@kite-copilot/chat-panel 0.2.55 → 0.2.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,52 +1,87 @@
1
- "use strict";var KiteChatEmbed=(()=>{var fP=Object.create;var Gu=Object.defineProperty;var pP=Object.getOwnPropertyDescriptor;var mP=Object.getOwnPropertyNames;var hP=Object.getPrototypeOf,gP=Object.prototype.hasOwnProperty;var yP=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,a)=>(typeof require<"u"?require:t)[a]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var xP=(e,t)=>()=>(e&&(t=e(e=0)),t);var tt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Cx=(e,t)=>{for(var a in t)Gu(e,a,{get:t[a],enumerable:!0})},Sx=(e,t,a,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of mP(t))!gP.call(e,o)&&o!==a&&Gu(e,o,{get:()=>t[o],enumerable:!(r=pP(t,o))||r.enumerable});return e};var F=(e,t,a)=>(a=e!=null?fP(hP(e)):{},Sx(t||!e||!e.__esModule?Gu(a,"default",{value:e,enumerable:!0}):a,e)),Lx=e=>Sx(Gu({},"__esModule",{value:!0}),e);var Nx=tt(oe=>{"use strict";var Ui=Symbol.for("react.element"),vP=Symbol.for("react.portal"),wP=Symbol.for("react.fragment"),CP=Symbol.for("react.strict_mode"),SP=Symbol.for("react.profiler"),LP=Symbol.for("react.provider"),bP=Symbol.for("react.context"),IP=Symbol.for("react.forward_ref"),kP=Symbol.for("react.suspense"),PP=Symbol.for("react.memo"),TP=Symbol.for("react.lazy"),bx=Symbol.iterator;function AP(e){return e===null||typeof e!="object"?null:(e=bx&&e[bx]||e["@@iterator"],typeof e=="function"?e:null)}var Px={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Tx=Object.assign,Ax={};function Un(e,t,a){this.props=e,this.context=t,this.refs=Ax,this.updater=a||Px}Un.prototype.isReactComponent={};Un.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")};Un.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Rx(){}Rx.prototype=Un.prototype;function Qp(e,t,a){this.props=e,this.context=t,this.refs=Ax,this.updater=a||Px}var Jp=Qp.prototype=new Rx;Jp.constructor=Qp;Tx(Jp,Un.prototype);Jp.isPureReactComponent=!0;var Ix=Array.isArray,_x=Object.prototype.hasOwnProperty,Yp={current:null},Ex={key:!0,ref:!0,__self:!0,__source:!0};function Dx(e,t,a){var r,o={},n=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(n=""+t.key),t)_x.call(t,r)&&!Ex.hasOwnProperty(r)&&(o[r]=t[r]);var i=arguments.length-2;if(i===1)o.children=a;else if(1<i){for(var l=Array(i),u=0;u<i;u++)l[u]=arguments[u+2];o.children=l}if(e&&e.defaultProps)for(r in i=e.defaultProps,i)o[r]===void 0&&(o[r]=i[r]);return{$$typeof:Ui,type:e,key:n,ref:s,props:o,_owner:Yp.current}}function RP(e,t){return{$$typeof:Ui,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Zp(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ui}function _P(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(a){return t[a]})}var kx=/\/+/g;function Xp(e,t){return typeof e=="object"&&e!==null&&e.key!=null?_P(""+e.key):t.toString(36)}function Xu(e,t,a,r,o){var n=typeof e;(n==="undefined"||n==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(n){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Ui:case vP:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+Xp(s,0):r,Ix(o)?(a="",e!=null&&(a=e.replace(kx,"$&/")+"/"),Xu(o,t,a,"",function(u){return u})):o!=null&&(Zp(o)&&(o=RP(o,a+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(kx,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",Ix(e))for(var i=0;i<e.length;i++){n=e[i];var l=r+Xp(n,i);s+=Xu(n,t,a,l,o)}else if(l=AP(e),typeof l=="function")for(e=l.call(e),i=0;!(n=e.next()).done;)n=n.value,l=r+Xp(n,i++),s+=Xu(n,t,a,l,o);else if(n==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function Ku(e,t,a){if(e==null)return e;var r=[],o=0;return Xu(e,r,"","",function(n){return t.call(a,n,o++)}),r}function EP(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(a){(e._status===0||e._status===-1)&&(e._status=1,e._result=a)},function(a){(e._status===0||e._status===-1)&&(e._status=2,e._result=a)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Pt={current:null},Qu={transition:null},DP={ReactCurrentDispatcher:Pt,ReactCurrentBatchConfig:Qu,ReactCurrentOwner:Yp};function Mx(){throw Error("act(...) is not supported in production builds of React.")}oe.Children={map:Ku,forEach:function(e,t,a){Ku(e,function(){t.apply(this,arguments)},a)},count:function(e){var t=0;return Ku(e,function(){t++}),t},toArray:function(e){return Ku(e,function(t){return t})||[]},only:function(e){if(!Zp(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};oe.Component=Un;oe.Fragment=wP;oe.Profiler=SP;oe.PureComponent=Qp;oe.StrictMode=CP;oe.Suspense=kP;oe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=DP;oe.act=Mx;oe.cloneElement=function(e,t,a){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Tx({},e.props),o=e.key,n=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(n=t.ref,s=Yp.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var i=e.type.defaultProps;for(l in t)_x.call(t,l)&&!Ex.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&i!==void 0?i[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=a;else if(1<l){i=Array(l);for(var u=0;u<l;u++)i[u]=arguments[u+2];r.children=i}return{$$typeof:Ui,type:e.type,key:o,ref:n,props:r,_owner:s}};oe.createContext=function(e){return e={$$typeof:bP,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:LP,_context:e},e.Consumer=e};oe.createElement=Dx;oe.createFactory=function(e){var t=Dx.bind(null,e);return t.type=e,t};oe.createRef=function(){return{current:null}};oe.forwardRef=function(e){return{$$typeof:IP,render:e}};oe.isValidElement=Zp;oe.lazy=function(e){return{$$typeof:TP,_payload:{_status:-1,_result:e},_init:EP}};oe.memo=function(e,t){return{$$typeof:PP,type:e,compare:t===void 0?null:t}};oe.startTransition=function(e){var t=Qu.transition;Qu.transition={};try{e()}finally{Qu.transition=t}};oe.unstable_act=Mx;oe.useCallback=function(e,t){return Pt.current.useCallback(e,t)};oe.useContext=function(e){return Pt.current.useContext(e)};oe.useDebugValue=function(){};oe.useDeferredValue=function(e){return Pt.current.useDeferredValue(e)};oe.useEffect=function(e,t){return Pt.current.useEffect(e,t)};oe.useId=function(){return Pt.current.useId()};oe.useImperativeHandle=function(e,t,a){return Pt.current.useImperativeHandle(e,t,a)};oe.useInsertionEffect=function(e,t){return Pt.current.useInsertionEffect(e,t)};oe.useLayoutEffect=function(e,t){return Pt.current.useLayoutEffect(e,t)};oe.useMemo=function(e,t){return Pt.current.useMemo(e,t)};oe.useReducer=function(e,t,a){return Pt.current.useReducer(e,t,a)};oe.useRef=function(e){return Pt.current.useRef(e)};oe.useState=function(e){return Pt.current.useState(e)};oe.useSyncExternalStore=function(e,t,a){return Pt.current.useSyncExternalStore(e,t,a)};oe.useTransition=function(){return Pt.current.useTransition()};oe.version="18.3.1"});var K=tt((bM,Ox)=>{"use strict";Ox.exports=Nx()});var Wx=tt(ve=>{"use strict";function rm(e,t){var a=e.length;e.push(t);e:for(;0<a;){var r=a-1>>>1,o=e[r];if(0<Ju(o,t))e[r]=t,e[a]=o,a=r;else break e}}function wa(e){return e.length===0?null:e[0]}function Zu(e){if(e.length===0)return null;var t=e[0],a=e.pop();if(a!==t){e[0]=a;e:for(var r=0,o=e.length,n=o>>>1;r<n;){var s=2*(r+1)-1,i=e[s],l=s+1,u=e[l];if(0>Ju(i,a))l<o&&0>Ju(u,i)?(e[r]=u,e[l]=a,r=l):(e[r]=i,e[s]=a,r=s);else if(l<o&&0>Ju(u,a))e[r]=u,e[l]=a,r=l;else break e}}return t}function Ju(e,t){var a=e.sortIndex-t.sortIndex;return a!==0?a:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(Fx=performance,ve.unstable_now=function(){return Fx.now()}):(em=Date,Bx=em.now(),ve.unstable_now=function(){return em.now()-Bx});var Fx,em,Bx,Na=[],Fr=[],MP=1,ua=null,gt=3,ed=!1,Mo=!1,ji=!1,jx=typeof setTimeout=="function"?setTimeout:null,qx=typeof clearTimeout=="function"?clearTimeout:null,Ux=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function om(e){for(var t=wa(Fr);t!==null;){if(t.callback===null)Zu(Fr);else if(t.startTime<=e)Zu(Fr),t.sortIndex=t.expirationTime,rm(Na,t);else break;t=wa(Fr)}}function nm(e){if(ji=!1,om(e),!Mo)if(wa(Na)!==null)Mo=!0,im(sm);else{var t=wa(Fr);t!==null&&lm(nm,t.startTime-e)}}function sm(e,t){Mo=!1,ji&&(ji=!1,qx(qi),qi=-1),ed=!0;var a=gt;try{for(om(t),ua=wa(Na);ua!==null&&(!(ua.expirationTime>t)||e&&!$x());){var r=ua.callback;if(typeof r=="function"){ua.callback=null,gt=ua.priorityLevel;var o=r(ua.expirationTime<=t);t=ve.unstable_now(),typeof o=="function"?ua.callback=o:ua===wa(Na)&&Zu(Na),om(t)}else Zu(Na);ua=wa(Na)}if(ua!==null)var n=!0;else{var s=wa(Fr);s!==null&&lm(nm,s.startTime-t),n=!1}return n}finally{ua=null,gt=a,ed=!1}}var td=!1,Yu=null,qi=-1,Hx=5,zx=-1;function $x(){return!(ve.unstable_now()-zx<Hx)}function tm(){if(Yu!==null){var e=ve.unstable_now();zx=e;var t=!0;try{t=Yu(!0,e)}finally{t?Vi():(td=!1,Yu=null)}}else td=!1}var Vi;typeof Ux=="function"?Vi=function(){Ux(tm)}:typeof MessageChannel<"u"?(am=new MessageChannel,Vx=am.port2,am.port1.onmessage=tm,Vi=function(){Vx.postMessage(null)}):Vi=function(){jx(tm,0)};var am,Vx;function im(e){Yu=e,td||(td=!0,Vi())}function lm(e,t){qi=jx(function(){e(ve.unstable_now())},t)}ve.unstable_IdlePriority=5;ve.unstable_ImmediatePriority=1;ve.unstable_LowPriority=4;ve.unstable_NormalPriority=3;ve.unstable_Profiling=null;ve.unstable_UserBlockingPriority=2;ve.unstable_cancelCallback=function(e){e.callback=null};ve.unstable_continueExecution=function(){Mo||ed||(Mo=!0,im(sm))};ve.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Hx=0<e?Math.floor(1e3/e):5};ve.unstable_getCurrentPriorityLevel=function(){return gt};ve.unstable_getFirstCallbackNode=function(){return wa(Na)};ve.unstable_next=function(e){switch(gt){case 1:case 2:case 3:var t=3;break;default:t=gt}var a=gt;gt=t;try{return e()}finally{gt=a}};ve.unstable_pauseExecution=function(){};ve.unstable_requestPaint=function(){};ve.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var a=gt;gt=e;try{return t()}finally{gt=a}};ve.unstable_scheduleCallback=function(e,t,a){var r=ve.unstable_now();switch(typeof a=="object"&&a!==null?(a=a.delay,a=typeof a=="number"&&0<a?r+a:r):a=r,e){case 1:var o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5e3}return o=a+o,e={id:MP++,callback:t,priorityLevel:e,startTime:a,expirationTime:o,sortIndex:-1},a>r?(e.sortIndex=a,rm(Fr,e),wa(Na)===null&&e===wa(Fr)&&(ji?(qx(qi),qi=-1):ji=!0,lm(nm,a-r))):(e.sortIndex=o,rm(Na,e),Mo||ed||(Mo=!0,im(sm))),e};ve.unstable_shouldYield=$x;ve.unstable_wrapCallback=function(e){var t=gt;return function(){var a=gt;gt=t;try{return e.apply(this,arguments)}finally{gt=a}}}});var Kx=tt((kM,Gx)=>{"use strict";Gx.exports=Wx()});var Yw=tt(Yt=>{"use strict";var NP=K(),Qt=Kx();function M(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,a=1;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var t0=new Set,dl={};function Go(e,t){ss(e,t),ss(e+"Capture",t)}function ss(e,t){for(dl[e]=t,e=0;e<t.length;e++)t0.add(t[e])}var fr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_m=Object.prototype.hasOwnProperty,OP=/^[: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]*$/,Xx={},Qx={};function FP(e){return _m.call(Qx,e)?!0:_m.call(Xx,e)?!1:OP.test(e)?Qx[e]=!0:(Xx[e]=!0,!1)}function BP(e,t,a,r){if(a!==null&&a.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:a!==null?!a.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function UP(e,t,a,r){if(t===null||typeof t>"u"||BP(e,t,a,r))return!0;if(r)return!1;if(a!==null)switch(a.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 Rt(e,t,a,r,o,n,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=a,this.propertyName=e,this.type=t,this.sanitizeURL=n,this.removeEmptyString=s}var ut={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ut[e]=new Rt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ut[t]=new Rt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ut[e]=new Rt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ut[e]=new Rt(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){ut[e]=new Rt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ut[e]=new Rt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ut[e]=new Rt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ut[e]=new Rt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ut[e]=new Rt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Lh=/[\-:]([a-z])/g;function bh(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(Lh,bh);ut[t]=new Rt(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(Lh,bh);ut[t]=new Rt(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(Lh,bh);ut[t]=new Rt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ut[e]=new Rt(e,1,!1,e.toLowerCase(),null,!1,!1)});ut.xlinkHref=new Rt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ut[e]=new Rt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ih(e,t,a,r){var o=ut.hasOwnProperty(t)?ut[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(UP(t,a,o,r)&&(a=null),r||o===null?FP(t)&&(a===null?e.removeAttribute(t):e.setAttribute(t,""+a)):o.mustUseProperty?e[o.propertyName]=a===null?o.type===3?!1:"":a:(t=o.attributeName,r=o.attributeNamespace,a===null?e.removeAttribute(t):(o=o.type,a=o===3||o===4&&a===!0?"":""+a,r?e.setAttributeNS(r,t,a):e.setAttribute(t,a))))}var gr=NP.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ad=Symbol.for("react.element"),qn=Symbol.for("react.portal"),Hn=Symbol.for("react.fragment"),kh=Symbol.for("react.strict_mode"),Em=Symbol.for("react.profiler"),a0=Symbol.for("react.provider"),r0=Symbol.for("react.context"),Ph=Symbol.for("react.forward_ref"),Dm=Symbol.for("react.suspense"),Mm=Symbol.for("react.suspense_list"),Th=Symbol.for("react.memo"),Ur=Symbol.for("react.lazy"),o0=Symbol.for("react.offscreen"),Jx=Symbol.iterator;function Hi(e){return e===null||typeof e!="object"?null:(e=Jx&&e[Jx]||e["@@iterator"],typeof e=="function"?e:null)}var Ne=Object.assign,um;function Ji(e){if(um===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);um=t&&t[1]||""}return`
2
- `+um+e}var dm=!1;function cm(e,t){if(!e||dm)return"";dm=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var o=u.stack.split(`
3
- `),n=r.stack.split(`
1
+ "use strict";var KiteChatEmbed=(()=>{var eP=Object.create;var $u=Object.defineProperty;var tP=Object.getOwnPropertyDescriptor;var rP=Object.getOwnPropertyNames;var aP=Object.getPrototypeOf,oP=Object.prototype.hasOwnProperty;var nP=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var pa=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),sP=(e,t)=>{for(var r in t)$u(e,r,{get:t[r],enumerable:!0})},yv=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of rP(t))!oP.call(e,o)&&o!==r&&$u(e,o,{get:()=>t[o],enumerable:!(a=tP(t,o))||a.enumerable});return e};var B=(e,t,r)=>(r=e!=null?eP(aP(e)):{},yv(t||!e||!e.__esModule?$u(r,"default",{value:e,enumerable:!0}):r,e)),iP=e=>yv($u({},"__esModule",{value:!0}),e);var _v=pa(oe=>{"use strict";var Hi=Symbol.for("react.element"),lP=Symbol.for("react.portal"),uP=Symbol.for("react.fragment"),cP=Symbol.for("react.strict_mode"),dP=Symbol.for("react.profiler"),fP=Symbol.for("react.provider"),pP=Symbol.for("react.context"),hP=Symbol.for("react.forward_ref"),mP=Symbol.for("react.suspense"),gP=Symbol.for("react.memo"),yP=Symbol.for("react.lazy"),vv=Symbol.iterator;function vP(e){return e===null||typeof e!="object"?null:(e=vv&&e[vv]||e["@@iterator"],typeof e=="function"?e:null)}var Sv={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Cv=Object.assign,bv={};function Wn(e,t,r){this.props=e,this.context=t,this.refs=bv,this.updater=r||Sv}Wn.prototype.isReactComponent={};Wn.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")};Wn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Lv(){}Lv.prototype=Wn.prototype;function Hp(e,t,r){this.props=e,this.context=t,this.refs=bv,this.updater=r||Sv}var zp=Hp.prototype=new Lv;zp.constructor=Hp;Cv(zp,Wn.prototype);zp.isPureReactComponent=!0;var xv=Array.isArray,Iv=Object.prototype.hasOwnProperty,Wp={current:null},kv={key:!0,ref:!0,__self:!0,__source:!0};function Pv(e,t,r){var a,o={},n=null,s=null;if(t!=null)for(a in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(n=""+t.key),t)Iv.call(t,a)&&!kv.hasOwnProperty(a)&&(o[a]=t[a]);var i=arguments.length-2;if(i===1)o.children=r;else if(1<i){for(var l=Array(i),u=0;u<i;u++)l[u]=arguments[u+2];o.children=l}if(e&&e.defaultProps)for(a in i=e.defaultProps,i)o[a]===void 0&&(o[a]=i[a]);return{$$typeof:Hi,type:e,key:n,ref:s,props:o,_owner:Wp.current}}function xP(e,t){return{$$typeof:Hi,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Gp(e){return typeof e=="object"&&e!==null&&e.$$typeof===Hi}function wP(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var wv=/\/+/g;function $p(e,t){return typeof e=="object"&&e!==null&&e.key!=null?wP(""+e.key):t.toString(36)}function zu(e,t,r,a,o){var n=typeof e;(n==="undefined"||n==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(n){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Hi:case lP:s=!0}}if(s)return s=e,o=o(s),e=a===""?"."+$p(s,0):a,xv(o)?(r="",e!=null&&(r=e.replace(wv,"$&/")+"/"),zu(o,t,r,"",function(u){return u})):o!=null&&(Gp(o)&&(o=xP(o,r+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(wv,"$&/")+"/")+e)),t.push(o)),1;if(s=0,a=a===""?".":a+":",xv(e))for(var i=0;i<e.length;i++){n=e[i];var l=a+$p(n,i);s+=zu(n,t,r,l,o)}else if(l=vP(e),typeof l=="function")for(e=l.call(e),i=0;!(n=e.next()).done;)n=n.value,l=a+$p(n,i++),s+=zu(n,t,r,l,o);else if(n==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function Hu(e,t,r){if(e==null)return e;var a=[],o=0;return zu(e,a,"","",function(n){return t.call(r,n,o++)}),a}function SP(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Et={current:null},Wu={transition:null},CP={ReactCurrentDispatcher:Et,ReactCurrentBatchConfig:Wu,ReactCurrentOwner:Wp};function Tv(){throw Error("act(...) is not supported in production builds of React.")}oe.Children={map:Hu,forEach:function(e,t,r){Hu(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return Hu(e,function(){t++}),t},toArray:function(e){return Hu(e,function(t){return t})||[]},only:function(e){if(!Gp(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};oe.Component=Wn;oe.Fragment=uP;oe.Profiler=dP;oe.PureComponent=Hp;oe.StrictMode=cP;oe.Suspense=mP;oe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=CP;oe.act=Tv;oe.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var a=Cv({},e.props),o=e.key,n=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(n=t.ref,s=Wp.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var i=e.type.defaultProps;for(l in t)Iv.call(t,l)&&!kv.hasOwnProperty(l)&&(a[l]=t[l]===void 0&&i!==void 0?i[l]:t[l])}var l=arguments.length-2;if(l===1)a.children=r;else if(1<l){i=Array(l);for(var u=0;u<l;u++)i[u]=arguments[u+2];a.children=i}return{$$typeof:Hi,type:e.type,key:o,ref:n,props:a,_owner:s}};oe.createContext=function(e){return e={$$typeof:pP,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:fP,_context:e},e.Consumer=e};oe.createElement=Pv;oe.createFactory=function(e){var t=Pv.bind(null,e);return t.type=e,t};oe.createRef=function(){return{current:null}};oe.forwardRef=function(e){return{$$typeof:hP,render:e}};oe.isValidElement=Gp;oe.lazy=function(e){return{$$typeof:yP,_payload:{_status:-1,_result:e},_init:SP}};oe.memo=function(e,t){return{$$typeof:gP,type:e,compare:t===void 0?null:t}};oe.startTransition=function(e){var t=Wu.transition;Wu.transition={};try{e()}finally{Wu.transition=t}};oe.unstable_act=Tv;oe.useCallback=function(e,t){return Et.current.useCallback(e,t)};oe.useContext=function(e){return Et.current.useContext(e)};oe.useDebugValue=function(){};oe.useDeferredValue=function(e){return Et.current.useDeferredValue(e)};oe.useEffect=function(e,t){return Et.current.useEffect(e,t)};oe.useId=function(){return Et.current.useId()};oe.useImperativeHandle=function(e,t,r){return Et.current.useImperativeHandle(e,t,r)};oe.useInsertionEffect=function(e,t){return Et.current.useInsertionEffect(e,t)};oe.useLayoutEffect=function(e,t){return Et.current.useLayoutEffect(e,t)};oe.useMemo=function(e,t){return Et.current.useMemo(e,t)};oe.useReducer=function(e,t,r){return Et.current.useReducer(e,t,r)};oe.useRef=function(e){return Et.current.useRef(e)};oe.useState=function(e){return Et.current.useState(e)};oe.useSyncExternalStore=function(e,t,r){return Et.current.useSyncExternalStore(e,t,r)};oe.useTransition=function(){return Et.current.useTransition()};oe.version="18.3.1"});var Q=pa((HN,Av)=>{"use strict";Av.exports=_v()});var Vv=pa(Ce=>{"use strict";function Qp(e,t){var r=e.length;e.push(t);e:for(;0<r;){var a=r-1>>>1,o=e[a];if(0<Gu(o,t))e[a]=t,e[r]=o,r=a;else break e}}function kr(e){return e.length===0?null:e[0]}function Xu(e){if(e.length===0)return null;var t=e[0],r=e.pop();if(r!==t){e[0]=r;e:for(var a=0,o=e.length,n=o>>>1;a<n;){var s=2*(a+1)-1,i=e[s],l=s+1,u=e[l];if(0>Gu(i,r))l<o&&0>Gu(u,i)?(e[a]=u,e[l]=r,a=l):(e[a]=i,e[s]=r,a=s);else if(l<o&&0>Gu(u,r))e[a]=u,e[l]=r,a=l;else break e}}return t}function Gu(e,t){var r=e.sortIndex-t.sortIndex;return r!==0?r:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(Rv=performance,Ce.unstable_now=function(){return Rv.now()}):(Kp=Date,Ev=Kp.now(),Ce.unstable_now=function(){return Kp.now()-Ev});var Rv,Kp,Ev,$r=[],za=[],bP=1,mr=null,Ct=3,Ju=!1,Ho=!1,Wi=!1,Mv=typeof setTimeout=="function"?setTimeout:null,Ov=typeof clearTimeout=="function"?clearTimeout:null,Dv=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function Yp(e){for(var t=kr(za);t!==null;){if(t.callback===null)Xu(za);else if(t.startTime<=e)Xu(za),t.sortIndex=t.expirationTime,Qp($r,t);else break;t=kr(za)}}function Zp(e){if(Wi=!1,Yp(e),!Ho)if(kr($r)!==null)Ho=!0,th(eh);else{var t=kr(za);t!==null&&rh(Zp,t.startTime-e)}}function eh(e,t){Ho=!1,Wi&&(Wi=!1,Ov(Gi),Gi=-1),Ju=!0;var r=Ct;try{for(Yp(t),mr=kr($r);mr!==null&&(!(mr.expirationTime>t)||e&&!Uv());){var a=mr.callback;if(typeof a=="function"){mr.callback=null,Ct=mr.priorityLevel;var o=a(mr.expirationTime<=t);t=Ce.unstable_now(),typeof o=="function"?mr.callback=o:mr===kr($r)&&Xu($r),Yp(t)}else Xu($r);mr=kr($r)}if(mr!==null)var n=!0;else{var s=kr(za);s!==null&&rh(Zp,s.startTime-t),n=!1}return n}finally{mr=null,Ct=r,Ju=!1}}var Qu=!1,Ku=null,Gi=-1,Bv=5,Fv=-1;function Uv(){return!(Ce.unstable_now()-Fv<Bv)}function Xp(){if(Ku!==null){var e=Ce.unstable_now();Fv=e;var t=!0;try{t=Ku(!0,e)}finally{t?zi():(Qu=!1,Ku=null)}}else Qu=!1}var zi;typeof Dv=="function"?zi=function(){Dv(Xp)}:typeof MessageChannel<"u"?(Jp=new MessageChannel,Nv=Jp.port2,Jp.port1.onmessage=Xp,zi=function(){Nv.postMessage(null)}):zi=function(){Mv(Xp,0)};var Jp,Nv;function th(e){Ku=e,Qu||(Qu=!0,zi())}function rh(e,t){Gi=Mv(function(){e(Ce.unstable_now())},t)}Ce.unstable_IdlePriority=5;Ce.unstable_ImmediatePriority=1;Ce.unstable_LowPriority=4;Ce.unstable_NormalPriority=3;Ce.unstable_Profiling=null;Ce.unstable_UserBlockingPriority=2;Ce.unstable_cancelCallback=function(e){e.callback=null};Ce.unstable_continueExecution=function(){Ho||Ju||(Ho=!0,th(eh))};Ce.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Bv=0<e?Math.floor(1e3/e):5};Ce.unstable_getCurrentPriorityLevel=function(){return Ct};Ce.unstable_getFirstCallbackNode=function(){return kr($r)};Ce.unstable_next=function(e){switch(Ct){case 1:case 2:case 3:var t=3;break;default:t=Ct}var r=Ct;Ct=t;try{return e()}finally{Ct=r}};Ce.unstable_pauseExecution=function(){};Ce.unstable_requestPaint=function(){};Ce.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=Ct;Ct=e;try{return t()}finally{Ct=r}};Ce.unstable_scheduleCallback=function(e,t,r){var a=Ce.unstable_now();switch(typeof r=="object"&&r!==null?(r=r.delay,r=typeof r=="number"&&0<r?a+r:a):r=a,e){case 1:var o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5e3}return o=r+o,e={id:bP++,callback:t,priorityLevel:e,startTime:r,expirationTime:o,sortIndex:-1},r>a?(e.sortIndex=r,Qp(za,e),kr($r)===null&&e===kr(za)&&(Wi?(Ov(Gi),Gi=-1):Wi=!0,rh(Zp,r-a))):(e.sortIndex=o,Qp($r,e),Ho||Ju||(Ho=!0,th(eh))),e};Ce.unstable_shouldYield=Uv;Ce.unstable_wrapCallback=function(e){var t=Ct;return function(){var r=Ct;Ct=t;try{return e.apply(this,arguments)}finally{Ct=r}}}});var qv=pa((WN,jv)=>{"use strict";jv.exports=Vv()});var Ww=pa(tr=>{"use strict";var LP=Q(),Zt=qv();function N(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Xx=new Set,ml={};function an(e,t){ps(e,t),ps(e+"Capture",t)}function ps(e,t){for(ml[e]=t,e=0;e<t.length;e++)Xx.add(t[e])}var xa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ih=Object.prototype.hasOwnProperty,IP=/^[: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]*$/,$v={},Hv={};function kP(e){return Ih.call(Hv,e)?!0:Ih.call($v,e)?!1:IP.test(e)?Hv[e]=!0:($v[e]=!0,!1)}function PP(e,t,r,a){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return a?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function TP(e,t,r,a){if(t===null||typeof t>"u"||PP(e,t,r,a))return!0;if(a)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 Mt(e,t,r,a,o,n,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=a,this.attributeNamespace=o,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=n,this.removeEmptyString=s}var gt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){gt[e]=new Mt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];gt[t]=new Mt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){gt[e]=new Mt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){gt[e]=new Mt(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){gt[e]=new Mt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){gt[e]=new Mt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){gt[e]=new Mt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){gt[e]=new Mt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){gt[e]=new Mt(e,5,!1,e.toLowerCase(),null,!1,!1)});var ym=/[\-:]([a-z])/g;function vm(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(ym,vm);gt[t]=new Mt(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(ym,vm);gt[t]=new Mt(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(ym,vm);gt[t]=new Mt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){gt[e]=new Mt(e,1,!1,e.toLowerCase(),null,!1,!1)});gt.xlinkHref=new Mt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){gt[e]=new Mt(e,1,!1,e.toLowerCase(),null,!0,!0)});function xm(e,t,r,a){var o=gt.hasOwnProperty(t)?gt[t]:null;(o!==null?o.type!==0:a||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(TP(t,r,o,a)&&(r=null),a||o===null?kP(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):o.mustUseProperty?e[o.propertyName]=r===null?o.type===3?!1:"":r:(t=o.attributeName,a=o.attributeNamespace,r===null?e.removeAttribute(t):(o=o.type,r=o===3||o===4&&r===!0?"":""+r,a?e.setAttributeNS(a,t,r):e.setAttribute(t,r))))}var ba=LP.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Yu=Symbol.for("react.element"),Xn=Symbol.for("react.portal"),Jn=Symbol.for("react.fragment"),wm=Symbol.for("react.strict_mode"),kh=Symbol.for("react.profiler"),Jx=Symbol.for("react.provider"),Qx=Symbol.for("react.context"),Sm=Symbol.for("react.forward_ref"),Ph=Symbol.for("react.suspense"),Th=Symbol.for("react.suspense_list"),Cm=Symbol.for("react.memo"),Ga=Symbol.for("react.lazy"),Yx=Symbol.for("react.offscreen"),zv=Symbol.iterator;function Ki(e){return e===null||typeof e!="object"?null:(e=zv&&e[zv]||e["@@iterator"],typeof e=="function"?e:null)}var Be=Object.assign,ah;function rl(e){if(ah===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);ah=t&&t[1]||""}return`
2
+ `+ah+e}var oh=!1;function nh(e,t){if(!e||oh)return"";oh=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var a=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){a=u}e.call(t.prototype)}else{try{throw Error()}catch(u){a=u}e()}}catch(u){if(u&&a&&typeof u.stack=="string"){for(var o=u.stack.split(`
3
+ `),n=a.stack.split(`
4
4
  `),s=o.length-1,i=n.length-1;1<=s&&0<=i&&o[s]!==n[i];)i--;for(;1<=s&&0<=i;s--,i--)if(o[s]!==n[i]){if(s!==1||i!==1)do if(s--,i--,0>i||o[s]!==n[i]){var l=`
5
- `+o[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=s&&0<=i);break}}}finally{dm=!1,Error.prepareStackTrace=a}return(e=e?e.displayName||e.name:"")?Ji(e):""}function VP(e){switch(e.tag){case 5:return Ji(e.type);case 16:return Ji("Lazy");case 13:return Ji("Suspense");case 19:return Ji("SuspenseList");case 0:case 2:case 15:return e=cm(e.type,!1),e;case 11:return e=cm(e.type.render,!1),e;case 1:return e=cm(e.type,!0),e;default:return""}}function Nm(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 Hn:return"Fragment";case qn:return"Portal";case Em:return"Profiler";case kh:return"StrictMode";case Dm:return"Suspense";case Mm:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case r0:return(e.displayName||"Context")+".Consumer";case a0:return(e._context.displayName||"Context")+".Provider";case Ph:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Th:return t=e.displayName||null,t!==null?t:Nm(e.type)||"Memo";case Ur:t=e._payload,e=e._init;try{return Nm(e(t))}catch{}}return null}function jP(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 Nm(t);case 8:return t===kh?"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 Zr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function n0(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function qP(e){var t=n0(e)?"checked":"value",a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var o=a.get,n=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,n.call(this,s)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function rd(e){e._valueTracker||(e._valueTracker=qP(e))}function s0(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),r="";return e&&(r=n0(e)?e.checked?"true":"false":e.value),e=r,e!==a?(t.setValue(e),!0):!1}function _d(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 Om(e,t){var a=t.checked;return Ne({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:a??e._wrapperState.initialChecked})}function Yx(e,t){var a=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;a=Zr(t.value!=null?t.value:a),e._wrapperState={initialChecked:r,initialValue:a,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function i0(e,t){t=t.checked,t!=null&&Ih(e,"checked",t,!1)}function Fm(e,t){i0(e,t);var a=Zr(t.value),r=t.type;if(a!=null)r==="number"?(a===0&&e.value===""||e.value!=a)&&(e.value=""+a):e.value!==""+a&&(e.value=""+a);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Bm(e,t.type,a):t.hasOwnProperty("defaultValue")&&Bm(e,t.type,Zr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Zx(e,t,a){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,a||t===e.value||(e.value=t),e.defaultValue=t}a=e.name,a!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,a!==""&&(e.name=a)}function Bm(e,t,a){(t!=="number"||_d(e.ownerDocument)!==e)&&(a==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+a&&(e.defaultValue=""+a))}var Yi=Array.isArray;function es(e,t,a,r){if(e=e.options,t){t={};for(var o=0;o<a.length;o++)t["$"+a[o]]=!0;for(a=0;a<e.length;a++)o=t.hasOwnProperty("$"+e[a].value),e[a].selected!==o&&(e[a].selected=o),o&&r&&(e[a].defaultSelected=!0)}else{for(a=""+Zr(a),t=null,o=0;o<e.length;o++){if(e[o].value===a){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Um(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(M(91));return Ne({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ev(e,t){var a=t.value;if(a==null){if(a=t.children,t=t.defaultValue,a!=null){if(t!=null)throw Error(M(92));if(Yi(a)){if(1<a.length)throw Error(M(93));a=a[0]}t=a}t==null&&(t=""),a=t}e._wrapperState={initialValue:Zr(a)}}function l0(e,t){var a=Zr(t.value),r=Zr(t.defaultValue);a!=null&&(a=""+a,a!==e.value&&(e.value=a),t.defaultValue==null&&e.defaultValue!==a&&(e.defaultValue=a)),r!=null&&(e.defaultValue=""+r)}function tv(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function u0(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Vm(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?u0(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var od,d0=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,a,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,a,r,o)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(od=od||document.createElement("div"),od.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=od.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function cl(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var tl={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},HP=["Webkit","ms","Moz","O"];Object.keys(tl).forEach(function(e){HP.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),tl[t]=tl[e]})});function c0(e,t,a){return t==null||typeof t=="boolean"||t===""?"":a||typeof t!="number"||t===0||tl.hasOwnProperty(e)&&tl[e]?(""+t).trim():t+"px"}function f0(e,t){e=e.style;for(var a in t)if(t.hasOwnProperty(a)){var r=a.indexOf("--")===0,o=c0(a,t[a],r);a==="float"&&(a="cssFloat"),r?e.setProperty(a,o):e[a]=o}}var zP=Ne({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 jm(e,t){if(t){if(zP[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(M(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(M(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(M(61))}if(t.style!=null&&typeof t.style!="object")throw Error(M(62))}}function qm(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 Hm=null;function Ah(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var zm=null,ts=null,as=null;function av(e){if(e=Al(e)){if(typeof zm!="function")throw Error(M(280));var t=e.stateNode;t&&(t=nc(t),zm(e.stateNode,e.type,t))}}function p0(e){ts?as?as.push(e):as=[e]:ts=e}function m0(){if(ts){var e=ts,t=as;if(as=ts=null,av(e),t)for(e=0;e<t.length;e++)av(t[e])}}function h0(e,t){return e(t)}function g0(){}var fm=!1;function y0(e,t,a){if(fm)return e(t,a);fm=!0;try{return h0(e,t,a)}finally{fm=!1,(ts!==null||as!==null)&&(g0(),m0())}}function fl(e,t){var a=e.stateNode;if(a===null)return null;var r=nc(a);if(r===null)return null;a=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(M(231,t,typeof a));return a}var $m=!1;if(fr)try{Vn={},Object.defineProperty(Vn,"passive",{get:function(){$m=!0}}),window.addEventListener("test",Vn,Vn),window.removeEventListener("test",Vn,Vn)}catch{$m=!1}var Vn;function $P(e,t,a,r,o,n,s,i,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(a,u)}catch(d){this.onError(d)}}var al=!1,Ed=null,Dd=!1,Wm=null,WP={onError:function(e){al=!0,Ed=e}};function GP(e,t,a,r,o,n,s,i,l){al=!1,Ed=null,$P.apply(WP,arguments)}function KP(e,t,a,r,o,n,s,i,l){if(GP.apply(this,arguments),al){if(al){var u=Ed;al=!1,Ed=null}else throw Error(M(198));Dd||(Dd=!0,Wm=u)}}function Ko(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function x0(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function rv(e){if(Ko(e)!==e)throw Error(M(188))}function XP(e){var t=e.alternate;if(!t){if(t=Ko(e),t===null)throw Error(M(188));return t!==e?null:e}for(var a=e,r=t;;){var o=a.return;if(o===null)break;var n=o.alternate;if(n===null){if(r=o.return,r!==null){a=r;continue}break}if(o.child===n.child){for(n=o.child;n;){if(n===a)return rv(o),e;if(n===r)return rv(o),t;n=n.sibling}throw Error(M(188))}if(a.return!==r.return)a=o,r=n;else{for(var s=!1,i=o.child;i;){if(i===a){s=!0,a=o,r=n;break}if(i===r){s=!0,r=o,a=n;break}i=i.sibling}if(!s){for(i=n.child;i;){if(i===a){s=!0,a=n,r=o;break}if(i===r){s=!0,r=n,a=o;break}i=i.sibling}if(!s)throw Error(M(189))}}if(a.alternate!==r)throw Error(M(190))}if(a.tag!==3)throw Error(M(188));return a.stateNode.current===a?e:t}function v0(e){return e=XP(e),e!==null?w0(e):null}function w0(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=w0(e);if(t!==null)return t;e=e.sibling}return null}var C0=Qt.unstable_scheduleCallback,ov=Qt.unstable_cancelCallback,QP=Qt.unstable_shouldYield,JP=Qt.unstable_requestPaint,qe=Qt.unstable_now,YP=Qt.unstable_getCurrentPriorityLevel,Rh=Qt.unstable_ImmediatePriority,S0=Qt.unstable_UserBlockingPriority,Md=Qt.unstable_NormalPriority,ZP=Qt.unstable_LowPriority,L0=Qt.unstable_IdlePriority,tc=null,Ua=null;function eT(e){if(Ua&&typeof Ua.onCommitFiberRoot=="function")try{Ua.onCommitFiberRoot(tc,e,void 0,(e.current.flags&128)===128)}catch{}}var Ia=Math.clz32?Math.clz32:rT,tT=Math.log,aT=Math.LN2;function rT(e){return e>>>=0,e===0?32:31-(tT(e)/aT|0)|0}var nd=64,sd=4194304;function Zi(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 Nd(e,t){var a=e.pendingLanes;if(a===0)return 0;var r=0,o=e.suspendedLanes,n=e.pingedLanes,s=a&268435455;if(s!==0){var i=s&~o;i!==0?r=Zi(i):(n&=s,n!==0&&(r=Zi(n)))}else s=a&~o,s!==0?r=Zi(s):n!==0&&(r=Zi(n));if(r===0)return 0;if(t!==0&&t!==r&&(t&o)===0&&(o=r&-r,n=t&-t,o>=n||o===16&&(n&4194240)!==0))return t;if((r&4)!==0&&(r|=a&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)a=31-Ia(t),o=1<<a,r|=e[a],t&=~o;return r}function oT(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function nT(e,t){for(var a=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,n=e.pendingLanes;0<n;){var s=31-Ia(n),i=1<<s,l=o[s];l===-1?((i&a)===0||(i&r)!==0)&&(o[s]=oT(i,t)):l<=t&&(e.expiredLanes|=i),n&=~i}}function Gm(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function b0(){var e=nd;return nd<<=1,(nd&4194240)===0&&(nd=64),e}function pm(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Pl(e,t,a){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ia(t),e[t]=a}function sT(e,t){var a=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<a;){var o=31-Ia(a),n=1<<o;t[o]=0,r[o]=-1,e[o]=-1,a&=~n}}function _h(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var r=31-Ia(a),o=1<<r;o&t|e[r]&t&&(e[r]|=t),a&=~o}}var he=0;function I0(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var k0,Eh,P0,T0,A0,Km=!1,id=[],$r=null,Wr=null,Gr=null,pl=new Map,ml=new Map,jr=[],iT="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function nv(e,t){switch(e){case"focusin":case"focusout":$r=null;break;case"dragenter":case"dragleave":Wr=null;break;case"mouseover":case"mouseout":Gr=null;break;case"pointerover":case"pointerout":pl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ml.delete(t.pointerId)}}function zi(e,t,a,r,o,n){return e===null||e.nativeEvent!==n?(e={blockedOn:t,domEventName:a,eventSystemFlags:r,nativeEvent:n,targetContainers:[o]},t!==null&&(t=Al(t),t!==null&&Eh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function lT(e,t,a,r,o){switch(t){case"focusin":return $r=zi($r,e,t,a,r,o),!0;case"dragenter":return Wr=zi(Wr,e,t,a,r,o),!0;case"mouseover":return Gr=zi(Gr,e,t,a,r,o),!0;case"pointerover":var n=o.pointerId;return pl.set(n,zi(pl.get(n)||null,e,t,a,r,o)),!0;case"gotpointercapture":return n=o.pointerId,ml.set(n,zi(ml.get(n)||null,e,t,a,r,o)),!0}return!1}function R0(e){var t=Fo(e.target);if(t!==null){var a=Ko(t);if(a!==null){if(t=a.tag,t===13){if(t=x0(a),t!==null){e.blockedOn=t,A0(e.priority,function(){P0(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Cd(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Xm(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(a===null){a=e.nativeEvent;var r=new a.constructor(a.type,a);Hm=r,a.target.dispatchEvent(r),Hm=null}else return t=Al(a),t!==null&&Eh(t),e.blockedOn=a,!1;t.shift()}return!0}function sv(e,t,a){Cd(e)&&a.delete(t)}function uT(){Km=!1,$r!==null&&Cd($r)&&($r=null),Wr!==null&&Cd(Wr)&&(Wr=null),Gr!==null&&Cd(Gr)&&(Gr=null),pl.forEach(sv),ml.forEach(sv)}function $i(e,t){e.blockedOn===t&&(e.blockedOn=null,Km||(Km=!0,Qt.unstable_scheduleCallback(Qt.unstable_NormalPriority,uT)))}function hl(e){function t(o){return $i(o,e)}if(0<id.length){$i(id[0],e);for(var a=1;a<id.length;a++){var r=id[a];r.blockedOn===e&&(r.blockedOn=null)}}for($r!==null&&$i($r,e),Wr!==null&&$i(Wr,e),Gr!==null&&$i(Gr,e),pl.forEach(t),ml.forEach(t),a=0;a<jr.length;a++)r=jr[a],r.blockedOn===e&&(r.blockedOn=null);for(;0<jr.length&&(a=jr[0],a.blockedOn===null);)R0(a),a.blockedOn===null&&jr.shift()}var rs=gr.ReactCurrentBatchConfig,Od=!0;function dT(e,t,a,r){var o=he,n=rs.transition;rs.transition=null;try{he=1,Dh(e,t,a,r)}finally{he=o,rs.transition=n}}function cT(e,t,a,r){var o=he,n=rs.transition;rs.transition=null;try{he=4,Dh(e,t,a,r)}finally{he=o,rs.transition=n}}function Dh(e,t,a,r){if(Od){var o=Xm(e,t,a,r);if(o===null)wm(e,t,r,Fd,a),nv(e,r);else if(lT(o,e,t,a,r))r.stopPropagation();else if(nv(e,r),t&4&&-1<iT.indexOf(e)){for(;o!==null;){var n=Al(o);if(n!==null&&k0(n),n=Xm(e,t,a,r),n===null&&wm(e,t,r,Fd,a),n===o)break;o=n}o!==null&&r.stopPropagation()}else wm(e,t,r,null,a)}}var Fd=null;function Xm(e,t,a,r){if(Fd=null,e=Ah(r),e=Fo(e),e!==null)if(t=Ko(e),t===null)e=null;else if(a=t.tag,a===13){if(e=x0(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Fd=e,null}function _0(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(YP()){case Rh:return 1;case S0:return 4;case Md:case ZP:return 16;case L0:return 536870912;default:return 16}default:return 16}}var Hr=null,Mh=null,Sd=null;function E0(){if(Sd)return Sd;var e,t=Mh,a=t.length,r,o="value"in Hr?Hr.value:Hr.textContent,n=o.length;for(e=0;e<a&&t[e]===o[e];e++);var s=a-e;for(r=1;r<=s&&t[a-r]===o[n-r];r++);return Sd=o.slice(e,1<r?1-r:void 0)}function Ld(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function ld(){return!0}function iv(){return!1}function Jt(e){function t(a,r,o,n,s){this._reactName=a,this._targetInst=o,this.type=r,this.nativeEvent=n,this.target=s,this.currentTarget=null;for(var i in e)e.hasOwnProperty(i)&&(a=e[i],this[i]=a?a(n):n[i]);return this.isDefaultPrevented=(n.defaultPrevented!=null?n.defaultPrevented:n.returnValue===!1)?ld:iv,this.isPropagationStopped=iv,this}return Ne(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=ld)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=ld)},persist:function(){},isPersistent:ld}),t}var ps={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Nh=Jt(ps),Tl=Ne({},ps,{view:0,detail:0}),fT=Jt(Tl),mm,hm,Wi,ac=Ne({},Tl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Oh,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Wi&&(Wi&&e.type==="mousemove"?(mm=e.screenX-Wi.screenX,hm=e.screenY-Wi.screenY):hm=mm=0,Wi=e),mm)},movementY:function(e){return"movementY"in e?e.movementY:hm}}),lv=Jt(ac),pT=Ne({},ac,{dataTransfer:0}),mT=Jt(pT),hT=Ne({},Tl,{relatedTarget:0}),gm=Jt(hT),gT=Ne({},ps,{animationName:0,elapsedTime:0,pseudoElement:0}),yT=Jt(gT),xT=Ne({},ps,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),vT=Jt(xT),wT=Ne({},ps,{data:0}),uv=Jt(wT),CT={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ST={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},LT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function bT(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=LT[e])?!!t[e]:!1}function Oh(){return bT}var IT=Ne({},Tl,{key:function(e){if(e.key){var t=CT[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ld(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?ST[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Oh,charCode:function(e){return e.type==="keypress"?Ld(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ld(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),kT=Jt(IT),PT=Ne({},ac,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),dv=Jt(PT),TT=Ne({},Tl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Oh}),AT=Jt(TT),RT=Ne({},ps,{propertyName:0,elapsedTime:0,pseudoElement:0}),_T=Jt(RT),ET=Ne({},ac,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),DT=Jt(ET),MT=[9,13,27,32],Fh=fr&&"CompositionEvent"in window,rl=null;fr&&"documentMode"in document&&(rl=document.documentMode);var NT=fr&&"TextEvent"in window&&!rl,D0=fr&&(!Fh||rl&&8<rl&&11>=rl),cv=" ",fv=!1;function M0(e,t){switch(e){case"keyup":return MT.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function N0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var zn=!1;function OT(e,t){switch(e){case"compositionend":return N0(t);case"keypress":return t.which!==32?null:(fv=!0,cv);case"textInput":return e=t.data,e===cv&&fv?null:e;default:return null}}function FT(e,t){if(zn)return e==="compositionend"||!Fh&&M0(e,t)?(e=E0(),Sd=Mh=Hr=null,zn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return D0&&t.locale!=="ko"?null:t.data;default:return null}}var BT={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function pv(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!BT[e.type]:t==="textarea"}function O0(e,t,a,r){p0(r),t=Bd(t,"onChange"),0<t.length&&(a=new Nh("onChange","change",null,a,r),e.push({event:a,listeners:t}))}var ol=null,gl=null;function UT(e){G0(e,0)}function rc(e){var t=Gn(e);if(s0(t))return e}function VT(e,t){if(e==="change")return t}var F0=!1;fr&&(fr?(dd="oninput"in document,dd||(ym=document.createElement("div"),ym.setAttribute("oninput","return;"),dd=typeof ym.oninput=="function"),ud=dd):ud=!1,F0=ud&&(!document.documentMode||9<document.documentMode));var ud,dd,ym;function mv(){ol&&(ol.detachEvent("onpropertychange",B0),gl=ol=null)}function B0(e){if(e.propertyName==="value"&&rc(gl)){var t=[];O0(t,gl,e,Ah(e)),y0(UT,t)}}function jT(e,t,a){e==="focusin"?(mv(),ol=t,gl=a,ol.attachEvent("onpropertychange",B0)):e==="focusout"&&mv()}function qT(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return rc(gl)}function HT(e,t){if(e==="click")return rc(t)}function zT(e,t){if(e==="input"||e==="change")return rc(t)}function $T(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Pa=typeof Object.is=="function"?Object.is:$T;function yl(e,t){if(Pa(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),r=Object.keys(t);if(a.length!==r.length)return!1;for(r=0;r<a.length;r++){var o=a[r];if(!_m.call(t,o)||!Pa(e[o],t[o]))return!1}return!0}function hv(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function gv(e,t){var a=hv(e);e=0;for(var r;a;){if(a.nodeType===3){if(r=e+a.textContent.length,e<=t&&r>=t)return{node:a,offset:t-e};e=r}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=hv(a)}}function U0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?U0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function V0(){for(var e=window,t=_d();t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=_d(e.document)}return t}function Bh(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 WT(e){var t=V0(),a=e.focusedElem,r=e.selectionRange;if(t!==a&&a&&a.ownerDocument&&U0(a.ownerDocument.documentElement,a)){if(r!==null&&Bh(a)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in a)a.selectionStart=t,a.selectionEnd=Math.min(e,a.value.length);else if(e=(t=a.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=a.textContent.length,n=Math.min(r.start,o);r=r.end===void 0?n:Math.min(r.end,o),!e.extend&&n>r&&(o=r,r=n,n=o),o=gv(a,n);var s=gv(a,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),n>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=a;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof a.focus=="function"&&a.focus(),a=0;a<t.length;a++)e=t[a],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var GT=fr&&"documentMode"in document&&11>=document.documentMode,$n=null,Qm=null,nl=null,Jm=!1;function yv(e,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Jm||$n==null||$n!==_d(r)||(r=$n,"selectionStart"in r&&Bh(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),nl&&yl(nl,r)||(nl=r,r=Bd(Qm,"onSelect"),0<r.length&&(t=new Nh("onSelect","select",null,t,a),e.push({event:t,listeners:r}),t.target=$n)))}function cd(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Wn={animationend:cd("Animation","AnimationEnd"),animationiteration:cd("Animation","AnimationIteration"),animationstart:cd("Animation","AnimationStart"),transitionend:cd("Transition","TransitionEnd")},xm={},j0={};fr&&(j0=document.createElement("div").style,"AnimationEvent"in window||(delete Wn.animationend.animation,delete Wn.animationiteration.animation,delete Wn.animationstart.animation),"TransitionEvent"in window||delete Wn.transitionend.transition);function oc(e){if(xm[e])return xm[e];if(!Wn[e])return e;var t=Wn[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in j0)return xm[e]=t[a];return e}var q0=oc("animationend"),H0=oc("animationiteration"),z0=oc("animationstart"),$0=oc("transitionend"),W0=new Map,xv="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function to(e,t){W0.set(e,t),Go(t,[e])}for(fd=0;fd<xv.length;fd++)pd=xv[fd],vv=pd.toLowerCase(),wv=pd[0].toUpperCase()+pd.slice(1),to(vv,"on"+wv);var pd,vv,wv,fd;to(q0,"onAnimationEnd");to(H0,"onAnimationIteration");to(z0,"onAnimationStart");to("dblclick","onDoubleClick");to("focusin","onFocus");to("focusout","onBlur");to($0,"onTransitionEnd");ss("onMouseEnter",["mouseout","mouseover"]);ss("onMouseLeave",["mouseout","mouseover"]);ss("onPointerEnter",["pointerout","pointerover"]);ss("onPointerLeave",["pointerout","pointerover"]);Go("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Go("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Go("onBeforeInput",["compositionend","keypress","textInput","paste"]);Go("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Go("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Go("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var el="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),KT=new Set("cancel close invalid load scroll toggle".split(" ").concat(el));function Cv(e,t,a){var r=e.type||"unknown-event";e.currentTarget=a,KP(r,t,void 0,e),e.currentTarget=null}function G0(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var r=e[a],o=r.event;r=r.listeners;e:{var n=void 0;if(t)for(var s=r.length-1;0<=s;s--){var i=r[s],l=i.instance,u=i.currentTarget;if(i=i.listener,l!==n&&o.isPropagationStopped())break e;Cv(o,i,u),n=l}else for(s=0;s<r.length;s++){if(i=r[s],l=i.instance,u=i.currentTarget,i=i.listener,l!==n&&o.isPropagationStopped())break e;Cv(o,i,u),n=l}}}if(Dd)throw e=Wm,Dd=!1,Wm=null,e}function Ie(e,t){var a=t[ah];a===void 0&&(a=t[ah]=new Set);var r=e+"__bubble";a.has(r)||(K0(t,e,2,!1),a.add(r))}function vm(e,t,a){var r=0;t&&(r|=4),K0(a,e,r,t)}var md="_reactListening"+Math.random().toString(36).slice(2);function xl(e){if(!e[md]){e[md]=!0,t0.forEach(function(a){a!=="selectionchange"&&(KT.has(a)||vm(a,!1,e),vm(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[md]||(t[md]=!0,vm("selectionchange",!1,t))}}function K0(e,t,a,r){switch(_0(t)){case 1:var o=dT;break;case 4:o=cT;break;default:o=Dh}a=o.bind(null,t,a,e),o=void 0,!$m||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,a,{capture:!0,passive:o}):e.addEventListener(t,a,!0):o!==void 0?e.addEventListener(t,a,{passive:o}):e.addEventListener(t,a,!1)}function wm(e,t,a,r,o){var n=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var i=r.stateNode.containerInfo;if(i===o||i.nodeType===8&&i.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===o||l.nodeType===8&&l.parentNode===o))return;s=s.return}for(;i!==null;){if(s=Fo(i),s===null)return;if(l=s.tag,l===5||l===6){r=n=s;continue e}i=i.parentNode}}r=r.return}y0(function(){var u=n,d=Ah(a),c=[];e:{var f=W0.get(e);if(f!==void 0){var m=Nh,v=e;switch(e){case"keypress":if(Ld(a)===0)break e;case"keydown":case"keyup":m=kT;break;case"focusin":v="focus",m=gm;break;case"focusout":v="blur",m=gm;break;case"beforeblur":case"afterblur":m=gm;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=lv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=mT;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=AT;break;case q0:case H0:case z0:m=yT;break;case $0:m=_T;break;case"scroll":m=fT;break;case"wheel":m=DT;break;case"copy":case"cut":case"paste":m=vT;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=dv}var w=(t&4)!==0,S=!w&&e==="scroll",h=w?f!==null?f+"Capture":null:f;w=[];for(var g=u,x;g!==null;){x=g;var L=x.stateNode;if(x.tag===5&&L!==null&&(x=L,h!==null&&(L=fl(g,h),L!=null&&w.push(vl(g,L,x)))),S)break;g=g.return}0<w.length&&(f=new m(f,v,null,a,d),c.push({event:f,listeners:w}))}}if((t&7)===0){e:{if(f=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",f&&a!==Hm&&(v=a.relatedTarget||a.fromElement)&&(Fo(v)||v[pr]))break e;if((m||f)&&(f=d.window===d?d:(f=d.ownerDocument)?f.defaultView||f.parentWindow:window,m?(v=a.relatedTarget||a.toElement,m=u,v=v?Fo(v):null,v!==null&&(S=Ko(v),v!==S||v.tag!==5&&v.tag!==6)&&(v=null)):(m=null,v=u),m!==v)){if(w=lv,L="onMouseLeave",h="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(w=dv,L="onPointerLeave",h="onPointerEnter",g="pointer"),S=m==null?f:Gn(m),x=v==null?f:Gn(v),f=new w(L,g+"leave",m,a,d),f.target=S,f.relatedTarget=x,L=null,Fo(d)===u&&(w=new w(h,g+"enter",v,a,d),w.target=x,w.relatedTarget=S,L=w),S=L,m&&v)t:{for(w=m,h=v,g=0,x=w;x;x=jn(x))g++;for(x=0,L=h;L;L=jn(L))x++;for(;0<g-x;)w=jn(w),g--;for(;0<x-g;)h=jn(h),x--;for(;g--;){if(w===h||h!==null&&w===h.alternate)break t;w=jn(w),h=jn(h)}w=null}else w=null;m!==null&&Sv(c,f,m,w,!1),v!==null&&S!==null&&Sv(c,S,v,w,!0)}}e:{if(f=u?Gn(u):window,m=f.nodeName&&f.nodeName.toLowerCase(),m==="select"||m==="input"&&f.type==="file")var I=VT;else if(pv(f))if(F0)I=zT;else{I=qT;var k=jT}else(m=f.nodeName)&&m.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(I=HT);if(I&&(I=I(e,u))){O0(c,I,a,d);break e}k&&k(e,f,u),e==="focusout"&&(k=f._wrapperState)&&k.controlled&&f.type==="number"&&Bm(f,"number",f.value)}switch(k=u?Gn(u):window,e){case"focusin":(pv(k)||k.contentEditable==="true")&&($n=k,Qm=u,nl=null);break;case"focusout":nl=Qm=$n=null;break;case"mousedown":Jm=!0;break;case"contextmenu":case"mouseup":case"dragend":Jm=!1,yv(c,a,d);break;case"selectionchange":if(GT)break;case"keydown":case"keyup":yv(c,a,d)}var D;if(Fh)e:{switch(e){case"compositionstart":var _="onCompositionStart";break e;case"compositionend":_="onCompositionEnd";break e;case"compositionupdate":_="onCompositionUpdate";break e}_=void 0}else zn?M0(e,a)&&(_="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(_="onCompositionStart");_&&(D0&&a.locale!=="ko"&&(zn||_!=="onCompositionStart"?_==="onCompositionEnd"&&zn&&(D=E0()):(Hr=d,Mh="value"in Hr?Hr.value:Hr.textContent,zn=!0)),k=Bd(u,_),0<k.length&&(_=new uv(_,e,null,a,d),c.push({event:_,listeners:k}),D?_.data=D:(D=N0(a),D!==null&&(_.data=D)))),(D=NT?OT(e,a):FT(e,a))&&(u=Bd(u,"onBeforeInput"),0<u.length&&(d=new uv("onBeforeInput","beforeinput",null,a,d),c.push({event:d,listeners:u}),d.data=D))}G0(c,t)})}function vl(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Bd(e,t){for(var a=t+"Capture",r=[];e!==null;){var o=e,n=o.stateNode;o.tag===5&&n!==null&&(o=n,n=fl(e,a),n!=null&&r.unshift(vl(e,n,o)),n=fl(e,t),n!=null&&r.push(vl(e,n,o))),e=e.return}return r}function jn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Sv(e,t,a,r,o){for(var n=t._reactName,s=[];a!==null&&a!==r;){var i=a,l=i.alternate,u=i.stateNode;if(l!==null&&l===r)break;i.tag===5&&u!==null&&(i=u,o?(l=fl(a,n),l!=null&&s.unshift(vl(a,l,i))):o||(l=fl(a,n),l!=null&&s.push(vl(a,l,i)))),a=a.return}s.length!==0&&e.push({event:t,listeners:s})}var XT=/\r\n?/g,QT=/\u0000|\uFFFD/g;function Lv(e){return(typeof e=="string"?e:""+e).replace(XT,`
6
- `).replace(QT,"")}function hd(e,t,a){if(t=Lv(t),Lv(e)!==t&&a)throw Error(M(425))}function Ud(){}var Ym=null,Zm=null;function eh(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var th=typeof setTimeout=="function"?setTimeout:void 0,JT=typeof clearTimeout=="function"?clearTimeout:void 0,bv=typeof Promise=="function"?Promise:void 0,YT=typeof queueMicrotask=="function"?queueMicrotask:typeof bv<"u"?function(e){return bv.resolve(null).then(e).catch(ZT)}:th;function ZT(e){setTimeout(function(){throw e})}function Cm(e,t){var a=t,r=0;do{var o=a.nextSibling;if(e.removeChild(a),o&&o.nodeType===8)if(a=o.data,a==="/$"){if(r===0){e.removeChild(o),hl(t);return}r--}else a!=="$"&&a!=="$?"&&a!=="$!"||r++;a=o}while(a);hl(t)}function Kr(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Iv(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"){if(t===0)return e;t--}else a==="/$"&&t++}e=e.previousSibling}return null}var ms=Math.random().toString(36).slice(2),Ba="__reactFiber$"+ms,wl="__reactProps$"+ms,pr="__reactContainer$"+ms,ah="__reactEvents$"+ms,e1="__reactListeners$"+ms,t1="__reactHandles$"+ms;function Fo(e){var t=e[Ba];if(t)return t;for(var a=e.parentNode;a;){if(t=a[pr]||a[Ba]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Iv(e);e!==null;){if(a=e[Ba])return a;e=Iv(e)}return t}e=a,a=e.parentNode}return null}function Al(e){return e=e[Ba]||e[pr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Gn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(M(33))}function nc(e){return e[wl]||null}var rh=[],Kn=-1;function ao(e){return{current:e}}function ke(e){0>Kn||(e.current=rh[Kn],rh[Kn]=null,Kn--)}function we(e,t){Kn++,rh[Kn]=e.current,e.current=t}var eo={},wt=ao(eo),Ot=ao(!1),qo=eo;function is(e,t){var a=e.type.contextTypes;if(!a)return eo;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},n;for(n in a)o[n]=t[n];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Ft(e){return e=e.childContextTypes,e!=null}function Vd(){ke(Ot),ke(wt)}function kv(e,t,a){if(wt.current!==eo)throw Error(M(168));we(wt,t),we(Ot,a)}function X0(e,t,a){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return a;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(M(108,jP(e)||"Unknown",o));return Ne({},a,r)}function jd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||eo,qo=wt.current,we(wt,e),we(Ot,Ot.current),!0}function Pv(e,t,a){var r=e.stateNode;if(!r)throw Error(M(169));a?(e=X0(e,t,qo),r.__reactInternalMemoizedMergedChildContext=e,ke(Ot),ke(wt),we(wt,e)):ke(Ot),we(Ot,a)}var lr=null,sc=!1,Sm=!1;function Q0(e){lr===null?lr=[e]:lr.push(e)}function a1(e){sc=!0,Q0(e)}function ro(){if(!Sm&&lr!==null){Sm=!0;var e=0,t=he;try{var a=lr;for(he=1;e<a.length;e++){var r=a[e];do r=r(!0);while(r!==null)}lr=null,sc=!1}catch(o){throw lr!==null&&(lr=lr.slice(e+1)),C0(Rh,ro),o}finally{he=t,Sm=!1}}return null}var Xn=[],Qn=0,qd=null,Hd=0,da=[],ca=0,Ho=null,ur=1,dr="";function No(e,t){Xn[Qn++]=Hd,Xn[Qn++]=qd,qd=e,Hd=t}function J0(e,t,a){da[ca++]=ur,da[ca++]=dr,da[ca++]=Ho,Ho=e;var r=ur;e=dr;var o=32-Ia(r)-1;r&=~(1<<o),a+=1;var n=32-Ia(t)+o;if(30<n){var s=o-o%5;n=(r&(1<<s)-1).toString(32),r>>=s,o-=s,ur=1<<32-Ia(t)+o|a<<o|r,dr=n+e}else ur=1<<n|a<<o|r,dr=e}function Uh(e){e.return!==null&&(No(e,1),J0(e,1,0))}function Vh(e){for(;e===qd;)qd=Xn[--Qn],Xn[Qn]=null,Hd=Xn[--Qn],Xn[Qn]=null;for(;e===Ho;)Ho=da[--ca],da[ca]=null,dr=da[--ca],da[ca]=null,ur=da[--ca],da[ca]=null}var Xt=null,Kt=null,_e=!1,ba=null;function Y0(e,t){var a=fa(5,null,null,0);a.elementType="DELETED",a.stateNode=t,a.return=e,t=e.deletions,t===null?(e.deletions=[a],e.flags|=16):t.push(a)}function Tv(e,t){switch(e.tag){case 5:var a=e.type;return t=t.nodeType!==1||a.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Xt=e,Kt=Kr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Xt=e,Kt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(a=Ho!==null?{id:ur,overflow:dr}:null,e.memoizedState={dehydrated:t,treeContext:a,retryLane:1073741824},a=fa(18,null,null,0),a.stateNode=t,a.return=e,e.child=a,Xt=e,Kt=null,!0):!1;default:return!1}}function oh(e){return(e.mode&1)!==0&&(e.flags&128)===0}function nh(e){if(_e){var t=Kt;if(t){var a=t;if(!Tv(e,t)){if(oh(e))throw Error(M(418));t=Kr(a.nextSibling);var r=Xt;t&&Tv(e,t)?Y0(r,a):(e.flags=e.flags&-4097|2,_e=!1,Xt=e)}}else{if(oh(e))throw Error(M(418));e.flags=e.flags&-4097|2,_e=!1,Xt=e}}}function Av(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Xt=e}function gd(e){if(e!==Xt)return!1;if(!_e)return Av(e),_e=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!eh(e.type,e.memoizedProps)),t&&(t=Kt)){if(oh(e))throw Z0(),Error(M(418));for(;t;)Y0(e,t),t=Kr(t.nextSibling)}if(Av(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(M(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"){if(t===0){Kt=Kr(e.nextSibling);break e}t--}else a!=="$"&&a!=="$!"&&a!=="$?"||t++}e=e.nextSibling}Kt=null}}else Kt=Xt?Kr(e.stateNode.nextSibling):null;return!0}function Z0(){for(var e=Kt;e;)e=Kr(e.nextSibling)}function ls(){Kt=Xt=null,_e=!1}function jh(e){ba===null?ba=[e]:ba.push(e)}var r1=gr.ReactCurrentBatchConfig;function Gi(e,t,a){if(e=a.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(a._owner){if(a=a._owner,a){if(a.tag!==1)throw Error(M(309));var r=a.stateNode}if(!r)throw Error(M(147,e));var o=r,n=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===n?t.ref:(t=function(s){var i=o.refs;s===null?delete i[n]:i[n]=s},t._stringRef=n,t)}if(typeof e!="string")throw Error(M(284));if(!a._owner)throw Error(M(290,e))}return e}function yd(e,t){throw e=Object.prototype.toString.call(t),Error(M(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Rv(e){var t=e._init;return t(e._payload)}function ew(e){function t(h,g){if(e){var x=h.deletions;x===null?(h.deletions=[g],h.flags|=16):x.push(g)}}function a(h,g){if(!e)return null;for(;g!==null;)t(h,g),g=g.sibling;return null}function r(h,g){for(h=new Map;g!==null;)g.key!==null?h.set(g.key,g):h.set(g.index,g),g=g.sibling;return h}function o(h,g){return h=Yr(h,g),h.index=0,h.sibling=null,h}function n(h,g,x){return h.index=x,e?(x=h.alternate,x!==null?(x=x.index,x<g?(h.flags|=2,g):x):(h.flags|=2,g)):(h.flags|=1048576,g)}function s(h){return e&&h.alternate===null&&(h.flags|=2),h}function i(h,g,x,L){return g===null||g.tag!==6?(g=Am(x,h.mode,L),g.return=h,g):(g=o(g,x),g.return=h,g)}function l(h,g,x,L){var I=x.type;return I===Hn?d(h,g,x.props.children,L,x.key):g!==null&&(g.elementType===I||typeof I=="object"&&I!==null&&I.$$typeof===Ur&&Rv(I)===g.type)?(L=o(g,x.props),L.ref=Gi(h,g,x),L.return=h,L):(L=Rd(x.type,x.key,x.props,null,h.mode,L),L.ref=Gi(h,g,x),L.return=h,L)}function u(h,g,x,L){return g===null||g.tag!==4||g.stateNode.containerInfo!==x.containerInfo||g.stateNode.implementation!==x.implementation?(g=Rm(x,h.mode,L),g.return=h,g):(g=o(g,x.children||[]),g.return=h,g)}function d(h,g,x,L,I){return g===null||g.tag!==7?(g=jo(x,h.mode,L,I),g.return=h,g):(g=o(g,x),g.return=h,g)}function c(h,g,x){if(typeof g=="string"&&g!==""||typeof g=="number")return g=Am(""+g,h.mode,x),g.return=h,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case ad:return x=Rd(g.type,g.key,g.props,null,h.mode,x),x.ref=Gi(h,null,g),x.return=h,x;case qn:return g=Rm(g,h.mode,x),g.return=h,g;case Ur:var L=g._init;return c(h,L(g._payload),x)}if(Yi(g)||Hi(g))return g=jo(g,h.mode,x,null),g.return=h,g;yd(h,g)}return null}function f(h,g,x,L){var I=g!==null?g.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return I!==null?null:i(h,g,""+x,L);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case ad:return x.key===I?l(h,g,x,L):null;case qn:return x.key===I?u(h,g,x,L):null;case Ur:return I=x._init,f(h,g,I(x._payload),L)}if(Yi(x)||Hi(x))return I!==null?null:d(h,g,x,L,null);yd(h,x)}return null}function m(h,g,x,L,I){if(typeof L=="string"&&L!==""||typeof L=="number")return h=h.get(x)||null,i(g,h,""+L,I);if(typeof L=="object"&&L!==null){switch(L.$$typeof){case ad:return h=h.get(L.key===null?x:L.key)||null,l(g,h,L,I);case qn:return h=h.get(L.key===null?x:L.key)||null,u(g,h,L,I);case Ur:var k=L._init;return m(h,g,x,k(L._payload),I)}if(Yi(L)||Hi(L))return h=h.get(x)||null,d(g,h,L,I,null);yd(g,L)}return null}function v(h,g,x,L){for(var I=null,k=null,D=g,_=g=0,V=null;D!==null&&_<x.length;_++){D.index>_?(V=D,D=null):V=D.sibling;var j=f(h,D,x[_],L);if(j===null){D===null&&(D=V);break}e&&D&&j.alternate===null&&t(h,D),g=n(j,g,_),k===null?I=j:k.sibling=j,k=j,D=V}if(_===x.length)return a(h,D),_e&&No(h,_),I;if(D===null){for(;_<x.length;_++)D=c(h,x[_],L),D!==null&&(g=n(D,g,_),k===null?I=D:k.sibling=D,k=D);return _e&&No(h,_),I}for(D=r(h,D);_<x.length;_++)V=m(D,h,_,x[_],L),V!==null&&(e&&V.alternate!==null&&D.delete(V.key===null?_:V.key),g=n(V,g,_),k===null?I=V:k.sibling=V,k=V);return e&&D.forEach(function(ge){return t(h,ge)}),_e&&No(h,_),I}function w(h,g,x,L){var I=Hi(x);if(typeof I!="function")throw Error(M(150));if(x=I.call(x),x==null)throw Error(M(151));for(var k=I=null,D=g,_=g=0,V=null,j=x.next();D!==null&&!j.done;_++,j=x.next()){D.index>_?(V=D,D=null):V=D.sibling;var ge=f(h,D,j.value,L);if(ge===null){D===null&&(D=V);break}e&&D&&ge.alternate===null&&t(h,D),g=n(ge,g,_),k===null?I=ge:k.sibling=ge,k=ge,D=V}if(j.done)return a(h,D),_e&&No(h,_),I;if(D===null){for(;!j.done;_++,j=x.next())j=c(h,j.value,L),j!==null&&(g=n(j,g,_),k===null?I=j:k.sibling=j,k=j);return _e&&No(h,_),I}for(D=r(h,D);!j.done;_++,j=x.next())j=m(D,h,_,j.value,L),j!==null&&(e&&j.alternate!==null&&D.delete(j.key===null?_:j.key),g=n(j,g,_),k===null?I=j:k.sibling=j,k=j);return e&&D.forEach(function(ue){return t(h,ue)}),_e&&No(h,_),I}function S(h,g,x,L){if(typeof x=="object"&&x!==null&&x.type===Hn&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case ad:e:{for(var I=x.key,k=g;k!==null;){if(k.key===I){if(I=x.type,I===Hn){if(k.tag===7){a(h,k.sibling),g=o(k,x.props.children),g.return=h,h=g;break e}}else if(k.elementType===I||typeof I=="object"&&I!==null&&I.$$typeof===Ur&&Rv(I)===k.type){a(h,k.sibling),g=o(k,x.props),g.ref=Gi(h,k,x),g.return=h,h=g;break e}a(h,k);break}else t(h,k);k=k.sibling}x.type===Hn?(g=jo(x.props.children,h.mode,L,x.key),g.return=h,h=g):(L=Rd(x.type,x.key,x.props,null,h.mode,L),L.ref=Gi(h,g,x),L.return=h,h=L)}return s(h);case qn:e:{for(k=x.key;g!==null;){if(g.key===k)if(g.tag===4&&g.stateNode.containerInfo===x.containerInfo&&g.stateNode.implementation===x.implementation){a(h,g.sibling),g=o(g,x.children||[]),g.return=h,h=g;break e}else{a(h,g);break}else t(h,g);g=g.sibling}g=Rm(x,h.mode,L),g.return=h,h=g}return s(h);case Ur:return k=x._init,S(h,g,k(x._payload),L)}if(Yi(x))return v(h,g,x,L);if(Hi(x))return w(h,g,x,L);yd(h,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,g!==null&&g.tag===6?(a(h,g.sibling),g=o(g,x),g.return=h,h=g):(a(h,g),g=Am(x,h.mode,L),g.return=h,h=g),s(h)):a(h,g)}return S}var us=ew(!0),tw=ew(!1),zd=ao(null),$d=null,Jn=null,qh=null;function Hh(){qh=Jn=$d=null}function zh(e){var t=zd.current;ke(zd),e._currentValue=t}function sh(e,t,a){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===a)break;e=e.return}}function os(e,t){$d=e,qh=Jn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Nt=!0),e.firstContext=null)}function ma(e){var t=e._currentValue;if(qh!==e)if(e={context:e,memoizedValue:t,next:null},Jn===null){if($d===null)throw Error(M(308));Jn=e,$d.dependencies={lanes:0,firstContext:e}}else Jn=Jn.next=e;return t}var Bo=null;function $h(e){Bo===null?Bo=[e]:Bo.push(e)}function aw(e,t,a,r){var o=t.interleaved;return o===null?(a.next=a,$h(t)):(a.next=o.next,o.next=a),t.interleaved=a,mr(e,r)}function mr(e,t){e.lanes|=t;var a=e.alternate;for(a!==null&&(a.lanes|=t),a=e,e=e.return;e!==null;)e.childLanes|=t,a=e.alternate,a!==null&&(a.childLanes|=t),a=e,e=e.return;return a.tag===3?a.stateNode:null}var Vr=!1;function Wh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function rw(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 cr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Xr(e,t,a){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(de&2)!==0){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,mr(e,a)}return o=r.interleaved,o===null?(t.next=t,$h(r)):(t.next=o.next,o.next=t),r.interleaved=t,mr(e,a)}function bd(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,_h(e,a)}}function _v(e,t){var a=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var o=null,n=null;if(a=a.firstBaseUpdate,a!==null){do{var s={eventTime:a.eventTime,lane:a.lane,tag:a.tag,payload:a.payload,callback:a.callback,next:null};n===null?o=n=s:n=n.next=s,a=a.next}while(a!==null);n===null?o=n=t:n=n.next=t}else o=n=t;a={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:n,shared:r.shared,effects:r.effects},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}function Wd(e,t,a,r){var o=e.updateQueue;Vr=!1;var n=o.firstBaseUpdate,s=o.lastBaseUpdate,i=o.shared.pending;if(i!==null){o.shared.pending=null;var l=i,u=l.next;l.next=null,s===null?n=u:s.next=u,s=l;var d=e.alternate;d!==null&&(d=d.updateQueue,i=d.lastBaseUpdate,i!==s&&(i===null?d.firstBaseUpdate=u:i.next=u,d.lastBaseUpdate=l))}if(n!==null){var c=o.baseState;s=0,d=u=l=null,i=n;do{var f=i.lane,m=i.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:m,lane:0,tag:i.tag,payload:i.payload,callback:i.callback,next:null});e:{var v=e,w=i;switch(f=t,m=a,w.tag){case 1:if(v=w.payload,typeof v=="function"){c=v.call(m,c,f);break e}c=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=w.payload,f=typeof v=="function"?v.call(m,c,f):v,f==null)break e;c=Ne({},c,f);break e;case 2:Vr=!0}}i.callback!==null&&i.lane!==0&&(e.flags|=64,f=o.effects,f===null?o.effects=[i]:f.push(i))}else m={eventTime:m,lane:f,tag:i.tag,payload:i.payload,callback:i.callback,next:null},d===null?(u=d=m,l=c):d=d.next=m,s|=f;if(i=i.next,i===null){if(i=o.shared.pending,i===null)break;f=i,i=f.next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}while(!0);if(d===null&&(l=c),o.baseState=l,o.firstBaseUpdate=u,o.lastBaseUpdate=d,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else n===null&&(o.shared.lanes=0);$o|=s,e.lanes=s,e.memoizedState=c}}function Ev(e,t,a){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=a,typeof o!="function")throw Error(M(191,o));o.call(r)}}}var Rl={},Va=ao(Rl),Cl=ao(Rl),Sl=ao(Rl);function Uo(e){if(e===Rl)throw Error(M(174));return e}function Gh(e,t){switch(we(Sl,t),we(Cl,e),we(Va,Rl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Vm(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Vm(t,e)}ke(Va),we(Va,t)}function ds(){ke(Va),ke(Cl),ke(Sl)}function ow(e){Uo(Sl.current);var t=Uo(Va.current),a=Vm(t,e.type);t!==a&&(we(Cl,e),we(Va,a))}function Kh(e){Cl.current===e&&(ke(Va),ke(Cl))}var De=ao(0);function Gd(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||a.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Lm=[];function Xh(){for(var e=0;e<Lm.length;e++)Lm[e]._workInProgressVersionPrimary=null;Lm.length=0}var Id=gr.ReactCurrentDispatcher,bm=gr.ReactCurrentBatchConfig,zo=0,Me=null,Je=null,at=null,Kd=!1,sl=!1,Ll=0,o1=0;function yt(){throw Error(M(321))}function Qh(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Pa(e[a],t[a]))return!1;return!0}function Jh(e,t,a,r,o,n){if(zo=n,Me=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Id.current=e===null||e.memoizedState===null?l1:u1,e=a(r,o),sl){n=0;do{if(sl=!1,Ll=0,25<=n)throw Error(M(301));n+=1,at=Je=null,t.updateQueue=null,Id.current=d1,e=a(r,o)}while(sl)}if(Id.current=Xd,t=Je!==null&&Je.next!==null,zo=0,at=Je=Me=null,Kd=!1,t)throw Error(M(300));return e}function Yh(){var e=Ll!==0;return Ll=0,e}function Fa(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return at===null?Me.memoizedState=at=e:at=at.next=e,at}function ha(){if(Je===null){var e=Me.alternate;e=e!==null?e.memoizedState:null}else e=Je.next;var t=at===null?Me.memoizedState:at.next;if(t!==null)at=t,Je=e;else{if(e===null)throw Error(M(310));Je=e,e={memoizedState:Je.memoizedState,baseState:Je.baseState,baseQueue:Je.baseQueue,queue:Je.queue,next:null},at===null?Me.memoizedState=at=e:at=at.next=e}return at}function bl(e,t){return typeof t=="function"?t(e):t}function Im(e){var t=ha(),a=t.queue;if(a===null)throw Error(M(311));a.lastRenderedReducer=e;var r=Je,o=r.baseQueue,n=a.pending;if(n!==null){if(o!==null){var s=o.next;o.next=n.next,n.next=s}r.baseQueue=o=n,a.pending=null}if(o!==null){n=o.next,r=r.baseState;var i=s=null,l=null,u=n;do{var d=u.lane;if((zo&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var c={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(i=l=c,s=r):l=l.next=c,Me.lanes|=d,$o|=d}u=u.next}while(u!==null&&u!==n);l===null?s=r:l.next=i,Pa(r,t.memoizedState)||(Nt=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=l,a.lastRenderedState=r}if(e=a.interleaved,e!==null){o=e;do n=o.lane,Me.lanes|=n,$o|=n,o=o.next;while(o!==e)}else o===null&&(a.lanes=0);return[t.memoizedState,a.dispatch]}function km(e){var t=ha(),a=t.queue;if(a===null)throw Error(M(311));a.lastRenderedReducer=e;var r=a.dispatch,o=a.pending,n=t.memoizedState;if(o!==null){a.pending=null;var s=o=o.next;do n=e(n,s.action),s=s.next;while(s!==o);Pa(n,t.memoizedState)||(Nt=!0),t.memoizedState=n,t.baseQueue===null&&(t.baseState=n),a.lastRenderedState=n}return[n,r]}function nw(){}function sw(e,t){var a=Me,r=ha(),o=t(),n=!Pa(r.memoizedState,o);if(n&&(r.memoizedState=o,Nt=!0),r=r.queue,Zh(uw.bind(null,a,r,e),[e]),r.getSnapshot!==t||n||at!==null&&at.memoizedState.tag&1){if(a.flags|=2048,Il(9,lw.bind(null,a,r,o,t),void 0,null),rt===null)throw Error(M(349));(zo&30)!==0||iw(a,t,o)}return o}function iw(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=Me.updateQueue,t===null?(t={lastEffect:null,stores:null},Me.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function lw(e,t,a,r){t.value=a,t.getSnapshot=r,dw(t)&&cw(e)}function uw(e,t,a){return a(function(){dw(t)&&cw(e)})}function dw(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Pa(e,a)}catch{return!0}}function cw(e){var t=mr(e,1);t!==null&&ka(t,e,1,-1)}function Dv(e){var t=Fa();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:bl,lastRenderedState:e},t.queue=e,e=e.dispatch=i1.bind(null,Me,e),[t.memoizedState,e]}function Il(e,t,a,r){return e={tag:e,create:t,destroy:a,deps:r,next:null},t=Me.updateQueue,t===null?(t={lastEffect:null,stores:null},Me.updateQueue=t,t.lastEffect=e.next=e):(a=t.lastEffect,a===null?t.lastEffect=e.next=e:(r=a.next,a.next=e,e.next=r,t.lastEffect=e)),e}function fw(){return ha().memoizedState}function kd(e,t,a,r){var o=Fa();Me.flags|=e,o.memoizedState=Il(1|t,a,void 0,r===void 0?null:r)}function ic(e,t,a,r){var o=ha();r=r===void 0?null:r;var n=void 0;if(Je!==null){var s=Je.memoizedState;if(n=s.destroy,r!==null&&Qh(r,s.deps)){o.memoizedState=Il(t,a,n,r);return}}Me.flags|=e,o.memoizedState=Il(1|t,a,n,r)}function Mv(e,t){return kd(8390656,8,e,t)}function Zh(e,t){return ic(2048,8,e,t)}function pw(e,t){return ic(4,2,e,t)}function mw(e,t){return ic(4,4,e,t)}function hw(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function gw(e,t,a){return a=a!=null?a.concat([e]):null,ic(4,4,hw.bind(null,t,e),a)}function eg(){}function yw(e,t){var a=ha();t=t===void 0?null:t;var r=a.memoizedState;return r!==null&&t!==null&&Qh(t,r[1])?r[0]:(a.memoizedState=[e,t],e)}function xw(e,t){var a=ha();t=t===void 0?null:t;var r=a.memoizedState;return r!==null&&t!==null&&Qh(t,r[1])?r[0]:(e=e(),a.memoizedState=[e,t],e)}function vw(e,t,a){return(zo&21)===0?(e.baseState&&(e.baseState=!1,Nt=!0),e.memoizedState=a):(Pa(a,t)||(a=b0(),Me.lanes|=a,$o|=a,e.baseState=!0),t)}function n1(e,t){var a=he;he=a!==0&&4>a?a:4,e(!0);var r=bm.transition;bm.transition={};try{e(!1),t()}finally{he=a,bm.transition=r}}function ww(){return ha().memoizedState}function s1(e,t,a){var r=Jr(e);if(a={lane:r,action:a,hasEagerState:!1,eagerState:null,next:null},Cw(e))Sw(t,a);else if(a=aw(e,t,a,r),a!==null){var o=At();ka(a,e,r,o),Lw(a,t,r)}}function i1(e,t,a){var r=Jr(e),o={lane:r,action:a,hasEagerState:!1,eagerState:null,next:null};if(Cw(e))Sw(t,o);else{var n=e.alternate;if(e.lanes===0&&(n===null||n.lanes===0)&&(n=t.lastRenderedReducer,n!==null))try{var s=t.lastRenderedState,i=n(s,a);if(o.hasEagerState=!0,o.eagerState=i,Pa(i,s)){var l=t.interleaved;l===null?(o.next=o,$h(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}a=aw(e,t,o,r),a!==null&&(o=At(),ka(a,e,r,o),Lw(a,t,r))}}function Cw(e){var t=e.alternate;return e===Me||t!==null&&t===Me}function Sw(e,t){sl=Kd=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Lw(e,t,a){if((a&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,_h(e,a)}}var Xd={readContext:ma,useCallback:yt,useContext:yt,useEffect:yt,useImperativeHandle:yt,useInsertionEffect:yt,useLayoutEffect:yt,useMemo:yt,useReducer:yt,useRef:yt,useState:yt,useDebugValue:yt,useDeferredValue:yt,useTransition:yt,useMutableSource:yt,useSyncExternalStore:yt,useId:yt,unstable_isNewReconciler:!1},l1={readContext:ma,useCallback:function(e,t){return Fa().memoizedState=[e,t===void 0?null:t],e},useContext:ma,useEffect:Mv,useImperativeHandle:function(e,t,a){return a=a!=null?a.concat([e]):null,kd(4194308,4,hw.bind(null,t,e),a)},useLayoutEffect:function(e,t){return kd(4194308,4,e,t)},useInsertionEffect:function(e,t){return kd(4,2,e,t)},useMemo:function(e,t){var a=Fa();return t=t===void 0?null:t,e=e(),a.memoizedState=[e,t],e},useReducer:function(e,t,a){var r=Fa();return t=a!==void 0?a(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=s1.bind(null,Me,e),[r.memoizedState,e]},useRef:function(e){var t=Fa();return e={current:e},t.memoizedState=e},useState:Dv,useDebugValue:eg,useDeferredValue:function(e){return Fa().memoizedState=e},useTransition:function(){var e=Dv(!1),t=e[0];return e=n1.bind(null,e[1]),Fa().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,a){var r=Me,o=Fa();if(_e){if(a===void 0)throw Error(M(407));a=a()}else{if(a=t(),rt===null)throw Error(M(349));(zo&30)!==0||iw(r,t,a)}o.memoizedState=a;var n={value:a,getSnapshot:t};return o.queue=n,Mv(uw.bind(null,r,n,e),[e]),r.flags|=2048,Il(9,lw.bind(null,r,n,a,t),void 0,null),a},useId:function(){var e=Fa(),t=rt.identifierPrefix;if(_e){var a=dr,r=ur;a=(r&~(1<<32-Ia(r)-1)).toString(32)+a,t=":"+t+"R"+a,a=Ll++,0<a&&(t+="H"+a.toString(32)),t+=":"}else a=o1++,t=":"+t+"r"+a.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},u1={readContext:ma,useCallback:yw,useContext:ma,useEffect:Zh,useImperativeHandle:gw,useInsertionEffect:pw,useLayoutEffect:mw,useMemo:xw,useReducer:Im,useRef:fw,useState:function(){return Im(bl)},useDebugValue:eg,useDeferredValue:function(e){var t=ha();return vw(t,Je.memoizedState,e)},useTransition:function(){var e=Im(bl)[0],t=ha().memoizedState;return[e,t]},useMutableSource:nw,useSyncExternalStore:sw,useId:ww,unstable_isNewReconciler:!1},d1={readContext:ma,useCallback:yw,useContext:ma,useEffect:Zh,useImperativeHandle:gw,useInsertionEffect:pw,useLayoutEffect:mw,useMemo:xw,useReducer:km,useRef:fw,useState:function(){return km(bl)},useDebugValue:eg,useDeferredValue:function(e){var t=ha();return Je===null?t.memoizedState=e:vw(t,Je.memoizedState,e)},useTransition:function(){var e=km(bl)[0],t=ha().memoizedState;return[e,t]},useMutableSource:nw,useSyncExternalStore:sw,useId:ww,unstable_isNewReconciler:!1};function Sa(e,t){if(e&&e.defaultProps){t=Ne({},t),e=e.defaultProps;for(var a in e)t[a]===void 0&&(t[a]=e[a]);return t}return t}function ih(e,t,a,r){t=e.memoizedState,a=a(r,t),a=a==null?t:Ne({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var lc={isMounted:function(e){return(e=e._reactInternals)?Ko(e)===e:!1},enqueueSetState:function(e,t,a){e=e._reactInternals;var r=At(),o=Jr(e),n=cr(r,o);n.payload=t,a!=null&&(n.callback=a),t=Xr(e,n,o),t!==null&&(ka(t,e,o,r),bd(t,e,o))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var r=At(),o=Jr(e),n=cr(r,o);n.tag=1,n.payload=t,a!=null&&(n.callback=a),t=Xr(e,n,o),t!==null&&(ka(t,e,o,r),bd(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=At(),r=Jr(e),o=cr(a,r);o.tag=2,t!=null&&(o.callback=t),t=Xr(e,o,r),t!==null&&(ka(t,e,r,a),bd(t,e,r))}};function Nv(e,t,a,r,o,n,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,n,s):t.prototype&&t.prototype.isPureReactComponent?!yl(a,r)||!yl(o,n):!0}function bw(e,t,a){var r=!1,o=eo,n=t.contextType;return typeof n=="object"&&n!==null?n=ma(n):(o=Ft(t)?qo:wt.current,r=t.contextTypes,n=(r=r!=null)?is(e,o):eo),t=new t(a,n),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=lc,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=n),t}function Ov(e,t,a,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,r),t.state!==e&&lc.enqueueReplaceState(t,t.state,null)}function lh(e,t,a,r){var o=e.stateNode;o.props=a,o.state=e.memoizedState,o.refs={},Wh(e);var n=t.contextType;typeof n=="object"&&n!==null?o.context=ma(n):(n=Ft(t)?qo:wt.current,o.context=is(e,n)),o.state=e.memoizedState,n=t.getDerivedStateFromProps,typeof n=="function"&&(ih(e,t,n,a),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&lc.enqueueReplaceState(o,o.state,null),Wd(e,a,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function cs(e,t){try{var a="",r=t;do a+=VP(r),r=r.return;while(r);var o=a}catch(n){o=`
5
+ `+o[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=s&&0<=i);break}}}finally{oh=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?rl(e):""}function _P(e){switch(e.tag){case 5:return rl(e.type);case 16:return rl("Lazy");case 13:return rl("Suspense");case 19:return rl("SuspenseList");case 0:case 2:case 15:return e=nh(e.type,!1),e;case 11:return e=nh(e.type.render,!1),e;case 1:return e=nh(e.type,!0),e;default:return""}}function _h(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 Jn:return"Fragment";case Xn:return"Portal";case kh:return"Profiler";case wm:return"StrictMode";case Ph:return"Suspense";case Th:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Qx:return(e.displayName||"Context")+".Consumer";case Jx:return(e._context.displayName||"Context")+".Provider";case Sm:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Cm:return t=e.displayName||null,t!==null?t:_h(e.type)||"Memo";case Ga:t=e._payload,e=e._init;try{return _h(e(t))}catch{}}return null}function AP(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 _h(t);case 8:return t===wm?"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 io(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Zx(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function RP(e){var t=Zx(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),a=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var o=r.get,n=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){a=""+s,n.call(this,s)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return a},setValue:function(s){a=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Zu(e){e._valueTracker||(e._valueTracker=RP(e))}function e0(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),a="";return e&&(a=Zx(e)?e.checked?"true":"false":e.value),e=a,e!==r?(t.setValue(e),!0):!1}function Pc(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 Ah(e,t){var r=t.checked;return Be({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Wv(e,t){var r=t.defaultValue==null?"":t.defaultValue,a=t.checked!=null?t.checked:t.defaultChecked;r=io(t.value!=null?t.value:r),e._wrapperState={initialChecked:a,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function t0(e,t){t=t.checked,t!=null&&xm(e,"checked",t,!1)}function Rh(e,t){t0(e,t);var r=io(t.value),a=t.type;if(r!=null)a==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(a==="submit"||a==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Eh(e,t.type,r):t.hasOwnProperty("defaultValue")&&Eh(e,t.type,io(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Gv(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var a=t.type;if(!(a!=="submit"&&a!=="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 Eh(e,t,r){(t!=="number"||Pc(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var al=Array.isArray;function is(e,t,r,a){if(e=e.options,t){t={};for(var o=0;o<r.length;o++)t["$"+r[o]]=!0;for(r=0;r<e.length;r++)o=t.hasOwnProperty("$"+e[r].value),e[r].selected!==o&&(e[r].selected=o),o&&a&&(e[r].defaultSelected=!0)}else{for(r=""+io(r),t=null,o=0;o<e.length;o++){if(e[o].value===r){e[o].selected=!0,a&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Dh(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(N(91));return Be({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Kv(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(N(92));if(al(r)){if(1<r.length)throw Error(N(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:io(r)}}function r0(e,t){var r=io(t.value),a=io(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),a!=null&&(e.defaultValue=""+a)}function Xv(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function a0(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Nh(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?a0(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ec,o0=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,a,o){MSApp.execUnsafeLocalFunction(function(){return e(t,r,a,o)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(ec=ec||document.createElement("div"),ec.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ec.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function gl(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var sl={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},EP=["Webkit","ms","Moz","O"];Object.keys(sl).forEach(function(e){EP.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),sl[t]=sl[e]})});function n0(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||sl.hasOwnProperty(e)&&sl[e]?(""+t).trim():t+"px"}function s0(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var a=r.indexOf("--")===0,o=n0(r,t[r],a);r==="float"&&(r="cssFloat"),a?e.setProperty(r,o):e[r]=o}}var DP=Be({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 Mh(e,t){if(t){if(DP[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(N(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(N(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(N(61))}if(t.style!=null&&typeof t.style!="object")throw Error(N(62))}}function Oh(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 Bh=null;function bm(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Fh=null,ls=null,us=null;function Jv(e){if(e=Nl(e)){if(typeof Fh!="function")throw Error(N(280));var t=e.stateNode;t&&(t=td(t),Fh(e.stateNode,e.type,t))}}function i0(e){ls?us?us.push(e):us=[e]:ls=e}function l0(){if(ls){var e=ls,t=us;if(us=ls=null,Jv(e),t)for(e=0;e<t.length;e++)Jv(t[e])}}function u0(e,t){return e(t)}function c0(){}var sh=!1;function d0(e,t,r){if(sh)return e(t,r);sh=!0;try{return u0(e,t,r)}finally{sh=!1,(ls!==null||us!==null)&&(c0(),l0())}}function yl(e,t){var r=e.stateNode;if(r===null)return null;var a=td(r);if(a===null)return null;r=a[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(N(231,t,typeof r));return r}var Uh=!1;if(xa)try{Gn={},Object.defineProperty(Gn,"passive",{get:function(){Uh=!0}}),window.addEventListener("test",Gn,Gn),window.removeEventListener("test",Gn,Gn)}catch{Uh=!1}var Gn;function NP(e,t,r,a,o,n,s,i,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(r,u)}catch(c){this.onError(c)}}var il=!1,Tc=null,_c=!1,Vh=null,MP={onError:function(e){il=!0,Tc=e}};function OP(e,t,r,a,o,n,s,i,l){il=!1,Tc=null,NP.apply(MP,arguments)}function BP(e,t,r,a,o,n,s,i,l){if(OP.apply(this,arguments),il){if(il){var u=Tc;il=!1,Tc=null}else throw Error(N(198));_c||(_c=!0,Vh=u)}}function on(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function f0(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Qv(e){if(on(e)!==e)throw Error(N(188))}function FP(e){var t=e.alternate;if(!t){if(t=on(e),t===null)throw Error(N(188));return t!==e?null:e}for(var r=e,a=t;;){var o=r.return;if(o===null)break;var n=o.alternate;if(n===null){if(a=o.return,a!==null){r=a;continue}break}if(o.child===n.child){for(n=o.child;n;){if(n===r)return Qv(o),e;if(n===a)return Qv(o),t;n=n.sibling}throw Error(N(188))}if(r.return!==a.return)r=o,a=n;else{for(var s=!1,i=o.child;i;){if(i===r){s=!0,r=o,a=n;break}if(i===a){s=!0,a=o,r=n;break}i=i.sibling}if(!s){for(i=n.child;i;){if(i===r){s=!0,r=n,a=o;break}if(i===a){s=!0,a=n,r=o;break}i=i.sibling}if(!s)throw Error(N(189))}}if(r.alternate!==a)throw Error(N(190))}if(r.tag!==3)throw Error(N(188));return r.stateNode.current===r?e:t}function p0(e){return e=FP(e),e!==null?h0(e):null}function h0(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=h0(e);if(t!==null)return t;e=e.sibling}return null}var m0=Zt.unstable_scheduleCallback,Yv=Zt.unstable_cancelCallback,UP=Zt.unstable_shouldYield,VP=Zt.unstable_requestPaint,Ge=Zt.unstable_now,jP=Zt.unstable_getCurrentPriorityLevel,Lm=Zt.unstable_ImmediatePriority,g0=Zt.unstable_UserBlockingPriority,Ac=Zt.unstable_NormalPriority,qP=Zt.unstable_LowPriority,y0=Zt.unstable_IdlePriority,Qc=null,Gr=null;function $P(e){if(Gr&&typeof Gr.onCommitFiberRoot=="function")try{Gr.onCommitFiberRoot(Qc,e,void 0,(e.current.flags&128)===128)}catch{}}var Rr=Math.clz32?Math.clz32:WP,HP=Math.log,zP=Math.LN2;function WP(e){return e>>>=0,e===0?32:31-(HP(e)/zP|0)|0}var tc=64,rc=4194304;function ol(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 Rc(e,t){var r=e.pendingLanes;if(r===0)return 0;var a=0,o=e.suspendedLanes,n=e.pingedLanes,s=r&268435455;if(s!==0){var i=s&~o;i!==0?a=ol(i):(n&=s,n!==0&&(a=ol(n)))}else s=r&~o,s!==0?a=ol(s):n!==0&&(a=ol(n));if(a===0)return 0;if(t!==0&&t!==a&&(t&o)===0&&(o=a&-a,n=t&-t,o>=n||o===16&&(n&4194240)!==0))return t;if((a&4)!==0&&(a|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=a;0<t;)r=31-Rr(t),o=1<<r,a|=e[r],t&=~o;return a}function GP(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function KP(e,t){for(var r=e.suspendedLanes,a=e.pingedLanes,o=e.expirationTimes,n=e.pendingLanes;0<n;){var s=31-Rr(n),i=1<<s,l=o[s];l===-1?((i&r)===0||(i&a)!==0)&&(o[s]=GP(i,t)):l<=t&&(e.expiredLanes|=i),n&=~i}}function jh(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function v0(){var e=tc;return tc<<=1,(tc&4194240)===0&&(tc=64),e}function ih(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function El(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Rr(t),e[t]=r}function XP(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 a=e.eventTimes;for(e=e.expirationTimes;0<r;){var o=31-Rr(r),n=1<<o;t[o]=0,a[o]=-1,e[o]=-1,r&=~n}}function Im(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var a=31-Rr(r),o=1<<a;o&t|e[a]&t&&(e[a]|=t),r&=~o}}var ge=0;function x0(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var w0,km,S0,C0,b0,qh=!1,ac=[],Za=null,eo=null,to=null,vl=new Map,xl=new Map,Xa=[],JP="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Zv(e,t){switch(e){case"focusin":case"focusout":Za=null;break;case"dragenter":case"dragleave":eo=null;break;case"mouseover":case"mouseout":to=null;break;case"pointerover":case"pointerout":vl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":xl.delete(t.pointerId)}}function Xi(e,t,r,a,o,n){return e===null||e.nativeEvent!==n?(e={blockedOn:t,domEventName:r,eventSystemFlags:a,nativeEvent:n,targetContainers:[o]},t!==null&&(t=Nl(t),t!==null&&km(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function QP(e,t,r,a,o){switch(t){case"focusin":return Za=Xi(Za,e,t,r,a,o),!0;case"dragenter":return eo=Xi(eo,e,t,r,a,o),!0;case"mouseover":return to=Xi(to,e,t,r,a,o),!0;case"pointerover":var n=o.pointerId;return vl.set(n,Xi(vl.get(n)||null,e,t,r,a,o)),!0;case"gotpointercapture":return n=o.pointerId,xl.set(n,Xi(xl.get(n)||null,e,t,r,a,o)),!0}return!1}function L0(e){var t=Go(e.target);if(t!==null){var r=on(t);if(r!==null){if(t=r.tag,t===13){if(t=f0(r),t!==null){e.blockedOn=t,b0(e.priority,function(){S0(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function yc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=$h(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var a=new r.constructor(r.type,r);Bh=a,r.target.dispatchEvent(a),Bh=null}else return t=Nl(r),t!==null&&km(t),e.blockedOn=r,!1;t.shift()}return!0}function ex(e,t,r){yc(e)&&r.delete(t)}function YP(){qh=!1,Za!==null&&yc(Za)&&(Za=null),eo!==null&&yc(eo)&&(eo=null),to!==null&&yc(to)&&(to=null),vl.forEach(ex),xl.forEach(ex)}function Ji(e,t){e.blockedOn===t&&(e.blockedOn=null,qh||(qh=!0,Zt.unstable_scheduleCallback(Zt.unstable_NormalPriority,YP)))}function wl(e){function t(o){return Ji(o,e)}if(0<ac.length){Ji(ac[0],e);for(var r=1;r<ac.length;r++){var a=ac[r];a.blockedOn===e&&(a.blockedOn=null)}}for(Za!==null&&Ji(Za,e),eo!==null&&Ji(eo,e),to!==null&&Ji(to,e),vl.forEach(t),xl.forEach(t),r=0;r<Xa.length;r++)a=Xa[r],a.blockedOn===e&&(a.blockedOn=null);for(;0<Xa.length&&(r=Xa[0],r.blockedOn===null);)L0(r),r.blockedOn===null&&Xa.shift()}var cs=ba.ReactCurrentBatchConfig,Ec=!0;function ZP(e,t,r,a){var o=ge,n=cs.transition;cs.transition=null;try{ge=1,Pm(e,t,r,a)}finally{ge=o,cs.transition=n}}function eT(e,t,r,a){var o=ge,n=cs.transition;cs.transition=null;try{ge=4,Pm(e,t,r,a)}finally{ge=o,cs.transition=n}}function Pm(e,t,r,a){if(Ec){var o=$h(e,t,r,a);if(o===null)hh(e,t,a,Dc,r),Zv(e,a);else if(QP(o,e,t,r,a))a.stopPropagation();else if(Zv(e,a),t&4&&-1<JP.indexOf(e)){for(;o!==null;){var n=Nl(o);if(n!==null&&w0(n),n=$h(e,t,r,a),n===null&&hh(e,t,a,Dc,r),n===o)break;o=n}o!==null&&a.stopPropagation()}else hh(e,t,a,null,r)}}var Dc=null;function $h(e,t,r,a){if(Dc=null,e=bm(a),e=Go(e),e!==null)if(t=on(e),t===null)e=null;else if(r=t.tag,r===13){if(e=f0(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Dc=e,null}function I0(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(jP()){case Lm:return 1;case g0:return 4;case Ac:case qP:return 16;case y0:return 536870912;default:return 16}default:return 16}}var Qa=null,Tm=null,vc=null;function k0(){if(vc)return vc;var e,t=Tm,r=t.length,a,o="value"in Qa?Qa.value:Qa.textContent,n=o.length;for(e=0;e<r&&t[e]===o[e];e++);var s=r-e;for(a=1;a<=s&&t[r-a]===o[n-a];a++);return vc=o.slice(e,1<a?1-a:void 0)}function xc(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function oc(){return!0}function tx(){return!1}function er(e){function t(r,a,o,n,s){this._reactName=r,this._targetInst=o,this.type=a,this.nativeEvent=n,this.target=s,this.currentTarget=null;for(var i in e)e.hasOwnProperty(i)&&(r=e[i],this[i]=r?r(n):n[i]);return this.isDefaultPrevented=(n.defaultPrevented!=null?n.defaultPrevented:n.returnValue===!1)?oc:tx,this.isPropagationStopped=tx,this}return Be(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=oc)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=oc)},persist:function(){},isPersistent:oc}),t}var ws={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_m=er(ws),Dl=Be({},ws,{view:0,detail:0}),tT=er(Dl),lh,uh,Qi,Yc=Be({},Dl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Am,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Qi&&(Qi&&e.type==="mousemove"?(lh=e.screenX-Qi.screenX,uh=e.screenY-Qi.screenY):uh=lh=0,Qi=e),lh)},movementY:function(e){return"movementY"in e?e.movementY:uh}}),rx=er(Yc),rT=Be({},Yc,{dataTransfer:0}),aT=er(rT),oT=Be({},Dl,{relatedTarget:0}),ch=er(oT),nT=Be({},ws,{animationName:0,elapsedTime:0,pseudoElement:0}),sT=er(nT),iT=Be({},ws,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),lT=er(iT),uT=Be({},ws,{data:0}),ax=er(uT),cT={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},dT={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},fT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function pT(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=fT[e])?!!t[e]:!1}function Am(){return pT}var hT=Be({},Dl,{key:function(e){if(e.key){var t=cT[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=xc(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?dT[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Am,charCode:function(e){return e.type==="keypress"?xc(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?xc(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),mT=er(hT),gT=Be({},Yc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ox=er(gT),yT=Be({},Dl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Am}),vT=er(yT),xT=Be({},ws,{propertyName:0,elapsedTime:0,pseudoElement:0}),wT=er(xT),ST=Be({},Yc,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),CT=er(ST),bT=[9,13,27,32],Rm=xa&&"CompositionEvent"in window,ll=null;xa&&"documentMode"in document&&(ll=document.documentMode);var LT=xa&&"TextEvent"in window&&!ll,P0=xa&&(!Rm||ll&&8<ll&&11>=ll),nx=" ",sx=!1;function T0(e,t){switch(e){case"keyup":return bT.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Qn=!1;function IT(e,t){switch(e){case"compositionend":return _0(t);case"keypress":return t.which!==32?null:(sx=!0,nx);case"textInput":return e=t.data,e===nx&&sx?null:e;default:return null}}function kT(e,t){if(Qn)return e==="compositionend"||!Rm&&T0(e,t)?(e=k0(),vc=Tm=Qa=null,Qn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return P0&&t.locale!=="ko"?null:t.data;default:return null}}var PT={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function ix(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!PT[e.type]:t==="textarea"}function A0(e,t,r,a){i0(a),t=Nc(t,"onChange"),0<t.length&&(r=new _m("onChange","change",null,r,a),e.push({event:r,listeners:t}))}var ul=null,Sl=null;function TT(e){j0(e,0)}function Zc(e){var t=es(e);if(e0(t))return e}function _T(e,t){if(e==="change")return t}var R0=!1;xa&&(xa?(sc="oninput"in document,sc||(dh=document.createElement("div"),dh.setAttribute("oninput","return;"),sc=typeof dh.oninput=="function"),nc=sc):nc=!1,R0=nc&&(!document.documentMode||9<document.documentMode));var nc,sc,dh;function lx(){ul&&(ul.detachEvent("onpropertychange",E0),Sl=ul=null)}function E0(e){if(e.propertyName==="value"&&Zc(Sl)){var t=[];A0(t,Sl,e,bm(e)),d0(TT,t)}}function AT(e,t,r){e==="focusin"?(lx(),ul=t,Sl=r,ul.attachEvent("onpropertychange",E0)):e==="focusout"&&lx()}function RT(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Zc(Sl)}function ET(e,t){if(e==="click")return Zc(t)}function DT(e,t){if(e==="input"||e==="change")return Zc(t)}function NT(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Dr=typeof Object.is=="function"?Object.is:NT;function Cl(e,t){if(Dr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;for(a=0;a<r.length;a++){var o=r[a];if(!Ih.call(t,o)||!Dr(e[o],t[o]))return!1}return!0}function ux(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function cx(e,t){var r=ux(e);e=0;for(var a;r;){if(r.nodeType===3){if(a=e+r.textContent.length,e<=t&&a>=t)return{node:r,offset:t-e};e=a}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=ux(r)}}function D0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?D0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function N0(){for(var e=window,t=Pc();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Pc(e.document)}return t}function Em(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 MT(e){var t=N0(),r=e.focusedElem,a=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&D0(r.ownerDocument.documentElement,r)){if(a!==null&&Em(r)){if(t=a.start,e=a.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 o=r.textContent.length,n=Math.min(a.start,o);a=a.end===void 0?n:Math.min(a.end,o),!e.extend&&n>a&&(o=a,a=n,n=o),o=cx(r,n);var s=cx(r,a);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),n>a?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var OT=xa&&"documentMode"in document&&11>=document.documentMode,Yn=null,Hh=null,cl=null,zh=!1;function dx(e,t,r){var a=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;zh||Yn==null||Yn!==Pc(a)||(a=Yn,"selectionStart"in a&&Em(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),cl&&Cl(cl,a)||(cl=a,a=Nc(Hh,"onSelect"),0<a.length&&(t=new _m("onSelect","select",null,t,r),e.push({event:t,listeners:a}),t.target=Yn)))}function ic(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Zn={animationend:ic("Animation","AnimationEnd"),animationiteration:ic("Animation","AnimationIteration"),animationstart:ic("Animation","AnimationStart"),transitionend:ic("Transition","TransitionEnd")},fh={},M0={};xa&&(M0=document.createElement("div").style,"AnimationEvent"in window||(delete Zn.animationend.animation,delete Zn.animationiteration.animation,delete Zn.animationstart.animation),"TransitionEvent"in window||delete Zn.transitionend.transition);function ed(e){if(fh[e])return fh[e];if(!Zn[e])return e;var t=Zn[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in M0)return fh[e]=t[r];return e}var O0=ed("animationend"),B0=ed("animationiteration"),F0=ed("animationstart"),U0=ed("transitionend"),V0=new Map,fx="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function uo(e,t){V0.set(e,t),an(t,[e])}for(lc=0;lc<fx.length;lc++)uc=fx[lc],px=uc.toLowerCase(),hx=uc[0].toUpperCase()+uc.slice(1),uo(px,"on"+hx);var uc,px,hx,lc;uo(O0,"onAnimationEnd");uo(B0,"onAnimationIteration");uo(F0,"onAnimationStart");uo("dblclick","onDoubleClick");uo("focusin","onFocus");uo("focusout","onBlur");uo(U0,"onTransitionEnd");ps("onMouseEnter",["mouseout","mouseover"]);ps("onMouseLeave",["mouseout","mouseover"]);ps("onPointerEnter",["pointerout","pointerover"]);ps("onPointerLeave",["pointerout","pointerover"]);an("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));an("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));an("onBeforeInput",["compositionend","keypress","textInput","paste"]);an("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));an("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));an("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var nl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),BT=new Set("cancel close invalid load scroll toggle".split(" ").concat(nl));function mx(e,t,r){var a=e.type||"unknown-event";e.currentTarget=r,BP(a,t,void 0,e),e.currentTarget=null}function j0(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var a=e[r],o=a.event;a=a.listeners;e:{var n=void 0;if(t)for(var s=a.length-1;0<=s;s--){var i=a[s],l=i.instance,u=i.currentTarget;if(i=i.listener,l!==n&&o.isPropagationStopped())break e;mx(o,i,u),n=l}else for(s=0;s<a.length;s++){if(i=a[s],l=i.instance,u=i.currentTarget,i=i.listener,l!==n&&o.isPropagationStopped())break e;mx(o,i,u),n=l}}}if(_c)throw e=Vh,_c=!1,Vh=null,e}function Te(e,t){var r=t[Jh];r===void 0&&(r=t[Jh]=new Set);var a=e+"__bubble";r.has(a)||(q0(t,e,2,!1),r.add(a))}function ph(e,t,r){var a=0;t&&(a|=4),q0(r,e,a,t)}var cc="_reactListening"+Math.random().toString(36).slice(2);function bl(e){if(!e[cc]){e[cc]=!0,Xx.forEach(function(r){r!=="selectionchange"&&(BT.has(r)||ph(r,!1,e),ph(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[cc]||(t[cc]=!0,ph("selectionchange",!1,t))}}function q0(e,t,r,a){switch(I0(t)){case 1:var o=ZP;break;case 4:o=eT;break;default:o=Pm}r=o.bind(null,t,r,e),o=void 0,!Uh||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),a?o!==void 0?e.addEventListener(t,r,{capture:!0,passive:o}):e.addEventListener(t,r,!0):o!==void 0?e.addEventListener(t,r,{passive:o}):e.addEventListener(t,r,!1)}function hh(e,t,r,a,o){var n=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var s=a.tag;if(s===3||s===4){var i=a.stateNode.containerInfo;if(i===o||i.nodeType===8&&i.parentNode===o)break;if(s===4)for(s=a.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===o||l.nodeType===8&&l.parentNode===o))return;s=s.return}for(;i!==null;){if(s=Go(i),s===null)return;if(l=s.tag,l===5||l===6){a=n=s;continue e}i=i.parentNode}}a=a.return}d0(function(){var u=n,c=bm(r),d=[];e:{var f=V0.get(e);if(f!==void 0){var h=_m,x=e;switch(e){case"keypress":if(xc(r)===0)break e;case"keydown":case"keyup":h=mT;break;case"focusin":x="focus",h=ch;break;case"focusout":x="blur",h=ch;break;case"beforeblur":case"afterblur":h=ch;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=rx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=aT;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=vT;break;case O0:case B0:case F0:h=sT;break;case U0:h=wT;break;case"scroll":h=tT;break;case"wheel":h=CT;break;case"copy":case"cut":case"paste":h=lT;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=ox}var w=(t&4)!==0,C=!w&&e==="scroll",m=w?f!==null?f+"Capture":null:f;w=[];for(var g=u,y;g!==null;){y=g;var b=y.stateNode;if(y.tag===5&&b!==null&&(y=b,m!==null&&(b=yl(g,m),b!=null&&w.push(Ll(g,b,y)))),C)break;g=g.return}0<w.length&&(f=new h(f,x,null,r,c),d.push({event:f,listeners:w}))}}if((t&7)===0){e:{if(f=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",f&&r!==Bh&&(x=r.relatedTarget||r.fromElement)&&(Go(x)||x[wa]))break e;if((h||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,h?(x=r.relatedTarget||r.toElement,h=u,x=x?Go(x):null,x!==null&&(C=on(x),x!==C||x.tag!==5&&x.tag!==6)&&(x=null)):(h=null,x=u),h!==x)){if(w=rx,b="onMouseLeave",m="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(w=ox,b="onPointerLeave",m="onPointerEnter",g="pointer"),C=h==null?f:es(h),y=x==null?f:es(x),f=new w(b,g+"leave",h,r,c),f.target=C,f.relatedTarget=y,b=null,Go(c)===u&&(w=new w(m,g+"enter",x,r,c),w.target=y,w.relatedTarget=C,b=w),C=b,h&&x)t:{for(w=h,m=x,g=0,y=w;y;y=Kn(y))g++;for(y=0,b=m;b;b=Kn(b))y++;for(;0<g-y;)w=Kn(w),g--;for(;0<y-g;)m=Kn(m),y--;for(;g--;){if(w===m||m!==null&&w===m.alternate)break t;w=Kn(w),m=Kn(m)}w=null}else w=null;h!==null&&gx(d,f,h,w,!1),x!==null&&C!==null&&gx(d,C,x,w,!0)}}e:{if(f=u?es(u):window,h=f.nodeName&&f.nodeName.toLowerCase(),h==="select"||h==="input"&&f.type==="file")var k=_T;else if(ix(f))if(R0)k=DT;else{k=RT;var I=AT}else(h=f.nodeName)&&h.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(k=ET);if(k&&(k=k(e,u))){A0(d,k,r,c);break e}I&&I(e,f,u),e==="focusout"&&(I=f._wrapperState)&&I.controlled&&f.type==="number"&&Eh(f,"number",f.value)}switch(I=u?es(u):window,e){case"focusin":(ix(I)||I.contentEditable==="true")&&(Yn=I,Hh=u,cl=null);break;case"focusout":cl=Hh=Yn=null;break;case"mousedown":zh=!0;break;case"contextmenu":case"mouseup":case"dragend":zh=!1,dx(d,r,c);break;case"selectionchange":if(OT)break;case"keydown":case"keyup":dx(d,r,c)}var A;if(Rm)e:{switch(e){case"compositionstart":var R="onCompositionStart";break e;case"compositionend":R="onCompositionEnd";break e;case"compositionupdate":R="onCompositionUpdate";break e}R=void 0}else Qn?T0(e,r)&&(R="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(R="onCompositionStart");R&&(P0&&r.locale!=="ko"&&(Qn||R!=="onCompositionStart"?R==="onCompositionEnd"&&Qn&&(A=k0()):(Qa=c,Tm="value"in Qa?Qa.value:Qa.textContent,Qn=!0)),I=Nc(u,R),0<I.length&&(R=new ax(R,e,null,r,c),d.push({event:R,listeners:I}),A?R.data=A:(A=_0(r),A!==null&&(R.data=A)))),(A=LT?IT(e,r):kT(e,r))&&(u=Nc(u,"onBeforeInput"),0<u.length&&(c=new ax("onBeforeInput","beforeinput",null,r,c),d.push({event:c,listeners:u}),c.data=A))}j0(d,t)})}function Ll(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Nc(e,t){for(var r=t+"Capture",a=[];e!==null;){var o=e,n=o.stateNode;o.tag===5&&n!==null&&(o=n,n=yl(e,r),n!=null&&a.unshift(Ll(e,n,o)),n=yl(e,t),n!=null&&a.push(Ll(e,n,o))),e=e.return}return a}function Kn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function gx(e,t,r,a,o){for(var n=t._reactName,s=[];r!==null&&r!==a;){var i=r,l=i.alternate,u=i.stateNode;if(l!==null&&l===a)break;i.tag===5&&u!==null&&(i=u,o?(l=yl(r,n),l!=null&&s.unshift(Ll(r,l,i))):o||(l=yl(r,n),l!=null&&s.push(Ll(r,l,i)))),r=r.return}s.length!==0&&e.push({event:t,listeners:s})}var FT=/\r\n?/g,UT=/\u0000|\uFFFD/g;function yx(e){return(typeof e=="string"?e:""+e).replace(FT,`
6
+ `).replace(UT,"")}function dc(e,t,r){if(t=yx(t),yx(e)!==t&&r)throw Error(N(425))}function Mc(){}var Wh=null,Gh=null;function Kh(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Xh=typeof setTimeout=="function"?setTimeout:void 0,VT=typeof clearTimeout=="function"?clearTimeout:void 0,vx=typeof Promise=="function"?Promise:void 0,jT=typeof queueMicrotask=="function"?queueMicrotask:typeof vx<"u"?function(e){return vx.resolve(null).then(e).catch(qT)}:Xh;function qT(e){setTimeout(function(){throw e})}function mh(e,t){var r=t,a=0;do{var o=r.nextSibling;if(e.removeChild(r),o&&o.nodeType===8)if(r=o.data,r==="/$"){if(a===0){e.removeChild(o),wl(t);return}a--}else r!=="$"&&r!=="$?"&&r!=="$!"||a++;r=o}while(r);wl(t)}function ro(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function xx(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var Ss=Math.random().toString(36).slice(2),Wr="__reactFiber$"+Ss,Il="__reactProps$"+Ss,wa="__reactContainer$"+Ss,Jh="__reactEvents$"+Ss,$T="__reactListeners$"+Ss,HT="__reactHandles$"+Ss;function Go(e){var t=e[Wr];if(t)return t;for(var r=e.parentNode;r;){if(t=r[wa]||r[Wr]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=xx(e);e!==null;){if(r=e[Wr])return r;e=xx(e)}return t}e=r,r=e.parentNode}return null}function Nl(e){return e=e[Wr]||e[wa],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function es(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(N(33))}function td(e){return e[Il]||null}var Qh=[],ts=-1;function co(e){return{current:e}}function _e(e){0>ts||(e.current=Qh[ts],Qh[ts]=null,ts--)}function be(e,t){ts++,Qh[ts]=e.current,e.current=t}var lo={},kt=co(lo),qt=co(!1),Yo=lo;function hs(e,t){var r=e.type.contextTypes;if(!r)return lo;var a=e.stateNode;if(a&&a.__reactInternalMemoizedUnmaskedChildContext===t)return a.__reactInternalMemoizedMaskedChildContext;var o={},n;for(n in r)o[n]=t[n];return a&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function $t(e){return e=e.childContextTypes,e!=null}function Oc(){_e(qt),_e(kt)}function wx(e,t,r){if(kt.current!==lo)throw Error(N(168));be(kt,t),be(qt,r)}function $0(e,t,r){var a=e.stateNode;if(t=t.childContextTypes,typeof a.getChildContext!="function")return r;a=a.getChildContext();for(var o in a)if(!(o in t))throw Error(N(108,AP(e)||"Unknown",o));return Be({},r,a)}function Bc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||lo,Yo=kt.current,be(kt,e),be(qt,qt.current),!0}function Sx(e,t,r){var a=e.stateNode;if(!a)throw Error(N(169));r?(e=$0(e,t,Yo),a.__reactInternalMemoizedMergedChildContext=e,_e(qt),_e(kt),be(kt,e)):_e(qt),be(qt,r)}var ma=null,rd=!1,gh=!1;function H0(e){ma===null?ma=[e]:ma.push(e)}function zT(e){rd=!0,H0(e)}function fo(){if(!gh&&ma!==null){gh=!0;var e=0,t=ge;try{var r=ma;for(ge=1;e<r.length;e++){var a=r[e];do a=a(!0);while(a!==null)}ma=null,rd=!1}catch(o){throw ma!==null&&(ma=ma.slice(e+1)),m0(Lm,fo),o}finally{ge=t,gh=!1}}return null}var rs=[],as=0,Fc=null,Uc=0,gr=[],yr=0,Zo=null,ga=1,ya="";function zo(e,t){rs[as++]=Uc,rs[as++]=Fc,Fc=e,Uc=t}function z0(e,t,r){gr[yr++]=ga,gr[yr++]=ya,gr[yr++]=Zo,Zo=e;var a=ga;e=ya;var o=32-Rr(a)-1;a&=~(1<<o),r+=1;var n=32-Rr(t)+o;if(30<n){var s=o-o%5;n=(a&(1<<s)-1).toString(32),a>>=s,o-=s,ga=1<<32-Rr(t)+o|r<<o|a,ya=n+e}else ga=1<<n|r<<o|a,ya=e}function Dm(e){e.return!==null&&(zo(e,1),z0(e,1,0))}function Nm(e){for(;e===Fc;)Fc=rs[--as],rs[as]=null,Uc=rs[--as],rs[as]=null;for(;e===Zo;)Zo=gr[--yr],gr[yr]=null,ya=gr[--yr],gr[yr]=null,ga=gr[--yr],gr[yr]=null}var Yt=null,Qt=null,Ne=!1,Ar=null;function W0(e,t){var r=vr(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function Cx(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Yt=e,Qt=ro(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Yt=e,Qt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Zo!==null?{id:ga,overflow:ya}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=vr(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Yt=e,Qt=null,!0):!1;default:return!1}}function Yh(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Zh(e){if(Ne){var t=Qt;if(t){var r=t;if(!Cx(e,t)){if(Yh(e))throw Error(N(418));t=ro(r.nextSibling);var a=Yt;t&&Cx(e,t)?W0(a,r):(e.flags=e.flags&-4097|2,Ne=!1,Yt=e)}}else{if(Yh(e))throw Error(N(418));e.flags=e.flags&-4097|2,Ne=!1,Yt=e}}}function bx(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Yt=e}function fc(e){if(e!==Yt)return!1;if(!Ne)return bx(e),Ne=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Kh(e.type,e.memoizedProps)),t&&(t=Qt)){if(Yh(e))throw G0(),Error(N(418));for(;t;)W0(e,t),t=ro(t.nextSibling)}if(bx(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(N(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){Qt=ro(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Qt=null}}else Qt=Yt?ro(e.stateNode.nextSibling):null;return!0}function G0(){for(var e=Qt;e;)e=ro(e.nextSibling)}function ms(){Qt=Yt=null,Ne=!1}function Mm(e){Ar===null?Ar=[e]:Ar.push(e)}var WT=ba.ReactCurrentBatchConfig;function Yi(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(N(309));var a=r.stateNode}if(!a)throw Error(N(147,e));var o=a,n=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===n?t.ref:(t=function(s){var i=o.refs;s===null?delete i[n]:i[n]=s},t._stringRef=n,t)}if(typeof e!="string")throw Error(N(284));if(!r._owner)throw Error(N(290,e))}return e}function pc(e,t){throw e=Object.prototype.toString.call(t),Error(N(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Lx(e){var t=e._init;return t(e._payload)}function K0(e){function t(m,g){if(e){var y=m.deletions;y===null?(m.deletions=[g],m.flags|=16):y.push(g)}}function r(m,g){if(!e)return null;for(;g!==null;)t(m,g),g=g.sibling;return null}function a(m,g){for(m=new Map;g!==null;)g.key!==null?m.set(g.key,g):m.set(g.index,g),g=g.sibling;return m}function o(m,g){return m=so(m,g),m.index=0,m.sibling=null,m}function n(m,g,y){return m.index=y,e?(y=m.alternate,y!==null?(y=y.index,y<g?(m.flags|=2,g):y):(m.flags|=2,g)):(m.flags|=1048576,g)}function s(m){return e&&m.alternate===null&&(m.flags|=2),m}function i(m,g,y,b){return g===null||g.tag!==6?(g=bh(y,m.mode,b),g.return=m,g):(g=o(g,y),g.return=m,g)}function l(m,g,y,b){var k=y.type;return k===Jn?c(m,g,y.props.children,b,y.key):g!==null&&(g.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Ga&&Lx(k)===g.type)?(b=o(g,y.props),b.ref=Yi(m,g,y),b.return=m,b):(b=kc(y.type,y.key,y.props,null,m.mode,b),b.ref=Yi(m,g,y),b.return=m,b)}function u(m,g,y,b){return g===null||g.tag!==4||g.stateNode.containerInfo!==y.containerInfo||g.stateNode.implementation!==y.implementation?(g=Lh(y,m.mode,b),g.return=m,g):(g=o(g,y.children||[]),g.return=m,g)}function c(m,g,y,b,k){return g===null||g.tag!==7?(g=Qo(y,m.mode,b,k),g.return=m,g):(g=o(g,y),g.return=m,g)}function d(m,g,y){if(typeof g=="string"&&g!==""||typeof g=="number")return g=bh(""+g,m.mode,y),g.return=m,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Yu:return y=kc(g.type,g.key,g.props,null,m.mode,y),y.ref=Yi(m,null,g),y.return=m,y;case Xn:return g=Lh(g,m.mode,y),g.return=m,g;case Ga:var b=g._init;return d(m,b(g._payload),y)}if(al(g)||Ki(g))return g=Qo(g,m.mode,y,null),g.return=m,g;pc(m,g)}return null}function f(m,g,y,b){var k=g!==null?g.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return k!==null?null:i(m,g,""+y,b);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Yu:return y.key===k?l(m,g,y,b):null;case Xn:return y.key===k?u(m,g,y,b):null;case Ga:return k=y._init,f(m,g,k(y._payload),b)}if(al(y)||Ki(y))return k!==null?null:c(m,g,y,b,null);pc(m,y)}return null}function h(m,g,y,b,k){if(typeof b=="string"&&b!==""||typeof b=="number")return m=m.get(y)||null,i(g,m,""+b,k);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Yu:return m=m.get(b.key===null?y:b.key)||null,l(g,m,b,k);case Xn:return m=m.get(b.key===null?y:b.key)||null,u(g,m,b,k);case Ga:var I=b._init;return h(m,g,y,I(b._payload),k)}if(al(b)||Ki(b))return m=m.get(y)||null,c(g,m,b,k,null);pc(g,b)}return null}function x(m,g,y,b){for(var k=null,I=null,A=g,R=g=0,F=null;A!==null&&R<y.length;R++){A.index>R?(F=A,A=null):F=A.sibling;var j=f(m,A,y[R],b);if(j===null){A===null&&(A=F);break}e&&A&&j.alternate===null&&t(m,A),g=n(j,g,R),I===null?k=j:I.sibling=j,I=j,A=F}if(R===y.length)return r(m,A),Ne&&zo(m,R),k;if(A===null){for(;R<y.length;R++)A=d(m,y[R],b),A!==null&&(g=n(A,g,R),I===null?k=A:I.sibling=A,I=A);return Ne&&zo(m,R),k}for(A=a(m,A);R<y.length;R++)F=h(A,m,R,y[R],b),F!==null&&(e&&F.alternate!==null&&A.delete(F.key===null?R:F.key),g=n(F,g,R),I===null?k=F:I.sibling=F,I=F);return e&&A.forEach(function(ye){return t(m,ye)}),Ne&&zo(m,R),k}function w(m,g,y,b){var k=Ki(y);if(typeof k!="function")throw Error(N(150));if(y=k.call(y),y==null)throw Error(N(151));for(var I=k=null,A=g,R=g=0,F=null,j=y.next();A!==null&&!j.done;R++,j=y.next()){A.index>R?(F=A,A=null):F=A.sibling;var ye=f(m,A,j.value,b);if(ye===null){A===null&&(A=F);break}e&&A&&ye.alternate===null&&t(m,A),g=n(ye,g,R),I===null?k=ye:I.sibling=ye,I=ye,A=F}if(j.done)return r(m,A),Ne&&zo(m,R),k;if(A===null){for(;!j.done;R++,j=y.next())j=d(m,j.value,b),j!==null&&(g=n(j,g,R),I===null?k=j:I.sibling=j,I=j);return Ne&&zo(m,R),k}for(A=a(m,A);!j.done;R++,j=y.next())j=h(A,m,R,j.value,b),j!==null&&(e&&j.alternate!==null&&A.delete(j.key===null?R:j.key),g=n(j,g,R),I===null?k=j:I.sibling=j,I=j);return e&&A.forEach(function(de){return t(m,de)}),Ne&&zo(m,R),k}function C(m,g,y,b){if(typeof y=="object"&&y!==null&&y.type===Jn&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Yu:e:{for(var k=y.key,I=g;I!==null;){if(I.key===k){if(k=y.type,k===Jn){if(I.tag===7){r(m,I.sibling),g=o(I,y.props.children),g.return=m,m=g;break e}}else if(I.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Ga&&Lx(k)===I.type){r(m,I.sibling),g=o(I,y.props),g.ref=Yi(m,I,y),g.return=m,m=g;break e}r(m,I);break}else t(m,I);I=I.sibling}y.type===Jn?(g=Qo(y.props.children,m.mode,b,y.key),g.return=m,m=g):(b=kc(y.type,y.key,y.props,null,m.mode,b),b.ref=Yi(m,g,y),b.return=m,m=b)}return s(m);case Xn:e:{for(I=y.key;g!==null;){if(g.key===I)if(g.tag===4&&g.stateNode.containerInfo===y.containerInfo&&g.stateNode.implementation===y.implementation){r(m,g.sibling),g=o(g,y.children||[]),g.return=m,m=g;break e}else{r(m,g);break}else t(m,g);g=g.sibling}g=Lh(y,m.mode,b),g.return=m,m=g}return s(m);case Ga:return I=y._init,C(m,g,I(y._payload),b)}if(al(y))return x(m,g,y,b);if(Ki(y))return w(m,g,y,b);pc(m,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,g!==null&&g.tag===6?(r(m,g.sibling),g=o(g,y),g.return=m,m=g):(r(m,g),g=bh(y,m.mode,b),g.return=m,m=g),s(m)):r(m,g)}return C}var gs=K0(!0),X0=K0(!1),Vc=co(null),jc=null,os=null,Om=null;function Bm(){Om=os=jc=null}function Fm(e){var t=Vc.current;_e(Vc),e._currentValue=t}function em(e,t,r){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===r)break;e=e.return}}function ds(e,t){jc=e,Om=os=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(jt=!0),e.firstContext=null)}function wr(e){var t=e._currentValue;if(Om!==e)if(e={context:e,memoizedValue:t,next:null},os===null){if(jc===null)throw Error(N(308));os=e,jc.dependencies={lanes:0,firstContext:e}}else os=os.next=e;return t}var Ko=null;function Um(e){Ko===null?Ko=[e]:Ko.push(e)}function J0(e,t,r,a){var o=t.interleaved;return o===null?(r.next=r,Um(t)):(r.next=o.next,o.next=r),t.interleaved=r,Sa(e,a)}function Sa(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 Ka=!1;function Vm(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Q0(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 va(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ao(e,t,r){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(fe&2)!==0){var o=a.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),a.pending=t,Sa(e,r)}return o=a.interleaved,o===null?(t.next=t,Um(a)):(t.next=o.next,o.next=t),a.interleaved=t,Sa(e,r)}function wc(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var a=t.lanes;a&=e.pendingLanes,r|=a,t.lanes=r,Im(e,r)}}function Ix(e,t){var r=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,r===a)){var o=null,n=null;if(r=r.firstBaseUpdate,r!==null){do{var s={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};n===null?o=n=s:n=n.next=s,r=r.next}while(r!==null);n===null?o=n=t:n=n.next=t}else o=n=t;r={baseState:a.baseState,firstBaseUpdate:o,lastBaseUpdate:n,shared:a.shared,effects:a.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function qc(e,t,r,a){var o=e.updateQueue;Ka=!1;var n=o.firstBaseUpdate,s=o.lastBaseUpdate,i=o.shared.pending;if(i!==null){o.shared.pending=null;var l=i,u=l.next;l.next=null,s===null?n=u:s.next=u,s=l;var c=e.alternate;c!==null&&(c=c.updateQueue,i=c.lastBaseUpdate,i!==s&&(i===null?c.firstBaseUpdate=u:i.next=u,c.lastBaseUpdate=l))}if(n!==null){var d=o.baseState;s=0,c=u=l=null,i=n;do{var f=i.lane,h=i.eventTime;if((a&f)===f){c!==null&&(c=c.next={eventTime:h,lane:0,tag:i.tag,payload:i.payload,callback:i.callback,next:null});e:{var x=e,w=i;switch(f=t,h=r,w.tag){case 1:if(x=w.payload,typeof x=="function"){d=x.call(h,d,f);break e}d=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=w.payload,f=typeof x=="function"?x.call(h,d,f):x,f==null)break e;d=Be({},d,f);break e;case 2:Ka=!0}}i.callback!==null&&i.lane!==0&&(e.flags|=64,f=o.effects,f===null?o.effects=[i]:f.push(i))}else h={eventTime:h,lane:f,tag:i.tag,payload:i.payload,callback:i.callback,next:null},c===null?(u=c=h,l=d):c=c.next=h,s|=f;if(i=i.next,i===null){if(i=o.shared.pending,i===null)break;f=i,i=f.next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}while(!0);if(c===null&&(l=d),o.baseState=l,o.firstBaseUpdate=u,o.lastBaseUpdate=c,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else n===null&&(o.shared.lanes=0);tn|=s,e.lanes=s,e.memoizedState=d}}function kx(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var a=e[t],o=a.callback;if(o!==null){if(a.callback=null,a=r,typeof o!="function")throw Error(N(191,o));o.call(a)}}}var Ml={},Kr=co(Ml),kl=co(Ml),Pl=co(Ml);function Xo(e){if(e===Ml)throw Error(N(174));return e}function jm(e,t){switch(be(Pl,t),be(kl,e),be(Kr,Ml),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Nh(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Nh(t,e)}_e(Kr),be(Kr,t)}function ys(){_e(Kr),_e(kl),_e(Pl)}function Y0(e){Xo(Pl.current);var t=Xo(Kr.current),r=Nh(t,e.type);t!==r&&(be(kl,e),be(Kr,r))}function qm(e){kl.current===e&&(_e(Kr),_e(kl))}var Me=co(0);function $c(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var yh=[];function $m(){for(var e=0;e<yh.length;e++)yh[e]._workInProgressVersionPrimary=null;yh.length=0}var Sc=ba.ReactCurrentDispatcher,vh=ba.ReactCurrentBatchConfig,en=0,Oe=null,tt=null,lt=null,Hc=!1,dl=!1,Tl=0,GT=0;function bt(){throw Error(N(321))}function Hm(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Dr(e[r],t[r]))return!1;return!0}function zm(e,t,r,a,o,n){if(en=n,Oe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Sc.current=e===null||e.memoizedState===null?QT:YT,e=r(a,o),dl){n=0;do{if(dl=!1,Tl=0,25<=n)throw Error(N(301));n+=1,lt=tt=null,t.updateQueue=null,Sc.current=ZT,e=r(a,o)}while(dl)}if(Sc.current=zc,t=tt!==null&&tt.next!==null,en=0,lt=tt=Oe=null,Hc=!1,t)throw Error(N(300));return e}function Wm(){var e=Tl!==0;return Tl=0,e}function zr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return lt===null?Oe.memoizedState=lt=e:lt=lt.next=e,lt}function Sr(){if(tt===null){var e=Oe.alternate;e=e!==null?e.memoizedState:null}else e=tt.next;var t=lt===null?Oe.memoizedState:lt.next;if(t!==null)lt=t,tt=e;else{if(e===null)throw Error(N(310));tt=e,e={memoizedState:tt.memoizedState,baseState:tt.baseState,baseQueue:tt.baseQueue,queue:tt.queue,next:null},lt===null?Oe.memoizedState=lt=e:lt=lt.next=e}return lt}function _l(e,t){return typeof t=="function"?t(e):t}function xh(e){var t=Sr(),r=t.queue;if(r===null)throw Error(N(311));r.lastRenderedReducer=e;var a=tt,o=a.baseQueue,n=r.pending;if(n!==null){if(o!==null){var s=o.next;o.next=n.next,n.next=s}a.baseQueue=o=n,r.pending=null}if(o!==null){n=o.next,a=a.baseState;var i=s=null,l=null,u=n;do{var c=u.lane;if((en&c)===c)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),a=u.hasEagerState?u.eagerState:e(a,u.action);else{var d={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(i=l=d,s=a):l=l.next=d,Oe.lanes|=c,tn|=c}u=u.next}while(u!==null&&u!==n);l===null?s=a:l.next=i,Dr(a,t.memoizedState)||(jt=!0),t.memoizedState=a,t.baseState=s,t.baseQueue=l,r.lastRenderedState=a}if(e=r.interleaved,e!==null){o=e;do n=o.lane,Oe.lanes|=n,tn|=n,o=o.next;while(o!==e)}else o===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function wh(e){var t=Sr(),r=t.queue;if(r===null)throw Error(N(311));r.lastRenderedReducer=e;var a=r.dispatch,o=r.pending,n=t.memoizedState;if(o!==null){r.pending=null;var s=o=o.next;do n=e(n,s.action),s=s.next;while(s!==o);Dr(n,t.memoizedState)||(jt=!0),t.memoizedState=n,t.baseQueue===null&&(t.baseState=n),r.lastRenderedState=n}return[n,a]}function Z0(){}function ew(e,t){var r=Oe,a=Sr(),o=t(),n=!Dr(a.memoizedState,o);if(n&&(a.memoizedState=o,jt=!0),a=a.queue,Gm(aw.bind(null,r,a,e),[e]),a.getSnapshot!==t||n||lt!==null&&lt.memoizedState.tag&1){if(r.flags|=2048,Al(9,rw.bind(null,r,a,o,t),void 0,null),ut===null)throw Error(N(349));(en&30)!==0||tw(r,t,o)}return o}function tw(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Oe.updateQueue,t===null?(t={lastEffect:null,stores:null},Oe.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function rw(e,t,r,a){t.value=r,t.getSnapshot=a,ow(t)&&nw(e)}function aw(e,t,r){return r(function(){ow(t)&&nw(e)})}function ow(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Dr(e,r)}catch{return!0}}function nw(e){var t=Sa(e,1);t!==null&&Er(t,e,1,-1)}function Px(e){var t=zr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:_l,lastRenderedState:e},t.queue=e,e=e.dispatch=JT.bind(null,Oe,e),[t.memoizedState,e]}function Al(e,t,r,a){return e={tag:e,create:t,destroy:r,deps:a,next:null},t=Oe.updateQueue,t===null?(t={lastEffect:null,stores:null},Oe.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(a=r.next,r.next=e,e.next=a,t.lastEffect=e)),e}function sw(){return Sr().memoizedState}function Cc(e,t,r,a){var o=zr();Oe.flags|=e,o.memoizedState=Al(1|t,r,void 0,a===void 0?null:a)}function ad(e,t,r,a){var o=Sr();a=a===void 0?null:a;var n=void 0;if(tt!==null){var s=tt.memoizedState;if(n=s.destroy,a!==null&&Hm(a,s.deps)){o.memoizedState=Al(t,r,n,a);return}}Oe.flags|=e,o.memoizedState=Al(1|t,r,n,a)}function Tx(e,t){return Cc(8390656,8,e,t)}function Gm(e,t){return ad(2048,8,e,t)}function iw(e,t){return ad(4,2,e,t)}function lw(e,t){return ad(4,4,e,t)}function uw(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function cw(e,t,r){return r=r!=null?r.concat([e]):null,ad(4,4,uw.bind(null,t,e),r)}function Km(){}function dw(e,t){var r=Sr();t=t===void 0?null:t;var a=r.memoizedState;return a!==null&&t!==null&&Hm(t,a[1])?a[0]:(r.memoizedState=[e,t],e)}function fw(e,t){var r=Sr();t=t===void 0?null:t;var a=r.memoizedState;return a!==null&&t!==null&&Hm(t,a[1])?a[0]:(e=e(),r.memoizedState=[e,t],e)}function pw(e,t,r){return(en&21)===0?(e.baseState&&(e.baseState=!1,jt=!0),e.memoizedState=r):(Dr(r,t)||(r=v0(),Oe.lanes|=r,tn|=r,e.baseState=!0),t)}function KT(e,t){var r=ge;ge=r!==0&&4>r?r:4,e(!0);var a=vh.transition;vh.transition={};try{e(!1),t()}finally{ge=r,vh.transition=a}}function hw(){return Sr().memoizedState}function XT(e,t,r){var a=no(e);if(r={lane:a,action:r,hasEagerState:!1,eagerState:null,next:null},mw(e))gw(t,r);else if(r=J0(e,t,r,a),r!==null){var o=Nt();Er(r,e,a,o),yw(r,t,a)}}function JT(e,t,r){var a=no(e),o={lane:a,action:r,hasEagerState:!1,eagerState:null,next:null};if(mw(e))gw(t,o);else{var n=e.alternate;if(e.lanes===0&&(n===null||n.lanes===0)&&(n=t.lastRenderedReducer,n!==null))try{var s=t.lastRenderedState,i=n(s,r);if(o.hasEagerState=!0,o.eagerState=i,Dr(i,s)){var l=t.interleaved;l===null?(o.next=o,Um(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}r=J0(e,t,o,a),r!==null&&(o=Nt(),Er(r,e,a,o),yw(r,t,a))}}function mw(e){var t=e.alternate;return e===Oe||t!==null&&t===Oe}function gw(e,t){dl=Hc=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function yw(e,t,r){if((r&4194240)!==0){var a=t.lanes;a&=e.pendingLanes,r|=a,t.lanes=r,Im(e,r)}}var zc={readContext:wr,useCallback:bt,useContext:bt,useEffect:bt,useImperativeHandle:bt,useInsertionEffect:bt,useLayoutEffect:bt,useMemo:bt,useReducer:bt,useRef:bt,useState:bt,useDebugValue:bt,useDeferredValue:bt,useTransition:bt,useMutableSource:bt,useSyncExternalStore:bt,useId:bt,unstable_isNewReconciler:!1},QT={readContext:wr,useCallback:function(e,t){return zr().memoizedState=[e,t===void 0?null:t],e},useContext:wr,useEffect:Tx,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Cc(4194308,4,uw.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Cc(4194308,4,e,t)},useInsertionEffect:function(e,t){return Cc(4,2,e,t)},useMemo:function(e,t){var r=zr();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var a=zr();return t=r!==void 0?r(t):t,a.memoizedState=a.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},a.queue=e,e=e.dispatch=XT.bind(null,Oe,e),[a.memoizedState,e]},useRef:function(e){var t=zr();return e={current:e},t.memoizedState=e},useState:Px,useDebugValue:Km,useDeferredValue:function(e){return zr().memoizedState=e},useTransition:function(){var e=Px(!1),t=e[0];return e=KT.bind(null,e[1]),zr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var a=Oe,o=zr();if(Ne){if(r===void 0)throw Error(N(407));r=r()}else{if(r=t(),ut===null)throw Error(N(349));(en&30)!==0||tw(a,t,r)}o.memoizedState=r;var n={value:r,getSnapshot:t};return o.queue=n,Tx(aw.bind(null,a,n,e),[e]),a.flags|=2048,Al(9,rw.bind(null,a,n,r,t),void 0,null),r},useId:function(){var e=zr(),t=ut.identifierPrefix;if(Ne){var r=ya,a=ga;r=(a&~(1<<32-Rr(a)-1)).toString(32)+r,t=":"+t+"R"+r,r=Tl++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=GT++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},YT={readContext:wr,useCallback:dw,useContext:wr,useEffect:Gm,useImperativeHandle:cw,useInsertionEffect:iw,useLayoutEffect:lw,useMemo:fw,useReducer:xh,useRef:sw,useState:function(){return xh(_l)},useDebugValue:Km,useDeferredValue:function(e){var t=Sr();return pw(t,tt.memoizedState,e)},useTransition:function(){var e=xh(_l)[0],t=Sr().memoizedState;return[e,t]},useMutableSource:Z0,useSyncExternalStore:ew,useId:hw,unstable_isNewReconciler:!1},ZT={readContext:wr,useCallback:dw,useContext:wr,useEffect:Gm,useImperativeHandle:cw,useInsertionEffect:iw,useLayoutEffect:lw,useMemo:fw,useReducer:wh,useRef:sw,useState:function(){return wh(_l)},useDebugValue:Km,useDeferredValue:function(e){var t=Sr();return tt===null?t.memoizedState=e:pw(t,tt.memoizedState,e)},useTransition:function(){var e=wh(_l)[0],t=Sr().memoizedState;return[e,t]},useMutableSource:Z0,useSyncExternalStore:ew,useId:hw,unstable_isNewReconciler:!1};function Tr(e,t){if(e&&e.defaultProps){t=Be({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function tm(e,t,r,a){t=e.memoizedState,r=r(a,t),r=r==null?t:Be({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var od={isMounted:function(e){return(e=e._reactInternals)?on(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var a=Nt(),o=no(e),n=va(a,o);n.payload=t,r!=null&&(n.callback=r),t=ao(e,n,o),t!==null&&(Er(t,e,o,a),wc(t,e,o))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var a=Nt(),o=no(e),n=va(a,o);n.tag=1,n.payload=t,r!=null&&(n.callback=r),t=ao(e,n,o),t!==null&&(Er(t,e,o,a),wc(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Nt(),a=no(e),o=va(r,a);o.tag=2,t!=null&&(o.callback=t),t=ao(e,o,a),t!==null&&(Er(t,e,a,r),wc(t,e,a))}};function _x(e,t,r,a,o,n,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,n,s):t.prototype&&t.prototype.isPureReactComponent?!Cl(r,a)||!Cl(o,n):!0}function vw(e,t,r){var a=!1,o=lo,n=t.contextType;return typeof n=="object"&&n!==null?n=wr(n):(o=$t(t)?Yo:kt.current,a=t.contextTypes,n=(a=a!=null)?hs(e,o):lo),t=new t(r,n),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=od,e.stateNode=t,t._reactInternals=e,a&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=n),t}function Ax(e,t,r,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,a),t.state!==e&&od.enqueueReplaceState(t,t.state,null)}function rm(e,t,r,a){var o=e.stateNode;o.props=r,o.state=e.memoizedState,o.refs={},Vm(e);var n=t.contextType;typeof n=="object"&&n!==null?o.context=wr(n):(n=$t(t)?Yo:kt.current,o.context=hs(e,n)),o.state=e.memoizedState,n=t.getDerivedStateFromProps,typeof n=="function"&&(tm(e,t,n,r),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&od.enqueueReplaceState(o,o.state,null),qc(e,r,o,a),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function vs(e,t){try{var r="",a=t;do r+=_P(a),a=a.return;while(a);var o=r}catch(n){o=`
7
7
  Error generating stack: `+n.message+`
8
- `+n.stack}return{value:e,source:t,stack:o,digest:null}}function Pm(e,t,a){return{value:e,source:null,stack:a??null,digest:t??null}}function uh(e,t){try{console.error(t.value)}catch(a){setTimeout(function(){throw a})}}var c1=typeof WeakMap=="function"?WeakMap:Map;function Iw(e,t,a){a=cr(-1,a),a.tag=3,a.payload={element:null};var r=t.value;return a.callback=function(){Jd||(Jd=!0,vh=r),uh(e,t)},a}function kw(e,t,a){a=cr(-1,a),a.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;a.payload=function(){return r(o)},a.callback=function(){uh(e,t)}}var n=e.stateNode;return n!==null&&typeof n.componentDidCatch=="function"&&(a.callback=function(){uh(e,t),typeof r!="function"&&(Qr===null?Qr=new Set([this]):Qr.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),a}function Fv(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new c1;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(a)||(o.add(a),e=I1.bind(null,e,t,a),t.then(e,e))}function Bv(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Uv(e,t,a,r,o){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,a.flags|=131072,a.flags&=-52805,a.tag===1&&(a.alternate===null?a.tag=17:(t=cr(-1,1),t.tag=2,Xr(a,t,1))),a.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var f1=gr.ReactCurrentOwner,Nt=!1;function Tt(e,t,a,r){t.child=e===null?tw(t,null,a,r):us(t,e.child,a,r)}function Vv(e,t,a,r,o){a=a.render;var n=t.ref;return os(t,o),r=Jh(e,t,a,r,n,o),a=Yh(),e!==null&&!Nt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,hr(e,t,o)):(_e&&a&&Uh(t),t.flags|=1,Tt(e,t,r,o),t.child)}function jv(e,t,a,r,o){if(e===null){var n=a.type;return typeof n=="function"&&!lg(n)&&n.defaultProps===void 0&&a.compare===null&&a.defaultProps===void 0?(t.tag=15,t.type=n,Pw(e,t,n,r,o)):(e=Rd(a.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(n=e.child,(e.lanes&o)===0){var s=n.memoizedProps;if(a=a.compare,a=a!==null?a:yl,a(s,r)&&e.ref===t.ref)return hr(e,t,o)}return t.flags|=1,e=Yr(n,r),e.ref=t.ref,e.return=t,t.child=e}function Pw(e,t,a,r,o){if(e!==null){var n=e.memoizedProps;if(yl(n,r)&&e.ref===t.ref)if(Nt=!1,t.pendingProps=r=n,(e.lanes&o)!==0)(e.flags&131072)!==0&&(Nt=!0);else return t.lanes=e.lanes,hr(e,t,o)}return dh(e,t,a,r,o)}function Tw(e,t,a){var r=t.pendingProps,o=r.children,n=e!==null?e.memoizedState:null;if(r.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},we(Zn,Gt),Gt|=a;else{if((a&1073741824)===0)return e=n!==null?n.baseLanes|a:a,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,we(Zn,Gt),Gt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=n!==null?n.baseLanes:a,we(Zn,Gt),Gt|=r}else n!==null?(r=n.baseLanes|a,t.memoizedState=null):r=a,we(Zn,Gt),Gt|=r;return Tt(e,t,o,a),t.child}function Aw(e,t){var a=t.ref;(e===null&&a!==null||e!==null&&e.ref!==a)&&(t.flags|=512,t.flags|=2097152)}function dh(e,t,a,r,o){var n=Ft(a)?qo:wt.current;return n=is(t,n),os(t,o),a=Jh(e,t,a,r,n,o),r=Yh(),e!==null&&!Nt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,hr(e,t,o)):(_e&&r&&Uh(t),t.flags|=1,Tt(e,t,a,o),t.child)}function qv(e,t,a,r,o){if(Ft(a)){var n=!0;jd(t)}else n=!1;if(os(t,o),t.stateNode===null)Pd(e,t),bw(t,a,r),lh(t,a,r,o),r=!0;else if(e===null){var s=t.stateNode,i=t.memoizedProps;s.props=i;var l=s.context,u=a.contextType;typeof u=="object"&&u!==null?u=ma(u):(u=Ft(a)?qo:wt.current,u=is(t,u));var d=a.getDerivedStateFromProps,c=typeof d=="function"||typeof s.getSnapshotBeforeUpdate=="function";c||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(i!==r||l!==u)&&Ov(t,s,r,u),Vr=!1;var f=t.memoizedState;s.state=f,Wd(t,r,s,o),l=t.memoizedState,i!==r||f!==l||Ot.current||Vr?(typeof d=="function"&&(ih(t,a,d,r),l=t.memoizedState),(i=Vr||Nv(t,a,i,r,f,l,u))?(c||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),s.props=r,s.state=l,s.context=u,r=i):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,rw(e,t),i=t.memoizedProps,u=t.type===t.elementType?i:Sa(t.type,i),s.props=u,c=t.pendingProps,f=s.context,l=a.contextType,typeof l=="object"&&l!==null?l=ma(l):(l=Ft(a)?qo:wt.current,l=is(t,l));var m=a.getDerivedStateFromProps;(d=typeof m=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(i!==c||f!==l)&&Ov(t,s,r,l),Vr=!1,f=t.memoizedState,s.state=f,Wd(t,r,s,o);var v=t.memoizedState;i!==c||f!==v||Ot.current||Vr?(typeof m=="function"&&(ih(t,a,m,r),v=t.memoizedState),(u=Vr||Nv(t,a,u,r,f,v,l)||!1)?(d||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,v,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,v,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=v),s.props=r,s.state=v,s.context=l,r=u):(typeof s.componentDidUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return ch(e,t,a,r,n,o)}function ch(e,t,a,r,o,n){Aw(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&Pv(t,a,!1),hr(e,t,n);r=t.stateNode,f1.current=t;var i=s&&typeof a.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=us(t,e.child,null,n),t.child=us(t,null,i,n)):Tt(e,t,i,n),t.memoizedState=r.state,o&&Pv(t,a,!0),t.child}function Rw(e){var t=e.stateNode;t.pendingContext?kv(e,t.pendingContext,t.pendingContext!==t.context):t.context&&kv(e,t.context,!1),Gh(e,t.containerInfo)}function Hv(e,t,a,r,o){return ls(),jh(o),t.flags|=256,Tt(e,t,a,r),t.child}var fh={dehydrated:null,treeContext:null,retryLane:0};function ph(e){return{baseLanes:e,cachePool:null,transitions:null}}function _w(e,t,a){var r=t.pendingProps,o=De.current,n=!1,s=(t.flags&128)!==0,i;if((i=s)||(i=e!==null&&e.memoizedState===null?!1:(o&2)!==0),i?(n=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),we(De,o&1),e===null)return nh(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(s=r.children,e=r.fallback,n?(r=t.mode,n=t.child,s={mode:"hidden",children:s},(r&1)===0&&n!==null?(n.childLanes=0,n.pendingProps=s):n=cc(s,r,0,null),e=jo(e,r,a,null),n.return=t,e.return=t,n.sibling=e,t.child=n,t.child.memoizedState=ph(a),t.memoizedState=fh,e):tg(t,s));if(o=e.memoizedState,o!==null&&(i=o.dehydrated,i!==null))return p1(e,t,s,r,i,o,a);if(n){n=r.fallback,s=t.mode,o=e.child,i=o.sibling;var l={mode:"hidden",children:r.children};return(s&1)===0&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=Yr(o,l),r.subtreeFlags=o.subtreeFlags&14680064),i!==null?n=Yr(i,n):(n=jo(n,s,a,null),n.flags|=2),n.return=t,r.return=t,r.sibling=n,t.child=r,r=n,n=t.child,s=e.child.memoizedState,s=s===null?ph(a):{baseLanes:s.baseLanes|a,cachePool:null,transitions:s.transitions},n.memoizedState=s,n.childLanes=e.childLanes&~a,t.memoizedState=fh,r}return n=e.child,e=n.sibling,r=Yr(n,{mode:"visible",children:r.children}),(t.mode&1)===0&&(r.lanes=a),r.return=t,r.sibling=null,e!==null&&(a=t.deletions,a===null?(t.deletions=[e],t.flags|=16):a.push(e)),t.child=r,t.memoizedState=null,r}function tg(e,t){return t=cc({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function xd(e,t,a,r){return r!==null&&jh(r),us(t,e.child,null,a),e=tg(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function p1(e,t,a,r,o,n,s){if(a)return t.flags&256?(t.flags&=-257,r=Pm(Error(M(422))),xd(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(n=r.fallback,o=t.mode,r=cc({mode:"visible",children:r.children},o,0,null),n=jo(n,o,s,null),n.flags|=2,r.return=t,n.return=t,r.sibling=n,t.child=r,(t.mode&1)!==0&&us(t,e.child,null,s),t.child.memoizedState=ph(s),t.memoizedState=fh,n);if((t.mode&1)===0)return xd(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var i=r.dgst;return r=i,n=Error(M(419)),r=Pm(n,r,void 0),xd(e,t,s,r)}if(i=(s&e.childLanes)!==0,Nt||i){if(r=rt,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=(o&(r.suspendedLanes|s))!==0?0:o,o!==0&&o!==n.retryLane&&(n.retryLane=o,mr(e,o),ka(r,e,o,-1))}return ig(),r=Pm(Error(M(421))),xd(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=k1.bind(null,e),o._reactRetry=t,null):(e=n.treeContext,Kt=Kr(o.nextSibling),Xt=t,_e=!0,ba=null,e!==null&&(da[ca++]=ur,da[ca++]=dr,da[ca++]=Ho,ur=e.id,dr=e.overflow,Ho=t),t=tg(t,r.children),t.flags|=4096,t)}function zv(e,t,a){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),sh(e.return,t,a)}function Tm(e,t,a,r,o){var n=e.memoizedState;n===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:a,tailMode:o}:(n.isBackwards=t,n.rendering=null,n.renderingStartTime=0,n.last=r,n.tail=a,n.tailMode=o)}function Ew(e,t,a){var r=t.pendingProps,o=r.revealOrder,n=r.tail;if(Tt(e,t,r.children,a),r=De.current,(r&2)!==0)r=r&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&zv(e,a,t);else if(e.tag===19)zv(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(we(De,r),(t.mode&1)===0)t.memoizedState=null;else switch(o){case"forwards":for(a=t.child,o=null;a!==null;)e=a.alternate,e!==null&&Gd(e)===null&&(o=a),a=a.sibling;a=o,a===null?(o=t.child,t.child=null):(o=a.sibling,a.sibling=null),Tm(t,!1,o,a,n);break;case"backwards":for(a=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Gd(e)===null){t.child=o;break}e=o.sibling,o.sibling=a,a=o,o=e}Tm(t,!0,a,null,n);break;case"together":Tm(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Pd(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function hr(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),$o|=t.lanes,(a&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(M(153));if(t.child!==null){for(e=t.child,a=Yr(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Yr(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function m1(e,t,a){switch(t.tag){case 3:Rw(t),ls();break;case 5:ow(t);break;case 1:Ft(t.type)&&jd(t);break;case 4:Gh(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;we(zd,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(we(De,De.current&1),t.flags|=128,null):(a&t.child.childLanes)!==0?_w(e,t,a):(we(De,De.current&1),e=hr(e,t,a),e!==null?e.sibling:null);we(De,De.current&1);break;case 19:if(r=(a&t.childLanes)!==0,(e.flags&128)!==0){if(r)return Ew(e,t,a);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),we(De,De.current),r)break;return null;case 22:case 23:return t.lanes=0,Tw(e,t,a)}return hr(e,t,a)}var Dw,mh,Mw,Nw;Dw=function(e,t){for(var a=t.child;a!==null;){if(a.tag===5||a.tag===6)e.appendChild(a.stateNode);else if(a.tag!==4&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return;a=a.return}a.sibling.return=a.return,a=a.sibling}};mh=function(){};Mw=function(e,t,a,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Uo(Va.current);var n=null;switch(a){case"input":o=Om(e,o),r=Om(e,r),n=[];break;case"select":o=Ne({},o,{value:void 0}),r=Ne({},r,{value:void 0}),n=[];break;case"textarea":o=Um(e,o),r=Um(e,r),n=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Ud)}jm(a,r);var s;a=null;for(u in o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var i=o[u];for(s in i)i.hasOwnProperty(s)&&(a||(a={}),a[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(dl.hasOwnProperty(u)?n||(n=[]):(n=n||[]).push(u,null));for(u in r){var l=r[u];if(i=o?.[u],r.hasOwnProperty(u)&&l!==i&&(l!=null||i!=null))if(u==="style")if(i){for(s in i)!i.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(a||(a={}),a[s]="");for(s in l)l.hasOwnProperty(s)&&i[s]!==l[s]&&(a||(a={}),a[s]=l[s])}else a||(n||(n=[]),n.push(u,a)),a=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,i=i?i.__html:void 0,l!=null&&i!==l&&(n=n||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(n=n||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(dl.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&Ie("scroll",e),n||i===l||(n=[])):(n=n||[]).push(u,l))}a&&(n=n||[]).push("style",a);var u=n;(t.updateQueue=u)&&(t.flags|=4)}};Nw=function(e,t,a,r){a!==r&&(t.flags|=4)};function Ki(e,t){if(!_e)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var r=null;a!==null;)a.alternate!==null&&(r=a),a=a.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function xt(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,r=0;if(t)for(var o=e.child;o!==null;)a|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)a|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=a,t}function h1(e,t,a){var r=t.pendingProps;switch(Vh(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xt(t),null;case 1:return Ft(t.type)&&Vd(),xt(t),null;case 3:return r=t.stateNode,ds(),ke(Ot),ke(wt),Xh(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(gd(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ba!==null&&(Sh(ba),ba=null))),mh(e,t),xt(t),null;case 5:Kh(t);var o=Uo(Sl.current);if(a=t.type,e!==null&&t.stateNode!=null)Mw(e,t,a,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(M(166));return xt(t),null}if(e=Uo(Va.current),gd(t)){r=t.stateNode,a=t.type;var n=t.memoizedProps;switch(r[Ba]=t,r[wl]=n,e=(t.mode&1)!==0,a){case"dialog":Ie("cancel",r),Ie("close",r);break;case"iframe":case"object":case"embed":Ie("load",r);break;case"video":case"audio":for(o=0;o<el.length;o++)Ie(el[o],r);break;case"source":Ie("error",r);break;case"img":case"image":case"link":Ie("error",r),Ie("load",r);break;case"details":Ie("toggle",r);break;case"input":Yx(r,n),Ie("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!n.multiple},Ie("invalid",r);break;case"textarea":ev(r,n),Ie("invalid",r)}jm(a,n),o=null;for(var s in n)if(n.hasOwnProperty(s)){var i=n[s];s==="children"?typeof i=="string"?r.textContent!==i&&(n.suppressHydrationWarning!==!0&&hd(r.textContent,i,e),o=["children",i]):typeof i=="number"&&r.textContent!==""+i&&(n.suppressHydrationWarning!==!0&&hd(r.textContent,i,e),o=["children",""+i]):dl.hasOwnProperty(s)&&i!=null&&s==="onScroll"&&Ie("scroll",r)}switch(a){case"input":rd(r),Zx(r,n,!0);break;case"textarea":rd(r),tv(r);break;case"select":case"option":break;default:typeof n.onClick=="function"&&(r.onclick=Ud)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=u0(a)),e==="http://www.w3.org/1999/xhtml"?a==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(a,{is:r.is}):(e=s.createElement(a),a==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,a),e[Ba]=t,e[wl]=r,Dw(e,t,!1,!1),t.stateNode=e;e:{switch(s=qm(a,r),a){case"dialog":Ie("cancel",e),Ie("close",e),o=r;break;case"iframe":case"object":case"embed":Ie("load",e),o=r;break;case"video":case"audio":for(o=0;o<el.length;o++)Ie(el[o],e);o=r;break;case"source":Ie("error",e),o=r;break;case"img":case"image":case"link":Ie("error",e),Ie("load",e),o=r;break;case"details":Ie("toggle",e),o=r;break;case"input":Yx(e,r),o=Om(e,r),Ie("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Ne({},r,{value:void 0}),Ie("invalid",e);break;case"textarea":ev(e,r),o=Um(e,r),Ie("invalid",e);break;default:o=r}jm(a,o),i=o;for(n in i)if(i.hasOwnProperty(n)){var l=i[n];n==="style"?f0(e,l):n==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&d0(e,l)):n==="children"?typeof l=="string"?(a!=="textarea"||l!=="")&&cl(e,l):typeof l=="number"&&cl(e,""+l):n!=="suppressContentEditableWarning"&&n!=="suppressHydrationWarning"&&n!=="autoFocus"&&(dl.hasOwnProperty(n)?l!=null&&n==="onScroll"&&Ie("scroll",e):l!=null&&Ih(e,n,l,s))}switch(a){case"input":rd(e),Zx(e,r,!1);break;case"textarea":rd(e),tv(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Zr(r.value));break;case"select":e.multiple=!!r.multiple,n=r.value,n!=null?es(e,!!r.multiple,n,!1):r.defaultValue!=null&&es(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Ud)}switch(a){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return xt(t),null;case 6:if(e&&t.stateNode!=null)Nw(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(M(166));if(a=Uo(Sl.current),Uo(Va.current),gd(t)){if(r=t.stateNode,a=t.memoizedProps,r[Ba]=t,(n=r.nodeValue!==a)&&(e=Xt,e!==null))switch(e.tag){case 3:hd(r.nodeValue,a,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&hd(r.nodeValue,a,(e.mode&1)!==0)}n&&(t.flags|=4)}else r=(a.nodeType===9?a:a.ownerDocument).createTextNode(r),r[Ba]=t,t.stateNode=r}return xt(t),null;case 13:if(ke(De),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(_e&&Kt!==null&&(t.mode&1)!==0&&(t.flags&128)===0)Z0(),ls(),t.flags|=98560,n=!1;else if(n=gd(t),r!==null&&r.dehydrated!==null){if(e===null){if(!n)throw Error(M(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(M(317));n[Ba]=t}else ls(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;xt(t),n=!1}else ba!==null&&(Sh(ba),ba=null),n=!0;if(!n)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=a,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(De.current&1)!==0?Ye===0&&(Ye=3):ig())),t.updateQueue!==null&&(t.flags|=4),xt(t),null);case 4:return ds(),mh(e,t),e===null&&xl(t.stateNode.containerInfo),xt(t),null;case 10:return zh(t.type._context),xt(t),null;case 17:return Ft(t.type)&&Vd(),xt(t),null;case 19:if(ke(De),n=t.memoizedState,n===null)return xt(t),null;if(r=(t.flags&128)!==0,s=n.rendering,s===null)if(r)Ki(n,!1);else{if(Ye!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(s=Gd(e),s!==null){for(t.flags|=128,Ki(n,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=a,a=t.child;a!==null;)n=a,e=r,n.flags&=14680066,s=n.alternate,s===null?(n.childLanes=0,n.lanes=e,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=s.childLanes,n.lanes=s.lanes,n.child=s.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=s.memoizedProps,n.memoizedState=s.memoizedState,n.updateQueue=s.updateQueue,n.type=s.type,e=s.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),a=a.sibling;return we(De,De.current&1|2),t.child}e=e.sibling}n.tail!==null&&qe()>fs&&(t.flags|=128,r=!0,Ki(n,!1),t.lanes=4194304)}else{if(!r)if(e=Gd(s),e!==null){if(t.flags|=128,r=!0,a=e.updateQueue,a!==null&&(t.updateQueue=a,t.flags|=4),Ki(n,!0),n.tail===null&&n.tailMode==="hidden"&&!s.alternate&&!_e)return xt(t),null}else 2*qe()-n.renderingStartTime>fs&&a!==1073741824&&(t.flags|=128,r=!0,Ki(n,!1),t.lanes=4194304);n.isBackwards?(s.sibling=t.child,t.child=s):(a=n.last,a!==null?a.sibling=s:t.child=s,n.last=s)}return n.tail!==null?(t=n.tail,n.rendering=t,n.tail=t.sibling,n.renderingStartTime=qe(),t.sibling=null,a=De.current,we(De,r?a&1|2:a&1),t):(xt(t),null);case 22:case 23:return sg(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(Gt&1073741824)!==0&&(xt(t),t.subtreeFlags&6&&(t.flags|=8192)):xt(t),null;case 24:return null;case 25:return null}throw Error(M(156,t.tag))}function g1(e,t){switch(Vh(t),t.tag){case 1:return Ft(t.type)&&Vd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ds(),ke(Ot),ke(wt),Xh(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Kh(t),null;case 13:if(ke(De),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(M(340));ls()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ke(De),null;case 4:return ds(),null;case 10:return zh(t.type._context),null;case 22:case 23:return sg(),null;case 24:return null;default:return null}}var vd=!1,vt=!1,y1=typeof WeakSet=="function"?WeakSet:Set,B=null;function Yn(e,t){var a=e.ref;if(a!==null)if(typeof a=="function")try{a(null)}catch(r){Ue(e,t,r)}else a.current=null}function hh(e,t,a){try{a()}catch(r){Ue(e,t,r)}}var $v=!1;function x1(e,t){if(Ym=Od,e=V0(),Bh(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var r=a.getSelection&&a.getSelection();if(r&&r.rangeCount!==0){a=r.anchorNode;var o=r.anchorOffset,n=r.focusNode;r=r.focusOffset;try{a.nodeType,n.nodeType}catch{a=null;break e}var s=0,i=-1,l=-1,u=0,d=0,c=e,f=null;t:for(;;){for(var m;c!==a||o!==0&&c.nodeType!==3||(i=s+o),c!==n||r!==0&&c.nodeType!==3||(l=s+r),c.nodeType===3&&(s+=c.nodeValue.length),(m=c.firstChild)!==null;)f=c,c=m;for(;;){if(c===e)break t;if(f===a&&++u===o&&(i=s),f===n&&++d===r&&(l=s),(m=c.nextSibling)!==null)break;c=f,f=c.parentNode}c=m}a=i===-1||l===-1?null:{start:i,end:l}}else a=null}a=a||{start:0,end:0}}else a=null;for(Zm={focusedElem:e,selectionRange:a},Od=!1,B=t;B!==null;)if(t=B,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,B=e;else for(;B!==null;){t=B;try{var v=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var w=v.memoizedProps,S=v.memoizedState,h=t.stateNode,g=h.getSnapshotBeforeUpdate(t.elementType===t.type?w:Sa(t.type,w),S);h.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(M(163))}}catch(L){Ue(t,t.return,L)}if(e=t.sibling,e!==null){e.return=t.return,B=e;break}B=t.return}return v=$v,$v=!1,v}function il(e,t,a){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var n=o.destroy;o.destroy=void 0,n!==void 0&&hh(t,a,n)}o=o.next}while(o!==r)}}function uc(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var a=t=t.next;do{if((a.tag&e)===e){var r=a.create;a.destroy=r()}a=a.next}while(a!==t)}}function gh(e){var t=e.ref;if(t!==null){var a=e.stateNode;e.tag,e=a,typeof t=="function"?t(e):t.current=e}}function Ow(e){var t=e.alternate;t!==null&&(e.alternate=null,Ow(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ba],delete t[wl],delete t[ah],delete t[e1],delete t[t1])),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 Fw(e){return e.tag===5||e.tag===3||e.tag===4}function Wv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Fw(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 yh(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?a.nodeType===8?a.parentNode.insertBefore(e,t):a.insertBefore(e,t):(a.nodeType===8?(t=a.parentNode,t.insertBefore(e,a)):(t=a,t.appendChild(e)),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Ud));else if(r!==4&&(e=e.child,e!==null))for(yh(e,t,a),e=e.sibling;e!==null;)yh(e,t,a),e=e.sibling}function xh(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(xh(e,t,a),e=e.sibling;e!==null;)xh(e,t,a),e=e.sibling}var it=null,La=!1;function Br(e,t,a){for(a=a.child;a!==null;)Bw(e,t,a),a=a.sibling}function Bw(e,t,a){if(Ua&&typeof Ua.onCommitFiberUnmount=="function")try{Ua.onCommitFiberUnmount(tc,a)}catch{}switch(a.tag){case 5:vt||Yn(a,t);case 6:var r=it,o=La;it=null,Br(e,t,a),it=r,La=o,it!==null&&(La?(e=it,a=a.stateNode,e.nodeType===8?e.parentNode.removeChild(a):e.removeChild(a)):it.removeChild(a.stateNode));break;case 18:it!==null&&(La?(e=it,a=a.stateNode,e.nodeType===8?Cm(e.parentNode,a):e.nodeType===1&&Cm(e,a),hl(e)):Cm(it,a.stateNode));break;case 4:r=it,o=La,it=a.stateNode.containerInfo,La=!0,Br(e,t,a),it=r,La=o;break;case 0:case 11:case 14:case 15:if(!vt&&(r=a.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var n=o,s=n.destroy;n=n.tag,s!==void 0&&((n&2)!==0||(n&4)!==0)&&hh(a,t,s),o=o.next}while(o!==r)}Br(e,t,a);break;case 1:if(!vt&&(Yn(a,t),r=a.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=a.memoizedProps,r.state=a.memoizedState,r.componentWillUnmount()}catch(i){Ue(a,t,i)}Br(e,t,a);break;case 21:Br(e,t,a);break;case 22:a.mode&1?(vt=(r=vt)||a.memoizedState!==null,Br(e,t,a),vt=r):Br(e,t,a);break;default:Br(e,t,a)}}function Gv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var a=e.stateNode;a===null&&(a=e.stateNode=new y1),t.forEach(function(r){var o=P1.bind(null,e,r);a.has(r)||(a.add(r),r.then(o,o))})}}function Ca(e,t){var a=t.deletions;if(a!==null)for(var r=0;r<a.length;r++){var o=a[r];try{var n=e,s=t,i=s;e:for(;i!==null;){switch(i.tag){case 5:it=i.stateNode,La=!1;break e;case 3:it=i.stateNode.containerInfo,La=!0;break e;case 4:it=i.stateNode.containerInfo,La=!0;break e}i=i.return}if(it===null)throw Error(M(160));Bw(n,s,o),it=null,La=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(u){Ue(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Uw(t,e),t=t.sibling}function Uw(e,t){var a=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ca(t,e),Oa(e),r&4){try{il(3,e,e.return),uc(3,e)}catch(w){Ue(e,e.return,w)}try{il(5,e,e.return)}catch(w){Ue(e,e.return,w)}}break;case 1:Ca(t,e),Oa(e),r&512&&a!==null&&Yn(a,a.return);break;case 5:if(Ca(t,e),Oa(e),r&512&&a!==null&&Yn(a,a.return),e.flags&32){var o=e.stateNode;try{cl(o,"")}catch(w){Ue(e,e.return,w)}}if(r&4&&(o=e.stateNode,o!=null)){var n=e.memoizedProps,s=a!==null?a.memoizedProps:n,i=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{i==="input"&&n.type==="radio"&&n.name!=null&&i0(o,n),qm(i,s);var u=qm(i,n);for(s=0;s<l.length;s+=2){var d=l[s],c=l[s+1];d==="style"?f0(o,c):d==="dangerouslySetInnerHTML"?d0(o,c):d==="children"?cl(o,c):Ih(o,d,c,u)}switch(i){case"input":Fm(o,n);break;case"textarea":l0(o,n);break;case"select":var f=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!n.multiple;var m=n.value;m!=null?es(o,!!n.multiple,m,!1):f!==!!n.multiple&&(n.defaultValue!=null?es(o,!!n.multiple,n.defaultValue,!0):es(o,!!n.multiple,n.multiple?[]:"",!1))}o[wl]=n}catch(w){Ue(e,e.return,w)}}break;case 6:if(Ca(t,e),Oa(e),r&4){if(e.stateNode===null)throw Error(M(162));o=e.stateNode,n=e.memoizedProps;try{o.nodeValue=n}catch(w){Ue(e,e.return,w)}}break;case 3:if(Ca(t,e),Oa(e),r&4&&a!==null&&a.memoizedState.isDehydrated)try{hl(t.containerInfo)}catch(w){Ue(e,e.return,w)}break;case 4:Ca(t,e),Oa(e);break;case 13:Ca(t,e),Oa(e),o=e.child,o.flags&8192&&(n=o.memoizedState!==null,o.stateNode.isHidden=n,!n||o.alternate!==null&&o.alternate.memoizedState!==null||(og=qe())),r&4&&Gv(e);break;case 22:if(d=a!==null&&a.memoizedState!==null,e.mode&1?(vt=(u=vt)||d,Ca(t,e),vt=u):Ca(t,e),Oa(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&(e.mode&1)!==0)for(B=e,d=e.child;d!==null;){for(c=B=d;B!==null;){switch(f=B,m=f.child,f.tag){case 0:case 11:case 14:case 15:il(4,f,f.return);break;case 1:Yn(f,f.return);var v=f.stateNode;if(typeof v.componentWillUnmount=="function"){r=f,a=f.return;try{t=r,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(w){Ue(r,a,w)}}break;case 5:Yn(f,f.return);break;case 22:if(f.memoizedState!==null){Xv(c);continue}}m!==null?(m.return=f,B=m):Xv(c)}d=d.sibling}e:for(d=null,c=e;;){if(c.tag===5){if(d===null){d=c;try{o=c.stateNode,u?(n=o.style,typeof n.setProperty=="function"?n.setProperty("display","none","important"):n.display="none"):(i=c.stateNode,l=c.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,i.style.display=c0("display",s))}catch(w){Ue(e,e.return,w)}}}else if(c.tag===6){if(d===null)try{c.stateNode.nodeValue=u?"":c.memoizedProps}catch(w){Ue(e,e.return,w)}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===e)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===e)break e;for(;c.sibling===null;){if(c.return===null||c.return===e)break e;d===c&&(d=null),c=c.return}d===c&&(d=null),c.sibling.return=c.return,c=c.sibling}}break;case 19:Ca(t,e),Oa(e),r&4&&Gv(e);break;case 21:break;default:Ca(t,e),Oa(e)}}function Oa(e){var t=e.flags;if(t&2){try{e:{for(var a=e.return;a!==null;){if(Fw(a)){var r=a;break e}a=a.return}throw Error(M(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(cl(o,""),r.flags&=-33);var n=Wv(e);xh(e,n,o);break;case 3:case 4:var s=r.stateNode.containerInfo,i=Wv(e);yh(e,i,s);break;default:throw Error(M(161))}}catch(l){Ue(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function v1(e,t,a){B=e,Vw(e,t,a)}function Vw(e,t,a){for(var r=(e.mode&1)!==0;B!==null;){var o=B,n=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||vd;if(!s){var i=o.alternate,l=i!==null&&i.memoizedState!==null||vt;i=vd;var u=vt;if(vd=s,(vt=l)&&!u)for(B=o;B!==null;)s=B,l=s.child,s.tag===22&&s.memoizedState!==null?Qv(o):l!==null?(l.return=s,B=l):Qv(o);for(;n!==null;)B=n,Vw(n,t,a),n=n.sibling;B=o,vd=i,vt=u}Kv(e,t,a)}else(o.subtreeFlags&8772)!==0&&n!==null?(n.return=o,B=n):Kv(e,t,a)}}function Kv(e){for(;B!==null;){var t=B;if((t.flags&8772)!==0){var a=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:vt||uc(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!vt)if(a===null)r.componentDidMount();else{var o=t.elementType===t.type?a.memoizedProps:Sa(t.type,a.memoizedProps);r.componentDidUpdate(o,a.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var n=t.updateQueue;n!==null&&Ev(t,n,r);break;case 3:var s=t.updateQueue;if(s!==null){if(a=null,t.child!==null)switch(t.child.tag){case 5:a=t.child.stateNode;break;case 1:a=t.child.stateNode}Ev(t,s,a)}break;case 5:var i=t.stateNode;if(a===null&&t.flags&4){a=i;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&a.focus();break;case"img":l.src&&(a.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var c=d.dehydrated;c!==null&&hl(c)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(M(163))}vt||t.flags&512&&gh(t)}catch(f){Ue(t,t.return,f)}}if(t===e){B=null;break}if(a=t.sibling,a!==null){a.return=t.return,B=a;break}B=t.return}}function Xv(e){for(;B!==null;){var t=B;if(t===e){B=null;break}var a=t.sibling;if(a!==null){a.return=t.return,B=a;break}B=t.return}}function Qv(e){for(;B!==null;){var t=B;try{switch(t.tag){case 0:case 11:case 15:var a=t.return;try{uc(4,t)}catch(l){Ue(t,a,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(l){Ue(t,o,l)}}var n=t.return;try{gh(t)}catch(l){Ue(t,n,l)}break;case 5:var s=t.return;try{gh(t)}catch(l){Ue(t,s,l)}}}catch(l){Ue(t,t.return,l)}if(t===e){B=null;break}var i=t.sibling;if(i!==null){i.return=t.return,B=i;break}B=t.return}}var w1=Math.ceil,Qd=gr.ReactCurrentDispatcher,ag=gr.ReactCurrentOwner,pa=gr.ReactCurrentBatchConfig,de=0,rt=null,We=null,lt=0,Gt=0,Zn=ao(0),Ye=0,kl=null,$o=0,dc=0,rg=0,ll=null,Mt=null,og=0,fs=1/0,ir=null,Jd=!1,vh=null,Qr=null,wd=!1,zr=null,Yd=0,ul=0,wh=null,Td=-1,Ad=0;function At(){return(de&6)!==0?qe():Td!==-1?Td:Td=qe()}function Jr(e){return(e.mode&1)===0?1:(de&2)!==0&&lt!==0?lt&-lt:r1.transition!==null?(Ad===0&&(Ad=b0()),Ad):(e=he,e!==0||(e=window.event,e=e===void 0?16:_0(e.type)),e)}function ka(e,t,a,r){if(50<ul)throw ul=0,wh=null,Error(M(185));Pl(e,a,r),((de&2)===0||e!==rt)&&(e===rt&&((de&2)===0&&(dc|=a),Ye===4&&qr(e,lt)),Bt(e,r),a===1&&de===0&&(t.mode&1)===0&&(fs=qe()+500,sc&&ro()))}function Bt(e,t){var a=e.callbackNode;nT(e,t);var r=Nd(e,e===rt?lt:0);if(r===0)a!==null&&ov(a),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(a!=null&&ov(a),t===1)e.tag===0?a1(Jv.bind(null,e)):Q0(Jv.bind(null,e)),YT(function(){(de&6)===0&&ro()}),a=null;else{switch(I0(r)){case 1:a=Rh;break;case 4:a=S0;break;case 16:a=Md;break;case 536870912:a=L0;break;default:a=Md}a=Kw(a,jw.bind(null,e))}e.callbackPriority=t,e.callbackNode=a}}function jw(e,t){if(Td=-1,Ad=0,(de&6)!==0)throw Error(M(327));var a=e.callbackNode;if(ns()&&e.callbackNode!==a)return null;var r=Nd(e,e===rt?lt:0);if(r===0)return null;if((r&30)!==0||(r&e.expiredLanes)!==0||t)t=Zd(e,r);else{t=r;var o=de;de|=2;var n=Hw();(rt!==e||lt!==t)&&(ir=null,fs=qe()+500,Vo(e,t));do try{L1();break}catch(i){qw(e,i)}while(!0);Hh(),Qd.current=n,de=o,We!==null?t=0:(rt=null,lt=0,t=Ye)}if(t!==0){if(t===2&&(o=Gm(e),o!==0&&(r=o,t=Ch(e,o))),t===1)throw a=kl,Vo(e,0),qr(e,r),Bt(e,qe()),a;if(t===6)qr(e,r);else{if(o=e.current.alternate,(r&30)===0&&!C1(o)&&(t=Zd(e,r),t===2&&(n=Gm(e),n!==0&&(r=n,t=Ch(e,n))),t===1))throw a=kl,Vo(e,0),qr(e,r),Bt(e,qe()),a;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(M(345));case 2:Oo(e,Mt,ir);break;case 3:if(qr(e,r),(r&130023424)===r&&(t=og+500-qe(),10<t)){if(Nd(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){At(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=th(Oo.bind(null,e,Mt,ir),t);break}Oo(e,Mt,ir);break;case 4:if(qr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-Ia(r);n=1<<s,s=t[s],s>o&&(o=s),r&=~n}if(r=o,r=qe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*w1(r/1960))-r,10<r){e.timeoutHandle=th(Oo.bind(null,e,Mt,ir),r);break}Oo(e,Mt,ir);break;case 5:Oo(e,Mt,ir);break;default:throw Error(M(329))}}}return Bt(e,qe()),e.callbackNode===a?jw.bind(null,e):null}function Ch(e,t){var a=ll;return e.current.memoizedState.isDehydrated&&(Vo(e,t).flags|=256),e=Zd(e,t),e!==2&&(t=Mt,Mt=a,t!==null&&Sh(t)),e}function Sh(e){Mt===null?Mt=e:Mt.push.apply(Mt,e)}function C1(e){for(var t=e;;){if(t.flags&16384){var a=t.updateQueue;if(a!==null&&(a=a.stores,a!==null))for(var r=0;r<a.length;r++){var o=a[r],n=o.getSnapshot;o=o.value;try{if(!Pa(n(),o))return!1}catch{return!1}}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function qr(e,t){for(t&=~rg,t&=~dc,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var a=31-Ia(t),r=1<<a;e[a]=-1,t&=~r}}function Jv(e){if((de&6)!==0)throw Error(M(327));ns();var t=Nd(e,0);if((t&1)===0)return Bt(e,qe()),null;var a=Zd(e,t);if(e.tag!==0&&a===2){var r=Gm(e);r!==0&&(t=r,a=Ch(e,r))}if(a===1)throw a=kl,Vo(e,0),qr(e,t),Bt(e,qe()),a;if(a===6)throw Error(M(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Oo(e,Mt,ir),Bt(e,qe()),null}function ng(e,t){var a=de;de|=1;try{return e(t)}finally{de=a,de===0&&(fs=qe()+500,sc&&ro())}}function Wo(e){zr!==null&&zr.tag===0&&(de&6)===0&&ns();var t=de;de|=1;var a=pa.transition,r=he;try{if(pa.transition=null,he=1,e)return e()}finally{he=r,pa.transition=a,de=t,(de&6)===0&&ro()}}function sg(){Gt=Zn.current,ke(Zn)}function Vo(e,t){e.finishedWork=null,e.finishedLanes=0;var a=e.timeoutHandle;if(a!==-1&&(e.timeoutHandle=-1,JT(a)),We!==null)for(a=We.return;a!==null;){var r=a;switch(Vh(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Vd();break;case 3:ds(),ke(Ot),ke(wt),Xh();break;case 5:Kh(r);break;case 4:ds();break;case 13:ke(De);break;case 19:ke(De);break;case 10:zh(r.type._context);break;case 22:case 23:sg()}a=a.return}if(rt=e,We=e=Yr(e.current,null),lt=Gt=t,Ye=0,kl=null,rg=dc=$o=0,Mt=ll=null,Bo!==null){for(t=0;t<Bo.length;t++)if(a=Bo[t],r=a.interleaved,r!==null){a.interleaved=null;var o=r.next,n=a.pending;if(n!==null){var s=n.next;n.next=o,r.next=s}a.pending=r}Bo=null}return e}function qw(e,t){do{var a=We;try{if(Hh(),Id.current=Xd,Kd){for(var r=Me.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Kd=!1}if(zo=0,at=Je=Me=null,sl=!1,Ll=0,ag.current=null,a===null||a.return===null){Ye=1,kl=t,We=null;break}e:{var n=e,s=a.return,i=a,l=t;if(t=lt,i.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,d=i,c=d.tag;if((d.mode&1)===0&&(c===0||c===11||c===15)){var f=d.alternate;f?(d.updateQueue=f.updateQueue,d.memoizedState=f.memoizedState,d.lanes=f.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=Bv(s);if(m!==null){m.flags&=-257,Uv(m,s,i,n,t),m.mode&1&&Fv(n,u,t),t=m,l=u;var v=t.updateQueue;if(v===null){var w=new Set;w.add(l),t.updateQueue=w}else v.add(l);break e}else{if((t&1)===0){Fv(n,u,t),ig();break e}l=Error(M(426))}}else if(_e&&i.mode&1){var S=Bv(s);if(S!==null){(S.flags&65536)===0&&(S.flags|=256),Uv(S,s,i,n,t),jh(cs(l,i));break e}}n=l=cs(l,i),Ye!==4&&(Ye=2),ll===null?ll=[n]:ll.push(n),n=s;do{switch(n.tag){case 3:n.flags|=65536,t&=-t,n.lanes|=t;var h=Iw(n,l,t);_v(n,h);break e;case 1:i=l;var g=n.type,x=n.stateNode;if((n.flags&128)===0&&(typeof g.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Qr===null||!Qr.has(x)))){n.flags|=65536,t&=-t,n.lanes|=t;var L=kw(n,i,t);_v(n,L);break e}}n=n.return}while(n!==null)}$w(a)}catch(I){t=I,We===a&&a!==null&&(We=a=a.return);continue}break}while(!0)}function Hw(){var e=Qd.current;return Qd.current=Xd,e===null?Xd:e}function ig(){(Ye===0||Ye===3||Ye===2)&&(Ye=4),rt===null||($o&268435455)===0&&(dc&268435455)===0||qr(rt,lt)}function Zd(e,t){var a=de;de|=2;var r=Hw();(rt!==e||lt!==t)&&(ir=null,Vo(e,t));do try{S1();break}catch(o){qw(e,o)}while(!0);if(Hh(),de=a,Qd.current=r,We!==null)throw Error(M(261));return rt=null,lt=0,Ye}function S1(){for(;We!==null;)zw(We)}function L1(){for(;We!==null&&!QP();)zw(We)}function zw(e){var t=Gw(e.alternate,e,Gt);e.memoizedProps=e.pendingProps,t===null?$w(e):We=t,ag.current=null}function $w(e){var t=e;do{var a=t.alternate;if(e=t.return,(t.flags&32768)===0){if(a=h1(a,t,Gt),a!==null){We=a;return}}else{if(a=g1(a,t),a!==null){a.flags&=32767,We=a;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ye=6,We=null;return}}if(t=t.sibling,t!==null){We=t;return}We=t=e}while(t!==null);Ye===0&&(Ye=5)}function Oo(e,t,a){var r=he,o=pa.transition;try{pa.transition=null,he=1,b1(e,t,a,r)}finally{pa.transition=o,he=r}return null}function b1(e,t,a,r){do ns();while(zr!==null);if((de&6)!==0)throw Error(M(327));a=e.finishedWork;var o=e.finishedLanes;if(a===null)return null;if(e.finishedWork=null,e.finishedLanes=0,a===e.current)throw Error(M(177));e.callbackNode=null,e.callbackPriority=0;var n=a.lanes|a.childLanes;if(sT(e,n),e===rt&&(We=rt=null,lt=0),(a.subtreeFlags&2064)===0&&(a.flags&2064)===0||wd||(wd=!0,Kw(Md,function(){return ns(),null})),n=(a.flags&15990)!==0,(a.subtreeFlags&15990)!==0||n){n=pa.transition,pa.transition=null;var s=he;he=1;var i=de;de|=4,ag.current=null,x1(e,a),Uw(a,e),WT(Zm),Od=!!Ym,Zm=Ym=null,e.current=a,v1(a,e,o),JP(),de=i,he=s,pa.transition=n}else e.current=a;if(wd&&(wd=!1,zr=e,Yd=o),n=e.pendingLanes,n===0&&(Qr=null),eT(a.stateNode,r),Bt(e,qe()),t!==null)for(r=e.onRecoverableError,a=0;a<t.length;a++)o=t[a],r(o.value,{componentStack:o.stack,digest:o.digest});if(Jd)throw Jd=!1,e=vh,vh=null,e;return(Yd&1)!==0&&e.tag!==0&&ns(),n=e.pendingLanes,(n&1)!==0?e===wh?ul++:(ul=0,wh=e):ul=0,ro(),null}function ns(){if(zr!==null){var e=I0(Yd),t=pa.transition,a=he;try{if(pa.transition=null,he=16>e?16:e,zr===null)var r=!1;else{if(e=zr,zr=null,Yd=0,(de&6)!==0)throw Error(M(331));var o=de;for(de|=4,B=e.current;B!==null;){var n=B,s=n.child;if((B.flags&16)!==0){var i=n.deletions;if(i!==null){for(var l=0;l<i.length;l++){var u=i[l];for(B=u;B!==null;){var d=B;switch(d.tag){case 0:case 11:case 15:il(8,d,n)}var c=d.child;if(c!==null)c.return=d,B=c;else for(;B!==null;){d=B;var f=d.sibling,m=d.return;if(Ow(d),d===u){B=null;break}if(f!==null){f.return=m,B=f;break}B=m}}}var v=n.alternate;if(v!==null){var w=v.child;if(w!==null){v.child=null;do{var S=w.sibling;w.sibling=null,w=S}while(w!==null)}}B=n}}if((n.subtreeFlags&2064)!==0&&s!==null)s.return=n,B=s;else e:for(;B!==null;){if(n=B,(n.flags&2048)!==0)switch(n.tag){case 0:case 11:case 15:il(9,n,n.return)}var h=n.sibling;if(h!==null){h.return=n.return,B=h;break e}B=n.return}}var g=e.current;for(B=g;B!==null;){s=B;var x=s.child;if((s.subtreeFlags&2064)!==0&&x!==null)x.return=s,B=x;else e:for(s=g;B!==null;){if(i=B,(i.flags&2048)!==0)try{switch(i.tag){case 0:case 11:case 15:uc(9,i)}}catch(I){Ue(i,i.return,I)}if(i===s){B=null;break e}var L=i.sibling;if(L!==null){L.return=i.return,B=L;break e}B=i.return}}if(de=o,ro(),Ua&&typeof Ua.onPostCommitFiberRoot=="function")try{Ua.onPostCommitFiberRoot(tc,e)}catch{}r=!0}return r}finally{he=a,pa.transition=t}}return!1}function Yv(e,t,a){t=cs(a,t),t=Iw(e,t,1),e=Xr(e,t,1),t=At(),e!==null&&(Pl(e,1,t),Bt(e,t))}function Ue(e,t,a){if(e.tag===3)Yv(e,e,a);else for(;t!==null;){if(t.tag===3){Yv(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Qr===null||!Qr.has(r))){e=cs(a,e),e=kw(t,e,1),t=Xr(t,e,1),e=At(),t!==null&&(Pl(t,1,e),Bt(t,e));break}}t=t.return}}function I1(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),t=At(),e.pingedLanes|=e.suspendedLanes&a,rt===e&&(lt&a)===a&&(Ye===4||Ye===3&&(lt&130023424)===lt&&500>qe()-og?Vo(e,0):rg|=a),Bt(e,t)}function Ww(e,t){t===0&&((e.mode&1)===0?t=1:(t=sd,sd<<=1,(sd&130023424)===0&&(sd=4194304)));var a=At();e=mr(e,t),e!==null&&(Pl(e,t,a),Bt(e,a))}function k1(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Ww(e,a)}function P1(e,t){var a=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(a=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(M(314))}r!==null&&r.delete(t),Ww(e,a)}var Gw;Gw=function(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ot.current)Nt=!0;else{if((e.lanes&a)===0&&(t.flags&128)===0)return Nt=!1,m1(e,t,a);Nt=(e.flags&131072)!==0}else Nt=!1,_e&&(t.flags&1048576)!==0&&J0(t,Hd,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Pd(e,t),e=t.pendingProps;var o=is(t,wt.current);os(t,a),o=Jh(null,t,r,e,o,a);var n=Yh();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ft(r)?(n=!0,jd(t)):n=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Wh(t),o.updater=lc,t.stateNode=o,o._reactInternals=t,lh(t,r,e,a),t=ch(null,t,r,!0,n,a)):(t.tag=0,_e&&n&&Uh(t),Tt(null,t,o,a),t=t.child),t;case 16:r=t.elementType;e:{switch(Pd(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=A1(r),e=Sa(r,e),o){case 0:t=dh(null,t,r,e,a);break e;case 1:t=qv(null,t,r,e,a);break e;case 11:t=Vv(null,t,r,e,a);break e;case 14:t=jv(null,t,r,Sa(r.type,e),a);break e}throw Error(M(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Sa(r,o),dh(e,t,r,o,a);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Sa(r,o),qv(e,t,r,o,a);case 3:e:{if(Rw(t),e===null)throw Error(M(387));r=t.pendingProps,n=t.memoizedState,o=n.element,rw(e,t),Wd(t,r,null,a);var s=t.memoizedState;if(r=s.element,n.isDehydrated)if(n={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=n,t.memoizedState=n,t.flags&256){o=cs(Error(M(423)),t),t=Hv(e,t,r,a,o);break e}else if(r!==o){o=cs(Error(M(424)),t),t=Hv(e,t,r,a,o);break e}else for(Kt=Kr(t.stateNode.containerInfo.firstChild),Xt=t,_e=!0,ba=null,a=tw(t,null,r,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(ls(),r===o){t=hr(e,t,a);break e}Tt(e,t,r,a)}t=t.child}return t;case 5:return ow(t),e===null&&nh(t),r=t.type,o=t.pendingProps,n=e!==null?e.memoizedProps:null,s=o.children,eh(r,o)?s=null:n!==null&&eh(r,n)&&(t.flags|=32),Aw(e,t),Tt(e,t,s,a),t.child;case 6:return e===null&&nh(t),null;case 13:return _w(e,t,a);case 4:return Gh(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=us(t,null,r,a):Tt(e,t,r,a),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Sa(r,o),Vv(e,t,r,o,a);case 7:return Tt(e,t,t.pendingProps,a),t.child;case 8:return Tt(e,t,t.pendingProps.children,a),t.child;case 12:return Tt(e,t,t.pendingProps.children,a),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,n=t.memoizedProps,s=o.value,we(zd,r._currentValue),r._currentValue=s,n!==null)if(Pa(n.value,s)){if(n.children===o.children&&!Ot.current){t=hr(e,t,a);break e}}else for(n=t.child,n!==null&&(n.return=t);n!==null;){var i=n.dependencies;if(i!==null){s=n.child;for(var l=i.firstContext;l!==null;){if(l.context===r){if(n.tag===1){l=cr(-1,a&-a),l.tag=2;var u=n.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}n.lanes|=a,l=n.alternate,l!==null&&(l.lanes|=a),sh(n.return,a,t),i.lanes|=a;break}l=l.next}}else if(n.tag===10)s=n.type===t.type?null:n.child;else if(n.tag===18){if(s=n.return,s===null)throw Error(M(341));s.lanes|=a,i=s.alternate,i!==null&&(i.lanes|=a),sh(s,a,t),s=n.sibling}else s=n.child;if(s!==null)s.return=n;else for(s=n;s!==null;){if(s===t){s=null;break}if(n=s.sibling,n!==null){n.return=s.return,s=n;break}s=s.return}n=s}Tt(e,t,o.children,a),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,os(t,a),o=ma(o),r=r(o),t.flags|=1,Tt(e,t,r,a),t.child;case 14:return r=t.type,o=Sa(r,t.pendingProps),o=Sa(r.type,o),jv(e,t,r,o,a);case 15:return Pw(e,t,t.type,t.pendingProps,a);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Sa(r,o),Pd(e,t),t.tag=1,Ft(r)?(e=!0,jd(t)):e=!1,os(t,a),bw(t,r,o),lh(t,r,o,a),ch(null,t,r,!0,e,a);case 19:return Ew(e,t,a);case 22:return Tw(e,t,a)}throw Error(M(156,t.tag))};function Kw(e,t){return C0(e,t)}function T1(e,t,a,r){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function fa(e,t,a,r){return new T1(e,t,a,r)}function lg(e){return e=e.prototype,!(!e||!e.isReactComponent)}function A1(e){if(typeof e=="function")return lg(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ph)return 11;if(e===Th)return 14}return 2}function Yr(e,t){var a=e.alternate;return a===null?(a=fa(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&14680064,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a}function Rd(e,t,a,r,o,n){var s=2;if(r=e,typeof e=="function")lg(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Hn:return jo(a.children,o,n,t);case kh:s=8,o|=8;break;case Em:return e=fa(12,a,t,o|2),e.elementType=Em,e.lanes=n,e;case Dm:return e=fa(13,a,t,o),e.elementType=Dm,e.lanes=n,e;case Mm:return e=fa(19,a,t,o),e.elementType=Mm,e.lanes=n,e;case o0:return cc(a,o,n,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case a0:s=10;break e;case r0:s=9;break e;case Ph:s=11;break e;case Th:s=14;break e;case Ur:s=16,r=null;break e}throw Error(M(130,e==null?e:typeof e,""))}return t=fa(s,a,t,o),t.elementType=e,t.type=r,t.lanes=n,t}function jo(e,t,a,r){return e=fa(7,e,r,t),e.lanes=a,e}function cc(e,t,a,r){return e=fa(22,e,r,t),e.elementType=o0,e.lanes=a,e.stateNode={isHidden:!1},e}function Am(e,t,a){return e=fa(6,e,null,t),e.lanes=a,e}function Rm(e,t,a){return t=fa(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function R1(e,t,a,r,o){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=pm(0),this.expirationTimes=pm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pm(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function ug(e,t,a,r,o,n,s,i,l){return e=new R1(e,t,a,i,l),t===1?(t=1,n===!0&&(t|=8)):t=0,n=fa(3,null,null,t),e.current=n,n.stateNode=e,n.memoizedState={element:r,isDehydrated:a,cache:null,transitions:null,pendingSuspenseBoundaries:null},Wh(n),e}function _1(e,t,a){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:qn,key:r==null?null:""+r,children:e,containerInfo:t,implementation:a}}function Xw(e){if(!e)return eo;e=e._reactInternals;e:{if(Ko(e)!==e||e.tag!==1)throw Error(M(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ft(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(M(171))}if(e.tag===1){var a=e.type;if(Ft(a))return X0(e,a,t)}return t}function Qw(e,t,a,r,o,n,s,i,l){return e=ug(a,r,!0,e,o,n,s,i,l),e.context=Xw(null),a=e.current,r=At(),o=Jr(a),n=cr(r,o),n.callback=t??null,Xr(a,n,o),e.current.lanes=o,Pl(e,o,r),Bt(e,r),e}function fc(e,t,a,r){var o=t.current,n=At(),s=Jr(o);return a=Xw(a),t.context===null?t.context=a:t.pendingContext=a,t=cr(n,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Xr(o,t,s),e!==null&&(ka(e,o,s,n),bd(e,o,s)),s}function ec(e){return e=e.current,e.child?(e.child.tag===5,e.child.stateNode):null}function Zv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function dg(e,t){Zv(e,t),(e=e.alternate)&&Zv(e,t)}function E1(){return null}var Jw=typeof reportError=="function"?reportError:function(e){console.error(e)};function cg(e){this._internalRoot=e}pc.prototype.render=cg.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(M(409));fc(e,t,null,null)};pc.prototype.unmount=cg.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Wo(function(){fc(null,e,null,null)}),t[pr]=null}};function pc(e){this._internalRoot=e}pc.prototype.unstable_scheduleHydration=function(e){if(e){var t=T0();e={blockedOn:null,target:e,priority:t};for(var a=0;a<jr.length&&t!==0&&t<jr[a].priority;a++);jr.splice(a,0,e),a===0&&R0(e)}};function fg(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function mc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function e0(){}function D1(e,t,a,r,o){if(o){if(typeof r=="function"){var n=r;r=function(){var u=ec(s);n.call(u)}}var s=Qw(t,r,e,0,null,!1,!1,"",e0);return e._reactRootContainer=s,e[pr]=s.current,xl(e.nodeType===8?e.parentNode:e),Wo(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var i=r;r=function(){var u=ec(l);i.call(u)}}var l=ug(e,0,!1,null,null,!1,!1,"",e0);return e._reactRootContainer=l,e[pr]=l.current,xl(e.nodeType===8?e.parentNode:e),Wo(function(){fc(t,l,a,r)}),l}function hc(e,t,a,r,o){var n=a._reactRootContainer;if(n){var s=n;if(typeof o=="function"){var i=o;o=function(){var l=ec(s);i.call(l)}}fc(t,s,e,o)}else s=D1(a,t,e,o,r);return ec(s)}k0=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var a=Zi(t.pendingLanes);a!==0&&(_h(t,a|1),Bt(t,qe()),(de&6)===0&&(fs=qe()+500,ro()))}break;case 13:Wo(function(){var r=mr(e,1);if(r!==null){var o=At();ka(r,e,1,o)}}),dg(e,1)}};Eh=function(e){if(e.tag===13){var t=mr(e,134217728);if(t!==null){var a=At();ka(t,e,134217728,a)}dg(e,134217728)}};P0=function(e){if(e.tag===13){var t=Jr(e),a=mr(e,t);if(a!==null){var r=At();ka(a,e,t,r)}dg(e,t)}};T0=function(){return he};A0=function(e,t){var a=he;try{return he=e,t()}finally{he=a}};zm=function(e,t,a){switch(t){case"input":if(Fm(e,a),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<a.length;t++){var r=a[t];if(r!==e&&r.form===e.form){var o=nc(r);if(!o)throw Error(M(90));s0(r),Fm(r,o)}}}break;case"textarea":l0(e,a);break;case"select":t=a.value,t!=null&&es(e,!!a.multiple,t,!1)}};h0=ng;g0=Wo;var M1={usingClientEntryPoint:!1,Events:[Al,Gn,nc,p0,m0,ng]},Xi={findFiberByHostInstance:Fo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},N1={bundleType:Xi.bundleType,version:Xi.version,rendererPackageName:Xi.rendererPackageName,rendererConfig:Xi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:gr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=v0(e),e===null?null:e.stateNode},findFiberByHostInstance:Xi.findFiberByHostInstance||E1,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Qi=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Qi.isDisabled&&Qi.supportsFiber))try{tc=Qi.inject(N1),Ua=Qi}catch{}var Qi;Yt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=M1;Yt.createPortal=function(e,t){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!fg(t))throw Error(M(200));return _1(e,t,null,a)};Yt.createRoot=function(e,t){if(!fg(e))throw Error(M(299));var a=!1,r="",o=Jw;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=ug(e,1,!1,null,null,a,!1,r,o),e[pr]=t.current,xl(e.nodeType===8?e.parentNode:e),new cg(t)};Yt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(M(188)):(e=Object.keys(e).join(","),Error(M(268,e)));return e=v0(t),e=e===null?null:e.stateNode,e};Yt.flushSync=function(e){return Wo(e)};Yt.hydrate=function(e,t,a){if(!mc(t))throw Error(M(200));return hc(null,e,t,!0,a)};Yt.hydrateRoot=function(e,t,a){if(!fg(e))throw Error(M(405));var r=a!=null&&a.hydratedSources||null,o=!1,n="",s=Jw;if(a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(n=a.identifierPrefix),a.onRecoverableError!==void 0&&(s=a.onRecoverableError)),t=Qw(t,null,e,1,a??null,o,!1,n,s),e[pr]=t.current,xl(e),r)for(e=0;e<r.length;e++)a=r[e],o=a._getVersion,o=o(a._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[a,o]:t.mutableSourceEagerHydrationData.push(a,o);return new pc(t)};Yt.render=function(e,t,a){if(!mc(t))throw Error(M(200));return hc(null,e,t,!1,a)};Yt.unmountComponentAtNode=function(e){if(!mc(e))throw Error(M(40));return e._reactRootContainer?(Wo(function(){hc(null,null,e,!1,function(){e._reactRootContainer=null,e[pr]=null})}),!0):!1};Yt.unstable_batchedUpdates=ng;Yt.unstable_renderSubtreeIntoContainer=function(e,t,a,r){if(!mc(a))throw Error(M(200));if(e==null||e._reactInternals===void 0)throw Error(M(38));return hc(e,t,a,!1,r)};Yt.version="18.3.1-next-f1338f8080-20240426"});var gc=tt((TM,eC)=>{"use strict";function Zw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Zw)}catch(e){console.error(e)}}Zw(),eC.exports=Yw()});var aC=tt(pg=>{"use strict";var tC=gc();pg.createRoot=tC.createRoot,pg.hydrateRoot=tC.hydrateRoot;var AM});var Xo={};Cx(Xo,{Headers:()=>hg,Request:()=>B1,Response:()=>U1,default:()=>mg,fetch:()=>F1});var O1,hs,F1,mg,hg,B1,U1,oo=xP(()=>{"use strict";O1=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")},hs=O1(),F1=hs.fetch,mg=hs.fetch.bind(hs),hg=hs.Headers,B1=hs.Request,U1=hs.Response});var xg=tt(yg=>{"use strict";Object.defineProperty(yg,"__esModule",{value:!0});var gg=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.code=t.code}};yg.default=gg});var wg=tt(Nl=>{"use strict";var oC=Nl&&Nl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Nl,"__esModule",{value:!0});var j1=oC((oo(),Lx(Xo))),q1=oC(xg()),vg=class{constructor(t){this.shouldThrowOnError=!1,this.method=t.method,this.url=t.url,this.headers=t.headers,this.schema=t.schema,this.body=t.body,this.shouldThrowOnError=t.shouldThrowOnError,this.signal=t.signal,this.isMaybeSingle=t.isMaybeSingle,t.fetch?this.fetch=t.fetch:typeof fetch>"u"?this.fetch=j1.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,a){return this.headers=Object.assign({},this.headers),this.headers[t]=a,this}then(t,a){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),this.method!=="GET"&&this.method!=="HEAD"&&(this.headers["Content-Type"]="application/json");let r=this.fetch,o=r(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async n=>{var s,i,l;let u=null,d=null,c=null,f=n.status,m=n.statusText;if(n.ok){if(this.method!=="HEAD"){let h=await n.text();h===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?d=h:d=JSON.parse(h))}let w=(s=this.headers.Prefer)===null||s===void 0?void 0:s.match(/count=(exact|planned|estimated)/),S=(i=n.headers.get("content-range"))===null||i===void 0?void 0:i.split("/");w&&S&&S.length>1&&(c=parseInt(S[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,c=null,f=406,m="Not Acceptable"):d.length===1?d=d[0]:d=null)}else{let w=await n.text();try{u=JSON.parse(w),Array.isArray(u)&&n.status===404&&(d=[],u=null,f=200,m="OK")}catch{n.status===404&&w===""?(f=204,m="No Content"):u={message:w}}if(u&&this.isMaybeSingle&&(!((l=u?.details)===null||l===void 0)&&l.includes("0 rows"))&&(u=null,f=200,m="OK"),u&&this.shouldThrowOnError)throw new q1.default(u)}return{error:u,data:d,count:c,status:f,statusText:m}});return this.shouldThrowOnError||(o=o.catch(n=>{var s,i,l;return{error:{message:`${(s=n?.name)!==null&&s!==void 0?s:"FetchError"}: ${n?.message}`,details:`${(i=n?.stack)!==null&&i!==void 0?i:""}`,hint:"",code:`${(l=n?.code)!==null&&l!==void 0?l:""}`},data:null,count:null,status:0,statusText:""}})),o.then(t,a)}returns(){return this}overrideTypes(){return this}};Nl.default=vg});var Sg=tt(Ol=>{"use strict";var H1=Ol&&Ol.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ol,"__esModule",{value:!0});var z1=H1(wg()),Cg=class extends z1.default{select(t){let a=!1,r=(t??"*").split("").map(o=>/\s/.test(o)&&!a?"":(o==='"'&&(a=!a),o)).join("");return this.url.searchParams.set("select",r),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(t,{ascending:a=!0,nullsFirst:r,foreignTable:o,referencedTable:n=o}={}){let s=n?`${n}.order`:"order",i=this.url.searchParams.get(s);return this.url.searchParams.set(s,`${i?`${i},`:""}${t}.${a?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(t,{foreignTable:a,referencedTable:r=a}={}){let o=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(o,`${t}`),this}range(t,a,{foreignTable:r,referencedTable:o=r}={}){let n=typeof o>"u"?"offset":`${o}.offset`,s=typeof o>"u"?"limit":`${o}.limit`;return this.url.searchParams.set(n,`${t}`),this.url.searchParams.set(s,`${a-t+1}`),this}abortSignal(t){return this.signal=t,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return this.method==="GET"?this.headers.Accept="application/json":this.headers.Accept="application/vnd.pgrst.object+json",this.isMaybeSingle=!0,this}csv(){return this.headers.Accept="text/csv",this}geojson(){return this.headers.Accept="application/geo+json",this}explain({analyze:t=!1,verbose:a=!1,settings:r=!1,buffers:o=!1,wal:n=!1,format:s="text"}={}){var i;let l=[t?"analyze":null,a?"verbose":null,r?"settings":null,o?"buffers":null,n?"wal":null].filter(Boolean).join("|"),u=(i=this.headers.Accept)!==null&&i!==void 0?i:"application/json";return this.headers.Accept=`application/vnd.pgrst.plan+${s}; for="${u}"; options=${l};`,s==="json"?this:this}rollback(){var t;return((t=this.headers.Prefer)!==null&&t!==void 0?t:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}};Ol.default=Cg});var vc=tt(Fl=>{"use strict";var $1=Fl&&Fl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Fl,"__esModule",{value:!0});var W1=$1(Sg()),Lg=class extends W1.default{eq(t,a){return this.url.searchParams.append(t,`eq.${a}`),this}neq(t,a){return this.url.searchParams.append(t,`neq.${a}`),this}gt(t,a){return this.url.searchParams.append(t,`gt.${a}`),this}gte(t,a){return this.url.searchParams.append(t,`gte.${a}`),this}lt(t,a){return this.url.searchParams.append(t,`lt.${a}`),this}lte(t,a){return this.url.searchParams.append(t,`lte.${a}`),this}like(t,a){return this.url.searchParams.append(t,`like.${a}`),this}likeAllOf(t,a){return this.url.searchParams.append(t,`like(all).{${a.join(",")}}`),this}likeAnyOf(t,a){return this.url.searchParams.append(t,`like(any).{${a.join(",")}}`),this}ilike(t,a){return this.url.searchParams.append(t,`ilike.${a}`),this}ilikeAllOf(t,a){return this.url.searchParams.append(t,`ilike(all).{${a.join(",")}}`),this}ilikeAnyOf(t,a){return this.url.searchParams.append(t,`ilike(any).{${a.join(",")}}`),this}is(t,a){return this.url.searchParams.append(t,`is.${a}`),this}in(t,a){let r=Array.from(new Set(a)).map(o=>typeof o=="string"&&new RegExp("[,()]").test(o)?`"${o}"`:`${o}`).join(",");return this.url.searchParams.append(t,`in.(${r})`),this}contains(t,a){return typeof a=="string"?this.url.searchParams.append(t,`cs.${a}`):Array.isArray(a)?this.url.searchParams.append(t,`cs.{${a.join(",")}}`):this.url.searchParams.append(t,`cs.${JSON.stringify(a)}`),this}containedBy(t,a){return typeof a=="string"?this.url.searchParams.append(t,`cd.${a}`):Array.isArray(a)?this.url.searchParams.append(t,`cd.{${a.join(",")}}`):this.url.searchParams.append(t,`cd.${JSON.stringify(a)}`),this}rangeGt(t,a){return this.url.searchParams.append(t,`sr.${a}`),this}rangeGte(t,a){return this.url.searchParams.append(t,`nxl.${a}`),this}rangeLt(t,a){return this.url.searchParams.append(t,`sl.${a}`),this}rangeLte(t,a){return this.url.searchParams.append(t,`nxr.${a}`),this}rangeAdjacent(t,a){return this.url.searchParams.append(t,`adj.${a}`),this}overlaps(t,a){return typeof a=="string"?this.url.searchParams.append(t,`ov.${a}`):this.url.searchParams.append(t,`ov.{${a.join(",")}}`),this}textSearch(t,a,{config:r,type:o}={}){let n="";o==="plain"?n="pl":o==="phrase"?n="ph":o==="websearch"&&(n="w");let s=r===void 0?"":`(${r})`;return this.url.searchParams.append(t,`${n}fts${s}.${a}`),this}match(t){return Object.entries(t).forEach(([a,r])=>{this.url.searchParams.append(a,`eq.${r}`)}),this}not(t,a,r){return this.url.searchParams.append(t,`not.${a}.${r}`),this}or(t,{foreignTable:a,referencedTable:r=a}={}){let o=r?`${r}.or`:"or";return this.url.searchParams.append(o,`(${t})`),this}filter(t,a,r){return this.url.searchParams.append(t,`${a}.${r}`),this}};Fl.default=Lg});var Ig=tt(Ul=>{"use strict";var G1=Ul&&Ul.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ul,"__esModule",{value:!0});var Bl=G1(vc()),bg=class{constructor(t,{headers:a={},schema:r,fetch:o}){this.url=t,this.headers=a,this.schema=r,this.fetch=o}select(t,{head:a=!1,count:r}={}){let o=a?"HEAD":"GET",n=!1,s=(t??"*").split("").map(i=>/\s/.test(i)&&!n?"":(i==='"'&&(n=!n),i)).join("");return this.url.searchParams.set("select",s),r&&(this.headers.Prefer=`count=${r}`),new Bl.default({method:o,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}insert(t,{count:a,defaultToNull:r=!0}={}){let o="POST",n=[];if(this.headers.Prefer&&n.push(this.headers.Prefer),a&&n.push(`count=${a}`),r||n.push("missing=default"),this.headers.Prefer=n.join(","),Array.isArray(t)){let s=t.reduce((i,l)=>i.concat(Object.keys(l)),[]);if(s.length>0){let i=[...new Set(s)].map(l=>`"${l}"`);this.url.searchParams.set("columns",i.join(","))}}return new Bl.default({method:o,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:this.fetch,allowEmpty:!1})}upsert(t,{onConflict:a,ignoreDuplicates:r=!1,count:o,defaultToNull:n=!0}={}){let s="POST",i=[`resolution=${r?"ignore":"merge"}-duplicates`];if(a!==void 0&&this.url.searchParams.set("on_conflict",a),this.headers.Prefer&&i.push(this.headers.Prefer),o&&i.push(`count=${o}`),n||i.push("missing=default"),this.headers.Prefer=i.join(","),Array.isArray(t)){let l=t.reduce((u,d)=>u.concat(Object.keys(d)),[]);if(l.length>0){let u=[...new Set(l)].map(d=>`"${d}"`);this.url.searchParams.set("columns",u.join(","))}}return new Bl.default({method:s,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:this.fetch,allowEmpty:!1})}update(t,{count:a}={}){let r="PATCH",o=[];return this.headers.Prefer&&o.push(this.headers.Prefer),a&&o.push(`count=${a}`),this.headers.Prefer=o.join(","),new Bl.default({method:r,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:this.fetch,allowEmpty:!1})}delete({count:t}={}){let a="DELETE",r=[];return t&&r.push(`count=${t}`),this.headers.Prefer&&r.unshift(this.headers.Prefer),this.headers.Prefer=r.join(","),new Bl.default({method:a,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}};Ul.default=bg});var nC=tt(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});wc.version=void 0;wc.version="0.0.0-automated"});var sC=tt(Cc=>{"use strict";Object.defineProperty(Cc,"__esModule",{value:!0});Cc.DEFAULT_HEADERS=void 0;var K1=nC();Cc.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${K1.version}`}});var lC=tt(Vl=>{"use strict";var iC=Vl&&Vl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Vl,"__esModule",{value:!0});var X1=iC(Ig()),Q1=iC(vc()),J1=sC(),kg=class e{constructor(t,{headers:a={},schema:r,fetch:o}={}){this.url=t,this.headers=Object.assign(Object.assign({},J1.DEFAULT_HEADERS),a),this.schemaName=r,this.fetch=o}from(t){let a=new URL(`${this.url}/${t}`);return new X1.default(a,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(t){return new e(this.url,{headers:this.headers,schema:t,fetch:this.fetch})}rpc(t,a={},{head:r=!1,get:o=!1,count:n}={}){let s,i=new URL(`${this.url}/rpc/${t}`),l;r||o?(s=r?"HEAD":"GET",Object.entries(a).filter(([d,c])=>c!==void 0).map(([d,c])=>[d,Array.isArray(c)?`{${c.join(",")}}`:`${c}`]).forEach(([d,c])=>{i.searchParams.append(d,c)})):(s="POST",l=a);let u=Object.assign({},this.headers);return n&&(u.Prefer=`count=${n}`),new Q1.default({method:s,url:i,headers:u,schema:this.schemaName,body:l,fetch:this.fetch,allowEmpty:!1})}};Vl.default=kg});var hC=tt(dt=>{"use strict";var gs=dt&&dt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(dt,"__esModule",{value:!0});dt.PostgrestError=dt.PostgrestBuilder=dt.PostgrestTransformBuilder=dt.PostgrestFilterBuilder=dt.PostgrestQueryBuilder=dt.PostgrestClient=void 0;var uC=gs(lC());dt.PostgrestClient=uC.default;var dC=gs(Ig());dt.PostgrestQueryBuilder=dC.default;var cC=gs(vc());dt.PostgrestFilterBuilder=cC.default;var fC=gs(Sg());dt.PostgrestTransformBuilder=fC.default;var pC=gs(wg());dt.PostgrestBuilder=pC.default;var mC=gs(xg());dt.PostgrestError=mC.default;dt.default={PostgrestClient:uC.default,PostgrestQueryBuilder:dC.default,PostgrestFilterBuilder:cC.default,PostgrestTransformBuilder:fC.default,PostgrestBuilder:pC.default,PostgrestError:mC.default}});var IS=tt(Hc=>{"use strict";var pR=K(),mR=Symbol.for("react.element"),hR=Symbol.for("react.fragment"),gR=Object.prototype.hasOwnProperty,yR=pR.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,xR={key:!0,ref:!0,__self:!0,__source:!0};function bS(e,t,a){var r,o={},n=null,s=null;a!==void 0&&(n=""+a),t.key!==void 0&&(n=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)gR.call(t,r)&&!xR.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:mR,type:e,key:n,ref:s,props:o,_owner:yR.current}}Hc.Fragment=hR;Hc.jsx=bS;Hc.jsxs=bS});var le=tt((wO,kS)=>{"use strict";kS.exports=IS()});var yM={};Cx(yM,{initKiteChat:()=>_p});var tr=F(K(),1),Wk=F(aC(),1);var O=F(K(),1),zk=F(gc(),1);var rC=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...a)=>Promise.resolve().then(()=>(oo(),Xo)).then(({default:r})=>r(...a)):t=fetch,(...a)=>t(...a)};var _l=class extends Error{constructor(t,a="FunctionsError",r){super(t),this.name=a,this.context=r}},yc=class extends _l{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}},El=class extends _l{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}},Dl=class extends _l{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}},xc;(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"})(xc||(xc={}));var V1=function(e,t,a,r){function o(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function i(d){try{u(r.next(d))}catch(c){s(c)}}function l(d){try{u(r.throw(d))}catch(c){s(c)}}function u(d){d.done?n(d.value):o(d.value).then(i,l)}u((r=r.apply(e,t||[])).next())})},Ml=class{constructor(t,{headers:a={},customFetch:r,region:o=xc.Any}={}){this.url=t,this.headers=a,this.region=o,this.fetch=rC(r)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t,a={}){var r;return V1(this,void 0,void 0,function*(){try{let{headers:o,method:n,body:s}=a,i={},{region:l}=a;l||(l=this.region);let u=new URL(`${this.url}/${t}`);l&&l!=="any"&&(i["x-region"]=l,u.searchParams.set("forceFunctionRegion",l));let d;s&&(o&&!Object.prototype.hasOwnProperty.call(o,"Content-Type")||!o)&&(typeof Blob<"u"&&s instanceof Blob||s instanceof ArrayBuffer?(i["Content-Type"]="application/octet-stream",d=s):typeof s=="string"?(i["Content-Type"]="text/plain",d=s):typeof FormData<"u"&&s instanceof FormData?d=s:(i["Content-Type"]="application/json",d=JSON.stringify(s)));let c=yield this.fetch(u.toString(),{method:n||"POST",headers:Object.assign(Object.assign(Object.assign({},i),this.headers),o),body:d}).catch(w=>{throw new yc(w)}),f=c.headers.get("x-relay-error");if(f&&f==="true")throw new El(c);if(!c.ok)throw new Dl(c);let m=((r=c.headers.get("Content-Type"))!==null&&r!==void 0?r:"text/plain").split(";")[0].trim(),v;return m==="application/json"?v=yield c.json():m==="application/octet-stream"?v=yield c.blob():m==="text/event-stream"?v=c:m==="multipart/form-data"?v=yield c.formData():v=yield c.text(),{data:v,error:null,response:c}}catch(o){return{data:null,error:o,response:o instanceof Dl||o instanceof El?o.context:void 0}}})}};var gC=F(hC(),1),{PostgrestClient:yC,PostgrestQueryBuilder:GM,PostgrestFilterBuilder:KM,PostgrestTransformBuilder:XM,PostgrestBuilder:QM,PostgrestError:Y1}=gC.default;function xC(){if(typeof WebSocket<"u")return WebSocket;if(typeof global.WebSocket<"u")return global.WebSocket;if(typeof window.WebSocket<"u")return window.WebSocket;if(typeof self.WebSocket<"u")return self.WebSocket;throw new Error("`WebSocket` is not supported in this environment")}var vC=xC();var wC="2.11.15";var CC=`realtime-js/${wC}`,SC="1.0.0";var Lc=1e4,LC=1e3,ys;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(ys||(ys={}));var ct;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(ct||(ct={}));var Zt;(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"})(Zt||(Zt={}));var Sc;(function(e){e.websocket="websocket"})(Sc||(Sc={}));var no;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(no||(no={}));var jl=class{constructor(){this.HEADER_LENGTH=1}decode(t,a){return t.constructor===ArrayBuffer?a(this._binaryDecode(t)):a(typeof t=="string"?JSON.parse(t):{})}_binaryDecode(t){let a=new DataView(t),r=new TextDecoder;return this._decodeBroadcast(t,a,r)}_decodeBroadcast(t,a,r){let o=a.getUint8(1),n=a.getUint8(2),s=this.HEADER_LENGTH+2,i=r.decode(t.slice(s,s+o));s=s+o;let l=r.decode(t.slice(s,s+n));s=s+n;let u=JSON.parse(r.decode(t.slice(s,t.byteLength)));return{ref:null,topic:i,event:l,payload:u}}};var Qo=class{constructor(t,a){this.callback=t,this.timerCalc=a,this.timer=void 0,this.tries=0,this.callback=t,this.timerCalc=a}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}};var Ce;(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"})(Ce||(Ce={}));var Tg=(e,t,a={})=>{var r;let o=(r=a.skipTypes)!==null&&r!==void 0?r:[];return Object.keys(t).reduce((n,s)=>(n[s]=Z1(s,e,t,o),n),{})},Z1=(e,t,a,r)=>{let o=t.find(i=>i.name===e),n=o?.type,s=a[e];return n&&!r.includes(n)?bC(n,s):Pg(s)},bC=(e,t)=>{if(e.charAt(0)==="_"){let a=e.slice(1,e.length);return rA(t,a)}switch(e){case Ce.bool:return eA(t);case Ce.float4:case Ce.float8:case Ce.int2:case Ce.int4:case Ce.int8:case Ce.numeric:case Ce.oid:return tA(t);case Ce.json:case Ce.jsonb:return aA(t);case Ce.timestamp:return oA(t);case Ce.abstime:case Ce.date:case Ce.daterange:case Ce.int4range:case Ce.int8range:case Ce.money:case Ce.reltime:case Ce.text:case Ce.time:case Ce.timestamptz:case Ce.timetz:case Ce.tsrange:case Ce.tstzrange:return Pg(t);default:return Pg(t)}},Pg=e=>e,eA=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},tA=e=>{if(typeof e=="string"){let t=parseFloat(e);if(!Number.isNaN(t))return t}return e},aA=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch(t){return console.log(`JSON parse error: ${t}`),e}return e},rA=(e,t)=>{if(typeof e!="string")return e;let a=e.length-1,r=e[a];if(e[0]==="{"&&r==="}"){let n,s=e.slice(1,a);try{n=JSON.parse("["+s+"]")}catch{n=s?s.split(","):[]}return n.map(i=>bC(t,i))}return e},oA=e=>typeof e=="string"?e.replace(" ","T"):e,bc=e=>{let t=e;return t=t.replace(/^ws/i,"http"),t=t.replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,""),t.replace(/\/+$/,"")};var Jo=class{constructor(t,a,r={},o=Lc){this.channel=t,this.event=a,this.payload=r,this.timeout=o,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,a){var r;return this._hasReceived(t)&&a((r=this.receivedResp)===null||r===void 0?void 0:r.response),this.recHooks.push({status:t,callback:a}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);let t=a=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=a,this._matchReceive(a)};this.channel._on(this.refEvent,{},t),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(t,a){this.refEvent&&this.channel._trigger(this.refEvent,{status:t,response:a})}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:a}){this.recHooks.filter(r=>r.status===t).forEach(r=>r.callback(a))}_hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}};var Ag;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(Ag||(Ag={}));var xs=class e{constructor(t,a){this.channel=t,this.state={},this.pendingDiffs=[],this.joinRef=null,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};let r=a?.events||{state:"presence_state",diff:"presence_diff"};this.channel._on(r.state,{},o=>{let{onJoin:n,onLeave:s,onSync:i}=this.caller;this.joinRef=this.channel._joinRef(),this.state=e.syncState(this.state,o,n,s),this.pendingDiffs.forEach(l=>{this.state=e.syncDiff(this.state,l,n,s)}),this.pendingDiffs=[],i()}),this.channel._on(r.diff,{},o=>{let{onJoin:n,onLeave:s,onSync:i}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(o):(this.state=e.syncDiff(this.state,o,n,s),i())}),this.onJoin((o,n,s)=>{this.channel._trigger("presence",{event:"join",key:o,currentPresences:n,newPresences:s})}),this.onLeave((o,n,s)=>{this.channel._trigger("presence",{event:"leave",key:o,currentPresences:n,leftPresences:s})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(t,a,r,o){let n=this.cloneDeep(t),s=this.transformState(a),i={},l={};return this.map(n,(u,d)=>{s[u]||(l[u]=d)}),this.map(s,(u,d)=>{let c=n[u];if(c){let f=d.map(S=>S.presence_ref),m=c.map(S=>S.presence_ref),v=d.filter(S=>m.indexOf(S.presence_ref)<0),w=c.filter(S=>f.indexOf(S.presence_ref)<0);v.length>0&&(i[u]=v),w.length>0&&(l[u]=w)}else i[u]=d}),this.syncDiff(n,{joins:i,leaves:l},r,o)}static syncDiff(t,a,r,o){let{joins:n,leaves:s}={joins:this.transformState(a.joins),leaves:this.transformState(a.leaves)};return r||(r=()=>{}),o||(o=()=>{}),this.map(n,(i,l)=>{var u;let d=(u=t[i])!==null&&u!==void 0?u:[];if(t[i]=this.cloneDeep(l),d.length>0){let c=t[i].map(m=>m.presence_ref),f=d.filter(m=>c.indexOf(m.presence_ref)<0);t[i].unshift(...f)}r(i,d,l)}),this.map(s,(i,l)=>{let u=t[i];if(!u)return;let d=l.map(c=>c.presence_ref);u=u.filter(c=>d.indexOf(c.presence_ref)<0),t[i]=u,o(i,u,l),u.length===0&&delete t[i]}),t}static map(t,a){return Object.getOwnPropertyNames(t).map(r=>a(r,t[r]))}static transformState(t){return t=this.cloneDeep(t),Object.getOwnPropertyNames(t).reduce((a,r)=>{let o=t[r];return"metas"in o?a[r]=o.metas.map(n=>(n.presence_ref=n.phx_ref,delete n.phx_ref,delete n.phx_ref_prev,n)):a[r]=o,a},{})}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 Rg;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(Rg||(Rg={}));var _g;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(_g||(_g={}));var ja;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(ja||(ja={}));var vs=class e{constructor(t,a={config:{}},r){this.topic=t,this.params=a,this.socket=r,this.bindings={},this.state=ct.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:""},private:!1},a.config),this.timeout=this.socket.timeout,this.joinPush=new Jo(this,Zt.join,this.params,this.timeout),this.rejoinTimer=new Qo(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=ct.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(o=>o.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=ct.closed,this.socket._remove(this)}),this._onError(o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=ct.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=ct.errored,this.rejoinTimer.scheduleTimeout())}),this._on(Zt.reply,{},(o,n)=>{this._trigger(this._replyEventName(n),o)}),this.presence=new xs(this),this.broadcastEndpointURL=bc(this.socket.endPoint)+"/api/broadcast",this.private=this.params.config.private||!1}subscribe(t,a=this.timeout){var r,o;if(this.socket.isConnected()||this.socket.connect(),this.state==ct.closed){let{config:{broadcast:n,presence:s,private:i}}=this.params;this._onError(d=>t?.(ja.CHANNEL_ERROR,d)),this._onClose(()=>t?.(ja.CLOSED));let l={},u={broadcast:n,presence:s,postgres_changes:(o=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(d=>d.filter))!==null&&o!==void 0?o:[],private:i};this.socket.accessTokenValue&&(l.access_token=this.socket.accessTokenValue),this.updateJoinPayload(Object.assign({config:u},l)),this.joinedOnce=!0,this._rejoin(a),this.joinPush.receive("ok",async({postgres_changes:d})=>{var c;if(this.socket.setAuth(),d===void 0){t?.(ja.SUBSCRIBED);return}else{let f=this.bindings.postgres_changes,m=(c=f?.length)!==null&&c!==void 0?c:0,v=[];for(let w=0;w<m;w++){let S=f[w],{filter:{event:h,schema:g,table:x,filter:L}}=S,I=d&&d[w];if(I&&I.event===h&&I.schema===g&&I.table===x&&I.filter===L)v.push(Object.assign(Object.assign({},S),{id:I.id}));else{this.unsubscribe(),this.state=ct.errored,t?.(ja.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=v,t&&t(ja.SUBSCRIBED);return}}).receive("error",d=>{this.state=ct.errored,t?.(ja.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(d).join(", ")||"error")))}).receive("timeout",()=>{t?.(ja.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(t,a={}){return await this.send({type:"presence",event:"track",payload:t},a.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,a,r){return this._on(t,a,r)}async send(t,a={}){var r,o;if(!this._canPush()&&t.type==="broadcast"){let{event:n,payload:s}=t,l={method:"POST",headers:{Authorization:this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:n,payload:s,private:this.private}]})};try{let u=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(r=a.timeout)!==null&&r!==void 0?r:this.timeout);return await((o=u.body)===null||o===void 0?void 0:o.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(n=>{var s,i,l;let u=this._push(t.type,t,a.timeout||this.timeout);t.type==="broadcast"&&!(!((l=(i=(s=this.params)===null||s===void 0?void 0:s.config)===null||i===void 0?void 0:i.broadcast)===null||l===void 0)&&l.ack)&&n("ok"),u.receive("ok",()=>n("ok")),u.receive("error",()=>n("error")),u.receive("timeout",()=>n("timed out"))})}updateJoinPayload(t){this.joinPush.updatePayload(t)}unsubscribe(t=this.timeout){this.state=ct.leaving;let a=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(Zt.close,"leave",this._joinRef())};this.joinPush.destroy();let r=null;return new Promise(o=>{r=new Jo(this,Zt.leave,{},t),r.receive("ok",()=>{a(),o("ok")}).receive("timeout",()=>{a(),o("timed out")}).receive("error",()=>{o("error")}),r.send(),this._canPush()||r.trigger("ok",{})}).finally(()=>{r?.destroy()})}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.rejoinTimer&&clearTimeout(this.rejoinTimer.timer),this.joinPush.destroy()}async _fetchWithTimeout(t,a,r){let o=new AbortController,n=setTimeout(()=>o.abort(),r),s=await this.socket.fetch(t,Object.assign(Object.assign({},a),{signal:o.signal}));return clearTimeout(n),s}_push(t,a,r=this.timeout){if(!this.joinedOnce)throw`tried to push '${t}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let o=new Jo(this,t,a,r);return this._canPush()?o.send():(o.startTimeout(),this.pushBuffer.push(o)),o}_onMessage(t,a,r){return a}_isMember(t){return this.topic===t}_joinRef(){return this.joinPush.ref}_trigger(t,a,r){var o,n;let s=t.toLocaleLowerCase(),{close:i,error:l,leave:u,join:d}=Zt;if(r&&[i,l,u,d].indexOf(s)>=0&&r!==this._joinRef())return;let f=this._onMessage(s,a,r);if(a&&!f)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(s)?(o=this.bindings.postgres_changes)===null||o===void 0||o.filter(m=>{var v,w,S;return((v=m.filter)===null||v===void 0?void 0:v.event)==="*"||((S=(w=m.filter)===null||w===void 0?void 0:w.event)===null||S===void 0?void 0:S.toLocaleLowerCase())===s}).map(m=>m.callback(f,r)):(n=this.bindings[s])===null||n===void 0||n.filter(m=>{var v,w,S,h,g,x;if(["broadcast","presence","postgres_changes"].includes(s))if("id"in m){let L=m.id,I=(v=m.filter)===null||v===void 0?void 0:v.event;return L&&((w=a.ids)===null||w===void 0?void 0:w.includes(L))&&(I==="*"||I?.toLocaleLowerCase()===((S=a.data)===null||S===void 0?void 0:S.type.toLocaleLowerCase()))}else{let L=(g=(h=m?.filter)===null||h===void 0?void 0:h.event)===null||g===void 0?void 0:g.toLocaleLowerCase();return L==="*"||L===((x=a?.event)===null||x===void 0?void 0:x.toLocaleLowerCase())}else return m.type.toLocaleLowerCase()===s}).map(m=>{if(typeof f=="object"&&"ids"in f){let v=f.data,{schema:w,table:S,commit_timestamp:h,type:g,errors:x}=v;f=Object.assign(Object.assign({},{schema:w,table:S,commit_timestamp:h,eventType:g,new:{},old:{},errors:x}),this._getPayloadRecords(v))}m.callback(f,r)})}_isClosed(){return this.state===ct.closed}_isJoined(){return this.state===ct.joined}_isJoining(){return this.state===ct.joining}_isLeaving(){return this.state===ct.leaving}_replyEventName(t){return`chan_reply_${t}`}_on(t,a,r){let o=t.toLocaleLowerCase(),n={type:o,filter:a,callback:r};return this.bindings[o]?this.bindings[o].push(n):this.bindings[o]=[n],this}_off(t,a){let r=t.toLocaleLowerCase();return this.bindings[r]=this.bindings[r].filter(o=>{var n;return!(((n=o.type)===null||n===void 0?void 0:n.toLocaleLowerCase())===r&&e.isEqual(o.filter,a))}),this}static isEqual(t,a){if(Object.keys(t).length!==Object.keys(a).length)return!1;for(let r in t)if(t[r]!==a[r])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(t){this._on(Zt.close,{},t)}_onError(t){this._on(Zt.error,{},a=>t(a))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=ct.joining,this.joinPush.resend(t))}_getPayloadRecords(t){let a={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(a.new=Tg(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(a.old=Tg(t.columns,t.old_record)),a}};var IC=()=>{},sA=`
8
+ `+n.stack}return{value:e,source:t,stack:o,digest:null}}function Sh(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function am(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var e_=typeof WeakMap=="function"?WeakMap:Map;function xw(e,t,r){r=va(-1,r),r.tag=3,r.payload={element:null};var a=t.value;return r.callback=function(){Gc||(Gc=!0,pm=a),am(e,t)},r}function ww(e,t,r){r=va(-1,r),r.tag=3;var a=e.type.getDerivedStateFromError;if(typeof a=="function"){var o=t.value;r.payload=function(){return a(o)},r.callback=function(){am(e,t)}}var n=e.stateNode;return n!==null&&typeof n.componentDidCatch=="function"&&(r.callback=function(){am(e,t),typeof a!="function"&&(oo===null?oo=new Set([this]):oo.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),r}function Rx(e,t,r){var a=e.pingCache;if(a===null){a=e.pingCache=new e_;var o=new Set;a.set(t,o)}else o=a.get(t),o===void 0&&(o=new Set,a.set(t,o));o.has(r)||(o.add(r),e=h_.bind(null,e,t,r),t.then(e,e))}function Ex(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Dx(e,t,r,a,o){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=va(-1,1),t.tag=2,ao(r,t,1))),r.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var t_=ba.ReactCurrentOwner,jt=!1;function Dt(e,t,r,a){t.child=e===null?X0(t,null,r,a):gs(t,e.child,r,a)}function Nx(e,t,r,a,o){r=r.render;var n=t.ref;return ds(t,o),a=zm(e,t,r,a,n,o),r=Wm(),e!==null&&!jt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Ca(e,t,o)):(Ne&&r&&Dm(t),t.flags|=1,Dt(e,t,a,o),t.child)}function Mx(e,t,r,a,o){if(e===null){var n=r.type;return typeof n=="function"&&!rg(n)&&n.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=n,Sw(e,t,n,a,o)):(e=kc(r.type,null,a,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(n=e.child,(e.lanes&o)===0){var s=n.memoizedProps;if(r=r.compare,r=r!==null?r:Cl,r(s,a)&&e.ref===t.ref)return Ca(e,t,o)}return t.flags|=1,e=so(n,a),e.ref=t.ref,e.return=t,t.child=e}function Sw(e,t,r,a,o){if(e!==null){var n=e.memoizedProps;if(Cl(n,a)&&e.ref===t.ref)if(jt=!1,t.pendingProps=a=n,(e.lanes&o)!==0)(e.flags&131072)!==0&&(jt=!0);else return t.lanes=e.lanes,Ca(e,t,o)}return om(e,t,r,a,o)}function Cw(e,t,r){var a=t.pendingProps,o=a.children,n=e!==null?e.memoizedState:null;if(a.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},be(ss,Jt),Jt|=r;else{if((r&1073741824)===0)return e=n!==null?n.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,be(ss,Jt),Jt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},a=n!==null?n.baseLanes:r,be(ss,Jt),Jt|=a}else n!==null?(a=n.baseLanes|r,t.memoizedState=null):a=r,be(ss,Jt),Jt|=a;return Dt(e,t,o,r),t.child}function bw(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function om(e,t,r,a,o){var n=$t(r)?Yo:kt.current;return n=hs(t,n),ds(t,o),r=zm(e,t,r,a,n,o),a=Wm(),e!==null&&!jt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Ca(e,t,o)):(Ne&&a&&Dm(t),t.flags|=1,Dt(e,t,r,o),t.child)}function Ox(e,t,r,a,o){if($t(r)){var n=!0;Bc(t)}else n=!1;if(ds(t,o),t.stateNode===null)bc(e,t),vw(t,r,a),rm(t,r,a,o),a=!0;else if(e===null){var s=t.stateNode,i=t.memoizedProps;s.props=i;var l=s.context,u=r.contextType;typeof u=="object"&&u!==null?u=wr(u):(u=$t(r)?Yo:kt.current,u=hs(t,u));var c=r.getDerivedStateFromProps,d=typeof c=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(i!==a||l!==u)&&Ax(t,s,a,u),Ka=!1;var f=t.memoizedState;s.state=f,qc(t,a,s,o),l=t.memoizedState,i!==a||f!==l||qt.current||Ka?(typeof c=="function"&&(tm(t,r,c,a),l=t.memoizedState),(i=Ka||_x(t,r,i,a,f,l,u))?(d||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=l),s.props=a,s.state=l,s.context=u,a=i):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{s=t.stateNode,Q0(e,t),i=t.memoizedProps,u=t.type===t.elementType?i:Tr(t.type,i),s.props=u,d=t.pendingProps,f=s.context,l=r.contextType,typeof l=="object"&&l!==null?l=wr(l):(l=$t(r)?Yo:kt.current,l=hs(t,l));var h=r.getDerivedStateFromProps;(c=typeof h=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(i!==d||f!==l)&&Ax(t,s,a,l),Ka=!1,f=t.memoizedState,s.state=f,qc(t,a,s,o);var x=t.memoizedState;i!==d||f!==x||qt.current||Ka?(typeof h=="function"&&(tm(t,r,h,a),x=t.memoizedState),(u=Ka||_x(t,r,u,a,f,x,l)||!1)?(c||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(a,x,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(a,x,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=x),s.props=a,s.state=x,s.context=l,a=u):(typeof s.componentDidUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),a=!1)}return nm(e,t,r,a,n,o)}function nm(e,t,r,a,o,n){bw(e,t);var s=(t.flags&128)!==0;if(!a&&!s)return o&&Sx(t,r,!1),Ca(e,t,n);a=t.stateNode,t_.current=t;var i=s&&typeof r.getDerivedStateFromError!="function"?null:a.render();return t.flags|=1,e!==null&&s?(t.child=gs(t,e.child,null,n),t.child=gs(t,null,i,n)):Dt(e,t,i,n),t.memoizedState=a.state,o&&Sx(t,r,!0),t.child}function Lw(e){var t=e.stateNode;t.pendingContext?wx(e,t.pendingContext,t.pendingContext!==t.context):t.context&&wx(e,t.context,!1),jm(e,t.containerInfo)}function Bx(e,t,r,a,o){return ms(),Mm(o),t.flags|=256,Dt(e,t,r,a),t.child}var sm={dehydrated:null,treeContext:null,retryLane:0};function im(e){return{baseLanes:e,cachePool:null,transitions:null}}function Iw(e,t,r){var a=t.pendingProps,o=Me.current,n=!1,s=(t.flags&128)!==0,i;if((i=s)||(i=e!==null&&e.memoizedState===null?!1:(o&2)!==0),i?(n=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),be(Me,o&1),e===null)return Zh(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(s=a.children,e=a.fallback,n?(a=t.mode,n=t.child,s={mode:"hidden",children:s},(a&1)===0&&n!==null?(n.childLanes=0,n.pendingProps=s):n=id(s,a,0,null),e=Qo(e,a,r,null),n.return=t,e.return=t,n.sibling=e,t.child=n,t.child.memoizedState=im(r),t.memoizedState=sm,e):Xm(t,s));if(o=e.memoizedState,o!==null&&(i=o.dehydrated,i!==null))return r_(e,t,s,a,i,o,r);if(n){n=a.fallback,s=t.mode,o=e.child,i=o.sibling;var l={mode:"hidden",children:a.children};return(s&1)===0&&t.child!==o?(a=t.child,a.childLanes=0,a.pendingProps=l,t.deletions=null):(a=so(o,l),a.subtreeFlags=o.subtreeFlags&14680064),i!==null?n=so(i,n):(n=Qo(n,s,r,null),n.flags|=2),n.return=t,a.return=t,a.sibling=n,t.child=a,a=n,n=t.child,s=e.child.memoizedState,s=s===null?im(r):{baseLanes:s.baseLanes|r,cachePool:null,transitions:s.transitions},n.memoizedState=s,n.childLanes=e.childLanes&~r,t.memoizedState=sm,a}return n=e.child,e=n.sibling,a=so(n,{mode:"visible",children:a.children}),(t.mode&1)===0&&(a.lanes=r),a.return=t,a.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=a,t.memoizedState=null,a}function Xm(e,t){return t=id({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function hc(e,t,r,a){return a!==null&&Mm(a),gs(t,e.child,null,r),e=Xm(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function r_(e,t,r,a,o,n,s){if(r)return t.flags&256?(t.flags&=-257,a=Sh(Error(N(422))),hc(e,t,s,a)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(n=a.fallback,o=t.mode,a=id({mode:"visible",children:a.children},o,0,null),n=Qo(n,o,s,null),n.flags|=2,a.return=t,n.return=t,a.sibling=n,t.child=a,(t.mode&1)!==0&&gs(t,e.child,null,s),t.child.memoizedState=im(s),t.memoizedState=sm,n);if((t.mode&1)===0)return hc(e,t,s,null);if(o.data==="$!"){if(a=o.nextSibling&&o.nextSibling.dataset,a)var i=a.dgst;return a=i,n=Error(N(419)),a=Sh(n,a,void 0),hc(e,t,s,a)}if(i=(s&e.childLanes)!==0,jt||i){if(a=ut,a!==null){switch(s&-s){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=(o&(a.suspendedLanes|s))!==0?0:o,o!==0&&o!==n.retryLane&&(n.retryLane=o,Sa(e,o),Er(a,e,o,-1))}return tg(),a=Sh(Error(N(421))),hc(e,t,s,a)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=m_.bind(null,e),o._reactRetry=t,null):(e=n.treeContext,Qt=ro(o.nextSibling),Yt=t,Ne=!0,Ar=null,e!==null&&(gr[yr++]=ga,gr[yr++]=ya,gr[yr++]=Zo,ga=e.id,ya=e.overflow,Zo=t),t=Xm(t,a.children),t.flags|=4096,t)}function Fx(e,t,r){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),em(e.return,t,r)}function Ch(e,t,r,a,o){var n=e.memoizedState;n===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:r,tailMode:o}:(n.isBackwards=t,n.rendering=null,n.renderingStartTime=0,n.last=a,n.tail=r,n.tailMode=o)}function kw(e,t,r){var a=t.pendingProps,o=a.revealOrder,n=a.tail;if(Dt(e,t,a.children,r),a=Me.current,(a&2)!==0)a=a&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Fx(e,r,t);else if(e.tag===19)Fx(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}a&=1}if(be(Me,a),(t.mode&1)===0)t.memoizedState=null;else switch(o){case"forwards":for(r=t.child,o=null;r!==null;)e=r.alternate,e!==null&&$c(e)===null&&(o=r),r=r.sibling;r=o,r===null?(o=t.child,t.child=null):(o=r.sibling,r.sibling=null),Ch(t,!1,o,r,n);break;case"backwards":for(r=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&$c(e)===null){t.child=o;break}e=o.sibling,o.sibling=r,r=o,o=e}Ch(t,!0,r,null,n);break;case"together":Ch(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function bc(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ca(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),tn|=t.lanes,(r&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(N(153));if(t.child!==null){for(e=t.child,r=so(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=so(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function a_(e,t,r){switch(t.tag){case 3:Lw(t),ms();break;case 5:Y0(t);break;case 1:$t(t.type)&&Bc(t);break;case 4:jm(t,t.stateNode.containerInfo);break;case 10:var a=t.type._context,o=t.memoizedProps.value;be(Vc,a._currentValue),a._currentValue=o;break;case 13:if(a=t.memoizedState,a!==null)return a.dehydrated!==null?(be(Me,Me.current&1),t.flags|=128,null):(r&t.child.childLanes)!==0?Iw(e,t,r):(be(Me,Me.current&1),e=Ca(e,t,r),e!==null?e.sibling:null);be(Me,Me.current&1);break;case 19:if(a=(r&t.childLanes)!==0,(e.flags&128)!==0){if(a)return kw(e,t,r);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),be(Me,Me.current),a)break;return null;case 22:case 23:return t.lanes=0,Cw(e,t,r)}return Ca(e,t,r)}var Pw,lm,Tw,_w;Pw=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};lm=function(){};Tw=function(e,t,r,a){var o=e.memoizedProps;if(o!==a){e=t.stateNode,Xo(Kr.current);var n=null;switch(r){case"input":o=Ah(e,o),a=Ah(e,a),n=[];break;case"select":o=Be({},o,{value:void 0}),a=Be({},a,{value:void 0}),n=[];break;case"textarea":o=Dh(e,o),a=Dh(e,a),n=[];break;default:typeof o.onClick!="function"&&typeof a.onClick=="function"&&(e.onclick=Mc)}Mh(r,a);var s;r=null;for(u in o)if(!a.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var i=o[u];for(s in i)i.hasOwnProperty(s)&&(r||(r={}),r[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(ml.hasOwnProperty(u)?n||(n=[]):(n=n||[]).push(u,null));for(u in a){var l=a[u];if(i=o?.[u],a.hasOwnProperty(u)&&l!==i&&(l!=null||i!=null))if(u==="style")if(i){for(s in i)!i.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(r||(r={}),r[s]="");for(s in l)l.hasOwnProperty(s)&&i[s]!==l[s]&&(r||(r={}),r[s]=l[s])}else r||(n||(n=[]),n.push(u,r)),r=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,i=i?i.__html:void 0,l!=null&&i!==l&&(n=n||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(n=n||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(ml.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&Te("scroll",e),n||i===l||(n=[])):(n=n||[]).push(u,l))}r&&(n=n||[]).push("style",r);var u=n;(t.updateQueue=u)&&(t.flags|=4)}};_w=function(e,t,r,a){r!==a&&(t.flags|=4)};function Zi(e,t){if(!Ne)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var a=null;r!==null;)r.alternate!==null&&(a=r),r=r.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function Lt(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,a=0;if(t)for(var o=e.child;o!==null;)r|=o.lanes|o.childLanes,a|=o.subtreeFlags&14680064,a|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)r|=o.lanes|o.childLanes,a|=o.subtreeFlags,a|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=a,e.childLanes=r,t}function o_(e,t,r){var a=t.pendingProps;switch(Nm(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Lt(t),null;case 1:return $t(t.type)&&Oc(),Lt(t),null;case 3:return a=t.stateNode,ys(),_e(qt),_e(kt),$m(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(fc(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ar!==null&&(gm(Ar),Ar=null))),lm(e,t),Lt(t),null;case 5:qm(t);var o=Xo(Pl.current);if(r=t.type,e!==null&&t.stateNode!=null)Tw(e,t,r,a,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!a){if(t.stateNode===null)throw Error(N(166));return Lt(t),null}if(e=Xo(Kr.current),fc(t)){a=t.stateNode,r=t.type;var n=t.memoizedProps;switch(a[Wr]=t,a[Il]=n,e=(t.mode&1)!==0,r){case"dialog":Te("cancel",a),Te("close",a);break;case"iframe":case"object":case"embed":Te("load",a);break;case"video":case"audio":for(o=0;o<nl.length;o++)Te(nl[o],a);break;case"source":Te("error",a);break;case"img":case"image":case"link":Te("error",a),Te("load",a);break;case"details":Te("toggle",a);break;case"input":Wv(a,n),Te("invalid",a);break;case"select":a._wrapperState={wasMultiple:!!n.multiple},Te("invalid",a);break;case"textarea":Kv(a,n),Te("invalid",a)}Mh(r,n),o=null;for(var s in n)if(n.hasOwnProperty(s)){var i=n[s];s==="children"?typeof i=="string"?a.textContent!==i&&(n.suppressHydrationWarning!==!0&&dc(a.textContent,i,e),o=["children",i]):typeof i=="number"&&a.textContent!==""+i&&(n.suppressHydrationWarning!==!0&&dc(a.textContent,i,e),o=["children",""+i]):ml.hasOwnProperty(s)&&i!=null&&s==="onScroll"&&Te("scroll",a)}switch(r){case"input":Zu(a),Gv(a,n,!0);break;case"textarea":Zu(a),Xv(a);break;case"select":case"option":break;default:typeof n.onClick=="function"&&(a.onclick=Mc)}a=o,t.updateQueue=a,a!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=a0(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof a.is=="string"?e=s.createElement(r,{is:a.is}):(e=s.createElement(r),r==="select"&&(s=e,a.multiple?s.multiple=!0:a.size&&(s.size=a.size))):e=s.createElementNS(e,r),e[Wr]=t,e[Il]=a,Pw(e,t,!1,!1),t.stateNode=e;e:{switch(s=Oh(r,a),r){case"dialog":Te("cancel",e),Te("close",e),o=a;break;case"iframe":case"object":case"embed":Te("load",e),o=a;break;case"video":case"audio":for(o=0;o<nl.length;o++)Te(nl[o],e);o=a;break;case"source":Te("error",e),o=a;break;case"img":case"image":case"link":Te("error",e),Te("load",e),o=a;break;case"details":Te("toggle",e),o=a;break;case"input":Wv(e,a),o=Ah(e,a),Te("invalid",e);break;case"option":o=a;break;case"select":e._wrapperState={wasMultiple:!!a.multiple},o=Be({},a,{value:void 0}),Te("invalid",e);break;case"textarea":Kv(e,a),o=Dh(e,a),Te("invalid",e);break;default:o=a}Mh(r,o),i=o;for(n in i)if(i.hasOwnProperty(n)){var l=i[n];n==="style"?s0(e,l):n==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&o0(e,l)):n==="children"?typeof l=="string"?(r!=="textarea"||l!=="")&&gl(e,l):typeof l=="number"&&gl(e,""+l):n!=="suppressContentEditableWarning"&&n!=="suppressHydrationWarning"&&n!=="autoFocus"&&(ml.hasOwnProperty(n)?l!=null&&n==="onScroll"&&Te("scroll",e):l!=null&&xm(e,n,l,s))}switch(r){case"input":Zu(e),Gv(e,a,!1);break;case"textarea":Zu(e),Xv(e);break;case"option":a.value!=null&&e.setAttribute("value",""+io(a.value));break;case"select":e.multiple=!!a.multiple,n=a.value,n!=null?is(e,!!a.multiple,n,!1):a.defaultValue!=null&&is(e,!!a.multiple,a.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Mc)}switch(r){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}}a&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Lt(t),null;case 6:if(e&&t.stateNode!=null)_w(e,t,e.memoizedProps,a);else{if(typeof a!="string"&&t.stateNode===null)throw Error(N(166));if(r=Xo(Pl.current),Xo(Kr.current),fc(t)){if(a=t.stateNode,r=t.memoizedProps,a[Wr]=t,(n=a.nodeValue!==r)&&(e=Yt,e!==null))switch(e.tag){case 3:dc(a.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&dc(a.nodeValue,r,(e.mode&1)!==0)}n&&(t.flags|=4)}else a=(r.nodeType===9?r:r.ownerDocument).createTextNode(a),a[Wr]=t,t.stateNode=a}return Lt(t),null;case 13:if(_e(Me),a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ne&&Qt!==null&&(t.mode&1)!==0&&(t.flags&128)===0)G0(),ms(),t.flags|=98560,n=!1;else if(n=fc(t),a!==null&&a.dehydrated!==null){if(e===null){if(!n)throw Error(N(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(N(317));n[Wr]=t}else ms(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Lt(t),n=!1}else Ar!==null&&(gm(Ar),Ar=null),n=!0;if(!n)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=r,t):(a=a!==null,a!==(e!==null&&e.memoizedState!==null)&&a&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(Me.current&1)!==0?rt===0&&(rt=3):tg())),t.updateQueue!==null&&(t.flags|=4),Lt(t),null);case 4:return ys(),lm(e,t),e===null&&bl(t.stateNode.containerInfo),Lt(t),null;case 10:return Fm(t.type._context),Lt(t),null;case 17:return $t(t.type)&&Oc(),Lt(t),null;case 19:if(_e(Me),n=t.memoizedState,n===null)return Lt(t),null;if(a=(t.flags&128)!==0,s=n.rendering,s===null)if(a)Zi(n,!1);else{if(rt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(s=$c(e),s!==null){for(t.flags|=128,Zi(n,!1),a=s.updateQueue,a!==null&&(t.updateQueue=a,t.flags|=4),t.subtreeFlags=0,a=r,r=t.child;r!==null;)n=r,e=a,n.flags&=14680066,s=n.alternate,s===null?(n.childLanes=0,n.lanes=e,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=s.childLanes,n.lanes=s.lanes,n.child=s.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=s.memoizedProps,n.memoizedState=s.memoizedState,n.updateQueue=s.updateQueue,n.type=s.type,e=s.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return be(Me,Me.current&1|2),t.child}e=e.sibling}n.tail!==null&&Ge()>xs&&(t.flags|=128,a=!0,Zi(n,!1),t.lanes=4194304)}else{if(!a)if(e=$c(s),e!==null){if(t.flags|=128,a=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Zi(n,!0),n.tail===null&&n.tailMode==="hidden"&&!s.alternate&&!Ne)return Lt(t),null}else 2*Ge()-n.renderingStartTime>xs&&r!==1073741824&&(t.flags|=128,a=!0,Zi(n,!1),t.lanes=4194304);n.isBackwards?(s.sibling=t.child,t.child=s):(r=n.last,r!==null?r.sibling=s:t.child=s,n.last=s)}return n.tail!==null?(t=n.tail,n.rendering=t,n.tail=t.sibling,n.renderingStartTime=Ge(),t.sibling=null,r=Me.current,be(Me,a?r&1|2:r&1),t):(Lt(t),null);case 22:case 23:return eg(),a=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==a&&(t.flags|=8192),a&&(t.mode&1)!==0?(Jt&1073741824)!==0&&(Lt(t),t.subtreeFlags&6&&(t.flags|=8192)):Lt(t),null;case 24:return null;case 25:return null}throw Error(N(156,t.tag))}function n_(e,t){switch(Nm(t),t.tag){case 1:return $t(t.type)&&Oc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ys(),_e(qt),_e(kt),$m(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return qm(t),null;case 13:if(_e(Me),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(N(340));ms()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return _e(Me),null;case 4:return ys(),null;case 10:return Fm(t.type._context),null;case 22:case 23:return eg(),null;case 24:return null;default:return null}}var mc=!1,It=!1,s_=typeof WeakSet=="function"?WeakSet:Set,U=null;function ns(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(a){$e(e,t,a)}else r.current=null}function um(e,t,r){try{r()}catch(a){$e(e,t,a)}}var Ux=!1;function i_(e,t){if(Wh=Ec,e=N0(),Em(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var a=r.getSelection&&r.getSelection();if(a&&a.rangeCount!==0){r=a.anchorNode;var o=a.anchorOffset,n=a.focusNode;a=a.focusOffset;try{r.nodeType,n.nodeType}catch{r=null;break e}var s=0,i=-1,l=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var h;d!==r||o!==0&&d.nodeType!==3||(i=s+o),d!==n||a!==0&&d.nodeType!==3||(l=s+a),d.nodeType===3&&(s+=d.nodeValue.length),(h=d.firstChild)!==null;)f=d,d=h;for(;;){if(d===e)break t;if(f===r&&++u===o&&(i=s),f===n&&++c===a&&(l=s),(h=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=h}r=i===-1||l===-1?null:{start:i,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(Gh={focusedElem:e,selectionRange:r},Ec=!1,U=t;U!==null;)if(t=U,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,U=e;else for(;U!==null;){t=U;try{var x=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var w=x.memoizedProps,C=x.memoizedState,m=t.stateNode,g=m.getSnapshotBeforeUpdate(t.elementType===t.type?w:Tr(t.type,w),C);m.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(N(163))}}catch(b){$e(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,U=e;break}U=t.return}return x=Ux,Ux=!1,x}function fl(e,t,r){var a=t.updateQueue;if(a=a!==null?a.lastEffect:null,a!==null){var o=a=a.next;do{if((o.tag&e)===e){var n=o.destroy;o.destroy=void 0,n!==void 0&&um(t,r,n)}o=o.next}while(o!==a)}}function nd(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 a=r.create;r.destroy=a()}r=r.next}while(r!==t)}}function cm(e){var t=e.ref;if(t!==null){var r=e.stateNode;e.tag,e=r,typeof t=="function"?t(e):t.current=e}}function Aw(e){var t=e.alternate;t!==null&&(e.alternate=null,Aw(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Wr],delete t[Il],delete t[Jh],delete t[$T],delete t[HT])),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 Rw(e){return e.tag===5||e.tag===3||e.tag===4}function Vx(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Rw(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 dm(e,t,r){var a=e.tag;if(a===5||a===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=Mc));else if(a!==4&&(e=e.child,e!==null))for(dm(e,t,r),e=e.sibling;e!==null;)dm(e,t,r),e=e.sibling}function fm(e,t,r){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(a!==4&&(e=e.child,e!==null))for(fm(e,t,r),e=e.sibling;e!==null;)fm(e,t,r),e=e.sibling}var ht=null,_r=!1;function Wa(e,t,r){for(r=r.child;r!==null;)Ew(e,t,r),r=r.sibling}function Ew(e,t,r){if(Gr&&typeof Gr.onCommitFiberUnmount=="function")try{Gr.onCommitFiberUnmount(Qc,r)}catch{}switch(r.tag){case 5:It||ns(r,t);case 6:var a=ht,o=_r;ht=null,Wa(e,t,r),ht=a,_r=o,ht!==null&&(_r?(e=ht,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):ht.removeChild(r.stateNode));break;case 18:ht!==null&&(_r?(e=ht,r=r.stateNode,e.nodeType===8?mh(e.parentNode,r):e.nodeType===1&&mh(e,r),wl(e)):mh(ht,r.stateNode));break;case 4:a=ht,o=_r,ht=r.stateNode.containerInfo,_r=!0,Wa(e,t,r),ht=a,_r=o;break;case 0:case 11:case 14:case 15:if(!It&&(a=r.updateQueue,a!==null&&(a=a.lastEffect,a!==null))){o=a=a.next;do{var n=o,s=n.destroy;n=n.tag,s!==void 0&&((n&2)!==0||(n&4)!==0)&&um(r,t,s),o=o.next}while(o!==a)}Wa(e,t,r);break;case 1:if(!It&&(ns(r,t),a=r.stateNode,typeof a.componentWillUnmount=="function"))try{a.props=r.memoizedProps,a.state=r.memoizedState,a.componentWillUnmount()}catch(i){$e(r,t,i)}Wa(e,t,r);break;case 21:Wa(e,t,r);break;case 22:r.mode&1?(It=(a=It)||r.memoizedState!==null,Wa(e,t,r),It=a):Wa(e,t,r);break;default:Wa(e,t,r)}}function jx(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new s_),t.forEach(function(a){var o=g_.bind(null,e,a);r.has(a)||(r.add(a),a.then(o,o))})}}function Pr(e,t){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a];try{var n=e,s=t,i=s;e:for(;i!==null;){switch(i.tag){case 5:ht=i.stateNode,_r=!1;break e;case 3:ht=i.stateNode.containerInfo,_r=!0;break e;case 4:ht=i.stateNode.containerInfo,_r=!0;break e}i=i.return}if(ht===null)throw Error(N(160));Ew(n,s,o),ht=null,_r=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(u){$e(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Dw(t,e),t=t.sibling}function Dw(e,t){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Pr(t,e),Hr(e),a&4){try{fl(3,e,e.return),nd(3,e)}catch(w){$e(e,e.return,w)}try{fl(5,e,e.return)}catch(w){$e(e,e.return,w)}}break;case 1:Pr(t,e),Hr(e),a&512&&r!==null&&ns(r,r.return);break;case 5:if(Pr(t,e),Hr(e),a&512&&r!==null&&ns(r,r.return),e.flags&32){var o=e.stateNode;try{gl(o,"")}catch(w){$e(e,e.return,w)}}if(a&4&&(o=e.stateNode,o!=null)){var n=e.memoizedProps,s=r!==null?r.memoizedProps:n,i=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{i==="input"&&n.type==="radio"&&n.name!=null&&t0(o,n),Oh(i,s);var u=Oh(i,n);for(s=0;s<l.length;s+=2){var c=l[s],d=l[s+1];c==="style"?s0(o,d):c==="dangerouslySetInnerHTML"?o0(o,d):c==="children"?gl(o,d):xm(o,c,d,u)}switch(i){case"input":Rh(o,n);break;case"textarea":r0(o,n);break;case"select":var f=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!n.multiple;var h=n.value;h!=null?is(o,!!n.multiple,h,!1):f!==!!n.multiple&&(n.defaultValue!=null?is(o,!!n.multiple,n.defaultValue,!0):is(o,!!n.multiple,n.multiple?[]:"",!1))}o[Il]=n}catch(w){$e(e,e.return,w)}}break;case 6:if(Pr(t,e),Hr(e),a&4){if(e.stateNode===null)throw Error(N(162));o=e.stateNode,n=e.memoizedProps;try{o.nodeValue=n}catch(w){$e(e,e.return,w)}}break;case 3:if(Pr(t,e),Hr(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{wl(t.containerInfo)}catch(w){$e(e,e.return,w)}break;case 4:Pr(t,e),Hr(e);break;case 13:Pr(t,e),Hr(e),o=e.child,o.flags&8192&&(n=o.memoizedState!==null,o.stateNode.isHidden=n,!n||o.alternate!==null&&o.alternate.memoizedState!==null||(Ym=Ge())),a&4&&jx(e);break;case 22:if(c=r!==null&&r.memoizedState!==null,e.mode&1?(It=(u=It)||c,Pr(t,e),It=u):Pr(t,e),Hr(e),a&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&(e.mode&1)!==0)for(U=e,c=e.child;c!==null;){for(d=U=c;U!==null;){switch(f=U,h=f.child,f.tag){case 0:case 11:case 14:case 15:fl(4,f,f.return);break;case 1:ns(f,f.return);var x=f.stateNode;if(typeof x.componentWillUnmount=="function"){a=f,r=f.return;try{t=a,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(w){$e(a,r,w)}}break;case 5:ns(f,f.return);break;case 22:if(f.memoizedState!==null){$x(d);continue}}h!==null?(h.return=f,U=h):$x(d)}c=c.sibling}e:for(c=null,d=e;;){if(d.tag===5){if(c===null){c=d;try{o=d.stateNode,u?(n=o.style,typeof n.setProperty=="function"?n.setProperty("display","none","important"):n.display="none"):(i=d.stateNode,l=d.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,i.style.display=n0("display",s))}catch(w){$e(e,e.return,w)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(w){$e(e,e.return,w)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Pr(t,e),Hr(e),a&4&&jx(e);break;case 21:break;default:Pr(t,e),Hr(e)}}function Hr(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(Rw(r)){var a=r;break e}r=r.return}throw Error(N(160))}switch(a.tag){case 5:var o=a.stateNode;a.flags&32&&(gl(o,""),a.flags&=-33);var n=Vx(e);fm(e,n,o);break;case 3:case 4:var s=a.stateNode.containerInfo,i=Vx(e);dm(e,i,s);break;default:throw Error(N(161))}}catch(l){$e(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function l_(e,t,r){U=e,Nw(e,t,r)}function Nw(e,t,r){for(var a=(e.mode&1)!==0;U!==null;){var o=U,n=o.child;if(o.tag===22&&a){var s=o.memoizedState!==null||mc;if(!s){var i=o.alternate,l=i!==null&&i.memoizedState!==null||It;i=mc;var u=It;if(mc=s,(It=l)&&!u)for(U=o;U!==null;)s=U,l=s.child,s.tag===22&&s.memoizedState!==null?Hx(o):l!==null?(l.return=s,U=l):Hx(o);for(;n!==null;)U=n,Nw(n,t,r),n=n.sibling;U=o,mc=i,It=u}qx(e,t,r)}else(o.subtreeFlags&8772)!==0&&n!==null?(n.return=o,U=n):qx(e,t,r)}}function qx(e){for(;U!==null;){var t=U;if((t.flags&8772)!==0){var r=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:It||nd(5,t);break;case 1:var a=t.stateNode;if(t.flags&4&&!It)if(r===null)a.componentDidMount();else{var o=t.elementType===t.type?r.memoizedProps:Tr(t.type,r.memoizedProps);a.componentDidUpdate(o,r.memoizedState,a.__reactInternalSnapshotBeforeUpdate)}var n=t.updateQueue;n!==null&&kx(t,n,a);break;case 3:var s=t.updateQueue;if(s!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}kx(t,s,r)}break;case 5:var i=t.stateNode;if(r===null&&t.flags&4){r=i;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&r.focus();break;case"img":l.src&&(r.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var d=c.dehydrated;d!==null&&wl(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(N(163))}It||t.flags&512&&cm(t)}catch(f){$e(t,t.return,f)}}if(t===e){U=null;break}if(r=t.sibling,r!==null){r.return=t.return,U=r;break}U=t.return}}function $x(e){for(;U!==null;){var t=U;if(t===e){U=null;break}var r=t.sibling;if(r!==null){r.return=t.return,U=r;break}U=t.return}}function Hx(e){for(;U!==null;){var t=U;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{nd(4,t)}catch(l){$e(t,r,l)}break;case 1:var a=t.stateNode;if(typeof a.componentDidMount=="function"){var o=t.return;try{a.componentDidMount()}catch(l){$e(t,o,l)}}var n=t.return;try{cm(t)}catch(l){$e(t,n,l)}break;case 5:var s=t.return;try{cm(t)}catch(l){$e(t,s,l)}}}catch(l){$e(t,t.return,l)}if(t===e){U=null;break}var i=t.sibling;if(i!==null){i.return=t.return,U=i;break}U=t.return}}var u_=Math.ceil,Wc=ba.ReactCurrentDispatcher,Jm=ba.ReactCurrentOwner,xr=ba.ReactCurrentBatchConfig,fe=0,ut=null,Je=null,mt=0,Jt=0,ss=co(0),rt=0,Rl=null,tn=0,sd=0,Qm=0,pl=null,Vt=null,Ym=0,xs=1/0,ha=null,Gc=!1,pm=null,oo=null,gc=!1,Ya=null,Kc=0,hl=0,hm=null,Lc=-1,Ic=0;function Nt(){return(fe&6)!==0?Ge():Lc!==-1?Lc:Lc=Ge()}function no(e){return(e.mode&1)===0?1:(fe&2)!==0&&mt!==0?mt&-mt:WT.transition!==null?(Ic===0&&(Ic=v0()),Ic):(e=ge,e!==0||(e=window.event,e=e===void 0?16:I0(e.type)),e)}function Er(e,t,r,a){if(50<hl)throw hl=0,hm=null,Error(N(185));El(e,r,a),((fe&2)===0||e!==ut)&&(e===ut&&((fe&2)===0&&(sd|=r),rt===4&&Ja(e,mt)),Ht(e,a),r===1&&fe===0&&(t.mode&1)===0&&(xs=Ge()+500,rd&&fo()))}function Ht(e,t){var r=e.callbackNode;KP(e,t);var a=Rc(e,e===ut?mt:0);if(a===0)r!==null&&Yv(r),e.callbackNode=null,e.callbackPriority=0;else if(t=a&-a,e.callbackPriority!==t){if(r!=null&&Yv(r),t===1)e.tag===0?zT(zx.bind(null,e)):H0(zx.bind(null,e)),jT(function(){(fe&6)===0&&fo()}),r=null;else{switch(x0(a)){case 1:r=Lm;break;case 4:r=g0;break;case 16:r=Ac;break;case 536870912:r=y0;break;default:r=Ac}r=qw(r,Mw.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Mw(e,t){if(Lc=-1,Ic=0,(fe&6)!==0)throw Error(N(327));var r=e.callbackNode;if(fs()&&e.callbackNode!==r)return null;var a=Rc(e,e===ut?mt:0);if(a===0)return null;if((a&30)!==0||(a&e.expiredLanes)!==0||t)t=Xc(e,a);else{t=a;var o=fe;fe|=2;var n=Bw();(ut!==e||mt!==t)&&(ha=null,xs=Ge()+500,Jo(e,t));do try{f_();break}catch(i){Ow(e,i)}while(!0);Bm(),Wc.current=n,fe=o,Je!==null?t=0:(ut=null,mt=0,t=rt)}if(t!==0){if(t===2&&(o=jh(e),o!==0&&(a=o,t=mm(e,o))),t===1)throw r=Rl,Jo(e,0),Ja(e,a),Ht(e,Ge()),r;if(t===6)Ja(e,a);else{if(o=e.current.alternate,(a&30)===0&&!c_(o)&&(t=Xc(e,a),t===2&&(n=jh(e),n!==0&&(a=n,t=mm(e,n))),t===1))throw r=Rl,Jo(e,0),Ja(e,a),Ht(e,Ge()),r;switch(e.finishedWork=o,e.finishedLanes=a,t){case 0:case 1:throw Error(N(345));case 2:Wo(e,Vt,ha);break;case 3:if(Ja(e,a),(a&130023424)===a&&(t=Ym+500-Ge(),10<t)){if(Rc(e,0)!==0)break;if(o=e.suspendedLanes,(o&a)!==a){Nt(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Xh(Wo.bind(null,e,Vt,ha),t);break}Wo(e,Vt,ha);break;case 4:if(Ja(e,a),(a&4194240)===a)break;for(t=e.eventTimes,o=-1;0<a;){var s=31-Rr(a);n=1<<s,s=t[s],s>o&&(o=s),a&=~n}if(a=o,a=Ge()-a,a=(120>a?120:480>a?480:1080>a?1080:1920>a?1920:3e3>a?3e3:4320>a?4320:1960*u_(a/1960))-a,10<a){e.timeoutHandle=Xh(Wo.bind(null,e,Vt,ha),a);break}Wo(e,Vt,ha);break;case 5:Wo(e,Vt,ha);break;default:throw Error(N(329))}}}return Ht(e,Ge()),e.callbackNode===r?Mw.bind(null,e):null}function mm(e,t){var r=pl;return e.current.memoizedState.isDehydrated&&(Jo(e,t).flags|=256),e=Xc(e,t),e!==2&&(t=Vt,Vt=r,t!==null&&gm(t)),e}function gm(e){Vt===null?Vt=e:Vt.push.apply(Vt,e)}function c_(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var a=0;a<r.length;a++){var o=r[a],n=o.getSnapshot;o=o.value;try{if(!Dr(n(),o))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ja(e,t){for(t&=~Qm,t&=~sd,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Rr(t),a=1<<r;e[r]=-1,t&=~a}}function zx(e){if((fe&6)!==0)throw Error(N(327));fs();var t=Rc(e,0);if((t&1)===0)return Ht(e,Ge()),null;var r=Xc(e,t);if(e.tag!==0&&r===2){var a=jh(e);a!==0&&(t=a,r=mm(e,a))}if(r===1)throw r=Rl,Jo(e,0),Ja(e,t),Ht(e,Ge()),r;if(r===6)throw Error(N(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Wo(e,Vt,ha),Ht(e,Ge()),null}function Zm(e,t){var r=fe;fe|=1;try{return e(t)}finally{fe=r,fe===0&&(xs=Ge()+500,rd&&fo())}}function rn(e){Ya!==null&&Ya.tag===0&&(fe&6)===0&&fs();var t=fe;fe|=1;var r=xr.transition,a=ge;try{if(xr.transition=null,ge=1,e)return e()}finally{ge=a,xr.transition=r,fe=t,(fe&6)===0&&fo()}}function eg(){Jt=ss.current,_e(ss)}function Jo(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,VT(r)),Je!==null)for(r=Je.return;r!==null;){var a=r;switch(Nm(a),a.tag){case 1:a=a.type.childContextTypes,a!=null&&Oc();break;case 3:ys(),_e(qt),_e(kt),$m();break;case 5:qm(a);break;case 4:ys();break;case 13:_e(Me);break;case 19:_e(Me);break;case 10:Fm(a.type._context);break;case 22:case 23:eg()}r=r.return}if(ut=e,Je=e=so(e.current,null),mt=Jt=t,rt=0,Rl=null,Qm=sd=tn=0,Vt=pl=null,Ko!==null){for(t=0;t<Ko.length;t++)if(r=Ko[t],a=r.interleaved,a!==null){r.interleaved=null;var o=a.next,n=r.pending;if(n!==null){var s=n.next;n.next=o,a.next=s}r.pending=a}Ko=null}return e}function Ow(e,t){do{var r=Je;try{if(Bm(),Sc.current=zc,Hc){for(var a=Oe.memoizedState;a!==null;){var o=a.queue;o!==null&&(o.pending=null),a=a.next}Hc=!1}if(en=0,lt=tt=Oe=null,dl=!1,Tl=0,Jm.current=null,r===null||r.return===null){rt=1,Rl=t,Je=null;break}e:{var n=e,s=r.return,i=r,l=t;if(t=mt,i.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,c=i,d=c.tag;if((c.mode&1)===0&&(d===0||d===11||d===15)){var f=c.alternate;f?(c.updateQueue=f.updateQueue,c.memoizedState=f.memoizedState,c.lanes=f.lanes):(c.updateQueue=null,c.memoizedState=null)}var h=Ex(s);if(h!==null){h.flags&=-257,Dx(h,s,i,n,t),h.mode&1&&Rx(n,u,t),t=h,l=u;var x=t.updateQueue;if(x===null){var w=new Set;w.add(l),t.updateQueue=w}else x.add(l);break e}else{if((t&1)===0){Rx(n,u,t),tg();break e}l=Error(N(426))}}else if(Ne&&i.mode&1){var C=Ex(s);if(C!==null){(C.flags&65536)===0&&(C.flags|=256),Dx(C,s,i,n,t),Mm(vs(l,i));break e}}n=l=vs(l,i),rt!==4&&(rt=2),pl===null?pl=[n]:pl.push(n),n=s;do{switch(n.tag){case 3:n.flags|=65536,t&=-t,n.lanes|=t;var m=xw(n,l,t);Ix(n,m);break e;case 1:i=l;var g=n.type,y=n.stateNode;if((n.flags&128)===0&&(typeof g.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(oo===null||!oo.has(y)))){n.flags|=65536,t&=-t,n.lanes|=t;var b=ww(n,i,t);Ix(n,b);break e}}n=n.return}while(n!==null)}Uw(r)}catch(k){t=k,Je===r&&r!==null&&(Je=r=r.return);continue}break}while(!0)}function Bw(){var e=Wc.current;return Wc.current=zc,e===null?zc:e}function tg(){(rt===0||rt===3||rt===2)&&(rt=4),ut===null||(tn&268435455)===0&&(sd&268435455)===0||Ja(ut,mt)}function Xc(e,t){var r=fe;fe|=2;var a=Bw();(ut!==e||mt!==t)&&(ha=null,Jo(e,t));do try{d_();break}catch(o){Ow(e,o)}while(!0);if(Bm(),fe=r,Wc.current=a,Je!==null)throw Error(N(261));return ut=null,mt=0,rt}function d_(){for(;Je!==null;)Fw(Je)}function f_(){for(;Je!==null&&!UP();)Fw(Je)}function Fw(e){var t=jw(e.alternate,e,Jt);e.memoizedProps=e.pendingProps,t===null?Uw(e):Je=t,Jm.current=null}function Uw(e){var t=e;do{var r=t.alternate;if(e=t.return,(t.flags&32768)===0){if(r=o_(r,t,Jt),r!==null){Je=r;return}}else{if(r=n_(r,t),r!==null){r.flags&=32767,Je=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{rt=6,Je=null;return}}if(t=t.sibling,t!==null){Je=t;return}Je=t=e}while(t!==null);rt===0&&(rt=5)}function Wo(e,t,r){var a=ge,o=xr.transition;try{xr.transition=null,ge=1,p_(e,t,r,a)}finally{xr.transition=o,ge=a}return null}function p_(e,t,r,a){do fs();while(Ya!==null);if((fe&6)!==0)throw Error(N(327));r=e.finishedWork;var o=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(N(177));e.callbackNode=null,e.callbackPriority=0;var n=r.lanes|r.childLanes;if(XP(e,n),e===ut&&(Je=ut=null,mt=0),(r.subtreeFlags&2064)===0&&(r.flags&2064)===0||gc||(gc=!0,qw(Ac,function(){return fs(),null})),n=(r.flags&15990)!==0,(r.subtreeFlags&15990)!==0||n){n=xr.transition,xr.transition=null;var s=ge;ge=1;var i=fe;fe|=4,Jm.current=null,i_(e,r),Dw(r,e),MT(Gh),Ec=!!Wh,Gh=Wh=null,e.current=r,l_(r,e,o),VP(),fe=i,ge=s,xr.transition=n}else e.current=r;if(gc&&(gc=!1,Ya=e,Kc=o),n=e.pendingLanes,n===0&&(oo=null),$P(r.stateNode,a),Ht(e,Ge()),t!==null)for(a=e.onRecoverableError,r=0;r<t.length;r++)o=t[r],a(o.value,{componentStack:o.stack,digest:o.digest});if(Gc)throw Gc=!1,e=pm,pm=null,e;return(Kc&1)!==0&&e.tag!==0&&fs(),n=e.pendingLanes,(n&1)!==0?e===hm?hl++:(hl=0,hm=e):hl=0,fo(),null}function fs(){if(Ya!==null){var e=x0(Kc),t=xr.transition,r=ge;try{if(xr.transition=null,ge=16>e?16:e,Ya===null)var a=!1;else{if(e=Ya,Ya=null,Kc=0,(fe&6)!==0)throw Error(N(331));var o=fe;for(fe|=4,U=e.current;U!==null;){var n=U,s=n.child;if((U.flags&16)!==0){var i=n.deletions;if(i!==null){for(var l=0;l<i.length;l++){var u=i[l];for(U=u;U!==null;){var c=U;switch(c.tag){case 0:case 11:case 15:fl(8,c,n)}var d=c.child;if(d!==null)d.return=c,U=d;else for(;U!==null;){c=U;var f=c.sibling,h=c.return;if(Aw(c),c===u){U=null;break}if(f!==null){f.return=h,U=f;break}U=h}}}var x=n.alternate;if(x!==null){var w=x.child;if(w!==null){x.child=null;do{var C=w.sibling;w.sibling=null,w=C}while(w!==null)}}U=n}}if((n.subtreeFlags&2064)!==0&&s!==null)s.return=n,U=s;else e:for(;U!==null;){if(n=U,(n.flags&2048)!==0)switch(n.tag){case 0:case 11:case 15:fl(9,n,n.return)}var m=n.sibling;if(m!==null){m.return=n.return,U=m;break e}U=n.return}}var g=e.current;for(U=g;U!==null;){s=U;var y=s.child;if((s.subtreeFlags&2064)!==0&&y!==null)y.return=s,U=y;else e:for(s=g;U!==null;){if(i=U,(i.flags&2048)!==0)try{switch(i.tag){case 0:case 11:case 15:nd(9,i)}}catch(k){$e(i,i.return,k)}if(i===s){U=null;break e}var b=i.sibling;if(b!==null){b.return=i.return,U=b;break e}U=i.return}}if(fe=o,fo(),Gr&&typeof Gr.onPostCommitFiberRoot=="function")try{Gr.onPostCommitFiberRoot(Qc,e)}catch{}a=!0}return a}finally{ge=r,xr.transition=t}}return!1}function Wx(e,t,r){t=vs(r,t),t=xw(e,t,1),e=ao(e,t,1),t=Nt(),e!==null&&(El(e,1,t),Ht(e,t))}function $e(e,t,r){if(e.tag===3)Wx(e,e,r);else for(;t!==null;){if(t.tag===3){Wx(t,e,r);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(oo===null||!oo.has(a))){e=vs(r,e),e=ww(t,e,1),t=ao(t,e,1),e=Nt(),t!==null&&(El(t,1,e),Ht(t,e));break}}t=t.return}}function h_(e,t,r){var a=e.pingCache;a!==null&&a.delete(t),t=Nt(),e.pingedLanes|=e.suspendedLanes&r,ut===e&&(mt&r)===r&&(rt===4||rt===3&&(mt&130023424)===mt&&500>Ge()-Ym?Jo(e,0):Qm|=r),Ht(e,t)}function Vw(e,t){t===0&&((e.mode&1)===0?t=1:(t=rc,rc<<=1,(rc&130023424)===0&&(rc=4194304)));var r=Nt();e=Sa(e,t),e!==null&&(El(e,t,r),Ht(e,r))}function m_(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Vw(e,r)}function g_(e,t){var r=0;switch(e.tag){case 13:var a=e.stateNode,o=e.memoizedState;o!==null&&(r=o.retryLane);break;case 19:a=e.stateNode;break;default:throw Error(N(314))}a!==null&&a.delete(t),Vw(e,r)}var jw;jw=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||qt.current)jt=!0;else{if((e.lanes&r)===0&&(t.flags&128)===0)return jt=!1,a_(e,t,r);jt=(e.flags&131072)!==0}else jt=!1,Ne&&(t.flags&1048576)!==0&&z0(t,Uc,t.index);switch(t.lanes=0,t.tag){case 2:var a=t.type;bc(e,t),e=t.pendingProps;var o=hs(t,kt.current);ds(t,r),o=zm(null,t,a,e,o,r);var n=Wm();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,$t(a)?(n=!0,Bc(t)):n=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Vm(t),o.updater=od,t.stateNode=o,o._reactInternals=t,rm(t,a,e,r),t=nm(null,t,a,!0,n,r)):(t.tag=0,Ne&&n&&Dm(t),Dt(null,t,o,r),t=t.child),t;case 16:a=t.elementType;e:{switch(bc(e,t),e=t.pendingProps,o=a._init,a=o(a._payload),t.type=a,o=t.tag=v_(a),e=Tr(a,e),o){case 0:t=om(null,t,a,e,r);break e;case 1:t=Ox(null,t,a,e,r);break e;case 11:t=Nx(null,t,a,e,r);break e;case 14:t=Mx(null,t,a,Tr(a.type,e),r);break e}throw Error(N(306,a,""))}return t;case 0:return a=t.type,o=t.pendingProps,o=t.elementType===a?o:Tr(a,o),om(e,t,a,o,r);case 1:return a=t.type,o=t.pendingProps,o=t.elementType===a?o:Tr(a,o),Ox(e,t,a,o,r);case 3:e:{if(Lw(t),e===null)throw Error(N(387));a=t.pendingProps,n=t.memoizedState,o=n.element,Q0(e,t),qc(t,a,null,r);var s=t.memoizedState;if(a=s.element,n.isDehydrated)if(n={element:a,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=n,t.memoizedState=n,t.flags&256){o=vs(Error(N(423)),t),t=Bx(e,t,a,r,o);break e}else if(a!==o){o=vs(Error(N(424)),t),t=Bx(e,t,a,r,o);break e}else for(Qt=ro(t.stateNode.containerInfo.firstChild),Yt=t,Ne=!0,Ar=null,r=X0(t,null,a,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(ms(),a===o){t=Ca(e,t,r);break e}Dt(e,t,a,r)}t=t.child}return t;case 5:return Y0(t),e===null&&Zh(t),a=t.type,o=t.pendingProps,n=e!==null?e.memoizedProps:null,s=o.children,Kh(a,o)?s=null:n!==null&&Kh(a,n)&&(t.flags|=32),bw(e,t),Dt(e,t,s,r),t.child;case 6:return e===null&&Zh(t),null;case 13:return Iw(e,t,r);case 4:return jm(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=gs(t,null,a,r):Dt(e,t,a,r),t.child;case 11:return a=t.type,o=t.pendingProps,o=t.elementType===a?o:Tr(a,o),Nx(e,t,a,o,r);case 7:return Dt(e,t,t.pendingProps,r),t.child;case 8:return Dt(e,t,t.pendingProps.children,r),t.child;case 12:return Dt(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(a=t.type._context,o=t.pendingProps,n=t.memoizedProps,s=o.value,be(Vc,a._currentValue),a._currentValue=s,n!==null)if(Dr(n.value,s)){if(n.children===o.children&&!qt.current){t=Ca(e,t,r);break e}}else for(n=t.child,n!==null&&(n.return=t);n!==null;){var i=n.dependencies;if(i!==null){s=n.child;for(var l=i.firstContext;l!==null;){if(l.context===a){if(n.tag===1){l=va(-1,r&-r),l.tag=2;var u=n.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}n.lanes|=r,l=n.alternate,l!==null&&(l.lanes|=r),em(n.return,r,t),i.lanes|=r;break}l=l.next}}else if(n.tag===10)s=n.type===t.type?null:n.child;else if(n.tag===18){if(s=n.return,s===null)throw Error(N(341));s.lanes|=r,i=s.alternate,i!==null&&(i.lanes|=r),em(s,r,t),s=n.sibling}else s=n.child;if(s!==null)s.return=n;else for(s=n;s!==null;){if(s===t){s=null;break}if(n=s.sibling,n!==null){n.return=s.return,s=n;break}s=s.return}n=s}Dt(e,t,o.children,r),t=t.child}return t;case 9:return o=t.type,a=t.pendingProps.children,ds(t,r),o=wr(o),a=a(o),t.flags|=1,Dt(e,t,a,r),t.child;case 14:return a=t.type,o=Tr(a,t.pendingProps),o=Tr(a.type,o),Mx(e,t,a,o,r);case 15:return Sw(e,t,t.type,t.pendingProps,r);case 17:return a=t.type,o=t.pendingProps,o=t.elementType===a?o:Tr(a,o),bc(e,t),t.tag=1,$t(a)?(e=!0,Bc(t)):e=!1,ds(t,r),vw(t,a,o),rm(t,a,o,r),nm(null,t,a,!0,e,r);case 19:return kw(e,t,r);case 22:return Cw(e,t,r)}throw Error(N(156,t.tag))};function qw(e,t){return m0(e,t)}function y_(e,t,r,a){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=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function vr(e,t,r,a){return new y_(e,t,r,a)}function rg(e){return e=e.prototype,!(!e||!e.isReactComponent)}function v_(e){if(typeof e=="function")return rg(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Sm)return 11;if(e===Cm)return 14}return 2}function so(e,t){var r=e.alternate;return r===null?(r=vr(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 kc(e,t,r,a,o,n){var s=2;if(a=e,typeof e=="function")rg(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Jn:return Qo(r.children,o,n,t);case wm:s=8,o|=8;break;case kh:return e=vr(12,r,t,o|2),e.elementType=kh,e.lanes=n,e;case Ph:return e=vr(13,r,t,o),e.elementType=Ph,e.lanes=n,e;case Th:return e=vr(19,r,t,o),e.elementType=Th,e.lanes=n,e;case Yx:return id(r,o,n,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Jx:s=10;break e;case Qx:s=9;break e;case Sm:s=11;break e;case Cm:s=14;break e;case Ga:s=16,a=null;break e}throw Error(N(130,e==null?e:typeof e,""))}return t=vr(s,r,t,o),t.elementType=e,t.type=a,t.lanes=n,t}function Qo(e,t,r,a){return e=vr(7,e,a,t),e.lanes=r,e}function id(e,t,r,a){return e=vr(22,e,a,t),e.elementType=Yx,e.lanes=r,e.stateNode={isHidden:!1},e}function bh(e,t,r){return e=vr(6,e,null,t),e.lanes=r,e}function Lh(e,t,r){return t=vr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function x_(e,t,r,a,o){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=ih(0),this.expirationTimes=ih(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ih(0),this.identifierPrefix=a,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function ag(e,t,r,a,o,n,s,i,l){return e=new x_(e,t,r,i,l),t===1?(t=1,n===!0&&(t|=8)):t=0,n=vr(3,null,null,t),e.current=n,n.stateNode=e,n.memoizedState={element:a,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Vm(n),e}function w_(e,t,r){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Xn,key:a==null?null:""+a,children:e,containerInfo:t,implementation:r}}function $w(e){if(!e)return lo;e=e._reactInternals;e:{if(on(e)!==e||e.tag!==1)throw Error(N(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if($t(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(N(171))}if(e.tag===1){var r=e.type;if($t(r))return $0(e,r,t)}return t}function Hw(e,t,r,a,o,n,s,i,l){return e=ag(r,a,!0,e,o,n,s,i,l),e.context=$w(null),r=e.current,a=Nt(),o=no(r),n=va(a,o),n.callback=t??null,ao(r,n,o),e.current.lanes=o,El(e,o,a),Ht(e,a),e}function ld(e,t,r,a){var o=t.current,n=Nt(),s=no(o);return r=$w(r),t.context===null?t.context=r:t.pendingContext=r,t=va(n,s),t.payload={element:e},a=a===void 0?null:a,a!==null&&(t.callback=a),e=ao(o,t,s),e!==null&&(Er(e,o,s,n),wc(e,o,s)),s}function Jc(e){return e=e.current,e.child?(e.child.tag===5,e.child.stateNode):null}function Gx(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function og(e,t){Gx(e,t),(e=e.alternate)&&Gx(e,t)}function S_(){return null}var zw=typeof reportError=="function"?reportError:function(e){console.error(e)};function ng(e){this._internalRoot=e}ud.prototype.render=ng.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(N(409));ld(e,t,null,null)};ud.prototype.unmount=ng.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;rn(function(){ld(null,e,null,null)}),t[wa]=null}};function ud(e){this._internalRoot=e}ud.prototype.unstable_scheduleHydration=function(e){if(e){var t=C0();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Xa.length&&t!==0&&t<Xa[r].priority;r++);Xa.splice(r,0,e),r===0&&L0(e)}};function sg(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function cd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Kx(){}function C_(e,t,r,a,o){if(o){if(typeof a=="function"){var n=a;a=function(){var u=Jc(s);n.call(u)}}var s=Hw(t,a,e,0,null,!1,!1,"",Kx);return e._reactRootContainer=s,e[wa]=s.current,bl(e.nodeType===8?e.parentNode:e),rn(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof a=="function"){var i=a;a=function(){var u=Jc(l);i.call(u)}}var l=ag(e,0,!1,null,null,!1,!1,"",Kx);return e._reactRootContainer=l,e[wa]=l.current,bl(e.nodeType===8?e.parentNode:e),rn(function(){ld(t,l,r,a)}),l}function dd(e,t,r,a,o){var n=r._reactRootContainer;if(n){var s=n;if(typeof o=="function"){var i=o;o=function(){var l=Jc(s);i.call(l)}}ld(t,s,e,o)}else s=C_(r,t,e,o,a);return Jc(s)}w0=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=ol(t.pendingLanes);r!==0&&(Im(t,r|1),Ht(t,Ge()),(fe&6)===0&&(xs=Ge()+500,fo()))}break;case 13:rn(function(){var a=Sa(e,1);if(a!==null){var o=Nt();Er(a,e,1,o)}}),og(e,1)}};km=function(e){if(e.tag===13){var t=Sa(e,134217728);if(t!==null){var r=Nt();Er(t,e,134217728,r)}og(e,134217728)}};S0=function(e){if(e.tag===13){var t=no(e),r=Sa(e,t);if(r!==null){var a=Nt();Er(r,e,t,a)}og(e,t)}};C0=function(){return ge};b0=function(e,t){var r=ge;try{return ge=e,t()}finally{ge=r}};Fh=function(e,t,r){switch(t){case"input":if(Rh(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var a=r[t];if(a!==e&&a.form===e.form){var o=td(a);if(!o)throw Error(N(90));e0(a),Rh(a,o)}}}break;case"textarea":r0(e,r);break;case"select":t=r.value,t!=null&&is(e,!!r.multiple,t,!1)}};u0=Zm;c0=rn;var b_={usingClientEntryPoint:!1,Events:[Nl,es,td,i0,l0,Zm]},el={findFiberByHostInstance:Go,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},L_={bundleType:el.bundleType,version:el.version,rendererPackageName:el.rendererPackageName,rendererConfig:el.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ba.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=p0(e),e===null?null:e.stateNode},findFiberByHostInstance:el.findFiberByHostInstance||S_,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(tl=__REACT_DEVTOOLS_GLOBAL_HOOK__,!tl.isDisabled&&tl.supportsFiber))try{Qc=tl.inject(L_),Gr=tl}catch{}var tl;tr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=b_;tr.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!sg(t))throw Error(N(200));return w_(e,t,null,r)};tr.createRoot=function(e,t){if(!sg(e))throw Error(N(299));var r=!1,a="",o=zw;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=ag(e,1,!1,null,null,r,!1,a,o),e[wa]=t.current,bl(e.nodeType===8?e.parentNode:e),new ng(t)};tr.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(N(188)):(e=Object.keys(e).join(","),Error(N(268,e)));return e=p0(t),e=e===null?null:e.stateNode,e};tr.flushSync=function(e){return rn(e)};tr.hydrate=function(e,t,r){if(!cd(t))throw Error(N(200));return dd(null,e,t,!0,r)};tr.hydrateRoot=function(e,t,r){if(!sg(e))throw Error(N(405));var a=r!=null&&r.hydratedSources||null,o=!1,n="",s=zw;if(r!=null&&(r.unstable_strictMode===!0&&(o=!0),r.identifierPrefix!==void 0&&(n=r.identifierPrefix),r.onRecoverableError!==void 0&&(s=r.onRecoverableError)),t=Hw(t,null,e,1,r??null,o,!1,n,s),e[wa]=t.current,bl(e),a)for(e=0;e<a.length;e++)r=a[e],o=r._getVersion,o=o(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,o]:t.mutableSourceEagerHydrationData.push(r,o);return new ud(t)};tr.render=function(e,t,r){if(!cd(t))throw Error(N(200));return dd(null,e,t,!1,r)};tr.unmountComponentAtNode=function(e){if(!cd(e))throw Error(N(40));return e._reactRootContainer?(rn(function(){dd(null,null,e,!1,function(){e._reactRootContainer=null,e[wa]=null})}),!0):!1};tr.unstable_batchedUpdates=Zm;tr.unstable_renderSubtreeIntoContainer=function(e,t,r,a){if(!cd(r))throw Error(N(200));if(e==null||e._reactInternals===void 0)throw Error(N(38));return dd(e,t,r,!1,a)};tr.version="18.3.1-next-f1338f8080-20240426"});var fd=pa((KN,Kw)=>{"use strict";function Gw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Gw)}catch(e){console.error(e)}}Gw(),Kw.exports=Ww()});var Jw=pa(ig=>{"use strict";var Xw=fd();ig.createRoot=Xw.createRoot,ig.hydrateRoot=Xw.hydrateRoot;var XN});var fC=pa(Md=>{"use strict";var NR=Q(),MR=Symbol.for("react.element"),OR=Symbol.for("react.fragment"),BR=Object.prototype.hasOwnProperty,FR=NR.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,UR={key:!0,ref:!0,__self:!0,__source:!0};function dC(e,t,r){var a,o={},n=null,s=null;r!==void 0&&(n=""+r),t.key!==void 0&&(n=""+t.key),t.ref!==void 0&&(s=t.ref);for(a in t)BR.call(t,a)&&!UR.hasOwnProperty(a)&&(o[a]=t[a]);if(e&&e.defaultProps)for(a in t=e.defaultProps,t)o[a]===void 0&&(o[a]=t[a]);return{$$typeof:MR,type:e,key:n,ref:s,props:o,_owner:FR.current}}Md.Fragment=OR;Md.jsx=dC;Md.jsxs=dC});var ce=pa((M2,pC)=>{"use strict";pC.exports=fC()});var BN={};sP(BN,{initKiteChat:()=>Lp});var qr=B(Q(),1),Nk=B(Jw(),1);var O=B(Q(),1),Ek=B(fd(),1);function nn(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(r[a[o]]=e[a[o]]);return r}function Qw(e,t,r,a){function o(n){return n instanceof r?n:new r(function(s){s(n)})}return new(r||(r=Promise))(function(n,s){function i(c){try{u(a.next(c))}catch(d){s(d)}}function l(c){try{u(a.throw(c))}catch(d){s(d)}}function u(c){c.done?n(c.value):o(c.value).then(i,l)}u((a=a.apply(e,t||[])).next())})}var Yw=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);var Cs=class extends Error{constructor(t,r="FunctionsError",a){super(t),this.name=r,this.context=a}},Ol=class extends Cs{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}},bs=class extends Cs{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}},Ls=class extends Cs{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}},Bl;(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"})(Bl||(Bl={}));var Fl=class{constructor(t,{headers:r={},customFetch:a,region:o=Bl.Any}={}){this.url=t,this.headers=r,this.region=o,this.fetch=Yw(a)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return Qw(this,arguments,void 0,function*(r,a={}){var o;let n,s;try{let{headers:i,method:l,body:u,signal:c,timeout:d}=a,f={},{region:h}=a;h||(h=this.region);let x=new URL(`${this.url}/${r}`);h&&h!=="any"&&(f["x-region"]=h,x.searchParams.set("forceFunctionRegion",h));let w;u&&(i&&!Object.prototype.hasOwnProperty.call(i,"Content-Type")||!i)?typeof Blob<"u"&&u instanceof Blob||u instanceof ArrayBuffer?(f["Content-Type"]="application/octet-stream",w=u):typeof u=="string"?(f["Content-Type"]="text/plain",w=u):typeof FormData<"u"&&u instanceof FormData?w=u:(f["Content-Type"]="application/json",w=JSON.stringify(u)):u&&typeof u!="string"&&!(typeof Blob<"u"&&u instanceof Blob)&&!(u instanceof ArrayBuffer)&&!(typeof FormData<"u"&&u instanceof FormData)?w=JSON.stringify(u):w=u;let C=c;d&&(s=new AbortController,n=setTimeout(()=>s.abort(),d),c?(C=s.signal,c.addEventListener("abort",()=>s.abort())):C=s.signal);let m=yield this.fetch(x.toString(),{method:l||"POST",headers:Object.assign(Object.assign(Object.assign({},f),this.headers),i),body:w,signal:C}).catch(k=>{throw new Ol(k)}),g=m.headers.get("x-relay-error");if(g&&g==="true")throw new bs(m);if(!m.ok)throw new Ls(m);let y=((o=m.headers.get("Content-Type"))!==null&&o!==void 0?o:"text/plain").split(";")[0].trim(),b;return y==="application/json"?b=yield m.json():y==="application/octet-stream"||y==="application/pdf"?b=yield m.blob():y==="text/event-stream"?b=m:y==="multipart/form-data"?b=yield m.formData():b=yield m.text(),{data:b,error:null,response:m}}catch(i){return{data:null,error:i,response:i instanceof Ls||i instanceof bs?i.context:void 0}}finally{n&&clearTimeout(n)}})}};var eS=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}},I_=class{constructor(e){var t,r;this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(t=e.shouldThrowOnError)!==null&&t!==void 0?t:!1,this.signal=e.signal,this.isMaybeSingle=(r=e.isMaybeSingle)!==null&&r!==void 0?r:!1,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}then(e,t){var r=this;this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");let a=this.fetch,o=a(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async n=>{let s=null,i=null,l=null,u=n.status,c=n.statusText;if(n.ok){var d,f;if(r.method!=="HEAD"){var h;let m=await n.text();m===""||(r.headers.get("Accept")==="text/csv"||r.headers.get("Accept")&&(!((h=r.headers.get("Accept"))===null||h===void 0)&&h.includes("application/vnd.pgrst.plan+text"))?i=m:i=JSON.parse(m))}let w=(d=r.headers.get("Prefer"))===null||d===void 0?void 0:d.match(/count=(exact|planned|estimated)/),C=(f=n.headers.get("content-range"))===null||f===void 0?void 0:f.split("/");w&&C&&C.length>1&&(l=parseInt(C[1])),r.isMaybeSingle&&r.method==="GET"&&Array.isArray(i)&&(i.length>1?(s={code:"PGRST116",details:`Results contain ${i.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},i=null,l=null,u=406,c="Not Acceptable"):i.length===1?i=i[0]:i=null)}else{var x;let w=await n.text();try{s=JSON.parse(w),Array.isArray(s)&&n.status===404&&(i=[],s=null,u=200,c="OK")}catch{n.status===404&&w===""?(u=204,c="No Content"):s={message:w}}if(s&&r.isMaybeSingle&&(!(s==null||(x=s.details)===null||x===void 0)&&x.includes("0 rows"))&&(s=null,u=200,c="OK"),s&&r.shouldThrowOnError)throw new eS(s)}return{error:s,data:i,count:l,status:u,statusText:c}});return this.shouldThrowOnError||(o=o.catch(n=>{var s;let i="",l=n?.cause;if(l){var u,c,d,f;let x=(u=l?.message)!==null&&u!==void 0?u:"",w=(c=l?.code)!==null&&c!==void 0?c:"";i=`${(d=n?.name)!==null&&d!==void 0?d:"FetchError"}: ${n?.message}`,i+=`
9
+
10
+ Caused by: ${(f=l?.name)!==null&&f!==void 0?f:"Error"}: ${x}`,w&&(i+=` (${w})`),l?.stack&&(i+=`
11
+ ${l.stack}`)}else{var h;i=(h=n?.stack)!==null&&h!==void 0?h:""}return{error:{message:`${(s=n?.name)!==null&&s!==void 0?s:"FetchError"}: ${n?.message}`,details:i,hint:"",code:""},data:null,count:null,status:0,statusText:""}})),o.then(e,t)}returns(){return this}overrideTypes(){return this}},k_=class extends I_{select(e){let t=!1,r=(e??"*").split("").map(a=>/\s/.test(a)&&!t?"":(a==='"'&&(t=!t),a)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:r,foreignTable:a,referencedTable:o=a}={}){let n=o?`${o}.order`:"order",s=this.url.searchParams.get(n);return this.url.searchParams.set(n,`${s?`${s},`:""}${e}.${t?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:r=t}={}){let a=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(a,`${e}`),this}range(e,t,{foreignTable:r,referencedTable:a=r}={}){let o=typeof a>"u"?"offset":`${a}.offset`,n=typeof a>"u"?"limit":`${a}.limit`;return this.url.searchParams.set(o,`${e}`),this.url.searchParams.set(n,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:e=!1,verbose:t=!1,settings:r=!1,buffers:a=!1,wal:o=!1,format:n="text"}={}){var s;let i=[e?"analyze":null,t?"verbose":null,r?"settings":null,a?"buffers":null,o?"wal":null].filter(Boolean).join("|"),l=(s=this.headers.get("Accept"))!==null&&s!==void 0?s:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${n}; for="${l}"; options=${i};`),n==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}},Zw=new RegExp("[,()]"),Is=class extends k_{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){let r=Array.from(new Set(t)).map(a=>typeof a=="string"&&Zw.test(a)?`"${a}"`:`${a}`).join(",");return this.url.searchParams.append(e,`in.(${r})`),this}notIn(e,t){let r=Array.from(new Set(t)).map(a=>typeof a=="string"&&Zw.test(a)?`"${a}"`:`${a}`).join(",");return this.url.searchParams.append(e,`not.in.(${r})`),this}contains(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t=="string"?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:r,type:a}={}){let o="";a==="plain"?o="pl":a==="phrase"?o="ph":a==="websearch"&&(o="w");let n=r===void 0?"":`(${r})`;return this.url.searchParams.append(e,`${o}fts${n}.${t}`),this}match(e){return Object.entries(e).forEach(([t,r])=>{this.url.searchParams.append(t,`eq.${r}`)}),this}not(e,t,r){return this.url.searchParams.append(e,`not.${t}.${r}`),this}or(e,{foreignTable:t,referencedTable:r=t}={}){let a=r?`${r}.or`:"or";return this.url.searchParams.append(a,`(${e})`),this}filter(e,t,r){return this.url.searchParams.append(e,`${t}.${r}`),this}},P_=class{constructor(e,{headers:t={},schema:r,fetch:a}){this.url=e,this.headers=new Headers(t),this.schema=r,this.fetch=a}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){let{head:r=!1,count:a}=t??{},o=r?"HEAD":"GET",n=!1,s=(e??"*").split("").map(u=>/\s/.test(u)&&!n?"":(u==='"'&&(n=!n),u)).join(""),{url:i,headers:l}=this.cloneRequestState();return i.searchParams.set("select",s),a&&l.append("Prefer",`count=${a}`),new Is({method:o,url:i,headers:l,schema:this.schema,fetch:this.fetch})}insert(e,{count:t,defaultToNull:r=!0}={}){var a;let o="POST",{url:n,headers:s}=this.cloneRequestState();if(t&&s.append("Prefer",`count=${t}`),r||s.append("Prefer","missing=default"),Array.isArray(e)){let i=e.reduce((l,u)=>l.concat(Object.keys(u)),[]);if(i.length>0){let l=[...new Set(i)].map(u=>`"${u}"`);n.searchParams.set("columns",l.join(","))}}return new Is({method:o,url:n,headers:s,schema:this.schema,body:e,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch})}upsert(e,{onConflict:t,ignoreDuplicates:r=!1,count:a,defaultToNull:o=!0}={}){var n;let s="POST",{url:i,headers:l}=this.cloneRequestState();if(l.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),t!==void 0&&i.searchParams.set("on_conflict",t),a&&l.append("Prefer",`count=${a}`),o||l.append("Prefer","missing=default"),Array.isArray(e)){let u=e.reduce((c,d)=>c.concat(Object.keys(d)),[]);if(u.length>0){let c=[...new Set(u)].map(d=>`"${d}"`);i.searchParams.set("columns",c.join(","))}}return new Is({method:s,url:i,headers:l,schema:this.schema,body:e,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch})}update(e,{count:t}={}){var r;let a="PATCH",{url:o,headers:n}=this.cloneRequestState();return t&&n.append("Prefer",`count=${t}`),new Is({method:a,url:o,headers:n,schema:this.schema,body:e,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch})}delete({count:e}={}){var t;let r="DELETE",{url:a,headers:o}=this.cloneRequestState();return e&&o.append("Prefer",`count=${e}`),new Is({method:r,url:a,headers:o,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch})}},tS=class rS{constructor(t,{headers:r={},schema:a,fetch:o}={}){this.url=t,this.headers=new Headers(r),this.schemaName=a,this.fetch=o}from(t){if(!t||typeof t!="string"||t.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new P_(new URL(`${this.url}/${t}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(t){return new rS(this.url,{headers:this.headers,schema:t,fetch:this.fetch})}rpc(t,r={},{head:a=!1,get:o=!1,count:n}={}){var s;let i,l=new URL(`${this.url}/rpc/${t}`),u,c=h=>h!==null&&typeof h=="object"&&(!Array.isArray(h)||h.some(c)),d=a&&Object.values(r).some(c);d?(i="POST",u=r):a||o?(i=a?"HEAD":"GET",Object.entries(r).filter(([h,x])=>x!==void 0).map(([h,x])=>[h,Array.isArray(x)?`{${x.join(",")}}`:`${x}`]).forEach(([h,x])=>{l.searchParams.append(h,x)})):(i="POST",u=r);let f=new Headers(this.headers);return d?f.set("Prefer",n?`count=${n},return=minimal`:"return=minimal"):n&&f.set("Prefer",`count=${n}`),new Is({method:i,url:l,headers:f,schema:this.schemaName,body:u,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch})}};var lg=class{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."};let r=globalThis.process;if(r){let a=r.versions;if(a&&a.node){let o=a.node,n=parseInt(o.replace(/^v/,"").split(".")[0]);return n>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${n} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${n} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
12
+ import ws from "ws"
13
+ 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(){let t=this.detectEnvironment();if(t.constructor)return t.constructor;let r=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(r+=`
14
+
15
+ Suggested solution: ${t.workaround}`),new Error(r)}static createWebSocket(t,r){let a=this.getWebSocketConstructor();return new a(t,r)}static isWebSocketSupported(){try{let t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}},ug=lg;var aS="2.90.1";var oS=`realtime-js/${aS}`,cg="1.0.0",nS="2.0.0",dg=cg;var Ul=1e4,sS=1e3,iS=100,La;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(La||(La={}));var Qe;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(Qe||(Qe={}));var rr;(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"})(rr||(rr={}));var pd;(function(e){e.websocket="websocket"})(pd||(pd={}));var po;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(po||(po={}));var Vl=class{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 a=[t.join_ref,t.ref,t.topic,t.event,t.payload];return r(JSON.stringify(a))}_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,a;let o=(a=(r=t.payload)===null||r===void 0?void 0:r.payload)!==null&&a!==void 0?a:new ArrayBuffer(0);return this._encodeUserBroadcastPush(t,this.BINARY_ENCODING,o)}_encodeJsonUserBroadcastPush(t){var r,a;let o=(a=(r=t.payload)===null||r===void 0?void 0:r.payload)!==null&&a!==void 0?a:{},s=new TextEncoder().encode(JSON.stringify(o)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,s)}_encodeUserBroadcastPush(t,r,a){var o,n;let s=t.topic,i=(o=t.ref)!==null&&o!==void 0?o:"",l=(n=t.join_ref)!==null&&n!==void 0?n:"",u=t.payload.event,c=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},d=Object.keys(c).length===0?"":JSON.stringify(c);if(l.length>255)throw new Error(`joinRef length ${l.length} exceeds maximum of 255`);if(i.length>255)throw new Error(`ref length ${i.length} exceeds maximum of 255`);if(s.length>255)throw new Error(`topic length ${s.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`userEvent length ${u.length} exceeds maximum of 255`);if(d.length>255)throw new Error(`metadata length ${d.length} exceeds maximum of 255`);let f=this.USER_BROADCAST_PUSH_META_LENGTH+l.length+i.length+s.length+u.length+d.length,h=new ArrayBuffer(this.HEADER_LENGTH+f),x=new DataView(h),w=0;x.setUint8(w++,this.KINDS.userBroadcastPush),x.setUint8(w++,l.length),x.setUint8(w++,i.length),x.setUint8(w++,s.length),x.setUint8(w++,u.length),x.setUint8(w++,d.length),x.setUint8(w++,r),Array.from(l,m=>x.setUint8(w++,m.charCodeAt(0))),Array.from(i,m=>x.setUint8(w++,m.charCodeAt(0))),Array.from(s,m=>x.setUint8(w++,m.charCodeAt(0))),Array.from(u,m=>x.setUint8(w++,m.charCodeAt(0))),Array.from(d,m=>x.setUint8(w++,m.charCodeAt(0)));var C=new Uint8Array(h.byteLength+a.byteLength);return C.set(new Uint8Array(h),0),C.set(new Uint8Array(a),h.byteLength),C.buffer}decode(t,r){if(this._isArrayBuffer(t)){let a=this._binaryDecode(t);return r(a)}if(typeof t=="string"){let a=JSON.parse(t),[o,n,s,i,l]=a;return r({join_ref:o,ref:n,topic:s,event:i,payload:l})}return r({})}_binaryDecode(t){let r=new DataView(t),a=r.getUint8(0),o=new TextDecoder;if(a===this.KINDS.userBroadcast)return this._decodeUserBroadcast(t,r,o)}_decodeUserBroadcast(t,r,a){let o=r.getUint8(1),n=r.getUint8(2),s=r.getUint8(3),i=r.getUint8(4),l=this.HEADER_LENGTH+4,u=a.decode(t.slice(l,l+o));l=l+o;let c=a.decode(t.slice(l,l+n));l=l+n;let d=a.decode(t.slice(l,l+s));l=l+s;let f=t.slice(l,t.byteLength),h=i===this.JSON_ENCODING?JSON.parse(a.decode(f)):f,x={type:this.BROADCAST_EVENT,event:c,payload:h};return s>0&&(x.meta=JSON.parse(d)),{join_ref:null,ref:null,topic:u,event:this.BROADCAST_EVENT,payload:x}}_isArrayBuffer(t){var r;return t instanceof ArrayBuffer||((r=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(([a])=>r.includes(a)))}};var sn=class{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 Le;(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"})(Le||(Le={}));var pg=(e,t,r={})=>{var a;let o=(a=r.skipTypes)!==null&&a!==void 0?a:[];return t?Object.keys(t).reduce((n,s)=>(n[s]=T_(s,e,t,o),n),{}):{}},T_=(e,t,r,a)=>{let o=t.find(i=>i.name===e),n=o?.type,s=r[e];return n&&!a.includes(n)?lS(n,s):fg(s)},lS=(e,t)=>{if(e.charAt(0)==="_"){let r=e.slice(1,e.length);return E_(t,r)}switch(e){case Le.bool:return __(t);case Le.float4:case Le.float8:case Le.int2:case Le.int4:case Le.int8:case Le.numeric:case Le.oid:return A_(t);case Le.json:case Le.jsonb:return R_(t);case Le.timestamp:return D_(t);case Le.abstime:case Le.date:case Le.daterange:case Le.int4range:case Le.int8range:case Le.money:case Le.reltime:case Le.text:case Le.time:case Le.timestamptz:case Le.timetz:case Le.tsrange:case Le.tstzrange:return fg(t);default:return fg(t)}},fg=e=>e,__=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},A_=e=>{if(typeof e=="string"){let t=parseFloat(e);if(!Number.isNaN(t))return t}return e},R_=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},E_=(e,t)=>{if(typeof e!="string")return e;let r=e.length-1,a=e[r];if(e[0]==="{"&&a==="}"){let n,s=e.slice(1,r);try{n=JSON.parse("["+s+"]")}catch{n=s?s.split(","):[]}return n.map(i=>lS(t,i))}return e},D_=e=>typeof e=="string"?e.replace(" ","T"):e,hd=e=>{let t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),t.pathname===""||t.pathname==="/"?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};var ln=class{constructor(t,r,a={},o=Ul){this.channel=t,this.event=r,this.payload=a,this.timeout=o,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 a;return this._hasReceived(t)&&r((a=this.receivedResp)===null||a===void 0?void 0:a.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);let 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(a=>a.status===t).forEach(a=>a.callback(r))}_hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}};var hg;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(hg||(hg={}));var ks=class e{constructor(t,r){this.channel=t,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};let a=r?.events||{state:"presence_state",diff:"presence_diff"};this.channel._on(a.state,{},o=>{let{onJoin:n,onLeave:s,onSync:i}=this.caller;this.joinRef=this.channel._joinRef(),this.state=e.syncState(this.state,o,n,s),this.pendingDiffs.forEach(l=>{this.state=e.syncDiff(this.state,l,n,s)}),this.pendingDiffs=[],i()}),this.channel._on(a.diff,{},o=>{let{onJoin:n,onLeave:s,onSync:i}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(o):(this.state=e.syncDiff(this.state,o,n,s),i())}),this.onJoin((o,n,s)=>{this.channel._trigger("presence",{event:"join",key:o,currentPresences:n,newPresences:s})}),this.onLeave((o,n,s)=>{this.channel._trigger("presence",{event:"leave",key:o,currentPresences:n,leftPresences:s})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(t,r,a,o){let n=this.cloneDeep(t),s=this.transformState(r),i={},l={};return this.map(n,(u,c)=>{s[u]||(l[u]=c)}),this.map(s,(u,c)=>{let d=n[u];if(d){let f=c.map(C=>C.presence_ref),h=d.map(C=>C.presence_ref),x=c.filter(C=>h.indexOf(C.presence_ref)<0),w=d.filter(C=>f.indexOf(C.presence_ref)<0);x.length>0&&(i[u]=x),w.length>0&&(l[u]=w)}else i[u]=c}),this.syncDiff(n,{joins:i,leaves:l},a,o)}static syncDiff(t,r,a,o){let{joins:n,leaves:s}={joins:this.transformState(r.joins),leaves:this.transformState(r.leaves)};return a||(a=()=>{}),o||(o=()=>{}),this.map(n,(i,l)=>{var u;let c=(u=t[i])!==null&&u!==void 0?u:[];if(t[i]=this.cloneDeep(l),c.length>0){let d=t[i].map(h=>h.presence_ref),f=c.filter(h=>d.indexOf(h.presence_ref)<0);t[i].unshift(...f)}a(i,c,l)}),this.map(s,(i,l)=>{let u=t[i];if(!u)return;let c=l.map(d=>d.presence_ref);u=u.filter(d=>c.indexOf(d.presence_ref)<0),t[i]=u,o(i,u,l),u.length===0&&delete t[i]}),t}static map(t,r){return Object.getOwnPropertyNames(t).map(a=>r(a,t[a]))}static transformState(t){return t=this.cloneDeep(t),Object.getOwnPropertyNames(t).reduce((r,a)=>{let o=t[a];return"metas"in o?r[a]=o.metas.map(n=>(n.presence_ref=n.phx_ref,delete n.phx_ref,delete n.phx_ref_prev,n)):r[a]=o,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 mg;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(mg||(mg={}));var Ps;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(Ps||(Ps={}));var Xr;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(Xr||(Xr={}));var Ts=class e{constructor(t,r={config:{}},a){var o,n;if(this.topic=t,this.params=r,this.socket=a,this.bindings={},this.state=Qe.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 ln(this,rr.join,this.params,this.timeout),this.rejoinTimer=new sn(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=Qe.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(s=>s.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=Qe.closed,this.socket._remove(this)}),this._onError(s=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,s),this.state=Qe.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=Qe.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",s=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,s),this.state=Qe.errored,this.rejoinTimer.scheduleTimeout())}),this._on(rr.reply,{},(s,i)=>{this._trigger(this._replyEventName(i),s)}),this.presence=new ks(this),this.broadcastEndpointURL=hd(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(!((n=(o=this.params.config)===null||o===void 0?void 0:o.broadcast)===null||n===void 0)&&n.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(t,r=this.timeout){var a,o,n;if(this.socket.isConnected()||this.socket.connect(),this.state==Qe.closed){let{config:{broadcast:s,presence:i,private:l}}=this.params,u=(o=(a=this.bindings.postgres_changes)===null||a===void 0?void 0:a.map(h=>h.filter))!==null&&o!==void 0?o:[],c=!!this.bindings[Ps.PRESENCE]&&this.bindings[Ps.PRESENCE].length>0||((n=this.params.config.presence)===null||n===void 0?void 0:n.enabled)===!0,d={},f={broadcast:s,presence:Object.assign(Object.assign({},i),{enabled:c}),postgres_changes:u,private:l};this.socket.accessTokenValue&&(d.access_token=this.socket.accessTokenValue),this._onError(h=>t?.(Xr.CHANNEL_ERROR,h)),this._onClose(()=>t?.(Xr.CLOSED)),this.updateJoinPayload(Object.assign({config:f},d)),this.joinedOnce=!0,this._rejoin(r),this.joinPush.receive("ok",async({postgres_changes:h})=>{var x;if(this.socket._isManualToken()||this.socket.setAuth(),h===void 0){t?.(Xr.SUBSCRIBED);return}else{let w=this.bindings.postgres_changes,C=(x=w?.length)!==null&&x!==void 0?x:0,m=[];for(let g=0;g<C;g++){let y=w[g],{filter:{event:b,schema:k,table:I,filter:A}}=y,R=h&&h[g];if(R&&R.event===b&&e.isFilterValueEqual(R.schema,k)&&e.isFilterValueEqual(R.table,I)&&e.isFilterValueEqual(R.filter,A))m.push(Object.assign(Object.assign({},y),{id:R.id}));else{this.unsubscribe(),this.state=Qe.errored,t?.(Xr.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=m,t&&t(Xr.SUBSCRIBED);return}}).receive("error",h=>{this.state=Qe.errored,t?.(Xr.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(h).join(", ")||"error")))}).receive("timeout",()=>{t?.(Xr.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,a){return this.state===Qe.joined&&t===Ps.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,a)}async httpSend(t,r,a={}){var o;if(r==null)return Promise.reject("Payload is required for httpSend()");let n={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(n.Authorization=`Bearer ${this.socket.accessTokenValue}`);let s={method:"POST",headers:n,body:JSON.stringify({messages:[{topic:this.subTopic,event:t,payload:r,private:this.private}]})},i=await this._fetchWithTimeout(this.broadcastEndpointURL,s,(o=a.timeout)!==null&&o!==void 0?o:this.timeout);if(i.status===202)return{success:!0};let l=i.statusText;try{let u=await i.json();l=u.error||u.message||l}catch{}return Promise.reject(new Error(l))}async send(t,r={}){var a,o;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.");let{event:n,payload:s}=t,i={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(i.Authorization=`Bearer ${this.socket.accessTokenValue}`);let l={method:"POST",headers:i,body:JSON.stringify({messages:[{topic:this.subTopic,event:n,payload:s,private:this.private}]})};try{let u=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(a=r.timeout)!==null&&a!==void 0?a:this.timeout);return await((o=u.body)===null||o===void 0?void 0:o.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(n=>{var s,i,l;let u=this._push(t.type,t,r.timeout||this.timeout);t.type==="broadcast"&&!(!((l=(i=(s=this.params)===null||s===void 0?void 0:s.config)===null||i===void 0?void 0:i.broadcast)===null||l===void 0)&&l.ack)&&n("ok"),u.receive("ok",()=>n("ok")),u.receive("error",()=>n("error")),u.receive("timeout",()=>n("timed out"))})}updateJoinPayload(t){this.joinPush.updatePayload(t)}unsubscribe(t=this.timeout){this.state=Qe.leaving;let r=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(rr.close,"leave",this._joinRef())};this.joinPush.destroy();let a=null;return new Promise(o=>{a=new ln(this,rr.leave,{},t),a.receive("ok",()=>{r(),o("ok")}).receive("timeout",()=>{r(),o("timed out")}).receive("error",()=>{o("error")}),a.send(),this._canPush()||a.trigger("ok",{})}).finally(()=>{a?.destroy()})}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Qe.closed,this.bindings={}}async _fetchWithTimeout(t,r,a){let o=new AbortController,n=setTimeout(()=>o.abort(),a),s=await this.socket.fetch(t,Object.assign(Object.assign({},r),{signal:o.signal}));return clearTimeout(n),s}_push(t,r,a=this.timeout){if(!this.joinedOnce)throw`tried to push '${t}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let o=new ln(this,t,r,a);return this._canPush()?o.send():this._addToPushBuffer(o),o}_addToPushBuffer(t){if(t.startTimeout(),this.pushBuffer.push(t),this.pushBuffer.length>iS){let r=this.pushBuffer.shift();r&&(r.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${r.event}`,r.payload))}}_onMessage(t,r,a){return r}_isMember(t){return this.topic===t}_joinRef(){return this.joinPush.ref}_trigger(t,r,a){var o,n;let s=t.toLocaleLowerCase(),{close:i,error:l,leave:u,join:c}=rr;if(a&&[i,l,u,c].indexOf(s)>=0&&a!==this._joinRef())return;let f=this._onMessage(s,r,a);if(r&&!f)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(s)?(o=this.bindings.postgres_changes)===null||o===void 0||o.filter(h=>{var x,w,C;return((x=h.filter)===null||x===void 0?void 0:x.event)==="*"||((C=(w=h.filter)===null||w===void 0?void 0:w.event)===null||C===void 0?void 0:C.toLocaleLowerCase())===s}).map(h=>h.callback(f,a)):(n=this.bindings[s])===null||n===void 0||n.filter(h=>{var x,w,C,m,g,y,b,k;if(["broadcast","presence","postgres_changes"].includes(s))if("id"in h){let I=h.id,A=(x=h.filter)===null||x===void 0?void 0:x.event;return I&&((w=r.ids)===null||w===void 0?void 0:w.includes(I))&&(A==="*"||A?.toLocaleLowerCase()===((C=r.data)===null||C===void 0?void 0:C.type.toLocaleLowerCase()))&&(!(!((m=h.filter)===null||m===void 0)&&m.table)||h.filter.table===((g=r.data)===null||g===void 0?void 0:g.table))}else{let I=(b=(y=h?.filter)===null||y===void 0?void 0:y.event)===null||b===void 0?void 0:b.toLocaleLowerCase();return I==="*"||I===((k=r?.event)===null||k===void 0?void 0:k.toLocaleLowerCase())}else return h.type.toLocaleLowerCase()===s}).map(h=>{if(typeof f=="object"&&"ids"in f){let x=f.data,{schema:w,table:C,commit_timestamp:m,type:g,errors:y}=x;f=Object.assign(Object.assign({},{schema:w,table:C,commit_timestamp:m,eventType:g,new:{},old:{},errors:y}),this._getPayloadRecords(x))}h.callback(f,a)})}_isClosed(){return this.state===Qe.closed}_isJoined(){return this.state===Qe.joined}_isJoining(){return this.state===Qe.joining}_isLeaving(){return this.state===Qe.leaving}_replyEventName(t){return`chan_reply_${t}`}_on(t,r,a){let o=t.toLocaleLowerCase(),n={type:o,filter:r,callback:a};return this.bindings[o]?this.bindings[o].push(n):this.bindings[o]=[n],this}_off(t,r){let a=t.toLocaleLowerCase();return this.bindings[a]&&(this.bindings[a]=this.bindings[a].filter(o=>{var n;return!(((n=o.type)===null||n===void 0?void 0:n.toLocaleLowerCase())===a&&e.isEqual(o.filter,r))})),this}static isEqual(t,r){if(Object.keys(t).length!==Object.keys(r).length)return!1;for(let a in t)if(t[a]!==r[a])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(rr.close,{},t)}_onError(t){this._on(rr.error,{},r=>t(r))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=Qe.joining,this.joinPush.resend(t))}_getPayloadRecords(t){let r={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(r.new=pg(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(r.old=pg(t.columns,t.old_record)),r}};var gg=()=>{},md={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},M_=[1e3,2e3,5e3,1e4],O_=1e4,B_=`
9
16
  addEventListener("message", (e) => {
10
17
  if (e.data.event === "start") {
11
18
  setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
12
19
  }
13
- });`,ws=class{constructor(t,a){var r;this.accessTokenValue=null,this.apiKey=null,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=Lc,this.heartbeatIntervalMs=25e3,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=IC,this.ref=0,this.logger=IC,this.conn=null,this.sendBuffer=[],this.serializer=new jl,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._resolveFetch=n=>{let s;return n?s=n:typeof fetch>"u"?s=(...i)=>Promise.resolve().then(()=>(oo(),Xo)).then(({default:l})=>l(...i)):s=fetch,(...i)=>s(...i)},this.endPoint=`${t}/${Sc.websocket}`,this.httpEndpoint=bc(t),a?.transport?this.transport=a.transport:this.transport=null,a?.params&&(this.params=a.params),a?.timeout&&(this.timeout=a.timeout),a?.logger&&(this.logger=a.logger),(a?.logLevel||a?.log_level)&&(this.logLevel=a.logLevel||a.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),a?.heartbeatIntervalMs&&(this.heartbeatIntervalMs=a.heartbeatIntervalMs);let o=(r=a?.params)===null||r===void 0?void 0:r.apikey;if(o&&(this.accessTokenValue=o,this.apiKey=o),this.reconnectAfterMs=a?.reconnectAfterMs?a.reconnectAfterMs:n=>[1e3,2e3,5e3,1e4][n-1]||1e4,this.encode=a?.encode?a.encode:(n,s)=>s(JSON.stringify(n)),this.decode=a?.decode?a.decode:this.serializer.decode.bind(this.serializer),this.reconnectTimer=new Qo(async()=>{this.disconnect(),this.connect()},this.reconnectAfterMs),this.fetch=this._resolveFetch(a?.fetch),a?.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.worker=a?.worker||!1,this.workerUrl=a?.workerUrl}this.accessToken=a?.accessToken||null}connect(){if(!this.conn){if(this.transport||(this.transport=vC),!this.transport)throw new Error("No transport provided");this.conn=new this.transport(this.endpointURL()),this.setupConnection()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:SC}))}disconnect(t,a){this.conn&&(this.conn.onclose=function(){},t?this.conn.close(t,a??""):this.conn.close(),this.conn=null,this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.reset(),this.channels.forEach(r=>r.teardown()))}getChannels(){return this.channels}async removeChannel(t){let a=await t.unsubscribe();return this.channels.length===0&&this.disconnect(),a}async removeAllChannels(){let t=await Promise.all(this.channels.map(a=>a.unsubscribe()));return this.channels=[],this.disconnect(),t}log(t,a,r){this.logger(t,a,r)}connectionState(){switch(this.conn&&this.conn.readyState){case ys.connecting:return no.Connecting;case ys.open:return no.Open;case ys.closing:return no.Closing;default:return no.Closed}}isConnected(){return this.connectionState()===no.Open}channel(t,a={config:{}}){let r=`realtime:${t}`,o=this.getChannels().find(n=>n.topic===r);if(o)return o;{let n=new vs(`realtime:${t}`,a,this);return this.channels.push(n),n}}push(t){let{topic:a,event:r,payload:o,ref:n}=t,s=()=>{this.encode(t,i=>{var l;(l=this.conn)===null||l===void 0||l.send(i)})};this.log("push",`${a} ${r} (${n})`,o),this.isConnected()?s():this.sendBuffer.push(s)}async setAuth(t=null){let a=t||this.accessToken&&await this.accessToken()||this.accessTokenValue;this.accessTokenValue!=a&&(this.accessTokenValue=a,this.channels.forEach(r=>{let o={access_token:a,version:CC};a&&r.updateJoinPayload(o),r.joinedOnce&&r._isJoined()&&r._push(Zt.access_token,{access_token:a})}))}async sendHeartbeat(){var t;if(!this.isConnected()){this.heartbeatCallback("disconnected");return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection"),this.heartbeatCallback("timeout"),(t=this.conn)===null||t===void 0||t.close(LC,"hearbeat timeout");return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.heartbeatCallback("sent"),await this.setAuth()}onHeartbeat(t){this.heartbeatCallback=t}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}_makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}_leaveOpenTopic(t){let a=this.channels.find(r=>r.topic===t&&(r._isJoined()||r._isJoining()));a&&(this.log("transport",`leaving duplicate topic "${t}"`),a.unsubscribe())}_remove(t){this.channels=this.channels.filter(a=>a.topic!==t.topic)}setupConnection(){this.conn&&(this.conn.binaryType="arraybuffer",this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=t=>this._onConnError(t),this.conn.onmessage=t=>this._onConnMessage(t),this.conn.onclose=t=>this._onConnClose(t))}_onConnMessage(t){this.decode(t.data,a=>{let{topic:r,event:o,payload:n,ref:s}=a;r==="phoenix"&&o==="phx_reply"&&this.heartbeatCallback(a.payload.status=="ok"?"ok":"error"),s&&s===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null),this.log("receive",`${n.status||""} ${r} ${o} ${s&&"("+s+")"||""}`,n),Array.from(this.channels).filter(i=>i._isMember(r)).forEach(i=>i._trigger(o,n,s)),this.stateChangeCallbacks.message.forEach(i=>i(a))})}_onConnOpen(){this.log("transport",`connected to ${this.endpointURL()}`),this.flushSendBuffer(),this.reconnectTimer.reset(),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this.stateChangeCallbacks.open.forEach(t=>t())}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");let t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=a=>{this.log("worker","worker error",a.message),this.workerRef.terminate()},this.workerRef.onmessage=a=>{a.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_onConnClose(t){this.log("transport","close",t),this._triggerChanError(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(a=>a(t))}_onConnError(t){this.log("transport",`${t}`),this._triggerChanError(),this.stateChangeCallbacks.error.forEach(a=>a(t))}_triggerChanError(){this.channels.forEach(t=>t._trigger(Zt.error))}_appendParams(t,a){if(Object.keys(a).length===0)return t;let r=t.match(/\?/)?"&":"?",o=new URLSearchParams(a);return`${t}${r}${o}`}_workerObjectUrl(t){let a;if(t)a=t;else{let r=new Blob([sA],{type:"application/javascript"});a=URL.createObjectURL(r)}return a}};var Cs=class extends Error{constructor(t){super(t),this.__isStorageError=!0,this.name="StorageError"}};function Ge(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var Ic=class extends Cs{constructor(t,a,r){super(t),this.name="StorageApiError",this.status=a,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},Yo=class extends Cs{constructor(t,a){super(t),this.name="StorageUnknownError",this.originalError=a}};var iA=function(e,t,a,r){function o(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function i(d){try{u(r.next(d))}catch(c){s(c)}}function l(d){try{u(r.throw(d))}catch(c){s(c)}}function u(d){d.done?n(d.value):o(d.value).then(i,l)}u((r=r.apply(e,t||[])).next())})},Pc=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...a)=>Promise.resolve().then(()=>(oo(),Xo)).then(({default:r})=>r(...a)):t=fetch,(...a)=>t(...a)},kC=()=>iA(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield Promise.resolve().then(()=>(oo(),Xo))).Response:Response}),kc=e=>{if(Array.isArray(e))return e.map(a=>kc(a));if(typeof e=="function"||e!==Object(e))return e;let t={};return Object.entries(e).forEach(([a,r])=>{let o=a.replace(/([-_][a-z])/gi,n=>n.toUpperCase().replace(/[-_]/g,""));t[o]=kc(r)}),t},PC=e=>{if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)};var Zo=function(e,t,a,r){function o(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function i(d){try{u(r.next(d))}catch(c){s(c)}}function l(d){try{u(r.throw(d))}catch(c){s(c)}}function u(d){d.done?n(d.value):o(d.value).then(i,l)}u((r=r.apply(e,t||[])).next())})},Eg=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),lA=(e,t,a)=>Zo(void 0,void 0,void 0,function*(){let r=yield kC();e instanceof r&&!a?.noResolveJson?e.json().then(o=>{let n=e.status||500,s=o?.statusCode||n+"";t(new Ic(Eg(o),n,s))}).catch(o=>{t(new Yo(Eg(o),o))}):t(new Yo(Eg(e),e))}),uA=(e,t,a,r)=>{let o={method:e,headers:t?.headers||{}};return e==="GET"||!r?o:(PC(r)?(o.headers=Object.assign({"Content-Type":"application/json"},t?.headers),o.body=JSON.stringify(r)):o.body=r,Object.assign(Object.assign({},o),a))};function ql(e,t,a,r,o,n){return Zo(this,void 0,void 0,function*(){return new Promise((s,i)=>{e(a,uA(t,r,o,n)).then(l=>{if(!l.ok)throw l;return r?.noResolveJson?l:l.json()}).then(l=>s(l)).catch(l=>lA(l,i,r))})})}function Ss(e,t,a,r){return Zo(this,void 0,void 0,function*(){return ql(e,"GET",t,a,r)})}function Ta(e,t,a,r,o){return Zo(this,void 0,void 0,function*(){return ql(e,"POST",t,r,o,a)})}function Hl(e,t,a,r,o){return Zo(this,void 0,void 0,function*(){return ql(e,"PUT",t,r,o,a)})}function TC(e,t,a,r){return Zo(this,void 0,void 0,function*(){return ql(e,"HEAD",t,Object.assign(Object.assign({},a),{noResolveJson:!0}),r)})}function Tc(e,t,a,r,o){return Zo(this,void 0,void 0,function*(){return ql(e,"DELETE",t,r,o,a)})}var Ut=function(e,t,a,r){function o(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function i(d){try{u(r.next(d))}catch(c){s(c)}}function l(d){try{u(r.throw(d))}catch(c){s(c)}}function u(d){d.done?n(d.value):o(d.value).then(i,l)}u((r=r.apply(e,t||[])).next())})},dA={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},AC={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1},zl=class{constructor(t,a={},r,o){this.url=t,this.headers=a,this.bucketId=r,this.fetch=Pc(o)}uploadOrUpdate(t,a,r,o){return Ut(this,void 0,void 0,function*(){try{let n,s=Object.assign(Object.assign({},AC),o),i=Object.assign(Object.assign({},this.headers),t==="POST"&&{"x-upsert":String(s.upsert)}),l=s.metadata;typeof Blob<"u"&&r instanceof Blob?(n=new FormData,n.append("cacheControl",s.cacheControl),l&&n.append("metadata",this.encodeMetadata(l)),n.append("",r)):typeof FormData<"u"&&r instanceof FormData?(n=r,n.append("cacheControl",s.cacheControl),l&&n.append("metadata",this.encodeMetadata(l))):(n=r,i["cache-control"]=`max-age=${s.cacheControl}`,i["content-type"]=s.contentType,l&&(i["x-metadata"]=this.toBase64(this.encodeMetadata(l)))),o?.headers&&(i=Object.assign(Object.assign({},i),o.headers));let u=this._removeEmptyFolders(a),d=this._getFinalPath(u),c=yield(t=="PUT"?Hl:Ta)(this.fetch,`${this.url}/object/${d}`,n,Object.assign({headers:i},s?.duplex?{duplex:s.duplex}:{}));return{data:{path:u,id:c.Id,fullPath:c.Key},error:null}}catch(n){if(Ge(n))return{data:null,error:n};throw n}})}upload(t,a,r){return Ut(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",t,a,r)})}uploadToSignedUrl(t,a,r,o){return Ut(this,void 0,void 0,function*(){let n=this._removeEmptyFolders(t),s=this._getFinalPath(n),i=new URL(this.url+`/object/upload/sign/${s}`);i.searchParams.set("token",a);try{let l,u=Object.assign({upsert:AC.upsert},o),d=Object.assign(Object.assign({},this.headers),{"x-upsert":String(u.upsert)});typeof Blob<"u"&&r instanceof Blob?(l=new FormData,l.append("cacheControl",u.cacheControl),l.append("",r)):typeof FormData<"u"&&r instanceof FormData?(l=r,l.append("cacheControl",u.cacheControl)):(l=r,d["cache-control"]=`max-age=${u.cacheControl}`,d["content-type"]=u.contentType);let c=yield Hl(this.fetch,i.toString(),l,{headers:d});return{data:{path:n,fullPath:c.Key},error:null}}catch(l){if(Ge(l))return{data:null,error:l};throw l}})}createSignedUploadUrl(t,a){return Ut(this,void 0,void 0,function*(){try{let r=this._getFinalPath(t),o=Object.assign({},this.headers);a?.upsert&&(o["x-upsert"]="true");let n=yield Ta(this.fetch,`${this.url}/object/upload/sign/${r}`,{},{headers:o}),s=new URL(this.url+n.url),i=s.searchParams.get("token");if(!i)throw new Cs("No token returned by API");return{data:{signedUrl:s.toString(),path:t,token:i},error:null}}catch(r){if(Ge(r))return{data:null,error:r};throw r}})}update(t,a,r){return Ut(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",t,a,r)})}move(t,a,r){return Ut(this,void 0,void 0,function*(){try{return{data:yield Ta(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:t,destinationKey:a,destinationBucket:r?.destinationBucket},{headers:this.headers}),error:null}}catch(o){if(Ge(o))return{data:null,error:o};throw o}})}copy(t,a,r){return Ut(this,void 0,void 0,function*(){try{return{data:{path:(yield Ta(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:t,destinationKey:a,destinationBucket:r?.destinationBucket},{headers:this.headers})).Key},error:null}}catch(o){if(Ge(o))return{data:null,error:o};throw o}})}createSignedUrl(t,a,r){return Ut(this,void 0,void 0,function*(){try{let o=this._getFinalPath(t),n=yield Ta(this.fetch,`${this.url}/object/sign/${o}`,Object.assign({expiresIn:a},r?.transform?{transform:r.transform}:{}),{headers:this.headers}),s=r?.download?`&download=${r.download===!0?"":r.download}`:"";return n={signedUrl:encodeURI(`${this.url}${n.signedURL}${s}`)},{data:n,error:null}}catch(o){if(Ge(o))return{data:null,error:o};throw o}})}createSignedUrls(t,a,r){return Ut(this,void 0,void 0,function*(){try{let o=yield Ta(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:a,paths:t},{headers:this.headers}),n=r?.download?`&download=${r.download===!0?"":r.download}`:"";return{data:o.map(s=>Object.assign(Object.assign({},s),{signedUrl:s.signedURL?encodeURI(`${this.url}${s.signedURL}${n}`):null})),error:null}}catch(o){if(Ge(o))return{data:null,error:o};throw o}})}download(t,a){return Ut(this,void 0,void 0,function*(){let o=typeof a?.transform<"u"?"render/image/authenticated":"object",n=this.transformOptsToQueryString(a?.transform||{}),s=n?`?${n}`:"";try{let i=this._getFinalPath(t);return{data:yield(yield Ss(this.fetch,`${this.url}/${o}/${i}${s}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(i){if(Ge(i))return{data:null,error:i};throw i}})}info(t){return Ut(this,void 0,void 0,function*(){let a=this._getFinalPath(t);try{let r=yield Ss(this.fetch,`${this.url}/object/info/${a}`,{headers:this.headers});return{data:kc(r),error:null}}catch(r){if(Ge(r))return{data:null,error:r};throw r}})}exists(t){return Ut(this,void 0,void 0,function*(){let a=this._getFinalPath(t);try{return yield TC(this.fetch,`${this.url}/object/${a}`,{headers:this.headers}),{data:!0,error:null}}catch(r){if(Ge(r)&&r instanceof Yo){let o=r.originalError;if([400,404].includes(o?.status))return{data:!1,error:r}}throw r}})}getPublicUrl(t,a){let r=this._getFinalPath(t),o=[],n=a?.download?`download=${a.download===!0?"":a.download}`:"";n!==""&&o.push(n);let i=typeof a?.transform<"u"?"render/image":"object",l=this.transformOptsToQueryString(a?.transform||{});l!==""&&o.push(l);let u=o.join("&");return u!==""&&(u=`?${u}`),{data:{publicUrl:encodeURI(`${this.url}/${i}/public/${r}${u}`)}}}remove(t){return Ut(this,void 0,void 0,function*(){try{return{data:yield Tc(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:t},{headers:this.headers}),error:null}}catch(a){if(Ge(a))return{data:null,error:a};throw a}})}list(t,a,r){return Ut(this,void 0,void 0,function*(){try{let o=Object.assign(Object.assign(Object.assign({},dA),a),{prefix:t||""});return{data:yield Ta(this.fetch,`${this.url}/object/list/${this.bucketId}`,o,{headers:this.headers},r),error:null}}catch(o){if(Ge(o))return{data:null,error:o};throw o}})}encodeMetadata(t){return JSON.stringify(t)}toBase64(t){return typeof Buffer<"u"?Buffer.from(t).toString("base64"):btoa(t)}_getFinalPath(t){return`${this.bucketId}/${t.replace(/^\/+/,"")}`}_removeEmptyFolders(t){return t.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(t){let a=[];return t.width&&a.push(`width=${t.width}`),t.height&&a.push(`height=${t.height}`),t.resize&&a.push(`resize=${t.resize}`),t.format&&a.push(`format=${t.format}`),t.quality&&a.push(`quality=${t.quality}`),a.join("&")}};var RC="2.10.4";var _C={"X-Client-Info":`storage-js/${RC}`};var Ls=function(e,t,a,r){function o(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function i(d){try{u(r.next(d))}catch(c){s(c)}}function l(d){try{u(r.throw(d))}catch(c){s(c)}}function u(d){d.done?n(d.value):o(d.value).then(i,l)}u((r=r.apply(e,t||[])).next())})},$l=class{constructor(t,a={},r,o){let n=new URL(t);o?.useNewHostname&&/supabase\.(co|in|red)$/.test(n.hostname)&&!n.hostname.includes("storage.supabase.")&&(n.hostname=n.hostname.replace("supabase.","storage.supabase.")),this.url=n.href,this.headers=Object.assign(Object.assign({},_C),a),this.fetch=Pc(r)}listBuckets(){return Ls(this,void 0,void 0,function*(){try{return{data:yield Ss(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(t){if(Ge(t))return{data:null,error:t};throw t}})}getBucket(t){return Ls(this,void 0,void 0,function*(){try{return{data:yield Ss(this.fetch,`${this.url}/bucket/${t}`,{headers:this.headers}),error:null}}catch(a){if(Ge(a))return{data:null,error:a};throw a}})}createBucket(t,a={public:!1}){return Ls(this,void 0,void 0,function*(){try{return{data:yield Ta(this.fetch,`${this.url}/bucket`,{id:t,name:t,type:a.type,public:a.public,file_size_limit:a.fileSizeLimit,allowed_mime_types:a.allowedMimeTypes},{headers:this.headers}),error:null}}catch(r){if(Ge(r))return{data:null,error:r};throw r}})}updateBucket(t,a){return Ls(this,void 0,void 0,function*(){try{return{data:yield Hl(this.fetch,`${this.url}/bucket/${t}`,{id:t,name:t,public:a.public,file_size_limit:a.fileSizeLimit,allowed_mime_types:a.allowedMimeTypes},{headers:this.headers}),error:null}}catch(r){if(Ge(r))return{data:null,error:r};throw r}})}emptyBucket(t){return Ls(this,void 0,void 0,function*(){try{return{data:yield Ta(this.fetch,`${this.url}/bucket/${t}/empty`,{},{headers:this.headers}),error:null}}catch(a){if(Ge(a))return{data:null,error:a};throw a}})}deleteBucket(t){return Ls(this,void 0,void 0,function*(){try{return{data:yield Tc(this.fetch,`${this.url}/bucket/${t}`,{},{headers:this.headers}),error:null}}catch(a){if(Ge(a))return{data:null,error:a};throw a}})}};var Wl=class extends $l{constructor(t,a={},r,o){super(t,a,r,o)}from(t){return new zl(this.url,this.headers,t,this.fetch)}};var EC="2.53.0";var Gl="";typeof Deno<"u"?Gl="deno":typeof document<"u"?Gl="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Gl="react-native":Gl="node";var cA={"X-Client-Info":`supabase-js-${Gl}/${EC}`},DC={headers:cA},MC={schema:"public"},NC={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},OC={};oo();var fA=function(e,t,a,r){function o(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function i(d){try{u(r.next(d))}catch(c){s(c)}}function l(d){try{u(r.throw(d))}catch(c){s(c)}}function u(d){d.done?n(d.value):o(d.value).then(i,l)}u((r=r.apply(e,t||[])).next())})},pA=e=>{let t;return e?t=e:typeof fetch>"u"?t=mg:t=fetch,(...a)=>t(...a)},mA=()=>typeof Headers>"u"?hg:Headers,FC=(e,t,a)=>{let r=pA(a),o=mA();return(n,s)=>fA(void 0,void 0,void 0,function*(){var i;let l=(i=yield t())!==null&&i!==void 0?i:e,u=new o(s?.headers);return u.has("apikey")||u.set("apikey",e),u.has("Authorization")||u.set("Authorization",`Bearer ${l}`),r(n,Object.assign(Object.assign({},s),{headers:u}))})};var hA=function(e,t,a,r){function o(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function i(d){try{u(r.next(d))}catch(c){s(c)}}function l(d){try{u(r.throw(d))}catch(c){s(c)}}function u(d){d.done?n(d.value):o(d.value).then(i,l)}u((r=r.apply(e,t||[])).next())})};function BC(e){return e.endsWith("/")?e:e+"/"}function UC(e,t){var a,r;let{db:o,auth:n,realtime:s,global:i}=e,{db:l,auth:u,realtime:d,global:c}=t,f={db:Object.assign(Object.assign({},l),o),auth:Object.assign(Object.assign({},u),n),realtime:Object.assign(Object.assign({},d),s),storage:{},global:Object.assign(Object.assign(Object.assign({},c),i),{headers:Object.assign(Object.assign({},(a=c?.headers)!==null&&a!==void 0?a:{}),(r=i?.headers)!==null&&r!==void 0?r:{})}),accessToken:()=>hA(this,void 0,void 0,function*(){return""})};return e.accessToken?f.accessToken=e.accessToken:delete f.accessToken,f}var Ac="2.71.1";var en=30*1e3,Rc=3,_c=Rc*en,VC="http://localhost:9999",jC="supabase.auth.token";var qC={"X-Client-Info":`gotrue-js/${Ac}`};var Kl="X-Supabase-Api-Version",Dg={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},HC=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,zC=600*1e3;var Xl=class extends Error{constructor(t,a,r){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=a,this.code=r}};function Y(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}var Ec=class extends Xl{constructor(t,a,r){super(t,a,r),this.name="AuthApiError",this.status=a,this.code=r}};function $C(e){return Y(e)&&e.name==="AuthApiError"}var bs=class extends Xl{constructor(t,a){super(t),this.name="AuthUnknownError",this.originalError=a}},qa=class extends Xl{constructor(t,a,r,o){super(t,r,o),this.name=a,this.status=r}},ga=class extends qa{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}};function WC(e){return Y(e)&&e.name==="AuthSessionMissingError"}var tn=class extends qa{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}},an=class extends qa{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}},rn=class extends qa{constructor(t,a=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=a}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}};function GC(e){return Y(e)&&e.name==="AuthImplicitGrantRedirectError"}var Ql=class extends qa{constructor(t,a=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=a}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}},Is=class extends qa{constructor(t,a){super(t,"AuthRetryableFetchError",a,void 0)}};function Dc(e){return Y(e)&&e.name==="AuthRetryableFetchError"}var Jl=class extends qa{constructor(t,a,r){super(t,"AuthWeakPasswordError",a,"weak_password"),this.reasons=r}};var on=class extends qa{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}};var Mc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),KC=`
14
- \r=`.split(""),gA=(()=>{let e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<KC.length;t+=1)e[KC[t].charCodeAt(0)]=-2;for(let t=0;t<Mc.length;t+=1)e[Mc[t].charCodeAt(0)]=t;return e})();function XC(e,t,a){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){let r=t.queue>>t.queuedBits-6&63;a(Mc[r]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){let r=t.queue>>t.queuedBits-6&63;a(Mc[r]),t.queuedBits-=6}}function QC(e,t,a){let r=gA[e];if(r>-1)for(t.queue=t.queue<<6|r,t.queuedBits+=6;t.queuedBits>=8;)a(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(r===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function Mg(e){let t=[],a=s=>{t.push(String.fromCodePoint(s))},r={utf8seq:0,codepoint:0},o={queue:0,queuedBits:0},n=s=>{vA(s,r,a)};for(let s=0;s<e.length;s+=1)QC(e.charCodeAt(s),o,n);return t.join("")}function yA(e,t){if(e<=127){t(e);return}else if(e<=2047){t(192|e>>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function xA(e,t){for(let a=0;a<e.length;a+=1){let r=e.charCodeAt(a);if(r>55295&&r<=56319){let o=(r-55296)*1024&65535;r=(e.charCodeAt(a+1)-56320&65535|o)+65536,a+=1}yA(r,t)}}function vA(e,t,a){if(t.utf8seq===0){if(e<=127){a(e);return}for(let r=1;r<6;r+=1)if((e>>7-r&1)===0){t.utf8seq=r;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&a(t.codepoint)}}function JC(e){let t=[],a={queue:0,queuedBits:0},r=o=>{t.push(o)};for(let o=0;o<e.length;o+=1)QC(e.charCodeAt(o),a,r);return new Uint8Array(t)}function YC(e){let t=[];return xA(e,a=>t.push(a)),new Uint8Array(t)}function ZC(e){let t=[],a={queue:0,queuedBits:0},r=o=>{t.push(o)};return e.forEach(o=>XC(o,a,r)),XC(null,a,r),t.join("")}function eS(e){return Math.round(Date.now()/1e3)+e}function tS(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}var ya=()=>typeof window<"u"&&typeof document<"u",nn={tested:!1,writable:!1},Nc=()=>{if(!ya())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(nn.tested)return nn.writable;let e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),nn.tested=!0,nn.writable=!0}catch{nn.tested=!0,nn.writable=!1}return nn.writable};function aS(e){let t={},a=new URL(e);if(a.hash&&a.hash[0]==="#")try{new URLSearchParams(a.hash.substring(1)).forEach((o,n)=>{t[n]=o})}catch{}return a.searchParams.forEach((r,o)=>{t[o]=r}),t}var Oc=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...a)=>Promise.resolve().then(()=>(oo(),Xo)).then(({default:r})=>r(...a)):t=fetch,(...a)=>t(...a)},rS=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",sn=async(e,t,a)=>{await e.setItem(t,JSON.stringify(a))},so=async(e,t)=>{let a=await e.getItem(t);if(!a)return null;try{return JSON.parse(a)}catch{return a}},yr=async(e,t)=>{await e.removeItem(t)},Yl=class e{constructor(){this.promise=new e.promiseConstructor((t,a)=>{this.resolve=t,this.reject=a})}};Yl.promiseConstructor=Promise;function Fc(e){let t=e.split(".");if(t.length!==3)throw new on("Invalid JWT structure");for(let r=0;r<t.length;r++)if(!HC.test(t[r]))throw new on("JWT not in base64url format");return{header:JSON.parse(Mg(t[0])),payload:JSON.parse(Mg(t[1])),signature:JC(t[2]),raw:{header:t[0],payload:t[1]}}}async function oS(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function nS(e,t){return new Promise((r,o)=>{(async()=>{for(let n=0;n<1/0;n++)try{let s=await e(n);if(!t(n,null,s)){r(s);return}}catch(s){if(!t(n,s)){o(s);return}}})()})}function wA(e){return("0"+e.toString(16)).substr(-2)}function CA(){let t=new Uint32Array(56);if(typeof crypto>"u"){let a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=a.length,o="";for(let n=0;n<56;n++)o+=a.charAt(Math.floor(Math.random()*r));return o}return crypto.getRandomValues(t),Array.from(t,wA).join("")}async function SA(e){let a=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",a),o=new Uint8Array(r);return Array.from(o).map(n=>String.fromCharCode(n)).join("")}async function LA(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;let a=await SA(e);return btoa(a).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function ln(e,t,a=!1){let r=CA(),o=r;a&&(o+="/PASSWORD_RECOVERY"),await sn(e,`${t}-code-verifier`,o);let n=await LA(r);return[n,r===n?"plain":"s256"]}var bA=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function sS(e){let t=e.headers.get(Kl);if(!t||!t.match(bA))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function iS(e){if(!e)throw new Error("Missing exp claim");let t=Math.floor(Date.now()/1e3);if(e<=t)throw new Error("JWT has expired")}function lS(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}var IA=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function un(e){if(!IA.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Bc(){let e={};return new Proxy(e,{get:(t,a)=>{if(a==="__isUserNotAvailableProxy")return!0;if(typeof a=="symbol"){let r=a.toString();if(r==="Symbol(Symbol.toPrimitive)"||r==="Symbol(Symbol.toStringTag)"||r==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${a}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,a)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${a}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,a)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${a}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function Ng(e){return JSON.parse(JSON.stringify(e))}var kA=function(e,t){var a={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(a[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(a[r[o]]=e[r[o]]);return a},dn=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),PA=[502,503,504];async function uS(e){var t;if(!rS(e))throw new Is(dn(e),0);if(PA.includes(e.status))throw new Is(dn(e),e.status);let a;try{a=await e.json()}catch(n){throw new bs(dn(n),n)}let r,o=sS(e);if(o&&o.getTime()>=Dg["2024-01-01"].timestamp&&typeof a=="object"&&a&&typeof a.code=="string"?r=a.code:typeof a=="object"&&a&&typeof a.error_code=="string"&&(r=a.error_code),r){if(r==="weak_password")throw new Jl(dn(a),e.status,((t=a.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(r==="session_not_found")throw new ga}else if(typeof a=="object"&&a&&typeof a.weak_password=="object"&&a.weak_password&&Array.isArray(a.weak_password.reasons)&&a.weak_password.reasons.length&&a.weak_password.reasons.reduce((n,s)=>n&&typeof s=="string",!0))throw new Jl(dn(a),e.status,a.weak_password.reasons);throw new Ec(dn(a),e.status||500,r)}var TA=(e,t,a,r)=>{let o={method:e,headers:t?.headers||{}};return e==="GET"?o:(o.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t?.headers),o.body=JSON.stringify(r),Object.assign(Object.assign({},o),a))};async function re(e,t,a,r){var o;let n=Object.assign({},r?.headers);n[Kl]||(n[Kl]=Dg["2024-01-01"].name),r?.jwt&&(n.Authorization=`Bearer ${r.jwt}`);let s=(o=r?.query)!==null&&o!==void 0?o:{};r?.redirectTo&&(s.redirect_to=r.redirectTo);let i=Object.keys(s).length?"?"+new URLSearchParams(s).toString():"",l=await AA(e,t,a+i,{headers:n,noResolveJson:r?.noResolveJson},{},r?.body);return r?.xform?r?.xform(l):{data:Object.assign({},l),error:null}}async function AA(e,t,a,r,o,n){let s=TA(t,r,o,n),i;try{i=await e(a,Object.assign({},s))}catch(l){throw console.error(l),new Is(dn(l),0)}if(i.ok||await uS(i),r?.noResolveJson)return i;try{return await i.json()}catch(l){await uS(l)}}function Ha(e){var t;let a=null;RA(e)&&(a=Object.assign({},e),e.expires_at||(a.expires_at=eS(e.expires_in)));let r=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:a,user:r},error:null}}function Og(e){let t=Ha(e);return!t.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((a,r)=>a&&typeof r=="string",!0)&&(t.data.weak_password=e.weak_password),t}function za(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function dS(e){return{data:e,error:null}}function cS(e){let{action_link:t,email_otp:a,hashed_token:r,redirect_to:o,verification_type:n}=e,s=kA(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),i={action_link:t,email_otp:a,hashed_token:r,redirect_to:o,verification_type:n},l=Object.assign({},s);return{data:{properties:i,user:l},error:null}}function fS(e){return e}function RA(e){return e.access_token&&e.refresh_token&&e.expires_in}var Uc=["global","local","others"];var _A=function(e,t){var a={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(a[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(a[r[o]]=e[r[o]]);return a},cn=class{constructor({url:t="",headers:a={},fetch:r}){this.url=t,this.headers=a,this.fetch=Oc(r),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}async signOut(t,a=Uc[0]){if(Uc.indexOf(a)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Uc.join(", ")}`);try{return await re(this.fetch,"POST",`${this.url}/logout?scope=${a}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(r){if(Y(r))return{data:null,error:r};throw r}}async inviteUserByEmail(t,a={}){try{return await re(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:a.data},headers:this.headers,redirectTo:a.redirectTo,xform:za})}catch(r){if(Y(r))return{data:{user:null},error:r};throw r}}async generateLink(t){try{let{options:a}=t,r=_A(t,["options"]),o=Object.assign(Object.assign({},r),a);return"newEmail"in r&&(o.new_email=r?.newEmail,delete o.newEmail),await re(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:o,headers:this.headers,xform:cS,redirectTo:a?.redirectTo})}catch(a){if(Y(a))return{data:{properties:null,user:null},error:a};throw a}}async createUser(t){try{return await re(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:za})}catch(a){if(Y(a))return{data:{user:null},error:a};throw a}}async listUsers(t){var a,r,o,n,s,i,l;try{let u={nextPage:null,lastPage:0,total:0},d=await re(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(a=t?.page)===null||a===void 0?void 0:a.toString())!==null&&r!==void 0?r:"",per_page:(n=(o=t?.perPage)===null||o===void 0?void 0:o.toString())!==null&&n!==void 0?n:""},xform:fS});if(d.error)throw d.error;let c=await d.json(),f=(s=d.headers.get("x-total-count"))!==null&&s!==void 0?s:0,m=(l=(i=d.headers.get("link"))===null||i===void 0?void 0:i.split(","))!==null&&l!==void 0?l:[];return m.length>0&&(m.forEach(v=>{let w=parseInt(v.split(";")[0].split("=")[1].substring(0,1)),S=JSON.parse(v.split(";")[1].split("=")[1]);u[`${S}Page`]=w}),u.total=parseInt(f)),{data:Object.assign(Object.assign({},c),u),error:null}}catch(u){if(Y(u))return{data:{users:[]},error:u};throw u}}async getUserById(t){un(t);try{return await re(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:za})}catch(a){if(Y(a))return{data:{user:null},error:a};throw a}}async updateUserById(t,a){un(t);try{return await re(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:a,headers:this.headers,xform:za})}catch(r){if(Y(r))return{data:{user:null},error:r};throw r}}async deleteUser(t,a=!1){un(t);try{return await re(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:a},xform:za})}catch(r){if(Y(r))return{data:{user:null},error:r};throw r}}async _listFactors(t){un(t.userId);try{let{data:a,error:r}=await re(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:o=>({data:{factors:o},error:null})});return{data:a,error:r}}catch(a){if(Y(a))return{data:null,error:a};throw a}}async _deleteFactor(t){un(t.userId),un(t.id);try{return{data:await re(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(a){if(Y(a))return{data:null,error:a};throw a}}};function Fg(e={}){return{getItem:t=>e[t]||null,setItem:(t,a)=>{e[t]=a},removeItem:t=>{delete e[t]}}}function pS(){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)}}var fn={debug:!!(globalThis&&Nc()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")},Zl=class extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}},Vc=class extends Zl{};async function Bg(e,t,a){fn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);let r=new globalThis.AbortController;return t>0&&setTimeout(()=>{r.abort(),fn.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},async o=>{if(o){fn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,o.name);try{return await a()}finally{fn.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,o.name)}}else{if(t===0)throw fn.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new Vc(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(fn.debug)try{let n=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(n,null," "))}catch(n){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",n)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await a()}}))}pS();var EA={url:VC,storageKey:jC,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:qC,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1};async function mS(e,t,a){return await a()}var ks={},pn=class e{constructor(t){var a,r;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=e.nextInstanceID,e.nextInstanceID+=1,this.instanceID>0&&ya()&&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.");let o=Object.assign(Object.assign({},EA),t);if(this.logDebugMessages=!!o.debug,typeof o.debug=="function"&&(this.logger=o.debug),this.persistSession=o.persistSession,this.storageKey=o.storageKey,this.autoRefreshToken=o.autoRefreshToken,this.admin=new cn({url:o.url,headers:o.headers,fetch:o.fetch}),this.url=o.url,this.headers=o.headers,this.fetch=Oc(o.fetch),this.lock=o.lock||mS,this.detectSessionInUrl=o.detectSessionInUrl,this.flowType=o.flowType,this.hasCustomAuthorizationHeader=o.hasCustomAuthorizationHeader,o.lock?this.lock=o.lock:ya()&&(!((a=globalThis?.navigator)===null||a===void 0)&&a.locks)?this.lock=Bg:this.lock=mS,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this)},this.persistSession?(o.storage?this.storage=o.storage:Nc()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=Fg(this.memoryStorage)),o.userStorage&&(this.userStorage=o.userStorage)):(this.memoryStorage={},this.storage=Fg(this.memoryStorage)),ya()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(n){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",n)}(r=this.broadcastChannel)===null||r===void 0||r.addEventListener("message",async n=>{this._debug("received broadcast notification from other tab or client",n),await this._notifyAllSubscribers(n.data.event,n.data.session,!1)})}this.initialize()}get jwks(){var t,a;return(a=(t=ks[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&a!==void 0?a:{keys:[]}}set jwks(t){ks[this.storageKey]=Object.assign(Object.assign({},ks[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,a;return(a=(t=ks[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&a!==void 0?a:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){ks[this.storageKey]=Object.assign(Object.assign({},ks[this.storageKey]),{cachedAt:t})}_debug(...t){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${Ac}) ${new Date().toISOString()}`,...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{let a=aS(window.location.href),r="none";if(this._isImplicitGrantCallback(a)?r="implicit":await this._isPKCECallback(a)&&(r="pkce"),ya()&&this.detectSessionInUrl&&r!=="none"){let{data:o,error:n}=await this._getSessionFromURL(a,r);if(n){if(this._debug("#_initialize()","error detecting session from URL",n),GC(n)){let l=(t=n.details)===null||t===void 0?void 0:t.code;if(l==="identity_already_exists"||l==="identity_not_found"||l==="single_identity_not_deletable")return{error:n}}return await this._removeSession(),{error:n}}let{session:s,redirectType:i}=o;return this._debug("#_initialize()","detected session in URL",s,"redirect type",i),await this._saveSession(s),setTimeout(async()=>{i==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",s):await this._notifyAllSubscribers("SIGNED_IN",s)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(a){return Y(a)?{error:a}:{error:new bs("Unexpected error during initialization",a)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var a,r,o;try{let n=await re(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(a=t?.options)===null||a===void 0?void 0:a.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:(o=t?.options)===null||o===void 0?void 0:o.captchaToken}},xform:Ha}),{data:s,error:i}=n;if(i||!s)return{data:{user:null,session:null},error:i};let l=s.session,u=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",l)),{data:{user:u,session:l},error:null}}catch(n){if(Y(n))return{data:{user:null,session:null},error:n};throw n}}async signUp(t){var a,r,o;try{let n;if("email"in t){let{email:d,password:c,options:f}=t,m=null,v=null;this.flowType==="pkce"&&([m,v]=await ln(this.storage,this.storageKey)),n=await re(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:f?.emailRedirectTo,body:{email:d,password:c,data:(a=f?.data)!==null&&a!==void 0?a:{},gotrue_meta_security:{captcha_token:f?.captchaToken},code_challenge:m,code_challenge_method:v},xform:Ha})}else if("phone"in t){let{phone:d,password:c,options:f}=t;n=await re(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:d,password:c,data:(r=f?.data)!==null&&r!==void 0?r:{},channel:(o=f?.channel)!==null&&o!==void 0?o:"sms",gotrue_meta_security:{captcha_token:f?.captchaToken}},xform:Ha})}else throw new an("You must provide either an email or phone number and a password");let{data:s,error:i}=n;if(i||!s)return{data:{user:null,session:null},error:i};let l=s.session,u=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",l)),{data:{user:u,session:l},error:null}}catch(n){if(Y(n))return{data:{user:null,session:null},error:n};throw n}}async signInWithPassword(t){try{let a;if("email"in t){let{email:n,password:s,options:i}=t;a=await re(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:n,password:s,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:Og})}else if("phone"in t){let{phone:n,password:s,options:i}=t;a=await re(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:n,password:s,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:Og})}else throw new an("You must provide either an email or phone number and a password");let{data:r,error:o}=a;return o?{data:{user:null,session:null},error:o}:!r||!r.session||!r.user?{data:{user:null,session:null},error:new tn}:(r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),{data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:o})}catch(a){if(Y(a))return{data:{user:null,session:null},error:a};throw a}}async signInWithOAuth(t){var a,r,o,n;return await this._handleProviderSignIn(t.provider,{redirectTo:(a=t.options)===null||a===void 0?void 0:a.redirectTo,scopes:(r=t.options)===null||r===void 0?void 0:r.scopes,queryParams:(o=t.options)===null||o===void 0?void 0:o.queryParams,skipBrowserRedirect:(n=t.options)===null||n===void 0?void 0:n.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){let{chain:a}=t;if(a==="solana")return await this.signInWithSolana(t);throw new Error(`@supabase/auth-js: Unsupported chain "${a}"`)}async signInWithSolana(t){var a,r,o,n,s,i,l,u,d,c,f,m;let v,w;if("message"in t)v=t.message,w=t.signature;else{let{chain:S,wallet:h,statement:g,options:x}=t,L;if(ya())if(typeof h=="object")L=h;else{let k=window;if("solana"in k&&typeof k.solana=="object"&&("signIn"in k.solana&&typeof k.solana.signIn=="function"||"signMessage"in k.solana&&typeof k.solana.signMessage=="function"))L=k.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof h!="object"||!x?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");L=h}let I=new URL((a=x?.url)!==null&&a!==void 0?a:window.location.href);if("signIn"in L&&L.signIn){let k=await L.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},x?.signInWithSolana),{version:"1",domain:I.host,uri:I.href}),g?{statement:g}:null)),D;if(Array.isArray(k)&&k[0]&&typeof k[0]=="object")D=k[0];else if(k&&typeof k=="object"&&"signedMessage"in k&&"signature"in k)D=k;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in D&&"signature"in D&&(typeof D.signedMessage=="string"||D.signedMessage instanceof Uint8Array)&&D.signature instanceof Uint8Array)v=typeof D.signedMessage=="string"?D.signedMessage:new TextDecoder().decode(D.signedMessage),w=D.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in L)||typeof L.signMessage!="function"||!("publicKey"in L)||typeof L!="object"||!L.publicKey||!("toBase58"in L.publicKey)||typeof L.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");v=[`${I.host} wants you to sign in with your Solana account:`,L.publicKey.toBase58(),...g?["",g,""]:[""],"Version: 1",`URI: ${I.href}`,`Issued At: ${(o=(r=x?.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&o!==void 0?o:new Date().toISOString()}`,...!((n=x?.signInWithSolana)===null||n===void 0)&&n.notBefore?[`Not Before: ${x.signInWithSolana.notBefore}`]:[],...!((s=x?.signInWithSolana)===null||s===void 0)&&s.expirationTime?[`Expiration Time: ${x.signInWithSolana.expirationTime}`]:[],...!((i=x?.signInWithSolana)===null||i===void 0)&&i.chainId?[`Chain ID: ${x.signInWithSolana.chainId}`]:[],...!((l=x?.signInWithSolana)===null||l===void 0)&&l.nonce?[`Nonce: ${x.signInWithSolana.nonce}`]:[],...!((u=x?.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${x.signInWithSolana.requestId}`]:[],...!((c=(d=x?.signInWithSolana)===null||d===void 0?void 0:d.resources)===null||c===void 0)&&c.length?["Resources",...x.signInWithSolana.resources.map(D=>`- ${D}`)]:[]].join(`
15
- `);let k=await L.signMessage(new TextEncoder().encode(v),"utf8");if(!k||!(k instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");w=k}}try{let{data:S,error:h}=await re(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:v,signature:ZC(w)},!((f=t.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(m=t.options)===null||m===void 0?void 0:m.captchaToken}}:null),xform:Ha});if(h)throw h;return!S||!S.session||!S.user?{data:{user:null,session:null},error:new tn}:(S.session&&(await this._saveSession(S.session),await this._notifyAllSubscribers("SIGNED_IN",S.session)),{data:Object.assign({},S),error:h})}catch(S){if(Y(S))return{data:{user:null,session:null},error:S};throw S}}async _exchangeCodeForSession(t){let a=await so(this.storage,`${this.storageKey}-code-verifier`),[r,o]=(a??"").split("/");try{let{data:n,error:s}=await re(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:r},xform:Ha});if(await yr(this.storage,`${this.storageKey}-code-verifier`),s)throw s;return!n||!n.session||!n.user?{data:{user:null,session:null,redirectType:null},error:new tn}:(n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),{data:Object.assign(Object.assign({},n),{redirectType:o??null}),error:s})}catch(n){if(Y(n))return{data:{user:null,session:null,redirectType:null},error:n};throw n}}async signInWithIdToken(t){try{let{options:a,provider:r,token:o,access_token:n,nonce:s}=t,i=await re(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:o,access_token:n,nonce:s,gotrue_meta_security:{captcha_token:a?.captchaToken}},xform:Ha}),{data:l,error:u}=i;return u?{data:{user:null,session:null},error:u}:!l||!l.session||!l.user?{data:{user:null,session:null},error:new tn}:(l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),{data:l,error:u})}catch(a){if(Y(a))return{data:{user:null,session:null},error:a};throw a}}async signInWithOtp(t){var a,r,o,n,s;try{if("email"in t){let{email:i,options:l}=t,u=null,d=null;this.flowType==="pkce"&&([u,d]=await ln(this.storage,this.storageKey));let{error:c}=await re(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:i,data:(a=l?.data)!==null&&a!==void 0?a:{},create_user:(r=l?.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:l?.captchaToken},code_challenge:u,code_challenge_method:d},redirectTo:l?.emailRedirectTo});return{data:{user:null,session:null},error:c}}if("phone"in t){let{phone:i,options:l}=t,{data:u,error:d}=await re(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:i,data:(o=l?.data)!==null&&o!==void 0?o:{},create_user:(n=l?.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:l?.captchaToken},channel:(s=l?.channel)!==null&&s!==void 0?s:"sms"}});return{data:{user:null,session:null,messageId:u?.message_id},error:d}}throw new an("You must provide either an email or phone number.")}catch(i){if(Y(i))return{data:{user:null,session:null},error:i};throw i}}async verifyOtp(t){var a,r;try{let o,n;"options"in t&&(o=(a=t.options)===null||a===void 0?void 0:a.redirectTo,n=(r=t.options)===null||r===void 0?void 0:r.captchaToken);let{data:s,error:i}=await re(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:n}}),redirectTo:o,xform:Ha});if(i)throw i;if(!s)throw new Error("An error occurred on token verification.");let l=s.session,u=s.user;return l?.access_token&&(await this._saveSession(l),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",l)),{data:{user:u,session:l},error:null}}catch(o){if(Y(o))return{data:{user:null,session:null},error:o};throw o}}async signInWithSSO(t){var a,r,o;try{let n=null,s=null;return this.flowType==="pkce"&&([n,s]=await ln(this.storage,this.storageKey)),await re(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(r=(a=t.options)===null||a===void 0?void 0:a.redirectTo)!==null&&r!==void 0?r:void 0}),!((o=t?.options)===null||o===void 0)&&o.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:n,code_challenge_method:s}),headers:this.headers,xform:dS})}catch(n){if(Y(n))return{data:null,error:n};throw n}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{let{data:{session:a},error:r}=t;if(r)throw r;if(!a)throw new ga;let{error:o}=await re(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:a.access_token});return{data:{user:null,session:null},error:o}})}catch(t){if(Y(t))return{data:{user:null,session:null},error:t};throw t}}async resend(t){try{let a=`${this.url}/resend`;if("email"in t){let{email:r,type:o,options:n}=t,{error:s}=await re(this.fetch,"POST",a,{headers:this.headers,body:{email:r,type:o,gotrue_meta_security:{captcha_token:n?.captchaToken}},redirectTo:n?.emailRedirectTo});return{data:{user:null,session:null},error:s}}else if("phone"in t){let{phone:r,type:o,options:n}=t,{data:s,error:i}=await re(this.fetch,"POST",a,{headers:this.headers,body:{phone:r,type:o,gotrue_meta_security:{captcha_token:n?.captchaToken}}});return{data:{user:null,session:null,messageId:s?.message_id},error:i}}throw new an("You must provide either an email or phone number and a type")}catch(a){if(Y(a))return{data:{user:null,session:null},error:a};throw a}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async a=>a))}async _acquireLock(t,a){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){let r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),o=(async()=>(await r,await a()))();return this.pendingInLock.push((async()=>{try{await o}catch{}})()),o}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;let r=a();for(this.pendingInLock.push((async()=>{try{await r}catch{}})()),await r;this.pendingInLock.length;){let o=[...this.pendingInLock];await Promise.all(o),this.pendingInLock.splice(0,o.length)}return await r}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{let a=await this.__loadSession();return await t(a)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null,a=await so(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",a),a!==null&&(this._isValidSession(a)?t=a:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!t)return{data:{session:null},error:null};let r=t.expires_at?t.expires_at*1e3-Date.now()<_c:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",t.expires_at),!r){if(this.userStorage){let s=await so(this.userStorage,this.storageKey+"-user");s?.user?t.user=s.user:t.user=Bc()}if(this.storage.isServer&&t.user){let s=this.suppressGetSessionWarning;t=new Proxy(t,{get:(l,u,d)=>(!s&&u==="user"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),s=!0,this.suppressGetSessionWarning=!0),Reflect.get(l,u,d))})}return{data:{session:t},error:null}}let{session:o,error:n}=await this._callRefreshToken(t.refresh_token);return n?{data:{session:null},error:n}:{data:{session:o},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(t){return t?await this._getUser(t):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(t){try{return t?await re(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:za}):await this._useSession(async a=>{var r,o,n;let{data:s,error:i}=a;if(i)throw i;return!(!((r=s.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new ga}:await re(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(n=(o=s.session)===null||o===void 0?void 0:o.access_token)!==null&&n!==void 0?n:void 0,xform:za})})}catch(a){if(Y(a))return WC(a)&&(await this._removeSession(),await yr(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:a};throw a}}async updateUser(t,a={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(t,a))}async _updateUser(t,a={}){try{return await this._useSession(async r=>{let{data:o,error:n}=r;if(n)throw n;if(!o.session)throw new ga;let s=o.session,i=null,l=null;this.flowType==="pkce"&&t.email!=null&&([i,l]=await ln(this.storage,this.storageKey));let{data:u,error:d}=await re(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:a?.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:i,code_challenge_method:l}),jwt:s.access_token,xform:za});if(d)throw d;return s.user=u.user,await this._saveSession(s),await this._notifyAllSubscribers("USER_UPDATED",s),{data:{user:s.user},error:null}})}catch(r){if(Y(r))return{data:{user:null},error:r};throw r}}async setSession(t){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new ga;let a=Date.now()/1e3,r=a,o=!0,n=null,{payload:s}=Fc(t.access_token);if(s.exp&&(r=s.exp,o=r<=a),o){let{session:i,error:l}=await this._callRefreshToken(t.refresh_token);if(l)return{data:{user:null,session:null},error:l};if(!i)return{data:{user:null,session:null},error:null};n=i}else{let{data:i,error:l}=await this._getUser(t.access_token);if(l)throw l;n={access_token:t.access_token,refresh_token:t.refresh_token,user:i.user,token_type:"bearer",expires_in:r-a,expires_at:r},await this._saveSession(n),await this._notifyAllSubscribers("SIGNED_IN",n)}return{data:{user:n.user,session:n},error:null}}catch(a){if(Y(a))return{data:{session:null,user:null},error:a};throw a}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async a=>{var r;if(!t){let{data:s,error:i}=a;if(i)throw i;t=(r=s.session)!==null&&r!==void 0?r:void 0}if(!t?.refresh_token)throw new ga;let{session:o,error:n}=await this._callRefreshToken(t.refresh_token);return n?{data:{user:null,session:null},error:n}:o?{data:{user:o.user,session:o},error:null}:{data:{user:null,session:null},error:null}})}catch(a){if(Y(a))return{data:{user:null,session:null},error:a};throw a}}async _getSessionFromURL(t,a){try{if(!ya())throw new rn("No browser detected.");if(t.error||t.error_description||t.error_code)throw new rn(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(a){case"implicit":if(this.flowType==="pkce")throw new Ql("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new rn("Not a valid implicit grant flow url.");break;default:}if(a==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new Ql("No code detected.");let{data:g,error:x}=await this._exchangeCodeForSession(t.code);if(x)throw x;let L=new URL(window.location.href);return L.searchParams.delete("code"),window.history.replaceState(window.history.state,"",L.toString()),{data:{session:g.session,redirectType:null},error:null}}let{provider_token:r,provider_refresh_token:o,access_token:n,refresh_token:s,expires_in:i,expires_at:l,token_type:u}=t;if(!n||!i||!s||!u)throw new rn("No session defined in URL");let d=Math.round(Date.now()/1e3),c=parseInt(i),f=d+c;l&&(f=parseInt(l));let m=f-d;m*1e3<=en&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${m}s, should have been closer to ${c}s`);let v=f-c;d-v>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",v,f,d):d-v<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",v,f,d);let{data:w,error:S}=await this._getUser(n);if(S)throw S;let h={provider_token:r,provider_refresh_token:o,access_token:n,expires_in:c,expires_at:f,refresh_token:s,token_type:u,user:w.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:h,redirectType:t.type},error:null}}catch(r){if(Y(r))return{data:{session:null,redirectType:null},error:r};throw r}}_isImplicitGrantCallback(t){return!!(t.access_token||t.error_description)}async _isPKCECallback(t){let a=await so(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&a)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async a=>{var r;let{data:o,error:n}=a;if(n)return{error:n};let s=(r=o.session)===null||r===void 0?void 0:r.access_token;if(s){let{error:i}=await this.admin.signOut(s,t);if(i&&!($C(i)&&(i.status===404||i.status===401||i.status===403)))return{error:i}}return t!=="others"&&(await this._removeSession(),await yr(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(t){let a=tS(),r={id:a,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",a),this.stateChangeEmitters.delete(a)}};return this._debug("#onAuthStateChange()","registered callback with id",a),this.stateChangeEmitters.set(a,r),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(a)})))(),{data:{subscription:r}}}async _emitInitialSession(t){return await this._useSession(async a=>{var r,o;try{let{data:{session:n},error:s}=a;if(s)throw s;await((r=this.stateChangeEmitters.get(t))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",n)),this._debug("INITIAL_SESSION","callback id",t,"session",n)}catch(n){await((o=this.stateChangeEmitters.get(t))===null||o===void 0?void 0:o.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",n),console.error(n)}})}async resetPasswordForEmail(t,a={}){let r=null,o=null;this.flowType==="pkce"&&([r,o]=await ln(this.storage,this.storageKey,!0));try{return await re(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:r,code_challenge_method:o,gotrue_meta_security:{captcha_token:a.captchaToken}},headers:this.headers,redirectTo:a.redirectTo})}catch(n){if(Y(n))return{data:null,error:n};throw n}}async getUserIdentities(){var t;try{let{data:a,error:r}=await this.getUser();if(r)throw r;return{data:{identities:(t=a.user.identities)!==null&&t!==void 0?t:[]},error:null}}catch(a){if(Y(a))return{data:null,error:a};throw a}}async linkIdentity(t){var a;try{let{data:r,error:o}=await this._useSession(async n=>{var s,i,l,u,d;let{data:c,error:f}=n;if(f)throw f;let m=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(s=t.options)===null||s===void 0?void 0:s.redirectTo,scopes:(i=t.options)===null||i===void 0?void 0:i.scopes,queryParams:(l=t.options)===null||l===void 0?void 0:l.queryParams,skipBrowserRedirect:!0});return await re(this.fetch,"GET",m,{headers:this.headers,jwt:(d=(u=c.session)===null||u===void 0?void 0:u.access_token)!==null&&d!==void 0?d:void 0})});if(o)throw o;return ya()&&!(!((a=t.options)===null||a===void 0)&&a.skipBrowserRedirect)&&window.location.assign(r?.url),{data:{provider:t.provider,url:r?.url},error:null}}catch(r){if(Y(r))return{data:{provider:t.provider,url:null},error:r};throw r}}async unlinkIdentity(t){try{return await this._useSession(async a=>{var r,o;let{data:n,error:s}=a;if(s)throw s;return await re(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(o=(r=n.session)===null||r===void 0?void 0:r.access_token)!==null&&o!==void 0?o:void 0})})}catch(a){if(Y(a))return{data:null,error:a};throw a}}async _refreshAccessToken(t){let a=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(a,"begin");try{let r=Date.now();return await nS(async o=>(o>0&&await oS(200*Math.pow(2,o-1)),this._debug(a,"refreshing attempt",o),await re(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:Ha})),(o,n)=>{let s=200*Math.pow(2,o);return n&&Dc(n)&&Date.now()+s-r<en})}catch(r){if(this._debug(a,"error",r),Y(r))return{data:{session:null,user:null},error:r};throw r}finally{this._debug(a,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,a){let r=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:a.redirectTo,scopes:a.scopes,queryParams:a.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",a,"url",r),ya()&&!a.skipBrowserRedirect&&window.location.assign(r),{data:{provider:t,url:r},error:null}}async _recoverAndRefresh(){var t,a;let r="#_recoverAndRefresh()";this._debug(r,"begin");try{let o=await so(this.storage,this.storageKey);if(o&&this.userStorage){let s=await so(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!s&&(s={user:o.user},await sn(this.userStorage,this.storageKey+"-user",s)),o.user=(t=s?.user)!==null&&t!==void 0?t:Bc()}else if(o&&!o.user&&!o.user){let s=await so(this.storage,this.storageKey+"-user");s&&s?.user?(o.user=s.user,await yr(this.storage,this.storageKey+"-user"),await sn(this.storage,this.storageKey,o)):o.user=Bc()}if(this._debug(r,"session from storage",o),!this._isValidSession(o)){this._debug(r,"session is not valid"),o!==null&&await this._removeSession();return}let n=((a=o.expires_at)!==null&&a!==void 0?a:1/0)*1e3-Date.now()<_c;if(this._debug(r,`session has${n?"":" not"} expired with margin of ${_c}s`),n){if(this.autoRefreshToken&&o.refresh_token){let{error:s}=await this._callRefreshToken(o.refresh_token);s&&(console.error(s),Dc(s)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",s),await this._removeSession()))}}else if(o.user&&o.user.__isUserNotAvailableProxy===!0)try{let{data:s,error:i}=await this._getUser(o.access_token);!i&&s?.user?(o.user=s.user,await this._saveSession(o),await this._notifyAllSubscribers("SIGNED_IN",o)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(s){console.error("Error getting user data:",s),this._debug(r,"error getting user data, skipping SIGNED_IN notification",s)}else await this._notifyAllSubscribers("SIGNED_IN",o)}catch(o){this._debug(r,"error",o),console.error(o);return}finally{this._debug(r,"end")}}async _callRefreshToken(t){var a,r;if(!t)throw new ga;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let o=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(o,"begin");try{this.refreshingDeferred=new Yl;let{data:n,error:s}=await this._refreshAccessToken(t);if(s)throw s;if(!n.session)throw new ga;await this._saveSession(n.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",n.session);let i={session:n.session,error:null};return this.refreshingDeferred.resolve(i),i}catch(n){if(this._debug(o,"error",n),Y(n)){let s={session:null,error:n};return Dc(n)||await this._removeSession(),(a=this.refreshingDeferred)===null||a===void 0||a.resolve(s),s}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(n),n}finally{this.refreshingDeferred=null,this._debug(o,"end")}}async _notifyAllSubscribers(t,a,r=!0){let o=`#_notifyAllSubscribers(${t})`;this._debug(o,"begin",a,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:t,session:a});let n=[],s=Array.from(this.stateChangeEmitters.values()).map(async i=>{try{await i.callback(t,a)}catch(l){n.push(l)}});if(await Promise.all(s),n.length>0){for(let i=0;i<n.length;i+=1)console.error(n[i]);throw n[0]}}finally{this._debug(o,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0;let a=Object.assign({},t),r=a.user&&a.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!r&&a.user&&await sn(this.userStorage,this.storageKey+"-user",{user:a.user});let o=Object.assign({},a);delete o.user;let n=Ng(o);await sn(this.storage,this.storageKey,n)}else{let o=Ng(a);await sn(this.storage,this.storageKey,o)}}async _removeSession(){this._debug("#_removeSession()"),await yr(this.storage,this.storageKey),await yr(this.storage,this.storageKey+"-code-verifier"),await yr(this.storage,this.storageKey+"-user"),this.userStorage&&await yr(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");let t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&ya()&&window?.removeEventListener&&window.removeEventListener("visibilitychange",t)}catch(a){console.error("removing visibilitychange callback failed",a)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");let t=setInterval(()=>this._autoRefreshTokenTick(),en);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");let t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{let t=Date.now();try{return await this._useSession(async a=>{let{data:{session:r}}=a;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}let o=Math.floor((r.expires_at*1e3-t)/en);this._debug("#_autoRefreshTokenTick()",`access token expires in ${o} ticks, a tick lasts ${en}ms, refresh threshold is ${Rc} ticks`),o<=Rc&&await this._callRefreshToken(r.refresh_token)})}catch(a){console.error("Auto refresh tick failed with error. This is likely a transient error.",a)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t.isAcquireTimeout||t instanceof Zl)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!ya()||!window?.addEventListener)return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window?.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){let a=`#_onVisibilityChanged(${t})`;this._debug(a,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(a,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(t,a,r){let o=[`provider=${encodeURIComponent(a)}`];if(r?.redirectTo&&o.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r?.scopes&&o.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){let[n,s]=await ln(this.storage,this.storageKey),i=new URLSearchParams({code_challenge:`${encodeURIComponent(n)}`,code_challenge_method:`${encodeURIComponent(s)}`});o.push(i.toString())}if(r?.queryParams){let n=new URLSearchParams(r.queryParams);o.push(n.toString())}return r?.skipBrowserRedirect&&o.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${t}?${o.join("&")}`}async _unenroll(t){try{return await this._useSession(async a=>{var r;let{data:o,error:n}=a;return n?{data:null,error:n}:await re(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(r=o?.session)===null||r===void 0?void 0:r.access_token})})}catch(a){if(Y(a))return{data:null,error:a};throw a}}async _enroll(t){try{return await this._useSession(async a=>{var r,o;let{data:n,error:s}=a;if(s)return{data:null,error:s};let i=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:{issuer:t.issuer}),{data:l,error:u}=await re(this.fetch,"POST",`${this.url}/factors`,{body:i,headers:this.headers,jwt:(r=n?.session)===null||r===void 0?void 0:r.access_token});return u?{data:null,error:u}:(t.factorType==="totp"&&(!((o=l?.totp)===null||o===void 0)&&o.qr_code)&&(l.totp.qr_code=`data:image/svg+xml;utf-8,${l.totp.qr_code}`),{data:l,error:null})})}catch(a){if(Y(a))return{data:null,error:a};throw a}}async _verify(t){return this._acquireLock(-1,async()=>{try{return await this._useSession(async a=>{var r;let{data:o,error:n}=a;if(n)return{data:null,error:n};let{data:s,error:i}=await re(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:{code:t.code,challenge_id:t.challengeId},headers:this.headers,jwt:(r=o?.session)===null||r===void 0?void 0:r.access_token});return i?{data:null,error:i}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+s.expires_in},s)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",s),{data:s,error:i})})}catch(a){if(Y(a))return{data:null,error:a};throw a}})}async _challenge(t){return this._acquireLock(-1,async()=>{try{return await this._useSession(async a=>{var r;let{data:o,error:n}=a;return n?{data:null,error:n}:await re(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:{channel:t.channel},headers:this.headers,jwt:(r=o?.session)===null||r===void 0?void 0:r.access_token})})}catch(a){if(Y(a))return{data:null,error:a};throw a}})}async _challengeAndVerify(t){let{data:a,error:r}=await this._challenge({factorId:t.factorId});return r?{data:null,error:r}:await this._verify({factorId:t.factorId,challengeId:a.id,code:t.code})}async _listFactors(){let{data:{user:t},error:a}=await this.getUser();if(a)return{data:null,error:a};let r=t?.factors||[],o=r.filter(s=>s.factor_type==="totp"&&s.status==="verified"),n=r.filter(s=>s.factor_type==="phone"&&s.status==="verified");return{data:{all:r,totp:o,phone:n},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async t=>{var a,r;let{data:{session:o},error:n}=t;if(n)return{data:null,error:n};if(!o)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let{payload:s}=Fc(o.access_token),i=null;s.aal&&(i=s.aal);let l=i;((r=(a=o.user.factors)===null||a===void 0?void 0:a.filter(c=>c.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(l="aal2");let d=s.amr||[];return{data:{currentLevel:i,nextLevel:l,currentAuthenticationMethods:d},error:null}}))}async fetchJwk(t,a={keys:[]}){let r=a.keys.find(i=>i.kid===t);if(r)return r;let o=Date.now();if(r=this.jwks.keys.find(i=>i.kid===t),r&&this.jwks_cached_at+zC>o)return r;let{data:n,error:s}=await re(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(s)throw s;return!n.keys||n.keys.length===0||(this.jwks=n,this.jwks_cached_at=o,r=n.keys.find(i=>i.kid===t),!r)?null:r}async getClaims(t,a={}){try{let r=t;if(!r){let{data:m,error:v}=await this.getSession();if(v||!m.session)return{data:null,error:v};r=m.session.access_token}let{header:o,payload:n,signature:s,raw:{header:i,payload:l}}=Fc(r);a?.allowExpired||iS(n.exp);let u=!o.alg||o.alg.startsWith("HS")||!o.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(o.kid,a?.keys?{keys:a.keys}:a?.jwks);if(!u){let{error:m}=await this.getUser(r);if(m)throw m;return{data:{claims:n,header:o,signature:s},error:null}}let d=lS(o.alg),c=await crypto.subtle.importKey("jwk",u,d,!0,["verify"]);if(!await crypto.subtle.verify(d,c,s,YC(`${i}.${l}`)))throw new on("Invalid JWT signature");return{data:{claims:n,header:o,signature:s},error:null}}catch(r){if(Y(r))return{data:null,error:r};throw r}}};pn.nextInstanceID=0;var DA=pn,Ug=DA;var jc=class extends Ug{constructor(t){super(t)}};var MA=function(e,t,a,r){function o(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function i(d){try{u(r.next(d))}catch(c){s(c)}}function l(d){try{u(r.throw(d))}catch(c){s(c)}}function u(d){d.done?n(d.value):o(d.value).then(i,l)}u((r=r.apply(e,t||[])).next())})},eu=class{constructor(t,a,r){var o,n,s;if(this.supabaseUrl=t,this.supabaseKey=a,!t)throw new Error("supabaseUrl is required.");if(!a)throw new Error("supabaseKey is required.");let i=BC(t),l=new URL(i);this.realtimeUrl=new URL("realtime/v1",l),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",l),this.storageUrl=new URL("storage/v1",l),this.functionsUrl=new URL("functions/v1",l);let u=`sb-${l.hostname.split(".")[0]}-auth-token`,d={db:MC,realtime:OC,auth:Object.assign(Object.assign({},NC),{storageKey:u}),global:DC},c=UC(r??{},d);this.storageKey=(o=c.auth.storageKey)!==null&&o!==void 0?o:"",this.headers=(n=c.global.headers)!==null&&n!==void 0?n:{},c.accessToken?(this.accessToken=c.accessToken,this.auth=new Proxy({},{get:(f,m)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(m)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((s=c.auth)!==null&&s!==void 0?s:{},this.headers,c.global.fetch),this.fetch=FC(a,this._getAccessToken.bind(this),c.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},c.realtime)),this.rest=new yC(new URL("rest/v1",l).href,{headers:this.headers,schema:c.db.schema,fetch:this.fetch}),this.storage=new Wl(this.storageUrl.href,this.headers,this.fetch,r?.storage),c.accessToken||this._listenForAuthEvents()}get functions(){return new Ml(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(t){return this.rest.from(t)}schema(t){return this.rest.schema(t)}rpc(t,a={},r={}){return this.rest.rpc(t,a,r)}channel(t,a={config:{}}){return this.realtime.channel(t,a)}getChannels(){return this.realtime.getChannels()}removeChannel(t){return this.realtime.removeChannel(t)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var t,a;return MA(this,void 0,void 0,function*(){if(this.accessToken)return yield this.accessToken();let{data:r}=yield this.auth.getSession();return(a=(t=r.session)===null||t===void 0?void 0:t.access_token)!==null&&a!==void 0?a:null})}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:a,detectSessionInUrl:r,storage:o,storageKey:n,flowType:s,lock:i,debug:l},u,d){let c={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new jc({url:this.authUrl.href,headers:Object.assign(Object.assign({},c),u),storageKey:n,autoRefreshToken:t,persistSession:a,detectSessionInUrl:r,storage:o,flowType:s,lock:i,debug:l,fetch:d,hasCustomAuthorizationHeader:"Authorization"in this.headers})}_initRealtimeClient(t){return new ws(this.realtimeUrl.href,Object.assign(Object.assign({},t),{params:Object.assign({apikey:this.supabaseKey},t?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((a,r)=>{this._handleTokenChanged(a,"CLIENT",r?.access_token)})}_handleTokenChanged(t,a,r){(t==="TOKEN_REFRESHED"||t==="SIGNED_IN")&&this.changedAccessToken!==r?this.changedAccessToken=r:t==="SIGNED_OUT"&&(this.realtime.setAuth(),a=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};var hS=(e,t,a)=>new eu(e,t,a);function NA(){if(typeof window<"u"||typeof process>"u"||process.version===void 0||process.version===null)return!1;let e=process.version.match(/^v(\d+)\./);return e?parseInt(e[1],10)<=18:!1}NA()&&console.warn("\u26A0\uFE0F Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");function gS(e){var t,a,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(a=gS(e[t]))&&(r&&(r+=" "),r+=a)}else for(a in e)e[a]&&(r&&(r+=" "),r+=a);return r}function qc(){for(var e,t,a=0,r="",o=arguments.length;a<o;a++)(e=arguments[a])&&(t=gS(e))&&(r&&(r+=" "),r+=t);return r}var OA=e=>{let t=BA(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{let i=s.split("-");return i[0]===""&&i.length!==1&&i.shift(),vS(i,t)||FA(s)},getConflictingClassGroupIds:(s,i)=>{let l=a[s]||[];return i&&r[s]?[...l,...r[s]]:l}}},vS=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],r=t.nextPart.get(a),o=r?vS(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;let n=e.join("-");return t.validators.find(({validator:s})=>s(n))?.classGroupId},yS=/^\[(.+)\]$/,FA=e=>{if(yS.test(e)){let t=yS.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},BA=e=>{let{theme:t,prefix:a}=e,r={nextPart:new Map,validators:[]};return VA(Object.entries(e.classGroups),a).forEach(([n,s])=>{jg(s,r,n,t)}),r},jg=(e,t,a,r)=>{e.forEach(o=>{if(typeof o=="string"){let n=o===""?t:xS(t,o);n.classGroupId=a;return}if(typeof o=="function"){if(UA(o)){jg(o(r),t,a,r);return}t.validators.push({validator:o,classGroupId:a});return}Object.entries(o).forEach(([n,s])=>{jg(s,xS(t,n),a,r)})})},xS=(e,t)=>{let a=e;return t.split("-").forEach(r=>{a.nextPart.has(r)||a.nextPart.set(r,{nextPart:new Map,validators:[]}),a=a.nextPart.get(r)}),a},UA=e=>e.isThemeGetter,VA=(e,t)=>t?e.map(([a,r])=>{let o=r.map(n=>typeof n=="string"?t+n:typeof n=="object"?Object.fromEntries(Object.entries(n).map(([s,i])=>[t+s,i])):n);return[a,o]}):e,jA=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,r=new Map,o=(n,s)=>{a.set(n,s),t++,t>e&&(t=0,r=a,a=new Map)};return{get(n){let s=a.get(n);if(s!==void 0)return s;if((s=r.get(n))!==void 0)return o(n,s),s},set(n,s){a.has(n)?a.set(n,s):o(n,s)}}};var qA=e=>{let{separator:t,experimentalParseClassName:a}=e,r=t.length===1,o=t[0],n=t.length,s=i=>{let l=[],u=0,d=0,c;for(let S=0;S<i.length;S++){let h=i[S];if(u===0){if(h===o&&(r||i.slice(S,S+n)===t)){l.push(i.slice(d,S)),d=S+n;continue}if(h==="/"){c=S;continue}}h==="["?u++:h==="]"&&u--}let f=l.length===0?i:i.substring(d),m=f.startsWith("!"),v=m?f.substring(1):f,w=c&&c>d?c-d:void 0;return{modifiers:l,hasImportantModifier:m,baseClassName:v,maybePostfixModifierPosition:w}};return a?i=>a({className:i,parseClassName:s}):s},HA=e=>{if(e.length<=1)return e;let t=[],a=[];return e.forEach(r=>{r[0]==="["?(t.push(...a.sort(),r),a=[]):a.push(r)}),t.push(...a.sort()),t},zA=e=>({cache:jA(e.cacheSize),parseClassName:qA(e),...OA(e)}),$A=/\s+/,WA=(e,t)=>{let{parseClassName:a,getClassGroupId:r,getConflictingClassGroupIds:o}=t,n=[],s=e.trim().split($A),i="";for(let l=s.length-1;l>=0;l-=1){let u=s[l],{modifiers:d,hasImportantModifier:c,baseClassName:f,maybePostfixModifierPosition:m}=a(u),v=!!m,w=r(v?f.substring(0,m):f);if(!w){if(!v){i=u+(i.length>0?" "+i:i);continue}if(w=r(f),!w){i=u+(i.length>0?" "+i:i);continue}v=!1}let S=HA(d).join(":"),h=c?S+"!":S,g=h+w;if(n.includes(g))continue;n.push(g);let x=o(w,v);for(let L=0;L<x.length;++L){let I=x[L];n.push(h+I)}i=u+(i.length>0?" "+i:i)}return i};function GA(){let e=0,t,a,r="";for(;e<arguments.length;)(t=arguments[e++])&&(a=wS(t))&&(r&&(r+=" "),r+=a);return r}var wS=e=>{if(typeof e=="string")return e;let t,a="";for(let r=0;r<e.length;r++)e[r]&&(t=wS(e[r]))&&(a&&(a+=" "),a+=t);return a};function KA(e,...t){let a,r,o,n=s;function s(l){let u=t.reduce((d,c)=>c(d),e());return a=zA(u),r=a.cache.get,o=a.cache.set,n=i,i(l)}function i(l){let u=r(l);if(u)return u;let d=WA(l,a);return o(l,d),d}return function(){return n(GA.apply(null,arguments))}}var Pe=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},CS=/^\[(?:([a-z-]+):)?(.+)\]$/i,XA=/^\d+\/\d+$/,QA=new Set(["px","full","screen"]),JA=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,YA=/\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$/,ZA=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,eR=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,tR=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,xr=e=>Ps(e)||QA.has(e)||XA.test(e),io=e=>Ts(e,"length",uR),Ps=e=>!!e&&!Number.isNaN(Number(e)),Vg=e=>Ts(e,"number",Ps),tu=e=>!!e&&Number.isInteger(Number(e)),aR=e=>e.endsWith("%")&&Ps(e.slice(0,-1)),ee=e=>CS.test(e),lo=e=>JA.test(e),rR=new Set(["length","size","percentage"]),oR=e=>Ts(e,rR,SS),nR=e=>Ts(e,"position",SS),sR=new Set(["image","url"]),iR=e=>Ts(e,sR,cR),lR=e=>Ts(e,"",dR),au=()=>!0,Ts=(e,t,a)=>{let r=CS.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):a(r[2]):!1},uR=e=>YA.test(e)&&!ZA.test(e),SS=()=>!1,dR=e=>eR.test(e),cR=e=>tR.test(e);var fR=()=>{let e=Pe("colors"),t=Pe("spacing"),a=Pe("blur"),r=Pe("brightness"),o=Pe("borderColor"),n=Pe("borderRadius"),s=Pe("borderSpacing"),i=Pe("borderWidth"),l=Pe("contrast"),u=Pe("grayscale"),d=Pe("hueRotate"),c=Pe("invert"),f=Pe("gap"),m=Pe("gradientColorStops"),v=Pe("gradientColorStopPositions"),w=Pe("inset"),S=Pe("margin"),h=Pe("opacity"),g=Pe("padding"),x=Pe("saturate"),L=Pe("scale"),I=Pe("sepia"),k=Pe("skew"),D=Pe("space"),_=Pe("translate"),V=()=>["auto","contain","none"],j=()=>["auto","hidden","clip","visible","scroll"],ge=()=>["auto",ee,t],ue=()=>[ee,t],Dr=()=>["",xr,io],ar=()=>["auto",Ps,ee],Q=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Ro=()=>["solid","dashed","dotted","double","none"],Re=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ht=()=>["start","end","center","between","around","evenly","stretch"],It=()=>["","0",ee],Wt=()=>["auto","avoid","all","avoid-page","page","left","right","column"],$e=()=>[Ps,ee];return{cacheSize:500,separator:":",theme:{colors:[au],spacing:[xr,io],blur:["none","",lo,ee],brightness:$e(),borderColor:[e],borderRadius:["none","","full",lo,ee],borderSpacing:ue(),borderWidth:Dr(),contrast:$e(),grayscale:It(),hueRotate:$e(),invert:It(),gap:ue(),gradientColorStops:[e],gradientColorStopPositions:[aR,io],inset:ge(),margin:ge(),opacity:$e(),padding:ue(),saturate:$e(),scale:$e(),sepia:It(),skew:$e(),space:ue(),translate:ue()},classGroups:{aspect:[{aspect:["auto","square","video",ee]}],container:["container"],columns:[{columns:[lo]}],"break-after":[{"break-after":Wt()}],"break-before":[{"break-before":Wt()}],"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:[...Q(),ee]}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:V()}],"overscroll-x":[{"overscroll-x":V()}],"overscroll-y":[{"overscroll-y":V()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",tu,ee]}],basis:[{basis:ge()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ee]}],grow:[{grow:It()}],shrink:[{shrink:It()}],order:[{order:["first","last","none",tu,ee]}],"grid-cols":[{"grid-cols":[au]}],"col-start-end":[{col:["auto",{span:["full",tu,ee]},ee]}],"col-start":[{"col-start":ar()}],"col-end":[{"col-end":ar()}],"grid-rows":[{"grid-rows":[au]}],"row-start-end":[{row:["auto",{span:[tu,ee]},ee]}],"row-start":[{"row-start":ar()}],"row-end":[{"row-end":ar()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ee]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ee]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...ht()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ht(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ht(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[g]}],px:[{px:[g]}],py:[{py:[g]}],ps:[{ps:[g]}],pe:[{pe:[g]}],pt:[{pt:[g]}],pr:[{pr:[g]}],pb:[{pb:[g]}],pl:[{pl:[g]}],m:[{m:[S]}],mx:[{mx:[S]}],my:[{my:[S]}],ms:[{ms:[S]}],me:[{me:[S]}],mt:[{mt:[S]}],mr:[{mr:[S]}],mb:[{mb:[S]}],ml:[{ml:[S]}],"space-x":[{"space-x":[D]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[D]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ee,t]}],"min-w":[{"min-w":[ee,t,"min","max","fit"]}],"max-w":[{"max-w":[ee,t,"none","full","min","max","fit","prose",{screen:[lo]},lo]}],h:[{h:[ee,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ee,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ee,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ee,t,"auto","min","max","fit"]}],"font-size":[{text:["base",lo,io]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Vg]}],"font-family":[{font:[au]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ee]}],"line-clamp":[{"line-clamp":["none",Ps,Vg]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",xr,ee]}],"list-image":[{"list-image":["none",ee]}],"list-style-type":[{list:["none","disc","decimal",ee]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[h]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[h]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ro(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",xr,io]}],"underline-offset":[{"underline-offset":["auto",xr,ee]}],"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:ue()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ee]}],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",ee]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[h]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Q(),nR]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",oR]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},iR]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[n]}],"rounded-s":[{"rounded-s":[n]}],"rounded-e":[{"rounded-e":[n]}],"rounded-t":[{"rounded-t":[n]}],"rounded-r":[{"rounded-r":[n]}],"rounded-b":[{"rounded-b":[n]}],"rounded-l":[{"rounded-l":[n]}],"rounded-ss":[{"rounded-ss":[n]}],"rounded-se":[{"rounded-se":[n]}],"rounded-ee":[{"rounded-ee":[n]}],"rounded-es":[{"rounded-es":[n]}],"rounded-tl":[{"rounded-tl":[n]}],"rounded-tr":[{"rounded-tr":[n]}],"rounded-br":[{"rounded-br":[n]}],"rounded-bl":[{"rounded-bl":[n]}],"border-w":[{border:[i]}],"border-w-x":[{"border-x":[i]}],"border-w-y":[{"border-y":[i]}],"border-w-s":[{"border-s":[i]}],"border-w-e":[{"border-e":[i]}],"border-w-t":[{"border-t":[i]}],"border-w-r":[{"border-r":[i]}],"border-w-b":[{"border-b":[i]}],"border-w-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[h]}],"border-style":[{border:[...Ro(),"hidden"]}],"divide-x":[{"divide-x":[i]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[i]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[h]}],"divide-style":[{divide:Ro()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...Ro()]}],"outline-offset":[{"outline-offset":[xr,ee]}],"outline-w":[{outline:[xr,io]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Dr()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[h]}],"ring-offset-w":[{"ring-offset":[xr,io]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",lo,lR]}],"shadow-color":[{shadow:[au]}],opacity:[{opacity:[h]}],"mix-blend":[{"mix-blend":[...Re(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Re()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",lo,ee]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[c]}],saturate:[{saturate:[x]}],sepia:[{sepia:[I]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[c]}],"backdrop-opacity":[{"backdrop-opacity":[h]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[I]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ee]}],duration:[{duration:$e()}],ease:[{ease:["linear","in","out","in-out",ee]}],delay:[{delay:$e()}],animate:[{animate:["none","spin","ping","pulse","bounce",ee]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[L]}],"scale-x":[{"scale-x":[L]}],"scale-y":[{"scale-y":[L]}],rotate:[{rotate:[tu,ee]}],"translate-x":[{"translate-x":[_]}],"translate-y":[{"translate-y":[_]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ee]}],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",ee]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":ue()}],"scroll-mx":[{"scroll-mx":ue()}],"scroll-my":[{"scroll-my":ue()}],"scroll-ms":[{"scroll-ms":ue()}],"scroll-me":[{"scroll-me":ue()}],"scroll-mt":[{"scroll-mt":ue()}],"scroll-mr":[{"scroll-mr":ue()}],"scroll-mb":[{"scroll-mb":ue()}],"scroll-ml":[{"scroll-ml":ue()}],"scroll-p":[{"scroll-p":ue()}],"scroll-px":[{"scroll-px":ue()}],"scroll-py":[{"scroll-py":ue()}],"scroll-ps":[{"scroll-ps":ue()}],"scroll-pe":[{"scroll-pe":ue()}],"scroll-pt":[{"scroll-pt":ue()}],"scroll-pr":[{"scroll-pr":ue()}],"scroll-pb":[{"scroll-pb":ue()}],"scroll-pl":[{"scroll-pl":ue()}],"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",ee]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[xr,io,Vg]}],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"]}}};var LS=KA(fR);function ea(...e){return LS(qc(e))}var PS=F(le(),1);function Oe({className:e,type:t,...a}){return(0,PS.jsx)("input",{type:t,"data-slot":"input",className:ea("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...a})}var Ke=F(K(),1);var AS=F(K(),1);function TS(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ru(...e){return t=>{let a=!1,r=e.map(o=>{let n=TS(o,t);return!a&&typeof n=="function"&&(a=!0),n});if(a)return()=>{for(let o=0;o<r.length;o++){let n=r[o];typeof n=="function"?n():TS(e[o],null)}}}}function vr(...e){return AS.useCallback(ru(...e),e)}var zc=F(le(),1),vR=Symbol.for("react.lazy"),$c=Ke[" use ".trim().toString()];function wR(e){return typeof e=="object"&&e!==null&&"then"in e}function RS(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===vR&&"_payload"in e&&wR(e._payload)}function CR(e){let t=SR(e),a=Ke.forwardRef((r,o)=>{let{children:n,...s}=r;RS(n)&&typeof $c=="function"&&(n=$c(n._payload));let i=Ke.Children.toArray(n),l=i.find(bR);if(l){let u=l.props.children,d=i.map(c=>c===l?Ke.Children.count(u)>1?Ke.Children.only(null):Ke.isValidElement(u)?u.props.children:null:c);return(0,zc.jsx)(t,{...s,ref:o,children:Ke.isValidElement(u)?Ke.cloneElement(u,void 0,d):null})}return(0,zc.jsx)(t,{...s,ref:o,children:n})});return a.displayName=`${e}.Slot`,a}var _S=CR("Slot");function SR(e){let t=Ke.forwardRef((a,r)=>{let{children:o,...n}=a;if(RS(o)&&typeof $c=="function"&&(o=$c(o._payload)),Ke.isValidElement(o)){let s=kR(o),i=IR(n,o.props);return o.type!==Ke.Fragment&&(i.ref=r?ru(r,s):s),Ke.cloneElement(o,i)}return Ke.Children.count(o)>1?Ke.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var LR=Symbol("radix.slottable");function bR(e){return Ke.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===LR}function IR(e,t){let a={...t};for(let r in t){let o=e[r],n=t[r];/^on[A-Z]/.test(r)?o&&n?a[r]=(...i)=>{let l=n(...i);return o(...i),l}:o&&(a[r]=o):r==="style"?a[r]={...o,...n}:r==="className"&&(a[r]=[o,n].filter(Boolean).join(" "))}return{...e,...a}}function kR(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var ES=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,DS=qc,MS=(e,t)=>a=>{var r;if(t?.variants==null)return DS(e,a?.class,a?.className);let{variants:o,defaultVariants:n}=t,s=Object.keys(o).map(u=>{let d=a?.[u],c=n?.[u];if(d===null)return null;let f=ES(d)||ES(c);return o[u][f]}),i=a&&Object.entries(a).reduce((u,d)=>{let[c,f]=d;return f===void 0||(u[c]=f),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:c,className:f,...m}=d;return Object.entries(m).every(v=>{let[w,S]=v;return Array.isArray(S)?S.includes({...n,...i}[w]):{...n,...i}[w]===S})?[...u,c,f]:u},[]);return DS(e,s,l,a?.class,a?.className)};var NS=F(le(),1),PR=MS("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function ot({className:e,variant:t,size:a,asChild:r=!1,...o}){return(0,NS.jsx)(r?_S:"button",{"data-slot":"button",className:ea(PR({variant:t,size:a,className:e})),...o})}var iL=F(K(),1);var $=F(K(),1);var FS=F(K(),1),DR=F(gc(),1);var Ze=F(K(),1);var Wc=F(le(),1);function OS(e){let t=TR(e),a=Ze.forwardRef((r,o)=>{let{children:n,...s}=r,i=Ze.Children.toArray(n),l=i.find(RR);if(l){let u=l.props.children,d=i.map(c=>c===l?Ze.Children.count(u)>1?Ze.Children.only(null):Ze.isValidElement(u)?u.props.children:null:c);return(0,Wc.jsx)(t,{...s,ref:o,children:Ze.isValidElement(u)?Ze.cloneElement(u,void 0,d):null})}return(0,Wc.jsx)(t,{...s,ref:o,children:n})});return a.displayName=`${e}.Slot`,a}function TR(e){let t=Ze.forwardRef((a,r)=>{let{children:o,...n}=a;if(Ze.isValidElement(o)){let s=ER(o),i=_R(n,o.props);return o.type!==Ze.Fragment&&(i.ref=r?ru(r,s):s),Ze.cloneElement(o,i)}return Ze.Children.count(o)>1?Ze.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var AR=Symbol("radix.slottable");function RR(e){return Ze.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===AR}function _R(e,t){let a={...t};for(let r in t){let o=e[r],n=t[r];/^on[A-Z]/.test(r)?o&&n?a[r]=(...i)=>{let l=n(...i);return o(...i),l}:o&&(a[r]=o):r==="style"?a[r]={...o,...n}:r==="className"&&(a[r]=[o,n].filter(Boolean).join(" "))}return{...e,...a}}function ER(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var BS=F(le(),1),MR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],As=MR.reduce((e,t)=>{let a=OS(`Primitive.${t}`),r=FS.forwardRef((o,n)=>{let{asChild:s,...i}=o,l=s?a:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),(0,BS.jsx)(l,{...i,ref:n})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});var Vt=F(K(),1);var US=F(K(),1),ou=globalThis?.document?US.useLayoutEffect:()=>{};var VS=F(K(),1);function NR(e,t){return VS.useReducer((a,r)=>t[a][r]??a,e)}var Rs=e=>{let{present:t,children:a}=e,r=OR(t),o=typeof a=="function"?a({present:r.isPresent}):Vt.Children.only(a),n=vr(r.ref,FR(o));return typeof a=="function"||r.isPresent?Vt.cloneElement(o,{ref:n}):null};Rs.displayName="Presence";function OR(e){let[t,a]=Vt.useState(),r=Vt.useRef(null),o=Vt.useRef(e),n=Vt.useRef("none"),s=e?"mounted":"unmounted",[i,l]=NR(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return Vt.useEffect(()=>{let u=Gc(r.current);n.current=i==="mounted"?u:"none"},[i]),ou(()=>{let u=r.current,d=o.current;if(d!==e){let f=n.current,m=Gc(u);e?l("MOUNT"):m==="none"||u?.display==="none"?l("UNMOUNT"):l(d&&f!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),ou(()=>{if(t){let u,d=t.ownerDocument.defaultView??window,c=m=>{let w=Gc(r.current).includes(CSS.escape(m.animationName));if(m.target===t&&w&&(l("ANIMATION_END"),!o.current)){let S=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},f=m=>{m.target===t&&(n.current=Gc(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:Vt.useCallback(u=>{r.current=u?getComputedStyle(u):null,a(u)},[])}}function Gc(e){return e?.animationName||"none"}function FR(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var wr=F(K(),1),jS=F(le(),1);function qS(e,t=[]){let a=[];function r(n,s){let i=wr.createContext(s),l=a.length;a=[...a,s];let u=c=>{let{scope:f,children:m,...v}=c,w=f?.[e]?.[l]||i,S=wr.useMemo(()=>v,Object.values(v));return(0,jS.jsx)(w.Provider,{value:S,children:m})};u.displayName=n+"Provider";function d(c,f){let m=f?.[e]?.[l]||i,v=wr.useContext(m);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${c}\` must be used within \`${n}\``)}return[u,d]}let o=()=>{let n=a.map(s=>wr.createContext(s));return function(i){let l=i?.[e]||n;return wr.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return o.scopeName=e,[r,BR(o,...t)]}function BR(...e){let t=e[0];if(e.length===1)return t;let a=()=>{let r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(n){let s=r.reduce((i,{useScope:l,scopeName:u})=>{let c=l(n)[`__scope${u}`];return{...i,...c}},{});return wr.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return a.scopeName=t.scopeName,a}var _s=F(K(),1);function uo(e){let t=_s.useRef(e);return _s.useEffect(()=>{t.current=e}),_s.useMemo(()=>(...a)=>t.current?.(...a),[])}var Kc=F(K(),1),UR=F(le(),1),VR=Kc.createContext(void 0);function HS(e){let t=Kc.useContext(VR);return e||t||"ltr"}function zS(e,[t,a]){return Math.min(a,Math.max(t,e))}var zO=!!(typeof window<"u"&&window.document&&window.document.createElement);function co(e,t,{checkForDefaultPrevented:a=!0}={}){return function(o){if(e?.(o),a===!1||!o.defaultPrevented)return t?.(o)}}var WS=F(K(),1),pe=F(le(),1);function jR(e,t){return WS.useReducer((a,r)=>t[a][r]??a,e)}var qg="ScrollArea",[GS,tF]=qS(qg),[qR,xa]=GS(qg),KS=$.forwardRef((e,t)=>{let{__scopeScrollArea:a,type:r="hover",dir:o,scrollHideDelay:n=600,...s}=e,[i,l]=$.useState(null),[u,d]=$.useState(null),[c,f]=$.useState(null),[m,v]=$.useState(null),[w,S]=$.useState(null),[h,g]=$.useState(0),[x,L]=$.useState(0),[I,k]=$.useState(!1),[D,_]=$.useState(!1),V=vr(t,ge=>l(ge)),j=HS(o);return(0,pe.jsx)(qR,{scope:a,type:r,dir:j,scrollHideDelay:n,scrollArea:i,viewport:u,onViewportChange:d,content:c,onContentChange:f,scrollbarX:m,onScrollbarXChange:v,scrollbarXEnabled:I,onScrollbarXEnabledChange:k,scrollbarY:w,onScrollbarYChange:S,scrollbarYEnabled:D,onScrollbarYEnabledChange:_,onCornerWidthChange:g,onCornerHeightChange:L,children:(0,pe.jsx)(As.div,{dir:j,...s,ref:V,style:{position:"relative","--radix-scroll-area-corner-width":h+"px","--radix-scroll-area-corner-height":x+"px",...e.style}})})});KS.displayName=qg;var XS="ScrollAreaViewport",QS=$.forwardRef((e,t)=>{let{__scopeScrollArea:a,children:r,nonce:o,...n}=e,s=xa(XS,a),i=$.useRef(null),l=vr(t,i,s.onViewportChange);return(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),(0,pe.jsx)(As.div,{"data-radix-scroll-area-viewport":"",...n,ref:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:(0,pe.jsx)("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});QS.displayName=XS;var $a="ScrollAreaScrollbar",Hg=$.forwardRef((e,t)=>{let{forceMount:a,...r}=e,o=xa($a,e.__scopeScrollArea),{onScrollbarXEnabledChange:n,onScrollbarYEnabledChange:s}=o,i=e.orientation==="horizontal";return $.useEffect(()=>(i?n(!0):s(!0),()=>{i?n(!1):s(!1)}),[i,n,s]),o.type==="hover"?(0,pe.jsx)(HR,{...r,ref:t,forceMount:a}):o.type==="scroll"?(0,pe.jsx)(zR,{...r,ref:t,forceMount:a}):o.type==="auto"?(0,pe.jsx)(JS,{...r,ref:t,forceMount:a}):o.type==="always"?(0,pe.jsx)(zg,{...r,ref:t}):null});Hg.displayName=$a;var HR=$.forwardRef((e,t)=>{let{forceMount:a,...r}=e,o=xa($a,e.__scopeScrollArea),[n,s]=$.useState(!1);return $.useEffect(()=>{let i=o.scrollArea,l=0;if(i){let u=()=>{window.clearTimeout(l),s(!0)},d=()=>{l=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return i.addEventListener("pointerenter",u),i.addEventListener("pointerleave",d),()=>{window.clearTimeout(l),i.removeEventListener("pointerenter",u),i.removeEventListener("pointerleave",d)}}},[o.scrollArea,o.scrollHideDelay]),(0,pe.jsx)(Rs,{present:a||n,children:(0,pe.jsx)(JS,{"data-state":n?"visible":"hidden",...r,ref:t})})}),zR=$.forwardRef((e,t)=>{let{forceMount:a,...r}=e,o=xa($a,e.__scopeScrollArea),n=e.orientation==="horizontal",s=Yc(()=>l("SCROLL_END"),100),[i,l]=jR("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return $.useEffect(()=>{if(i==="idle"){let u=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(u)}},[i,o.scrollHideDelay,l]),$.useEffect(()=>{let u=o.viewport,d=n?"scrollLeft":"scrollTop";if(u){let c=u[d],f=()=>{let m=u[d];c!==m&&(l("SCROLL"),s()),c=m};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[o.viewport,n,l,s]),(0,pe.jsx)(Rs,{present:a||i!=="hidden",children:(0,pe.jsx)(zg,{"data-state":i==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:co(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:co(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),JS=$.forwardRef((e,t)=>{let a=xa($a,e.__scopeScrollArea),{forceMount:r,...o}=e,[n,s]=$.useState(!1),i=e.orientation==="horizontal",l=Yc(()=>{if(a.viewport){let u=a.viewport.offsetWidth<a.viewport.scrollWidth,d=a.viewport.offsetHeight<a.viewport.scrollHeight;s(i?u:d)}},10);return Es(a.viewport,l),Es(a.content,l),(0,pe.jsx)(Rs,{present:r||n,children:(0,pe.jsx)(zg,{"data-state":n?"visible":"hidden",...o,ref:t})})}),zg=$.forwardRef((e,t)=>{let{orientation:a="vertical",...r}=e,o=xa($a,e.__scopeScrollArea),n=$.useRef(null),s=$.useRef(0),[i,l]=$.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=tL(i.viewport,i.content),d={...r,sizes:i,onSizesChange:l,hasThumb:u>0&&u<1,onThumbChange:f=>n.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function c(f,m){return QR(f,s.current,i,m)}return a==="horizontal"?(0,pe.jsx)($R,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&n.current){let f=o.viewport.scrollLeft,m=$S(f,i,o.dir);n.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollLeft=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollLeft=c(f,o.dir))}}):a==="vertical"?(0,pe.jsx)(WR,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&n.current){let f=o.viewport.scrollTop,m=$S(f,i);n.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollTop=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollTop=c(f))}}):null}),$R=$.forwardRef((e,t)=>{let{sizes:a,onSizesChange:r,...o}=e,n=xa($a,e.__scopeScrollArea),[s,i]=$.useState(),l=$.useRef(null),u=vr(t,l,n.onScrollbarXChange);return $.useEffect(()=>{l.current&&i(getComputedStyle(l.current))},[l]),(0,pe.jsx)(ZS,{"data-orientation":"horizontal",...o,ref:u,sizes:a,style:{bottom:0,left:n.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:n.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Jc(a)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,c)=>{if(n.viewport){let f=n.viewport.scrollLeft+d.deltaX;e.onWheelScroll(f),rL(f,c)&&d.preventDefault()}},onResize:()=>{l.current&&n.viewport&&s&&r({content:n.viewport.scrollWidth,viewport:n.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Qc(s.paddingLeft),paddingEnd:Qc(s.paddingRight)}})}})}),WR=$.forwardRef((e,t)=>{let{sizes:a,onSizesChange:r,...o}=e,n=xa($a,e.__scopeScrollArea),[s,i]=$.useState(),l=$.useRef(null),u=vr(t,l,n.onScrollbarYChange);return $.useEffect(()=>{l.current&&i(getComputedStyle(l.current))},[l]),(0,pe.jsx)(ZS,{"data-orientation":"vertical",...o,ref:u,sizes:a,style:{top:0,right:n.dir==="ltr"?0:void 0,left:n.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Jc(a)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,c)=>{if(n.viewport){let f=n.viewport.scrollTop+d.deltaY;e.onWheelScroll(f),rL(f,c)&&d.preventDefault()}},onResize:()=>{l.current&&n.viewport&&s&&r({content:n.viewport.scrollHeight,viewport:n.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Qc(s.paddingTop),paddingEnd:Qc(s.paddingBottom)}})}})}),[GR,YS]=GS($a),ZS=$.forwardRef((e,t)=>{let{__scopeScrollArea:a,sizes:r,hasThumb:o,onThumbChange:n,onThumbPointerUp:s,onThumbPointerDown:i,onThumbPositionChange:l,onDragScroll:u,onWheelScroll:d,onResize:c,...f}=e,m=xa($a,a),[v,w]=$.useState(null),S=vr(t,V=>w(V)),h=$.useRef(null),g=$.useRef(""),x=m.viewport,L=r.content-r.viewport,I=uo(d),k=uo(l),D=Yc(c,10);function _(V){if(h.current){let j=V.clientX-h.current.left,ge=V.clientY-h.current.top;u({x:j,y:ge})}}return $.useEffect(()=>{let V=j=>{let ge=j.target;v?.contains(ge)&&I(j,L)};return document.addEventListener("wheel",V,{passive:!1}),()=>document.removeEventListener("wheel",V,{passive:!1})},[x,v,L,I]),$.useEffect(k,[r,k]),Es(v,D),Es(m.content,D),(0,pe.jsx)(GR,{scope:a,scrollbar:v,hasThumb:o,onThumbChange:uo(n),onThumbPointerUp:uo(s),onThumbPositionChange:k,onThumbPointerDown:uo(i),children:(0,pe.jsx)(As.div,{...f,ref:S,style:{position:"absolute",...f.style},onPointerDown:co(e.onPointerDown,V=>{V.button===0&&(V.target.setPointerCapture(V.pointerId),h.current=v.getBoundingClientRect(),g.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),_(V))}),onPointerMove:co(e.onPointerMove,_),onPointerUp:co(e.onPointerUp,V=>{let j=V.target;j.hasPointerCapture(V.pointerId)&&j.releasePointerCapture(V.pointerId),document.body.style.webkitUserSelect=g.current,m.viewport&&(m.viewport.style.scrollBehavior=""),h.current=null})})})}),Xc="ScrollAreaThumb",$g=$.forwardRef((e,t)=>{let{forceMount:a,...r}=e,o=YS(Xc,e.__scopeScrollArea);return(0,pe.jsx)(Rs,{present:a||o.hasThumb,children:(0,pe.jsx)(KR,{ref:t,...r})})}),KR=$.forwardRef((e,t)=>{let{__scopeScrollArea:a,style:r,...o}=e,n=xa(Xc,a),s=YS(Xc,a),{onThumbPositionChange:i}=s,l=vr(t,c=>s.onThumbChange(c)),u=$.useRef(void 0),d=Yc(()=>{u.current&&(u.current(),u.current=void 0)},100);return $.useEffect(()=>{let c=n.viewport;if(c){let f=()=>{if(d(),!u.current){let m=JR(c,i);u.current=m,i()}};return i(),c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)}},[n.viewport,d,i]),(0,pe.jsx)(As.div,{"data-state":s.hasThumb?"visible":"hidden",...o,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:co(e.onPointerDownCapture,c=>{let m=c.target.getBoundingClientRect(),v=c.clientX-m.left,w=c.clientY-m.top;s.onThumbPointerDown({x:v,y:w})}),onPointerUp:co(e.onPointerUp,s.onThumbPointerUp)})});$g.displayName=Xc;var Wg="ScrollAreaCorner",eL=$.forwardRef((e,t)=>{let a=xa(Wg,e.__scopeScrollArea),r=!!(a.scrollbarX&&a.scrollbarY);return a.type!=="scroll"&&r?(0,pe.jsx)(XR,{...e,ref:t}):null});eL.displayName=Wg;var XR=$.forwardRef((e,t)=>{let{__scopeScrollArea:a,...r}=e,o=xa(Wg,a),[n,s]=$.useState(0),[i,l]=$.useState(0),u=!!(n&&i);return Es(o.scrollbarX,()=>{let d=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(d),l(d)}),Es(o.scrollbarY,()=>{let d=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(d),s(d)}),u?(0,pe.jsx)(As.div,{...r,ref:t,style:{width:n,height:i,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Qc(e){return e?parseInt(e,10):0}function tL(e,t){let a=e/t;return isNaN(a)?0:a}function Jc(e){let t=tL(e.viewport,e.content),a=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-a)*t;return Math.max(r,18)}function QR(e,t,a,r="ltr"){let o=Jc(a),n=o/2,s=t||n,i=o-s,l=a.scrollbar.paddingStart+s,u=a.scrollbar.size-a.scrollbar.paddingEnd-i,d=a.content-a.viewport,c=r==="ltr"?[0,d]:[d*-1,0];return aL([l,u],c)(e)}function $S(e,t,a="ltr"){let r=Jc(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,n=t.scrollbar.size-o,s=t.content-t.viewport,i=n-r,l=a==="ltr"?[0,s]:[s*-1,0],u=zS(e,l);return aL([0,s],[0,i])(u)}function aL(e,t){return a=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(a-e[0])}}function rL(e,t){return e>0&&e<t}var JR=(e,t=()=>{})=>{let a={left:e.scrollLeft,top:e.scrollTop},r=0;return(function o(){let n={left:e.scrollLeft,top:e.scrollTop},s=a.left!==n.left,i=a.top!==n.top;(s||i)&&t(),a=n,r=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(r)};function Yc(e,t){let a=uo(e),r=$.useRef(0);return $.useEffect(()=>()=>window.clearTimeout(r.current),[]),$.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(a,t)},[a,t])}function Es(e,t){let a=uo(t);ou(()=>{let r=0;if(e){let o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(a)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,a])}var oL=KS,nL=QS;var sL=eL;var fo=F(le(),1),Gg=iL.forwardRef(({className:e,children:t,...a},r)=>(0,fo.jsxs)(oL,{"data-slot":"scroll-area",className:ea("relative",e),...a,children:[(0,fo.jsx)(nL,{ref:r,"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),(0,fo.jsx)(ZR,{}),(0,fo.jsx)(sL,{})]}));Gg.displayName="ScrollArea";function ZR({className:e,orientation:t="vertical",...a}){return(0,fo.jsx)(Hg,{"data-slot":"scroll-area-scrollbar",orientation:t,className:ea("flex touch-none p-px transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...a,children:(0,fo.jsx)($g,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}var ef=F(K());var lL=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),e_=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,r)=>r?r.toUpperCase():a.toLowerCase()),Kg=e=>{let t=e_(e);return t.charAt(0).toUpperCase()+t.slice(1)},Zc=(...e)=>e.filter((t,a,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===a).join(" ").trim(),uL=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var nu=F(K());var dL={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"};var cL=(0,nu.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:r,className:o="",children:n,iconNode:s,...i},l)=>(0,nu.createElement)("svg",{ref:l,...dL,width:t,height:t,stroke:e,strokeWidth:r?Number(a)*24/Number(t):a,className:Zc("lucide",o),...!n&&!uL(i)&&{"aria-hidden":"true"},...i},[...s.map(([u,d])=>(0,nu.createElement)(u,d)),...Array.isArray(n)?n:[n]]));var U=(e,t)=>{let a=(0,ef.forwardRef)(({className:r,...o},n)=>(0,ef.createElement)(cL,{ref:n,iconNode:t,className:Zc(`lucide-${lL(Kg(e))}`,`lucide-${e}`,r),...o}));return a.displayName=Kg(e),a};var t_=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],su=U("activity",t_);var a_=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Ds=U("arrow-left",a_);var r_=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],iu=U("arrow-up",r_);var o_=[["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"}]],lu=U("calendar",o_);var n_=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],uu=U("chevron-down",n_);var s_=[["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"}]],Aa=U("circle-alert",s_);var i_=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],nt=U("circle-check",i_);var l_=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Ra=U("circle-x",l_);var u_=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],mn=U("clock",u_);var d_=[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]],Cr=U("command",d_);var c_=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],Sr=U("corner-down-left",c_);var f_=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],hn=U("credit-card",f_);var p_=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],gn=U("crown",p_);var m_=[["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"}]],yn=U("dollar-sign",m_);var h_=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],du=U("download",h_);var g_=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],xn=U("file-spreadsheet",g_);var y_=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],Ms=U("key",y_);var x_=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],cu=U("laptop",x_);var v_=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ct=U("loader-circle",v_);var w_=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],Ns=U("mail",w_);var C_=[["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"}]],Os=U("map-pin",C_);var S_=[["path",{d:"M5 12h14",key:"1ays0h"}]],vn=U("minus",S_);var L_=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],fu=U("paperclip",L_);var b_=[["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"}]],Fs=U("refresh-cw",b_);var I_=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],wn=U("search",I_);var k_=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],Bs=U("shield",k_);var P_=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],pu=U("smartphone",P_);var T_=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],ta=U("sparkles",T_);var A_=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],jt=U("square-pen",A_);var R_=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],mu=U("trending-up",R_);var __=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Us=U("users",__);var E_=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],_a=U("x",E_);var D_=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],hu=U("zap",D_);var yu=F(le(),1),Wa=F(K(),1);var fL=F(K(),1),Vs=(0,fL.createContext)({});var pL=F(K(),1);function po(e){let t=(0,pL.useRef)(null);return t.current===null&&(t.current=e()),t.current}var Qg=F(le(),1),xL=F(K(),1),Cn=F(K(),1);var mL=F(K(),1),mo=(0,mL.createContext)(null);var gL=F(le(),1),tf=F(K(),1),Lr=F(K(),1);var hL=F(K(),1),js=(0,hL.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});var Xg=class extends tf.Component{getSnapshotBeforeUpdate(t){let a=this.props.childRef.current;if(a&&t.isPresent&&!this.props.isPresent){let r=this.props.sizeRef.current;r.height=a.offsetHeight||0,r.width=a.offsetWidth||0,r.top=a.offsetTop,r.left=a.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}};function yL({children:e,isPresent:t}){let a=(0,Lr.useId)(),r=(0,Lr.useRef)(null),o=(0,Lr.useRef)({width:0,height:0,top:0,left:0}),{nonce:n}=(0,Lr.useContext)(js);return(0,Lr.useInsertionEffect)(()=>{let{width:s,height:i,top:l,left:u}=o.current;if(t||!r.current||!s||!i)return;r.current.dataset.motionPopId=a;let d=document.createElement("style");return n&&(d.nonce=n),document.head.appendChild(d),d.sheet&&d.sheet.insertRule(`
16
- [data-motion-pop-id="${a}"] {
20
+ });`,_s=class{constructor(t,r){var a;if(this.accessTokenValue=null,this.apiKey=null,this._manuallySetToken=!1,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=Ul,this.transport=null,this.heartbeatIntervalMs=md.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=gg,this.ref=0,this.reconnectTimer=null,this.vsn=dg,this.logger=gg,this.conn=null,this.sendBuffer=[],this.serializer=new Vl,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._heartbeatSentAt=null,this._resolveFetch=o=>o?(...n)=>o(...n):(...n)=>fetch(...n),!(!((a=r?.params)===null||a===void 0)&&a.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=r.params.apikey,this.endPoint=`${t}/${pd.websocket}`,this.httpEndpoint=hd(t),this._initializeOptions(r),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(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=ug.createWebSocket(this.endpointURL())}catch(t){this._setConnectionState("disconnected");let r=t.message;throw r.includes("Node.js")?new Error(`${r}
21
+
22
+ To use Realtime in Node.js, you need to provide a WebSocket implementation:
23
+
24
+ Option 1: Use Node.js 22+ which has native WebSocket support
25
+ Option 2: Install and provide the "ws" package:
26
+
27
+ npm install ws
28
+
29
+ import ws from "ws"
30
+ const client = new RealtimeClient(url, {
31
+ ...options,
32
+ transport: ws
33
+ })`):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){let a=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(a),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){let r=await t.unsubscribe();return this.channels.length===0&&this.disconnect(),r}async removeAllChannels(){let t=await Promise.all(this.channels.map(r=>r.unsubscribe()));return this.channels=[],this.disconnect(),t}log(t,r,a){this.logger(t,r,a)}connectionState(){switch(this.conn&&this.conn.readyState){case La.connecting:return po.Connecting;case La.open:return po.Open;case La.closing:return po.Closing;default:return po.Closed}}isConnected(){return this.connectionState()===po.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(t,r={config:{}}){let a=`realtime:${t}`,o=this.getChannels().find(n=>n.topic===a);if(o)return o;{let n=new Ts(`realtime:${t}`,r,this);return this.channels.push(n),n}}push(t){let{topic:r,event:a,payload:o,ref:n}=t,s=()=>{this.encode(t,i=>{var l;(l=this.conn)===null||l===void 0||l.send(i)})};this.log("push",`${r} ${a} (${n})`,o),this.isConnected()?s():this.sendBuffer.push(s)}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(sS,"heartbeat timeout"),setTimeout(()=>{var r;this.isConnected()||(r=this.reconnectTimer)===null||r===void 0||r.scheduleTimeout()},md.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(a=>a.topic===t&&(a._isJoined()||a._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){let u=this._heartbeatSentAt?Date.now()-this._heartbeatSentAt:void 0;try{this.heartbeatCallback(r.payload.status==="ok"?"ok":"error",u)}catch(c){this.log("error","error in heartbeat callback",c)}this._heartbeatSentAt=null,this.pendingHeartbeatRef=null}let{topic:a,event:o,payload:n,ref:s}=r,i=s?`(${s})`:"",l=n.status||"";this.log("receive",`${l} ${a} ${o} ${i}`.trim(),n),this.channels.filter(u=>u._isMember(a)).forEach(u=>u._trigger(o,n,s)),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===La.open&&this._onConnOpen())}_teardownConnection(){if(this.conn){if(this.conn.readyState===La.open||this.conn.readyState===La.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");let 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)}_triggerChanError(){this.channels.forEach(t=>t._trigger(rr.error))}_appendParams(t,r){if(Object.keys(r).length===0)return t;let a=t.match(/\?/)?"&":"?",o=new URLSearchParams(r);return`${t}${a}${o}`}_workerObjectUrl(t){let r;if(t)r=t;else{let a=new Blob([B_],{type:"application/javascript"});r=URL.createObjectURL(a)}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,a=!1;if(t)r=t,a=!0;else if(this.accessToken)try{r=await this.accessToken()}catch(o){this.log("error","Error fetching access token from callback",o),r=this.accessTokenValue}else r=this.accessTokenValue;a?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(o=>{let n={access_token:r,version:oS};r&&o.updateJoinPayload(n),o.joinedOnce&&o._isJoined()&&o._push(rr.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(a=>{try{a(r)}catch(o){this.log("error",`error in ${t} callback`,o)}})}catch(a){this.log("error",`error triggering ${t} callbacks`,a)}}_setupReconnectionTimer(){this.reconnectTimer=new sn(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},md.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(t){var r,a,o,n,s,i,l,u,c,d,f,h;switch(this.transport=(r=t?.transport)!==null&&r!==void 0?r:null,this.timeout=(a=t?.timeout)!==null&&a!==void 0?a:Ul,this.heartbeatIntervalMs=(o=t?.heartbeatIntervalMs)!==null&&o!==void 0?o:md.HEARTBEAT_INTERVAL,this.worker=(n=t?.worker)!==null&&n!==void 0?n:!1,this.accessToken=(s=t?.accessToken)!==null&&s!==void 0?s:null,this.heartbeatCallback=(i=t?.heartbeatCallback)!==null&&i!==void 0?i:gg,this.vsn=(l=t?.vsn)!==null&&l!==void 0?l:dg,t?.params&&(this.params=t.params),t?.logger&&(this.logger=t.logger),(t?.logLevel||t?.log_level)&&(this.logLevel=t.logLevel||t.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(u=t?.reconnectAfterMs)!==null&&u!==void 0?u:(x=>M_[x-1]||O_),this.vsn){case cg:this.encode=(c=t?.encode)!==null&&c!==void 0?c:((x,w)=>w(JSON.stringify(x))),this.decode=(d=t?.decode)!==null&&d!==void 0?d:((x,w)=>w(JSON.parse(x)));break;case nS:this.encode=(f=t?.encode)!==null&&f!==void 0?f:this.serializer.encode.bind(this.serializer),this.decode=(h=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?.workerUrl}}};var jl=class extends Error{constructor(e,t){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)&&t.icebergType?.includes("CommitState")===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function F_(e,t,r){let a=new URL(t,e);if(r)for(let[o,n]of Object.entries(r))n!==void 0&&a.searchParams.set(o,n);return a.toString()}async function U_(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 V_(e){let t=e.fetchImpl??globalThis.fetch;return{async request({method:r,path:a,query:o,body:n,headers:s}){let i=F_(e.baseUrl,a,o),l=await U_(e.auth),u=await t(i,{method:r,headers:{...n?{"Content-Type":"application/json"}:{},...l,...s},body:n?JSON.stringify(n):void 0}),c=await u.text(),d=(u.headers.get("content-type")||"").includes("application/json"),f=d&&c?JSON.parse(c):c;if(!u.ok){let h=d?f:void 0,x=h?.error;throw new jl(x?.message??`Request failed with status ${u.status}`,{status:u.status,icebergType:x?.type,icebergCode:x?.code,details:h})}return{status:u.status,headers:u.headers,data:f}}}}function gd(e){return e.join("")}var j_=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){let t=e?{parent:gd(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(a=>({namespace:a}))}async createNamespace(e,t){let r={namespace:e.namespace,properties: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/${gd(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${gd(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${gd(e.namespace)}`}),!0}catch(t){if(t instanceof jl&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(r){if(r instanceof jl&&r.status===409)return;throw r}}};function As(e){return e.join("")}var q_=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/${As(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){let r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${As(e.namespace)}/tables`,body:t,headers:r})).data.metadata}async updateTable(e,t){let r=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${As(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/${As(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String(t?.purge??!1)}})}async loadTable(e){let t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${As(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){let t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${As(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(r){if(r instanceof jl&&r.status===404)return!1;throw r}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(r){if(r instanceof jl&&r.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw r}}},uS=class{constructor(e){let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);let r=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=V_({baseUrl:r,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=e.accessDelegation?.join(","),this.namespaceOps=new j_(this.client,t),this.tableOps=new q_(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)}};var yd=class extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}};function Fe(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var $_=class extends yd{constructor(e,t,r){super(e),this.name="StorageApiError",this.status=t,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},xg=class extends yd{constructor(e,t){super(e),this.name="StorageUnknownError",this.originalError=t}},Cg=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),H_=()=>Response,wg=e=>{if(Array.isArray(e))return e.map(r=>wg(r));if(typeof e=="function"||e!==Object(e))return e;let t={};return Object.entries(e).forEach(([r,a])=>{let o=r.replace(/([-_][a-z])/gi,n=>n.toUpperCase().replace(/[-_]/g,""));t[o]=wg(a)}),t},z_=e=>{if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},W_=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e);function ql(e){"@babel/helpers - typeof";return ql=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},ql(e)}function G_(e,t){if(ql(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t||"default");if(ql(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function K_(e){var t=G_(e,"string");return ql(t)=="symbol"?t:t+""}function X_(e,t,r){return(t=K_(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,a)}return r}function Y(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?cS(Object(r),!0).forEach(function(a){X_(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cS(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}var yg=e=>{var t;return e.msg||e.message||e.error_description||(typeof e.error=="string"?e.error:(t=e.error)===null||t===void 0?void 0:t.message)||JSON.stringify(e)},J_=async(e,t,r)=>{e instanceof await H_()&&!r?.noResolveJson?e.json().then(a=>{let o=e.status||500,n=a?.statusCode||o+"";t(new $_(yg(a),o,n))}).catch(a=>{t(new xg(yg(a),a))}):t(new xg(yg(e),e))},Q_=(e,t,r,a)=>{let o={method:e,headers:t?.headers||{}};return e==="GET"||!a?o:(z_(a)?(o.headers=Y({"Content-Type":"application/json"},t?.headers),o.body=JSON.stringify(a)):o.body=a,t?.duplex&&(o.duplex=t.duplex),Y(Y({},o),r))};async function Hl(e,t,r,a,o,n){return new Promise((s,i)=>{e(r,Q_(t,a,o,n)).then(l=>{if(!l.ok)throw l;return a?.noResolveJson?l:l.json()}).then(l=>s(l)).catch(l=>J_(l,i,a))})}async function $l(e,t,r,a){return Hl(e,"GET",t,r,a)}async function Nr(e,t,r,a,o){return Hl(e,"POST",t,a,o,r)}async function Sg(e,t,r,a,o){return Hl(e,"PUT",t,a,o,r)}async function Y_(e,t,r,a){return Hl(e,"HEAD",t,Y(Y({},r),{},{noResolveJson:!0}),a)}async function bg(e,t,r,a,o){return Hl(e,"DELETE",t,a,o,r)}var Z_=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(Fe(t))return{data:null,error:t};throw t}}},pS;pS=Symbol.toStringTag;var eA=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[pS]="BlobDownloadBuilder",this.promise=null}asStream(){return new Z_(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(Fe(t))return{data:null,error:t};throw t}}},tA={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},dS={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1},rA=class{constructor(e,t={},r,a){this.shouldThrowOnError=!1,this.url=e,this.headers=t,this.bucketId=r,this.fetch=Cg(a)}throwOnError(){return this.shouldThrowOnError=!0,this}async uploadOrUpdate(e,t,r,a){var o=this;try{let n,s=Y(Y({},dS),a),i=Y(Y({},o.headers),e==="POST"&&{"x-upsert":String(s.upsert)}),l=s.metadata;typeof Blob<"u"&&r instanceof Blob?(n=new FormData,n.append("cacheControl",s.cacheControl),l&&n.append("metadata",o.encodeMetadata(l)),n.append("",r)):typeof FormData<"u"&&r instanceof FormData?(n=r,n.has("cacheControl")||n.append("cacheControl",s.cacheControl),l&&!n.has("metadata")&&n.append("metadata",o.encodeMetadata(l))):(n=r,i["cache-control"]=`max-age=${s.cacheControl}`,i["content-type"]=s.contentType,l&&(i["x-metadata"]=o.toBase64(o.encodeMetadata(l))),(typeof ReadableStream<"u"&&n instanceof ReadableStream||n&&typeof n=="object"&&"pipe"in n&&typeof n.pipe=="function")&&!s.duplex&&(s.duplex="half")),a?.headers&&(i=Y(Y({},i),a.headers));let u=o._removeEmptyFolders(t),c=o._getFinalPath(u),d=await(e=="PUT"?Sg:Nr)(o.fetch,`${o.url}/object/${c}`,n,Y({headers:i},s?.duplex?{duplex:s.duplex}:{}));return{data:{path:u,id:d.Id,fullPath:d.Key},error:null}}catch(n){if(o.shouldThrowOnError)throw n;if(Fe(n))return{data:null,error:n};throw n}}async upload(e,t,r){return this.uploadOrUpdate("POST",e,t,r)}async uploadToSignedUrl(e,t,r,a){var o=this;let n=o._removeEmptyFolders(e),s=o._getFinalPath(n),i=new URL(o.url+`/object/upload/sign/${s}`);i.searchParams.set("token",t);try{let l,u=Y({upsert:dS.upsert},a),c=Y(Y({},o.headers),{"x-upsert":String(u.upsert)});return typeof Blob<"u"&&r instanceof Blob?(l=new FormData,l.append("cacheControl",u.cacheControl),l.append("",r)):typeof FormData<"u"&&r instanceof FormData?(l=r,l.append("cacheControl",u.cacheControl)):(l=r,c["cache-control"]=`max-age=${u.cacheControl}`,c["content-type"]=u.contentType),{data:{path:n,fullPath:(await Sg(o.fetch,i.toString(),l,{headers:c})).Key},error:null}}catch(l){if(o.shouldThrowOnError)throw l;if(Fe(l))return{data:null,error:l};throw l}}async createSignedUploadUrl(e,t){var r=this;try{let a=r._getFinalPath(e),o=Y({},r.headers);t?.upsert&&(o["x-upsert"]="true");let n=await Nr(r.fetch,`${r.url}/object/upload/sign/${a}`,{},{headers:o}),s=new URL(r.url+n.url),i=s.searchParams.get("token");if(!i)throw new yd("No token returned by API");return{data:{signedUrl:s.toString(),path:e,token:i},error:null}}catch(a){if(r.shouldThrowOnError)throw a;if(Fe(a))return{data:null,error:a};throw a}}async update(e,t,r){return this.uploadOrUpdate("PUT",e,t,r)}async move(e,t,r){var a=this;try{return{data:await Nr(a.fetch,`${a.url}/object/move`,{bucketId:a.bucketId,sourceKey:e,destinationKey:t,destinationBucket:r?.destinationBucket},{headers:a.headers}),error:null}}catch(o){if(a.shouldThrowOnError)throw o;if(Fe(o))return{data:null,error:o};throw o}}async copy(e,t,r){var a=this;try{return{data:{path:(await Nr(a.fetch,`${a.url}/object/copy`,{bucketId:a.bucketId,sourceKey:e,destinationKey:t,destinationBucket:r?.destinationBucket},{headers:a.headers})).Key},error:null}}catch(o){if(a.shouldThrowOnError)throw o;if(Fe(o))return{data:null,error:o};throw o}}async createSignedUrl(e,t,r){var a=this;try{let o=a._getFinalPath(e),n=await Nr(a.fetch,`${a.url}/object/sign/${o}`,Y({expiresIn:t},r?.transform?{transform:r.transform}:{}),{headers:a.headers}),s=r?.download?`&download=${r.download===!0?"":r.download}`:"";return n={signedUrl:encodeURI(`${a.url}${n.signedURL}${s}`)},{data:n,error:null}}catch(o){if(a.shouldThrowOnError)throw o;if(Fe(o))return{data:null,error:o};throw o}}async createSignedUrls(e,t,r){var a=this;try{let o=await Nr(a.fetch,`${a.url}/object/sign/${a.bucketId}`,{expiresIn:t,paths:e},{headers:a.headers}),n=r?.download?`&download=${r.download===!0?"":r.download}`:"";return{data:o.map(s=>Y(Y({},s),{},{signedUrl:s.signedURL?encodeURI(`${a.url}${s.signedURL}${n}`):null})),error:null}}catch(o){if(a.shouldThrowOnError)throw o;if(Fe(o))return{data:null,error:o};throw o}}download(e,t){let r=typeof t?.transform<"u"?"render/image/authenticated":"object",a=this.transformOptsToQueryString(t?.transform||{}),o=a?`?${a}`:"",n=this._getFinalPath(e),s=()=>$l(this.fetch,`${this.url}/${r}/${n}${o}`,{headers:this.headers,noResolveJson:!0});return new eA(s,this.shouldThrowOnError)}async info(e){var t=this;let r=t._getFinalPath(e);try{return{data:wg(await $l(t.fetch,`${t.url}/object/info/${r}`,{headers:t.headers})),error:null}}catch(a){if(t.shouldThrowOnError)throw a;if(Fe(a))return{data:null,error:a};throw a}}async exists(e){var t=this;let r=t._getFinalPath(e);try{return await Y_(t.fetch,`${t.url}/object/${r}`,{headers:t.headers}),{data:!0,error:null}}catch(a){if(t.shouldThrowOnError)throw a;if(Fe(a)&&a instanceof xg){let o=a.originalError;if([400,404].includes(o?.status))return{data:!1,error:a}}throw a}}getPublicUrl(e,t){let r=this._getFinalPath(e),a=[],o=t?.download?`download=${t.download===!0?"":t.download}`:"";o!==""&&a.push(o);let n=typeof t?.transform<"u"?"render/image":"object",s=this.transformOptsToQueryString(t?.transform||{});s!==""&&a.push(s);let i=a.join("&");return i!==""&&(i=`?${i}`),{data:{publicUrl:encodeURI(`${this.url}/${n}/public/${r}${i}`)}}}async remove(e){var t=this;try{return{data:await bg(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Fe(r))return{data:null,error:r};throw r}}async list(e,t,r){var a=this;try{let o=Y(Y(Y({},tA),t),{},{prefix:e||""});return{data:await Nr(a.fetch,`${a.url}/object/list/${a.bucketId}`,o,{headers:a.headers},r),error:null}}catch(o){if(a.shouldThrowOnError)throw o;if(Fe(o))return{data:null,error:o};throw o}}async listV2(e,t){var r=this;try{let a=Y({},e);return{data:await Nr(r.fetch,`${r.url}/object/list-v2/${r.bucketId}`,a,{headers:r.headers},t),error:null}}catch(a){if(r.shouldThrowOnError)throw a;if(Fe(a))return{data:null,error:a};throw a}}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){let 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("&")}},hS="2.90.1",mS={"X-Client-Info":`storage-js/${hS}`},aA=class{constructor(e,t={},r,a){this.shouldThrowOnError=!1;let o=new URL(e);a?.useNewHostname&&/supabase\.(co|in|red)$/.test(o.hostname)&&!o.hostname.includes("storage.supabase.")&&(o.hostname=o.hostname.replace("supabase.","storage.supabase.")),this.url=o.href.replace(/\/$/,""),this.headers=Y(Y({},mS),t),this.fetch=Cg(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async listBuckets(e){var t=this;try{let r=t.listBucketOptionsToQueryString(e);return{data:await $l(t.fetch,`${t.url}/bucket${r}`,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Fe(r))return{data:null,error:r};throw r}}async getBucket(e){var t=this;try{return{data:await $l(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Fe(r))return{data:null,error:r};throw r}}async createBucket(e,t={public:!1}){var r=this;try{return{data:await Nr(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}),error:null}}catch(a){if(r.shouldThrowOnError)throw a;if(Fe(a))return{data:null,error:a};throw a}}async updateBucket(e,t){var r=this;try{return{data:await Sg(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}),error:null}}catch(a){if(r.shouldThrowOnError)throw a;if(Fe(a))return{data:null,error:a};throw a}}async emptyBucket(e){var t=this;try{return{data:await Nr(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Fe(r))return{data:null,error:r};throw r}}async deleteBucket(e){var t=this;try{return{data:await bg(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Fe(r))return{data:null,error:r};throw r}}listBucketOptionsToQueryString(e){let 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():""}},oA=class{constructor(e,t={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Y(Y({},mS),t),this.fetch=Cg(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async createBucket(e){var t=this;try{return{data:await Nr(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Fe(r))return{data:null,error:r};throw r}}async listBuckets(e){var t=this;try{let r=new URLSearchParams;e?.limit!==void 0&&r.set("limit",e.limit.toString()),e?.offset!==void 0&&r.set("offset",e.offset.toString()),e?.sortColumn&&r.set("sortColumn",e.sortColumn),e?.sortOrder&&r.set("sortOrder",e.sortOrder),e?.search&&r.set("search",e.search);let a=r.toString(),o=a?`${t.url}/bucket?${a}`:`${t.url}/bucket`;return{data:await $l(t.fetch,o,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Fe(r))return{data:null,error:r};throw r}}async deleteBucket(e){var t=this;try{return{data:await bg(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Fe(r))return{data:null,error:r};throw r}}from(e){var t=this;if(!W_(e))throw new yd("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");let r=new uS({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}),a=this.shouldThrowOnError;return new Proxy(r,{get(o,n){let s=o[n];return typeof s!="function"?s:async(...i)=>{try{return{data:await s.apply(o,i),error:null}}catch(l){if(a)throw l;return{data:null,error:l}}}}})}},Lg={"X-Client-Info":`storage-js/${hS}`,"Content-Type":"application/json"},gS=class extends Error{constructor(e){super(e),this.__isStorageVectorsError=!0,this.name="StorageVectorsError"}};function ar(e){return typeof e=="object"&&e!==null&&"__isStorageVectorsError"in e}var vg=class extends gS{constructor(e,t,r){super(e),this.name="StorageVectorsApiError",this.status=t,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},nA=class extends gS{constructor(e,t){super(e),this.name="StorageVectorsUnknownError",this.originalError=t}};var Ig=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);var sA=e=>{if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)};var fS=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),iA=async(e,t,r)=>{if(e&&typeof e=="object"&&"status"in e&&"ok"in e&&typeof e.status=="number"&&!r?.noResolveJson){let a=e.status||500,o=e;if(typeof o.json=="function")o.json().then(n=>{let s=n?.statusCode||n?.code||a+"";t(new vg(fS(n),a,s))}).catch(()=>{let n=a+"";t(new vg(o.statusText||`HTTP ${a} error`,a,n))});else{let n=a+"";t(new vg(o.statusText||`HTTP ${a} error`,a,n))}}else t(new nA(fS(e),e))},lA=(e,t,r,a)=>{let o={method:e,headers:t?.headers||{}};return e==="GET"||!a?o:(sA(a)?(o.headers=Y({"Content-Type":"application/json"},t?.headers),o.body=JSON.stringify(a)):o.body=a,Y(Y({},o),r))};async function uA(e,t,r,a,o,n){return new Promise((s,i)=>{e(r,lA(t,a,o,n)).then(l=>{if(!l.ok)throw l;if(a?.noResolveJson)return l;let u=l.headers.get("content-type");return!u||!u.includes("application/json")?{}:l.json()}).then(l=>s(l)).catch(l=>iA(l,i,a))})}async function or(e,t,r,a,o){return uA(e,"POST",t,a,o,r)}var cA=class{constructor(e,t={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Y(Y({},Lg),t),this.fetch=Ig(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async createIndex(e){var t=this;try{return{data:await or(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{},error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(ar(r))return{data:null,error:r};throw r}}async getIndex(e,t){var r=this;try{return{data:await or(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers}),error:null}}catch(a){if(r.shouldThrowOnError)throw a;if(ar(a))return{data:null,error:a};throw a}}async listIndexes(e){var t=this;try{return{data:await or(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(ar(r))return{data:null,error:r};throw r}}async deleteIndex(e,t){var r=this;try{return{data:await or(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers})||{},error:null}}catch(a){if(r.shouldThrowOnError)throw a;if(ar(a))return{data:null,error:a};throw a}}},dA=class{constructor(e,t={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Y(Y({},Lg),t),this.fetch=Ig(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async putVectors(e){var t=this;try{if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return{data:await or(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{},error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(ar(r))return{data:null,error:r};throw r}}async getVectors(e){var t=this;try{return{data:await or(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(ar(r))return{data:null,error:r};throw r}}async listVectors(e){var t=this;try{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{data:await or(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(ar(r))return{data:null,error:r};throw r}}async queryVectors(e){var t=this;try{return{data:await or(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(ar(r))return{data:null,error:r};throw r}}async deleteVectors(e){var t=this;try{if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return{data:await or(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{},error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(ar(r))return{data:null,error:r};throw r}}},fA=class{constructor(e,t={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Y(Y({},Lg),t),this.fetch=Ig(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async createBucket(e){var t=this;try{return{data:await or(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{},error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(ar(r))return{data:null,error:r};throw r}}async getBucket(e){var t=this;try{return{data:await or(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(ar(r))return{data:null,error:r};throw r}}async listBuckets(e={}){var t=this;try{return{data:await or(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(ar(r))return{data:null,error:r};throw r}}async deleteBucket(e){var t=this;try{return{data:await or(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{},error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(ar(r))return{data:null,error:r};throw r}}},pA=class extends fA{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new hA(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)}},hA=class extends cA{constructor(e,t,r,a){super(e,t,a),this.vectorBucketName=r}async createIndex(e){var t=()=>super.createIndex,r=this;return t().call(r,Y(Y({},e),{},{vectorBucketName:r.vectorBucketName}))}async listIndexes(e={}){var t=()=>super.listIndexes,r=this;return t().call(r,Y(Y({},e),{},{vectorBucketName:r.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,r=this;return t().call(r,r.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,r=this;return t().call(r,r.vectorBucketName,e)}index(e){return new mA(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},mA=class extends dA{constructor(e,t,r,a,o){super(e,t,o),this.vectorBucketName=r,this.indexName=a}async putVectors(e){var t=()=>super.putVectors,r=this;return t().call(r,Y(Y({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async getVectors(e){var t=()=>super.getVectors,r=this;return t().call(r,Y(Y({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,r=this;return t().call(r,Y(Y({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,r=this;return t().call(r,Y(Y({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,r=this;return t().call(r,Y(Y({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}},yS=class extends aA{constructor(e,t={},r,a){super(e,t,r,a)}from(e){return new rA(this.url,this.headers,e,this.fetch)}get vectors(){return new pA(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new oA(this.url+"/iceberg",this.headers,this.fetch)}};var vd="2.90.1";var un=30*1e3,xd=3,wd=xd*un,vS="http://localhost:9999",xS="supabase.auth.token";var wS={"X-Client-Info":`gotrue-js/${vd}`};var zl="X-Supabase-Api-Version",kg={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},SS=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,CS=600*1e3;var ho=class extends Error{constructor(t,r,a){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=a}};function q(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}var Sd=class extends ho{constructor(t,r,a){super(t,r,a),this.name="AuthApiError",this.status=r,this.code=a}};function bS(e){return q(e)&&e.name==="AuthApiError"}var Cr=class extends ho{constructor(t,r){super(t),this.name="AuthUnknownError",this.originalError=r}},Mr=class extends ho{constructor(t,r,a,o){super(t,a,o),this.name=r,this.status=a}},yt=class extends Mr{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}};function LS(e){return q(e)&&e.name==="AuthSessionMissingError"}var Ia=class extends Mr{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}},cn=class extends Mr{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}},dn=class extends Mr{constructor(t,r=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}};function IS(e){return q(e)&&e.name==="AuthImplicitGrantRedirectError"}var Wl=class extends Mr{constructor(t,r=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}},Cd=class extends Mr{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}};var Rs=class extends Mr{constructor(t,r){super(t,"AuthRetryableFetchError",r,void 0)}};function bd(e){return q(e)&&e.name==="AuthRetryableFetchError"}var Gl=class extends Mr{constructor(t,r,a){super(t,"AuthWeakPasswordError",r,"weak_password"),this.reasons=a}};var fn=class extends Mr{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}};var Ld="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),kS=`
34
+ \r=`.split(""),gA=(()=>{let e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<kS.length;t+=1)e[kS[t].charCodeAt(0)]=-2;for(let t=0;t<Ld.length;t+=1)e[Ld[t].charCodeAt(0)]=t;return e})();function PS(e,t,r){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){let a=t.queue>>t.queuedBits-6&63;r(Ld[a]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){let a=t.queue>>t.queuedBits-6&63;r(Ld[a]),t.queuedBits-=6}}function TS(e,t,r){let a=gA[e];if(a>-1)for(t.queue=t.queue<<6|a,t.queuedBits+=6;t.queuedBits>=8;)r(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(a===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function Pg(e){let t=[],r=s=>{t.push(String.fromCodePoint(s))},a={utf8seq:0,codepoint:0},o={queue:0,queuedBits:0},n=s=>{xA(s,a,r)};for(let s=0;s<e.length;s+=1)TS(e.charCodeAt(s),o,n);return t.join("")}function yA(e,t){if(e<=127){t(e);return}else if(e<=2047){t(192|e>>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function vA(e,t){for(let r=0;r<e.length;r+=1){let a=e.charCodeAt(r);if(a>55295&&a<=56319){let o=(a-55296)*1024&65535;a=(e.charCodeAt(r+1)-56320&65535|o)+65536,r+=1}yA(a,t)}}function xA(e,t,r){if(t.utf8seq===0){if(e<=127){r(e);return}for(let a=1;a<6;a+=1)if((e>>7-a&1)===0){t.utf8seq=a;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&r(t.codepoint)}}function mo(e){let t=[],r={queue:0,queuedBits:0},a=o=>{t.push(o)};for(let o=0;o<e.length;o+=1)TS(e.charCodeAt(o),r,a);return new Uint8Array(t)}function _S(e){let t=[];return vA(e,r=>t.push(r)),new Uint8Array(t)}function ka(e){let t=[],r={queue:0,queuedBits:0},a=o=>{t.push(o)};return e.forEach(o=>PS(o,r,a)),PS(null,r,a),t.join("")}function AS(e){return Math.round(Date.now()/1e3)+e}function RS(){return Symbol("auth-callback")}var at=()=>typeof window<"u"&&typeof document<"u",pn={tested:!1,writable:!1},Id=()=>{if(!at())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(pn.tested)return pn.writable;let e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),pn.tested=!0,pn.writable=!0}catch{pn.tested=!0,pn.writable=!1}return pn.writable};function ES(e){let t={},r=new URL(e);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((o,n)=>{t[n]=o})}catch{}return r.searchParams.forEach((a,o)=>{t[o]=a}),t}var kd=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),DS=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",hn=async(e,t,r)=>{await e.setItem(t,JSON.stringify(r))},go=async(e,t)=>{let r=await e.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch{return r}},ct=async(e,t)=>{await e.removeItem(t)},Kl=class e{constructor(){this.promise=new e.promiseConstructor((t,r)=>{this.resolve=t,this.reject=r})}};Kl.promiseConstructor=Promise;function Pd(e){let t=e.split(".");if(t.length!==3)throw new fn("Invalid JWT structure");for(let a=0;a<t.length;a++)if(!SS.test(t[a]))throw new fn("JWT not in base64url format");return{header:JSON.parse(Pg(t[0])),payload:JSON.parse(Pg(t[1])),signature:mo(t[2]),raw:{header:t[0],payload:t[1]}}}async function NS(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function MS(e,t){return new Promise((a,o)=>{(async()=>{for(let n=0;n<1/0;n++)try{let s=await e(n);if(!t(n,null,s)){a(s);return}}catch(s){if(!t(n,s)){o(s);return}}})()})}function wA(e){return("0"+e.toString(16)).substr(-2)}function SA(){let t=new Uint32Array(56);if(typeof crypto>"u"){let r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",a=r.length,o="";for(let n=0;n<56;n++)o+=r.charAt(Math.floor(Math.random()*a));return o}return crypto.getRandomValues(t),Array.from(t,wA).join("")}async function CA(e){let r=new TextEncoder().encode(e),a=await crypto.subtle.digest("SHA-256",r),o=new Uint8Array(a);return Array.from(o).map(n=>String.fromCharCode(n)).join("")}async function bA(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;let r=await CA(e);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function mn(e,t,r=!1){let a=SA(),o=a;r&&(o+="/PASSWORD_RECOVERY"),await hn(e,`${t}-code-verifier`,o);let n=await bA(a);return[n,a===n?"plain":"s256"]}var LA=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function OS(e){let t=e.headers.get(zl);if(!t||!t.match(LA))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function BS(e){if(!e)throw new Error("Missing exp claim");let t=Math.floor(Date.now()/1e3);if(e<=t)throw new Error("JWT has expired")}function FS(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}var IA=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function gn(e){if(!IA.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Td(){let e={};return new Proxy(e,{get:(t,r)=>{if(r==="__isUserNotAvailableProxy")return!0;if(typeof r=="symbol"){let a=r.toString();if(a==="Symbol(Symbol.toPrimitive)"||a==="Symbol(Symbol.toStringTag)"||a==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${r}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function US(e,t){return new Proxy(e,{get:(r,a,o)=>{if(a==="__isInsecureUserWarningProxy")return!0;if(typeof a=="symbol"){let n=a.toString();if(n==="Symbol(Symbol.toPrimitive)"||n==="Symbol(Symbol.toStringTag)"||n==="Symbol(util.inspect.custom)"||n==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(r,a,o)}return!t.value&&typeof a=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),t.value=!0),Reflect.get(r,a,o)}})}function Tg(e){return JSON.parse(JSON.stringify(e))}var yn=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),kA=[502,503,504];async function VS(e){var t;if(!DS(e))throw new Rs(yn(e),0);if(kA.includes(e.status))throw new Rs(yn(e),e.status);let r;try{r=await e.json()}catch(n){throw new Cr(yn(n),n)}let a,o=OS(e);if(o&&o.getTime()>=kg["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?a=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(a=r.error_code),a){if(a==="weak_password")throw new Gl(yn(r),e.status,((t=r.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(a==="session_not_found")throw new yt}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((n,s)=>n&&typeof s=="string",!0))throw new Gl(yn(r),e.status,r.weak_password.reasons);throw new Sd(yn(r),e.status||500,a)}var PA=(e,t,r,a)=>{let o={method:e,headers:t?.headers||{}};return e==="GET"?o:(o.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t?.headers),o.body=JSON.stringify(a),Object.assign(Object.assign({},o),r))};async function X(e,t,r,a){var o;let n=Object.assign({},a?.headers);n[zl]||(n[zl]=kg["2024-01-01"].name),a?.jwt&&(n.Authorization=`Bearer ${a.jwt}`);let s=(o=a?.query)!==null&&o!==void 0?o:{};a?.redirectTo&&(s.redirect_to=a.redirectTo);let i=Object.keys(s).length?"?"+new URLSearchParams(s).toString():"",l=await TA(e,t,r+i,{headers:n,noResolveJson:a?.noResolveJson},{},a?.body);return a?.xform?a?.xform(l):{data:Object.assign({},l),error:null}}async function TA(e,t,r,a,o,n){let s=PA(t,a,o,n),i;try{i=await e(r,Object.assign({},s))}catch(l){throw console.error(l),new Rs(yn(l),0)}if(i.ok||await VS(i),a?.noResolveJson)return i;try{return await i.json()}catch(l){await VS(l)}}function br(e){var t;let r=null;_A(e)&&(r=Object.assign({},e),e.expires_at||(r.expires_at=AS(e.expires_in)));let a=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:r,user:a},error:null}}function _g(e){let t=br(e);return!t.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((r,a)=>r&&typeof a=="string",!0)&&(t.data.weak_password=e.weak_password),t}function Jr(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function jS(e){return{data:e,error:null}}function qS(e){let{action_link:t,email_otp:r,hashed_token:a,redirect_to:o,verification_type:n}=e,s=nn(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),i={action_link:t,email_otp:r,hashed_token:a,redirect_to:o,verification_type:n},l=Object.assign({},s);return{data:{properties:i,user:l},error:null}}function Ag(e){return e}function _A(e){return e.access_token&&e.refresh_token&&e.expires_in}var _d=["global","local","others"];var vn=class{constructor({url:t="",headers:r={},fetch:a}){this.url=t,this.headers=r,this.fetch=kd(a),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)}}async signOut(t,r=_d[0]){if(_d.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${_d.join(", ")}`);try{return await X(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(a){if(q(a))return{data:null,error:a};throw a}}async inviteUserByEmail(t,r={}){try{return await X(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:Jr})}catch(a){if(q(a))return{data:{user:null},error:a};throw a}}async generateLink(t){try{let{options:r}=t,a=nn(t,["options"]),o=Object.assign(Object.assign({},a),r);return"newEmail"in a&&(o.new_email=a?.newEmail,delete o.newEmail),await X(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:o,headers:this.headers,xform:qS,redirectTo:r?.redirectTo})}catch(r){if(q(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(t){try{return await X(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:Jr})}catch(r){if(q(r))return{data:{user:null},error:r};throw r}}async listUsers(t){var r,a,o,n,s,i,l;try{let u={nextPage:null,lastPage:0,total:0},c=await X(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(a=(r=t?.page)===null||r===void 0?void 0:r.toString())!==null&&a!==void 0?a:"",per_page:(n=(o=t?.perPage)===null||o===void 0?void 0:o.toString())!==null&&n!==void 0?n:""},xform:Ag});if(c.error)throw c.error;let d=await c.json(),f=(s=c.headers.get("x-total-count"))!==null&&s!==void 0?s:0,h=(l=(i=c.headers.get("link"))===null||i===void 0?void 0:i.split(","))!==null&&l!==void 0?l:[];return h.length>0&&(h.forEach(x=>{let w=parseInt(x.split(";")[0].split("=")[1].substring(0,1)),C=JSON.parse(x.split(";")[1].split("=")[1]);u[`${C}Page`]=w}),u.total=parseInt(f)),{data:Object.assign(Object.assign({},d),u),error:null}}catch(u){if(q(u))return{data:{users:[]},error:u};throw u}}async getUserById(t){gn(t);try{return await X(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:Jr})}catch(r){if(q(r))return{data:{user:null},error:r};throw r}}async updateUserById(t,r){gn(t);try{return await X(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:r,headers:this.headers,xform:Jr})}catch(a){if(q(a))return{data:{user:null},error:a};throw a}}async deleteUser(t,r=!1){gn(t);try{return await X(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:r},xform:Jr})}catch(a){if(q(a))return{data:{user:null},error:a};throw a}}async _listFactors(t){gn(t.userId);try{let{data:r,error:a}=await X(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:o=>({data:{factors:o},error:null})});return{data:r,error:a}}catch(r){if(q(r))return{data:null,error:r};throw r}}async _deleteFactor(t){gn(t.userId),gn(t.id);try{return{data:await X(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(r){if(q(r))return{data:null,error:r};throw r}}async _listOAuthClients(t){var r,a,o,n,s,i,l;try{let u={nextPage:null,lastPage:0,total:0},c=await X(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(a=(r=t?.page)===null||r===void 0?void 0:r.toString())!==null&&a!==void 0?a:"",per_page:(n=(o=t?.perPage)===null||o===void 0?void 0:o.toString())!==null&&n!==void 0?n:""},xform:Ag});if(c.error)throw c.error;let d=await c.json(),f=(s=c.headers.get("x-total-count"))!==null&&s!==void 0?s:0,h=(l=(i=c.headers.get("link"))===null||i===void 0?void 0:i.split(","))!==null&&l!==void 0?l:[];return h.length>0&&(h.forEach(x=>{let w=parseInt(x.split(";")[0].split("=")[1].substring(0,1)),C=JSON.parse(x.split(";")[1].split("=")[1]);u[`${C}Page`]=w}),u.total=parseInt(f)),{data:Object.assign(Object.assign({},d),u),error:null}}catch(u){if(q(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(t){try{return await X(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(q(r))return{data:null,error:r};throw r}}async _getOAuthClient(t){try{return await X(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(q(r))return{data:null,error:r};throw r}}async _updateOAuthClient(t,r){try{return await X(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:r,headers:this.headers,xform:a=>({data:a,error:null})})}catch(a){if(q(a))return{data:null,error:a};throw a}}async _deleteOAuthClient(t){try{return await X(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(q(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(t){try{return await X(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(q(r))return{data:null,error:r};throw r}}};function Rg(e={}){return{getItem:t=>e[t]||null,setItem:(t,r)=>{e[t]=r},removeItem:t=>{delete e[t]}}}var xn={debug:!!(globalThis&&Id()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")},Xl=class extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}},Ad=class extends Xl{};async function Eg(e,t,r){xn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);let a=new globalThis.AbortController;return t>0&&setTimeout(()=>{a.abort(),xn.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:a.signal},async o=>{if(o){xn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,o.name);try{return await r()}finally{xn.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,o.name)}}else{if(t===0)throw xn.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new Ad(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(xn.debug)try{let n=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(n,null," "))}catch(n){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",n)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await r()}}))}function $S(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function Dg(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function HS(e){return parseInt(e,16)}function zS(e){let t=new TextEncoder().encode(e);return"0x"+Array.from(t,a=>a.toString(16).padStart(2,"0")).join("")}function WS(e){var t;let{chainId:r,domain:a,expirationTime:o,issuedAt:n=new Date,nonce:s,notBefore:i,requestId:l,resources:u,scheme:c,uri:d,version:f}=e;{if(!Number.isInteger(r))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!a)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(s&&s.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${s}`);if(!d)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(f!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${f}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(`
35
+ `))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}let h=Dg(e.address),x=c?`${c}://${a}`:a,w=e.statement?`${e.statement}
36
+ `:"",C=`${x} wants you to sign in with your Ethereum account:
37
+ ${h}
38
+
39
+ ${w}`,m=`URI: ${d}
40
+ Version: ${f}
41
+ Chain ID: ${r}${s?`
42
+ Nonce: ${s}`:""}
43
+ Issued At: ${n.toISOString()}`;if(o&&(m+=`
44
+ Expiration Time: ${o.toISOString()}`),i&&(m+=`
45
+ Not Before: ${i.toISOString()}`),l&&(m+=`
46
+ Request ID: ${l}`),u){let g=`
47
+ Resources:`;for(let y of u){if(!y||typeof y!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${y}`);g+=`
48
+ - ${y}`}m+=g}return`${C}
49
+ ${m}`}var Ue=class extends Error{constructor({message:t,code:r,cause:a,name:o}){var n;super(t,{cause:a}),this.__isWebAuthnError=!0,this.name=(n=o??(a instanceof Error?a.name:void 0))!==null&&n!==void 0?n:"Unknown Error",this.code=r}},wn=class extends Ue{constructor(t,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:t}),this.name="WebAuthnUnknownError",this.originalError=r}};function GS({error:e,options:t}){var r,a,o;let{publicKey:n}=t;if(!n)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Ue({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((r=n.authenticatorSelection)===null||r===void 0?void 0:r.requireResidentKey)===!0)return new Ue({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&((a=n.authenticatorSelection)===null||a===void 0?void 0:a.userVerification)==="required")return new Ue({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((o=n.authenticatorSelection)===null||o===void 0?void 0:o.userVerification)==="required")return new Ue({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if(e.name==="InvalidStateError")return new Ue({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new Ue({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return n.pubKeyCredParams.filter(i=>i.type==="public-key").length===0?new Ue({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new Ue({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){let s=window.location.hostname;if(Ng(s)){if(n.rp.id!==s)return new Ue({message:`The RP ID "${n.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Ue({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(n.user.id.byteLength<1||n.user.id.byteLength>64)return new Ue({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new Ue({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new Ue({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function KS({error:e,options:t}){let{publicKey:r}=t;if(!r)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Ue({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new Ue({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){let a=window.location.hostname;if(Ng(a)){if(r.rpId!==a)return new Ue({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Ue({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new Ue({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new Ue({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}var Mg=class{createNewAbortSignal(){if(this.controller){let r=new Error("Cancelling existing WebAuthn API call for new one");r.name="AbortError",this.controller.abort(r)}let t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){let t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0}}},AA=new Mg;function JS(e){if(!e)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(e);let{challenge:t,user:r,excludeCredentials:a}=e,o=nn(e,["challenge","user","excludeCredentials"]),n=mo(t).buffer,s=Object.assign(Object.assign({},r),{id:mo(r.id).buffer}),i=Object.assign(Object.assign({},o),{challenge:n,user:s});if(a&&a.length>0){i.excludeCredentials=new Array(a.length);for(let l=0;l<a.length;l++){let u=a[l];i.excludeCredentials[l]=Object.assign(Object.assign({},u),{id:mo(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return i}function QS(e){if(!e)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(e);let{challenge:t,allowCredentials:r}=e,a=nn(e,["challenge","allowCredentials"]),o=mo(t).buffer,n=Object.assign(Object.assign({},a),{challenge:o});if(r&&r.length>0){n.allowCredentials=new Array(r.length);for(let s=0;s<r.length;s++){let i=r[s];n.allowCredentials[s]=Object.assign(Object.assign({},i),{id:mo(i.id).buffer,type:i.type||"public-key",transports:i.transports})}}return n}function YS(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();let r=e;return{id:e.id,rawId:e.id,response:{attestationObject:ka(new Uint8Array(e.response.attestationObject)),clientDataJSON:ka(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function ZS(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();let r=e,a=e.getClientExtensionResults(),o=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:ka(new Uint8Array(o.authenticatorData)),clientDataJSON:ka(new Uint8Array(o.clientDataJSON)),signature:ka(new Uint8Array(o.signature)),userHandle:o.userHandle?ka(new Uint8Array(o.userHandle)):void 0},type:"public-key",clientExtensionResults:a,authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function Ng(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function XS(){var e,t;return!!(at()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((e=navigator?.credentials)===null||e===void 0?void 0:e.create)=="function"&&typeof((t=navigator?.credentials)===null||t===void 0?void 0:t.get)=="function")}async function RA(e){try{let t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new wn("Browser returned unexpected credential type",t)}:{data:null,error:new wn("Empty credential response",t)}}catch(t){return{data:null,error:GS({error:t,options:e})}}}async function EA(e){try{let t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new wn("Browser returned unexpected credential type",t)}:{data:null,error:new wn("Empty credential response",t)}}catch(t){return{data:null,error:KS({error:t,options:e})}}}var DA={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},NA={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function Rd(...e){let t=o=>o!==null&&typeof o=="object"&&!Array.isArray(o),r=o=>o instanceof ArrayBuffer||ArrayBuffer.isView(o),a={};for(let o of e)if(o)for(let n in o){let s=o[n];if(s!==void 0)if(Array.isArray(s))a[n]=s;else if(r(s))a[n]=s;else if(t(s)){let i=a[n];t(i)?a[n]=Rd(i,s):a[n]=Rd(s)}else a[n]=s}return a}function MA(e,t){return Rd(DA,e,t||{})}function OA(e,t){return Rd(NA,e,t||{})}var Ed=class{constructor(t){this.client=t,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(t){return this.client.mfa.enroll(Object.assign(Object.assign({},t),{factorType:"webauthn"}))}async _challenge({factorId:t,webauthn:r,friendlyName:a,signal:o},n){try{let{data:s,error:i}=await this.client.mfa.challenge({factorId:t,webauthn:r});if(!s)return{data:null,error:i};let l=o??AA.createNewAbortSignal();if(s.webauthn.type==="create"){let{user:u}=s.webauthn.credential_options.publicKey;u.name||(u.name=`${u.id}:${a}`),u.displayName||(u.displayName=u.name)}switch(s.webauthn.type){case"create":{let u=MA(s.webauthn.credential_options.publicKey,n?.create),{data:c,error:d}=await RA({publicKey:u,signal:l});return c?{data:{factorId:t,challengeId:s.id,webauthn:{type:s.webauthn.type,credential_response:c}},error:null}:{data:null,error:d}}case"request":{let u=OA(s.webauthn.credential_options.publicKey,n?.request),{data:c,error:d}=await EA(Object.assign(Object.assign({},s.webauthn.credential_options),{publicKey:u,signal:l}));return c?{data:{factorId:t,challengeId:s.id,webauthn:{type:s.webauthn.type,credential_response:c}},error:null}:{data:null,error:d}}}}catch(s){return q(s)?{data:null,error:s}:{data:null,error:new Cr("Unexpected error in challenge",s)}}}async _verify({challengeId:t,factorId:r,webauthn:a}){return this.client.mfa.verify({factorId:r,challengeId:t,webauthn:a})}async _authenticate({factorId:t,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:a=typeof window<"u"?[window.location.origin]:void 0,signal:o}={}},n){if(!r)return{data:null,error:new ho("rpId is required for WebAuthn authentication")};try{if(!XS())return{data:null,error:new Cr("Browser does not support WebAuthn",null)};let{data:s,error:i}=await this.challenge({factorId:t,webauthn:{rpId:r,rpOrigins:a},signal:o},{request:n});if(!s)return{data:null,error:i};let{webauthn:l}=s;return this._verify({factorId:t,challengeId:s.challengeId,webauthn:{type:l.type,rpId:r,rpOrigins:a,credential_response:l.credential_response}})}catch(s){return q(s)?{data:null,error:s}:{data:null,error:new Cr("Unexpected error in authenticate",s)}}}async _register({friendlyName:t,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:a=typeof window<"u"?[window.location.origin]:void 0,signal:o}={}},n){if(!r)return{data:null,error:new ho("rpId is required for WebAuthn registration")};try{if(!XS())return{data:null,error:new Cr("Browser does not support WebAuthn",null)};let{data:s,error:i}=await this._enroll({friendlyName:t});if(!s)return await this.client.mfa.listFactors().then(c=>{var d;return(d=c.data)===null||d===void 0?void 0:d.all.find(f=>f.factor_type==="webauthn"&&f.friendly_name===t&&f.status!=="unverified")}).then(c=>c?this.client.mfa.unenroll({factorId:c?.id}):void 0),{data:null,error:i};let{data:l,error:u}=await this._challenge({factorId:s.id,friendlyName:s.friendly_name,webauthn:{rpId:r,rpOrigins:a},signal:o},{create:n});return l?this._verify({factorId:s.id,challengeId:l.challengeId,webauthn:{rpId:r,rpOrigins:a,type:l.webauthn.type,credential_response:l.webauthn.credential_response}}):{data:null,error:u}}catch(s){return q(s)?{data:null,error:s}:{data:null,error:new Cr("Unexpected error in register",s)}}}};$S();var BA={url:vS,storageKey:xS,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:wS,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:1e4};async function eC(e,t,r){return await r()}var Es={},Dd=class e{get jwks(){var t,r;return(r=(t=Es[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(t){Es[this.storageKey]=Object.assign(Object.assign({},Es[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,r;return(r=(t=Es[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){Es[this.storageKey]=Object.assign(Object.assign({},Es[this.storageKey]),{cachedAt:t})}constructor(t){var r,a,o;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;let n=Object.assign(Object.assign({},BA),t);if(this.storageKey=n.storageKey,this.instanceID=(r=e.nextInstanceID[this.storageKey])!==null&&r!==void 0?r:0,e.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!n.debug,typeof n.debug=="function"&&(this.logger=n.debug),this.instanceID>0&&at()){let s=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(s),this.logDebugMessages&&console.trace(s)}if(this.persistSession=n.persistSession,this.autoRefreshToken=n.autoRefreshToken,this.admin=new vn({url:n.url,headers:n.headers,fetch:n.fetch}),this.url=n.url,this.headers=n.headers,this.fetch=kd(n.fetch),this.lock=n.lock||eC,this.detectSessionInUrl=n.detectSessionInUrl,this.flowType=n.flowType,this.hasCustomAuthorizationHeader=n.hasCustomAuthorizationHeader,this.throwOnError=n.throwOnError,this.lockAcquireTimeout=n.lockAcquireTimeout,n.lock?this.lock=n.lock:this.persistSession&&at()&&(!((a=globalThis?.navigator)===null||a===void 0)&&a.locks)?this.lock=Eg:this.lock=eC,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new Ed(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(n.storage?this.storage=n.storage:Id()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=Rg(this.memoryStorage)),n.userStorage&&(this.userStorage=n.userStorage)):(this.memoryStorage={},this.storage=Rg(this.memoryStorage)),at()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(s){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",s)}(o=this.broadcastChannel)===null||o===void 0||o.addEventListener("message",async s=>{this._debug("received broadcast notification from other tab or client",s),await this._notifyAllSubscribers(s.data.event,s.data.session,!1)})}this.initialize()}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${vd}) ${new Date().toISOString()}`}_debug(...t){return this.logDebugMessages&&this.logger(this._logPrefix(),...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{let r={},a="none";if(at()&&(r=ES(window.location.href),this._isImplicitGrantCallback(r)?a="implicit":await this._isPKCECallback(r)&&(a="pkce")),at()&&this.detectSessionInUrl&&a!=="none"){let{data:o,error:n}=await this._getSessionFromURL(r,a);if(n){if(this._debug("#_initialize()","error detecting session from URL",n),IS(n)){let l=(t=n.details)===null||t===void 0?void 0:t.code;if(l==="identity_already_exists"||l==="identity_not_found"||l==="single_identity_not_deletable")return{error:n}}return{error:n}}let{session:s,redirectType:i}=o;return this._debug("#_initialize()","detected session in URL",s,"redirect type",i),await this._saveSession(s),setTimeout(async()=>{i==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",s):await this._notifyAllSubscribers("SIGNED_IN",s)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return q(r)?this._returnResult({error:r}):this._returnResult({error:new Cr("Unexpected error during initialization",r)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var r,a,o;try{let n=await X(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(a=(r=t?.options)===null||r===void 0?void 0:r.data)!==null&&a!==void 0?a:{},gotrue_meta_security:{captcha_token:(o=t?.options)===null||o===void 0?void 0:o.captchaToken}},xform:br}),{data:s,error:i}=n;if(i||!s)return this._returnResult({data:{user:null,session:null},error:i});let l=s.session,u=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(n){if(q(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signUp(t){var r,a,o;try{let n;if("email"in t){let{email:c,password:d,options:f}=t,h=null,x=null;this.flowType==="pkce"&&([h,x]=await mn(this.storage,this.storageKey)),n=await X(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:f?.emailRedirectTo,body:{email:c,password:d,data:(r=f?.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:f?.captchaToken},code_challenge:h,code_challenge_method:x},xform:br})}else if("phone"in t){let{phone:c,password:d,options:f}=t;n=await X(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:c,password:d,data:(a=f?.data)!==null&&a!==void 0?a:{},channel:(o=f?.channel)!==null&&o!==void 0?o:"sms",gotrue_meta_security:{captcha_token:f?.captchaToken}},xform:br})}else throw new cn("You must provide either an email or phone number and a password");let{data:s,error:i}=n;if(i||!s)return await ct(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:i});let l=s.session,u=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(n){if(await ct(this.storage,`${this.storageKey}-code-verifier`),q(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithPassword(t){try{let r;if("email"in t){let{email:n,password:s,options:i}=t;r=await X(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:n,password:s,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:_g})}else if("phone"in t){let{phone:n,password:s,options:i}=t;r=await X(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:n,password:s,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:_g})}else throw new cn("You must provide either an email or phone number and a password");let{data:a,error:o}=r;if(o)return this._returnResult({data:{user:null,session:null},error:o});if(!a||!a.session||!a.user){let n=new Ia;return this._returnResult({data:{user:null,session:null},error:n})}return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",a.session)),this._returnResult({data:Object.assign({user:a.user,session:a.session},a.weak_password?{weakPassword:a.weak_password}:null),error:o})}catch(r){if(q(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOAuth(t){var r,a,o,n;return await this._handleProviderSignIn(t.provider,{redirectTo:(r=t.options)===null||r===void 0?void 0:r.redirectTo,scopes:(a=t.options)===null||a===void 0?void 0:a.scopes,queryParams:(o=t.options)===null||o===void 0?void 0:o.queryParams,skipBrowserRedirect:(n=t.options)===null||n===void 0?void 0:n.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){let{chain:r}=t;switch(r){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${r}"`)}}async signInWithEthereum(t){var r,a,o,n,s,i,l,u,c,d,f;let h,x;if("message"in t)h=t.message,x=t.signature;else{let{chain:w,wallet:C,statement:m,options:g}=t,y;if(at())if(typeof C=="object")y=C;else{let F=window;if("ethereum"in F&&typeof F.ethereum=="object"&&"request"in F.ethereum&&typeof F.ethereum.request=="function")y=F.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof C!="object"||!g?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");y=C}let b=new URL((r=g?.url)!==null&&r!==void 0?r:window.location.href),k=await y.request({method:"eth_requestAccounts"}).then(F=>F).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!k||k.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");let I=Dg(k[0]),A=(a=g?.signInWithEthereum)===null||a===void 0?void 0:a.chainId;if(!A){let F=await y.request({method:"eth_chainId"});A=HS(F)}let R={domain:b.host,address:I,statement:m,uri:b.href,version:"1",chainId:A,nonce:(o=g?.signInWithEthereum)===null||o===void 0?void 0:o.nonce,issuedAt:(s=(n=g?.signInWithEthereum)===null||n===void 0?void 0:n.issuedAt)!==null&&s!==void 0?s:new Date,expirationTime:(i=g?.signInWithEthereum)===null||i===void 0?void 0:i.expirationTime,notBefore:(l=g?.signInWithEthereum)===null||l===void 0?void 0:l.notBefore,requestId:(u=g?.signInWithEthereum)===null||u===void 0?void 0:u.requestId,resources:(c=g?.signInWithEthereum)===null||c===void 0?void 0:c.resources};h=WS(R),x=await y.request({method:"personal_sign",params:[zS(h),I]})}try{let{data:w,error:C}=await X(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:h,signature:x},!((d=t.options)===null||d===void 0)&&d.captchaToken?{gotrue_meta_security:{captcha_token:(f=t.options)===null||f===void 0?void 0:f.captchaToken}}:null),xform:br});if(C)throw C;if(!w||!w.session||!w.user){let m=new Ia;return this._returnResult({data:{user:null,session:null},error:m})}return w.session&&(await this._saveSession(w.session),await this._notifyAllSubscribers("SIGNED_IN",w.session)),this._returnResult({data:Object.assign({},w),error:C})}catch(w){if(q(w))return this._returnResult({data:{user:null,session:null},error:w});throw w}}async signInWithSolana(t){var r,a,o,n,s,i,l,u,c,d,f,h;let x,w;if("message"in t)x=t.message,w=t.signature;else{let{chain:C,wallet:m,statement:g,options:y}=t,b;if(at())if(typeof m=="object")b=m;else{let I=window;if("solana"in I&&typeof I.solana=="object"&&("signIn"in I.solana&&typeof I.solana.signIn=="function"||"signMessage"in I.solana&&typeof I.solana.signMessage=="function"))b=I.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof m!="object"||!y?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");b=m}let k=new URL((r=y?.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in b&&b.signIn){let I=await b.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},y?.signInWithSolana),{version:"1",domain:k.host,uri:k.href}),g?{statement:g}:null)),A;if(Array.isArray(I)&&I[0]&&typeof I[0]=="object")A=I[0];else if(I&&typeof I=="object"&&"signedMessage"in I&&"signature"in I)A=I;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in A&&"signature"in A&&(typeof A.signedMessage=="string"||A.signedMessage instanceof Uint8Array)&&A.signature instanceof Uint8Array)x=typeof A.signedMessage=="string"?A.signedMessage:new TextDecoder().decode(A.signedMessage),w=A.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in b)||typeof b.signMessage!="function"||!("publicKey"in b)||typeof b!="object"||!b.publicKey||!("toBase58"in b.publicKey)||typeof b.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");x=[`${k.host} wants you to sign in with your Solana account:`,b.publicKey.toBase58(),...g?["",g,""]:[""],"Version: 1",`URI: ${k.href}`,`Issued At: ${(o=(a=y?.signInWithSolana)===null||a===void 0?void 0:a.issuedAt)!==null&&o!==void 0?o:new Date().toISOString()}`,...!((n=y?.signInWithSolana)===null||n===void 0)&&n.notBefore?[`Not Before: ${y.signInWithSolana.notBefore}`]:[],...!((s=y?.signInWithSolana)===null||s===void 0)&&s.expirationTime?[`Expiration Time: ${y.signInWithSolana.expirationTime}`]:[],...!((i=y?.signInWithSolana)===null||i===void 0)&&i.chainId?[`Chain ID: ${y.signInWithSolana.chainId}`]:[],...!((l=y?.signInWithSolana)===null||l===void 0)&&l.nonce?[`Nonce: ${y.signInWithSolana.nonce}`]:[],...!((u=y?.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${y.signInWithSolana.requestId}`]:[],...!((d=(c=y?.signInWithSolana)===null||c===void 0?void 0:c.resources)===null||d===void 0)&&d.length?["Resources",...y.signInWithSolana.resources.map(A=>`- ${A}`)]:[]].join(`
50
+ `);let I=await b.signMessage(new TextEncoder().encode(x),"utf8");if(!I||!(I instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");w=I}}try{let{data:C,error:m}=await X(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:x,signature:ka(w)},!((f=t.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(h=t.options)===null||h===void 0?void 0:h.captchaToken}}:null),xform:br});if(m)throw m;if(!C||!C.session||!C.user){let g=new Ia;return this._returnResult({data:{user:null,session:null},error:g})}return C.session&&(await this._saveSession(C.session),await this._notifyAllSubscribers("SIGNED_IN",C.session)),this._returnResult({data:Object.assign({},C),error:m})}catch(C){if(q(C))return this._returnResult({data:{user:null,session:null},error:C});throw C}}async _exchangeCodeForSession(t){let r=await go(this.storage,`${this.storageKey}-code-verifier`),[a,o]=(r??"").split("/");try{if(!a&&this.flowType==="pkce")throw new Cd;let{data:n,error:s}=await X(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:a},xform:br});if(await ct(this.storage,`${this.storageKey}-code-verifier`),s)throw s;if(!n||!n.session||!n.user){let i=new Ia;return this._returnResult({data:{user:null,session:null,redirectType:null},error:i})}return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:Object.assign(Object.assign({},n),{redirectType:o??null}),error:s})}catch(n){if(await ct(this.storage,`${this.storageKey}-code-verifier`),q(n))return this._returnResult({data:{user:null,session:null,redirectType:null},error:n});throw n}}async signInWithIdToken(t){try{let{options:r,provider:a,token:o,access_token:n,nonce:s}=t,i=await X(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:a,id_token:o,access_token:n,nonce:s,gotrue_meta_security:{captcha_token:r?.captchaToken}},xform:br}),{data:l,error:u}=i;if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!l||!l.session||!l.user){let c=new Ia;return this._returnResult({data:{user:null,session:null},error:c})}return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),this._returnResult({data:l,error:u})}catch(r){if(q(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOtp(t){var r,a,o,n,s;try{if("email"in t){let{email:i,options:l}=t,u=null,c=null;this.flowType==="pkce"&&([u,c]=await mn(this.storage,this.storageKey));let{error:d}=await X(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:i,data:(r=l?.data)!==null&&r!==void 0?r:{},create_user:(a=l?.shouldCreateUser)!==null&&a!==void 0?a:!0,gotrue_meta_security:{captcha_token:l?.captchaToken},code_challenge:u,code_challenge_method:c},redirectTo:l?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:d})}if("phone"in t){let{phone:i,options:l}=t,{data:u,error:c}=await X(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:i,data:(o=l?.data)!==null&&o!==void 0?o:{},create_user:(n=l?.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:l?.captchaToken},channel:(s=l?.channel)!==null&&s!==void 0?s:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:u?.message_id},error:c})}throw new cn("You must provide either an email or phone number.")}catch(i){if(await ct(this.storage,`${this.storageKey}-code-verifier`),q(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async verifyOtp(t){var r,a;try{let o,n;"options"in t&&(o=(r=t.options)===null||r===void 0?void 0:r.redirectTo,n=(a=t.options)===null||a===void 0?void 0:a.captchaToken);let{data:s,error:i}=await X(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:n}}),redirectTo:o,xform:br});if(i)throw i;if(!s)throw new Error("An error occurred on token verification.");let l=s.session,u=s.user;return l?.access_token&&(await this._saveSession(l),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(o){if(q(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async signInWithSSO(t){var r,a,o,n,s;try{let i=null,l=null;this.flowType==="pkce"&&([i,l]=await mn(this.storage,this.storageKey));let u=await X(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:(a=(r=t.options)===null||r===void 0?void 0:r.redirectTo)!==null&&a!==void 0?a:void 0}),!((o=t?.options)===null||o===void 0)&&o.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:i,code_challenge_method:l}),headers:this.headers,xform:jS});return!((n=u.data)===null||n===void 0)&&n.url&&at()&&!(!((s=t.options)===null||s===void 0)&&s.skipBrowserRedirect)&&window.location.assign(u.data.url),this._returnResult(u)}catch(i){if(await ct(this.storage,`${this.storageKey}-code-verifier`),q(i))return this._returnResult({data:null,error:i});throw i}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{let{data:{session:r},error:a}=t;if(a)throw a;if(!r)throw new yt;let{error:o}=await X(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return this._returnResult({data:{user:null,session:null},error:o})})}catch(t){if(q(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async resend(t){try{let r=`${this.url}/resend`;if("email"in t){let{email:a,type:o,options:n}=t,{error:s}=await X(this.fetch,"POST",r,{headers:this.headers,body:{email:a,type:o,gotrue_meta_security:{captcha_token:n?.captchaToken}},redirectTo:n?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:s})}else if("phone"in t){let{phone:a,type:o,options:n}=t,{data:s,error:i}=await X(this.fetch,"POST",r,{headers:this.headers,body:{phone:a,type:o,gotrue_meta_security:{captcha_token:n?.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:s?.message_id},error:i})}throw new cn("You must provide either an email or phone number and a type")}catch(r){if(q(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async r=>r))}async _acquireLock(t,r){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){let a=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),o=(async()=>(await a,await r()))();return this.pendingInLock.push((async()=>{try{await o}catch{}})()),o}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;let a=r();for(this.pendingInLock.push((async()=>{try{await a}catch{}})()),await a;this.pendingInLock.length;){let o=[...this.pendingInLock];await Promise.all(o),this.pendingInLock.splice(0,o.length)}return await a}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{let r=await this.__loadSession();return await t(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null,r=await go(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?t=r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!t)return{data:{session:null},error:null};let a=t.expires_at?t.expires_at*1e3-Date.now()<wd:!1;if(this._debug("#__loadSession()",`session has${a?"":" not"} expired`,"expires_at",t.expires_at),!a){if(this.userStorage){let s=await go(this.userStorage,this.storageKey+"-user");s?.user?t.user=s.user:t.user=Td()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){let s={value:this.suppressGetSessionWarning};t.user=US(t.user,s),s.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}let{data:o,error:n}=await this._callRefreshToken(t.refresh_token);return n?this._returnResult({data:{session:null},error:n}):this._returnResult({data:{session:o},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(t){if(t)return await this._getUser(t);await this.initializePromise;let r=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return r.data.user&&(this.suppressGetSessionWarning=!0),r}async _getUser(t){try{return t?await X(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:Jr}):await this._useSession(async r=>{var a,o,n;let{data:s,error:i}=r;if(i)throw i;return!(!((a=s.session)===null||a===void 0)&&a.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new yt}:await X(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(n=(o=s.session)===null||o===void 0?void 0:o.access_token)!==null&&n!==void 0?n:void 0,xform:Jr})})}catch(r){if(q(r))return LS(r)&&(await this._removeSession(),await ct(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:r});throw r}}async updateUser(t,r={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(t,r))}async _updateUser(t,r={}){try{return await this._useSession(async a=>{let{data:o,error:n}=a;if(n)throw n;if(!o.session)throw new yt;let s=o.session,i=null,l=null;this.flowType==="pkce"&&t.email!=null&&([i,l]=await mn(this.storage,this.storageKey));let{data:u,error:c}=await X(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r?.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:i,code_challenge_method:l}),jwt:s.access_token,xform:Jr});if(c)throw c;return s.user=u.user,await this._saveSession(s),await this._notifyAllSubscribers("USER_UPDATED",s),this._returnResult({data:{user:s.user},error:null})})}catch(a){if(await ct(this.storage,`${this.storageKey}-code-verifier`),q(a))return this._returnResult({data:{user:null},error:a});throw a}}async setSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new yt;let r=Date.now()/1e3,a=r,o=!0,n=null,{payload:s}=Pd(t.access_token);if(s.exp&&(a=s.exp,o=a<=r),o){let{data:i,error:l}=await this._callRefreshToken(t.refresh_token);if(l)return this._returnResult({data:{user:null,session:null},error:l});if(!i)return{data:{user:null,session:null},error:null};n=i}else{let{data:i,error:l}=await this._getUser(t.access_token);if(l)throw l;n={access_token:t.access_token,refresh_token:t.refresh_token,user:i.user,token_type:"bearer",expires_in:a-r,expires_at:a},await this._saveSession(n),await this._notifyAllSubscribers("SIGNED_IN",n)}return this._returnResult({data:{user:n.user,session:n},error:null})}catch(r){if(q(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async r=>{var a;if(!t){let{data:s,error:i}=r;if(i)throw i;t=(a=s.session)!==null&&a!==void 0?a:void 0}if(!t?.refresh_token)throw new yt;let{data:o,error:n}=await this._callRefreshToken(t.refresh_token);return n?this._returnResult({data:{user:null,session:null},error:n}):o?this._returnResult({data:{user:o.user,session:o},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(r){if(q(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(t,r){try{if(!at())throw new dn("No browser detected.");if(t.error||t.error_description||t.error_code)throw new dn(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new Wl("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new dn("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new Wl("No code detected.");let{data:g,error:y}=await this._exchangeCodeForSession(t.code);if(y)throw y;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}}let{provider_token:a,provider_refresh_token:o,access_token:n,refresh_token:s,expires_in:i,expires_at:l,token_type:u}=t;if(!n||!i||!s||!u)throw new dn("No session defined in URL");let c=Math.round(Date.now()/1e3),d=parseInt(i),f=c+d;l&&(f=parseInt(l));let h=f-c;h*1e3<=un&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${h}s, should have been closer to ${d}s`);let x=f-d;c-x>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",x,f,c):c-x<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",x,f,c);let{data:w,error:C}=await this._getUser(n);if(C)throw C;let m={provider_token:a,provider_refresh_token:o,access_token:n,expires_in:d,expires_at:f,refresh_token:s,token_type:u,user:w.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:m,redirectType:t.type},error:null})}catch(a){if(q(a))return this._returnResult({data:{session:null,redirectType:null},error:a});throw a}}_isImplicitGrantCallback(t){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),t):!!(t.access_token||t.error_description)}async _isPKCECallback(t){let r=await go(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&r)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async r=>{var a;let{data:o,error:n}=r;if(n)return this._returnResult({error:n});let s=(a=o.session)===null||a===void 0?void 0:a.access_token;if(s){let{error:i}=await this.admin.signOut(s,t);if(i&&!(bS(i)&&(i.status===404||i.status===401||i.status===403)))return this._returnResult({error:i})}return t!=="others"&&(await this._removeSession(),await ct(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){let r=RS(),a={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,a),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:a}}}async _emitInitialSession(t){return await this._useSession(async r=>{var a,o;try{let{data:{session:n},error:s}=r;if(s)throw s;await((a=this.stateChangeEmitters.get(t))===null||a===void 0?void 0:a.callback("INITIAL_SESSION",n)),this._debug("INITIAL_SESSION","callback id",t,"session",n)}catch(n){await((o=this.stateChangeEmitters.get(t))===null||o===void 0?void 0:o.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",n),console.error(n)}})}async resetPasswordForEmail(t,r={}){let a=null,o=null;this.flowType==="pkce"&&([a,o]=await mn(this.storage,this.storageKey,!0));try{return await X(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:a,code_challenge_method:o,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(n){if(await ct(this.storage,`${this.storageKey}-code-verifier`),q(n))return this._returnResult({data:null,error:n});throw n}}async getUserIdentities(){var t;try{let{data:r,error:a}=await this.getUser();if(a)throw a;return this._returnResult({data:{identities:(t=r.user.identities)!==null&&t!==void 0?t:[]},error:null})}catch(r){if(q(r))return this._returnResult({data:null,error:r});throw r}}async linkIdentity(t){return"token"in t?this.linkIdentityIdToken(t):this.linkIdentityOAuth(t)}async linkIdentityOAuth(t){var r;try{let{data:a,error:o}=await this._useSession(async n=>{var s,i,l,u,c;let{data:d,error:f}=n;if(f)throw f;let h=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(s=t.options)===null||s===void 0?void 0:s.redirectTo,scopes:(i=t.options)===null||i===void 0?void 0:i.scopes,queryParams:(l=t.options)===null||l===void 0?void 0:l.queryParams,skipBrowserRedirect:!0});return await X(this.fetch,"GET",h,{headers:this.headers,jwt:(c=(u=d.session)===null||u===void 0?void 0:u.access_token)!==null&&c!==void 0?c:void 0})});if(o)throw o;return at()&&!(!((r=t.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(a?.url),this._returnResult({data:{provider:t.provider,url:a?.url},error:null})}catch(a){if(q(a))return this._returnResult({data:{provider:t.provider,url:null},error:a});throw a}}async linkIdentityIdToken(t){return await this._useSession(async r=>{var a;try{let{error:o,data:{session:n}}=r;if(o)throw o;let{options:s,provider:i,token:l,access_token:u,nonce:c}=t,d=await X(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(a=n?.access_token)!==null&&a!==void 0?a:void 0,body:{provider:i,id_token:l,access_token:u,nonce:c,link_identity:!0,gotrue_meta_security:{captcha_token:s?.captchaToken}},xform:br}),{data:f,error:h}=d;return h?this._returnResult({data:{user:null,session:null},error:h}):!f||!f.session||!f.user?this._returnResult({data:{user:null,session:null},error:new Ia}):(f.session&&(await this._saveSession(f.session),await this._notifyAllSubscribers("USER_UPDATED",f.session)),this._returnResult({data:f,error:h}))}catch(o){if(await ct(this.storage,`${this.storageKey}-code-verifier`),q(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}})}async unlinkIdentity(t){try{return await this._useSession(async r=>{var a,o;let{data:n,error:s}=r;if(s)throw s;return await X(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(o=(a=n.session)===null||a===void 0?void 0:a.access_token)!==null&&o!==void 0?o:void 0})})}catch(r){if(q(r))return this._returnResult({data:null,error:r});throw r}}async _refreshAccessToken(t){let r=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(r,"begin");try{let a=Date.now();return await MS(async o=>(o>0&&await NS(200*Math.pow(2,o-1)),this._debug(r,"refreshing attempt",o),await X(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:br})),(o,n)=>{let s=200*Math.pow(2,o);return n&&bd(n)&&Date.now()+s-a<un})}catch(a){if(this._debug(r,"error",a),q(a))return this._returnResult({data:{session:null,user:null},error:a});throw a}finally{this._debug(r,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,r){let a=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",r,"url",a),at()&&!r.skipBrowserRedirect&&window.location.assign(a),{data:{provider:t,url:a},error:null}}async _recoverAndRefresh(){var t,r;let a="#_recoverAndRefresh()";this._debug(a,"begin");try{let o=await go(this.storage,this.storageKey);if(o&&this.userStorage){let s=await go(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!s&&(s={user:o.user},await hn(this.userStorage,this.storageKey+"-user",s)),o.user=(t=s?.user)!==null&&t!==void 0?t:Td()}else if(o&&!o.user&&!o.user){let s=await go(this.storage,this.storageKey+"-user");s&&s?.user?(o.user=s.user,await ct(this.storage,this.storageKey+"-user"),await hn(this.storage,this.storageKey,o)):o.user=Td()}if(this._debug(a,"session from storage",o),!this._isValidSession(o)){this._debug(a,"session is not valid"),o!==null&&await this._removeSession();return}let n=((r=o.expires_at)!==null&&r!==void 0?r:1/0)*1e3-Date.now()<wd;if(this._debug(a,`session has${n?"":" not"} expired with margin of ${wd}s`),n){if(this.autoRefreshToken&&o.refresh_token){let{error:s}=await this._callRefreshToken(o.refresh_token);s&&(console.error(s),bd(s)||(this._debug(a,"refresh failed with a non-retryable error, removing the session",s),await this._removeSession()))}}else if(o.user&&o.user.__isUserNotAvailableProxy===!0)try{let{data:s,error:i}=await this._getUser(o.access_token);!i&&s?.user?(o.user=s.user,await this._saveSession(o),await this._notifyAllSubscribers("SIGNED_IN",o)):this._debug(a,"could not get user data, skipping SIGNED_IN notification")}catch(s){console.error("Error getting user data:",s),this._debug(a,"error getting user data, skipping SIGNED_IN notification",s)}else await this._notifyAllSubscribers("SIGNED_IN",o)}catch(o){this._debug(a,"error",o),console.error(o);return}finally{this._debug(a,"end")}}async _callRefreshToken(t){var r,a;if(!t)throw new yt;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let o=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(o,"begin");try{this.refreshingDeferred=new Kl;let{data:n,error:s}=await this._refreshAccessToken(t);if(s)throw s;if(!n.session)throw new yt;await this._saveSession(n.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",n.session);let i={data:n.session,error:null};return this.refreshingDeferred.resolve(i),i}catch(n){if(this._debug(o,"error",n),q(n)){let s={data:null,error:n};return bd(n)||await this._removeSession(),(r=this.refreshingDeferred)===null||r===void 0||r.resolve(s),s}throw(a=this.refreshingDeferred)===null||a===void 0||a.reject(n),n}finally{this.refreshingDeferred=null,this._debug(o,"end")}}async _notifyAllSubscribers(t,r,a=!0){let o=`#_notifyAllSubscribers(${t})`;this._debug(o,"begin",r,`broadcast = ${a}`);try{this.broadcastChannel&&a&&this.broadcastChannel.postMessage({event:t,session:r});let n=[],s=Array.from(this.stateChangeEmitters.values()).map(async i=>{try{await i.callback(t,r)}catch(l){n.push(l)}});if(await Promise.all(s),n.length>0){for(let i=0;i<n.length;i+=1)console.error(n[i]);throw n[0]}}finally{this._debug(o,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0,await ct(this.storage,`${this.storageKey}-code-verifier`);let r=Object.assign({},t),a=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!a&&r.user&&await hn(this.userStorage,this.storageKey+"-user",{user:r.user});let o=Object.assign({},r);delete o.user;let n=Tg(o);await hn(this.storage,this.storageKey,n)}else{let o=Tg(r);await hn(this.storage,this.storageKey,o)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await ct(this.storage,this.storageKey),await ct(this.storage,this.storageKey+"-code-verifier"),await ct(this.storage,this.storageKey+"-user"),this.userStorage&&await ct(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");let t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&at()&&window?.removeEventListener&&window.removeEventListener("visibilitychange",t)}catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");let t=setInterval(()=>this._autoRefreshTokenTick(),un);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t);let r=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=r,r&&typeof r=="object"&&typeof r.unref=="function"?r.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(r)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");let t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t);let r=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,r&&clearTimeout(r)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{let t=Date.now();try{return await this._useSession(async r=>{let{data:{session:a}}=r;if(!a||!a.refresh_token||!a.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}let o=Math.floor((a.expires_at*1e3-t)/un);this._debug("#_autoRefreshTokenTick()",`access token expires in ${o} ticks, a tick lasts ${un}ms, refresh threshold is ${xd} ticks`),o<=xd&&await this._callRefreshToken(a.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t.isAcquireTimeout||t instanceof Xl)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!at()||!window?.addEventListener)return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window?.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){let r=`#_onVisibilityChanged(${t})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(t,r,a){let o=[`provider=${encodeURIComponent(r)}`];if(a?.redirectTo&&o.push(`redirect_to=${encodeURIComponent(a.redirectTo)}`),a?.scopes&&o.push(`scopes=${encodeURIComponent(a.scopes)}`),this.flowType==="pkce"){let[n,s]=await mn(this.storage,this.storageKey),i=new URLSearchParams({code_challenge:`${encodeURIComponent(n)}`,code_challenge_method:`${encodeURIComponent(s)}`});o.push(i.toString())}if(a?.queryParams){let n=new URLSearchParams(a.queryParams);o.push(n.toString())}return a?.skipBrowserRedirect&&o.push(`skip_http_redirect=${a.skipBrowserRedirect}`),`${t}?${o.join("&")}`}async _unenroll(t){try{return await this._useSession(async r=>{var a;let{data:o,error:n}=r;return n?this._returnResult({data:null,error:n}):await X(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(a=o?.session)===null||a===void 0?void 0:a.access_token})})}catch(r){if(q(r))return this._returnResult({data:null,error:r});throw r}}async _enroll(t){try{return await this._useSession(async r=>{var a,o;let{data:n,error:s}=r;if(s)return this._returnResult({data:null,error:s});let i=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:t.factorType==="totp"?{issuer:t.issuer}:{}),{data:l,error:u}=await X(this.fetch,"POST",`${this.url}/factors`,{body:i,headers:this.headers,jwt:(a=n?.session)===null||a===void 0?void 0:a.access_token});return u?this._returnResult({data:null,error:u}):(t.factorType==="totp"&&l.type==="totp"&&(!((o=l?.totp)===null||o===void 0)&&o.qr_code)&&(l.totp.qr_code=`data:image/svg+xml;utf-8,${l.totp.qr_code}`),this._returnResult({data:l,error:null}))})}catch(r){if(q(r))return this._returnResult({data:null,error:r});throw r}}async _verify(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async r=>{var a;let{data:o,error:n}=r;if(n)return this._returnResult({data:null,error:n});let s=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?YS(t.webauthn.credential_response):ZS(t.webauthn.credential_response)})}:{code:t.code}),{data:i,error:l}=await X(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:s,headers:this.headers,jwt:(a=o?.session)===null||a===void 0?void 0:a.access_token});return l?this._returnResult({data:null,error:l}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+i.expires_in},i)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",i),this._returnResult({data:i,error:l}))})}catch(r){if(q(r))return this._returnResult({data:null,error:r});throw r}})}async _challenge(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async r=>{var a;let{data:o,error:n}=r;if(n)return this._returnResult({data:null,error:n});let s=await X(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(a=o?.session)===null||a===void 0?void 0:a.access_token});if(s.error)return s;let{data:i}=s;if(i.type!=="webauthn")return{data:i,error:null};switch(i.webauthn.type){case"create":return{data:Object.assign(Object.assign({},i),{webauthn:Object.assign(Object.assign({},i.webauthn),{credential_options:Object.assign(Object.assign({},i.webauthn.credential_options),{publicKey:JS(i.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},i),{webauthn:Object.assign(Object.assign({},i.webauthn),{credential_options:Object.assign(Object.assign({},i.webauthn.credential_options),{publicKey:QS(i.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if(q(r))return this._returnResult({data:null,error:r});throw r}})}async _challengeAndVerify(t){let{data:r,error:a}=await this._challenge({factorId:t.factorId});return a?this._returnResult({data:null,error:a}):await this._verify({factorId:t.factorId,challengeId:r.id,code:t.code})}async _listFactors(){var t;let{data:{user:r},error:a}=await this.getUser();if(a)return{data:null,error:a};let o={all:[],phone:[],totp:[],webauthn:[]};for(let n of(t=r?.factors)!==null&&t!==void 0?t:[])o.all.push(n),n.status==="verified"&&o[n.factor_type].push(n);return{data:o,error:null}}async _getAuthenticatorAssuranceLevel(){var t,r;let{data:{session:a},error:o}=await this.getSession();if(o)return this._returnResult({data:null,error:o});if(!a)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let{payload:n}=Pd(a.access_token),s=null;n.aal&&(s=n.aal);let i=s;((r=(t=a.user.factors)===null||t===void 0?void 0:t.filter(c=>c.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(i="aal2");let u=n.amr||[];return{data:{currentLevel:s,nextLevel:i,currentAuthenticationMethods:u},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async r=>{let{data:{session:a},error:o}=r;return o?this._returnResult({data:null,error:o}):a?await X(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:a.access_token,xform:n=>({data:n,error:null})}):this._returnResult({data:null,error:new yt})})}catch(r){if(q(r))return this._returnResult({data:null,error:r});throw r}}async _approveAuthorization(t,r){try{return await this._useSession(async a=>{let{data:{session:o},error:n}=a;if(n)return this._returnResult({data:null,error:n});if(!o)return this._returnResult({data:null,error:new yt});let s=await X(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:o.access_token,body:{action:"approve"},xform:i=>({data:i,error:null})});return s.data&&s.data.redirect_url&&at()&&!r?.skipBrowserRedirect&&window.location.assign(s.data.redirect_url),s})}catch(a){if(q(a))return this._returnResult({data:null,error:a});throw a}}async _denyAuthorization(t,r){try{return await this._useSession(async a=>{let{data:{session:o},error:n}=a;if(n)return this._returnResult({data:null,error:n});if(!o)return this._returnResult({data:null,error:new yt});let s=await X(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:o.access_token,body:{action:"deny"},xform:i=>({data:i,error:null})});return s.data&&s.data.redirect_url&&at()&&!r?.skipBrowserRedirect&&window.location.assign(s.data.redirect_url),s})}catch(a){if(q(a))return this._returnResult({data:null,error:a});throw a}}async _listOAuthGrants(){try{return await this._useSession(async t=>{let{data:{session:r},error:a}=t;return a?this._returnResult({data:null,error:a}):r?await X(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,xform:o=>({data:o,error:null})}):this._returnResult({data:null,error:new yt})})}catch(t){if(q(t))return this._returnResult({data:null,error:t});throw t}}async _revokeOAuthGrant(t){try{return await this._useSession(async r=>{let{data:{session:a},error:o}=r;return o?this._returnResult({data:null,error:o}):a?(await X(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:a.access_token,query:{client_id:t.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new yt})})}catch(r){if(q(r))return this._returnResult({data:null,error:r});throw r}}async fetchJwk(t,r={keys:[]}){let a=r.keys.find(i=>i.kid===t);if(a)return a;let o=Date.now();if(a=this.jwks.keys.find(i=>i.kid===t),a&&this.jwks_cached_at+CS>o)return a;let{data:n,error:s}=await X(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(s)throw s;return!n.keys||n.keys.length===0||(this.jwks=n,this.jwks_cached_at=o,a=n.keys.find(i=>i.kid===t),!a)?null:a}async getClaims(t,r={}){try{let a=t;if(!a){let{data:h,error:x}=await this.getSession();if(x||!h.session)return this._returnResult({data:null,error:x});a=h.session.access_token}let{header:o,payload:n,signature:s,raw:{header:i,payload:l}}=Pd(a);r?.allowExpired||BS(n.exp);let u=!o.alg||o.alg.startsWith("HS")||!o.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(o.kid,r?.keys?{keys:r.keys}:r?.jwks);if(!u){let{error:h}=await this.getUser(a);if(h)throw h;return{data:{claims:n,header:o,signature:s},error:null}}let c=FS(o.alg),d=await crypto.subtle.importKey("jwk",u,c,!0,["verify"]);if(!await crypto.subtle.verify(c,d,s,_S(`${i}.${l}`)))throw new fn("Invalid JWT signature");return{data:{claims:n,header:o,signature:s},error:null}}catch(a){if(q(a))return this._returnResult({data:null,error:a});throw a}}};Dd.nextInstanceID={};var Og=Dd;var FA=Og,Bg=FA;var UA="2.90.1",Jl="";typeof Deno<"u"?Jl="deno":typeof document<"u"?Jl="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Jl="react-native":Jl="node";var VA={"X-Client-Info":`supabase-js-${Jl}/${UA}`},jA={headers:VA},qA={schema:"public"},$A={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},HA={};function Ql(e){"@babel/helpers - typeof";return Ql=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},Ql(e)}function zA(e,t){if(Ql(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t||"default");if(Ql(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function WA(e){var t=zA(e,"string");return Ql(t)=="symbol"?t:t+""}function GA(e,t,r){return(t=WA(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tC(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,a)}return r}function He(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?tC(Object(r),!0).forEach(function(a){GA(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tC(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}var KA=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),XA=()=>Headers,JA=(e,t,r)=>{let a=KA(r),o=XA();return async(n,s)=>{var i;let l=(i=await t())!==null&&i!==void 0?i:e,u=new o(s?.headers);return u.has("apikey")||u.set("apikey",e),u.has("Authorization")||u.set("Authorization",`Bearer ${l}`),a(n,He(He({},s),{},{headers:u}))}};function QA(e){return e.endsWith("/")?e:e+"/"}function YA(e,t){var r,a;let{db:o,auth:n,realtime:s,global:i}=e,{db:l,auth:u,realtime:c,global:d}=t,f={db:He(He({},l),o),auth:He(He({},u),n),realtime:He(He({},c),s),storage:{},global:He(He(He({},d),i),{},{headers:He(He({},(r=d?.headers)!==null&&r!==void 0?r:{}),(a=i?.headers)!==null&&a!==void 0?a:{})}),accessToken:async()=>""};return e.accessToken?f.accessToken=e.accessToken:delete f.accessToken,f}function ZA(e){let t=e?.trim();if(!t)throw new Error("supabaseUrl is required.");if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(QA(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var eR=class extends Bg{constructor(e){super(e)}},tR=class{constructor(e,t,r){var a,o;this.supabaseUrl=e,this.supabaseKey=t;let n=ZA(e);if(!t)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",n),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",n),this.storageUrl=new URL("storage/v1",n),this.functionsUrl=new URL("functions/v1",n);let s=`sb-${n.hostname.split(".")[0]}-auth-token`,i={db:qA,realtime:HA,auth:He(He({},$A),{},{storageKey:s}),global:jA},l=YA(r??{},i);if(this.storageKey=(a=l.auth.storageKey)!==null&&a!==void 0?a:"",this.headers=(o=l.global.headers)!==null&&o!==void 0?o:{},l.accessToken)this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(c,d)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(d)} is not possible`)}});else{var u;this.auth=this._initSupabaseAuthClient((u=l.auth)!==null&&u!==void 0?u:{},this.headers,l.global.fetch)}this.fetch=JA(t,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(He({headers:this.headers,accessToken:this._getAccessToken.bind(this)},l.realtime)),this.accessToken&&this.accessToken().then(c=>this.realtime.setAuth(c)).catch(c=>console.warn("Failed to set initial Realtime auth token:",c)),this.rest=new tS(new URL("rest/v1",n).href,{headers:this.headers,schema:l.db.schema,fetch:this.fetch}),this.storage=new yS(this.storageUrl.href,this.headers,this.fetch,r?.storage),l.accessToken||this._listenForAuthEvents()}get functions(){return new Fl(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,r)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e=this,t,r;if(e.accessToken)return await e.accessToken();let{data:a}=await e.auth.getSession();return(t=(r=a.session)===null||r===void 0?void 0:r.access_token)!==null&&t!==void 0?t:e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:a,userStorage:o,storageKey:n,flowType:s,lock:i,debug:l,throwOnError:u},c,d){let f={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new eR({url:this.authUrl.href,headers:He(He({},f),c),storageKey:n,autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:a,userStorage:o,flowType:s,lock:i,debug:l,throwOnError:u,fetch:d,hasCustomAuthorizationHeader:Object.keys(this.headers).some(h=>h.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new _s(this.realtimeUrl.href,He(He({},e),{},{params:He(He({},{apikey:this.supabaseKey}),e?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",t?.access_token)})}_handleTokenChanged(e,t,r){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}},rC=(e,t,r)=>new tR(e,t,r);function rR(){if(typeof window<"u")return!1;let e=globalThis.process;if(!e)return!1;let t=e.version;if(t==null)return!1;let r=t.match(/^v(\d+)\./);return r?parseInt(r[1],10)<=18:!1}rR()&&console.warn("\u26A0\uFE0F Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");function aC(e){var t,r,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=aC(e[t]))&&(a&&(a+=" "),a+=r)}else for(r in e)e[r]&&(a&&(a+=" "),a+=r);return a}function Nd(){for(var e,t,r=0,a="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=aC(e))&&(a&&(a+=" "),a+=t);return a}var aR=e=>{let t=nR(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:s=>{let i=s.split("-");return i[0]===""&&i.length!==1&&i.shift(),sC(i,t)||oR(s)},getConflictingClassGroupIds:(s,i)=>{let l=r[s]||[];return i&&a[s]?[...l,...a[s]]:l}}},sC=(e,t)=>{if(e.length===0)return t.classGroupId;let r=e[0],a=t.nextPart.get(r),o=a?sC(e.slice(1),a):void 0;if(o)return o;if(t.validators.length===0)return;let n=e.join("-");return t.validators.find(({validator:s})=>s(n))?.classGroupId},oC=/^\[(.+)\]$/,oR=e=>{if(oC.test(e)){let t=oC.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},nR=e=>{let{theme:t,prefix:r}=e,a={nextPart:new Map,validators:[]};return iR(Object.entries(e.classGroups),r).forEach(([n,s])=>{Ug(s,a,n,t)}),a},Ug=(e,t,r,a)=>{e.forEach(o=>{if(typeof o=="string"){let n=o===""?t:nC(t,o);n.classGroupId=r;return}if(typeof o=="function"){if(sR(o)){Ug(o(a),t,r,a);return}t.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([n,s])=>{Ug(s,nC(t,n),r,a)})})},nC=(e,t)=>{let r=e;return t.split("-").forEach(a=>{r.nextPart.has(a)||r.nextPart.set(a,{nextPart:new Map,validators:[]}),r=r.nextPart.get(a)}),r},sR=e=>e.isThemeGetter,iR=(e,t)=>t?e.map(([r,a])=>{let o=a.map(n=>typeof n=="string"?t+n:typeof n=="object"?Object.fromEntries(Object.entries(n).map(([s,i])=>[t+s,i])):n);return[r,o]}):e,lR=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,a=new Map,o=(n,s)=>{r.set(n,s),t++,t>e&&(t=0,a=r,r=new Map)};return{get(n){let s=r.get(n);if(s!==void 0)return s;if((s=a.get(n))!==void 0)return o(n,s),s},set(n,s){r.has(n)?r.set(n,s):o(n,s)}}};var uR=e=>{let{separator:t,experimentalParseClassName:r}=e,a=t.length===1,o=t[0],n=t.length,s=i=>{let l=[],u=0,c=0,d;for(let C=0;C<i.length;C++){let m=i[C];if(u===0){if(m===o&&(a||i.slice(C,C+n)===t)){l.push(i.slice(c,C)),c=C+n;continue}if(m==="/"){d=C;continue}}m==="["?u++:m==="]"&&u--}let f=l.length===0?i:i.substring(c),h=f.startsWith("!"),x=h?f.substring(1):f,w=d&&d>c?d-c:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:x,maybePostfixModifierPosition:w}};return r?i=>r({className:i,parseClassName:s}):s},cR=e=>{if(e.length<=1)return e;let t=[],r=[];return e.forEach(a=>{a[0]==="["?(t.push(...r.sort(),a),r=[]):r.push(a)}),t.push(...r.sort()),t},dR=e=>({cache:lR(e.cacheSize),parseClassName:uR(e),...aR(e)}),fR=/\s+/,pR=(e,t)=>{let{parseClassName:r,getClassGroupId:a,getConflictingClassGroupIds:o}=t,n=[],s=e.trim().split(fR),i="";for(let l=s.length-1;l>=0;l-=1){let u=s[l],{modifiers:c,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:h}=r(u),x=!!h,w=a(x?f.substring(0,h):f);if(!w){if(!x){i=u+(i.length>0?" "+i:i);continue}if(w=a(f),!w){i=u+(i.length>0?" "+i:i);continue}x=!1}let C=cR(c).join(":"),m=d?C+"!":C,g=m+w;if(n.includes(g))continue;n.push(g);let y=o(w,x);for(let b=0;b<y.length;++b){let k=y[b];n.push(m+k)}i=u+(i.length>0?" "+i:i)}return i};function hR(){let e=0,t,r,a="";for(;e<arguments.length;)(t=arguments[e++])&&(r=iC(t))&&(a&&(a+=" "),a+=r);return a}var iC=e=>{if(typeof e=="string")return e;let t,r="";for(let a=0;a<e.length;a++)e[a]&&(t=iC(e[a]))&&(r&&(r+=" "),r+=t);return r};function mR(e,...t){let r,a,o,n=s;function s(l){let u=t.reduce((c,d)=>d(c),e());return r=dR(u),a=r.cache.get,o=r.cache.set,n=i,i(l)}function i(l){let u=a(l);if(u)return u;let c=pR(l,r);return o(l,c),c}return function(){return n(hR.apply(null,arguments))}}var Ae=e=>{let t=r=>r[e]||[];return t.isThemeGetter=!0,t},lC=/^\[(?:([a-z-]+):)?(.+)\]$/i,gR=/^\d+\/\d+$/,yR=new Set(["px","full","screen"]),vR=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,xR=/\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$/,wR=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,SR=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,CR=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Pa=e=>Ds(e)||yR.has(e)||gR.test(e),yo=e=>Ns(e,"length",AR),Ds=e=>!!e&&!Number.isNaN(Number(e)),Fg=e=>Ns(e,"number",Ds),Yl=e=>!!e&&Number.isInteger(Number(e)),bR=e=>e.endsWith("%")&&Ds(e.slice(0,-1)),te=e=>lC.test(e),vo=e=>vR.test(e),LR=new Set(["length","size","percentage"]),IR=e=>Ns(e,LR,uC),kR=e=>Ns(e,"position",uC),PR=new Set(["image","url"]),TR=e=>Ns(e,PR,ER),_R=e=>Ns(e,"",RR),Zl=()=>!0,Ns=(e,t,r)=>{let a=lC.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):r(a[2]):!1},AR=e=>xR.test(e)&&!wR.test(e),uC=()=>!1,RR=e=>SR.test(e),ER=e=>CR.test(e);var DR=()=>{let e=Ae("colors"),t=Ae("spacing"),r=Ae("blur"),a=Ae("brightness"),o=Ae("borderColor"),n=Ae("borderRadius"),s=Ae("borderSpacing"),i=Ae("borderWidth"),l=Ae("contrast"),u=Ae("grayscale"),c=Ae("hueRotate"),d=Ae("invert"),f=Ae("gap"),h=Ae("gradientColorStops"),x=Ae("gradientColorStopPositions"),w=Ae("inset"),C=Ae("margin"),m=Ae("opacity"),g=Ae("padding"),y=Ae("saturate"),b=Ae("scale"),k=Ae("sepia"),I=Ae("skew"),A=Ae("space"),R=Ae("translate"),F=()=>["auto","contain","none"],j=()=>["auto","hidden","clip","visible","scroll"],ye=()=>["auto",te,t],de=()=>[te,t],Uo=()=>["",Pa,yo],ia=()=>["auto",Ds,te],W=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Vo=()=>["solid","dashed","dotted","double","none"],De=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],St=()=>["start","end","center","between","around","evenly","stretch"],Rt=()=>["","0",te],Ft=()=>["auto","avoid","all","avoid-page","page","left","right","column"],We=()=>[Ds,te];return{cacheSize:500,separator:":",theme:{colors:[Zl],spacing:[Pa,yo],blur:["none","",vo,te],brightness:We(),borderColor:[e],borderRadius:["none","","full",vo,te],borderSpacing:de(),borderWidth:Uo(),contrast:We(),grayscale:Rt(),hueRotate:We(),invert:Rt(),gap:de(),gradientColorStops:[e],gradientColorStopPositions:[bR,yo],inset:ye(),margin:ye(),opacity:We(),padding:de(),saturate:We(),scale:We(),sepia:Rt(),skew:We(),space:de(),translate:de()},classGroups:{aspect:[{aspect:["auto","square","video",te]}],container:["container"],columns:[{columns:[vo]}],"break-after":[{"break-after":Ft()}],"break-before":[{"break-before":Ft()}],"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:[...W(),te]}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:F()}],"overscroll-x":[{"overscroll-x":F()}],"overscroll-y":[{"overscroll-y":F()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Yl,te]}],basis:[{basis:ye()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",te]}],grow:[{grow:Rt()}],shrink:[{shrink:Rt()}],order:[{order:["first","last","none",Yl,te]}],"grid-cols":[{"grid-cols":[Zl]}],"col-start-end":[{col:["auto",{span:["full",Yl,te]},te]}],"col-start":[{"col-start":ia()}],"col-end":[{"col-end":ia()}],"grid-rows":[{"grid-rows":[Zl]}],"row-start-end":[{row:["auto",{span:[Yl,te]},te]}],"row-start":[{"row-start":ia()}],"row-end":[{"row-end":ia()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",te]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",te]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...St()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...St(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...St(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[g]}],px:[{px:[g]}],py:[{py:[g]}],ps:[{ps:[g]}],pe:[{pe:[g]}],pt:[{pt:[g]}],pr:[{pr:[g]}],pb:[{pb:[g]}],pl:[{pl:[g]}],m:[{m:[C]}],mx:[{mx:[C]}],my:[{my:[C]}],ms:[{ms:[C]}],me:[{me:[C]}],mt:[{mt:[C]}],mr:[{mr:[C]}],mb:[{mb:[C]}],ml:[{ml:[C]}],"space-x":[{"space-x":[A]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[A]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",te,t]}],"min-w":[{"min-w":[te,t,"min","max","fit"]}],"max-w":[{"max-w":[te,t,"none","full","min","max","fit","prose",{screen:[vo]},vo]}],h:[{h:[te,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[te,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[te,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[te,t,"auto","min","max","fit"]}],"font-size":[{text:["base",vo,yo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Fg]}],"font-family":[{font:[Zl]}],"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",te]}],"line-clamp":[{"line-clamp":["none",Ds,Fg]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Pa,te]}],"list-image":[{"list-image":["none",te]}],"list-style-type":[{list:["none","disc","decimal",te]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[m]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[m]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Vo(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Pa,yo]}],"underline-offset":[{"underline-offset":["auto",Pa,te]}],"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:de()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",te]}],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",te]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[m]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...W(),kR]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",IR]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},TR]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[n]}],"rounded-s":[{"rounded-s":[n]}],"rounded-e":[{"rounded-e":[n]}],"rounded-t":[{"rounded-t":[n]}],"rounded-r":[{"rounded-r":[n]}],"rounded-b":[{"rounded-b":[n]}],"rounded-l":[{"rounded-l":[n]}],"rounded-ss":[{"rounded-ss":[n]}],"rounded-se":[{"rounded-se":[n]}],"rounded-ee":[{"rounded-ee":[n]}],"rounded-es":[{"rounded-es":[n]}],"rounded-tl":[{"rounded-tl":[n]}],"rounded-tr":[{"rounded-tr":[n]}],"rounded-br":[{"rounded-br":[n]}],"rounded-bl":[{"rounded-bl":[n]}],"border-w":[{border:[i]}],"border-w-x":[{"border-x":[i]}],"border-w-y":[{"border-y":[i]}],"border-w-s":[{"border-s":[i]}],"border-w-e":[{"border-e":[i]}],"border-w-t":[{"border-t":[i]}],"border-w-r":[{"border-r":[i]}],"border-w-b":[{"border-b":[i]}],"border-w-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[m]}],"border-style":[{border:[...Vo(),"hidden"]}],"divide-x":[{"divide-x":[i]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[i]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[m]}],"divide-style":[{divide:Vo()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...Vo()]}],"outline-offset":[{"outline-offset":[Pa,te]}],"outline-w":[{outline:[Pa,yo]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Uo()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[m]}],"ring-offset-w":[{"ring-offset":[Pa,yo]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",vo,_R]}],"shadow-color":[{shadow:[Zl]}],opacity:[{opacity:[m]}],"mix-blend":[{"mix-blend":[...De(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":De()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[a]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",vo,te]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[y]}],sepia:[{sepia:[k]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[m]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[k]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",te]}],duration:[{duration:We()}],ease:[{ease:["linear","in","out","in-out",te]}],delay:[{delay:We()}],animate:[{animate:["none","spin","ping","pulse","bounce",te]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[Yl,te]}],"translate-x":[{"translate-x":[R]}],"translate-y":[{"translate-y":[R]}],"skew-x":[{"skew-x":[I]}],"skew-y":[{"skew-y":[I]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",te]}],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",te]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":de()}],"scroll-mx":[{"scroll-mx":de()}],"scroll-my":[{"scroll-my":de()}],"scroll-ms":[{"scroll-ms":de()}],"scroll-me":[{"scroll-me":de()}],"scroll-mt":[{"scroll-mt":de()}],"scroll-mr":[{"scroll-mr":de()}],"scroll-mb":[{"scroll-mb":de()}],"scroll-ml":[{"scroll-ml":de()}],"scroll-p":[{"scroll-p":de()}],"scroll-px":[{"scroll-px":de()}],"scroll-py":[{"scroll-py":de()}],"scroll-ps":[{"scroll-ps":de()}],"scroll-pe":[{"scroll-pe":de()}],"scroll-pt":[{"scroll-pt":de()}],"scroll-pr":[{"scroll-pr":de()}],"scroll-pb":[{"scroll-pb":de()}],"scroll-pl":[{"scroll-pl":de()}],"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",te]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Pa,yo,Fg]}],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"]}}};var cC=mR(DR);function nr(...e){return cC(Nd(e))}var hC=B(ce(),1);function Ve({className:e,type:t,...r}){return(0,hC.jsx)("input",{type:t,"data-slot":"input",className:nr("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...r})}var Ye=B(Q(),1);var gC=B(Q(),1);function mC(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function eu(...e){return t=>{let r=!1,a=e.map(o=>{let n=mC(o,t);return!r&&typeof n=="function"&&(r=!0),n});if(r)return()=>{for(let o=0;o<a.length;o++){let n=a[o];typeof n=="function"?n():mC(e[o],null)}}}}function Ta(...e){return gC.useCallback(eu(...e),e)}var Od=B(ce(),1),VR=Symbol.for("react.lazy"),Bd=Ye[" use ".trim().toString()];function jR(e){return typeof e=="object"&&e!==null&&"then"in e}function yC(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===VR&&"_payload"in e&&jR(e._payload)}function qR(e){let t=$R(e),r=Ye.forwardRef((a,o)=>{let{children:n,...s}=a;yC(n)&&typeof Bd=="function"&&(n=Bd(n._payload));let i=Ye.Children.toArray(n),l=i.find(zR);if(l){let u=l.props.children,c=i.map(d=>d===l?Ye.Children.count(u)>1?Ye.Children.only(null):Ye.isValidElement(u)?u.props.children:null:d);return(0,Od.jsx)(t,{...s,ref:o,children:Ye.isValidElement(u)?Ye.cloneElement(u,void 0,c):null})}return(0,Od.jsx)(t,{...s,ref:o,children:n})});return r.displayName=`${e}.Slot`,r}var vC=qR("Slot");function $R(e){let t=Ye.forwardRef((r,a)=>{let{children:o,...n}=r;if(yC(o)&&typeof Bd=="function"&&(o=Bd(o._payload)),Ye.isValidElement(o)){let s=GR(o),i=WR(n,o.props);return o.type!==Ye.Fragment&&(i.ref=a?eu(a,s):s),Ye.cloneElement(o,i)}return Ye.Children.count(o)>1?Ye.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var HR=Symbol("radix.slottable");function zR(e){return Ye.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===HR}function WR(e,t){let r={...t};for(let a in t){let o=e[a],n=t[a];/^on[A-Z]/.test(a)?o&&n?r[a]=(...i)=>{let l=n(...i);return o(...i),l}:o&&(r[a]=o):a==="style"?r[a]={...o,...n}:a==="className"&&(r[a]=[o,n].filter(Boolean).join(" "))}return{...e,...r}}function GR(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var xC=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,wC=Nd,SC=(e,t)=>r=>{var a;if(t?.variants==null)return wC(e,r?.class,r?.className);let{variants:o,defaultVariants:n}=t,s=Object.keys(o).map(u=>{let c=r?.[u],d=n?.[u];if(c===null)return null;let f=xC(c)||xC(d);return o[u][f]}),i=r&&Object.entries(r).reduce((u,c)=>{let[d,f]=c;return f===void 0||(u[d]=f),u},{}),l=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((u,c)=>{let{class:d,className:f,...h}=c;return Object.entries(h).every(x=>{let[w,C]=x;return Array.isArray(C)?C.includes({...n,...i}[w]):{...n,...i}[w]===C})?[...u,d,f]:u},[]);return wC(e,s,l,r?.class,r?.className)};var CC=B(ce(),1),KR=SC("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function dt({className:e,variant:t,size:r,asChild:a=!1,...o}){return(0,CC.jsx)(a?vC:"button",{"data-slot":"button",className:nr(KR({variant:t,size:r,className:e})),...o})}var KC=B(Q(),1);var z=B(Q(),1);var LC=B(Q(),1),e1=B(fd(),1);var ot=B(Q(),1);var Fd=B(ce(),1);function bC(e){let t=XR(e),r=ot.forwardRef((a,o)=>{let{children:n,...s}=a,i=ot.Children.toArray(n),l=i.find(QR);if(l){let u=l.props.children,c=i.map(d=>d===l?ot.Children.count(u)>1?ot.Children.only(null):ot.isValidElement(u)?u.props.children:null:d);return(0,Fd.jsx)(t,{...s,ref:o,children:ot.isValidElement(u)?ot.cloneElement(u,void 0,c):null})}return(0,Fd.jsx)(t,{...s,ref:o,children:n})});return r.displayName=`${e}.Slot`,r}function XR(e){let t=ot.forwardRef((r,a)=>{let{children:o,...n}=r;if(ot.isValidElement(o)){let s=ZR(o),i=YR(n,o.props);return o.type!==ot.Fragment&&(i.ref=a?eu(a,s):s),ot.cloneElement(o,i)}return ot.Children.count(o)>1?ot.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var JR=Symbol("radix.slottable");function QR(e){return ot.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===JR}function YR(e,t){let r={...t};for(let a in t){let o=e[a],n=t[a];/^on[A-Z]/.test(a)?o&&n?r[a]=(...i)=>{let l=n(...i);return o(...i),l}:o&&(r[a]=o):a==="style"?r[a]={...o,...n}:a==="className"&&(r[a]=[o,n].filter(Boolean).join(" "))}return{...e,...r}}function ZR(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var IC=B(ce(),1),t1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ms=t1.reduce((e,t)=>{let r=bC(`Primitive.${t}`),a=LC.forwardRef((o,n)=>{let{asChild:s,...i}=o,l=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),(0,IC.jsx)(l,{...i,ref:n})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});var zt=B(Q(),1);var kC=B(Q(),1),tu=globalThis?.document?kC.useLayoutEffect:()=>{};var PC=B(Q(),1);function r1(e,t){return PC.useReducer((r,a)=>t[r][a]??r,e)}var Os=e=>{let{present:t,children:r}=e,a=a1(t),o=typeof r=="function"?r({present:a.isPresent}):zt.Children.only(r),n=Ta(a.ref,o1(o));return typeof r=="function"||a.isPresent?zt.cloneElement(o,{ref:n}):null};Os.displayName="Presence";function a1(e){let[t,r]=zt.useState(),a=zt.useRef(null),o=zt.useRef(e),n=zt.useRef("none"),s=e?"mounted":"unmounted",[i,l]=r1(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return zt.useEffect(()=>{let u=Ud(a.current);n.current=i==="mounted"?u:"none"},[i]),tu(()=>{let u=a.current,c=o.current;if(c!==e){let f=n.current,h=Ud(u);e?l("MOUNT"):h==="none"||u?.display==="none"?l("UNMOUNT"):l(c&&f!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),tu(()=>{if(t){let u,c=t.ownerDocument.defaultView??window,d=h=>{let w=Ud(a.current).includes(CSS.escape(h.animationName));if(h.target===t&&w&&(l("ANIMATION_END"),!o.current)){let C=t.style.animationFillMode;t.style.animationFillMode="forwards",u=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},f=h=>{h.target===t&&(n.current=Ud(a.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{c.clearTimeout(u),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:zt.useCallback(u=>{a.current=u?getComputedStyle(u):null,r(u)},[])}}function Ud(e){return e?.animationName||"none"}function o1(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var _a=B(Q(),1),TC=B(ce(),1);function _C(e,t=[]){let r=[];function a(n,s){let i=_a.createContext(s),l=r.length;r=[...r,s];let u=d=>{let{scope:f,children:h,...x}=d,w=f?.[e]?.[l]||i,C=_a.useMemo(()=>x,Object.values(x));return(0,TC.jsx)(w.Provider,{value:C,children:h})};u.displayName=n+"Provider";function c(d,f){let h=f?.[e]?.[l]||i,x=_a.useContext(h);if(x)return x;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${n}\``)}return[u,c]}let o=()=>{let n=r.map(s=>_a.createContext(s));return function(i){let l=i?.[e]||n;return _a.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return o.scopeName=e,[a,n1(o,...t)]}function n1(...e){let t=e[0];if(e.length===1)return t;let r=()=>{let a=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(n){let s=a.reduce((i,{useScope:l,scopeName:u})=>{let d=l(n)[`__scope${u}`];return{...i,...d}},{});return _a.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}var Bs=B(Q(),1);function xo(e){let t=Bs.useRef(e);return Bs.useEffect(()=>{t.current=e}),Bs.useMemo(()=>(...r)=>t.current?.(...r),[])}var Vd=B(Q(),1),s1=B(ce(),1),i1=Vd.createContext(void 0);function AC(e){let t=Vd.useContext(i1);return e||t||"ltr"}function RC(e,[t,r]){return Math.min(r,Math.max(t,e))}var nB=!!(typeof window<"u"&&window.document&&window.document.createElement);function wo(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o.defaultPrevented)return t?.(o)}}var DC=B(Q(),1),he=B(ce(),1);function l1(e,t){return DC.useReducer((r,a)=>t[r][a]??r,e)}var Vg="ScrollArea",[NC,gB]=_C(Vg),[u1,Lr]=NC(Vg),MC=z.forwardRef((e,t)=>{let{__scopeScrollArea:r,type:a="hover",dir:o,scrollHideDelay:n=600,...s}=e,[i,l]=z.useState(null),[u,c]=z.useState(null),[d,f]=z.useState(null),[h,x]=z.useState(null),[w,C]=z.useState(null),[m,g]=z.useState(0),[y,b]=z.useState(0),[k,I]=z.useState(!1),[A,R]=z.useState(!1),F=Ta(t,ye=>l(ye)),j=AC(o);return(0,he.jsx)(u1,{scope:r,type:a,dir:j,scrollHideDelay:n,scrollArea:i,viewport:u,onViewportChange:c,content:d,onContentChange:f,scrollbarX:h,onScrollbarXChange:x,scrollbarXEnabled:k,onScrollbarXEnabledChange:I,scrollbarY:w,onScrollbarYChange:C,scrollbarYEnabled:A,onScrollbarYEnabledChange:R,onCornerWidthChange:g,onCornerHeightChange:b,children:(0,he.jsx)(Ms.div,{dir:j,...s,ref:F,style:{position:"relative","--radix-scroll-area-corner-width":m+"px","--radix-scroll-area-corner-height":y+"px",...e.style}})})});MC.displayName=Vg;var OC="ScrollAreaViewport",BC=z.forwardRef((e,t)=>{let{__scopeScrollArea:r,children:a,nonce:o,...n}=e,s=Lr(OC,r),i=z.useRef(null),l=Ta(t,i,s.onViewportChange);return(0,he.jsxs)(he.Fragment,{children:[(0,he.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),(0,he.jsx)(Ms.div,{"data-radix-scroll-area-viewport":"",...n,ref:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:(0,he.jsx)("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:a})})]})});BC.displayName=OC;var Qr="ScrollAreaScrollbar",jg=z.forwardRef((e,t)=>{let{forceMount:r,...a}=e,o=Lr(Qr,e.__scopeScrollArea),{onScrollbarXEnabledChange:n,onScrollbarYEnabledChange:s}=o,i=e.orientation==="horizontal";return z.useEffect(()=>(i?n(!0):s(!0),()=>{i?n(!1):s(!1)}),[i,n,s]),o.type==="hover"?(0,he.jsx)(c1,{...a,ref:t,forceMount:r}):o.type==="scroll"?(0,he.jsx)(d1,{...a,ref:t,forceMount:r}):o.type==="auto"?(0,he.jsx)(FC,{...a,ref:t,forceMount:r}):o.type==="always"?(0,he.jsx)(qg,{...a,ref:t}):null});jg.displayName=Qr;var c1=z.forwardRef((e,t)=>{let{forceMount:r,...a}=e,o=Lr(Qr,e.__scopeScrollArea),[n,s]=z.useState(!1);return z.useEffect(()=>{let i=o.scrollArea,l=0;if(i){let u=()=>{window.clearTimeout(l),s(!0)},c=()=>{l=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return i.addEventListener("pointerenter",u),i.addEventListener("pointerleave",c),()=>{window.clearTimeout(l),i.removeEventListener("pointerenter",u),i.removeEventListener("pointerleave",c)}}},[o.scrollArea,o.scrollHideDelay]),(0,he.jsx)(Os,{present:r||n,children:(0,he.jsx)(FC,{"data-state":n?"visible":"hidden",...a,ref:t})})}),d1=z.forwardRef((e,t)=>{let{forceMount:r,...a}=e,o=Lr(Qr,e.__scopeScrollArea),n=e.orientation==="horizontal",s=Hd(()=>l("SCROLL_END"),100),[i,l]=l1("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return z.useEffect(()=>{if(i==="idle"){let u=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(u)}},[i,o.scrollHideDelay,l]),z.useEffect(()=>{let u=o.viewport,c=n?"scrollLeft":"scrollTop";if(u){let d=u[c],f=()=>{let h=u[c];d!==h&&(l("SCROLL"),s()),d=h};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[o.viewport,n,l,s]),(0,he.jsx)(Os,{present:r||i!=="hidden",children:(0,he.jsx)(qg,{"data-state":i==="hidden"?"hidden":"visible",...a,ref:t,onPointerEnter:wo(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:wo(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),FC=z.forwardRef((e,t)=>{let r=Lr(Qr,e.__scopeScrollArea),{forceMount:a,...o}=e,[n,s]=z.useState(!1),i=e.orientation==="horizontal",l=Hd(()=>{if(r.viewport){let u=r.viewport.offsetWidth<r.viewport.scrollWidth,c=r.viewport.offsetHeight<r.viewport.scrollHeight;s(i?u:c)}},10);return Fs(r.viewport,l),Fs(r.content,l),(0,he.jsx)(Os,{present:a||n,children:(0,he.jsx)(qg,{"data-state":n?"visible":"hidden",...o,ref:t})})}),qg=z.forwardRef((e,t)=>{let{orientation:r="vertical",...a}=e,o=Lr(Qr,e.__scopeScrollArea),n=z.useRef(null),s=z.useRef(0),[i,l]=z.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=qC(i.viewport,i.content),c={...a,sizes:i,onSizesChange:l,hasThumb:u>0&&u<1,onThumbChange:f=>n.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function d(f,h){return y1(f,s.current,i,h)}return r==="horizontal"?(0,he.jsx)(f1,{...c,ref:t,onThumbPositionChange:()=>{if(o.viewport&&n.current){let f=o.viewport.scrollLeft,h=EC(f,i,o.dir);n.current.style.transform=`translate3d(${h}px, 0, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollLeft=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollLeft=d(f,o.dir))}}):r==="vertical"?(0,he.jsx)(p1,{...c,ref:t,onThumbPositionChange:()=>{if(o.viewport&&n.current){let f=o.viewport.scrollTop,h=EC(f,i);n.current.style.transform=`translate3d(0, ${h}px, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollTop=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollTop=d(f))}}):null}),f1=z.forwardRef((e,t)=>{let{sizes:r,onSizesChange:a,...o}=e,n=Lr(Qr,e.__scopeScrollArea),[s,i]=z.useState(),l=z.useRef(null),u=Ta(t,l,n.onScrollbarXChange);return z.useEffect(()=>{l.current&&i(getComputedStyle(l.current))},[l]),(0,he.jsx)(VC,{"data-orientation":"horizontal",...o,ref:u,sizes:r,style:{bottom:0,left:n.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:n.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":$d(r)+"px",...e.style},onThumbPointerDown:c=>e.onThumbPointerDown(c.x),onDragScroll:c=>e.onDragScroll(c.x),onWheelScroll:(c,d)=>{if(n.viewport){let f=n.viewport.scrollLeft+c.deltaX;e.onWheelScroll(f),HC(f,d)&&c.preventDefault()}},onResize:()=>{l.current&&n.viewport&&s&&a({content:n.viewport.scrollWidth,viewport:n.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:qd(s.paddingLeft),paddingEnd:qd(s.paddingRight)}})}})}),p1=z.forwardRef((e,t)=>{let{sizes:r,onSizesChange:a,...o}=e,n=Lr(Qr,e.__scopeScrollArea),[s,i]=z.useState(),l=z.useRef(null),u=Ta(t,l,n.onScrollbarYChange);return z.useEffect(()=>{l.current&&i(getComputedStyle(l.current))},[l]),(0,he.jsx)(VC,{"data-orientation":"vertical",...o,ref:u,sizes:r,style:{top:0,right:n.dir==="ltr"?0:void 0,left:n.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":$d(r)+"px",...e.style},onThumbPointerDown:c=>e.onThumbPointerDown(c.y),onDragScroll:c=>e.onDragScroll(c.y),onWheelScroll:(c,d)=>{if(n.viewport){let f=n.viewport.scrollTop+c.deltaY;e.onWheelScroll(f),HC(f,d)&&c.preventDefault()}},onResize:()=>{l.current&&n.viewport&&s&&a({content:n.viewport.scrollHeight,viewport:n.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:qd(s.paddingTop),paddingEnd:qd(s.paddingBottom)}})}})}),[h1,UC]=NC(Qr),VC=z.forwardRef((e,t)=>{let{__scopeScrollArea:r,sizes:a,hasThumb:o,onThumbChange:n,onThumbPointerUp:s,onThumbPointerDown:i,onThumbPositionChange:l,onDragScroll:u,onWheelScroll:c,onResize:d,...f}=e,h=Lr(Qr,r),[x,w]=z.useState(null),C=Ta(t,F=>w(F)),m=z.useRef(null),g=z.useRef(""),y=h.viewport,b=a.content-a.viewport,k=xo(c),I=xo(l),A=Hd(d,10);function R(F){if(m.current){let j=F.clientX-m.current.left,ye=F.clientY-m.current.top;u({x:j,y:ye})}}return z.useEffect(()=>{let F=j=>{let ye=j.target;x?.contains(ye)&&k(j,b)};return document.addEventListener("wheel",F,{passive:!1}),()=>document.removeEventListener("wheel",F,{passive:!1})},[y,x,b,k]),z.useEffect(I,[a,I]),Fs(x,A),Fs(h.content,A),(0,he.jsx)(h1,{scope:r,scrollbar:x,hasThumb:o,onThumbChange:xo(n),onThumbPointerUp:xo(s),onThumbPositionChange:I,onThumbPointerDown:xo(i),children:(0,he.jsx)(Ms.div,{...f,ref:C,style:{position:"absolute",...f.style},onPointerDown:wo(e.onPointerDown,F=>{F.button===0&&(F.target.setPointerCapture(F.pointerId),m.current=x.getBoundingClientRect(),g.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),R(F))}),onPointerMove:wo(e.onPointerMove,R),onPointerUp:wo(e.onPointerUp,F=>{let j=F.target;j.hasPointerCapture(F.pointerId)&&j.releasePointerCapture(F.pointerId),document.body.style.webkitUserSelect=g.current,h.viewport&&(h.viewport.style.scrollBehavior=""),m.current=null})})})}),jd="ScrollAreaThumb",$g=z.forwardRef((e,t)=>{let{forceMount:r,...a}=e,o=UC(jd,e.__scopeScrollArea);return(0,he.jsx)(Os,{present:r||o.hasThumb,children:(0,he.jsx)(m1,{ref:t,...a})})}),m1=z.forwardRef((e,t)=>{let{__scopeScrollArea:r,style:a,...o}=e,n=Lr(jd,r),s=UC(jd,r),{onThumbPositionChange:i}=s,l=Ta(t,d=>s.onThumbChange(d)),u=z.useRef(void 0),c=Hd(()=>{u.current&&(u.current(),u.current=void 0)},100);return z.useEffect(()=>{let d=n.viewport;if(d){let f=()=>{if(c(),!u.current){let h=v1(d,i);u.current=h,i()}};return i(),d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[n.viewport,c,i]),(0,he.jsx)(Ms.div,{"data-state":s.hasThumb?"visible":"hidden",...o,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...a},onPointerDownCapture:wo(e.onPointerDownCapture,d=>{let h=d.target.getBoundingClientRect(),x=d.clientX-h.left,w=d.clientY-h.top;s.onThumbPointerDown({x,y:w})}),onPointerUp:wo(e.onPointerUp,s.onThumbPointerUp)})});$g.displayName=jd;var Hg="ScrollAreaCorner",jC=z.forwardRef((e,t)=>{let r=Lr(Hg,e.__scopeScrollArea),a=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&a?(0,he.jsx)(g1,{...e,ref:t}):null});jC.displayName=Hg;var g1=z.forwardRef((e,t)=>{let{__scopeScrollArea:r,...a}=e,o=Lr(Hg,r),[n,s]=z.useState(0),[i,l]=z.useState(0),u=!!(n&&i);return Fs(o.scrollbarX,()=>{let c=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(c),l(c)}),Fs(o.scrollbarY,()=>{let c=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(c),s(c)}),u?(0,he.jsx)(Ms.div,{...a,ref:t,style:{width:n,height:i,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function qd(e){return e?parseInt(e,10):0}function qC(e,t){let r=e/t;return isNaN(r)?0:r}function $d(e){let t=qC(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,a=(e.scrollbar.size-r)*t;return Math.max(a,18)}function y1(e,t,r,a="ltr"){let o=$d(r),n=o/2,s=t||n,i=o-s,l=r.scrollbar.paddingStart+s,u=r.scrollbar.size-r.scrollbar.paddingEnd-i,c=r.content-r.viewport,d=a==="ltr"?[0,c]:[c*-1,0];return $C([l,u],d)(e)}function EC(e,t,r="ltr"){let a=$d(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,n=t.scrollbar.size-o,s=t.content-t.viewport,i=n-a,l=r==="ltr"?[0,s]:[s*-1,0],u=RC(e,l);return $C([0,s],[0,i])(u)}function $C(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let a=(t[1]-t[0])/(e[1]-e[0]);return t[0]+a*(r-e[0])}}function HC(e,t){return e>0&&e<t}var v1=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},a=0;return(function o(){let n={left:e.scrollLeft,top:e.scrollTop},s=r.left!==n.left,i=r.top!==n.top;(s||i)&&t(),r=n,a=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(a)};function Hd(e,t){let r=xo(e),a=z.useRef(0);return z.useEffect(()=>()=>window.clearTimeout(a.current),[]),z.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(r,t)},[r,t])}function Fs(e,t){let r=xo(t);tu(()=>{let a=0;if(e){let o=new ResizeObserver(()=>{cancelAnimationFrame(a),a=window.requestAnimationFrame(r)});return o.observe(e),()=>{window.cancelAnimationFrame(a),o.unobserve(e)}}},[e,r])}var zC=MC,WC=BC;var GC=jC;var So=B(ce(),1),zg=KC.forwardRef(({className:e,children:t,...r},a)=>(0,So.jsxs)(zC,{"data-slot":"scroll-area",className:nr("relative",e),...r,children:[(0,So.jsx)(WC,{ref:a,"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),(0,So.jsx)(w1,{}),(0,So.jsx)(GC,{})]}));zg.displayName="ScrollArea";function w1({className:e,orientation:t="vertical",...r}){return(0,So.jsx)(jg,{"data-slot":"scroll-area-scrollbar",orientation:t,className:nr("flex touch-none p-px transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...r,children:(0,So.jsx)($g,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}var Wd=B(Q());var XC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),S1=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,a)=>a?a.toUpperCase():r.toLowerCase()),Wg=e=>{let t=S1(e);return t.charAt(0).toUpperCase()+t.slice(1)},zd=(...e)=>e.filter((t,r,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===r).join(" ").trim(),JC=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var ru=B(Q());var QC={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"};var YC=(0,ru.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:a,className:o="",children:n,iconNode:s,...i},l)=>(0,ru.createElement)("svg",{ref:l,...QC,width:t,height:t,stroke:e,strokeWidth:a?Number(r)*24/Number(t):r,className:zd("lucide",o),...!n&&!JC(i)&&{"aria-hidden":"true"},...i},[...s.map(([u,c])=>(0,ru.createElement)(u,c)),...Array.isArray(n)?n:[n]]));var V=(e,t)=>{let r=(0,Wd.forwardRef)(({className:a,...o},n)=>(0,Wd.createElement)(YC,{ref:n,iconNode:t,className:zd(`lucide-${XC(Wg(e))}`,`lucide-${e}`,a),...o}));return r.displayName=Wg(e),r};var C1=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],au=V("activity",C1);var b1=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Us=V("arrow-left",b1);var L1=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],ou=V("arrow-up",L1);var I1=[["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"}]],nu=V("calendar",I1);var k1=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],su=V("chevron-down",k1);var P1=[["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"}]],Or=V("circle-alert",P1);var T1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],ft=V("circle-check",T1);var _1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Br=V("circle-x",_1);var A1=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Sn=V("clock",A1);var R1=[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]],Aa=V("command",R1);var E1=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],Ra=V("corner-down-left",E1);var D1=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],Cn=V("credit-card",D1);var N1=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],bn=V("crown",N1);var M1=[["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"}]],Ln=V("dollar-sign",M1);var O1=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],iu=V("download",O1);var B1=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],In=V("file-spreadsheet",B1);var F1=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],Vs=V("key",F1);var U1=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],lu=V("laptop",U1);var V1=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Pt=V("loader-circle",V1);var j1=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],js=V("mail",j1);var q1=[["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"}]],qs=V("map-pin",q1);var $1=[["path",{d:"M5 12h14",key:"1ays0h"}]],kn=V("minus",$1);var H1=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],uu=V("paperclip",H1);var z1=[["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"}]],$s=V("refresh-cw",z1);var W1=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Pn=V("search",W1);var G1=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],Hs=V("shield",G1);var K1=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],cu=V("smartphone",K1);var X1=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],sr=V("sparkles",X1);var J1=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],Wt=V("square-pen",J1);var Q1=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],du=V("trending-up",Q1);var Y1=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],zs=V("users",Y1);var Z1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Fr=V("x",Z1);var eE=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],fu=V("zap",eE);var hu=B(ce(),1),Yr=B(Q(),1);var ZC=B(Q(),1),Ws=(0,ZC.createContext)({});var eb=B(Q(),1);function Co(e){let t=(0,eb.useRef)(null);return t.current===null&&(t.current=e()),t.current}var Kg=B(ce(),1),nb=B(Q(),1),Tn=B(Q(),1);var tb=B(Q(),1),bo=(0,tb.createContext)(null);var ab=B(ce(),1),Gd=B(Q(),1),Ea=B(Q(),1);var rb=B(Q(),1),Gs=(0,rb.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});var Gg=class extends Gd.Component{getSnapshotBeforeUpdate(t){let r=this.props.childRef.current;if(r&&t.isPresent&&!this.props.isPresent){let a=this.props.sizeRef.current;a.height=r.offsetHeight||0,a.width=r.offsetWidth||0,a.top=r.offsetTop,a.left=r.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}};function ob({children:e,isPresent:t}){let r=(0,Ea.useId)(),a=(0,Ea.useRef)(null),o=(0,Ea.useRef)({width:0,height:0,top:0,left:0}),{nonce:n}=(0,Ea.useContext)(Gs);return(0,Ea.useInsertionEffect)(()=>{let{width:s,height:i,top:l,left:u}=o.current;if(t||!a.current||!s||!i)return;a.current.dataset.motionPopId=r;let c=document.createElement("style");return n&&(c.nonce=n),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(`
51
+ [data-motion-pop-id="${r}"] {
17
52
  position: absolute !important;
18
53
  width: ${s}px !important;
19
54
  height: ${i}px !important;
20
55
  top: ${l}px !important;
21
56
  left: ${u}px !important;
22
57
  }
23
- `),()=>{document.head.removeChild(d)}},[t]),(0,gL.jsx)(Xg,{isPresent:t,childRef:r,sizeRef:o,children:tf.cloneElement(e,{ref:r})})}var vL=({children:e,initial:t,isPresent:a,onExitComplete:r,custom:o,presenceAffectsLayout:n,mode:s})=>{let i=po(M_),l=(0,Cn.useId)(),u=(0,Cn.useCallback)(c=>{i.set(c,!0);for(let f of i.values())if(!f)return;r&&r()},[i,r]),d=(0,Cn.useMemo)(()=>({id:l,initial:t,isPresent:a,custom:o,onExitComplete:u,register:c=>(i.set(c,!1),()=>i.delete(c))}),n?[Math.random(),u]:[a,u]);return(0,Cn.useMemo)(()=>{i.forEach((c,f)=>i.set(f,!1))},[a]),xL.useEffect(()=>{!a&&!i.size&&r&&r()},[a]),s==="popLayout"&&(e=(0,Qg.jsx)(yL,{isPresent:a,children:e})),(0,Qg.jsx)(mo.Provider,{value:d,children:e})};function M_(){return new Map}var ho=F(K(),1);function af(e=!0){let t=(0,ho.useContext)(mo);if(t===null)return[!0,null];let{isPresent:a,onExitComplete:r,register:o}=t,n=(0,ho.useId)();(0,ho.useEffect)(()=>{e&&o(n)},[e]);let s=(0,ho.useCallback)(()=>e&&r&&r(n),[n,r,e]);return!a&&r?[!1,s]:[!0]}var rf=F(K(),1),gu=e=>e.key||"";function Jg(e){let t=[];return rf.Children.forEach(e,a=>{(0,rf.isValidElement)(a)&&t.push(a)}),t}var of=F(K(),1);var qs=typeof window<"u";var Hs=qs?of.useLayoutEffect:of.useEffect;var Yg=({children:e,custom:t,initial:a=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:n="sync",propagate:s=!1})=>{let[i,l]=af(s),u=(0,Wa.useMemo)(()=>Jg(e),[e]),d=s&&!i?[]:u.map(gu),c=(0,Wa.useRef)(!0),f=(0,Wa.useRef)(u),m=po(()=>new Map),[v,w]=(0,Wa.useState)(u),[S,h]=(0,Wa.useState)(u);Hs(()=>{c.current=!1,f.current=u;for(let L=0;L<S.length;L++){let I=gu(S[L]);d.includes(I)?m.delete(I):m.get(I)!==!0&&m.set(I,!1)}},[S,d.length,d.join("-")]);let g=[];if(u!==v){let L=[...u];for(let I=0;I<S.length;I++){let k=S[I],D=gu(k);d.includes(D)||(L.splice(I,0,k),g.push(k))}n==="wait"&&g.length&&(L=g),h(Jg(L)),w(u);return}let{forceRender:x}=(0,Wa.useContext)(Vs);return(0,yu.jsx)(yu.Fragment,{children:S.map(L=>{let I=gu(L),k=s&&!i?!1:u===S||d.includes(I),D=()=>{if(m.has(I))m.set(I,!0);else return;let _=!0;m.forEach(V=>{V||(_=!1)}),_&&(x?.(),h(f.current),s&&l?.(),r&&r())};return(0,yu.jsx)(vL,{isPresent:k,initial:!c.current||a?void 0:!1,custom:k?void 0:t,presenceAffectsLayout:o,mode:n,onExitComplete:k?void 0:D,children:L},I)})})};var ye=e=>e;var br=ye,qt=ye;function Sn(e){let t;return()=>(t===void 0&&(t=e()),t)}var aa=(e,t,a)=>{let r=t-e;return r===0?1:(a-e)/r};var He=e=>e*1e3,ft=e=>e/1e3;var zs={skipAnimations:!1,useManualTiming:!1};function wL(e){let t=new Set,a=new Set,r=!1,o=!1,n=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1};function i(u){n.has(u)&&(l.schedule(u),e()),u(s)}let l={schedule:(u,d=!1,c=!1)=>{let m=c&&r?t:a;return d&&n.add(u),m.has(u)||m.add(u),u},cancel:u=>{a.delete(u),n.delete(u)},process:u=>{if(s=u,r){o=!0;return}r=!0,[t,a]=[a,t],t.forEach(i),t.clear(),r=!1,o&&(o=!1,l.process(u))}};return l}var nf=["read","resolveKeyframes","update","preRender","render","postRender"],N_=40;function sf(e,t){let a=!1,r=!0,o={delta:0,timestamp:0,isProcessing:!1},n=()=>a=!0,s=nf.reduce((h,g)=>(h[g]=wL(n),h),{}),{read:i,resolveKeyframes:l,update:u,preRender:d,render:c,postRender:f}=s,m=()=>{let h=zs.useManualTiming?o.timestamp:performance.now();a=!1,o.delta=r?1e3/60:Math.max(Math.min(h-o.timestamp,N_),1),o.timestamp=h,o.isProcessing=!0,i.process(o),l.process(o),u.process(o),d.process(o),c.process(o),f.process(o),o.isProcessing=!1,a&&t&&(r=!1,e(m))},v=()=>{a=!0,r=!0,o.isProcessing||e(m)};return{schedule:nf.reduce((h,g)=>{let x=s[g];return h[g]=(L,I=!1,k=!1)=>(a||v(),x.schedule(L,I,k)),h},{}),cancel:h=>{for(let g=0;g<nf.length;g++)s[nf[g]].cancel(h)},state:o,steps:s}}var{schedule:te,cancel:ra,state:ze,steps:lf}=sf(typeof requestAnimationFrame<"u"?requestAnimationFrame:ye,!0);var CL=F(K(),1),uf=(0,CL.createContext)({strict:!1});var SL={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"]},Ir={};for(let e in SL)Ir[e]={isEnabled:t=>SL[e].some(a=>!!t[a])};function LL(e){for(let t in e)Ir[t]={...Ir[t],...e[t]}}var O_=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 xu(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||O_.has(e)}var bL=e=>!xu(e);function F_(e){e&&(bL=t=>t.startsWith("on")?!xu(t):e(t))}try{F_(yP("@emotion/is-prop-valid").default)}catch{}function IL(e,t,a){let r={};for(let o in e)o==="values"&&typeof e.values=="object"||(bL(o)||a===!0&&xu(o)||!t&&!xu(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}function kL(e){if(typeof Proxy>"u")return e;let t=new Map,a=(...r)=>e(...r);return new Proxy(a,{get:(r,o)=>o==="create"?e:(t.has(o)||t.set(o,e(o)),t.get(o))})}var hf=F(le(),1);var Gs=F(K(),1);var PL=F(K(),1),go=(0,PL.createContext)({});var ff=F(K(),1);function kr(e){return typeof e=="string"||Array.isArray(e)}function yo(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}var df=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],vu=["initial",...df];function Ln(e){return yo(e.animate)||vu.some(t=>kr(e[t]))}function cf(e){return!!(Ln(e)||e.variants)}function TL(e,t){if(Ln(e)){let{initial:a,animate:r}=e;return{initial:a===!1||kr(a)?a:void 0,animate:kr(r)?r:void 0}}return e.inherit!==!1?t:{}}function RL(e){let{initial:t,animate:a}=TL(e,(0,ff.useContext)(go));return(0,ff.useMemo)(()=>({initial:t,animate:a}),[AL(t),AL(a)])}function AL(e){return Array.isArray(e)?e.join(" "):e}var _L=Symbol.for("motionComponentSymbol");var EL=F(K(),1);function Pr(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function DL(e,t,a){return(0,EL.useCallback)(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),a&&(typeof a=="function"?a(r):Pr(a)&&(a.current=r))},[t])}var Ht=F(K(),1);var $s=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase();var B_="framerAppearId",pf="data-"+$s(B_);var{schedule:Ws,cancel:LV}=sf(queueMicrotask,!1);var ML=F(K(),1),mf=(0,ML.createContext)({});function NL(e,t,a,r,o){var n,s;let{visualElement:i}=(0,Ht.useContext)(go),l=(0,Ht.useContext)(uf),u=(0,Ht.useContext)(mo),d=(0,Ht.useContext)(js).reducedMotion,c=(0,Ht.useRef)(null);r=r||l.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:i,props:a,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d}));let f=c.current,m=(0,Ht.useContext)(mf);f&&!f.projection&&o&&(f.type==="html"||f.type==="svg")&&U_(c.current,a,o,m);let v=(0,Ht.useRef)(!1);(0,Ht.useInsertionEffect)(()=>{f&&v.current&&f.update(a,u)});let w=a[pf],S=(0,Ht.useRef)(!!w&&!(!((n=window.MotionHandoffIsComplete)===null||n===void 0)&&n.call(window,w))&&((s=window.MotionHasOptimisedAnimation)===null||s===void 0?void 0:s.call(window,w)));return Hs(()=>{f&&(v.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),Ws.render(f.render),S.current&&f.animationState&&f.animationState.animateChanges())}),(0,Ht.useEffect)(()=>{f&&(!S.current&&f.animationState&&f.animationState.animateChanges(),S.current&&(queueMicrotask(()=>{var h;(h=window.MotionHandoffMarkAsComplete)===null||h===void 0||h.call(window,w)}),S.current=!1))}),f}function U_(e,t,a,r){let{layoutId:o,layout:n,drag:s,dragConstraints:i,layoutScroll:l,layoutRoot:u}=t;e.projection=new a(e.latestValues,t["data-framer-portal-id"]?void 0:OL(e.parent)),e.projection.setOptions({layoutId:o,layout:n,alwaysMeasureLayout:!!s||i&&Pr(i),visualElement:e,animationType:typeof n=="string"?n:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:u})}function OL(e){if(e)return e.options.allowProjection!==!1?e.projection:OL(e.parent)}function FL({preloadedFeatures:e,createVisualElement:t,useRender:a,useVisualState:r,Component:o}){var n,s;e&&LL(e);function i(u,d){let c,f={...(0,Gs.useContext)(js),...u,layoutId:V_(u)},{isStatic:m}=f,v=RL(u),w=r(u,m);if(!m&&qs){j_(f,e);let S=q_(f);c=S.MeasureLayout,v.visualElement=NL(o,w,f,t,S.ProjectionNode)}return(0,hf.jsxs)(go.Provider,{value:v,children:[c&&v.visualElement?(0,hf.jsx)(c,{visualElement:v.visualElement,...f}):null,a(o,u,DL(w,v.visualElement,d),w,m,v.visualElement)]})}i.displayName=`motion.${typeof o=="string"?o:`create(${(s=(n=o.displayName)!==null&&n!==void 0?n:o.name)!==null&&s!==void 0?s:""})`}`;let l=(0,Gs.forwardRef)(i);return l[_L]=o,l}function V_({layoutId:e}){let t=(0,Gs.useContext)(Vs).id;return t&&e!==void 0?t+"-"+e:e}function j_(e,t){let a=(0,Gs.useContext)(uf).strict}function q_(e){let{drag:t,layout:a}=Ir;if(!t&&!a)return{};let r={...t,...a};return{MeasureLayout:t?.isEnabled(e)||a?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}var BL=["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 Ks(e){return typeof e!="string"||e.includes("-")?!1:!!(BL.indexOf(e)>-1||/[A-Z]/u.test(e))}var Zg=F(K(),1);function UL(e){let t=[{},{}];return e?.values.forEach((a,r)=>{t[0][r]=a.get(),t[1][r]=a.getVelocity()}),t}function Xs(e,t,a,r){if(typeof t=="function"){let[o,n]=UL(r);t=t(a!==void 0?a:e.custom,o,n)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){let[o,n]=UL(r);t=t(a!==void 0?a:e.custom,o,n)}return t}var wu=e=>Array.isArray(e);var VL=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),jL=e=>wu(e)?e[e.length-1]||0:e;var Se=e=>!!(e&&e.getVelocity);function Qs(e){let t=Se(e)?e.get():e;return VL(t)?t.toValue():t}function H_({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:a},r,o,n){let s={latestValues:z_(r,o,n,e),renderState:t()};return a&&(s.onMount=i=>a({props:r,current:i,...s}),s.onUpdate=i=>a(i)),s}var gf=e=>(t,a)=>{let r=(0,Zg.useContext)(go),o=(0,Zg.useContext)(mo),n=()=>H_(e,t,r,o);return a?n():po(n)};function z_(e,t,a,r){let o={},n=r(e,{});for(let f in n)o[f]=Qs(n[f]);let{initial:s,animate:i}=e,l=Ln(e),u=cf(e);t&&u&&!l&&e.inherit!==!1&&(s===void 0&&(s=t.initial),i===void 0&&(i=t.animate));let d=a?a.initial===!1:!1;d=d||s===!1;let c=d?i:s;if(c&&typeof c!="boolean"&&!yo(c)){let f=Array.isArray(c)?c:[c];for(let m=0;m<f.length;m++){let v=Xs(e,f[m]);if(v){let{transitionEnd:w,transition:S,...h}=v;for(let g in h){let x=h[g];if(Array.isArray(x)){let L=d?x.length-1:0;x=x[L]}x!==null&&(o[g]=x)}for(let g in w)o[g]=w[g]}}}return o}var Ga=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],zt=new Set(Ga);var qL=e=>t=>typeof t=="string"&&t.startsWith(e),yf=qL("--"),$_=qL("var(--"),Js=e=>$_(e)?W_.test(e.split("/*")[0].trim()):!1,W_=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;var xf=(e,t)=>t&&typeof e=="number"?t.transform(e):e;var pt=(e,t,a)=>a>t?t:a<e?e:a;var Ka={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Tr={...Ka,transform:e=>pt(0,1,e)},Cu={...Ka,default:1};var Su=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Xa=Su("deg"),_t=Su("%"),H=Su("px"),HL=Su("vh"),zL=Su("vw"),ey={..._t,parse:e=>_t.parse(e)/100,transform:e=>_t.transform(e*100)};var $L={borderWidth:H,borderTopWidth:H,borderRightWidth:H,borderBottomWidth:H,borderLeftWidth:H,borderRadius:H,radius:H,borderTopLeftRadius:H,borderTopRightRadius:H,borderBottomRightRadius:H,borderBottomLeftRadius:H,width:H,maxWidth:H,height:H,maxHeight:H,top:H,right:H,bottom:H,left:H,padding:H,paddingTop:H,paddingRight:H,paddingBottom:H,paddingLeft:H,margin:H,marginTop:H,marginRight:H,marginBottom:H,marginLeft:H,backgroundPositionX:H,backgroundPositionY:H};var WL={rotate:Xa,rotateX:Xa,rotateY:Xa,rotateZ:Xa,scale:Cu,scaleX:Cu,scaleY:Cu,scaleZ:Cu,skew:Xa,skewX:Xa,skewY:Xa,distance:H,translateX:H,translateY:H,translateZ:H,x:H,y:H,z:H,perspective:H,transformPerspective:H,opacity:Tr,originX:ey,originY:ey,originZ:H};var ty={...Ka,transform:Math.round};var Ys={...$L,...WL,zIndex:ty,size:H,fillOpacity:Tr,strokeOpacity:Tr,numOctaves:ty};var G_={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},K_=Ga.length;function GL(e,t,a){let r="",o=!0;for(let n=0;n<K_;n++){let s=Ga[n],i=e[s];if(i===void 0)continue;let l=!0;if(typeof i=="number"?l=i===(s.startsWith("scale")?1:0):l=parseFloat(i)===0,!l||a){let u=xf(i,Ys[s]);if(!l){o=!1;let d=G_[s]||s;r+=`${d}(${u}) `}a&&(t[s]=u)}}return r=r.trim(),a?r=a(t,o?"":r):o&&(r="none"),r}function Zs(e,t,a){let{style:r,vars:o,transformOrigin:n}=e,s=!1,i=!1;for(let l in t){let u=t[l];if(zt.has(l)){s=!0;continue}else if(yf(l)){o[l]=u;continue}else{let d=xf(u,Ys[l]);l.startsWith("origin")?(i=!0,n[l]=d):r[l]=d}}if(t.transform||(s||a?r.transform=GL(t,e.transform,a):r.transform&&(r.transform="none")),i){let{originX:l="50%",originY:u="50%",originZ:d=0}=n;r.transformOrigin=`${l} ${u} ${d}`}}var X_={offset:"stroke-dashoffset",array:"stroke-dasharray"},Q_={offset:"strokeDashoffset",array:"strokeDasharray"};function KL(e,t,a=1,r=0,o=!0){e.pathLength=1;let n=o?X_:Q_;e[n.offset]=H.transform(-r);let s=H.transform(t),i=H.transform(a);e[n.array]=`${s} ${i}`}function XL(e,t,a){return typeof e=="string"?e:H.transform(t+a*e)}function QL(e,t,a){let r=XL(t,e.x,e.width),o=XL(a,e.y,e.height);return`${r} ${o}`}function ei(e,{attrX:t,attrY:a,attrScale:r,originX:o,originY:n,pathLength:s,pathSpacing:i=1,pathOffset:l=0,...u},d,c){if(Zs(e,u,c),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:f,style:m,dimensions:v}=e;f.transform&&(v&&(m.transform=f.transform),delete f.transform),v&&(o!==void 0||n!==void 0||m.transform)&&(m.transformOrigin=QL(v,o!==void 0?o:.5,n!==void 0?n:.5)),t!==void 0&&(f.x=t),a!==void 0&&(f.y=a),r!==void 0&&(f.scale=r),s!==void 0&&KL(f,s,i,l,!1)}var ti=()=>({style:{},transform:{},transformOrigin:{},vars:{}});var vf=()=>({...ti(),attrs:{}});var ai=e=>typeof e=="string"&&e.toLowerCase()==="svg";function wf(e,{style:t,vars:a},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(let n in a)e.style.setProperty(n,a[n])}var Cf=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 Sf(e,t,a,r){wf(e,t,void 0,r);for(let o in t.attrs)e.setAttribute(Cf.has(o)?o:$s(o),t.attrs[o])}var ri={};function JL(e){Object.assign(ri,e)}function Lf(e,{layout:t,layoutId:a}){return zt.has(e)||e.startsWith("origin")||(t||a!==void 0)&&(!!ri[e]||e==="opacity")}function oi(e,t,a){var r;let{style:o}=e,n={};for(let s in o)(Se(o[s])||t.style&&Se(t.style[s])||Lf(s,e)||((r=a?.getValue(s))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(n[s]=o[s]);return n}function bf(e,t,a){let r=oi(e,t,a);for(let o in e)if(Se(e[o])||Se(t[o])){let n=Ga.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[n]=e[o]}return r}function J_(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}var YL=["x","y","width","height","cx","cy","r"],ZL={useVisualState:gf({scrapeMotionValuesFromProps:bf,createRenderState:vf,onUpdate:({props:e,prevProps:t,current:a,renderState:r,latestValues:o})=>{if(!a)return;let n=!!e.drag;if(!n){for(let i in o)if(zt.has(i)){n=!0;break}}if(!n)return;let s=!t;if(t)for(let i=0;i<YL.length;i++){let l=YL[i];e[l]!==t[l]&&(s=!0)}s&&te.read(()=>{J_(a,r),te.render(()=>{ei(r,o,ai(a.tagName),e.transformTemplate),Sf(a,r)})})}})};var eb={useVisualState:gf({scrapeMotionValuesFromProps:oi,createRenderState:ti})};var ni=F(K(),1);var tb=F(K(),1);function ay(e,t,a){for(let r in t)!Se(t[r])&&!Lf(r,a)&&(e[r]=t[r])}function Y_({transformTemplate:e},t){return(0,tb.useMemo)(()=>{let a=ti();return Zs(a,t,e),Object.assign({},a.vars,a.style)},[t])}function Z_(e,t){let a=e.style||{},r={};return ay(r,a,e),Object.assign(r,Y_(e,t)),r}function ab(e,t){let a={},r=Z_(e,t);return e.drag&&e.dragListener!==!1&&(a.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(a.tabIndex=0),a.style=r,a}var rb=F(K(),1);function ob(e,t,a,r){let o=(0,rb.useMemo)(()=>{let n=vf();return ei(n,t,ai(r),e.transformTemplate),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let n={};ay(n,e.style,e),o.style={...n,...o.style}}return o}function nb(e=!1){return(a,r,o,{latestValues:n},s)=>{let l=(Ks(a)?ob:ab)(r,n,s,a),u=IL(r,typeof a=="string",e),d=a!==ni.Fragment?{...u,...l,ref:o}:{},{children:c}=r,f=(0,ni.useMemo)(()=>Se(c)?c.get():c,[c]);return(0,ni.createElement)(a,{...d,children:f})}}function sb(e,t){return function(r,{forwardMotionProps:o}={forwardMotionProps:!1}){let s={...Ks(r)?ZL:eb,preloadedFeatures:e,useRender:nb(o),createVisualElement:t,Component:r};return FL(s)}}function ry(e,t){if(!Array.isArray(t))return!1;let a=t.length;if(a!==e.length)return!1;for(let r=0;r<a;r++)if(t[r]!==e[r])return!1;return!0}function xo(e,t,a){let r=e.getProps();return Xs(r,t,a!==void 0?a:r.custom,e)}var oy=Sn(()=>window.ScrollTimeline!==void 0);var Lu=class{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,a){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=a}attachTimeline(t,a){let r=this.animations.map(o=>{if(oy()&&o.attachTimeline)return o.attachTimeline(t);if(typeof a=="function")return a(o)});return()=>{r.forEach((o,n)=>{o&&o(),this.animations[n].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 a=0;a<this.animations.length;a++)t=Math.max(t,this.animations[a].duration);return t}runAll(t){this.animations.forEach(a=>a[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}};var bu=class extends Lu{then(t,a){return Promise.all(this.animations).then(t).catch(a)}};function vo(e,t){return e?e[t]||e.default||e:void 0}function si(e){let t=0,a=50,r=e.next(t);for(;!r.done&&t<2e4;)t+=a,r=e.next(t);return t>=2e4?1/0:t}function wo(e){return typeof e=="function"}function Iu(e,t){e.timeline=t,e.onfinish=null}var ii=e=>Array.isArray(e)&&typeof e[0]=="number";var sy={linearEasing:void 0};function ib(e,t){let a=Sn(e);return()=>{var r;return(r=sy[t])!==null&&r!==void 0?r:a()}}var Co=ib(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");var ku=(e,t,a=10)=>{let r="",o=Math.max(Math.round(t/a),2);for(let n=0;n<o;n++)r+=e(aa(0,o-1,n))+", ";return`linear(${r.substring(0,r.length-2)})`};function kf(e){return!!(typeof e=="function"&&Co()||!e||typeof e=="string"&&(e in If||Co())||ii(e)||Array.isArray(e)&&e.every(kf))}var li=([e,t,a,r])=>`cubic-bezier(${e}, ${t}, ${a}, ${r})`,If={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:li([0,.65,.55,1]),circOut:li([.55,0,1,.45]),backIn:li([.31,.01,.66,-.59]),backOut:li([.33,1.53,.69,.99])};function ui(e,t){if(e)return typeof e=="function"&&Co()?ku(e,t):ii(e)?li(e):Array.isArray(e)?e.map(a=>ui(a,t)||If.easeOut):If[e]}var oa={x:!1,y:!1};function di(){return oa.x||oa.y}function iy(e,t,a){var r;if(e instanceof Element)return[e];if(typeof e=="string"){let o=document;t&&(o=t.current);let n=(r=a?.[e])!==null&&r!==void 0?r:o.querySelectorAll(e);return n?Array.from(n):[]}return Array.from(e)}function Pf(e,t){let a=iy(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[a,o,()=>r.abort()]}function lb(e){return t=>{t.pointerType==="touch"||di()||e(t)}}function ly(e,t,a={}){let[r,o,n]=Pf(e,a),s=lb(i=>{let{target:l}=i,u=t(i);if(typeof u!="function"||!l)return;let d=lb(c=>{u(c),l.removeEventListener("pointerleave",d)});l.addEventListener("pointerleave",d,o)});return r.forEach(i=>{i.addEventListener("pointerenter",s,o)}),n}var Tf=(e,t)=>t?e===t?!0:Tf(e,t.parentElement):!1;var bn=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;var eE=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function ub(e){return eE.has(e.tagName)||e.tabIndex!==-1}var In=new WeakSet;function db(e){return t=>{t.key==="Enter"&&e(t)}}function uy(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}var cb=(e,t)=>{let a=e.currentTarget;if(!a)return;let r=db(()=>{if(In.has(a))return;uy(a,"down");let o=db(()=>{uy(a,"up")}),n=()=>uy(a,"cancel");a.addEventListener("keyup",o,t),a.addEventListener("blur",n,t)});a.addEventListener("keydown",r,t),a.addEventListener("blur",()=>a.removeEventListener("keydown",r),t)};function fb(e){return bn(e)&&!di()}function dy(e,t,a={}){let[r,o,n]=Pf(e,a),s=i=>{let l=i.currentTarget;if(!fb(i)||In.has(l))return;In.add(l);let u=t(i),d=(m,v)=>{window.removeEventListener("pointerup",c),window.removeEventListener("pointercancel",f),!(!fb(m)||!In.has(l))&&(In.delete(l),typeof u=="function"&&u(m,{success:v}))},c=m=>{d(m,a.useGlobalTarget||Tf(l,m.target))},f=m=>{d(m,!1)};window.addEventListener("pointerup",c,o),window.addEventListener("pointercancel",f,o)};return r.forEach(i=>{!ub(i)&&i.getAttribute("tabindex")===null&&(i.tabIndex=0),(a.useGlobalTarget?window:i).addEventListener("pointerdown",s,o),i.addEventListener("focus",u=>cb(u,o),o)}),n}function cy(e){return e==="x"||e==="y"?oa[e]?null:(oa[e]=!0,()=>{oa[e]=!1}):oa.x||oa.y?null:(oa.x=oa.y=!0,()=>{oa.x=oa.y=!1})}var Af=new Set(["width","height","top","left","right","bottom",...Ga]);var Rf;function aE(){Rf=void 0}var St={now:()=>(Rf===void 0&&St.set(ze.isProcessing||zs.useManualTiming?ze.timestamp:performance.now()),Rf),set:e=>{Rf=e,queueMicrotask(aE)}};function ci(e,t){e.indexOf(t)===-1&&e.push(t)}function fi(e,t){let a=e.indexOf(t);a>-1&&e.splice(a,1)}var So=class{constructor(){this.subscriptions=[]}add(t){return ci(this.subscriptions,t),()=>fi(this.subscriptions,t)}notify(t,a,r){let o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,a,r);else for(let n=0;n<o;n++){let s=this.subscriptions[n];s&&s(t,a,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}};function _f(e,t){return t?e*(1e3/t):0}var mb=30,rE=e=>!isNaN(parseFloat(e)),hb={current:void 0},fy=class{constructor(t,a={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,o=!0)=>{let n=St.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),o&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=a.owner}setCurrent(t){this.current=t,this.updatedAt=St.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=rE(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,a){this.events[t]||(this.events[t]=new So);let r=this.events[t].add(a);return t==="change"?()=>{r(),te.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(let t in this.events)this.events[t].clear()}attach(t,a){this.passiveEffect=t,this.stopPassiveEffect=a}set(t,a=!0){!a||!this.passiveEffect?this.updateAndNotify(t,a):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,a,r){this.set(a),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,a=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,a&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return hb.current&&hb.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let t=St.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>mb)return 0;let a=Math.min(this.updatedAt-this.prevUpdatedAt,mb);return _f(parseFloat(this.current)-parseFloat(this.prevFrameValue),a)}start(t){return this.stop(),new Promise(a=>{this.hasAnimated=!0,this.animation=t(a),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 Ar(e,t){return new fy(e,t)}function oE(e,t,a){e.hasValue(t)?e.getValue(t).set(a):e.addValue(t,Ar(a))}function Pu(e,t){let a=xo(e,t),{transitionEnd:r={},transition:o={},...n}=a||{};n={...n,...r};for(let s in n){let i=jL(n[s]);oE(e,s,i)}}function gb(e){return!!(Se(e)&&e.add)}function Tu(e,t){let a=e.getValue("willChange");if(gb(a))return a.add(t)}function Ef(e){return e.props[pf]}var Df={current:!1};var yb=(e,t,a)=>(((1-3*a+3*t)*e+(3*a-6*t))*e+3*t)*e,nE=1e-7,sE=12;function iE(e,t,a,r,o){let n,s,i=0;do s=t+(a-t)/2,n=yb(s,r,o)-e,n>0?a=s:t=s;while(Math.abs(n)>nE&&++i<sE);return s}function Lo(e,t,a,r){if(e===t&&a===r)return ye;let o=n=>iE(n,0,1,e,a);return n=>n===0||n===1?n:yb(o(n),t,r)}var Mf=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2;var Nf=e=>t=>1-e(1-t);var py=Lo(.33,1.53,.69,.99),Au=Nf(py),Of=Mf(Au);var Ff=e=>(e*=2)<1?.5*Au(e):.5*(2-Math.pow(2,-10*(e-1)));var Bf=e=>1-Math.sin(Math.acos(e)),Uf=Nf(Bf),Vf=Mf(Bf);var jf=e=>/^0[^.\s]+$/u.test(e);function xb(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||jf(e):!0}var bo=e=>Math.round(e*1e5)/1e5;var pi=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function vb(e){return e==null}var wb=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;var mi=(e,t)=>a=>!!(typeof a=="string"&&wb.test(a)&&a.startsWith(e)||t&&!vb(a)&&Object.prototype.hasOwnProperty.call(a,t)),qf=(e,t,a)=>r=>{if(typeof r!="string")return r;let[o,n,s,i]=r.match(pi);return{[e]:parseFloat(o),[t]:parseFloat(n),[a]:parseFloat(s),alpha:i!==void 0?parseFloat(i):1}};var lE=e=>pt(0,255,e),my={...Ka,transform:e=>Math.round(lE(e))},Qa={test:mi("rgb","red"),parse:qf("red","green","blue"),transform:({red:e,green:t,blue:a,alpha:r=1})=>"rgba("+my.transform(e)+", "+my.transform(t)+", "+my.transform(a)+", "+bo(Tr.transform(r))+")"};function uE(e){let t="",a="",r="",o="";return e.length>5?(t=e.substring(1,3),a=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),a=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,a+=a,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(a,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}var Ru={test:mi("#"),parse:uE,transform:Qa.transform};var Io={test:mi("hsl","hue"),parse:qf("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:a,alpha:r=1})=>"hsla("+Math.round(e)+", "+_t.transform(bo(t))+", "+_t.transform(bo(a))+", "+bo(Tr.transform(r))+")"};var Xe={test:e=>Qa.test(e)||Ru.test(e)||Io.test(e),parse:e=>Qa.test(e)?Qa.parse(e):Io.test(e)?Io.parse(e):Ru.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Qa.transform(e):Io.transform(e)};var Cb=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function dE(e){var t,a;return isNaN(e)&&typeof e=="string"&&(((t=e.match(pi))===null||t===void 0?void 0:t.length)||0)+(((a=e.match(Cb))===null||a===void 0?void 0:a.length)||0)>0}var Lb="number",bb="color",cE="var",fE="var(",Sb="${}",pE=/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 kn(e){let t=e.toString(),a=[],r={color:[],number:[],var:[]},o=[],n=0,i=t.replace(pE,l=>(Xe.test(l)?(r.color.push(n),o.push(bb),a.push(Xe.parse(l))):l.startsWith(fE)?(r.var.push(n),o.push(cE),a.push(l)):(r.number.push(n),o.push(Lb),a.push(parseFloat(l))),++n,Sb)).split(Sb);return{values:a,split:i,indexes:r,types:o}}function Ib(e){return kn(e).values}function kb(e){let{split:t,types:a}=kn(e),r=t.length;return o=>{let n="";for(let s=0;s<r;s++)if(n+=t[s],o[s]!==void 0){let i=a[s];i===Lb?n+=bo(o[s]):i===bb?n+=Xe.transform(o[s]):n+=o[s]}return n}}var mE=e=>typeof e=="number"?0:e;function hE(e){let t=Ib(e);return kb(e)(t.map(mE))}var Et={test:dE,parse:Ib,createTransformer:kb,getAnimatableNone:hE};var gE=new Set(["brightness","contrast","saturate","opacity"]);function yE(e){let[t,a]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;let[r]=a.match(pi)||[];if(!r)return e;let o=a.replace(r,""),n=gE.has(t)?1:0;return r!==a&&(n*=100),t+"("+n+o+")"}var xE=/\b([a-z-]*)\(.*?\)/gu,_u={...Et,getAnimatableNone:e=>{let t=e.match(xE);return t?t.map(yE).join(" "):e}};var vE={...Ys,color:Xe,backgroundColor:Xe,outlineColor:Xe,fill:Xe,stroke:Xe,borderColor:Xe,borderTopColor:Xe,borderRightColor:Xe,borderBottomColor:Xe,borderLeftColor:Xe,filter:_u,WebkitFilter:_u},hi=e=>vE[e];function Hf(e,t){let a=hi(e);return a!==_u&&(a=Et),a.getAnimatableNone?a.getAnimatableNone(t):void 0}var wE=new Set(["auto","none","0"]);function Pb(e,t,a){let r=0,o;for(;r<e.length&&!o;){let n=e[r];typeof n=="string"&&!wE.has(n)&&kn(n).values.length&&(o=e[r]),r++}if(o&&a)for(let n of t)e[n]=Hf(a,o)}var hy=e=>e===Ka||e===H,Tb=(e,t)=>parseFloat(e.split(", ")[t]),Ab=(e,t)=>(a,{transform:r})=>{if(r==="none"||!r)return 0;let o=r.match(/^matrix3d\((.+)\)$/u);if(o)return Tb(o[1],t);{let n=r.match(/^matrix\((.+)\)$/u);return n?Tb(n[1],e):0}},CE=new Set(["x","y","z"]),SE=Ga.filter(e=>!CE.has(e));function Rb(e){let t=[];return SE.forEach(a=>{let r=e.getValue(a);r!==void 0&&(t.push([a,r.get()]),r.set(a.startsWith("scale")?1:0))}),t}var Pn={width:({x:e},{paddingLeft:t="0",paddingRight:a="0"})=>e.max-e.min-parseFloat(t)-parseFloat(a),height:({y:e},{paddingTop:t="0",paddingBottom:a="0"})=>e.max-e.min-parseFloat(t)-parseFloat(a),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:Ab(4,13),y:Ab(5,14)};Pn.translateX=Pn.x;Pn.translateY=Pn.y;var Tn=new Set,gy=!1,yy=!1;function _b(){if(yy){let e=Array.from(Tn).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),a=new Map;t.forEach(r=>{let o=Rb(r);o.length&&(a.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();let o=a.get(r);o&&o.forEach(([n,s])=>{var i;(i=r.getValue(n))===null||i===void 0||i.set(s)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}yy=!1,gy=!1,Tn.forEach(e=>e.complete()),Tn.clear()}function Eb(){Tn.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(yy=!0)})}function Db(){Eb(),_b()}var ko=class{constructor(t,a,r,o,n,s=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=a,this.name=r,this.motionValue=o,this.element=n,this.isAsync=s}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Tn.add(this),gy||(gy=!0,te.read(Eb),te.resolveKeyframes(_b))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:t,name:a,element:r,motionValue:o}=this;for(let n=0;n<t.length;n++)if(t[n]===null)if(n===0){let s=o?.get(),i=t[t.length-1];if(s!==void 0)t[0]=s;else if(r&&a){let l=r.readValue(a,i);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=i),o&&s===void 0&&o.set(t[0])}else t[n]=t[n-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Tn.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Tn.delete(this))}resume(){this.isComplete||this.scheduleResolve()}};var zf=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);var LE=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function bE(e){let t=LE.exec(e);if(!t)return[,];let[,a,r,o]=t;return[`--${a??r}`,o]}var IE=4;function xy(e,t,a=1){qt(a<=IE,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);let[r,o]=bE(e);if(!r)return;let n=window.getComputedStyle(t).getPropertyValue(r);if(n){let s=n.trim();return zf(s)?parseFloat(s):s}return Js(o)?xy(o,t,a+1):o}var $f=e=>t=>t.test(e);var Mb={test:e=>e==="auto",parse:e=>e};var vy=[Ka,H,_t,Xa,zL,HL,Mb],wy=e=>vy.find($f(e));var gi=class extends ko{constructor(t,a,r,o,n){super(t,a,r,o,n,!0)}readKeyframes(){let{unresolvedKeyframes:t,element:a,name:r}=this;if(!a||!a.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let u=t[l];if(typeof u=="string"&&(u=u.trim(),Js(u))){let d=xy(u,a.current);d!==void 0&&(t[l]=d),l===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Af.has(r)||t.length!==2)return;let[o,n]=t,s=wy(o),i=wy(n);if(s!==i)if(hy(s)&&hy(i))for(let l=0;l<t.length;l++){let u=t[l];typeof u=="string"&&(t[l]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){let{unresolvedKeyframes:t,name:a}=this,r=[];for(let o=0;o<t.length;o++)xb(t[o])&&r.push(o);r.length&&Pb(t,r,a)}measureInitialState(){let{element:t,unresolvedKeyframes:a,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Pn[r](t.measureViewportBox(),window.getComputedStyle(t.current)),a[0]=this.measuredOrigin;let o=a[a.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){var t;let{element:a,name:r,unresolvedKeyframes:o}=this;if(!a||!a.current)return;let n=a.getValue(r);n&&n.jump(this.measuredOrigin,!1);let s=o.length-1,i=o[s];o[s]=Pn[r](a.measureViewportBox(),window.getComputedStyle(a.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([l,u])=>{a.getValue(l).set(u)}),this.resolveNoneKeyframes()}};var Cy=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Et.test(e)||e==="0")&&!e.startsWith("url("));function kE(e){let t=e[0];if(e.length===1)return!0;for(let a=0;a<e.length;a++)if(e[a]!==t)return!0}function Nb(e,t,a,r){let o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;let n=e[e.length-1],s=Cy(o,t),i=Cy(n,t);return br(s===i,`You are trying to animate ${t} from "${o}" to "${n}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${n} via the \`style\` property.`),!s||!i?!1:kE(e)||(a==="spring"||wo(a))&&r}var PE=e=>e!==null;function Po(e,{repeat:t,repeatType:a="loop"},r){let o=e.filter(PE),n=t&&a!=="loop"&&t%2===1?0:o.length-1;return!n||r===void 0?o[n]:r}var TE=40,yi=class{constructor({autoplay:t=!0,delay:a=0,type:r="keyframes",repeat:o=0,repeatDelay:n=0,repeatType:s="loop",...i}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=St.now(),this.options={autoplay:t,delay:a,type:r,repeat:o,repeatDelay:n,repeatType:s,...i},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>TE?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Db(),this._resolved}onKeyframesResolved(t,a){this.resolvedAt=St.now(),this.hasAttemptedResolve=!0;let{name:r,type:o,velocity:n,delay:s,onComplete:i,onUpdate:l,isGenerator:u}=this.options;if(!u&&!Nb(t,r,o,n))if(Df.current||!s){l&&l(Po(t,this.options,a)),i&&i(),this.resolveFinishedPromise();return}else this.options.duration=0;let d=this.initPlayback(t,a);d!==!1&&(this._resolved={keyframes:t,finalKeyframe:a,...d},this.onPostResolved())}onPostResolved(){}then(t,a){return this.currentFinishedPromise.then(t,a)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}};var ie=(e,t,a)=>e+(t-e)*a;function Sy(e,t,a){return a<0&&(a+=1),a>1&&(a-=1),a<1/6?e+(t-e)*6*a:a<1/2?t:a<2/3?e+(t-e)*(2/3-a)*6:e}function Ob({hue:e,saturation:t,lightness:a,alpha:r}){e/=360,t/=100,a/=100;let o=0,n=0,s=0;if(!t)o=n=s=a;else{let i=a<.5?a*(1+t):a+t-a*t,l=2*a-i;o=Sy(l,i,e+1/3),n=Sy(l,i,e),s=Sy(l,i,e-1/3)}return{red:Math.round(o*255),green:Math.round(n*255),blue:Math.round(s*255),alpha:r}}function xi(e,t){return a=>a>0?t:e}var Ly=(e,t,a)=>{let r=e*e,o=a*(t*t-r)+r;return o<0?0:Math.sqrt(o)},AE=[Ru,Qa,Io],RE=e=>AE.find(t=>t.test(e));function Fb(e){let t=RE(e);if(br(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let a=t.parse(e);return t===Io&&(a=Ob(a)),a}var by=(e,t)=>{let a=Fb(e),r=Fb(t);if(!a||!r)return xi(e,t);let o={...a};return n=>(o.red=Ly(a.red,r.red,n),o.green=Ly(a.green,r.green,n),o.blue=Ly(a.blue,r.blue,n),o.alpha=ie(a.alpha,r.alpha,n),Qa.transform(o))};var _E=(e,t)=>a=>t(e(a)),Ja=(...e)=>e.reduce(_E);var Wf=new Set(["none","hidden"]);function Bb(e,t){return Wf.has(e)?a=>a<=0?e:t:a=>a>=1?t:e}function EE(e,t){return a=>ie(e,t,a)}function Gf(e){return typeof e=="number"?EE:typeof e=="string"?Js(e)?xi:Xe.test(e)?by:NE:Array.isArray(e)?Ub:typeof e=="object"?Xe.test(e)?by:DE:xi}function Ub(e,t){let a=[...e],r=a.length,o=e.map((n,s)=>Gf(n)(n,t[s]));return n=>{for(let s=0;s<r;s++)a[s]=o[s](n);return a}}function DE(e,t){let a={...e,...t},r={};for(let o in a)e[o]!==void 0&&t[o]!==void 0&&(r[o]=Gf(e[o])(e[o],t[o]));return o=>{for(let n in r)a[n]=r[n](o);return a}}function ME(e,t){var a;let r=[],o={color:0,var:0,number:0};for(let n=0;n<t.values.length;n++){let s=t.types[n],i=e.indexes[s][o[s]],l=(a=e.values[i])!==null&&a!==void 0?a:0;r[n]=l,o[s]++}return r}var NE=(e,t)=>{let a=Et.createTransformer(t),r=kn(e),o=kn(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?Wf.has(e)&&!o.values.length||Wf.has(t)&&!r.values.length?Bb(e,t):Ja(Ub(ME(r,o),o.values),a):(br(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),xi(e,t))};function Kf(e,t,a){return typeof e=="number"&&typeof t=="number"&&typeof a=="number"?ie(e,t,a):Gf(e)(e,t)}var OE=5;function Xf(e,t,a){let r=Math.max(t-OE,0);return _f(a-e(r),t-r)}var Te={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};var Iy=.001;function Vb({duration:e=Te.duration,bounce:t=Te.bounce,velocity:a=Te.velocity,mass:r=Te.mass}){let o,n;br(e<=He(Te.maxDuration),"Spring duration must be 10 seconds or less");let s=1-t;s=pt(Te.minDamping,Te.maxDamping,s),e=pt(Te.minDuration,Te.maxDuration,ft(e)),s<1?(o=u=>{let d=u*s,c=d*e,f=d-a,m=Qf(u,s),v=Math.exp(-c);return Iy-f/m*v},n=u=>{let c=u*s*e,f=c*a+a,m=Math.pow(s,2)*Math.pow(u,2)*e,v=Math.exp(-c),w=Qf(Math.pow(u,2),s);return(-o(u)+Iy>0?-1:1)*((f-m)*v)/w}):(o=u=>{let d=Math.exp(-u*e),c=(u-a)*e+1;return-Iy+d*c},n=u=>{let d=Math.exp(-u*e),c=(a-u)*(e*e);return d*c});let i=5/e,l=BE(o,n,i);if(e=He(e),isNaN(l))return{stiffness:Te.stiffness,damping:Te.damping,duration:e};{let u=Math.pow(l,2)*r;return{stiffness:u,damping:s*2*Math.sqrt(r*u),duration:e}}}var FE=12;function BE(e,t,a){let r=a;for(let o=1;o<FE;o++)r=r-e(r)/t(r);return r}function Qf(e,t){return e*Math.sqrt(1-t*t)}var UE=["duration","bounce"],VE=["stiffness","damping","mass"];function jb(e,t){return t.some(a=>e[a]!==void 0)}function jE(e){let t={velocity:Te.velocity,stiffness:Te.stiffness,damping:Te.damping,mass:Te.mass,isResolvedFromDuration:!1,...e};if(!jb(e,VE)&&jb(e,UE))if(e.visualDuration){let a=e.visualDuration,r=2*Math.PI/(a*1.2),o=r*r,n=2*pt(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:Te.mass,stiffness:o,damping:n}}else{let a=Vb(e);t={...t,...a,mass:Te.mass},t.isResolvedFromDuration=!0}return t}function Jf(e=Te.visualDuration,t=Te.bounce){let a=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e,{restSpeed:r,restDelta:o}=a,n=a.keyframes[0],s=a.keyframes[a.keyframes.length-1],i={done:!1,value:n},{stiffness:l,damping:u,mass:d,duration:c,velocity:f,isResolvedFromDuration:m}=jE({...a,velocity:-ft(a.velocity||0)}),v=f||0,w=u/(2*Math.sqrt(l*d)),S=s-n,h=ft(Math.sqrt(l/d)),g=Math.abs(S)<5;r||(r=g?Te.restSpeed.granular:Te.restSpeed.default),o||(o=g?Te.restDelta.granular:Te.restDelta.default);let x;if(w<1){let I=Qf(h,w);x=k=>{let D=Math.exp(-w*h*k);return s-D*((v+w*h*S)/I*Math.sin(I*k)+S*Math.cos(I*k))}}else if(w===1)x=I=>s-Math.exp(-h*I)*(S+(v+h*S)*I);else{let I=h*Math.sqrt(w*w-1);x=k=>{let D=Math.exp(-w*h*k),_=Math.min(I*k,300);return s-D*((v+w*h*S)*Math.sinh(_)+I*S*Math.cosh(_))/I}}let L={calculatedDuration:m&&c||null,next:I=>{let k=x(I);if(m)i.done=I>=c;else{let D=0;w<1&&(D=I===0?He(v):Xf(x,I,k));let _=Math.abs(D)<=r,V=Math.abs(s-k)<=o;i.done=_&&V}return i.value=i.done?s:k,i},toString:()=>{let I=Math.min(si(L),2e4),k=ku(D=>L.next(I*D).value,I,30);return I+"ms "+k}};return L}function ky({keyframes:e,velocity:t=0,power:a=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:n=500,modifyTarget:s,min:i,max:l,restDelta:u=.5,restSpeed:d}){let c=e[0],f={done:!1,value:c},m=_=>i!==void 0&&_<i||l!==void 0&&_>l,v=_=>i===void 0?l:l===void 0||Math.abs(i-_)<Math.abs(l-_)?i:l,w=a*t,S=c+w,h=s===void 0?S:s(S);h!==S&&(w=h-c);let g=_=>-w*Math.exp(-_/r),x=_=>h+g(_),L=_=>{let V=g(_),j=x(_);f.done=Math.abs(V)<=u,f.value=f.done?h:j},I,k,D=_=>{m(f.value)&&(I=_,k=Jf({keyframes:[f.value,v(f.value)],velocity:Xf(x,_,f.value),damping:o,stiffness:n,restDelta:u,restSpeed:d}))};return D(0),{calculatedDuration:null,next:_=>{let V=!1;return!k&&I===void 0&&(V=!0,L(_),D(_)),I!==void 0&&_>=I?k.next(_-I):(!V&&L(_),f)}}}var qb=Lo(.42,0,1,1),Hb=Lo(0,0,.58,1),Yf=Lo(.42,0,.58,1);var zb=e=>Array.isArray(e)&&typeof e[0]!="number";var $b={linear:ye,easeIn:qb,easeInOut:Yf,easeOut:Hb,circIn:Bf,circInOut:Vf,circOut:Uf,backIn:Au,backInOut:Of,backOut:py,anticipate:Ff},Py=e=>{if(ii(e)){qt(e.length===4,"Cubic bezier arrays must contain four numerical values.");let[t,a,r,o]=e;return Lo(t,a,r,o)}else if(typeof e=="string")return qt($b[e]!==void 0,`Invalid easing type '${e}'`),$b[e];return e};function qE(e,t,a){let r=[],o=a||Kf,n=e.length-1;for(let s=0;s<n;s++){let i=o(e[s],e[s+1]);if(t){let l=Array.isArray(t)?t[s]||ye:t;i=Ja(l,i)}r.push(i)}return r}function Wb(e,t,{clamp:a=!0,ease:r,mixer:o}={}){let n=e.length;if(qt(n===t.length,"Both input and output ranges must be the same length"),n===1)return()=>t[0];if(n===2&&t[0]===t[1])return()=>t[1];let s=e[0]===e[1];e[0]>e[n-1]&&(e=[...e].reverse(),t=[...t].reverse());let i=qE(t,r,o),l=i.length,u=d=>{if(s&&d<e[0])return t[0];let c=0;if(l>1)for(;c<e.length-2&&!(d<e[c+1]);c++);let f=aa(e[c],e[c+1],d);return i[c](f)};return a?d=>u(pt(e[0],e[n-1],d)):u}function Gb(e,t){let a=e[e.length-1];for(let r=1;r<=t;r++){let o=aa(0,t,r);e.push(ie(a,1,o))}}function Kb(e){let t=[0];return Gb(t,e.length-1),t}function Xb(e,t){return e.map(a=>a*t)}function HE(e,t){return e.map(()=>t||Yf).splice(0,e.length-1)}function Eu({duration:e=300,keyframes:t,times:a,ease:r="easeInOut"}){let o=zb(r)?r.map(Py):Py(r),n={done:!1,value:t[0]},s=Xb(a&&a.length===t.length?a:Kb(t),e),i=Wb(s,t,{ease:Array.isArray(o)?o:HE(t,o)});return{calculatedDuration:e,next:l=>(n.value=i(l),n.done=l>=e,n)}}var Qb=e=>{let t=({timestamp:a})=>e(a);return{start:()=>te.update(t,!0),stop:()=>ra(t),now:()=>ze.isProcessing?ze.timestamp:St.now()}};var zE={decay:ky,inertia:ky,tween:Eu,keyframes:Eu,spring:Jf},$E=e=>e/100,An=class extends yi{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();let{onStop:l}=this.options;l&&l()};let{name:a,motionValue:r,element:o,keyframes:n}=this.options,s=o?.KeyframeResolver||ko,i=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new s(n,i,a,r,o),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){let{type:a="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:n,velocity:s=0}=this.options,i=wo(a)?a:zE[a]||Eu,l,u;i!==Eu&&typeof t[0]!="number"&&(l=Ja($E,Kf(t[0],t[1])),t=[0,100]);let d=i({...this.options,keyframes:t});n==="mirror"&&(u=i({...this.options,keyframes:[...t].reverse(),velocity:-s})),d.calculatedDuration===null&&(d.calculatedDuration=si(d));let{calculatedDuration:c}=d,f=c+o,m=f*(r+1)-o;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:c,resolvedDuration:f,totalDuration:m}}onPostResolved(){let{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,a=!1){let{resolved:r}=this;if(!r){let{keyframes:_}=this.options;return{done:!0,value:_[_.length-1]}}let{finalKeyframe:o,generator:n,mirroredGenerator:s,mapPercentToKeyframes:i,keyframes:l,calculatedDuration:u,totalDuration:d,resolvedDuration:c}=r;if(this.startTime===null)return n.next(0);let{delay:f,repeat:m,repeatType:v,repeatDelay:w,onUpdate:S}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),a?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;let h=this.currentTime-f*(this.speed>=0?1:-1),g=this.speed>=0?h<0:h>d;this.currentTime=Math.max(h,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let x=this.currentTime,L=n;if(m){let _=Math.min(this.currentTime,d)/c,V=Math.floor(_),j=_%1;!j&&_>=1&&(j=1),j===1&&V--,V=Math.min(V,m+1),V%2&&(v==="reverse"?(j=1-j,w&&(j-=w/c)):v==="mirror"&&(L=s)),x=pt(0,1,j)*c}let I=g?{done:!1,value:l[0]}:L.next(x);i&&(I.value=i(I.value));let{done:k}=I;!g&&u!==null&&(k=this.speed>=0?this.currentTime>=d:this.currentTime<=0);let D=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&k);return D&&o!==void 0&&(I.value=Po(l,this.options,o)),S&&S(I.value),D&&this.finish(),I}get duration(){let{resolved:t}=this;return t?ft(t.calculatedDuration):0}get time(){return ft(this.currentTime)}set time(t){t=He(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){let a=this.playbackSpeed!==t;this.playbackSpeed=t,a&&(this.time=ft(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;let{driver:t=Qb,onPlay:a,startTime:r}=this.options;this.driver||(this.driver=t(n=>this.tick(n))),a&&a();let o=this.driver.now();this.holdTime!==null?this.startTime=o-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=o):this.startTime=r??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";let{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)}};var Jb=new Set(["opacity","clipPath","filter","transform"]);function Yb(e,t,a,{delay:r=0,duration:o=300,repeat:n=0,repeatType:s="loop",ease:i="easeInOut",times:l}={}){let u={[t]:a};l&&(u.offset=l);let d=ui(i,o);return Array.isArray(d)&&(u.easing=d),e.animate(u,{delay:r,duration:o,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:n+1,direction:s==="reverse"?"alternate":"normal"})}var Zb=Sn(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));var Zf=10,WE=2e4;function GE(e){return wo(e.type)||e.type==="spring"||!kf(e.ease)}function KE(e,t){let a=new An({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0}),r={done:!1,value:e[0]},o=[],n=0;for(;!r.done&&n<WE;)r=a.sample(n),o.push(r.value),n+=Zf;return{times:void 0,keyframes:o,duration:n-Zf,ease:"linear"}}var eI={anticipate:Ff,backInOut:Of,circInOut:Vf};function XE(e){return e in eI}var Du=class extends yi{constructor(t){super(t);let{name:a,motionValue:r,element:o,keyframes:n}=this.options;this.resolver=new gi(n,(s,i)=>this.onKeyframesResolved(s,i),a,r,o),this.resolver.scheduleResolve()}initPlayback(t,a){let{duration:r=300,times:o,ease:n,type:s,motionValue:i,name:l,startTime:u}=this.options;if(!i.owner||!i.owner.current)return!1;if(typeof n=="string"&&Co()&&XE(n)&&(n=eI[n]),GE(this.options)){let{onComplete:c,onUpdate:f,motionValue:m,element:v,...w}=this.options,S=KE(t,w);t=S.keyframes,t.length===1&&(t[1]=t[0]),r=S.duration,o=S.times,n=S.ease,s="keyframes"}let d=Yb(i.owner.current,l,t,{...this.options,duration:r,times:o,ease:n});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(Iu(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{let{onComplete:c}=this.options;i.set(Po(t,this.options,a)),c&&c(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:r,times:o,type:s,ease:n,keyframes:t}}get duration(){let{resolved:t}=this;if(!t)return 0;let{duration:a}=t;return ft(a)}get time(){let{resolved:t}=this;if(!t)return 0;let{animation:a}=t;return ft(a.currentTime||0)}set time(t){let{resolved:a}=this;if(!a)return;let{animation:r}=a;r.currentTime=He(t)}get speed(){let{resolved:t}=this;if(!t)return 1;let{animation:a}=t;return a.playbackRate}set speed(t){let{resolved:a}=this;if(!a)return;let{animation:r}=a;r.playbackRate=t}get state(){let{resolved:t}=this;if(!t)return"idle";let{animation:a}=t;return a.playState}get startTime(){let{resolved:t}=this;if(!t)return null;let{animation:a}=t;return a.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{let{resolved:a}=this;if(!a)return ye;let{animation:r}=a;Iu(r,t)}return ye}play(){if(this.isStopped)return;let{resolved:t}=this;if(!t)return;let{animation:a}=t;a.playState==="finished"&&this.updateFinishedPromise(),a.play()}pause(){let{resolved:t}=this;if(!t)return;let{animation:a}=t;a.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();let{resolved:t}=this;if(!t)return;let{animation:a,keyframes:r,duration:o,type:n,ease:s,times:i}=t;if(a.playState==="idle"||a.playState==="finished")return;if(this.time){let{motionValue:u,onUpdate:d,onComplete:c,element:f,...m}=this.options,v=new An({...m,keyframes:r,duration:o,type:n,ease:s,times:i,isGenerator:!0}),w=He(this.time);u.setWithVelocity(v.sample(w-Zf).value,v.sample(w).value,Zf)}let{onStop:l}=this.options;l&&l(),this.cancel()}complete(){let{resolved:t}=this;t&&t.animation.finish()}cancel(){let{resolved:t}=this;t&&t.animation.cancel()}static supports(t){let{motionValue:a,name:r,repeatDelay:o,repeatType:n,damping:s,type:i}=t;if(!a||!a.owner||!(a.owner.current instanceof HTMLElement))return!1;let{onUpdate:l,transformTemplate:u}=a.owner.getProps();return Zb()&&r&&Jb.has(r)&&!l&&!u&&!o&&n!=="mirror"&&s!==0&&i!=="inertia"}};var QE={type:"spring",stiffness:500,damping:25,restSpeed:10},JE=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),YE={type:"keyframes",duration:.8},ZE={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},tI=(e,{keyframes:t})=>t.length>2?YE:zt.has(e)?e.startsWith("scale")?JE(t[1]):QE:ZE;function aI({when:e,delay:t,delayChildren:a,staggerChildren:r,staggerDirection:o,repeat:n,repeatType:s,repeatDelay:i,from:l,elapsed:u,...d}){return!!Object.keys(d).length}var vi=(e,t,a,r={},o,n)=>s=>{let i=vo(r,e)||{},l=i.delay||r.delay||0,{elapsed:u=0}=r;u=u-He(l);let d={keyframes:Array.isArray(a)?a:[null,a],ease:"easeOut",velocity:t.getVelocity(),...i,delay:-u,onUpdate:f=>{t.set(f),i.onUpdate&&i.onUpdate(f)},onComplete:()=>{s(),i.onComplete&&i.onComplete()},name:e,motionValue:t,element:n?void 0:o};aI(i)||(d={...d,...tI(e,d)}),d.duration&&(d.duration=He(d.duration)),d.repeatDelay&&(d.repeatDelay=He(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let c=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(c=!0)),(Df.current||zs.skipAnimations)&&(c=!0,d.duration=0,d.delay=0),c&&!n&&t.get()!==void 0){let f=Po(d.keyframes,i);if(f!==void 0)return te.update(()=>{d.onUpdate(f),d.onComplete()}),new bu([])}return!n&&Du.supports(d)?new Du(d):new An(d)};function eD({protectedKeys:e,needsAnimating:t},a){let r=e.hasOwnProperty(a)&&t[a]!==!0;return t[a]=!1,r}function ep(e,t,{delay:a=0,transitionOverride:r,type:o}={}){var n;let{transition:s=e.getDefaultTransition(),transitionEnd:i,...l}=t;r&&(s=r);let u=[],d=o&&e.animationState&&e.animationState.getState()[o];for(let c in l){let f=e.getValue(c,(n=e.latestValues[c])!==null&&n!==void 0?n:null),m=l[c];if(m===void 0||d&&eD(d,c))continue;let v={delay:a,...vo(s||{},c)},w=!1;if(window.MotionHandoffAnimation){let h=Ef(e);if(h){let g=window.MotionHandoffAnimation(h,c,te);g!==null&&(v.startTime=g,w=!0)}}Tu(e,c),f.start(vi(c,f,m,e.shouldReduceMotion&&Af.has(c)?{type:!1}:v,e,w));let S=f.animation;S&&u.push(S)}return i&&Promise.all(u).then(()=>{te.update(()=>{i&&Pu(e,i)})}),u}function tp(e,t,a={}){var r;let o=xo(e,t,a.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0),{transition:n=e.getDefaultTransition()||{}}=o||{};a.transitionOverride&&(n=a.transitionOverride);let s=o?()=>Promise.all(ep(e,o,a)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(u=0)=>{let{delayChildren:d=0,staggerChildren:c,staggerDirection:f}=n;return tD(e,t,d+u,c,f,a)}:()=>Promise.resolve(),{when:l}=n;if(l){let[u,d]=l==="beforeChildren"?[s,i]:[i,s];return u().then(()=>d())}else return Promise.all([s(),i(a.delay)])}function tD(e,t,a=0,r=0,o=1,n){let s=[],i=(e.variantChildren.size-1)*r,l=o===1?(u=0)=>u*r:(u=0)=>i-u*r;return Array.from(e.variantChildren).sort(aD).forEach((u,d)=>{u.notify("AnimationStart",t),s.push(tp(u,t,{...n,delay:a+l(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(s)}function aD(e,t){return e.sortNodePosition(t)}function ap(e,t,a={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){let o=t.map(n=>tp(e,n,a));r=Promise.all(o)}else if(typeof t=="string")r=tp(e,t,a);else{let o=typeof t=="function"?xo(e,t,a.custom):t;r=Promise.all(ep(e,o,a))}return r.then(()=>{e.notify("AnimationComplete",t)})}var rD=vu.length;function Ty(e){if(!e)return;if(!e.isControllingVariants){let a=e.parent?Ty(e.parent)||{}:{};return e.props.initial!==void 0&&(a.initial=e.props.initial),a}let t={};for(let a=0;a<rD;a++){let r=vu[a],o=e.props[r];(kr(o)||o===!1)&&(t[r]=o)}return t}var oD=[...df].reverse(),nD=df.length;function sD(e){return t=>Promise.all(t.map(({animation:a,options:r})=>ap(e,a,r)))}function oI(e){let t=sD(e),a=rI(),r=!0,o=l=>(u,d)=>{var c;let f=xo(e,d,l==="exit"?(c=e.presenceContext)===null||c===void 0?void 0:c.custom:void 0);if(f){let{transition:m,transitionEnd:v,...w}=f;u={...u,...w,...v}}return u};function n(l){t=l(e)}function s(l){let{props:u}=e,d=Ty(e.parent)||{},c=[],f=new Set,m={},v=1/0;for(let S=0;S<nD;S++){let h=oD[S],g=a[h],x=u[h]!==void 0?u[h]:d[h],L=kr(x),I=h===l?g.isActive:null;I===!1&&(v=S);let k=x===d[h]&&x!==u[h]&&L;if(k&&r&&e.manuallyAnimateOnMount&&(k=!1),g.protectedKeys={...m},!g.isActive&&I===null||!x&&!g.prevProp||yo(x)||typeof x=="boolean")continue;let D=iD(g.prevProp,x),_=D||h===l&&g.isActive&&!k&&L||S>v&&L,V=!1,j=Array.isArray(x)?x:[x],ge=j.reduce(o(h),{});I===!1&&(ge={});let{prevResolvedValues:ue={}}=g,Dr={...ue,...ge},ar=Re=>{_=!0,f.has(Re)&&(V=!0,f.delete(Re)),g.needsAnimating[Re]=!0;let ht=e.getValue(Re);ht&&(ht.liveStyle=!1)};for(let Re in Dr){let ht=ge[Re],It=ue[Re];if(m.hasOwnProperty(Re))continue;let Wt=!1;wu(ht)&&wu(It)?Wt=!ry(ht,It):Wt=ht!==It,Wt?ht!=null?ar(Re):f.add(Re):ht!==void 0&&f.has(Re)?ar(Re):g.protectedKeys[Re]=!0}g.prevProp=x,g.prevResolvedValues=ge,g.isActive&&(m={...m,...ge}),r&&e.blockInitialAnimation&&(_=!1),_&&(!(k&&D)||V)&&c.push(...j.map(Re=>({animation:Re,options:{type:h}})))}if(f.size){let S={};f.forEach(h=>{let g=e.getBaseTarget(h),x=e.getValue(h);x&&(x.liveStyle=!0),S[h]=g??null}),c.push({animation:S})}let w=!!c.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(w=!1),r=!1,w?t(c):Promise.resolve()}function i(l,u){var d;if(a[l].isActive===u)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(f=>{var m;return(m=f.animationState)===null||m===void 0?void 0:m.setActive(l,u)}),a[l].isActive=u;let c=s(l);for(let f in a)a[f].protectedKeys={};return c}return{animateChanges:s,setActive:i,setAnimateFunction:n,getState:()=>a,reset:()=>{a=rI(),r=!0}}}function iD(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!ry(t,e):!1}function Rn(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function rI(){return{animate:Rn(!0),whileInView:Rn(),whileHover:Rn(),whileTap:Rn(),whileDrag:Rn(),whileFocus:Rn(),exit:Rn()}}var st=class{constructor(t){this.isMounted=!1,this.node=t}update(){}};var rp=class extends st{constructor(t){super(t),t.animationState||(t.animationState=oI(t))}updateAnimationControlsSubscription(){let{animate:t}=this.node.getProps();yo(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:t}=this.node.getProps(),{animate:a}=this.node.prevProps||{};t!==a&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}};var lD=0,op=class extends st{constructor(){super(...arguments),this.id=lD++}update(){if(!this.node.presenceContext)return;let{isPresent:t,onExitComplete:a}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;let o=this.node.animationState.setActive("exit",!t);a&&!t&&o.then(()=>a(this.id))}mount(){let{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}};var nI={animation:{Feature:rp},exit:{Feature:op}};function Rr(e,t,a,r={passive:!0}){return e.addEventListener(t,a,r),()=>e.removeEventListener(t,a)}function _r(e){return{point:{x:e.pageX,y:e.pageY}}}var sI=e=>t=>bn(t)&&e(t,_r(t));function To(e,t,a,r){return Rr(e,t,sI(a),r)}var iI=(e,t)=>Math.abs(e-t);function lI(e,t){let a=iI(e.x,t.x),r=iI(e.y,t.y);return Math.sqrt(a**2+r**2)}var wi=class{constructor(t,a,{transformPagePoint:r,contextWindow:o,dragSnapToOrigin:n=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let c=Ry(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,m=lI(c.offset,{x:0,y:0})>=3;if(!f&&!m)return;let{point:v}=c,{timestamp:w}=ze;this.history.push({...v,timestamp:w});let{onStart:S,onMove:h}=this.handlers;f||(S&&S(this.lastMoveEvent,c),this.startEvent=this.lastMoveEvent),h&&h(this.lastMoveEvent,c)},this.handlePointerMove=(c,f)=>{this.lastMoveEvent=c,this.lastMoveEventInfo=Ay(f,this.transformPagePoint),te.update(this.updatePoint,!0)},this.handlePointerUp=(c,f)=>{this.end();let{onEnd:m,onSessionEnd:v,resumeAnimation:w}=this.handlers;if(this.dragSnapToOrigin&&w&&w(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let S=Ry(c.type==="pointercancel"?this.lastMoveEventInfo:Ay(f,this.transformPagePoint),this.history);this.startEvent&&m&&m(c,S),v&&v(c,S)},!bn(t))return;this.dragSnapToOrigin=n,this.handlers=a,this.transformPagePoint=r,this.contextWindow=o||window;let s=_r(t),i=Ay(s,this.transformPagePoint),{point:l}=i,{timestamp:u}=ze;this.history=[{...l,timestamp:u}];let{onSessionStart:d}=a;d&&d(t,Ry(i,this.history)),this.removeListeners=Ja(To(this.contextWindow,"pointermove",this.handlePointerMove),To(this.contextWindow,"pointerup",this.handlePointerUp),To(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),ra(this.updatePoint)}};function Ay(e,t){return t?{point:t(e.point)}:e}function uI(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Ry({point:e},t){return{point:e,delta:uI(e,dI(t)),offset:uI(e,uD(t)),velocity:dD(t,.1)}}function uD(e){return e[0]}function dI(e){return e[e.length-1]}function dD(e,t){if(e.length<2)return{x:0,y:0};let a=e.length-1,r=null,o=dI(e);for(;a>=0&&(r=e[a],!(o.timestamp-r.timestamp>He(t)));)a--;if(!r)return{x:0,y:0};let n=ft(o.timestamp-r.timestamp);if(n===0)return{x:0,y:0};let s={x:(o.x-r.x)/n,y:(o.y-r.y)/n};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}var mI=1e-4,cD=1-mI,fD=1+mI,hI=.01,pD=0-hI,mD=0+hI;function mt(e){return e.max-e.min}function gI(e,t,a){return Math.abs(e-t)<=a}function cI(e,t,a,r=.5){e.origin=r,e.originPoint=ie(t.min,t.max,e.origin),e.scale=mt(a)/mt(t),e.translate=ie(a.min,a.max,e.origin)-e.originPoint,(e.scale>=cD&&e.scale<=fD||isNaN(e.scale))&&(e.scale=1),(e.translate>=pD&&e.translate<=mD||isNaN(e.translate))&&(e.translate=0)}function Ci(e,t,a,r){cI(e.x,t.x,a.x,r?r.originX:void 0),cI(e.y,t.y,a.y,r?r.originY:void 0)}function fI(e,t,a){e.min=a.min+t.min,e.max=e.min+mt(t)}function yI(e,t,a){fI(e.x,t.x,a.x),fI(e.y,t.y,a.y)}function pI(e,t,a){e.min=t.min-a.min,e.max=e.min+mt(t)}function Si(e,t,a){pI(e.x,t.x,a.x),pI(e.y,t.y,a.y)}function SI(e,{min:t,max:a},r){return t!==void 0&&e<t?e=r?ie(t,e,r.min):Math.max(e,t):a!==void 0&&e>a&&(e=r?ie(a,e,r.max):Math.min(e,a)),e}function xI(e,t,a){return{min:t!==void 0?e.min+t:void 0,max:a!==void 0?e.max+a-(e.max-e.min):void 0}}function LI(e,{top:t,left:a,bottom:r,right:o}){return{x:xI(e.x,a,o),y:xI(e.y,t,r)}}function vI(e,t){let a=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([a,r]=[r,a]),{min:a,max:r}}function bI(e,t){return{x:vI(e.x,t.x),y:vI(e.y,t.y)}}function II(e,t){let a=.5,r=mt(e),o=mt(t);return o>r?a=aa(t.min,t.max-r,e.min):r>o&&(a=aa(e.min,e.max-o,t.min)),pt(0,1,a)}function kI(e,t){let a={};return t.min!==void 0&&(a.min=t.min-e.min),t.max!==void 0&&(a.max=t.max-e.min),a}var np=.35;function PI(e=np){return e===!1?e=0:e===!0&&(e=np),{x:wI(e,"left","right"),y:wI(e,"top","bottom")}}function wI(e,t,a){return{min:CI(e,t),max:CI(e,a)}}function CI(e,t){return typeof e=="number"?e:e[t]||0}var TI=()=>({translate:0,scale:1,origin:0,originPoint:0}),_n=()=>({x:TI(),y:TI()}),AI=()=>({min:0,max:0}),Ae=()=>({x:AI(),y:AI()});function $t(e){return[e("x"),e("y")]}function sp({top:e,left:t,right:a,bottom:r}){return{x:{min:t,max:a},y:{min:e,max:r}}}function RI({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function _I(e,t){if(!t)return e;let a=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:a.y,left:a.x,bottom:r.y,right:r.x}}function _y(e){return e===void 0||e===1}function ip({scale:e,scaleX:t,scaleY:a}){return!_y(e)||!_y(t)||!_y(a)}function Er(e){return ip(e)||Ey(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Ey(e){return EI(e.x)||EI(e.y)}function EI(e){return e&&e!=="0%"}function Mu(e,t,a){let r=e-a,o=t*r;return a+o}function DI(e,t,a,r,o){return o!==void 0&&(e=Mu(e,o,r)),Mu(e,a,r)+t}function Dy(e,t=0,a=1,r,o){e.min=DI(e.min,t,a,r,o),e.max=DI(e.max,t,a,r,o)}function My(e,{x:t,y:a}){Dy(e.x,t.translate,t.scale,t.originPoint),Dy(e.y,a.translate,a.scale,a.originPoint)}var MI=.999999999999,NI=1.0000000000001;function FI(e,t,a,r=!1){let o=a.length;if(!o)return;t.x=t.y=1;let n,s;for(let i=0;i<o;i++){n=a[i],s=n.projectionDelta;let{visualElement:l}=n.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&n.options.layoutScroll&&n.scroll&&n!==n.root&&En(e,{x:-n.scroll.offset.x,y:-n.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,My(e,s)),r&&Er(n.latestValues)&&En(e,n.latestValues))}t.x<NI&&t.x>MI&&(t.x=1),t.y<NI&&t.y>MI&&(t.y=1)}function Ao(e,t){e.min=e.min+t,e.max=e.max+t}function OI(e,t,a,r,o=.5){let n=ie(e.min,e.max,o);Dy(e,t,a,n,r)}function En(e,t){OI(e.x,t.x,t.scaleX,t.scale,t.originX),OI(e.y,t.y,t.scaleY,t.scale,t.originY)}function Ny(e,t){return sp(_I(e.getBoundingClientRect(),t))}function BI(e,t,a){let r=Ny(e,a),{scroll:o}=t;return o&&(Ao(r.x,o.offset.x),Ao(r.y,o.offset.y)),r}var lp=({current:e})=>e?e.ownerDocument.defaultView:null;var hD=new WeakMap,dp=class{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=Ae(),this.visualElement=t}start(t,{snapToCursor:a=!1}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let o=d=>{let{dragSnapToOrigin:c}=this.getProps();c?this.pauseAnimation():this.stopAnimation(),a&&this.snapToCursor(_r(d).point)},n=(d,c)=>{let{drag:f,dragPropagation:m,onDragStart:v}=this.getProps();if(f&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=cy(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),$t(S=>{let h=this.getAxisMotionValue(S).get()||0;if(_t.test(h)){let{projection:g}=this.visualElement;if(g&&g.layout){let x=g.layout.layoutBox[S];x&&(h=mt(x)*(parseFloat(h)/100))}}this.originPoint[S]=h}),v&&te.postRender(()=>v(d,c)),Tu(this.visualElement,"transform");let{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},s=(d,c)=>{let{dragPropagation:f,dragDirectionLock:m,onDirectionLock:v,onDrag:w}=this.getProps();if(!f&&!this.openDragLock)return;let{offset:S}=c;if(m&&this.currentDirection===null){this.currentDirection=gD(S),this.currentDirection!==null&&v&&v(this.currentDirection);return}this.updateAxis("x",c.point,S),this.updateAxis("y",c.point,S),this.visualElement.render(),w&&w(d,c)},i=(d,c)=>this.stop(d,c),l=()=>$t(d=>{var c;return this.getAnimationState(d)==="paused"&&((c=this.getAxisMotionValue(d).animation)===null||c===void 0?void 0:c.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new wi(t,{onSessionStart:o,onStart:n,onMove:s,onSessionEnd:i,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:lp(this.visualElement)})}stop(t,a){let r=this.isDragging;if(this.cancel(),!r)return;let{velocity:o}=a;this.startAnimation(o);let{onDragEnd:n}=this.getProps();n&&te.postRender(()=>n(t,a))}cancel(){this.isDragging=!1;let{projection:t,animationState:a}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),a&&a.setActive("whileDrag",!1)}updateAxis(t,a,r){let{drag:o}=this.getProps();if(!r||!up(t,o,this.currentDirection))return;let n=this.getAxisMotionValue(t),s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=SI(s,this.constraints[t],this.elastic[t])),n.set(s)}resolveConstraints(){var t;let{dragConstraints:a,dragElastic:r}=this.getProps(),o=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,n=this.constraints;a&&Pr(a)?this.constraints||(this.constraints=this.resolveRefConstraints()):a&&o?this.constraints=LI(o.layoutBox,a):this.constraints=!1,this.elastic=PI(r),n!==this.constraints&&o&&this.constraints&&!this.hasMutatedConstraints&&$t(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=kI(o.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){let{dragConstraints:t,onMeasureDragConstraints:a}=this.getProps();if(!t||!Pr(t))return!1;let r=t.current;qt(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");let{projection:o}=this.visualElement;if(!o||!o.layout)return!1;let n=BI(r,o.root,this.visualElement.getTransformPagePoint()),s=bI(o.layout.layoutBox,n);if(a){let i=a(RI(s));this.hasMutatedConstraints=!!i,i&&(s=sp(i))}return s}startAnimation(t){let{drag:a,dragMomentum:r,dragElastic:o,dragTransition:n,dragSnapToOrigin:s,onDragTransitionEnd:i}=this.getProps(),l=this.constraints||{},u=$t(d=>{if(!up(d,a,this.currentDirection))return;let c=l&&l[d]||{};s&&(c={min:0,max:0});let f=o?200:1e6,m=o?40:1e7,v={type:"inertia",velocity:r?t[d]:0,bounceStiffness:f,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...n,...c};return this.startAxisValueAnimation(d,v)});return Promise.all(u).then(i)}startAxisValueAnimation(t,a){let r=this.getAxisMotionValue(t);return Tu(this.visualElement,t),r.start(vi(t,r,0,a,this.visualElement,!1))}stopAnimation(){$t(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){$t(t=>{var a;return(a=this.getAxisMotionValue(t).animation)===null||a===void 0?void 0:a.pause()})}getAnimationState(t){var a;return(a=this.getAxisMotionValue(t).animation)===null||a===void 0?void 0:a.state}getAxisMotionValue(t){let a=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[a];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){$t(a=>{let{drag:r}=this.getProps();if(!up(a,r,this.currentDirection))return;let{projection:o}=this.visualElement,n=this.getAxisMotionValue(a);if(o&&o.layout){let{min:s,max:i}=o.layout.layoutBox[a];n.set(t[a]-ie(s,i,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:t,dragConstraints:a}=this.getProps(),{projection:r}=this.visualElement;if(!Pr(a)||!r||!this.constraints)return;this.stopAnimation();let o={x:0,y:0};$t(s=>{let i=this.getAxisMotionValue(s);if(i&&this.constraints!==!1){let l=i.get();o[s]=II({min:l,max:l},this.constraints[s])}});let{transformTemplate:n}=this.visualElement.getProps();this.visualElement.current.style.transform=n?n({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),$t(s=>{if(!up(s,t,null))return;let i=this.getAxisMotionValue(s),{min:l,max:u}=this.constraints[s];i.set(ie(l,u,o[s]))})}addListeners(){if(!this.visualElement.current)return;hD.set(this.visualElement,this);let t=this.visualElement.current,a=To(t,"pointerdown",l=>{let{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(l)}),r=()=>{let{dragConstraints:l}=this.getProps();Pr(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,n=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),te.read(r);let s=Rr(window,"resize",()=>this.scalePositionWithinConstraints()),i=o.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&($t(d=>{let c=this.getAxisMotionValue(d);c&&(this.originPoint[d]+=l[d].translate,c.set(c.get()+l[d].translate))}),this.visualElement.render())}));return()=>{s(),a(),n(),i&&i()}}getProps(){let t=this.visualElement.getProps(),{drag:a=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:n=!1,dragElastic:s=np,dragMomentum:i=!0}=t;return{...t,drag:a,dragDirectionLock:r,dragPropagation:o,dragConstraints:n,dragElastic:s,dragMomentum:i}}};function up(e,t,a){return(t===!0||t===e)&&(a===null||a===e)}function gD(e,t=10){let a=null;return Math.abs(e.y)>t?a="y":Math.abs(e.x)>t&&(a="x"),a}var cp=class extends st{constructor(t){super(t),this.removeGroupControls=ye,this.removeListeners=ye,this.controls=new dp(t)}mount(){let{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ye}unmount(){this.removeGroupControls(),this.removeListeners()}};var UI=e=>(t,a)=>{e&&te.postRender(()=>e(t,a))},fp=class extends st{constructor(){super(...arguments),this.removePointerDownListener=ye}onPointerDown(t){this.session=new wi(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:lp(this.node)})}createPanHandlers(){let{onPanSessionStart:t,onPanStart:a,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:UI(t),onStart:UI(a),onMove:r,onEnd:(n,s)=>{delete this.session,o&&te.postRender(()=>o(n,s))}}}mount(){this.removePointerDownListener=To(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}};var qI=F(le(),1),Nu=F(K(),1);var Li={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function VI(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var bi={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(H.test(e))e=parseFloat(e);else return e;let a=VI(e,t.target.x),r=VI(e,t.target.y);return`${a}% ${r}%`}};var jI={correct:(e,{treeScale:t,projectionDelta:a})=>{let r=e,o=Et.parse(e);if(o.length>5)return r;let n=Et.createTransformer(e),s=typeof o[0]!="number"?1:0,i=a.x.scale*t.x,l=a.y.scale*t.y;o[0+s]/=i,o[1+s]/=l;let u=ie(i,l,.5);return typeof o[2+s]=="number"&&(o[2+s]/=u),typeof o[3+s]=="number"&&(o[3+s]/=u),n(o)}};var Oy=class extends Nu.Component{componentDidMount(){let{visualElement:t,layoutGroup:a,switchLayoutGroup:r,layoutId:o}=this.props,{projection:n}=t;JL(yD),n&&(a.group&&a.group.add(n),r&&r.register&&o&&r.register(n),n.root.didUpdate(),n.addEventListener("animationComplete",()=>{this.safeToRemove()}),n.setOptions({...n.options,onExitComplete:()=>this.safeToRemove()})),Li.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){let{layoutDependency:a,visualElement:r,drag:o,isPresent:n}=this.props,s=r.projection;return s&&(s.isPresent=n,o||t.layoutDependency!==a||a===void 0?s.willUpdate():this.safeToRemove(),t.isPresent!==n&&(n?s.promote():s.relegate()||te.postRender(()=>{let i=s.getStack();(!i||!i.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){let{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Ws.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:t,layoutGroup:a,switchLayoutGroup:r}=this.props,{projection:o}=t;o&&(o.scheduleCheckAfterUnmount(),a&&a.group&&a.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){let{safeToRemove:t}=this.props;t&&t()}render(){return null}};function pp(e){let[t,a]=af(),r=(0,Nu.useContext)(Vs);return(0,qI.jsx)(Oy,{...e,layoutGroup:r,switchLayoutGroup:(0,Nu.useContext)(mf),isPresent:t,safeToRemove:a})}var yD={borderRadius:{...bi,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:bi,borderTopRightRadius:bi,borderBottomLeftRadius:bi,borderBottomRightRadius:bi,boxShadow:jI};function HI(e,t,a){let r=Se(e)?e:Ar(e);return r.start(vi("",r,t,a)),r.animation}function zI(e){return e instanceof SVGElement&&e.tagName!=="svg"}var $I=(e,t)=>e.depth-t.depth;var mp=class{constructor(){this.children=[],this.isDirty=!1}add(t){ci(this.children,t),this.isDirty=!0}remove(t){fi(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort($I),this.isDirty=!1,this.children.forEach(t)}};function WI(e,t){let a=St.now(),r=({timestamp:o})=>{let n=o-a;n>=t&&(ra(r),e(n-t))};return te.read(r,!0),()=>ra(r)}var QI=["TopLeft","TopRight","BottomLeft","BottomRight"],xD=QI.length,GI=e=>typeof e=="string"?parseFloat(e):e,KI=e=>typeof e=="number"||H.test(e);function JI(e,t,a,r,o,n){o?(e.opacity=ie(0,a.opacity!==void 0?a.opacity:1,vD(r)),e.opacityExit=ie(t.opacity!==void 0?t.opacity:1,0,wD(r))):n&&(e.opacity=ie(t.opacity!==void 0?t.opacity:1,a.opacity!==void 0?a.opacity:1,r));for(let s=0;s<xD;s++){let i=`border${QI[s]}Radius`,l=XI(t,i),u=XI(a,i);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||KI(l)===KI(u)?(e[i]=Math.max(ie(GI(l),GI(u),r),0),(_t.test(u)||_t.test(l))&&(e[i]+="%")):e[i]=u}(t.rotate||a.rotate)&&(e.rotate=ie(t.rotate||0,a.rotate||0,r))}function XI(e,t){return e[t]!==void 0?e[t]:e.borderRadius}var vD=YI(0,.5,Uf),wD=YI(.5,.95,ye);function YI(e,t,a){return r=>r<e?0:r>t?1:a(aa(e,t,r))}function ZI(e,t){e.min=t.min,e.max=t.max}function na(e,t){ZI(e.x,t.x),ZI(e.y,t.y)}function Fy(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function ek(e,t,a,r,o){return e-=t,e=Mu(e,1/a,r),o!==void 0&&(e=Mu(e,1/o,r)),e}function CD(e,t=0,a=1,r=.5,o,n=e,s=e){if(_t.test(t)&&(t=parseFloat(t),t=ie(s.min,s.max,t/100)-s.min),typeof t!="number")return;let i=ie(n.min,n.max,r);e===n&&(i-=t),e.min=ek(e.min,t,a,i,o),e.max=ek(e.max,t,a,i,o)}function tk(e,t,[a,r,o],n,s){CD(e,t[a],t[r],t[o],t.scale,n,s)}var SD=["x","scaleX","originX"],LD=["y","scaleY","originY"];function By(e,t,a,r){tk(e.x,t,SD,a?a.x:void 0,r?r.x:void 0),tk(e.y,t,LD,a?a.y:void 0,r?r.y:void 0)}function ak(e){return e.translate===0&&e.scale===1}function Uy(e){return ak(e.x)&&ak(e.y)}function rk(e,t){return e.min===t.min&&e.max===t.max}function nk(e,t){return rk(e.x,t.x)&&rk(e.y,t.y)}function ok(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Vy(e,t){return ok(e.x,t.x)&&ok(e.y,t.y)}function jy(e){return mt(e.x)/mt(e.y)}function qy(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var hp=class{constructor(){this.members=[]}add(t){ci(this.members,t),t.scheduleRender()}remove(t){if(fi(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){let a=this.members[this.members.length-1];a&&this.promote(a)}}relegate(t){let a=this.members.findIndex(o=>t===o);if(a===0)return!1;let r;for(let o=a;o>=0;o--){let n=this.members[o];if(n.isPresent!==!1){r=n;break}}return r?(this.promote(r),!0):!1}promote(t,a){let r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,a&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);let{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{let{options:a,resumingFrom:r}=t;a.onExitComplete&&a.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}};function sk(e,t,a){let r="",o=e.x.translate/t.x,n=e.y.translate/t.y,s=a?.z||0;if((o||n||s)&&(r=`translate3d(${o}px, ${n}px, ${s}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),a){let{transformPerspective:u,rotate:d,rotateX:c,rotateY:f,skewX:m,skewY:v}=a;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),c&&(r+=`rotateX(${c}deg) `),f&&(r+=`rotateY(${f}deg) `),m&&(r+=`skewX(${m}deg) `),v&&(r+=`skewY(${v}deg) `)}let i=e.x.scale*t.x,l=e.y.scale*t.y;return(i!==1||l!==1)&&(r+=`scale(${i}, ${l})`),r||"none"}var Dn={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Ou=typeof window<"u"&&window.MotionDebug!==void 0,Hy=["","X","Y","Z"],bD={visibility:"hidden"},ik=1e3,ID=0;function zy(e,t,a,r){let{latestValues:o}=t;o[e]&&(a[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function hk(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let a=Ef(t);if(window.MotionHasOptimisedAnimation(a,"transform")){let{layout:o,layoutId:n}=e.options;window.MotionCancelOptimisedAnimation(a,"transform",te,!(o||n))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&hk(r)}function gp({attachResizeListener:e,defaultParent:t,measureScroll:a,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(s={},i=t?.()){this.id=ID++,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,Ou&&(Dn.totalNodes=Dn.resolvedTargetDeltas=Dn.recalculatedProjection=0),this.nodes.forEach(TD),this.nodes.forEach(DD),this.nodes.forEach(MD),this.nodes.forEach(AD),Ou&&window.MotionDebug.record(Dn)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new mp)}addEventListener(s,i){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new So),this.eventHandlers.get(s).add(i)}notifyListeners(s,...i){let l=this.eventHandlers.get(s);l&&l.notify(...i)}hasListeners(s){return this.eventHandlers.has(s)}mount(s,i=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=zI(s),this.instance=s;let{layoutId:l,layout:u,visualElement:d}=this.options;if(d&&!d.current&&d.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),i&&(u||l)&&(this.isLayoutDirty=!0),e){let c,f=()=>this.root.updateBlockedByResize=!1;e(s,()=>{this.root.updateBlockedByResize=!0,c&&c(),c=WI(f,250),Li.hasAnimatedSinceResize&&(Li.hasAnimatedSinceResize=!1,this.nodes.forEach(uk))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||u)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:f,hasRelativeTargetChanged:m,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let w=this.options.transition||d.getDefaultTransition()||UD,{onLayoutAnimationStart:S,onLayoutAnimationComplete:h}=d.getProps(),g=!this.targetLayout||!Vy(this.targetLayout,v)||m,x=!f&&m;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||f&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(c,x);let L={...vo(w,"layout"),onPlay:S,onComplete:h};(d.shouldReduceMotion||this.options.layoutRoot)&&(L.delay=0,L.type=!1),this.startAnimation(L)}else f||uk(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let s=this.getStack();s&&s.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(ND),this.animationId++)}getTransformTemplate(){let{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&hk(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){let c=this.path[d];c.shouldResetTransform=!0,c.updateScroll("snapshot"),c.options.layoutRoot&&c.willUpdate(!1)}let{layoutId:i,layout:l}=this.options;if(i===void 0&&!l)return;let u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(lk);return}this.isUpdating||this.nodes.forEach(_D),this.isUpdating=!1,this.nodes.forEach(ED),this.nodes.forEach(kD),this.nodes.forEach(PD),this.clearAllSnapshots();let i=St.now();ze.delta=pt(0,1e3/60,i-ze.timestamp),ze.timestamp=i,ze.isProcessing=!0,lf.update.process(ze),lf.preRender.process(ze),lf.render.process(ze),ze.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ws.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(RD),this.sharedNodes.forEach(OD)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,te.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){te.postRender(()=>{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 l=0;l<this.path.length;l++)this.path[l].updateScroll();let s=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Ae(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:i}=this.options;i&&i.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let i=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(i=!1),i){let l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:l,offset:a(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!o)return;let s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,i=this.projectionDelta&&!Uy(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;s&&(i||Er(this.latestValues)||d)&&(o(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){let i=this.measurePageBox(),l=this.removeElementScroll(i);return s&&(l=this.removeTransform(l)),VD(l),{animationId:this.root.animationId,measuredBox:i,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var s;let{visualElement:i}=this.options;if(!i)return Ae();let l=i.measureViewportBox();if(!(((s=this.scroll)===null||s===void 0?void 0:s.wasRoot)||this.path.some(jD))){let{scroll:d}=this.root;d&&(Ao(l.x,d.offset.x),Ao(l.y,d.offset.y))}return l}removeElementScroll(s){var i;let l=Ae();if(na(l,s),!((i=this.scroll)===null||i===void 0)&&i.wasRoot)return l;for(let u=0;u<this.path.length;u++){let d=this.path[u],{scroll:c,options:f}=d;d!==this.root&&c&&f.layoutScroll&&(c.wasRoot&&na(l,s),Ao(l.x,c.offset.x),Ao(l.y,c.offset.y))}return l}applyTransform(s,i=!1){let l=Ae();na(l,s);for(let u=0;u<this.path.length;u++){let d=this.path[u];!i&&d.options.layoutScroll&&d.scroll&&d!==d.root&&En(l,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),Er(d.latestValues)&&En(l,d.latestValues)}return Er(this.latestValues)&&En(l,this.latestValues),l}removeTransform(s){let i=Ae();na(i,s);for(let l=0;l<this.path.length;l++){let u=this.path[l];if(!u.instance||!Er(u.latestValues))continue;ip(u.latestValues)&&u.updateSnapshot();let d=Ae(),c=u.measurePageBox();na(d,c),By(i,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return Er(this.latestValues)&&By(i,this.latestValues),i}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==ze.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){var i;let l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);let u=!!this.resumingFrom||this!==l;if(!(s||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((i=this.parent)===null||i===void 0)&&i.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:c,layoutId:f}=this.options;if(!(!this.layout||!(c||f))){if(this.resolvedRelativeTargetAt=ze.timestamp,!this.targetDelta&&!this.relativeTarget){let m=this.getClosestProjectingParent();m&&m.layout&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ae(),this.relativeTargetOrigin=Ae(),Si(this.relativeTargetOrigin,this.layout.layoutBox,m.layout.layoutBox),na(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Ae(),this.targetWithTransforms=Ae()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),yI(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):na(this.target,this.layout.layoutBox),My(this.target,this.targetDelta)):na(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;let m=this.getClosestProjectingParent();m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ae(),this.relativeTargetOrigin=Ae(),Si(this.relativeTargetOrigin,this.target,m.target),na(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Ou&&Dn.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||ip(this.parent.latestValues)||Ey(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var s;let i=this.getLead(),l=!!this.resumingFrom||this!==i,u=!0;if((this.isProjectionDirty||!((s=this.parent)===null||s===void 0)&&s.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===ze.timestamp&&(u=!1),u)return;let{layout:d,layoutId:c}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||c))return;na(this.layoutCorrected,this.layout.layoutBox);let f=this.treeScale.x,m=this.treeScale.y;FI(this.layoutCorrected,this.treeScale,this.path,l),i.layout&&!i.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(i.target=i.layout.layoutBox,i.targetWithTransforms=Ae());let{target:v}=i;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Fy(this.prevProjectionDelta.x,this.projectionDelta.x),Fy(this.prevProjectionDelta.y,this.projectionDelta.y)),Ci(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==m||!qy(this.projectionDelta.x,this.prevProjectionDelta.x)||!qy(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",v)),Ou&&Dn.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){var i;if((i=this.options.visualElement)===null||i===void 0||i.scheduleRender(),s){let l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=_n(),this.projectionDelta=_n(),this.projectionDeltaWithTransform=_n()}setAnimationOrigin(s,i=!1){let l=this.snapshot,u=l?l.latestValues:{},d={...this.latestValues},c=_n();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!i;let f=Ae(),m=l?l.source:void 0,v=this.layout?this.layout.source:void 0,w=m!==v,S=this.getStack(),h=!S||S.members.length<=1,g=!!(w&&!h&&this.options.crossfade===!0&&!this.path.some(BD));this.animationProgress=0;let x;this.mixTargetDelta=L=>{let I=L/1e3;dk(c.x,s.x,I),dk(c.y,s.y,I),this.setTargetDelta(c),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Si(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),FD(this.relativeTarget,this.relativeTargetOrigin,f,I),x&&nk(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=Ae()),na(x,this.relativeTarget)),w&&(this.animationValues=d,JI(d,u,this.latestValues,I,g,h)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=I},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){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=te.update(()=>{Li.hasAnimatedSinceResize=!0,this.currentAnimation=HI(0,ik,{...s,onUpdate:i=>{this.mixTargetDelta(i),s.onUpdate&&s.onUpdate(i)},onComplete:()=>{s.onComplete&&s.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);let s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(ik),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let s=this.getLead(),{targetWithTransforms:i,target:l,layout:u,latestValues:d}=s;if(!(!i||!l||!u)){if(this!==s&&this.layout&&u&&gk(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Ae();let c=mt(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+c;let f=mt(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+f}na(i,l),En(i,d),Ci(this.projectionDeltaWithTransform,this.layoutCorrected,i,d)}}registerSharedNode(s,i){this.sharedNodes.has(s)||this.sharedNodes.set(s,new hp),this.sharedNodes.get(s).add(i);let u=i.options.initialPromotionConfig;i.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(i):void 0})}isLead(){let s=this.getStack();return s?s.lead===this:!0}getLead(){var s;let{layoutId:i}=this.options;return i?((s=this.getStack())===null||s===void 0?void 0:s.lead)||this:this}getPrevLead(){var s;let{layoutId:i}=this.options;return i?(s=this.getStack())===null||s===void 0?void 0:s.prevLead:void 0}getStack(){let{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:i,preserveFollowOpacity:l}={}){let u=this.getStack();u&&u.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),i&&this.setOptions({transition:i})}relegate(){let s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){let{visualElement:s}=this.options;if(!s)return;let i=!1,{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(i=!0),!i)return;let u={};l.z&&zy("z",s,u,this.animationValues);for(let d=0;d<Hy.length;d++)zy(`rotate${Hy[d]}`,s,u,this.animationValues),zy(`skew${Hy[d]}`,s,u,this.animationValues);s.render();for(let d in u)s.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);s.scheduleRender()}getProjectionStyles(s){var i,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return bD;let u={visibility:""},d=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=Qs(s?.pointerEvents)||"",u.transform=d?d(this.latestValues,""):"none",u;let c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){let w={};return this.options.layoutId&&(w.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,w.pointerEvents=Qs(s?.pointerEvents)||""),this.hasProjected&&!Er(this.latestValues)&&(w.transform=d?d({},""):"none",this.hasProjected=!1),w}let f=c.animationValues||c.latestValues;this.applyTransformsToTarget(),u.transform=sk(this.projectionDeltaWithTransform,this.treeScale,f),d&&(u.transform=d(f,u.transform));let{x:m,y:v}=this.projectionDelta;u.transformOrigin=`${m.origin*100}% ${v.origin*100}% 0`,c.animationValues?u.opacity=c===this?(l=(i=f.opacity)!==null&&i!==void 0?i:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:u.opacity=c===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(let w in ri){if(f[w]===void 0)continue;let{correct:S,applyTo:h}=ri[w],g=u.transform==="none"?f[w]:S(f[w],c);if(h){let x=h.length;for(let L=0;L<x;L++)u[h[L]]=g}else u[w]=g}return this.options.layoutId&&(u.pointerEvents=c===this?Qs(s?.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>{var i;return(i=s.currentAnimation)===null||i===void 0?void 0:i.stop()}),this.root.nodes.forEach(lk),this.root.sharedNodes.clear()}}}function kD(e){e.updateLayout()}function PD(e){var t;let a=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&a&&e.hasListeners("didUpdate")){let{layoutBox:r,measuredBox:o}=e.layout,{animationType:n}=e.options,s=a.source!==e.layout.source;n==="size"?$t(c=>{let f=s?a.measuredBox[c]:a.layoutBox[c],m=mt(f);f.min=r[c].min,f.max=f.min+m}):gk(n,a.layoutBox,r)&&$t(c=>{let f=s?a.measuredBox[c]:a.layoutBox[c],m=mt(r[c]);f.max=f.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[c].max=e.relativeTarget[c].min+m)});let i=_n();Ci(i,r,a.layoutBox);let l=_n();s?Ci(l,e.applyTransform(o,!0),a.measuredBox):Ci(l,r,a.layoutBox);let u=!Uy(i),d=!1;if(!e.resumeFrom){let c=e.getClosestProjectingParent();if(c&&!c.resumeFrom){let{snapshot:f,layout:m}=c;if(f&&m){let v=Ae();Si(v,a.layoutBox,f.layoutBox);let w=Ae();Si(w,r,m.layoutBox),Vy(v,w)||(d=!0),c.options.layoutRoot&&(e.relativeTarget=w,e.relativeTargetOrigin=v,e.relativeParent=c)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:a,delta:l,layoutDelta:i,hasLayoutChanged:u,hasRelativeTargetChanged:d})}else if(e.isLead()){let{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function TD(e){Ou&&Dn.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 AD(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function RD(e){e.clearSnapshot()}function lk(e){e.clearMeasurements()}function _D(e){e.isLayoutDirty=!1}function ED(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function uk(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function DD(e){e.resolveTargetDelta()}function MD(e){e.calcProjection()}function ND(e){e.resetSkewAndRotation()}function OD(e){e.removeLeadSnapshot()}function dk(e,t,a){e.translate=ie(t.translate,0,a),e.scale=ie(t.scale,1,a),e.origin=t.origin,e.originPoint=t.originPoint}function ck(e,t,a,r){e.min=ie(t.min,a.min,r),e.max=ie(t.max,a.max,r)}function FD(e,t,a,r){ck(e.x,t.x,a.x,r),ck(e.y,t.y,a.y,r)}function BD(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var UD={duration:.45,ease:[.4,0,.1,1]},fk=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),pk=fk("applewebkit/")&&!fk("chrome/")?Math.round:ye;function mk(e){e.min=pk(e.min),e.max=pk(e.max)}function VD(e){mk(e.x),mk(e.y)}function gk(e,t,a){return e==="position"||e==="preserve-aspect"&&!gI(jy(t),jy(a),.2)}function jD(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}var yk=gp({attachResizeListener:(e,t)=>Rr(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0});var $y={current:void 0},yp=gp({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!$y.current){let e=new yk({});e.mount(window),e.setOptions({layoutScroll:!0}),$y.current=e}return $y.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"});var xk={pan:{Feature:fp},drag:{Feature:cp,ProjectionNode:yp,MeasureLayout:pp}};function vk(e,t,a){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",a==="Start");let o="onHover"+a,n=r[o];n&&te.postRender(()=>n(t,_r(t)))}var xp=class extends st{mount(){let{current:t}=this.node;t&&(this.unmount=ly(t,a=>(vk(this.node,a,"Start"),r=>vk(this.node,r,"End"))))}unmount(){}};var vp=class extends st{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=Ja(Rr(this.node.current,"focus",()=>this.onFocus()),Rr(this.node.current,"blur",()=>this.onBlur()))}unmount(){}};function wk(e,t,a){let{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",a==="Start");let o="onTap"+(a==="End"?"":a),n=r[o];n&&te.postRender(()=>n(t,_r(t)))}var wp=class extends st{mount(){let{current:t}=this.node;t&&(this.unmount=dy(t,a=>(wk(this.node,a,"Start"),(r,{success:o})=>wk(this.node,r,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}};var Gy=new WeakMap,Wy=new WeakMap,qD=e=>{let t=Gy.get(e.target);t&&t(e)},HD=e=>{e.forEach(qD)};function zD({root:e,...t}){let a=e||document;Wy.has(a)||Wy.set(a,{});let r=Wy.get(a),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(HD,{root:e,...t})),r[o]}function Ck(e,t,a){let r=zD(t);return Gy.set(e,a),r.observe(e),()=>{Gy.delete(e),r.unobserve(e)}}var $D={some:0,all:1},Cp=class extends st{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:t={}}=this.node.getProps(),{root:a,margin:r,amount:o="some",once:n}=t,s={root:a?a.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:$D[o]},i=l=>{let{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,n&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);let{onViewportEnter:d,onViewportLeave:c}=this.node.getProps(),f=u?d:c;f&&f(l)};return Ck(this.node.current,s,i)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;let{props:t,prevProps:a}=this.node;["amount","margin","root"].some(WD(t,a))&&this.startObserver()}unmount(){}};function WD({viewport:e={}},{viewport:t={}}={}){return a=>e[a]!==t[a]}var Sk={inView:{Feature:Cp},tap:{Feature:wp},focus:{Feature:vp},hover:{Feature:xp}};var Lk={layout:{ProjectionNode:yp,MeasureLayout:pp}};var Tk=F(K(),1);var Fu={current:null},Sp={current:!1};function bk(){if(Sp.current=!0,!!qs)if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Fu.current=e.matches;e.addListener(t),t()}else Fu.current=!1}var GD=[...vy,Xe,Et],Ik=e=>GD.find($f(e));var Ky=new WeakMap;function kk(e,t,a){for(let r in t){let o=t[r],n=a[r];if(Se(o))e.addValue(r,o);else if(Se(n))e.addValue(r,Ar(o,{owner:e}));else if(n!==o)if(e.hasValue(r)){let s=e.getValue(r);s.liveStyle===!0?s.jump(o):s.hasAnimated||s.set(o)}else{let s=e.getStaticValue(r);e.addValue(r,Ar(s!==void 0?s:o,{owner:e}))}}for(let r in a)t[r]===void 0&&e.removeValue(r);return t}var Pk=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Lp=class{scrapeMotionValuesFromProps(t,a,r){return{}}constructor({parent:t,props:a,presenceContext:r,reducedMotionConfig:o,blockInitialAnimation:n,visualState:s},i={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=ko,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=()=>{let m=St.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,te.render(this.render,!1,!0))};let{latestValues:l,renderState:u,onUpdate:d}=s;this.onUpdate=d,this.latestValues=l,this.baseTarget={...l},this.initialValues=a.initial?{...l}:{},this.renderState=u,this.parent=t,this.props=a,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=i,this.blockInitialAnimation=!!n,this.isControllingVariants=Ln(a),this.isVariantNode=cf(a),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);let{willChange:c,...f}=this.scrapeMotionValuesFromProps(a,{},this);for(let m in f){let v=f[m];l[m]!==void 0&&Se(v)&&v.set(l[m],!1)}}mount(t){this.current=t,Ky.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((a,r)=>this.bindToMotionValue(r,a)),Sp.current||bk(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Fu.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Ky.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(let t in this.events)this.events[t].clear();for(let t in this.features){let a=this.features[t];a&&(a.unmount(),a.isMounted=!1)}this.current=null}bindToMotionValue(t,a){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();let r=zt.has(t),o=a.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&te.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),n=a.on("renderRequest",this.scheduleRender),s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,a)),this.valueSubscriptions.set(t,()=>{o(),n(),s&&s(),a.owner&&a.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 Ir){let a=Ir[t];if(!a)continue;let{isEnabled:r,Feature:o}=a;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){let n=this.features[t];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ae()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,a){this.latestValues[t]=a}update(t,a){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=a;for(let r=0;r<Pk.length;r++){let o=Pk[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);let n="on"+o,s=t[n];s&&(this.propEventSubscriptions[o]=this.on(o,s))}this.prevMotionValues=kk(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){let a=this.getClosestVariantNode();if(a)return a.variantChildren&&a.variantChildren.add(t),()=>a.variantChildren.delete(t)}addValue(t,a){let r=this.values.get(t);a!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,a),this.values.set(t,a),this.latestValues[t]=a.get())}removeValue(t){this.values.delete(t);let a=this.valueSubscriptions.get(t);a&&(a(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,a){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&a!==void 0&&(r=Ar(a===null?void 0:a,{owner:this}),this.addValue(t,r)),r}readValue(t,a){var r;let o=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return o!=null&&(typeof o=="string"&&(zf(o)||jf(o))?o=parseFloat(o):!Ik(o)&&Et.test(a)&&(o=Hf(t,a)),this.setBaseTarget(t,Se(o)?o.get():o)),Se(o)?o.get():o}setBaseTarget(t,a){this.baseTarget[t]=a}getBaseTarget(t){var a;let{initial:r}=this.props,o;if(typeof r=="string"||typeof r=="object"){let s=Xs(this.props,r,(a=this.presenceContext)===null||a===void 0?void 0:a.custom);s&&(o=s[t])}if(r&&o!==void 0)return o;let n=this.getBaseTargetFromProps(this.props,t);return n!==void 0&&!Se(n)?n:this.initialValues[t]!==void 0&&o===void 0?void 0:this.baseTarget[t]}on(t,a){return this.events[t]||(this.events[t]=new So),this.events[t].add(a)}notify(t,...a){this.events[t]&&this.events[t].notify(...a)}};var Ii=class extends Lp{constructor(){super(...arguments),this.KeyframeResolver=gi}sortInstanceNodePosition(t,a){return t.compareDocumentPosition(a)&2?1:-1}getBaseTargetFromProps(t,a){return t.style?t.style[a]:void 0}removeValueFromRenderState(t,{vars:a,style:r}){delete a[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:t}=this.props;Se(t)&&(this.childSubscription=t.on("change",a=>{this.current&&(this.current.textContent=`${a}`)}))}};function KD(e){return window.getComputedStyle(e)}var bp=class extends Ii{constructor(){super(...arguments),this.type="html",this.renderInstance=wf}readValueFromInstance(t,a){if(zt.has(a)){let r=hi(a);return r&&r.default||0}else{let r=KD(t),o=(yf(a)?r.getPropertyValue(a):r[a])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:a}){return Ny(t,a)}build(t,a,r){Zs(t,a,r.transformTemplate)}scrapeMotionValuesFromProps(t,a,r){return oi(t,a,r)}};var Ip=class extends Ii{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ae}getBaseTargetFromProps(t,a){return t[a]}readValueFromInstance(t,a){if(zt.has(a)){let r=hi(a);return r&&r.default||0}return a=Cf.has(a)?a:$s(a),t.getAttribute(a)}scrapeMotionValuesFromProps(t,a,r){return bf(t,a,r)}build(t,a,r){ei(t,a,this.isSVGTag,r.transformTemplate)}renderInstance(t,a,r,o){Sf(t,a,r,o)}mount(t){this.isSVGTag=ai(t.tagName),super.mount(t)}};var Ak=(e,t)=>Ks(e)?new Ip(t):new bp(t,{allowProjection:e!==Tk.Fragment});var Rk=sb({...nI,...Sk,...xk,...Lk},Ak);var Bu=kL(Rk);function XD(e){e.values.forEach(t=>t.stop())}function Xy(e,t){[...t].reverse().forEach(r=>{let o=e.getVariant(r);o&&Pu(e,o),e.variantChildren&&e.variantChildren.forEach(n=>{Xy(n,t)})})}function QD(e,t){if(Array.isArray(t))return Xy(e,t);if(typeof t=="string")return Xy(e,[t]);Pu(e,t)}function _k(){let e=!1,t=new Set,a={subscribe(r){return t.add(r),()=>{t.delete(r)}},start(r,o){qt(e,"controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook.");let n=[];return t.forEach(s=>{n.push(ap(s,r,{transitionOverride:o}))}),Promise.all(n)},set(r){return qt(e,"controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook."),t.forEach(o=>{QD(o,r)})},stop(){t.forEach(r=>{XD(r)})},mount(){return e=!0,()=>{e=!1,a.stop()}}};return a}function Qy(){let e=po(_k);return Hs(e.mount,[]),e}var Ve=F(le(),1);function Ek({phase:e,progressSteps:t=[]}){return(0,Ve.jsxs)("div",{className:"mb-3 rounded-lg bg-muted/40 px-3 py-3 text-xs text-muted-foreground transition-colors",children:[e==="thinking"&&t.length===0&&(0,Ve.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ve.jsx)(Ct,{className:"h-3.5 w-3.5 animate-spin"}),(0,Ve.jsx)("span",{children:"Thinking\u2026"})]}),e==="searching"&&(0,Ve.jsxs)("div",{className:"space-y-2 animate-in fade-in-0 duration-300",children:[(0,Ve.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ve.jsx)(wn,{className:"h-3.5 w-3.5 opacity-70"}),(0,Ve.jsx)("span",{children:"Searching across pages\u2026"})]}),(0,Ve.jsxs)("ul",{className:"ml-6 list-disc space-y-1",children:[(0,Ve.jsx)("li",{className:"opacity-90",children:"Checking recent changes"}),(0,Ve.jsx)("li",{className:"opacity-90",children:"Scanning documentation"}),(0,Ve.jsx)("li",{className:"opacity-90",children:"Summarizing relevant sections"})]})]}),(e==="thinking"||e==="executing"||e==="responding")&&t.length>0&&(0,Ve.jsxs)("div",{className:"space-y-2 animate-in fade-in-0 duration-200",children:[t.map((a,r)=>(0,Ve.jsxs)("div",{className:`flex items-center gap-2 transition-opacity duration-200 ${a.completed?"opacity-60":"opacity-100"}`,children:[a.completed?(0,Ve.jsx)(nt,{className:"h-3.5 w-3.5 text-green-500 flex-shrink-0"}):(0,Ve.jsx)(Ct,{className:"h-3.5 w-3.5 animate-spin flex-shrink-0"}),(0,Ve.jsx)("span",{className:a.completed?"line-through":"",children:a.message})]},r)),e==="responding"&&(0,Ve.jsxs)("div",{className:"flex items-center gap-2 opacity-100 animate-in fade-in-0 duration-200",children:[(0,Ve.jsx)(Ct,{className:"h-3.5 w-3.5 animate-spin flex-shrink-0"}),(0,Ve.jsx)("span",{children:"Preparing response..."})]})]})]})}var Dk=F(K(),1);var Ea=F(le(),1);function Mk({title:e,links:t}){let[a,r]=Dk.useState(!1);return(0,Ea.jsxs)("div",{className:"text-xs text-muted-foreground",children:[(0,Ea.jsx)("button",{type:"button",onClick:()=>r(o=>!o),className:"flex w-full items-center gap-2 px-0 py-0","aria-expanded":a,children:(0,Ea.jsxs)("div",{className:"flex items-center gap-1.5",children:[a?(0,Ea.jsx)(uu,{className:"h-3 w-3 opacity-70"}):(0,Ea.jsx)(wn,{className:"h-3 w-3 opacity-70"}),(0,Ea.jsx)("span",{children:e})]})}),a&&t.length>0&&(0,Ea.jsx)("ul",{className:"ml-5 mt-1 space-y-0.5",children:t.map(o=>(0,Ea.jsx)("li",{children:(0,Ea.jsx)("a",{href:o.href,target:"_blank",rel:"noreferrer",className:"text-primary hover:underline",children:o.label})},o.href))})]})}var Uu=F(le(),1);function Nk({x:e,y:t,visible:a,onClick:r=!1}){return(0,Uu.jsx)(Yg,{children:a&&(0,Uu.jsx)(Bu.div,{className:"fixed pointer-events-none z-[9999]",initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1,x:e,y:t},exit:{opacity:0,scale:.5},transition:{type:"spring",stiffness:200,damping:20},style:{left:0,top:0},children:(0,Uu.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Uu.jsx)("path",{d:"M3 3L10.07 19.97L12.58 12.58L19.97 10.07L3 3Z",fill:"#C4B5FD"})})})})}var ki=F(K(),1);function Ok(){let[e,t]=ki.useState({x:0,y:0,visible:!1,onClick:!1}),a=ki.useCallback(n=>{let s=document.querySelector(n.selector);if(s){let i=s.getBoundingClientRect(),l=n.offset?.x||0,u=n.offset?.y||0;t({x:i.left+i.width/2+l,y:i.top+i.height/2+u,visible:!0,onClick:n.onClick||!1})}},[]),r=ki.useCallback(()=>{t(n=>({...n,visible:!1}))},[]),o=ki.useCallback(()=>{t(n=>({...n,visible:!0}))},[]);return{cursorState:e,moveTo:a,hide:r,show:o}}var Ya=F(K(),1);function Fk({productBackendUrl:e,sessionId:t,enabled:a=!0}){let[r,o]=Ya.useState({status:"idle"}),n=Ya.useRef(null),s=Ya.useRef(a),i=Ya.useCallback(async()=>{if(!e||!a){o({status:"idle"});return}o({status:"loading"});try{let u=await fetch(`${e}/users/me`,{method:"GET",credentials:"include",headers:{Accept:"application/json"}});if(!u.ok)throw u.status===401?new Error("Please log in to use the chat assistant."):u.status===403?new Error("You do not have permission to access this feature."):new Error(`Authentication failed (${u.status})`);let d=await u.json();o({status:"authenticated",user:d})}catch(u){if(u instanceof Error){let c=u.message.toLowerCase(),f=u instanceof TypeError||c.includes("failed to fetch")||c.includes("network"),m=c.includes("404");if(f||m){console.warn("[useUserAuth] Auth endpoint unavailable, falling back to unauthenticated mode:",u.message),o({status:"idle"});return}}let d=u instanceof Error?u.message:"Unable to verify your identity. Please try again.";o({status:"error",error:d})}},[e,a]);Ya.useEffect(()=>{let u=t!==n.current,d=a!==s.current,c=a&&!s.current;u&&(n.current=t),d&&(s.current=a),(u||c)&&i()},[t,a,i]);let l=Ya.useCallback(()=>{i()},[i]);return{authState:r,retry:l}}var kp=F(K(),1);function Bk({agentUrl:e,orgId:t}){let[a,r]=kp.useState({status:"idle",config:null,error:null});return kp.useEffect(()=>{if(!e||!t)return;(async()=>{r({status:"loading",config:null,error:null});let n=`${e}/org/${t}/config`;try{let s=await fetch(n,{method:"GET",headers:{Accept:"application/json"}});if(!s.ok)throw new Error(`Failed to fetch org config (${s.status})`);let i=await s.json();r({status:"success",config:i,error:null})}catch(s){let i=s instanceof Error?s.message:"Failed to fetch org config";console.error("[useOrgConfig] Error:",i),r({status:"error",config:null,error:i})}})()},[e,t]),a}var Jy=F(K(),1);function Uk({productBackendUrl:e,agentUrl:t,sessionId:a}){let r=(0,Jy.useCallback)(async n=>{try{await fetch(`${t}/chat/tool-result`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}catch(s){console.error("[FrontendToolExecutor] Failed to send tool result:",s)}},[t]);return{executeToolRequest:(0,Jy.useCallback)(async n=>{let{call_id:s,arguments:i,endpoint:l,method:u,path_params:d}=n;try{let c=l;for(let h of d)i[h]&&(c=c.replace(`{${h}}`,encodeURIComponent(i[h])));let f=new URLSearchParams;for(let[h,g]of Object.entries(i))!d.includes(h)&&g!==void 0&&g!==null&&f.append(h,String(g));let m=f.toString(),v=`${e}${c}${m?"?"+m:""}`,w=await fetch(v,{method:u,credentials:"include",headers:{Accept:"application/json","Content-Type":"application/json"}}),S;if(w.ok)S=await w.json();else{let h=await w.text();throw new Error(`HTTP ${w.status}: ${h}`)}await r({session_id:a,call_id:s,result:S})}catch(c){console.error("[FrontendToolExecutor] Tool execution failed:",c),await r({session_id:a,call_id:s,error:c instanceof Error?c.message:"Unknown error"})}},[e,a,r])}}var Pi=F(le(),1);function Lt({className:e,...t}){return(0,Pi.jsx)("div",{"data-slot":"card",className:ea("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function Za({className:e,...t}){return(0,Pi.jsx)("div",{"data-slot":"card-header",className:ea("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function er({className:e,...t}){return(0,Pi.jsx)("div",{"data-slot":"card-title",className:ea("leading-none font-semibold",e),...t})}function Yy({className:e,...t}){return(0,Pi.jsx)("div",{"data-slot":"card-description",className:ea("text-muted-foreground text-sm",e),...t})}function bt({className:e,...t}){return(0,Pi.jsx)("div",{"data-slot":"card-content",className:ea("px-6",e),...t})}var C=F(le(),1),Zy=e=>new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),Pp=(e,t="USD")=>new Intl.NumberFormat("en-US",{style:"currency",currency:t}).format(e),ex=e=>{switch(e){case"Enterprise":return gn;case"Professional":return hu;default:return su}},Tp=e=>{switch(e){case"Enterprise":return"bg-purple-50 text-purple-700 border-purple-200";case"Professional":return"bg-blue-50 text-blue-700 border-blue-200";default:return"bg-gray-50 text-gray-700 border-gray-200"}};function Vu({status:e,type:t="default"}){let r=(()=>{let n=e.toLowerCase();if(t==="transaction")switch(n){case"paid":return{color:"bg-emerald-50 text-emerald-700 border-emerald-200",icon:nt};case"failed":return{color:"bg-red-50 text-red-700 border-red-200",icon:Ra};case"pending":return{color:"bg-amber-50 text-amber-700 border-amber-200",icon:mn};case"refunded":return{color:"bg-slate-50 text-slate-700 border-slate-200",icon:Fs};default:return{color:"bg-gray-50 text-gray-700 border-gray-200",icon:Aa}}if(t==="subscription")switch(n){case"active":return{color:"bg-emerald-50 text-emerald-700 border-emerald-200",icon:nt};case"cancelled":return{color:"bg-slate-50 text-slate-700 border-slate-200",icon:Ra};case"past_due":return{color:"bg-red-50 text-red-700 border-red-200",icon:Aa};case"trialing":return{color:"bg-blue-50 text-blue-700 border-blue-200",icon:mn};default:return{color:"bg-gray-50 text-gray-700 border-gray-200",icon:Aa}}switch(n){case"active":return{color:"bg-emerald-50 text-emerald-700 border-emerald-200",icon:nt};case"inactive":return{color:"bg-slate-50 text-slate-700 border-slate-200",icon:Ra};default:return{color:"bg-gray-50 text-gray-700 border-gray-200",icon:Aa}}})(),o=r.icon;return(0,C.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium border ${r.color}`,children:[(0,C.jsx)(o,{className:"h-3 w-3"}),e]})}function JD({subscription:e}){let t=ex(e.plan);return(0,C.jsxs)(Lt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,C.jsx)("div",{className:`h-1 ${e.status==="active"?"bg-emerald-500":e.status==="past_due"?"bg-red-500":"bg-slate-300"}`}),(0,C.jsx)(Za,{className:"pb-3",children:(0,C.jsxs)("div",{className:"flex items-start justify-between",children:[(0,C.jsxs)("div",{className:"space-y-1",children:[(0,C.jsxs)(er,{className:"text-base font-semibold text-gray-900 flex items-center gap-2",children:[(0,C.jsx)(hn,{className:"h-4 w-4 text-gray-500"}),e.id]}),e.customer_email&&(0,C.jsxs)(Yy,{className:"text-sm text-gray-500 flex items-center gap-1.5",children:[(0,C.jsx)(Ns,{className:"h-3 w-3"}),e.customer_email]})]}),(0,C.jsx)(Vu,{status:e.status,type:"subscription"})]})}),(0,C.jsx)(bt,{className:"pt-0",children:(0,C.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,C.jsxs)("div",{className:"space-y-3",children:[(0,C.jsxs)("div",{children:[(0,C.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Plan"}),(0,C.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium border ${Tp(e.plan)}`,children:[(0,C.jsx)(t,{className:"h-3 w-3"}),e.plan]})]}),(0,C.jsxs)("div",{children:[(0,C.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Billing"}),(0,C.jsxs)("div",{className:"text-sm font-medium text-gray-900",children:[Pp(e.amount,e.currency)," / ",e.billing_cycle]})]})]}),(0,C.jsxs)("div",{className:"space-y-3",children:[(0,C.jsxs)("div",{children:[(0,C.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Current Period"}),(0,C.jsxs)("div",{className:"text-sm text-gray-700",children:[Zy(e.current_period_start)," - ",Zy(e.current_period_end)]})]}),(0,C.jsxs)("div",{children:[(0,C.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Created"}),(0,C.jsx)("div",{className:"text-sm text-gray-700",children:Zy(e.created_at)})]})]})]})})]})}function YD({subscriptions:e,maxItems:t=5}){let a=e.slice(0,t),r=e.length>t;return e.length===0?(0,C.jsx)(Lt,{className:"border-gray-200 shadow-sm bg-white",children:(0,C.jsxs)(bt,{className:"py-8 text-center",children:[(0,C.jsx)(hn,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,C.jsx)("p",{className:"text-sm text-gray-500",children:"No subscriptions found"})]})}):(0,C.jsxs)(Lt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,C.jsx)(Za,{className:"pb-2 border-b border-gray-100",children:(0,C.jsxs)(er,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,C.jsx)(hn,{className:"h-4 w-4"}),e.length," Subscription",e.length!==1?"s":""]})}),(0,C.jsxs)(bt,{className:"p-0",children:[(0,C.jsx)("div",{className:"divide-y divide-gray-100",children:a.map(o=>{let n=ex(o.plan);return(0,C.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,C.jsxs)("div",{className:"flex items-center justify-between",children:[(0,C.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,C.jsx)("div",{className:`p-2 rounded-lg ${Tp(o.plan).replace("text-","text-").replace("border-","bg-").split(" ")[0]}`,children:(0,C.jsx)(n,{className:"h-4 w-4"})}),(0,C.jsxs)("div",{className:"min-w-0",children:[(0,C.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:o.customer_email||o.customer_id}),(0,C.jsxs)("div",{className:"text-xs text-gray-500",children:[o.plan," \xB7 ",Pp(o.amount,o.currency),"/",o.billing_cycle]})]})]}),(0,C.jsx)(Vu,{status:o.status,type:"subscription"})]})},o.id)})}),r&&(0,C.jsx)("div",{className:"px-4 py-2 bg-gray-50 border-t border-gray-100 text-center",children:(0,C.jsxs)("span",{className:"text-xs text-gray-500",children:["+",e.length-t," more subscription",e.length-t!==1?"s":""]})})]})]})}function ZD({customer:e}){let t=ex(e.subscription);return(0,C.jsxs)(Lt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,C.jsx)("div",{className:`h-1 ${e.status==="active"?"bg-emerald-500":"bg-slate-300"}`}),(0,C.jsx)(Za,{className:"pb-3",children:(0,C.jsxs)("div",{className:"flex items-start justify-between",children:[(0,C.jsx)("div",{className:"flex items-center gap-3",children:(0,C.jsxs)("div",{children:[(0,C.jsx)(er,{className:"text-base font-semibold text-gray-900",children:e.name}),(0,C.jsxs)(Yy,{className:"text-sm text-gray-500 flex items-center gap-1",children:[(0,C.jsx)(Ns,{className:"h-3 w-3"}),e.email]})]})}),(0,C.jsx)(Vu,{status:e.status,type:"customer"})]})}),(0,C.jsx)(bt,{className:"pt-0",children:(0,C.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,C.jsxs)("div",{className:"space-y-3",children:[(0,C.jsxs)("div",{children:[(0,C.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Plan"}),(0,C.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium border ${Tp(e.subscription)}`,children:[(0,C.jsx)(t,{className:"h-3 w-3"}),e.subscription]})]}),(0,C.jsxs)("div",{children:[(0,C.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Revenue"}),(0,C.jsxs)("div",{className:"text-sm font-medium text-gray-900 flex items-center gap-1",children:[(0,C.jsx)(yn,{className:"h-3 w-3 text-emerald-500"}),e.revenue]})]})]}),(0,C.jsxs)("div",{className:"space-y-3",children:[(0,C.jsxs)("div",{children:[(0,C.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Location"}),(0,C.jsxs)("div",{className:"text-sm text-gray-700 flex items-center gap-1",children:[(0,C.jsx)(Os,{className:"h-3 w-3 text-gray-400"}),e.location||"Not specified"]})]}),(0,C.jsxs)("div",{children:[(0,C.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Customer Since"}),(0,C.jsxs)("div",{className:"text-sm text-gray-700 flex items-center gap-1",children:[(0,C.jsx)(lu,{className:"h-3 w-3 text-gray-400"}),e.joinDate]})]})]})]})})]})}function eM({customers:e,maxItems:t=5}){let a=e.slice(0,t),r=e.length>t;return e.length===0?(0,C.jsx)(Lt,{className:"border-gray-200 shadow-sm bg-white",children:(0,C.jsxs)(bt,{className:"py-8 text-center",children:[(0,C.jsx)(Us,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,C.jsx)("p",{className:"text-sm text-gray-500",children:"No customers found"})]})}):(0,C.jsxs)(Lt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,C.jsx)(Za,{className:"pb-2 border-b border-gray-100",children:(0,C.jsxs)(er,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,C.jsx)(Us,{className:"h-4 w-4"}),e.length," Customer",e.length!==1?"s":""]})}),(0,C.jsxs)(bt,{className:"p-0",children:[(0,C.jsx)("div",{className:"divide-y divide-gray-100",children:a.map(o=>(0,C.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,C.jsxs)("div",{className:"flex items-center justify-between",children:[(0,C.jsx)("div",{className:"flex items-center gap-3 min-w-0",children:(0,C.jsxs)("div",{className:"min-w-0",children:[(0,C.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:o.name}),(0,C.jsx)("div",{className:"text-xs text-gray-500 truncate",children:o.email})]})}),(0,C.jsxs)("div",{className:"flex items-center gap-2",children:[(0,C.jsx)("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${Tp(o.subscription)}`,children:o.subscription}),(0,C.jsx)(Vu,{status:o.status,type:"customer"})]})]})},o.id))}),r&&(0,C.jsx)("div",{className:"px-4 py-2 bg-gray-50 border-t border-gray-100 text-center",children:(0,C.jsxs)("span",{className:"text-xs text-gray-500",children:["+",e.length-t," more customer",e.length-t!==1?"s":""]})})]})]})}function Vk({transactions:e,maxItems:t=5}){let a=e.slice(0,t),r=e.length>t;return e.length===0?(0,C.jsx)(Lt,{className:"border-gray-200 shadow-sm bg-white",children:(0,C.jsxs)(bt,{className:"py-8 text-center",children:[(0,C.jsx)(yn,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,C.jsx)("p",{className:"text-sm text-gray-500",children:"No transactions found"})]})}):(0,C.jsxs)(Lt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,C.jsx)(Za,{className:"pb-2 border-b border-gray-100",children:(0,C.jsxs)(er,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,C.jsx)(yn,{className:"h-4 w-4"}),e.length," Transaction",e.length!==1?"s":""]})}),(0,C.jsxs)(bt,{className:"p-0",children:[(0,C.jsx)("div",{className:"divide-y divide-gray-100",children:a.map(o=>(0,C.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,C.jsxs)("div",{className:"flex items-center justify-between",children:[(0,C.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,C.jsx)("div",{className:`p-2 rounded-lg ${o.status==="paid"?"bg-emerald-50":o.status==="failed"?"bg-red-50":o.status==="refunded"?"bg-slate-50":"bg-amber-50"}`,children:o.status==="paid"?(0,C.jsx)(nt,{className:"h-4 w-4 text-emerald-600"}):o.status==="failed"?(0,C.jsx)(Ra,{className:"h-4 w-4 text-red-600"}):o.status==="refunded"?(0,C.jsx)(Fs,{className:"h-4 w-4 text-slate-600"}):(0,C.jsx)(mn,{className:"h-4 w-4 text-amber-600"})}),(0,C.jsxs)("div",{className:"min-w-0",children:[(0,C.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:o.customer}),(0,C.jsxs)("div",{className:"text-xs text-gray-500",children:[o.date,o.decline_reason&&(0,C.jsxs)("span",{className:"text-red-500 ml-2",children:["\xB7 ",o.decline_reason]})]})]})]}),(0,C.jsxs)("div",{className:"flex items-center gap-3",children:[(0,C.jsxs)("span",{className:`text-sm font-semibold ${o.status==="paid"?"text-emerald-600":o.status==="failed"?"text-red-600":o.status==="refunded"?"text-slate-600":"text-amber-600"}`,children:[o.status==="refunded"?"-":"",o.amount]}),(0,C.jsx)(Vu,{status:o.status,type:"transaction"})]})]})},o.id))}),r&&(0,C.jsx)("div",{className:"px-4 py-2 bg-gray-50 border-t border-gray-100 text-center",children:(0,C.jsxs)("span",{className:"text-xs text-gray-500",children:["+",e.length-t," more transaction",e.length-t!==1?"s":""]})})]})]})}function tM({apiKeys:e}){return e.length===0?(0,C.jsx)(Lt,{className:"border-gray-200 shadow-sm bg-white",children:(0,C.jsxs)(bt,{className:"py-8 text-center",children:[(0,C.jsx)(Ms,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,C.jsx)("p",{className:"text-sm text-gray-500",children:"No API keys found"})]})}):(0,C.jsxs)(Lt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,C.jsx)(Za,{className:"pb-2 border-b border-gray-100",children:(0,C.jsxs)(er,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,C.jsx)(Ms,{className:"h-4 w-4"}),e.length," API Key",e.length!==1?"s":""]})}),(0,C.jsx)(bt,{className:"p-0",children:(0,C.jsx)("div",{className:"divide-y divide-gray-100",children:e.map((t,a)=>(0,C.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,C.jsxs)("div",{className:"flex items-center justify-between",children:[(0,C.jsxs)("div",{className:"min-w-0",children:[(0,C.jsx)("div",{className:"text-sm font-medium text-gray-900",children:t.name}),(0,C.jsxs)("div",{className:"text-xs text-gray-500 font-mono",children:[t.key.slice(0,12),"...",t.key.slice(-4)]})]}),(0,C.jsxs)("div",{className:"text-xs text-gray-500",children:["Last used: ",t.lastUsed]})]})},a))})})]})}function aM({sessions:e}){let t=a=>{let r=a.toLowerCase();return r.includes("mobile")||r.includes("iphone")||r.includes("android")?pu:cu};return e.length===0?(0,C.jsx)(Lt,{className:"border-gray-200 shadow-sm bg-white",children:(0,C.jsxs)(bt,{className:"py-8 text-center",children:[(0,C.jsx)(Bs,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,C.jsx)("p",{className:"text-sm text-gray-500",children:"No active sessions"})]})}):(0,C.jsxs)(Lt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,C.jsx)(Za,{className:"pb-2 border-b border-gray-100",children:(0,C.jsxs)(er,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,C.jsx)(Bs,{className:"h-4 w-4"}),e.length," Active Session",e.length!==1?"s":""]})}),(0,C.jsx)(bt,{className:"p-0",children:(0,C.jsx)("div",{className:"divide-y divide-gray-100",children:e.map((a,r)=>{let o=t(a.device);return(0,C.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,C.jsxs)("div",{className:"flex items-center justify-between",children:[(0,C.jsxs)("div",{className:"flex items-center gap-3",children:[(0,C.jsx)("div",{className:"p-2 rounded-lg bg-gray-100",children:(0,C.jsx)(o,{className:"h-4 w-4 text-gray-600"})}),(0,C.jsxs)("div",{children:[(0,C.jsx)("div",{className:"text-sm font-medium text-gray-900",children:a.device}),(0,C.jsxs)("div",{className:"text-xs text-gray-500 flex items-center gap-1",children:[(0,C.jsx)(Os,{className:"h-3 w-3"}),a.location]})]})]}),(0,C.jsx)("div",{className:"text-xs text-gray-500",children:a.time})]})},r)})})})]})}function rM({stats:e}){return(0,C.jsxs)(Lt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,C.jsx)(Za,{className:"pb-2 border-b border-gray-100",children:(0,C.jsxs)(er,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,C.jsx)(mu,{className:"h-4 w-4"}),"Dashboard Overview"]})}),(0,C.jsx)(bt,{className:"p-4",children:(0,C.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[e.revenue&&(0,C.jsxs)("div",{className:"p-3 rounded-lg bg-emerald-50 border border-emerald-100",children:[(0,C.jsx)("div",{className:"text-xs text-emerald-600 font-medium mb-1",children:"Revenue"}),(0,C.jsx)("div",{className:"text-lg font-bold text-emerald-700",children:Pp(e.revenue.total)}),e.revenue.change!==0&&(0,C.jsxs)("div",{className:`text-xs ${e.revenue.change>0?"text-emerald-600":"text-red-600"}`,children:[e.revenue.change>0?"+":"",e.revenue.change,"% from last period"]})]}),e.subscriptions&&(0,C.jsxs)("div",{className:"p-3 rounded-lg bg-blue-50 border border-blue-100",children:[(0,C.jsx)("div",{className:"text-xs text-blue-600 font-medium mb-1",children:"Subscriptions"}),(0,C.jsxs)("div",{className:"text-lg font-bold text-blue-700",children:[e.subscriptions.active," active"]}),(0,C.jsxs)("div",{className:"text-xs text-blue-600",children:[e.subscriptions.total," total"]})]}),e.customers&&(0,C.jsxs)("div",{className:"p-3 rounded-lg bg-purple-50 border border-purple-100",children:[(0,C.jsx)("div",{className:"text-xs text-purple-600 font-medium mb-1",children:"Customers"}),(0,C.jsx)("div",{className:"text-lg font-bold text-purple-700",children:e.customers.total}),e.customers.new>0&&(0,C.jsxs)("div",{className:"text-xs text-purple-600",children:["+",e.customers.new," new this period"]})]}),e.transactions&&(0,C.jsxs)("div",{className:"p-3 rounded-lg bg-amber-50 border border-amber-100",children:[(0,C.jsx)("div",{className:"text-xs text-amber-600 font-medium mb-1",children:"Transactions"}),(0,C.jsxs)("div",{className:"text-lg font-bold text-amber-700",children:[e.transactions.successful," successful"]}),e.transactions.failed>0&&(0,C.jsxs)("div",{className:"text-xs text-red-600",children:[e.transactions.failed," failed"]})]})]})})]})}function oM({customers:e}){return e.length===0?(0,C.jsx)(Lt,{className:"border-gray-200 shadow-sm bg-white",children:(0,C.jsxs)(bt,{className:"py-8 text-center",children:[(0,C.jsx)(gn,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,C.jsx)("p",{className:"text-sm text-gray-500",children:"No top customers data"})]})}):(0,C.jsxs)(Lt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,C.jsx)(Za,{className:"pb-2 border-b border-gray-100",children:(0,C.jsxs)(er,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,C.jsx)(gn,{className:"h-4 w-4 text-amber-500"}),"Top Customers"]})}),(0,C.jsx)(bt,{className:"p-0",children:(0,C.jsx)("div",{className:"divide-y divide-gray-100",children:e.map((t,a)=>(0,C.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,C.jsxs)("div",{className:"flex items-center justify-between",children:[(0,C.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,C.jsx)("div",{className:`h-6 w-6 rounded-full flex items-center justify-center text-xs font-bold ${a===0?"bg-amber-100 text-amber-700":a===1?"bg-slate-100 text-slate-700":a===2?"bg-orange-100 text-orange-700":"bg-gray-100 text-gray-700"}`,children:a+1}),(0,C.jsxs)("div",{className:"min-w-0",children:[(0,C.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:t.name}),(0,C.jsx)("div",{className:"text-xs text-gray-500 truncate",children:t.email})]})]}),(0,C.jsx)("div",{className:"text-sm font-semibold text-emerald-600",children:typeof t.revenue=="number"?Pp(t.revenue):t.revenue})]})},a))})})]})}function jk({type:e,data:t}){if(!t)return null;switch(e){case"subscription":return(0,C.jsx)(JD,{subscription:t});case"subscriptions":let a=t.subscriptions||t||[];return(0,C.jsx)(YD,{subscriptions:Array.isArray(a)?a:[a]});case"customer":return(0,C.jsx)(ZD,{customer:t.customer||t});case"customers":let r=t.customers||t||[];return(0,C.jsx)(eM,{customers:Array.isArray(r)?r:[r]});case"transactions":let o=t.transactions||t||[];return(0,C.jsx)(Vk,{transactions:Array.isArray(o)?o:[o]});case"transaction":return(0,C.jsx)(Vk,{transactions:[t],maxItems:1});case"dashboard_stats":return(0,C.jsx)(rM,{stats:t});case"top_customers":let n=t.customers||t||[];return(0,C.jsx)(oM,{customers:Array.isArray(n)?n:[n]});case"api_keys":let s=t.api_keys||t||[];return(0,C.jsx)(tM,{apiKeys:Array.isArray(s)?s:[s]});case"sessions":let i=t.sessions||t||[];return(0,C.jsx)(aM,{sessions:Array.isArray(i)?i:[i]});default:return null}}var Ti=F(le(),1);function qk({className:e=""}){return(0,Ti.jsxs)("div",{className:`flex items-center gap-1.5 ${e}`,children:[(0,Ti.jsx)("span",{className:"w-2 h-2 bg-gray-500 rounded-full animate-bounce",style:{animationDelay:"0ms",animationDuration:"600ms"}}),(0,Ti.jsx)("span",{className:"w-2 h-2 bg-gray-500 rounded-full animate-bounce",style:{animationDelay:"150ms",animationDuration:"600ms"}}),(0,Ti.jsx)("span",{className:"w-2 h-2 bg-gray-500 rounded-full animate-bounce",style:{animationDelay:"300ms",animationDuration:"600ms"}})]})}var p=F(le(),1);var nM="http://localhost:5002",Ap=400,Rp=600;function sM(e){return e.replace(/\\\\n/g,`
58
+ `),()=>{document.head.removeChild(c)}},[t]),(0,ab.jsx)(Gg,{isPresent:t,childRef:a,sizeRef:o,children:Gd.cloneElement(e,{ref:a})})}var sb=({children:e,initial:t,isPresent:r,onExitComplete:a,custom:o,presenceAffectsLayout:n,mode:s})=>{let i=Co(tE),l=(0,Tn.useId)(),u=(0,Tn.useCallback)(d=>{i.set(d,!0);for(let f of i.values())if(!f)return;a&&a()},[i,a]),c=(0,Tn.useMemo)(()=>({id:l,initial:t,isPresent:r,custom:o,onExitComplete:u,register:d=>(i.set(d,!1),()=>i.delete(d))}),n?[Math.random(),u]:[r,u]);return(0,Tn.useMemo)(()=>{i.forEach((d,f)=>i.set(f,!1))},[r]),nb.useEffect(()=>{!r&&!i.size&&a&&a()},[r]),s==="popLayout"&&(e=(0,Kg.jsx)(ob,{isPresent:r,children:e})),(0,Kg.jsx)(bo.Provider,{value:c,children:e})};function tE(){return new Map}var Lo=B(Q(),1);function Kd(e=!0){let t=(0,Lo.useContext)(bo);if(t===null)return[!0,null];let{isPresent:r,onExitComplete:a,register:o}=t,n=(0,Lo.useId)();(0,Lo.useEffect)(()=>{e&&o(n)},[e]);let s=(0,Lo.useCallback)(()=>e&&a&&a(n),[n,a,e]);return!r&&a?[!1,s]:[!0]}var Xd=B(Q(),1),pu=e=>e.key||"";function Xg(e){let t=[];return Xd.Children.forEach(e,r=>{(0,Xd.isValidElement)(r)&&t.push(r)}),t}var Jd=B(Q(),1);var Ks=typeof window<"u";var Qd=Ks?Jd.useLayoutEffect:Jd.useEffect;var Jg=({children:e,custom:t,initial:r=!0,onExitComplete:a,presenceAffectsLayout:o=!0,mode:n="sync",propagate:s=!1})=>{let[i,l]=Kd(s),u=(0,Yr.useMemo)(()=>Xg(e),[e]),c=s&&!i?[]:u.map(pu),d=(0,Yr.useRef)(!0),f=(0,Yr.useRef)(u),h=Co(()=>new Map),[x,w]=(0,Yr.useState)(u),[C,m]=(0,Yr.useState)(u);Qd(()=>{d.current=!1,f.current=u;for(let b=0;b<C.length;b++){let k=pu(C[b]);c.includes(k)?h.delete(k):h.get(k)!==!0&&h.set(k,!1)}},[C,c.length,c.join("-")]);let g=[];if(u!==x){let b=[...u];for(let k=0;k<C.length;k++){let I=C[k],A=pu(I);c.includes(A)||(b.splice(k,0,I),g.push(I))}n==="wait"&&g.length&&(b=g),m(Xg(b)),w(u);return}let{forceRender:y}=(0,Yr.useContext)(Ws);return(0,hu.jsx)(hu.Fragment,{children:C.map(b=>{let k=pu(b),I=s&&!i?!1:u===C||c.includes(k),A=()=>{if(h.has(k))h.set(k,!0);else return;let R=!0;h.forEach(F=>{F||(R=!1)}),R&&(y?.(),m(f.current),s&&l?.(),a&&a())};return(0,hu.jsx)(sb,{isPresent:I,initial:!d.current||r?void 0:!1,custom:I?void 0:t,presenceAffectsLayout:o,mode:n,onExitComplete:I?void 0:A,children:b},k)})})};var we=e=>e;var Da=we,Ur=we;function _n(e){let t;return()=>(t===void 0&&(t=e()),t)}var ir=(e,t,r)=>{let a=t-e;return a===0?1:(r-e)/a};var Ke=e=>e*1e3,vt=e=>e/1e3;var Xs={skipAnimations:!1,useManualTiming:!1};function ib(e){let t=new Set,r=new Set,a=!1,o=!1,n=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1};function i(u){n.has(u)&&(l.schedule(u),e()),u(s)}let l={schedule:(u,c=!1,d=!1)=>{let h=d&&a?t:r;return c&&n.add(u),h.has(u)||h.add(u),u},cancel:u=>{r.delete(u),n.delete(u)},process:u=>{if(s=u,a){o=!0;return}a=!0,[t,r]=[r,t],t.forEach(i),t.clear(),a=!1,o&&(o=!1,l.process(u))}};return l}var Yd=["read","resolveKeyframes","update","preRender","render","postRender"],rE=40;function Zd(e,t){let r=!1,a=!0,o={delta:0,timestamp:0,isProcessing:!1},n=()=>r=!0,s=Yd.reduce((m,g)=>(m[g]=ib(n),m),{}),{read:i,resolveKeyframes:l,update:u,preRender:c,render:d,postRender:f}=s,h=()=>{let m=Xs.useManualTiming?o.timestamp:performance.now();r=!1,o.delta=a?1e3/60:Math.max(Math.min(m-o.timestamp,rE),1),o.timestamp=m,o.isProcessing=!0,i.process(o),l.process(o),u.process(o),c.process(o),d.process(o),f.process(o),o.isProcessing=!1,r&&t&&(a=!1,e(h))},x=()=>{r=!0,a=!0,o.isProcessing||e(h)};return{schedule:Yd.reduce((m,g)=>{let y=s[g];return m[g]=(b,k=!1,I=!1)=>(r||x(),y.schedule(b,k,I)),m},{}),cancel:m=>{for(let g=0;g<Yd.length;g++)s[Yd[g]].cancel(m)},state:o,steps:s}}var{schedule:ae,cancel:lr,state:Xe,steps:ef}=Zd(typeof requestAnimationFrame<"u"?requestAnimationFrame:we,!0);var lb=B(Q(),1),tf=(0,lb.createContext)({strict:!1});var ub={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"]},Na={};for(let e in ub)Na[e]={isEnabled:t=>ub[e].some(r=>!!t[r])};function cb(e){for(let t in e)Na[t]={...Na[t],...e[t]}}var aE=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 mu(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||aE.has(e)}var db=e=>!mu(e);function oE(e){e&&(db=t=>t.startsWith("on")?!mu(t):e(t))}try{oE(nP("@emotion/is-prop-valid").default)}catch{}function fb(e,t,r){let a={};for(let o in e)o==="values"&&typeof e.values=="object"||(db(o)||r===!0&&mu(o)||!t&&!mu(o)||e.draggable&&o.startsWith("onDrag"))&&(a[o]=e[o]);return a}function pb(e){if(typeof Proxy>"u")return e;let t=new Map,r=(...a)=>e(...a);return new Proxy(r,{get:(a,o)=>o==="create"?e:(t.has(o)||t.set(o,e(o)),t.get(o))})}var lf=B(ce(),1);var Ys=B(Q(),1);var hb=B(Q(),1),Io=(0,hb.createContext)({});var of=B(Q(),1);function Ma(e){return typeof e=="string"||Array.isArray(e)}function ko(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}var rf=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],gu=["initial",...rf];function An(e){return ko(e.animate)||gu.some(t=>Ma(e[t]))}function af(e){return!!(An(e)||e.variants)}function mb(e,t){if(An(e)){let{initial:r,animate:a}=e;return{initial:r===!1||Ma(r)?r:void 0,animate:Ma(a)?a:void 0}}return e.inherit!==!1?t:{}}function yb(e){let{initial:t,animate:r}=mb(e,(0,of.useContext)(Io));return(0,of.useMemo)(()=>({initial:t,animate:r}),[gb(t),gb(r)])}function gb(e){return Array.isArray(e)?e.join(" "):e}var vb=Symbol.for("motionComponentSymbol");var xb=B(Q(),1);function Oa(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function wb(e,t,r){return(0,xb.useCallback)(a=>{a&&e.onMount&&e.onMount(a),t&&(a?t.mount(a):t.unmount()),r&&(typeof r=="function"?r(a):Oa(r)&&(r.current=a))},[t])}var Gt=B(Q(),1);var Js=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase();var nE="framerAppearId",nf="data-"+Js(nE);var{schedule:Qs,cancel:FV}=Zd(queueMicrotask,!1);var Sb=B(Q(),1),sf=(0,Sb.createContext)({});function Cb(e,t,r,a,o){var n,s;let{visualElement:i}=(0,Gt.useContext)(Io),l=(0,Gt.useContext)(tf),u=(0,Gt.useContext)(bo),c=(0,Gt.useContext)(Gs).reducedMotion,d=(0,Gt.useRef)(null);a=a||l.renderer,!d.current&&a&&(d.current=a(e,{visualState:t,parent:i,props:r,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:c}));let f=d.current,h=(0,Gt.useContext)(sf);f&&!f.projection&&o&&(f.type==="html"||f.type==="svg")&&sE(d.current,r,o,h);let x=(0,Gt.useRef)(!1);(0,Gt.useInsertionEffect)(()=>{f&&x.current&&f.update(r,u)});let w=r[nf],C=(0,Gt.useRef)(!!w&&!(!((n=window.MotionHandoffIsComplete)===null||n===void 0)&&n.call(window,w))&&((s=window.MotionHasOptimisedAnimation)===null||s===void 0?void 0:s.call(window,w)));return Qd(()=>{f&&(x.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),Qs.render(f.render),C.current&&f.animationState&&f.animationState.animateChanges())}),(0,Gt.useEffect)(()=>{f&&(!C.current&&f.animationState&&f.animationState.animateChanges(),C.current&&(queueMicrotask(()=>{var m;(m=window.MotionHandoffMarkAsComplete)===null||m===void 0||m.call(window,w)}),C.current=!1))}),f}function sE(e,t,r,a){let{layoutId:o,layout:n,drag:s,dragConstraints:i,layoutScroll:l,layoutRoot:u}=t;e.projection=new r(e.latestValues,t["data-framer-portal-id"]?void 0:bb(e.parent)),e.projection.setOptions({layoutId:o,layout:n,alwaysMeasureLayout:!!s||i&&Oa(i),visualElement:e,animationType:typeof n=="string"?n:"both",initialPromotionConfig:a,layoutScroll:l,layoutRoot:u})}function bb(e){if(e)return e.options.allowProjection!==!1?e.projection:bb(e.parent)}function Lb({preloadedFeatures:e,createVisualElement:t,useRender:r,useVisualState:a,Component:o}){var n,s;e&&cb(e);function i(u,c){let d,f={...(0,Ys.useContext)(Gs),...u,layoutId:iE(u)},{isStatic:h}=f,x=yb(u),w=a(u,h);if(!h&&Ks){lE(f,e);let C=uE(f);d=C.MeasureLayout,x.visualElement=Cb(o,w,f,t,C.ProjectionNode)}return(0,lf.jsxs)(Io.Provider,{value:x,children:[d&&x.visualElement?(0,lf.jsx)(d,{visualElement:x.visualElement,...f}):null,r(o,u,wb(w,x.visualElement,c),w,h,x.visualElement)]})}i.displayName=`motion.${typeof o=="string"?o:`create(${(s=(n=o.displayName)!==null&&n!==void 0?n:o.name)!==null&&s!==void 0?s:""})`}`;let l=(0,Ys.forwardRef)(i);return l[vb]=o,l}function iE({layoutId:e}){let t=(0,Ys.useContext)(Ws).id;return t&&e!==void 0?t+"-"+e:e}function lE(e,t){let r=(0,Ys.useContext)(tf).strict}function uE(e){let{drag:t,layout:r}=Na;if(!t&&!r)return{};let a={...t,...r};return{MeasureLayout:t?.isEnabled(e)||r?.isEnabled(e)?a.MeasureLayout:void 0,ProjectionNode:a.ProjectionNode}}var Ib=["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 Zs(e){return typeof e!="string"||e.includes("-")?!1:!!(Ib.indexOf(e)>-1||/[A-Z]/u.test(e))}var Qg=B(Q(),1);function kb(e){let t=[{},{}];return e?.values.forEach((r,a)=>{t[0][a]=r.get(),t[1][a]=r.getVelocity()}),t}function ei(e,t,r,a){if(typeof t=="function"){let[o,n]=kb(a);t=t(r!==void 0?r:e.custom,o,n)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){let[o,n]=kb(a);t=t(r!==void 0?r:e.custom,o,n)}return t}var yu=e=>Array.isArray(e);var Pb=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),Tb=e=>yu(e)?e[e.length-1]||0:e;var Ie=e=>!!(e&&e.getVelocity);function ti(e){let t=Ie(e)?e.get():e;return Pb(t)?t.toValue():t}function cE({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:r},a,o,n){let s={latestValues:dE(a,o,n,e),renderState:t()};return r&&(s.onMount=i=>r({props:a,current:i,...s}),s.onUpdate=i=>r(i)),s}var uf=e=>(t,r)=>{let a=(0,Qg.useContext)(Io),o=(0,Qg.useContext)(bo),n=()=>cE(e,t,a,o);return r?n():Co(n)};function dE(e,t,r,a){let o={},n=a(e,{});for(let f in n)o[f]=ti(n[f]);let{initial:s,animate:i}=e,l=An(e),u=af(e);t&&u&&!l&&e.inherit!==!1&&(s===void 0&&(s=t.initial),i===void 0&&(i=t.animate));let c=r?r.initial===!1:!1;c=c||s===!1;let d=c?i:s;if(d&&typeof d!="boolean"&&!ko(d)){let f=Array.isArray(d)?d:[d];for(let h=0;h<f.length;h++){let x=ei(e,f[h]);if(x){let{transitionEnd:w,transition:C,...m}=x;for(let g in m){let y=m[g];if(Array.isArray(y)){let b=c?y.length-1:0;y=y[b]}y!==null&&(o[g]=y)}for(let g in w)o[g]=w[g]}}}return o}var Zr=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Kt=new Set(Zr);var _b=e=>t=>typeof t=="string"&&t.startsWith(e),cf=_b("--"),fE=_b("var(--"),ri=e=>fE(e)?pE.test(e.split("/*")[0].trim()):!1,pE=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;var df=(e,t)=>t&&typeof e=="number"?t.transform(e):e;var xt=(e,t,r)=>r>t?t:r<e?e:r;var ea={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Ba={...ea,transform:e=>xt(0,1,e)},vu={...ea,default:1};var xu=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ta=xu("deg"),Ot=xu("%"),H=xu("px"),Ab=xu("vh"),Rb=xu("vw"),Yg={...Ot,parse:e=>Ot.parse(e)/100,transform:e=>Ot.transform(e*100)};var Eb={borderWidth:H,borderTopWidth:H,borderRightWidth:H,borderBottomWidth:H,borderLeftWidth:H,borderRadius:H,radius:H,borderTopLeftRadius:H,borderTopRightRadius:H,borderBottomRightRadius:H,borderBottomLeftRadius:H,width:H,maxWidth:H,height:H,maxHeight:H,top:H,right:H,bottom:H,left:H,padding:H,paddingTop:H,paddingRight:H,paddingBottom:H,paddingLeft:H,margin:H,marginTop:H,marginRight:H,marginBottom:H,marginLeft:H,backgroundPositionX:H,backgroundPositionY:H};var Db={rotate:ta,rotateX:ta,rotateY:ta,rotateZ:ta,scale:vu,scaleX:vu,scaleY:vu,scaleZ:vu,skew:ta,skewX:ta,skewY:ta,distance:H,translateX:H,translateY:H,translateZ:H,x:H,y:H,z:H,perspective:H,transformPerspective:H,opacity:Ba,originX:Yg,originY:Yg,originZ:H};var Zg={...ea,transform:Math.round};var ai={...Eb,...Db,zIndex:Zg,size:H,fillOpacity:Ba,strokeOpacity:Ba,numOctaves:Zg};var hE={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},mE=Zr.length;function Nb(e,t,r){let a="",o=!0;for(let n=0;n<mE;n++){let s=Zr[n],i=e[s];if(i===void 0)continue;let l=!0;if(typeof i=="number"?l=i===(s.startsWith("scale")?1:0):l=parseFloat(i)===0,!l||r){let u=df(i,ai[s]);if(!l){o=!1;let c=hE[s]||s;a+=`${c}(${u}) `}r&&(t[s]=u)}}return a=a.trim(),r?a=r(t,o?"":a):o&&(a="none"),a}function oi(e,t,r){let{style:a,vars:o,transformOrigin:n}=e,s=!1,i=!1;for(let l in t){let u=t[l];if(Kt.has(l)){s=!0;continue}else if(cf(l)){o[l]=u;continue}else{let c=df(u,ai[l]);l.startsWith("origin")?(i=!0,n[l]=c):a[l]=c}}if(t.transform||(s||r?a.transform=Nb(t,e.transform,r):a.transform&&(a.transform="none")),i){let{originX:l="50%",originY:u="50%",originZ:c=0}=n;a.transformOrigin=`${l} ${u} ${c}`}}var gE={offset:"stroke-dashoffset",array:"stroke-dasharray"},yE={offset:"strokeDashoffset",array:"strokeDasharray"};function Mb(e,t,r=1,a=0,o=!0){e.pathLength=1;let n=o?gE:yE;e[n.offset]=H.transform(-a);let s=H.transform(t),i=H.transform(r);e[n.array]=`${s} ${i}`}function Ob(e,t,r){return typeof e=="string"?e:H.transform(t+r*e)}function Bb(e,t,r){let a=Ob(t,e.x,e.width),o=Ob(r,e.y,e.height);return`${a} ${o}`}function ni(e,{attrX:t,attrY:r,attrScale:a,originX:o,originY:n,pathLength:s,pathSpacing:i=1,pathOffset:l=0,...u},c,d){if(oi(e,u,d),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:f,style:h,dimensions:x}=e;f.transform&&(x&&(h.transform=f.transform),delete f.transform),x&&(o!==void 0||n!==void 0||h.transform)&&(h.transformOrigin=Bb(x,o!==void 0?o:.5,n!==void 0?n:.5)),t!==void 0&&(f.x=t),r!==void 0&&(f.y=r),a!==void 0&&(f.scale=a),s!==void 0&&Mb(f,s,i,l,!1)}var si=()=>({style:{},transform:{},transformOrigin:{},vars:{}});var ff=()=>({...si(),attrs:{}});var ii=e=>typeof e=="string"&&e.toLowerCase()==="svg";function pf(e,{style:t,vars:r},a,o){Object.assign(e.style,t,o&&o.getProjectionStyles(a));for(let n in r)e.style.setProperty(n,r[n])}var hf=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 mf(e,t,r,a){pf(e,t,void 0,a);for(let o in t.attrs)e.setAttribute(hf.has(o)?o:Js(o),t.attrs[o])}var li={};function Fb(e){Object.assign(li,e)}function gf(e,{layout:t,layoutId:r}){return Kt.has(e)||e.startsWith("origin")||(t||r!==void 0)&&(!!li[e]||e==="opacity")}function ui(e,t,r){var a;let{style:o}=e,n={};for(let s in o)(Ie(o[s])||t.style&&Ie(t.style[s])||gf(s,e)||((a=r?.getValue(s))===null||a===void 0?void 0:a.liveStyle)!==void 0)&&(n[s]=o[s]);return n}function yf(e,t,r){let a=ui(e,t,r);for(let o in e)if(Ie(e[o])||Ie(t[o])){let n=Zr.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;a[n]=e[o]}return a}function vE(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}var Ub=["x","y","width","height","cx","cy","r"],Vb={useVisualState:uf({scrapeMotionValuesFromProps:yf,createRenderState:ff,onUpdate:({props:e,prevProps:t,current:r,renderState:a,latestValues:o})=>{if(!r)return;let n=!!e.drag;if(!n){for(let i in o)if(Kt.has(i)){n=!0;break}}if(!n)return;let s=!t;if(t)for(let i=0;i<Ub.length;i++){let l=Ub[i];e[l]!==t[l]&&(s=!0)}s&&ae.read(()=>{vE(r,a),ae.render(()=>{ni(a,o,ii(r.tagName),e.transformTemplate),mf(r,a)})})}})};var jb={useVisualState:uf({scrapeMotionValuesFromProps:ui,createRenderState:si})};var ci=B(Q(),1);var qb=B(Q(),1);function ey(e,t,r){for(let a in t)!Ie(t[a])&&!gf(a,r)&&(e[a]=t[a])}function xE({transformTemplate:e},t){return(0,qb.useMemo)(()=>{let r=si();return oi(r,t,e),Object.assign({},r.vars,r.style)},[t])}function wE(e,t){let r=e.style||{},a={};return ey(a,r,e),Object.assign(a,xE(e,t)),a}function $b(e,t){let r={},a=wE(e,t);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,a.userSelect=a.WebkitUserSelect=a.WebkitTouchCallout="none",a.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=a,r}var Hb=B(Q(),1);function zb(e,t,r,a){let o=(0,Hb.useMemo)(()=>{let n=ff();return ni(n,t,ii(a),e.transformTemplate),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let n={};ey(n,e.style,e),o.style={...n,...o.style}}return o}function Wb(e=!1){return(r,a,o,{latestValues:n},s)=>{let l=(Zs(r)?zb:$b)(a,n,s,r),u=fb(a,typeof r=="string",e),c=r!==ci.Fragment?{...u,...l,ref:o}:{},{children:d}=a,f=(0,ci.useMemo)(()=>Ie(d)?d.get():d,[d]);return(0,ci.createElement)(r,{...c,children:f})}}function Gb(e,t){return function(a,{forwardMotionProps:o}={forwardMotionProps:!1}){let s={...Zs(a)?Vb:jb,preloadedFeatures:e,useRender:Wb(o),createVisualElement:t,Component:a};return Lb(s)}}function ty(e,t){if(!Array.isArray(t))return!1;let r=t.length;if(r!==e.length)return!1;for(let a=0;a<r;a++)if(t[a]!==e[a])return!1;return!0}function Po(e,t,r){let a=e.getProps();return ei(a,t,r!==void 0?r:a.custom,e)}var ry=_n(()=>window.ScrollTimeline!==void 0);var wu=class{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,r){for(let a=0;a<this.animations.length;a++)this.animations[a][t]=r}attachTimeline(t,r){let a=this.animations.map(o=>{if(ry()&&o.attachTimeline)return o.attachTimeline(t);if(typeof r=="function")return r(o)});return()=>{a.forEach((o,n)=>{o&&o(),this.animations[n].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;r<this.animations.length;r++)t=Math.max(t,this.animations[r].duration);return t}runAll(t){this.animations.forEach(r=>r[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}};var Su=class extends wu{then(t,r){return Promise.all(this.animations).then(t).catch(r)}};function To(e,t){return e?e[t]||e.default||e:void 0}function di(e){let t=0,r=50,a=e.next(t);for(;!a.done&&t<2e4;)t+=r,a=e.next(t);return t>=2e4?1/0:t}function _o(e){return typeof e=="function"}function Cu(e,t){e.timeline=t,e.onfinish=null}var fi=e=>Array.isArray(e)&&typeof e[0]=="number";var oy={linearEasing:void 0};function Kb(e,t){let r=_n(e);return()=>{var a;return(a=oy[t])!==null&&a!==void 0?a:r()}}var Ao=Kb(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");var bu=(e,t,r=10)=>{let a="",o=Math.max(Math.round(t/r),2);for(let n=0;n<o;n++)a+=e(ir(0,o-1,n))+", ";return`linear(${a.substring(0,a.length-2)})`};function xf(e){return!!(typeof e=="function"&&Ao()||!e||typeof e=="string"&&(e in vf||Ao())||fi(e)||Array.isArray(e)&&e.every(xf))}var pi=([e,t,r,a])=>`cubic-bezier(${e}, ${t}, ${r}, ${a})`,vf={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:pi([0,.65,.55,1]),circOut:pi([.55,0,1,.45]),backIn:pi([.31,.01,.66,-.59]),backOut:pi([.33,1.53,.69,.99])};function hi(e,t){if(e)return typeof e=="function"&&Ao()?bu(e,t):fi(e)?pi(e):Array.isArray(e)?e.map(r=>hi(r,t)||vf.easeOut):vf[e]}var ur={x:!1,y:!1};function mi(){return ur.x||ur.y}function ny(e,t,r){var a;if(e instanceof Element)return[e];if(typeof e=="string"){let o=document;t&&(o=t.current);let n=(a=r?.[e])!==null&&a!==void 0?a:o.querySelectorAll(e);return n?Array.from(n):[]}return Array.from(e)}function wf(e,t){let r=ny(e),a=new AbortController,o={passive:!0,...t,signal:a.signal};return[r,o,()=>a.abort()]}function Xb(e){return t=>{t.pointerType==="touch"||mi()||e(t)}}function sy(e,t,r={}){let[a,o,n]=wf(e,r),s=Xb(i=>{let{target:l}=i,u=t(i);if(typeof u!="function"||!l)return;let c=Xb(d=>{u(d),l.removeEventListener("pointerleave",c)});l.addEventListener("pointerleave",c,o)});return a.forEach(i=>{i.addEventListener("pointerenter",s,o)}),n}var Sf=(e,t)=>t?e===t?!0:Sf(e,t.parentElement):!1;var Rn=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;var SE=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Jb(e){return SE.has(e.tagName)||e.tabIndex!==-1}var En=new WeakSet;function Qb(e){return t=>{t.key==="Enter"&&e(t)}}function iy(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}var Yb=(e,t)=>{let r=e.currentTarget;if(!r)return;let a=Qb(()=>{if(En.has(r))return;iy(r,"down");let o=Qb(()=>{iy(r,"up")}),n=()=>iy(r,"cancel");r.addEventListener("keyup",o,t),r.addEventListener("blur",n,t)});r.addEventListener("keydown",a,t),r.addEventListener("blur",()=>r.removeEventListener("keydown",a),t)};function Zb(e){return Rn(e)&&!mi()}function ly(e,t,r={}){let[a,o,n]=wf(e,r),s=i=>{let l=i.currentTarget;if(!Zb(i)||En.has(l))return;En.add(l);let u=t(i),c=(h,x)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),!(!Zb(h)||!En.has(l))&&(En.delete(l),typeof u=="function"&&u(h,{success:x}))},d=h=>{c(h,r.useGlobalTarget||Sf(l,h.target))},f=h=>{c(h,!1)};window.addEventListener("pointerup",d,o),window.addEventListener("pointercancel",f,o)};return a.forEach(i=>{!Jb(i)&&i.getAttribute("tabindex")===null&&(i.tabIndex=0),(r.useGlobalTarget?window:i).addEventListener("pointerdown",s,o),i.addEventListener("focus",u=>Yb(u,o),o)}),n}function uy(e){return e==="x"||e==="y"?ur[e]?null:(ur[e]=!0,()=>{ur[e]=!1}):ur.x||ur.y?null:(ur.x=ur.y=!0,()=>{ur.x=ur.y=!1})}var Cf=new Set(["width","height","top","left","right","bottom",...Zr]);var bf;function bE(){bf=void 0}var Tt={now:()=>(bf===void 0&&Tt.set(Xe.isProcessing||Xs.useManualTiming?Xe.timestamp:performance.now()),bf),set:e=>{bf=e,queueMicrotask(bE)}};function gi(e,t){e.indexOf(t)===-1&&e.push(t)}function yi(e,t){let r=e.indexOf(t);r>-1&&e.splice(r,1)}var Ro=class{constructor(){this.subscriptions=[]}add(t){return gi(this.subscriptions,t),()=>yi(this.subscriptions,t)}notify(t,r,a){let o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,r,a);else for(let n=0;n<o;n++){let s=this.subscriptions[n];s&&s(t,r,a)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}};function Lf(e,t){return t?e*(1e3/t):0}var tL=30,LE=e=>!isNaN(parseFloat(e)),rL={current:void 0},cy=class{constructor(t,r={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(a,o=!0)=>{let n=Tt.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(a),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),o&&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=Tt.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=LE(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 Ro);let a=this.events[t].add(r);return t==="change"?()=>{a(),ae.read(()=>{this.events.change.getSize()||this.stop()})}:a}clearListeners(){for(let 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,a){this.set(r),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-a}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 rL.current&&rL.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let t=Tt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>tL)return 0;let r=Math.min(this.updatedAt-this.prevUpdatedAt,tL);return Lf(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 Fa(e,t){return new cy(e,t)}function IE(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,Fa(r))}function aL(e,t){let r=Po(e,t),{transitionEnd:a={},transition:o={},...n}=r||{};n={...n,...a};for(let s in n){let i=Tb(n[s]);IE(e,s,i)}}function oL(e){return!!(Ie(e)&&e.add)}function Lu(e,t){let r=e.getValue("willChange");if(oL(r))return r.add(t)}function If(e){return e.props[nf]}var kf={current:!1};var nL=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,kE=1e-7,PE=12;function TE(e,t,r,a,o){let n,s,i=0;do s=t+(r-t)/2,n=nL(s,a,o)-e,n>0?r=s:t=s;while(Math.abs(n)>kE&&++i<PE);return s}function Eo(e,t,r,a){if(e===t&&r===a)return we;let o=n=>TE(n,0,1,e,r);return n=>n===0||n===1?n:nL(o(n),t,a)}var Pf=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2;var Tf=e=>t=>1-e(1-t);var dy=Eo(.33,1.53,.69,.99),Iu=Tf(dy),_f=Pf(Iu);var Af=e=>(e*=2)<1?.5*Iu(e):.5*(2-Math.pow(2,-10*(e-1)));var Rf=e=>1-Math.sin(Math.acos(e)),Ef=Tf(Rf),Df=Pf(Rf);var Nf=e=>/^0[^.\s]+$/u.test(e);function sL(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Nf(e):!0}var Do=e=>Math.round(e*1e5)/1e5;var vi=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function iL(e){return e==null}var lL=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;var xi=(e,t)=>r=>!!(typeof r=="string"&&lL.test(r)&&r.startsWith(e)||t&&!iL(r)&&Object.prototype.hasOwnProperty.call(r,t)),Mf=(e,t,r)=>a=>{if(typeof a!="string")return a;let[o,n,s,i]=a.match(vi);return{[e]:parseFloat(o),[t]:parseFloat(n),[r]:parseFloat(s),alpha:i!==void 0?parseFloat(i):1}};var _E=e=>xt(0,255,e),fy={...ea,transform:e=>Math.round(_E(e))},ra={test:xi("rgb","red"),parse:Mf("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:a=1})=>"rgba("+fy.transform(e)+", "+fy.transform(t)+", "+fy.transform(r)+", "+Do(Ba.transform(a))+")"};function AE(e){let t="",r="",a="",o="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),a=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),a=e.substring(3,4),o=e.substring(4,5),t+=t,r+=r,a+=a,o+=o),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(a,16),alpha:o?parseInt(o,16)/255:1}}var ku={test:xi("#"),parse:AE,transform:ra.transform};var No={test:xi("hsl","hue"),parse:Mf("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:a=1})=>"hsla("+Math.round(e)+", "+Ot.transform(Do(t))+", "+Ot.transform(Do(r))+", "+Do(Ba.transform(a))+")"};var Ze={test:e=>ra.test(e)||ku.test(e)||No.test(e),parse:e=>ra.test(e)?ra.parse(e):No.test(e)?No.parse(e):ku.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ra.transform(e):No.transform(e)};var uL=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function RE(e){var t,r;return isNaN(e)&&typeof e=="string"&&(((t=e.match(vi))===null||t===void 0?void 0:t.length)||0)+(((r=e.match(uL))===null||r===void 0?void 0:r.length)||0)>0}var dL="number",fL="color",EE="var",DE="var(",cL="${}",NE=/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 Dn(e){let t=e.toString(),r=[],a={color:[],number:[],var:[]},o=[],n=0,i=t.replace(NE,l=>(Ze.test(l)?(a.color.push(n),o.push(fL),r.push(Ze.parse(l))):l.startsWith(DE)?(a.var.push(n),o.push(EE),r.push(l)):(a.number.push(n),o.push(dL),r.push(parseFloat(l))),++n,cL)).split(cL);return{values:r,split:i,indexes:a,types:o}}function pL(e){return Dn(e).values}function hL(e){let{split:t,types:r}=Dn(e),a=t.length;return o=>{let n="";for(let s=0;s<a;s++)if(n+=t[s],o[s]!==void 0){let i=r[s];i===dL?n+=Do(o[s]):i===fL?n+=Ze.transform(o[s]):n+=o[s]}return n}}var ME=e=>typeof e=="number"?0:e;function OE(e){let t=pL(e);return hL(e)(t.map(ME))}var Bt={test:RE,parse:pL,createTransformer:hL,getAnimatableNone:OE};var BE=new Set(["brightness","contrast","saturate","opacity"]);function FE(e){let[t,r]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;let[a]=r.match(vi)||[];if(!a)return e;let o=r.replace(a,""),n=BE.has(t)?1:0;return a!==r&&(n*=100),t+"("+n+o+")"}var UE=/\b([a-z-]*)\(.*?\)/gu,Pu={...Bt,getAnimatableNone:e=>{let t=e.match(UE);return t?t.map(FE).join(" "):e}};var VE={...ai,color:Ze,backgroundColor:Ze,outlineColor:Ze,fill:Ze,stroke:Ze,borderColor:Ze,borderTopColor:Ze,borderRightColor:Ze,borderBottomColor:Ze,borderLeftColor:Ze,filter:Pu,WebkitFilter:Pu},wi=e=>VE[e];function Of(e,t){let r=wi(e);return r!==Pu&&(r=Bt),r.getAnimatableNone?r.getAnimatableNone(t):void 0}var jE=new Set(["auto","none","0"]);function mL(e,t,r){let a=0,o;for(;a<e.length&&!o;){let n=e[a];typeof n=="string"&&!jE.has(n)&&Dn(n).values.length&&(o=e[a]),a++}if(o&&r)for(let n of t)e[n]=Of(r,o)}var py=e=>e===ea||e===H,gL=(e,t)=>parseFloat(e.split(", ")[t]),yL=(e,t)=>(r,{transform:a})=>{if(a==="none"||!a)return 0;let o=a.match(/^matrix3d\((.+)\)$/u);if(o)return gL(o[1],t);{let n=a.match(/^matrix\((.+)\)$/u);return n?gL(n[1],e):0}},qE=new Set(["x","y","z"]),$E=Zr.filter(e=>!qE.has(e));function vL(e){let t=[];return $E.forEach(r=>{let a=e.getValue(r);a!==void 0&&(t.push([r,a.get()]),a.set(r.startsWith("scale")?1:0))}),t}var Nn={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:yL(4,13),y:yL(5,14)};Nn.translateX=Nn.x;Nn.translateY=Nn.y;var Mn=new Set,hy=!1,my=!1;function xL(){if(my){let e=Array.from(Mn).filter(a=>a.needsMeasurement),t=new Set(e.map(a=>a.element)),r=new Map;t.forEach(a=>{let o=vL(a);o.length&&(r.set(a,o),a.render())}),e.forEach(a=>a.measureInitialState()),t.forEach(a=>{a.render();let o=r.get(a);o&&o.forEach(([n,s])=>{var i;(i=a.getValue(n))===null||i===void 0||i.set(s)})}),e.forEach(a=>a.measureEndState()),e.forEach(a=>{a.suspendedScrollY!==void 0&&window.scrollTo(0,a.suspendedScrollY)})}my=!1,hy=!1,Mn.forEach(e=>e.complete()),Mn.clear()}function wL(){Mn.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(my=!0)})}function SL(){wL(),xL()}var Mo=class{constructor(t,r,a,o,n,s=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=r,this.name=a,this.motionValue=o,this.element=n,this.isAsync=s}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Mn.add(this),hy||(hy=!0,ae.read(wL),ae.resolveKeyframes(xL))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:t,name:r,element:a,motionValue:o}=this;for(let n=0;n<t.length;n++)if(t[n]===null)if(n===0){let s=o?.get(),i=t[t.length-1];if(s!==void 0)t[0]=s;else if(a&&r){let l=a.readValue(r,i);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=i),o&&s===void 0&&o.set(t[0])}else t[n]=t[n-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Mn.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Mn.delete(this))}resume(){this.isComplete||this.scheduleResolve()}};var Bf=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);var HE=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function zE(e){let t=HE.exec(e);if(!t)return[,];let[,r,a,o]=t;return[`--${r??a}`,o]}var WE=4;function gy(e,t,r=1){Ur(r<=WE,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);let[a,o]=zE(e);if(!a)return;let n=window.getComputedStyle(t).getPropertyValue(a);if(n){let s=n.trim();return Bf(s)?parseFloat(s):s}return ri(o)?gy(o,t,r+1):o}var Ff=e=>t=>t.test(e);var CL={test:e=>e==="auto",parse:e=>e};var yy=[ea,H,Ot,ta,Rb,Ab,CL],vy=e=>yy.find(Ff(e));var Si=class extends Mo{constructor(t,r,a,o,n){super(t,r,a,o,n,!0)}readKeyframes(){let{unresolvedKeyframes:t,element:r,name:a}=this;if(!r||!r.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let u=t[l];if(typeof u=="string"&&(u=u.trim(),ri(u))){let c=gy(u,r.current);c!==void 0&&(t[l]=c),l===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Cf.has(a)||t.length!==2)return;let[o,n]=t,s=vy(o),i=vy(n);if(s!==i)if(py(s)&&py(i))for(let l=0;l<t.length;l++){let u=t[l];typeof u=="string"&&(t[l]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){let{unresolvedKeyframes:t,name:r}=this,a=[];for(let o=0;o<t.length;o++)sL(t[o])&&a.push(o);a.length&&mL(t,a,r)}measureInitialState(){let{element:t,unresolvedKeyframes:r,name:a}=this;if(!t||!t.current)return;a==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Nn[a](t.measureViewportBox(),window.getComputedStyle(t.current)),r[0]=this.measuredOrigin;let o=r[r.length-1];o!==void 0&&t.getValue(a,o).jump(o,!1)}measureEndState(){var t;let{element:r,name:a,unresolvedKeyframes:o}=this;if(!r||!r.current)return;let n=r.getValue(a);n&&n.jump(this.measuredOrigin,!1);let s=o.length-1,i=o[s];o[s]=Nn[a](r.measureViewportBox(),window.getComputedStyle(r.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([l,u])=>{r.getValue(l).set(u)}),this.resolveNoneKeyframes()}};var xy=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Bt.test(e)||e==="0")&&!e.startsWith("url("));function GE(e){let t=e[0];if(e.length===1)return!0;for(let r=0;r<e.length;r++)if(e[r]!==t)return!0}function bL(e,t,r,a){let o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;let n=e[e.length-1],s=xy(o,t),i=xy(n,t);return Da(s===i,`You are trying to animate ${t} from "${o}" to "${n}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${n} via the \`style\` property.`),!s||!i?!1:GE(e)||(r==="spring"||_o(r))&&a}var KE=e=>e!==null;function Oo(e,{repeat:t,repeatType:r="loop"},a){let o=e.filter(KE),n=t&&r!=="loop"&&t%2===1?0:o.length-1;return!n||a===void 0?o[n]:a}var XE=40,Ci=class{constructor({autoplay:t=!0,delay:r=0,type:a="keyframes",repeat:o=0,repeatDelay:n=0,repeatType:s="loop",...i}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Tt.now(),this.options={autoplay:t,delay:r,type:a,repeat:o,repeatDelay:n,repeatType:s,...i},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>XE?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&SL(),this._resolved}onKeyframesResolved(t,r){this.resolvedAt=Tt.now(),this.hasAttemptedResolve=!0;let{name:a,type:o,velocity:n,delay:s,onComplete:i,onUpdate:l,isGenerator:u}=this.options;if(!u&&!bL(t,a,o,n))if(kf.current||!s){l&&l(Oo(t,this.options,r)),i&&i(),this.resolveFinishedPromise();return}else this.options.duration=0;let c=this.initPlayback(t,r);c!==!1&&(this._resolved={keyframes:t,finalKeyframe:r,...c},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})}};var ie=(e,t,r)=>e+(t-e)*r;function wy(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 LL({hue:e,saturation:t,lightness:r,alpha:a}){e/=360,t/=100,r/=100;let o=0,n=0,s=0;if(!t)o=n=s=r;else{let i=r<.5?r*(1+t):r+t-r*t,l=2*r-i;o=wy(l,i,e+1/3),n=wy(l,i,e),s=wy(l,i,e-1/3)}return{red:Math.round(o*255),green:Math.round(n*255),blue:Math.round(s*255),alpha:a}}function bi(e,t){return r=>r>0?t:e}var Sy=(e,t,r)=>{let a=e*e,o=r*(t*t-a)+a;return o<0?0:Math.sqrt(o)},JE=[ku,ra,No],QE=e=>JE.find(t=>t.test(e));function IL(e){let t=QE(e);if(Da(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let r=t.parse(e);return t===No&&(r=LL(r)),r}var Cy=(e,t)=>{let r=IL(e),a=IL(t);if(!r||!a)return bi(e,t);let o={...r};return n=>(o.red=Sy(r.red,a.red,n),o.green=Sy(r.green,a.green,n),o.blue=Sy(r.blue,a.blue,n),o.alpha=ie(r.alpha,a.alpha,n),ra.transform(o))};var YE=(e,t)=>r=>t(e(r)),aa=(...e)=>e.reduce(YE);var Uf=new Set(["none","hidden"]);function kL(e,t){return Uf.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}function ZE(e,t){return r=>ie(e,t,r)}function Vf(e){return typeof e=="number"?ZE:typeof e=="string"?ri(e)?bi:Ze.test(e)?Cy:rD:Array.isArray(e)?PL:typeof e=="object"?Ze.test(e)?Cy:eD:bi}function PL(e,t){let r=[...e],a=r.length,o=e.map((n,s)=>Vf(n)(n,t[s]));return n=>{for(let s=0;s<a;s++)r[s]=o[s](n);return r}}function eD(e,t){let r={...e,...t},a={};for(let o in r)e[o]!==void 0&&t[o]!==void 0&&(a[o]=Vf(e[o])(e[o],t[o]));return o=>{for(let n in a)r[n]=a[n](o);return r}}function tD(e,t){var r;let a=[],o={color:0,var:0,number:0};for(let n=0;n<t.values.length;n++){let s=t.types[n],i=e.indexes[s][o[s]],l=(r=e.values[i])!==null&&r!==void 0?r:0;a[n]=l,o[s]++}return a}var rD=(e,t)=>{let r=Bt.createTransformer(t),a=Dn(e),o=Dn(t);return a.indexes.var.length===o.indexes.var.length&&a.indexes.color.length===o.indexes.color.length&&a.indexes.number.length>=o.indexes.number.length?Uf.has(e)&&!o.values.length||Uf.has(t)&&!a.values.length?kL(e,t):aa(PL(tD(a,o),o.values),r):(Da(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),bi(e,t))};function jf(e,t,r){return typeof e=="number"&&typeof t=="number"&&typeof r=="number"?ie(e,t,r):Vf(e)(e,t)}var aD=5;function qf(e,t,r){let a=Math.max(t-aD,0);return Lf(r-e(a),t-a)}var Re={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};var by=.001;function TL({duration:e=Re.duration,bounce:t=Re.bounce,velocity:r=Re.velocity,mass:a=Re.mass}){let o,n;Da(e<=Ke(Re.maxDuration),"Spring duration must be 10 seconds or less");let s=1-t;s=xt(Re.minDamping,Re.maxDamping,s),e=xt(Re.minDuration,Re.maxDuration,vt(e)),s<1?(o=u=>{let c=u*s,d=c*e,f=c-r,h=$f(u,s),x=Math.exp(-d);return by-f/h*x},n=u=>{let d=u*s*e,f=d*r+r,h=Math.pow(s,2)*Math.pow(u,2)*e,x=Math.exp(-d),w=$f(Math.pow(u,2),s);return(-o(u)+by>0?-1:1)*((f-h)*x)/w}):(o=u=>{let c=Math.exp(-u*e),d=(u-r)*e+1;return-by+c*d},n=u=>{let c=Math.exp(-u*e),d=(r-u)*(e*e);return c*d});let i=5/e,l=nD(o,n,i);if(e=Ke(e),isNaN(l))return{stiffness:Re.stiffness,damping:Re.damping,duration:e};{let u=Math.pow(l,2)*a;return{stiffness:u,damping:s*2*Math.sqrt(a*u),duration:e}}}var oD=12;function nD(e,t,r){let a=r;for(let o=1;o<oD;o++)a=a-e(a)/t(a);return a}function $f(e,t){return e*Math.sqrt(1-t*t)}var sD=["duration","bounce"],iD=["stiffness","damping","mass"];function _L(e,t){return t.some(r=>e[r]!==void 0)}function lD(e){let t={velocity:Re.velocity,stiffness:Re.stiffness,damping:Re.damping,mass:Re.mass,isResolvedFromDuration:!1,...e};if(!_L(e,iD)&&_L(e,sD))if(e.visualDuration){let r=e.visualDuration,a=2*Math.PI/(r*1.2),o=a*a,n=2*xt(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:Re.mass,stiffness:o,damping:n}}else{let r=TL(e);t={...t,...r,mass:Re.mass},t.isResolvedFromDuration=!0}return t}function Hf(e=Re.visualDuration,t=Re.bounce){let r=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e,{restSpeed:a,restDelta:o}=r,n=r.keyframes[0],s=r.keyframes[r.keyframes.length-1],i={done:!1,value:n},{stiffness:l,damping:u,mass:c,duration:d,velocity:f,isResolvedFromDuration:h}=lD({...r,velocity:-vt(r.velocity||0)}),x=f||0,w=u/(2*Math.sqrt(l*c)),C=s-n,m=vt(Math.sqrt(l/c)),g=Math.abs(C)<5;a||(a=g?Re.restSpeed.granular:Re.restSpeed.default),o||(o=g?Re.restDelta.granular:Re.restDelta.default);let y;if(w<1){let k=$f(m,w);y=I=>{let A=Math.exp(-w*m*I);return s-A*((x+w*m*C)/k*Math.sin(k*I)+C*Math.cos(k*I))}}else if(w===1)y=k=>s-Math.exp(-m*k)*(C+(x+m*C)*k);else{let k=m*Math.sqrt(w*w-1);y=I=>{let A=Math.exp(-w*m*I),R=Math.min(k*I,300);return s-A*((x+w*m*C)*Math.sinh(R)+k*C*Math.cosh(R))/k}}let b={calculatedDuration:h&&d||null,next:k=>{let I=y(k);if(h)i.done=k>=d;else{let A=0;w<1&&(A=k===0?Ke(x):qf(y,k,I));let R=Math.abs(A)<=a,F=Math.abs(s-I)<=o;i.done=R&&F}return i.value=i.done?s:I,i},toString:()=>{let k=Math.min(di(b),2e4),I=bu(A=>b.next(k*A).value,k,30);return k+"ms "+I}};return b}function Ly({keyframes:e,velocity:t=0,power:r=.8,timeConstant:a=325,bounceDamping:o=10,bounceStiffness:n=500,modifyTarget:s,min:i,max:l,restDelta:u=.5,restSpeed:c}){let d=e[0],f={done:!1,value:d},h=R=>i!==void 0&&R<i||l!==void 0&&R>l,x=R=>i===void 0?l:l===void 0||Math.abs(i-R)<Math.abs(l-R)?i:l,w=r*t,C=d+w,m=s===void 0?C:s(C);m!==C&&(w=m-d);let g=R=>-w*Math.exp(-R/a),y=R=>m+g(R),b=R=>{let F=g(R),j=y(R);f.done=Math.abs(F)<=u,f.value=f.done?m:j},k,I,A=R=>{h(f.value)&&(k=R,I=Hf({keyframes:[f.value,x(f.value)],velocity:qf(y,R,f.value),damping:o,stiffness:n,restDelta:u,restSpeed:c}))};return A(0),{calculatedDuration:null,next:R=>{let F=!1;return!I&&k===void 0&&(F=!0,b(R),A(R)),k!==void 0&&R>=k?I.next(R-k):(!F&&b(R),f)}}}var AL=Eo(.42,0,1,1),RL=Eo(0,0,.58,1),zf=Eo(.42,0,.58,1);var EL=e=>Array.isArray(e)&&typeof e[0]!="number";var DL={linear:we,easeIn:AL,easeInOut:zf,easeOut:RL,circIn:Rf,circInOut:Df,circOut:Ef,backIn:Iu,backInOut:_f,backOut:dy,anticipate:Af},Iy=e=>{if(fi(e)){Ur(e.length===4,"Cubic bezier arrays must contain four numerical values.");let[t,r,a,o]=e;return Eo(t,r,a,o)}else if(typeof e=="string")return Ur(DL[e]!==void 0,`Invalid easing type '${e}'`),DL[e];return e};function uD(e,t,r){let a=[],o=r||jf,n=e.length-1;for(let s=0;s<n;s++){let i=o(e[s],e[s+1]);if(t){let l=Array.isArray(t)?t[s]||we:t;i=aa(l,i)}a.push(i)}return a}function NL(e,t,{clamp:r=!0,ease:a,mixer:o}={}){let n=e.length;if(Ur(n===t.length,"Both input and output ranges must be the same length"),n===1)return()=>t[0];if(n===2&&t[0]===t[1])return()=>t[1];let s=e[0]===e[1];e[0]>e[n-1]&&(e=[...e].reverse(),t=[...t].reverse());let i=uD(t,a,o),l=i.length,u=c=>{if(s&&c<e[0])return t[0];let d=0;if(l>1)for(;d<e.length-2&&!(c<e[d+1]);d++);let f=ir(e[d],e[d+1],c);return i[d](f)};return r?c=>u(xt(e[0],e[n-1],c)):u}function ML(e,t){let r=e[e.length-1];for(let a=1;a<=t;a++){let o=ir(0,t,a);e.push(ie(r,1,o))}}function OL(e){let t=[0];return ML(t,e.length-1),t}function BL(e,t){return e.map(r=>r*t)}function cD(e,t){return e.map(()=>t||zf).splice(0,e.length-1)}function Tu({duration:e=300,keyframes:t,times:r,ease:a="easeInOut"}){let o=EL(a)?a.map(Iy):Iy(a),n={done:!1,value:t[0]},s=BL(r&&r.length===t.length?r:OL(t),e),i=NL(s,t,{ease:Array.isArray(o)?o:cD(t,o)});return{calculatedDuration:e,next:l=>(n.value=i(l),n.done=l>=e,n)}}var FL=e=>{let t=({timestamp:r})=>e(r);return{start:()=>ae.update(t,!0),stop:()=>lr(t),now:()=>Xe.isProcessing?Xe.timestamp:Tt.now()}};var dD={decay:Ly,inertia:Ly,tween:Tu,keyframes:Tu,spring:Hf},fD=e=>e/100,On=class extends Ci{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();let{onStop:l}=this.options;l&&l()};let{name:r,motionValue:a,element:o,keyframes:n}=this.options,s=o?.KeyframeResolver||Mo,i=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new s(n,i,r,a,o),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){let{type:r="keyframes",repeat:a=0,repeatDelay:o=0,repeatType:n,velocity:s=0}=this.options,i=_o(r)?r:dD[r]||Tu,l,u;i!==Tu&&typeof t[0]!="number"&&(l=aa(fD,jf(t[0],t[1])),t=[0,100]);let c=i({...this.options,keyframes:t});n==="mirror"&&(u=i({...this.options,keyframes:[...t].reverse(),velocity:-s})),c.calculatedDuration===null&&(c.calculatedDuration=di(c));let{calculatedDuration:d}=c,f=d+o,h=f*(a+1)-o;return{generator:c,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:d,resolvedDuration:f,totalDuration:h}}onPostResolved(){let{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,r=!1){let{resolved:a}=this;if(!a){let{keyframes:R}=this.options;return{done:!0,value:R[R.length-1]}}let{finalKeyframe:o,generator:n,mirroredGenerator:s,mapPercentToKeyframes:i,keyframes:l,calculatedDuration:u,totalDuration:c,resolvedDuration:d}=a;if(this.startTime===null)return n.next(0);let{delay:f,repeat:h,repeatType:x,repeatDelay:w,onUpdate:C}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-c/this.speed,this.startTime)),r?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;let m=this.currentTime-f*(this.speed>=0?1:-1),g=this.speed>=0?m<0:m>c;this.currentTime=Math.max(m,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=c);let y=this.currentTime,b=n;if(h){let R=Math.min(this.currentTime,c)/d,F=Math.floor(R),j=R%1;!j&&R>=1&&(j=1),j===1&&F--,F=Math.min(F,h+1),F%2&&(x==="reverse"?(j=1-j,w&&(j-=w/d)):x==="mirror"&&(b=s)),y=xt(0,1,j)*d}let k=g?{done:!1,value:l[0]}:b.next(y);i&&(k.value=i(k.value));let{done:I}=k;!g&&u!==null&&(I=this.speed>=0?this.currentTime>=c:this.currentTime<=0);let A=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&I);return A&&o!==void 0&&(k.value=Oo(l,this.options,o)),C&&C(k.value),A&&this.finish(),k}get duration(){let{resolved:t}=this;return t?vt(t.calculatedDuration):0}get time(){return vt(this.currentTime)}set time(t){t=Ke(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){let r=this.playbackSpeed!==t;this.playbackSpeed=t,r&&(this.time=vt(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;let{driver:t=FL,onPlay:r,startTime:a}=this.options;this.driver||(this.driver=t(n=>this.tick(n))),r&&r();let o=this.driver.now();this.holdTime!==null?this.startTime=o-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=o):this.startTime=a??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";let{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)}};var UL=new Set(["opacity","clipPath","filter","transform"]);function VL(e,t,r,{delay:a=0,duration:o=300,repeat:n=0,repeatType:s="loop",ease:i="easeInOut",times:l}={}){let u={[t]:r};l&&(u.offset=l);let c=hi(i,o);return Array.isArray(c)&&(u.easing=c),e.animate(u,{delay:a,duration:o,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:n+1,direction:s==="reverse"?"alternate":"normal"})}var jL=_n(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));var Wf=10,pD=2e4;function hD(e){return _o(e.type)||e.type==="spring"||!xf(e.ease)}function mD(e,t){let r=new On({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0}),a={done:!1,value:e[0]},o=[],n=0;for(;!a.done&&n<pD;)a=r.sample(n),o.push(a.value),n+=Wf;return{times:void 0,keyframes:o,duration:n-Wf,ease:"linear"}}var qL={anticipate:Af,backInOut:_f,circInOut:Df};function gD(e){return e in qL}var _u=class extends Ci{constructor(t){super(t);let{name:r,motionValue:a,element:o,keyframes:n}=this.options;this.resolver=new Si(n,(s,i)=>this.onKeyframesResolved(s,i),r,a,o),this.resolver.scheduleResolve()}initPlayback(t,r){let{duration:a=300,times:o,ease:n,type:s,motionValue:i,name:l,startTime:u}=this.options;if(!i.owner||!i.owner.current)return!1;if(typeof n=="string"&&Ao()&&gD(n)&&(n=qL[n]),hD(this.options)){let{onComplete:d,onUpdate:f,motionValue:h,element:x,...w}=this.options,C=mD(t,w);t=C.keyframes,t.length===1&&(t[1]=t[0]),a=C.duration,o=C.times,n=C.ease,s="keyframes"}let c=VL(i.owner.current,l,t,{...this.options,duration:a,times:o,ease:n});return c.startTime=u??this.calcStartTime(),this.pendingTimeline?(Cu(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{let{onComplete:d}=this.options;i.set(Oo(t,this.options,r)),d&&d(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:a,times:o,type:s,ease:n,keyframes:t}}get duration(){let{resolved:t}=this;if(!t)return 0;let{duration:r}=t;return vt(r)}get time(){let{resolved:t}=this;if(!t)return 0;let{animation:r}=t;return vt(r.currentTime||0)}set time(t){let{resolved:r}=this;if(!r)return;let{animation:a}=r;a.currentTime=Ke(t)}get speed(){let{resolved:t}=this;if(!t)return 1;let{animation:r}=t;return r.playbackRate}set speed(t){let{resolved:r}=this;if(!r)return;let{animation:a}=r;a.playbackRate=t}get state(){let{resolved:t}=this;if(!t)return"idle";let{animation:r}=t;return r.playState}get startTime(){let{resolved:t}=this;if(!t)return null;let{animation:r}=t;return r.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{let{resolved:r}=this;if(!r)return we;let{animation:a}=r;Cu(a,t)}return we}play(){if(this.isStopped)return;let{resolved:t}=this;if(!t)return;let{animation:r}=t;r.playState==="finished"&&this.updateFinishedPromise(),r.play()}pause(){let{resolved:t}=this;if(!t)return;let{animation:r}=t;r.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();let{resolved:t}=this;if(!t)return;let{animation:r,keyframes:a,duration:o,type:n,ease:s,times:i}=t;if(r.playState==="idle"||r.playState==="finished")return;if(this.time){let{motionValue:u,onUpdate:c,onComplete:d,element:f,...h}=this.options,x=new On({...h,keyframes:a,duration:o,type:n,ease:s,times:i,isGenerator:!0}),w=Ke(this.time);u.setWithVelocity(x.sample(w-Wf).value,x.sample(w).value,Wf)}let{onStop:l}=this.options;l&&l(),this.cancel()}complete(){let{resolved:t}=this;t&&t.animation.finish()}cancel(){let{resolved:t}=this;t&&t.animation.cancel()}static supports(t){let{motionValue:r,name:a,repeatDelay:o,repeatType:n,damping:s,type:i}=t;if(!r||!r.owner||!(r.owner.current instanceof HTMLElement))return!1;let{onUpdate:l,transformTemplate:u}=r.owner.getProps();return jL()&&a&&UL.has(a)&&!l&&!u&&!o&&n!=="mirror"&&s!==0&&i!=="inertia"}};var yD={type:"spring",stiffness:500,damping:25,restSpeed:10},vD=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),xD={type:"keyframes",duration:.8},wD={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},$L=(e,{keyframes:t})=>t.length>2?xD:Kt.has(e)?e.startsWith("scale")?vD(t[1]):yD:wD;function HL({when:e,delay:t,delayChildren:r,staggerChildren:a,staggerDirection:o,repeat:n,repeatType:s,repeatDelay:i,from:l,elapsed:u,...c}){return!!Object.keys(c).length}var Li=(e,t,r,a={},o,n)=>s=>{let i=To(a,e)||{},l=i.delay||a.delay||0,{elapsed:u=0}=a;u=u-Ke(l);let c={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:t.getVelocity(),...i,delay:-u,onUpdate:f=>{t.set(f),i.onUpdate&&i.onUpdate(f)},onComplete:()=>{s(),i.onComplete&&i.onComplete()},name:e,motionValue:t,element:n?void 0:o};HL(i)||(c={...c,...$L(e,c)}),c.duration&&(c.duration=Ke(c.duration)),c.repeatDelay&&(c.repeatDelay=Ke(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let d=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(c.duration=0,c.delay===0&&(d=!0)),(kf.current||Xs.skipAnimations)&&(d=!0,c.duration=0,c.delay=0),d&&!n&&t.get()!==void 0){let f=Oo(c.keyframes,i);if(f!==void 0)return ae.update(()=>{c.onUpdate(f),c.onComplete()}),new Su([])}return!n&&_u.supports(c)?new _u(c):new On(c)};function SD({protectedKeys:e,needsAnimating:t},r){let a=e.hasOwnProperty(r)&&t[r]!==!0;return t[r]=!1,a}function Gf(e,t,{delay:r=0,transitionOverride:a,type:o}={}){var n;let{transition:s=e.getDefaultTransition(),transitionEnd:i,...l}=t;a&&(s=a);let u=[],c=o&&e.animationState&&e.animationState.getState()[o];for(let d in l){let f=e.getValue(d,(n=e.latestValues[d])!==null&&n!==void 0?n:null),h=l[d];if(h===void 0||c&&SD(c,d))continue;let x={delay:r,...To(s||{},d)},w=!1;if(window.MotionHandoffAnimation){let m=If(e);if(m){let g=window.MotionHandoffAnimation(m,d,ae);g!==null&&(x.startTime=g,w=!0)}}Lu(e,d),f.start(Li(d,f,h,e.shouldReduceMotion&&Cf.has(d)?{type:!1}:x,e,w));let C=f.animation;C&&u.push(C)}return i&&Promise.all(u).then(()=>{ae.update(()=>{i&&aL(e,i)})}),u}function Kf(e,t,r={}){var a;let o=Po(e,t,r.type==="exit"?(a=e.presenceContext)===null||a===void 0?void 0:a.custom:void 0),{transition:n=e.getDefaultTransition()||{}}=o||{};r.transitionOverride&&(n=r.transitionOverride);let s=o?()=>Promise.all(Gf(e,o,r)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(u=0)=>{let{delayChildren:c=0,staggerChildren:d,staggerDirection:f}=n;return CD(e,t,c+u,d,f,r)}:()=>Promise.resolve(),{when:l}=n;if(l){let[u,c]=l==="beforeChildren"?[s,i]:[i,s];return u().then(()=>c())}else return Promise.all([s(),i(r.delay)])}function CD(e,t,r=0,a=0,o=1,n){let s=[],i=(e.variantChildren.size-1)*a,l=o===1?(u=0)=>u*a:(u=0)=>i-u*a;return Array.from(e.variantChildren).sort(bD).forEach((u,c)=>{u.notify("AnimationStart",t),s.push(Kf(u,t,{...n,delay:r+l(c)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(s)}function bD(e,t){return e.sortNodePosition(t)}function zL(e,t,r={}){e.notify("AnimationStart",t);let a;if(Array.isArray(t)){let o=t.map(n=>Kf(e,n,r));a=Promise.all(o)}else if(typeof t=="string")a=Kf(e,t,r);else{let o=typeof t=="function"?Po(e,t,r.custom):t;a=Promise.all(Gf(e,o,r))}return a.then(()=>{e.notify("AnimationComplete",t)})}var LD=gu.length;function ky(e){if(!e)return;if(!e.isControllingVariants){let r=e.parent?ky(e.parent)||{}:{};return e.props.initial!==void 0&&(r.initial=e.props.initial),r}let t={};for(let r=0;r<LD;r++){let a=gu[r],o=e.props[a];(Ma(o)||o===!1)&&(t[a]=o)}return t}var ID=[...rf].reverse(),kD=rf.length;function PD(e){return t=>Promise.all(t.map(({animation:r,options:a})=>zL(e,r,a)))}function GL(e){let t=PD(e),r=WL(),a=!0,o=l=>(u,c)=>{var d;let f=Po(e,c,l==="exit"?(d=e.presenceContext)===null||d===void 0?void 0:d.custom:void 0);if(f){let{transition:h,transitionEnd:x,...w}=f;u={...u,...w,...x}}return u};function n(l){t=l(e)}function s(l){let{props:u}=e,c=ky(e.parent)||{},d=[],f=new Set,h={},x=1/0;for(let C=0;C<kD;C++){let m=ID[C],g=r[m],y=u[m]!==void 0?u[m]:c[m],b=Ma(y),k=m===l?g.isActive:null;k===!1&&(x=C);let I=y===c[m]&&y!==u[m]&&b;if(I&&a&&e.manuallyAnimateOnMount&&(I=!1),g.protectedKeys={...h},!g.isActive&&k===null||!y&&!g.prevProp||ko(y)||typeof y=="boolean")continue;let A=TD(g.prevProp,y),R=A||m===l&&g.isActive&&!I&&b||C>x&&b,F=!1,j=Array.isArray(y)?y:[y],ye=j.reduce(o(m),{});k===!1&&(ye={});let{prevResolvedValues:de={}}=g,Uo={...de,...ye},ia=De=>{R=!0,f.has(De)&&(F=!0,f.delete(De)),g.needsAnimating[De]=!0;let St=e.getValue(De);St&&(St.liveStyle=!1)};for(let De in Uo){let St=ye[De],Rt=de[De];if(h.hasOwnProperty(De))continue;let Ft=!1;yu(St)&&yu(Rt)?Ft=!ty(St,Rt):Ft=St!==Rt,Ft?St!=null?ia(De):f.add(De):St!==void 0&&f.has(De)?ia(De):g.protectedKeys[De]=!0}g.prevProp=y,g.prevResolvedValues=ye,g.isActive&&(h={...h,...ye}),a&&e.blockInitialAnimation&&(R=!1),R&&(!(I&&A)||F)&&d.push(...j.map(De=>({animation:De,options:{type:m}})))}if(f.size){let C={};f.forEach(m=>{let g=e.getBaseTarget(m),y=e.getValue(m);y&&(y.liveStyle=!0),C[m]=g??null}),d.push({animation:C})}let w=!!d.length;return a&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(w=!1),a=!1,w?t(d):Promise.resolve()}function i(l,u){var c;if(r[l].isActive===u)return Promise.resolve();(c=e.variantChildren)===null||c===void 0||c.forEach(f=>{var h;return(h=f.animationState)===null||h===void 0?void 0:h.setActive(l,u)}),r[l].isActive=u;let d=s(l);for(let f in r)r[f].protectedKeys={};return d}return{animateChanges:s,setActive:i,setAnimateFunction:n,getState:()=>r,reset:()=>{r=WL(),a=!0}}}function TD(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!ty(t,e):!1}function Bn(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function WL(){return{animate:Bn(!0),whileInView:Bn(),whileHover:Bn(),whileTap:Bn(),whileDrag:Bn(),whileFocus:Bn(),exit:Bn()}}var pt=class{constructor(t){this.isMounted=!1,this.node=t}update(){}};var Xf=class extends pt{constructor(t){super(t),t.animationState||(t.animationState=GL(t))}updateAnimationControlsSubscription(){let{animate:t}=this.node.getProps();ko(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{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)}};var _D=0,Jf=class extends pt{constructor(){super(...arguments),this.id=_D++}update(){if(!this.node.presenceContext)return;let{isPresent:t,onExitComplete:r}=this.node.presenceContext,{isPresent:a}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===a)return;let o=this.node.animationState.setActive("exit",!t);r&&!t&&o.then(()=>r(this.id))}mount(){let{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}};var KL={animation:{Feature:Xf},exit:{Feature:Jf}};function Ua(e,t,r,a={passive:!0}){return e.addEventListener(t,r,a),()=>e.removeEventListener(t,r)}function Va(e){return{point:{x:e.pageX,y:e.pageY}}}var XL=e=>t=>Rn(t)&&e(t,Va(t));function Bo(e,t,r,a){return Ua(e,t,XL(r),a)}var JL=(e,t)=>Math.abs(e-t);function QL(e,t){let r=JL(e.x,t.x),a=JL(e.y,t.y);return Math.sqrt(r**2+a**2)}var Ii=class{constructor(t,r,{transformPagePoint:a,contextWindow:o,dragSnapToOrigin:n=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let d=Ty(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,h=QL(d.offset,{x:0,y:0})>=3;if(!f&&!h)return;let{point:x}=d,{timestamp:w}=Xe;this.history.push({...x,timestamp:w});let{onStart:C,onMove:m}=this.handlers;f||(C&&C(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),m&&m(this.lastMoveEvent,d)},this.handlePointerMove=(d,f)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=Py(f,this.transformPagePoint),ae.update(this.updatePoint,!0)},this.handlePointerUp=(d,f)=>{this.end();let{onEnd:h,onSessionEnd:x,resumeAnimation:w}=this.handlers;if(this.dragSnapToOrigin&&w&&w(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let C=Ty(d.type==="pointercancel"?this.lastMoveEventInfo:Py(f,this.transformPagePoint),this.history);this.startEvent&&h&&h(d,C),x&&x(d,C)},!Rn(t))return;this.dragSnapToOrigin=n,this.handlers=r,this.transformPagePoint=a,this.contextWindow=o||window;let s=Va(t),i=Py(s,this.transformPagePoint),{point:l}=i,{timestamp:u}=Xe;this.history=[{...l,timestamp:u}];let{onSessionStart:c}=r;c&&c(t,Ty(i,this.history)),this.removeListeners=aa(Bo(this.contextWindow,"pointermove",this.handlePointerMove),Bo(this.contextWindow,"pointerup",this.handlePointerUp),Bo(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),lr(this.updatePoint)}};function Py(e,t){return t?{point:t(e.point)}:e}function YL(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Ty({point:e},t){return{point:e,delta:YL(e,ZL(t)),offset:YL(e,AD(t)),velocity:RD(t,.1)}}function AD(e){return e[0]}function ZL(e){return e[e.length-1]}function RD(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,a=null,o=ZL(e);for(;r>=0&&(a=e[r],!(o.timestamp-a.timestamp>Ke(t)));)r--;if(!a)return{x:0,y:0};let n=vt(o.timestamp-a.timestamp);if(n===0)return{x:0,y:0};let s={x:(o.x-a.x)/n,y:(o.y-a.y)/n};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}var aI=1e-4,ED=1-aI,DD=1+aI,oI=.01,ND=0-oI,MD=0+oI;function wt(e){return e.max-e.min}function nI(e,t,r){return Math.abs(e-t)<=r}function eI(e,t,r,a=.5){e.origin=a,e.originPoint=ie(t.min,t.max,e.origin),e.scale=wt(r)/wt(t),e.translate=ie(r.min,r.max,e.origin)-e.originPoint,(e.scale>=ED&&e.scale<=DD||isNaN(e.scale))&&(e.scale=1),(e.translate>=ND&&e.translate<=MD||isNaN(e.translate))&&(e.translate=0)}function ki(e,t,r,a){eI(e.x,t.x,r.x,a?a.originX:void 0),eI(e.y,t.y,r.y,a?a.originY:void 0)}function tI(e,t,r){e.min=r.min+t.min,e.max=e.min+wt(t)}function sI(e,t,r){tI(e.x,t.x,r.x),tI(e.y,t.y,r.y)}function rI(e,t,r){e.min=t.min-r.min,e.max=e.min+wt(t)}function Pi(e,t,r){rI(e.x,t.x,r.x),rI(e.y,t.y,r.y)}function dI(e,{min:t,max:r},a){return t!==void 0&&e<t?e=a?ie(t,e,a.min):Math.max(e,t):r!==void 0&&e>r&&(e=a?ie(r,e,a.max):Math.min(e,r)),e}function iI(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 fI(e,{top:t,left:r,bottom:a,right:o}){return{x:iI(e.x,r,o),y:iI(e.y,t,a)}}function lI(e,t){let r=t.min-e.min,a=t.max-e.max;return t.max-t.min<e.max-e.min&&([r,a]=[a,r]),{min:r,max:a}}function pI(e,t){return{x:lI(e.x,t.x),y:lI(e.y,t.y)}}function hI(e,t){let r=.5,a=wt(e),o=wt(t);return o>a?r=ir(t.min,t.max-a,e.min):a>o&&(r=ir(e.min,e.max-o,t.min)),xt(0,1,r)}function mI(e,t){let r={};return t.min!==void 0&&(r.min=t.min-e.min),t.max!==void 0&&(r.max=t.max-e.min),r}var Qf=.35;function gI(e=Qf){return e===!1?e=0:e===!0&&(e=Qf),{x:uI(e,"left","right"),y:uI(e,"top","bottom")}}function uI(e,t,r){return{min:cI(e,t),max:cI(e,r)}}function cI(e,t){return typeof e=="number"?e:e[t]||0}var yI=()=>({translate:0,scale:1,origin:0,originPoint:0}),Fn=()=>({x:yI(),y:yI()}),vI=()=>({min:0,max:0}),Ee=()=>({x:vI(),y:vI()});function Xt(e){return[e("x"),e("y")]}function Yf({top:e,left:t,right:r,bottom:a}){return{x:{min:t,max:r},y:{min:e,max:a}}}function xI({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function wI(e,t){if(!t)return e;let r=t({x:e.left,y:e.top}),a=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:a.y,right:a.x}}function _y(e){return e===void 0||e===1}function Zf({scale:e,scaleX:t,scaleY:r}){return!_y(e)||!_y(t)||!_y(r)}function ja(e){return Zf(e)||Ay(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Ay(e){return SI(e.x)||SI(e.y)}function SI(e){return e&&e!=="0%"}function Au(e,t,r){let a=e-r,o=t*a;return r+o}function CI(e,t,r,a,o){return o!==void 0&&(e=Au(e,o,a)),Au(e,r,a)+t}function Ry(e,t=0,r=1,a,o){e.min=CI(e.min,t,r,a,o),e.max=CI(e.max,t,r,a,o)}function Ey(e,{x:t,y:r}){Ry(e.x,t.translate,t.scale,t.originPoint),Ry(e.y,r.translate,r.scale,r.originPoint)}var bI=.999999999999,LI=1.0000000000001;function kI(e,t,r,a=!1){let o=r.length;if(!o)return;t.x=t.y=1;let n,s;for(let i=0;i<o;i++){n=r[i],s=n.projectionDelta;let{visualElement:l}=n.options;l&&l.props.style&&l.props.style.display==="contents"||(a&&n.options.layoutScroll&&n.scroll&&n!==n.root&&Un(e,{x:-n.scroll.offset.x,y:-n.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,Ey(e,s)),a&&ja(n.latestValues)&&Un(e,n.latestValues))}t.x<LI&&t.x>bI&&(t.x=1),t.y<LI&&t.y>bI&&(t.y=1)}function Fo(e,t){e.min=e.min+t,e.max=e.max+t}function II(e,t,r,a,o=.5){let n=ie(e.min,e.max,o);Ry(e,t,r,n,a)}function Un(e,t){II(e.x,t.x,t.scaleX,t.scale,t.originX),II(e.y,t.y,t.scaleY,t.scale,t.originY)}function Dy(e,t){return Yf(wI(e.getBoundingClientRect(),t))}function PI(e,t,r){let a=Dy(e,r),{scroll:o}=t;return o&&(Fo(a.x,o.offset.x),Fo(a.y,o.offset.y)),a}var ep=({current:e})=>e?e.ownerDocument.defaultView:null;var OD=new WeakMap,rp=class{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=Ee(),this.visualElement=t}start(t,{snapToCursor:r=!1}={}){let{presenceContext:a}=this.visualElement;if(a&&a.isPresent===!1)return;let o=c=>{let{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),r&&this.snapToCursor(Va(c).point)},n=(c,d)=>{let{drag:f,dragPropagation:h,onDragStart:x}=this.getProps();if(f&&!h&&(this.openDragLock&&this.openDragLock(),this.openDragLock=uy(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),Xt(C=>{let m=this.getAxisMotionValue(C).get()||0;if(Ot.test(m)){let{projection:g}=this.visualElement;if(g&&g.layout){let y=g.layout.layoutBox[C];y&&(m=wt(y)*(parseFloat(m)/100))}}this.originPoint[C]=m}),x&&ae.postRender(()=>x(c,d)),Lu(this.visualElement,"transform");let{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},s=(c,d)=>{let{dragPropagation:f,dragDirectionLock:h,onDirectionLock:x,onDrag:w}=this.getProps();if(!f&&!this.openDragLock)return;let{offset:C}=d;if(h&&this.currentDirection===null){this.currentDirection=BD(C),this.currentDirection!==null&&x&&x(this.currentDirection);return}this.updateAxis("x",d.point,C),this.updateAxis("y",d.point,C),this.visualElement.render(),w&&w(c,d)},i=(c,d)=>this.stop(c,d),l=()=>Xt(c=>{var d;return this.getAnimationState(c)==="paused"&&((d=this.getAxisMotionValue(c).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new Ii(t,{onSessionStart:o,onStart:n,onMove:s,onSessionEnd:i,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:ep(this.visualElement)})}stop(t,r){let a=this.isDragging;if(this.cancel(),!a)return;let{velocity:o}=r;this.startAnimation(o);let{onDragEnd:n}=this.getProps();n&&ae.postRender(()=>n(t,r))}cancel(){this.isDragging=!1;let{projection:t,animationState:r}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:a}=this.getProps();!a&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),r&&r.setActive("whileDrag",!1)}updateAxis(t,r,a){let{drag:o}=this.getProps();if(!a||!tp(t,o,this.currentDirection))return;let n=this.getAxisMotionValue(t),s=this.originPoint[t]+a[t];this.constraints&&this.constraints[t]&&(s=dI(s,this.constraints[t],this.elastic[t])),n.set(s)}resolveConstraints(){var t;let{dragConstraints:r,dragElastic:a}=this.getProps(),o=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,n=this.constraints;r&&Oa(r)?this.constraints||(this.constraints=this.resolveRefConstraints()):r&&o?this.constraints=fI(o.layoutBox,r):this.constraints=!1,this.elastic=gI(a),n!==this.constraints&&o&&this.constraints&&!this.hasMutatedConstraints&&Xt(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=mI(o.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){let{dragConstraints:t,onMeasureDragConstraints:r}=this.getProps();if(!t||!Oa(t))return!1;let a=t.current;Ur(a!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");let{projection:o}=this.visualElement;if(!o||!o.layout)return!1;let n=PI(a,o.root,this.visualElement.getTransformPagePoint()),s=pI(o.layout.layoutBox,n);if(r){let i=r(xI(s));this.hasMutatedConstraints=!!i,i&&(s=Yf(i))}return s}startAnimation(t){let{drag:r,dragMomentum:a,dragElastic:o,dragTransition:n,dragSnapToOrigin:s,onDragTransitionEnd:i}=this.getProps(),l=this.constraints||{},u=Xt(c=>{if(!tp(c,r,this.currentDirection))return;let d=l&&l[c]||{};s&&(d={min:0,max:0});let f=o?200:1e6,h=o?40:1e7,x={type:"inertia",velocity:a?t[c]:0,bounceStiffness:f,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...n,...d};return this.startAxisValueAnimation(c,x)});return Promise.all(u).then(i)}startAxisValueAnimation(t,r){let a=this.getAxisMotionValue(t);return Lu(this.visualElement,t),a.start(Li(t,a,0,r,this.visualElement,!1))}stopAnimation(){Xt(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Xt(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){let r=`_drag${t.toUpperCase()}`,a=this.visualElement.getProps(),o=a[r];return o||this.visualElement.getValue(t,(a.initial?a.initial[t]:void 0)||0)}snapToCursor(t){Xt(r=>{let{drag:a}=this.getProps();if(!tp(r,a,this.currentDirection))return;let{projection:o}=this.visualElement,n=this.getAxisMotionValue(r);if(o&&o.layout){let{min:s,max:i}=o.layout.layoutBox[r];n.set(t[r]-ie(s,i,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:t,dragConstraints:r}=this.getProps(),{projection:a}=this.visualElement;if(!Oa(r)||!a||!this.constraints)return;this.stopAnimation();let o={x:0,y:0};Xt(s=>{let i=this.getAxisMotionValue(s);if(i&&this.constraints!==!1){let l=i.get();o[s]=hI({min:l,max:l},this.constraints[s])}});let{transformTemplate:n}=this.visualElement.getProps();this.visualElement.current.style.transform=n?n({},""):"none",a.root&&a.root.updateScroll(),a.updateLayout(),this.resolveConstraints(),Xt(s=>{if(!tp(s,t,null))return;let i=this.getAxisMotionValue(s),{min:l,max:u}=this.constraints[s];i.set(ie(l,u,o[s]))})}addListeners(){if(!this.visualElement.current)return;OD.set(this.visualElement,this);let t=this.visualElement.current,r=Bo(t,"pointerdown",l=>{let{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),a=()=>{let{dragConstraints:l}=this.getProps();Oa(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,n=o.addEventListener("measure",a);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),ae.read(a);let s=Ua(window,"resize",()=>this.scalePositionWithinConstraints()),i=o.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Xt(c=>{let d=this.getAxisMotionValue(c);d&&(this.originPoint[c]+=l[c].translate,d.set(d.get()+l[c].translate))}),this.visualElement.render())}));return()=>{s(),r(),n(),i&&i()}}getProps(){let t=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:a=!1,dragPropagation:o=!1,dragConstraints:n=!1,dragElastic:s=Qf,dragMomentum:i=!0}=t;return{...t,drag:r,dragDirectionLock:a,dragPropagation:o,dragConstraints:n,dragElastic:s,dragMomentum:i}}};function tp(e,t,r){return(t===!0||t===e)&&(r===null||r===e)}function BD(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}var ap=class extends pt{constructor(t){super(t),this.removeGroupControls=we,this.removeListeners=we,this.controls=new rp(t)}mount(){let{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||we}unmount(){this.removeGroupControls(),this.removeListeners()}};var TI=e=>(t,r)=>{e&&ae.postRender(()=>e(t,r))},op=class extends pt{constructor(){super(...arguments),this.removePointerDownListener=we}onPointerDown(t){this.session=new Ii(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ep(this.node)})}createPanHandlers(){let{onPanSessionStart:t,onPanStart:r,onPan:a,onPanEnd:o}=this.node.getProps();return{onSessionStart:TI(t),onStart:TI(r),onMove:a,onEnd:(n,s)=>{delete this.session,o&&ae.postRender(()=>o(n,s))}}}mount(){this.removePointerDownListener=Bo(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}};var RI=B(ce(),1),Ru=B(Q(),1);var Ti={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function _I(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var _i={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(H.test(e))e=parseFloat(e);else return e;let r=_I(e,t.target.x),a=_I(e,t.target.y);return`${r}% ${a}%`}};var AI={correct:(e,{treeScale:t,projectionDelta:r})=>{let a=e,o=Bt.parse(e);if(o.length>5)return a;let n=Bt.createTransformer(e),s=typeof o[0]!="number"?1:0,i=r.x.scale*t.x,l=r.y.scale*t.y;o[0+s]/=i,o[1+s]/=l;let u=ie(i,l,.5);return typeof o[2+s]=="number"&&(o[2+s]/=u),typeof o[3+s]=="number"&&(o[3+s]/=u),n(o)}};var Ny=class extends Ru.Component{componentDidMount(){let{visualElement:t,layoutGroup:r,switchLayoutGroup:a,layoutId:o}=this.props,{projection:n}=t;Fb(FD),n&&(r.group&&r.group.add(n),a&&a.register&&o&&a.register(n),n.root.didUpdate(),n.addEventListener("animationComplete",()=>{this.safeToRemove()}),n.setOptions({...n.options,onExitComplete:()=>this.safeToRemove()})),Ti.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){let{layoutDependency:r,visualElement:a,drag:o,isPresent:n}=this.props,s=a.projection;return s&&(s.isPresent=n,o||t.layoutDependency!==r||r===void 0?s.willUpdate():this.safeToRemove(),t.isPresent!==n&&(n?s.promote():s.relegate()||ae.postRender(()=>{let i=s.getStack();(!i||!i.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){let{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Qs.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:t,layoutGroup:r,switchLayoutGroup:a}=this.props,{projection:o}=t;o&&(o.scheduleCheckAfterUnmount(),r&&r.group&&r.group.remove(o),a&&a.deregister&&a.deregister(o))}safeToRemove(){let{safeToRemove:t}=this.props;t&&t()}render(){return null}};function np(e){let[t,r]=Kd(),a=(0,Ru.useContext)(Ws);return(0,RI.jsx)(Ny,{...e,layoutGroup:a,switchLayoutGroup:(0,Ru.useContext)(sf),isPresent:t,safeToRemove:r})}var FD={borderRadius:{..._i,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:_i,borderTopRightRadius:_i,borderBottomLeftRadius:_i,borderBottomRightRadius:_i,boxShadow:AI};function EI(e,t,r){let a=Ie(e)?e:Fa(e);return a.start(Li("",a,t,r)),a.animation}function DI(e){return e instanceof SVGElement&&e.tagName!=="svg"}var NI=(e,t)=>e.depth-t.depth;var sp=class{constructor(){this.children=[],this.isDirty=!1}add(t){gi(this.children,t),this.isDirty=!0}remove(t){yi(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(NI),this.isDirty=!1,this.children.forEach(t)}};function MI(e,t){let r=Tt.now(),a=({timestamp:o})=>{let n=o-r;n>=t&&(lr(a),e(n-t))};return ae.read(a,!0),()=>lr(a)}var UI=["TopLeft","TopRight","BottomLeft","BottomRight"],UD=UI.length,OI=e=>typeof e=="string"?parseFloat(e):e,BI=e=>typeof e=="number"||H.test(e);function VI(e,t,r,a,o,n){o?(e.opacity=ie(0,r.opacity!==void 0?r.opacity:1,VD(a)),e.opacityExit=ie(t.opacity!==void 0?t.opacity:1,0,jD(a))):n&&(e.opacity=ie(t.opacity!==void 0?t.opacity:1,r.opacity!==void 0?r.opacity:1,a));for(let s=0;s<UD;s++){let i=`border${UI[s]}Radius`,l=FI(t,i),u=FI(r,i);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||BI(l)===BI(u)?(e[i]=Math.max(ie(OI(l),OI(u),a),0),(Ot.test(u)||Ot.test(l))&&(e[i]+="%")):e[i]=u}(t.rotate||r.rotate)&&(e.rotate=ie(t.rotate||0,r.rotate||0,a))}function FI(e,t){return e[t]!==void 0?e[t]:e.borderRadius}var VD=jI(0,.5,Ef),jD=jI(.5,.95,we);function jI(e,t,r){return a=>a<e?0:a>t?1:r(ir(e,t,a))}function qI(e,t){e.min=t.min,e.max=t.max}function cr(e,t){qI(e.x,t.x),qI(e.y,t.y)}function My(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function $I(e,t,r,a,o){return e-=t,e=Au(e,1/r,a),o!==void 0&&(e=Au(e,1/o,a)),e}function qD(e,t=0,r=1,a=.5,o,n=e,s=e){if(Ot.test(t)&&(t=parseFloat(t),t=ie(s.min,s.max,t/100)-s.min),typeof t!="number")return;let i=ie(n.min,n.max,a);e===n&&(i-=t),e.min=$I(e.min,t,r,i,o),e.max=$I(e.max,t,r,i,o)}function HI(e,t,[r,a,o],n,s){qD(e,t[r],t[a],t[o],t.scale,n,s)}var $D=["x","scaleX","originX"],HD=["y","scaleY","originY"];function Oy(e,t,r,a){HI(e.x,t,$D,r?r.x:void 0,a?a.x:void 0),HI(e.y,t,HD,r?r.y:void 0,a?a.y:void 0)}function zI(e){return e.translate===0&&e.scale===1}function By(e){return zI(e.x)&&zI(e.y)}function WI(e,t){return e.min===t.min&&e.max===t.max}function KI(e,t){return WI(e.x,t.x)&&WI(e.y,t.y)}function GI(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Fy(e,t){return GI(e.x,t.x)&&GI(e.y,t.y)}function Uy(e){return wt(e.x)/wt(e.y)}function Vy(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var ip=class{constructor(){this.members=[]}add(t){gi(this.members,t),t.scheduleRender()}remove(t){if(yi(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){let r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(t){let r=this.members.findIndex(o=>t===o);if(r===0)return!1;let a;for(let o=r;o>=0;o--){let n=this.members[o];if(n.isPresent!==!1){a=n;break}}return a?(this.promote(a),!0):!1}promote(t,r){let a=this.lead;if(t!==a&&(this.prevLead=a,this.lead=t,t.show(),a)){a.instance&&a.scheduleRender(),t.scheduleRender(),t.resumeFrom=a,r&&(t.resumeFrom.preserveOpacity=!0),a.snapshot&&(t.snapshot=a.snapshot,t.snapshot.latestValues=a.animationValues||a.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);let{crossfade:o}=t.options;o===!1&&a.hide()}}exitAnimationComplete(){this.members.forEach(t=>{let{options:r,resumingFrom:a}=t;r.onExitComplete&&r.onExitComplete(),a&&a.options.onExitComplete&&a.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}};function XI(e,t,r){let a="",o=e.x.translate/t.x,n=e.y.translate/t.y,s=r?.z||0;if((o||n||s)&&(a=`translate3d(${o}px, ${n}px, ${s}px) `),(t.x!==1||t.y!==1)&&(a+=`scale(${1/t.x}, ${1/t.y}) `),r){let{transformPerspective:u,rotate:c,rotateX:d,rotateY:f,skewX:h,skewY:x}=r;u&&(a=`perspective(${u}px) ${a}`),c&&(a+=`rotate(${c}deg) `),d&&(a+=`rotateX(${d}deg) `),f&&(a+=`rotateY(${f}deg) `),h&&(a+=`skewX(${h}deg) `),x&&(a+=`skewY(${x}deg) `)}let i=e.x.scale*t.x,l=e.y.scale*t.y;return(i!==1||l!==1)&&(a+=`scale(${i}, ${l})`),a||"none"}var Vn={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Eu=typeof window<"u"&&window.MotionDebug!==void 0,jy=["","X","Y","Z"],zD={visibility:"hidden"},JI=1e3,WD=0;function qy(e,t,r,a){let{latestValues:o}=t;o[e]&&(r[e]=o[e],t.setStaticValue(e,0),a&&(a[e]=0))}function ok(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let r=If(t);if(window.MotionHasOptimisedAnimation(r,"transform")){let{layout:o,layoutId:n}=e.options;window.MotionCancelOptimisedAnimation(r,"transform",ae,!(o||n))}let{parent:a}=e;a&&!a.hasCheckedOptimisedAppear&&ok(a)}function lp({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:a,resetTransform:o}){return class{constructor(s={},i=t?.()){this.id=WD++,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,Eu&&(Vn.totalNodes=Vn.resolvedTargetDeltas=Vn.recalculatedProjection=0),this.nodes.forEach(XD),this.nodes.forEach(eN),this.nodes.forEach(tN),this.nodes.forEach(JD),Eu&&window.MotionDebug.record(Vn)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new sp)}addEventListener(s,i){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new Ro),this.eventHandlers.get(s).add(i)}notifyListeners(s,...i){let l=this.eventHandlers.get(s);l&&l.notify(...i)}hasListeners(s){return this.eventHandlers.has(s)}mount(s,i=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=DI(s),this.instance=s;let{layoutId:l,layout:u,visualElement:c}=this.options;if(c&&!c.current&&c.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),i&&(u||l)&&(this.isLayoutDirty=!0),e){let d,f=()=>this.root.updateBlockedByResize=!1;e(s,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=MI(f,250),Ti.hasAnimatedSinceResize&&(Ti.hasAnimatedSinceResize=!1,this.nodes.forEach(YI))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeTargetChanged:h,layout:x})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let w=this.options.transition||c.getDefaultTransition()||sN,{onLayoutAnimationStart:C,onLayoutAnimationComplete:m}=c.getProps(),g=!this.targetLayout||!Fy(this.targetLayout,x)||h,y=!f&&h;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||y||f&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,y);let b={...To(w,"layout"),onPlay:C,onComplete:m};(c.shouldReduceMotion||this.options.layoutRoot)&&(b.delay=0,b.type=!1),this.startAnimation(b)}else f||YI(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=x})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,lr(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(rN),this.animationId++)}getTransformTemplate(){let{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&ok(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){let d=this.path[c];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}let{layoutId:i,layout:l}=this.options;if(i===void 0&&!l)return;let u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(QI);return}this.isUpdating||this.nodes.forEach(YD),this.isUpdating=!1,this.nodes.forEach(ZD),this.nodes.forEach(GD),this.nodes.forEach(KD),this.clearAllSnapshots();let i=Tt.now();Xe.delta=xt(0,1e3/60,i-Xe.timestamp),Xe.timestamp=i,Xe.isProcessing=!0,ef.update.process(Xe),ef.preRender.process(Xe),ef.render.process(Xe),Xe.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Qs.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(QD),this.sharedNodes.forEach(aN)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ae.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ae.postRender(()=>{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 l=0;l<this.path.length;l++)this.path[l].updateScroll();let s=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Ee(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:i}=this.options;i&&i.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let i=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(i=!1),i){let l=a(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:l,offset:r(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!o)return;let s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,i=this.projectionDelta&&!By(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;s&&(i||ja(this.latestValues)||c)&&(o(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){let i=this.measurePageBox(),l=this.removeElementScroll(i);return s&&(l=this.removeTransform(l)),iN(l),{animationId:this.root.animationId,measuredBox:i,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var s;let{visualElement:i}=this.options;if(!i)return Ee();let l=i.measureViewportBox();if(!(((s=this.scroll)===null||s===void 0?void 0:s.wasRoot)||this.path.some(lN))){let{scroll:c}=this.root;c&&(Fo(l.x,c.offset.x),Fo(l.y,c.offset.y))}return l}removeElementScroll(s){var i;let l=Ee();if(cr(l,s),!((i=this.scroll)===null||i===void 0)&&i.wasRoot)return l;for(let u=0;u<this.path.length;u++){let c=this.path[u],{scroll:d,options:f}=c;c!==this.root&&d&&f.layoutScroll&&(d.wasRoot&&cr(l,s),Fo(l.x,d.offset.x),Fo(l.y,d.offset.y))}return l}applyTransform(s,i=!1){let l=Ee();cr(l,s);for(let u=0;u<this.path.length;u++){let c=this.path[u];!i&&c.options.layoutScroll&&c.scroll&&c!==c.root&&Un(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),ja(c.latestValues)&&Un(l,c.latestValues)}return ja(this.latestValues)&&Un(l,this.latestValues),l}removeTransform(s){let i=Ee();cr(i,s);for(let l=0;l<this.path.length;l++){let u=this.path[l];if(!u.instance||!ja(u.latestValues))continue;Zf(u.latestValues)&&u.updateSnapshot();let c=Ee(),d=u.measurePageBox();cr(c,d),Oy(i,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return ja(this.latestValues)&&Oy(i,this.latestValues),i}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Xe.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){var i;let l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);let u=!!this.resumingFrom||this!==l;if(!(s||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((i=this.parent)===null||i===void 0)&&i.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:d,layoutId:f}=this.options;if(!(!this.layout||!(d||f))){if(this.resolvedRelativeTargetAt=Xe.timestamp,!this.targetDelta&&!this.relativeTarget){let h=this.getClosestProjectingParent();h&&h.layout&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ee(),this.relativeTargetOrigin=Ee(),Pi(this.relativeTargetOrigin,this.layout.layoutBox,h.layout.layoutBox),cr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Ee(),this.targetWithTransforms=Ee()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),sI(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):cr(this.target,this.layout.layoutBox),Ey(this.target,this.targetDelta)):cr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;let h=this.getClosestProjectingParent();h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ee(),this.relativeTargetOrigin=Ee(),Pi(this.relativeTargetOrigin,this.target,h.target),cr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Eu&&Vn.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Zf(this.parent.latestValues)||Ay(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var s;let i=this.getLead(),l=!!this.resumingFrom||this!==i,u=!0;if((this.isProjectionDirty||!((s=this.parent)===null||s===void 0)&&s.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===Xe.timestamp&&(u=!1),u)return;let{layout:c,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||d))return;cr(this.layoutCorrected,this.layout.layoutBox);let f=this.treeScale.x,h=this.treeScale.y;kI(this.layoutCorrected,this.treeScale,this.path,l),i.layout&&!i.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(i.target=i.layout.layoutBox,i.targetWithTransforms=Ee());let{target:x}=i;if(!x){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(My(this.prevProjectionDelta.x,this.projectionDelta.x),My(this.prevProjectionDelta.y,this.projectionDelta.y)),ki(this.projectionDelta,this.layoutCorrected,x,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==h||!Vy(this.projectionDelta.x,this.prevProjectionDelta.x)||!Vy(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",x)),Eu&&Vn.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){var i;if((i=this.options.visualElement)===null||i===void 0||i.scheduleRender(),s){let l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Fn(),this.projectionDelta=Fn(),this.projectionDeltaWithTransform=Fn()}setAnimationOrigin(s,i=!1){let l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},d=Fn();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!i;let f=Ee(),h=l?l.source:void 0,x=this.layout?this.layout.source:void 0,w=h!==x,C=this.getStack(),m=!C||C.members.length<=1,g=!!(w&&!m&&this.options.crossfade===!0&&!this.path.some(nN));this.animationProgress=0;let y;this.mixTargetDelta=b=>{let k=b/1e3;ZI(d.x,s.x,k),ZI(d.y,s.y,k),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Pi(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),oN(this.relativeTarget,this.relativeTargetOrigin,f,k),y&&KI(this.relativeTarget,y)&&(this.isProjectionDirty=!1),y||(y=Ee()),cr(y,this.relativeTarget)),w&&(this.animationValues=c,VI(c,u,this.latestValues,k,g,m)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=k},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(lr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ae.update(()=>{Ti.hasAnimatedSinceResize=!0,this.currentAnimation=EI(0,JI,{...s,onUpdate:i=>{this.mixTargetDelta(i),s.onUpdate&&s.onUpdate(i)},onComplete:()=>{s.onComplete&&s.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);let s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(JI),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let s=this.getLead(),{targetWithTransforms:i,target:l,layout:u,latestValues:c}=s;if(!(!i||!l||!u)){if(this!==s&&this.layout&&u&&nk(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Ee();let d=wt(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+d;let f=wt(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+f}cr(i,l),Un(i,c),ki(this.projectionDeltaWithTransform,this.layoutCorrected,i,c)}}registerSharedNode(s,i){this.sharedNodes.has(s)||this.sharedNodes.set(s,new ip),this.sharedNodes.get(s).add(i);let u=i.options.initialPromotionConfig;i.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(i):void 0})}isLead(){let s=this.getStack();return s?s.lead===this:!0}getLead(){var s;let{layoutId:i}=this.options;return i?((s=this.getStack())===null||s===void 0?void 0:s.lead)||this:this}getPrevLead(){var s;let{layoutId:i}=this.options;return i?(s=this.getStack())===null||s===void 0?void 0:s.prevLead:void 0}getStack(){let{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:i,preserveFollowOpacity:l}={}){let u=this.getStack();u&&u.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),i&&this.setOptions({transition:i})}relegate(){let s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){let{visualElement:s}=this.options;if(!s)return;let i=!1,{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(i=!0),!i)return;let u={};l.z&&qy("z",s,u,this.animationValues);for(let c=0;c<jy.length;c++)qy(`rotate${jy[c]}`,s,u,this.animationValues),qy(`skew${jy[c]}`,s,u,this.animationValues);s.render();for(let c in u)s.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);s.scheduleRender()}getProjectionStyles(s){var i,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return zD;let u={visibility:""},c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=ti(s?.pointerEvents)||"",u.transform=c?c(this.latestValues,""):"none",u;let d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){let w={};return this.options.layoutId&&(w.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,w.pointerEvents=ti(s?.pointerEvents)||""),this.hasProjected&&!ja(this.latestValues)&&(w.transform=c?c({},""):"none",this.hasProjected=!1),w}let f=d.animationValues||d.latestValues;this.applyTransformsToTarget(),u.transform=XI(this.projectionDeltaWithTransform,this.treeScale,f),c&&(u.transform=c(f,u.transform));let{x:h,y:x}=this.projectionDelta;u.transformOrigin=`${h.origin*100}% ${x.origin*100}% 0`,d.animationValues?u.opacity=d===this?(l=(i=f.opacity)!==null&&i!==void 0?i:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:u.opacity=d===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(let w in li){if(f[w]===void 0)continue;let{correct:C,applyTo:m}=li[w],g=u.transform==="none"?f[w]:C(f[w],d);if(m){let y=m.length;for(let b=0;b<y;b++)u[m[b]]=g}else u[w]=g}return this.options.layoutId&&(u.pointerEvents=d===this?ti(s?.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>{var i;return(i=s.currentAnimation)===null||i===void 0?void 0:i.stop()}),this.root.nodes.forEach(QI),this.root.sharedNodes.clear()}}}function GD(e){e.updateLayout()}function KD(e){var t;let r=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&r&&e.hasListeners("didUpdate")){let{layoutBox:a,measuredBox:o}=e.layout,{animationType:n}=e.options,s=r.source!==e.layout.source;n==="size"?Xt(d=>{let f=s?r.measuredBox[d]:r.layoutBox[d],h=wt(f);f.min=a[d].min,f.max=f.min+h}):nk(n,r.layoutBox,a)&&Xt(d=>{let f=s?r.measuredBox[d]:r.layoutBox[d],h=wt(a[d]);f.max=f.min+h,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+h)});let i=Fn();ki(i,a,r.layoutBox);let l=Fn();s?ki(l,e.applyTransform(o,!0),r.measuredBox):ki(l,a,r.layoutBox);let u=!By(i),c=!1;if(!e.resumeFrom){let d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){let{snapshot:f,layout:h}=d;if(f&&h){let x=Ee();Pi(x,r.layoutBox,f.layoutBox);let w=Ee();Pi(w,a,h.layoutBox),Fy(x,w)||(c=!0),d.options.layoutRoot&&(e.relativeTarget=w,e.relativeTargetOrigin=x,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:a,snapshot:r,delta:l,layoutDelta:i,hasLayoutChanged:u,hasRelativeTargetChanged:c})}else if(e.isLead()){let{onExitComplete:a}=e.options;a&&a()}e.options.transition=void 0}function XD(e){Eu&&Vn.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 JD(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function QD(e){e.clearSnapshot()}function QI(e){e.clearMeasurements()}function YD(e){e.isLayoutDirty=!1}function ZD(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function YI(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function eN(e){e.resolveTargetDelta()}function tN(e){e.calcProjection()}function rN(e){e.resetSkewAndRotation()}function aN(e){e.removeLeadSnapshot()}function ZI(e,t,r){e.translate=ie(t.translate,0,r),e.scale=ie(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function ek(e,t,r,a){e.min=ie(t.min,r.min,a),e.max=ie(t.max,r.max,a)}function oN(e,t,r,a){ek(e.x,t.x,r.x,a),ek(e.y,t.y,r.y,a)}function nN(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var sN={duration:.45,ease:[.4,0,.1,1]},tk=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),rk=tk("applewebkit/")&&!tk("chrome/")?Math.round:we;function ak(e){e.min=rk(e.min),e.max=rk(e.max)}function iN(e){ak(e.x),ak(e.y)}function nk(e,t,r){return e==="position"||e==="preserve-aspect"&&!nI(Uy(t),Uy(r),.2)}function lN(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}var sk=lp({attachResizeListener:(e,t)=>Ua(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0});var $y={current:void 0},up=lp({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!$y.current){let e=new sk({});e.mount(window),e.setOptions({layoutScroll:!0}),$y.current=e}return $y.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"});var ik={pan:{Feature:op},drag:{Feature:ap,ProjectionNode:up,MeasureLayout:np}};function lk(e,t,r){let{props:a}=e;e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",r==="Start");let o="onHover"+r,n=a[o];n&&ae.postRender(()=>n(t,Va(t)))}var cp=class extends pt{mount(){let{current:t}=this.node;t&&(this.unmount=sy(t,r=>(lk(this.node,r,"Start"),a=>lk(this.node,a,"End"))))}unmount(){}};var dp=class extends pt{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=aa(Ua(this.node.current,"focus",()=>this.onFocus()),Ua(this.node.current,"blur",()=>this.onBlur()))}unmount(){}};function uk(e,t,r){let{props:a}=e;e.animationState&&a.whileTap&&e.animationState.setActive("whileTap",r==="Start");let o="onTap"+(r==="End"?"":r),n=a[o];n&&ae.postRender(()=>n(t,Va(t)))}var fp=class extends pt{mount(){let{current:t}=this.node;t&&(this.unmount=ly(t,r=>(uk(this.node,r,"Start"),(a,{success:o})=>uk(this.node,a,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}};var zy=new WeakMap,Hy=new WeakMap,uN=e=>{let t=zy.get(e.target);t&&t(e)},cN=e=>{e.forEach(uN)};function dN({root:e,...t}){let r=e||document;Hy.has(r)||Hy.set(r,{});let a=Hy.get(r),o=JSON.stringify(t);return a[o]||(a[o]=new IntersectionObserver(cN,{root:e,...t})),a[o]}function ck(e,t,r){let a=dN(t);return zy.set(e,r),a.observe(e),()=>{zy.delete(e),a.unobserve(e)}}var fN={some:0,all:1},pp=class extends pt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:t={}}=this.node.getProps(),{root:r,margin:a,amount:o="some",once:n}=t,s={root:r?r.current:void 0,rootMargin:a,threshold:typeof o=="number"?o:fN[o]},i=l=>{let{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,n&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);let{onViewportEnter:c,onViewportLeave:d}=this.node.getProps(),f=u?c:d;f&&f(l)};return ck(this.node.current,s,i)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;let{props:t,prevProps:r}=this.node;["amount","margin","root"].some(pN(t,r))&&this.startObserver()}unmount(){}};function pN({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}var dk={inView:{Feature:pp},tap:{Feature:fp},focus:{Feature:dp},hover:{Feature:cp}};var fk={layout:{ProjectionNode:up,MeasureLayout:np}};var yk=B(Q(),1);var Du={current:null},hp={current:!1};function pk(){if(hp.current=!0,!!Ks)if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Du.current=e.matches;e.addListener(t),t()}else Du.current=!1}var hN=[...yy,Ze,Bt],hk=e=>hN.find(Ff(e));var Wy=new WeakMap;function mk(e,t,r){for(let a in t){let o=t[a],n=r[a];if(Ie(o))e.addValue(a,o);else if(Ie(n))e.addValue(a,Fa(o,{owner:e}));else if(n!==o)if(e.hasValue(a)){let s=e.getValue(a);s.liveStyle===!0?s.jump(o):s.hasAnimated||s.set(o)}else{let s=e.getStaticValue(a);e.addValue(a,Fa(s!==void 0?s:o,{owner:e}))}}for(let a in r)t[a]===void 0&&e.removeValue(a);return t}var gk=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],mp=class{scrapeMotionValuesFromProps(t,r,a){return{}}constructor({parent:t,props:r,presenceContext:a,reducedMotionConfig:o,blockInitialAnimation:n,visualState:s},i={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Mo,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=()=>{let h=Tt.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,ae.render(this.render,!1,!0))};let{latestValues:l,renderState:u,onUpdate:c}=s;this.onUpdate=c,this.latestValues=l,this.baseTarget={...l},this.initialValues=r.initial?{...l}:{},this.renderState=u,this.parent=t,this.props=r,this.presenceContext=a,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=i,this.blockInitialAnimation=!!n,this.isControllingVariants=An(r),this.isVariantNode=af(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);let{willChange:d,...f}=this.scrapeMotionValuesFromProps(r,{},this);for(let h in f){let x=f[h];l[h]!==void 0&&Ie(x)&&x.set(l[h],!1)}}mount(t){this.current=t,Wy.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,a)=>this.bindToMotionValue(a,r)),hp.current||pk(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Du.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Wy.delete(this.current),this.projection&&this.projection.unmount(),lr(this.notifyUpdate),lr(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(let t in this.events)this.events[t].clear();for(let t in this.features){let r=this.features[t];r&&(r.unmount(),r.isMounted=!1)}this.current=null}bindToMotionValue(t,r){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();let a=Kt.has(t),o=r.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&ae.preRender(this.notifyUpdate),a&&this.projection&&(this.projection.isTransformDirty=!0)}),n=r.on("renderRequest",this.scheduleRender),s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,r)),this.valueSubscriptions.set(t,()=>{o(),n(),s&&s(),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 Na){let r=Na[t];if(!r)continue;let{isEnabled:a,Feature:o}=r;if(!this.features[t]&&o&&a(this.props)&&(this.features[t]=new o(this)),this.features[t]){let n=this.features[t];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ee()}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 a=0;a<gk.length;a++){let o=gk[a];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);let n="on"+o,s=t[n];s&&(this.propEventSubscriptions[o]=this.on(o,s))}this.prevMotionValues=mk(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){let r=this.getClosestVariantNode();if(r)return r.variantChildren&&r.variantChildren.add(t),()=>r.variantChildren.delete(t)}addValue(t,r){let a=this.values.get(t);r!==a&&(a&&this.removeValue(t),this.bindToMotionValue(t,r),this.values.set(t,r),this.latestValues[t]=r.get())}removeValue(t){this.values.delete(t);let 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 a=this.values.get(t);return a===void 0&&r!==void 0&&(a=Fa(r===null?void 0:r,{owner:this}),this.addValue(t,a)),a}readValue(t,r){var a;let o=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(a=this.getBaseTargetFromProps(this.props,t))!==null&&a!==void 0?a:this.readValueFromInstance(this.current,t,this.options);return o!=null&&(typeof o=="string"&&(Bf(o)||Nf(o))?o=parseFloat(o):!hk(o)&&Bt.test(r)&&(o=Of(t,r)),this.setBaseTarget(t,Ie(o)?o.get():o)),Ie(o)?o.get():o}setBaseTarget(t,r){this.baseTarget[t]=r}getBaseTarget(t){var r;let{initial:a}=this.props,o;if(typeof a=="string"||typeof a=="object"){let s=ei(this.props,a,(r=this.presenceContext)===null||r===void 0?void 0:r.custom);s&&(o=s[t])}if(a&&o!==void 0)return o;let n=this.getBaseTargetFromProps(this.props,t);return n!==void 0&&!Ie(n)?n:this.initialValues[t]!==void 0&&o===void 0?void 0:this.baseTarget[t]}on(t,r){return this.events[t]||(this.events[t]=new Ro),this.events[t].add(r)}notify(t,...r){this.events[t]&&this.events[t].notify(...r)}};var Ai=class extends mp{constructor(){super(...arguments),this.KeyframeResolver=Si}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:a}){delete r[t],delete a[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:t}=this.props;Ie(t)&&(this.childSubscription=t.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}};function mN(e){return window.getComputedStyle(e)}var gp=class extends Ai{constructor(){super(...arguments),this.type="html",this.renderInstance=pf}readValueFromInstance(t,r){if(Kt.has(r)){let a=wi(r);return a&&a.default||0}else{let a=mN(t),o=(cf(r)?a.getPropertyValue(r):a[r])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:r}){return Dy(t,r)}build(t,r,a){oi(t,r,a.transformTemplate)}scrapeMotionValuesFromProps(t,r,a){return ui(t,r,a)}};var yp=class extends Ai{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ee}getBaseTargetFromProps(t,r){return t[r]}readValueFromInstance(t,r){if(Kt.has(r)){let a=wi(r);return a&&a.default||0}return r=hf.has(r)?r:Js(r),t.getAttribute(r)}scrapeMotionValuesFromProps(t,r,a){return yf(t,r,a)}build(t,r,a){ni(t,r,this.isSVGTag,a.transformTemplate)}renderInstance(t,r,a,o){mf(t,r,a,o)}mount(t){this.isSVGTag=ii(t.tagName),super.mount(t)}};var vk=(e,t)=>Zs(e)?new yp(t):new gp(t,{allowProjection:e!==yk.Fragment});var xk=Gb({...KL,...dk,...ik,...fk},vk);var Nu=pb(xk);var vp=class{constructor(){this.componentControls=new Set}subscribe(t){return this.componentControls.add(t),()=>this.componentControls.delete(t)}start(t,r){this.componentControls.forEach(a=>{a.start(t.nativeEvent||t,r)})}},gN=()=>new vp;function Gy(){return Co(gN)}var ze=B(ce(),1);function wk({phase:e,progressSteps:t=[]}){return(0,ze.jsxs)("div",{className:"mb-3 rounded-lg bg-muted/40 px-3 py-3 text-xs text-muted-foreground transition-colors",children:[e==="thinking"&&t.length===0&&(0,ze.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ze.jsx)(Pt,{className:"h-3.5 w-3.5 animate-spin"}),(0,ze.jsx)("span",{children:"Thinking\u2026"})]}),e==="searching"&&(0,ze.jsxs)("div",{className:"space-y-2 animate-in fade-in-0 duration-300",children:[(0,ze.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ze.jsx)(Pn,{className:"h-3.5 w-3.5 opacity-70"}),(0,ze.jsx)("span",{children:"Searching across pages\u2026"})]}),(0,ze.jsxs)("ul",{className:"ml-6 list-disc space-y-1",children:[(0,ze.jsx)("li",{className:"opacity-90",children:"Checking recent changes"}),(0,ze.jsx)("li",{className:"opacity-90",children:"Scanning documentation"}),(0,ze.jsx)("li",{className:"opacity-90",children:"Summarizing relevant sections"})]})]}),(e==="thinking"||e==="executing"||e==="responding")&&t.length>0&&(0,ze.jsxs)("div",{className:"space-y-2 animate-in fade-in-0 duration-200",children:[t.map((r,a)=>(0,ze.jsxs)("div",{className:`flex items-center gap-2 transition-opacity duration-200 ${r.completed?"opacity-60":"opacity-100"}`,children:[r.completed?(0,ze.jsx)(ft,{className:"h-3.5 w-3.5 text-green-500 flex-shrink-0"}):(0,ze.jsx)(Pt,{className:"h-3.5 w-3.5 animate-spin flex-shrink-0"}),(0,ze.jsx)("span",{className:r.completed?"line-through":"",children:r.message})]},a)),e==="responding"&&(0,ze.jsxs)("div",{className:"flex items-center gap-2 opacity-100 animate-in fade-in-0 duration-200",children:[(0,ze.jsx)(Pt,{className:"h-3.5 w-3.5 animate-spin flex-shrink-0"}),(0,ze.jsx)("span",{children:"Preparing response..."})]})]})]})}var Sk=B(Q(),1);var Vr=B(ce(),1);function Ck({title:e,links:t}){let[r,a]=Sk.useState(!1);return(0,Vr.jsxs)("div",{className:"text-xs text-muted-foreground",children:[(0,Vr.jsx)("button",{type:"button",onClick:()=>a(o=>!o),className:"flex w-full items-center gap-2 px-0 py-0","aria-expanded":r,children:(0,Vr.jsxs)("div",{className:"flex items-center gap-1.5",children:[r?(0,Vr.jsx)(su,{className:"h-3 w-3 opacity-70"}):(0,Vr.jsx)(Pn,{className:"h-3 w-3 opacity-70"}),(0,Vr.jsx)("span",{children:e})]})}),r&&t.length>0&&(0,Vr.jsx)("ul",{className:"ml-5 mt-1 space-y-0.5",children:t.map(o=>(0,Vr.jsx)("li",{children:(0,Vr.jsx)("a",{href:o.href,target:"_blank",rel:"noreferrer",className:"text-primary hover:underline",children:o.label})},o.href))})]})}var Mu=B(ce(),1);function bk({x:e,y:t,visible:r,onClick:a=!1}){return(0,Mu.jsx)(Jg,{children:r&&(0,Mu.jsx)(Nu.div,{className:"fixed pointer-events-none z-[9999]",initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1,x:e,y:t},exit:{opacity:0,scale:.5},transition:{type:"spring",stiffness:200,damping:20},style:{left:0,top:0},children:(0,Mu.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Mu.jsx)("path",{d:"M3 3L10.07 19.97L12.58 12.58L19.97 10.07L3 3Z",fill:"#C4B5FD"})})})})}var Ri=B(Q(),1);function Lk(){let[e,t]=Ri.useState({x:0,y:0,visible:!1,onClick:!1}),r=Ri.useCallback(n=>{let s=document.querySelector(n.selector);if(s){let i=s.getBoundingClientRect(),l=n.offset?.x||0,u=n.offset?.y||0;t({x:i.left+i.width/2+l,y:i.top+i.height/2+u,visible:!0,onClick:n.onClick||!1})}},[]),a=Ri.useCallback(()=>{t(n=>({...n,visible:!1}))},[]),o=Ri.useCallback(()=>{t(n=>({...n,visible:!0}))},[]);return{cursorState:e,moveTo:r,hide:a,show:o}}var oa=B(Q(),1);function Ik({productBackendUrl:e,sessionId:t,enabled:r=!0}){let[a,o]=oa.useState({status:"idle"}),n=oa.useRef(null),s=oa.useRef(r),i=oa.useCallback(async()=>{if(!e||!r){o({status:"idle"});return}o({status:"loading"});try{let u=await fetch(`${e}/users/me`,{method:"GET",credentials:"include",headers:{Accept:"application/json"}});if(!u.ok)throw u.status===401?new Error("Please log in to use the chat assistant."):u.status===403?new Error("You do not have permission to access this feature."):new Error(`Authentication failed (${u.status})`);let c=await u.json();o({status:"authenticated",user:c})}catch(u){if(u instanceof Error){let d=u.message.toLowerCase(),f=u instanceof TypeError||d.includes("failed to fetch")||d.includes("network"),h=d.includes("404");if(f||h){console.warn("[useUserAuth] Auth endpoint unavailable, falling back to unauthenticated mode:",u.message),o({status:"idle"});return}}let c=u instanceof Error?u.message:"Unable to verify your identity. Please try again.";o({status:"error",error:c})}},[e,r]);oa.useEffect(()=>{let u=t!==n.current,c=r!==s.current,d=r&&!s.current;u&&(n.current=t),c&&(s.current=r),(u||d)&&i()},[t,r,i]);let l=oa.useCallback(()=>{i()},[i]);return{authState:a,retry:l}}var xp=B(Q(),1);function kk({agentUrl:e,orgId:t}){let[r,a]=xp.useState({status:"idle",config:null,error:null});return xp.useEffect(()=>{if(!e||!t)return;(async()=>{a({status:"loading",config:null,error:null});let n=`${e}/org/${t}/config`;try{let s=await fetch(n,{method:"GET",headers:{Accept:"application/json"}});if(!s.ok)throw new Error(`Failed to fetch org config (${s.status})`);let i=await s.json();a({status:"success",config:i,error:null})}catch(s){let i=s instanceof Error?s.message:"Failed to fetch org config";console.error("[useOrgConfig] Error:",i),a({status:"error",config:null,error:i})}})()},[e,t]),r}var Ky=B(Q(),1);function Pk({productBackendUrl:e,agentUrl:t,sessionId:r}){let a=(0,Ky.useCallback)(async n=>{try{await fetch(`${t}/chat/tool-result`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}catch(s){console.error("[FrontendToolExecutor] Failed to send tool result:",s)}},[t]);return{executeToolRequest:(0,Ky.useCallback)(async n=>{let{call_id:s,arguments:i,endpoint:l,method:u,path_params:c}=n;try{let d=l;for(let m of c)i[m]&&(d=d.replace(`{${m}}`,encodeURIComponent(i[m])));let f=new URLSearchParams;for(let[m,g]of Object.entries(i))!c.includes(m)&&g!==void 0&&g!==null&&f.append(m,String(g));let h=f.toString(),x=`${e}${d}${h?"?"+h:""}`,w=await fetch(x,{method:u,credentials:"include",headers:{Accept:"application/json","Content-Type":"application/json"}}),C;if(w.ok)C=await w.json();else{let m=await w.text();throw new Error(`HTTP ${w.status}: ${m}`)}await a({session_id:r,call_id:s,result:C})}catch(d){console.error("[FrontendToolExecutor] Tool execution failed:",d),await a({session_id:r,call_id:s,error:d instanceof Error?d.message:"Unknown error"})}},[e,r,a])}}var Ei=B(ce(),1);function _t({className:e,...t}){return(0,Ei.jsx)("div",{"data-slot":"card",className:nr("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function na({className:e,...t}){return(0,Ei.jsx)("div",{"data-slot":"card-header",className:nr("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function sa({className:e,...t}){return(0,Ei.jsx)("div",{"data-slot":"card-title",className:nr("leading-none font-semibold",e),...t})}function Xy({className:e,...t}){return(0,Ei.jsx)("div",{"data-slot":"card-description",className:nr("text-muted-foreground text-sm",e),...t})}function At({className:e,...t}){return(0,Ei.jsx)("div",{"data-slot":"card-content",className:nr("px-6",e),...t})}var S=B(ce(),1),Jy=e=>new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),wp=(e,t="USD")=>new Intl.NumberFormat("en-US",{style:"currency",currency:t}).format(e),Qy=e=>{switch(e){case"Enterprise":return bn;case"Professional":return fu;default:return au}},Sp=e=>{switch(e){case"Enterprise":return"bg-purple-50 text-purple-700 border-purple-200";case"Professional":return"bg-blue-50 text-blue-700 border-blue-200";default:return"bg-gray-50 text-gray-700 border-gray-200"}};function Ou({status:e,type:t="default"}){let a=(()=>{let n=e.toLowerCase();if(t==="transaction")switch(n){case"paid":return{color:"bg-emerald-50 text-emerald-700 border-emerald-200",icon:ft};case"failed":return{color:"bg-red-50 text-red-700 border-red-200",icon:Br};case"pending":return{color:"bg-amber-50 text-amber-700 border-amber-200",icon:Sn};case"refunded":return{color:"bg-slate-50 text-slate-700 border-slate-200",icon:$s};default:return{color:"bg-gray-50 text-gray-700 border-gray-200",icon:Or}}if(t==="subscription")switch(n){case"active":return{color:"bg-emerald-50 text-emerald-700 border-emerald-200",icon:ft};case"cancelled":return{color:"bg-slate-50 text-slate-700 border-slate-200",icon:Br};case"past_due":return{color:"bg-red-50 text-red-700 border-red-200",icon:Or};case"trialing":return{color:"bg-blue-50 text-blue-700 border-blue-200",icon:Sn};default:return{color:"bg-gray-50 text-gray-700 border-gray-200",icon:Or}}switch(n){case"active":return{color:"bg-emerald-50 text-emerald-700 border-emerald-200",icon:ft};case"inactive":return{color:"bg-slate-50 text-slate-700 border-slate-200",icon:Br};default:return{color:"bg-gray-50 text-gray-700 border-gray-200",icon:Or}}})(),o=a.icon;return(0,S.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium border ${a.color}`,children:[(0,S.jsx)(o,{className:"h-3 w-3"}),e]})}function yN({subscription:e}){let t=Qy(e.plan);return(0,S.jsxs)(_t,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)("div",{className:`h-1 ${e.status==="active"?"bg-emerald-500":e.status==="past_due"?"bg-red-500":"bg-slate-300"}`}),(0,S.jsx)(na,{className:"pb-3",children:(0,S.jsxs)("div",{className:"flex items-start justify-between",children:[(0,S.jsxs)("div",{className:"space-y-1",children:[(0,S.jsxs)(sa,{className:"text-base font-semibold text-gray-900 flex items-center gap-2",children:[(0,S.jsx)(Cn,{className:"h-4 w-4 text-gray-500"}),e.id]}),e.customer_email&&(0,S.jsxs)(Xy,{className:"text-sm text-gray-500 flex items-center gap-1.5",children:[(0,S.jsx)(js,{className:"h-3 w-3"}),e.customer_email]})]}),(0,S.jsx)(Ou,{status:e.status,type:"subscription"})]})}),(0,S.jsx)(At,{className:"pt-0",children:(0,S.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,S.jsxs)("div",{className:"space-y-3",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Plan"}),(0,S.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium border ${Sp(e.plan)}`,children:[(0,S.jsx)(t,{className:"h-3 w-3"}),e.plan]})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Billing"}),(0,S.jsxs)("div",{className:"text-sm font-medium text-gray-900",children:[wp(e.amount,e.currency)," / ",e.billing_cycle]})]})]}),(0,S.jsxs)("div",{className:"space-y-3",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Current Period"}),(0,S.jsxs)("div",{className:"text-sm text-gray-700",children:[Jy(e.current_period_start)," - ",Jy(e.current_period_end)]})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Created"}),(0,S.jsx)("div",{className:"text-sm text-gray-700",children:Jy(e.created_at)})]})]})]})})]})}function vN({subscriptions:e,maxItems:t=5}){let r=e.slice(0,t),a=e.length>t;return e.length===0?(0,S.jsx)(_t,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(At,{className:"py-8 text-center",children:[(0,S.jsx)(Cn,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,S.jsx)("p",{className:"text-sm text-gray-500",children:"No subscriptions found"})]})}):(0,S.jsxs)(_t,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(na,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(sa,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(Cn,{className:"h-4 w-4"}),e.length," Subscription",e.length!==1?"s":""]})}),(0,S.jsxs)(At,{className:"p-0",children:[(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:r.map(o=>{let n=Qy(o.plan);return(0,S.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,S.jsx)("div",{className:`p-2 rounded-lg ${Sp(o.plan).replace("text-","text-").replace("border-","bg-").split(" ")[0]}`,children:(0,S.jsx)(n,{className:"h-4 w-4"})}),(0,S.jsxs)("div",{className:"min-w-0",children:[(0,S.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:o.customer_email||o.customer_id}),(0,S.jsxs)("div",{className:"text-xs text-gray-500",children:[o.plan," \xB7 ",wp(o.amount,o.currency),"/",o.billing_cycle]})]})]}),(0,S.jsx)(Ou,{status:o.status,type:"subscription"})]})},o.id)})}),a&&(0,S.jsx)("div",{className:"px-4 py-2 bg-gray-50 border-t border-gray-100 text-center",children:(0,S.jsxs)("span",{className:"text-xs text-gray-500",children:["+",e.length-t," more subscription",e.length-t!==1?"s":""]})})]})]})}function xN({customer:e}){let t=Qy(e.subscription);return(0,S.jsxs)(_t,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)("div",{className:`h-1 ${e.status==="active"?"bg-emerald-500":"bg-slate-300"}`}),(0,S.jsx)(na,{className:"pb-3",children:(0,S.jsxs)("div",{className:"flex items-start justify-between",children:[(0,S.jsx)("div",{className:"flex items-center gap-3",children:(0,S.jsxs)("div",{children:[(0,S.jsx)(sa,{className:"text-base font-semibold text-gray-900",children:e.name}),(0,S.jsxs)(Xy,{className:"text-sm text-gray-500 flex items-center gap-1",children:[(0,S.jsx)(js,{className:"h-3 w-3"}),e.email]})]})}),(0,S.jsx)(Ou,{status:e.status,type:"customer"})]})}),(0,S.jsx)(At,{className:"pt-0",children:(0,S.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,S.jsxs)("div",{className:"space-y-3",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Plan"}),(0,S.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium border ${Sp(e.subscription)}`,children:[(0,S.jsx)(t,{className:"h-3 w-3"}),e.subscription]})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Revenue"}),(0,S.jsxs)("div",{className:"text-sm font-medium text-gray-900 flex items-center gap-1",children:[(0,S.jsx)(Ln,{className:"h-3 w-3 text-emerald-500"}),e.revenue]})]})]}),(0,S.jsxs)("div",{className:"space-y-3",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Location"}),(0,S.jsxs)("div",{className:"text-sm text-gray-700 flex items-center gap-1",children:[(0,S.jsx)(qs,{className:"h-3 w-3 text-gray-400"}),e.location||"Not specified"]})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Customer Since"}),(0,S.jsxs)("div",{className:"text-sm text-gray-700 flex items-center gap-1",children:[(0,S.jsx)(nu,{className:"h-3 w-3 text-gray-400"}),e.joinDate]})]})]})]})})]})}function wN({customers:e,maxItems:t=5}){let r=e.slice(0,t),a=e.length>t;return e.length===0?(0,S.jsx)(_t,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(At,{className:"py-8 text-center",children:[(0,S.jsx)(zs,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,S.jsx)("p",{className:"text-sm text-gray-500",children:"No customers found"})]})}):(0,S.jsxs)(_t,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(na,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(sa,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(zs,{className:"h-4 w-4"}),e.length," Customer",e.length!==1?"s":""]})}),(0,S.jsxs)(At,{className:"p-0",children:[(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:r.map(o=>(0,S.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsx)("div",{className:"flex items-center gap-3 min-w-0",children:(0,S.jsxs)("div",{className:"min-w-0",children:[(0,S.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:o.name}),(0,S.jsx)("div",{className:"text-xs text-gray-500 truncate",children:o.email})]})}),(0,S.jsxs)("div",{className:"flex items-center gap-2",children:[(0,S.jsx)("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${Sp(o.subscription)}`,children:o.subscription}),(0,S.jsx)(Ou,{status:o.status,type:"customer"})]})]})},o.id))}),a&&(0,S.jsx)("div",{className:"px-4 py-2 bg-gray-50 border-t border-gray-100 text-center",children:(0,S.jsxs)("span",{className:"text-xs text-gray-500",children:["+",e.length-t," more customer",e.length-t!==1?"s":""]})})]})]})}function Tk({transactions:e,maxItems:t=5}){let r=e.slice(0,t),a=e.length>t;return e.length===0?(0,S.jsx)(_t,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(At,{className:"py-8 text-center",children:[(0,S.jsx)(Ln,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,S.jsx)("p",{className:"text-sm text-gray-500",children:"No transactions found"})]})}):(0,S.jsxs)(_t,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(na,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(sa,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(Ln,{className:"h-4 w-4"}),e.length," Transaction",e.length!==1?"s":""]})}),(0,S.jsxs)(At,{className:"p-0",children:[(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:r.map(o=>(0,S.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,S.jsx)("div",{className:`p-2 rounded-lg ${o.status==="paid"?"bg-emerald-50":o.status==="failed"?"bg-red-50":o.status==="refunded"?"bg-slate-50":"bg-amber-50"}`,children:o.status==="paid"?(0,S.jsx)(ft,{className:"h-4 w-4 text-emerald-600"}):o.status==="failed"?(0,S.jsx)(Br,{className:"h-4 w-4 text-red-600"}):o.status==="refunded"?(0,S.jsx)($s,{className:"h-4 w-4 text-slate-600"}):(0,S.jsx)(Sn,{className:"h-4 w-4 text-amber-600"})}),(0,S.jsxs)("div",{className:"min-w-0",children:[(0,S.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:o.customer}),(0,S.jsxs)("div",{className:"text-xs text-gray-500",children:[o.date,o.decline_reason&&(0,S.jsxs)("span",{className:"text-red-500 ml-2",children:["\xB7 ",o.decline_reason]})]})]})]}),(0,S.jsxs)("div",{className:"flex items-center gap-3",children:[(0,S.jsxs)("span",{className:`text-sm font-semibold ${o.status==="paid"?"text-emerald-600":o.status==="failed"?"text-red-600":o.status==="refunded"?"text-slate-600":"text-amber-600"}`,children:[o.status==="refunded"?"-":"",o.amount]}),(0,S.jsx)(Ou,{status:o.status,type:"transaction"})]})]})},o.id))}),a&&(0,S.jsx)("div",{className:"px-4 py-2 bg-gray-50 border-t border-gray-100 text-center",children:(0,S.jsxs)("span",{className:"text-xs text-gray-500",children:["+",e.length-t," more transaction",e.length-t!==1?"s":""]})})]})]})}function SN({apiKeys:e}){return e.length===0?(0,S.jsx)(_t,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(At,{className:"py-8 text-center",children:[(0,S.jsx)(Vs,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,S.jsx)("p",{className:"text-sm text-gray-500",children:"No API keys found"})]})}):(0,S.jsxs)(_t,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(na,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(sa,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(Vs,{className:"h-4 w-4"}),e.length," API Key",e.length!==1?"s":""]})}),(0,S.jsx)(At,{className:"p-0",children:(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:e.map((t,r)=>(0,S.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsxs)("div",{className:"min-w-0",children:[(0,S.jsx)("div",{className:"text-sm font-medium text-gray-900",children:t.name}),(0,S.jsxs)("div",{className:"text-xs text-gray-500 font-mono",children:[t.key.slice(0,12),"...",t.key.slice(-4)]})]}),(0,S.jsxs)("div",{className:"text-xs text-gray-500",children:["Last used: ",t.lastUsed]})]})},r))})})]})}function CN({sessions:e}){let t=r=>{let a=r.toLowerCase();return a.includes("mobile")||a.includes("iphone")||a.includes("android")?cu:lu};return e.length===0?(0,S.jsx)(_t,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(At,{className:"py-8 text-center",children:[(0,S.jsx)(Hs,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,S.jsx)("p",{className:"text-sm text-gray-500",children:"No active sessions"})]})}):(0,S.jsxs)(_t,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(na,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(sa,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(Hs,{className:"h-4 w-4"}),e.length," Active Session",e.length!==1?"s":""]})}),(0,S.jsx)(At,{className:"p-0",children:(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:e.map((r,a)=>{let o=t(r.device);return(0,S.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsxs)("div",{className:"flex items-center gap-3",children:[(0,S.jsx)("div",{className:"p-2 rounded-lg bg-gray-100",children:(0,S.jsx)(o,{className:"h-4 w-4 text-gray-600"})}),(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-sm font-medium text-gray-900",children:r.device}),(0,S.jsxs)("div",{className:"text-xs text-gray-500 flex items-center gap-1",children:[(0,S.jsx)(qs,{className:"h-3 w-3"}),r.location]})]})]}),(0,S.jsx)("div",{className:"text-xs text-gray-500",children:r.time})]})},a)})})})]})}function bN({stats:e}){return(0,S.jsxs)(_t,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(na,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(sa,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(du,{className:"h-4 w-4"}),"Dashboard Overview"]})}),(0,S.jsx)(At,{className:"p-4",children:(0,S.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[e.revenue&&(0,S.jsxs)("div",{className:"p-3 rounded-lg bg-emerald-50 border border-emerald-100",children:[(0,S.jsx)("div",{className:"text-xs text-emerald-600 font-medium mb-1",children:"Revenue"}),(0,S.jsx)("div",{className:"text-lg font-bold text-emerald-700",children:wp(e.revenue.total)}),e.revenue.change!==0&&(0,S.jsxs)("div",{className:`text-xs ${e.revenue.change>0?"text-emerald-600":"text-red-600"}`,children:[e.revenue.change>0?"+":"",e.revenue.change,"% from last period"]})]}),e.subscriptions&&(0,S.jsxs)("div",{className:"p-3 rounded-lg bg-blue-50 border border-blue-100",children:[(0,S.jsx)("div",{className:"text-xs text-blue-600 font-medium mb-1",children:"Subscriptions"}),(0,S.jsxs)("div",{className:"text-lg font-bold text-blue-700",children:[e.subscriptions.active," active"]}),(0,S.jsxs)("div",{className:"text-xs text-blue-600",children:[e.subscriptions.total," total"]})]}),e.customers&&(0,S.jsxs)("div",{className:"p-3 rounded-lg bg-purple-50 border border-purple-100",children:[(0,S.jsx)("div",{className:"text-xs text-purple-600 font-medium mb-1",children:"Customers"}),(0,S.jsx)("div",{className:"text-lg font-bold text-purple-700",children:e.customers.total}),e.customers.new>0&&(0,S.jsxs)("div",{className:"text-xs text-purple-600",children:["+",e.customers.new," new this period"]})]}),e.transactions&&(0,S.jsxs)("div",{className:"p-3 rounded-lg bg-amber-50 border border-amber-100",children:[(0,S.jsx)("div",{className:"text-xs text-amber-600 font-medium mb-1",children:"Transactions"}),(0,S.jsxs)("div",{className:"text-lg font-bold text-amber-700",children:[e.transactions.successful," successful"]}),e.transactions.failed>0&&(0,S.jsxs)("div",{className:"text-xs text-red-600",children:[e.transactions.failed," failed"]})]})]})})]})}function LN({customers:e}){return e.length===0?(0,S.jsx)(_t,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(At,{className:"py-8 text-center",children:[(0,S.jsx)(bn,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,S.jsx)("p",{className:"text-sm text-gray-500",children:"No top customers data"})]})}):(0,S.jsxs)(_t,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(na,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(sa,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(bn,{className:"h-4 w-4 text-amber-500"}),"Top Customers"]})}),(0,S.jsx)(At,{className:"p-0",children:(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:e.map((t,r)=>(0,S.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,S.jsx)("div",{className:`h-6 w-6 rounded-full flex items-center justify-center text-xs font-bold ${r===0?"bg-amber-100 text-amber-700":r===1?"bg-slate-100 text-slate-700":r===2?"bg-orange-100 text-orange-700":"bg-gray-100 text-gray-700"}`,children:r+1}),(0,S.jsxs)("div",{className:"min-w-0",children:[(0,S.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:t.name}),(0,S.jsx)("div",{className:"text-xs text-gray-500 truncate",children:t.email})]})]}),(0,S.jsx)("div",{className:"text-sm font-semibold text-emerald-600",children:typeof t.revenue=="number"?wp(t.revenue):t.revenue})]})},r))})})]})}function _k({type:e,data:t}){if(!t)return null;switch(e){case"subscription":return(0,S.jsx)(yN,{subscription:t});case"subscriptions":let r=t.subscriptions||t||[];return(0,S.jsx)(vN,{subscriptions:Array.isArray(r)?r:[r]});case"customer":return(0,S.jsx)(xN,{customer:t.customer||t});case"customers":let a=t.customers||t||[];return(0,S.jsx)(wN,{customers:Array.isArray(a)?a:[a]});case"transactions":let o=t.transactions||t||[];return(0,S.jsx)(Tk,{transactions:Array.isArray(o)?o:[o]});case"transaction":return(0,S.jsx)(Tk,{transactions:[t],maxItems:1});case"dashboard_stats":return(0,S.jsx)(bN,{stats:t});case"top_customers":let n=t.customers||t||[];return(0,S.jsx)(LN,{customers:Array.isArray(n)?n:[n]});case"api_keys":let s=t.api_keys||t||[];return(0,S.jsx)(SN,{apiKeys:Array.isArray(s)?s:[s]});case"sessions":let i=t.sessions||t||[];return(0,S.jsx)(CN,{sessions:Array.isArray(i)?i:[i]});default:return null}}var Di=B(ce(),1);function Ak({className:e=""}){return(0,Di.jsxs)("div",{className:`flex items-center gap-1.5 ${e}`,children:[(0,Di.jsx)("span",{className:"w-2 h-2 bg-gray-500 rounded-full animate-bounce",style:{animationDelay:"0ms",animationDuration:"600ms"}}),(0,Di.jsx)("span",{className:"w-2 h-2 bg-gray-500 rounded-full animate-bounce",style:{animationDelay:"150ms",animationDuration:"600ms"}}),(0,Di.jsx)("span",{className:"w-2 h-2 bg-gray-500 rounded-full animate-bounce",style:{animationDelay:"300ms",animationDuration:"600ms"}})]})}var p=B(ce(),1);var IN="http://localhost:5002",Cp=400,bp=600;function kN(e){return e.replace(/\\\\n/g,`
24
59
  `).replace(/\\\\t/g," ").replace(/\\\\"/g,'"').replace(/\\\\\\\\/g,"\\").replace(/\\n/g,`
25
- `).replace(/\\t/g," ").replace(/\\"/g,'"').replace(/\\\\/g,"\\")}function iM(e){if(!e)return null;let t=e.split(`
26
- `),a=[],r=null,o=!1,n=[],s="",i=u=>{let d=[],c=u,f=0;for(;c.length>0;){let m=c.match(/^`([^`]+)`/);if(m){d.push((0,p.jsx)("code",{className:"bg-gray-100 px-1 py-0.5 rounded text-xs font-mono",children:m[1]},f++)),c=c.slice(m[0].length);continue}let v=c.match(/^\*\*([^*]+)\*\*/);if(v){d.push((0,p.jsx)("strong",{children:v[1]},f++)),c=c.slice(v[0].length);continue}let w=c.match(/^\*([^*]+)\*/);if(w){d.push((0,p.jsx)("em",{children:w[1]},f++)),c=c.slice(w[0].length);continue}let S=c.match(/^\[([^\]]+)\]\(([^)]+)\)/);if(S){d.push((0,p.jsx)("a",{href:S[2],className:"kite-link",target:"_blank",rel:"noopener noreferrer",children:S[1]},f++)),c=c.slice(S[0].length);continue}let h=c.match(/^(https?:\/\/[^\s<>]+|www\.[^\s<>]+)/);if(h){let L=h[1],I=L.startsWith("www.")?`https://${L}`:L;d.push((0,p.jsx)("a",{href:I,className:"kite-link",target:"_blank",rel:"noopener noreferrer",children:L},f++)),c=c.slice(L.length);continue}let g=c.match(/^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})/);if(g){let L=g[1];d.push((0,p.jsx)("a",{href:`mailto:${L}`,className:"kite-link",children:L},f++)),c=c.slice(L.length);continue}let x=c.search(/[`*\[@h]/);if(x===-1){d.push(c);break}else x===0?(d.push(c[0]),c=c.slice(1)):(d.push(c.slice(0,x)),c=c.slice(x))}return d.length===1?d[0]:(0,p.jsx)(p.Fragment,{children:d})},l=()=>{if(r){let u=r.type==="ul"?"ul":"ol";a.push((0,p.jsx)(u,{className:`${r.type==="ul"?"list-disc":"list-decimal"} ml-4 my-1`,children:r.items.map((d,c)=>(0,p.jsx)("li",{className:"ml-2",children:d},c))},a.length)),r=null}};for(let u=0;u<t.length;u++){let d=t[u];if(d.startsWith("```")){o?(a.push((0,p.jsx)("pre",{className:"bg-gray-100 rounded p-2 my-1 overflow-x-auto",children:(0,p.jsx)("code",{className:"text-xs font-mono",children:n.join(`
27
- `)})},a.length)),o=!1,n=[],s=""):(l(),o=!0,s=d.slice(3).trim());continue}if(o){n.push(d);continue}let c=d.match(/^(#{1,6})\s+(.+)/);if(c){l();let v=c[1].length,w=i(c[2]),S=v===1?"text-lg font-bold my-1":v===2?"text-base font-bold my-1":"text-sm font-semibold my-1";a.push((0,p.jsx)("div",{className:S,children:w},a.length));continue}let f=d.match(/^[-*]\s+(.+)/);if(f){(!r||r.type!=="ul")&&(l(),r={type:"ul",items:[]}),r.items.push(i(f[1]));continue}let m=d.match(/^\d+[.)]\s+(.+)/);if(m){(!r||r.type!=="ol")&&(l(),r={type:"ol",items:[]}),r.items.push(i(m[1]));continue}if(d.trim()===""){l(),a.push((0,p.jsx)("div",{className:"h-2"},a.length));continue}if(d.match(/^[-*_]{3,}$/)){l(),a.push((0,p.jsx)("hr",{className:"my-2 border-gray-200"},a.length));continue}l(),a.push((0,p.jsx)("div",{children:i(d)},a.length))}return l(),(0,p.jsx)(p.Fragment,{children:a})}var lM=[{id:"changing-layouts",label:"Changing layouts",prompt:"How do I change the layout of my profiles or folders?",icon:"layout"},{id:"bulk-uploads",label:"Bulk uploads",prompt:"How do I bulk upload profiles using a CSV file?",icon:"upload"},{id:"example-setups",label:"Example setups",prompt:"Can you show me some example folder setups?",icon:"setup"}],Hk=[{id:"customers",title:"Customer Management",topics:[{id:"add-customer",label:"Add a new customer",prompt:"How do I add a new customer to the system and what information is required?"},{id:"customer-details",label:"View customer details",prompt:"Show me how to view and edit customer information and their payment history."}]},{id:"payments",title:"Payment Processing",topics:[{id:"process-payment",label:"Process a payment",prompt:"How do I process a one-time payment for a customer?"},{id:"refund-payment",label:"Issue a refund",prompt:"Walk me through issuing a refund for a customer payment."}]},{id:"subscriptions",title:"Subscription Management",topics:[{id:"create-subscription",label:"Create a subscription",prompt:"How do I set up a new subscription plan for a customer?"},{id:"update-subscription",label:"Update subscription tier",prompt:"How can I change a customer's subscription plan or upgrade them?"}]},{id:"billing",title:"Billing",topics:[{id:"payment-methods",label:"Manage payment methods",prompt:"How do customers add or update their payment methods?"}]}],tx={"getting-started":{id:"getting-started",title:"Getting started",steps:[{text:"Step 1: Let's open the Customers page. This is where you'll manage all your customers - you can view, add, and edit customer information here.",navigation:{page:"customers"},cursorTarget:{selector:'[data-page="customers"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 2: Now let's open the Add customer dialog. This is where you'll enter information for your first customer, including their name, email, and other details.",navigation:{page:"customers"},cursorTarget:{selector:'[data-testid="add-customer-button"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 3: Let's open the Settings page. This is where you manage your account settings, company information, and preferences. We're going to verify your company address is correct.",navigation:{page:"settings",subtab:"general"},cursorTarget:{selector:'[data-page="settings"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 4: Here's the address field in the Company Information section. It's important to verify this address is accurate since it's used for billing and shipping purposes. Make sure it's up to date.",navigation:{page:"settings",subtab:"general"},cursorTarget:{selector:'[data-testid="company-address-input"]',offset:{x:0,y:0},onClick:!1}},{text:"Step 5: Let's open the API Keys tab. This section shows all your API keys - you'll need these to connect your application to our services. We're going to create a production API key.",navigation:{page:"settings",subtab:"api"},cursorTarget:{selector:'[data-settings-tab="api"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 6: Let's open the Create API Key dialog. Here you can create a new API key for your application. You'll want to give it a descriptive name like 'Production Key' so you can easily identify it later.",navigation:{page:"settings",subtab:"api"},cursorTarget:{selector:'[data-testid="create-api-key-button"]',offset:{x:0,y:0},onClick:!0}}]},"add-api-key":{id:"add-api-key",title:"How to add an API key",steps:[{text:"Step 1: Let's open the Settings page. This is where you manage your account settings and preferences. We need to go here to access the API Keys section.",navigation:{page:"settings",subtab:"general"},cursorTarget:{selector:'[data-page="settings"]',offset:{x:0,y:0},onClick:!1}},{text:"Step 2: Let's open the API Keys tab. This section shows all your API keys and allows you to create new ones. You'll need API keys to connect your application to our services.",navigation:{page:"settings",subtab:"api"},cursorTarget:{selector:'[data-settings-tab="api"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 3: Let's open the Create API Key dialog. This is where you'll create your new API key - you can give it a name to help you identify it later, then click Create to generate it.",navigation:{page:"settings",subtab:"api"},cursorTarget:{selector:'[data-testid="create-api-key-button"]',offset:{x:0,y:0},onClick:!0}}]},"refund-payment":{id:"refund-payment",title:"How to refund a payment",steps:[{text:"Step 1: Let's open the Home page. This is your dashboard where you can view today's activity, your payment overview, and recent transactions. We need to go here to find the payment you want to refund.",navigation:{page:"dashboard"},cursorTarget:{selector:'[data-page="dashboard"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 2: Scroll down to see the Recent transactions section at the bottom. This shows your latest payment transactions with their status. We're looking for a transaction with 'paid' status - only paid transactions can be refunded.",navigation:{page:"dashboard"},cursorTarget:{selector:'[data-testid="recent-activity-card"]',offset:{x:0,y:0},onClick:!1}},{text:"Step 3: Let's open the dropdown menu for this paid transaction. Each transaction has a menu button (three dots) that gives you options like refunding. Click it to see the available actions, including the 'Refund payment' option.",navigation:{page:"dashboard"},cursorTarget:{selector:'[data-testid="transaction-menu-button"]',offset:{x:0,y:0},onClick:!0}}]}},uM=[];function dM(){return(0,p.jsxs)("div",{className:"flex flex-col items-center justify-center h-full p-6",children:[(0,p.jsx)(Ct,{className:"h-8 w-8 animate-spin text-gray-400 mb-3"}),(0,p.jsx)("p",{className:"text-xs text-gray-500",children:"Verifying your identity..."})]})}function cM({error:e,onRetry:t}){return(0,p.jsxs)("div",{className:"flex flex-col items-center justify-center h-full p-6 text-center",children:[(0,p.jsx)("div",{className:"w-12 h-12 rounded-full bg-red-100 flex items-center justify-center mb-4",children:(0,p.jsx)(_a,{className:"h-6 w-6 text-red-600"})}),(0,p.jsx)("h3",{className:"text-sm font-semibold text-gray-900 mb-2",children:"Unable to Start Chat"}),(0,p.jsx)("p",{className:"text-xs text-gray-500 mb-4 max-w-[240px]",children:e}),(0,p.jsx)(ot,{variant:"secondary",size:"sm",onClick:t,className:"h-8 px-4 text-xs",children:"Try Again"})]})}function fM({imageUrl:e,onClose:t}){return(0,zk.createPortal)((0,p.jsxs)("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.8)",zIndex:99999},onClick:t,children:[(0,p.jsx)("button",{onClick:r=>{r.stopPropagation(),t()},style:{position:"absolute",top:"16px",right:"16px",padding:"8px",borderRadius:"9999px",backgroundColor:"rgba(0, 0, 0, 0.5)",color:"white",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},"aria-label":"Close",children:(0,p.jsx)(_a,{style:{height:"24px",width:"24px"}})}),(0,p.jsxs)("div",{style:{position:"relative",maxWidth:"90vw",maxHeight:"90vh",display:"flex",flexDirection:"column",alignItems:"center"},onClick:r=>r.stopPropagation(),children:[(0,p.jsx)("img",{src:e,alt:"Full size preview",style:{maxWidth:"100%",maxHeight:"85vh",objectFit:"contain",borderRadius:"8px",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)"}}),(0,p.jsx)("div",{style:{display:"flex",gap:"12px",marginTop:"16px"},children:(0,p.jsxs)("button",{onClick:async()=>{try{let o=await(await fetch(e)).blob(),n=window.URL.createObjectURL(o),s=document.createElement("a");s.href=n;let i=e.split("/"),l=i[i.length-1]||"image.jpg";s.download=l,document.body.appendChild(s),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(n)}catch(r){console.error("Failed to download image:",r),window.open(e,"_blank")}},style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 16px",backgroundColor:"white",color:"#1f2937",borderRadius:"8px",border:"none",cursor:"pointer",fontSize:"14px",fontWeight:500,boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1)"},children:[(0,p.jsx)(du,{style:{height:"16px",width:"16px"}}),"Download"]})})]})]}),document.body)}function pM({isOpen:e=!0,onClose:t,onOpen:a,onBack:r,onNavigate:o,onActionComplete:n,currentPage:s,agentUrl:i=nM,startingQuestions:l,startingQuestionsEndpoint:u,userId:d,orgId:c,userName:f,userEmail:m,supabaseUrl:v,supabaseAnonKey:w,initialCorner:S="bottom-left",onCornerChange:h,productBackendUrl:g,getAuthHeaders:x,isEval:L=!1}={}){let[I,k]=O.useState(uM),[D,_]=O.useState(""),[V,j]=O.useState(S),[ge,ue]=O.useState(!1),Dr=Qy(),ar=O.useCallback((y,b)=>{Dr.set({x:0,y:0}),ue(!1);let E=window.innerWidth,R=b.point.x<E/2?"bottom-left":"bottom-right";R!==V&&(j(R),h?.(R))},[V,h,Dr]),[Q,Ro]=O.useState(()=>crypto.randomUUID()),[Re,ht]=O.useState(null),It=Bk({agentUrl:i,orgId:c||""}),Wt=It.config?.productBackendUrl||g,$e=It.config?.supabaseUrl||v,Ma=It.config?.supabaseAnonKey||w,{authState:Fe,retry:Gk}=Fk({productBackendUrl:Wt,sessionId:Q,enabled:!!Wt&&It.status==="success"}),{executeToolRequest:Kk}=Uk({productBackendUrl:Wt||"",agentUrl:i,sessionId:Q}),xM=O.useMemo(()=>Re||(Fe.status==="authenticated"?{userId:Fe.user.id,userName:Fe.user.name,userEmail:Fe.user.email,userRole:Fe.user.role,isInternal:Fe.user.isInternal}:{userId:d||"anonymous",userName:f||"Anonymous User",userEmail:m||"Not provided",userRole:void 0,isInternal:!1}),[Re,Fe,d,f,m]);O.useEffect(()=>{Fe.status==="authenticated"&&Re===null&&ht({userId:Fe.user.id,userName:Fe.user.name,userEmail:Fe.user.email,userRole:Fe.user.role,isInternal:Fe.user.isInternal})},[Fe,Re]);let ju=O.useMemo(()=>Wt?Fe.status==="loading"||Fe.status==="idle":!1,[Wt,Fe.status]),[Le,rx]=O.useState(!1),ia=O.useRef(null),[Ep,Dp]=O.useState(!1),Ee=O.useRef(null),_o=O.useRef(null),Ri=O.useRef(null),Mp=O.useCallback(()=>{Le&&Ee.current&&Q&&Ee.current.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",Q).then(()=>{},y=>{console.error("[KiteChat] Disconnect update failed:",y)}),Ee.current&&Q?(console.log("[KiteChat] resetSession - marking session as ended:",Q),Ee.current.from("sessions").update({session_status:"ended"}).eq("session_id",Q).then(()=>console.log("[KiteChat] resetSession - session marked as ended successfully:",Q),y=>console.error("[KiteChat] resetSession - failed to mark session as ended:",Q,y))):console.log("[KiteChat] resetSession - skipped marking session as ended:",{hasSupabase:!!Ee.current,sessionId:Q}),ht(null),Ro(crypto.randomUUID()),rx(!1),ia.current&&(ia.current.close(),ia.current=null),Dp(!1),_o.current&&(_o.current.unsubscribe(),_o.current=null)},[Le,Q]);O.useEffect(()=>{$e&&Ma&&!Ee.current&&(Ee.current=hS($e,Ma))},[$e,Ma]),O.useEffect(()=>{if(!Le||!Q||!Ee.current){console.log("[KiteChat] Typing channel skip - isEscalated:",Le,"sessionId:",Q,"supabase:",!!Ee.current);return}let y=`typing:${Q}`;console.log("[KiteChat] Subscribing to typing channel:",y,"sessionId:",Q);let b=Ee.current.channel(y,{config:{broadcast:{self:!0}}});return b.on("broadcast",{event:"typing"},E=>{console.log("[KiteChat] Received typing event:",E);let{sender:A,isTyping:R}=E.payload;console.log("[KiteChat] Typing event - sender:",A,"isTyping:",R),A==="agent"&&(console.log("[KiteChat] Setting agentIsTyping to:",R),Dp(R),R&&(Ri.current&&window.clearTimeout(Ri.current),Ri.current=window.setTimeout(()=>{Dp(!1)},5e3)))}).subscribe(E=>{console.log("[KiteChat] Typing channel subscription status:",E),E==="SUBSCRIBED"?(_o.current=b,console.log("[KiteChat] Typing channel subscribed successfully")):E==="CHANNEL_ERROR"&&console.error("[KiteChat] Typing channel subscription failed")}),()=>{b.unsubscribe(),_o.current=null,Ri.current&&window.clearTimeout(Ri.current)}},[Le,Q,$e,Ma]),O.useEffect(()=>{!e&&Le&&Ee.current&&Q&&(console.log("[KiteChat] Panel closed during live chat, marking disconnected"),Ee.current.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",Q).then(()=>console.log("[KiteChat] Successfully marked disconnected on panel close"),y=>{console.error("[KiteChat] Failed to mark disconnected on panel close:",y)}))},[e,Le,Q]),O.useEffect(()=>{if(!Q||!$e||!Ma){console.log("[KiteChat] Session end handler skipped - missing:",{sessionId:!!Q,supabaseUrl:!!$e,supabaseKey:!!Ma});return}let y=Q,b=$e,E=Ma;console.log("[KiteChat] Registering session end handler for session:",y);let A=()=>{console.log("[KiteChat] Marking session as ended:",y);let R=`${b}/rest/v1/sessions?session_id=eq.${y}`;fetch(R,{method:"PATCH",headers:{"Content-Type":"application/json",apikey:E,Authorization:`Bearer ${E}`,Prefer:"return=minimal"},body:JSON.stringify({session_status:"ended"}),keepalive:!0}).catch(()=>{})};return window.addEventListener("beforeunload",A),()=>{console.log("[KiteChat] Component unmounting - marking session as ended:",y),window.removeEventListener("beforeunload",A),A()}},[Q,$e,Ma]);let qu=O.useRef(null),vM=O.useCallback(async y=>{if(!(!Ee.current||!Q))try{await Ee.current.from("escalations").update({customer_status:y,customer_last_seen:new Date().toISOString()}).eq("session_id",Q)}catch(b){console.error("[KiteChat] Failed to update customer status:",b)}},[Q]);O.useEffect(()=>{if(!Le||!Q||!Ee.current)return;let y=Q,b=Ee.current,E=$e,A=Ma,R=()=>{b.from("escalations").update({customer_status:"active",customer_last_seen:new Date().toISOString()}).eq("session_id",y).then(()=>{},N=>console.error("[KiteChat] Failed to update customer status:",N))},G=()=>{if(console.log("[KiteChat] markDisconnectedWithKeepalive called for escalated session:",y),!E||!A){console.log("[KiteChat] markDisconnectedWithKeepalive skipped - missing credentials");return}let N=`${E}/rest/v1/escalations?session_id=eq.${y}`;fetch(N,{method:"PATCH",headers:{"Content-Type":"application/json",apikey:A,Authorization:`Bearer ${A}`,Prefer:"return=minimal"},body:JSON.stringify({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}),keepalive:!0}).catch(()=>{}),console.log("[KiteChat] markDisconnectedWithKeepalive - also marking session as ended:",y);let P=`${E}/rest/v1/sessions?session_id=eq.${y}`;fetch(P,{method:"PATCH",headers:{"Content-Type":"application/json",apikey:A,Authorization:`Bearer ${A}`,Prefer:"return=minimal"},body:JSON.stringify({session_status:"ended"}),keepalive:!0}).catch(()=>{})};console.log("[KiteChat] Starting presence heartbeat for live chat"),R(),qu.current=window.setInterval(()=>{R()},6e4);let W=()=>{G()},T=()=>{document.visibilityState==="visible"&&R()};return window.addEventListener("beforeunload",W),document.addEventListener("visibilitychange",T),()=>{window.removeEventListener("beforeunload",W),document.removeEventListener("visibilitychange",T),console.log("[KiteChat] Escalation ended, marking disconnected"),b.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",y).then(()=>console.log("[KiteChat] Successfully marked disconnected on escalation end"),N=>{console.error("[KiteChat] Failed to mark disconnected:",N)}),qu.current&&(window.clearInterval(qu.current),qu.current=null)}},[Le,Q,$e,Ma]);let _i=O.useCallback(y=>{if(!_o.current||!Le){y&&console.warn("[KiteChat] Typing channel not ready, cannot send typing indicator");return}_o.current.send({type:"broadcast",event:"typing",payload:{sender:"user",isTyping:y}})},[Le]),rr=O.useRef(null),Xk=O.useCallback(()=>{!Le||!Ee.current||!Q||(_i(!0),Ee.current.from("escalations").update({customer_status:"active",customer_last_seen:new Date().toISOString()}).eq("session_id",Q).then(()=>{},y=>console.error("[KiteChat] Failed to update presence:",y)),rr.current&&window.clearTimeout(rr.current),rr.current=window.setTimeout(()=>{_i(!1)},1500))},[Le,_i,Q]),Mn=O.useRef({}),ox=I.length===0,[Nn,xe]=O.useState("idle"),[Qk,be]=O.useState([]),Mr=O.useRef([]),Jk=I.length?I[I.length-1].role:void 0,[Np,On]=O.useState("landing"),[nx,Eo]=O.useState(void 0),[Yk,sx]=O.useState(l||lM),[Zk,ix]=O.useState(!1);O.useEffect(()=>{u&&!l&&(ix(!0),fetch(u).then(y=>y.json()).then(y=>{Array.isArray(y)&&y.length>0&&sx(y)}).catch(y=>{console.warn("[KiteChat] Failed to fetch starting questions:",y)}).finally(()=>ix(!1)))},[u,l]),O.useEffect(()=>{l&&sx(l)},[l]);let[me,Nr]=O.useState(void 0),Be=O.useRef(void 0),lx=O.useRef(null),[Ei,Di]=O.useState(!1);O.useEffect(()=>{let y=()=>{if(!localStorage.getItem("gmailNotificationSeen")){On("landing"),Eo(void 0);let E=Date.now(),A="I see you're exploring integrations. Let me know if there are any other connections we should add.",R={id:E,role:"assistant",kind:"text",content:"",isNotificationMessage:!0};k(G=>[...G,R]),nr(E,A),localStorage.setItem("gmailNotificationSeen","true")}};return window.addEventListener("integrationTabClicked",y),()=>{window.removeEventListener("integrationTabClicked",y)}},[]),O.useEffect(()=>{me?(!Be.current||Be.current.id!==me.id||Be.current.stepIndex!==me.stepIndex)&&(Be.current=me):Be.current=void 0},[me]);let[Mi,Hu]=O.useState(null),[et,Op]=O.useState(null),[ne,se]=O.useState({}),Fp=O.useRef(null),Bp=O.useRef(null),zu=O.useRef(null),{cursorState:$u,moveTo:Do,hide:Fn}=Ok(),[or,Ni]=O.useState(null),[ux,Or]=O.useState(null),Up=O.useRef(null),Oi=O.useRef(null),[la,Vp]=O.useState([]),[dx,cx]=O.useState(!1),[jp,qp]=O.useState(!1),fx=O.useRef(null),[px,Hp]=O.useState(null),eP=O.useCallback(async y=>{if(!Ee.current)return console.error("[KiteChat] Supabase client not available for file upload"),null;let b=y.name.split(".").pop(),E=`${Q}/${Date.now()}-${Math.random().toString(36).substring(7)}.${b}`,A="chat-attachments";try{let{data:R,error:G}=await Ee.current.storage.from(A).upload(E,y,{cacheControl:"3600",upsert:!1});if(G)return console.error("[KiteChat] Upload error:",G),null;let{data:W}=Ee.current.storage.from(A).getPublicUrl(E);return W?.publicUrl||null}catch(R){return console.error("[KiteChat] Upload failed:",R),null}},[Q]),zp=O.useCallback(y=>{if(!y)return;let E=Array.from(y).filter(A=>A.type.startsWith("image/")||A.type==="application/pdf").map(A=>({file:A,preview:A.type.startsWith("image/")?URL.createObjectURL(A):""}));console.log("[KiteChat] Adding images to pending:",E.length,"files"),Vp(A=>{let R=[...A,...E];return console.log("[KiteChat] pendingImages now:",R.length),R})},[]);O.useEffect(()=>{let y=D.trim().length>0,b=!!or,E=la.length>0,A=!y&&!b&&!E||ju;console.log("[KiteChat] Send button state:",{hasText:y,hasFile:b,hasImages:E,pendingImagesCount:la.length,isWaitingForAuth:ju,authStatus:Fe.status,disabled:A})},[D,or,la,ju,Fe.status]);let tP=O.useCallback(y=>{y.preventDefault(),y.stopPropagation(),qp(!0)},[]),aP=O.useCallback(y=>{y.preventDefault(),y.stopPropagation(),qp(!1)},[]),rP=O.useCallback(y=>{y.preventDefault(),y.stopPropagation(),qp(!1);let b=y.dataTransfer.files;if(b.length>0){let E=Array.from(b).find(A=>A.name.endsWith(".csv"));E&&!Le?Ni(E):zp(b)}},[Le,zp]);O.useEffect(()=>()=>{la.forEach(y=>{y.preview&&URL.revokeObjectURL(y.preview)})},[la]);let[mx,Fi]=O.useState(!1),[Bn,Wu]=O.useState(""),hx=O.useRef(null);O.useEffect(()=>{if(!me||me.id!=="add-api-key"||me.stepIndex!==2)return;let b=setInterval(()=>{let E=document.querySelector('[role="dialog"]'),A=Be.current;if(E&&A&&A.id==="add-api-key"&&A.stepIndex===2){Fn();let R=Date.now()+1;k(G=>[...G,{id:R,role:"assistant",kind:"guideComplete",content:"Perfect! The dialog is now open. You can enter a name and create your API key."}]),Nr(void 0),Di(!0)}},300);return()=>clearInterval(b)},[me,Fn]),O.useEffect(()=>()=>{Object.values(Mn.current).forEach(y=>window.clearInterval(y)),Mn.current={},Mr.current.forEach(y=>window.clearTimeout(y)),Mr.current=[]},[]),O.useEffect(()=>{if(me&&I.length>0){let y=I[I.length-1];if((y.kind==="guideStep"||y.kind==="guideComplete")&&zu.current&&Bp.current){let b=Bp.current,E=zu.current,A=b.getBoundingClientRect(),G=E.getBoundingClientRect().top-A.top+b.scrollTop;b.scrollTop=G}}else!me&&I.length>0&&Fp.current?.scrollIntoView({behavior:"smooth"})},[I,Nn,me]),O.useEffect(()=>{Le&&Ep&&!me&&Fp.current?.scrollIntoView({behavior:"smooth"})},[Le,Ep,me]);let gx=O.useMemo(()=>{for(let y=I.length-1;y>=0;y--){let b=I[y];if(b.kind==="bulkSummary"&&b.bulkSummary?.navigationPage&&b.bulkSummary.successes>0)return b.bulkSummary.navigationPage}return null},[I]);O.useEffect(()=>{lx.current=gx},[gx]),O.useEffect(()=>{Up.current=ux},[ux]),O.useEffect(()=>{let y=b=>{if((b.metaKey||b.ctrlKey)&&b.key==="Enter"){let E=Up.current;if(E){b.preventDefault(),b.stopPropagation(),Gp(E);return}if(et){b.preventDefault(),b.stopPropagation(),Wp();return}if(Mi){b.preventDefault(),b.stopPropagation(),$p(Mi);return}let A=lx.current;if(A&&o){b.preventDefault(),b.stopPropagation(),o(A.page,A.subtab);return}if(Ei){b.preventDefault(),b.stopPropagation(),vx();return}if(Be.current){b.preventDefault(),b.stopPropagation(),Kp();return}}};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[et,Mi,me,Ei,o]);let yx=O.useCallback(y=>{if(!i){console.log("[KiteChat] No agentUrl, skipping WebSocket connection");return}ia.current&&(console.log("[KiteChat] Closing existing WebSocket connection"),ia.current.close());let b=i.replace(/^http/,"ws")+`/ws/escalation/${y}`;console.log("[KiteChat] Connecting to escalation WebSocket:",b);let E=new WebSocket(b);E.onopen=()=>{console.log("[KiteChat] Escalation WebSocket connected successfully")},E.onmessage=A=>{try{let R=JSON.parse(A.data);R.type==="agent_message"?k(G=>{let W=R.content,T=R.message_id;return(T?G.some(P=>P.serverMessageId===T):G.slice(-5).some(P=>P.content===W))?G:[...G,{id:Date.now(),role:"agent",kind:"text",content:W,serverMessageId:T}]}):R.type==="error"&&console.error("[KiteChat] Escalation error:",R.message)}catch(R){console.error("[KiteChat] Failed to parse escalation message:",R)}},E.onerror=A=>{console.error("[KiteChat] Escalation WebSocket error:",A)},E.onclose=A=>{console.log("[KiteChat] Escalation WebSocket closed - code:",A.code,"reason:",A.reason)},ia.current=E},[i]),xx=O.useCallback(async y=>{if(!ia.current)return console.error("[KiteChat] Escalation WebSocket not connected - no ref"),!1;if(ia.current.readyState!==WebSocket.OPEN)return console.error("[KiteChat] Escalation WebSocket not connected - state:",ia.current.readyState,"(0=CONNECTING, 1=OPEN, 2=CLOSING, 3=CLOSED)"),!1;try{return ia.current.send(JSON.stringify({type:"user_message",content:y})),Ee.current&&Q&&Ee.current.from("escalations").update({customer_status:"active",customer_last_seen:new Date().toISOString()}).eq("session_id",Q).then(()=>{},b=>console.error("[KiteChat] Failed to update presence:",b)),!0}catch(b){return console.error("[KiteChat] Failed to send escalated message:",b),!1}},[Q]);O.useEffect(()=>()=>{ia.current&&ia.current.close()},[]),O.useEffect(()=>{console.log("[KiteChat] Escalation useEffect - isEscalated:",Le,"sessionId:",Q),Le&&Q&&(console.log("[KiteChat] Triggering WebSocket connection for escalation"),yx(Q))},[Le,Q,yx]);function nr(y,b,E){let A=b||"",R=E;if(b&&b.startsWith("{")&&b.includes('"response"'))try{let N=0,P=0;for(let X=0;X<b.length;X++)if(b[X]==="{")N++;else if(b[X]==="}"&&(N--,N===0)){P=X+1;break}let J=P>0?b.slice(0,P):b,Z=JSON.parse(J);Z.response&&typeof Z.response=="string"&&(A=Z.response,!R&&Z.followups&&(R=Z.followups))}catch{}A=sM(A);let G=A.split(" "),W=0,T=window.setInterval(()=>{W+=1,k(N=>N.map(P=>P.id===y?{...P,content:G.slice(0,W).join(" ")}:P)),W>=G.length&&(window.clearInterval(T),delete Mn.current[y],R&&R.length>0&&k(N=>N.map(P=>P.id===y?{...P,followups:R}:P)),xe("idle"))},25);Mn.current[y]=T}function oP(y,b){k(E=>E.map(A=>A.id===y?{...A,followupSelected:!0}:A)),Bi(b.label)}function vx(){Object.values(Mn.current).forEach(y=>window.clearInterval(y)),Mn.current={},Mr.current.forEach(y=>window.clearTimeout(y)),Mr.current=[],Fn(),Mp(),k([]),_(""),xe("idle"),On("landing"),Eo(void 0),Nr(void 0),Di(!1),Hu(null),Op(null),se({}),r&&r()}function wM(y){On("folder"),Eo(y)}function nP(){On("landing"),Eo(void 0)}async function sP(y){y.preventDefault();let b=D.trim();if(or){if(!b){let E={id:Date.now(),role:"assistant",kind:"text",content:"Please describe what you'd like to do with this CSV file. For example: 'Create customers from this file' or 'Add these subscriptions'."};k(A=>[...A,E]);return}lP(b,or),_(""),Ni(null),Oi.current&&(Oi.current.value="");return}if(la.length>0){cx(!0);try{let E=[];for(let A of la){let R=await eP(A.file);R&&E.push(R),A.preview&&URL.revokeObjectURL(A.preview)}if(E.length>0){let A=E.map(W=>`![image](${W})`).join(`
28
- `),R=b?`${b}
60
+ `).replace(/\\t/g," ").replace(/\\"/g,'"').replace(/\\\\/g,"\\")}function PN(e){if(!e)return null;let t=e.split(`
61
+ `),r=[],a=null,o=!1,n=[],s="",i=u=>{let c=[],d=u,f=0;for(;d.length>0;){let h=d.match(/^`([^`]+)`/);if(h){c.push((0,p.jsx)("code",{className:"bg-gray-100 px-1 py-0.5 rounded text-xs font-mono",children:h[1]},f++)),d=d.slice(h[0].length);continue}let x=d.match(/^\*\*([^*]+)\*\*/);if(x){c.push((0,p.jsx)("strong",{children:x[1]},f++)),d=d.slice(x[0].length);continue}let w=d.match(/^\*([^*]+)\*/);if(w){c.push((0,p.jsx)("em",{children:w[1]},f++)),d=d.slice(w[0].length);continue}let C=d.match(/^\[([^\]]+)\]\(([^)]+)\)/);if(C){c.push((0,p.jsx)("a",{href:C[2],className:"kite-link",target:"_blank",rel:"noopener noreferrer",children:C[1]},f++)),d=d.slice(C[0].length);continue}let m=d.match(/^(https?:\/\/[^\s<>]+|www\.[^\s<>]+)/);if(m){let b=m[1],k=b.startsWith("www.")?`https://${b}`:b;c.push((0,p.jsx)("a",{href:k,className:"kite-link",target:"_blank",rel:"noopener noreferrer",children:b},f++)),d=d.slice(b.length);continue}let g=d.match(/^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})/);if(g){let b=g[1];c.push((0,p.jsx)("a",{href:`mailto:${b}`,className:"kite-link",children:b},f++)),d=d.slice(b.length);continue}let y=d.search(/[`*\[@h]/);if(y===-1){c.push(d);break}else y===0?(c.push(d[0]),d=d.slice(1)):(c.push(d.slice(0,y)),d=d.slice(y))}return c.length===1?c[0]:(0,p.jsx)(p.Fragment,{children:c})},l=()=>{if(a){let u=a.type==="ul"?"ul":"ol";r.push((0,p.jsx)(u,{className:`${a.type==="ul"?"list-disc":"list-decimal"} ml-4 my-1`,children:a.items.map((c,d)=>(0,p.jsx)("li",{className:"ml-2",children:c},d))},r.length)),a=null}};for(let u=0;u<t.length;u++){let c=t[u];if(c.startsWith("```")){o?(r.push((0,p.jsx)("pre",{className:"bg-gray-100 rounded p-2 my-1 overflow-x-auto",children:(0,p.jsx)("code",{className:"text-xs font-mono",children:n.join(`
62
+ `)})},r.length)),o=!1,n=[],s=""):(l(),o=!0,s=c.slice(3).trim());continue}if(o){n.push(c);continue}let d=c.match(/^(#{1,6})\s+(.+)/);if(d){l();let x=d[1].length,w=i(d[2]),C=x===1?"text-lg font-bold my-1":x===2?"text-base font-bold my-1":"text-sm font-semibold my-1";r.push((0,p.jsx)("div",{className:C,children:w},r.length));continue}let f=c.match(/^[-*]\s+(.+)/);if(f){(!a||a.type!=="ul")&&(l(),a={type:"ul",items:[]}),a.items.push(i(f[1]));continue}let h=c.match(/^\d+[.)]\s+(.+)/);if(h){(!a||a.type!=="ol")&&(l(),a={type:"ol",items:[]}),a.items.push(i(h[1]));continue}if(c.trim()===""){l(),r.push((0,p.jsx)("div",{className:"h-2"},r.length));continue}if(c.match(/^[-*_]{3,}$/)){l(),r.push((0,p.jsx)("hr",{className:"my-2 border-gray-200"},r.length));continue}l(),r.push((0,p.jsx)("div",{children:i(c)},r.length))}return l(),(0,p.jsx)(p.Fragment,{children:r})}var TN=[{id:"changing-layouts",label:"Changing layouts",prompt:"How do I change the layout of my profiles or folders?",icon:"layout"},{id:"bulk-uploads",label:"Bulk uploads",prompt:"How do I bulk upload profiles using a CSV file?",icon:"upload"},{id:"example-setups",label:"Example setups",prompt:"Can you show me some example folder setups?",icon:"setup"}],Rk=[{id:"customers",title:"Customer Management",topics:[{id:"add-customer",label:"Add a new customer",prompt:"How do I add a new customer to the system and what information is required?"},{id:"customer-details",label:"View customer details",prompt:"Show me how to view and edit customer information and their payment history."}]},{id:"payments",title:"Payment Processing",topics:[{id:"process-payment",label:"Process a payment",prompt:"How do I process a one-time payment for a customer?"},{id:"refund-payment",label:"Issue a refund",prompt:"Walk me through issuing a refund for a customer payment."}]},{id:"subscriptions",title:"Subscription Management",topics:[{id:"create-subscription",label:"Create a subscription",prompt:"How do I set up a new subscription plan for a customer?"},{id:"update-subscription",label:"Update subscription tier",prompt:"How can I change a customer's subscription plan or upgrade them?"}]},{id:"billing",title:"Billing",topics:[{id:"payment-methods",label:"Manage payment methods",prompt:"How do customers add or update their payment methods?"}]}],Yy={"getting-started":{id:"getting-started",title:"Getting started",steps:[{text:"Step 1: Let's open the Customers page. This is where you'll manage all your customers - you can view, add, and edit customer information here.",navigation:{page:"customers"},cursorTarget:{selector:'[data-page="customers"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 2: Now let's open the Add customer dialog. This is where you'll enter information for your first customer, including their name, email, and other details.",navigation:{page:"customers"},cursorTarget:{selector:'[data-testid="add-customer-button"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 3: Let's open the Settings page. This is where you manage your account settings, company information, and preferences. We're going to verify your company address is correct.",navigation:{page:"settings",subtab:"general"},cursorTarget:{selector:'[data-page="settings"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 4: Here's the address field in the Company Information section. It's important to verify this address is accurate since it's used for billing and shipping purposes. Make sure it's up to date.",navigation:{page:"settings",subtab:"general"},cursorTarget:{selector:'[data-testid="company-address-input"]',offset:{x:0,y:0},onClick:!1}},{text:"Step 5: Let's open the API Keys tab. This section shows all your API keys - you'll need these to connect your application to our services. We're going to create a production API key.",navigation:{page:"settings",subtab:"api"},cursorTarget:{selector:'[data-settings-tab="api"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 6: Let's open the Create API Key dialog. Here you can create a new API key for your application. You'll want to give it a descriptive name like 'Production Key' so you can easily identify it later.",navigation:{page:"settings",subtab:"api"},cursorTarget:{selector:'[data-testid="create-api-key-button"]',offset:{x:0,y:0},onClick:!0}}]},"add-api-key":{id:"add-api-key",title:"How to add an API key",steps:[{text:"Step 1: Let's open the Settings page. This is where you manage your account settings and preferences. We need to go here to access the API Keys section.",navigation:{page:"settings",subtab:"general"},cursorTarget:{selector:'[data-page="settings"]',offset:{x:0,y:0},onClick:!1}},{text:"Step 2: Let's open the API Keys tab. This section shows all your API keys and allows you to create new ones. You'll need API keys to connect your application to our services.",navigation:{page:"settings",subtab:"api"},cursorTarget:{selector:'[data-settings-tab="api"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 3: Let's open the Create API Key dialog. This is where you'll create your new API key - you can give it a name to help you identify it later, then click Create to generate it.",navigation:{page:"settings",subtab:"api"},cursorTarget:{selector:'[data-testid="create-api-key-button"]',offset:{x:0,y:0},onClick:!0}}]},"refund-payment":{id:"refund-payment",title:"How to refund a payment",steps:[{text:"Step 1: Let's open the Home page. This is your dashboard where you can view today's activity, your payment overview, and recent transactions. We need to go here to find the payment you want to refund.",navigation:{page:"dashboard"},cursorTarget:{selector:'[data-page="dashboard"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 2: Scroll down to see the Recent transactions section at the bottom. This shows your latest payment transactions with their status. We're looking for a transaction with 'paid' status - only paid transactions can be refunded.",navigation:{page:"dashboard"},cursorTarget:{selector:'[data-testid="recent-activity-card"]',offset:{x:0,y:0},onClick:!1}},{text:"Step 3: Let's open the dropdown menu for this paid transaction. Each transaction has a menu button (three dots) that gives you options like refunding. Click it to see the available actions, including the 'Refund payment' option.",navigation:{page:"dashboard"},cursorTarget:{selector:'[data-testid="transaction-menu-button"]',offset:{x:0,y:0},onClick:!0}}]}},_N=[];function AN(){return(0,p.jsxs)("div",{className:"flex flex-col items-center justify-center h-full p-6",children:[(0,p.jsx)(Pt,{className:"h-8 w-8 animate-spin text-gray-400 mb-3"}),(0,p.jsx)("p",{className:"text-xs text-gray-500",children:"Verifying your identity..."})]})}function RN({error:e,onRetry:t}){return(0,p.jsxs)("div",{className:"flex flex-col items-center justify-center h-full p-6 text-center",children:[(0,p.jsx)("div",{className:"w-12 h-12 rounded-full bg-red-100 flex items-center justify-center mb-4",children:(0,p.jsx)(Fr,{className:"h-6 w-6 text-red-600"})}),(0,p.jsx)("h3",{className:"text-sm font-semibold text-gray-900 mb-2",children:"Unable to Start Chat"}),(0,p.jsx)("p",{className:"text-xs text-gray-500 mb-4 max-w-[240px]",children:e}),(0,p.jsx)(dt,{variant:"secondary",size:"sm",onClick:t,className:"h-8 px-4 text-xs",children:"Try Again"})]})}function EN({imageUrl:e,onClose:t}){return(0,Ek.createPortal)((0,p.jsxs)("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.8)",zIndex:99999},onClick:t,children:[(0,p.jsx)("button",{onClick:a=>{a.stopPropagation(),t()},style:{position:"absolute",top:"16px",right:"16px",padding:"8px",borderRadius:"9999px",backgroundColor:"rgba(0, 0, 0, 0.5)",color:"white",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},"aria-label":"Close",children:(0,p.jsx)(Fr,{style:{height:"24px",width:"24px"}})}),(0,p.jsxs)("div",{style:{position:"relative",maxWidth:"90vw",maxHeight:"90vh",display:"flex",flexDirection:"column",alignItems:"center"},onClick:a=>a.stopPropagation(),children:[(0,p.jsx)("img",{src:e,alt:"Full size preview",style:{maxWidth:"100%",maxHeight:"85vh",objectFit:"contain",borderRadius:"8px",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)"}}),(0,p.jsx)("div",{style:{display:"flex",gap:"12px",marginTop:"16px"},children:(0,p.jsxs)("button",{onClick:async()=>{try{let o=await(await fetch(e)).blob(),n=window.URL.createObjectURL(o),s=document.createElement("a");s.href=n;let i=e.split("/"),l=i[i.length-1]||"image.jpg";s.download=l,document.body.appendChild(s),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(n)}catch(a){console.error("Failed to download image:",a),window.open(e,"_blank")}},style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 16px",backgroundColor:"white",color:"#1f2937",borderRadius:"8px",border:"none",cursor:"pointer",fontSize:"14px",fontWeight:500,boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1)"},children:[(0,p.jsx)(iu,{style:{height:"16px",width:"16px"}}),"Download"]})})]})]}),document.body)}function DN({isOpen:e=!0,onClose:t,onOpen:r,onBack:a,onNavigate:o,onActionComplete:n,currentPage:s,agentUrl:i=IN,startingQuestions:l,startingQuestionsEndpoint:u,userId:c,orgId:d,userName:f,userEmail:h,supabaseUrl:x,supabaseAnonKey:w,initialCorner:C="bottom-left",onCornerChange:m,productBackendUrl:g,getAuthHeaders:y,isEval:b=!1}={}){let[k,I]=O.useState(_N),[A,R]=O.useState(""),[F,j]=O.useState(C),[ye,de]=O.useState(!1),Uo=Gy(),ia=O.useCallback((v,L)=>{de(!1);let E=window.innerWidth,D=L.point.x<E/2?"bottom-left":"bottom-right";D!==F&&(j(D),m?.(D))},[F,m]),[W,Vo]=O.useState(()=>crypto.randomUUID()),[De,St]=O.useState(null),Rt=kk({agentUrl:i,orgId:d||""}),Ft=Rt.config?.productBackendUrl||g,We=Rt.config?.supabaseUrl||x,Ir=Rt.config?.supabaseAnonKey||w,{authState:je,retry:Mk}=Ik({productBackendUrl:Ft,sessionId:W,enabled:!!Ft&&Rt.status==="success"}),{executeToolRequest:Ok}=Pk({productBackendUrl:Ft||"",agentUrl:i,sessionId:W}),FN=O.useMemo(()=>De||(je.status==="authenticated"?{userId:je.user.id,userName:je.user.name,userEmail:je.user.email,userRole:je.user.role,isInternal:je.user.isInternal}:{userId:c||"anonymous",userName:f||"Anonymous User",userEmail:h||"Not provided",userRole:void 0,isInternal:!1}),[De,je,c,f,h]);O.useEffect(()=>{je.status==="authenticated"&&De===null&&St({userId:je.user.id,userName:je.user.name,userEmail:je.user.email,userRole:je.user.role,isInternal:je.user.isInternal})},[je,De]);let Bu=O.useMemo(()=>Ft?je.status==="loading"||je.status==="idle":!1,[Ft,je.status]),[ve,Ip]=O.useState(!1),fr=O.useRef(null),[kp,Pp]=O.useState(!1),Se=O.useRef(null),jo=O.useRef(null),Mi=O.useRef(null),Tp=O.useCallback(()=>{ve&&Se.current&&W&&Se.current.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",W).then(()=>{},v=>{console.error("[KiteChat] Disconnect update failed:",v)}),Se.current&&W?(console.log("[KiteChat] resetSession - marking session as ended:",W),Se.current.from("sessions").update({session_status:"ended"}).eq("session_id",W).then(()=>console.log("[KiteChat] resetSession - session marked as ended successfully:",W),v=>console.error("[KiteChat] resetSession - failed to mark session as ended:",W,v))):console.log("[KiteChat] resetSession - skipped marking session as ended:",{hasSupabase:!!Se.current,sessionId:W}),St(null),Vo(crypto.randomUUID()),Ip(!1),fr.current&&(fr.current.close(),fr.current=null),Pp(!1),jo.current&&(jo.current.unsubscribe(),jo.current=null)},[ve,W]);O.useEffect(()=>{We&&Ir&&!Se.current&&(Se.current=rC(We,Ir))},[We,Ir]),O.useEffect(()=>{if(!ve||!W||!Se.current){console.log("[KiteChat] Typing channel skip - isEscalated:",ve,"sessionId:",W,"supabase:",!!Se.current);return}let v=`typing:${W}`;console.log("[KiteChat] Subscribing to typing channel:",v,"sessionId:",W);let L=Se.current.channel(v,{config:{broadcast:{self:!0}}});return L.on("broadcast",{event:"typing"},E=>{console.log("[KiteChat] Received typing event:",E);let{sender:_,isTyping:D}=E.payload;console.log("[KiteChat] Typing event - sender:",_,"isTyping:",D),_==="agent"&&(console.log("[KiteChat] Setting agentIsTyping to:",D),Pp(D),D&&(Mi.current&&window.clearTimeout(Mi.current),Mi.current=window.setTimeout(()=>{Pp(!1)},5e3)))}).subscribe(E=>{console.log("[KiteChat] Typing channel subscription status:",E),E==="SUBSCRIBED"?(jo.current=L,console.log("[KiteChat] Typing channel subscribed successfully")):E==="CHANNEL_ERROR"&&console.error("[KiteChat] Typing channel subscription failed")}),()=>{L.unsubscribe(),jo.current=null,Mi.current&&window.clearTimeout(Mi.current)}},[ve,W,We,Ir]),O.useEffect(()=>{if(!W||!Se.current||ve){console.log("[KiteChat] Session status subscription skip - sessionId:",W,"supabase:",!!Se.current,"isEscalated:",ve);return}let v=`session-status:${W}`;console.log("[KiteChat] Subscribing to session status changes:",v);let L=Se.current.channel(v).on("postgres_changes",{event:"UPDATE",schema:"public",table:"sessions",filter:`session_id=eq.${W}`},E=>{if(console.log("[KiteChat] Session status changed:",E),E.new.session_status==="escalated"){console.log("[KiteChat] Manual escalation detected - agent took over from control center"),Ip(!0),xe("idle");let D={id:Date.now()+2,role:"assistant",kind:"text",content:"A support agent has joined the conversation and will assist you shortly."};I(G=>[...G,D])}}).subscribe(E=>{E==="SUBSCRIBED"?console.log("[KiteChat] Successfully subscribed to session status changes"):E==="CHANNEL_ERROR"&&console.error("[KiteChat] Failed to subscribe to session status changes")});return()=>{console.log("[KiteChat] Unsubscribing from session status changes"),L.unsubscribe()}},[W,ve,We,Ir]),O.useEffect(()=>{!ve||!Se.current||!W||(e?(console.log("[KiteChat] Panel reopened during live chat, marking active"),Se.current.from("escalations").update({customer_status:"active",customer_last_seen:new Date().toISOString()}).eq("session_id",W).then(()=>console.log("[KiteChat] Successfully marked active on panel reopen"),v=>{console.error("[KiteChat] Failed to mark active on panel reopen:",v)})):(console.log("[KiteChat] Panel minimized during live chat, marking inactive"),Se.current.from("escalations").update({customer_status:"inactive",customer_last_seen:new Date().toISOString()}).eq("session_id",W).then(()=>console.log("[KiteChat] Successfully marked inactive on panel minimize"),v=>{console.error("[KiteChat] Failed to mark inactive on panel minimize:",v)})))},[e,ve,W]),O.useEffect(()=>{if(!W||!We||!Ir){console.log("[KiteChat] Session end handler skipped - missing:",{sessionId:!!W,supabaseUrl:!!We,supabaseKey:!!Ir});return}let v=W,L=We,E=Ir;console.log("[KiteChat] Registering session end handler for session:",v);let _=()=>{console.log("[KiteChat] Marking session as ended:",v);let D=`${L}/rest/v1/sessions?session_id=eq.${v}`;fetch(D,{method:"PATCH",headers:{"Content-Type":"application/json",apikey:E,Authorization:`Bearer ${E}`,Prefer:"return=minimal"},body:JSON.stringify({session_status:"ended"}),keepalive:!0}).catch(()=>{})};return window.addEventListener("beforeunload",_),()=>{console.log("[KiteChat] Component unmounting - marking session as ended:",v),window.removeEventListener("beforeunload",_),_()}},[W,We,Ir]);let Fu=O.useRef(null),UN=O.useCallback(async v=>{if(!(!Se.current||!W))try{await Se.current.from("escalations").update({customer_status:v,customer_last_seen:new Date().toISOString()}).eq("session_id",W)}catch(L){console.error("[KiteChat] Failed to update customer status:",L)}},[W]);O.useEffect(()=>{if(!ve||!W||!Se.current)return;let v=W,L=Se.current,E=We,_=Ir,D=()=>{L.from("escalations").update({customer_status:"active",customer_last_seen:new Date().toISOString()}).eq("session_id",v).then(()=>{},P=>console.error("[KiteChat] Failed to update customer status:",P))},G=()=>{L.from("escalations").update({customer_status:"inactive",customer_last_seen:new Date().toISOString()}).eq("session_id",v).then(()=>console.log("[KiteChat] Marked inactive on tab hidden"),P=>console.error("[KiteChat] Failed to mark inactive:",P))},K=()=>{if(console.log("[KiteChat] markDisconnectedWithKeepalive called for escalated session:",v),!E||!_){console.log("[KiteChat] markDisconnectedWithKeepalive skipped - missing credentials");return}let P=`${E}/rest/v1/escalations?session_id=eq.${v}`;fetch(P,{method:"PATCH",headers:{"Content-Type":"application/json",apikey:_,Authorization:`Bearer ${_}`,Prefer:"return=minimal"},body:JSON.stringify({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}),keepalive:!0}).catch(()=>{}),console.log("[KiteChat] markDisconnectedWithKeepalive - also marking session as ended:",v);let J=`${E}/rest/v1/sessions?session_id=eq.${v}`;fetch(J,{method:"PATCH",headers:{"Content-Type":"application/json",apikey:_,Authorization:`Bearer ${_}`,Prefer:"return=minimal"},body:JSON.stringify({session_status:"ended"}),keepalive:!0}).catch(()=>{})};console.log("[KiteChat] Starting presence heartbeat for live chat"),D(),Fu.current=window.setInterval(()=>{D()},6e4);let T=()=>{K()},M=()=>{document.visibilityState==="visible"?D():G()};return window.addEventListener("beforeunload",T),document.addEventListener("visibilitychange",M),()=>{window.removeEventListener("beforeunload",T),document.removeEventListener("visibilitychange",M),console.log("[KiteChat] Escalation ended, marking disconnected"),L.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",v).then(()=>console.log("[KiteChat] Successfully marked disconnected on escalation end"),P=>{console.error("[KiteChat] Failed to mark disconnected:",P)}),Fu.current&&(window.clearInterval(Fu.current),Fu.current=null)}},[ve,W,We,Ir]);let Oi=O.useCallback(v=>{if(!jo.current||!ve){v&&console.warn("[KiteChat] Typing channel not ready, cannot send typing indicator");return}jo.current.send({type:"broadcast",event:"typing",payload:{sender:"user",isTyping:v}})},[ve]),la=O.useRef(null),Bk=O.useCallback(()=>{!ve||!Se.current||!W||(Oi(!0),Se.current.from("escalations").update({customer_status:"active",customer_last_seen:new Date().toISOString()}).eq("session_id",W).then(()=>{},v=>console.error("[KiteChat] Failed to update presence:",v)),la.current&&window.clearTimeout(la.current),la.current=window.setTimeout(()=>{Oi(!1)},1500))},[ve,Oi,W]),jn=O.useRef({}),ev=k.length===0,[qn,xe]=O.useState("idle"),[Fk,ke]=O.useState([]),qa=O.useRef([]),Uk=k.length?k[k.length-1].role:void 0,[_p,$n]=O.useState("landing"),[tv,qo]=O.useState(void 0),[Vk,rv]=O.useState(l||TN),[jk,av]=O.useState(!1);O.useEffect(()=>{u&&!l&&(av(!0),fetch(u).then(v=>v.json()).then(v=>{Array.isArray(v)&&v.length>0&&rv(v)}).catch(v=>{console.warn("[KiteChat] Failed to fetch starting questions:",v)}).finally(()=>av(!1)))},[u,l]),O.useEffect(()=>{l&&rv(l)},[l]);let[me,$a]=O.useState(void 0),qe=O.useRef(void 0),ov=O.useRef(null),[Bi,Fi]=O.useState(!1);O.useEffect(()=>{let v=()=>{if(!localStorage.getItem("gmailNotificationSeen")){$n("landing"),qo(void 0);let E=Date.now(),_="I see you're exploring integrations. Let me know if there are any other connections we should add.",D={id:E,role:"assistant",kind:"text",content:"",isNotificationMessage:!0};I(G=>[...G,D]),ca(E,_),localStorage.setItem("gmailNotificationSeen","true")}};return window.addEventListener("integrationTabClicked",v),()=>{window.removeEventListener("integrationTabClicked",v)}},[]),O.useEffect(()=>{me?(!qe.current||qe.current.id!==me.id||qe.current.stepIndex!==me.stepIndex)&&(qe.current=me):qe.current=void 0},[me]);let[Ui,Uu]=O.useState(null),[nt,Ap]=O.useState(null),[ne,se]=O.useState({}),Rp=O.useRef(null),Ep=O.useRef(null),Vu=O.useRef(null),{cursorState:ju,moveTo:$o,hide:Hn}=Lk(),[ua,Vi]=O.useState(null),[nv,Ha]=O.useState(null),Dp=O.useRef(null),ji=O.useRef(null),[pr,Np]=O.useState([]),[sv,iv]=O.useState(!1),[Mp,Op]=O.useState(!1),lv=O.useRef(null),[uv,Bp]=O.useState(null),qk=O.useCallback(async v=>{if(!Se.current)return console.error("[KiteChat] Supabase client not available for file upload"),null;let L=v.name.split(".").pop(),E=`${W}/${Date.now()}-${Math.random().toString(36).substring(7)}.${L}`,_="chat-attachments";try{let{data:D,error:G}=await Se.current.storage.from(_).upload(E,v,{cacheControl:"3600",upsert:!1});if(G)return console.error("[KiteChat] Upload error:",G),null;let{data:K}=Se.current.storage.from(_).getPublicUrl(E);return K?.publicUrl||null}catch(D){return console.error("[KiteChat] Upload failed:",D),null}},[W]),Fp=O.useCallback(v=>{if(!v)return;let E=Array.from(v).filter(_=>_.type.startsWith("image/")||_.type==="application/pdf").map(_=>({file:_,preview:_.type.startsWith("image/")?URL.createObjectURL(_):""}));console.log("[KiteChat] Adding images to pending:",E.length,"files"),Np(_=>{let D=[..._,...E];return console.log("[KiteChat] pendingImages now:",D.length),D})},[]);O.useEffect(()=>{let v=A.trim().length>0,L=!!ua,E=pr.length>0,_=!v&&!L&&!E||Bu;console.log("[KiteChat] Send button state:",{hasText:v,hasFile:L,hasImages:E,pendingImagesCount:pr.length,isWaitingForAuth:Bu,authStatus:je.status,disabled:_})},[A,ua,pr,Bu,je.status]);let $k=O.useCallback(v=>{v.preventDefault(),v.stopPropagation(),Op(!0)},[]),Hk=O.useCallback(v=>{v.preventDefault(),v.stopPropagation(),Op(!1)},[]),zk=O.useCallback(v=>{v.preventDefault(),v.stopPropagation(),Op(!1);let L=v.dataTransfer.files;if(L.length>0){let E=Array.from(L).find(_=>_.name.endsWith(".csv"));E&&!ve?Vi(E):Fp(L)}},[ve,Fp]);O.useEffect(()=>()=>{pr.forEach(v=>{v.preview&&URL.revokeObjectURL(v.preview)})},[pr]);let[cv,qi]=O.useState(!1),[zn,qu]=O.useState(""),dv=O.useRef(null);O.useEffect(()=>{if(!me||me.id!=="add-api-key"||me.stepIndex!==2)return;let L=setInterval(()=>{let E=document.querySelector('[role="dialog"]'),_=qe.current;if(E&&_&&_.id==="add-api-key"&&_.stepIndex===2){Hn();let D=Date.now()+1;I(G=>[...G,{id:D,role:"assistant",kind:"guideComplete",content:"Perfect! The dialog is now open. You can enter a name and create your API key."}]),$a(void 0),Fi(!0)}},300);return()=>clearInterval(L)},[me,Hn]),O.useEffect(()=>()=>{Object.values(jn.current).forEach(v=>window.clearInterval(v)),jn.current={},qa.current.forEach(v=>window.clearTimeout(v)),qa.current=[]},[]),O.useEffect(()=>{if(me&&k.length>0){let v=k[k.length-1];if((v.kind==="guideStep"||v.kind==="guideComplete")&&Vu.current&&Ep.current){let L=Ep.current,E=Vu.current,_=L.getBoundingClientRect(),G=E.getBoundingClientRect().top-_.top+L.scrollTop;L.scrollTop=G}}else!me&&k.length>0&&Rp.current?.scrollIntoView({behavior:"smooth"})},[k,qn,me]),O.useEffect(()=>{ve&&kp&&!me&&Rp.current?.scrollIntoView({behavior:"smooth"})},[ve,kp,me]);let fv=O.useMemo(()=>{for(let v=k.length-1;v>=0;v--){let L=k[v];if(L.kind==="bulkSummary"&&L.bulkSummary?.navigationPage&&L.bulkSummary.successes>0)return L.bulkSummary.navigationPage}return null},[k]);O.useEffect(()=>{ov.current=fv},[fv]),O.useEffect(()=>{Dp.current=nv},[nv]),O.useEffect(()=>{let v=L=>{if((L.metaKey||L.ctrlKey)&&L.key==="Enter"){let E=Dp.current;if(E){L.preventDefault(),L.stopPropagation(),jp(E);return}if(nt){L.preventDefault(),L.stopPropagation(),Vp();return}if(Ui){L.preventDefault(),L.stopPropagation(),Up(Ui);return}let _=ov.current;if(_&&o){L.preventDefault(),L.stopPropagation(),o(_.page,_.subtab);return}if(Bi){L.preventDefault(),L.stopPropagation(),mv();return}if(qe.current){L.preventDefault(),L.stopPropagation(),qp();return}}};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[nt,Ui,me,Bi,o]);let pv=O.useCallback(v=>{if(!i){console.log("[KiteChat] No agentUrl, skipping WebSocket connection");return}fr.current&&(console.log("[KiteChat] Closing existing WebSocket connection"),fr.current.close());let L=i.replace(/^http/,"ws")+`/ws/escalation/${v}`;console.log("[KiteChat] Connecting to escalation WebSocket:",L);let E=new WebSocket(L);E.onopen=()=>{console.log("[KiteChat] Escalation WebSocket connected successfully")},E.onmessage=_=>{try{let D=JSON.parse(_.data);D.type==="agent_message"?I(G=>{let K=D.content,T=D.message_id;return(T?G.some(P=>P.serverMessageId===T):G.slice(-5).some(P=>P.content===K))?G:[...G,{id:Date.now(),role:"agent",kind:"text",content:K,serverMessageId:T}]}):D.type==="error"&&console.error("[KiteChat] Escalation error:",D.message)}catch(D){console.error("[KiteChat] Failed to parse escalation message:",D)}},E.onerror=_=>{console.error("[KiteChat] Escalation WebSocket error:",_)},E.onclose=_=>{console.log("[KiteChat] Escalation WebSocket closed - code:",_.code,"reason:",_.reason)},fr.current=E},[i]),hv=O.useCallback(async v=>{if(!fr.current)return console.error("[KiteChat] Escalation WebSocket not connected - no ref"),!1;if(fr.current.readyState!==WebSocket.OPEN)return console.error("[KiteChat] Escalation WebSocket not connected - state:",fr.current.readyState,"(0=CONNECTING, 1=OPEN, 2=CLOSING, 3=CLOSED)"),!1;try{return fr.current.send(JSON.stringify({type:"user_message",content:v})),Se.current&&W&&Se.current.from("escalations").update({customer_status:"active",customer_last_seen:new Date().toISOString()}).eq("session_id",W).then(()=>{},L=>console.error("[KiteChat] Failed to update presence:",L)),!0}catch(L){return console.error("[KiteChat] Failed to send escalated message:",L),!1}},[W]);O.useEffect(()=>()=>{fr.current&&fr.current.close()},[]),O.useEffect(()=>{console.log("[KiteChat] Escalation useEffect - isEscalated:",ve,"sessionId:",W),ve&&W&&(console.log("[KiteChat] Triggering WebSocket connection for escalation"),pv(W))},[ve,W,pv]);function ca(v,L,E){let _=L||"",D=E;if(L&&L.startsWith("{")&&L.includes('"response"'))try{let M=0,P=0;for(let Z=0;Z<L.length;Z++)if(L[Z]==="{")M++;else if(L[Z]==="}"&&(M--,M===0)){P=Z+1;break}let J=P>0?L.slice(0,P):L,re=JSON.parse(J);re.response&&typeof re.response=="string"&&(_=re.response,!D&&re.followups&&(D=re.followups))}catch{}_=kN(_);let G=_.split(" "),K=0,T=window.setInterval(()=>{K+=1,I(M=>M.map(P=>P.id===v?{...P,content:G.slice(0,K).join(" ")}:P)),K>=G.length&&(window.clearInterval(T),delete jn.current[v],D&&D.length>0&&I(M=>M.map(P=>P.id===v?{...P,followups:D}:P)),xe("idle"))},25);jn.current[v]=T}function Wk(v,L){I(E=>E.map(_=>_.id===v?{..._,followupSelected:!0}:_)),$i(L.label)}function mv(){Object.values(jn.current).forEach(v=>window.clearInterval(v)),jn.current={},qa.current.forEach(v=>window.clearTimeout(v)),qa.current=[],Hn(),Tp(),I([]),R(""),xe("idle"),$n("landing"),qo(void 0),$a(void 0),Fi(!1),Uu(null),Ap(null),se({}),a&&a()}function VN(v){$n("folder"),qo(v)}function Gk(){$n("landing"),qo(void 0)}async function Kk(v){v.preventDefault();let L=A.trim();if(ua){if(!L){let E={id:Date.now(),role:"assistant",kind:"text",content:"Please describe what you'd like to do with this CSV file. For example: 'Create customers from this file' or 'Add these subscriptions'."};I(_=>[..._,E]);return}Jk(L,ua),R(""),Vi(null),ji.current&&(ji.current.value="");return}if(pr.length>0){iv(!0);try{let E=[];for(let _ of pr){let D=await qk(_.file);D&&E.push(D),_.preview&&URL.revokeObjectURL(_.preview)}if(E.length>0){let _=E.map(K=>`![image](${K})`).join(`
63
+ `),D=L?`${L}
29
64
 
30
- ${A}`:A,G={id:Date.now(),role:"user",content:R,imageUrls:E};k(W=>[...W,G]),Le?(xx(R),_i(!1),rr.current&&(window.clearTimeout(rr.current),rr.current=null)):Bi(R)}}catch(E){console.error("[KiteChat] Failed to upload images:",E)}finally{cx(!1),Vp([]),_("")}return}if(b){if(Le){let E={id:Date.now(),role:"user",content:b};k(A=>[...A,E]),xx(b),_i(!1),rr.current&&(window.clearTimeout(rr.current),rr.current=null),_("");return}Bi(b),_("")}}function iP(y){let b={dashboard:"dashboard",customers:"customers page",payments:"payments page",settings:"settings page",support:"support page",disputes:"disputes page",radar:"radar page"};if(y.page==="settings"&&y.subtab){let E={general:"General",billing:"Billing",security:"Security",api:"API Keys",notifications:"Notifications",integrations:"Integrations"};return`${b.settings} (${E[y.subtab]} tab)`}return b[y.page]}function $p(y){o&&o(y.page,y.subtab),Hu(null),k(b=>b.map(E=>E.kind==="navigationAction"&&E.navigationTarget?.page===y.page&&E.navigationTarget?.subtab===y.subtab?{...E,navigationTarget:void 0}:E))}function Wp(){if(!et)return;let y=ne;if(et.type!=="updateCompanyInfo"){if(et.type==="addApiKey"){let b=y;if(!b.name||!b.name.trim())return}else if(et.type==="addCustomer"){let b=y;if(!b.name||!b.name.trim()||!b.email||!b.email.trim())return}else if(et.type==="changePassword"){let b=y;if(!b.currentPassword||!b.newPassword||!b.confirmPassword||b.newPassword!==b.confirmPassword)return}else if(et.type==="addWebhook"){let b=y;if(!b.url||!b.url.trim())return}else if(et.type==="addPaymentMethod"){let b=y;if(!b.cardNumber||!b.expiryDate)return}else if(et.type==="deleteApiKey"){let b=y;if(!b.keyId&&!b.name)return}else if(et.type==="refundPayment"){let b=y;if(!b.transactionId&&!b.customer)return}else if(et.type==="createSubscription"){let b=y;if(!b.customerEmail&&!b.customerId)return}else if((et.type==="toggleBlockRule"||et.type==="enableBlockRule"||et.type==="disableBlockRule")&&!y.ruleId)return}n&&n(et.type,y),k(b=>b.map(E=>E.kind==="actionForm"&&E.actionType===et.type?{...E,isSubmitted:!0}:E)),Op(null),se({})}async function Bi(y){Mr.current.forEach(W=>window.clearTimeout(W)),Mr.current=[];let E=[...I].reverse().find(W=>W.role==="assistant")?.isNotificationMessage===!0,A=Date.now(),R={id:A,role:"user",content:y};if(k(W=>W.map(T=>T.followups&&T.followups.length>0?{...T,followupSelected:!0}:T).concat(R)),E){let W=Date.now()+1,T={id:W,role:"assistant",kind:"text",content:""};k(N=>[...N,T]),nr(W,"Thank you, your feedback is saved.");return}Hu(null),xe("thinking"),be([]);let G=!1;try{let W=new AbortController,T=setTimeout(()=>W.abort(),6e4),N=await fetch(`${i}/chat/stream`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:Q,message:y,current_page:s||"dashboard",user_id:d,org_id:c,user_name:f,user_email:m,is_eval:L}),signal:W.signal});if(clearTimeout(T),!N.ok)throw new Error(`Agent request failed: ${N.status}`);let P=N.body?.getReader();if(!P)throw new Error("No response body");let J=new TextDecoder,Z="";for(;;){let{done:X,value:ce}=await P.read();if(X)break;Z+=J.decode(ce,{stream:!0});let je=Z.split(`
65
+ ${_}`:_,G={id:Date.now(),role:"user",content:D,imageUrls:E};I(K=>[...K,G]),ve?(hv(D),Oi(!1),la.current&&(window.clearTimeout(la.current),la.current=null)):$i(D)}}catch(E){console.error("[KiteChat] Failed to upload images:",E)}finally{iv(!1),Np([]),R("")}return}if(L){if(ve){let E={id:Date.now(),role:"user",content:L};I(_=>[..._,E]),hv(L),Oi(!1),la.current&&(window.clearTimeout(la.current),la.current=null),R("");return}$i(L),R("")}}function Xk(v){let L={dashboard:"dashboard",customers:"customers page",payments:"payments page",settings:"settings page",support:"support page",disputes:"disputes page",radar:"radar page"};if(v.page==="settings"&&v.subtab){let E={general:"General",billing:"Billing",security:"Security",api:"API Keys",notifications:"Notifications",integrations:"Integrations"};return`${L.settings} (${E[v.subtab]} tab)`}return L[v.page]}function Up(v){o&&o(v.page,v.subtab),Uu(null),I(L=>L.map(E=>E.kind==="navigationAction"&&E.navigationTarget?.page===v.page&&E.navigationTarget?.subtab===v.subtab?{...E,navigationTarget:void 0}:E))}function Vp(){if(!nt)return;let v=ne;if(nt.type!=="updateCompanyInfo"){if(nt.type==="addApiKey"){let L=v;if(!L.name||!L.name.trim())return}else if(nt.type==="addCustomer"){let L=v;if(!L.name||!L.name.trim()||!L.email||!L.email.trim())return}else if(nt.type==="changePassword"){let L=v;if(!L.currentPassword||!L.newPassword||!L.confirmPassword||L.newPassword!==L.confirmPassword)return}else if(nt.type==="addWebhook"){let L=v;if(!L.url||!L.url.trim())return}else if(nt.type==="addPaymentMethod"){let L=v;if(!L.cardNumber||!L.expiryDate)return}else if(nt.type==="deleteApiKey"){let L=v;if(!L.keyId&&!L.name)return}else if(nt.type==="refundPayment"){let L=v;if(!L.transactionId&&!L.customer)return}else if(nt.type==="createSubscription"){let L=v;if(!L.customerEmail&&!L.customerId)return}else if((nt.type==="toggleBlockRule"||nt.type==="enableBlockRule"||nt.type==="disableBlockRule")&&!v.ruleId)return}n&&n(nt.type,v),I(L=>L.map(E=>E.kind==="actionForm"&&E.actionType===nt.type?{...E,isSubmitted:!0}:E)),Ap(null),se({})}async function $i(v){qa.current.forEach(K=>window.clearTimeout(K)),qa.current=[];let E=[...k].reverse().find(K=>K.role==="assistant")?.isNotificationMessage===!0,_=Date.now(),D={id:_,role:"user",content:v};if(I(K=>K.map(T=>T.followups&&T.followups.length>0?{...T,followupSelected:!0}:T).concat(D)),E){let K=Date.now()+1,T={id:K,role:"assistant",kind:"text",content:""};I(M=>[...M,T]),ca(K,"Thank you, your feedback is saved.");return}Uu(null),xe("thinking"),ke([]);let G=!1;try{let K=new AbortController,T=setTimeout(()=>K.abort(),6e4),M,P;if(y)try{let Pe=await y(),st=Pe.Authorization||Pe.authorization;if(st){let Ut=st.split(" ");Ut.length===2?(P=Ut[0],M=Ut[1]):M=st,console.log("[ChatPanel] Auth token obtained from getAuthHeaders")}}catch(Pe){console.warn("[ChatPanel] Failed to get auth headers:",Pe)}let J=await fetch(`${i}/chat/stream`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:W,message:v,current_page:typeof window<"u"?window.location.href:s||"dashboard",user_id:c,org_id:d,user_name:f,user_email:h,is_eval:b,auth_token:M,auth_token_type:P,product_backend_url:Ft}),signal:K.signal});if(clearTimeout(T),!J.ok)throw new Error(`Agent request failed: ${J.status}`);let re=J.body?.getReader();if(!re)throw new Error("No response body");let Z=new TextDecoder,le="";for(;;){let{done:Pe,value:st}=await re.read();if(Pe)break;le+=Z.decode(st,{stream:!0});let Ut=le.split(`
31
66
 
32
- `);Z=je.pop()||"";for(let kt of je){if(!kt.trim())continue;let sr=kt.split(`
33
- `),Qe="",va="";for(let z of sr)z.startsWith("event: ")?Qe=z.slice(7):z.startsWith("data: ")&&(va=z.slice(6));if(!(!Qe||!va))try{let z=JSON.parse(va);if(Qe==="progress")z.status==="thinking"?(xe("thinking"),be([{message:z.message,completed:!1}])):z.status==="searching"?(xe("thinking"),be([{message:z.message||"Searching knowledge base...",completed:!1}])):z.status==="evaluating"?(xe("thinking"),be([{message:z.message||"Evaluating sources...",completed:!1}])):z.status==="executing"?(xe("executing"),be(q=>{let ae=q.map(Dt=>({...Dt,completed:!0})),fe=ae[ae.length-1];return(!fe||fe.message!==z.message)&&ae.push({message:z.message,completed:!1}),ae})):z.status==="responding"&&(xe("responding"),be(q=>q.map(ae=>({...ae,completed:!0}))));else if(Qe==="response"){be([]),G=!0;let q=z;if(q.action==="navigate"&&q.navigation){let ae={page:q.navigation.page,subtab:q.navigation.subtab};Hu(ae);let fe={id:A+1,role:"assistant",kind:"navigationAction",content:q.response||`I can take you to the ${iP(ae)}.`,navigationTarget:ae};k(Dt=>[...Dt,fe]),xe("idle")}else if(q.action==="show_form"&&q.actionType){Op({type:q.actionType,data:q.actionData||{}}),se(q.actionData||{});let ae={id:A+1,role:"assistant",kind:"actionForm",content:q.response||q.message||"Please fill in the details below:",actionType:q.actionType,actionData:q.actionData||{}};k(fe=>[...fe,ae]),xe("idle")}else if(q.action==="suggest_bulk"){let ae=A+1,fe={id:ae,role:"assistant",kind:"text",content:""};k(Dt=>[...Dt,fe]),nr(ae,q.response||q.message||"For bulk operations, you can upload a CSV file - just click the \u{1F4CE} button!",q.followups),G=!0}else if(q.action==="bulk_preview"){Or(q.bulk_session_id);let ae={id:A+1,role:"assistant",kind:"bulkPreview",content:q.message||`I found ${q.csv_data?.rowCount||0} items. Here's a preview:`,csvData:q.csv_data?{rowCount:q.csv_data.rowCount,columns:q.csv_data.columns,sampleRows:q.csv_data.sampleRows,fileName:"From context"}:void 0,suggestedAction:q.suggested_action,bulkSessionId:q.bulk_session_id};k(fe=>[...fe,ae]),xe("idle"),G=!0}else if(q.action==="execute"&&q.executionResult){let ae=A+1,fe={id:ae,role:"assistant",kind:"text",content:"",structuredData:q.structuredData||void 0};k(Dt=>[...Dt,fe]),nr(ae,q.response||"Action completed successfully.",q.followups),G=!0,setTimeout(()=>{window.dispatchEvent(new CustomEvent("agentActionComplete",{detail:{result:q.executionResult}}))},100)}else{let ae=A+1,fe={id:ae,role:"assistant",kind:"text",content:""};k(Dt=>[...Dt,fe]),nr(ae,q.response||q.message||"",q.followups),G=!0}}else if(Qe==="error"){xe("idle"),be([]),G=!0;let q=A+1,ae={id:q,role:"assistant",kind:"text",content:""};k(fe=>[...fe,ae]),nr(q,z.message||"An error occurred processing your request.")}else if(Qe==="done")be([]),xe("idle"),G=!0;else if(Qe==="escalation"){rx(!0),xe("idle");let ae={id:Date.now()+2,role:"assistant",kind:"text",content:z.message||"You've been connected to our support queue. An agent will be with you shortly."};k(fe=>[...fe,ae])}else Qe==="tool_request"&&Kk(z).catch(ae=>{console.error("[KiteChat] Tool execution failed:",ae)})}catch(z){console.error("Failed to parse SSE event:",z)}}}be([]),G||xe("idle")}catch(W){console.error("Agent request failed:",W),be([]);let T=A+1,N={id:T,role:"assistant",kind:"text",content:""};k(J=>[...J,N]);let P="I'm having trouble connecting to my backend.";W instanceof Error&&(W.name==="AbortError"?P="The request timed out. The server might be busy - please try again.":W.message.includes("Failed to fetch")||W.message.includes("NetworkError")?P="I'm having trouble connecting to my backend. Please make sure the agent server is running on port 5002.":W.message.includes("Agent request failed:")&&(P="The server encountered an error. Please try again.")),P+=" For simple navigation requests, I can still help you locally.",nr(T,P)}finally{be([])}}async function lP(y,b){Mr.current.forEach(R=>window.clearTimeout(R)),Mr.current=[];let E=Date.now(),A={id:E,role:"user",content:`\u{1F4CE} ${b.name}
67
+ `);le=Ut.pop()||"";for(let hr of Ut){if(!hr.trim())continue;let da=hr.split(`
68
+ `),ee="",et="";for(let pe of da)pe.startsWith("event: ")?ee=pe.slice(7):pe.startsWith("data: ")&&(et=pe.slice(6));if(!(!ee||!et))try{let pe=JSON.parse(et);if(ee==="progress")pe.status==="thinking"?(xe("thinking"),ke([{message:pe.message,completed:!1}])):pe.status==="searching"?(xe("thinking"),ke([{message:pe.message||"Searching knowledge base...",completed:!1}])):pe.status==="evaluating"?(xe("thinking"),ke([{message:pe.message||"Evaluating sources...",completed:!1}])):pe.status==="executing"?(xe("executing"),ke($=>{let ue=$.map(fa=>({...fa,completed:!0})),it=ue[ue.length-1];return(!it||it.message!==pe.message)&&ue.push({message:pe.message,completed:!1}),ue})):pe.status==="responding"&&(xe("responding"),ke($=>$.map(ue=>({...ue,completed:!0}))));else if(ee==="response"){ke([]),G=!0;let $=pe;if($.action==="navigate"&&$.navigation){let ue={page:$.navigation.page,subtab:$.navigation.subtab};Uu(ue);let it={id:_+1,role:"assistant",kind:"navigationAction",content:$.response||`I can take you to the ${Xk(ue)}.`,navigationTarget:ue};I(fa=>[...fa,it]),xe("idle")}else if($.action==="show_form"&&$.actionType){Ap({type:$.actionType,data:$.actionData||{}}),se($.actionData||{});let ue={id:_+1,role:"assistant",kind:"actionForm",content:$.response||$.message||"Please fill in the details below:",actionType:$.actionType,actionData:$.actionData||{}};I(it=>[...it,ue]),xe("idle")}else if($.action==="suggest_bulk"){let ue=_+1,it={id:ue,role:"assistant",kind:"text",content:""};I(fa=>[...fa,it]),ca(ue,$.response||$.message||"For bulk operations, you can upload a CSV file - just click the \u{1F4CE} button!",$.followups),G=!0}else if($.action==="bulk_preview"){Ha($.bulk_session_id);let ue={id:_+1,role:"assistant",kind:"bulkPreview",content:$.message||`I found ${$.csv_data?.rowCount||0} items. Here's a preview:`,csvData:$.csv_data?{rowCount:$.csv_data.rowCount,columns:$.csv_data.columns,sampleRows:$.csv_data.sampleRows,fileName:"From context"}:void 0,suggestedAction:$.suggested_action,bulkSessionId:$.bulk_session_id};I(it=>[...it,ue]),xe("idle"),G=!0}else if($.action==="execute"&&$.executionResult){let ue=_+1,it={id:ue,role:"assistant",kind:"text",content:"",structuredData:$.structuredData||void 0};I(fa=>[...fa,it]),ca(ue,$.response||"Action completed successfully.",$.followups),G=!0,setTimeout(()=>{window.dispatchEvent(new CustomEvent("agentActionComplete",{detail:{result:$.executionResult}}))},100)}else{let ue=_+1,it={id:ue,role:"assistant",kind:"text",content:""};I(fa=>[...fa,it]),ca(ue,$.response||$.message||"",$.followups),G=!0}}else if(ee==="error"){xe("idle"),ke([]),G=!0;let $=_+1,ue={id:$,role:"assistant",kind:"text",content:""};I(it=>[...it,ue]),ca($,pe.message||"An error occurred processing your request.")}else if(ee==="done")ke([]),xe("idle"),G=!0;else if(ee==="escalation"){console.log("[KiteChat] SSE escalation event received (AI-triggered)"),Ip(!0),xe("idle");let ue={id:Date.now()+2,role:"assistant",kind:"text",content:pe.message||"You've been connected to our support queue. An agent will be with you shortly."};I(it=>[...it,ue])}else ee==="tool_request"&&Ok(pe).catch(ue=>{console.error("[KiteChat] Tool execution failed:",ue)})}catch(pe){console.error("Failed to parse SSE event:",pe)}}}ke([]),G||xe("idle")}catch(K){console.error("Agent request failed:",K),ke([]);let T=_+1,M={id:T,role:"assistant",kind:"text",content:""};I(J=>[...J,M]);let P="I'm having trouble connecting to my backend.";K instanceof Error&&(K.name==="AbortError"?P="The request timed out. The server might be busy - please try again.":K.message.includes("Failed to fetch")||K.message.includes("NetworkError")?P="I'm having trouble connecting to my backend. Please make sure the agent server is running on port 5002.":K.message.includes("Agent request failed:")&&(P="The server encountered an error. Please try again.")),P+=" For simple navigation requests, I can still help you locally.",ca(T,P)}finally{ke([])}}async function Jk(v,L){qa.current.forEach(D=>window.clearTimeout(D)),qa.current=[];let E=Date.now(),_={id:E,role:"user",content:`\u{1F4CE} ${L.name}
34
69
 
35
- ${y}`};k(R=>[...R,A]),xe("thinking"),be([{message:"Analyzing CSV file...",completed:!1}]);try{let R=new FormData;R.append("file",b),R.append("message",y),R.append("session_id",Q),R.append("current_page",s||"dashboard"),c&&R.append("org_id",c);let G=new AbortController,W=setTimeout(()=>G.abort(),12e4),T=await fetch(`${i}/chat/bulk/stream`,{method:"POST",body:R,signal:G.signal});if(clearTimeout(W),!T.ok)throw new Error(`Bulk upload failed: ${T.status}`);let N=T.body?.getReader();if(!N)throw new Error("No response body");let P=new TextDecoder,J="",Z=null;for(;;){let{done:X,value:ce}=await N.read();if(X)break;J+=P.decode(ce,{stream:!0});let je=J.split(`
70
+ ${v}`};I(D=>[...D,_]),xe("thinking"),ke([{message:"Analyzing CSV file...",completed:!1}]);try{let D=new FormData;D.append("file",L),D.append("message",v),D.append("session_id",W),D.append("current_page",typeof window<"u"?window.location.href:s||"dashboard"),d&&D.append("org_id",d);let G=new AbortController,K=setTimeout(()=>G.abort(),12e4),T=await fetch(`${i}/chat/bulk/stream`,{method:"POST",body:D,signal:G.signal});if(clearTimeout(K),!T.ok)throw new Error(`Bulk upload failed: ${T.status}`);let M=T.body?.getReader();if(!M)throw new Error("No response body");let P=new TextDecoder,J="",re=null;for(;;){let{done:Z,value:le}=await M.read();if(Z)break;J+=P.decode(le,{stream:!0});let Pe=J.split(`
36
71
 
37
- `);J=je.pop()||"";for(let kt of je){if(!kt.trim())continue;let sr=kt.split(`
38
- `),Qe="",va="";for(let z of sr)z.startsWith("event: ")?Qe=z.slice(7):z.startsWith("data: ")&&(va=z.slice(6));if(!(!Qe||!va))try{let z=JSON.parse(va);if(Qe==="preview"){xe("idle"),be([]),Z=z.bulk_session_id,Or(Z);let q={id:E+1,role:"assistant",kind:"bulkPreview",content:z.message||`I found ${z.csv_data.rowCount} rows in your CSV. Here's a preview:`,csvData:{rowCount:z.csv_data.rowCount,columns:z.csv_data.columns,sampleRows:z.csv_data.sampleRows,fileName:b.name},suggestedAction:z.suggested_action,bulkSessionId:Z||void 0};k(ae=>[...ae,q])}else if(Qe==="progress")xe("executing"),be([{message:`Processing row ${z.row} of ${z.total}...`,completed:!1}]),k(q=>q[q.length-1]?.kind==="bulkProgress"?q.map((fe,Dt)=>Dt===q.length-1?{...fe,bulkProgress:{processed:z.row,total:z.total,successes:z.successes||0,failures:z.failures||0}}:fe):[...q,{id:Date.now(),role:"assistant",kind:"bulkProgress",bulkProgress:{processed:z.row,total:z.total,successes:z.successes||0,failures:z.failures||0}}]);else if(Qe==="summary")xe("idle"),be([]),Or(null),k(q=>[...q.filter(fe=>fe.kind!=="bulkProgress"),{id:Date.now(),role:"assistant",kind:"bulkSummary",content:z.message,bulkSummary:{total:z.total,successes:z.successes,failures:z.failures||[],navigationPage:z.navigationPage}}]),setTimeout(()=>{window.dispatchEvent(new CustomEvent("agentActionComplete",{detail:{result:{bulk:!0,total:z.total,successes:z.successes}}}))},100);else if(Qe==="error"){xe("idle"),be([]),Or(null);let q={id:E+1,role:"assistant",kind:"text",content:z.message||"An error occurred processing your CSV file."};k(ae=>[...ae,q])}else Qe==="done"&&(xe("idle"),be([]))}catch(z){console.error("Failed to parse bulk SSE event:",z)}}}be([]),xe("idle")}catch(R){console.error("Bulk upload failed:",R),be([]),xe("idle");let G="I'm having trouble processing your CSV file.";R instanceof Error&&(R.name==="AbortError"?G="The bulk upload request timed out. The file might be too large or the server is busy - please try again.":R.message.includes("Failed to fetch")||R.message.includes("NetworkError")?G="I'm having trouble connecting to my backend. Please make sure the agent server is running on port 5002.":R.message.includes("Bulk upload failed:")&&(G="The server encountered an error processing your CSV file. Please try again.")),G+=" Please try again.";let W={id:E+1,role:"assistant",kind:"text",content:G};k(T=>[...T,W])}}async function Gp(y){xe("executing"),be([{message:"Starting bulk operation...",completed:!1}]);try{let b=await fetch(`${i}/chat/bulk/confirm`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({bulk_session_id:y})});if(!b.ok)throw new Error(`Confirm failed: ${b.status}`);let E=b.body?.getReader();if(!E)throw new Error("No response body");let A=new TextDecoder,R="";for(;;){let{done:G,value:W}=await E.read();if(G)break;R+=A.decode(W,{stream:!0});let T=R.split(`
72
+ `);J=Pe.pop()||"";for(let st of Pe){if(!st.trim())continue;let Ut=st.split(`
73
+ `),hr="",da="";for(let ee of Ut)ee.startsWith("event: ")?hr=ee.slice(7):ee.startsWith("data: ")&&(da=ee.slice(6));if(!(!hr||!da))try{let ee=JSON.parse(da);if(hr==="preview"){xe("idle"),ke([]),re=ee.bulk_session_id,Ha(re);let et={id:E+1,role:"assistant",kind:"bulkPreview",content:ee.message||`I found ${ee.csv_data.rowCount} rows in your CSV. Here's a preview:`,csvData:{rowCount:ee.csv_data.rowCount,columns:ee.csv_data.columns,sampleRows:ee.csv_data.sampleRows,fileName:L.name},suggestedAction:ee.suggested_action,bulkSessionId:re||void 0};I(pe=>[...pe,et])}else if(hr==="progress")xe("executing"),ke([{message:`Processing row ${ee.row} of ${ee.total}...`,completed:!1}]),I(et=>et[et.length-1]?.kind==="bulkProgress"?et.map(($,ue)=>ue===et.length-1?{...$,bulkProgress:{processed:ee.row,total:ee.total,successes:ee.successes||0,failures:ee.failures||0}}:$):[...et,{id:Date.now(),role:"assistant",kind:"bulkProgress",bulkProgress:{processed:ee.row,total:ee.total,successes:ee.successes||0,failures:ee.failures||0}}]);else if(hr==="summary")xe("idle"),ke([]),Ha(null),I(et=>[...et.filter($=>$.kind!=="bulkProgress"),{id:Date.now(),role:"assistant",kind:"bulkSummary",content:ee.message,bulkSummary:{total:ee.total,successes:ee.successes,failures:ee.failures||[],navigationPage:ee.navigationPage}}]),setTimeout(()=>{window.dispatchEvent(new CustomEvent("agentActionComplete",{detail:{result:{bulk:!0,total:ee.total,successes:ee.successes}}}))},100);else if(hr==="error"){xe("idle"),ke([]),Ha(null);let et={id:E+1,role:"assistant",kind:"text",content:ee.message||"An error occurred processing your CSV file."};I(pe=>[...pe,et])}else hr==="done"&&(xe("idle"),ke([]))}catch(ee){console.error("Failed to parse bulk SSE event:",ee)}}}ke([]),xe("idle")}catch(D){console.error("Bulk upload failed:",D),ke([]),xe("idle");let G="I'm having trouble processing your CSV file.";D instanceof Error&&(D.name==="AbortError"?G="The bulk upload request timed out. The file might be too large or the server is busy - please try again.":D.message.includes("Failed to fetch")||D.message.includes("NetworkError")?G="I'm having trouble connecting to my backend. Please make sure the agent server is running on port 5002.":D.message.includes("Bulk upload failed:")&&(G="The server encountered an error processing your CSV file. Please try again.")),G+=" Please try again.";let K={id:E+1,role:"assistant",kind:"text",content:G};I(T=>[...T,K])}}async function jp(v){xe("executing"),ke([{message:"Starting bulk operation...",completed:!1}]);try{let L=await fetch(`${i}/chat/bulk/confirm`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({bulk_session_id:v})});if(!L.ok)throw new Error(`Confirm failed: ${L.status}`);let E=L.body?.getReader();if(!E)throw new Error("No response body");let _=new TextDecoder,D="";for(;;){let{done:G,value:K}=await E.read();if(G)break;D+=_.decode(K,{stream:!0});let T=D.split(`
39
74
 
40
- `);R=T.pop()||"";for(let N of T){if(!N.trim())continue;let P=N.split(`
41
- `),J="",Z="";for(let X of P)X.startsWith("event: ")?J=X.slice(7):X.startsWith("data: ")&&(Z=X.slice(6));if(!(!J||!Z))try{let X=JSON.parse(Z);if(J==="progress")be([{message:`Processing row ${X.row} of ${X.total}...`,completed:!1}]),k(ce=>ce[ce.length-1]?.kind==="bulkProgress"?ce.map((kt,sr)=>sr===ce.length-1?{...kt,bulkProgress:{processed:X.row,total:X.total,successes:X.successes||0,failures:X.failures||0}}:kt):[...ce,{id:Date.now(),role:"assistant",kind:"bulkProgress",bulkProgress:{processed:X.row,total:X.total,successes:X.successes||0,failures:X.failures||0}}]);else if(J==="summary")xe("idle"),be([]),Or(null),k(ce=>{let je=ce.filter(sr=>sr.kind!=="bulkProgress"&&sr.kind!=="bulkPreview"),kt={id:Date.now(),role:"assistant",kind:"bulkSummary",content:X.message,bulkSummary:{total:X.total,successes:X.successes,failures:X.failures||[],navigationPage:X.navigationPage}};return[...je,kt]}),setTimeout(()=>{window.dispatchEvent(new CustomEvent("agentActionComplete",{detail:{result:{bulk:!0,total:X.total,successes:X.successes}}}))},100);else if(J==="error"){xe("idle"),be([]),Or(null);let ce={id:Date.now(),role:"assistant",kind:"text",content:X.message||"An error occurred during bulk processing."};k(je=>[...je,ce])}}catch(X){console.error("Failed to parse confirm SSE event:",X)}}}}catch(b){console.error("Bulk confirm failed:",b),xe("idle"),be([]),Or(null);let E={id:Date.now(),role:"assistant",kind:"text",content:"Failed to start bulk operation. Please try again."};k(A=>[...A,E])}}function uP(){Or(null),k(y=>y.filter(b=>b.kind!=="bulkPreview"))}function wx(y){Bi(y)}function dP(y){let b=Date.now()+Math.floor(Math.random()*1e3);k(E=>[...E,{id:b,role:"assistant",kind:"text",content:y}])}function CM(y){let b=tx[y];if(!b)return;On("landing"),Eo(void 0);let E={id:y,stepIndex:0};Nr(E),Be.current=E,dP(`I'll help you with ${b.title}.`);let A=b.steps[0],R=A.cursorTarget?.selector.includes("[data-page="),G=A.cursorTarget?.selector.includes("[data-settings-tab=");if(A.cursorTarget&&(R||G)){let T=A.cursorTarget;G&&A.navigation&&o&&o(A.navigation.page,void 0),setTimeout(()=>{let P=()=>{let J=document.querySelector(T.selector);J&&J.offsetParent!==null?(Do(T),T.onClick&&setTimeout(()=>{J.click()},1200)):setTimeout(P,200)};P()},G?800:400)}else if(A.navigation&&o&&o(A.navigation.page,A.navigation.subtab),A.cursorTarget){let T=A.cursorTarget,N=T.selector.includes("data-settings-tab"),P=T.selector.includes("dialog")||T.selector.includes("api-key-name-input");setTimeout(()=>{let Z=()=>{let X=document.querySelector(T.selector);X&&X.offsetParent!==null?(Do(T),T.onClick&&setTimeout(()=>{X.click()},1e3)):N||P?setTimeout(Z,200):(Do(T),T.onClick&&setTimeout(()=>{let ce=document.querySelector(T.selector);ce&&ce.click()},1e3))};Z()},P?700:N?600:400)}let W={id:Date.now()+1,role:"assistant",kind:"guideStep",content:"",guideStepIndex:0};k(T=>[...T,W]),nr(W.id,A.text)}function Kp(){if(!me)return;let y=tx[me.id];if(!y)return;let b=Be.current;(!b||b.id!==me.id)&&(b=me,Be.current=me);let A=b.stepIndex+1;if(A>=y.steps.length){Fn();let P=Date.now()+1;k(J=>[...J,{id:P,role:"assistant",kind:"guideComplete",content:"Guide Complete"}]),Nr(void 0),Di(!0);return}let R=y.steps[A],G={id:me.id,stepIndex:A};Nr(G),Be.current=G;let W={id:Date.now()+1,role:"assistant",kind:"guideStep",content:"",guideStepIndex:A};k(P=>[...P,W]);let T=R.cursorTarget?.selector.includes("[data-page="),N=R.cursorTarget?.selector.includes("[data-settings-tab=");if(R.cursorTarget&&(T||N)){let P=R.cursorTarget;N&&R.navigation&&o&&o(R.navigation.page,void 0),setTimeout(()=>{let Z=Be.current;if(!Z||Z.id!==y.id||Z.stepIndex!==A)return;let X=()=>{let ce=Be.current;if(!ce||ce.id!==y.id||ce.stepIndex!==A)return;let je=document.querySelector(P.selector);je&&je.offsetParent!==null?(Do(P),P.onClick&&setTimeout(()=>{let kt=Be.current;!kt||kt.id!==y.id||kt.stepIndex!==A||je.click()},1200)):setTimeout(X,200)};X()},N?800:400)}else if(R.navigation&&o&&o(R.navigation.page,R.navigation.subtab),R.cursorTarget){let P=R.cursorTarget,J=P.selector.includes("dialog")||P.selector.includes("api-key-name-input"),Z=P.selector.includes("data-settings-tab"),X=R.navigation?.subtab&&Z&&P.selector.includes(`data-settings-tab="${R.navigation.subtab}"`),ce=P.onClick&&!X,je=!!R.navigation,Qe=(!!R.navigation?.subtab?700:je?400:0)+(J?700:Z?600:400);setTimeout(()=>{let va=Be.current;if(!va||va.id!==y.id||va.stepIndex!==A)return;let z=()=>{let q=Be.current;if(!q||q.id!==y.id||q.stepIndex!==A)return;let ae=document.querySelector(P.selector);ae&&ae.offsetParent!==null?(Do(P),ce&&setTimeout(()=>{let fe=Be.current;!fe||fe.id!==y.id||fe.stepIndex!==A||ae.click()},1e3)):J||Z||P.selector.includes("data-testid")?setTimeout(z,200):(Do(P),ce&&setTimeout(()=>{let fe=Be.current;if(!fe||fe.id!==y.id||fe.stepIndex!==A)return;let Dt=document.querySelector(P.selector);Dt&&Dt.click()},1e3))};z()},Qe)}else Fn();nr(W.id,R.text)}function cP(){if(!me)return;let y=tx[me.id];if(!y)return;let b=me.stepIndex-1;if(b>=0){Nr({id:me.id,stepIndex:b});let E=y.steps[b];E.navigation&&o&&o(E.navigation.page,E.navigation.subtab),E.cursorTarget?setTimeout(()=>{Do(E.cursorTarget)},500):Fn();let A=I.filter(R=>R.kind!=="guideStep"&&R.kind!=="guideComplete");k([...A,{id:Date.now(),role:"assistant",kind:"guideStep",content:E.text}])}}if(!e)return(0,p.jsx)("div",{className:"fixed bottom-6 left-1/2 -translate-x-1/2 z-50",children:(0,p.jsx)("div",{className:`flex items-center gap-3 rounded-2xl bg-white border border-gray-200 shadow-lg px-4 py-2 hover:shadow-xl transition-all duration-300 ease-out focus-within:border-gray-700 ${mx?"w-[480px]":"w-[320px]"}`,children:mx?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("textarea",{ref:hx,value:Bn,onChange:y=>{Wu(y.target.value),y.target.style.height="auto",y.target.style.height=Math.min(y.target.scrollHeight,120)+"px"},onKeyDown:y=>{y.key==="Enter"&&!y.shiftKey&&Bn.trim()?(y.preventDefault(),a?.(),Bi(Bn.trim()),Wu(""),Fi(!1),y.currentTarget.style.height="auto"):y.key==="Escape"&&(Fi(!1),Wu(""))},onBlur:()=>{Bn.trim()||setTimeout(()=>Fi(!1),200)},placeholder:"Ask a question...",rows:1,className:"flex-1 text-sm text-gray-700 outline-none bg-transparent resize-none min-h-[20px] max-h-[120px]"}),(0,p.jsxs)("div",{className:"flex items-center gap-2",children:[(0,p.jsx)("span",{className:"text-xs text-gray-400 font-medium",children:"\u21B5 Enter"}),(0,p.jsx)("button",{onClick:()=>{a?.(),Bn.trim()&&_(Bn),Wu(""),Fi(!1)},className:"h-7 w-7 rounded-lg bg-gray-100 hover:bg-gray-200 flex items-center justify-center transition-colors cursor-pointer",children:(0,p.jsx)(ta,{className:"h-3.5 w-3.5 text-black",fill:"currentColor"})})]})]}):(0,p.jsxs)("div",{className:"flex items-center gap-3 w-full",children:[(0,p.jsxs)("button",{onClick:()=>{Fi(!0),setTimeout(()=>hx.current?.focus(),100)},className:"flex items-center gap-3 flex-1 group",children:[(0,p.jsx)("span",{className:"text-sm text-gray-500 flex-1 text-left",children:"Ask a question..."}),(0,p.jsx)("span",{className:"text-xs text-gray-400 font-medium",children:"\u2318I"})]}),(0,p.jsx)("button",{onClick:()=>{a?.()},className:"h-7 w-7 rounded-lg bg-gray-100 hover:bg-gray-200 flex items-center justify-center transition-colors",children:(0,p.jsx)(ta,{className:"h-3.5 w-3.5 text-black",fill:"currentColor"})})]})})});if(It.status==="loading")return(0,p.jsxs)("section",{className:`fixed bottom-4 z-40 flex flex-col bg-white border border-gray-200 rounded-2xl overflow-hidden shadow-2xl ${V==="bottom-left"?"left-4":"right-4"} ${e?"opacity-100 scale-100":"opacity-0 scale-95 pointer-events-none"}`,style:{width:`${Ap}px`,height:`${Rp}px`},children:[(0,p.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-100 bg-gradient-to-r from-gray-50 to-white shrink-0",children:[(0,p.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,p.jsx)(ta,{className:"h-3.5 w-3.5 text-black",fill:"currentColor"}),(0,p.jsx)("h3",{className:"text-sm font-semibold text-gray-800",children:"Copilot"})]}),(0,p.jsx)(ot,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-full",onClick:()=>t?.(),children:(0,p.jsx)(_a,{className:"h-4 w-4"})})]}),(0,p.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,p.jsxs)("div",{className:"text-center",children:[(0,p.jsx)(Ct,{className:"h-8 w-8 animate-spin text-gray-400 mx-auto mb-3"}),(0,p.jsx)("p",{className:"text-sm text-gray-500",children:"Loading..."})]})})]});if(Wt){if(Fe.status==="loading")return(0,p.jsxs)("section",{className:`fixed bottom-4 z-40 flex flex-col bg-white border border-gray-200 rounded-2xl overflow-hidden shadow-2xl ${V==="bottom-left"?"left-4":"right-4"} ${e?"opacity-100 scale-100":"opacity-0 scale-95 pointer-events-none"}`,style:{width:`${Ap}px`,height:`${Rp}px`},children:[(0,p.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-100 bg-gradient-to-r from-gray-50 to-white shrink-0",children:[(0,p.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,p.jsx)(ta,{className:"h-3.5 w-3.5 text-black",fill:"currentColor"}),(0,p.jsx)("h3",{className:"text-sm font-semibold text-gray-800",children:"Copilot"})]}),(0,p.jsx)(ot,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-full",onClick:()=>t?.(),children:(0,p.jsx)(vn,{className:"h-3.5 w-3.5"})})]}),(0,p.jsx)(dM,{})]});if(Fe.status==="error")return(0,p.jsxs)("section",{className:`fixed bottom-4 z-40 flex flex-col bg-white border border-gray-200 rounded-2xl overflow-hidden shadow-2xl ${V==="bottom-left"?"left-4":"right-4"} ${e?"opacity-100 scale-100":"opacity-0 scale-95 pointer-events-none"}`,style:{width:`${Ap}px`,height:`${Rp}px`},children:[(0,p.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-100 bg-gradient-to-r from-gray-50 to-white shrink-0",children:[(0,p.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,p.jsx)(ta,{className:"h-3.5 w-3.5 text-black",fill:"currentColor"}),(0,p.jsx)("h3",{className:"text-sm font-semibold text-gray-800",children:"Copilot"})]}),(0,p.jsx)(ot,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-full",onClick:()=>t?.(),children:(0,p.jsx)(vn,{className:"h-3.5 w-3.5"})})]}),(0,p.jsx)(cM,{error:Fe.error,onRetry:Gk})]})}return(0,p.jsxs)(Bu.section,{drag:!0,dragMomentum:!1,dragElastic:0,animate:Dr,onDragStart:()=>ue(!0),onDragEnd:ar,className:`fixed bottom-4 z-40 flex flex-col bg-white border border-gray-200 rounded-2xl overflow-hidden shadow-2xl ${ge?"cursor-grabbing":""} ${V==="bottom-left"?"left-4":"right-4"} ${e?"opacity-100 scale-100":"opacity-0 scale-95 pointer-events-none"}`,style:{width:`${Ap}px`,height:`${Rp}px`},children:[(0,p.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-100 bg-gradient-to-r from-gray-50 to-white shrink-0 cursor-grab active:cursor-grabbing",children:[(0,p.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,p.jsx)(ta,{className:"h-3.5 w-3.5 text-black",fill:"currentColor"}),(0,p.jsx)("h3",{className:"text-sm font-semibold text-gray-800",children:"Copilot"})]}),(0,p.jsxs)("div",{className:"flex items-center gap-1",children:[(0,p.jsx)(ot,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-full",onClick:()=>{k([]),Mp(),Eo(void 0),Nr(void 0),Be.current=void 0,Di(!1)},children:(0,p.jsx)(jt,{className:"h-3 w-3"})}),(0,p.jsx)(ot,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-full",onClick:()=>{Le&&(Mp(),k([]),On("landing"),Eo(void 0),Nr(void 0),Be.current=void 0,Di(!1)),t?.()},children:(0,p.jsx)(vn,{className:"h-3.5 w-3.5"})})]})]}),(0,p.jsxs)("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden relative",children:[(0,p.jsx)("div",{className:`absolute inset-0 grid place-items-center overflow-y-auto ${ox?"visible":"invisible pointer-events-none"}`,children:(0,p.jsxs)("div",{className:"w-full px-4",children:[(0,p.jsx)("div",{className:"py-3",children:(0,p.jsx)("h2",{className:"text-center text-2xl font-semibold text-gray-900",children:Np==="folder"?Hk.find(y=>y.id===nx)?.title||"":"How can I help?"})}),(0,p.jsxs)("div",{className:"pb-4 px-4",children:[Np==="landing"&&(0,p.jsx)(p.Fragment,{children:(0,p.jsx)("div",{className:"flex flex-col gap-1",children:Zk?(0,p.jsx)("div",{className:"flex items-center justify-center py-4",children:(0,p.jsx)(Ct,{className:"h-4 w-4 animate-spin text-gray-400"})}):Yk.map((y,b)=>{let E=["bg-blue-400","bg-green-400","bg-purple-400","bg-orange-400","bg-pink-400"];return(0,p.jsxs)(ot,{type:"button",size:"sm",variant:"ghost",className:"w-full justify-start rounded-lg px-3 py-1.5 text-xs text-gray-700 hover:bg-gray-100 h-auto",onClick:()=>wx(y.prompt),children:[(0,p.jsx)("span",{className:`mr-2 inline-block h-1.5 w-1.5 rounded-full ${E[b%E.length]}`}),y.label]},y.id)})})}),Np==="folder"&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,p.jsx)(ot,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 rounded-full hover:bg-gray-100",onClick:nP,"aria-label":"Back to suggestions",children:(0,p.jsx)(Ds,{className:"h-4 w-4 text-gray-500"})}),(0,p.jsx)("span",{className:"text-xs font-medium uppercase tracking-wide text-gray-400",children:"Topics"})]}),(0,p.jsx)("div",{className:"flex flex-col gap-1.5",children:Hk.find(y=>y.id===nx)?.topics.map(y=>(0,p.jsx)(ot,{type:"button",size:"sm",variant:"secondary",className:"justify-start rounded-xl border border-gray-200 bg-gray-50 px-3 py-2.5 text-xs text-gray-700 shadow-none transition-all hover:bg-gray-100 hover:border-gray-300 h-auto",onClick:()=>wx(y.prompt),children:y.label},y.id))})]})]})]})}),(0,p.jsx)("div",{className:`flex-1 flex flex-col min-h-0 overflow-hidden ${ox?"invisible pointer-events-none":"visible"}`,children:(0,p.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:(0,p.jsx)(Gg,{ref:Bp,className:"h-full",children:(0,p.jsxs)("div",{className:"flex flex-col gap-2 px-4 py-3",children:[I.map((y,b)=>{let E=y.role==="user",A=b>0?I[b-1].role:void 0,R=A!==void 0&&A!==y.role,G=Be.current||me,W=!1;if(G&&y.kind==="guideStep"?y.guideStepIndex!==void 0?W=y.guideStepIndex===G.stepIndex:W=b===I.length-1:y.kind==="guideComplete"&&(W=b===I.length-1),y.kind==="guideStep"&&!W)return null;if(E)return(0,p.jsxs)("div",{className:`flex flex-col items-end gap-2 ${R?"mt-3":""}`,children:[y.imageUrls&&y.imageUrls.length>0&&(0,p.jsx)("div",{className:"flex flex-wrap gap-1 justify-end max-w-[260px]",children:y.imageUrls.map((T,N)=>(0,p.jsx)("button",{onClick:()=>Hp(T),className:"block cursor-pointer",children:(0,p.jsx)("img",{src:T,alt:`Attachment ${N+1}`,className:"max-h-32 max-w-[200px] rounded-lg object-cover border border-gray-700 hover:opacity-90 transition-opacity"})},N))}),y.content&&!y.content.match(/^!\[image\]\([^)]+\)(\n!\[image\]\([^)]+\))*$/)&&(0,p.jsx)("div",{className:"max-w-[260px] rounded-2xl rounded-br-md bg-gray-900 px-3 py-2 text-sm text-white shadow-sm",children:y.content.replace(/!\[image\]\([^)]+\)\n*/g,"").trim()})]},y.id);if(y.role==="agent"){let T=/!\[image\]\(([^)]+)\)/g,N=[],P,J=y.content||"";for(;(P=T.exec(J))!==null;)N.push(P[1]);let Z=y.imageUrls||N,X=J.replace(/!\[image\]\([^)]+\)\n*/g,"").trim();return(0,p.jsxs)("div",{className:`flex flex-col items-start gap-2 ${R?"mt-3":""}`,children:[R&&(0,p.jsx)("span",{className:"text-[10px] text-gray-500 mb-1 ml-1",children:"Agent"}),Z.length>0&&(0,p.jsx)("div",{className:"flex flex-wrap gap-1 justify-start max-w-[300px]",children:Z.map((ce,je)=>(0,p.jsx)("button",{onClick:()=>Hp(ce),className:"block cursor-pointer",children:(0,p.jsx)("img",{src:ce,alt:`Attachment ${je+1}`,className:"max-h-32 max-w-[200px] rounded-lg object-cover border border-gray-300 hover:opacity-90 transition-opacity"})},je))}),X&&(0,p.jsx)("div",{className:"max-w-[300px] rounded-2xl rounded-bl-md bg-gray-100 px-4 py-3 text-sm text-gray-700",children:X})]},y.id)}if(y.kind==="searchSummary")return(0,p.jsx)("div",{className:`${R?"mt-3":""}`,children:(0,p.jsx)(Mk,{title:y.title??"Search results",links:y.links??[]})},y.id);if(y.kind==="guideComplete")return(0,p.jsx)("div",{ref:W?zu:null,className:`${R?"mt-3":""}`,children:(0,p.jsxs)("div",{className:"flex items-center gap-2 rounded-xl bg-green-50 border border-green-200 px-3 py-2.5 text-sm leading-6",children:[(0,p.jsx)(nt,{className:"h-5 w-5 text-green-600 flex-shrink-0"}),(0,p.jsx)("span",{className:"font-medium text-green-800",children:y.content})]})},y.id);if(y.kind==="navigationAction")return(0,p.jsxs)("div",{className:`${R?"mt-3":""}`,children:[(0,p.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-6 mb-2 text-gray-700",children:y.content||""}),y.navigationTarget&&(0,p.jsx)("div",{className:"mt-2",children:(0,p.jsxs)(ot,{type:"button",size:"sm",variant:"secondary",className:"h-8 rounded-xl px-3 text-xs gap-1.5 bg-gray-100 hover:bg-gray-200 border border-gray-200",onClick:()=>y.navigationTarget&&$p(y.navigationTarget),children:[(0,p.jsx)("span",{children:"Confirm"}),(0,p.jsxs)("span",{className:"flex items-center gap-0.5 text-gray-400",children:[(0,p.jsx)(Cr,{className:"h-3 w-3"}),(0,p.jsx)(Sr,{className:"h-3 w-3"})]})]})})]},y.id);if(y.kind==="actionForm"){let T=y.actionType,N=Object.keys(ne).length>0?ne:y.actionData||{};if(y.isSubmitted){let P="";return T==="updateCompanyInfo"?P="Company information has been updated successfully.":T==="addApiKey"?P="API key has been added successfully.":T==="addCustomer"?P="Customer has been added successfully.":T==="enable2FA"?P="Two-factor authentication has been enabled successfully.":T==="disable2FA"?P="Two-factor authentication has been disabled successfully.":T==="changePassword"?P="Your password has been changed successfully.":T==="revokeSession"?P="Session has been revoked successfully.":T==="toggleNotification"?P="Notification preferences have been updated successfully.":T==="connectIntegration"?P="Integration has been connected successfully.":T==="disconnectIntegration"?P="Integration has been disconnected successfully.":T==="addPaymentMethod"?P="Payment method has been added successfully.":T==="removePaymentMethod"?P="Payment method has been removed successfully.":T==="deleteApiKey"?P="API key has been deleted successfully.":T==="addWebhook"?P="Webhook endpoint has been added successfully.":T==="updateCurrency"?P="Currency preference has been updated successfully.":T==="updateTimezone"?P="Timezone has been updated successfully.":T==="refundPayment"?P="Refund has been processed successfully.":T==="exportCertificate"?P="Certificate of Incorporation has been downloaded successfully.":T==="createSubscription"?P="Subscription has been created successfully.":T==="toggleBlockRule"||T==="enableBlockRule"||T==="disableBlockRule"?P="Block rule has been updated successfully.":P="Action completed successfully.",(0,p.jsx)("div",{className:`${R?"mt-3":""}`,children:(0,p.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-6 text-gray-700",children:P})},y.id)}return(0,p.jsxs)("div",{className:`min-w-0 ${R?"mt-3":""}`,children:[(0,p.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-6 mb-3 text-gray-700",children:y.content||""}),T==="updateCompanyInfo"&&(0,p.jsxs)("div",{className:"space-y-2 bg-gray-50 rounded-lg p-2 border border-gray-200 overflow-hidden",children:[(0,p.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Company Name"}),(0,p.jsx)(Oe,{placeholder:"Acme Corporation",value:N.companyName||"",onChange:P=>se({...ne,companyName:P.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Email"}),(0,p.jsx)(Oe,{type:"email",placeholder:"contact@acme.com",value:N.email||"",onChange:P=>se({...ne,email:P.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Address"}),(0,p.jsx)(Oe,{placeholder:"123 Main St, San Francisco, CA",value:N.address||"",onChange:P=>se({...ne,address:P.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Phone"}),(0,p.jsx)(Oe,{type:"tel",placeholder:"+1 (555) 123-4567",value:N.phone||"",onChange:P=>se({...ne,phone:P.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Website"}),(0,p.jsx)(Oe,{type:"url",placeholder:"https://acme.com",value:N.website||"",onChange:P=>se({...ne,website:P.target.value}),className:"h-8 text-xs border-gray-200"})]})]})]}),T==="addApiKey"&&(0,p.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"API Key Name"}),(0,p.jsx)(Oe,{placeholder:"Production Key",value:N.name||"",onChange:P=>se({...ne,name:P.target.value}),className:"h-8 text-xs border-gray-200"})]})}),T==="addCustomer"&&(0,p.jsxs)("div",{className:"space-y-2 bg-gray-50 rounded-lg p-2 border border-gray-200 overflow-hidden",children:[(0,p.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Company Name"}),(0,p.jsx)(Oe,{placeholder:"Acme Corporation",value:N.name||"",onChange:P=>se({...ne,name:P.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Email"}),(0,p.jsx)(Oe,{type:"email",placeholder:"contact@acme.com",value:N.email||"",onChange:P=>se({...ne,email:P.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Location"}),(0,p.jsx)(Oe,{placeholder:"San Francisco, CA",value:N.location||"",onChange:P=>se({...ne,location:P.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Subscription Tier"}),(0,p.jsxs)("select",{value:N.subscription||"Starter",onChange:P=>se({...ne,subscription:P.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,p.jsx)("option",{value:"Starter",children:"Starter"}),(0,p.jsx)("option",{value:"Professional",children:"Professional"}),(0,p.jsx)("option",{value:"Enterprise",children:"Enterprise"})]})]})]}),(T==="enable2FA"||T==="disable2FA")&&(0,p.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,p.jsx)("p",{className:"text-xs text-black",children:T==="enable2FA"?"This will enable two-factor authentication for your account. You'll need to set up an authenticator app.":"This will disable two-factor authentication for your account. Your account will be less secure."})}),T==="changePassword"&&(0,p.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Current Password"}),(0,p.jsx)(Oe,{type:"password",value:N.currentPassword||"",onChange:P=>se({...ne,currentPassword:P.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"New Password"}),(0,p.jsx)(Oe,{type:"password",value:N.newPassword||"",onChange:P=>se({...ne,newPassword:P.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Confirm New Password"}),(0,p.jsx)(Oe,{type:"password",value:N.confirmPassword||"",onChange:P=>se({...ne,confirmPassword:P.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),T==="toggleNotification"&&(0,p.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Notification Type"}),(0,p.jsxs)("select",{value:N.notificationType||"paymentReceived",onChange:P=>se({...ne,notificationType:P.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,p.jsx)("option",{value:"paymentReceived",children:"Payment Received"}),(0,p.jsx)("option",{value:"paymentFailed",children:"Payment Failed"}),(0,p.jsx)("option",{value:"invoicePaid",children:"Invoice Paid"}),(0,p.jsx)("option",{value:"monthlySummary",children:"Monthly Summary"}),(0,p.jsx)("option",{value:"productUpdates",children:"Product Updates"})]})]}),(0,p.jsxs)("div",{className:"flex items-center gap-2",children:[(0,p.jsx)("input",{type:"checkbox",checked:N.enabled!==!1,onChange:P=>se({...ne,enabled:P.target.checked}),className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"}),(0,p.jsx)("label",{className:"text-xs text-black",children:"Enable this notification"})]})]}),(T==="connectIntegration"||T==="disconnectIntegration")&&(0,p.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Integration"}),(0,p.jsxs)("select",{value:N.integrationName||"Slack",onChange:P=>se({...ne,integrationName:P.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,p.jsx)("option",{value:"Slack",children:"Slack"}),(0,p.jsx)("option",{value:"Zapier",children:"Zapier"}),(0,p.jsx)("option",{value:"Webhook",children:"Webhook"})]})]})}),T==="addPaymentMethod"&&(0,p.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Card Number"}),(0,p.jsx)(Oe,{placeholder:"1234 5678 9012 3456",value:N.cardNumber||"",onChange:P=>se({...ne,cardNumber:P.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Expiry Date"}),(0,p.jsx)(Oe,{placeholder:"MM/YY",value:N.expiryDate||"",onChange:P=>se({...ne,expiryDate:P.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),T==="removePaymentMethod"&&(0,p.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,p.jsx)("p",{className:"text-xs text-black",children:"This will remove the default payment method from your account."})}),T==="refundPayment"&&(0,p.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Transaction ID or Customer Name"}),(0,p.jsx)(Oe,{placeholder:"e.g., txn_1234 or Acme Corp",value:N.transactionId||N.customer||"",onChange:P=>{let J=P.target.value;J.startsWith("txn_")||/^\d+$/.test(J)?se({...ne,transactionId:J,customer:void 0}):se({...ne,customer:J,transactionId:void 0})},className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Amount (optional)"}),(0,p.jsx)(Oe,{placeholder:"$0.00",value:N.amount||"",onChange:P=>se({...ne,amount:P.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Reason (optional)"}),(0,p.jsx)(Oe,{placeholder:"e.g., Customer request",value:N.reason||"",onChange:P=>se({...ne,reason:P.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),T==="deleteApiKey"&&(0,p.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"API Key Name or ID"}),(0,p.jsx)(Oe,{placeholder:"Production Key",value:N.keyId||N.name||"",onChange:P=>se({...ne,keyId:P.target.value,name:P.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsx)("p",{className:"text-xs text-red-600",children:"Warning: This action cannot be undone. The API key will be permanently deleted."})]}),T==="addWebhook"&&(0,p.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Webhook URL"}),(0,p.jsx)(Oe,{type:"url",placeholder:"https://example.com/webhook",value:N.url||"",onChange:P=>se({...ne,url:P.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Name (optional)"}),(0,p.jsx)(Oe,{placeholder:"Production Webhook",value:N.name||"",onChange:P=>se({...ne,name:P.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),T==="updateCurrency"&&(0,p.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Currency"}),(0,p.jsxs)("select",{value:N.currency||"USD",onChange:P=>se({...ne,currency:P.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,p.jsx)("option",{value:"USD",children:"USD ($)"}),(0,p.jsx)("option",{value:"EUR",children:"EUR (\u20AC)"}),(0,p.jsx)("option",{value:"GBP",children:"GBP (\xA3)"}),(0,p.jsx)("option",{value:"JPY",children:"JPY (\xA5)"})]})]})}),T==="updateTimezone"&&(0,p.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Timezone"}),(0,p.jsxs)("select",{value:N.timezone||"America/Los_Angeles",onChange:P=>se({...ne,timezone:P.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,p.jsx)("option",{value:"America/Los_Angeles",children:"Pacific Time (PT)"}),(0,p.jsx)("option",{value:"America/New_York",children:"Eastern Time (ET)"}),(0,p.jsx)("option",{value:"Europe/London",children:"GMT"}),(0,p.jsx)("option",{value:"Asia/Tokyo",children:"JST"})]})]})}),T==="revokeSession"&&(0,p.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Device/Session"}),(0,p.jsx)(Oe,{placeholder:"MacBook Pro",value:N.device||"",onChange:P=>se({...ne,device:P.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsx)("p",{className:"text-xs text-black",children:"This will sign out the device and invalidate its session."})]}),T==="createSubscription"&&(0,p.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Customer Email"}),(0,p.jsx)(Oe,{type:"email",placeholder:"customer@example.com",value:N.customerEmail||"",onChange:P=>se({...ne,customerEmail:P.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Plan"}),(0,p.jsxs)("select",{value:N.plan||"Starter",onChange:P=>se({...ne,plan:P.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,p.jsx)("option",{value:"Starter",children:"Starter ($29/mo)"}),(0,p.jsx)("option",{value:"Professional",children:"Professional ($99/mo)"}),(0,p.jsx)("option",{value:"Enterprise",children:"Enterprise ($299/mo)"})]})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Billing Cycle"}),(0,p.jsxs)("select",{value:N.billingCycle||"monthly",onChange:P=>se({...ne,billingCycle:P.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,p.jsx)("option",{value:"monthly",children:"Monthly"}),(0,p.jsx)("option",{value:"yearly",children:"Yearly (Save 15%)"})]})]})]}),T==="exportCertificate"&&(0,p.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,p.jsx)("p",{className:"text-xs text-black",children:"This will export your certificate of incorporation document."}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Format"}),(0,p.jsxs)("select",{value:N.format||"pdf",onChange:P=>se({...ne,format:P.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,p.jsx)("option",{value:"pdf",children:"PDF"}),(0,p.jsx)("option",{value:"json",children:"JSON"})]})]})]}),(T==="toggleBlockRule"||T==="enableBlockRule"||T==="disableBlockRule")&&(0,p.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Block Rule"}),(0,p.jsxs)("select",{value:N.ruleId||"rule_1",onChange:P=>se({...ne,ruleId:P.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,p.jsx)("option",{value:"rule_1",children:"Block if risk level = 'highest'"}),(0,p.jsx)("option",{value:"rule_2",children:"Block if matches Stripe block lists"}),(0,p.jsx)("option",{value:"rule_3",children:"Block if CVC verification fails"}),(0,p.jsx)("option",{value:"rule_4",children:"Block if Postal code verification fails"})]})]}),(0,p.jsx)("p",{className:"text-xs text-black",children:T==="enableBlockRule"?"This will enable the selected block rule to actively block matching payments.":T==="disableBlockRule"?"This will disable the selected block rule. Matching payments will no longer be blocked.":"This will toggle the selected block rule's state."})]}),(0,p.jsx)("div",{className:"mt-3",children:(0,p.jsxs)(ot,{type:"button",size:"sm",variant:"secondary",className:"h-8 rounded-xl px-3 text-xs gap-1.5 bg-gray-100 hover:bg-gray-200 border border-gray-200",onClick:Wp,children:[(0,p.jsx)("span",{children:"Confirm"}),(0,p.jsxs)("span",{className:"flex items-center gap-0.5 text-gray-400",children:[(0,p.jsx)(Cr,{className:"h-3 w-3"}),(0,p.jsx)(Sr,{className:"h-3 w-3"})]})]})})]},y.id)}if(y.kind==="bulkPreview"&&y.csvData)return(0,p.jsxs)("div",{className:`${R?"mt-3":""}`,children:[(0,p.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-6 mb-3 text-gray-700",children:y.content||""}),(0,p.jsxs)("div",{className:"bg-gray-50 rounded-lg border border-gray-200 overflow-hidden",children:[(0,p.jsxs)("div",{className:"bg-gray-100 px-3 py-2 border-b border-gray-200 flex items-center gap-2",children:[(0,p.jsx)(xn,{className:"h-4 w-4 text-gray-600"}),(0,p.jsx)("span",{className:"text-xs font-medium text-gray-700",children:y.csvData.fileName}),(0,p.jsxs)("span",{className:"text-xs text-gray-500",children:["\u2022 ",y.csvData.rowCount," rows"]})]}),(0,p.jsxs)("div",{className:"px-3 py-2 border-b border-gray-100",children:[(0,p.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-gray-500 mb-1",children:"Columns"}),(0,p.jsx)("div",{className:"flex flex-wrap gap-1",children:y.csvData.columns.map((T,N)=>(0,p.jsx)("span",{className:"text-xs bg-blue-100 text-blue-700 px-1.5 py-0.5 rounded",children:T},N))})]}),y.csvData.sampleRows.length>0&&(0,p.jsxs)("div",{className:"px-3 py-2",children:[(0,p.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-gray-500 mb-1",children:"Sample Data"}),(0,p.jsx)("div",{className:"space-y-1",children:y.csvData.sampleRows.slice(0,3).map((T,N)=>(0,p.jsxs)("div",{className:"text-xs text-gray-600 bg-white rounded px-2 py-1 border border-gray-100",children:[Object.entries(T).slice(0,3).map(([P,J],Z)=>(0,p.jsxs)("span",{children:[Z>0&&" \u2022 ",(0,p.jsxs)("span",{className:"text-gray-400",children:[P,":"]})," ",J]},P)),Object.keys(T).length>3&&(0,p.jsxs)("span",{className:"text-gray-400",children:[" ","..."]})]},N))})]}),y.suggestedAction&&(0,p.jsx)("div",{className:"px-3 py-2 bg-blue-50 border-t border-blue-100",children:(0,p.jsxs)("span",{className:"text-xs text-blue-700",children:["Suggested action:"," ",(0,p.jsx)("strong",{children:y.suggestedAction.replace(/_/g," ")})]})})]}),y.bulkSessionId&&(0,p.jsxs)("div",{className:"mt-3 flex items-center gap-2",children:[(0,p.jsxs)(ot,{type:"button",size:"sm",variant:"secondary",className:"h-8 rounded-xl px-3 text-xs gap-1.5 bg-gray-100 hover:bg-gray-200 border border-gray-200",onClick:()=>y.bulkSessionId&&Gp(y.bulkSessionId),children:[(0,p.jsxs)("span",{children:["Process ",y.csvData.rowCount," rows"]}),(0,p.jsxs)("span",{className:"flex items-center gap-0.5 text-gray-400",children:[(0,p.jsx)(Cr,{className:"h-3 w-3"}),(0,p.jsx)(Sr,{className:"h-3 w-3"})]})]}),(0,p.jsx)(ot,{type:"button",size:"sm",variant:"ghost",className:"h-8 rounded-xl px-3 text-xs text-gray-500 hover:text-gray-700 hover:bg-gray-100",onClick:uP,children:"Cancel"})]})]},y.id);if(y.kind==="bulkProgress"&&y.bulkProgress){let{processed:T,total:N,successes:P,failures:J}=y.bulkProgress,Z=Math.round(T/N*100);return(0,p.jsx)("div",{className:`${R?"mt-3":""}`,children:(0,p.jsxs)("div",{className:"bg-gray-50 rounded-lg border border-gray-200 p-3",children:[(0,p.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,p.jsx)(Ct,{className:"h-4 w-4 animate-spin text-blue-600"}),(0,p.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["Processing... ",T," of ",N]})]}),(0,p.jsx)("div",{className:"h-2 bg-gray-200 rounded-full overflow-hidden mb-2",children:(0,p.jsx)("div",{className:"h-full bg-blue-600 transition-all duration-300",style:{width:`${Z}%`}})}),(0,p.jsxs)("div",{className:"flex items-center gap-3 text-xs text-gray-600",children:[(0,p.jsxs)("span",{className:"flex items-center gap-1",children:[(0,p.jsx)(nt,{className:"h-3 w-3 text-green-600"}),P," successful"]}),J>0&&(0,p.jsxs)("span",{className:"flex items-center gap-1 text-red-600",children:[(0,p.jsx)(_a,{className:"h-3 w-3"}),J," failed"]})]})]})},y.id)}if(y.kind==="bulkSummary"&&y.bulkSummary){let{total:T,successes:N,failures:P,navigationPage:J}=y.bulkSummary,Z=P.length>0,X=J?.page==="customers"?"Customers":J?.page==="dashboard"?"Dashboard":J?.page==="settings"?"Settings":"Results";return(0,p.jsx)("div",{className:`${R?"mt-3":""}`,children:(0,p.jsxs)("div",{className:`rounded-lg border p-3 ${Z?"bg-amber-50 border-amber-200":"bg-green-50 border-green-200"}`,children:[(0,p.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,p.jsx)(nt,{className:`h-5 w-5 ${Z?"text-amber-600":"text-green-600"}`}),(0,p.jsx)("span",{className:"text-sm font-medium text-gray-800",children:"Bulk operation complete"})]}),(0,p.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:y.content||`Processed ${T} rows: ${N} successful${Z?`, ${P.length} failed`:""}.`}),(0,p.jsxs)("div",{className:"flex items-center gap-4 text-xs",children:[(0,p.jsxs)("span",{className:"flex items-center gap-1 text-green-700",children:[(0,p.jsx)(nt,{className:"h-3 w-3"}),N," successful"]}),Z&&(0,p.jsxs)("span",{className:"flex items-center gap-1 text-red-600",children:[(0,p.jsx)(_a,{className:"h-3 w-3"}),P.length," failed"]})]}),Z&&(0,p.jsxs)("div",{className:"mt-3 pt-2 border-t border-amber-200",children:[(0,p.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-amber-700 mb-1",children:"Failed Rows"}),(0,p.jsxs)("div",{className:"space-y-1 max-h-32 overflow-y-auto",children:[P.slice(0,5).map((ce,je)=>(0,p.jsxs)("div",{className:"text-xs text-red-700 bg-red-50 rounded px-2 py-1",children:["Row ",ce.row,":"," ",ce.error||"Unknown error"]},je)),P.length>5&&(0,p.jsxs)("div",{className:"text-xs text-amber-600",children:["...and ",P.length-5," more"]})]})]}),J&&N>0&&(0,p.jsx)("div",{className:"mt-3 pt-2 border-t border-gray-200",children:(0,p.jsxs)("button",{type:"button",onClick:ce=>{ce.preventDefault(),ce.stopPropagation(),o&&J.page&&o(J.page,J.subtab)},className:"flex items-center gap-2 text-xs text-gray-500 hover:text-gray-700 transition-colors group cursor-pointer",children:[(0,p.jsxs)("span",{className:"flex items-center gap-1 px-1.5 py-0.5 bg-gray-100 rounded text-[10px] font-medium text-gray-600 group-hover:bg-gray-200",children:[(0,p.jsx)(Cr,{className:"h-2.5 w-2.5"}),(0,p.jsx)("span",{children:"+"}),(0,p.jsx)(Sr,{className:"h-2.5 w-2.5"})]}),(0,p.jsxs)("span",{children:["View ",X]})]})})]})},y.id)}return(0,p.jsx)(O.Fragment,{children:(0,p.jsxs)("div",{ref:W?zu:null,className:`${R?"mt-3":""}`,children:[(0,p.jsx)("div",{className:"text-sm leading-6 text-gray-700",children:(()=>{let T=y.content||"";if(y.kind==="guideStep"){let N=T.match(/^(Step\s+\d+:)([\s\S]*)/);if(N)return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("strong",{children:N[1]}),N[2]]})}return y.role==="assistant"&&T?iM(T):T||(0,p.jsx)("span",{className:"opacity-70",children:"Thinking\u2026"})})()}),y.role==="assistant"&&y.structuredData&&(0,p.jsx)("div",{className:"mt-3",children:(0,p.jsx)(jk,{type:y.structuredData.type,data:y.structuredData.data})}),y.role==="assistant"&&y.followups&&y.followups.length>0&&!y.followupSelected&&(0,p.jsx)("div",{className:"mt-3 flex flex-wrap gap-1.5",children:y.followups.map(T=>(0,p.jsx)("button",{type:"button",onClick:()=>oP(y.id,T),className:`inline-flex items-center px-3 py-1.5 text-xs font-medium rounded-xl
75
+ `);D=T.pop()||"";for(let M of T){if(!M.trim())continue;let P=M.split(`
76
+ `),J="",re="";for(let Z of P)Z.startsWith("event: ")?J=Z.slice(7):Z.startsWith("data: ")&&(re=Z.slice(6));if(!(!J||!re))try{let Z=JSON.parse(re);if(J==="progress")ke([{message:`Processing row ${Z.row} of ${Z.total}...`,completed:!1}]),I(le=>le[le.length-1]?.kind==="bulkProgress"?le.map((st,Ut)=>Ut===le.length-1?{...st,bulkProgress:{processed:Z.row,total:Z.total,successes:Z.successes||0,failures:Z.failures||0}}:st):[...le,{id:Date.now(),role:"assistant",kind:"bulkProgress",bulkProgress:{processed:Z.row,total:Z.total,successes:Z.successes||0,failures:Z.failures||0}}]);else if(J==="summary")xe("idle"),ke([]),Ha(null),I(le=>{let Pe=le.filter(Ut=>Ut.kind!=="bulkProgress"&&Ut.kind!=="bulkPreview"),st={id:Date.now(),role:"assistant",kind:"bulkSummary",content:Z.message,bulkSummary:{total:Z.total,successes:Z.successes,failures:Z.failures||[],navigationPage:Z.navigationPage}};return[...Pe,st]}),setTimeout(()=>{window.dispatchEvent(new CustomEvent("agentActionComplete",{detail:{result:{bulk:!0,total:Z.total,successes:Z.successes}}}))},100);else if(J==="error"){xe("idle"),ke([]),Ha(null);let le={id:Date.now(),role:"assistant",kind:"text",content:Z.message||"An error occurred during bulk processing."};I(Pe=>[...Pe,le])}}catch(Z){console.error("Failed to parse confirm SSE event:",Z)}}}}catch(L){console.error("Bulk confirm failed:",L),xe("idle"),ke([]),Ha(null);let E={id:Date.now(),role:"assistant",kind:"text",content:"Failed to start bulk operation. Please try again."};I(_=>[..._,E])}}function Qk(){Ha(null),I(v=>v.filter(L=>L.kind!=="bulkPreview"))}function gv(v){$i(v)}function Yk(v){let L=Date.now()+Math.floor(Math.random()*1e3);I(E=>[...E,{id:L,role:"assistant",kind:"text",content:v}])}function jN(v){let L=Yy[v];if(!L)return;$n("landing"),qo(void 0);let E={id:v,stepIndex:0};$a(E),qe.current=E,Yk(`I'll help you with ${L.title}.`);let _=L.steps[0],D=_.cursorTarget?.selector.includes("[data-page="),G=_.cursorTarget?.selector.includes("[data-settings-tab=");if(_.cursorTarget&&(D||G)){let T=_.cursorTarget;G&&_.navigation&&o&&o(_.navigation.page,void 0),setTimeout(()=>{let P=()=>{let J=document.querySelector(T.selector);J&&J.offsetParent!==null?($o(T),T.onClick&&setTimeout(()=>{J.click()},1200)):setTimeout(P,200)};P()},G?800:400)}else if(_.navigation&&o&&o(_.navigation.page,_.navigation.subtab),_.cursorTarget){let T=_.cursorTarget,M=T.selector.includes("data-settings-tab"),P=T.selector.includes("dialog")||T.selector.includes("api-key-name-input");setTimeout(()=>{let re=()=>{let Z=document.querySelector(T.selector);Z&&Z.offsetParent!==null?($o(T),T.onClick&&setTimeout(()=>{Z.click()},1e3)):M||P?setTimeout(re,200):($o(T),T.onClick&&setTimeout(()=>{let le=document.querySelector(T.selector);le&&le.click()},1e3))};re()},P?700:M?600:400)}let K={id:Date.now()+1,role:"assistant",kind:"guideStep",content:"",guideStepIndex:0};I(T=>[...T,K]),ca(K.id,_.text)}function qp(){if(!me)return;let v=Yy[me.id];if(!v)return;let L=qe.current;(!L||L.id!==me.id)&&(L=me,qe.current=me);let _=L.stepIndex+1;if(_>=v.steps.length){Hn();let P=Date.now()+1;I(J=>[...J,{id:P,role:"assistant",kind:"guideComplete",content:"Guide Complete"}]),$a(void 0),Fi(!0);return}let D=v.steps[_],G={id:me.id,stepIndex:_};$a(G),qe.current=G;let K={id:Date.now()+1,role:"assistant",kind:"guideStep",content:"",guideStepIndex:_};I(P=>[...P,K]);let T=D.cursorTarget?.selector.includes("[data-page="),M=D.cursorTarget?.selector.includes("[data-settings-tab=");if(D.cursorTarget&&(T||M)){let P=D.cursorTarget;M&&D.navigation&&o&&o(D.navigation.page,void 0),setTimeout(()=>{let re=qe.current;if(!re||re.id!==v.id||re.stepIndex!==_)return;let Z=()=>{let le=qe.current;if(!le||le.id!==v.id||le.stepIndex!==_)return;let Pe=document.querySelector(P.selector);Pe&&Pe.offsetParent!==null?($o(P),P.onClick&&setTimeout(()=>{let st=qe.current;!st||st.id!==v.id||st.stepIndex!==_||Pe.click()},1200)):setTimeout(Z,200)};Z()},M?800:400)}else if(D.navigation&&o&&o(D.navigation.page,D.navigation.subtab),D.cursorTarget){let P=D.cursorTarget,J=P.selector.includes("dialog")||P.selector.includes("api-key-name-input"),re=P.selector.includes("data-settings-tab"),Z=D.navigation?.subtab&&re&&P.selector.includes(`data-settings-tab="${D.navigation.subtab}"`),le=P.onClick&&!Z,Pe=!!D.navigation,hr=(!!D.navigation?.subtab?700:Pe?400:0)+(J?700:re?600:400);setTimeout(()=>{let da=qe.current;if(!da||da.id!==v.id||da.stepIndex!==_)return;let ee=()=>{let et=qe.current;if(!et||et.id!==v.id||et.stepIndex!==_)return;let pe=document.querySelector(P.selector);pe&&pe.offsetParent!==null?($o(P),le&&setTimeout(()=>{let $=qe.current;!$||$.id!==v.id||$.stepIndex!==_||pe.click()},1e3)):J||re||P.selector.includes("data-testid")?setTimeout(ee,200):($o(P),le&&setTimeout(()=>{let $=qe.current;if(!$||$.id!==v.id||$.stepIndex!==_)return;let ue=document.querySelector(P.selector);ue&&ue.click()},1e3))};ee()},hr)}else Hn();ca(K.id,D.text)}function Zk(){if(!me)return;let v=Yy[me.id];if(!v)return;let L=me.stepIndex-1;if(L>=0){$a({id:me.id,stepIndex:L});let E=v.steps[L];E.navigation&&o&&o(E.navigation.page,E.navigation.subtab),E.cursorTarget?setTimeout(()=>{$o(E.cursorTarget)},500):Hn();let _=k.filter(D=>D.kind!=="guideStep"&&D.kind!=="guideComplete");I([..._,{id:Date.now(),role:"assistant",kind:"guideStep",content:E.text}])}}if(!e)return(0,p.jsx)("div",{className:"fixed bottom-6 left-1/2 -translate-x-1/2 z-50",children:(0,p.jsx)("div",{className:`flex items-center gap-3 rounded-2xl bg-white border border-gray-200 shadow-lg px-4 py-2 hover:shadow-xl transition-all duration-300 ease-out focus-within:border-gray-700 ${cv?"w-[480px]":"w-[320px]"}`,children:cv?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("textarea",{ref:dv,value:zn,onChange:v=>{qu(v.target.value),v.target.style.height="auto",v.target.style.height=Math.min(v.target.scrollHeight,120)+"px"},onKeyDown:v=>{v.key==="Enter"&&!v.shiftKey&&zn.trim()?(v.preventDefault(),r?.(),$i(zn.trim()),qu(""),qi(!1),v.currentTarget.style.height="auto"):v.key==="Escape"&&(qi(!1),qu(""))},onBlur:()=>{zn.trim()||setTimeout(()=>qi(!1),200)},placeholder:"Ask a question...",rows:1,className:"flex-1 text-sm text-gray-700 outline-none bg-transparent resize-none min-h-[20px] max-h-[120px]"}),(0,p.jsxs)("div",{className:"flex items-center gap-2",children:[(0,p.jsx)("span",{className:"text-xs text-gray-400 font-medium",children:"\u21B5 Enter"}),(0,p.jsx)("button",{onClick:()=>{r?.(),zn.trim()&&R(zn),qu(""),qi(!1)},className:"h-7 w-7 rounded-lg bg-gray-100 hover:bg-gray-200 flex items-center justify-center transition-colors cursor-pointer",children:(0,p.jsx)(sr,{className:"h-3.5 w-3.5 text-black",fill:"currentColor"})})]})]}):(0,p.jsxs)("div",{className:"flex items-center gap-3 w-full",children:[(0,p.jsxs)("button",{onClick:()=>{qi(!0),setTimeout(()=>dv.current?.focus(),100)},className:"flex items-center gap-3 flex-1 group",children:[(0,p.jsx)("span",{className:"text-sm text-gray-500 flex-1 text-left",children:"Ask a question..."}),(0,p.jsx)("span",{className:"text-xs text-gray-400 font-medium",children:"\u2318I"})]}),(0,p.jsx)("button",{onClick:()=>{r?.()},className:"h-7 w-7 rounded-lg bg-gray-100 hover:bg-gray-200 flex items-center justify-center transition-colors",children:(0,p.jsx)(sr,{className:"h-3.5 w-3.5 text-black",fill:"currentColor"})})]})})});if(Rt.status==="loading")return(0,p.jsxs)("section",{className:`fixed bottom-4 z-40 flex flex-col bg-white border border-gray-200 rounded-2xl overflow-hidden shadow-2xl ${F==="bottom-left"?"left-4":"right-4"} ${e?"opacity-100 scale-100":"opacity-0 scale-95 pointer-events-none"}`,style:{width:`${Cp}px`,height:`${bp}px`},children:[(0,p.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-100 bg-gradient-to-r from-gray-50 to-white shrink-0",children:[(0,p.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,p.jsx)(sr,{className:"h-3.5 w-3.5 text-black",fill:"currentColor"}),(0,p.jsx)("h3",{className:"text-sm font-semibold text-gray-800",children:"Copilot"})]}),(0,p.jsx)(dt,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-full",onClick:()=>t?.(),children:(0,p.jsx)(Fr,{className:"h-4 w-4"})})]}),(0,p.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,p.jsxs)("div",{className:"text-center",children:[(0,p.jsx)(Pt,{className:"h-8 w-8 animate-spin text-gray-400 mx-auto mb-3"}),(0,p.jsx)("p",{className:"text-sm text-gray-500",children:"Loading..."})]})})]});if(Ft){if(je.status==="loading")return(0,p.jsxs)("section",{className:`fixed bottom-4 z-40 flex flex-col bg-white border border-gray-200 rounded-2xl overflow-hidden shadow-2xl ${F==="bottom-left"?"left-4":"right-4"} ${e?"opacity-100 scale-100":"opacity-0 scale-95 pointer-events-none"}`,style:{width:`${Cp}px`,height:`${bp}px`},children:[(0,p.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-100 bg-gradient-to-r from-gray-50 to-white shrink-0",children:[(0,p.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,p.jsx)(sr,{className:"h-3.5 w-3.5 text-black",fill:"currentColor"}),(0,p.jsx)("h3",{className:"text-sm font-semibold text-gray-800",children:"Copilot"})]}),(0,p.jsx)(dt,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-full",onClick:()=>t?.(),children:(0,p.jsx)(kn,{className:"h-3.5 w-3.5"})})]}),(0,p.jsx)(AN,{})]});if(je.status==="error")return(0,p.jsxs)("section",{className:`fixed bottom-4 z-40 flex flex-col bg-white border border-gray-200 rounded-2xl overflow-hidden shadow-2xl ${F==="bottom-left"?"left-4":"right-4"} ${e?"opacity-100 scale-100":"opacity-0 scale-95 pointer-events-none"}`,style:{width:`${Cp}px`,height:`${bp}px`},children:[(0,p.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-100 bg-gradient-to-r from-gray-50 to-white shrink-0",children:[(0,p.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,p.jsx)(sr,{className:"h-3.5 w-3.5 text-black",fill:"currentColor"}),(0,p.jsx)("h3",{className:"text-sm font-semibold text-gray-800",children:"Copilot"})]}),(0,p.jsx)(dt,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-full",onClick:()=>t?.(),children:(0,p.jsx)(kn,{className:"h-3.5 w-3.5"})})]}),(0,p.jsx)(RN,{error:je.error,onRetry:Mk})]})}return(0,p.jsxs)(Nu.section,{drag:!0,dragControls:Uo,dragListener:!1,dragMomentum:!1,dragElastic:0,onDragStart:()=>de(!0),onDragEnd:ia,className:`fixed bottom-4 z-40 flex flex-col bg-white border border-gray-200 rounded-2xl overflow-hidden shadow-2xl ${ye?"cursor-grabbing":""} ${F==="bottom-left"?"left-4":"right-4"} ${e?"opacity-100 scale-100":"opacity-0 scale-95 pointer-events-none"}`,style:{width:`${Cp}px`,height:`${bp}px`},children:[(0,p.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-100 bg-gradient-to-r from-gray-50 to-white shrink-0 cursor-grab active:cursor-grabbing",onPointerDown:v=>Uo.start(v),children:[(0,p.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,p.jsx)(sr,{className:"h-3.5 w-3.5 text-black",fill:"currentColor"}),(0,p.jsx)("h3",{className:"text-sm font-semibold text-gray-800",children:"Copilot"})]}),(0,p.jsxs)("div",{className:"flex items-center gap-1",children:[(0,p.jsx)(dt,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-full",onClick:()=>{I([]),Tp(),qo(void 0),$a(void 0),qe.current=void 0,Fi(!1)},children:(0,p.jsx)(Wt,{className:"h-3 w-3"})}),(0,p.jsx)(dt,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-full",onClick:()=>{ve&&(Tp(),I([]),$n("landing"),qo(void 0),$a(void 0),qe.current=void 0,Fi(!1)),t?.()},children:(0,p.jsx)(kn,{className:"h-3.5 w-3.5"})})]})]}),(0,p.jsxs)("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden relative select-text",children:[(0,p.jsx)("div",{className:`absolute inset-0 grid place-items-center overflow-y-auto ${ev?"visible":"invisible pointer-events-none"}`,children:(0,p.jsxs)("div",{className:"w-full px-4",children:[(0,p.jsx)("div",{className:"py-3",children:(0,p.jsx)("h2",{className:"text-center text-2xl font-semibold text-gray-900",children:_p==="folder"?Rk.find(v=>v.id===tv)?.title||"":"How can I help?"})}),(0,p.jsxs)("div",{className:"pb-4 px-4",children:[_p==="landing"&&(0,p.jsx)(p.Fragment,{children:(0,p.jsx)("div",{className:"flex flex-col gap-1",children:jk?(0,p.jsx)("div",{className:"flex items-center justify-center py-4",children:(0,p.jsx)(Pt,{className:"h-4 w-4 animate-spin text-gray-400"})}):Vk.map((v,L)=>{let E=["bg-blue-400","bg-green-400","bg-purple-400","bg-orange-400","bg-pink-400"];return(0,p.jsxs)(dt,{type:"button",size:"sm",variant:"ghost",className:"w-full justify-start rounded-lg px-3 py-1.5 text-xs text-gray-700 hover:bg-gray-100 h-auto",onClick:()=>gv(v.prompt),children:[(0,p.jsx)("span",{className:`mr-2 inline-block h-1.5 w-1.5 rounded-full ${E[L%E.length]}`}),v.label]},v.id)})})}),_p==="folder"&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,p.jsx)(dt,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 rounded-full hover:bg-gray-100",onClick:Gk,"aria-label":"Back to suggestions",children:(0,p.jsx)(Us,{className:"h-4 w-4 text-gray-500"})}),(0,p.jsx)("span",{className:"text-xs font-medium uppercase tracking-wide text-gray-400",children:"Topics"})]}),(0,p.jsx)("div",{className:"flex flex-col gap-1.5",children:Rk.find(v=>v.id===tv)?.topics.map(v=>(0,p.jsx)(dt,{type:"button",size:"sm",variant:"secondary",className:"justify-start rounded-xl border border-gray-200 bg-gray-50 px-3 py-2.5 text-xs text-gray-700 shadow-none transition-all hover:bg-gray-100 hover:border-gray-300 h-auto",onClick:()=>gv(v.prompt),children:v.label},v.id))})]})]})]})}),(0,p.jsx)("div",{className:`flex-1 flex flex-col min-h-0 overflow-hidden ${ev?"invisible pointer-events-none":"visible"}`,children:(0,p.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:(0,p.jsx)(zg,{ref:Ep,className:"h-full",children:(0,p.jsxs)("div",{className:"flex flex-col gap-2 px-4 py-3",children:[k.map((v,L)=>{let E=v.role==="user",_=L>0?k[L-1].role:void 0,D=_!==void 0&&_!==v.role,G=qe.current||me,K=!1;if(G&&v.kind==="guideStep"?v.guideStepIndex!==void 0?K=v.guideStepIndex===G.stepIndex:K=L===k.length-1:v.kind==="guideComplete"&&(K=L===k.length-1),v.kind==="guideStep"&&!K)return null;if(E)return(0,p.jsxs)("div",{className:`flex flex-col items-end gap-2 ${D?"mt-3":""}`,children:[v.imageUrls&&v.imageUrls.length>0&&(0,p.jsx)("div",{className:"flex flex-wrap gap-1 justify-end max-w-[260px]",children:v.imageUrls.map((T,M)=>(0,p.jsx)("button",{onClick:()=>Bp(T),className:"block cursor-pointer",children:(0,p.jsx)("img",{src:T,alt:`Attachment ${M+1}`,className:"max-h-32 max-w-[200px] rounded-lg object-cover border border-gray-700 hover:opacity-90 transition-opacity"})},M))}),v.content&&!v.content.match(/^!\[image\]\([^)]+\)(\n!\[image\]\([^)]+\))*$/)&&(0,p.jsx)("div",{className:"max-w-[260px] rounded-2xl rounded-br-md bg-gray-900 px-3 py-2 text-sm text-white shadow-sm",children:v.content.replace(/!\[image\]\([^)]+\)\n*/g,"").trim()})]},v.id);if(v.role==="agent"){let T=/!\[image\]\(([^)]+)\)/g,M=[],P,J=v.content||"";for(;(P=T.exec(J))!==null;)M.push(P[1]);let re=v.imageUrls||M,Z=J.replace(/!\[image\]\([^)]+\)\n*/g,"").trim();return(0,p.jsxs)("div",{className:`flex flex-col items-start ${D?"mt-2":""}`,children:[D&&(0,p.jsx)("span",{className:"text-[10px] text-gray-500 mb-0.5 ml-1",children:"Agent"}),re.length>0&&(0,p.jsx)("div",{className:"flex flex-wrap gap-1 justify-start max-w-[300px]",children:re.map((le,Pe)=>(0,p.jsx)("button",{onClick:()=>Bp(le),className:"block cursor-pointer",children:(0,p.jsx)("img",{src:le,alt:`Attachment ${Pe+1}`,className:"max-h-32 max-w-[200px] rounded-lg object-cover border border-gray-300 hover:opacity-90 transition-opacity"})},Pe))}),Z&&(0,p.jsx)("div",{className:"max-w-[300px] rounded-2xl rounded-bl-md bg-gray-100 px-4 py-3 text-sm text-gray-700",children:Z})]},v.id)}if(v.kind==="searchSummary")return(0,p.jsx)("div",{className:`${D?"mt-3":""}`,children:(0,p.jsx)(Ck,{title:v.title??"Search results",links:v.links??[]})},v.id);if(v.kind==="guideComplete")return(0,p.jsx)("div",{ref:K?Vu:null,className:`${D?"mt-3":""}`,children:(0,p.jsxs)("div",{className:"flex items-center gap-2 rounded-xl bg-green-50 border border-green-200 px-3 py-2.5 text-sm leading-6",children:[(0,p.jsx)(ft,{className:"h-5 w-5 text-green-600 flex-shrink-0"}),(0,p.jsx)("span",{className:"font-medium text-green-800",children:v.content})]})},v.id);if(v.kind==="navigationAction")return(0,p.jsxs)("div",{className:`${D?"mt-3":""}`,children:[(0,p.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-6 mb-2 text-gray-700",children:v.content||""}),v.navigationTarget&&(0,p.jsx)("div",{className:"mt-2",children:(0,p.jsxs)(dt,{type:"button",size:"sm",variant:"secondary",className:"h-8 rounded-xl px-3 text-xs gap-1.5 bg-gray-100 hover:bg-gray-200 border border-gray-200",onClick:()=>v.navigationTarget&&Up(v.navigationTarget),children:[(0,p.jsx)("span",{children:"Confirm"}),(0,p.jsxs)("span",{className:"flex items-center gap-0.5 text-gray-400",children:[(0,p.jsx)(Aa,{className:"h-3 w-3"}),(0,p.jsx)(Ra,{className:"h-3 w-3"})]})]})})]},v.id);if(v.kind==="actionForm"){let T=v.actionType,M=Object.keys(ne).length>0?ne:v.actionData||{};if(v.isSubmitted){let P="";return T==="updateCompanyInfo"?P="Company information has been updated successfully.":T==="addApiKey"?P="API key has been added successfully.":T==="addCustomer"?P="Customer has been added successfully.":T==="enable2FA"?P="Two-factor authentication has been enabled successfully.":T==="disable2FA"?P="Two-factor authentication has been disabled successfully.":T==="changePassword"?P="Your password has been changed successfully.":T==="revokeSession"?P="Session has been revoked successfully.":T==="toggleNotification"?P="Notification preferences have been updated successfully.":T==="connectIntegration"?P="Integration has been connected successfully.":T==="disconnectIntegration"?P="Integration has been disconnected successfully.":T==="addPaymentMethod"?P="Payment method has been added successfully.":T==="removePaymentMethod"?P="Payment method has been removed successfully.":T==="deleteApiKey"?P="API key has been deleted successfully.":T==="addWebhook"?P="Webhook endpoint has been added successfully.":T==="updateCurrency"?P="Currency preference has been updated successfully.":T==="updateTimezone"?P="Timezone has been updated successfully.":T==="refundPayment"?P="Refund has been processed successfully.":T==="exportCertificate"?P="Certificate of Incorporation has been downloaded successfully.":T==="createSubscription"?P="Subscription has been created successfully.":T==="toggleBlockRule"||T==="enableBlockRule"||T==="disableBlockRule"?P="Block rule has been updated successfully.":P="Action completed successfully.",(0,p.jsx)("div",{className:`${D?"mt-3":""}`,children:(0,p.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-6 text-gray-700",children:P})},v.id)}return(0,p.jsxs)("div",{className:`min-w-0 ${D?"mt-3":""}`,children:[(0,p.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-6 mb-3 text-gray-700",children:v.content||""}),T==="updateCompanyInfo"&&(0,p.jsxs)("div",{className:"space-y-2 bg-gray-50 rounded-lg p-2 border border-gray-200 overflow-hidden",children:[(0,p.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Company Name"}),(0,p.jsx)(Ve,{placeholder:"Acme Corporation",value:M.companyName||"",onChange:P=>se({...ne,companyName:P.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Email"}),(0,p.jsx)(Ve,{type:"email",placeholder:"contact@acme.com",value:M.email||"",onChange:P=>se({...ne,email:P.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Address"}),(0,p.jsx)(Ve,{placeholder:"123 Main St, San Francisco, CA",value:M.address||"",onChange:P=>se({...ne,address:P.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Phone"}),(0,p.jsx)(Ve,{type:"tel",placeholder:"+1 (555) 123-4567",value:M.phone||"",onChange:P=>se({...ne,phone:P.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Website"}),(0,p.jsx)(Ve,{type:"url",placeholder:"https://acme.com",value:M.website||"",onChange:P=>se({...ne,website:P.target.value}),className:"h-8 text-xs border-gray-200"})]})]})]}),T==="addApiKey"&&(0,p.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"API Key Name"}),(0,p.jsx)(Ve,{placeholder:"Production Key",value:M.name||"",onChange:P=>se({...ne,name:P.target.value}),className:"h-8 text-xs border-gray-200"})]})}),T==="addCustomer"&&(0,p.jsxs)("div",{className:"space-y-2 bg-gray-50 rounded-lg p-2 border border-gray-200 overflow-hidden",children:[(0,p.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Company Name"}),(0,p.jsx)(Ve,{placeholder:"Acme Corporation",value:M.name||"",onChange:P=>se({...ne,name:P.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Email"}),(0,p.jsx)(Ve,{type:"email",placeholder:"contact@acme.com",value:M.email||"",onChange:P=>se({...ne,email:P.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Location"}),(0,p.jsx)(Ve,{placeholder:"San Francisco, CA",value:M.location||"",onChange:P=>se({...ne,location:P.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Subscription Tier"}),(0,p.jsxs)("select",{value:M.subscription||"Starter",onChange:P=>se({...ne,subscription:P.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,p.jsx)("option",{value:"Starter",children:"Starter"}),(0,p.jsx)("option",{value:"Professional",children:"Professional"}),(0,p.jsx)("option",{value:"Enterprise",children:"Enterprise"})]})]})]}),(T==="enable2FA"||T==="disable2FA")&&(0,p.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,p.jsx)("p",{className:"text-xs text-black",children:T==="enable2FA"?"This will enable two-factor authentication for your account. You'll need to set up an authenticator app.":"This will disable two-factor authentication for your account. Your account will be less secure."})}),T==="changePassword"&&(0,p.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Current Password"}),(0,p.jsx)(Ve,{type:"password",value:M.currentPassword||"",onChange:P=>se({...ne,currentPassword:P.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"New Password"}),(0,p.jsx)(Ve,{type:"password",value:M.newPassword||"",onChange:P=>se({...ne,newPassword:P.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Confirm New Password"}),(0,p.jsx)(Ve,{type:"password",value:M.confirmPassword||"",onChange:P=>se({...ne,confirmPassword:P.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),T==="toggleNotification"&&(0,p.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Notification Type"}),(0,p.jsxs)("select",{value:M.notificationType||"paymentReceived",onChange:P=>se({...ne,notificationType:P.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,p.jsx)("option",{value:"paymentReceived",children:"Payment Received"}),(0,p.jsx)("option",{value:"paymentFailed",children:"Payment Failed"}),(0,p.jsx)("option",{value:"invoicePaid",children:"Invoice Paid"}),(0,p.jsx)("option",{value:"monthlySummary",children:"Monthly Summary"}),(0,p.jsx)("option",{value:"productUpdates",children:"Product Updates"})]})]}),(0,p.jsxs)("div",{className:"flex items-center gap-2",children:[(0,p.jsx)("input",{type:"checkbox",checked:M.enabled!==!1,onChange:P=>se({...ne,enabled:P.target.checked}),className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"}),(0,p.jsx)("label",{className:"text-xs text-black",children:"Enable this notification"})]})]}),(T==="connectIntegration"||T==="disconnectIntegration")&&(0,p.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Integration"}),(0,p.jsxs)("select",{value:M.integrationName||"Slack",onChange:P=>se({...ne,integrationName:P.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,p.jsx)("option",{value:"Slack",children:"Slack"}),(0,p.jsx)("option",{value:"Zapier",children:"Zapier"}),(0,p.jsx)("option",{value:"Webhook",children:"Webhook"})]})]})}),T==="addPaymentMethod"&&(0,p.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Card Number"}),(0,p.jsx)(Ve,{placeholder:"1234 5678 9012 3456",value:M.cardNumber||"",onChange:P=>se({...ne,cardNumber:P.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Expiry Date"}),(0,p.jsx)(Ve,{placeholder:"MM/YY",value:M.expiryDate||"",onChange:P=>se({...ne,expiryDate:P.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),T==="removePaymentMethod"&&(0,p.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,p.jsx)("p",{className:"text-xs text-black",children:"This will remove the default payment method from your account."})}),T==="refundPayment"&&(0,p.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Transaction ID or Customer Name"}),(0,p.jsx)(Ve,{placeholder:"e.g., txn_1234 or Acme Corp",value:M.transactionId||M.customer||"",onChange:P=>{let J=P.target.value;J.startsWith("txn_")||/^\d+$/.test(J)?se({...ne,transactionId:J,customer:void 0}):se({...ne,customer:J,transactionId:void 0})},className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Amount (optional)"}),(0,p.jsx)(Ve,{placeholder:"$0.00",value:M.amount||"",onChange:P=>se({...ne,amount:P.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Reason (optional)"}),(0,p.jsx)(Ve,{placeholder:"e.g., Customer request",value:M.reason||"",onChange:P=>se({...ne,reason:P.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),T==="deleteApiKey"&&(0,p.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"API Key Name or ID"}),(0,p.jsx)(Ve,{placeholder:"Production Key",value:M.keyId||M.name||"",onChange:P=>se({...ne,keyId:P.target.value,name:P.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsx)("p",{className:"text-xs text-red-600",children:"Warning: This action cannot be undone. The API key will be permanently deleted."})]}),T==="addWebhook"&&(0,p.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Webhook URL"}),(0,p.jsx)(Ve,{type:"url",placeholder:"https://example.com/webhook",value:M.url||"",onChange:P=>se({...ne,url:P.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Name (optional)"}),(0,p.jsx)(Ve,{placeholder:"Production Webhook",value:M.name||"",onChange:P=>se({...ne,name:P.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),T==="updateCurrency"&&(0,p.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Currency"}),(0,p.jsxs)("select",{value:M.currency||"USD",onChange:P=>se({...ne,currency:P.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,p.jsx)("option",{value:"USD",children:"USD ($)"}),(0,p.jsx)("option",{value:"EUR",children:"EUR (\u20AC)"}),(0,p.jsx)("option",{value:"GBP",children:"GBP (\xA3)"}),(0,p.jsx)("option",{value:"JPY",children:"JPY (\xA5)"})]})]})}),T==="updateTimezone"&&(0,p.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Timezone"}),(0,p.jsxs)("select",{value:M.timezone||"America/Los_Angeles",onChange:P=>se({...ne,timezone:P.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,p.jsx)("option",{value:"America/Los_Angeles",children:"Pacific Time (PT)"}),(0,p.jsx)("option",{value:"America/New_York",children:"Eastern Time (ET)"}),(0,p.jsx)("option",{value:"Europe/London",children:"GMT"}),(0,p.jsx)("option",{value:"Asia/Tokyo",children:"JST"})]})]})}),T==="revokeSession"&&(0,p.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Device/Session"}),(0,p.jsx)(Ve,{placeholder:"MacBook Pro",value:M.device||"",onChange:P=>se({...ne,device:P.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsx)("p",{className:"text-xs text-black",children:"This will sign out the device and invalidate its session."})]}),T==="createSubscription"&&(0,p.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Customer Email"}),(0,p.jsx)(Ve,{type:"email",placeholder:"customer@example.com",value:M.customerEmail||"",onChange:P=>se({...ne,customerEmail:P.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Plan"}),(0,p.jsxs)("select",{value:M.plan||"Starter",onChange:P=>se({...ne,plan:P.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,p.jsx)("option",{value:"Starter",children:"Starter ($29/mo)"}),(0,p.jsx)("option",{value:"Professional",children:"Professional ($99/mo)"}),(0,p.jsx)("option",{value:"Enterprise",children:"Enterprise ($299/mo)"})]})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Billing Cycle"}),(0,p.jsxs)("select",{value:M.billingCycle||"monthly",onChange:P=>se({...ne,billingCycle:P.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,p.jsx)("option",{value:"monthly",children:"Monthly"}),(0,p.jsx)("option",{value:"yearly",children:"Yearly (Save 15%)"})]})]})]}),T==="exportCertificate"&&(0,p.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,p.jsx)("p",{className:"text-xs text-black",children:"This will export your certificate of incorporation document."}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Format"}),(0,p.jsxs)("select",{value:M.format||"pdf",onChange:P=>se({...ne,format:P.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,p.jsx)("option",{value:"pdf",children:"PDF"}),(0,p.jsx)("option",{value:"json",children:"JSON"})]})]})]}),(T==="toggleBlockRule"||T==="enableBlockRule"||T==="disableBlockRule")&&(0,p.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Block Rule"}),(0,p.jsxs)("select",{value:M.ruleId||"rule_1",onChange:P=>se({...ne,ruleId:P.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,p.jsx)("option",{value:"rule_1",children:"Block if risk level = 'highest'"}),(0,p.jsx)("option",{value:"rule_2",children:"Block if matches Stripe block lists"}),(0,p.jsx)("option",{value:"rule_3",children:"Block if CVC verification fails"}),(0,p.jsx)("option",{value:"rule_4",children:"Block if Postal code verification fails"})]})]}),(0,p.jsx)("p",{className:"text-xs text-black",children:T==="enableBlockRule"?"This will enable the selected block rule to actively block matching payments.":T==="disableBlockRule"?"This will disable the selected block rule. Matching payments will no longer be blocked.":"This will toggle the selected block rule's state."})]}),(0,p.jsx)("div",{className:"mt-3",children:(0,p.jsxs)(dt,{type:"button",size:"sm",variant:"secondary",className:"h-8 rounded-xl px-3 text-xs gap-1.5 bg-gray-100 hover:bg-gray-200 border border-gray-200",onClick:Vp,children:[(0,p.jsx)("span",{children:"Confirm"}),(0,p.jsxs)("span",{className:"flex items-center gap-0.5 text-gray-400",children:[(0,p.jsx)(Aa,{className:"h-3 w-3"}),(0,p.jsx)(Ra,{className:"h-3 w-3"})]})]})})]},v.id)}if(v.kind==="bulkPreview"&&v.csvData)return(0,p.jsxs)("div",{className:`${D?"mt-3":""}`,children:[(0,p.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-6 mb-3 text-gray-700",children:v.content||""}),(0,p.jsxs)("div",{className:"bg-gray-50 rounded-lg border border-gray-200 overflow-hidden",children:[(0,p.jsxs)("div",{className:"bg-gray-100 px-3 py-2 border-b border-gray-200 flex items-center gap-2",children:[(0,p.jsx)(In,{className:"h-4 w-4 text-gray-600"}),(0,p.jsx)("span",{className:"text-xs font-medium text-gray-700",children:v.csvData.fileName}),(0,p.jsxs)("span",{className:"text-xs text-gray-500",children:["\u2022 ",v.csvData.rowCount," rows"]})]}),(0,p.jsxs)("div",{className:"px-3 py-2 border-b border-gray-100",children:[(0,p.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-gray-500 mb-1",children:"Columns"}),(0,p.jsx)("div",{className:"flex flex-wrap gap-1",children:v.csvData.columns.map((T,M)=>(0,p.jsx)("span",{className:"text-xs bg-blue-100 text-blue-700 px-1.5 py-0.5 rounded",children:T},M))})]}),v.csvData.sampleRows.length>0&&(0,p.jsxs)("div",{className:"px-3 py-2",children:[(0,p.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-gray-500 mb-1",children:"Sample Data"}),(0,p.jsx)("div",{className:"space-y-1",children:v.csvData.sampleRows.slice(0,3).map((T,M)=>(0,p.jsxs)("div",{className:"text-xs text-gray-600 bg-white rounded px-2 py-1 border border-gray-100",children:[Object.entries(T).slice(0,3).map(([P,J],re)=>(0,p.jsxs)("span",{children:[re>0&&" \u2022 ",(0,p.jsxs)("span",{className:"text-gray-400",children:[P,":"]})," ",J]},P)),Object.keys(T).length>3&&(0,p.jsxs)("span",{className:"text-gray-400",children:[" ","..."]})]},M))})]}),v.suggestedAction&&(0,p.jsx)("div",{className:"px-3 py-2 bg-blue-50 border-t border-blue-100",children:(0,p.jsxs)("span",{className:"text-xs text-blue-700",children:["Suggested action:"," ",(0,p.jsx)("strong",{children:v.suggestedAction.replace(/_/g," ")})]})})]}),v.bulkSessionId&&(0,p.jsxs)("div",{className:"mt-3 flex items-center gap-2",children:[(0,p.jsxs)(dt,{type:"button",size:"sm",variant:"secondary",className:"h-8 rounded-xl px-3 text-xs gap-1.5 bg-gray-100 hover:bg-gray-200 border border-gray-200",onClick:()=>v.bulkSessionId&&jp(v.bulkSessionId),children:[(0,p.jsxs)("span",{children:["Process ",v.csvData.rowCount," rows"]}),(0,p.jsxs)("span",{className:"flex items-center gap-0.5 text-gray-400",children:[(0,p.jsx)(Aa,{className:"h-3 w-3"}),(0,p.jsx)(Ra,{className:"h-3 w-3"})]})]}),(0,p.jsx)(dt,{type:"button",size:"sm",variant:"ghost",className:"h-8 rounded-xl px-3 text-xs text-gray-500 hover:text-gray-700 hover:bg-gray-100",onClick:Qk,children:"Cancel"})]})]},v.id);if(v.kind==="bulkProgress"&&v.bulkProgress){let{processed:T,total:M,successes:P,failures:J}=v.bulkProgress,re=Math.round(T/M*100);return(0,p.jsx)("div",{className:`${D?"mt-3":""}`,children:(0,p.jsxs)("div",{className:"bg-gray-50 rounded-lg border border-gray-200 p-3",children:[(0,p.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,p.jsx)(Pt,{className:"h-4 w-4 animate-spin text-blue-600"}),(0,p.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["Processing... ",T," of ",M]})]}),(0,p.jsx)("div",{className:"h-2 bg-gray-200 rounded-full overflow-hidden mb-2",children:(0,p.jsx)("div",{className:"h-full bg-blue-600 transition-all duration-300",style:{width:`${re}%`}})}),(0,p.jsxs)("div",{className:"flex items-center gap-3 text-xs text-gray-600",children:[(0,p.jsxs)("span",{className:"flex items-center gap-1",children:[(0,p.jsx)(ft,{className:"h-3 w-3 text-green-600"}),P," successful"]}),J>0&&(0,p.jsxs)("span",{className:"flex items-center gap-1 text-red-600",children:[(0,p.jsx)(Fr,{className:"h-3 w-3"}),J," failed"]})]})]})},v.id)}if(v.kind==="bulkSummary"&&v.bulkSummary){let{total:T,successes:M,failures:P,navigationPage:J}=v.bulkSummary,re=P.length>0,Z=J?.page==="customers"?"Customers":J?.page==="dashboard"?"Dashboard":J?.page==="settings"?"Settings":"Results";return(0,p.jsx)("div",{className:`${D?"mt-3":""}`,children:(0,p.jsxs)("div",{className:`rounded-lg border p-3 ${re?"bg-amber-50 border-amber-200":"bg-green-50 border-green-200"}`,children:[(0,p.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,p.jsx)(ft,{className:`h-5 w-5 ${re?"text-amber-600":"text-green-600"}`}),(0,p.jsx)("span",{className:"text-sm font-medium text-gray-800",children:"Bulk operation complete"})]}),(0,p.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:v.content||`Processed ${T} rows: ${M} successful${re?`, ${P.length} failed`:""}.`}),(0,p.jsxs)("div",{className:"flex items-center gap-4 text-xs",children:[(0,p.jsxs)("span",{className:"flex items-center gap-1 text-green-700",children:[(0,p.jsx)(ft,{className:"h-3 w-3"}),M," successful"]}),re&&(0,p.jsxs)("span",{className:"flex items-center gap-1 text-red-600",children:[(0,p.jsx)(Fr,{className:"h-3 w-3"}),P.length," failed"]})]}),re&&(0,p.jsxs)("div",{className:"mt-3 pt-2 border-t border-amber-200",children:[(0,p.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-amber-700 mb-1",children:"Failed Rows"}),(0,p.jsxs)("div",{className:"space-y-1 max-h-32 overflow-y-auto",children:[P.slice(0,5).map((le,Pe)=>(0,p.jsxs)("div",{className:"text-xs text-red-700 bg-red-50 rounded px-2 py-1",children:["Row ",le.row,":"," ",le.error||"Unknown error"]},Pe)),P.length>5&&(0,p.jsxs)("div",{className:"text-xs text-amber-600",children:["...and ",P.length-5," more"]})]})]}),J&&M>0&&(0,p.jsx)("div",{className:"mt-3 pt-2 border-t border-gray-200",children:(0,p.jsxs)("button",{type:"button",onClick:le=>{le.preventDefault(),le.stopPropagation(),o&&J.page&&o(J.page,J.subtab)},className:"flex items-center gap-2 text-xs text-gray-500 hover:text-gray-700 transition-colors group cursor-pointer",children:[(0,p.jsxs)("span",{className:"flex items-center gap-1 px-1.5 py-0.5 bg-gray-100 rounded text-[10px] font-medium text-gray-600 group-hover:bg-gray-200",children:[(0,p.jsx)(Aa,{className:"h-2.5 w-2.5"}),(0,p.jsx)("span",{children:"+"}),(0,p.jsx)(Ra,{className:"h-2.5 w-2.5"})]}),(0,p.jsxs)("span",{children:["View ",Z]})]})})]})},v.id)}return(0,p.jsx)(O.Fragment,{children:(0,p.jsxs)("div",{ref:K?Vu:null,className:`${D?"mt-3":""}`,children:[(0,p.jsx)("div",{className:"text-sm leading-6 text-gray-700",children:(()=>{let T=v.content||"";if(v.kind==="guideStep"){let M=T.match(/^(Step\s+\d+:)([\s\S]*)/);if(M)return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("strong",{children:M[1]}),M[2]]})}return v.role==="assistant"&&T?PN(T):T||(0,p.jsx)("span",{className:"opacity-70",children:"Thinking\u2026"})})()}),v.role==="assistant"&&v.structuredData&&(0,p.jsx)("div",{className:"mt-3",children:(0,p.jsx)(_k,{type:v.structuredData.type,data:v.structuredData.data})}),v.role==="assistant"&&v.followups&&v.followups.length>0&&!v.followupSelected&&(0,p.jsx)("div",{className:"mt-3 flex flex-wrap gap-1.5",children:v.followups.map(T=>(0,p.jsx)("button",{type:"button",onClick:()=>Wk(v.id,T),className:`inline-flex items-center px-3 py-1.5 text-xs font-medium rounded-xl
42
77
  bg-white hover:bg-gray-50 text-gray-600 hover:text-gray-800
43
78
  border border-gray-200 hover:border-gray-300 shadow-sm
44
- transition-all duration-150 ease-in-out`,children:T.label},T.id))})]})},y.id)}),(me||Ei)&&(0,p.jsxs)("div",{className:"mt-3 flex items-center gap-2",children:[me&&me.stepIndex>0&&(0,p.jsx)(ot,{type:"button",size:"sm",variant:"secondary",className:"h-7 w-7 rounded-full p-0 bg-gray-100 hover:bg-gray-200 border border-gray-200",onClick:cP,children:(0,p.jsx)(Ds,{className:"h-3.5 w-3.5 text-gray-600"})}),(0,p.jsxs)(ot,{type:"button",size:"sm",variant:"secondary",className:"h-8 rounded-xl px-3 text-xs gap-1.5 bg-gray-100 hover:bg-gray-200 border border-gray-200",onClick:Ei?vx:Kp,children:[(0,p.jsx)("span",{children:Ei?"Done":"Next"}),(0,p.jsxs)("span",{className:"flex items-center gap-0.5 text-gray-400",children:[(0,p.jsx)(Cr,{className:"h-3 w-3"}),(0,p.jsx)(Sr,{className:"h-3 w-3"})]})]})]}),(Nn==="thinking"||Nn==="searching"||Nn==="executing"||Nn==="responding")&&(0,p.jsx)("div",{className:`${Jk==="user"?"mt-3":""}`,children:(0,p.jsx)(Ek,{phase:Nn,progressSteps:Qk})}),Le&&Ep&&(0,p.jsx)("div",{className:"flex items-start mt-2",children:(0,p.jsx)("div",{className:"bg-gray-200 rounded-2xl rounded-bl-md px-4 py-3",children:(0,p.jsx)(qk,{})})}),!me&&(0,p.jsx)("div",{ref:Fp})]})})})})]}),(0,p.jsxs)("div",{className:`px-4 py-3 bg-white shrink-0 ${jp?"ring-2 ring-blue-400 ring-inset bg-blue-50":""}`,onDragOver:tP,onDragLeave:aP,onDrop:rP,children:[or&&(0,p.jsxs)("div",{className:"mb-2 flex items-center gap-2 rounded-xl bg-blue-50 border border-blue-200 px-3 py-2",children:[(0,p.jsx)(xn,{className:"h-4 w-4 text-blue-600"}),(0,p.jsx)("span",{className:"text-xs text-blue-700 flex-1 truncate",children:or.name}),(0,p.jsx)("button",{type:"button",onClick:()=>{Ni(null),Oi.current&&(Oi.current.value="")},className:"text-blue-600 hover:text-blue-800",children:(0,p.jsx)(_a,{className:"h-4 w-4"})})]}),la.length>0&&(0,p.jsxs)("div",{className:"mb-2 flex flex-wrap gap-2",children:[la.map((y,b)=>(0,p.jsxs)("div",{className:"relative group",children:[y.preview?(0,p.jsx)("img",{src:y.preview,alt:`Preview ${b+1}`,className:"h-16 w-16 object-cover rounded-lg border border-gray-200"}):(0,p.jsx)("div",{className:"h-16 w-16 rounded-lg border border-gray-200 bg-gray-100 flex items-center justify-center",children:(0,p.jsx)(xn,{className:"h-6 w-6 text-gray-400"})}),(0,p.jsx)("button",{type:"button",onClick:()=>{y.preview&&URL.revokeObjectURL(y.preview),Vp(E=>E.filter((A,R)=>R!==b))},className:"absolute -top-1 -right-1 h-4 w-4 rounded-full bg-gray-800 text-white flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",children:(0,p.jsx)(_a,{className:"h-2.5 w-2.5"})})]},b)),dx&&(0,p.jsx)("div",{className:"h-16 w-16 rounded-lg border border-gray-200 bg-gray-50 flex items-center justify-center",children:(0,p.jsx)(Ct,{className:"h-5 w-5 animate-spin text-gray-400"})})]}),(0,p.jsxs)("form",{onSubmit:sP,className:"w-full",children:[(0,p.jsx)("input",{ref:Oi,type:"file",accept:".csv",className:"hidden",onChange:y=>{let b=y.target.files?.[0];b&&Ni(b)}}),(0,p.jsx)("input",{ref:fx,type:"file",accept:"image/*,.pdf,.csv",multiple:!0,className:"hidden",onChange:y=>{let b=y.target.files;if(!b||b.length===0)return;let E=Array.from(b).find(A=>A.name.endsWith(".csv"));E&&!Le?Ni(E):zp(b)}}),(0,p.jsxs)("div",{className:`flex w-full items-start gap-2 rounded-xl border bg-white px-3 py-2 shadow-sm ${jp?"border-blue-400":"border-gray-200"}`,children:[(0,p.jsx)(ot,{type:"button",size:"icon",variant:"ghost",onClick:()=>{fx.current?.click()},className:"h-5 w-5 rounded-full text-gray-400 hover:text-gray-600 hover:bg-gray-100",title:"Attach file (image, PDF, or CSV)",disabled:dx,children:(0,p.jsx)(fu,{className:"h-2.5 w-2.5"})}),(0,p.jsx)("textarea",{placeholder:or?"Describe what to do with this CSV...":la.length>0?"Add a message (optional)...":jp?"Drop files here...":"Ask anything...",value:D,onChange:y=>{_(y.target.value),y.target.value.length>0&&Xk()},rows:1,className:"flex-1 border-0 bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0 text-sm placeholder:text-gray-400 resize-none overflow-hidden outline-none",style:{minHeight:"20px",maxHeight:"120px"},onInput:y=>{let b=y.target;b.style.height="auto",b.style.height=Math.min(b.scrollHeight,120)+"px"},onKeyDown:y=>{if(y.key==="Enter"&&!y.shiftKey&&!y.metaKey&&!y.ctrlKey){if(y.preventDefault(),D.trim()||or||la.length>0){let b=y.currentTarget.closest("form");b&&b.requestSubmit()}return}if((y.metaKey||y.ctrlKey)&&y.key==="Enter"){let b=Up.current;if(b){y.preventDefault(),y.stopPropagation(),Gp(b);return}if(et){y.preventDefault(),y.stopPropagation(),Wp();return}if(Mi){y.preventDefault(),y.stopPropagation(),$p(Mi);return}if(Be.current){y.preventDefault(),y.stopPropagation(),Kp();return}}}}),(0,p.jsx)(ot,{type:"submit",size:"icon",disabled:!D.trim()&&!or&&la.length===0||ju,className:"h-6 w-6 rounded-full bg-gray-700 hover:bg-gray-600 disabled:bg-gray-300",onClick:y=>{y.preventDefault();let b=y.currentTarget.closest("form");b&&b.requestSubmit()},children:(0,p.jsx)(iu,{className:"h-2.5 w-2.5 text-white"})})]})]})]}),(0,p.jsx)(Nk,{x:$u.x,y:$u.y,visible:$u.visible,onClick:$u.onClick}),px&&(0,p.jsx)(fM,{imageUrl:px,onClose:()=>Hp(null)})]})}function $k({onNavigate:e,onActionComplete:t,currentPage:a,agentUrl:r,startingQuestions:o,startingQuestionsEndpoint:n,defaultOpen:s=!1,isOpen:i,onOpenChange:l,userId:u,orgId:d,userName:c,userEmail:f,supabaseUrl:m,supabaseAnonKey:v,initialCorner:w,onCornerChange:S,productBackendUrl:h,getAuthHeaders:g,isEval:x}){let[L,I]=O.useState(s),k=i!==void 0?i:L,D=_=>{i===void 0&&I(_),l?.(_)};return(0,p.jsx)(pM,{isOpen:k,onClose:()=>D(!1),onOpen:()=>D(!0),onNavigate:e,onActionComplete:t,currentPage:a,agentUrl:r,startingQuestions:o,startingQuestionsEndpoint:n,userId:u,orgId:d,userName:c,userEmail:f,supabaseUrl:m,supabaseAnonKey:v,initialCorner:w,onCornerChange:S,productBackendUrl:h,getAuthHeaders:g,isEval:x})}var ax=F(le(),1),Ai=null,Da=null,sa={};function mM({initialConfig:e}){let[t,a]=(0,tr.useState)(e),[r,o]=(0,tr.useState)(e.currentPage||"dashboard"),[n,s]=(0,tr.useState)(!1),i=(0,tr.useRef)(!1);return(0,tr.useEffect)(()=>{i.current=n},[n]),(0,tr.useEffect)(()=>(console.log("[KiteChat] Chat panel loaded v0.2.55"),sa.setCurrentPage=o,sa.setConfig=l=>a(u=>({...u,...l})),sa.setIsOpen=s,sa.getIsOpen=()=>i.current,()=>{sa={}}),[]),(0,tr.useEffect)(()=>{t.theme==="dark"?Da?.classList.add("dark"):Da?.classList.remove("dark")},[t.theme]),(0,ax.jsx)($k,{isOpen:n,onOpenChange:s,currentPage:r,agentUrl:t.agentUrl,onNavigate:(l,u)=>t.onNavigate?.(l,u),onActionComplete:t.onActionComplete,startingQuestions:t.startingQuestions,startingQuestionsEndpoint:t.startingQuestionsEndpoint,userId:t.userId,orgId:t.orgId,userName:t.userName,userEmail:t.userEmail,supabaseUrl:t.supabaseUrl,supabaseAnonKey:t.supabaseAnonKey,productBackendUrl:t.productBackendUrl,getAuthHeaders:t.getAuthHeaders,isEval:t.isEval})}function hM(){if(document.getElementById("kite-chat-styles"))return;let e=document.createElement("style");e.id="kite-chat-styles",e.textContent=`/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */
45
- @supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){#kite-chat-root *,#kite-chat-root :before,#kite-chat-root :after,#kite-chat-root ::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-duration:initial;--tw-ease:initial}}:root,#kite-chat-root{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-orange-100:oklch(95.4% .038 75.164);--color-orange-400:oklch(75% .183 55.934);--color-orange-700:oklch(55.3% .195 38.402);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-100:oklch(96.2% .059 95.617);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-amber-700:oklch(55.5% .163 48.998);--color-green-50:oklch(98.2% .018 155.826);--color-green-200:oklch(92.5% .084 155.995);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-green-800:oklch(44.8% .119 151.328);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-100:oklch(95% .052 163.051);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-600:oklch(59.6% .145 163.225);--color-emerald-700:oklch(50.8% .118 165.612);--color-blue-50:oklch(97% .014 254.604);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-200:oklch(88.2% .059 254.128);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--color-purple-50:oklch(97.7% .014 308.299);--color-purple-100:oklch(94.6% .033 307.174);--color-purple-200:oklch(90.2% .063 306.703);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-600:oklch(55.8% .288 302.321);--color-purple-700:oklch(49.6% .265 301.924);--color-pink-400:oklch(71.8% .202 349.761);--color-slate-50:oklch(98.4% .003 247.858);--color-slate-100:oklch(96.8% .007 247.896);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-700:oklch(37.2% .044 257.287);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height:calc(1.5/1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wide:.025em;--tracking-wider:.05em;--radius-2xl:1rem;--ease-out:cubic-bezier(0,0,.2,1);--ease-in-out:cubic-bezier(.4,0,.2,1);--animate-spin:spin 1s linear infinite;--animate-bounce:bounce 1s infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}#kite-chat-root *,#kite-chat-root :after,#kite-chat-root :before,#kite-chat-root ::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}#kite-chat-root ::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}#kite-chat-root,#kite-chat-root{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}#kite-chat-root hr{height:0;color:inherit;border-top-width:1px}#kite-chat-root abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}#kite-chat-root h1,#kite-chat-root h2,#kite-chat-root h3,#kite-chat-root h4,#kite-chat-root h5,#kite-chat-root h6{font-size:inherit;font-weight:inherit}#kite-chat-root a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}#kite-chat-root b,#kite-chat-root strong{font-weight:bolder}#kite-chat-root code,#kite-chat-root kbd,#kite-chat-root samp,#kite-chat-root pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}#kite-chat-root small{font-size:80%}#kite-chat-root sub,#kite-chat-root sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}#kite-chat-root sub{bottom:-.25em}#kite-chat-root sup{top:-.5em}#kite-chat-root table{text-indent:0;border-color:inherit;border-collapse:collapse}#kite-chat-root :-moz-focusring{outline:auto}#kite-chat-root progress{vertical-align:baseline}#kite-chat-root summary{display:list-item}#kite-chat-root ol,#kite-chat-root ul,#kite-chat-root menu{list-style:none}#kite-chat-root img,#kite-chat-root svg,#kite-chat-root video,#kite-chat-root canvas,#kite-chat-root audio,#kite-chat-root iframe,#kite-chat-root embed,#kite-chat-root object{vertical-align:middle;display:block}#kite-chat-root img,#kite-chat-root video{max-width:100%;height:auto}#kite-chat-root button,#kite-chat-root input,#kite-chat-root select,#kite-chat-root optgroup,#kite-chat-root textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}#kite-chat-root ::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}#kite-chat-root :where(select:is([multiple],[size])) optgroup{font-weight:bolder}#kite-chat-root :where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}#kite-chat-root ::file-selector-button{margin-inline-end:4px}#kite-chat-root ::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){#kite-chat-root ::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){#kite-chat-root ::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}#kite-chat-root textarea{resize:vertical}#kite-chat-root ::-webkit-search-decoration{-webkit-appearance:none}#kite-chat-root ::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}#kite-chat-root ::-webkit-datetime-edit{display:inline-flex}#kite-chat-root ::-webkit-datetime-edit-fields-wrapper{padding:0}#kite-chat-root ::-webkit-datetime-edit{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-year-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-month-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-day-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-hour-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-minute-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-second-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-millisecond-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-meridiem-field{padding-block:0}#kite-chat-root ::-webkit-calendar-picker-indicator{line-height:1}#kite-chat-root :-moz-ui-invalid{box-shadow:none}#kite-chat-root button,#kite-chat-root input:where([type=button],[type=reset],[type=submit]){appearance:button}#kite-chat-root ::file-selector-button{appearance:button}#kite-chat-root ::-webkit-inner-spin-button{height:auto}#kite-chat-root ::-webkit-outer-spin-button{height:auto}#kite-chat-root [hidden]:where(:not([hidden=until-found])){display:none!important}#kite-chat-root .\\@container\\/card-header{container:card-header/inline-size}#kite-chat-root .pointer-events-none{pointer-events:none}#kite-chat-root .collapse{visibility:collapse}#kite-chat-root .invisible{visibility:hidden}#kite-chat-root .visible{visibility:visible}#kite-chat-root .absolute{position:absolute}#kite-chat-root .fixed{position:fixed}#kite-chat-root .relative{position:relative}#kite-chat-root .inset-0{inset:calc(var(--spacing)*0)}#kite-chat-root .-top-1{top:calc(var(--spacing)*-1)}#kite-chat-root .top-1\\/2{top:50%}#kite-chat-root .-right-1{right:calc(var(--spacing)*-1)}#kite-chat-root .right-4{right:calc(var(--spacing)*4)}#kite-chat-root .bottom-4{bottom:calc(var(--spacing)*4)}#kite-chat-root .bottom-6{bottom:calc(var(--spacing)*6)}#kite-chat-root .left-1\\/2{left:50%}#kite-chat-root .left-4{left:calc(var(--spacing)*4)}#kite-chat-root .z-40{z-index:40}#kite-chat-root .z-50{z-index:50}#kite-chat-root .z-\\[9999\\]{z-index:9999}#kite-chat-root .col-start-2{grid-column-start:2}#kite-chat-root .row-span-2{grid-row:span 2/span 2}#kite-chat-root .row-start-1{grid-row-start:1}#kite-chat-root .container{width:100%}@media (min-width:40rem){#kite-chat-root .container{max-width:40rem}}@media (min-width:48rem){#kite-chat-root .container{max-width:48rem}}@media (min-width:64rem){#kite-chat-root .container{max-width:64rem}}@media (min-width:80rem){#kite-chat-root .container{max-width:80rem}}@media (min-width:96rem){#kite-chat-root .container{max-width:96rem}}#kite-chat-root .mx-auto{margin-inline:auto}#kite-chat-root .my-1{margin-block:calc(var(--spacing)*1)}#kite-chat-root .my-2{margin-block:calc(var(--spacing)*2)}#kite-chat-root .mt-1{margin-top:calc(var(--spacing)*1)}#kite-chat-root .mt-2{margin-top:calc(var(--spacing)*2)}#kite-chat-root .mt-3{margin-top:calc(var(--spacing)*3)}#kite-chat-root .mr-2{margin-right:calc(var(--spacing)*2)}#kite-chat-root .mb-1{margin-bottom:calc(var(--spacing)*1)}#kite-chat-root .mb-1\\.5{margin-bottom:calc(var(--spacing)*1.5)}#kite-chat-root .mb-2{margin-bottom:calc(var(--spacing)*2)}#kite-chat-root .mb-3{margin-bottom:calc(var(--spacing)*3)}#kite-chat-root .mb-4{margin-bottom:calc(var(--spacing)*4)}#kite-chat-root .ml-1{margin-left:calc(var(--spacing)*1)}#kite-chat-root .ml-2{margin-left:calc(var(--spacing)*2)}#kite-chat-root .ml-4{margin-left:calc(var(--spacing)*4)}#kite-chat-root .ml-5{margin-left:calc(var(--spacing)*5)}#kite-chat-root .ml-6{margin-left:calc(var(--spacing)*6)}#kite-chat-root .block{display:block}#kite-chat-root .contents{display:contents}#kite-chat-root .flex{display:flex}#kite-chat-root .grid{display:grid}#kite-chat-root .hidden{display:none}#kite-chat-root .inline{display:inline}#kite-chat-root .inline-block{display:inline-block}#kite-chat-root .inline-flex{display:inline-flex}#kite-chat-root .table{display:table}#kite-chat-root .size-8{width:calc(var(--spacing)*8);height:calc(var(--spacing)*8)}#kite-chat-root .size-9{width:calc(var(--spacing)*9);height:calc(var(--spacing)*9)}#kite-chat-root .size-10{width:calc(var(--spacing)*10);height:calc(var(--spacing)*10)}#kite-chat-root .size-full{width:100%;height:100%}#kite-chat-root .h-1{height:calc(var(--spacing)*1)}#kite-chat-root .h-1\\.5{height:calc(var(--spacing)*1.5)}#kite-chat-root .h-2{height:calc(var(--spacing)*2)}#kite-chat-root .h-2\\.5{height:calc(var(--spacing)*2.5)}#kite-chat-root .h-3{height:calc(var(--spacing)*3)}#kite-chat-root .h-3\\.5{height:calc(var(--spacing)*3.5)}#kite-chat-root .h-4{height:calc(var(--spacing)*4)}#kite-chat-root .h-5{height:calc(var(--spacing)*5)}#kite-chat-root .h-6{height:calc(var(--spacing)*6)}#kite-chat-root .h-7{height:calc(var(--spacing)*7)}#kite-chat-root .h-8{height:calc(var(--spacing)*8)}#kite-chat-root .h-9{height:calc(var(--spacing)*9)}#kite-chat-root .h-10{height:calc(var(--spacing)*10)}#kite-chat-root .h-12{height:calc(var(--spacing)*12)}#kite-chat-root .h-16{height:calc(var(--spacing)*16)}#kite-chat-root .h-auto{height:auto}#kite-chat-root .h-full{height:100%}#kite-chat-root .max-h-32{max-height:calc(var(--spacing)*32)}#kite-chat-root .max-h-\\[120px\\]{max-height:120px}#kite-chat-root .min-h-0{min-height:calc(var(--spacing)*0)}#kite-chat-root .min-h-\\[20px\\]{min-height:20px}#kite-chat-root .w-1\\.5{width:calc(var(--spacing)*1.5)}#kite-chat-root .w-2{width:calc(var(--spacing)*2)}#kite-chat-root .w-2\\.5{width:calc(var(--spacing)*2.5)}#kite-chat-root .w-3{width:calc(var(--spacing)*3)}#kite-chat-root .w-3\\.5{width:calc(var(--spacing)*3.5)}#kite-chat-root .w-4{width:calc(var(--spacing)*4)}#kite-chat-root .w-5{width:calc(var(--spacing)*5)}#kite-chat-root .w-6{width:calc(var(--spacing)*6)}#kite-chat-root .w-7{width:calc(var(--spacing)*7)}#kite-chat-root .w-8{width:calc(var(--spacing)*8)}#kite-chat-root .w-10{width:calc(var(--spacing)*10)}#kite-chat-root .w-12{width:calc(var(--spacing)*12)}#kite-chat-root .w-16{width:calc(var(--spacing)*16)}#kite-chat-root .w-\\[320px\\]{width:320px}#kite-chat-root .w-\\[480px\\]{width:480px}#kite-chat-root .w-full{width:100%}#kite-chat-root .max-w-\\[200px\\]{max-width:200px}#kite-chat-root .max-w-\\[240px\\]{max-width:240px}#kite-chat-root .max-w-\\[260px\\]{max-width:260px}#kite-chat-root .max-w-\\[300px\\]{max-width:300px}#kite-chat-root .min-w-0{min-width:calc(var(--spacing)*0)}#kite-chat-root .flex-1{flex:1}#kite-chat-root .flex-shrink-0,#kite-chat-root .shrink-0{flex-shrink:0}#kite-chat-root .-translate-x-1\\/2{--tw-translate-x:calc(calc(1/2*100%)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}#kite-chat-root .scale-95{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x)var(--tw-scale-y)}#kite-chat-root .scale-100{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x)var(--tw-scale-y)}#kite-chat-root .transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}#kite-chat-root .animate-bounce{animation:var(--animate-bounce)}#kite-chat-root .animate-spin{animation:var(--animate-spin)}#kite-chat-root .cursor-grab{cursor:grab}#kite-chat-root .cursor-grabbing{cursor:grabbing}#kite-chat-root .cursor-pointer{cursor:pointer}#kite-chat-root .touch-none{touch-action:none}#kite-chat-root .resize-none{resize:none}#kite-chat-root .list-decimal{list-style-type:decimal}#kite-chat-root .list-disc{list-style-type:disc}#kite-chat-root .auto-rows-min{grid-auto-rows:min-content}#kite-chat-root .grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}#kite-chat-root .grid-rows-\\[auto_auto\\]{grid-template-rows:auto auto}#kite-chat-root .flex-col{flex-direction:column}#kite-chat-root .flex-wrap{flex-wrap:wrap}#kite-chat-root .place-items-center{place-items:center}#kite-chat-root .items-center{align-items:center}#kite-chat-root .items-end{align-items:flex-end}#kite-chat-root .items-start{align-items:flex-start}#kite-chat-root .justify-between{justify-content:space-between}#kite-chat-root .justify-center{justify-content:center}#kite-chat-root .justify-end{justify-content:flex-end}#kite-chat-root .justify-start{justify-content:flex-start}#kite-chat-root .gap-0\\.5{gap:calc(var(--spacing)*.5)}#kite-chat-root .gap-1{gap:calc(var(--spacing)*1)}#kite-chat-root .gap-1\\.5{gap:calc(var(--spacing)*1.5)}#kite-chat-root .gap-2{gap:calc(var(--spacing)*2)}#kite-chat-root .gap-2\\.5{gap:calc(var(--spacing)*2.5)}#kite-chat-root .gap-3{gap:calc(var(--spacing)*3)}#kite-chat-root .gap-4{gap:calc(var(--spacing)*4)}#kite-chat-root .gap-6{gap:calc(var(--spacing)*6)}#kite-chat-root :where(.space-y-0\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*.5)*calc(1 - var(--tw-space-y-reverse)))}#kite-chat-root :where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}#kite-chat-root :where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}#kite-chat-root :where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}#kite-chat-root :where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)))}#kite-chat-root :where(.divide-gray-100>:not(:last-child)){border-color:var(--color-gray-100)}#kite-chat-root .self-start{align-self:flex-start}#kite-chat-root .justify-self-end{justify-self:flex-end}#kite-chat-root .truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}#kite-chat-root .overflow-hidden{overflow:hidden}#kite-chat-root .overflow-x-auto{overflow-x:auto}#kite-chat-root .overflow-y-auto{overflow-y:auto}#kite-chat-root .rounded{border-radius:.25rem}#kite-chat-root .rounded-2xl{border-radius:var(--radius-2xl)}#kite-chat-root .rounded-\\[inherit\\]{border-radius:inherit}#kite-chat-root .rounded-full{border-radius:3.40282e38px}#kite-chat-root .rounded-lg{border-radius:var(--kite-radius)}#kite-chat-root .rounded-md{border-radius:calc(var(--kite-radius) - 2px)}#kite-chat-root .rounded-xl{border-radius:calc(var(--kite-radius) + 4px)}#kite-chat-root .rounded-l-lg{border-top-left-radius:var(--kite-radius);border-bottom-left-radius:var(--kite-radius)}#kite-chat-root .rounded-br-md{border-bottom-right-radius:calc(var(--kite-radius) - 2px)}#kite-chat-root .rounded-bl-md{border-bottom-left-radius:calc(var(--kite-radius) - 2px)}#kite-chat-root .border{border-style:var(--tw-border-style);border-width:1px}#kite-chat-root .border-0{border-style:var(--tw-border-style);border-width:0}#kite-chat-root .border-t{border-top-style:var(--tw-border-style);border-top-width:1px}#kite-chat-root .border-r-0{border-right-style:var(--tw-border-style);border-right-width:0}#kite-chat-root .border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}#kite-chat-root .border-l{border-left-style:var(--tw-border-style);border-left-width:1px}#kite-chat-root .border-amber-100{border-color:var(--color-amber-100)}#kite-chat-root .border-amber-200{border-color:var(--color-amber-200)}#kite-chat-root .border-blue-100{border-color:var(--color-blue-100)}#kite-chat-root .border-blue-200{border-color:var(--color-blue-200)}#kite-chat-root .border-blue-400{border-color:var(--color-blue-400)}#kite-chat-root .border-emerald-100{border-color:var(--color-emerald-100)}#kite-chat-root .border-emerald-200{border-color:var(--color-emerald-200)}#kite-chat-root .border-gray-100{border-color:var(--color-gray-100)}#kite-chat-root .border-gray-200{border-color:var(--color-gray-200)}#kite-chat-root .border-gray-300{border-color:var(--color-gray-300)}#kite-chat-root .border-gray-700{border-color:var(--color-gray-700)}#kite-chat-root .border-green-200{border-color:var(--color-green-200)}#kite-chat-root .border-input{border-color:var(--kite-input)}#kite-chat-root .border-primary\\/20{border-color:var(--kite-primary)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .border-primary\\/20{border-color:color-mix(in oklab,var(--kite-primary)20%,transparent)}}#kite-chat-root .border-purple-100{border-color:var(--color-purple-100)}#kite-chat-root .border-purple-200{border-color:var(--color-purple-200)}#kite-chat-root .border-red-200{border-color:var(--color-red-200)}#kite-chat-root .border-slate-200{border-color:var(--color-slate-200)}#kite-chat-root .border-t-transparent{border-top-color:#0000}#kite-chat-root .border-l-transparent{border-left-color:#0000}#kite-chat-root .bg-amber-50{background-color:var(--color-amber-50)}#kite-chat-root .bg-amber-100{background-color:var(--color-amber-100)}#kite-chat-root .bg-background{background-color:var(--kite-background)}#kite-chat-root .bg-blue-50{background-color:var(--color-blue-50)}#kite-chat-root .bg-blue-100{background-color:var(--color-blue-100)}#kite-chat-root .bg-blue-400{background-color:var(--color-blue-400)}#kite-chat-root .bg-blue-600{background-color:var(--color-blue-600)}#kite-chat-root .bg-border{background-color:var(--kite-border)}#kite-chat-root .bg-card{background-color:var(--kite-card)}#kite-chat-root .bg-destructive{background-color:var(--kite-destructive)}#kite-chat-root .bg-emerald-50{background-color:var(--color-emerald-50)}#kite-chat-root .bg-emerald-500{background-color:var(--color-emerald-500)}#kite-chat-root .bg-gray-50{background-color:var(--color-gray-50)}#kite-chat-root .bg-gray-100{background-color:var(--color-gray-100)}#kite-chat-root .bg-gray-200{background-color:var(--color-gray-200)}#kite-chat-root .bg-gray-500{background-color:var(--color-gray-500)}#kite-chat-root .bg-gray-700{background-color:var(--color-gray-700)}#kite-chat-root .bg-gray-800{background-color:var(--color-gray-800)}#kite-chat-root .bg-gray-900{background-color:var(--color-gray-900)}#kite-chat-root .bg-green-50{background-color:var(--color-green-50)}#kite-chat-root .bg-green-400{background-color:var(--color-green-400)}#kite-chat-root .bg-muted\\/40{background-color:var(--kite-muted)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .bg-muted\\/40{background-color:color-mix(in oklab,var(--kite-muted)40%,transparent)}}#kite-chat-root .bg-orange-100{background-color:var(--color-orange-100)}#kite-chat-root .bg-orange-400{background-color:var(--color-orange-400)}#kite-chat-root .bg-pink-400{background-color:var(--color-pink-400)}#kite-chat-root .bg-primary,#kite-chat-root .bg-primary\\/5{background-color:var(--kite-primary)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .bg-primary\\/5{background-color:color-mix(in oklab,var(--kite-primary)5%,transparent)}}#kite-chat-root .bg-purple-50{background-color:var(--color-purple-50)}#kite-chat-root .bg-purple-400{background-color:var(--color-purple-400)}#kite-chat-root .bg-red-50{background-color:var(--color-red-50)}#kite-chat-root .bg-red-100{background-color:var(--color-red-100)}#kite-chat-root .bg-red-500{background-color:var(--color-red-500)}#kite-chat-root .bg-secondary{background-color:var(--kite-secondary)}#kite-chat-root .bg-slate-50{background-color:var(--color-slate-50)}#kite-chat-root .bg-slate-100{background-color:var(--color-slate-100)}#kite-chat-root .bg-slate-300{background-color:var(--color-slate-300)}#kite-chat-root .bg-transparent{background-color:#0000}#kite-chat-root .bg-white{background-color:var(--color-white)}#kite-chat-root .bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}#kite-chat-root .from-gray-50{--tw-gradient-from:var(--color-gray-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}#kite-chat-root .to-white{--tw-gradient-to:var(--color-white);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}#kite-chat-root .object-cover{object-fit:cover}#kite-chat-root .p-0{padding:calc(var(--spacing)*0)}#kite-chat-root .p-2{padding:calc(var(--spacing)*2)}#kite-chat-root .p-3{padding:calc(var(--spacing)*3)}#kite-chat-root .p-4{padding:calc(var(--spacing)*4)}#kite-chat-root .p-6{padding:calc(var(--spacing)*6)}#kite-chat-root .p-px{padding:1px}#kite-chat-root .px-0{padding-inline:calc(var(--spacing)*0)}#kite-chat-root .px-1{padding-inline:calc(var(--spacing)*1)}#kite-chat-root .px-1\\.5{padding-inline:calc(var(--spacing)*1.5)}#kite-chat-root .px-2{padding-inline:calc(var(--spacing)*2)}#kite-chat-root .px-2\\.5{padding-inline:calc(var(--spacing)*2.5)}#kite-chat-root .px-3{padding-inline:calc(var(--spacing)*3)}#kite-chat-root .px-4{padding-inline:calc(var(--spacing)*4)}#kite-chat-root .px-6{padding-inline:calc(var(--spacing)*6)}#kite-chat-root .py-0{padding-block:calc(var(--spacing)*0)}#kite-chat-root .py-0\\.5{padding-block:calc(var(--spacing)*.5)}#kite-chat-root .py-1{padding-block:calc(var(--spacing)*1)}#kite-chat-root .py-1\\.5{padding-block:calc(var(--spacing)*1.5)}#kite-chat-root .py-2{padding-block:calc(var(--spacing)*2)}#kite-chat-root .py-2\\.5{padding-block:calc(var(--spacing)*2.5)}#kite-chat-root .py-3{padding-block:calc(var(--spacing)*3)}#kite-chat-root .py-4{padding-block:calc(var(--spacing)*4)}#kite-chat-root .py-6{padding-block:calc(var(--spacing)*6)}#kite-chat-root .py-8{padding-block:calc(var(--spacing)*8)}#kite-chat-root .pt-0{padding-top:calc(var(--spacing)*0)}#kite-chat-root .pt-2{padding-top:calc(var(--spacing)*2)}#kite-chat-root .pb-2{padding-bottom:calc(var(--spacing)*2)}#kite-chat-root .pb-3{padding-bottom:calc(var(--spacing)*3)}#kite-chat-root .pb-4{padding-bottom:calc(var(--spacing)*4)}#kite-chat-root .text-center{text-align:center}#kite-chat-root .text-left{text-align:left}#kite-chat-root .font-mono{font-family:var(--font-mono)}#kite-chat-root .text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}#kite-chat-root .text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}#kite-chat-root .text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}#kite-chat-root .text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}#kite-chat-root .text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}#kite-chat-root .text-\\[10px\\]{font-size:10px}#kite-chat-root .leading-6{--tw-leading:calc(var(--spacing)*6);line-height:calc(var(--spacing)*6)}#kite-chat-root .leading-none{--tw-leading:1;line-height:1}#kite-chat-root .font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}#kite-chat-root .font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}#kite-chat-root .font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}#kite-chat-root .tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}#kite-chat-root .tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}#kite-chat-root .whitespace-nowrap{white-space:nowrap}#kite-chat-root .whitespace-pre-wrap{white-space:pre-wrap}#kite-chat-root .text-amber-500{color:var(--color-amber-500)}#kite-chat-root .text-amber-600{color:var(--color-amber-600)}#kite-chat-root .text-amber-700{color:var(--color-amber-700)}#kite-chat-root .text-black{color:var(--color-black)}#kite-chat-root .text-blue-600{color:var(--color-blue-600)}#kite-chat-root .text-blue-700{color:var(--color-blue-700)}#kite-chat-root .text-card-foreground{color:var(--kite-card-foreground)}#kite-chat-root .text-emerald-500{color:var(--color-emerald-500)}#kite-chat-root .text-emerald-600{color:var(--color-emerald-600)}#kite-chat-root .text-emerald-700{color:var(--color-emerald-700)}#kite-chat-root .text-gray-300{color:var(--color-gray-300)}#kite-chat-root .text-gray-400{color:var(--color-gray-400)}#kite-chat-root .text-gray-500{color:var(--color-gray-500)}#kite-chat-root .text-gray-600{color:var(--color-gray-600)}#kite-chat-root .text-gray-700{color:var(--color-gray-700)}#kite-chat-root .text-gray-800{color:var(--color-gray-800)}#kite-chat-root .text-gray-900{color:var(--color-gray-900)}#kite-chat-root .text-green-500{color:var(--color-green-500)}#kite-chat-root .text-green-600{color:var(--color-green-600)}#kite-chat-root .text-green-700{color:var(--color-green-700)}#kite-chat-root .text-green-800{color:var(--color-green-800)}#kite-chat-root .text-muted-foreground{color:var(--kite-muted-foreground)}#kite-chat-root .text-orange-700{color:var(--color-orange-700)}#kite-chat-root .text-primary{color:var(--kite-primary)}#kite-chat-root .text-primary-foreground{color:var(--kite-primary-foreground)}#kite-chat-root .text-purple-600{color:var(--color-purple-600)}#kite-chat-root .text-purple-700{color:var(--color-purple-700)}#kite-chat-root .text-red-500{color:var(--color-red-500)}#kite-chat-root .text-red-600{color:var(--color-red-600)}#kite-chat-root .text-red-700{color:var(--color-red-700)}#kite-chat-root .text-secondary-foreground{color:var(--kite-secondary-foreground)}#kite-chat-root .text-slate-600{color:var(--color-slate-600)}#kite-chat-root .text-slate-700{color:var(--color-slate-700)}#kite-chat-root .text-white{color:var(--color-white)}#kite-chat-root .uppercase{text-transform:uppercase}#kite-chat-root .italic{font-style:italic}#kite-chat-root .line-through{text-decoration-line:line-through}#kite-chat-root .underline-offset-4{text-underline-offset:4px}#kite-chat-root .opacity-0{opacity:0}#kite-chat-root .opacity-60{opacity:.6}#kite-chat-root .opacity-70{opacity:.7}#kite-chat-root .opacity-90{opacity:.9}#kite-chat-root .opacity-100{opacity:1}#kite-chat-root .shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .ring-2{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .ring-blue-400{--tw-ring-color:var(--color-blue-400)}#kite-chat-root .outline{outline-style:var(--tw-outline-style);outline-width:1px}#kite-chat-root .transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}#kite-chat-root .transition-\\[color\\,box-shadow\\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}#kite-chat-root .transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}#kite-chat-root .transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}#kite-chat-root .transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}#kite-chat-root .duration-150{--tw-duration:.15s;transition-duration:.15s}#kite-chat-root .duration-200{--tw-duration:.2s;transition-duration:.2s}#kite-chat-root .duration-300{--tw-duration:.3s;transition-duration:.3s}#kite-chat-root .ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}#kite-chat-root .ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}#kite-chat-root .outline-none{--tw-outline-style:none;outline-style:none}#kite-chat-root .select-none{-webkit-user-select:none;user-select:none}#kite-chat-root .ring-inset{--tw-ring-inset:inset}@media (hover:hover){#kite-chat-root .group-hover\\:bg-gray-200:is(:where(.group):hover *){background-color:var(--color-gray-200)}#kite-chat-root .group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}}#kite-chat-root .selection\\:bg-primary ::selection{background-color:var(--kite-primary)}#kite-chat-root .selection\\:bg-primary::selection{background-color:var(--kite-primary)}#kite-chat-root .selection\\:text-primary-foreground ::selection{color:var(--kite-primary-foreground)}#kite-chat-root .selection\\:text-primary-foreground::selection{color:var(--kite-primary-foreground)}#kite-chat-root .file\\:inline-flex::file-selector-button{display:inline-flex}#kite-chat-root .file\\:h-7::file-selector-button{height:calc(var(--spacing)*7)}#kite-chat-root .file\\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}#kite-chat-root .file\\:bg-transparent::file-selector-button{background-color:#0000}#kite-chat-root .file\\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}#kite-chat-root .file\\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}#kite-chat-root .file\\:text-foreground::file-selector-button{color:var(--kite-foreground)}#kite-chat-root .placeholder\\:text-gray-400::placeholder{color:var(--color-gray-400)}#kite-chat-root .placeholder\\:text-muted-foreground::placeholder{color:var(--kite-muted-foreground)}#kite-chat-root .focus-within\\:border-gray-700:focus-within{border-color:var(--color-gray-700)}@media (hover:hover){#kite-chat-root .hover\\:border-gray-300:hover{border-color:var(--color-gray-300)}#kite-chat-root .hover\\:border-primary\\/30:hover{border-color:var(--kite-primary)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .hover\\:border-primary\\/30:hover{border-color:color-mix(in oklab,var(--kite-primary)30%,transparent)}}#kite-chat-root .hover\\:bg-accent:hover{background-color:var(--kite-accent)}#kite-chat-root .hover\\:bg-destructive\\/90:hover{background-color:var(--kite-destructive)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .hover\\:bg-destructive\\/90:hover{background-color:color-mix(in oklab,var(--kite-destructive)90%,transparent)}}#kite-chat-root .hover\\:bg-gray-50:hover{background-color:var(--color-gray-50)}#kite-chat-root .hover\\:bg-gray-100:hover{background-color:var(--color-gray-100)}#kite-chat-root .hover\\:bg-gray-200:hover{background-color:var(--color-gray-200)}#kite-chat-root .hover\\:bg-gray-600:hover{background-color:var(--color-gray-600)}#kite-chat-root .hover\\:bg-primary\\/10:hover{background-color:var(--kite-primary)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .hover\\:bg-primary\\/10:hover{background-color:color-mix(in oklab,var(--kite-primary)10%,transparent)}}#kite-chat-root .hover\\:bg-primary\\/90:hover{background-color:var(--kite-primary)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .hover\\:bg-primary\\/90:hover{background-color:color-mix(in oklab,var(--kite-primary)90%,transparent)}}#kite-chat-root .hover\\:bg-secondary\\/80:hover{background-color:var(--kite-secondary)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .hover\\:bg-secondary\\/80:hover{background-color:color-mix(in oklab,var(--kite-secondary)80%,transparent)}}#kite-chat-root .hover\\:text-accent-foreground:hover{color:var(--kite-accent-foreground)}#kite-chat-root .hover\\:text-blue-800:hover{color:var(--color-blue-800)}#kite-chat-root .hover\\:text-gray-600:hover{color:var(--color-gray-600)}#kite-chat-root .hover\\:text-gray-700:hover{color:var(--color-gray-700)}#kite-chat-root .hover\\:text-gray-800:hover{color:var(--color-gray-800)}#kite-chat-root .hover\\:underline:hover{text-decoration-line:underline}#kite-chat-root .hover\\:opacity-90:hover{opacity:.9}#kite-chat-root .hover\\:shadow-xl:hover{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}#kite-chat-root .focus\\:ring-primary:focus{--tw-ring-color:var(--kite-primary)}#kite-chat-root .focus-visible\\:border-ring:focus-visible{border-color:var(--kite-ring)}#kite-chat-root .focus-visible\\:ring-0:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .focus-visible\\:ring-\\[3px\\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:var(--kite-destructive)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:color-mix(in oklab,var(--kite-destructive)20%,transparent)}}#kite-chat-root .focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:var(--kite-ring)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:color-mix(in oklab,var(--kite-ring)50%,transparent)}}#kite-chat-root .focus-visible\\:ring-offset-0:focus-visible{--tw-ring-offset-width:0px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}#kite-chat-root .focus-visible\\:outline-1:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}#kite-chat-root .active\\:cursor-grabbing:active{cursor:grabbing}#kite-chat-root .disabled\\:pointer-events-none:disabled{pointer-events:none}#kite-chat-root .disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}#kite-chat-root .disabled\\:bg-gray-300:disabled{background-color:var(--color-gray-300)}#kite-chat-root .disabled\\:opacity-50:disabled{opacity:.5}#kite-chat-root .has-data-\\[slot\\=card-action\\]\\:grid-cols-\\[1fr_auto\\]:has([data-slot=card-action]){grid-template-columns:1fr auto}#kite-chat-root .has-\\[\\>svg\\]\\:px-2\\.5:has(>svg){padding-inline:calc(var(--spacing)*2.5)}#kite-chat-root .has-\\[\\>svg\\]\\:px-3:has(>svg){padding-inline:calc(var(--spacing)*3)}#kite-chat-root .has-\\[\\>svg\\]\\:px-4:has(>svg){padding-inline:calc(var(--spacing)*4)}#kite-chat-root .aria-invalid\\:border-destructive[aria-invalid=true]{border-color:var(--kite-destructive)}#kite-chat-root .aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:var(--kite-destructive)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--kite-destructive)20%,transparent)}}@media (min-width:48rem){#kite-chat-root .md\\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}#kite-chat-root .dark\\:border-input:is(.dark *){border-color:var(--kite-input)}#kite-chat-root .dark\\:bg-destructive\\/60:is(.dark *){background-color:var(--kite-destructive)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .dark\\:bg-destructive\\/60:is(.dark *){background-color:color-mix(in oklab,var(--kite-destructive)60%,transparent)}}#kite-chat-root .dark\\:bg-input\\/30:is(.dark *){background-color:var(--kite-input)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .dark\\:bg-input\\/30:is(.dark *){background-color:color-mix(in oklab,var(--kite-input)30%,transparent)}}@media (hover:hover){#kite-chat-root .dark\\:hover\\:bg-accent\\/50:is(.dark *):hover{background-color:var(--kite-accent)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .dark\\:hover\\:bg-accent\\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--kite-accent)50%,transparent)}}#kite-chat-root .dark\\:hover\\:bg-input\\/50:is(.dark *):hover{background-color:var(--kite-input)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .dark\\:hover\\:bg-input\\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--kite-input)50%,transparent)}}}#kite-chat-root .dark\\:focus-visible\\:ring-destructive\\/40:is(.dark *):focus-visible{--tw-ring-color:var(--kite-destructive)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .dark\\:focus-visible\\:ring-destructive\\/40:is(.dark *):focus-visible{--tw-ring-color:color-mix(in oklab,var(--kite-destructive)40%,transparent)}}#kite-chat-root .dark\\:aria-invalid\\:ring-destructive\\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--kite-destructive)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .dark\\:aria-invalid\\:ring-destructive\\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--kite-destructive)40%,transparent)}}#kite-chat-root .\\[\\&_svg\\]\\:pointer-events-none svg{pointer-events:none}#kite-chat-root .\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}#kite-chat-root .\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-4 svg:not([class*=size-]){width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}#kite-chat-root .\\[\\.border-b\\]\\:pb-6.border-b{padding-bottom:calc(var(--spacing)*6)}#kite-chat-root .\\[\\.border-t\\]\\:pt-6.border-t{padding-top:calc(var(--spacing)*6)}:root{--kite-radius:.625rem;--kite-background:oklch(100% 0 0);--kite-foreground:oklch(14.5% 0 0);--kite-card:oklch(100% 0 0);--kite-card-foreground:oklch(14.5% 0 0);--kite-popover:oklch(100% 0 0);--kite-popover-foreground:oklch(14.5% 0 0);--kite-primary:oklch(20.5% 0 0);--kite-primary-foreground:oklch(98.5% 0 0);--kite-secondary:oklch(97% 0 0);--kite-secondary-foreground:oklch(20.5% 0 0);--kite-muted:oklch(97% 0 0);--kite-muted-foreground:oklch(55.6% 0 0);--kite-accent:oklch(97% 0 0);--kite-accent-foreground:oklch(20.5% 0 0);--kite-destructive:oklch(57.7% .245 27.325);--kite-destructive-foreground:oklch(98.5% 0 0);--kite-border:oklch(92.2% 0 0);--kite-input:oklch(92.2% 0 0);--kite-ring:oklch(70.8% 0 0)}.dark{--kite-background:oklch(14.5% 0 0);--kite-foreground:oklch(98.5% 0 0);--kite-card:oklch(20.5% 0 0);--kite-card-foreground:oklch(98.5% 0 0);--kite-popover:oklch(20.5% 0 0);--kite-popover-foreground:oklch(98.5% 0 0);--kite-primary:oklch(92.2% 0 0);--kite-primary-foreground:oklch(20.5% 0 0);--kite-secondary:oklch(26.9% 0 0);--kite-secondary-foreground:oklch(98.5% 0 0);--kite-muted:oklch(26.9% 0 0);--kite-muted-foreground:oklch(70.8% 0 0);--kite-accent:oklch(26.9% 0 0);--kite-accent-foreground:oklch(98.5% 0 0);--kite-destructive:oklch(70.4% .191 22.216);--kite-destructive-foreground:oklch(98.5% 0 0);--kite-border:oklch(100% 0 0/.1);--kite-input:oklch(100% 0 0/.15);--kite-ring:oklch(55.6% 0 0);--kite-link:oklch(65% .15 250)}#kite-chat-root *{border-color:var(--kite-border)}#kite-chat-root section form input{color:var(--kite-foreground,#1a1a1a)!important}#kite-chat-root section form input::placeholder{color:var(--kite-muted-foreground,#9ca3af)!important}#kite-chat-root section .space-y-1>div+div{margin-top:.625rem}#kite-chat-root section>div.flex-1>div.overflow-y-auto{padding:1rem 1.25rem!important}#kite-chat-root section .mt-6.pt-4.border-t{margin-top:1.25rem;padding-top:1rem}#kite-chat-root section button.w-full.text-left.px-3{padding:.75rem 1rem}#kite-chat-root section .text-sm.leading-6{line-height:1.625rem}@keyframes spin{to{transform:rotate(360deg)}}#kite-chat-root .animate-spin{animation:1s linear infinite spin}#kite-chat-root [data-motion]{will-change:transform,opacity}#kite-chat-root a,#kite-chat-root .kite-link{word-break:break-word;overflow-wrap:break-word;-webkit-hyphens:auto;hyphens:auto;text-decoration:none;color:var(--kite-link)!important}#kite-chat-root a:hover,#kite-chat-root .kite-link:hover{text-decoration:underline}#kite-chat-root .text-sm.leading-6{overflow-wrap:break-word;word-break:break-word;max-width:100%}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes bounce{0%,to{animation-timing-function:cubic-bezier(.8,0,1,1);transform:translateY(-25%)}50%{animation-timing-function:cubic-bezier(0,0,.2,1);transform:none}}#kite-chat-root{--kite-link:oklch(55% .15 250)}`,document.head.appendChild(e);let t=document.createElement("style");t.id="kite-chat-position",t.textContent=`
79
+ transition-all duration-150 ease-in-out`,children:T.label},T.id))})]})},v.id)}),(me||Bi)&&(0,p.jsxs)("div",{className:"mt-3 flex items-center gap-2",children:[me&&me.stepIndex>0&&(0,p.jsx)(dt,{type:"button",size:"sm",variant:"secondary",className:"h-7 w-7 rounded-full p-0 bg-gray-100 hover:bg-gray-200 border border-gray-200",onClick:Zk,children:(0,p.jsx)(Us,{className:"h-3.5 w-3.5 text-gray-600"})}),(0,p.jsxs)(dt,{type:"button",size:"sm",variant:"secondary",className:"h-8 rounded-xl px-3 text-xs gap-1.5 bg-gray-100 hover:bg-gray-200 border border-gray-200",onClick:Bi?mv:qp,children:[(0,p.jsx)("span",{children:Bi?"Done":"Next"}),(0,p.jsxs)("span",{className:"flex items-center gap-0.5 text-gray-400",children:[(0,p.jsx)(Aa,{className:"h-3 w-3"}),(0,p.jsx)(Ra,{className:"h-3 w-3"})]})]})]}),(qn==="thinking"||qn==="searching"||qn==="executing"||qn==="responding")&&(0,p.jsx)("div",{className:`${Uk==="user"?"mt-3":""}`,children:(0,p.jsx)(wk,{phase:qn,progressSteps:Fk})}),ve&&kp&&(0,p.jsx)("div",{className:"flex items-start mt-2",children:(0,p.jsx)("div",{className:"bg-gray-200 rounded-2xl rounded-bl-md px-4 py-3",children:(0,p.jsx)(Ak,{})})}),!me&&(0,p.jsx)("div",{ref:Rp})]})})})})]}),(0,p.jsxs)("div",{className:`px-4 py-3 bg-white shrink-0 ${Mp?"ring-2 ring-blue-400 ring-inset bg-blue-50":""}`,onDragOver:$k,onDragLeave:Hk,onDrop:zk,children:[ua&&(0,p.jsxs)("div",{className:"mb-2 flex items-center gap-2 rounded-xl bg-blue-50 border border-blue-200 px-3 py-2",children:[(0,p.jsx)(In,{className:"h-4 w-4 text-blue-600"}),(0,p.jsx)("span",{className:"text-xs text-blue-700 flex-1 truncate",children:ua.name}),(0,p.jsx)("button",{type:"button",onClick:()=>{Vi(null),ji.current&&(ji.current.value="")},className:"text-blue-600 hover:text-blue-800",children:(0,p.jsx)(Fr,{className:"h-4 w-4"})})]}),pr.length>0&&(0,p.jsxs)("div",{className:"mb-2 flex flex-wrap gap-2",children:[pr.map((v,L)=>(0,p.jsxs)("div",{className:"relative group",children:[v.preview?(0,p.jsx)("img",{src:v.preview,alt:`Preview ${L+1}`,className:"h-16 w-16 object-cover rounded-lg border border-gray-200"}):(0,p.jsx)("div",{className:"h-16 w-16 rounded-lg border border-gray-200 bg-gray-100 flex items-center justify-center",children:(0,p.jsx)(In,{className:"h-6 w-6 text-gray-400"})}),(0,p.jsx)("button",{type:"button",onClick:()=>{v.preview&&URL.revokeObjectURL(v.preview),Np(E=>E.filter((_,D)=>D!==L))},className:"absolute -top-1 -right-1 h-4 w-4 rounded-full bg-gray-800 text-white flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",children:(0,p.jsx)(Fr,{className:"h-2.5 w-2.5"})})]},L)),sv&&(0,p.jsx)("div",{className:"h-16 w-16 rounded-lg border border-gray-200 bg-gray-50 flex items-center justify-center",children:(0,p.jsx)(Pt,{className:"h-5 w-5 animate-spin text-gray-400"})})]}),(0,p.jsxs)("form",{onSubmit:Kk,className:"w-full",children:[(0,p.jsx)("input",{ref:ji,type:"file",accept:".csv",className:"hidden",onChange:v=>{let L=v.target.files?.[0];L&&Vi(L)}}),(0,p.jsx)("input",{ref:lv,type:"file",accept:"image/*,.pdf,.csv",multiple:!0,className:"hidden",onChange:v=>{let L=v.target.files;if(!L||L.length===0)return;let E=Array.from(L).find(_=>_.name.endsWith(".csv"));E&&!ve?Vi(E):Fp(L)}}),(0,p.jsxs)("div",{className:`flex w-full items-start gap-2 rounded-xl border bg-white px-3 py-2 shadow-sm ${Mp?"border-blue-400":"border-gray-200"}`,children:[(0,p.jsx)(dt,{type:"button",size:"icon",variant:"ghost",onClick:()=>{lv.current?.click()},className:"h-5 w-5 rounded-full text-gray-400 hover:text-gray-600 hover:bg-gray-100",title:"Attach file (image, PDF, or CSV)",disabled:sv,children:(0,p.jsx)(uu,{className:"h-2.5 w-2.5"})}),(0,p.jsx)("textarea",{placeholder:ua?"Describe what to do with this CSV...":pr.length>0?"Add a message (optional)...":Mp?"Drop files here...":"Ask anything...",value:A,onChange:v=>{R(v.target.value),v.target.value.length>0&&Bk()},rows:1,className:"flex-1 border-0 bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0 text-sm placeholder:text-gray-400 resize-none overflow-hidden outline-none",style:{minHeight:"20px",maxHeight:"120px"},onInput:v=>{let L=v.target;L.style.height="auto",L.style.height=Math.min(L.scrollHeight,120)+"px"},onKeyDown:v=>{if(v.key==="Enter"&&!v.shiftKey&&!v.metaKey&&!v.ctrlKey){if(v.preventDefault(),A.trim()||ua||pr.length>0){let L=v.currentTarget.closest("form");L&&L.requestSubmit()}return}if((v.metaKey||v.ctrlKey)&&v.key==="Enter"){let L=Dp.current;if(L){v.preventDefault(),v.stopPropagation(),jp(L);return}if(nt){v.preventDefault(),v.stopPropagation(),Vp();return}if(Ui){v.preventDefault(),v.stopPropagation(),Up(Ui);return}if(qe.current){v.preventDefault(),v.stopPropagation(),qp();return}}}}),(0,p.jsx)(dt,{type:"submit",size:"icon",disabled:!A.trim()&&!ua&&pr.length===0||Bu,className:"h-6 w-6 rounded-full bg-gray-700 hover:bg-gray-600 disabled:bg-gray-300",onClick:v=>{v.preventDefault();let L=v.currentTarget.closest("form");L&&L.requestSubmit()},children:(0,p.jsx)(ou,{className:"h-2.5 w-2.5 text-white"})})]})]})]}),(0,p.jsx)(bk,{x:ju.x,y:ju.y,visible:ju.visible,onClick:ju.onClick}),uv&&(0,p.jsx)(EN,{imageUrl:uv,onClose:()=>Bp(null)})]})}function Dk({onNavigate:e,onActionComplete:t,currentPage:r,agentUrl:a,startingQuestions:o,startingQuestionsEndpoint:n,defaultOpen:s=!1,isOpen:i,onOpenChange:l,userId:u,orgId:c,userName:d,userEmail:f,supabaseUrl:h,supabaseAnonKey:x,initialCorner:w,onCornerChange:C,productBackendUrl:m,getAuthHeaders:g,isEval:y}){let[b,k]=O.useState(s),I=i!==void 0?i:b,A=R=>{i===void 0&&k(R),l?.(R)};return(0,p.jsx)(DN,{isOpen:I,onClose:()=>A(!1),onOpen:()=>A(!0),onNavigate:e,onActionComplete:t,currentPage:r,agentUrl:a,startingQuestions:o,startingQuestionsEndpoint:n,userId:u,orgId:c,userName:d,userEmail:f,supabaseUrl:h,supabaseAnonKey:x,initialCorner:w,onCornerChange:C,productBackendUrl:m,getAuthHeaders:g,isEval:y})}var Zy=B(ce(),1),Ni=null,jr=null,dr={};function NN({initialConfig:e}){let[t,r]=(0,qr.useState)(e),[a,o]=(0,qr.useState)(e.currentPage||"dashboard"),[n,s]=(0,qr.useState)(!1),i=(0,qr.useRef)(!1);return(0,qr.useEffect)(()=>{i.current=n},[n]),(0,qr.useEffect)(()=>(console.log("[KiteChat] Chat panel loaded v0.2.57"),console.log(`[KiteChat] Initial current page: "${a}"`),dr.setCurrentPage=o,dr.setConfig=l=>r(u=>({...u,...l})),dr.setIsOpen=s,dr.getIsOpen=()=>i.current,()=>{dr={}}),[]),(0,qr.useEffect)(()=>{console.log(`[KiteChat] Current page changed to: "${a}"`)},[a]),(0,qr.useEffect)(()=>{t.theme==="dark"?jr?.classList.add("dark"):jr?.classList.remove("dark")},[t.theme]),(0,Zy.jsx)(Dk,{isOpen:n,onOpenChange:s,currentPage:a,agentUrl:t.agentUrl,onNavigate:(l,u)=>t.onNavigate?.(l,u),onActionComplete:t.onActionComplete,startingQuestions:t.startingQuestions,startingQuestionsEndpoint:t.startingQuestionsEndpoint,userId:t.userId,orgId:t.orgId,userName:t.userName,userEmail:t.userEmail,supabaseUrl:t.supabaseUrl,supabaseAnonKey:t.supabaseAnonKey,productBackendUrl:t.productBackendUrl,getAuthHeaders:t.getAuthHeaders,isEval:t.isEval})}function MN(){if(document.getElementById("kite-chat-styles"))return;let e=document.createElement("style");e.id="kite-chat-styles",e.textContent=`/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */
80
+ @supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){#kite-chat-root *,#kite-chat-root :before,#kite-chat-root :after,#kite-chat-root ::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial}}:root,#kite-chat-root{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-orange-100:oklch(95.4% .038 75.164);--color-orange-400:oklch(75% .183 55.934);--color-orange-700:oklch(55.3% .195 38.402);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-100:oklch(96.2% .059 95.617);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-amber-700:oklch(55.5% .163 48.998);--color-green-50:oklch(98.2% .018 155.826);--color-green-200:oklch(92.5% .084 155.995);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-green-800:oklch(44.8% .119 151.328);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-100:oklch(95% .052 163.051);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-600:oklch(59.6% .145 163.225);--color-emerald-700:oklch(50.8% .118 165.612);--color-blue-50:oklch(97% .014 254.604);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-200:oklch(88.2% .059 254.128);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--color-purple-50:oklch(97.7% .014 308.299);--color-purple-100:oklch(94.6% .033 307.174);--color-purple-200:oklch(90.2% .063 306.703);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-600:oklch(55.8% .288 302.321);--color-purple-700:oklch(49.6% .265 301.924);--color-pink-400:oklch(71.8% .202 349.761);--color-slate-50:oklch(98.4% .003 247.858);--color-slate-100:oklch(96.8% .007 247.896);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-700:oklch(37.2% .044 257.287);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height:calc(1.5/1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wide:.025em;--tracking-wider:.05em;--radius-2xl:1rem;--ease-out:cubic-bezier(0,0,.2,1);--ease-in-out:cubic-bezier(.4,0,.2,1);--animate-spin:spin 1s linear infinite;--animate-bounce:bounce 1s infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}#kite-chat-root *,#kite-chat-root :after,#kite-chat-root :before,#kite-chat-root ::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}#kite-chat-root ::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}#kite-chat-root,#kite-chat-root{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}#kite-chat-root hr{height:0;color:inherit;border-top-width:1px}#kite-chat-root abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}#kite-chat-root h1,#kite-chat-root h2,#kite-chat-root h3,#kite-chat-root h4,#kite-chat-root h5,#kite-chat-root h6{font-size:inherit;font-weight:inherit}#kite-chat-root a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}#kite-chat-root b,#kite-chat-root strong{font-weight:bolder}#kite-chat-root code,#kite-chat-root kbd,#kite-chat-root samp,#kite-chat-root pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}#kite-chat-root small{font-size:80%}#kite-chat-root sub,#kite-chat-root sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}#kite-chat-root sub{bottom:-.25em}#kite-chat-root sup{top:-.5em}#kite-chat-root table{text-indent:0;border-color:inherit;border-collapse:collapse}#kite-chat-root :-moz-focusring{outline:auto}#kite-chat-root progress{vertical-align:baseline}#kite-chat-root summary{display:list-item}#kite-chat-root ol,#kite-chat-root ul,#kite-chat-root menu{list-style:none}#kite-chat-root img,#kite-chat-root svg,#kite-chat-root video,#kite-chat-root canvas,#kite-chat-root audio,#kite-chat-root iframe,#kite-chat-root embed,#kite-chat-root object{vertical-align:middle;display:block}#kite-chat-root img,#kite-chat-root video{max-width:100%;height:auto}#kite-chat-root button,#kite-chat-root input,#kite-chat-root select,#kite-chat-root optgroup,#kite-chat-root textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}#kite-chat-root ::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}#kite-chat-root :where(select:is([multiple],[size])) optgroup{font-weight:bolder}#kite-chat-root :where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}#kite-chat-root ::file-selector-button{margin-inline-end:4px}#kite-chat-root ::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){#kite-chat-root ::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){#kite-chat-root ::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}#kite-chat-root textarea{resize:vertical}#kite-chat-root ::-webkit-search-decoration{-webkit-appearance:none}#kite-chat-root ::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}#kite-chat-root ::-webkit-datetime-edit{display:inline-flex}#kite-chat-root ::-webkit-datetime-edit-fields-wrapper{padding:0}#kite-chat-root ::-webkit-datetime-edit{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-year-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-month-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-day-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-hour-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-minute-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-second-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-millisecond-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-meridiem-field{padding-block:0}#kite-chat-root ::-webkit-calendar-picker-indicator{line-height:1}#kite-chat-root :-moz-ui-invalid{box-shadow:none}#kite-chat-root button,#kite-chat-root input:where([type=button],[type=reset],[type=submit]){appearance:button}#kite-chat-root ::file-selector-button{appearance:button}#kite-chat-root ::-webkit-inner-spin-button{height:auto}#kite-chat-root ::-webkit-outer-spin-button{height:auto}#kite-chat-root [hidden]:where(:not([hidden=until-found])){display:none!important}#kite-chat-root .\\@container\\/card-header{container:card-header/inline-size}#kite-chat-root .pointer-events-none{pointer-events:none}#kite-chat-root .collapse{visibility:collapse}#kite-chat-root .invisible{visibility:hidden}#kite-chat-root .visible{visibility:visible}#kite-chat-root .absolute{position:absolute}#kite-chat-root .fixed{position:fixed}#kite-chat-root .relative{position:relative}#kite-chat-root .inset-0{inset:calc(var(--spacing)*0)}#kite-chat-root .-top-1{top:calc(var(--spacing)*-1)}#kite-chat-root .top-1\\/2{top:50%}#kite-chat-root .-right-1{right:calc(var(--spacing)*-1)}#kite-chat-root .right-4{right:calc(var(--spacing)*4)}#kite-chat-root .bottom-4{bottom:calc(var(--spacing)*4)}#kite-chat-root .bottom-6{bottom:calc(var(--spacing)*6)}#kite-chat-root .left-1\\/2{left:50%}#kite-chat-root .left-4{left:calc(var(--spacing)*4)}#kite-chat-root .z-40{z-index:40}#kite-chat-root .z-50{z-index:50}#kite-chat-root .z-\\[9999\\]{z-index:9999}#kite-chat-root .col-start-2{grid-column-start:2}#kite-chat-root .row-span-2{grid-row:span 2/span 2}#kite-chat-root .row-start-1{grid-row-start:1}#kite-chat-root .container{width:100%}@media (min-width:40rem){#kite-chat-root .container{max-width:40rem}}@media (min-width:48rem){#kite-chat-root .container{max-width:48rem}}@media (min-width:64rem){#kite-chat-root .container{max-width:64rem}}@media (min-width:80rem){#kite-chat-root .container{max-width:80rem}}@media (min-width:96rem){#kite-chat-root .container{max-width:96rem}}#kite-chat-root .mx-auto{margin-inline:auto}#kite-chat-root .my-1{margin-block:calc(var(--spacing)*1)}#kite-chat-root .my-2{margin-block:calc(var(--spacing)*2)}#kite-chat-root .mt-1{margin-top:calc(var(--spacing)*1)}#kite-chat-root .mt-2{margin-top:calc(var(--spacing)*2)}#kite-chat-root .mt-3{margin-top:calc(var(--spacing)*3)}#kite-chat-root .mr-2{margin-right:calc(var(--spacing)*2)}#kite-chat-root .mb-0\\.5{margin-bottom:calc(var(--spacing)*.5)}#kite-chat-root .mb-1{margin-bottom:calc(var(--spacing)*1)}#kite-chat-root .mb-1\\.5{margin-bottom:calc(var(--spacing)*1.5)}#kite-chat-root .mb-2{margin-bottom:calc(var(--spacing)*2)}#kite-chat-root .mb-3{margin-bottom:calc(var(--spacing)*3)}#kite-chat-root .mb-4{margin-bottom:calc(var(--spacing)*4)}#kite-chat-root .ml-1{margin-left:calc(var(--spacing)*1)}#kite-chat-root .ml-2{margin-left:calc(var(--spacing)*2)}#kite-chat-root .ml-4{margin-left:calc(var(--spacing)*4)}#kite-chat-root .ml-5{margin-left:calc(var(--spacing)*5)}#kite-chat-root .ml-6{margin-left:calc(var(--spacing)*6)}#kite-chat-root .block{display:block}#kite-chat-root .contents{display:contents}#kite-chat-root .flex{display:flex}#kite-chat-root .grid{display:grid}#kite-chat-root .hidden{display:none}#kite-chat-root .inline{display:inline}#kite-chat-root .inline-block{display:inline-block}#kite-chat-root .inline-flex{display:inline-flex}#kite-chat-root .table{display:table}#kite-chat-root .size-8{width:calc(var(--spacing)*8);height:calc(var(--spacing)*8)}#kite-chat-root .size-9{width:calc(var(--spacing)*9);height:calc(var(--spacing)*9)}#kite-chat-root .size-10{width:calc(var(--spacing)*10);height:calc(var(--spacing)*10)}#kite-chat-root .size-full{width:100%;height:100%}#kite-chat-root .h-1{height:calc(var(--spacing)*1)}#kite-chat-root .h-1\\.5{height:calc(var(--spacing)*1.5)}#kite-chat-root .h-2{height:calc(var(--spacing)*2)}#kite-chat-root .h-2\\.5{height:calc(var(--spacing)*2.5)}#kite-chat-root .h-3{height:calc(var(--spacing)*3)}#kite-chat-root .h-3\\.5{height:calc(var(--spacing)*3.5)}#kite-chat-root .h-4{height:calc(var(--spacing)*4)}#kite-chat-root .h-5{height:calc(var(--spacing)*5)}#kite-chat-root .h-6{height:calc(var(--spacing)*6)}#kite-chat-root .h-7{height:calc(var(--spacing)*7)}#kite-chat-root .h-8{height:calc(var(--spacing)*8)}#kite-chat-root .h-9{height:calc(var(--spacing)*9)}#kite-chat-root .h-10{height:calc(var(--spacing)*10)}#kite-chat-root .h-12{height:calc(var(--spacing)*12)}#kite-chat-root .h-16{height:calc(var(--spacing)*16)}#kite-chat-root .h-auto{height:auto}#kite-chat-root .h-full{height:100%}#kite-chat-root .max-h-32{max-height:calc(var(--spacing)*32)}#kite-chat-root .max-h-\\[120px\\]{max-height:120px}#kite-chat-root .min-h-0{min-height:calc(var(--spacing)*0)}#kite-chat-root .min-h-\\[20px\\]{min-height:20px}#kite-chat-root .w-1\\.5{width:calc(var(--spacing)*1.5)}#kite-chat-root .w-2{width:calc(var(--spacing)*2)}#kite-chat-root .w-2\\.5{width:calc(var(--spacing)*2.5)}#kite-chat-root .w-3{width:calc(var(--spacing)*3)}#kite-chat-root .w-3\\.5{width:calc(var(--spacing)*3.5)}#kite-chat-root .w-4{width:calc(var(--spacing)*4)}#kite-chat-root .w-5{width:calc(var(--spacing)*5)}#kite-chat-root .w-6{width:calc(var(--spacing)*6)}#kite-chat-root .w-7{width:calc(var(--spacing)*7)}#kite-chat-root .w-8{width:calc(var(--spacing)*8)}#kite-chat-root .w-10{width:calc(var(--spacing)*10)}#kite-chat-root .w-12{width:calc(var(--spacing)*12)}#kite-chat-root .w-16{width:calc(var(--spacing)*16)}#kite-chat-root .w-\\[320px\\]{width:320px}#kite-chat-root .w-\\[480px\\]{width:480px}#kite-chat-root .w-full{width:100%}#kite-chat-root .max-w-\\[200px\\]{max-width:200px}#kite-chat-root .max-w-\\[240px\\]{max-width:240px}#kite-chat-root .max-w-\\[260px\\]{max-width:260px}#kite-chat-root .max-w-\\[300px\\]{max-width:300px}#kite-chat-root .min-w-0{min-width:calc(var(--spacing)*0)}#kite-chat-root .flex-1{flex:1}#kite-chat-root .flex-shrink-0,#kite-chat-root .shrink-0{flex-shrink:0}#kite-chat-root .-translate-x-1\\/2{--tw-translate-x:calc(calc(1/2*100%)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}#kite-chat-root .scale-95{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x)var(--tw-scale-y)}#kite-chat-root .scale-100{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x)var(--tw-scale-y)}#kite-chat-root .transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}#kite-chat-root .animate-bounce{animation:var(--animate-bounce)}#kite-chat-root .animate-spin{animation:var(--animate-spin)}#kite-chat-root .cursor-grab{cursor:grab}#kite-chat-root .cursor-grabbing{cursor:grabbing}#kite-chat-root .cursor-pointer{cursor:pointer}#kite-chat-root .touch-none{touch-action:none}#kite-chat-root .resize-none{resize:none}#kite-chat-root .list-decimal{list-style-type:decimal}#kite-chat-root .list-disc{list-style-type:disc}#kite-chat-root .auto-rows-min{grid-auto-rows:min-content}#kite-chat-root .grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}#kite-chat-root .grid-rows-\\[auto_auto\\]{grid-template-rows:auto auto}#kite-chat-root .flex-col{flex-direction:column}#kite-chat-root .flex-wrap{flex-wrap:wrap}#kite-chat-root .place-items-center{place-items:center}#kite-chat-root .items-center{align-items:center}#kite-chat-root .items-end{align-items:flex-end}#kite-chat-root .items-start{align-items:flex-start}#kite-chat-root .justify-between{justify-content:space-between}#kite-chat-root .justify-center{justify-content:center}#kite-chat-root .justify-end{justify-content:flex-end}#kite-chat-root .justify-start{justify-content:flex-start}#kite-chat-root .gap-0\\.5{gap:calc(var(--spacing)*.5)}#kite-chat-root .gap-1{gap:calc(var(--spacing)*1)}#kite-chat-root .gap-1\\.5{gap:calc(var(--spacing)*1.5)}#kite-chat-root .gap-2{gap:calc(var(--spacing)*2)}#kite-chat-root .gap-2\\.5{gap:calc(var(--spacing)*2.5)}#kite-chat-root .gap-3{gap:calc(var(--spacing)*3)}#kite-chat-root .gap-4{gap:calc(var(--spacing)*4)}#kite-chat-root .gap-6{gap:calc(var(--spacing)*6)}#kite-chat-root :where(.space-y-0\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*.5)*calc(1 - var(--tw-space-y-reverse)))}#kite-chat-root :where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}#kite-chat-root :where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}#kite-chat-root :where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}#kite-chat-root :where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)))}#kite-chat-root :where(.divide-gray-100>:not(:last-child)){border-color:var(--color-gray-100)}#kite-chat-root .self-start{align-self:flex-start}#kite-chat-root .justify-self-end{justify-self:flex-end}#kite-chat-root .truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}#kite-chat-root .overflow-hidden{overflow:hidden}#kite-chat-root .overflow-x-auto{overflow-x:auto}#kite-chat-root .overflow-y-auto{overflow-y:auto}#kite-chat-root .rounded{border-radius:.25rem}#kite-chat-root .rounded-2xl{border-radius:var(--radius-2xl)}#kite-chat-root .rounded-\\[inherit\\]{border-radius:inherit}#kite-chat-root .rounded-full{border-radius:3.40282e38px}#kite-chat-root .rounded-lg{border-radius:var(--kite-radius)}#kite-chat-root .rounded-md{border-radius:calc(var(--kite-radius) - 2px)}#kite-chat-root .rounded-xl{border-radius:calc(var(--kite-radius) + 4px)}#kite-chat-root .rounded-l-lg{border-top-left-radius:var(--kite-radius);border-bottom-left-radius:var(--kite-radius)}#kite-chat-root .rounded-br-md{border-bottom-right-radius:calc(var(--kite-radius) - 2px)}#kite-chat-root .rounded-bl-md{border-bottom-left-radius:calc(var(--kite-radius) - 2px)}#kite-chat-root .border{border-style:var(--tw-border-style);border-width:1px}#kite-chat-root .border-0{border-style:var(--tw-border-style);border-width:0}#kite-chat-root .border-t{border-top-style:var(--tw-border-style);border-top-width:1px}#kite-chat-root .border-r-0{border-right-style:var(--tw-border-style);border-right-width:0}#kite-chat-root .border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}#kite-chat-root .border-l{border-left-style:var(--tw-border-style);border-left-width:1px}#kite-chat-root .border-amber-100{border-color:var(--color-amber-100)}#kite-chat-root .border-amber-200{border-color:var(--color-amber-200)}#kite-chat-root .border-blue-100{border-color:var(--color-blue-100)}#kite-chat-root .border-blue-200{border-color:var(--color-blue-200)}#kite-chat-root .border-blue-400{border-color:var(--color-blue-400)}#kite-chat-root .border-emerald-100{border-color:var(--color-emerald-100)}#kite-chat-root .border-emerald-200{border-color:var(--color-emerald-200)}#kite-chat-root .border-gray-100{border-color:var(--color-gray-100)}#kite-chat-root .border-gray-200{border-color:var(--color-gray-200)}#kite-chat-root .border-gray-300{border-color:var(--color-gray-300)}#kite-chat-root .border-gray-700{border-color:var(--color-gray-700)}#kite-chat-root .border-green-200{border-color:var(--color-green-200)}#kite-chat-root .border-input{border-color:var(--kite-input)}#kite-chat-root .border-primary\\/20{border-color:var(--kite-primary)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .border-primary\\/20{border-color:color-mix(in oklab,var(--kite-primary)20%,transparent)}}#kite-chat-root .border-purple-100{border-color:var(--color-purple-100)}#kite-chat-root .border-purple-200{border-color:var(--color-purple-200)}#kite-chat-root .border-red-200{border-color:var(--color-red-200)}#kite-chat-root .border-slate-200{border-color:var(--color-slate-200)}#kite-chat-root .border-t-transparent{border-top-color:#0000}#kite-chat-root .border-l-transparent{border-left-color:#0000}#kite-chat-root .bg-amber-50{background-color:var(--color-amber-50)}#kite-chat-root .bg-amber-100{background-color:var(--color-amber-100)}#kite-chat-root .bg-background{background-color:var(--kite-background)}#kite-chat-root .bg-blue-50{background-color:var(--color-blue-50)}#kite-chat-root .bg-blue-100{background-color:var(--color-blue-100)}#kite-chat-root .bg-blue-400{background-color:var(--color-blue-400)}#kite-chat-root .bg-blue-600{background-color:var(--color-blue-600)}#kite-chat-root .bg-border{background-color:var(--kite-border)}#kite-chat-root .bg-card{background-color:var(--kite-card)}#kite-chat-root .bg-destructive{background-color:var(--kite-destructive)}#kite-chat-root .bg-emerald-50{background-color:var(--color-emerald-50)}#kite-chat-root .bg-emerald-500{background-color:var(--color-emerald-500)}#kite-chat-root .bg-gray-50{background-color:var(--color-gray-50)}#kite-chat-root .bg-gray-100{background-color:var(--color-gray-100)}#kite-chat-root .bg-gray-200{background-color:var(--color-gray-200)}#kite-chat-root .bg-gray-500{background-color:var(--color-gray-500)}#kite-chat-root .bg-gray-700{background-color:var(--color-gray-700)}#kite-chat-root .bg-gray-800{background-color:var(--color-gray-800)}#kite-chat-root .bg-gray-900{background-color:var(--color-gray-900)}#kite-chat-root .bg-green-50{background-color:var(--color-green-50)}#kite-chat-root .bg-green-400{background-color:var(--color-green-400)}#kite-chat-root .bg-muted\\/40{background-color:var(--kite-muted)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .bg-muted\\/40{background-color:color-mix(in oklab,var(--kite-muted)40%,transparent)}}#kite-chat-root .bg-orange-100{background-color:var(--color-orange-100)}#kite-chat-root .bg-orange-400{background-color:var(--color-orange-400)}#kite-chat-root .bg-pink-400{background-color:var(--color-pink-400)}#kite-chat-root .bg-primary,#kite-chat-root .bg-primary\\/5{background-color:var(--kite-primary)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .bg-primary\\/5{background-color:color-mix(in oklab,var(--kite-primary)5%,transparent)}}#kite-chat-root .bg-purple-50{background-color:var(--color-purple-50)}#kite-chat-root .bg-purple-400{background-color:var(--color-purple-400)}#kite-chat-root .bg-red-50{background-color:var(--color-red-50)}#kite-chat-root .bg-red-100{background-color:var(--color-red-100)}#kite-chat-root .bg-red-500{background-color:var(--color-red-500)}#kite-chat-root .bg-secondary{background-color:var(--kite-secondary)}#kite-chat-root .bg-slate-50{background-color:var(--color-slate-50)}#kite-chat-root .bg-slate-100{background-color:var(--color-slate-100)}#kite-chat-root .bg-slate-300{background-color:var(--color-slate-300)}#kite-chat-root .bg-transparent{background-color:#0000}#kite-chat-root .bg-white{background-color:var(--color-white)}#kite-chat-root .bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}#kite-chat-root .from-gray-50{--tw-gradient-from:var(--color-gray-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}#kite-chat-root .to-white{--tw-gradient-to:var(--color-white);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}#kite-chat-root .object-cover{object-fit:cover}#kite-chat-root .p-0{padding:calc(var(--spacing)*0)}#kite-chat-root .p-2{padding:calc(var(--spacing)*2)}#kite-chat-root .p-3{padding:calc(var(--spacing)*3)}#kite-chat-root .p-4{padding:calc(var(--spacing)*4)}#kite-chat-root .p-6{padding:calc(var(--spacing)*6)}#kite-chat-root .p-px{padding:1px}#kite-chat-root .px-0{padding-inline:calc(var(--spacing)*0)}#kite-chat-root .px-1{padding-inline:calc(var(--spacing)*1)}#kite-chat-root .px-1\\.5{padding-inline:calc(var(--spacing)*1.5)}#kite-chat-root .px-2{padding-inline:calc(var(--spacing)*2)}#kite-chat-root .px-2\\.5{padding-inline:calc(var(--spacing)*2.5)}#kite-chat-root .px-3{padding-inline:calc(var(--spacing)*3)}#kite-chat-root .px-4{padding-inline:calc(var(--spacing)*4)}#kite-chat-root .px-6{padding-inline:calc(var(--spacing)*6)}#kite-chat-root .py-0{padding-block:calc(var(--spacing)*0)}#kite-chat-root .py-0\\.5{padding-block:calc(var(--spacing)*.5)}#kite-chat-root .py-1{padding-block:calc(var(--spacing)*1)}#kite-chat-root .py-1\\.5{padding-block:calc(var(--spacing)*1.5)}#kite-chat-root .py-2{padding-block:calc(var(--spacing)*2)}#kite-chat-root .py-2\\.5{padding-block:calc(var(--spacing)*2.5)}#kite-chat-root .py-3{padding-block:calc(var(--spacing)*3)}#kite-chat-root .py-4{padding-block:calc(var(--spacing)*4)}#kite-chat-root .py-6{padding-block:calc(var(--spacing)*6)}#kite-chat-root .py-8{padding-block:calc(var(--spacing)*8)}#kite-chat-root .pt-0{padding-top:calc(var(--spacing)*0)}#kite-chat-root .pt-2{padding-top:calc(var(--spacing)*2)}#kite-chat-root .pb-2{padding-bottom:calc(var(--spacing)*2)}#kite-chat-root .pb-3{padding-bottom:calc(var(--spacing)*3)}#kite-chat-root .pb-4{padding-bottom:calc(var(--spacing)*4)}#kite-chat-root .text-center{text-align:center}#kite-chat-root .text-left{text-align:left}#kite-chat-root .font-mono{font-family:var(--font-mono)}#kite-chat-root .text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}#kite-chat-root .text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}#kite-chat-root .text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}#kite-chat-root .text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}#kite-chat-root .text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}#kite-chat-root .text-\\[10px\\]{font-size:10px}#kite-chat-root .leading-6{--tw-leading:calc(var(--spacing)*6);line-height:calc(var(--spacing)*6)}#kite-chat-root .leading-none{--tw-leading:1;line-height:1}#kite-chat-root .font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}#kite-chat-root .font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}#kite-chat-root .font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}#kite-chat-root .tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}#kite-chat-root .tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}#kite-chat-root .whitespace-nowrap{white-space:nowrap}#kite-chat-root .whitespace-pre-wrap{white-space:pre-wrap}#kite-chat-root .text-amber-500{color:var(--color-amber-500)}#kite-chat-root .text-amber-600{color:var(--color-amber-600)}#kite-chat-root .text-amber-700{color:var(--color-amber-700)}#kite-chat-root .text-black{color:var(--color-black)}#kite-chat-root .text-blue-600{color:var(--color-blue-600)}#kite-chat-root .text-blue-700{color:var(--color-blue-700)}#kite-chat-root .text-card-foreground{color:var(--kite-card-foreground)}#kite-chat-root .text-emerald-500{color:var(--color-emerald-500)}#kite-chat-root .text-emerald-600{color:var(--color-emerald-600)}#kite-chat-root .text-emerald-700{color:var(--color-emerald-700)}#kite-chat-root .text-gray-300{color:var(--color-gray-300)}#kite-chat-root .text-gray-400{color:var(--color-gray-400)}#kite-chat-root .text-gray-500{color:var(--color-gray-500)}#kite-chat-root .text-gray-600{color:var(--color-gray-600)}#kite-chat-root .text-gray-700{color:var(--color-gray-700)}#kite-chat-root .text-gray-800{color:var(--color-gray-800)}#kite-chat-root .text-gray-900{color:var(--color-gray-900)}#kite-chat-root .text-green-500{color:var(--color-green-500)}#kite-chat-root .text-green-600{color:var(--color-green-600)}#kite-chat-root .text-green-700{color:var(--color-green-700)}#kite-chat-root .text-green-800{color:var(--color-green-800)}#kite-chat-root .text-muted-foreground{color:var(--kite-muted-foreground)}#kite-chat-root .text-orange-700{color:var(--color-orange-700)}#kite-chat-root .text-primary{color:var(--kite-primary)}#kite-chat-root .text-primary-foreground{color:var(--kite-primary-foreground)}#kite-chat-root .text-purple-600{color:var(--color-purple-600)}#kite-chat-root .text-purple-700{color:var(--color-purple-700)}#kite-chat-root .text-red-500{color:var(--color-red-500)}#kite-chat-root .text-red-600{color:var(--color-red-600)}#kite-chat-root .text-red-700{color:var(--color-red-700)}#kite-chat-root .text-secondary-foreground{color:var(--kite-secondary-foreground)}#kite-chat-root .text-slate-600{color:var(--color-slate-600)}#kite-chat-root .text-slate-700{color:var(--color-slate-700)}#kite-chat-root .text-white{color:var(--color-white)}#kite-chat-root .uppercase{text-transform:uppercase}#kite-chat-root .italic{font-style:italic}#kite-chat-root .line-through{text-decoration-line:line-through}#kite-chat-root .underline-offset-4{text-underline-offset:4px}#kite-chat-root .opacity-0{opacity:0}#kite-chat-root .opacity-60{opacity:.6}#kite-chat-root .opacity-70{opacity:.7}#kite-chat-root .opacity-90{opacity:.9}#kite-chat-root .opacity-100{opacity:1}#kite-chat-root .shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .ring-2{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .ring-blue-400{--tw-ring-color:var(--color-blue-400)}#kite-chat-root .outline{outline-style:var(--tw-outline-style);outline-width:1px}#kite-chat-root .filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}#kite-chat-root .transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}#kite-chat-root .transition-\\[color\\,box-shadow\\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}#kite-chat-root .transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}#kite-chat-root .transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}#kite-chat-root .transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}#kite-chat-root .duration-150{--tw-duration:.15s;transition-duration:.15s}#kite-chat-root .duration-200{--tw-duration:.2s;transition-duration:.2s}#kite-chat-root .duration-300{--tw-duration:.3s;transition-duration:.3s}#kite-chat-root .ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}#kite-chat-root .ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}#kite-chat-root .outline-none{--tw-outline-style:none;outline-style:none}#kite-chat-root .select-none{-webkit-user-select:none;user-select:none}#kite-chat-root .select-text{-webkit-user-select:text;user-select:text}#kite-chat-root .ring-inset{--tw-ring-inset:inset}@media (hover:hover){#kite-chat-root .group-hover\\:bg-gray-200:is(:where(.group):hover *){background-color:var(--color-gray-200)}#kite-chat-root .group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}}#kite-chat-root .selection\\:bg-primary ::selection{background-color:var(--kite-primary)}#kite-chat-root .selection\\:bg-primary::selection{background-color:var(--kite-primary)}#kite-chat-root .selection\\:text-primary-foreground ::selection{color:var(--kite-primary-foreground)}#kite-chat-root .selection\\:text-primary-foreground::selection{color:var(--kite-primary-foreground)}#kite-chat-root .file\\:inline-flex::file-selector-button{display:inline-flex}#kite-chat-root .file\\:h-7::file-selector-button{height:calc(var(--spacing)*7)}#kite-chat-root .file\\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}#kite-chat-root .file\\:bg-transparent::file-selector-button{background-color:#0000}#kite-chat-root .file\\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}#kite-chat-root .file\\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}#kite-chat-root .file\\:text-foreground::file-selector-button{color:var(--kite-foreground)}#kite-chat-root .placeholder\\:text-gray-400::placeholder{color:var(--color-gray-400)}#kite-chat-root .placeholder\\:text-muted-foreground::placeholder{color:var(--kite-muted-foreground)}#kite-chat-root .focus-within\\:border-gray-700:focus-within{border-color:var(--color-gray-700)}@media (hover:hover){#kite-chat-root .hover\\:border-gray-300:hover{border-color:var(--color-gray-300)}#kite-chat-root .hover\\:border-primary\\/30:hover{border-color:var(--kite-primary)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .hover\\:border-primary\\/30:hover{border-color:color-mix(in oklab,var(--kite-primary)30%,transparent)}}#kite-chat-root .hover\\:bg-accent:hover{background-color:var(--kite-accent)}#kite-chat-root .hover\\:bg-destructive\\/90:hover{background-color:var(--kite-destructive)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .hover\\:bg-destructive\\/90:hover{background-color:color-mix(in oklab,var(--kite-destructive)90%,transparent)}}#kite-chat-root .hover\\:bg-gray-50:hover{background-color:var(--color-gray-50)}#kite-chat-root .hover\\:bg-gray-100:hover{background-color:var(--color-gray-100)}#kite-chat-root .hover\\:bg-gray-200:hover{background-color:var(--color-gray-200)}#kite-chat-root .hover\\:bg-gray-600:hover{background-color:var(--color-gray-600)}#kite-chat-root .hover\\:bg-primary\\/10:hover{background-color:var(--kite-primary)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .hover\\:bg-primary\\/10:hover{background-color:color-mix(in oklab,var(--kite-primary)10%,transparent)}}#kite-chat-root .hover\\:bg-primary\\/90:hover{background-color:var(--kite-primary)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .hover\\:bg-primary\\/90:hover{background-color:color-mix(in oklab,var(--kite-primary)90%,transparent)}}#kite-chat-root .hover\\:bg-secondary\\/80:hover{background-color:var(--kite-secondary)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .hover\\:bg-secondary\\/80:hover{background-color:color-mix(in oklab,var(--kite-secondary)80%,transparent)}}#kite-chat-root .hover\\:text-accent-foreground:hover{color:var(--kite-accent-foreground)}#kite-chat-root .hover\\:text-blue-800:hover{color:var(--color-blue-800)}#kite-chat-root .hover\\:text-gray-600:hover{color:var(--color-gray-600)}#kite-chat-root .hover\\:text-gray-700:hover{color:var(--color-gray-700)}#kite-chat-root .hover\\:text-gray-800:hover{color:var(--color-gray-800)}#kite-chat-root .hover\\:underline:hover{text-decoration-line:underline}#kite-chat-root .hover\\:opacity-90:hover{opacity:.9}#kite-chat-root .hover\\:shadow-xl:hover{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}#kite-chat-root .focus\\:ring-primary:focus{--tw-ring-color:var(--kite-primary)}#kite-chat-root .focus-visible\\:border-ring:focus-visible{border-color:var(--kite-ring)}#kite-chat-root .focus-visible\\:ring-0:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .focus-visible\\:ring-\\[3px\\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:var(--kite-destructive)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:color-mix(in oklab,var(--kite-destructive)20%,transparent)}}#kite-chat-root .focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:var(--kite-ring)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:color-mix(in oklab,var(--kite-ring)50%,transparent)}}#kite-chat-root .focus-visible\\:ring-offset-0:focus-visible{--tw-ring-offset-width:0px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}#kite-chat-root .focus-visible\\:outline-1:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}#kite-chat-root .active\\:cursor-grabbing:active{cursor:grabbing}#kite-chat-root .disabled\\:pointer-events-none:disabled{pointer-events:none}#kite-chat-root .disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}#kite-chat-root .disabled\\:bg-gray-300:disabled{background-color:var(--color-gray-300)}#kite-chat-root .disabled\\:opacity-50:disabled{opacity:.5}#kite-chat-root .has-data-\\[slot\\=card-action\\]\\:grid-cols-\\[1fr_auto\\]:has([data-slot=card-action]){grid-template-columns:1fr auto}#kite-chat-root .has-\\[\\>svg\\]\\:px-2\\.5:has(>svg){padding-inline:calc(var(--spacing)*2.5)}#kite-chat-root .has-\\[\\>svg\\]\\:px-3:has(>svg){padding-inline:calc(var(--spacing)*3)}#kite-chat-root .has-\\[\\>svg\\]\\:px-4:has(>svg){padding-inline:calc(var(--spacing)*4)}#kite-chat-root .aria-invalid\\:border-destructive[aria-invalid=true]{border-color:var(--kite-destructive)}#kite-chat-root .aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:var(--kite-destructive)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--kite-destructive)20%,transparent)}}@media (min-width:48rem){#kite-chat-root .md\\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}#kite-chat-root .dark\\:border-input:is(.dark *){border-color:var(--kite-input)}#kite-chat-root .dark\\:bg-destructive\\/60:is(.dark *){background-color:var(--kite-destructive)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .dark\\:bg-destructive\\/60:is(.dark *){background-color:color-mix(in oklab,var(--kite-destructive)60%,transparent)}}#kite-chat-root .dark\\:bg-input\\/30:is(.dark *){background-color:var(--kite-input)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .dark\\:bg-input\\/30:is(.dark *){background-color:color-mix(in oklab,var(--kite-input)30%,transparent)}}@media (hover:hover){#kite-chat-root .dark\\:hover\\:bg-accent\\/50:is(.dark *):hover{background-color:var(--kite-accent)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .dark\\:hover\\:bg-accent\\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--kite-accent)50%,transparent)}}#kite-chat-root .dark\\:hover\\:bg-input\\/50:is(.dark *):hover{background-color:var(--kite-input)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .dark\\:hover\\:bg-input\\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--kite-input)50%,transparent)}}}#kite-chat-root .dark\\:focus-visible\\:ring-destructive\\/40:is(.dark *):focus-visible{--tw-ring-color:var(--kite-destructive)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .dark\\:focus-visible\\:ring-destructive\\/40:is(.dark *):focus-visible{--tw-ring-color:color-mix(in oklab,var(--kite-destructive)40%,transparent)}}#kite-chat-root .dark\\:aria-invalid\\:ring-destructive\\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--kite-destructive)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .dark\\:aria-invalid\\:ring-destructive\\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--kite-destructive)40%,transparent)}}#kite-chat-root .\\[\\&_svg\\]\\:pointer-events-none svg{pointer-events:none}#kite-chat-root .\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}#kite-chat-root .\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-4 svg:not([class*=size-]){width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}#kite-chat-root .\\[\\.border-b\\]\\:pb-6.border-b{padding-bottom:calc(var(--spacing)*6)}#kite-chat-root .\\[\\.border-t\\]\\:pt-6.border-t{padding-top:calc(var(--spacing)*6)}:root{--kite-radius:.625rem;--kite-background:oklch(100% 0 0);--kite-foreground:oklch(14.5% 0 0);--kite-card:oklch(100% 0 0);--kite-card-foreground:oklch(14.5% 0 0);--kite-popover:oklch(100% 0 0);--kite-popover-foreground:oklch(14.5% 0 0);--kite-primary:oklch(20.5% 0 0);--kite-primary-foreground:oklch(98.5% 0 0);--kite-secondary:oklch(97% 0 0);--kite-secondary-foreground:oklch(20.5% 0 0);--kite-muted:oklch(97% 0 0);--kite-muted-foreground:oklch(55.6% 0 0);--kite-accent:oklch(97% 0 0);--kite-accent-foreground:oklch(20.5% 0 0);--kite-destructive:oklch(57.7% .245 27.325);--kite-destructive-foreground:oklch(98.5% 0 0);--kite-border:oklch(92.2% 0 0);--kite-input:oklch(92.2% 0 0);--kite-ring:oklch(70.8% 0 0)}.dark{--kite-background:oklch(14.5% 0 0);--kite-foreground:oklch(98.5% 0 0);--kite-card:oklch(20.5% 0 0);--kite-card-foreground:oklch(98.5% 0 0);--kite-popover:oklch(20.5% 0 0);--kite-popover-foreground:oklch(98.5% 0 0);--kite-primary:oklch(92.2% 0 0);--kite-primary-foreground:oklch(20.5% 0 0);--kite-secondary:oklch(26.9% 0 0);--kite-secondary-foreground:oklch(98.5% 0 0);--kite-muted:oklch(26.9% 0 0);--kite-muted-foreground:oklch(70.8% 0 0);--kite-accent:oklch(26.9% 0 0);--kite-accent-foreground:oklch(98.5% 0 0);--kite-destructive:oklch(70.4% .191 22.216);--kite-destructive-foreground:oklch(98.5% 0 0);--kite-border:oklch(100% 0 0/.1);--kite-input:oklch(100% 0 0/.15);--kite-ring:oklch(55.6% 0 0);--kite-link:oklch(65% .15 250)}#kite-chat-root *{border-color:var(--kite-border)}#kite-chat-root section form input{color:var(--kite-foreground,#1a1a1a)!important}#kite-chat-root section form input::placeholder{color:var(--kite-muted-foreground,#9ca3af)!important}#kite-chat-root section .space-y-1>div+div{margin-top:.625rem}#kite-chat-root section>div.flex-1>div.overflow-y-auto{padding:1rem 1.25rem!important}#kite-chat-root section .mt-6.pt-4.border-t{margin-top:1.25rem;padding-top:1rem}#kite-chat-root section button.w-full.text-left.px-3{padding:.75rem 1rem}#kite-chat-root section .text-sm.leading-6{line-height:1.625rem}@keyframes spin{to{transform:rotate(360deg)}}#kite-chat-root .animate-spin{animation:1s linear infinite spin}#kite-chat-root [data-motion]{will-change:transform,opacity}#kite-chat-root a,#kite-chat-root .kite-link{word-break:break-word;overflow-wrap:break-word;-webkit-hyphens:auto;hyphens:auto;text-decoration:none;color:var(--kite-link)!important}#kite-chat-root a:hover,#kite-chat-root .kite-link:hover{text-decoration:underline}#kite-chat-root .text-sm.leading-6{overflow-wrap:break-word;word-break:break-word;max-width:100%}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes bounce{0%,to{animation-timing-function:cubic-bezier(.8,0,1,1);transform:translateY(-25%)}50%{animation-timing-function:cubic-bezier(0,0,.2,1);transform:none}}#kite-chat-root{--kite-link:oklch(55% .15 250)}`,document.head.appendChild(e);let t=document.createElement("style");t.id="kite-chat-position",t.textContent=`
46
81
  #kite-chat-root {
47
82
  /* Container is just a mount point - ChatPanel handles its own positioning */
48
83
  }
49
- `,document.head.appendChild(t)}function _p(){let e=window.KiteChatConfig;if(!e){console.error("[KiteChat] Missing window.KiteChatConfig");return}if(!e.userId){console.error("[KiteChat] userId is required");return}if(Ai){console.warn("[KiteChat] Already initialized");return}if(hM(),e.container){let t=typeof e.container=="string"?document.querySelector(e.container):e.container;if(!t){console.error(`[KiteChat] Container not found: ${e.container}`);return}Da=document.createElement("div"),Da.id="kite-chat-root",t.appendChild(Da)}else Da=document.createElement("div"),Da.id="kite-chat-root",document.body.appendChild(Da);Ai=(0,Wk.createRoot)(Da),Ai.render((0,ax.jsx)(mM,{initialConfig:e})),window.KiteChat=gM()}function gM(){return{setCurrentPage:e=>sa.setCurrentPage?.(e),setUser:e=>sa.setConfig?.({userId:e}),setConfig:e=>sa.setConfig?.(e),open:()=>sa.setIsOpen?.(!0),close:()=>sa.setIsOpen?.(!1),toggle:()=>{let e=sa.getIsOpen?.()??!1;sa.setIsOpen?.(!e)},isOpen:()=>sa.getIsOpen?.()??!1,destroy:()=>{Ai?.unmount(),Ai=null,Da?.remove(),Da=null,window.KiteChat=void 0},isMounted:()=>Ai!==null}}typeof window<"u"&&(window.KiteChatInit=_p,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",_p):_p());return Lx(yM);})();
84
+ `,document.head.appendChild(t)}function Lp(){let e=window.KiteChatConfig;if(!e){console.error("[KiteChat] Missing window.KiteChatConfig");return}if(!e.userId){console.error("[KiteChat] userId is required");return}if(Ni){console.warn("[KiteChat] Already initialized");return}if(MN(),e.container){let t=typeof e.container=="string"?document.querySelector(e.container):e.container;if(!t){console.error(`[KiteChat] Container not found: ${e.container}`);return}jr=document.createElement("div"),jr.id="kite-chat-root",t.appendChild(jr)}else jr=document.createElement("div"),jr.id="kite-chat-root",document.body.appendChild(jr);Ni=(0,Nk.createRoot)(jr),Ni.render((0,Zy.jsx)(NN,{initialConfig:e})),window.KiteChat=ON()}function ON(){return{setCurrentPage:e=>{console.log(`[KiteChat] API.setCurrentPage called with: "${e}"`),dr.setCurrentPage?.(e)},setUser:e=>dr.setConfig?.({userId:e}),setConfig:e=>dr.setConfig?.(e),open:()=>dr.setIsOpen?.(!0),close:()=>dr.setIsOpen?.(!1),toggle:()=>{let e=dr.getIsOpen?.()??!1;dr.setIsOpen?.(!e)},isOpen:()=>dr.getIsOpen?.()??!1,destroy:()=>{Ni?.unmount(),Ni=null,jr?.remove(),jr=null,window.KiteChat=void 0},isMounted:()=>Ni!==null}}typeof window<"u"&&(window.KiteChatInit=Lp,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Lp):Lp());return iP(BN);})();
50
85
  /*! Bundled license information:
51
86
 
52
87
  react/cjs/react.production.min.js: