@kite-copilot/chat-panel 0.2.43 → 0.2.45
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.
- package/dist/auto.cjs +174 -69
- package/dist/auto.js +1 -1
- package/dist/{chunk-XZM4VX5Y.js → chunk-262FS4KW.js} +182 -77
- package/dist/embed.global.js +21 -21
- package/dist/index.cjs +174 -69
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/embed.global.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
"use strict";var KiteChatEmbed=(()=>{var Pk=Object.create;var Eu=Object.defineProperty;var Tk=Object.getOwnPropertyDescriptor;var Ak=Object.getOwnPropertyNames;var Rk=Object.getPrototypeOf,_k=Object.prototype.hasOwnProperty;var Ek=(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 Dk=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ze=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Hy=(e,t)=>{for(var a in t)Eu(e,a,{get:t[a],enumerable:!0})},zy=(e,t,a,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ak(t))!_k.call(e,o)&&o!==a&&Eu(e,o,{get:()=>t[o],enumerable:!(r=Tk(t,o))||r.enumerable});return e};var M=(e,t,a)=>(a=e!=null?Pk(Rk(e)):{},zy(t||!e||!e.__esModule?Eu(a,"default",{value:e,enumerable:!0}):a,e)),$y=e=>zy(Eu({},"__esModule",{value:!0}),e);var rx=Ze(oe=>{"use strict";var Pi=Symbol.for("react.element"),Mk=Symbol.for("react.portal"),Nk=Symbol.for("react.fragment"),Ok=Symbol.for("react.strict_mode"),Fk=Symbol.for("react.profiler"),Bk=Symbol.for("react.provider"),Uk=Symbol.for("react.context"),Vk=Symbol.for("react.forward_ref"),jk=Symbol.for("react.suspense"),qk=Symbol.for("react.memo"),Hk=Symbol.for("react.lazy"),Wy=Symbol.iterator;function zk(e){return e===null||typeof e!="object"?null:(e=Wy&&e[Wy]||e["@@iterator"],typeof e=="function"?e:null)}var Xy={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Qy=Object.assign,Jy={};function En(e,t,a){this.props=e,this.context=t,this.refs=Jy,this.updater=a||Xy}En.prototype.isReactComponent={};En.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")};En.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Yy(){}Yy.prototype=En.prototype;function Lp(e,t,a){this.props=e,this.context=t,this.refs=Jy,this.updater=a||Xy}var Ip=Lp.prototype=new Yy;Ip.constructor=Lp;Qy(Ip,En.prototype);Ip.isPureReactComponent=!0;var Gy=Array.isArray,Zy=Object.prototype.hasOwnProperty,bp={current:null},ex={key:!0,ref:!0,__self:!0,__source:!0};function tx(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)Zy.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:Pi,type:e,key:n,ref:s,props:o,_owner:bp.current}}function $k(e,t){return{$$typeof:Pi,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function kp(e){return typeof e=="object"&&e!==null&&e.$$typeof===Pi}function Wk(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(a){return t[a]})}var Ky=/\/+/g;function Cp(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Wk(""+e.key):t.toString(36)}function Mu(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 Pi:case Mk:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+Cp(s,0):r,Gy(o)?(a="",e!=null&&(a=e.replace(Ky,"$&/")+"/"),Mu(o,t,a,"",function(u){return u})):o!=null&&(kp(o)&&(o=$k(o,a+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(Ky,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",Gy(e))for(var i=0;i<e.length;i++){n=e[i];var l=r+Cp(n,i);s+=Mu(n,t,a,l,o)}else if(l=zk(e),typeof l=="function")for(e=l.call(e),i=0;!(n=e.next()).done;)n=n.value,l=r+Cp(n,i++),s+=Mu(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 Du(e,t,a){if(e==null)return e;var r=[],o=0;return Mu(e,r,"","",function(n){return t.call(a,n,o++)}),r}function Gk(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 Lt={current:null},Nu={transition:null},Kk={ReactCurrentDispatcher:Lt,ReactCurrentBatchConfig:Nu,ReactCurrentOwner:bp};function ax(){throw Error("act(...) is not supported in production builds of React.")}oe.Children={map:Du,forEach:function(e,t,a){Du(e,function(){t.apply(this,arguments)},a)},count:function(e){var t=0;return Du(e,function(){t++}),t},toArray:function(e){return Du(e,function(t){return t})||[]},only:function(e){if(!kp(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};oe.Component=En;oe.Fragment=Nk;oe.Profiler=Fk;oe.PureComponent=Lp;oe.StrictMode=Ok;oe.Suspense=jk;oe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Kk;oe.act=ax;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=Qy({},e.props),o=e.key,n=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(n=t.ref,s=bp.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var i=e.type.defaultProps;for(l in t)Zy.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:Pi,type:e.type,key:o,ref:n,props:r,_owner:s}};oe.createContext=function(e){return e={$$typeof:Uk,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Bk,_context:e},e.Consumer=e};oe.createElement=tx;oe.createFactory=function(e){var t=tx.bind(null,e);return t.type=e,t};oe.createRef=function(){return{current:null}};oe.forwardRef=function(e){return{$$typeof:Vk,render:e}};oe.isValidElement=kp;oe.lazy=function(e){return{$$typeof:Hk,_payload:{_status:-1,_result:e},_init:Gk}};oe.memo=function(e,t){return{$$typeof:qk,type:e,compare:t===void 0?null:t}};oe.startTransition=function(e){var t=Nu.transition;Nu.transition={};try{e()}finally{Nu.transition=t}};oe.unstable_act=ax;oe.useCallback=function(e,t){return Lt.current.useCallback(e,t)};oe.useContext=function(e){return Lt.current.useContext(e)};oe.useDebugValue=function(){};oe.useDeferredValue=function(e){return Lt.current.useDeferredValue(e)};oe.useEffect=function(e,t){return Lt.current.useEffect(e,t)};oe.useId=function(){return Lt.current.useId()};oe.useImperativeHandle=function(e,t,a){return Lt.current.useImperativeHandle(e,t,a)};oe.useInsertionEffect=function(e,t){return Lt.current.useInsertionEffect(e,t)};oe.useLayoutEffect=function(e,t){return Lt.current.useLayoutEffect(e,t)};oe.useMemo=function(e,t){return Lt.current.useMemo(e,t)};oe.useReducer=function(e,t,a){return Lt.current.useReducer(e,t,a)};oe.useRef=function(e){return Lt.current.useRef(e)};oe.useState=function(e){return Lt.current.useState(e)};oe.useSyncExternalStore=function(e,t,a){return Lt.current.useSyncExternalStore(e,t,a)};oe.useTransition=function(){return Lt.current.useTransition()};oe.version="18.3.1"});var G=Ze((MD,ox)=>{"use strict";ox.exports=rx()});var mx=Ze(ve=>{"use strict";function Rp(e,t){var a=e.length;e.push(t);e:for(;0<a;){var r=a-1>>>1,o=e[r];if(0<Ou(o,t))e[r]=t,e[a]=o,a=r;else break e}}function ga(e){return e.length===0?null:e[0]}function Bu(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>Ou(i,a))l<o&&0>Ou(u,i)?(e[r]=u,e[l]=a,r=l):(e[r]=i,e[s]=a,r=s);else if(l<o&&0>Ou(u,a))e[r]=u,e[l]=a,r=l;else break e}}return t}function Ou(e,t){var a=e.sortIndex-t.sortIndex;return a!==0?a:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(nx=performance,ve.unstable_now=function(){return nx.now()}):(Pp=Date,sx=Pp.now(),ve.unstable_now=function(){return Pp.now()-sx});var nx,Pp,sx,Aa=[],Tr=[],Xk=1,ra=null,ht=3,Uu=!1,ko=!1,Ai=!1,ux=typeof setTimeout=="function"?setTimeout:null,dx=typeof clearTimeout=="function"?clearTimeout:null,ix=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _p(e){for(var t=ga(Tr);t!==null;){if(t.callback===null)Bu(Tr);else if(t.startTime<=e)Bu(Tr),t.sortIndex=t.expirationTime,Rp(Aa,t);else break;t=ga(Tr)}}function Ep(e){if(Ai=!1,_p(e),!ko)if(ga(Aa)!==null)ko=!0,Mp(Dp);else{var t=ga(Tr);t!==null&&Np(Ep,t.startTime-e)}}function Dp(e,t){ko=!1,Ai&&(Ai=!1,dx(Ri),Ri=-1),Uu=!0;var a=ht;try{for(_p(t),ra=ga(Aa);ra!==null&&(!(ra.expirationTime>t)||e&&!px());){var r=ra.callback;if(typeof r=="function"){ra.callback=null,ht=ra.priorityLevel;var o=r(ra.expirationTime<=t);t=ve.unstable_now(),typeof o=="function"?ra.callback=o:ra===ga(Aa)&&Bu(Aa),_p(t)}else Bu(Aa);ra=ga(Aa)}if(ra!==null)var n=!0;else{var s=ga(Tr);s!==null&&Np(Ep,s.startTime-t),n=!1}return n}finally{ra=null,ht=a,Uu=!1}}var Vu=!1,Fu=null,Ri=-1,cx=5,fx=-1;function px(){return!(ve.unstable_now()-fx<cx)}function Tp(){if(Fu!==null){var e=ve.unstable_now();fx=e;var t=!0;try{t=Fu(!0,e)}finally{t?Ti():(Vu=!1,Fu=null)}}else Vu=!1}var Ti;typeof ix=="function"?Ti=function(){ix(Tp)}:typeof MessageChannel<"u"?(Ap=new MessageChannel,lx=Ap.port2,Ap.port1.onmessage=Tp,Ti=function(){lx.postMessage(null)}):Ti=function(){ux(Tp,0)};var Ap,lx;function Mp(e){Fu=e,Vu||(Vu=!0,Ti())}function Np(e,t){Ri=ux(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(){ko||Uu||(ko=!0,Mp(Dp))};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"):cx=0<e?Math.floor(1e3/e):5};ve.unstable_getCurrentPriorityLevel=function(){return ht};ve.unstable_getFirstCallbackNode=function(){return ga(Aa)};ve.unstable_next=function(e){switch(ht){case 1:case 2:case 3:var t=3;break;default:t=ht}var a=ht;ht=t;try{return e()}finally{ht=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=ht;ht=e;try{return t()}finally{ht=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:Xk++,callback:t,priorityLevel:e,startTime:a,expirationTime:o,sortIndex:-1},a>r?(e.sortIndex=a,Rp(Tr,e),ga(Aa)===null&&e===ga(Tr)&&(Ai?(dx(Ri),Ri=-1):Ai=!0,Np(Ep,a-r))):(e.sortIndex=o,Rp(Aa,e),ko||Uu||(ko=!0,Mp(Dp))),e};ve.unstable_shouldYield=px;ve.unstable_wrapCallback=function(e){var t=ht;return function(){var a=ht;ht=t;try{return e.apply(this,arguments)}finally{ht=a}}}});var gx=Ze((OD,hx)=>{"use strict";hx.exports=mx()});var ww=Ze(Xt=>{"use strict";var Qk=G(),Gt=gx();function _(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 Lv=new Set,Yi={};function Uo(e,t){Zn(e,t),Zn(e+"Capture",t)}function Zn(e,t){for(Yi[e]=t,e=0;e<t.length;e++)Lv.add(t[e])}var rr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),om=Object.prototype.hasOwnProperty,Jk=/^[: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]*$/,yx={},xx={};function Yk(e){return om.call(xx,e)?!0:om.call(yx,e)?!1:Jk.test(e)?xx[e]=!0:(yx[e]=!0,!1)}function Zk(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 eP(e,t,a,r){if(t===null||typeof t>"u"||Zk(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 kt(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 st={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){st[e]=new kt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];st[t]=new kt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){st[e]=new kt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){st[e]=new kt(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){st[e]=new kt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){st[e]=new kt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){st[e]=new kt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){st[e]=new kt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){st[e]=new kt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Qm=/[\-:]([a-z])/g;function Jm(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(Qm,Jm);st[t]=new kt(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(Qm,Jm);st[t]=new kt(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(Qm,Jm);st[t]=new kt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){st[e]=new kt(e,1,!1,e.toLowerCase(),null,!1,!1)});st.xlinkHref=new kt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){st[e]=new kt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ym(e,t,a,r){var o=st.hasOwnProperty(t)?st[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(eP(t,a,o,r)&&(a=null),r||o===null?Yk(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 ir=Qk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ju=Symbol.for("react.element"),Nn=Symbol.for("react.portal"),On=Symbol.for("react.fragment"),Zm=Symbol.for("react.strict_mode"),nm=Symbol.for("react.profiler"),Iv=Symbol.for("react.provider"),bv=Symbol.for("react.context"),eh=Symbol.for("react.forward_ref"),sm=Symbol.for("react.suspense"),im=Symbol.for("react.suspense_list"),th=Symbol.for("react.memo"),Rr=Symbol.for("react.lazy"),kv=Symbol.for("react.offscreen"),vx=Symbol.iterator;function _i(e){return e===null||typeof e!="object"?null:(e=vx&&e[vx]||e["@@iterator"],typeof e=="function"?e:null)}var Ee=Object.assign,Op;function Ui(e){if(Op===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Op=t&&t[1]||""}return`
|
|
2
|
-
`+
|
|
1
|
+
"use strict";var KiteChatEmbed=(()=>{var _k=Object.create;var Nu=Object.defineProperty;var Ek=Object.getOwnPropertyDescriptor;var Dk=Object.getOwnPropertyNames;var Mk=Object.getPrototypeOf,Nk=Object.prototype.hasOwnProperty;var Ok=(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 Fk=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ye=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Wy=(e,t)=>{for(var a in t)Nu(e,a,{get:t[a],enumerable:!0})},Gy=(e,t,a,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Dk(t))!Nk.call(e,o)&&o!==a&&Nu(e,o,{get:()=>t[o],enumerable:!(r=Ek(t,o))||r.enumerable});return e};var N=(e,t,a)=>(a=e!=null?_k(Mk(e)):{},Gy(t||!e||!e.__esModule?Nu(a,"default",{value:e,enumerable:!0}):a,e)),Ky=e=>Gy(Nu({},"__esModule",{value:!0}),e);var sx=Ye(oe=>{"use strict";var Ti=Symbol.for("react.element"),Bk=Symbol.for("react.portal"),Uk=Symbol.for("react.fragment"),Vk=Symbol.for("react.strict_mode"),jk=Symbol.for("react.profiler"),qk=Symbol.for("react.provider"),zk=Symbol.for("react.context"),Hk=Symbol.for("react.forward_ref"),$k=Symbol.for("react.suspense"),Wk=Symbol.for("react.memo"),Gk=Symbol.for("react.lazy"),Xy=Symbol.iterator;function Kk(e){return e===null||typeof e!="object"?null:(e=Xy&&e[Xy]||e["@@iterator"],typeof e=="function"?e:null)}var Yy={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Zy=Object.assign,ex={};function Dn(e,t,a){this.props=e,this.context=t,this.refs=ex,this.updater=a||Yy}Dn.prototype.isReactComponent={};Dn.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")};Dn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function tx(){}tx.prototype=Dn.prototype;function kp(e,t,a){this.props=e,this.context=t,this.refs=ex,this.updater=a||Yy}var Pp=kp.prototype=new tx;Pp.constructor=kp;Zy(Pp,Dn.prototype);Pp.isPureReactComponent=!0;var Qy=Array.isArray,ax=Object.prototype.hasOwnProperty,Tp={current:null},rx={key:!0,ref:!0,__self:!0,__source:!0};function ox(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)ax.call(t,r)&&!rx.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:Ti,type:e,key:n,ref:s,props:o,_owner:Tp.current}}function Xk(e,t){return{$$typeof:Ti,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Ap(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ti}function Qk(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(a){return t[a]})}var Jy=/\/+/g;function bp(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Qk(""+e.key):t.toString(36)}function Fu(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 Ti:case Bk:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+bp(s,0):r,Qy(o)?(a="",e!=null&&(a=e.replace(Jy,"$&/")+"/"),Fu(o,t,a,"",function(u){return u})):o!=null&&(Ap(o)&&(o=Xk(o,a+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(Jy,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",Qy(e))for(var i=0;i<e.length;i++){n=e[i];var l=r+bp(n,i);s+=Fu(n,t,a,l,o)}else if(l=Kk(e),typeof l=="function")for(e=l.call(e),i=0;!(n=e.next()).done;)n=n.value,l=r+bp(n,i++),s+=Fu(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 Ou(e,t,a){if(e==null)return e;var r=[],o=0;return Fu(e,r,"","",function(n){return t.call(a,n,o++)}),r}function Jk(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 Lt={current:null},Bu={transition:null},Yk={ReactCurrentDispatcher:Lt,ReactCurrentBatchConfig:Bu,ReactCurrentOwner:Tp};function nx(){throw Error("act(...) is not supported in production builds of React.")}oe.Children={map:Ou,forEach:function(e,t,a){Ou(e,function(){t.apply(this,arguments)},a)},count:function(e){var t=0;return Ou(e,function(){t++}),t},toArray:function(e){return Ou(e,function(t){return t})||[]},only:function(e){if(!Ap(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};oe.Component=Dn;oe.Fragment=Uk;oe.Profiler=jk;oe.PureComponent=kp;oe.StrictMode=Vk;oe.Suspense=$k;oe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Yk;oe.act=nx;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=Zy({},e.props),o=e.key,n=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(n=t.ref,s=Tp.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var i=e.type.defaultProps;for(l in t)ax.call(t,l)&&!rx.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:Ti,type:e.type,key:o,ref:n,props:r,_owner:s}};oe.createContext=function(e){return e={$$typeof:zk,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:qk,_context:e},e.Consumer=e};oe.createElement=ox;oe.createFactory=function(e){var t=ox.bind(null,e);return t.type=e,t};oe.createRef=function(){return{current:null}};oe.forwardRef=function(e){return{$$typeof:Hk,render:e}};oe.isValidElement=Ap;oe.lazy=function(e){return{$$typeof:Gk,_payload:{_status:-1,_result:e},_init:Jk}};oe.memo=function(e,t){return{$$typeof:Wk,type:e,compare:t===void 0?null:t}};oe.startTransition=function(e){var t=Bu.transition;Bu.transition={};try{e()}finally{Bu.transition=t}};oe.unstable_act=nx;oe.useCallback=function(e,t){return Lt.current.useCallback(e,t)};oe.useContext=function(e){return Lt.current.useContext(e)};oe.useDebugValue=function(){};oe.useDeferredValue=function(e){return Lt.current.useDeferredValue(e)};oe.useEffect=function(e,t){return Lt.current.useEffect(e,t)};oe.useId=function(){return Lt.current.useId()};oe.useImperativeHandle=function(e,t,a){return Lt.current.useImperativeHandle(e,t,a)};oe.useInsertionEffect=function(e,t){return Lt.current.useInsertionEffect(e,t)};oe.useLayoutEffect=function(e,t){return Lt.current.useLayoutEffect(e,t)};oe.useMemo=function(e,t){return Lt.current.useMemo(e,t)};oe.useReducer=function(e,t,a){return Lt.current.useReducer(e,t,a)};oe.useRef=function(e){return Lt.current.useRef(e)};oe.useState=function(e){return Lt.current.useState(e)};oe.useSyncExternalStore=function(e,t,a){return Lt.current.useSyncExternalStore(e,t,a)};oe.useTransition=function(){return Lt.current.useTransition()};oe.version="18.3.1"});var W=Ye((BD,ix)=>{"use strict";ix.exports=sx()});var yx=Ye(ve=>{"use strict";function Dp(e,t){var a=e.length;e.push(t);e:for(;0<a;){var r=a-1>>>1,o=e[r];if(0<Uu(o,t))e[r]=t,e[a]=o,a=r;else break e}}function ga(e){return e.length===0?null:e[0]}function ju(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>Uu(i,a))l<o&&0>Uu(u,i)?(e[r]=u,e[l]=a,r=l):(e[r]=i,e[s]=a,r=s);else if(l<o&&0>Uu(u,a))e[r]=u,e[l]=a,r=l;else break e}}return t}function Uu(e,t){var a=e.sortIndex-t.sortIndex;return a!==0?a:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(lx=performance,ve.unstable_now=function(){return lx.now()}):(Rp=Date,ux=Rp.now(),ve.unstable_now=function(){return Rp.now()-ux});var lx,Rp,ux,Ra=[],Rr=[],Zk=1,na=null,mt=3,qu=!1,Po=!1,Ri=!1,fx=typeof setTimeout=="function"?setTimeout:null,px=typeof clearTimeout=="function"?clearTimeout:null,dx=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function Mp(e){for(var t=ga(Rr);t!==null;){if(t.callback===null)ju(Rr);else if(t.startTime<=e)ju(Rr),t.sortIndex=t.expirationTime,Dp(Ra,t);else break;t=ga(Rr)}}function Np(e){if(Ri=!1,Mp(e),!Po)if(ga(Ra)!==null)Po=!0,Fp(Op);else{var t=ga(Rr);t!==null&&Bp(Np,t.startTime-e)}}function Op(e,t){Po=!1,Ri&&(Ri=!1,px(_i),_i=-1),qu=!0;var a=mt;try{for(Mp(t),na=ga(Ra);na!==null&&(!(na.expirationTime>t)||e&&!gx());){var r=na.callback;if(typeof r=="function"){na.callback=null,mt=na.priorityLevel;var o=r(na.expirationTime<=t);t=ve.unstable_now(),typeof o=="function"?na.callback=o:na===ga(Ra)&&ju(Ra),Mp(t)}else ju(Ra);na=ga(Ra)}if(na!==null)var n=!0;else{var s=ga(Rr);s!==null&&Bp(Np,s.startTime-t),n=!1}return n}finally{na=null,mt=a,qu=!1}}var zu=!1,Vu=null,_i=-1,mx=5,hx=-1;function gx(){return!(ve.unstable_now()-hx<mx)}function _p(){if(Vu!==null){var e=ve.unstable_now();hx=e;var t=!0;try{t=Vu(!0,e)}finally{t?Ai():(zu=!1,Vu=null)}}else zu=!1}var Ai;typeof dx=="function"?Ai=function(){dx(_p)}:typeof MessageChannel<"u"?(Ep=new MessageChannel,cx=Ep.port2,Ep.port1.onmessage=_p,Ai=function(){cx.postMessage(null)}):Ai=function(){fx(_p,0)};var Ep,cx;function Fp(e){Vu=e,zu||(zu=!0,Ai())}function Bp(e,t){_i=fx(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(){Po||qu||(Po=!0,Fp(Op))};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"):mx=0<e?Math.floor(1e3/e):5};ve.unstable_getCurrentPriorityLevel=function(){return mt};ve.unstable_getFirstCallbackNode=function(){return ga(Ra)};ve.unstable_next=function(e){switch(mt){case 1:case 2:case 3:var t=3;break;default:t=mt}var a=mt;mt=t;try{return e()}finally{mt=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=mt;mt=e;try{return t()}finally{mt=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:Zk++,callback:t,priorityLevel:e,startTime:a,expirationTime:o,sortIndex:-1},a>r?(e.sortIndex=a,Dp(Rr,e),ga(Ra)===null&&e===ga(Rr)&&(Ri?(px(_i),_i=-1):Ri=!0,Bp(Np,a-r))):(e.sortIndex=o,Dp(Ra,e),Po||qu||(Po=!0,Fp(Op))),e};ve.unstable_shouldYield=gx;ve.unstable_wrapCallback=function(e){var t=mt;return function(){var a=mt;mt=t;try{return e.apply(this,arguments)}finally{mt=a}}}});var vx=Ye((VD,xx)=>{"use strict";xx.exports=yx()});var Lw=Ye(Xt=>{"use strict";var eP=W(),Gt=vx();function _(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 kv=new Set,Zi={};function Vo(e,t){es(e,t),es(e+"Capture",t)}function es(e,t){for(Zi[e]=t,e=0;e<t.length;e++)kv.add(t[e])}var rr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),im=Object.prototype.hasOwnProperty,tP=/^[: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]*$/,wx={},Cx={};function aP(e){return im.call(Cx,e)?!0:im.call(wx,e)?!1:tP.test(e)?Cx[e]=!0:(wx[e]=!0,!1)}function rP(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 oP(e,t,a,r){if(t===null||typeof t>"u"||rP(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 kt(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 it={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){it[e]=new kt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];it[t]=new kt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){it[e]=new kt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){it[e]=new kt(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){it[e]=new kt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){it[e]=new kt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){it[e]=new kt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){it[e]=new kt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){it[e]=new kt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Zm=/[\-:]([a-z])/g;function eh(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(Zm,eh);it[t]=new kt(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(Zm,eh);it[t]=new kt(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(Zm,eh);it[t]=new kt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){it[e]=new kt(e,1,!1,e.toLowerCase(),null,!1,!1)});it.xlinkHref=new kt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){it[e]=new kt(e,1,!1,e.toLowerCase(),null,!0,!0)});function th(e,t,a,r){var o=it.hasOwnProperty(t)?it[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(oP(t,a,o,r)&&(a=null),r||o===null?aP(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 ir=eP.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Hu=Symbol.for("react.element"),On=Symbol.for("react.portal"),Fn=Symbol.for("react.fragment"),ah=Symbol.for("react.strict_mode"),lm=Symbol.for("react.profiler"),Pv=Symbol.for("react.provider"),Tv=Symbol.for("react.context"),rh=Symbol.for("react.forward_ref"),um=Symbol.for("react.suspense"),dm=Symbol.for("react.suspense_list"),oh=Symbol.for("react.memo"),Er=Symbol.for("react.lazy"),Av=Symbol.for("react.offscreen"),Sx=Symbol.iterator;function Ei(e){return e===null||typeof e!="object"?null:(e=Sx&&e[Sx]||e["@@iterator"],typeof e=="function"?e:null)}var Ee=Object.assign,Up;function Vi(e){if(Up===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Up=t&&t[1]||""}return`
|
|
2
|
+
`+Up+e}var Vp=!1;function jp(e,t){if(!e||Vp)return"";Vp=!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
3
|
`),n=r.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{Fp=!1,Error.prepareStackTrace=a}return(e=e?e.displayName||e.name:"")?Ui(e):""}function tP(e){switch(e.tag){case 5:return Ui(e.type);case 16:return Ui("Lazy");case 13:return Ui("Suspense");case 19:return Ui("SuspenseList");case 0:case 2:case 15:return e=Bp(e.type,!1),e;case 11:return e=Bp(e.type.render,!1),e;case 1:return e=Bp(e.type,!0),e;default:return""}}function lm(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 On:return"Fragment";case Nn:return"Portal";case nm:return"Profiler";case Zm:return"StrictMode";case sm:return"Suspense";case im:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case bv:return(e.displayName||"Context")+".Consumer";case Iv:return(e._context.displayName||"Context")+".Provider";case eh: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:lm(e.type)||"Memo";case Rr:t=e._payload,e=e._init;try{return lm(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 lm(t);case 8:return t===Zm?"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 Pv(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function rP(e){var t=Pv(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 qu(e){e._valueTracker||(e._valueTracker=rP(e))}function Tv(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),r="";return e&&(r=Pv(e)?e.checked?"true":"false":e.value),e=r,e!==a?(t.setValue(e),!0):!1}function gd(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 um(e,t){var a=t.checked;return Ee({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:a??e._wrapperState.initialChecked})}function wx(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 Av(e,t){t=t.checked,t!=null&&Ym(e,"checked",t,!1)}function dm(e,t){Av(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")?cm(e,t.type,a):t.hasOwnProperty("defaultValue")&&cm(e,t.type,zr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Sx(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 cm(e,t,a){(t!=="number"||gd(e.ownerDocument)!==e)&&(a==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+a&&(e.defaultValue=""+a))}var Vi=Array.isArray;function Gn(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 fm(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(_(91));return Ee({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Cx(e,t){var a=t.value;if(a==null){if(a=t.children,t=t.defaultValue,a!=null){if(t!=null)throw Error(_(92));if(Vi(a)){if(1<a.length)throw Error(_(93));a=a[0]}t=a}t==null&&(t=""),a=t}e._wrapperState={initialValue:zr(a)}}function Rv(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 Lx(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function _v(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 pm(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?_v(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Hu,Ev=(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(Hu=Hu||document.createElement("div"),Hu.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Hu.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Zi(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var Hi={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},oP=["Webkit","ms","Moz","O"];Object.keys(Hi).forEach(function(e){oP.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Hi[t]=Hi[e]})});function Dv(e,t,a){return t==null||typeof t=="boolean"||t===""?"":a||typeof t!="number"||t===0||Hi.hasOwnProperty(e)&&Hi[e]?(""+t).trim():t+"px"}function Mv(e,t){e=e.style;for(var a in t)if(t.hasOwnProperty(a)){var r=a.indexOf("--")===0,o=Dv(a,t[a],r);a==="float"&&(a="cssFloat"),r?e.setProperty(a,o):e[a]=o}}var nP=Ee({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 mm(e,t){if(t){if(nP[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(_(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(_(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(_(61))}if(t.style!=null&&typeof t.style!="object")throw Error(_(62))}}function hm(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 gm=null;function ah(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ym=null,Kn=null,Xn=null;function Ix(e){if(e=yl(e)){if(typeof ym!="function")throw Error(_(280));var t=e.stateNode;t&&(t=zd(t),ym(e.stateNode,e.type,t))}}function Nv(e){Kn?Xn?Xn.push(e):Xn=[e]:Kn=e}function Ov(){if(Kn){var e=Kn,t=Xn;if(Xn=Kn=null,Ix(e),t)for(e=0;e<t.length;e++)Ix(t[e])}}function Fv(e,t){return e(t)}function Bv(){}var Up=!1;function Uv(e,t,a){if(Up)return e(t,a);Up=!0;try{return Fv(e,t,a)}finally{Up=!1,(Kn!==null||Xn!==null)&&(Bv(),Ov())}}function el(e,t){var a=e.stateNode;if(a===null)return null;var r=zd(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(_(231,t,typeof a));return a}var xm=!1;if(rr)try{Dn={},Object.defineProperty(Dn,"passive",{get:function(){xm=!0}}),window.addEventListener("test",Dn,Dn),window.removeEventListener("test",Dn,Dn)}catch{xm=!1}var Dn;function sP(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 zi=!1,yd=null,xd=!1,vm=null,iP={onError:function(e){zi=!0,yd=e}};function lP(e,t,a,r,o,n,s,i,l){zi=!1,yd=null,sP.apply(iP,arguments)}function uP(e,t,a,r,o,n,s,i,l){if(lP.apply(this,arguments),zi){if(zi){var u=yd;zi=!1,yd=null}else throw Error(_(198));xd||(xd=!0,vm=u)}}function Vo(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 Vv(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 bx(e){if(Vo(e)!==e)throw Error(_(188))}function dP(e){var t=e.alternate;if(!t){if(t=Vo(e),t===null)throw Error(_(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 bx(o),e;if(n===r)return bx(o),t;n=n.sibling}throw Error(_(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(_(189))}}if(a.alternate!==r)throw Error(_(190))}if(a.tag!==3)throw Error(_(188));return a.stateNode.current===a?e:t}function jv(e){return e=dP(e),e!==null?qv(e):null}function qv(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=qv(e);if(t!==null)return t;e=e.sibling}return null}var Hv=Gt.unstable_scheduleCallback,kx=Gt.unstable_cancelCallback,cP=Gt.unstable_shouldYield,fP=Gt.unstable_requestPaint,Fe=Gt.unstable_now,pP=Gt.unstable_getCurrentPriorityLevel,rh=Gt.unstable_ImmediatePriority,zv=Gt.unstable_UserBlockingPriority,vd=Gt.unstable_NormalPriority,mP=Gt.unstable_LowPriority,$v=Gt.unstable_IdlePriority,Vd=null,Da=null;function hP(e){if(Da&&typeof Da.onCommitFiberRoot=="function")try{Da.onCommitFiberRoot(Vd,e,void 0,(e.current.flags&128)===128)}catch{}}var Sa=Math.clz32?Math.clz32:xP,gP=Math.log,yP=Math.LN2;function xP(e){return e>>>=0,e===0?32:31-(gP(e)/yP|0)|0}var zu=64,$u=4194304;function ji(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 wd(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=ji(i):(n&=s,n!==0&&(r=ji(n)))}else s=a&~o,s!==0?r=ji(s):n!==0&&(r=ji(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-Sa(t),o=1<<a,r|=e[a],t&=~o;return r}function vP(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 wP(e,t){for(var a=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,n=e.pendingLanes;0<n;){var s=31-Sa(n),i=1<<s,l=o[s];l===-1?((i&a)===0||(i&r)!==0)&&(o[s]=vP(i,t)):l<=t&&(e.expiredLanes|=i),n&=~i}}function wm(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Wv(){var e=zu;return zu<<=1,(zu&4194240)===0&&(zu=64),e}function Vp(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function hl(e,t,a){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Sa(t),e[t]=a}function SP(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-Sa(a),n=1<<o;t[o]=0,r[o]=-1,e[o]=-1,a&=~n}}function oh(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var r=31-Sa(a),o=1<<r;o&t|e[r]&t&&(e[r]|=t),a&=~o}}var me=0;function Gv(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var Kv,nh,Xv,Qv,Jv,Sm=!1,Wu=[],Or=null,Fr=null,Br=null,tl=new Map,al=new Map,Er=[],CP="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 Px(e,t){switch(e){case"focusin":case"focusout":Or=null;break;case"dragenter":case"dragleave":Fr=null;break;case"mouseover":case"mouseout":Br=null;break;case"pointerover":case"pointerout":tl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":al.delete(t.pointerId)}}function Ei(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=yl(t),t!==null&&nh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function LP(e,t,a,r,o){switch(t){case"focusin":return Or=Ei(Or,e,t,a,r,o),!0;case"dragenter":return Fr=Ei(Fr,e,t,a,r,o),!0;case"mouseover":return Br=Ei(Br,e,t,a,r,o),!0;case"pointerover":var n=o.pointerId;return tl.set(n,Ei(tl.get(n)||null,e,t,a,r,o)),!0;case"gotpointercapture":return n=o.pointerId,al.set(n,Ei(al.get(n)||null,e,t,a,r,o)),!0}return!1}function Yv(e){var t=Ao(e.target);if(t!==null){var a=Vo(t);if(a!==null){if(t=a.tag,t===13){if(t=Vv(a),t!==null){e.blockedOn=t,Jv(e.priority,function(){Xv(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 sd(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Cm(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(a===null){a=e.nativeEvent;var r=new a.constructor(a.type,a);gm=r,a.target.dispatchEvent(r),gm=null}else return t=yl(a),t!==null&&nh(t),e.blockedOn=a,!1;t.shift()}return!0}function Tx(e,t,a){sd(e)&&a.delete(t)}function IP(){Sm=!1,Or!==null&&sd(Or)&&(Or=null),Fr!==null&&sd(Fr)&&(Fr=null),Br!==null&&sd(Br)&&(Br=null),tl.forEach(Tx),al.forEach(Tx)}function Di(e,t){e.blockedOn===t&&(e.blockedOn=null,Sm||(Sm=!0,Gt.unstable_scheduleCallback(Gt.unstable_NormalPriority,IP)))}function rl(e){function t(o){return Di(o,e)}if(0<Wu.length){Di(Wu[0],e);for(var a=1;a<Wu.length;a++){var r=Wu[a];r.blockedOn===e&&(r.blockedOn=null)}}for(Or!==null&&Di(Or,e),Fr!==null&&Di(Fr,e),Br!==null&&Di(Br,e),tl.forEach(t),al.forEach(t),a=0;a<Er.length;a++)r=Er[a],r.blockedOn===e&&(r.blockedOn=null);for(;0<Er.length&&(a=Er[0],a.blockedOn===null);)Yv(a),a.blockedOn===null&&Er.shift()}var Qn=ir.ReactCurrentBatchConfig,Sd=!0;function bP(e,t,a,r){var o=me,n=Qn.transition;Qn.transition=null;try{me=1,sh(e,t,a,r)}finally{me=o,Qn.transition=n}}function kP(e,t,a,r){var o=me,n=Qn.transition;Qn.transition=null;try{me=4,sh(e,t,a,r)}finally{me=o,Qn.transition=n}}function sh(e,t,a,r){if(Sd){var o=Cm(e,t,a,r);if(o===null)Gp(e,t,r,Cd,a),Px(e,r);else if(LP(o,e,t,a,r))r.stopPropagation();else if(Px(e,r),t&4&&-1<CP.indexOf(e)){for(;o!==null;){var n=yl(o);if(n!==null&&Kv(n),n=Cm(e,t,a,r),n===null&&Gp(e,t,r,Cd,a),n===o)break;o=n}o!==null&&r.stopPropagation()}else Gp(e,t,r,null,a)}}var Cd=null;function Cm(e,t,a,r){if(Cd=null,e=ah(r),e=Ao(e),e!==null)if(t=Vo(e),t===null)e=null;else if(a=t.tag,a===13){if(e=Vv(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 Cd=e,null}function Zv(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(pP()){case rh:return 1;case zv:return 4;case vd:case mP:return 16;case $v:return 536870912;default:return 16}default:return 16}}var Mr=null,ih=null,id=null;function e0(){if(id)return id;var e,t=ih,a=t.length,r,o="value"in Mr?Mr.value:Mr.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 id=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 Gu(){return!0}function Ax(){return!1}function Kt(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)?Gu:Ax,this.isPropagationStopped=Ax,this}return Ee(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=Gu)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Gu)},persist:function(){},isPersistent:Gu}),t}var ss={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},lh=Kt(ss),gl=Ee({},ss,{view:0,detail:0}),PP=Kt(gl),jp,qp,Mi,jd=Ee({},gl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:uh,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!==Mi&&(Mi&&e.type==="mousemove"?(jp=e.screenX-Mi.screenX,qp=e.screenY-Mi.screenY):qp=jp=0,Mi=e),jp)},movementY:function(e){return"movementY"in e?e.movementY:qp}}),Rx=Kt(jd),TP=Ee({},jd,{dataTransfer:0}),AP=Kt(TP),RP=Ee({},gl,{relatedTarget:0}),Hp=Kt(RP),_P=Ee({},ss,{animationName:0,elapsedTime:0,pseudoElement:0}),EP=Kt(_P),DP=Ee({},ss,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),MP=Kt(DP),NP=Ee({},ss,{data:0}),_x=Kt(NP),OP={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},FP={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"},BP={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function UP(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=BP[e])?!!t[e]:!1}function uh(){return UP}var VP=Ee({},gl,{key:function(e){if(e.key){var t=OP[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"?FP[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:uh,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}}),jP=Kt(VP),qP=Ee({},jd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ex=Kt(qP),HP=Ee({},gl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:uh}),zP=Kt(HP),$P=Ee({},ss,{propertyName:0,elapsedTime:0,pseudoElement:0}),WP=Kt($P),GP=Ee({},jd,{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}),KP=Kt(GP),XP=[9,13,27,32],dh=rr&&"CompositionEvent"in window,$i=null;rr&&"documentMode"in document&&($i=document.documentMode);var QP=rr&&"TextEvent"in window&&!$i,t0=rr&&(!dh||$i&&8<$i&&11>=$i),Dx=" ",Mx=!1;function a0(e,t){switch(e){case"keyup":return XP.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function r0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Fn=!1;function JP(e,t){switch(e){case"compositionend":return r0(t);case"keypress":return t.which!==32?null:(Mx=!0,Dx);case"textInput":return e=t.data,e===Dx&&Mx?null:e;default:return null}}function YP(e,t){if(Fn)return e==="compositionend"||!dh&&a0(e,t)?(e=e0(),id=ih=Mr=null,Fn=!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 t0&&t.locale!=="ko"?null:t.data;default:return null}}var ZP={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 Nx(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ZP[e.type]:t==="textarea"}function o0(e,t,a,r){Nv(r),t=Ld(t,"onChange"),0<t.length&&(a=new lh("onChange","change",null,a,r),e.push({event:a,listeners:t}))}var Wi=null,ol=null;function eT(e){h0(e,0)}function qd(e){var t=Vn(e);if(Tv(t))return e}function tT(e,t){if(e==="change")return t}var n0=!1;rr&&(rr?(Xu="oninput"in document,Xu||(zp=document.createElement("div"),zp.setAttribute("oninput","return;"),Xu=typeof zp.oninput=="function"),Ku=Xu):Ku=!1,n0=Ku&&(!document.documentMode||9<document.documentMode));var Ku,Xu,zp;function Ox(){Wi&&(Wi.detachEvent("onpropertychange",s0),ol=Wi=null)}function s0(e){if(e.propertyName==="value"&&qd(ol)){var t=[];o0(t,ol,e,ah(e)),Uv(eT,t)}}function aT(e,t,a){e==="focusin"?(Ox(),Wi=t,ol=a,Wi.attachEvent("onpropertychange",s0)):e==="focusout"&&Ox()}function rT(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return qd(ol)}function oT(e,t){if(e==="click")return qd(t)}function nT(e,t){if(e==="input"||e==="change")return qd(t)}function sT(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var La=typeof Object.is=="function"?Object.is:sT;function nl(e,t){if(La(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(!om.call(t,o)||!La(e[o],t[o]))return!1}return!0}function Fx(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Bx(e,t){var a=Fx(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=Fx(a)}}function i0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?i0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function l0(){for(var e=window,t=gd();t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=gd(e.document)}return t}function ch(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 iT(e){var t=l0(),a=e.focusedElem,r=e.selectionRange;if(t!==a&&a&&a.ownerDocument&&i0(a.ownerDocument.documentElement,a)){if(r!==null&&ch(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=Bx(a,n);var s=Bx(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 lT=rr&&"documentMode"in document&&11>=document.documentMode,Bn=null,Lm=null,Gi=null,Im=!1;function Ux(e,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Im||Bn==null||Bn!==gd(r)||(r=Bn,"selectionStart"in r&&ch(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}),Gi&&nl(Gi,r)||(Gi=r,r=Ld(Lm,"onSelect"),0<r.length&&(t=new lh("onSelect","select",null,t,a),e.push({event:t,listeners:r}),t.target=Bn)))}function Qu(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Un={animationend:Qu("Animation","AnimationEnd"),animationiteration:Qu("Animation","AnimationIteration"),animationstart:Qu("Animation","AnimationStart"),transitionend:Qu("Transition","TransitionEnd")},$p={},u0={};rr&&(u0=document.createElement("div").style,"AnimationEvent"in window||(delete Un.animationend.animation,delete Un.animationiteration.animation,delete Un.animationstart.animation),"TransitionEvent"in window||delete Un.transitionend.transition);function Hd(e){if($p[e])return $p[e];if(!Un[e])return e;var t=Un[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in u0)return $p[e]=t[a];return e}var d0=Hd("animationend"),c0=Hd("animationiteration"),f0=Hd("animationstart"),p0=Hd("transitionend"),m0=new Map,Vx="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 Wr(e,t){m0.set(e,t),Uo(t,[e])}for(Ju=0;Ju<Vx.length;Ju++)Yu=Vx[Ju],jx=Yu.toLowerCase(),qx=Yu[0].toUpperCase()+Yu.slice(1),Wr(jx,"on"+qx);var Yu,jx,qx,Ju;Wr(d0,"onAnimationEnd");Wr(c0,"onAnimationIteration");Wr(f0,"onAnimationStart");Wr("dblclick","onDoubleClick");Wr("focusin","onFocus");Wr("focusout","onBlur");Wr(p0,"onTransitionEnd");Zn("onMouseEnter",["mouseout","mouseover"]);Zn("onMouseLeave",["mouseout","mouseover"]);Zn("onPointerEnter",["pointerout","pointerover"]);Zn("onPointerLeave",["pointerout","pointerover"]);Uo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Uo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Uo("onBeforeInput",["compositionend","keypress","textInput","paste"]);Uo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Uo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Uo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var qi="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(" "),uT=new Set("cancel close invalid load scroll toggle".split(" ").concat(qi));function Hx(e,t,a){var r=e.type||"unknown-event";e.currentTarget=a,uP(r,t,void 0,e),e.currentTarget=null}function h0(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;Hx(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;Hx(o,i,u),n=l}}}if(xd)throw e=vm,xd=!1,vm=null,e}function Ie(e,t){var a=t[Am];a===void 0&&(a=t[Am]=new Set);var r=e+"__bubble";a.has(r)||(g0(t,e,2,!1),a.add(r))}function Wp(e,t,a){var r=0;t&&(r|=4),g0(a,e,r,t)}var Zu="_reactListening"+Math.random().toString(36).slice(2);function sl(e){if(!e[Zu]){e[Zu]=!0,Lv.forEach(function(a){a!=="selectionchange"&&(uT.has(a)||Wp(a,!1,e),Wp(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Zu]||(t[Zu]=!0,Wp("selectionchange",!1,t))}}function g0(e,t,a,r){switch(Zv(t)){case 1:var o=bP;break;case 4:o=kP;break;default:o=sh}a=o.bind(null,t,a,e),o=void 0,!xm||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 Gp(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=Ao(i),s===null)return;if(l=s.tag,l===5||l===6){r=n=s;continue e}i=i.parentNode}}r=r.return}Uv(function(){var u=n,d=ah(a),c=[];e:{var f=m0.get(e);if(f!==void 0){var g=lh,x=e;switch(e){case"keypress":if(ld(a)===0)break e;case"keydown":case"keyup":g=jP;break;case"focusin":x="focus",g=Hp;break;case"focusout":x="blur",g=Hp;break;case"beforeblur":case"afterblur":g=Hp;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":g=Rx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=AP;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=zP;break;case d0:case c0:case f0:g=EP;break;case p0:g=WP;break;case"scroll":g=PP;break;case"wheel":g=KP;break;case"copy":case"cut":case"paste":g=MP;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=Ex}var w=(t&4)!==0,L=!w&&e==="scroll",y=w?f!==null?f+"Capture":null:f;w=[];for(var h=u,m;h!==null;){m=h;var C=m.stateNode;if(m.tag===5&&C!==null&&(m=C,y!==null&&(C=el(h,y),C!=null&&w.push(il(h,C,m)))),L)break;h=h.return}0<w.length&&(f=new g(f,x,null,a,d),c.push({event:f,listeners:w}))}}if((t&7)===0){e:{if(f=e==="mouseover"||e==="pointerover",g=e==="mouseout"||e==="pointerout",f&&a!==gm&&(x=a.relatedTarget||a.fromElement)&&(Ao(x)||x[or]))break e;if((g||f)&&(f=d.window===d?d:(f=d.ownerDocument)?f.defaultView||f.parentWindow:window,g?(x=a.relatedTarget||a.toElement,g=u,x=x?Ao(x):null,x!==null&&(L=Vo(x),x!==L||x.tag!==5&&x.tag!==6)&&(x=null)):(g=null,x=u),g!==x)){if(w=Rx,C="onMouseLeave",y="onMouseEnter",h="mouse",(e==="pointerout"||e==="pointerover")&&(w=Ex,C="onPointerLeave",y="onPointerEnter",h="pointer"),L=g==null?f:Vn(g),m=x==null?f:Vn(x),f=new w(C,h+"leave",g,a,d),f.target=L,f.relatedTarget=m,C=null,Ao(d)===u&&(w=new w(y,h+"enter",x,a,d),w.target=m,w.relatedTarget=L,C=w),L=C,g&&x)t:{for(w=g,y=x,h=0,m=w;m;m=Mn(m))h++;for(m=0,C=y;C;C=Mn(C))m++;for(;0<h-m;)w=Mn(w),h--;for(;0<m-h;)y=Mn(y),m--;for(;h--;){if(w===y||y!==null&&w===y.alternate)break t;w=Mn(w),y=Mn(y)}w=null}else w=null;g!==null&&zx(c,f,g,w,!1),x!==null&&L!==null&&zx(c,L,x,w,!0)}}e:{if(f=u?Vn(u):window,g=f.nodeName&&f.nodeName.toLowerCase(),g==="select"||g==="input"&&f.type==="file")var I=tT;else if(Nx(f))if(n0)I=nT;else{I=rT;var P=aT}else(g=f.nodeName)&&g.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(I=oT);if(I&&(I=I(e,u))){o0(c,I,a,d);break e}P&&P(e,f,u),e==="focusout"&&(P=f._wrapperState)&&P.controlled&&f.type==="number"&&cm(f,"number",f.value)}switch(P=u?Vn(u):window,e){case"focusin":(Nx(P)||P.contentEditable==="true")&&(Bn=P,Lm=u,Gi=null);break;case"focusout":Gi=Lm=Bn=null;break;case"mousedown":Im=!0;break;case"contextmenu":case"mouseup":case"dragend":Im=!1,Ux(c,a,d);break;case"selectionchange":if(lT)break;case"keydown":case"keyup":Ux(c,a,d)}var R;if(dh)e:{switch(e){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else Fn?a0(e,a)&&(A="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(A="onCompositionStart");A&&(t0&&a.locale!=="ko"&&(Fn||A!=="onCompositionStart"?A==="onCompositionEnd"&&Fn&&(R=e0()):(Mr=d,ih="value"in Mr?Mr.value:Mr.textContent,Fn=!0)),P=Ld(u,A),0<P.length&&(A=new _x(A,e,null,a,d),c.push({event:A,listeners:P}),R?A.data=R:(R=r0(a),R!==null&&(A.data=R)))),(R=QP?JP(e,a):YP(e,a))&&(u=Ld(u,"onBeforeInput"),0<u.length&&(d=new _x("onBeforeInput","beforeinput",null,a,d),c.push({event:d,listeners:u}),d.data=R))}h0(c,t)})}function il(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Ld(e,t){for(var a=t+"Capture",r=[];e!==null;){var o=e,n=o.stateNode;o.tag===5&&n!==null&&(o=n,n=el(e,a),n!=null&&r.unshift(il(e,n,o)),n=el(e,t),n!=null&&r.push(il(e,n,o))),e=e.return}return r}function Mn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function zx(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=el(a,n),l!=null&&s.unshift(il(a,l,i))):o||(l=el(a,n),l!=null&&s.push(il(a,l,i)))),a=a.return}s.length!==0&&e.push({event:t,listeners:s})}var dT=/\r\n?/g,cT=/\u0000|\uFFFD/g;function $x(e){return(typeof e=="string"?e:""+e).replace(dT,`
|
|
6
|
-
`).replace(cT,"")}function ed(e,t,a){if(t=$x(t),$x(e)!==t&&a)throw Error(_(425))}function Id(){}var bm=null,km=null;function Pm(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 Tm=typeof setTimeout=="function"?setTimeout:void 0,fT=typeof clearTimeout=="function"?clearTimeout:void 0,Wx=typeof Promise=="function"?Promise:void 0,pT=typeof queueMicrotask=="function"?queueMicrotask:typeof Wx<"u"?function(e){return Wx.resolve(null).then(e).catch(mT)}:Tm;function mT(e){setTimeout(function(){throw e})}function Kp(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),rl(t);return}r--}else a!=="$"&&a!=="$?"&&a!=="$!"||r++;a=o}while(a);rl(t)}function Ur(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 Gx(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 is=Math.random().toString(36).slice(2),Ea="__reactFiber$"+is,ll="__reactProps$"+is,or="__reactContainer$"+is,Am="__reactEvents$"+is,hT="__reactListeners$"+is,gT="__reactHandles$"+is;function Ao(e){var t=e[Ea];if(t)return t;for(var a=e.parentNode;a;){if(t=a[or]||a[Ea]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Gx(e);e!==null;){if(a=e[Ea])return a;e=Gx(e)}return t}e=a,a=e.parentNode}return null}function yl(e){return e=e[Ea]||e[or],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Vn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(_(33))}function zd(e){return e[ll]||null}var Rm=[],jn=-1;function Gr(e){return{current:e}}function be(e){0>jn||(e.current=Rm[jn],Rm[jn]=null,jn--)}function we(e,t){jn++,Rm[jn]=e.current,e.current=t}var $r={},vt=Gr($r),Et=Gr(!1),Mo=$r;function es(e,t){var a=e.type.contextTypes;if(!a)return $r;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 Dt(e){return e=e.childContextTypes,e!=null}function bd(){be(Et),be(vt)}function Kx(e,t,a){if(vt.current!==$r)throw Error(_(168));we(vt,t),we(Et,a)}function y0(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(_(108,aP(e)||"Unknown",o));return Ee({},a,r)}function kd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||$r,Mo=vt.current,we(vt,e),we(Et,Et.current),!0}function Xx(e,t,a){var r=e.stateNode;if(!r)throw Error(_(169));a?(e=y0(e,t,Mo),r.__reactInternalMemoizedMergedChildContext=e,be(Et),be(vt),we(vt,e)):be(Et),we(Et,a)}var Za=null,$d=!1,Xp=!1;function x0(e){Za===null?Za=[e]:Za.push(e)}function yT(e){$d=!0,x0(e)}function Kr(){if(!Xp&&Za!==null){Xp=!0;var e=0,t=me;try{var a=Za;for(me=1;e<a.length;e++){var r=a[e];do r=r(!0);while(r!==null)}Za=null,$d=!1}catch(o){throw Za!==null&&(Za=Za.slice(e+1)),Hv(rh,Kr),o}finally{me=t,Xp=!1}}return null}var qn=[],Hn=0,Pd=null,Td=0,oa=[],na=0,No=null,er=1,tr="";function Po(e,t){qn[Hn++]=Td,qn[Hn++]=Pd,Pd=e,Td=t}function v0(e,t,a){oa[na++]=er,oa[na++]=tr,oa[na++]=No,No=e;var r=er;e=tr;var o=32-Sa(r)-1;r&=~(1<<o),a+=1;var n=32-Sa(t)+o;if(30<n){var s=o-o%5;n=(r&(1<<s)-1).toString(32),r>>=s,o-=s,er=1<<32-Sa(t)+o|a<<o|r,tr=n+e}else er=1<<n|a<<o|r,tr=e}function fh(e){e.return!==null&&(Po(e,1),v0(e,1,0))}function ph(e){for(;e===Pd;)Pd=qn[--Hn],qn[Hn]=null,Td=qn[--Hn],qn[Hn]=null;for(;e===No;)No=oa[--na],oa[na]=null,tr=oa[--na],oa[na]=null,er=oa[--na],oa[na]=null}var Wt=null,$t=null,Ae=!1,wa=null;function w0(e,t){var a=sa(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 Qx(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,Wt=e,$t=Ur(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Wt=e,$t=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(a=No!==null?{id:er,overflow:tr}:null,e.memoizedState={dehydrated:t,treeContext:a,retryLane:1073741824},a=sa(18,null,null,0),a.stateNode=t,a.return=e,e.child=a,Wt=e,$t=null,!0):!1;default:return!1}}function _m(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Em(e){if(Ae){var t=$t;if(t){var a=t;if(!Qx(e,t)){if(_m(e))throw Error(_(418));t=Ur(a.nextSibling);var r=Wt;t&&Qx(e,t)?w0(r,a):(e.flags=e.flags&-4097|2,Ae=!1,Wt=e)}}else{if(_m(e))throw Error(_(418));e.flags=e.flags&-4097|2,Ae=!1,Wt=e}}}function Jx(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Wt=e}function td(e){if(e!==Wt)return!1;if(!Ae)return Jx(e),Ae=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Pm(e.type,e.memoizedProps)),t&&(t=$t)){if(_m(e))throw S0(),Error(_(418));for(;t;)w0(e,t),t=Ur(t.nextSibling)}if(Jx(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(_(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"){if(t===0){$t=Ur(e.nextSibling);break e}t--}else a!=="$"&&a!=="$!"&&a!=="$?"||t++}e=e.nextSibling}$t=null}}else $t=Wt?Ur(e.stateNode.nextSibling):null;return!0}function S0(){for(var e=$t;e;)e=Ur(e.nextSibling)}function ts(){$t=Wt=null,Ae=!1}function mh(e){wa===null?wa=[e]:wa.push(e)}var xT=ir.ReactCurrentBatchConfig;function Ni(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(_(309));var r=a.stateNode}if(!r)throw Error(_(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(_(284));if(!a._owner)throw Error(_(290,e))}return e}function ad(e,t){throw e=Object.prototype.toString.call(t),Error(_(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Yx(e){var t=e._init;return t(e._payload)}function C0(e){function t(y,h){if(e){var m=y.deletions;m===null?(y.deletions=[h],y.flags|=16):m.push(h)}}function a(y,h){if(!e)return null;for(;h!==null;)t(y,h),h=h.sibling;return null}function r(y,h){for(y=new Map;h!==null;)h.key!==null?y.set(h.key,h):y.set(h.index,h),h=h.sibling;return y}function o(y,h){return y=Hr(y,h),y.index=0,y.sibling=null,y}function n(y,h,m){return y.index=m,e?(m=y.alternate,m!==null?(m=m.index,m<h?(y.flags|=2,h):m):(y.flags|=2,h)):(y.flags|=1048576,h)}function s(y){return e&&y.alternate===null&&(y.flags|=2),y}function i(y,h,m,C){return h===null||h.tag!==6?(h=am(m,y.mode,C),h.return=y,h):(h=o(h,m),h.return=y,h)}function l(y,h,m,C){var I=m.type;return I===On?d(y,h,m.props.children,C,m.key):h!==null&&(h.elementType===I||typeof I=="object"&&I!==null&&I.$$typeof===Rr&&Yx(I)===h.type)?(C=o(h,m.props),C.ref=Ni(y,h,m),C.return=y,C):(C=hd(m.type,m.key,m.props,null,y.mode,C),C.ref=Ni(y,h,m),C.return=y,C)}function u(y,h,m,C){return h===null||h.tag!==4||h.stateNode.containerInfo!==m.containerInfo||h.stateNode.implementation!==m.implementation?(h=rm(m,y.mode,C),h.return=y,h):(h=o(h,m.children||[]),h.return=y,h)}function d(y,h,m,C,I){return h===null||h.tag!==7?(h=Do(m,y.mode,C,I),h.return=y,h):(h=o(h,m),h.return=y,h)}function c(y,h,m){if(typeof h=="string"&&h!==""||typeof h=="number")return h=am(""+h,y.mode,m),h.return=y,h;if(typeof h=="object"&&h!==null){switch(h.$$typeof){case ju:return m=hd(h.type,h.key,h.props,null,y.mode,m),m.ref=Ni(y,null,h),m.return=y,m;case Nn:return h=rm(h,y.mode,m),h.return=y,h;case Rr:var C=h._init;return c(y,C(h._payload),m)}if(Vi(h)||_i(h))return h=Do(h,y.mode,m,null),h.return=y,h;ad(y,h)}return null}function f(y,h,m,C){var I=h!==null?h.key:null;if(typeof m=="string"&&m!==""||typeof m=="number")return I!==null?null:i(y,h,""+m,C);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case ju:return m.key===I?l(y,h,m,C):null;case Nn:return m.key===I?u(y,h,m,C):null;case Rr:return I=m._init,f(y,h,I(m._payload),C)}if(Vi(m)||_i(m))return I!==null?null:d(y,h,m,C,null);ad(y,m)}return null}function g(y,h,m,C,I){if(typeof C=="string"&&C!==""||typeof C=="number")return y=y.get(m)||null,i(h,y,""+C,I);if(typeof C=="object"&&C!==null){switch(C.$$typeof){case ju:return y=y.get(C.key===null?m:C.key)||null,l(h,y,C,I);case Nn:return y=y.get(C.key===null?m:C.key)||null,u(h,y,C,I);case Rr:var P=C._init;return g(y,h,m,P(C._payload),I)}if(Vi(C)||_i(C))return y=y.get(m)||null,d(h,y,C,I,null);ad(h,C)}return null}function x(y,h,m,C){for(var I=null,P=null,R=h,A=h=0,q=null;R!==null&&A<m.length;A++){R.index>A?(q=R,R=null):q=R.sibling;var B=f(y,R,m[A],C);if(B===null){R===null&&(R=q);break}e&&R&&B.alternate===null&&t(y,R),h=n(B,h,A),P===null?I=B:P.sibling=B,P=B,R=q}if(A===m.length)return a(y,R),Ae&&Po(y,A),I;if(R===null){for(;A<m.length;A++)R=c(y,m[A],C),R!==null&&(h=n(R,h,A),P===null?I=R:P.sibling=R,P=R);return Ae&&Po(y,A),I}for(R=r(y,R);A<m.length;A++)q=g(R,y,A,m[A],C),q!==null&&(e&&q.alternate!==null&&R.delete(q.key===null?A:q.key),h=n(q,h,A),P===null?I=q:P.sibling=q,P=q);return e&&R.forEach(function(J){return t(y,J)}),Ae&&Po(y,A),I}function w(y,h,m,C){var I=_i(m);if(typeof I!="function")throw Error(_(150));if(m=I.call(m),m==null)throw Error(_(151));for(var P=I=null,R=h,A=h=0,q=null,B=m.next();R!==null&&!B.done;A++,B=m.next()){R.index>A?(q=R,R=null):q=R.sibling;var J=f(y,R,B.value,C);if(J===null){R===null&&(R=q);break}e&&R&&J.alternate===null&&t(y,R),h=n(J,h,A),P===null?I=J:P.sibling=J,P=J,R=q}if(B.done)return a(y,R),Ae&&Po(y,A),I;if(R===null){for(;!B.done;A++,B=m.next())B=c(y,B.value,C),B!==null&&(h=n(B,h,A),P===null?I=B:P.sibling=B,P=B);return Ae&&Po(y,A),I}for(R=r(y,R);!B.done;A++,B=m.next())B=g(R,y,A,B.value,C),B!==null&&(e&&B.alternate!==null&&R.delete(B.key===null?A:B.key),h=n(B,h,A),P===null?I=B:P.sibling=B,P=B);return e&&R.forEach(function(ue){return t(y,ue)}),Ae&&Po(y,A),I}function L(y,h,m,C){if(typeof m=="object"&&m!==null&&m.type===On&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case ju:e:{for(var I=m.key,P=h;P!==null;){if(P.key===I){if(I=m.type,I===On){if(P.tag===7){a(y,P.sibling),h=o(P,m.props.children),h.return=y,y=h;break e}}else if(P.elementType===I||typeof I=="object"&&I!==null&&I.$$typeof===Rr&&Yx(I)===P.type){a(y,P.sibling),h=o(P,m.props),h.ref=Ni(y,P,m),h.return=y,y=h;break e}a(y,P);break}else t(y,P);P=P.sibling}m.type===On?(h=Do(m.props.children,y.mode,C,m.key),h.return=y,y=h):(C=hd(m.type,m.key,m.props,null,y.mode,C),C.ref=Ni(y,h,m),C.return=y,y=C)}return s(y);case Nn:e:{for(P=m.key;h!==null;){if(h.key===P)if(h.tag===4&&h.stateNode.containerInfo===m.containerInfo&&h.stateNode.implementation===m.implementation){a(y,h.sibling),h=o(h,m.children||[]),h.return=y,y=h;break e}else{a(y,h);break}else t(y,h);h=h.sibling}h=rm(m,y.mode,C),h.return=y,y=h}return s(y);case Rr:return P=m._init,L(y,h,P(m._payload),C)}if(Vi(m))return x(y,h,m,C);if(_i(m))return w(y,h,m,C);ad(y,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,h!==null&&h.tag===6?(a(y,h.sibling),h=o(h,m),h.return=y,y=h):(a(y,h),h=am(m,y.mode,C),h.return=y,y=h),s(y)):a(y,h)}return L}var as=C0(!0),L0=C0(!1),Ad=Gr(null),Rd=null,zn=null,hh=null;function gh(){hh=zn=Rd=null}function yh(e){var t=Ad.current;be(Ad),e._currentValue=t}function Dm(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 Jn(e,t){Rd=e,hh=zn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(_t=!0),e.firstContext=null)}function la(e){var t=e._currentValue;if(hh!==e)if(e={context:e,memoizedValue:t,next:null},zn===null){if(Rd===null)throw Error(_(308));zn=e,Rd.dependencies={lanes:0,firstContext:e}}else zn=zn.next=e;return t}var Ro=null;function xh(e){Ro===null?Ro=[e]:Ro.push(e)}function I0(e,t,a,r){var o=t.interleaved;return o===null?(a.next=a,xh(t)):(a.next=o.next,o.next=a),t.interleaved=a,nr(e,r)}function nr(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 _r=!1;function vh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function b0(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 ar(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Vr(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,nr(e,a)}return o=r.interleaved,o===null?(t.next=t,xh(r)):(t.next=o.next,o.next=t),r.interleaved=t,nr(e,a)}function ud(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,oh(e,a)}}function Zx(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 _d(e,t,a,r){var o=e.updateQueue;_r=!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,g=i.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:g,lane:0,tag:i.tag,payload:i.payload,callback:i.callback,next:null});e:{var x=e,w=i;switch(f=t,g=a,w.tag){case 1:if(x=w.payload,typeof x=="function"){c=x.call(g,c,f);break e}c=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=w.payload,f=typeof x=="function"?x.call(g,c,f):x,f==null)break e;c=Ee({},c,f);break e;case 2:_r=!0}}i.callback!==null&&i.lane!==0&&(e.flags|=64,f=o.effects,f===null?o.effects=[i]:f.push(i))}else g={eventTime:g,lane:f,tag:i.tag,payload:i.payload,callback:i.callback,next:null},d===null?(u=d=g,l=c):d=d.next=g,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);Fo|=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(_(191,o));o.call(r)}}}var xl={},Ma=Gr(xl),ul=Gr(xl),dl=Gr(xl);function _o(e){if(e===xl)throw Error(_(174));return e}function wh(e,t){switch(we(dl,t),we(ul,e),we(Ma,xl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:pm(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=pm(t,e)}be(Ma),we(Ma,t)}function rs(){be(Ma),be(ul),be(dl)}function k0(e){_o(dl.current);var t=_o(Ma.current),a=pm(t,e.type);t!==a&&(we(ul,e),we(Ma,a))}function Sh(e){ul.current===e&&(be(Ma),be(ul))}var Re=Gr(0);function Ed(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 Qp=[];function Ch(){for(var e=0;e<Qp.length;e++)Qp[e]._workInProgressVersionPrimary=null;Qp.length=0}var dd=ir.ReactCurrentDispatcher,Jp=ir.ReactCurrentBatchConfig,Oo=0,_e=null,$e=null,et=null,Dd=!1,Ki=!1,cl=0,vT=0;function gt(){throw Error(_(321))}function Lh(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!La(e[a],t[a]))return!1;return!0}function Ih(e,t,a,r,o,n){if(Oo=n,_e=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,dd.current=e===null||e.memoizedState===null?LT:IT,e=a(r,o),Ki){n=0;do{if(Ki=!1,cl=0,25<=n)throw Error(_(301));n+=1,et=$e=null,t.updateQueue=null,dd.current=bT,e=a(r,o)}while(Ki)}if(dd.current=Md,t=$e!==null&&$e.next!==null,Oo=0,et=$e=_e=null,Dd=!1,t)throw Error(_(300));return e}function bh(){var e=cl!==0;return cl=0,e}function _a(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return et===null?_e.memoizedState=et=e:et=et.next=e,et}function ua(){if($e===null){var e=_e.alternate;e=e!==null?e.memoizedState:null}else e=$e.next;var t=et===null?_e.memoizedState:et.next;if(t!==null)et=t,$e=e;else{if(e===null)throw Error(_(310));$e=e,e={memoizedState:$e.memoizedState,baseState:$e.baseState,baseQueue:$e.baseQueue,queue:$e.queue,next:null},et===null?_e.memoizedState=et=e:et=et.next=e}return et}function fl(e,t){return typeof t=="function"?t(e):t}function Yp(e){var t=ua(),a=t.queue;if(a===null)throw Error(_(311));a.lastRenderedReducer=e;var r=$e,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((Oo&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,_e.lanes|=d,Fo|=d}u=u.next}while(u!==null&&u!==n);l===null?s=r:l.next=i,La(r,t.memoizedState)||(_t=!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,_e.lanes|=n,Fo|=n,o=o.next;while(o!==e)}else o===null&&(a.lanes=0);return[t.memoizedState,a.dispatch]}function Zp(e){var t=ua(),a=t.queue;if(a===null)throw Error(_(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);La(n,t.memoizedState)||(_t=!0),t.memoizedState=n,t.baseQueue===null&&(t.baseState=n),a.lastRenderedState=n}return[n,r]}function P0(){}function T0(e,t){var a=_e,r=ua(),o=t(),n=!La(r.memoizedState,o);if(n&&(r.memoizedState=o,_t=!0),r=r.queue,kh(_0.bind(null,a,r,e),[e]),r.getSnapshot!==t||n||et!==null&&et.memoizedState.tag&1){if(a.flags|=2048,pl(9,R0.bind(null,a,r,o,t),void 0,null),tt===null)throw Error(_(349));(Oo&30)!==0||A0(a,t,o)}return o}function A0(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=_e.updateQueue,t===null?(t={lastEffect:null,stores:null},_e.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function R0(e,t,a,r){t.value=a,t.getSnapshot=r,E0(t)&&D0(e)}function _0(e,t,a){return a(function(){E0(t)&&D0(e)})}function E0(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!La(e,a)}catch{return!0}}function D0(e){var t=nr(e,1);t!==null&&Ca(t,e,1,-1)}function tv(e){var t=_a();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:fl,lastRenderedState:e},t.queue=e,e=e.dispatch=CT.bind(null,_e,e),[t.memoizedState,e]}function pl(e,t,a,r){return e={tag:e,create:t,destroy:a,deps:r,next:null},t=_e.updateQueue,t===null?(t={lastEffect:null,stores:null},_e.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 M0(){return ua().memoizedState}function cd(e,t,a,r){var o=_a();_e.flags|=e,o.memoizedState=pl(1|t,a,void 0,r===void 0?null:r)}function Wd(e,t,a,r){var o=ua();r=r===void 0?null:r;var n=void 0;if($e!==null){var s=$e.memoizedState;if(n=s.destroy,r!==null&&Lh(r,s.deps)){o.memoizedState=pl(t,a,n,r);return}}_e.flags|=e,o.memoizedState=pl(1|t,a,n,r)}function av(e,t){return cd(8390656,8,e,t)}function kh(e,t){return Wd(2048,8,e,t)}function N0(e,t){return Wd(4,2,e,t)}function O0(e,t){return Wd(4,4,e,t)}function F0(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 B0(e,t,a){return a=a!=null?a.concat([e]):null,Wd(4,4,F0.bind(null,t,e),a)}function Ph(){}function U0(e,t){var a=ua();t=t===void 0?null:t;var r=a.memoizedState;return r!==null&&t!==null&&Lh(t,r[1])?r[0]:(a.memoizedState=[e,t],e)}function V0(e,t){var a=ua();t=t===void 0?null:t;var r=a.memoizedState;return r!==null&&t!==null&&Lh(t,r[1])?r[0]:(e=e(),a.memoizedState=[e,t],e)}function j0(e,t,a){return(Oo&21)===0?(e.baseState&&(e.baseState=!1,_t=!0),e.memoizedState=a):(La(a,t)||(a=Wv(),_e.lanes|=a,Fo|=a,e.baseState=!0),t)}function wT(e,t){var a=me;me=a!==0&&4>a?a:4,e(!0);var r=Jp.transition;Jp.transition={};try{e(!1),t()}finally{me=a,Jp.transition=r}}function q0(){return ua().memoizedState}function ST(e,t,a){var r=qr(e);if(a={lane:r,action:a,hasEagerState:!1,eagerState:null,next:null},H0(e))z0(t,a);else if(a=I0(e,t,a,r),a!==null){var o=bt();Ca(a,e,r,o),$0(a,t,r)}}function CT(e,t,a){var r=qr(e),o={lane:r,action:a,hasEagerState:!1,eagerState:null,next:null};if(H0(e))z0(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,La(i,s)){var l=t.interleaved;l===null?(o.next=o,xh(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}a=I0(e,t,o,r),a!==null&&(o=bt(),Ca(a,e,r,o),$0(a,t,r))}}function H0(e){var t=e.alternate;return e===_e||t!==null&&t===_e}function z0(e,t){Ki=Dd=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function $0(e,t,a){if((a&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,oh(e,a)}}var Md={readContext:la,useCallback:gt,useContext:gt,useEffect:gt,useImperativeHandle:gt,useInsertionEffect:gt,useLayoutEffect:gt,useMemo:gt,useReducer:gt,useRef:gt,useState:gt,useDebugValue:gt,useDeferredValue:gt,useTransition:gt,useMutableSource:gt,useSyncExternalStore:gt,useId:gt,unstable_isNewReconciler:!1},LT={readContext:la,useCallback:function(e,t){return _a().memoizedState=[e,t===void 0?null:t],e},useContext:la,useEffect:av,useImperativeHandle:function(e,t,a){return a=a!=null?a.concat([e]):null,cd(4194308,4,F0.bind(null,t,e),a)},useLayoutEffect:function(e,t){return cd(4194308,4,e,t)},useInsertionEffect:function(e,t){return cd(4,2,e,t)},useMemo:function(e,t){var a=_a();return t=t===void 0?null:t,e=e(),a.memoizedState=[e,t],e},useReducer:function(e,t,a){var r=_a();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=ST.bind(null,_e,e),[r.memoizedState,e]},useRef:function(e){var t=_a();return e={current:e},t.memoizedState=e},useState:tv,useDebugValue:Ph,useDeferredValue:function(e){return _a().memoizedState=e},useTransition:function(){var e=tv(!1),t=e[0];return e=wT.bind(null,e[1]),_a().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,a){var r=_e,o=_a();if(Ae){if(a===void 0)throw Error(_(407));a=a()}else{if(a=t(),tt===null)throw Error(_(349));(Oo&30)!==0||A0(r,t,a)}o.memoizedState=a;var n={value:a,getSnapshot:t};return o.queue=n,av(_0.bind(null,r,n,e),[e]),r.flags|=2048,pl(9,R0.bind(null,r,n,a,t),void 0,null),a},useId:function(){var e=_a(),t=tt.identifierPrefix;if(Ae){var a=tr,r=er;a=(r&~(1<<32-Sa(r)-1)).toString(32)+a,t=":"+t+"R"+a,a=cl++,0<a&&(t+="H"+a.toString(32)),t+=":"}else a=vT++,t=":"+t+"r"+a.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},IT={readContext:la,useCallback:U0,useContext:la,useEffect:kh,useImperativeHandle:B0,useInsertionEffect:N0,useLayoutEffect:O0,useMemo:V0,useReducer:Yp,useRef:M0,useState:function(){return Yp(fl)},useDebugValue:Ph,useDeferredValue:function(e){var t=ua();return j0(t,$e.memoizedState,e)},useTransition:function(){var e=Yp(fl)[0],t=ua().memoizedState;return[e,t]},useMutableSource:P0,useSyncExternalStore:T0,useId:q0,unstable_isNewReconciler:!1},bT={readContext:la,useCallback:U0,useContext:la,useEffect:kh,useImperativeHandle:B0,useInsertionEffect:N0,useLayoutEffect:O0,useMemo:V0,useReducer:Zp,useRef:M0,useState:function(){return Zp(fl)},useDebugValue:Ph,useDeferredValue:function(e){var t=ua();return $e===null?t.memoizedState=e:j0(t,$e.memoizedState,e)},useTransition:function(){var e=Zp(fl)[0],t=ua().memoizedState;return[e,t]},useMutableSource:P0,useSyncExternalStore:T0,useId:q0,unstable_isNewReconciler:!1};function xa(e,t){if(e&&e.defaultProps){t=Ee({},t),e=e.defaultProps;for(var a in e)t[a]===void 0&&(t[a]=e[a]);return t}return t}function Mm(e,t,a,r){t=e.memoizedState,a=a(r,t),a=a==null?t:Ee({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Gd={isMounted:function(e){return(e=e._reactInternals)?Vo(e)===e:!1},enqueueSetState:function(e,t,a){e=e._reactInternals;var r=bt(),o=qr(e),n=ar(r,o);n.payload=t,a!=null&&(n.callback=a),t=Vr(e,n,o),t!==null&&(Ca(t,e,o,r),ud(t,e,o))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var r=bt(),o=qr(e),n=ar(r,o);n.tag=1,n.payload=t,a!=null&&(n.callback=a),t=Vr(e,n,o),t!==null&&(Ca(t,e,o,r),ud(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=bt(),r=qr(e),o=ar(a,r);o.tag=2,t!=null&&(o.callback=t),t=Vr(e,o,r),t!==null&&(Ca(t,e,r,a),ud(t,e,r))}};function rv(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?!nl(a,r)||!nl(o,n):!0}function W0(e,t,a){var r=!1,o=$r,n=t.contextType;return typeof n=="object"&&n!==null?n=la(n):(o=Dt(t)?Mo:vt.current,r=t.contextTypes,n=(r=r!=null)?es(e,o):$r),t=new t(a,n),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Gd,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&&Gd.enqueueReplaceState(t,t.state,null)}function Nm(e,t,a,r){var o=e.stateNode;o.props=a,o.state=e.memoizedState,o.refs={},vh(e);var n=t.contextType;typeof n=="object"&&n!==null?o.context=la(n):(n=Dt(t)?Mo:vt.current,o.context=es(e,n)),o.state=e.memoizedState,n=t.getDerivedStateFromProps,typeof n=="function"&&(Mm(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&&Gd.enqueueReplaceState(o,o.state,null),_d(e,a,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function os(e,t){try{var a="",r=t;do a+=tP(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{Vp=!1,Error.prepareStackTrace=a}return(e=e?e.displayName||e.name:"")?Vi(e):""}function nP(e){switch(e.tag){case 5:return Vi(e.type);case 16:return Vi("Lazy");case 13:return Vi("Suspense");case 19:return Vi("SuspenseList");case 0:case 2:case 15:return e=jp(e.type,!1),e;case 11:return e=jp(e.type.render,!1),e;case 1:return e=jp(e.type,!0),e;default:return""}}function cm(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 Fn:return"Fragment";case On:return"Portal";case lm:return"Profiler";case ah:return"StrictMode";case um:return"Suspense";case dm:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Tv:return(e.displayName||"Context")+".Consumer";case Pv:return(e._context.displayName||"Context")+".Provider";case rh:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case oh:return t=e.displayName||null,t!==null?t:cm(e.type)||"Memo";case Er:t=e._payload,e=e._init;try{return cm(e(t))}catch{}}return null}function sP(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 cm(t);case 8:return t===ah?"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 Wr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Rv(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function iP(e){var t=Rv(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 $u(e){e._valueTracker||(e._valueTracker=iP(e))}function _v(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),r="";return e&&(r=Rv(e)?e.checked?"true":"false":e.value),e=r,e!==a?(t.setValue(e),!0):!1}function vd(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 fm(e,t){var a=t.checked;return Ee({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:a??e._wrapperState.initialChecked})}function Lx(e,t){var a=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;a=Wr(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 Ev(e,t){t=t.checked,t!=null&&th(e,"checked",t,!1)}function pm(e,t){Ev(e,t);var a=Wr(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")?mm(e,t.type,a):t.hasOwnProperty("defaultValue")&&mm(e,t.type,Wr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ix(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 mm(e,t,a){(t!=="number"||vd(e.ownerDocument)!==e)&&(a==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+a&&(e.defaultValue=""+a))}var ji=Array.isArray;function Kn(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=""+Wr(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 hm(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(_(91));return Ee({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function bx(e,t){var a=t.value;if(a==null){if(a=t.children,t=t.defaultValue,a!=null){if(t!=null)throw Error(_(92));if(ji(a)){if(1<a.length)throw Error(_(93));a=a[0]}t=a}t==null&&(t=""),a=t}e._wrapperState={initialValue:Wr(a)}}function Dv(e,t){var a=Wr(t.value),r=Wr(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 kx(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Mv(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 gm(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Mv(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Wu,Nv=(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(Wu=Wu||document.createElement("div"),Wu.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Wu.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function el(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var Hi={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},lP=["Webkit","ms","Moz","O"];Object.keys(Hi).forEach(function(e){lP.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Hi[t]=Hi[e]})});function Ov(e,t,a){return t==null||typeof t=="boolean"||t===""?"":a||typeof t!="number"||t===0||Hi.hasOwnProperty(e)&&Hi[e]?(""+t).trim():t+"px"}function Fv(e,t){e=e.style;for(var a in t)if(t.hasOwnProperty(a)){var r=a.indexOf("--")===0,o=Ov(a,t[a],r);a==="float"&&(a="cssFloat"),r?e.setProperty(a,o):e[a]=o}}var uP=Ee({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 ym(e,t){if(t){if(uP[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(_(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(_(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(_(61))}if(t.style!=null&&typeof t.style!="object")throw Error(_(62))}}function xm(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 vm=null;function nh(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wm=null,Xn=null,Qn=null;function Px(e){if(e=xl(e)){if(typeof wm!="function")throw Error(_(280));var t=e.stateNode;t&&(t=Gd(t),wm(e.stateNode,e.type,t))}}function Bv(e){Xn?Qn?Qn.push(e):Qn=[e]:Xn=e}function Uv(){if(Xn){var e=Xn,t=Qn;if(Qn=Xn=null,Px(e),t)for(e=0;e<t.length;e++)Px(t[e])}}function Vv(e,t){return e(t)}function jv(){}var qp=!1;function qv(e,t,a){if(qp)return e(t,a);qp=!0;try{return Vv(e,t,a)}finally{qp=!1,(Xn!==null||Qn!==null)&&(jv(),Uv())}}function tl(e,t){var a=e.stateNode;if(a===null)return null;var r=Gd(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(_(231,t,typeof a));return a}var Cm=!1;if(rr)try{Mn={},Object.defineProperty(Mn,"passive",{get:function(){Cm=!0}}),window.addEventListener("test",Mn,Mn),window.removeEventListener("test",Mn,Mn)}catch{Cm=!1}var Mn;function dP(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 $i=!1,wd=null,Cd=!1,Sm=null,cP={onError:function(e){$i=!0,wd=e}};function fP(e,t,a,r,o,n,s,i,l){$i=!1,wd=null,dP.apply(cP,arguments)}function pP(e,t,a,r,o,n,s,i,l){if(fP.apply(this,arguments),$i){if($i){var u=wd;$i=!1,wd=null}else throw Error(_(198));Cd||(Cd=!0,Sm=u)}}function jo(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 zv(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 Tx(e){if(jo(e)!==e)throw Error(_(188))}function mP(e){var t=e.alternate;if(!t){if(t=jo(e),t===null)throw Error(_(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 Tx(o),e;if(n===r)return Tx(o),t;n=n.sibling}throw Error(_(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(_(189))}}if(a.alternate!==r)throw Error(_(190))}if(a.tag!==3)throw Error(_(188));return a.stateNode.current===a?e:t}function Hv(e){return e=mP(e),e!==null?$v(e):null}function $v(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=$v(e);if(t!==null)return t;e=e.sibling}return null}var Wv=Gt.unstable_scheduleCallback,Ax=Gt.unstable_cancelCallback,hP=Gt.unstable_shouldYield,gP=Gt.unstable_requestPaint,Ue=Gt.unstable_now,yP=Gt.unstable_getCurrentPriorityLevel,sh=Gt.unstable_ImmediatePriority,Gv=Gt.unstable_UserBlockingPriority,Sd=Gt.unstable_NormalPriority,xP=Gt.unstable_LowPriority,Kv=Gt.unstable_IdlePriority,zd=null,Ma=null;function vP(e){if(Ma&&typeof Ma.onCommitFiberRoot=="function")try{Ma.onCommitFiberRoot(zd,e,void 0,(e.current.flags&128)===128)}catch{}}var Ca=Math.clz32?Math.clz32:SP,wP=Math.log,CP=Math.LN2;function SP(e){return e>>>=0,e===0?32:31-(wP(e)/CP|0)|0}var Gu=64,Ku=4194304;function qi(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 Ld(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=qi(i):(n&=s,n!==0&&(r=qi(n)))}else s=a&~o,s!==0?r=qi(s):n!==0&&(r=qi(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-Ca(t),o=1<<a,r|=e[a],t&=~o;return r}function LP(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 IP(e,t){for(var a=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,n=e.pendingLanes;0<n;){var s=31-Ca(n),i=1<<s,l=o[s];l===-1?((i&a)===0||(i&r)!==0)&&(o[s]=LP(i,t)):l<=t&&(e.expiredLanes|=i),n&=~i}}function Lm(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Xv(){var e=Gu;return Gu<<=1,(Gu&4194240)===0&&(Gu=64),e}function zp(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function gl(e,t,a){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ca(t),e[t]=a}function bP(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-Ca(a),n=1<<o;t[o]=0,r[o]=-1,e[o]=-1,a&=~n}}function ih(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var r=31-Ca(a),o=1<<r;o&t|e[r]&t&&(e[r]|=t),a&=~o}}var pe=0;function Qv(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var Jv,lh,Yv,Zv,e0,Im=!1,Xu=[],Br=null,Ur=null,Vr=null,al=new Map,rl=new Map,Mr=[],kP="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 Rx(e,t){switch(e){case"focusin":case"focusout":Br=null;break;case"dragenter":case"dragleave":Ur=null;break;case"mouseover":case"mouseout":Vr=null;break;case"pointerover":case"pointerout":al.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":rl.delete(t.pointerId)}}function Di(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=xl(t),t!==null&&lh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function PP(e,t,a,r,o){switch(t){case"focusin":return Br=Di(Br,e,t,a,r,o),!0;case"dragenter":return Ur=Di(Ur,e,t,a,r,o),!0;case"mouseover":return Vr=Di(Vr,e,t,a,r,o),!0;case"pointerover":var n=o.pointerId;return al.set(n,Di(al.get(n)||null,e,t,a,r,o)),!0;case"gotpointercapture":return n=o.pointerId,rl.set(n,Di(rl.get(n)||null,e,t,a,r,o)),!0}return!1}function t0(e){var t=Ro(e.target);if(t!==null){var a=jo(t);if(a!==null){if(t=a.tag,t===13){if(t=zv(a),t!==null){e.blockedOn=t,e0(e.priority,function(){Yv(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 ud(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=bm(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(a===null){a=e.nativeEvent;var r=new a.constructor(a.type,a);vm=r,a.target.dispatchEvent(r),vm=null}else return t=xl(a),t!==null&&lh(t),e.blockedOn=a,!1;t.shift()}return!0}function _x(e,t,a){ud(e)&&a.delete(t)}function TP(){Im=!1,Br!==null&&ud(Br)&&(Br=null),Ur!==null&&ud(Ur)&&(Ur=null),Vr!==null&&ud(Vr)&&(Vr=null),al.forEach(_x),rl.forEach(_x)}function Mi(e,t){e.blockedOn===t&&(e.blockedOn=null,Im||(Im=!0,Gt.unstable_scheduleCallback(Gt.unstable_NormalPriority,TP)))}function ol(e){function t(o){return Mi(o,e)}if(0<Xu.length){Mi(Xu[0],e);for(var a=1;a<Xu.length;a++){var r=Xu[a];r.blockedOn===e&&(r.blockedOn=null)}}for(Br!==null&&Mi(Br,e),Ur!==null&&Mi(Ur,e),Vr!==null&&Mi(Vr,e),al.forEach(t),rl.forEach(t),a=0;a<Mr.length;a++)r=Mr[a],r.blockedOn===e&&(r.blockedOn=null);for(;0<Mr.length&&(a=Mr[0],a.blockedOn===null);)t0(a),a.blockedOn===null&&Mr.shift()}var Jn=ir.ReactCurrentBatchConfig,Id=!0;function AP(e,t,a,r){var o=pe,n=Jn.transition;Jn.transition=null;try{pe=1,uh(e,t,a,r)}finally{pe=o,Jn.transition=n}}function RP(e,t,a,r){var o=pe,n=Jn.transition;Jn.transition=null;try{pe=4,uh(e,t,a,r)}finally{pe=o,Jn.transition=n}}function uh(e,t,a,r){if(Id){var o=bm(e,t,a,r);if(o===null)Qp(e,t,r,bd,a),Rx(e,r);else if(PP(o,e,t,a,r))r.stopPropagation();else if(Rx(e,r),t&4&&-1<kP.indexOf(e)){for(;o!==null;){var n=xl(o);if(n!==null&&Jv(n),n=bm(e,t,a,r),n===null&&Qp(e,t,r,bd,a),n===o)break;o=n}o!==null&&r.stopPropagation()}else Qp(e,t,r,null,a)}}var bd=null;function bm(e,t,a,r){if(bd=null,e=nh(r),e=Ro(e),e!==null)if(t=jo(e),t===null)e=null;else if(a=t.tag,a===13){if(e=zv(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 bd=e,null}function a0(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 sh:return 1;case Gv:return 4;case Sd:case xP:return 16;case Kv:return 536870912;default:return 16}default:return 16}}var Or=null,dh=null,dd=null;function r0(){if(dd)return dd;var e,t=dh,a=t.length,r,o="value"in Or?Or.value:Or.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 dd=o.slice(e,1<r?1-r:void 0)}function cd(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 Qu(){return!0}function Ex(){return!1}function Kt(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)?Qu:Ex,this.isPropagationStopped=Ex,this}return Ee(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=Qu)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Qu)},persist:function(){},isPersistent:Qu}),t}var is={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ch=Kt(is),yl=Ee({},is,{view:0,detail:0}),_P=Kt(yl),Hp,$p,Ni,Hd=Ee({},yl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:fh,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!==Ni&&(Ni&&e.type==="mousemove"?(Hp=e.screenX-Ni.screenX,$p=e.screenY-Ni.screenY):$p=Hp=0,Ni=e),Hp)},movementY:function(e){return"movementY"in e?e.movementY:$p}}),Dx=Kt(Hd),EP=Ee({},Hd,{dataTransfer:0}),DP=Kt(EP),MP=Ee({},yl,{relatedTarget:0}),Wp=Kt(MP),NP=Ee({},is,{animationName:0,elapsedTime:0,pseudoElement:0}),OP=Kt(NP),FP=Ee({},is,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),BP=Kt(FP),UP=Ee({},is,{data:0}),Mx=Kt(UP),VP={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},jP={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"},qP={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function zP(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=qP[e])?!!t[e]:!1}function fh(){return zP}var HP=Ee({},yl,{key:function(e){if(e.key){var t=VP[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=cd(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?jP[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:fh,charCode:function(e){return e.type==="keypress"?cd(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?cd(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),$P=Kt(HP),WP=Ee({},Hd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Nx=Kt(WP),GP=Ee({},yl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:fh}),KP=Kt(GP),XP=Ee({},is,{propertyName:0,elapsedTime:0,pseudoElement:0}),QP=Kt(XP),JP=Ee({},Hd,{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}),YP=Kt(JP),ZP=[9,13,27,32],ph=rr&&"CompositionEvent"in window,Wi=null;rr&&"documentMode"in document&&(Wi=document.documentMode);var eT=rr&&"TextEvent"in window&&!Wi,o0=rr&&(!ph||Wi&&8<Wi&&11>=Wi),Ox=" ",Fx=!1;function n0(e,t){switch(e){case"keyup":return ZP.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function s0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Bn=!1;function tT(e,t){switch(e){case"compositionend":return s0(t);case"keypress":return t.which!==32?null:(Fx=!0,Ox);case"textInput":return e=t.data,e===Ox&&Fx?null:e;default:return null}}function aT(e,t){if(Bn)return e==="compositionend"||!ph&&n0(e,t)?(e=r0(),dd=dh=Or=null,Bn=!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 o0&&t.locale!=="ko"?null:t.data;default:return null}}var rT={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 Bx(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!rT[e.type]:t==="textarea"}function i0(e,t,a,r){Bv(r),t=kd(t,"onChange"),0<t.length&&(a=new ch("onChange","change",null,a,r),e.push({event:a,listeners:t}))}var Gi=null,nl=null;function oT(e){x0(e,0)}function $d(e){var t=jn(e);if(_v(t))return e}function nT(e,t){if(e==="change")return t}var l0=!1;rr&&(rr?(Yu="oninput"in document,Yu||(Gp=document.createElement("div"),Gp.setAttribute("oninput","return;"),Yu=typeof Gp.oninput=="function"),Ju=Yu):Ju=!1,l0=Ju&&(!document.documentMode||9<document.documentMode));var Ju,Yu,Gp;function Ux(){Gi&&(Gi.detachEvent("onpropertychange",u0),nl=Gi=null)}function u0(e){if(e.propertyName==="value"&&$d(nl)){var t=[];i0(t,nl,e,nh(e)),qv(oT,t)}}function sT(e,t,a){e==="focusin"?(Ux(),Gi=t,nl=a,Gi.attachEvent("onpropertychange",u0)):e==="focusout"&&Ux()}function iT(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return $d(nl)}function lT(e,t){if(e==="click")return $d(t)}function uT(e,t){if(e==="input"||e==="change")return $d(t)}function dT(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var La=typeof Object.is=="function"?Object.is:dT;function sl(e,t){if(La(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(!im.call(t,o)||!La(e[o],t[o]))return!1}return!0}function Vx(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function jx(e,t){var a=Vx(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=Vx(a)}}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 c0(){for(var e=window,t=vd();t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=vd(e.document)}return t}function mh(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 cT(e){var t=c0(),a=e.focusedElem,r=e.selectionRange;if(t!==a&&a&&a.ownerDocument&&d0(a.ownerDocument.documentElement,a)){if(r!==null&&mh(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=jx(a,n);var s=jx(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 fT=rr&&"documentMode"in document&&11>=document.documentMode,Un=null,km=null,Ki=null,Pm=!1;function qx(e,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Pm||Un==null||Un!==vd(r)||(r=Un,"selectionStart"in r&&mh(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}),Ki&&sl(Ki,r)||(Ki=r,r=kd(km,"onSelect"),0<r.length&&(t=new ch("onSelect","select",null,t,a),e.push({event:t,listeners:r}),t.target=Un)))}function Zu(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Vn={animationend:Zu("Animation","AnimationEnd"),animationiteration:Zu("Animation","AnimationIteration"),animationstart:Zu("Animation","AnimationStart"),transitionend:Zu("Transition","TransitionEnd")},Kp={},f0={};rr&&(f0=document.createElement("div").style,"AnimationEvent"in window||(delete Vn.animationend.animation,delete Vn.animationiteration.animation,delete Vn.animationstart.animation),"TransitionEvent"in window||delete Vn.transitionend.transition);function Wd(e){if(Kp[e])return Kp[e];if(!Vn[e])return e;var t=Vn[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in f0)return Kp[e]=t[a];return e}var p0=Wd("animationend"),m0=Wd("animationiteration"),h0=Wd("animationstart"),g0=Wd("transitionend"),y0=new Map,zx="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 Kr(e,t){y0.set(e,t),Vo(t,[e])}for(ed=0;ed<zx.length;ed++)td=zx[ed],Hx=td.toLowerCase(),$x=td[0].toUpperCase()+td.slice(1),Kr(Hx,"on"+$x);var td,Hx,$x,ed;Kr(p0,"onAnimationEnd");Kr(m0,"onAnimationIteration");Kr(h0,"onAnimationStart");Kr("dblclick","onDoubleClick");Kr("focusin","onFocus");Kr("focusout","onBlur");Kr(g0,"onTransitionEnd");es("onMouseEnter",["mouseout","mouseover"]);es("onMouseLeave",["mouseout","mouseover"]);es("onPointerEnter",["pointerout","pointerover"]);es("onPointerLeave",["pointerout","pointerover"]);Vo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Vo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Vo("onBeforeInput",["compositionend","keypress","textInput","paste"]);Vo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Vo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Vo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var zi="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(" "),pT=new Set("cancel close invalid load scroll toggle".split(" ").concat(zi));function Wx(e,t,a){var r=e.type||"unknown-event";e.currentTarget=a,pP(r,t,void 0,e),e.currentTarget=null}function x0(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;Wx(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;Wx(o,i,u),n=l}}}if(Cd)throw e=Sm,Cd=!1,Sm=null,e}function Ie(e,t){var a=t[Em];a===void 0&&(a=t[Em]=new Set);var r=e+"__bubble";a.has(r)||(v0(t,e,2,!1),a.add(r))}function Xp(e,t,a){var r=0;t&&(r|=4),v0(a,e,r,t)}var ad="_reactListening"+Math.random().toString(36).slice(2);function il(e){if(!e[ad]){e[ad]=!0,kv.forEach(function(a){a!=="selectionchange"&&(pT.has(a)||Xp(a,!1,e),Xp(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ad]||(t[ad]=!0,Xp("selectionchange",!1,t))}}function v0(e,t,a,r){switch(a0(t)){case 1:var o=AP;break;case 4:o=RP;break;default:o=uh}a=o.bind(null,t,a,e),o=void 0,!Cm||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 Qp(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=Ro(i),s===null)return;if(l=s.tag,l===5||l===6){r=n=s;continue e}i=i.parentNode}}r=r.return}qv(function(){var u=n,d=nh(a),c=[];e:{var f=y0.get(e);if(f!==void 0){var g=ch,x=e;switch(e){case"keypress":if(cd(a)===0)break e;case"keydown":case"keyup":g=$P;break;case"focusin":x="focus",g=Wp;break;case"focusout":x="blur",g=Wp;break;case"beforeblur":case"afterblur":g=Wp;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":g=Dx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=DP;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=KP;break;case p0:case m0:case h0:g=OP;break;case g0:g=QP;break;case"scroll":g=_P;break;case"wheel":g=YP;break;case"copy":case"cut":case"paste":g=BP;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=Nx}var w=(t&4)!==0,L=!w&&e==="scroll",y=w?f!==null?f+"Capture":null:f;w=[];for(var h=u,m;h!==null;){m=h;var S=m.stateNode;if(m.tag===5&&S!==null&&(m=S,y!==null&&(S=tl(h,y),S!=null&&w.push(ll(h,S,m)))),L)break;h=h.return}0<w.length&&(f=new g(f,x,null,a,d),c.push({event:f,listeners:w}))}}if((t&7)===0){e:{if(f=e==="mouseover"||e==="pointerover",g=e==="mouseout"||e==="pointerout",f&&a!==vm&&(x=a.relatedTarget||a.fromElement)&&(Ro(x)||x[or]))break e;if((g||f)&&(f=d.window===d?d:(f=d.ownerDocument)?f.defaultView||f.parentWindow:window,g?(x=a.relatedTarget||a.toElement,g=u,x=x?Ro(x):null,x!==null&&(L=jo(x),x!==L||x.tag!==5&&x.tag!==6)&&(x=null)):(g=null,x=u),g!==x)){if(w=Dx,S="onMouseLeave",y="onMouseEnter",h="mouse",(e==="pointerout"||e==="pointerover")&&(w=Nx,S="onPointerLeave",y="onPointerEnter",h="pointer"),L=g==null?f:jn(g),m=x==null?f:jn(x),f=new w(S,h+"leave",g,a,d),f.target=L,f.relatedTarget=m,S=null,Ro(d)===u&&(w=new w(y,h+"enter",x,a,d),w.target=m,w.relatedTarget=L,S=w),L=S,g&&x)t:{for(w=g,y=x,h=0,m=w;m;m=Nn(m))h++;for(m=0,S=y;S;S=Nn(S))m++;for(;0<h-m;)w=Nn(w),h--;for(;0<m-h;)y=Nn(y),m--;for(;h--;){if(w===y||y!==null&&w===y.alternate)break t;w=Nn(w),y=Nn(y)}w=null}else w=null;g!==null&&Gx(c,f,g,w,!1),x!==null&&L!==null&&Gx(c,L,x,w,!0)}}e:{if(f=u?jn(u):window,g=f.nodeName&&f.nodeName.toLowerCase(),g==="select"||g==="input"&&f.type==="file")var I=nT;else if(Bx(f))if(l0)I=uT;else{I=iT;var P=sT}else(g=f.nodeName)&&g.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(I=lT);if(I&&(I=I(e,u))){i0(c,I,a,d);break e}P&&P(e,f,u),e==="focusout"&&(P=f._wrapperState)&&P.controlled&&f.type==="number"&&mm(f,"number",f.value)}switch(P=u?jn(u):window,e){case"focusin":(Bx(P)||P.contentEditable==="true")&&(Un=P,km=u,Ki=null);break;case"focusout":Ki=km=Un=null;break;case"mousedown":Pm=!0;break;case"contextmenu":case"mouseup":case"dragend":Pm=!1,qx(c,a,d);break;case"selectionchange":if(fT)break;case"keydown":case"keyup":qx(c,a,d)}var R;if(ph)e:{switch(e){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else Bn?n0(e,a)&&(A="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(A="onCompositionStart");A&&(o0&&a.locale!=="ko"&&(Bn||A!=="onCompositionStart"?A==="onCompositionEnd"&&Bn&&(R=r0()):(Or=d,dh="value"in Or?Or.value:Or.textContent,Bn=!0)),P=kd(u,A),0<P.length&&(A=new Mx(A,e,null,a,d),c.push({event:A,listeners:P}),R?A.data=R:(R=s0(a),R!==null&&(A.data=R)))),(R=eT?tT(e,a):aT(e,a))&&(u=kd(u,"onBeforeInput"),0<u.length&&(d=new Mx("onBeforeInput","beforeinput",null,a,d),c.push({event:d,listeners:u}),d.data=R))}x0(c,t)})}function ll(e,t,a){return{instance:e,listener:t,currentTarget:a}}function kd(e,t){for(var a=t+"Capture",r=[];e!==null;){var o=e,n=o.stateNode;o.tag===5&&n!==null&&(o=n,n=tl(e,a),n!=null&&r.unshift(ll(e,n,o)),n=tl(e,t),n!=null&&r.push(ll(e,n,o))),e=e.return}return r}function Nn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Gx(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=tl(a,n),l!=null&&s.unshift(ll(a,l,i))):o||(l=tl(a,n),l!=null&&s.push(ll(a,l,i)))),a=a.return}s.length!==0&&e.push({event:t,listeners:s})}var mT=/\r\n?/g,hT=/\u0000|\uFFFD/g;function Kx(e){return(typeof e=="string"?e:""+e).replace(mT,`
|
|
6
|
+
`).replace(hT,"")}function rd(e,t,a){if(t=Kx(t),Kx(e)!==t&&a)throw Error(_(425))}function Pd(){}var Tm=null,Am=null;function Rm(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 _m=typeof setTimeout=="function"?setTimeout:void 0,gT=typeof clearTimeout=="function"?clearTimeout:void 0,Xx=typeof Promise=="function"?Promise:void 0,yT=typeof queueMicrotask=="function"?queueMicrotask:typeof Xx<"u"?function(e){return Xx.resolve(null).then(e).catch(xT)}:_m;function xT(e){setTimeout(function(){throw e})}function Jp(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),ol(t);return}r--}else a!=="$"&&a!=="$?"&&a!=="$!"||r++;a=o}while(a);ol(t)}function jr(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 Qx(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 ls=Math.random().toString(36).slice(2),Da="__reactFiber$"+ls,ul="__reactProps$"+ls,or="__reactContainer$"+ls,Em="__reactEvents$"+ls,vT="__reactListeners$"+ls,wT="__reactHandles$"+ls;function Ro(e){var t=e[Da];if(t)return t;for(var a=e.parentNode;a;){if(t=a[or]||a[Da]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Qx(e);e!==null;){if(a=e[Da])return a;e=Qx(e)}return t}e=a,a=e.parentNode}return null}function xl(e){return e=e[Da]||e[or],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function jn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(_(33))}function Gd(e){return e[ul]||null}var Dm=[],qn=-1;function Xr(e){return{current:e}}function be(e){0>qn||(e.current=Dm[qn],Dm[qn]=null,qn--)}function we(e,t){qn++,Dm[qn]=e.current,e.current=t}var Gr={},xt=Xr(Gr),Dt=Xr(!1),No=Gr;function ts(e,t){var a=e.type.contextTypes;if(!a)return Gr;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 Mt(e){return e=e.childContextTypes,e!=null}function Td(){be(Dt),be(xt)}function Jx(e,t,a){if(xt.current!==Gr)throw Error(_(168));we(xt,t),we(Dt,a)}function w0(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(_(108,sP(e)||"Unknown",o));return Ee({},a,r)}function Ad(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Gr,No=xt.current,we(xt,e),we(Dt,Dt.current),!0}function Yx(e,t,a){var r=e.stateNode;if(!r)throw Error(_(169));a?(e=w0(e,t,No),r.__reactInternalMemoizedMergedChildContext=e,be(Dt),be(xt),we(xt,e)):be(Dt),we(Dt,a)}var Za=null,Kd=!1,Yp=!1;function C0(e){Za===null?Za=[e]:Za.push(e)}function CT(e){Kd=!0,C0(e)}function Qr(){if(!Yp&&Za!==null){Yp=!0;var e=0,t=pe;try{var a=Za;for(pe=1;e<a.length;e++){var r=a[e];do r=r(!0);while(r!==null)}Za=null,Kd=!1}catch(o){throw Za!==null&&(Za=Za.slice(e+1)),Wv(sh,Qr),o}finally{pe=t,Yp=!1}}return null}var zn=[],Hn=0,Rd=null,_d=0,sa=[],ia=0,Oo=null,er=1,tr="";function To(e,t){zn[Hn++]=_d,zn[Hn++]=Rd,Rd=e,_d=t}function S0(e,t,a){sa[ia++]=er,sa[ia++]=tr,sa[ia++]=Oo,Oo=e;var r=er;e=tr;var o=32-Ca(r)-1;r&=~(1<<o),a+=1;var n=32-Ca(t)+o;if(30<n){var s=o-o%5;n=(r&(1<<s)-1).toString(32),r>>=s,o-=s,er=1<<32-Ca(t)+o|a<<o|r,tr=n+e}else er=1<<n|a<<o|r,tr=e}function hh(e){e.return!==null&&(To(e,1),S0(e,1,0))}function gh(e){for(;e===Rd;)Rd=zn[--Hn],zn[Hn]=null,_d=zn[--Hn],zn[Hn]=null;for(;e===Oo;)Oo=sa[--ia],sa[ia]=null,tr=sa[--ia],sa[ia]=null,er=sa[--ia],sa[ia]=null}var Wt=null,$t=null,Ae=!1,wa=null;function L0(e,t){var a=la(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 Zx(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,Wt=e,$t=jr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Wt=e,$t=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(a=Oo!==null?{id:er,overflow:tr}:null,e.memoizedState={dehydrated:t,treeContext:a,retryLane:1073741824},a=la(18,null,null,0),a.stateNode=t,a.return=e,e.child=a,Wt=e,$t=null,!0):!1;default:return!1}}function Mm(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Nm(e){if(Ae){var t=$t;if(t){var a=t;if(!Zx(e,t)){if(Mm(e))throw Error(_(418));t=jr(a.nextSibling);var r=Wt;t&&Zx(e,t)?L0(r,a):(e.flags=e.flags&-4097|2,Ae=!1,Wt=e)}}else{if(Mm(e))throw Error(_(418));e.flags=e.flags&-4097|2,Ae=!1,Wt=e}}}function ev(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Wt=e}function od(e){if(e!==Wt)return!1;if(!Ae)return ev(e),Ae=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Rm(e.type,e.memoizedProps)),t&&(t=$t)){if(Mm(e))throw I0(),Error(_(418));for(;t;)L0(e,t),t=jr(t.nextSibling)}if(ev(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(_(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"){if(t===0){$t=jr(e.nextSibling);break e}t--}else a!=="$"&&a!=="$!"&&a!=="$?"||t++}e=e.nextSibling}$t=null}}else $t=Wt?jr(e.stateNode.nextSibling):null;return!0}function I0(){for(var e=$t;e;)e=jr(e.nextSibling)}function as(){$t=Wt=null,Ae=!1}function yh(e){wa===null?wa=[e]:wa.push(e)}var ST=ir.ReactCurrentBatchConfig;function Oi(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(_(309));var r=a.stateNode}if(!r)throw Error(_(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(_(284));if(!a._owner)throw Error(_(290,e))}return e}function nd(e,t){throw e=Object.prototype.toString.call(t),Error(_(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function tv(e){var t=e._init;return t(e._payload)}function b0(e){function t(y,h){if(e){var m=y.deletions;m===null?(y.deletions=[h],y.flags|=16):m.push(h)}}function a(y,h){if(!e)return null;for(;h!==null;)t(y,h),h=h.sibling;return null}function r(y,h){for(y=new Map;h!==null;)h.key!==null?y.set(h.key,h):y.set(h.index,h),h=h.sibling;return y}function o(y,h){return y=$r(y,h),y.index=0,y.sibling=null,y}function n(y,h,m){return y.index=m,e?(m=y.alternate,m!==null?(m=m.index,m<h?(y.flags|=2,h):m):(y.flags|=2,h)):(y.flags|=1048576,h)}function s(y){return e&&y.alternate===null&&(y.flags|=2),y}function i(y,h,m,S){return h===null||h.tag!==6?(h=nm(m,y.mode,S),h.return=y,h):(h=o(h,m),h.return=y,h)}function l(y,h,m,S){var I=m.type;return I===Fn?d(y,h,m.props.children,S,m.key):h!==null&&(h.elementType===I||typeof I=="object"&&I!==null&&I.$$typeof===Er&&tv(I)===h.type)?(S=o(h,m.props),S.ref=Oi(y,h,m),S.return=y,S):(S=xd(m.type,m.key,m.props,null,y.mode,S),S.ref=Oi(y,h,m),S.return=y,S)}function u(y,h,m,S){return h===null||h.tag!==4||h.stateNode.containerInfo!==m.containerInfo||h.stateNode.implementation!==m.implementation?(h=sm(m,y.mode,S),h.return=y,h):(h=o(h,m.children||[]),h.return=y,h)}function d(y,h,m,S,I){return h===null||h.tag!==7?(h=Mo(m,y.mode,S,I),h.return=y,h):(h=o(h,m),h.return=y,h)}function c(y,h,m){if(typeof h=="string"&&h!==""||typeof h=="number")return h=nm(""+h,y.mode,m),h.return=y,h;if(typeof h=="object"&&h!==null){switch(h.$$typeof){case Hu:return m=xd(h.type,h.key,h.props,null,y.mode,m),m.ref=Oi(y,null,h),m.return=y,m;case On:return h=sm(h,y.mode,m),h.return=y,h;case Er:var S=h._init;return c(y,S(h._payload),m)}if(ji(h)||Ei(h))return h=Mo(h,y.mode,m,null),h.return=y,h;nd(y,h)}return null}function f(y,h,m,S){var I=h!==null?h.key:null;if(typeof m=="string"&&m!==""||typeof m=="number")return I!==null?null:i(y,h,""+m,S);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Hu:return m.key===I?l(y,h,m,S):null;case On:return m.key===I?u(y,h,m,S):null;case Er:return I=m._init,f(y,h,I(m._payload),S)}if(ji(m)||Ei(m))return I!==null?null:d(y,h,m,S,null);nd(y,m)}return null}function g(y,h,m,S,I){if(typeof S=="string"&&S!==""||typeof S=="number")return y=y.get(m)||null,i(h,y,""+S,I);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Hu:return y=y.get(S.key===null?m:S.key)||null,l(h,y,S,I);case On:return y=y.get(S.key===null?m:S.key)||null,u(h,y,S,I);case Er:var P=S._init;return g(y,h,m,P(S._payload),I)}if(ji(S)||Ei(S))return y=y.get(m)||null,d(h,y,S,I,null);nd(h,S)}return null}function x(y,h,m,S){for(var I=null,P=null,R=h,A=h=0,V=null;R!==null&&A<m.length;A++){R.index>A?(V=R,R=null):V=R.sibling;var F=f(y,R,m[A],S);if(F===null){R===null&&(R=V);break}e&&R&&F.alternate===null&&t(y,R),h=n(F,h,A),P===null?I=F:P.sibling=F,P=F,R=V}if(A===m.length)return a(y,R),Ae&&To(y,A),I;if(R===null){for(;A<m.length;A++)R=c(y,m[A],S),R!==null&&(h=n(R,h,A),P===null?I=R:P.sibling=R,P=R);return Ae&&To(y,A),I}for(R=r(y,R);A<m.length;A++)V=g(R,y,A,m[A],S),V!==null&&(e&&V.alternate!==null&&R.delete(V.key===null?A:V.key),h=n(V,h,A),P===null?I=V:P.sibling=V,P=V);return e&&R.forEach(function(me){return t(y,me)}),Ae&&To(y,A),I}function w(y,h,m,S){var I=Ei(m);if(typeof I!="function")throw Error(_(150));if(m=I.call(m),m==null)throw Error(_(151));for(var P=I=null,R=h,A=h=0,V=null,F=m.next();R!==null&&!F.done;A++,F=m.next()){R.index>A?(V=R,R=null):V=R.sibling;var me=f(y,R,F.value,S);if(me===null){R===null&&(R=V);break}e&&R&&me.alternate===null&&t(y,R),h=n(me,h,A),P===null?I=me:P.sibling=me,P=me,R=V}if(F.done)return a(y,R),Ae&&To(y,A),I;if(R===null){for(;!F.done;A++,F=m.next())F=c(y,F.value,S),F!==null&&(h=n(F,h,A),P===null?I=F:P.sibling=F,P=F);return Ae&&To(y,A),I}for(R=r(y,R);!F.done;A++,F=m.next())F=g(R,y,A,F.value,S),F!==null&&(e&&F.alternate!==null&&R.delete(F.key===null?A:F.key),h=n(F,h,A),P===null?I=F:P.sibling=F,P=F);return e&&R.forEach(function(ae){return t(y,ae)}),Ae&&To(y,A),I}function L(y,h,m,S){if(typeof m=="object"&&m!==null&&m.type===Fn&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case Hu:e:{for(var I=m.key,P=h;P!==null;){if(P.key===I){if(I=m.type,I===Fn){if(P.tag===7){a(y,P.sibling),h=o(P,m.props.children),h.return=y,y=h;break e}}else if(P.elementType===I||typeof I=="object"&&I!==null&&I.$$typeof===Er&&tv(I)===P.type){a(y,P.sibling),h=o(P,m.props),h.ref=Oi(y,P,m),h.return=y,y=h;break e}a(y,P);break}else t(y,P);P=P.sibling}m.type===Fn?(h=Mo(m.props.children,y.mode,S,m.key),h.return=y,y=h):(S=xd(m.type,m.key,m.props,null,y.mode,S),S.ref=Oi(y,h,m),S.return=y,y=S)}return s(y);case On:e:{for(P=m.key;h!==null;){if(h.key===P)if(h.tag===4&&h.stateNode.containerInfo===m.containerInfo&&h.stateNode.implementation===m.implementation){a(y,h.sibling),h=o(h,m.children||[]),h.return=y,y=h;break e}else{a(y,h);break}else t(y,h);h=h.sibling}h=sm(m,y.mode,S),h.return=y,y=h}return s(y);case Er:return P=m._init,L(y,h,P(m._payload),S)}if(ji(m))return x(y,h,m,S);if(Ei(m))return w(y,h,m,S);nd(y,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,h!==null&&h.tag===6?(a(y,h.sibling),h=o(h,m),h.return=y,y=h):(a(y,h),h=nm(m,y.mode,S),h.return=y,y=h),s(y)):a(y,h)}return L}var rs=b0(!0),k0=b0(!1),Ed=Xr(null),Dd=null,$n=null,xh=null;function vh(){xh=$n=Dd=null}function wh(e){var t=Ed.current;be(Ed),e._currentValue=t}function Om(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 Yn(e,t){Dd=e,xh=$n=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Et=!0),e.firstContext=null)}function da(e){var t=e._currentValue;if(xh!==e)if(e={context:e,memoizedValue:t,next:null},$n===null){if(Dd===null)throw Error(_(308));$n=e,Dd.dependencies={lanes:0,firstContext:e}}else $n=$n.next=e;return t}var _o=null;function Ch(e){_o===null?_o=[e]:_o.push(e)}function P0(e,t,a,r){var o=t.interleaved;return o===null?(a.next=a,Ch(t)):(a.next=o.next,o.next=a),t.interleaved=a,nr(e,r)}function nr(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 Dr=!1;function Sh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function T0(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 ar(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function qr(e,t,a){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(ue&2)!==0){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,nr(e,a)}return o=r.interleaved,o===null?(t.next=t,Ch(r)):(t.next=o.next,o.next=t),r.interleaved=t,nr(e,a)}function fd(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,ih(e,a)}}function av(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 Md(e,t,a,r){var o=e.updateQueue;Dr=!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,g=i.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:g,lane:0,tag:i.tag,payload:i.payload,callback:i.callback,next:null});e:{var x=e,w=i;switch(f=t,g=a,w.tag){case 1:if(x=w.payload,typeof x=="function"){c=x.call(g,c,f);break e}c=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=w.payload,f=typeof x=="function"?x.call(g,c,f):x,f==null)break e;c=Ee({},c,f);break e;case 2:Dr=!0}}i.callback!==null&&i.lane!==0&&(e.flags|=64,f=o.effects,f===null?o.effects=[i]:f.push(i))}else g={eventTime:g,lane:f,tag:i.tag,payload:i.payload,callback:i.callback,next:null},d===null?(u=d=g,l=c):d=d.next=g,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);Bo|=s,e.lanes=s,e.memoizedState=c}}function rv(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(_(191,o));o.call(r)}}}var vl={},Na=Xr(vl),dl=Xr(vl),cl=Xr(vl);function Eo(e){if(e===vl)throw Error(_(174));return e}function Lh(e,t){switch(we(cl,t),we(dl,e),we(Na,vl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:gm(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=gm(t,e)}be(Na),we(Na,t)}function os(){be(Na),be(dl),be(cl)}function A0(e){Eo(cl.current);var t=Eo(Na.current),a=gm(t,e.type);t!==a&&(we(dl,e),we(Na,a))}function Ih(e){dl.current===e&&(be(Na),be(dl))}var Re=Xr(0);function Nd(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 Zp=[];function bh(){for(var e=0;e<Zp.length;e++)Zp[e]._workInProgressVersionPrimary=null;Zp.length=0}var pd=ir.ReactCurrentDispatcher,em=ir.ReactCurrentBatchConfig,Fo=0,_e=null,We=null,Ze=null,Od=!1,Xi=!1,fl=0,LT=0;function ht(){throw Error(_(321))}function kh(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!La(e[a],t[a]))return!1;return!0}function Ph(e,t,a,r,o,n){if(Fo=n,_e=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,pd.current=e===null||e.memoizedState===null?PT:TT,e=a(r,o),Xi){n=0;do{if(Xi=!1,fl=0,25<=n)throw Error(_(301));n+=1,Ze=We=null,t.updateQueue=null,pd.current=AT,e=a(r,o)}while(Xi)}if(pd.current=Fd,t=We!==null&&We.next!==null,Fo=0,Ze=We=_e=null,Od=!1,t)throw Error(_(300));return e}function Th(){var e=fl!==0;return fl=0,e}function Ea(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ze===null?_e.memoizedState=Ze=e:Ze=Ze.next=e,Ze}function ca(){if(We===null){var e=_e.alternate;e=e!==null?e.memoizedState:null}else e=We.next;var t=Ze===null?_e.memoizedState:Ze.next;if(t!==null)Ze=t,We=e;else{if(e===null)throw Error(_(310));We=e,e={memoizedState:We.memoizedState,baseState:We.baseState,baseQueue:We.baseQueue,queue:We.queue,next:null},Ze===null?_e.memoizedState=Ze=e:Ze=Ze.next=e}return Ze}function pl(e,t){return typeof t=="function"?t(e):t}function tm(e){var t=ca(),a=t.queue;if(a===null)throw Error(_(311));a.lastRenderedReducer=e;var r=We,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((Fo&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,_e.lanes|=d,Bo|=d}u=u.next}while(u!==null&&u!==n);l===null?s=r:l.next=i,La(r,t.memoizedState)||(Et=!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,_e.lanes|=n,Bo|=n,o=o.next;while(o!==e)}else o===null&&(a.lanes=0);return[t.memoizedState,a.dispatch]}function am(e){var t=ca(),a=t.queue;if(a===null)throw Error(_(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);La(n,t.memoizedState)||(Et=!0),t.memoizedState=n,t.baseQueue===null&&(t.baseState=n),a.lastRenderedState=n}return[n,r]}function R0(){}function _0(e,t){var a=_e,r=ca(),o=t(),n=!La(r.memoizedState,o);if(n&&(r.memoizedState=o,Et=!0),r=r.queue,Ah(M0.bind(null,a,r,e),[e]),r.getSnapshot!==t||n||Ze!==null&&Ze.memoizedState.tag&1){if(a.flags|=2048,ml(9,D0.bind(null,a,r,o,t),void 0,null),et===null)throw Error(_(349));(Fo&30)!==0||E0(a,t,o)}return o}function E0(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=_e.updateQueue,t===null?(t={lastEffect:null,stores:null},_e.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function D0(e,t,a,r){t.value=a,t.getSnapshot=r,N0(t)&&O0(e)}function M0(e,t,a){return a(function(){N0(t)&&O0(e)})}function N0(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!La(e,a)}catch{return!0}}function O0(e){var t=nr(e,1);t!==null&&Sa(t,e,1,-1)}function ov(e){var t=Ea();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:pl,lastRenderedState:e},t.queue=e,e=e.dispatch=kT.bind(null,_e,e),[t.memoizedState,e]}function ml(e,t,a,r){return e={tag:e,create:t,destroy:a,deps:r,next:null},t=_e.updateQueue,t===null?(t={lastEffect:null,stores:null},_e.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 F0(){return ca().memoizedState}function md(e,t,a,r){var o=Ea();_e.flags|=e,o.memoizedState=ml(1|t,a,void 0,r===void 0?null:r)}function Xd(e,t,a,r){var o=ca();r=r===void 0?null:r;var n=void 0;if(We!==null){var s=We.memoizedState;if(n=s.destroy,r!==null&&kh(r,s.deps)){o.memoizedState=ml(t,a,n,r);return}}_e.flags|=e,o.memoizedState=ml(1|t,a,n,r)}function nv(e,t){return md(8390656,8,e,t)}function Ah(e,t){return Xd(2048,8,e,t)}function B0(e,t){return Xd(4,2,e,t)}function U0(e,t){return Xd(4,4,e,t)}function V0(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 j0(e,t,a){return a=a!=null?a.concat([e]):null,Xd(4,4,V0.bind(null,t,e),a)}function Rh(){}function q0(e,t){var a=ca();t=t===void 0?null:t;var r=a.memoizedState;return r!==null&&t!==null&&kh(t,r[1])?r[0]:(a.memoizedState=[e,t],e)}function z0(e,t){var a=ca();t=t===void 0?null:t;var r=a.memoizedState;return r!==null&&t!==null&&kh(t,r[1])?r[0]:(e=e(),a.memoizedState=[e,t],e)}function H0(e,t,a){return(Fo&21)===0?(e.baseState&&(e.baseState=!1,Et=!0),e.memoizedState=a):(La(a,t)||(a=Xv(),_e.lanes|=a,Bo|=a,e.baseState=!0),t)}function IT(e,t){var a=pe;pe=a!==0&&4>a?a:4,e(!0);var r=em.transition;em.transition={};try{e(!1),t()}finally{pe=a,em.transition=r}}function $0(){return ca().memoizedState}function bT(e,t,a){var r=Hr(e);if(a={lane:r,action:a,hasEagerState:!1,eagerState:null,next:null},W0(e))G0(t,a);else if(a=P0(e,t,a,r),a!==null){var o=bt();Sa(a,e,r,o),K0(a,t,r)}}function kT(e,t,a){var r=Hr(e),o={lane:r,action:a,hasEagerState:!1,eagerState:null,next:null};if(W0(e))G0(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,La(i,s)){var l=t.interleaved;l===null?(o.next=o,Ch(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}a=P0(e,t,o,r),a!==null&&(o=bt(),Sa(a,e,r,o),K0(a,t,r))}}function W0(e){var t=e.alternate;return e===_e||t!==null&&t===_e}function G0(e,t){Xi=Od=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function K0(e,t,a){if((a&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,ih(e,a)}}var Fd={readContext:da,useCallback:ht,useContext:ht,useEffect:ht,useImperativeHandle:ht,useInsertionEffect:ht,useLayoutEffect:ht,useMemo:ht,useReducer:ht,useRef:ht,useState:ht,useDebugValue:ht,useDeferredValue:ht,useTransition:ht,useMutableSource:ht,useSyncExternalStore:ht,useId:ht,unstable_isNewReconciler:!1},PT={readContext:da,useCallback:function(e,t){return Ea().memoizedState=[e,t===void 0?null:t],e},useContext:da,useEffect:nv,useImperativeHandle:function(e,t,a){return a=a!=null?a.concat([e]):null,md(4194308,4,V0.bind(null,t,e),a)},useLayoutEffect:function(e,t){return md(4194308,4,e,t)},useInsertionEffect:function(e,t){return md(4,2,e,t)},useMemo:function(e,t){var a=Ea();return t=t===void 0?null:t,e=e(),a.memoizedState=[e,t],e},useReducer:function(e,t,a){var r=Ea();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=bT.bind(null,_e,e),[r.memoizedState,e]},useRef:function(e){var t=Ea();return e={current:e},t.memoizedState=e},useState:ov,useDebugValue:Rh,useDeferredValue:function(e){return Ea().memoizedState=e},useTransition:function(){var e=ov(!1),t=e[0];return e=IT.bind(null,e[1]),Ea().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,a){var r=_e,o=Ea();if(Ae){if(a===void 0)throw Error(_(407));a=a()}else{if(a=t(),et===null)throw Error(_(349));(Fo&30)!==0||E0(r,t,a)}o.memoizedState=a;var n={value:a,getSnapshot:t};return o.queue=n,nv(M0.bind(null,r,n,e),[e]),r.flags|=2048,ml(9,D0.bind(null,r,n,a,t),void 0,null),a},useId:function(){var e=Ea(),t=et.identifierPrefix;if(Ae){var a=tr,r=er;a=(r&~(1<<32-Ca(r)-1)).toString(32)+a,t=":"+t+"R"+a,a=fl++,0<a&&(t+="H"+a.toString(32)),t+=":"}else a=LT++,t=":"+t+"r"+a.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},TT={readContext:da,useCallback:q0,useContext:da,useEffect:Ah,useImperativeHandle:j0,useInsertionEffect:B0,useLayoutEffect:U0,useMemo:z0,useReducer:tm,useRef:F0,useState:function(){return tm(pl)},useDebugValue:Rh,useDeferredValue:function(e){var t=ca();return H0(t,We.memoizedState,e)},useTransition:function(){var e=tm(pl)[0],t=ca().memoizedState;return[e,t]},useMutableSource:R0,useSyncExternalStore:_0,useId:$0,unstable_isNewReconciler:!1},AT={readContext:da,useCallback:q0,useContext:da,useEffect:Ah,useImperativeHandle:j0,useInsertionEffect:B0,useLayoutEffect:U0,useMemo:z0,useReducer:am,useRef:F0,useState:function(){return am(pl)},useDebugValue:Rh,useDeferredValue:function(e){var t=ca();return We===null?t.memoizedState=e:H0(t,We.memoizedState,e)},useTransition:function(){var e=am(pl)[0],t=ca().memoizedState;return[e,t]},useMutableSource:R0,useSyncExternalStore:_0,useId:$0,unstable_isNewReconciler:!1};function xa(e,t){if(e&&e.defaultProps){t=Ee({},t),e=e.defaultProps;for(var a in e)t[a]===void 0&&(t[a]=e[a]);return t}return t}function Fm(e,t,a,r){t=e.memoizedState,a=a(r,t),a=a==null?t:Ee({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Qd={isMounted:function(e){return(e=e._reactInternals)?jo(e)===e:!1},enqueueSetState:function(e,t,a){e=e._reactInternals;var r=bt(),o=Hr(e),n=ar(r,o);n.payload=t,a!=null&&(n.callback=a),t=qr(e,n,o),t!==null&&(Sa(t,e,o,r),fd(t,e,o))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var r=bt(),o=Hr(e),n=ar(r,o);n.tag=1,n.payload=t,a!=null&&(n.callback=a),t=qr(e,n,o),t!==null&&(Sa(t,e,o,r),fd(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=bt(),r=Hr(e),o=ar(a,r);o.tag=2,t!=null&&(o.callback=t),t=qr(e,o,r),t!==null&&(Sa(t,e,r,a),fd(t,e,r))}};function sv(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?!sl(a,r)||!sl(o,n):!0}function X0(e,t,a){var r=!1,o=Gr,n=t.contextType;return typeof n=="object"&&n!==null?n=da(n):(o=Mt(t)?No:xt.current,r=t.contextTypes,n=(r=r!=null)?ts(e,o):Gr),t=new t(a,n),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Qd,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=n),t}function iv(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&&Qd.enqueueReplaceState(t,t.state,null)}function Bm(e,t,a,r){var o=e.stateNode;o.props=a,o.state=e.memoizedState,o.refs={},Sh(e);var n=t.contextType;typeof n=="object"&&n!==null?o.context=da(n):(n=Mt(t)?No:xt.current,o.context=ts(e,n)),o.state=e.memoizedState,n=t.getDerivedStateFromProps,typeof n=="function"&&(Fm(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&&Qd.enqueueReplaceState(o,o.state,null),Md(e,a,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function ns(e,t){try{var a="",r=t;do a+=nP(r),r=r.return;while(r);var o=a}catch(n){o=`
|
|
7
7
|
Error generating stack: `+n.message+`
|
|
8
|
-
`+n.stack}return{value:e,source:t,stack:o,digest:null}}function em(e,t,a){return{value:e,source:null,stack:a??null,digest:t??null}}function Om(e,t){try{console.error(t.value)}catch(a){setTimeout(function(){throw a})}}var kT=typeof WeakMap=="function"?WeakMap:Map;function G0(e,t,a){a=ar(-1,a),a.tag=3,a.payload={element:null};var r=t.value;return a.callback=function(){Od||(Od=!0,Wm=r),Om(e,t)},a}function K0(e,t,a){a=ar(-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(){Om(e,t)}}var n=e.stateNode;return n!==null&&typeof n.componentDidCatch=="function"&&(a.callback=function(){Om(e,t),typeof r!="function"&&(jr===null?jr=new Set([this]):jr.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),a}function nv(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new kT;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=VT.bind(null,e,t,a),t.then(e,e))}function sv(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 iv(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=ar(-1,1),t.tag=2,Vr(a,t,1))),a.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var PT=ir.ReactCurrentOwner,_t=!1;function It(e,t,a,r){t.child=e===null?L0(t,null,a,r):as(t,e.child,a,r)}function lv(e,t,a,r,o){a=a.render;var n=t.ref;return Jn(t,o),r=Ih(e,t,a,r,n,o),a=bh(),e!==null&&!_t?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,sr(e,t,o)):(Ae&&a&&fh(t),t.flags|=1,It(e,t,r,o),t.child)}function uv(e,t,a,r,o){if(e===null){var n=a.type;return typeof n=="function"&&!Nh(n)&&n.defaultProps===void 0&&a.compare===null&&a.defaultProps===void 0?(t.tag=15,t.type=n,X0(e,t,n,r,o)):(e=hd(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:nl,a(s,r)&&e.ref===t.ref)return sr(e,t,o)}return t.flags|=1,e=Hr(n,r),e.ref=t.ref,e.return=t,t.child=e}function X0(e,t,a,r,o){if(e!==null){var n=e.memoizedProps;if(nl(n,r)&&e.ref===t.ref)if(_t=!1,t.pendingProps=r=n,(e.lanes&o)!==0)(e.flags&131072)!==0&&(_t=!0);else return t.lanes=e.lanes,sr(e,t,o)}return Fm(e,t,a,r,o)}function Q0(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(Wn,zt),zt|=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(Wn,zt),zt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=n!==null?n.baseLanes:a,we(Wn,zt),zt|=r}else n!==null?(r=n.baseLanes|a,t.memoizedState=null):r=a,we(Wn,zt),zt|=r;return It(e,t,o,a),t.child}function J0(e,t){var a=t.ref;(e===null&&a!==null||e!==null&&e.ref!==a)&&(t.flags|=512,t.flags|=2097152)}function Fm(e,t,a,r,o){var n=Dt(a)?Mo:vt.current;return n=es(t,n),Jn(t,o),a=Ih(e,t,a,r,n,o),r=bh(),e!==null&&!_t?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,sr(e,t,o)):(Ae&&r&&fh(t),t.flags|=1,It(e,t,a,o),t.child)}function dv(e,t,a,r,o){if(Dt(a)){var n=!0;kd(t)}else n=!1;if(Jn(t,o),t.stateNode===null)fd(e,t),W0(t,a,r),Nm(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=la(u):(u=Dt(a)?Mo:vt.current,u=es(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),_r=!1;var f=t.memoizedState;s.state=f,_d(t,r,s,o),l=t.memoizedState,i!==r||f!==l||Et.current||_r?(typeof d=="function"&&(Mm(t,a,d,r),l=t.memoizedState),(i=_r||rv(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,b0(e,t),i=t.memoizedProps,u=t.type===t.elementType?i:xa(t.type,i),s.props=u,c=t.pendingProps,f=s.context,l=a.contextType,typeof l=="object"&&l!==null?l=la(l):(l=Dt(a)?Mo:vt.current,l=es(t,l));var g=a.getDerivedStateFromProps;(d=typeof g=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(i!==c||f!==l)&&ov(t,s,r,l),_r=!1,f=t.memoizedState,s.state=f,_d(t,r,s,o);var x=t.memoizedState;i!==c||f!==x||Et.current||_r?(typeof g=="function"&&(Mm(t,a,g,r),x=t.memoizedState),(u=_r||rv(t,a,u,r,f,x,l)||!1)?(d||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,x,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,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=r,t.memoizedState=x),s.props=r,s.state=x,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 Bm(e,t,a,r,n,o)}function Bm(e,t,a,r,o,n){J0(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&Xx(t,a,!1),sr(e,t,n);r=t.stateNode,PT.current=t;var i=s&&typeof a.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=as(t,e.child,null,n),t.child=as(t,null,i,n)):It(e,t,i,n),t.memoizedState=r.state,o&&Xx(t,a,!0),t.child}function Y0(e){var t=e.stateNode;t.pendingContext?Kx(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Kx(e,t.context,!1),wh(e,t.containerInfo)}function cv(e,t,a,r,o){return ts(),mh(o),t.flags|=256,It(e,t,a,r),t.child}var Um={dehydrated:null,treeContext:null,retryLane:0};function Vm(e){return{baseLanes:e,cachePool:null,transitions:null}}function Z0(e,t,a){var r=t.pendingProps,o=Re.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(Re,o&1),e===null)return Em(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=Qd(s,r,0,null),e=Do(e,r,a,null),n.return=t,e.return=t,n.sibling=e,t.child=n,t.child.memoizedState=Vm(a),t.memoizedState=Um,e):Th(t,s));if(o=e.memoizedState,o!==null&&(i=o.dehydrated,i!==null))return TT(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=Hr(o,l),r.subtreeFlags=o.subtreeFlags&14680064),i!==null?n=Hr(i,n):(n=Do(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?Vm(a):{baseLanes:s.baseLanes|a,cachePool:null,transitions:s.transitions},n.memoizedState=s,n.childLanes=e.childLanes&~a,t.memoizedState=Um,r}return n=e.child,e=n.sibling,r=Hr(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 Th(e,t){return t=Qd({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function rd(e,t,a,r){return r!==null&&mh(r),as(t,e.child,null,a),e=Th(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function TT(e,t,a,r,o,n,s){if(a)return t.flags&256?(t.flags&=-257,r=em(Error(_(422))),rd(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(n=r.fallback,o=t.mode,r=Qd({mode:"visible",children:r.children},o,0,null),n=Do(n,o,s,null),n.flags|=2,r.return=t,n.return=t,r.sibling=n,t.child=r,(t.mode&1)!==0&&as(t,e.child,null,s),t.child.memoizedState=Vm(s),t.memoizedState=Um,n);if((t.mode&1)===0)return rd(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var i=r.dgst;return r=i,n=Error(_(419)),r=em(n,r,void 0),rd(e,t,s,r)}if(i=(s&e.childLanes)!==0,_t||i){if(r=tt,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,nr(e,o),Ca(r,e,o,-1))}return Mh(),r=em(Error(_(421))),rd(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=jT.bind(null,e),o._reactRetry=t,null):(e=n.treeContext,$t=Ur(o.nextSibling),Wt=t,Ae=!0,wa=null,e!==null&&(oa[na++]=er,oa[na++]=tr,oa[na++]=No,er=e.id,tr=e.overflow,No=t),t=Th(t,r.children),t.flags|=4096,t)}function fv(e,t,a){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Dm(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(It(e,t,r.children,a),r=Re.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&&fv(e,a,t);else if(e.tag===19)fv(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(Re,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&&Ed(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&&Ed(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 fd(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function sr(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Fo|=t.lanes,(a&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(_(153));if(t.child!==null){for(e=t.child,a=Hr(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Hr(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function AT(e,t,a){switch(t.tag){case 3:Y0(t),ts();break;case 5:k0(t);break;case 1:Dt(t.type)&&kd(t);break;case 4:wh(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;we(Ad,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(we(Re,Re.current&1),t.flags|=128,null):(a&t.child.childLanes)!==0?Z0(e,t,a):(we(Re,Re.current&1),e=sr(e,t,a),e!==null?e.sibling:null);we(Re,Re.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(Re,Re.current),r)break;return null;case 22:case 23:return t.lanes=0,Q0(e,t,a)}return sr(e,t,a)}var tw,jm,aw,rw;tw=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}};jm=function(){};aw=function(e,t,a,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,_o(Ma.current);var n=null;switch(a){case"input":o=um(e,o),r=um(e,r),n=[];break;case"select":o=Ee({},o,{value:void 0}),r=Ee({},r,{value:void 0}),n=[];break;case"textarea":o=fm(e,o),r=fm(e,r),n=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Id)}mm(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"&&(Yi.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"&&(Yi.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)}};rw=function(e,t,a,r){a!==r&&(t.flags|=4)};function Oi(e,t){if(!Ae)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 yt(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 RT(e,t,a){var r=t.pendingProps;switch(ph(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yt(t),null;case 1:return Dt(t.type)&&bd(),yt(t),null;case 3:return r=t.stateNode,rs(),be(Et),be(vt),Ch(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(td(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,wa!==null&&(Xm(wa),wa=null))),jm(e,t),yt(t),null;case 5:Sh(t);var o=_o(dl.current);if(a=t.type,e!==null&&t.stateNode!=null)aw(e,t,a,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(_(166));return yt(t),null}if(e=_o(Ma.current),td(t)){r=t.stateNode,a=t.type;var n=t.memoizedProps;switch(r[Ea]=t,r[ll]=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<qi.length;o++)Ie(qi[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":wx(r,n),Ie("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!n.multiple},Ie("invalid",r);break;case"textarea":Cx(r,n),Ie("invalid",r)}mm(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&&ed(r.textContent,i,e),o=["children",i]):typeof i=="number"&&r.textContent!==""+i&&(n.suppressHydrationWarning!==!0&&ed(r.textContent,i,e),o=["children",""+i]):Yi.hasOwnProperty(s)&&i!=null&&s==="onScroll"&&Ie("scroll",r)}switch(a){case"input":qu(r),Sx(r,n,!0);break;case"textarea":qu(r),Lx(r);break;case"select":case"option":break;default:typeof n.onClick=="function"&&(r.onclick=Id)}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=_v(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[Ea]=t,e[ll]=r,tw(e,t,!1,!1),t.stateNode=e;e:{switch(s=hm(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<qi.length;o++)Ie(qi[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":wx(e,r),o=um(e,r),Ie("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Ee({},r,{value:void 0}),Ie("invalid",e);break;case"textarea":Cx(e,r),o=fm(e,r),Ie("invalid",e);break;default:o=r}mm(a,o),i=o;for(n in i)if(i.hasOwnProperty(n)){var l=i[n];n==="style"?Mv(e,l):n==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Ev(e,l)):n==="children"?typeof l=="string"?(a!=="textarea"||l!=="")&&Zi(e,l):typeof l=="number"&&Zi(e,""+l):n!=="suppressContentEditableWarning"&&n!=="suppressHydrationWarning"&&n!=="autoFocus"&&(Yi.hasOwnProperty(n)?l!=null&&n==="onScroll"&&Ie("scroll",e):l!=null&&Ym(e,n,l,s))}switch(a){case"input":qu(e),Sx(e,r,!1);break;case"textarea":qu(e),Lx(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?Gn(e,!!r.multiple,n,!1):r.defaultValue!=null&&Gn(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Id)}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 yt(t),null;case 6:if(e&&t.stateNode!=null)rw(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(_(166));if(a=_o(dl.current),_o(Ma.current),td(t)){if(r=t.stateNode,a=t.memoizedProps,r[Ea]=t,(n=r.nodeValue!==a)&&(e=Wt,e!==null))switch(e.tag){case 3:ed(r.nodeValue,a,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ed(r.nodeValue,a,(e.mode&1)!==0)}n&&(t.flags|=4)}else r=(a.nodeType===9?a:a.ownerDocument).createTextNode(r),r[Ea]=t,t.stateNode=r}return yt(t),null;case 13:if(be(Re),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ae&&$t!==null&&(t.mode&1)!==0&&(t.flags&128)===0)S0(),ts(),t.flags|=98560,n=!1;else if(n=td(t),r!==null&&r.dehydrated!==null){if(e===null){if(!n)throw Error(_(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(_(317));n[Ea]=t}else ts(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;yt(t),n=!1}else wa!==null&&(Xm(wa),wa=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||(Re.current&1)!==0?We===0&&(We=3):Mh())),t.updateQueue!==null&&(t.flags|=4),yt(t),null);case 4:return rs(),jm(e,t),e===null&&sl(t.stateNode.containerInfo),yt(t),null;case 10:return yh(t.type._context),yt(t),null;case 17:return Dt(t.type)&&bd(),yt(t),null;case 19:if(be(Re),n=t.memoizedState,n===null)return yt(t),null;if(r=(t.flags&128)!==0,s=n.rendering,s===null)if(r)Oi(n,!1);else{if(We!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(s=Ed(e),s!==null){for(t.flags|=128,Oi(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(Re,Re.current&1|2),t.child}e=e.sibling}n.tail!==null&&Fe()>ns&&(t.flags|=128,r=!0,Oi(n,!1),t.lanes=4194304)}else{if(!r)if(e=Ed(s),e!==null){if(t.flags|=128,r=!0,a=e.updateQueue,a!==null&&(t.updateQueue=a,t.flags|=4),Oi(n,!0),n.tail===null&&n.tailMode==="hidden"&&!s.alternate&&!Ae)return yt(t),null}else 2*Fe()-n.renderingStartTime>ns&&a!==1073741824&&(t.flags|=128,r=!0,Oi(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=Fe(),t.sibling=null,a=Re.current,we(Re,r?a&1|2:a&1),t):(yt(t),null);case 22:case 23:return Dh(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(zt&1073741824)!==0&&(yt(t),t.subtreeFlags&6&&(t.flags|=8192)):yt(t),null;case 24:return null;case 25:return null}throw Error(_(156,t.tag))}function _T(e,t){switch(ph(t),t.tag){case 1:return Dt(t.type)&&bd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return rs(),be(Et),be(vt),Ch(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Sh(t),null;case 13:if(be(Re),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(_(340));ts()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return be(Re),null;case 4:return rs(),null;case 10:return yh(t.type._context),null;case 22:case 23:return Dh(),null;case 24:return null;default:return null}}var od=!1,xt=!1,ET=typeof WeakSet=="function"?WeakSet:Set,U=null;function $n(e,t){var a=e.ref;if(a!==null)if(typeof a=="function")try{a(null)}catch(r){Ne(e,t,r)}else a.current=null}function qm(e,t,a){try{a()}catch(r){Ne(e,t,r)}}var pv=!1;function DT(e,t){if(bm=Sd,e=l0(),ch(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 g;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),(g=c.firstChild)!==null;)f=c,c=g;for(;;){if(c===e)break t;if(f===a&&++u===o&&(i=s),f===n&&++d===r&&(l=s),(g=c.nextSibling)!==null)break;c=f,f=c.parentNode}c=g}a=i===-1||l===-1?null:{start:i,end:l}}else a=null}a=a||{start:0,end:0}}else a=null;for(km={focusedElem:e,selectionRange:a},Sd=!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,L=x.memoizedState,y=t.stateNode,h=y.getSnapshotBeforeUpdate(t.elementType===t.type?w:xa(t.type,w),L);y.__reactInternalSnapshotBeforeUpdate=h}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(_(163))}}catch(C){Ne(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,U=e;break}U=t.return}return x=pv,pv=!1,x}function Xi(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&&qm(t,a,n)}o=o.next}while(o!==r)}}function Kd(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 Hm(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[Ea],delete t[ll],delete t[Am],delete t[hT],delete t[gT])),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 nw(e){return e.tag===5||e.tag===3||e.tag===4}function mv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||nw(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 zm(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=Id));else if(r!==4&&(e=e.child,e!==null))for(zm(e,t,a),e=e.sibling;e!==null;)zm(e,t,a),e=e.sibling}function $m(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($m(e,t,a),e=e.sibling;e!==null;)$m(e,t,a),e=e.sibling}var ot=null,va=!1;function Ar(e,t,a){for(a=a.child;a!==null;)sw(e,t,a),a=a.sibling}function sw(e,t,a){if(Da&&typeof Da.onCommitFiberUnmount=="function")try{Da.onCommitFiberUnmount(Vd,a)}catch{}switch(a.tag){case 5:xt||$n(a,t);case 6:var r=ot,o=va;ot=null,Ar(e,t,a),ot=r,va=o,ot!==null&&(va?(e=ot,a=a.stateNode,e.nodeType===8?e.parentNode.removeChild(a):e.removeChild(a)):ot.removeChild(a.stateNode));break;case 18:ot!==null&&(va?(e=ot,a=a.stateNode,e.nodeType===8?Kp(e.parentNode,a):e.nodeType===1&&Kp(e,a),rl(e)):Kp(ot,a.stateNode));break;case 4:r=ot,o=va,ot=a.stateNode.containerInfo,va=!0,Ar(e,t,a),ot=r,va=o;break;case 0:case 11:case 14:case 15:if(!xt&&(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)&&qm(a,t,s),o=o.next}while(o!==r)}Ar(e,t,a);break;case 1:if(!xt&&($n(a,t),r=a.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=a.memoizedProps,r.state=a.memoizedState,r.componentWillUnmount()}catch(i){Ne(a,t,i)}Ar(e,t,a);break;case 21:Ar(e,t,a);break;case 22:a.mode&1?(xt=(r=xt)||a.memoizedState!==null,Ar(e,t,a),xt=r):Ar(e,t,a);break;default:Ar(e,t,a)}}function hv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var a=e.stateNode;a===null&&(a=e.stateNode=new ET),t.forEach(function(r){var o=qT.bind(null,e,r);a.has(r)||(a.add(r),r.then(o,o))})}}function ya(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:ot=i.stateNode,va=!1;break e;case 3:ot=i.stateNode.containerInfo,va=!0;break e;case 4:ot=i.stateNode.containerInfo,va=!0;break e}i=i.return}if(ot===null)throw Error(_(160));sw(n,s,o),ot=null,va=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(u){Ne(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)iw(t,e),t=t.sibling}function iw(e,t){var a=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ya(t,e),Ra(e),r&4){try{Xi(3,e,e.return),Kd(3,e)}catch(w){Ne(e,e.return,w)}try{Xi(5,e,e.return)}catch(w){Ne(e,e.return,w)}}break;case 1:ya(t,e),Ra(e),r&512&&a!==null&&$n(a,a.return);break;case 5:if(ya(t,e),Ra(e),r&512&&a!==null&&$n(a,a.return),e.flags&32){var o=e.stateNode;try{Zi(o,"")}catch(w){Ne(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&&Av(o,n),hm(i,s);var u=hm(i,n);for(s=0;s<l.length;s+=2){var d=l[s],c=l[s+1];d==="style"?Mv(o,c):d==="dangerouslySetInnerHTML"?Ev(o,c):d==="children"?Zi(o,c):Ym(o,d,c,u)}switch(i){case"input":dm(o,n);break;case"textarea":Rv(o,n);break;case"select":var f=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!n.multiple;var g=n.value;g!=null?Gn(o,!!n.multiple,g,!1):f!==!!n.multiple&&(n.defaultValue!=null?Gn(o,!!n.multiple,n.defaultValue,!0):Gn(o,!!n.multiple,n.multiple?[]:"",!1))}o[ll]=n}catch(w){Ne(e,e.return,w)}}break;case 6:if(ya(t,e),Ra(e),r&4){if(e.stateNode===null)throw Error(_(162));o=e.stateNode,n=e.memoizedProps;try{o.nodeValue=n}catch(w){Ne(e,e.return,w)}}break;case 3:if(ya(t,e),Ra(e),r&4&&a!==null&&a.memoizedState.isDehydrated)try{rl(t.containerInfo)}catch(w){Ne(e,e.return,w)}break;case 4:ya(t,e),Ra(e);break;case 13:ya(t,e),Ra(e),o=e.child,o.flags&8192&&(n=o.memoizedState!==null,o.stateNode.isHidden=n,!n||o.alternate!==null&&o.alternate.memoizedState!==null||(_h=Fe())),r&4&&hv(e);break;case 22:if(d=a!==null&&a.memoizedState!==null,e.mode&1?(xt=(u=xt)||d,ya(t,e),xt=u):ya(t,e),Ra(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&(e.mode&1)!==0)for(U=e,d=e.child;d!==null;){for(c=U=d;U!==null;){switch(f=U,g=f.child,f.tag){case 0:case 11:case 14:case 15:Xi(4,f,f.return);break;case 1:$n(f,f.return);var x=f.stateNode;if(typeof x.componentWillUnmount=="function"){r=f,a=f.return;try{t=r,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(w){Ne(r,a,w)}}break;case 5:$n(f,f.return);break;case 22:if(f.memoizedState!==null){yv(c);continue}}g!==null?(g.return=f,U=g):yv(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=Dv("display",s))}catch(w){Ne(e,e.return,w)}}}else if(c.tag===6){if(d===null)try{c.stateNode.nodeValue=u?"":c.memoizedProps}catch(w){Ne(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:ya(t,e),Ra(e),r&4&&hv(e);break;case 21:break;default:ya(t,e),Ra(e)}}function Ra(e){var t=e.flags;if(t&2){try{e:{for(var a=e.return;a!==null;){if(nw(a)){var r=a;break e}a=a.return}throw Error(_(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(Zi(o,""),r.flags&=-33);var n=mv(e);$m(e,n,o);break;case 3:case 4:var s=r.stateNode.containerInfo,i=mv(e);zm(e,i,s);break;default:throw Error(_(161))}}catch(l){Ne(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function MT(e,t,a){U=e,lw(e,t,a)}function lw(e,t,a){for(var r=(e.mode&1)!==0;U!==null;){var o=U,n=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||od;if(!s){var i=o.alternate,l=i!==null&&i.memoizedState!==null||xt;i=od;var u=xt;if(od=s,(xt=l)&&!u)for(U=o;U!==null;)s=U,l=s.child,s.tag===22&&s.memoizedState!==null?xv(o):l!==null?(l.return=s,U=l):xv(o);for(;n!==null;)U=n,lw(n,t,a),n=n.sibling;U=o,od=i,xt=u}gv(e,t,a)}else(o.subtreeFlags&8772)!==0&&n!==null?(n.return=o,U=n):gv(e,t,a)}}function gv(e){for(;U!==null;){var t=U;if((t.flags&8772)!==0){var a=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:xt||Kd(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!xt)if(a===null)r.componentDidMount();else{var o=t.elementType===t.type?a.memoizedProps:xa(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&&rl(c)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(_(163))}xt||t.flags&512&&Hm(t)}catch(f){Ne(t,t.return,f)}}if(t===e){U=null;break}if(a=t.sibling,a!==null){a.return=t.return,U=a;break}U=t.return}}function yv(e){for(;U!==null;){var t=U;if(t===e){U=null;break}var a=t.sibling;if(a!==null){a.return=t.return,U=a;break}U=t.return}}function xv(e){for(;U!==null;){var t=U;try{switch(t.tag){case 0:case 11:case 15:var a=t.return;try{Kd(4,t)}catch(l){Ne(t,a,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(l){Ne(t,o,l)}}var n=t.return;try{Hm(t)}catch(l){Ne(t,n,l)}break;case 5:var s=t.return;try{Hm(t)}catch(l){Ne(t,s,l)}}}catch(l){Ne(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 NT=Math.ceil,Nd=ir.ReactCurrentDispatcher,Ah=ir.ReactCurrentOwner,ia=ir.ReactCurrentBatchConfig,de=0,tt=null,Ve=null,nt=0,zt=0,Wn=Gr(0),We=0,ml=null,Fo=0,Xd=0,Rh=0,Qi=null,Rt=null,_h=0,ns=1/0,Ya=null,Od=!1,Wm=null,jr=null,nd=!1,Nr=null,Fd=0,Ji=0,Gm=null,pd=-1,md=0;function bt(){return(de&6)!==0?Fe():pd!==-1?pd:pd=Fe()}function qr(e){return(e.mode&1)===0?1:(de&2)!==0&&nt!==0?nt&-nt:xT.transition!==null?(md===0&&(md=Wv()),md):(e=me,e!==0||(e=window.event,e=e===void 0?16:Zv(e.type)),e)}function Ca(e,t,a,r){if(50<Ji)throw Ji=0,Gm=null,Error(_(185));hl(e,a,r),((de&2)===0||e!==tt)&&(e===tt&&((de&2)===0&&(Xd|=a),We===4&&Dr(e,nt)),Mt(e,r),a===1&&de===0&&(t.mode&1)===0&&(ns=Fe()+500,$d&&Kr()))}function Mt(e,t){var a=e.callbackNode;wP(e,t);var r=wd(e,e===tt?nt:0);if(r===0)a!==null&&kx(a),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(a!=null&&kx(a),t===1)e.tag===0?yT(vv.bind(null,e)):x0(vv.bind(null,e)),pT(function(){(de&6)===0&&Kr()}),a=null;else{switch(Gv(r)){case 1:a=rh;break;case 4:a=zv;break;case 16:a=vd;break;case 536870912:a=$v;break;default:a=vd}a=gw(a,uw.bind(null,e))}e.callbackPriority=t,e.callbackNode=a}}function uw(e,t){if(pd=-1,md=0,(de&6)!==0)throw Error(_(327));var a=e.callbackNode;if(Yn()&&e.callbackNode!==a)return null;var r=wd(e,e===tt?nt:0);if(r===0)return null;if((r&30)!==0||(r&e.expiredLanes)!==0||t)t=Bd(e,r);else{t=r;var o=de;de|=2;var n=cw();(tt!==e||nt!==t)&&(Ya=null,ns=Fe()+500,Eo(e,t));do try{BT();break}catch(i){dw(e,i)}while(!0);gh(),Nd.current=n,de=o,Ve!==null?t=0:(tt=null,nt=0,t=We)}if(t!==0){if(t===2&&(o=wm(e),o!==0&&(r=o,t=Km(e,o))),t===1)throw a=ml,Eo(e,0),Dr(e,r),Mt(e,Fe()),a;if(t===6)Dr(e,r);else{if(o=e.current.alternate,(r&30)===0&&!OT(o)&&(t=Bd(e,r),t===2&&(n=wm(e),n!==0&&(r=n,t=Km(e,n))),t===1))throw a=ml,Eo(e,0),Dr(e,r),Mt(e,Fe()),a;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(_(345));case 2:To(e,Rt,Ya);break;case 3:if(Dr(e,r),(r&130023424)===r&&(t=_h+500-Fe(),10<t)){if(wd(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){bt(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Tm(To.bind(null,e,Rt,Ya),t);break}To(e,Rt,Ya);break;case 4:if(Dr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-Sa(r);n=1<<s,s=t[s],s>o&&(o=s),r&=~n}if(r=o,r=Fe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*NT(r/1960))-r,10<r){e.timeoutHandle=Tm(To.bind(null,e,Rt,Ya),r);break}To(e,Rt,Ya);break;case 5:To(e,Rt,Ya);break;default:throw Error(_(329))}}}return Mt(e,Fe()),e.callbackNode===a?uw.bind(null,e):null}function Km(e,t){var a=Qi;return e.current.memoizedState.isDehydrated&&(Eo(e,t).flags|=256),e=Bd(e,t),e!==2&&(t=Rt,Rt=a,t!==null&&Xm(t)),e}function Xm(e){Rt===null?Rt=e:Rt.push.apply(Rt,e)}function OT(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(!La(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 Dr(e,t){for(t&=~Rh,t&=~Xd,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var a=31-Sa(t),r=1<<a;e[a]=-1,t&=~r}}function vv(e){if((de&6)!==0)throw Error(_(327));Yn();var t=wd(e,0);if((t&1)===0)return Mt(e,Fe()),null;var a=Bd(e,t);if(e.tag!==0&&a===2){var r=wm(e);r!==0&&(t=r,a=Km(e,r))}if(a===1)throw a=ml,Eo(e,0),Dr(e,t),Mt(e,Fe()),a;if(a===6)throw Error(_(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,To(e,Rt,Ya),Mt(e,Fe()),null}function Eh(e,t){var a=de;de|=1;try{return e(t)}finally{de=a,de===0&&(ns=Fe()+500,$d&&Kr())}}function Bo(e){Nr!==null&&Nr.tag===0&&(de&6)===0&&Yn();var t=de;de|=1;var a=ia.transition,r=me;try{if(ia.transition=null,me=1,e)return e()}finally{me=r,ia.transition=a,de=t,(de&6)===0&&Kr()}}function Dh(){zt=Wn.current,be(Wn)}function Eo(e,t){e.finishedWork=null,e.finishedLanes=0;var a=e.timeoutHandle;if(a!==-1&&(e.timeoutHandle=-1,fT(a)),Ve!==null)for(a=Ve.return;a!==null;){var r=a;switch(ph(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&bd();break;case 3:rs(),be(Et),be(vt),Ch();break;case 5:Sh(r);break;case 4:rs();break;case 13:be(Re);break;case 19:be(Re);break;case 10:yh(r.type._context);break;case 22:case 23:Dh()}a=a.return}if(tt=e,Ve=e=Hr(e.current,null),nt=zt=t,We=0,ml=null,Rh=Xd=Fo=0,Rt=Qi=null,Ro!==null){for(t=0;t<Ro.length;t++)if(a=Ro[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}Ro=null}return e}function dw(e,t){do{var a=Ve;try{if(gh(),dd.current=Md,Dd){for(var r=_e.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Dd=!1}if(Oo=0,et=$e=_e=null,Ki=!1,cl=0,Ah.current=null,a===null||a.return===null){We=1,ml=t,Ve=null;break}e:{var n=e,s=a.return,i=a,l=t;if(t=nt,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 g=sv(s);if(g!==null){g.flags&=-257,iv(g,s,i,n,t),g.mode&1&&nv(n,u,t),t=g,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){nv(n,u,t),Mh();break e}l=Error(_(426))}}else if(Ae&&i.mode&1){var L=sv(s);if(L!==null){(L.flags&65536)===0&&(L.flags|=256),iv(L,s,i,n,t),mh(os(l,i));break e}}n=l=os(l,i),We!==4&&(We=2),Qi===null?Qi=[n]:Qi.push(n),n=s;do{switch(n.tag){case 3:n.flags|=65536,t&=-t,n.lanes|=t;var y=G0(n,l,t);Zx(n,y);break e;case 1:i=l;var h=n.type,m=n.stateNode;if((n.flags&128)===0&&(typeof h.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(jr===null||!jr.has(m)))){n.flags|=65536,t&=-t,n.lanes|=t;var C=K0(n,i,t);Zx(n,C);break e}}n=n.return}while(n!==null)}pw(a)}catch(I){t=I,Ve===a&&a!==null&&(Ve=a=a.return);continue}break}while(!0)}function cw(){var e=Nd.current;return Nd.current=Md,e===null?Md:e}function Mh(){(We===0||We===3||We===2)&&(We=4),tt===null||(Fo&268435455)===0&&(Xd&268435455)===0||Dr(tt,nt)}function Bd(e,t){var a=de;de|=2;var r=cw();(tt!==e||nt!==t)&&(Ya=null,Eo(e,t));do try{FT();break}catch(o){dw(e,o)}while(!0);if(gh(),de=a,Nd.current=r,Ve!==null)throw Error(_(261));return tt=null,nt=0,We}function FT(){for(;Ve!==null;)fw(Ve)}function BT(){for(;Ve!==null&&!cP();)fw(Ve)}function fw(e){var t=hw(e.alternate,e,zt);e.memoizedProps=e.pendingProps,t===null?pw(e):Ve=t,Ah.current=null}function pw(e){var t=e;do{var a=t.alternate;if(e=t.return,(t.flags&32768)===0){if(a=RT(a,t,zt),a!==null){Ve=a;return}}else{if(a=_T(a,t),a!==null){a.flags&=32767,Ve=a;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{We=6,Ve=null;return}}if(t=t.sibling,t!==null){Ve=t;return}Ve=t=e}while(t!==null);We===0&&(We=5)}function To(e,t,a){var r=me,o=ia.transition;try{ia.transition=null,me=1,UT(e,t,a,r)}finally{ia.transition=o,me=r}return null}function UT(e,t,a,r){do Yn();while(Nr!==null);if((de&6)!==0)throw Error(_(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(_(177));e.callbackNode=null,e.callbackPriority=0;var n=a.lanes|a.childLanes;if(SP(e,n),e===tt&&(Ve=tt=null,nt=0),(a.subtreeFlags&2064)===0&&(a.flags&2064)===0||nd||(nd=!0,gw(vd,function(){return Yn(),null})),n=(a.flags&15990)!==0,(a.subtreeFlags&15990)!==0||n){n=ia.transition,ia.transition=null;var s=me;me=1;var i=de;de|=4,Ah.current=null,DT(e,a),iw(a,e),iT(km),Sd=!!bm,km=bm=null,e.current=a,MT(a,e,o),fP(),de=i,me=s,ia.transition=n}else e.current=a;if(nd&&(nd=!1,Nr=e,Fd=o),n=e.pendingLanes,n===0&&(jr=null),hP(a.stateNode,r),Mt(e,Fe()),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(Od)throw Od=!1,e=Wm,Wm=null,e;return(Fd&1)!==0&&e.tag!==0&&Yn(),n=e.pendingLanes,(n&1)!==0?e===Gm?Ji++:(Ji=0,Gm=e):Ji=0,Kr(),null}function Yn(){if(Nr!==null){var e=Gv(Fd),t=ia.transition,a=me;try{if(ia.transition=null,me=16>e?16:e,Nr===null)var r=!1;else{if(e=Nr,Nr=null,Fd=0,(de&6)!==0)throw Error(_(331));var o=de;for(de|=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 d=U;switch(d.tag){case 0:case 11:case 15:Xi(8,d,n)}var c=d.child;if(c!==null)c.return=d,U=c;else for(;U!==null;){d=U;var f=d.sibling,g=d.return;if(ow(d),d===u){U=null;break}if(f!==null){f.return=g,U=f;break}U=g}}}var x=n.alternate;if(x!==null){var w=x.child;if(w!==null){x.child=null;do{var L=w.sibling;w.sibling=null,w=L}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:Xi(9,n,n.return)}var y=n.sibling;if(y!==null){y.return=n.return,U=y;break e}U=n.return}}var h=e.current;for(U=h;U!==null;){s=U;var m=s.child;if((s.subtreeFlags&2064)!==0&&m!==null)m.return=s,U=m;else e:for(s=h;U!==null;){if(i=U,(i.flags&2048)!==0)try{switch(i.tag){case 0:case 11:case 15:Kd(9,i)}}catch(I){Ne(i,i.return,I)}if(i===s){U=null;break e}var C=i.sibling;if(C!==null){C.return=i.return,U=C;break e}U=i.return}}if(de=o,Kr(),Da&&typeof Da.onPostCommitFiberRoot=="function")try{Da.onPostCommitFiberRoot(Vd,e)}catch{}r=!0}return r}finally{me=a,ia.transition=t}}return!1}function wv(e,t,a){t=os(a,t),t=G0(e,t,1),e=Vr(e,t,1),t=bt(),e!==null&&(hl(e,1,t),Mt(e,t))}function Ne(e,t,a){if(e.tag===3)wv(e,e,a);else for(;t!==null;){if(t.tag===3){wv(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(jr===null||!jr.has(r))){e=os(a,e),e=K0(t,e,1),t=Vr(t,e,1),e=bt(),t!==null&&(hl(t,1,e),Mt(t,e));break}}t=t.return}}function VT(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),t=bt(),e.pingedLanes|=e.suspendedLanes&a,tt===e&&(nt&a)===a&&(We===4||We===3&&(nt&130023424)===nt&&500>Fe()-_h?Eo(e,0):Rh|=a),Mt(e,t)}function mw(e,t){t===0&&((e.mode&1)===0?t=1:(t=$u,$u<<=1,($u&130023424)===0&&($u=4194304)));var a=bt();e=nr(e,t),e!==null&&(hl(e,t,a),Mt(e,a))}function jT(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),mw(e,a)}function qT(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(_(314))}r!==null&&r.delete(t),mw(e,a)}var hw;hw=function(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps||Et.current)_t=!0;else{if((e.lanes&a)===0&&(t.flags&128)===0)return _t=!1,AT(e,t,a);_t=(e.flags&131072)!==0}else _t=!1,Ae&&(t.flags&1048576)!==0&&v0(t,Td,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;fd(e,t),e=t.pendingProps;var o=es(t,vt.current);Jn(t,a),o=Ih(null,t,r,e,o,a);var n=bh();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,Dt(r)?(n=!0,kd(t)):n=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,vh(t),o.updater=Gd,t.stateNode=o,o._reactInternals=t,Nm(t,r,e,a),t=Bm(null,t,r,!0,n,a)):(t.tag=0,Ae&&n&&fh(t),It(null,t,o,a),t=t.child),t;case 16:r=t.elementType;e:{switch(fd(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=zT(r),e=xa(r,e),o){case 0:t=Fm(null,t,r,e,a);break e;case 1:t=dv(null,t,r,e,a);break e;case 11:t=lv(null,t,r,e,a);break e;case 14:t=uv(null,t,r,xa(r.type,e),a);break e}throw Error(_(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:xa(r,o),Fm(e,t,r,o,a);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:xa(r,o),dv(e,t,r,o,a);case 3:e:{if(Y0(t),e===null)throw Error(_(387));r=t.pendingProps,n=t.memoizedState,o=n.element,b0(e,t),_d(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=os(Error(_(423)),t),t=cv(e,t,r,a,o);break e}else if(r!==o){o=os(Error(_(424)),t),t=cv(e,t,r,a,o);break e}else for($t=Ur(t.stateNode.containerInfo.firstChild),Wt=t,Ae=!0,wa=null,a=L0(t,null,r,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(ts(),r===o){t=sr(e,t,a);break e}It(e,t,r,a)}t=t.child}return t;case 5:return k0(t),e===null&&Em(t),r=t.type,o=t.pendingProps,n=e!==null?e.memoizedProps:null,s=o.children,Pm(r,o)?s=null:n!==null&&Pm(r,n)&&(t.flags|=32),J0(e,t),It(e,t,s,a),t.child;case 6:return e===null&&Em(t),null;case 13:return Z0(e,t,a);case 4:return wh(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=as(t,null,r,a):It(e,t,r,a),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:xa(r,o),lv(e,t,r,o,a);case 7:return It(e,t,t.pendingProps,a),t.child;case 8:return It(e,t,t.pendingProps.children,a),t.child;case 12:return It(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(Ad,r._currentValue),r._currentValue=s,n!==null)if(La(n.value,s)){if(n.children===o.children&&!Et.current){t=sr(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=ar(-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),Dm(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(_(341));s.lanes|=a,i=s.alternate,i!==null&&(i.lanes|=a),Dm(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}It(e,t,o.children,a),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Jn(t,a),o=la(o),r=r(o),t.flags|=1,It(e,t,r,a),t.child;case 14:return r=t.type,o=xa(r,t.pendingProps),o=xa(r.type,o),uv(e,t,r,o,a);case 15:return X0(e,t,t.type,t.pendingProps,a);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:xa(r,o),fd(e,t),t.tag=1,Dt(r)?(e=!0,kd(t)):e=!1,Jn(t,a),W0(t,r,o),Nm(t,r,o,a),Bm(null,t,r,!0,e,a);case 19:return ew(e,t,a);case 22:return Q0(e,t,a)}throw Error(_(156,t.tag))};function gw(e,t){return Hv(e,t)}function HT(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 sa(e,t,a,r){return new HT(e,t,a,r)}function Nh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function zT(e){if(typeof e=="function")return Nh(e)?1:0;if(e!=null){if(e=e.$$typeof,e===eh)return 11;if(e===th)return 14}return 2}function Hr(e,t){var a=e.alternate;return a===null?(a=sa(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 hd(e,t,a,r,o,n){var s=2;if(r=e,typeof e=="function")Nh(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case On:return Do(a.children,o,n,t);case Zm:s=8,o|=8;break;case nm:return e=sa(12,a,t,o|2),e.elementType=nm,e.lanes=n,e;case sm:return e=sa(13,a,t,o),e.elementType=sm,e.lanes=n,e;case im:return e=sa(19,a,t,o),e.elementType=im,e.lanes=n,e;case kv:return Qd(a,o,n,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Iv:s=10;break e;case bv:s=9;break e;case eh:s=11;break e;case th:s=14;break e;case Rr:s=16,r=null;break e}throw Error(_(130,e==null?e:typeof e,""))}return t=sa(s,a,t,o),t.elementType=e,t.type=r,t.lanes=n,t}function Do(e,t,a,r){return e=sa(7,e,r,t),e.lanes=a,e}function Qd(e,t,a,r){return e=sa(22,e,r,t),e.elementType=kv,e.lanes=a,e.stateNode={isHidden:!1},e}function am(e,t,a){return e=sa(6,e,null,t),e.lanes=a,e}function rm(e,t,a){return t=sa(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function $T(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=Vp(0),this.expirationTimes=Vp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vp(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Oh(e,t,a,r,o,n,s,i,l){return e=new $T(e,t,a,i,l),t===1?(t=1,n===!0&&(t|=8)):t=0,n=sa(3,null,null,t),e.current=n,n.stateNode=e,n.memoizedState={element:r,isDehydrated:a,cache:null,transitions:null,pendingSuspenseBoundaries:null},vh(n),e}function WT(e,t,a){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Nn,key:r==null?null:""+r,children:e,containerInfo:t,implementation:a}}function yw(e){if(!e)return $r;e=e._reactInternals;e:{if(Vo(e)!==e||e.tag!==1)throw Error(_(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Dt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(_(171))}if(e.tag===1){var a=e.type;if(Dt(a))return y0(e,a,t)}return t}function xw(e,t,a,r,o,n,s,i,l){return e=Oh(a,r,!0,e,o,n,s,i,l),e.context=yw(null),a=e.current,r=bt(),o=qr(a),n=ar(r,o),n.callback=t??null,Vr(a,n,o),e.current.lanes=o,hl(e,o,r),Mt(e,r),e}function Jd(e,t,a,r){var o=t.current,n=bt(),s=qr(o);return a=yw(a),t.context===null?t.context=a:t.pendingContext=a,t=ar(n,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Vr(o,t,s),e!==null&&(Ca(e,o,s,n),ud(e,o,s)),s}function Ud(e){return e=e.current,e.child?(e.child.tag===5,e.child.stateNode):null}function Sv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Fh(e,t){Sv(e,t),(e=e.alternate)&&Sv(e,t)}function GT(){return null}var vw=typeof reportError=="function"?reportError:function(e){console.error(e)};function Bh(e){this._internalRoot=e}Yd.prototype.render=Bh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(_(409));Jd(e,t,null,null)};Yd.prototype.unmount=Bh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Bo(function(){Jd(null,e,null,null)}),t[or]=null}};function Yd(e){this._internalRoot=e}Yd.prototype.unstable_scheduleHydration=function(e){if(e){var t=Qv();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Er.length&&t!==0&&t<Er[a].priority;a++);Er.splice(a,0,e),a===0&&Yv(e)}};function Uh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Zd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Cv(){}function KT(e,t,a,r,o){if(o){if(typeof r=="function"){var n=r;r=function(){var u=Ud(s);n.call(u)}}var s=xw(t,r,e,0,null,!1,!1,"",Cv);return e._reactRootContainer=s,e[or]=s.current,sl(e.nodeType===8?e.parentNode:e),Bo(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var i=r;r=function(){var u=Ud(l);i.call(u)}}var l=Oh(e,0,!1,null,null,!1,!1,"",Cv);return e._reactRootContainer=l,e[or]=l.current,sl(e.nodeType===8?e.parentNode:e),Bo(function(){Jd(t,l,a,r)}),l}function ec(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=Ud(s);i.call(l)}}Jd(t,s,e,o)}else s=KT(a,t,e,o,r);return Ud(s)}Kv=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var a=ji(t.pendingLanes);a!==0&&(oh(t,a|1),Mt(t,Fe()),(de&6)===0&&(ns=Fe()+500,Kr()))}break;case 13:Bo(function(){var r=nr(e,1);if(r!==null){var o=bt();Ca(r,e,1,o)}}),Fh(e,1)}};nh=function(e){if(e.tag===13){var t=nr(e,134217728);if(t!==null){var a=bt();Ca(t,e,134217728,a)}Fh(e,134217728)}};Xv=function(e){if(e.tag===13){var t=qr(e),a=nr(e,t);if(a!==null){var r=bt();Ca(a,e,t,r)}Fh(e,t)}};Qv=function(){return me};Jv=function(e,t){var a=me;try{return me=e,t()}finally{me=a}};ym=function(e,t,a){switch(t){case"input":if(dm(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=zd(r);if(!o)throw Error(_(90));Tv(r),dm(r,o)}}}break;case"textarea":Rv(e,a);break;case"select":t=a.value,t!=null&&Gn(e,!!a.multiple,t,!1)}};Fv=Eh;Bv=Bo;var XT={usingClientEntryPoint:!1,Events:[yl,Vn,zd,Nv,Ov,Eh]},Fi={findFiberByHostInstance:Ao,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},QT={bundleType:Fi.bundleType,version:Fi.version,rendererPackageName:Fi.rendererPackageName,rendererConfig:Fi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ir.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=jv(e),e===null?null:e.stateNode},findFiberByHostInstance:Fi.findFiberByHostInstance||GT,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Bi=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Bi.isDisabled&&Bi.supportsFiber))try{Vd=Bi.inject(QT),Da=Bi}catch{}var Bi;Xt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=XT;Xt.createPortal=function(e,t){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Uh(t))throw Error(_(200));return WT(e,t,null,a)};Xt.createRoot=function(e,t){if(!Uh(e))throw Error(_(299));var a=!1,r="",o=vw;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Oh(e,1,!1,null,null,a,!1,r,o),e[or]=t.current,sl(e.nodeType===8?e.parentNode:e),new Bh(t)};Xt.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(_(188)):(e=Object.keys(e).join(","),Error(_(268,e)));return e=jv(t),e=e===null?null:e.stateNode,e};Xt.flushSync=function(e){return Bo(e)};Xt.hydrate=function(e,t,a){if(!Zd(t))throw Error(_(200));return ec(null,e,t,!0,a)};Xt.hydrateRoot=function(e,t,a){if(!Uh(e))throw Error(_(405));var r=a!=null&&a.hydratedSources||null,o=!1,n="",s=vw;if(a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(n=a.identifierPrefix),a.onRecoverableError!==void 0&&(s=a.onRecoverableError)),t=xw(t,null,e,1,a??null,o,!1,n,s),e[or]=t.current,sl(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 Yd(t)};Xt.render=function(e,t,a){if(!Zd(t))throw Error(_(200));return ec(null,e,t,!1,a)};Xt.unmountComponentAtNode=function(e){if(!Zd(e))throw Error(_(40));return e._reactRootContainer?(Bo(function(){ec(null,null,e,!1,function(){e._reactRootContainer=null,e[or]=null})}),!0):!1};Xt.unstable_batchedUpdates=Eh;Xt.unstable_renderSubtreeIntoContainer=function(e,t,a,r){if(!Zd(a))throw Error(_(200));if(e==null||e._reactInternals===void 0)throw Error(_(38));return ec(e,t,a,!1,r)};Xt.version="18.3.1-next-f1338f8080-20240426"});var Vh=Ze((BD,Cw)=>{"use strict";function Sw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Sw)}catch(e){console.error(e)}}Sw(),Cw.exports=ww()});var Iw=Ze(jh=>{"use strict";var Lw=Vh();jh.createRoot=Lw.createRoot,jh.hydrateRoot=Lw.hydrateRoot;var UD});var jo={};Hy(jo,{Headers:()=>Hh,Request:()=>ZT,Response:()=>e1,default:()=>qh,fetch:()=>YT});var JT,ls,YT,qh,Hh,ZT,e1,Xr=Dk(()=>{"use strict";JT=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")},ls=JT(),YT=ls.fetch,qh=ls.fetch.bind(ls),Hh=ls.Headers,ZT=ls.Request,e1=ls.Response});var Wh=Ze($h=>{"use strict";Object.defineProperty($h,"__esModule",{value:!0});var zh=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.code=t.code}};$h.default=zh});var Kh=Ze(Ll=>{"use strict";var kw=Ll&&Ll.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ll,"__esModule",{value:!0});var a1=kw((Xr(),$y(jo))),r1=kw(Wh()),Gh=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=a1.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,g=n.statusText;if(n.ok){if(this.method!=="HEAD"){let y=await n.text();y===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?d=y:d=JSON.parse(y))}let w=(s=this.headers.Prefer)===null||s===void 0?void 0:s.match(/count=(exact|planned|estimated)/),L=(i=n.headers.get("content-range"))===null||i===void 0?void 0:i.split("/");w&&L&&L.length>1&&(c=parseInt(L[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,g="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,g="OK")}catch{n.status===404&&w===""?(f=204,g="No Content"):u={message:w}}if(u&&this.isMaybeSingle&&(!((l=u?.details)===null||l===void 0)&&l.includes("0 rows"))&&(u=null,f=200,g="OK"),u&&this.shouldThrowOnError)throw new r1.default(u)}return{error:u,data:d,count:c,status:f,statusText:g}});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}};Ll.default=Gh});var Qh=Ze(Il=>{"use strict";var o1=Il&&Il.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Il,"__esModule",{value:!0});var n1=o1(Kh()),Xh=class extends n1.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}};Il.default=Xh});var rc=Ze(bl=>{"use strict";var s1=bl&&bl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(bl,"__esModule",{value:!0});var i1=s1(Qh()),Jh=class extends i1.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}};bl.default=Jh});var Zh=Ze(Pl=>{"use strict";var l1=Pl&&Pl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Pl,"__esModule",{value:!0});var kl=l1(rc()),Yh=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 kl.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 kl.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 kl.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 kl.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 kl.default({method:a,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}};Pl.default=Yh});var Pw=Ze(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});oc.version=void 0;oc.version="0.0.0-automated"});var Tw=Ze(nc=>{"use strict";Object.defineProperty(nc,"__esModule",{value:!0});nc.DEFAULT_HEADERS=void 0;var u1=Pw();nc.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${u1.version}`}});var Rw=Ze(Tl=>{"use strict";var Aw=Tl&&Tl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Tl,"__esModule",{value:!0});var d1=Aw(Zh()),c1=Aw(rc()),f1=Tw(),eg=class e{constructor(t,{headers:a={},schema:r,fetch:o}={}){this.url=t,this.headers=Object.assign(Object.assign({},f1.DEFAULT_HEADERS),a),this.schemaName=r,this.fetch=o}from(t){let a=new URL(`${this.url}/${t}`);return new d1.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 c1.default({method:s,url:i,headers:u,schema:this.schemaName,body:l,fetch:this.fetch,allowEmpty:!1})}};Tl.default=eg});var Fw=Ze(it=>{"use strict";var us=it&&it.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(it,"__esModule",{value:!0});it.PostgrestError=it.PostgrestBuilder=it.PostgrestTransformBuilder=it.PostgrestFilterBuilder=it.PostgrestQueryBuilder=it.PostgrestClient=void 0;var _w=us(Rw());it.PostgrestClient=_w.default;var Ew=us(Zh());it.PostgrestQueryBuilder=Ew.default;var Dw=us(rc());it.PostgrestFilterBuilder=Dw.default;var Mw=us(Qh());it.PostgrestTransformBuilder=Mw.default;var Nw=us(Kh());it.PostgrestBuilder=Nw.default;var Ow=us(Wh());it.PostgrestError=Ow.default;it.default={PostgrestClient:_w.default,PostgrestQueryBuilder:Ew.default,PostgrestFilterBuilder:Dw.default,PostgrestTransformBuilder:Mw.default,PostgrestBuilder:Nw.default,PostgrestError:Ow.default}});var GS=Ze(Pc=>{"use strict";var TA=G(),AA=Symbol.for("react.element"),RA=Symbol.for("react.fragment"),_A=Object.prototype.hasOwnProperty,EA=TA.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,DA={key:!0,ref:!0,__self:!0,__source:!0};function WS(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)_A.call(t,r)&&!DA.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:AA,type:e,key:n,ref:s,props:o,_owner:EA.current}}Pc.Fragment=RA;Pc.jsx=WS;Pc.jsxs=WS});var le=Ze((RN,KS)=>{"use strict";KS.exports=GS()});var AD={};Hy(AD,{initKiteChat:()=>Ty});var Ka=M(G(),1),fk=M(Iw(),1);var F=M(G(),1);var bw=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...a)=>Promise.resolve().then(()=>(Xr(),jo)).then(({default:r})=>r(...a)):t=fetch,(...a)=>t(...a)};var vl=class extends Error{constructor(t,a="FunctionsError",r){super(t),this.name=a,this.context=r}},tc=class extends vl{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}},wl=class extends vl{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}},Sl=class extends vl{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}},ac;(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"})(ac||(ac={}));var t1=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())})},Cl=class{constructor(t,{headers:a={},customFetch:r,region:o=ac.Any}={}){this.url=t,this.headers=a,this.region=o,this.fetch=bw(r)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t,a={}){var r;return t1(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 tc(w)}),f=c.headers.get("x-relay-error");if(f&&f==="true")throw new wl(c);if(!c.ok)throw new Sl(c);let g=((r=c.headers.get("Content-Type"))!==null&&r!==void 0?r:"text/plain").split(";")[0].trim(),x;return g==="application/json"?x=yield c.json():g==="application/octet-stream"?x=yield c.blob():g==="text/event-stream"?x=c:g==="multipart/form-data"?x=yield c.formData():x=yield c.text(),{data:x,error:null,response:c}}catch(o){return{data:null,error:o,response:o instanceof Sl||o instanceof wl?o.context:void 0}}})}};var Bw=M(Fw(),1),{PostgrestClient:Uw,PostgrestQueryBuilder:rM,PostgrestFilterBuilder:oM,PostgrestTransformBuilder:nM,PostgrestBuilder:sM,PostgrestError:p1}=Bw.default;function Vw(){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 jw=Vw();var qw="2.11.15";var Hw=`realtime-js/${qw}`,zw="1.0.0";var ic=1e4,$w=1e3,ds;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(ds||(ds={}));var lt;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(lt||(lt={}));var Qt;(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"})(Qt||(Qt={}));var sc;(function(e){e.websocket="websocket"})(sc||(sc={}));var Qr;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(Qr||(Qr={}));var Al=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 Se;(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"})(Se||(Se={}));var ag=(e,t,a={})=>{var r;let o=(r=a.skipTypes)!==null&&r!==void 0?r:[];return Object.keys(t).reduce((n,s)=>(n[s]=m1(s,e,t,o),n),{})},m1=(e,t,a,r)=>{let o=t.find(i=>i.name===e),n=o?.type,s=a[e];return n&&!r.includes(n)?Ww(n,s):tg(s)},Ww=(e,t)=>{if(e.charAt(0)==="_"){let a=e.slice(1,e.length);return x1(t,a)}switch(e){case Se.bool:return h1(t);case Se.float4:case Se.float8:case Se.int2:case Se.int4:case Se.int8:case Se.numeric:case Se.oid:return g1(t);case Se.json:case Se.jsonb:return y1(t);case Se.timestamp:return v1(t);case Se.abstime:case Se.date:case Se.daterange:case Se.int4range:case Se.int8range:case Se.money:case Se.reltime:case Se.text:case Se.time:case Se.timestamptz:case Se.timetz:case Se.tsrange:case Se.tstzrange:return tg(t);default:return tg(t)}},tg=e=>e,h1=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},g1=e=>{if(typeof e=="string"){let t=parseFloat(e);if(!Number.isNaN(t))return t}return e},y1=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch(t){return console.log(`JSON parse error: ${t}`),e}return e},x1=(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=>Ww(t,i))}return e},v1=e=>typeof e=="string"?e.replace(" ","T"):e,lc=e=>{let t=e;return t=t.replace(/^ws/i,"http"),t=t.replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,""),t.replace(/\/+$/,"")};var Ho=class{constructor(t,a,r={},o=ic){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 rg;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(rg||(rg={}));var cs=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(L=>L.presence_ref),g=c.map(L=>L.presence_ref),x=d.filter(L=>g.indexOf(L.presence_ref)<0),w=c.filter(L=>f.indexOf(L.presence_ref)<0);x.length>0&&(i[u]=x),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(g=>g.presence_ref),f=d.filter(g=>c.indexOf(g.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 og;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(og||(og={}));var ng;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(ng||(ng={}));var Na;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(Na||(Na={}));var fs=class e{constructor(t,a={config:{}},r){this.topic=t,this.params=a,this.socket=r,this.bindings={},this.state=lt.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 Ho(this,Qt.join,this.params,this.timeout),this.rejoinTimer=new qo(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=lt.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=lt.closed,this.socket._remove(this)}),this._onError(o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=lt.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=lt.errored,this.rejoinTimer.scheduleTimeout())}),this._on(Qt.reply,{},(o,n)=>{this._trigger(this._replyEventName(n),o)}),this.presence=new cs(this),this.broadcastEndpointURL=lc(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==lt.closed){let{config:{broadcast:n,presence:s,private:i}}=this.params;this._onError(d=>t?.(Na.CHANNEL_ERROR,d)),this._onClose(()=>t?.(Na.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?.(Na.SUBSCRIBED);return}else{let f=this.bindings.postgres_changes,g=(c=f?.length)!==null&&c!==void 0?c:0,x=[];for(let w=0;w<g;w++){let L=f[w],{filter:{event:y,schema:h,table:m,filter:C}}=L,I=d&&d[w];if(I&&I.event===y&&I.schema===h&&I.table===m&&I.filter===C)x.push(Object.assign(Object.assign({},L),{id:I.id}));else{this.unsubscribe(),this.state=lt.errored,t?.(Na.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=x,t&&t(Na.SUBSCRIBED);return}}).receive("error",d=>{this.state=lt.errored,t?.(Na.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(d).join(", ")||"error")))}).receive("timeout",()=>{t?.(Na.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=lt.leaving;let a=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(Qt.close,"leave",this._joinRef())};this.joinPush.destroy();let r=null;return new Promise(o=>{r=new Ho(this,Qt.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 Ho(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}=Qt;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(g=>{var x,w,L;return((x=g.filter)===null||x===void 0?void 0:x.event)==="*"||((L=(w=g.filter)===null||w===void 0?void 0:w.event)===null||L===void 0?void 0:L.toLocaleLowerCase())===s}).map(g=>g.callback(f,r)):(n=this.bindings[s])===null||n===void 0||n.filter(g=>{var x,w,L,y,h,m;if(["broadcast","presence","postgres_changes"].includes(s))if("id"in g){let C=g.id,I=(x=g.filter)===null||x===void 0?void 0:x.event;return C&&((w=a.ids)===null||w===void 0?void 0:w.includes(C))&&(I==="*"||I?.toLocaleLowerCase()===((L=a.data)===null||L===void 0?void 0:L.type.toLocaleLowerCase()))}else{let C=(h=(y=g?.filter)===null||y===void 0?void 0:y.event)===null||h===void 0?void 0:h.toLocaleLowerCase();return C==="*"||C===((m=a?.event)===null||m===void 0?void 0:m.toLocaleLowerCase())}else return g.type.toLocaleLowerCase()===s}).map(g=>{if(typeof f=="object"&&"ids"in f){let x=f.data,{schema:w,table:L,commit_timestamp:y,type:h,errors:m}=x;f=Object.assign(Object.assign({},{schema:w,table:L,commit_timestamp:y,eventType:h,new:{},old:{},errors:m}),this._getPayloadRecords(x))}g.callback(f,r)})}_isClosed(){return this.state===lt.closed}_isJoined(){return this.state===lt.joined}_isJoining(){return this.state===lt.joining}_isLeaving(){return this.state===lt.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(Qt.close,{},t)}_onError(t){this._on(Qt.error,{},a=>t(a))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=lt.joining,this.joinPush.resend(t))}_getPayloadRecords(t){let a={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(a.new=ag(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(a.old=ag(t.columns,t.old_record)),a}};var Gw=()=>{},S1=`
|
|
8
|
+
`+n.stack}return{value:e,source:t,stack:o,digest:null}}function rm(e,t,a){return{value:e,source:null,stack:a??null,digest:t??null}}function Um(e,t){try{console.error(t.value)}catch(a){setTimeout(function(){throw a})}}var RT=typeof WeakMap=="function"?WeakMap:Map;function Q0(e,t,a){a=ar(-1,a),a.tag=3,a.payload={element:null};var r=t.value;return a.callback=function(){Ud||(Ud=!0,Xm=r),Um(e,t)},a}function J0(e,t,a){a=ar(-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(){Um(e,t)}}var n=e.stateNode;return n!==null&&typeof n.componentDidCatch=="function"&&(a.callback=function(){Um(e,t),typeof r!="function"&&(zr===null?zr=new Set([this]):zr.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),a}function lv(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new RT;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=HT.bind(null,e,t,a),t.then(e,e))}function uv(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 dv(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=ar(-1,1),t.tag=2,qr(a,t,1))),a.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var _T=ir.ReactCurrentOwner,Et=!1;function It(e,t,a,r){t.child=e===null?k0(t,null,a,r):rs(t,e.child,a,r)}function cv(e,t,a,r,o){a=a.render;var n=t.ref;return Yn(t,o),r=Ph(e,t,a,r,n,o),a=Th(),e!==null&&!Et?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,sr(e,t,o)):(Ae&&a&&hh(t),t.flags|=1,It(e,t,r,o),t.child)}function fv(e,t,a,r,o){if(e===null){var n=a.type;return typeof n=="function"&&!Bh(n)&&n.defaultProps===void 0&&a.compare===null&&a.defaultProps===void 0?(t.tag=15,t.type=n,Y0(e,t,n,r,o)):(e=xd(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:sl,a(s,r)&&e.ref===t.ref)return sr(e,t,o)}return t.flags|=1,e=$r(n,r),e.ref=t.ref,e.return=t,t.child=e}function Y0(e,t,a,r,o){if(e!==null){var n=e.memoizedProps;if(sl(n,r)&&e.ref===t.ref)if(Et=!1,t.pendingProps=r=n,(e.lanes&o)!==0)(e.flags&131072)!==0&&(Et=!0);else return t.lanes=e.lanes,sr(e,t,o)}return Vm(e,t,a,r,o)}function Z0(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(Gn,Ht),Ht|=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(Gn,Ht),Ht|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=n!==null?n.baseLanes:a,we(Gn,Ht),Ht|=r}else n!==null?(r=n.baseLanes|a,t.memoizedState=null):r=a,we(Gn,Ht),Ht|=r;return It(e,t,o,a),t.child}function ew(e,t){var a=t.ref;(e===null&&a!==null||e!==null&&e.ref!==a)&&(t.flags|=512,t.flags|=2097152)}function Vm(e,t,a,r,o){var n=Mt(a)?No:xt.current;return n=ts(t,n),Yn(t,o),a=Ph(e,t,a,r,n,o),r=Th(),e!==null&&!Et?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,sr(e,t,o)):(Ae&&r&&hh(t),t.flags|=1,It(e,t,a,o),t.child)}function pv(e,t,a,r,o){if(Mt(a)){var n=!0;Ad(t)}else n=!1;if(Yn(t,o),t.stateNode===null)hd(e,t),X0(t,a,r),Bm(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=da(u):(u=Mt(a)?No:xt.current,u=ts(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)&&iv(t,s,r,u),Dr=!1;var f=t.memoizedState;s.state=f,Md(t,r,s,o),l=t.memoizedState,i!==r||f!==l||Dt.current||Dr?(typeof d=="function"&&(Fm(t,a,d,r),l=t.memoizedState),(i=Dr||sv(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,T0(e,t),i=t.memoizedProps,u=t.type===t.elementType?i:xa(t.type,i),s.props=u,c=t.pendingProps,f=s.context,l=a.contextType,typeof l=="object"&&l!==null?l=da(l):(l=Mt(a)?No:xt.current,l=ts(t,l));var g=a.getDerivedStateFromProps;(d=typeof g=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(i!==c||f!==l)&&iv(t,s,r,l),Dr=!1,f=t.memoizedState,s.state=f,Md(t,r,s,o);var x=t.memoizedState;i!==c||f!==x||Dt.current||Dr?(typeof g=="function"&&(Fm(t,a,g,r),x=t.memoizedState),(u=Dr||sv(t,a,u,r,f,x,l)||!1)?(d||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,x,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,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=r,t.memoizedState=x),s.props=r,s.state=x,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 jm(e,t,a,r,n,o)}function jm(e,t,a,r,o,n){ew(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&Yx(t,a,!1),sr(e,t,n);r=t.stateNode,_T.current=t;var i=s&&typeof a.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=rs(t,e.child,null,n),t.child=rs(t,null,i,n)):It(e,t,i,n),t.memoizedState=r.state,o&&Yx(t,a,!0),t.child}function tw(e){var t=e.stateNode;t.pendingContext?Jx(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Jx(e,t.context,!1),Lh(e,t.containerInfo)}function mv(e,t,a,r,o){return as(),yh(o),t.flags|=256,It(e,t,a,r),t.child}var qm={dehydrated:null,treeContext:null,retryLane:0};function zm(e){return{baseLanes:e,cachePool:null,transitions:null}}function aw(e,t,a){var r=t.pendingProps,o=Re.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(Re,o&1),e===null)return Nm(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=Zd(s,r,0,null),e=Mo(e,r,a,null),n.return=t,e.return=t,n.sibling=e,t.child=n,t.child.memoizedState=zm(a),t.memoizedState=qm,e):_h(t,s));if(o=e.memoizedState,o!==null&&(i=o.dehydrated,i!==null))return ET(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=$r(o,l),r.subtreeFlags=o.subtreeFlags&14680064),i!==null?n=$r(i,n):(n=Mo(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?zm(a):{baseLanes:s.baseLanes|a,cachePool:null,transitions:s.transitions},n.memoizedState=s,n.childLanes=e.childLanes&~a,t.memoizedState=qm,r}return n=e.child,e=n.sibling,r=$r(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 _h(e,t){return t=Zd({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function sd(e,t,a,r){return r!==null&&yh(r),rs(t,e.child,null,a),e=_h(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function ET(e,t,a,r,o,n,s){if(a)return t.flags&256?(t.flags&=-257,r=rm(Error(_(422))),sd(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(n=r.fallback,o=t.mode,r=Zd({mode:"visible",children:r.children},o,0,null),n=Mo(n,o,s,null),n.flags|=2,r.return=t,n.return=t,r.sibling=n,t.child=r,(t.mode&1)!==0&&rs(t,e.child,null,s),t.child.memoizedState=zm(s),t.memoizedState=qm,n);if((t.mode&1)===0)return sd(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var i=r.dgst;return r=i,n=Error(_(419)),r=rm(n,r,void 0),sd(e,t,s,r)}if(i=(s&e.childLanes)!==0,Et||i){if(r=et,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,nr(e,o),Sa(r,e,o,-1))}return Fh(),r=rm(Error(_(421))),sd(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=$T.bind(null,e),o._reactRetry=t,null):(e=n.treeContext,$t=jr(o.nextSibling),Wt=t,Ae=!0,wa=null,e!==null&&(sa[ia++]=er,sa[ia++]=tr,sa[ia++]=Oo,er=e.id,tr=e.overflow,Oo=t),t=_h(t,r.children),t.flags|=4096,t)}function hv(e,t,a){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Om(e.return,t,a)}function om(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 rw(e,t,a){var r=t.pendingProps,o=r.revealOrder,n=r.tail;if(It(e,t,r.children,a),r=Re.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&&hv(e,a,t);else if(e.tag===19)hv(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(Re,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&&Nd(e)===null&&(o=a),a=a.sibling;a=o,a===null?(o=t.child,t.child=null):(o=a.sibling,a.sibling=null),om(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&&Nd(e)===null){t.child=o;break}e=o.sibling,o.sibling=a,a=o,o=e}om(t,!0,a,null,n);break;case"together":om(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function hd(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function sr(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Bo|=t.lanes,(a&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(_(153));if(t.child!==null){for(e=t.child,a=$r(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=$r(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function DT(e,t,a){switch(t.tag){case 3:tw(t),as();break;case 5:A0(t);break;case 1:Mt(t.type)&&Ad(t);break;case 4:Lh(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;we(Ed,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(we(Re,Re.current&1),t.flags|=128,null):(a&t.child.childLanes)!==0?aw(e,t,a):(we(Re,Re.current&1),e=sr(e,t,a),e!==null?e.sibling:null);we(Re,Re.current&1);break;case 19:if(r=(a&t.childLanes)!==0,(e.flags&128)!==0){if(r)return rw(e,t,a);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),we(Re,Re.current),r)break;return null;case 22:case 23:return t.lanes=0,Z0(e,t,a)}return sr(e,t,a)}var ow,Hm,nw,sw;ow=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}};Hm=function(){};nw=function(e,t,a,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Eo(Na.current);var n=null;switch(a){case"input":o=fm(e,o),r=fm(e,r),n=[];break;case"select":o=Ee({},o,{value:void 0}),r=Ee({},r,{value:void 0}),n=[];break;case"textarea":o=hm(e,o),r=hm(e,r),n=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Pd)}ym(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"&&(Zi.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"&&(Zi.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)}};sw=function(e,t,a,r){a!==r&&(t.flags|=4)};function Fi(e,t){if(!Ae)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 gt(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 MT(e,t,a){var r=t.pendingProps;switch(gh(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return gt(t),null;case 1:return Mt(t.type)&&Td(),gt(t),null;case 3:return r=t.stateNode,os(),be(Dt),be(xt),bh(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(od(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,wa!==null&&(Ym(wa),wa=null))),Hm(e,t),gt(t),null;case 5:Ih(t);var o=Eo(cl.current);if(a=t.type,e!==null&&t.stateNode!=null)nw(e,t,a,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(_(166));return gt(t),null}if(e=Eo(Na.current),od(t)){r=t.stateNode,a=t.type;var n=t.memoizedProps;switch(r[Da]=t,r[ul]=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<zi.length;o++)Ie(zi[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":Lx(r,n),Ie("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!n.multiple},Ie("invalid",r);break;case"textarea":bx(r,n),Ie("invalid",r)}ym(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&&rd(r.textContent,i,e),o=["children",i]):typeof i=="number"&&r.textContent!==""+i&&(n.suppressHydrationWarning!==!0&&rd(r.textContent,i,e),o=["children",""+i]):Zi.hasOwnProperty(s)&&i!=null&&s==="onScroll"&&Ie("scroll",r)}switch(a){case"input":$u(r),Ix(r,n,!0);break;case"textarea":$u(r),kx(r);break;case"select":case"option":break;default:typeof n.onClick=="function"&&(r.onclick=Pd)}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=Mv(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[Da]=t,e[ul]=r,ow(e,t,!1,!1),t.stateNode=e;e:{switch(s=xm(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<zi.length;o++)Ie(zi[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":Lx(e,r),o=fm(e,r),Ie("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Ee({},r,{value:void 0}),Ie("invalid",e);break;case"textarea":bx(e,r),o=hm(e,r),Ie("invalid",e);break;default:o=r}ym(a,o),i=o;for(n in i)if(i.hasOwnProperty(n)){var l=i[n];n==="style"?Fv(e,l):n==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Nv(e,l)):n==="children"?typeof l=="string"?(a!=="textarea"||l!=="")&&el(e,l):typeof l=="number"&&el(e,""+l):n!=="suppressContentEditableWarning"&&n!=="suppressHydrationWarning"&&n!=="autoFocus"&&(Zi.hasOwnProperty(n)?l!=null&&n==="onScroll"&&Ie("scroll",e):l!=null&&th(e,n,l,s))}switch(a){case"input":$u(e),Ix(e,r,!1);break;case"textarea":$u(e),kx(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Wr(r.value));break;case"select":e.multiple=!!r.multiple,n=r.value,n!=null?Kn(e,!!r.multiple,n,!1):r.defaultValue!=null&&Kn(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Pd)}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 gt(t),null;case 6:if(e&&t.stateNode!=null)sw(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(_(166));if(a=Eo(cl.current),Eo(Na.current),od(t)){if(r=t.stateNode,a=t.memoizedProps,r[Da]=t,(n=r.nodeValue!==a)&&(e=Wt,e!==null))switch(e.tag){case 3:rd(r.nodeValue,a,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&rd(r.nodeValue,a,(e.mode&1)!==0)}n&&(t.flags|=4)}else r=(a.nodeType===9?a:a.ownerDocument).createTextNode(r),r[Da]=t,t.stateNode=r}return gt(t),null;case 13:if(be(Re),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ae&&$t!==null&&(t.mode&1)!==0&&(t.flags&128)===0)I0(),as(),t.flags|=98560,n=!1;else if(n=od(t),r!==null&&r.dehydrated!==null){if(e===null){if(!n)throw Error(_(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(_(317));n[Da]=t}else as(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;gt(t),n=!1}else wa!==null&&(Ym(wa),wa=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||(Re.current&1)!==0?Ge===0&&(Ge=3):Fh())),t.updateQueue!==null&&(t.flags|=4),gt(t),null);case 4:return os(),Hm(e,t),e===null&&il(t.stateNode.containerInfo),gt(t),null;case 10:return wh(t.type._context),gt(t),null;case 17:return Mt(t.type)&&Td(),gt(t),null;case 19:if(be(Re),n=t.memoizedState,n===null)return gt(t),null;if(r=(t.flags&128)!==0,s=n.rendering,s===null)if(r)Fi(n,!1);else{if(Ge!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(s=Nd(e),s!==null){for(t.flags|=128,Fi(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(Re,Re.current&1|2),t.child}e=e.sibling}n.tail!==null&&Ue()>ss&&(t.flags|=128,r=!0,Fi(n,!1),t.lanes=4194304)}else{if(!r)if(e=Nd(s),e!==null){if(t.flags|=128,r=!0,a=e.updateQueue,a!==null&&(t.updateQueue=a,t.flags|=4),Fi(n,!0),n.tail===null&&n.tailMode==="hidden"&&!s.alternate&&!Ae)return gt(t),null}else 2*Ue()-n.renderingStartTime>ss&&a!==1073741824&&(t.flags|=128,r=!0,Fi(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=Ue(),t.sibling=null,a=Re.current,we(Re,r?a&1|2:a&1),t):(gt(t),null);case 22:case 23:return Oh(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(Ht&1073741824)!==0&&(gt(t),t.subtreeFlags&6&&(t.flags|=8192)):gt(t),null;case 24:return null;case 25:return null}throw Error(_(156,t.tag))}function NT(e,t){switch(gh(t),t.tag){case 1:return Mt(t.type)&&Td(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return os(),be(Dt),be(xt),bh(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Ih(t),null;case 13:if(be(Re),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(_(340));as()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return be(Re),null;case 4:return os(),null;case 10:return wh(t.type._context),null;case 22:case 23:return Oh(),null;case 24:return null;default:return null}}var id=!1,yt=!1,OT=typeof WeakSet=="function"?WeakSet:Set,U=null;function Wn(e,t){var a=e.ref;if(a!==null)if(typeof a=="function")try{a(null)}catch(r){Oe(e,t,r)}else a.current=null}function $m(e,t,a){try{a()}catch(r){Oe(e,t,r)}}var gv=!1;function FT(e,t){if(Tm=Id,e=c0(),mh(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 g;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),(g=c.firstChild)!==null;)f=c,c=g;for(;;){if(c===e)break t;if(f===a&&++u===o&&(i=s),f===n&&++d===r&&(l=s),(g=c.nextSibling)!==null)break;c=f,f=c.parentNode}c=g}a=i===-1||l===-1?null:{start:i,end:l}}else a=null}a=a||{start:0,end:0}}else a=null;for(Am={focusedElem:e,selectionRange:a},Id=!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,L=x.memoizedState,y=t.stateNode,h=y.getSnapshotBeforeUpdate(t.elementType===t.type?w:xa(t.type,w),L);y.__reactInternalSnapshotBeforeUpdate=h}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(_(163))}}catch(S){Oe(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,U=e;break}U=t.return}return x=gv,gv=!1,x}function Qi(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&&$m(t,a,n)}o=o.next}while(o!==r)}}function Jd(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 Wm(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 iw(e){var t=e.alternate;t!==null&&(e.alternate=null,iw(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Da],delete t[ul],delete t[Em],delete t[vT],delete t[wT])),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 lw(e){return e.tag===5||e.tag===3||e.tag===4}function yv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||lw(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 Gm(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=Pd));else if(r!==4&&(e=e.child,e!==null))for(Gm(e,t,a),e=e.sibling;e!==null;)Gm(e,t,a),e=e.sibling}function Km(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(Km(e,t,a),e=e.sibling;e!==null;)Km(e,t,a),e=e.sibling}var nt=null,va=!1;function _r(e,t,a){for(a=a.child;a!==null;)uw(e,t,a),a=a.sibling}function uw(e,t,a){if(Ma&&typeof Ma.onCommitFiberUnmount=="function")try{Ma.onCommitFiberUnmount(zd,a)}catch{}switch(a.tag){case 5:yt||Wn(a,t);case 6:var r=nt,o=va;nt=null,_r(e,t,a),nt=r,va=o,nt!==null&&(va?(e=nt,a=a.stateNode,e.nodeType===8?e.parentNode.removeChild(a):e.removeChild(a)):nt.removeChild(a.stateNode));break;case 18:nt!==null&&(va?(e=nt,a=a.stateNode,e.nodeType===8?Jp(e.parentNode,a):e.nodeType===1&&Jp(e,a),ol(e)):Jp(nt,a.stateNode));break;case 4:r=nt,o=va,nt=a.stateNode.containerInfo,va=!0,_r(e,t,a),nt=r,va=o;break;case 0:case 11:case 14:case 15:if(!yt&&(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)&&$m(a,t,s),o=o.next}while(o!==r)}_r(e,t,a);break;case 1:if(!yt&&(Wn(a,t),r=a.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=a.memoizedProps,r.state=a.memoizedState,r.componentWillUnmount()}catch(i){Oe(a,t,i)}_r(e,t,a);break;case 21:_r(e,t,a);break;case 22:a.mode&1?(yt=(r=yt)||a.memoizedState!==null,_r(e,t,a),yt=r):_r(e,t,a);break;default:_r(e,t,a)}}function xv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var a=e.stateNode;a===null&&(a=e.stateNode=new OT),t.forEach(function(r){var o=WT.bind(null,e,r);a.has(r)||(a.add(r),r.then(o,o))})}}function ya(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:nt=i.stateNode,va=!1;break e;case 3:nt=i.stateNode.containerInfo,va=!0;break e;case 4:nt=i.stateNode.containerInfo,va=!0;break e}i=i.return}if(nt===null)throw Error(_(160));uw(n,s,o),nt=null,va=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(u){Oe(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)dw(t,e),t=t.sibling}function dw(e,t){var a=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ya(t,e),_a(e),r&4){try{Qi(3,e,e.return),Jd(3,e)}catch(w){Oe(e,e.return,w)}try{Qi(5,e,e.return)}catch(w){Oe(e,e.return,w)}}break;case 1:ya(t,e),_a(e),r&512&&a!==null&&Wn(a,a.return);break;case 5:if(ya(t,e),_a(e),r&512&&a!==null&&Wn(a,a.return),e.flags&32){var o=e.stateNode;try{el(o,"")}catch(w){Oe(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&&Ev(o,n),xm(i,s);var u=xm(i,n);for(s=0;s<l.length;s+=2){var d=l[s],c=l[s+1];d==="style"?Fv(o,c):d==="dangerouslySetInnerHTML"?Nv(o,c):d==="children"?el(o,c):th(o,d,c,u)}switch(i){case"input":pm(o,n);break;case"textarea":Dv(o,n);break;case"select":var f=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!n.multiple;var g=n.value;g!=null?Kn(o,!!n.multiple,g,!1):f!==!!n.multiple&&(n.defaultValue!=null?Kn(o,!!n.multiple,n.defaultValue,!0):Kn(o,!!n.multiple,n.multiple?[]:"",!1))}o[ul]=n}catch(w){Oe(e,e.return,w)}}break;case 6:if(ya(t,e),_a(e),r&4){if(e.stateNode===null)throw Error(_(162));o=e.stateNode,n=e.memoizedProps;try{o.nodeValue=n}catch(w){Oe(e,e.return,w)}}break;case 3:if(ya(t,e),_a(e),r&4&&a!==null&&a.memoizedState.isDehydrated)try{ol(t.containerInfo)}catch(w){Oe(e,e.return,w)}break;case 4:ya(t,e),_a(e);break;case 13:ya(t,e),_a(e),o=e.child,o.flags&8192&&(n=o.memoizedState!==null,o.stateNode.isHidden=n,!n||o.alternate!==null&&o.alternate.memoizedState!==null||(Mh=Ue())),r&4&&xv(e);break;case 22:if(d=a!==null&&a.memoizedState!==null,e.mode&1?(yt=(u=yt)||d,ya(t,e),yt=u):ya(t,e),_a(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&(e.mode&1)!==0)for(U=e,d=e.child;d!==null;){for(c=U=d;U!==null;){switch(f=U,g=f.child,f.tag){case 0:case 11:case 14:case 15:Qi(4,f,f.return);break;case 1:Wn(f,f.return);var x=f.stateNode;if(typeof x.componentWillUnmount=="function"){r=f,a=f.return;try{t=r,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(w){Oe(r,a,w)}}break;case 5:Wn(f,f.return);break;case 22:if(f.memoizedState!==null){wv(c);continue}}g!==null?(g.return=f,U=g):wv(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=Ov("display",s))}catch(w){Oe(e,e.return,w)}}}else if(c.tag===6){if(d===null)try{c.stateNode.nodeValue=u?"":c.memoizedProps}catch(w){Oe(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:ya(t,e),_a(e),r&4&&xv(e);break;case 21:break;default:ya(t,e),_a(e)}}function _a(e){var t=e.flags;if(t&2){try{e:{for(var a=e.return;a!==null;){if(lw(a)){var r=a;break e}a=a.return}throw Error(_(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(el(o,""),r.flags&=-33);var n=yv(e);Km(e,n,o);break;case 3:case 4:var s=r.stateNode.containerInfo,i=yv(e);Gm(e,i,s);break;default:throw Error(_(161))}}catch(l){Oe(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function BT(e,t,a){U=e,cw(e,t,a)}function cw(e,t,a){for(var r=(e.mode&1)!==0;U!==null;){var o=U,n=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||id;if(!s){var i=o.alternate,l=i!==null&&i.memoizedState!==null||yt;i=id;var u=yt;if(id=s,(yt=l)&&!u)for(U=o;U!==null;)s=U,l=s.child,s.tag===22&&s.memoizedState!==null?Cv(o):l!==null?(l.return=s,U=l):Cv(o);for(;n!==null;)U=n,cw(n,t,a),n=n.sibling;U=o,id=i,yt=u}vv(e,t,a)}else(o.subtreeFlags&8772)!==0&&n!==null?(n.return=o,U=n):vv(e,t,a)}}function vv(e){for(;U!==null;){var t=U;if((t.flags&8772)!==0){var a=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:yt||Jd(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!yt)if(a===null)r.componentDidMount();else{var o=t.elementType===t.type?a.memoizedProps:xa(t.type,a.memoizedProps);r.componentDidUpdate(o,a.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var n=t.updateQueue;n!==null&&rv(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}rv(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&&ol(c)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(_(163))}yt||t.flags&512&&Wm(t)}catch(f){Oe(t,t.return,f)}}if(t===e){U=null;break}if(a=t.sibling,a!==null){a.return=t.return,U=a;break}U=t.return}}function wv(e){for(;U!==null;){var t=U;if(t===e){U=null;break}var a=t.sibling;if(a!==null){a.return=t.return,U=a;break}U=t.return}}function Cv(e){for(;U!==null;){var t=U;try{switch(t.tag){case 0:case 11:case 15:var a=t.return;try{Jd(4,t)}catch(l){Oe(t,a,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(l){Oe(t,o,l)}}var n=t.return;try{Wm(t)}catch(l){Oe(t,n,l)}break;case 5:var s=t.return;try{Wm(t)}catch(l){Oe(t,s,l)}}}catch(l){Oe(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 UT=Math.ceil,Bd=ir.ReactCurrentDispatcher,Eh=ir.ReactCurrentOwner,ua=ir.ReactCurrentBatchConfig,ue=0,et=null,qe=null,st=0,Ht=0,Gn=Xr(0),Ge=0,hl=null,Bo=0,Yd=0,Dh=0,Ji=null,_t=null,Mh=0,ss=1/0,Ya=null,Ud=!1,Xm=null,zr=null,ld=!1,Fr=null,Vd=0,Yi=0,Qm=null,gd=-1,yd=0;function bt(){return(ue&6)!==0?Ue():gd!==-1?gd:gd=Ue()}function Hr(e){return(e.mode&1)===0?1:(ue&2)!==0&&st!==0?st&-st:ST.transition!==null?(yd===0&&(yd=Xv()),yd):(e=pe,e!==0||(e=window.event,e=e===void 0?16:a0(e.type)),e)}function Sa(e,t,a,r){if(50<Yi)throw Yi=0,Qm=null,Error(_(185));gl(e,a,r),((ue&2)===0||e!==et)&&(e===et&&((ue&2)===0&&(Yd|=a),Ge===4&&Nr(e,st)),Nt(e,r),a===1&&ue===0&&(t.mode&1)===0&&(ss=Ue()+500,Kd&&Qr()))}function Nt(e,t){var a=e.callbackNode;IP(e,t);var r=Ld(e,e===et?st:0);if(r===0)a!==null&&Ax(a),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(a!=null&&Ax(a),t===1)e.tag===0?CT(Sv.bind(null,e)):C0(Sv.bind(null,e)),yT(function(){(ue&6)===0&&Qr()}),a=null;else{switch(Qv(r)){case 1:a=sh;break;case 4:a=Gv;break;case 16:a=Sd;break;case 536870912:a=Kv;break;default:a=Sd}a=vw(a,fw.bind(null,e))}e.callbackPriority=t,e.callbackNode=a}}function fw(e,t){if(gd=-1,yd=0,(ue&6)!==0)throw Error(_(327));var a=e.callbackNode;if(Zn()&&e.callbackNode!==a)return null;var r=Ld(e,e===et?st:0);if(r===0)return null;if((r&30)!==0||(r&e.expiredLanes)!==0||t)t=jd(e,r);else{t=r;var o=ue;ue|=2;var n=mw();(et!==e||st!==t)&&(Ya=null,ss=Ue()+500,Do(e,t));do try{qT();break}catch(i){pw(e,i)}while(!0);vh(),Bd.current=n,ue=o,qe!==null?t=0:(et=null,st=0,t=Ge)}if(t!==0){if(t===2&&(o=Lm(e),o!==0&&(r=o,t=Jm(e,o))),t===1)throw a=hl,Do(e,0),Nr(e,r),Nt(e,Ue()),a;if(t===6)Nr(e,r);else{if(o=e.current.alternate,(r&30)===0&&!VT(o)&&(t=jd(e,r),t===2&&(n=Lm(e),n!==0&&(r=n,t=Jm(e,n))),t===1))throw a=hl,Do(e,0),Nr(e,r),Nt(e,Ue()),a;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(_(345));case 2:Ao(e,_t,Ya);break;case 3:if(Nr(e,r),(r&130023424)===r&&(t=Mh+500-Ue(),10<t)){if(Ld(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){bt(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=_m(Ao.bind(null,e,_t,Ya),t);break}Ao(e,_t,Ya);break;case 4:if(Nr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-Ca(r);n=1<<s,s=t[s],s>o&&(o=s),r&=~n}if(r=o,r=Ue()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*UT(r/1960))-r,10<r){e.timeoutHandle=_m(Ao.bind(null,e,_t,Ya),r);break}Ao(e,_t,Ya);break;case 5:Ao(e,_t,Ya);break;default:throw Error(_(329))}}}return Nt(e,Ue()),e.callbackNode===a?fw.bind(null,e):null}function Jm(e,t){var a=Ji;return e.current.memoizedState.isDehydrated&&(Do(e,t).flags|=256),e=jd(e,t),e!==2&&(t=_t,_t=a,t!==null&&Ym(t)),e}function Ym(e){_t===null?_t=e:_t.push.apply(_t,e)}function VT(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(!La(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 Nr(e,t){for(t&=~Dh,t&=~Yd,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var a=31-Ca(t),r=1<<a;e[a]=-1,t&=~r}}function Sv(e){if((ue&6)!==0)throw Error(_(327));Zn();var t=Ld(e,0);if((t&1)===0)return Nt(e,Ue()),null;var a=jd(e,t);if(e.tag!==0&&a===2){var r=Lm(e);r!==0&&(t=r,a=Jm(e,r))}if(a===1)throw a=hl,Do(e,0),Nr(e,t),Nt(e,Ue()),a;if(a===6)throw Error(_(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ao(e,_t,Ya),Nt(e,Ue()),null}function Nh(e,t){var a=ue;ue|=1;try{return e(t)}finally{ue=a,ue===0&&(ss=Ue()+500,Kd&&Qr())}}function Uo(e){Fr!==null&&Fr.tag===0&&(ue&6)===0&&Zn();var t=ue;ue|=1;var a=ua.transition,r=pe;try{if(ua.transition=null,pe=1,e)return e()}finally{pe=r,ua.transition=a,ue=t,(ue&6)===0&&Qr()}}function Oh(){Ht=Gn.current,be(Gn)}function Do(e,t){e.finishedWork=null,e.finishedLanes=0;var a=e.timeoutHandle;if(a!==-1&&(e.timeoutHandle=-1,gT(a)),qe!==null)for(a=qe.return;a!==null;){var r=a;switch(gh(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Td();break;case 3:os(),be(Dt),be(xt),bh();break;case 5:Ih(r);break;case 4:os();break;case 13:be(Re);break;case 19:be(Re);break;case 10:wh(r.type._context);break;case 22:case 23:Oh()}a=a.return}if(et=e,qe=e=$r(e.current,null),st=Ht=t,Ge=0,hl=null,Dh=Yd=Bo=0,_t=Ji=null,_o!==null){for(t=0;t<_o.length;t++)if(a=_o[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}_o=null}return e}function pw(e,t){do{var a=qe;try{if(vh(),pd.current=Fd,Od){for(var r=_e.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Od=!1}if(Fo=0,Ze=We=_e=null,Xi=!1,fl=0,Eh.current=null,a===null||a.return===null){Ge=1,hl=t,qe=null;break}e:{var n=e,s=a.return,i=a,l=t;if(t=st,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 g=uv(s);if(g!==null){g.flags&=-257,dv(g,s,i,n,t),g.mode&1&&lv(n,u,t),t=g,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){lv(n,u,t),Fh();break e}l=Error(_(426))}}else if(Ae&&i.mode&1){var L=uv(s);if(L!==null){(L.flags&65536)===0&&(L.flags|=256),dv(L,s,i,n,t),yh(ns(l,i));break e}}n=l=ns(l,i),Ge!==4&&(Ge=2),Ji===null?Ji=[n]:Ji.push(n),n=s;do{switch(n.tag){case 3:n.flags|=65536,t&=-t,n.lanes|=t;var y=Q0(n,l,t);av(n,y);break e;case 1:i=l;var h=n.type,m=n.stateNode;if((n.flags&128)===0&&(typeof h.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(zr===null||!zr.has(m)))){n.flags|=65536,t&=-t,n.lanes|=t;var S=J0(n,i,t);av(n,S);break e}}n=n.return}while(n!==null)}gw(a)}catch(I){t=I,qe===a&&a!==null&&(qe=a=a.return);continue}break}while(!0)}function mw(){var e=Bd.current;return Bd.current=Fd,e===null?Fd:e}function Fh(){(Ge===0||Ge===3||Ge===2)&&(Ge=4),et===null||(Bo&268435455)===0&&(Yd&268435455)===0||Nr(et,st)}function jd(e,t){var a=ue;ue|=2;var r=mw();(et!==e||st!==t)&&(Ya=null,Do(e,t));do try{jT();break}catch(o){pw(e,o)}while(!0);if(vh(),ue=a,Bd.current=r,qe!==null)throw Error(_(261));return et=null,st=0,Ge}function jT(){for(;qe!==null;)hw(qe)}function qT(){for(;qe!==null&&!hP();)hw(qe)}function hw(e){var t=xw(e.alternate,e,Ht);e.memoizedProps=e.pendingProps,t===null?gw(e):qe=t,Eh.current=null}function gw(e){var t=e;do{var a=t.alternate;if(e=t.return,(t.flags&32768)===0){if(a=MT(a,t,Ht),a!==null){qe=a;return}}else{if(a=NT(a,t),a!==null){a.flags&=32767,qe=a;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ge=6,qe=null;return}}if(t=t.sibling,t!==null){qe=t;return}qe=t=e}while(t!==null);Ge===0&&(Ge=5)}function Ao(e,t,a){var r=pe,o=ua.transition;try{ua.transition=null,pe=1,zT(e,t,a,r)}finally{ua.transition=o,pe=r}return null}function zT(e,t,a,r){do Zn();while(Fr!==null);if((ue&6)!==0)throw Error(_(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(_(177));e.callbackNode=null,e.callbackPriority=0;var n=a.lanes|a.childLanes;if(bP(e,n),e===et&&(qe=et=null,st=0),(a.subtreeFlags&2064)===0&&(a.flags&2064)===0||ld||(ld=!0,vw(Sd,function(){return Zn(),null})),n=(a.flags&15990)!==0,(a.subtreeFlags&15990)!==0||n){n=ua.transition,ua.transition=null;var s=pe;pe=1;var i=ue;ue|=4,Eh.current=null,FT(e,a),dw(a,e),cT(Am),Id=!!Tm,Am=Tm=null,e.current=a,BT(a,e,o),gP(),ue=i,pe=s,ua.transition=n}else e.current=a;if(ld&&(ld=!1,Fr=e,Vd=o),n=e.pendingLanes,n===0&&(zr=null),vP(a.stateNode,r),Nt(e,Ue()),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(Ud)throw Ud=!1,e=Xm,Xm=null,e;return(Vd&1)!==0&&e.tag!==0&&Zn(),n=e.pendingLanes,(n&1)!==0?e===Qm?Yi++:(Yi=0,Qm=e):Yi=0,Qr(),null}function Zn(){if(Fr!==null){var e=Qv(Vd),t=ua.transition,a=pe;try{if(ua.transition=null,pe=16>e?16:e,Fr===null)var r=!1;else{if(e=Fr,Fr=null,Vd=0,(ue&6)!==0)throw Error(_(331));var o=ue;for(ue|=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 d=U;switch(d.tag){case 0:case 11:case 15:Qi(8,d,n)}var c=d.child;if(c!==null)c.return=d,U=c;else for(;U!==null;){d=U;var f=d.sibling,g=d.return;if(iw(d),d===u){U=null;break}if(f!==null){f.return=g,U=f;break}U=g}}}var x=n.alternate;if(x!==null){var w=x.child;if(w!==null){x.child=null;do{var L=w.sibling;w.sibling=null,w=L}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:Qi(9,n,n.return)}var y=n.sibling;if(y!==null){y.return=n.return,U=y;break e}U=n.return}}var h=e.current;for(U=h;U!==null;){s=U;var m=s.child;if((s.subtreeFlags&2064)!==0&&m!==null)m.return=s,U=m;else e:for(s=h;U!==null;){if(i=U,(i.flags&2048)!==0)try{switch(i.tag){case 0:case 11:case 15:Jd(9,i)}}catch(I){Oe(i,i.return,I)}if(i===s){U=null;break e}var S=i.sibling;if(S!==null){S.return=i.return,U=S;break e}U=i.return}}if(ue=o,Qr(),Ma&&typeof Ma.onPostCommitFiberRoot=="function")try{Ma.onPostCommitFiberRoot(zd,e)}catch{}r=!0}return r}finally{pe=a,ua.transition=t}}return!1}function Lv(e,t,a){t=ns(a,t),t=Q0(e,t,1),e=qr(e,t,1),t=bt(),e!==null&&(gl(e,1,t),Nt(e,t))}function Oe(e,t,a){if(e.tag===3)Lv(e,e,a);else for(;t!==null;){if(t.tag===3){Lv(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(zr===null||!zr.has(r))){e=ns(a,e),e=J0(t,e,1),t=qr(t,e,1),e=bt(),t!==null&&(gl(t,1,e),Nt(t,e));break}}t=t.return}}function HT(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),t=bt(),e.pingedLanes|=e.suspendedLanes&a,et===e&&(st&a)===a&&(Ge===4||Ge===3&&(st&130023424)===st&&500>Ue()-Mh?Do(e,0):Dh|=a),Nt(e,t)}function yw(e,t){t===0&&((e.mode&1)===0?t=1:(t=Ku,Ku<<=1,(Ku&130023424)===0&&(Ku=4194304)));var a=bt();e=nr(e,t),e!==null&&(gl(e,t,a),Nt(e,a))}function $T(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),yw(e,a)}function WT(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(_(314))}r!==null&&r.delete(t),yw(e,a)}var xw;xw=function(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps||Dt.current)Et=!0;else{if((e.lanes&a)===0&&(t.flags&128)===0)return Et=!1,DT(e,t,a);Et=(e.flags&131072)!==0}else Et=!1,Ae&&(t.flags&1048576)!==0&&S0(t,_d,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;hd(e,t),e=t.pendingProps;var o=ts(t,xt.current);Yn(t,a),o=Ph(null,t,r,e,o,a);var n=Th();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,Mt(r)?(n=!0,Ad(t)):n=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Sh(t),o.updater=Qd,t.stateNode=o,o._reactInternals=t,Bm(t,r,e,a),t=jm(null,t,r,!0,n,a)):(t.tag=0,Ae&&n&&hh(t),It(null,t,o,a),t=t.child),t;case 16:r=t.elementType;e:{switch(hd(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=KT(r),e=xa(r,e),o){case 0:t=Vm(null,t,r,e,a);break e;case 1:t=pv(null,t,r,e,a);break e;case 11:t=cv(null,t,r,e,a);break e;case 14:t=fv(null,t,r,xa(r.type,e),a);break e}throw Error(_(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:xa(r,o),Vm(e,t,r,o,a);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:xa(r,o),pv(e,t,r,o,a);case 3:e:{if(tw(t),e===null)throw Error(_(387));r=t.pendingProps,n=t.memoizedState,o=n.element,T0(e,t),Md(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=ns(Error(_(423)),t),t=mv(e,t,r,a,o);break e}else if(r!==o){o=ns(Error(_(424)),t),t=mv(e,t,r,a,o);break e}else for($t=jr(t.stateNode.containerInfo.firstChild),Wt=t,Ae=!0,wa=null,a=k0(t,null,r,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(as(),r===o){t=sr(e,t,a);break e}It(e,t,r,a)}t=t.child}return t;case 5:return A0(t),e===null&&Nm(t),r=t.type,o=t.pendingProps,n=e!==null?e.memoizedProps:null,s=o.children,Rm(r,o)?s=null:n!==null&&Rm(r,n)&&(t.flags|=32),ew(e,t),It(e,t,s,a),t.child;case 6:return e===null&&Nm(t),null;case 13:return aw(e,t,a);case 4:return Lh(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=rs(t,null,r,a):It(e,t,r,a),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:xa(r,o),cv(e,t,r,o,a);case 7:return It(e,t,t.pendingProps,a),t.child;case 8:return It(e,t,t.pendingProps.children,a),t.child;case 12:return It(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(Ed,r._currentValue),r._currentValue=s,n!==null)if(La(n.value,s)){if(n.children===o.children&&!Dt.current){t=sr(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=ar(-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),Om(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(_(341));s.lanes|=a,i=s.alternate,i!==null&&(i.lanes|=a),Om(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}It(e,t,o.children,a),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Yn(t,a),o=da(o),r=r(o),t.flags|=1,It(e,t,r,a),t.child;case 14:return r=t.type,o=xa(r,t.pendingProps),o=xa(r.type,o),fv(e,t,r,o,a);case 15:return Y0(e,t,t.type,t.pendingProps,a);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:xa(r,o),hd(e,t),t.tag=1,Mt(r)?(e=!0,Ad(t)):e=!1,Yn(t,a),X0(t,r,o),Bm(t,r,o,a),jm(null,t,r,!0,e,a);case 19:return rw(e,t,a);case 22:return Z0(e,t,a)}throw Error(_(156,t.tag))};function vw(e,t){return Wv(e,t)}function GT(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 la(e,t,a,r){return new GT(e,t,a,r)}function Bh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function KT(e){if(typeof e=="function")return Bh(e)?1:0;if(e!=null){if(e=e.$$typeof,e===rh)return 11;if(e===oh)return 14}return 2}function $r(e,t){var a=e.alternate;return a===null?(a=la(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 xd(e,t,a,r,o,n){var s=2;if(r=e,typeof e=="function")Bh(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Fn:return Mo(a.children,o,n,t);case ah:s=8,o|=8;break;case lm:return e=la(12,a,t,o|2),e.elementType=lm,e.lanes=n,e;case um:return e=la(13,a,t,o),e.elementType=um,e.lanes=n,e;case dm:return e=la(19,a,t,o),e.elementType=dm,e.lanes=n,e;case Av:return Zd(a,o,n,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Pv:s=10;break e;case Tv:s=9;break e;case rh:s=11;break e;case oh:s=14;break e;case Er:s=16,r=null;break e}throw Error(_(130,e==null?e:typeof e,""))}return t=la(s,a,t,o),t.elementType=e,t.type=r,t.lanes=n,t}function Mo(e,t,a,r){return e=la(7,e,r,t),e.lanes=a,e}function Zd(e,t,a,r){return e=la(22,e,r,t),e.elementType=Av,e.lanes=a,e.stateNode={isHidden:!1},e}function nm(e,t,a){return e=la(6,e,null,t),e.lanes=a,e}function sm(e,t,a){return t=la(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function XT(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=zp(0),this.expirationTimes=zp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zp(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Uh(e,t,a,r,o,n,s,i,l){return e=new XT(e,t,a,i,l),t===1?(t=1,n===!0&&(t|=8)):t=0,n=la(3,null,null,t),e.current=n,n.stateNode=e,n.memoizedState={element:r,isDehydrated:a,cache:null,transitions:null,pendingSuspenseBoundaries:null},Sh(n),e}function QT(e,t,a){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:On,key:r==null?null:""+r,children:e,containerInfo:t,implementation:a}}function ww(e){if(!e)return Gr;e=e._reactInternals;e:{if(jo(e)!==e||e.tag!==1)throw Error(_(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Mt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(_(171))}if(e.tag===1){var a=e.type;if(Mt(a))return w0(e,a,t)}return t}function Cw(e,t,a,r,o,n,s,i,l){return e=Uh(a,r,!0,e,o,n,s,i,l),e.context=ww(null),a=e.current,r=bt(),o=Hr(a),n=ar(r,o),n.callback=t??null,qr(a,n,o),e.current.lanes=o,gl(e,o,r),Nt(e,r),e}function ec(e,t,a,r){var o=t.current,n=bt(),s=Hr(o);return a=ww(a),t.context===null?t.context=a:t.pendingContext=a,t=ar(n,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=qr(o,t,s),e!==null&&(Sa(e,o,s,n),fd(e,o,s)),s}function qd(e){return e=e.current,e.child?(e.child.tag===5,e.child.stateNode):null}function Iv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Vh(e,t){Iv(e,t),(e=e.alternate)&&Iv(e,t)}function JT(){return null}var Sw=typeof reportError=="function"?reportError:function(e){console.error(e)};function jh(e){this._internalRoot=e}tc.prototype.render=jh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(_(409));ec(e,t,null,null)};tc.prototype.unmount=jh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Uo(function(){ec(null,e,null,null)}),t[or]=null}};function tc(e){this._internalRoot=e}tc.prototype.unstable_scheduleHydration=function(e){if(e){var t=Zv();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Mr.length&&t!==0&&t<Mr[a].priority;a++);Mr.splice(a,0,e),a===0&&t0(e)}};function qh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ac(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function bv(){}function YT(e,t,a,r,o){if(o){if(typeof r=="function"){var n=r;r=function(){var u=qd(s);n.call(u)}}var s=Cw(t,r,e,0,null,!1,!1,"",bv);return e._reactRootContainer=s,e[or]=s.current,il(e.nodeType===8?e.parentNode:e),Uo(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var i=r;r=function(){var u=qd(l);i.call(u)}}var l=Uh(e,0,!1,null,null,!1,!1,"",bv);return e._reactRootContainer=l,e[or]=l.current,il(e.nodeType===8?e.parentNode:e),Uo(function(){ec(t,l,a,r)}),l}function rc(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=qd(s);i.call(l)}}ec(t,s,e,o)}else s=YT(a,t,e,o,r);return qd(s)}Jv=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var a=qi(t.pendingLanes);a!==0&&(ih(t,a|1),Nt(t,Ue()),(ue&6)===0&&(ss=Ue()+500,Qr()))}break;case 13:Uo(function(){var r=nr(e,1);if(r!==null){var o=bt();Sa(r,e,1,o)}}),Vh(e,1)}};lh=function(e){if(e.tag===13){var t=nr(e,134217728);if(t!==null){var a=bt();Sa(t,e,134217728,a)}Vh(e,134217728)}};Yv=function(e){if(e.tag===13){var t=Hr(e),a=nr(e,t);if(a!==null){var r=bt();Sa(a,e,t,r)}Vh(e,t)}};Zv=function(){return pe};e0=function(e,t){var a=pe;try{return pe=e,t()}finally{pe=a}};wm=function(e,t,a){switch(t){case"input":if(pm(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=Gd(r);if(!o)throw Error(_(90));_v(r),pm(r,o)}}}break;case"textarea":Dv(e,a);break;case"select":t=a.value,t!=null&&Kn(e,!!a.multiple,t,!1)}};Vv=Nh;jv=Uo;var ZT={usingClientEntryPoint:!1,Events:[xl,jn,Gd,Bv,Uv,Nh]},Bi={findFiberByHostInstance:Ro,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},e1={bundleType:Bi.bundleType,version:Bi.version,rendererPackageName:Bi.rendererPackageName,rendererConfig:Bi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ir.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Hv(e),e===null?null:e.stateNode},findFiberByHostInstance:Bi.findFiberByHostInstance||JT,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Ui=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Ui.isDisabled&&Ui.supportsFiber))try{zd=Ui.inject(e1),Ma=Ui}catch{}var Ui;Xt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ZT;Xt.createPortal=function(e,t){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!qh(t))throw Error(_(200));return QT(e,t,null,a)};Xt.createRoot=function(e,t){if(!qh(e))throw Error(_(299));var a=!1,r="",o=Sw;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Uh(e,1,!1,null,null,a,!1,r,o),e[or]=t.current,il(e.nodeType===8?e.parentNode:e),new jh(t)};Xt.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(_(188)):(e=Object.keys(e).join(","),Error(_(268,e)));return e=Hv(t),e=e===null?null:e.stateNode,e};Xt.flushSync=function(e){return Uo(e)};Xt.hydrate=function(e,t,a){if(!ac(t))throw Error(_(200));return rc(null,e,t,!0,a)};Xt.hydrateRoot=function(e,t,a){if(!qh(e))throw Error(_(405));var r=a!=null&&a.hydratedSources||null,o=!1,n="",s=Sw;if(a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(n=a.identifierPrefix),a.onRecoverableError!==void 0&&(s=a.onRecoverableError)),t=Cw(t,null,e,1,a??null,o,!1,n,s),e[or]=t.current,il(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 tc(t)};Xt.render=function(e,t,a){if(!ac(t))throw Error(_(200));return rc(null,e,t,!1,a)};Xt.unmountComponentAtNode=function(e){if(!ac(e))throw Error(_(40));return e._reactRootContainer?(Uo(function(){rc(null,null,e,!1,function(){e._reactRootContainer=null,e[or]=null})}),!0):!1};Xt.unstable_batchedUpdates=Nh;Xt.unstable_renderSubtreeIntoContainer=function(e,t,a,r){if(!ac(a))throw Error(_(200));if(e==null||e._reactInternals===void 0)throw Error(_(38));return rc(e,t,a,!1,r)};Xt.version="18.3.1-next-f1338f8080-20240426"});var zh=Ye((qD,bw)=>{"use strict";function Iw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Iw)}catch(e){console.error(e)}}Iw(),bw.exports=Lw()});var Pw=Ye(Hh=>{"use strict";var kw=zh();Hh.createRoot=kw.createRoot,Hh.hydrateRoot=kw.hydrateRoot;var zD});var qo={};Wy(qo,{Headers:()=>Wh,Request:()=>r1,Response:()=>o1,default:()=>$h,fetch:()=>a1});var t1,us,a1,$h,Wh,r1,o1,Jr=Fk(()=>{"use strict";t1=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")},us=t1(),a1=us.fetch,$h=us.fetch.bind(us),Wh=us.Headers,r1=us.Request,o1=us.Response});var Xh=Ye(Kh=>{"use strict";Object.defineProperty(Kh,"__esModule",{value:!0});var Gh=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.code=t.code}};Kh.default=Gh});var Jh=Ye(Il=>{"use strict";var Aw=Il&&Il.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Il,"__esModule",{value:!0});var s1=Aw((Jr(),Ky(qo))),i1=Aw(Xh()),Qh=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=s1.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,g=n.statusText;if(n.ok){if(this.method!=="HEAD"){let y=await n.text();y===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?d=y:d=JSON.parse(y))}let w=(s=this.headers.Prefer)===null||s===void 0?void 0:s.match(/count=(exact|planned|estimated)/),L=(i=n.headers.get("content-range"))===null||i===void 0?void 0:i.split("/");w&&L&&L.length>1&&(c=parseInt(L[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,g="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,g="OK")}catch{n.status===404&&w===""?(f=204,g="No Content"):u={message:w}}if(u&&this.isMaybeSingle&&(!((l=u?.details)===null||l===void 0)&&l.includes("0 rows"))&&(u=null,f=200,g="OK"),u&&this.shouldThrowOnError)throw new i1.default(u)}return{error:u,data:d,count:c,status:f,statusText:g}});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}};Il.default=Qh});var Zh=Ye(bl=>{"use strict";var l1=bl&&bl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(bl,"__esModule",{value:!0});var u1=l1(Jh()),Yh=class extends u1.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}};bl.default=Yh});var sc=Ye(kl=>{"use strict";var d1=kl&&kl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(kl,"__esModule",{value:!0});var c1=d1(Zh()),eg=class extends c1.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}};kl.default=eg});var ag=Ye(Tl=>{"use strict";var f1=Tl&&Tl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Tl,"__esModule",{value:!0});var Pl=f1(sc()),tg=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 Pl.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 Pl.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 Pl.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 Pl.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 Pl.default({method:a,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}};Tl.default=tg});var Rw=Ye(ic=>{"use strict";Object.defineProperty(ic,"__esModule",{value:!0});ic.version=void 0;ic.version="0.0.0-automated"});var _w=Ye(lc=>{"use strict";Object.defineProperty(lc,"__esModule",{value:!0});lc.DEFAULT_HEADERS=void 0;var p1=Rw();lc.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${p1.version}`}});var Dw=Ye(Al=>{"use strict";var Ew=Al&&Al.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Al,"__esModule",{value:!0});var m1=Ew(ag()),h1=Ew(sc()),g1=_w(),rg=class e{constructor(t,{headers:a={},schema:r,fetch:o}={}){this.url=t,this.headers=Object.assign(Object.assign({},g1.DEFAULT_HEADERS),a),this.schemaName=r,this.fetch=o}from(t){let a=new URL(`${this.url}/${t}`);return new m1.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 h1.default({method:s,url:i,headers:u,schema:this.schemaName,body:l,fetch:this.fetch,allowEmpty:!1})}};Al.default=rg});var Vw=Ye(lt=>{"use strict";var ds=lt&<.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(lt,"__esModule",{value:!0});lt.PostgrestError=lt.PostgrestBuilder=lt.PostgrestTransformBuilder=lt.PostgrestFilterBuilder=lt.PostgrestQueryBuilder=lt.PostgrestClient=void 0;var Mw=ds(Dw());lt.PostgrestClient=Mw.default;var Nw=ds(ag());lt.PostgrestQueryBuilder=Nw.default;var Ow=ds(sc());lt.PostgrestFilterBuilder=Ow.default;var Fw=ds(Zh());lt.PostgrestTransformBuilder=Fw.default;var Bw=ds(Jh());lt.PostgrestBuilder=Bw.default;var Uw=ds(Xh());lt.PostgrestError=Uw.default;lt.default={PostgrestClient:Mw.default,PostgrestQueryBuilder:Nw.default,PostgrestFilterBuilder:Ow.default,PostgrestTransformBuilder:Fw.default,PostgrestBuilder:Bw.default,PostgrestError:Uw.default}});var QC=Ye(Rc=>{"use strict";var EA=W(),DA=Symbol.for("react.element"),MA=Symbol.for("react.fragment"),NA=Object.prototype.hasOwnProperty,OA=EA.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,FA={key:!0,ref:!0,__self:!0,__source:!0};function XC(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)NA.call(t,r)&&!FA.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:DA,type:e,key:n,ref:s,props:o,_owner:OA.current}}Rc.Fragment=MA;Rc.jsx=XC;Rc.jsxs=XC});var le=Ye((MN,JC)=>{"use strict";JC.exports=QC()});var DD={};Wy(DD,{initKiteChat:()=>_y});var Xa=N(W(),1),gk=N(Pw(),1);var B=N(W(),1);var Tw=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...a)=>Promise.resolve().then(()=>(Jr(),qo)).then(({default:r})=>r(...a)):t=fetch,(...a)=>t(...a)};var wl=class extends Error{constructor(t,a="FunctionsError",r){super(t),this.name=a,this.context=r}},oc=class extends wl{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}},Cl=class extends wl{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}},Sl=class extends wl{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}},nc;(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"})(nc||(nc={}));var n1=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())})},Ll=class{constructor(t,{headers:a={},customFetch:r,region:o=nc.Any}={}){this.url=t,this.headers=a,this.region=o,this.fetch=Tw(r)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t,a={}){var r;return n1(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 oc(w)}),f=c.headers.get("x-relay-error");if(f&&f==="true")throw new Cl(c);if(!c.ok)throw new Sl(c);let g=((r=c.headers.get("Content-Type"))!==null&&r!==void 0?r:"text/plain").split(";")[0].trim(),x;return g==="application/json"?x=yield c.json():g==="application/octet-stream"?x=yield c.blob():g==="text/event-stream"?x=c:g==="multipart/form-data"?x=yield c.formData():x=yield c.text(),{data:x,error:null,response:c}}catch(o){return{data:null,error:o,response:o instanceof Sl||o instanceof Cl?o.context:void 0}}})}};var jw=N(Vw(),1),{PostgrestClient:qw,PostgrestQueryBuilder:iM,PostgrestFilterBuilder:lM,PostgrestTransformBuilder:uM,PostgrestBuilder:dM,PostgrestError:y1}=jw.default;function zw(){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 Hw=zw();var $w="2.11.15";var Ww=`realtime-js/${$w}`,Gw="1.0.0";var dc=1e4,Kw=1e3,cs;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(cs||(cs={}));var ut;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(ut||(ut={}));var Qt;(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"})(Qt||(Qt={}));var uc;(function(e){e.websocket="websocket"})(uc||(uc={}));var Yr;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(Yr||(Yr={}));var Rl=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 zo=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 ng=(e,t,a={})=>{var r;let o=(r=a.skipTypes)!==null&&r!==void 0?r:[];return Object.keys(t).reduce((n,s)=>(n[s]=x1(s,e,t,o),n),{})},x1=(e,t,a,r)=>{let o=t.find(i=>i.name===e),n=o?.type,s=a[e];return n&&!r.includes(n)?Xw(n,s):og(s)},Xw=(e,t)=>{if(e.charAt(0)==="_"){let a=e.slice(1,e.length);return S1(t,a)}switch(e){case Ce.bool:return v1(t);case Ce.float4:case Ce.float8:case Ce.int2:case Ce.int4:case Ce.int8:case Ce.numeric:case Ce.oid:return w1(t);case Ce.json:case Ce.jsonb:return C1(t);case Ce.timestamp:return L1(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 og(t);default:return og(t)}},og=e=>e,v1=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},w1=e=>{if(typeof e=="string"){let t=parseFloat(e);if(!Number.isNaN(t))return t}return e},C1=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch(t){return console.log(`JSON parse error: ${t}`),e}return e},S1=(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=>Xw(t,i))}return e},L1=e=>typeof e=="string"?e.replace(" ","T"):e,cc=e=>{let t=e;return t=t.replace(/^ws/i,"http"),t=t.replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,""),t.replace(/\/+$/,"")};var Ho=class{constructor(t,a,r={},o=dc){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 sg;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(sg||(sg={}));var fs=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(L=>L.presence_ref),g=c.map(L=>L.presence_ref),x=d.filter(L=>g.indexOf(L.presence_ref)<0),w=c.filter(L=>f.indexOf(L.presence_ref)<0);x.length>0&&(i[u]=x),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(g=>g.presence_ref),f=d.filter(g=>c.indexOf(g.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 ig;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(ig||(ig={}));var lg;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(lg||(lg={}));var Oa;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(Oa||(Oa={}));var ps=class e{constructor(t,a={config:{}},r){this.topic=t,this.params=a,this.socket=r,this.bindings={},this.state=ut.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 Ho(this,Qt.join,this.params,this.timeout),this.rejoinTimer=new zo(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=ut.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=ut.closed,this.socket._remove(this)}),this._onError(o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=ut.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=ut.errored,this.rejoinTimer.scheduleTimeout())}),this._on(Qt.reply,{},(o,n)=>{this._trigger(this._replyEventName(n),o)}),this.presence=new fs(this),this.broadcastEndpointURL=cc(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==ut.closed){let{config:{broadcast:n,presence:s,private:i}}=this.params;this._onError(d=>t?.(Oa.CHANNEL_ERROR,d)),this._onClose(()=>t?.(Oa.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?.(Oa.SUBSCRIBED);return}else{let f=this.bindings.postgres_changes,g=(c=f?.length)!==null&&c!==void 0?c:0,x=[];for(let w=0;w<g;w++){let L=f[w],{filter:{event:y,schema:h,table:m,filter:S}}=L,I=d&&d[w];if(I&&I.event===y&&I.schema===h&&I.table===m&&I.filter===S)x.push(Object.assign(Object.assign({},L),{id:I.id}));else{this.unsubscribe(),this.state=ut.errored,t?.(Oa.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=x,t&&t(Oa.SUBSCRIBED);return}}).receive("error",d=>{this.state=ut.errored,t?.(Oa.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(d).join(", ")||"error")))}).receive("timeout",()=>{t?.(Oa.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=ut.leaving;let a=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(Qt.close,"leave",this._joinRef())};this.joinPush.destroy();let r=null;return new Promise(o=>{r=new Ho(this,Qt.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 Ho(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}=Qt;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(g=>{var x,w,L;return((x=g.filter)===null||x===void 0?void 0:x.event)==="*"||((L=(w=g.filter)===null||w===void 0?void 0:w.event)===null||L===void 0?void 0:L.toLocaleLowerCase())===s}).map(g=>g.callback(f,r)):(n=this.bindings[s])===null||n===void 0||n.filter(g=>{var x,w,L,y,h,m;if(["broadcast","presence","postgres_changes"].includes(s))if("id"in g){let S=g.id,I=(x=g.filter)===null||x===void 0?void 0:x.event;return S&&((w=a.ids)===null||w===void 0?void 0:w.includes(S))&&(I==="*"||I?.toLocaleLowerCase()===((L=a.data)===null||L===void 0?void 0:L.type.toLocaleLowerCase()))}else{let S=(h=(y=g?.filter)===null||y===void 0?void 0:y.event)===null||h===void 0?void 0:h.toLocaleLowerCase();return S==="*"||S===((m=a?.event)===null||m===void 0?void 0:m.toLocaleLowerCase())}else return g.type.toLocaleLowerCase()===s}).map(g=>{if(typeof f=="object"&&"ids"in f){let x=f.data,{schema:w,table:L,commit_timestamp:y,type:h,errors:m}=x;f=Object.assign(Object.assign({},{schema:w,table:L,commit_timestamp:y,eventType:h,new:{},old:{},errors:m}),this._getPayloadRecords(x))}g.callback(f,r)})}_isClosed(){return this.state===ut.closed}_isJoined(){return this.state===ut.joined}_isJoining(){return this.state===ut.joining}_isLeaving(){return this.state===ut.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(Qt.close,{},t)}_onError(t){this._on(Qt.error,{},a=>t(a))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=ut.joining,this.joinPush.resend(t))}_getPayloadRecords(t){let a={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(a.new=ng(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(a.old=ng(t.columns,t.old_record)),a}};var Qw=()=>{},b1=`
|
|
9
9
|
addEventListener("message", (e) => {
|
|
10
10
|
if (e.data.event === "start") {
|
|
11
11
|
setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
|
|
12
12
|
}
|
|
13
|
-
});`,ps=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=ic,this.heartbeatIntervalMs=25e3,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=Gw,this.ref=0,this.logger=Gw,this.conn=null,this.sendBuffer=[],this.serializer=new Al,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(()=>(Xr(),jo)).then(({default:l})=>l(...i)):s=fetch,(...i)=>s(...i)},this.endPoint=`${t}/${sc.websocket}`,this.httpEndpoint=lc(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=jw),!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:zw}))}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 ds.connecting:return Qr.Connecting;case ds.open:return Qr.Open;case ds.closing:return Qr.Closing;default:return Qr.Closed}}isConnected(){return this.connectionState()===Qr.Open}channel(t,a={config:{}}){let r=`realtime:${t}`,o=this.getChannels().find(n=>n.topic===r);if(o)return o;{let n=new fs(`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:Hw};a&&r.updateJoinPayload(o),r.joinedOnce&&r._isJoined()&&r._push(Qt.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($w,"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(Qt.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([S1],{type:"application/javascript"});a=URL.createObjectURL(r)}return a}};var ms=class extends Error{constructor(t){super(t),this.__isStorageError=!0,this.name="StorageError"}};function je(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var uc=class extends ms{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}}},zo=class extends ms{constructor(t,a){super(t),this.name="StorageUnknownError",this.originalError=a}};var C1=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())})},cc=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...a)=>Promise.resolve().then(()=>(Xr(),jo)).then(({default:r})=>r(...a)):t=fetch,(...a)=>t(...a)},Kw=()=>C1(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield Promise.resolve().then(()=>(Xr(),jo))).Response:Response}),dc=e=>{if(Array.isArray(e))return e.map(a=>dc(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]=dc(r)}),t},Xw=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 $o=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())})},sg=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),L1=(e,t,a)=>$o(void 0,void 0,void 0,function*(){let r=yield Kw();e instanceof r&&!a?.noResolveJson?e.json().then(o=>{let n=e.status||500,s=o?.statusCode||n+"";t(new uc(sg(o),n,s))}).catch(o=>{t(new zo(sg(o),o))}):t(new zo(sg(e),e))}),I1=(e,t,a,r)=>{let o={method:e,headers:t?.headers||{}};return e==="GET"||!r?o:(Xw(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 Rl(e,t,a,r,o,n){return $o(this,void 0,void 0,function*(){return new Promise((s,i)=>{e(a,I1(t,r,o,n)).then(l=>{if(!l.ok)throw l;return r?.noResolveJson?l:l.json()}).then(l=>s(l)).catch(l=>L1(l,i,r))})})}function hs(e,t,a,r){return $o(this,void 0,void 0,function*(){return Rl(e,"GET",t,a,r)})}function Ia(e,t,a,r,o){return $o(this,void 0,void 0,function*(){return Rl(e,"POST",t,r,o,a)})}function _l(e,t,a,r,o){return $o(this,void 0,void 0,function*(){return Rl(e,"PUT",t,r,o,a)})}function Qw(e,t,a,r){return $o(this,void 0,void 0,function*(){return Rl(e,"HEAD",t,Object.assign(Object.assign({},a),{noResolveJson:!0}),r)})}function fc(e,t,a,r,o){return $o(this,void 0,void 0,function*(){return Rl(e,"DELETE",t,r,o,a)})}var Nt=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())})},b1={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Jw={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1},El=class{constructor(t,a={},r,o){this.url=t,this.headers=a,this.bucketId=r,this.fetch=cc(o)}uploadOrUpdate(t,a,r,o){return Nt(this,void 0,void 0,function*(){try{let n,s=Object.assign(Object.assign({},Jw),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"?_l:Ia)(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(je(n))return{data:null,error:n};throw n}})}upload(t,a,r){return Nt(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",t,a,r)})}uploadToSignedUrl(t,a,r,o){return Nt(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:Jw.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 _l(this.fetch,i.toString(),l,{headers:d});return{data:{path:n,fullPath:c.Key},error:null}}catch(l){if(je(l))return{data:null,error:l};throw l}})}createSignedUploadUrl(t,a){return Nt(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 Ia(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 ms("No token returned by API");return{data:{signedUrl:s.toString(),path:t,token:i},error:null}}catch(r){if(je(r))return{data:null,error:r};throw r}})}update(t,a,r){return Nt(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",t,a,r)})}move(t,a,r){return Nt(this,void 0,void 0,function*(){try{return{data:yield Ia(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:t,destinationKey:a,destinationBucket:r?.destinationBucket},{headers:this.headers}),error:null}}catch(o){if(je(o))return{data:null,error:o};throw o}})}copy(t,a,r){return Nt(this,void 0,void 0,function*(){try{return{data:{path:(yield Ia(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(je(o))return{data:null,error:o};throw o}})}createSignedUrl(t,a,r){return Nt(this,void 0,void 0,function*(){try{let o=this._getFinalPath(t),n=yield Ia(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(je(o))return{data:null,error:o};throw o}})}createSignedUrls(t,a,r){return Nt(this,void 0,void 0,function*(){try{let o=yield Ia(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(je(o))return{data:null,error:o};throw o}})}download(t,a){return Nt(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 hs(this.fetch,`${this.url}/${o}/${i}${s}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(i){if(je(i))return{data:null,error:i};throw i}})}info(t){return Nt(this,void 0,void 0,function*(){let a=this._getFinalPath(t);try{let r=yield hs(this.fetch,`${this.url}/object/info/${a}`,{headers:this.headers});return{data:dc(r),error:null}}catch(r){if(je(r))return{data:null,error:r};throw r}})}exists(t){return Nt(this,void 0,void 0,function*(){let a=this._getFinalPath(t);try{return yield Qw(this.fetch,`${this.url}/object/${a}`,{headers:this.headers}),{data:!0,error:null}}catch(r){if(je(r)&&r instanceof zo){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 Nt(this,void 0,void 0,function*(){try{return{data:yield fc(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:t},{headers:this.headers}),error:null}}catch(a){if(je(a))return{data:null,error:a};throw a}})}list(t,a,r){return Nt(this,void 0,void 0,function*(){try{let o=Object.assign(Object.assign(Object.assign({},b1),a),{prefix:t||""});return{data:yield Ia(this.fetch,`${this.url}/object/list/${this.bucketId}`,o,{headers:this.headers},r),error:null}}catch(o){if(je(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 Yw="2.10.4";var Zw={"X-Client-Info":`storage-js/${Yw}`};var gs=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())})},Dl=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({},Zw),a),this.fetch=cc(r)}listBuckets(){return gs(this,void 0,void 0,function*(){try{return{data:yield hs(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(t){if(je(t))return{data:null,error:t};throw t}})}getBucket(t){return gs(this,void 0,void 0,function*(){try{return{data:yield hs(this.fetch,`${this.url}/bucket/${t}`,{headers:this.headers}),error:null}}catch(a){if(je(a))return{data:null,error:a};throw a}})}createBucket(t,a={public:!1}){return gs(this,void 0,void 0,function*(){try{return{data:yield Ia(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(je(r))return{data:null,error:r};throw r}})}updateBucket(t,a){return gs(this,void 0,void 0,function*(){try{return{data:yield _l(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(je(r))return{data:null,error:r};throw r}})}emptyBucket(t){return gs(this,void 0,void 0,function*(){try{return{data:yield Ia(this.fetch,`${this.url}/bucket/${t}/empty`,{},{headers:this.headers}),error:null}}catch(a){if(je(a))return{data:null,error:a};throw a}})}deleteBucket(t){return gs(this,void 0,void 0,function*(){try{return{data:yield fc(this.fetch,`${this.url}/bucket/${t}`,{},{headers:this.headers}),error:null}}catch(a){if(je(a))return{data:null,error:a};throw a}})}};var Ml=class extends Dl{constructor(t,a={},r,o){super(t,a,r,o)}from(t){return new El(this.url,this.headers,t,this.fetch)}};var eS="2.53.0";var Nl="";typeof Deno<"u"?Nl="deno":typeof document<"u"?Nl="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Nl="react-native":Nl="node";var k1={"X-Client-Info":`supabase-js-${Nl}/${eS}`},tS={headers:k1},aS={schema:"public"},rS={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},oS={};Xr();var P1=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())})},T1=e=>{let t;return e?t=e:typeof fetch>"u"?t=qh:t=fetch,(...a)=>t(...a)},A1=()=>typeof Headers>"u"?Hh:Headers,nS=(e,t,a)=>{let r=T1(a),o=A1();return(n,s)=>P1(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 R1=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 sS(e){return e.endsWith("/")?e:e+"/"}function iS(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:()=>R1(this,void 0,void 0,function*(){return""})};return e.accessToken?f.accessToken=e.accessToken:delete f.accessToken,f}var pc="2.71.1";var Wo=30*1e3,mc=3,hc=mc*Wo,lS="http://localhost:9999",uS="supabase.auth.token";var dS={"X-Client-Info":`gotrue-js/${pc}`};var Ol="X-Supabase-Api-Version",ig={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},cS=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,fS=600*1e3;var Fl=class extends Error{constructor(t,a,r){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=a,this.code=r}};function Q(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}var gc=class extends Fl{constructor(t,a,r){super(t,a,r),this.name="AuthApiError",this.status=a,this.code=r}};function pS(e){return Q(e)&&e.name==="AuthApiError"}var ys=class extends Fl{constructor(t,a){super(t),this.name="AuthUnknownError",this.originalError=a}},Oa=class extends Fl{constructor(t,a,r,o){super(t,r,o),this.name=a,this.status=r}},da=class extends Oa{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}};function mS(e){return Q(e)&&e.name==="AuthSessionMissingError"}var Go=class extends Oa{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}},Ko=class extends Oa{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}},Xo=class extends Oa{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 hS(e){return Q(e)&&e.name==="AuthImplicitGrantRedirectError"}var Bl=class extends Oa{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}}},xs=class extends Oa{constructor(t,a){super(t,"AuthRetryableFetchError",a,void 0)}};function yc(e){return Q(e)&&e.name==="AuthRetryableFetchError"}var Ul=class extends Oa{constructor(t,a,r){super(t,"AuthWeakPasswordError",a,"weak_password"),this.reasons=r}};var Qo=class extends Oa{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}};var xc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),gS=`
|
|
14
|
-
\r=`.split(""),_1=(()=>{let e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<gS.length;t+=1)e[gS[t].charCodeAt(0)]=-2;for(let t=0;t<xc.length;t+=1)e[xc[t].charCodeAt(0)]=t;return e})();function yS(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(xc[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(xc[r]),t.queuedBits-=6}}function xS(e,t,a){let r=_1[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 lg(e){let t=[],a=s=>{t.push(String.fromCodePoint(s))},r={utf8seq:0,codepoint:0},o={queue:0,queuedBits:0},n=s=>{M1(s,r,a)};for(let s=0;s<e.length;s+=1)xS(e.charCodeAt(s),o,n);return t.join("")}function E1(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 D1(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}E1(r,t)}}function M1(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 vS(e){let t=[],a={queue:0,queuedBits:0},r=o=>{t.push(o)};for(let o=0;o<e.length;o+=1)xS(e.charCodeAt(o),a,r);return new Uint8Array(t)}function wS(e){let t=[];return D1(e,a=>t.push(a)),new Uint8Array(t)}function SS(e){let t=[],a={queue:0,queuedBits:0},r=o=>{t.push(o)};return e.forEach(o=>yS(o,a,r)),yS(null,a,r),t.join("")}function CS(e){return Math.round(Date.now()/1e3)+e}function LS(){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 ca=()=>typeof window<"u"&&typeof document<"u",Jo={tested:!1,writable:!1},vc=()=>{if(!ca())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Jo.tested)return Jo.writable;let e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),Jo.tested=!0,Jo.writable=!0}catch{Jo.tested=!0,Jo.writable=!1}return Jo.writable};function IS(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 wc=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...a)=>Promise.resolve().then(()=>(Xr(),jo)).then(({default:r})=>r(...a)):t=fetch,(...a)=>t(...a)},bS=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",Yo=async(e,t,a)=>{await e.setItem(t,JSON.stringify(a))},Jr=async(e,t)=>{let a=await e.getItem(t);if(!a)return null;try{return JSON.parse(a)}catch{return a}},lr=async(e,t)=>{await e.removeItem(t)},Vl=class e{constructor(){this.promise=new e.promiseConstructor((t,a)=>{this.resolve=t,this.reject=a})}};Vl.promiseConstructor=Promise;function Sc(e){let t=e.split(".");if(t.length!==3)throw new Qo("Invalid JWT structure");for(let r=0;r<t.length;r++)if(!cS.test(t[r]))throw new Qo("JWT not in base64url format");return{header:JSON.parse(lg(t[0])),payload:JSON.parse(lg(t[1])),signature:vS(t[2]),raw:{header:t[0],payload:t[1]}}}async function kS(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function PS(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 N1(e){return("0"+e.toString(16)).substr(-2)}function O1(){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,N1).join("")}async function F1(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 B1(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 F1(e);return btoa(a).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Zo(e,t,a=!1){let r=O1(),o=r;a&&(o+="/PASSWORD_RECOVERY"),await Yo(e,`${t}-code-verifier`,o);let n=await B1(r);return[n,r===n?"plain":"s256"]}var U1=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function TS(e){let t=e.headers.get(Ol);if(!t||!t.match(U1))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function AS(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 RS(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 V1=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function en(e){if(!V1.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Cc(){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 ug(e){return JSON.parse(JSON.stringify(e))}var j1=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},tn=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),q1=[502,503,504];async function _S(e){var t;if(!bS(e))throw new xs(tn(e),0);if(q1.includes(e.status))throw new xs(tn(e),e.status);let a;try{a=await e.json()}catch(n){throw new ys(tn(n),n)}let r,o=TS(e);if(o&&o.getTime()>=ig["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 Ul(tn(a),e.status,((t=a.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(r==="session_not_found")throw new da}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 Ul(tn(a),e.status,a.weak_password.reasons);throw new gc(tn(a),e.status||500,r)}var H1=(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 te(e,t,a,r){var o;let n=Object.assign({},r?.headers);n[Ol]||(n[Ol]=ig["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 z1(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 z1(e,t,a,r,o,n){let s=H1(t,r,o,n),i;try{i=await e(a,Object.assign({},s))}catch(l){throw console.error(l),new xs(tn(l),0)}if(i.ok||await _S(i),r?.noResolveJson)return i;try{return await i.json()}catch(l){await _S(l)}}function Fa(e){var t;let a=null;$1(e)&&(a=Object.assign({},e),e.expires_at||(a.expires_at=CS(e.expires_in)));let r=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:a,user:r},error:null}}function dg(e){let t=Fa(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 Ba(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function ES(e){return{data:e,error:null}}function DS(e){let{action_link:t,email_otp:a,hashed_token:r,redirect_to:o,verification_type:n}=e,s=j1(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 MS(e){return e}function $1(e){return e.access_token&&e.refresh_token&&e.expires_in}var Lc=["global","local","others"];var W1=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},an=class{constructor({url:t="",headers:a={},fetch:r}){this.url=t,this.headers=a,this.fetch=wc(r),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}async signOut(t,a=Lc[0]){if(Lc.indexOf(a)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Lc.join(", ")}`);try{return await te(this.fetch,"POST",`${this.url}/logout?scope=${a}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(r){if(Q(r))return{data:null,error:r};throw r}}async inviteUserByEmail(t,a={}){try{return await te(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:a.data},headers:this.headers,redirectTo:a.redirectTo,xform:Ba})}catch(r){if(Q(r))return{data:{user:null},error:r};throw r}}async generateLink(t){try{let{options:a}=t,r=W1(t,["options"]),o=Object.assign(Object.assign({},r),a);return"newEmail"in r&&(o.new_email=r?.newEmail,delete o.newEmail),await te(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:o,headers:this.headers,xform:DS,redirectTo:a?.redirectTo})}catch(a){if(Q(a))return{data:{properties:null,user:null},error:a};throw a}}async createUser(t){try{return await te(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:Ba})}catch(a){if(Q(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 te(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:MS});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,g=(l=(i=d.headers.get("link"))===null||i===void 0?void 0:i.split(","))!==null&&l!==void 0?l:[];return g.length>0&&(g.forEach(x=>{let w=parseInt(x.split(";")[0].split("=")[1].substring(0,1)),L=JSON.parse(x.split(";")[1].split("=")[1]);u[`${L}Page`]=w}),u.total=parseInt(f)),{data:Object.assign(Object.assign({},c),u),error:null}}catch(u){if(Q(u))return{data:{users:[]},error:u};throw u}}async getUserById(t){en(t);try{return await te(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:Ba})}catch(a){if(Q(a))return{data:{user:null},error:a};throw a}}async updateUserById(t,a){en(t);try{return await te(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:a,headers:this.headers,xform:Ba})}catch(r){if(Q(r))return{data:{user:null},error:r};throw r}}async deleteUser(t,a=!1){en(t);try{return await te(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:a},xform:Ba})}catch(r){if(Q(r))return{data:{user:null},error:r};throw r}}async _listFactors(t){en(t.userId);try{let{data:a,error:r}=await te(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(Q(a))return{data:null,error:a};throw a}}async _deleteFactor(t){en(t.userId),en(t.id);try{return{data:await te(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(a){if(Q(a))return{data:null,error:a};throw a}}};function cg(e={}){return{getItem:t=>e[t]||null,setItem:(t,a)=>{e[t]=a},removeItem:t=>{delete e[t]}}}function NS(){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 rn={debug:!!(globalThis&&vc()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")},jl=class extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}},Ic=class extends jl{};async function fg(e,t,a){rn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);let r=new globalThis.AbortController;return t>0&&setTimeout(()=>{r.abort(),rn.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){rn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,o.name);try{return await a()}finally{rn.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,o.name)}}else{if(t===0)throw rn.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new Ic(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(rn.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()}}))}NS();var G1={url:lS,storageKey:uS,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:dS,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1};async function OS(e,t,a){return await a()}var vs={},on=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&&ca()&&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({},G1),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 an({url:o.url,headers:o.headers,fetch:o.fetch}),this.url=o.url,this.headers=o.headers,this.fetch=wc(o.fetch),this.lock=o.lock||OS,this.detectSessionInUrl=o.detectSessionInUrl,this.flowType=o.flowType,this.hasCustomAuthorizationHeader=o.hasCustomAuthorizationHeader,o.lock?this.lock=o.lock:ca()&&(!((a=globalThis?.navigator)===null||a===void 0)&&a.locks)?this.lock=fg:this.lock=OS,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:vc()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=cg(this.memoryStorage)),o.userStorage&&(this.userStorage=o.userStorage)):(this.memoryStorage={},this.storage=cg(this.memoryStorage)),ca()&&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=vs[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&a!==void 0?a:{keys:[]}}set jwks(t){vs[this.storageKey]=Object.assign(Object.assign({},vs[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,a;return(a=(t=vs[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&a!==void 0?a:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){vs[this.storageKey]=Object.assign(Object.assign({},vs[this.storageKey]),{cachedAt:t})}_debug(...t){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${pc}) ${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=IS(window.location.href),r="none";if(this._isImplicitGrantCallback(a)?r="implicit":await this._isPKCECallback(a)&&(r="pkce"),ca()&&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),hS(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 Q(a)?{error:a}:{error:new ys("Unexpected error during initialization",a)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var a,r,o;try{let n=await te(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:Fa}),{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(Q(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,g=null,x=null;this.flowType==="pkce"&&([g,x]=await Zo(this.storage,this.storageKey)),n=await te(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:g,code_challenge_method:x},xform:Fa})}else if("phone"in t){let{phone:d,password:c,options:f}=t;n=await te(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:Fa})}else throw new Ko("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(Q(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 te(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:dg})}else if("phone"in t){let{phone:n,password:s,options:i}=t;a=await te(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:dg})}else throw new Ko("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 Go}:(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(Q(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,g;let x,w;if("message"in t)x=t.message,w=t.signature;else{let{chain:L,wallet:y,statement:h,options:m}=t,C;if(ca())if(typeof y=="object")C=y;else{let P=window;if("solana"in P&&typeof P.solana=="object"&&("signIn"in P.solana&&typeof P.solana.signIn=="function"||"signMessage"in P.solana&&typeof P.solana.signMessage=="function"))C=P.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof y!="object"||!m?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");C=y}let I=new URL((a=m?.url)!==null&&a!==void 0?a:window.location.href);if("signIn"in C&&C.signIn){let P=await C.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},m?.signInWithSolana),{version:"1",domain:I.host,uri:I.href}),h?{statement:h}:null)),R;if(Array.isArray(P)&&P[0]&&typeof P[0]=="object")R=P[0];else if(P&&typeof P=="object"&&"signedMessage"in P&&"signature"in P)R=P;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in R&&"signature"in R&&(typeof R.signedMessage=="string"||R.signedMessage instanceof Uint8Array)&&R.signature instanceof Uint8Array)x=typeof R.signedMessage=="string"?R.signedMessage:new TextDecoder().decode(R.signedMessage),w=R.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in C)||typeof C.signMessage!="function"||!("publicKey"in C)||typeof C!="object"||!C.publicKey||!("toBase58"in C.publicKey)||typeof C.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");x=[`${I.host} wants you to sign in with your Solana account:`,C.publicKey.toBase58(),...h?["",h,""]:[""],"Version: 1",`URI: ${I.href}`,`Issued At: ${(o=(r=m?.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&o!==void 0?o:new Date().toISOString()}`,...!((n=m?.signInWithSolana)===null||n===void 0)&&n.notBefore?[`Not Before: ${m.signInWithSolana.notBefore}`]:[],...!((s=m?.signInWithSolana)===null||s===void 0)&&s.expirationTime?[`Expiration Time: ${m.signInWithSolana.expirationTime}`]:[],...!((i=m?.signInWithSolana)===null||i===void 0)&&i.chainId?[`Chain ID: ${m.signInWithSolana.chainId}`]:[],...!((l=m?.signInWithSolana)===null||l===void 0)&&l.nonce?[`Nonce: ${m.signInWithSolana.nonce}`]:[],...!((u=m?.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${m.signInWithSolana.requestId}`]:[],...!((c=(d=m?.signInWithSolana)===null||d===void 0?void 0:d.resources)===null||c===void 0)&&c.length?["Resources",...m.signInWithSolana.resources.map(R=>`- ${R}`)]:[]].join(`
|
|
15
|
-
`);let P=await C.signMessage(new TextEncoder().encode(x),"utf8");if(!P||!(P instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");w=P}}try{let{data:L,error:y}=await te(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:x,signature:SS(w)},!((f=t.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(g=t.options)===null||g===void 0?void 0:g.captchaToken}}:null),xform:Fa});if(y)throw y;return!L||!L.session||!L.user?{data:{user:null,session:null},error:new Go}:(L.session&&(await this._saveSession(L.session),await this._notifyAllSubscribers("SIGNED_IN",L.session)),{data:Object.assign({},L),error:y})}catch(L){if(Q(L))return{data:{user:null,session:null},error:L};throw L}}async _exchangeCodeForSession(t){let a=await Jr(this.storage,`${this.storageKey}-code-verifier`),[r,o]=(a??"").split("/");try{let{data:n,error:s}=await te(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:r},xform:Fa});if(await lr(this.storage,`${this.storageKey}-code-verifier`),s)throw s;return!n||!n.session||!n.user?{data:{user:null,session:null,redirectType:null},error:new Go}:(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(Q(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 te(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:Fa}),{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 Go}:(l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),{data:l,error:u})}catch(a){if(Q(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 Zo(this.storage,this.storageKey));let{error:c}=await te(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 te(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 Ko("You must provide either an email or phone number.")}catch(i){if(Q(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 te(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:n}}),redirectTo:o,xform:Fa});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(Q(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 Zo(this.storage,this.storageKey)),await te(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:ES})}catch(n){if(Q(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 da;let{error:o}=await te(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:a.access_token});return{data:{user:null,session:null},error:o}})}catch(t){if(Q(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 te(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 te(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 Ko("You must provide either an email or phone number and a type")}catch(a){if(Q(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 Jr(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()<hc:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",t.expires_at),!r){if(this.userStorage){let s=await Jr(this.userStorage,this.storageKey+"-user");s?.user?t.user=s.user:t.user=Cc()}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 te(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:Ba}):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 da}:await te(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:Ba})})}catch(a){if(Q(a))return mS(a)&&(await this._removeSession(),await lr(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 da;let s=o.session,i=null,l=null;this.flowType==="pkce"&&t.email!=null&&([i,l]=await Zo(this.storage,this.storageKey));let{data:u,error:d}=await te(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:Ba});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(Q(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 da;let a=Date.now()/1e3,r=a,o=!0,n=null,{payload:s}=Sc(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(Q(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 da;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(Q(a))return{data:{user:null,session:null},error:a};throw a}}async _getSessionFromURL(t,a){try{if(!ca())throw new Xo("No browser detected.");if(t.error||t.error_description||t.error_code)throw new Xo(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 Bl("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Xo("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 Bl("No code detected.");let{data:h,error:m}=await this._exchangeCodeForSession(t.code);if(m)throw m;let C=new URL(window.location.href);return C.searchParams.delete("code"),window.history.replaceState(window.history.state,"",C.toString()),{data:{session:h.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 Xo("No session defined in URL");let d=Math.round(Date.now()/1e3),c=parseInt(i),f=d+c;l&&(f=parseInt(l));let g=f-d;g*1e3<=Wo&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${g}s, should have been closer to ${c}s`);let x=f-c;d-x>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",x,f,d):d-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,d);let{data:w,error:L}=await this._getUser(n);if(L)throw L;let y={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:y,redirectType:t.type},error:null}}catch(r){if(Q(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 Jr(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&&!(pS(i)&&(i.status===404||i.status===401||i.status===403)))return{error:i}}return t!=="others"&&(await this._removeSession(),await lr(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(t){let a=LS(),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 Zo(this.storage,this.storageKey,!0));try{return await te(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(Q(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(Q(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 g=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 te(this.fetch,"GET",g,{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 ca()&&!(!((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(Q(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 te(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(Q(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 PS(async o=>(o>0&&await kS(200*Math.pow(2,o-1)),this._debug(a,"refreshing attempt",o),await te(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:Fa})),(o,n)=>{let s=200*Math.pow(2,o);return n&&yc(n)&&Date.now()+s-r<Wo})}catch(r){if(this._debug(a,"error",r),Q(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),ca()&&!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 Jr(this.storage,this.storageKey);if(o&&this.userStorage){let s=await Jr(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!s&&(s={user:o.user},await Yo(this.userStorage,this.storageKey+"-user",s)),o.user=(t=s?.user)!==null&&t!==void 0?t:Cc()}else if(o&&!o.user&&!o.user){let s=await Jr(this.storage,this.storageKey+"-user");s&&s?.user?(o.user=s.user,await lr(this.storage,this.storageKey+"-user"),await Yo(this.storage,this.storageKey,o)):o.user=Cc()}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()<hc;if(this._debug(r,`session has${n?"":" not"} expired with margin of ${hc}s`),n){if(this.autoRefreshToken&&o.refresh_token){let{error:s}=await this._callRefreshToken(o.refresh_token);s&&(console.error(s),yc(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 da;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let o=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(o,"begin");try{this.refreshingDeferred=new Vl;let{data:n,error:s}=await this._refreshAccessToken(t);if(s)throw s;if(!n.session)throw new da;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),Q(n)){let s={session:null,error:n};return yc(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 Yo(this.userStorage,this.storageKey+"-user",{user:a.user});let o=Object.assign({},a);delete o.user;let n=ug(o);await Yo(this.storage,this.storageKey,n)}else{let o=ug(a);await Yo(this.storage,this.storageKey,o)}}async _removeSession(){this._debug("#_removeSession()"),await lr(this.storage,this.storageKey),await lr(this.storage,this.storageKey+"-code-verifier"),await lr(this.storage,this.storageKey+"-user"),this.userStorage&&await lr(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");let t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&ca()&&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(),Wo);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)/Wo);this._debug("#_autoRefreshTokenTick()",`access token expires in ${o} ticks, a tick lasts ${Wo}ms, refresh threshold is ${mc} ticks`),o<=mc&&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 jl)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!ca()||!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 Zo(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 te(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(Q(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 te(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(Q(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 te(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(Q(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 te(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(Q(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}=Sc(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+fS>o)return r;let{data:n,error:s}=await te(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:g,error:x}=await this.getSession();if(x||!g.session)return{data:null,error:x};r=g.session.access_token}let{header:o,payload:n,signature:s,raw:{header:i,payload:l}}=Sc(r);a?.allowExpired||AS(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:g}=await this.getUser(r);if(g)throw g;return{data:{claims:n,header:o,signature:s},error:null}}let d=RS(o.alg),c=await crypto.subtle.importKey("jwk",u,d,!0,["verify"]);if(!await crypto.subtle.verify(d,c,s,wS(`${i}.${l}`)))throw new Qo("Invalid JWT signature");return{data:{claims:n,header:o,signature:s},error:null}}catch(r){if(Q(r))return{data:null,error:r};throw r}}};on.nextInstanceID=0;var K1=on,pg=K1;var bc=class extends pg{constructor(t){super(t)}};var X1=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())})},ql=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=sS(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:aS,realtime:oS,auth:Object.assign(Object.assign({},rS),{storageKey:u}),global:tS},c=iS(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,g)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(g)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((s=c.auth)!==null&&s!==void 0?s:{},this.headers,c.global.fetch),this.fetch=nS(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 Uw(new URL("rest/v1",l).href,{headers:this.headers,schema:c.db.schema,fetch:this.fetch}),this.storage=new Ml(this.storageUrl.href,this.headers,this.fetch,r?.storage),c.accessToken||this._listenForAuthEvents()}get functions(){return new Cl(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 X1(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 bc({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 ps(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 FS=(e,t,a)=>new ql(e,t,a);function Q1(){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}Q1()&&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 BS(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=BS(e[t]))&&(r&&(r+=" "),r+=a)}else for(a in e)e[a]&&(r&&(r+=" "),r+=a);return r}function kc(){for(var e,t,a=0,r="",o=arguments.length;a<o;a++)(e=arguments[a])&&(t=BS(e))&&(r&&(r+=" "),r+=t);return r}var J1=e=>{let t=Z1(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{let i=s.split("-");return i[0]===""&&i.length!==1&&i.shift(),jS(i,t)||Y1(s)},getConflictingClassGroupIds:(s,i)=>{let l=a[s]||[];return i&&r[s]?[...l,...r[s]]:l}}},jS=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],r=t.nextPart.get(a),o=r?jS(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},US=/^\[(.+)\]$/,Y1=e=>{if(US.test(e)){let t=US.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},Z1=e=>{let{theme:t,prefix:a}=e,r={nextPart:new Map,validators:[]};return tA(Object.entries(e.classGroups),a).forEach(([n,s])=>{hg(s,r,n,t)}),r},hg=(e,t,a,r)=>{e.forEach(o=>{if(typeof o=="string"){let n=o===""?t:VS(t,o);n.classGroupId=a;return}if(typeof o=="function"){if(eA(o)){hg(o(r),t,a,r);return}t.validators.push({validator:o,classGroupId:a});return}Object.entries(o).forEach(([n,s])=>{hg(s,VS(t,n),a,r)})})},VS=(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},eA=e=>e.isThemeGetter,tA=(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,aA=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 rA=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 L=0;L<i.length;L++){let y=i[L];if(u===0){if(y===o&&(r||i.slice(L,L+n)===t)){l.push(i.slice(d,L)),d=L+n;continue}if(y==="/"){c=L;continue}}y==="["?u++:y==="]"&&u--}let f=l.length===0?i:i.substring(d),g=f.startsWith("!"),x=g?f.substring(1):f,w=c&&c>d?c-d:void 0;return{modifiers:l,hasImportantModifier:g,baseClassName:x,maybePostfixModifierPosition:w}};return a?i=>a({className:i,parseClassName:s}):s},oA=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},nA=e=>({cache:aA(e.cacheSize),parseClassName:rA(e),...J1(e)}),sA=/\s+/,iA=(e,t)=>{let{parseClassName:a,getClassGroupId:r,getConflictingClassGroupIds:o}=t,n=[],s=e.trim().split(sA),i="";for(let l=s.length-1;l>=0;l-=1){let u=s[l],{modifiers:d,hasImportantModifier:c,baseClassName:f,maybePostfixModifierPosition:g}=a(u),x=!!g,w=r(x?f.substring(0,g):f);if(!w){if(!x){i=u+(i.length>0?" "+i:i);continue}if(w=r(f),!w){i=u+(i.length>0?" "+i:i);continue}x=!1}let L=oA(d).join(":"),y=c?L+"!":L,h=y+w;if(n.includes(h))continue;n.push(h);let m=o(w,x);for(let C=0;C<m.length;++C){let I=m[C];n.push(y+I)}i=u+(i.length>0?" "+i:i)}return i};function lA(){let e=0,t,a,r="";for(;e<arguments.length;)(t=arguments[e++])&&(a=qS(t))&&(r&&(r+=" "),r+=a);return r}var qS=e=>{if(typeof e=="string")return e;let t,a="";for(let r=0;r<e.length;r++)e[r]&&(t=qS(e[r]))&&(a&&(a+=" "),a+=t);return a};function uA(e,...t){let a,r,o,n=s;function s(l){let u=t.reduce((d,c)=>c(d),e());return a=nA(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=iA(l,a);return o(l,d),d}return function(){return n(lA.apply(null,arguments))}}var ke=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},HS=/^\[(?:([a-z-]+):)?(.+)\]$/i,dA=/^\d+\/\d+$/,cA=new Set(["px","full","screen"]),fA=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,pA=/\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$/,mA=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,hA=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,gA=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ur=e=>ws(e)||cA.has(e)||dA.test(e),Yr=e=>Ss(e,"length",IA),ws=e=>!!e&&!Number.isNaN(Number(e)),mg=e=>Ss(e,"number",ws),Hl=e=>!!e&&Number.isInteger(Number(e)),yA=e=>e.endsWith("%")&&ws(e.slice(0,-1)),Z=e=>HS.test(e),Zr=e=>fA.test(e),xA=new Set(["length","size","percentage"]),vA=e=>Ss(e,xA,zS),wA=e=>Ss(e,"position",zS),SA=new Set(["image","url"]),CA=e=>Ss(e,SA,kA),LA=e=>Ss(e,"",bA),zl=()=>!0,Ss=(e,t,a)=>{let r=HS.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):a(r[2]):!1},IA=e=>pA.test(e)&&!mA.test(e),zS=()=>!1,bA=e=>hA.test(e),kA=e=>gA.test(e);var PA=()=>{let e=ke("colors"),t=ke("spacing"),a=ke("blur"),r=ke("brightness"),o=ke("borderColor"),n=ke("borderRadius"),s=ke("borderSpacing"),i=ke("borderWidth"),l=ke("contrast"),u=ke("grayscale"),d=ke("hueRotate"),c=ke("invert"),f=ke("gap"),g=ke("gradientColorStops"),x=ke("gradientColorStopPositions"),w=ke("inset"),L=ke("margin"),y=ke("opacity"),h=ke("padding"),m=ke("saturate"),C=ke("scale"),I=ke("sepia"),P=ke("skew"),R=ke("space"),A=ke("translate"),q=()=>["auto","contain","none"],B=()=>["auto","hidden","clip","visible","scroll"],J=()=>["auto",Z,t],ue=()=>[Z,t],pt=()=>["",ur,Yr],Xa=()=>["auto",ws,Z],So=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Ke=()=>["solid","dashed","dotted","double","none"],xe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ze=()=>["start","end","center","between","around","evenly","stretch"],Ht=()=>["","0",Z],ma=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Xe=()=>[ws,Z];return{cacheSize:500,separator:":",theme:{colors:[zl],spacing:[ur,Yr],blur:["none","",Zr,Z],brightness:Xe(),borderColor:[e],borderRadius:["none","","full",Zr,Z],borderSpacing:ue(),borderWidth:pt(),contrast:Xe(),grayscale:Ht(),hueRotate:Xe(),invert:Ht(),gap:ue(),gradientColorStops:[e],gradientColorStopPositions:[yA,Yr],inset:J(),margin:J(),opacity:Xe(),padding:ue(),saturate:Xe(),scale:Xe(),sepia:Ht(),skew:Xe(),space:ue(),translate:ue()},classGroups:{aspect:[{aspect:["auto","square","video",Z]}],container:["container"],columns:[{columns:[Zr]}],"break-after":[{"break-after":ma()}],"break-before":[{"break-before":ma()}],"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:[...So(),Z]}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:q()}],"overscroll-x":[{"overscroll-x":q()}],"overscroll-y":[{"overscroll-y":q()}],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",Hl,Z]}],basis:[{basis:J()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Z]}],grow:[{grow:Ht()}],shrink:[{shrink:Ht()}],order:[{order:["first","last","none",Hl,Z]}],"grid-cols":[{"grid-cols":[zl]}],"col-start-end":[{col:["auto",{span:["full",Hl,Z]},Z]}],"col-start":[{"col-start":Xa()}],"col-end":[{"col-end":Xa()}],"grid-rows":[{"grid-rows":[zl]}],"row-start-end":[{row:["auto",{span:[Hl,Z]},Z]}],"row-start":[{"row-start":Xa()}],"row-end":[{"row-end":Xa()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Z]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Z]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...ze()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ze(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ze(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[h]}],px:[{px:[h]}],py:[{py:[h]}],ps:[{ps:[h]}],pe:[{pe:[h]}],pt:[{pt:[h]}],pr:[{pr:[h]}],pb:[{pb:[h]}],pl:[{pl:[h]}],m:[{m:[L]}],mx:[{mx:[L]}],my:[{my:[L]}],ms:[{ms:[L]}],me:[{me:[L]}],mt:[{mt:[L]}],mr:[{mr:[L]}],mb:[{mb:[L]}],ml:[{ml:[L]}],"space-x":[{"space-x":[R]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[R]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Z,t]}],"min-w":[{"min-w":[Z,t,"min","max","fit"]}],"max-w":[{"max-w":[Z,t,"none","full","min","max","fit","prose",{screen:[Zr]},Zr]}],h:[{h:[Z,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Z,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Z,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Z,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Zr,Yr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",mg]}],"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",Z]}],"line-clamp":[{"line-clamp":["none",ws,mg]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ur,Z]}],"list-image":[{"list-image":["none",Z]}],"list-style-type":[{list:["none","disc","decimal",Z]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ke(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ur,Yr]}],"underline-offset":[{"underline-offset":["auto",ur,Z]}],"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",Z]}],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",Z]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...So(),wA]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",vA]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},CA]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],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":[y]}],"border-style":[{border:[...Ke(),"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":[y]}],"divide-style":[{divide:Ke()}],"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:["",...Ke()]}],"outline-offset":[{"outline-offset":[ur,Z]}],"outline-w":[{outline:[ur,Yr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:pt()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[ur,Yr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Zr,LA]}],"shadow-color":[{shadow:[zl]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...xe(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":xe()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Zr,Z]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[c]}],saturate:[{saturate:[m]}],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":[y]}],"backdrop-saturate":[{"backdrop-saturate":[m]}],"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",Z]}],duration:[{duration:Xe()}],ease:[{ease:["linear","in","out","in-out",Z]}],delay:[{delay:Xe()}],animate:[{animate:["none","spin","ping","pulse","bounce",Z]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[Hl,Z]}],"translate-x":[{"translate-x":[A]}],"translate-y":[{"translate-y":[A]}],"skew-x":[{"skew-x":[P]}],"skew-y":[{"skew-y":[P]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Z]}],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",Z]}],"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",Z]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ur,Yr,mg]}],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 $S=uA(PA);function Jt(...e){return $S(kc(e))}var XS=M(le(),1);function De({className:e,type:t,...a}){return(0,XS.jsx)("input",{type:t,"data-slot":"input",className:Jt("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 qe=M(G(),1);var JS=M(G(),1);function QS(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function $l(...e){return t=>{let a=!1,r=e.map(o=>{let n=QS(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():QS(e[o],null)}}}}function dr(...e){return JS.useCallback($l(...e),e)}var Tc=M(le(),1),MA=Symbol.for("react.lazy"),Ac=qe[" use ".trim().toString()];function NA(e){return typeof e=="object"&&e!==null&&"then"in e}function YS(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===MA&&"_payload"in e&&NA(e._payload)}function OA(e){let t=FA(e),a=qe.forwardRef((r,o)=>{let{children:n,...s}=r;YS(n)&&typeof Ac=="function"&&(n=Ac(n._payload));let i=qe.Children.toArray(n),l=i.find(UA);if(l){let u=l.props.children,d=i.map(c=>c===l?qe.Children.count(u)>1?qe.Children.only(null):qe.isValidElement(u)?u.props.children:null:c);return(0,Tc.jsx)(t,{...s,ref:o,children:qe.isValidElement(u)?qe.cloneElement(u,void 0,d):null})}return(0,Tc.jsx)(t,{...s,ref:o,children:n})});return a.displayName=`${e}.Slot`,a}var ZS=OA("Slot");function FA(e){let t=qe.forwardRef((a,r)=>{let{children:o,...n}=a;if(YS(o)&&typeof Ac=="function"&&(o=Ac(o._payload)),qe.isValidElement(o)){let s=jA(o),i=VA(n,o.props);return o.type!==qe.Fragment&&(i.ref=r?$l(r,s):s),qe.cloneElement(o,i)}return qe.Children.count(o)>1?qe.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var BA=Symbol("radix.slottable");function UA(e){return qe.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===BA}function VA(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 jA(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 eC=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,tC=kc,aC=(e,t)=>a=>{var r;if(t?.variants==null)return tC(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=eC(d)||eC(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,...g}=d;return Object.entries(g).every(x=>{let[w,L]=x;return Array.isArray(L)?L.includes({...n,...i}[w]):{...n,...i}[w]===L})?[...u,c,f]:u},[]);return tC(e,s,l,a?.class,a?.className)};var rC=M(le(),1),qA=aC("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 ut({className:e,variant:t,size:a,asChild:r=!1,...o}){return(0,rC.jsx)(r?ZS:"button",{"data-slot":"button",className:Jt(qA({variant:t,size:a,className:e})),...o})}var AC=M(G(),1);var $=M(G(),1);var nC=M(G(),1),KA=M(Vh(),1);var Ge=M(G(),1);var Rc=M(le(),1);function oC(e){let t=HA(e),a=Ge.forwardRef((r,o)=>{let{children:n,...s}=r,i=Ge.Children.toArray(n),l=i.find($A);if(l){let u=l.props.children,d=i.map(c=>c===l?Ge.Children.count(u)>1?Ge.Children.only(null):Ge.isValidElement(u)?u.props.children:null:c);return(0,Rc.jsx)(t,{...s,ref:o,children:Ge.isValidElement(u)?Ge.cloneElement(u,void 0,d):null})}return(0,Rc.jsx)(t,{...s,ref:o,children:n})});return a.displayName=`${e}.Slot`,a}function HA(e){let t=Ge.forwardRef((a,r)=>{let{children:o,...n}=a;if(Ge.isValidElement(o)){let s=GA(o),i=WA(n,o.props);return o.type!==Ge.Fragment&&(i.ref=r?$l(r,s):s),Ge.cloneElement(o,i)}return Ge.Children.count(o)>1?Ge.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var zA=Symbol("radix.slottable");function $A(e){return Ge.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===zA}function WA(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 GA(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 sC=M(le(),1),XA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Cs=XA.reduce((e,t)=>{let a=oC(`Primitive.${t}`),r=nC.forwardRef((o,n)=>{let{asChild:s,...i}=o,l=s?a:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),(0,sC.jsx)(l,{...i,ref:n})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});var Ot=M(G(),1);var iC=M(G(),1),Wl=globalThis?.document?iC.useLayoutEffect:()=>{};var lC=M(G(),1);function QA(e,t){return lC.useReducer((a,r)=>t[a][r]??a,e)}var Ls=e=>{let{present:t,children:a}=e,r=JA(t),o=typeof a=="function"?a({present:r.isPresent}):Ot.Children.only(a),n=dr(r.ref,YA(o));return typeof a=="function"||r.isPresent?Ot.cloneElement(o,{ref:n}):null};Ls.displayName="Presence";function JA(e){let[t,a]=Ot.useState(),r=Ot.useRef(null),o=Ot.useRef(e),n=Ot.useRef("none"),s=e?"mounted":"unmounted",[i,l]=QA(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return Ot.useEffect(()=>{let u=_c(r.current);n.current=i==="mounted"?u:"none"},[i]),Wl(()=>{let u=r.current,d=o.current;if(d!==e){let f=n.current,g=_c(u);e?l("MOUNT"):g==="none"||u?.display==="none"?l("UNMOUNT"):l(d&&f!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Wl(()=>{if(t){let u,d=t.ownerDocument.defaultView??window,c=g=>{let w=_c(r.current).includes(CSS.escape(g.animationName));if(g.target===t&&w&&(l("ANIMATION_END"),!o.current)){let L=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=L)})}},f=g=>{g.target===t&&(n.current=_c(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:Ot.useCallback(u=>{r.current=u?getComputedStyle(u):null,a(u)},[])}}function _c(e){return e?.animationName||"none"}function YA(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 cr=M(G(),1),uC=M(le(),1);function dC(e,t=[]){let a=[];function r(n,s){let i=cr.createContext(s),l=a.length;a=[...a,s];let u=c=>{let{scope:f,children:g,...x}=c,w=f?.[e]?.[l]||i,L=cr.useMemo(()=>x,Object.values(x));return(0,uC.jsx)(w.Provider,{value:L,children:g})};u.displayName=n+"Provider";function d(c,f){let g=f?.[e]?.[l]||i,x=cr.useContext(g);if(x)return x;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=>cr.createContext(s));return function(i){let l=i?.[e]||n;return cr.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return o.scopeName=e,[r,ZA(o,...t)]}function ZA(...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 cr.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return a.scopeName=t.scopeName,a}var Is=M(G(),1);function eo(e){let t=Is.useRef(e);return Is.useEffect(()=>{t.current=e}),Is.useMemo(()=>(...a)=>t.current?.(...a),[])}var Ec=M(G(),1),eR=M(le(),1),tR=Ec.createContext(void 0);function cC(e){let t=Ec.useContext(tR);return e||t||"ltr"}function fC(e,[t,a]){return Math.min(a,Math.max(t,e))}var eO=!!(typeof window<"u"&&window.document&&window.document.createElement);function to(e,t,{checkForDefaultPrevented:a=!0}={}){return function(o){if(e?.(o),a===!1||!o.defaultPrevented)return t?.(o)}}var mC=M(G(),1),fe=M(le(),1);function aR(e,t){return mC.useReducer((a,r)=>t[a][r]??a,e)}var gg="ScrollArea",[hC,cO]=dC(gg),[rR,fa]=hC(gg),gC=$.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),[g,x]=$.useState(null),[w,L]=$.useState(null),[y,h]=$.useState(0),[m,C]=$.useState(0),[I,P]=$.useState(!1),[R,A]=$.useState(!1),q=dr(t,J=>l(J)),B=cC(o);return(0,fe.jsx)(rR,{scope:a,type:r,dir:B,scrollHideDelay:n,scrollArea:i,viewport:u,onViewportChange:d,content:c,onContentChange:f,scrollbarX:g,onScrollbarXChange:x,scrollbarXEnabled:I,onScrollbarXEnabledChange:P,scrollbarY:w,onScrollbarYChange:L,scrollbarYEnabled:R,onScrollbarYEnabledChange:A,onCornerWidthChange:h,onCornerHeightChange:C,children:(0,fe.jsx)(Cs.div,{dir:B,...s,ref:q,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":m+"px",...e.style}})})});gC.displayName=gg;var yC="ScrollAreaViewport",xC=$.forwardRef((e,t)=>{let{__scopeScrollArea:a,children:r,nonce:o,...n}=e,s=fa(yC,a),i=$.useRef(null),l=dr(t,i,s.onViewportChange);return(0,fe.jsxs)(fe.Fragment,{children:[(0,fe.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,fe.jsx)(Cs.div,{"data-radix-scroll-area-viewport":"",...n,ref:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:(0,fe.jsx)("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});xC.displayName=yC;var Ua="ScrollAreaScrollbar",yg=$.forwardRef((e,t)=>{let{forceMount:a,...r}=e,o=fa(Ua,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,fe.jsx)(oR,{...r,ref:t,forceMount:a}):o.type==="scroll"?(0,fe.jsx)(nR,{...r,ref:t,forceMount:a}):o.type==="auto"?(0,fe.jsx)(vC,{...r,ref:t,forceMount:a}):o.type==="always"?(0,fe.jsx)(xg,{...r,ref:t}):null});yg.displayName=Ua;var oR=$.forwardRef((e,t)=>{let{forceMount:a,...r}=e,o=fa(Ua,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,fe.jsx)(Ls,{present:a||n,children:(0,fe.jsx)(vC,{"data-state":n?"visible":"hidden",...r,ref:t})})}),nR=$.forwardRef((e,t)=>{let{forceMount:a,...r}=e,o=fa(Ua,e.__scopeScrollArea),n=e.orientation==="horizontal",s=Oc(()=>l("SCROLL_END"),100),[i,l]=aR("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 g=u[d];c!==g&&(l("SCROLL"),s()),c=g};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[o.viewport,n,l,s]),(0,fe.jsx)(Ls,{present:a||i!=="hidden",children:(0,fe.jsx)(xg,{"data-state":i==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:to(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:to(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),vC=$.forwardRef((e,t)=>{let a=fa(Ua,e.__scopeScrollArea),{forceMount:r,...o}=e,[n,s]=$.useState(!1),i=e.orientation==="horizontal",l=Oc(()=>{if(a.viewport){let u=a.viewport.offsetWidth<a.viewport.scrollWidth,d=a.viewport.offsetHeight<a.viewport.scrollHeight;s(i?u:d)}},10);return bs(a.viewport,l),bs(a.content,l),(0,fe.jsx)(Ls,{present:r||n,children:(0,fe.jsx)(xg,{"data-state":n?"visible":"hidden",...o,ref:t})})}),xg=$.forwardRef((e,t)=>{let{orientation:a="vertical",...r}=e,o=fa(Ua,e.__scopeScrollArea),n=$.useRef(null),s=$.useRef(0),[i,l]=$.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=LC(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,g){return cR(f,s.current,i,g)}return a==="horizontal"?(0,fe.jsx)(sR,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&n.current){let f=o.viewport.scrollLeft,g=pC(f,i,o.dir);n.current.style.transform=`translate3d(${g}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,fe.jsx)(iR,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&n.current){let f=o.viewport.scrollTop,g=pC(f,i);n.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollTop=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollTop=c(f))}}):null}),sR=$.forwardRef((e,t)=>{let{sizes:a,onSizesChange:r,...o}=e,n=fa(Ua,e.__scopeScrollArea),[s,i]=$.useState(),l=$.useRef(null),u=dr(t,l,n.onScrollbarXChange);return $.useEffect(()=>{l.current&&i(getComputedStyle(l.current))},[l]),(0,fe.jsx)(SC,{"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":Nc(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),bC(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:Mc(s.paddingLeft),paddingEnd:Mc(s.paddingRight)}})}})}),iR=$.forwardRef((e,t)=>{let{sizes:a,onSizesChange:r,...o}=e,n=fa(Ua,e.__scopeScrollArea),[s,i]=$.useState(),l=$.useRef(null),u=dr(t,l,n.onScrollbarYChange);return $.useEffect(()=>{l.current&&i(getComputedStyle(l.current))},[l]),(0,fe.jsx)(SC,{"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":Nc(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),bC(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:Mc(s.paddingTop),paddingEnd:Mc(s.paddingBottom)}})}})}),[lR,wC]=hC(Ua),SC=$.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,g=fa(Ua,a),[x,w]=$.useState(null),L=dr(t,q=>w(q)),y=$.useRef(null),h=$.useRef(""),m=g.viewport,C=r.content-r.viewport,I=eo(d),P=eo(l),R=Oc(c,10);function A(q){if(y.current){let B=q.clientX-y.current.left,J=q.clientY-y.current.top;u({x:B,y:J})}}return $.useEffect(()=>{let q=B=>{let J=B.target;x?.contains(J)&&I(B,C)};return document.addEventListener("wheel",q,{passive:!1}),()=>document.removeEventListener("wheel",q,{passive:!1})},[m,x,C,I]),$.useEffect(P,[r,P]),bs(x,R),bs(g.content,R),(0,fe.jsx)(lR,{scope:a,scrollbar:x,hasThumb:o,onThumbChange:eo(n),onThumbPointerUp:eo(s),onThumbPositionChange:P,onThumbPointerDown:eo(i),children:(0,fe.jsx)(Cs.div,{...f,ref:L,style:{position:"absolute",...f.style},onPointerDown:to(e.onPointerDown,q=>{q.button===0&&(q.target.setPointerCapture(q.pointerId),y.current=x.getBoundingClientRect(),h.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),A(q))}),onPointerMove:to(e.onPointerMove,A),onPointerUp:to(e.onPointerUp,q=>{let B=q.target;B.hasPointerCapture(q.pointerId)&&B.releasePointerCapture(q.pointerId),document.body.style.webkitUserSelect=h.current,g.viewport&&(g.viewport.style.scrollBehavior=""),y.current=null})})})}),Dc="ScrollAreaThumb",vg=$.forwardRef((e,t)=>{let{forceMount:a,...r}=e,o=wC(Dc,e.__scopeScrollArea);return(0,fe.jsx)(Ls,{present:a||o.hasThumb,children:(0,fe.jsx)(uR,{ref:t,...r})})}),uR=$.forwardRef((e,t)=>{let{__scopeScrollArea:a,style:r,...o}=e,n=fa(Dc,a),s=wC(Dc,a),{onThumbPositionChange:i}=s,l=dr(t,c=>s.onThumbChange(c)),u=$.useRef(void 0),d=Oc(()=>{u.current&&(u.current(),u.current=void 0)},100);return $.useEffect(()=>{let c=n.viewport;if(c){let f=()=>{if(d(),!u.current){let g=fR(c,i);u.current=g,i()}};return i(),c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)}},[n.viewport,d,i]),(0,fe.jsx)(Cs.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:to(e.onPointerDownCapture,c=>{let g=c.target.getBoundingClientRect(),x=c.clientX-g.left,w=c.clientY-g.top;s.onThumbPointerDown({x,y:w})}),onPointerUp:to(e.onPointerUp,s.onThumbPointerUp)})});vg.displayName=Dc;var wg="ScrollAreaCorner",CC=$.forwardRef((e,t)=>{let a=fa(wg,e.__scopeScrollArea),r=!!(a.scrollbarX&&a.scrollbarY);return a.type!=="scroll"&&r?(0,fe.jsx)(dR,{...e,ref:t}):null});CC.displayName=wg;var dR=$.forwardRef((e,t)=>{let{__scopeScrollArea:a,...r}=e,o=fa(wg,a),[n,s]=$.useState(0),[i,l]=$.useState(0),u=!!(n&&i);return bs(o.scrollbarX,()=>{let d=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(d),l(d)}),bs(o.scrollbarY,()=>{let d=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(d),s(d)}),u?(0,fe.jsx)(Cs.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 Mc(e){return e?parseInt(e,10):0}function LC(e,t){let a=e/t;return isNaN(a)?0:a}function Nc(e){let t=LC(e.viewport,e.content),a=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-a)*t;return Math.max(r,18)}function cR(e,t,a,r="ltr"){let o=Nc(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 IC([l,u],c)(e)}function pC(e,t,a="ltr"){let r=Nc(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=fC(e,l);return IC([0,s],[0,i])(u)}function IC(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 bC(e,t){return e>0&&e<t}var fR=(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 Oc(e,t){let a=eo(e),r=$.useRef(0);return $.useEffect(()=>()=>window.clearTimeout(r.current),[]),$.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(a,t)},[a,t])}function bs(e,t){let a=eo(t);Wl(()=>{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 kC=gC,PC=xC;var TC=CC;var ao=M(le(),1),Sg=AC.forwardRef(({className:e,children:t,...a},r)=>(0,ao.jsxs)(kC,{"data-slot":"scroll-area",className:Jt("relative",e),...a,children:[(0,ao.jsx)(PC,{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,ao.jsx)(mR,{}),(0,ao.jsx)(TC,{})]}));Sg.displayName="ScrollArea";function mR({className:e,orientation:t="vertical",...a}){return(0,ao.jsx)(yg,{"data-slot":"scroll-area-scrollbar",orientation:t,className:Jt("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,ao.jsx)(vg,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}var Bc=M(G());var RC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),hR=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,r)=>r?r.toUpperCase():a.toLowerCase()),Cg=e=>{let t=hR(e);return t.charAt(0).toUpperCase()+t.slice(1)},Fc=(...e)=>e.filter((t,a,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===a).join(" ").trim(),_C=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var Gl=M(G());var EC={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 DC=(0,Gl.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:r,className:o="",children:n,iconNode:s,...i},l)=>(0,Gl.createElement)("svg",{ref:l,...EC,width:t,height:t,stroke:e,strokeWidth:r?Number(a)*24/Number(t):a,className:Fc("lucide",o),...!n&&!_C(i)&&{"aria-hidden":"true"},...i},[...s.map(([u,d])=>(0,Gl.createElement)(u,d)),...Array.isArray(n)?n:[n]]));var V=(e,t)=>{let a=(0,Bc.forwardRef)(({className:r,...o},n)=>(0,Bc.createElement)(DC,{ref:n,iconNode:t,className:Fc(`lucide-${RC(Cg(e))}`,`lucide-${e}`,r),...o}));return a.displayName=Cg(e),a};var gR=[["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"}]],Kl=V("activity",gR);var yR=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],ks=V("arrow-left",yR);var xR=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Xl=V("arrow-up",xR);var vR=[["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"}]],Ql=V("calendar",vR);var wR=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Jl=V("chevron-down",wR);var SR=[["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"}]],ba=V("circle-alert",SR);var CR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],at=V("circle-check",CR);var LR=[["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"}]],ka=V("circle-x",LR);var IR=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],nn=V("clock",IR);var bR=[["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"}]],fr=V("command",bR);var kR=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],pr=V("corner-down-left",kR);var PR=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],sn=V("credit-card",PR);var TR=[["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"}]],ln=V("crown",TR);var AR=[["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"}]],un=V("dollar-sign",AR);var RR=[["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"}]],Ps=V("file-spreadsheet",RR);var _R=[["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"}]],Ts=V("key",_R);var ER=[["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"}]],Yl=V("laptop",ER);var DR=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ft=V("loader-circle",DR);var MR=[["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"}]],As=V("mail",MR);var NR=[["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"}]],Rs=V("map-pin",NR);var OR=[["path",{d:"M5 12h14",key:"1ays0h"}]],dn=V("minus",OR);var FR=[["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"}]],Zl=V("paperclip",FR);var BR=[["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",BR);var UR=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],cn=V("search",UR);var VR=[["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"}]],Es=V("shield",VR);var jR=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],eu=V("smartphone",jR);var qR=[["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"}]],pa=V("sparkles",qR);var HR=[["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"}]],Bt=V("square-pen",HR);var zR=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],tu=V("trending-up",zR);var $R=[["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"}]],Ds=V("users",$R);var WR=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ro=V("x",WR);var GR=[["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"}]],au=V("zap",GR);var Oe=M(le(),1);function MC({phase:e,progressSteps:t=[]}){return(0,Oe.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,Oe.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Oe.jsx)(Ft,{className:"h-3.5 w-3.5 animate-spin"}),(0,Oe.jsx)("span",{children:"Thinking\u2026"})]}),e==="searching"&&(0,Oe.jsxs)("div",{className:"space-y-2 animate-in fade-in-0 duration-300",children:[(0,Oe.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Oe.jsx)(cn,{className:"h-3.5 w-3.5 opacity-70"}),(0,Oe.jsx)("span",{children:"Searching across pages\u2026"})]}),(0,Oe.jsxs)("ul",{className:"ml-6 list-disc space-y-1",children:[(0,Oe.jsx)("li",{className:"opacity-90",children:"Checking recent changes"}),(0,Oe.jsx)("li",{className:"opacity-90",children:"Scanning documentation"}),(0,Oe.jsx)("li",{className:"opacity-90",children:"Summarizing relevant sections"})]})]}),(e==="thinking"||e==="executing"||e==="responding")&&t.length>0&&(0,Oe.jsxs)("div",{className:"space-y-2 animate-in fade-in-0 duration-200",children:[t.map((a,r)=>(0,Oe.jsxs)("div",{className:`flex items-center gap-2 transition-opacity duration-200 ${a.completed?"opacity-60":"opacity-100"}`,children:[a.completed?(0,Oe.jsx)(at,{className:"h-3.5 w-3.5 text-green-500 flex-shrink-0"}):(0,Oe.jsx)(Ft,{className:"h-3.5 w-3.5 animate-spin flex-shrink-0"}),(0,Oe.jsx)("span",{className:a.completed?"line-through":"",children:a.message})]},r)),e==="responding"&&(0,Oe.jsxs)("div",{className:"flex items-center gap-2 opacity-100 animate-in fade-in-0 duration-200",children:[(0,Oe.jsx)(Ft,{className:"h-3.5 w-3.5 animate-spin flex-shrink-0"}),(0,Oe.jsx)("span",{children:"Preparing response..."})]})]})]})}var NC=M(G(),1);var Pa=M(le(),1);function OC({title:e,links:t}){let[a,r]=NC.useState(!1);return(0,Pa.jsxs)("div",{className:"text-xs text-muted-foreground",children:[(0,Pa.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,Pa.jsxs)("div",{className:"flex items-center gap-1.5",children:[a?(0,Pa.jsx)(Jl,{className:"h-3 w-3 opacity-70"}):(0,Pa.jsx)(cn,{className:"h-3 w-3 opacity-70"}),(0,Pa.jsx)("span",{children:e})]})}),a&&t.length>0&&(0,Pa.jsx)("ul",{className:"ml-5 mt-1 space-y-0.5",children:t.map(o=>(0,Pa.jsx)("li",{children:(0,Pa.jsx)("a",{href:o.href,target:"_blank",rel:"noreferrer",className:"text-primary hover:underline",children:o.label})},o.href))})]})}var ou=M(le(),1),Va=M(G(),1);var FC=M(G(),1),Ms=(0,FC.createContext)({});var BC=M(G(),1);function Ns(e){let t=(0,BC.useRef)(null);return t.current===null&&(t.current=e()),t.current}var Ig=M(le(),1),HC=M(G(),1),fn=M(G(),1);var UC=M(G(),1),oo=(0,UC.createContext)(null);var jC=M(le(),1),Uc=M(G(),1),mr=M(G(),1);var VC=M(G(),1),Os=(0,VC.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});var Lg=class extends Uc.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 qC({children:e,isPresent:t}){let a=(0,mr.useId)(),r=(0,mr.useRef)(null),o=(0,mr.useRef)({width:0,height:0,top:0,left:0}),{nonce:n}=(0,mr.useContext)(Os);return(0,mr.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(`
|
|
13
|
+
});`,ms=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=dc,this.heartbeatIntervalMs=25e3,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=Qw,this.ref=0,this.logger=Qw,this.conn=null,this.sendBuffer=[],this.serializer=new Rl,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(()=>(Jr(),qo)).then(({default:l})=>l(...i)):s=fetch,(...i)=>s(...i)},this.endPoint=`${t}/${uc.websocket}`,this.httpEndpoint=cc(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 zo(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=Hw),!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:Gw}))}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 cs.connecting:return Yr.Connecting;case cs.open:return Yr.Open;case cs.closing:return Yr.Closing;default:return Yr.Closed}}isConnected(){return this.connectionState()===Yr.Open}channel(t,a={config:{}}){let r=`realtime:${t}`,o=this.getChannels().find(n=>n.topic===r);if(o)return o;{let n=new ps(`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:Ww};a&&r.updateJoinPayload(o),r.joinedOnce&&r._isJoined()&&r._push(Qt.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(Kw,"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(Qt.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([b1],{type:"application/javascript"});a=URL.createObjectURL(r)}return a}};var hs=class extends Error{constructor(t){super(t),this.__isStorageError=!0,this.name="StorageError"}};function ze(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var fc=class extends hs{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}}},$o=class extends hs{constructor(t,a){super(t),this.name="StorageUnknownError",this.originalError=a}};var k1=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())})},mc=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...a)=>Promise.resolve().then(()=>(Jr(),qo)).then(({default:r})=>r(...a)):t=fetch,(...a)=>t(...a)},Jw=()=>k1(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield Promise.resolve().then(()=>(Jr(),qo))).Response:Response}),pc=e=>{if(Array.isArray(e))return e.map(a=>pc(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]=pc(r)}),t},Yw=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 Wo=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())})},ug=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),P1=(e,t,a)=>Wo(void 0,void 0,void 0,function*(){let r=yield Jw();e instanceof r&&!a?.noResolveJson?e.json().then(o=>{let n=e.status||500,s=o?.statusCode||n+"";t(new fc(ug(o),n,s))}).catch(o=>{t(new $o(ug(o),o))}):t(new $o(ug(e),e))}),T1=(e,t,a,r)=>{let o={method:e,headers:t?.headers||{}};return e==="GET"||!r?o:(Yw(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 _l(e,t,a,r,o,n){return Wo(this,void 0,void 0,function*(){return new Promise((s,i)=>{e(a,T1(t,r,o,n)).then(l=>{if(!l.ok)throw l;return r?.noResolveJson?l:l.json()}).then(l=>s(l)).catch(l=>P1(l,i,r))})})}function gs(e,t,a,r){return Wo(this,void 0,void 0,function*(){return _l(e,"GET",t,a,r)})}function Ia(e,t,a,r,o){return Wo(this,void 0,void 0,function*(){return _l(e,"POST",t,r,o,a)})}function El(e,t,a,r,o){return Wo(this,void 0,void 0,function*(){return _l(e,"PUT",t,r,o,a)})}function Zw(e,t,a,r){return Wo(this,void 0,void 0,function*(){return _l(e,"HEAD",t,Object.assign(Object.assign({},a),{noResolveJson:!0}),r)})}function hc(e,t,a,r,o){return Wo(this,void 0,void 0,function*(){return _l(e,"DELETE",t,r,o,a)})}var Ot=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())})},A1={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},eC={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1},Dl=class{constructor(t,a={},r,o){this.url=t,this.headers=a,this.bucketId=r,this.fetch=mc(o)}uploadOrUpdate(t,a,r,o){return Ot(this,void 0,void 0,function*(){try{let n,s=Object.assign(Object.assign({},eC),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"?El:Ia)(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(ze(n))return{data:null,error:n};throw n}})}upload(t,a,r){return Ot(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",t,a,r)})}uploadToSignedUrl(t,a,r,o){return Ot(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:eC.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 El(this.fetch,i.toString(),l,{headers:d});return{data:{path:n,fullPath:c.Key},error:null}}catch(l){if(ze(l))return{data:null,error:l};throw l}})}createSignedUploadUrl(t,a){return Ot(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 Ia(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 hs("No token returned by API");return{data:{signedUrl:s.toString(),path:t,token:i},error:null}}catch(r){if(ze(r))return{data:null,error:r};throw r}})}update(t,a,r){return Ot(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",t,a,r)})}move(t,a,r){return Ot(this,void 0,void 0,function*(){try{return{data:yield Ia(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:t,destinationKey:a,destinationBucket:r?.destinationBucket},{headers:this.headers}),error:null}}catch(o){if(ze(o))return{data:null,error:o};throw o}})}copy(t,a,r){return Ot(this,void 0,void 0,function*(){try{return{data:{path:(yield Ia(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(ze(o))return{data:null,error:o};throw o}})}createSignedUrl(t,a,r){return Ot(this,void 0,void 0,function*(){try{let o=this._getFinalPath(t),n=yield Ia(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(ze(o))return{data:null,error:o};throw o}})}createSignedUrls(t,a,r){return Ot(this,void 0,void 0,function*(){try{let o=yield Ia(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(ze(o))return{data:null,error:o};throw o}})}download(t,a){return Ot(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 gs(this.fetch,`${this.url}/${o}/${i}${s}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(i){if(ze(i))return{data:null,error:i};throw i}})}info(t){return Ot(this,void 0,void 0,function*(){let a=this._getFinalPath(t);try{let r=yield gs(this.fetch,`${this.url}/object/info/${a}`,{headers:this.headers});return{data:pc(r),error:null}}catch(r){if(ze(r))return{data:null,error:r};throw r}})}exists(t){return Ot(this,void 0,void 0,function*(){let a=this._getFinalPath(t);try{return yield Zw(this.fetch,`${this.url}/object/${a}`,{headers:this.headers}),{data:!0,error:null}}catch(r){if(ze(r)&&r instanceof $o){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 Ot(this,void 0,void 0,function*(){try{return{data:yield hc(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:t},{headers:this.headers}),error:null}}catch(a){if(ze(a))return{data:null,error:a};throw a}})}list(t,a,r){return Ot(this,void 0,void 0,function*(){try{let o=Object.assign(Object.assign(Object.assign({},A1),a),{prefix:t||""});return{data:yield Ia(this.fetch,`${this.url}/object/list/${this.bucketId}`,o,{headers:this.headers},r),error:null}}catch(o){if(ze(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 tC="2.10.4";var aC={"X-Client-Info":`storage-js/${tC}`};var ys=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,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({},aC),a),this.fetch=mc(r)}listBuckets(){return ys(this,void 0,void 0,function*(){try{return{data:yield gs(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(t){if(ze(t))return{data:null,error:t};throw t}})}getBucket(t){return ys(this,void 0,void 0,function*(){try{return{data:yield gs(this.fetch,`${this.url}/bucket/${t}`,{headers:this.headers}),error:null}}catch(a){if(ze(a))return{data:null,error:a};throw a}})}createBucket(t,a={public:!1}){return ys(this,void 0,void 0,function*(){try{return{data:yield Ia(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(ze(r))return{data:null,error:r};throw r}})}updateBucket(t,a){return ys(this,void 0,void 0,function*(){try{return{data:yield El(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(ze(r))return{data:null,error:r};throw r}})}emptyBucket(t){return ys(this,void 0,void 0,function*(){try{return{data:yield Ia(this.fetch,`${this.url}/bucket/${t}/empty`,{},{headers:this.headers}),error:null}}catch(a){if(ze(a))return{data:null,error:a};throw a}})}deleteBucket(t){return ys(this,void 0,void 0,function*(){try{return{data:yield hc(this.fetch,`${this.url}/bucket/${t}`,{},{headers:this.headers}),error:null}}catch(a){if(ze(a))return{data:null,error:a};throw a}})}};var Nl=class extends Ml{constructor(t,a={},r,o){super(t,a,r,o)}from(t){return new Dl(this.url,this.headers,t,this.fetch)}};var rC="2.53.0";var Ol="";typeof Deno<"u"?Ol="deno":typeof document<"u"?Ol="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Ol="react-native":Ol="node";var R1={"X-Client-Info":`supabase-js-${Ol}/${rC}`},oC={headers:R1},nC={schema:"public"},sC={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},iC={};Jr();var _1=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())})},E1=e=>{let t;return e?t=e:typeof fetch>"u"?t=$h:t=fetch,(...a)=>t(...a)},D1=()=>typeof Headers>"u"?Wh:Headers,lC=(e,t,a)=>{let r=E1(a),o=D1();return(n,s)=>_1(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 M1=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 uC(e){return e.endsWith("/")?e:e+"/"}function dC(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:()=>M1(this,void 0,void 0,function*(){return""})};return e.accessToken?f.accessToken=e.accessToken:delete f.accessToken,f}var gc="2.71.1";var Go=30*1e3,yc=3,xc=yc*Go,cC="http://localhost:9999",fC="supabase.auth.token";var pC={"X-Client-Info":`gotrue-js/${gc}`};var Fl="X-Supabase-Api-Version",dg={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},mC=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,hC=600*1e3;var Bl=class extends Error{constructor(t,a,r){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=a,this.code=r}};function Q(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}var vc=class extends Bl{constructor(t,a,r){super(t,a,r),this.name="AuthApiError",this.status=a,this.code=r}};function gC(e){return Q(e)&&e.name==="AuthApiError"}var xs=class extends Bl{constructor(t,a){super(t),this.name="AuthUnknownError",this.originalError=a}},Fa=class extends Bl{constructor(t,a,r,o){super(t,r,o),this.name=a,this.status=r}},fa=class extends Fa{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}};function yC(e){return Q(e)&&e.name==="AuthSessionMissingError"}var Ko=class extends Fa{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}},Xo=class extends Fa{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}},Qo=class extends Fa{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 xC(e){return Q(e)&&e.name==="AuthImplicitGrantRedirectError"}var Ul=class extends Fa{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}}},vs=class extends Fa{constructor(t,a){super(t,"AuthRetryableFetchError",a,void 0)}};function wc(e){return Q(e)&&e.name==="AuthRetryableFetchError"}var Vl=class extends Fa{constructor(t,a,r){super(t,"AuthWeakPasswordError",a,"weak_password"),this.reasons=r}};var Jo=class extends Fa{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}};var Cc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),vC=`
|
|
14
|
+
\r=`.split(""),N1=(()=>{let e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<vC.length;t+=1)e[vC[t].charCodeAt(0)]=-2;for(let t=0;t<Cc.length;t+=1)e[Cc[t].charCodeAt(0)]=t;return e})();function wC(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(Cc[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(Cc[r]),t.queuedBits-=6}}function CC(e,t,a){let r=N1[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 cg(e){let t=[],a=s=>{t.push(String.fromCodePoint(s))},r={utf8seq:0,codepoint:0},o={queue:0,queuedBits:0},n=s=>{B1(s,r,a)};for(let s=0;s<e.length;s+=1)CC(e.charCodeAt(s),o,n);return t.join("")}function O1(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 F1(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}O1(r,t)}}function B1(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 SC(e){let t=[],a={queue:0,queuedBits:0},r=o=>{t.push(o)};for(let o=0;o<e.length;o+=1)CC(e.charCodeAt(o),a,r);return new Uint8Array(t)}function LC(e){let t=[];return F1(e,a=>t.push(a)),new Uint8Array(t)}function IC(e){let t=[],a={queue:0,queuedBits:0},r=o=>{t.push(o)};return e.forEach(o=>wC(o,a,r)),wC(null,a,r),t.join("")}function bC(e){return Math.round(Date.now()/1e3)+e}function kC(){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 pa=()=>typeof window<"u"&&typeof document<"u",Yo={tested:!1,writable:!1},Sc=()=>{if(!pa())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Yo.tested)return Yo.writable;let e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),Yo.tested=!0,Yo.writable=!0}catch{Yo.tested=!0,Yo.writable=!1}return Yo.writable};function PC(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 Lc=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...a)=>Promise.resolve().then(()=>(Jr(),qo)).then(({default:r})=>r(...a)):t=fetch,(...a)=>t(...a)},TC=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",Zo=async(e,t,a)=>{await e.setItem(t,JSON.stringify(a))},Zr=async(e,t)=>{let a=await e.getItem(t);if(!a)return null;try{return JSON.parse(a)}catch{return a}},lr=async(e,t)=>{await e.removeItem(t)},jl=class e{constructor(){this.promise=new e.promiseConstructor((t,a)=>{this.resolve=t,this.reject=a})}};jl.promiseConstructor=Promise;function Ic(e){let t=e.split(".");if(t.length!==3)throw new Jo("Invalid JWT structure");for(let r=0;r<t.length;r++)if(!mC.test(t[r]))throw new Jo("JWT not in base64url format");return{header:JSON.parse(cg(t[0])),payload:JSON.parse(cg(t[1])),signature:SC(t[2]),raw:{header:t[0],payload:t[1]}}}async function AC(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function RC(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 U1(e){return("0"+e.toString(16)).substr(-2)}function V1(){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,U1).join("")}async function j1(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 q1(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 j1(e);return btoa(a).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function en(e,t,a=!1){let r=V1(),o=r;a&&(o+="/PASSWORD_RECOVERY"),await Zo(e,`${t}-code-verifier`,o);let n=await q1(r);return[n,r===n?"plain":"s256"]}var z1=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function _C(e){let t=e.headers.get(Fl);if(!t||!t.match(z1))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function EC(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 DC(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 H1=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function tn(e){if(!H1.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 fg(e){return JSON.parse(JSON.stringify(e))}var $1=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},an=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),W1=[502,503,504];async function MC(e){var t;if(!TC(e))throw new vs(an(e),0);if(W1.includes(e.status))throw new vs(an(e),e.status);let a;try{a=await e.json()}catch(n){throw new xs(an(n),n)}let r,o=_C(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 Vl(an(a),e.status,((t=a.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(r==="session_not_found")throw new fa}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 Vl(an(a),e.status,a.weak_password.reasons);throw new vc(an(a),e.status||500,r)}var G1=(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 ee(e,t,a,r){var o;let n=Object.assign({},r?.headers);n[Fl]||(n[Fl]=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 K1(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 K1(e,t,a,r,o,n){let s=G1(t,r,o,n),i;try{i=await e(a,Object.assign({},s))}catch(l){throw console.error(l),new vs(an(l),0)}if(i.ok||await MC(i),r?.noResolveJson)return i;try{return await i.json()}catch(l){await MC(l)}}function Ba(e){var t;let a=null;X1(e)&&(a=Object.assign({},e),e.expires_at||(a.expires_at=bC(e.expires_in)));let r=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:a,user:r},error:null}}function pg(e){let t=Ba(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 Ua(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function NC(e){return{data:e,error:null}}function OC(e){let{action_link:t,email_otp:a,hashed_token:r,redirect_to:o,verification_type:n}=e,s=$1(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 FC(e){return e}function X1(e){return e.access_token&&e.refresh_token&&e.expires_in}var kc=["global","local","others"];var Q1=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},rn=class{constructor({url:t="",headers:a={},fetch:r}){this.url=t,this.headers=a,this.fetch=Lc(r),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}async signOut(t,a=kc[0]){if(kc.indexOf(a)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${kc.join(", ")}`);try{return await ee(this.fetch,"POST",`${this.url}/logout?scope=${a}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(r){if(Q(r))return{data:null,error:r};throw r}}async inviteUserByEmail(t,a={}){try{return await ee(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:a.data},headers:this.headers,redirectTo:a.redirectTo,xform:Ua})}catch(r){if(Q(r))return{data:{user:null},error:r};throw r}}async generateLink(t){try{let{options:a}=t,r=Q1(t,["options"]),o=Object.assign(Object.assign({},r),a);return"newEmail"in r&&(o.new_email=r?.newEmail,delete o.newEmail),await ee(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:o,headers:this.headers,xform:OC,redirectTo:a?.redirectTo})}catch(a){if(Q(a))return{data:{properties:null,user:null},error:a};throw a}}async createUser(t){try{return await ee(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:Ua})}catch(a){if(Q(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 ee(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:FC});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,g=(l=(i=d.headers.get("link"))===null||i===void 0?void 0:i.split(","))!==null&&l!==void 0?l:[];return g.length>0&&(g.forEach(x=>{let w=parseInt(x.split(";")[0].split("=")[1].substring(0,1)),L=JSON.parse(x.split(";")[1].split("=")[1]);u[`${L}Page`]=w}),u.total=parseInt(f)),{data:Object.assign(Object.assign({},c),u),error:null}}catch(u){if(Q(u))return{data:{users:[]},error:u};throw u}}async getUserById(t){tn(t);try{return await ee(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:Ua})}catch(a){if(Q(a))return{data:{user:null},error:a};throw a}}async updateUserById(t,a){tn(t);try{return await ee(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:a,headers:this.headers,xform:Ua})}catch(r){if(Q(r))return{data:{user:null},error:r};throw r}}async deleteUser(t,a=!1){tn(t);try{return await ee(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:a},xform:Ua})}catch(r){if(Q(r))return{data:{user:null},error:r};throw r}}async _listFactors(t){tn(t.userId);try{let{data:a,error:r}=await ee(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(Q(a))return{data:null,error:a};throw a}}async _deleteFactor(t){tn(t.userId),tn(t.id);try{return{data:await ee(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(a){if(Q(a))return{data:null,error:a};throw a}}};function mg(e={}){return{getItem:t=>e[t]||null,setItem:(t,a)=>{e[t]=a},removeItem:t=>{delete e[t]}}}function BC(){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 on={debug:!!(globalThis&&Sc()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")},ql=class extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}},Pc=class extends ql{};async function hg(e,t,a){on.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);let r=new globalThis.AbortController;return t>0&&setTimeout(()=>{r.abort(),on.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){on.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,o.name);try{return await a()}finally{on.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,o.name)}}else{if(t===0)throw on.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new Pc(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(on.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()}}))}BC();var J1={url:cC,storageKey:fC,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:pC,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1};async function UC(e,t,a){return await a()}var ws={},nn=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&&pa()&&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({},J1),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 rn({url:o.url,headers:o.headers,fetch:o.fetch}),this.url=o.url,this.headers=o.headers,this.fetch=Lc(o.fetch),this.lock=o.lock||UC,this.detectSessionInUrl=o.detectSessionInUrl,this.flowType=o.flowType,this.hasCustomAuthorizationHeader=o.hasCustomAuthorizationHeader,o.lock?this.lock=o.lock:pa()&&(!((a=globalThis?.navigator)===null||a===void 0)&&a.locks)?this.lock=hg:this.lock=UC,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:Sc()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=mg(this.memoryStorage)),o.userStorage&&(this.userStorage=o.userStorage)):(this.memoryStorage={},this.storage=mg(this.memoryStorage)),pa()&&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=ws[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&a!==void 0?a:{keys:[]}}set jwks(t){ws[this.storageKey]=Object.assign(Object.assign({},ws[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,a;return(a=(t=ws[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&a!==void 0?a:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){ws[this.storageKey]=Object.assign(Object.assign({},ws[this.storageKey]),{cachedAt:t})}_debug(...t){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${gc}) ${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=PC(window.location.href),r="none";if(this._isImplicitGrantCallback(a)?r="implicit":await this._isPKCECallback(a)&&(r="pkce"),pa()&&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),xC(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 Q(a)?{error:a}:{error:new xs("Unexpected error during initialization",a)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var a,r,o;try{let n=await ee(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:Ba}),{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(Q(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,g=null,x=null;this.flowType==="pkce"&&([g,x]=await en(this.storage,this.storageKey)),n=await ee(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:g,code_challenge_method:x},xform:Ba})}else if("phone"in t){let{phone:d,password:c,options:f}=t;n=await ee(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:Ba})}else throw new Xo("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(Q(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 ee(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:pg})}else if("phone"in t){let{phone:n,password:s,options:i}=t;a=await ee(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:pg})}else throw new Xo("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 Ko}:(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(Q(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,g;let x,w;if("message"in t)x=t.message,w=t.signature;else{let{chain:L,wallet:y,statement:h,options:m}=t,S;if(pa())if(typeof y=="object")S=y;else{let P=window;if("solana"in P&&typeof P.solana=="object"&&("signIn"in P.solana&&typeof P.solana.signIn=="function"||"signMessage"in P.solana&&typeof P.solana.signMessage=="function"))S=P.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof y!="object"||!m?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");S=y}let I=new URL((a=m?.url)!==null&&a!==void 0?a:window.location.href);if("signIn"in S&&S.signIn){let P=await S.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},m?.signInWithSolana),{version:"1",domain:I.host,uri:I.href}),h?{statement:h}:null)),R;if(Array.isArray(P)&&P[0]&&typeof P[0]=="object")R=P[0];else if(P&&typeof P=="object"&&"signedMessage"in P&&"signature"in P)R=P;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in R&&"signature"in R&&(typeof R.signedMessage=="string"||R.signedMessage instanceof Uint8Array)&&R.signature instanceof Uint8Array)x=typeof R.signedMessage=="string"?R.signedMessage:new TextDecoder().decode(R.signedMessage),w=R.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in S)||typeof S.signMessage!="function"||!("publicKey"in S)||typeof S!="object"||!S.publicKey||!("toBase58"in S.publicKey)||typeof S.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");x=[`${I.host} wants you to sign in with your Solana account:`,S.publicKey.toBase58(),...h?["",h,""]:[""],"Version: 1",`URI: ${I.href}`,`Issued At: ${(o=(r=m?.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&o!==void 0?o:new Date().toISOString()}`,...!((n=m?.signInWithSolana)===null||n===void 0)&&n.notBefore?[`Not Before: ${m.signInWithSolana.notBefore}`]:[],...!((s=m?.signInWithSolana)===null||s===void 0)&&s.expirationTime?[`Expiration Time: ${m.signInWithSolana.expirationTime}`]:[],...!((i=m?.signInWithSolana)===null||i===void 0)&&i.chainId?[`Chain ID: ${m.signInWithSolana.chainId}`]:[],...!((l=m?.signInWithSolana)===null||l===void 0)&&l.nonce?[`Nonce: ${m.signInWithSolana.nonce}`]:[],...!((u=m?.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${m.signInWithSolana.requestId}`]:[],...!((c=(d=m?.signInWithSolana)===null||d===void 0?void 0:d.resources)===null||c===void 0)&&c.length?["Resources",...m.signInWithSolana.resources.map(R=>`- ${R}`)]:[]].join(`
|
|
15
|
+
`);let P=await S.signMessage(new TextEncoder().encode(x),"utf8");if(!P||!(P instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");w=P}}try{let{data:L,error:y}=await ee(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:x,signature:IC(w)},!((f=t.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(g=t.options)===null||g===void 0?void 0:g.captchaToken}}:null),xform:Ba});if(y)throw y;return!L||!L.session||!L.user?{data:{user:null,session:null},error:new Ko}:(L.session&&(await this._saveSession(L.session),await this._notifyAllSubscribers("SIGNED_IN",L.session)),{data:Object.assign({},L),error:y})}catch(L){if(Q(L))return{data:{user:null,session:null},error:L};throw L}}async _exchangeCodeForSession(t){let a=await Zr(this.storage,`${this.storageKey}-code-verifier`),[r,o]=(a??"").split("/");try{let{data:n,error:s}=await ee(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:r},xform:Ba});if(await lr(this.storage,`${this.storageKey}-code-verifier`),s)throw s;return!n||!n.session||!n.user?{data:{user:null,session:null,redirectType:null},error:new Ko}:(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(Q(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 ee(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:Ba}),{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 Ko}:(l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),{data:l,error:u})}catch(a){if(Q(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 en(this.storage,this.storageKey));let{error:c}=await ee(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 ee(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 Xo("You must provide either an email or phone number.")}catch(i){if(Q(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 ee(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:n}}),redirectTo:o,xform:Ba});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(Q(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 en(this.storage,this.storageKey)),await ee(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(r=(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:NC})}catch(n){if(Q(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 fa;let{error:o}=await ee(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:a.access_token});return{data:{user:null,session:null},error:o}})}catch(t){if(Q(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 ee(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 ee(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 Xo("You must provide either an email or phone number and a type")}catch(a){if(Q(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 Zr(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()<xc:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",t.expires_at),!r){if(this.userStorage){let s=await Zr(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 ee(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:Ua}):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 fa}:await ee(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:Ua})})}catch(a){if(Q(a))return yC(a)&&(await this._removeSession(),await lr(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 fa;let s=o.session,i=null,l=null;this.flowType==="pkce"&&t.email!=null&&([i,l]=await en(this.storage,this.storageKey));let{data:u,error:d}=await ee(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:Ua});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(Q(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 fa;let a=Date.now()/1e3,r=a,o=!0,n=null,{payload:s}=Ic(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(Q(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 fa;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(Q(a))return{data:{user:null,session:null},error:a};throw a}}async _getSessionFromURL(t,a){try{if(!pa())throw new Qo("No browser detected.");if(t.error||t.error_description||t.error_code)throw new Qo(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 Ul("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Qo("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 Ul("No code detected.");let{data:h,error:m}=await this._exchangeCodeForSession(t.code);if(m)throw m;let S=new URL(window.location.href);return S.searchParams.delete("code"),window.history.replaceState(window.history.state,"",S.toString()),{data:{session:h.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 Qo("No session defined in URL");let d=Math.round(Date.now()/1e3),c=parseInt(i),f=d+c;l&&(f=parseInt(l));let g=f-d;g*1e3<=Go&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${g}s, should have been closer to ${c}s`);let x=f-c;d-x>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",x,f,d):d-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,d);let{data:w,error:L}=await this._getUser(n);if(L)throw L;let y={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:y,redirectType:t.type},error:null}}catch(r){if(Q(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 Zr(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&&!(gC(i)&&(i.status===404||i.status===401||i.status===403)))return{error:i}}return t!=="others"&&(await this._removeSession(),await lr(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(t){let a=kC(),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 en(this.storage,this.storageKey,!0));try{return await ee(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(Q(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(Q(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 g=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 ee(this.fetch,"GET",g,{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 pa()&&!(!((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(Q(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 ee(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(Q(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 RC(async o=>(o>0&&await AC(200*Math.pow(2,o-1)),this._debug(a,"refreshing attempt",o),await ee(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:Ba})),(o,n)=>{let s=200*Math.pow(2,o);return n&&wc(n)&&Date.now()+s-r<Go})}catch(r){if(this._debug(a,"error",r),Q(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),pa()&&!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 Zr(this.storage,this.storageKey);if(o&&this.userStorage){let s=await Zr(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!s&&(s={user:o.user},await Zo(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 Zr(this.storage,this.storageKey+"-user");s&&s?.user?(o.user=s.user,await lr(this.storage,this.storageKey+"-user"),await Zo(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()<xc;if(this._debug(r,`session has${n?"":" not"} expired with margin of ${xc}s`),n){if(this.autoRefreshToken&&o.refresh_token){let{error:s}=await this._callRefreshToken(o.refresh_token);s&&(console.error(s),wc(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 fa;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let o=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(o,"begin");try{this.refreshingDeferred=new jl;let{data:n,error:s}=await this._refreshAccessToken(t);if(s)throw s;if(!n.session)throw new fa;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),Q(n)){let s={session:null,error:n};return wc(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 Zo(this.userStorage,this.storageKey+"-user",{user:a.user});let o=Object.assign({},a);delete o.user;let n=fg(o);await Zo(this.storage,this.storageKey,n)}else{let o=fg(a);await Zo(this.storage,this.storageKey,o)}}async _removeSession(){this._debug("#_removeSession()"),await lr(this.storage,this.storageKey),await lr(this.storage,this.storageKey+"-code-verifier"),await lr(this.storage,this.storageKey+"-user"),this.userStorage&&await lr(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");let t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&pa()&&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(),Go);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)/Go);this._debug("#_autoRefreshTokenTick()",`access token expires in ${o} ticks, a tick lasts ${Go}ms, refresh threshold is ${yc} ticks`),o<=yc&&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 ql)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!pa()||!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 en(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 ee(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(Q(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 ee(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(Q(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 ee(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(Q(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 ee(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(Q(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}=Ic(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+hC>o)return r;let{data:n,error:s}=await ee(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:g,error:x}=await this.getSession();if(x||!g.session)return{data:null,error:x};r=g.session.access_token}let{header:o,payload:n,signature:s,raw:{header:i,payload:l}}=Ic(r);a?.allowExpired||EC(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:g}=await this.getUser(r);if(g)throw g;return{data:{claims:n,header:o,signature:s},error:null}}let d=DC(o.alg),c=await crypto.subtle.importKey("jwk",u,d,!0,["verify"]);if(!await crypto.subtle.verify(d,c,s,LC(`${i}.${l}`)))throw new Jo("Invalid JWT signature");return{data:{claims:n,header:o,signature:s},error:null}}catch(r){if(Q(r))return{data:null,error:r};throw r}}};nn.nextInstanceID=0;var Y1=nn,gg=Y1;var Tc=class extends gg{constructor(t){super(t)}};var Z1=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())})},zl=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=uC(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:nC,realtime:iC,auth:Object.assign(Object.assign({},sC),{storageKey:u}),global:oC},c=dC(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,g)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(g)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((s=c.auth)!==null&&s!==void 0?s:{},this.headers,c.global.fetch),this.fetch=lC(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 qw(new URL("rest/v1",l).href,{headers:this.headers,schema:c.db.schema,fetch:this.fetch}),this.storage=new Nl(this.storageUrl.href,this.headers,this.fetch,r?.storage),c.accessToken||this._listenForAuthEvents()}get functions(){return new Ll(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 Z1(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 Tc({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 ms(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 VC=(e,t,a)=>new zl(e,t,a);function eA(){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}eA()&&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 jC(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=jC(e[t]))&&(r&&(r+=" "),r+=a)}else for(a in e)e[a]&&(r&&(r+=" "),r+=a);return r}function Ac(){for(var e,t,a=0,r="",o=arguments.length;a<o;a++)(e=arguments[a])&&(t=jC(e))&&(r&&(r+=" "),r+=t);return r}var tA=e=>{let t=rA(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{let i=s.split("-");return i[0]===""&&i.length!==1&&i.shift(),HC(i,t)||aA(s)},getConflictingClassGroupIds:(s,i)=>{let l=a[s]||[];return i&&r[s]?[...l,...r[s]]:l}}},HC=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],r=t.nextPart.get(a),o=r?HC(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},qC=/^\[(.+)\]$/,aA=e=>{if(qC.test(e)){let t=qC.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},rA=e=>{let{theme:t,prefix:a}=e,r={nextPart:new Map,validators:[]};return nA(Object.entries(e.classGroups),a).forEach(([n,s])=>{xg(s,r,n,t)}),r},xg=(e,t,a,r)=>{e.forEach(o=>{if(typeof o=="string"){let n=o===""?t:zC(t,o);n.classGroupId=a;return}if(typeof o=="function"){if(oA(o)){xg(o(r),t,a,r);return}t.validators.push({validator:o,classGroupId:a});return}Object.entries(o).forEach(([n,s])=>{xg(s,zC(t,n),a,r)})})},zC=(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},oA=e=>e.isThemeGetter,nA=(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,sA=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 iA=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 L=0;L<i.length;L++){let y=i[L];if(u===0){if(y===o&&(r||i.slice(L,L+n)===t)){l.push(i.slice(d,L)),d=L+n;continue}if(y==="/"){c=L;continue}}y==="["?u++:y==="]"&&u--}let f=l.length===0?i:i.substring(d),g=f.startsWith("!"),x=g?f.substring(1):f,w=c&&c>d?c-d:void 0;return{modifiers:l,hasImportantModifier:g,baseClassName:x,maybePostfixModifierPosition:w}};return a?i=>a({className:i,parseClassName:s}):s},lA=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},uA=e=>({cache:sA(e.cacheSize),parseClassName:iA(e),...tA(e)}),dA=/\s+/,cA=(e,t)=>{let{parseClassName:a,getClassGroupId:r,getConflictingClassGroupIds:o}=t,n=[],s=e.trim().split(dA),i="";for(let l=s.length-1;l>=0;l-=1){let u=s[l],{modifiers:d,hasImportantModifier:c,baseClassName:f,maybePostfixModifierPosition:g}=a(u),x=!!g,w=r(x?f.substring(0,g):f);if(!w){if(!x){i=u+(i.length>0?" "+i:i);continue}if(w=r(f),!w){i=u+(i.length>0?" "+i:i);continue}x=!1}let L=lA(d).join(":"),y=c?L+"!":L,h=y+w;if(n.includes(h))continue;n.push(h);let m=o(w,x);for(let S=0;S<m.length;++S){let I=m[S];n.push(y+I)}i=u+(i.length>0?" "+i:i)}return i};function fA(){let e=0,t,a,r="";for(;e<arguments.length;)(t=arguments[e++])&&(a=$C(t))&&(r&&(r+=" "),r+=a);return r}var $C=e=>{if(typeof e=="string")return e;let t,a="";for(let r=0;r<e.length;r++)e[r]&&(t=$C(e[r]))&&(a&&(a+=" "),a+=t);return a};function pA(e,...t){let a,r,o,n=s;function s(l){let u=t.reduce((d,c)=>c(d),e());return a=uA(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=cA(l,a);return o(l,d),d}return function(){return n(fA.apply(null,arguments))}}var ke=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},WC=/^\[(?:([a-z-]+):)?(.+)\]$/i,mA=/^\d+\/\d+$/,hA=new Set(["px","full","screen"]),gA=/^(\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$/,xA=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,vA=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,wA=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ur=e=>Cs(e)||hA.has(e)||mA.test(e),eo=e=>Ss(e,"length",TA),Cs=e=>!!e&&!Number.isNaN(Number(e)),yg=e=>Ss(e,"number",Cs),Hl=e=>!!e&&Number.isInteger(Number(e)),CA=e=>e.endsWith("%")&&Cs(e.slice(0,-1)),Y=e=>WC.test(e),to=e=>gA.test(e),SA=new Set(["length","size","percentage"]),LA=e=>Ss(e,SA,GC),IA=e=>Ss(e,"position",GC),bA=new Set(["image","url"]),kA=e=>Ss(e,bA,RA),PA=e=>Ss(e,"",AA),$l=()=>!0,Ss=(e,t,a)=>{let r=WC.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):a(r[2]):!1},TA=e=>yA.test(e)&&!xA.test(e),GC=()=>!1,AA=e=>vA.test(e),RA=e=>wA.test(e);var _A=()=>{let e=ke("colors"),t=ke("spacing"),a=ke("blur"),r=ke("brightness"),o=ke("borderColor"),n=ke("borderRadius"),s=ke("borderSpacing"),i=ke("borderWidth"),l=ke("contrast"),u=ke("grayscale"),d=ke("hueRotate"),c=ke("invert"),f=ke("gap"),g=ke("gradientColorStops"),x=ke("gradientColorStopPositions"),w=ke("inset"),L=ke("margin"),y=ke("opacity"),h=ke("padding"),m=ke("saturate"),S=ke("scale"),I=ke("sepia"),P=ke("skew"),R=ke("space"),A=ke("translate"),V=()=>["auto","contain","none"],F=()=>["auto","hidden","clip","visible","scroll"],me=()=>["auto",Y,t],ae=()=>[Y,t],Be=()=>["",ur,eo],Aa=()=>["auto",Cs,Y],St=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],So=()=>["solid","dashed","dotted","double","none"],Me=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],xe=()=>["start","end","center","between","around","evenly","stretch"],ot=()=>["","0",Y],oa=()=>["auto","avoid","all","avoid-page","page","left","right","column"],zt=()=>[Cs,Y];return{cacheSize:500,separator:":",theme:{colors:[$l],spacing:[ur,eo],blur:["none","",to,Y],brightness:zt(),borderColor:[e],borderRadius:["none","","full",to,Y],borderSpacing:ae(),borderWidth:Be(),contrast:zt(),grayscale:ot(),hueRotate:zt(),invert:ot(),gap:ae(),gradientColorStops:[e],gradientColorStopPositions:[CA,eo],inset:me(),margin:me(),opacity:zt(),padding:ae(),saturate:zt(),scale:zt(),sepia:ot(),skew:zt(),space:ae(),translate:ae()},classGroups:{aspect:[{aspect:["auto","square","video",Y]}],container:["container"],columns:[{columns:[to]}],"break-after":[{"break-after":oa()}],"break-before":[{"break-before":oa()}],"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:[...St(),Y]}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],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",Hl,Y]}],basis:[{basis:me()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Y]}],grow:[{grow:ot()}],shrink:[{shrink:ot()}],order:[{order:["first","last","none",Hl,Y]}],"grid-cols":[{"grid-cols":[$l]}],"col-start-end":[{col:["auto",{span:["full",Hl,Y]},Y]}],"col-start":[{"col-start":Aa()}],"col-end":[{"col-end":Aa()}],"grid-rows":[{"grid-rows":[$l]}],"row-start-end":[{row:["auto",{span:[Hl,Y]},Y]}],"row-start":[{"row-start":Aa()}],"row-end":[{"row-end":Aa()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Y]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Y]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...xe()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...xe(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...xe(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[h]}],px:[{px:[h]}],py:[{py:[h]}],ps:[{ps:[h]}],pe:[{pe:[h]}],pt:[{pt:[h]}],pr:[{pr:[h]}],pb:[{pb:[h]}],pl:[{pl:[h]}],m:[{m:[L]}],mx:[{mx:[L]}],my:[{my:[L]}],ms:[{ms:[L]}],me:[{me:[L]}],mt:[{mt:[L]}],mr:[{mr:[L]}],mb:[{mb:[L]}],ml:[{ml:[L]}],"space-x":[{"space-x":[R]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[R]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Y,t]}],"min-w":[{"min-w":[Y,t,"min","max","fit"]}],"max-w":[{"max-w":[Y,t,"none","full","min","max","fit","prose",{screen:[to]},to]}],h:[{h:[Y,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Y,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Y,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Y,t,"auto","min","max","fit"]}],"font-size":[{text:["base",to,eo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",yg]}],"font-family":[{font:[$l]}],"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",Y]}],"line-clamp":[{"line-clamp":["none",Cs,yg]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ur,Y]}],"list-image":[{"list-image":["none",Y]}],"list-style-type":[{list:["none","disc","decimal",Y]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...So(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ur,eo]}],"underline-offset":[{"underline-offset":["auto",ur,Y]}],"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:ae()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Y]}],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",Y]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...St(),IA]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",LA]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},kA]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],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":[y]}],"border-style":[{border:[...So(),"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":[y]}],"divide-style":[{divide:So()}],"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:["",...So()]}],"outline-offset":[{"outline-offset":[ur,Y]}],"outline-w":[{outline:[ur,eo]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Be()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[ur,eo]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",to,PA]}],"shadow-color":[{shadow:[$l]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...Me(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Me()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",to,Y]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[c]}],saturate:[{saturate:[m]}],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":[y]}],"backdrop-saturate":[{"backdrop-saturate":[m]}],"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",Y]}],duration:[{duration:zt()}],ease:[{ease:["linear","in","out","in-out",Y]}],delay:[{delay:zt()}],animate:[{animate:["none","spin","ping","pulse","bounce",Y]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[Hl,Y]}],"translate-x":[{"translate-x":[A]}],"translate-y":[{"translate-y":[A]}],"skew-x":[{"skew-x":[P]}],"skew-y":[{"skew-y":[P]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Y]}],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",Y]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":ae()}],"scroll-mx":[{"scroll-mx":ae()}],"scroll-my":[{"scroll-my":ae()}],"scroll-ms":[{"scroll-ms":ae()}],"scroll-me":[{"scroll-me":ae()}],"scroll-mt":[{"scroll-mt":ae()}],"scroll-mr":[{"scroll-mr":ae()}],"scroll-mb":[{"scroll-mb":ae()}],"scroll-ml":[{"scroll-ml":ae()}],"scroll-p":[{"scroll-p":ae()}],"scroll-px":[{"scroll-px":ae()}],"scroll-py":[{"scroll-py":ae()}],"scroll-ps":[{"scroll-ps":ae()}],"scroll-pe":[{"scroll-pe":ae()}],"scroll-pt":[{"scroll-pt":ae()}],"scroll-pr":[{"scroll-pr":ae()}],"scroll-pb":[{"scroll-pb":ae()}],"scroll-pl":[{"scroll-pl":ae()}],"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",Y]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ur,eo,yg]}],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 KC=pA(_A);function Jt(...e){return KC(Ac(e))}var YC=N(le(),1);function De({className:e,type:t,...a}){return(0,YC.jsx)("input",{type:t,"data-slot":"input",className:Jt("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 He=N(W(),1);var eS=N(W(),1);function ZC(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Wl(...e){return t=>{let a=!1,r=e.map(o=>{let n=ZC(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():ZC(e[o],null)}}}}function dr(...e){return eS.useCallback(Wl(...e),e)}var _c=N(le(),1),BA=Symbol.for("react.lazy"),Ec=He[" use ".trim().toString()];function UA(e){return typeof e=="object"&&e!==null&&"then"in e}function tS(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===BA&&"_payload"in e&&UA(e._payload)}function VA(e){let t=jA(e),a=He.forwardRef((r,o)=>{let{children:n,...s}=r;tS(n)&&typeof Ec=="function"&&(n=Ec(n._payload));let i=He.Children.toArray(n),l=i.find(zA);if(l){let u=l.props.children,d=i.map(c=>c===l?He.Children.count(u)>1?He.Children.only(null):He.isValidElement(u)?u.props.children:null:c);return(0,_c.jsx)(t,{...s,ref:o,children:He.isValidElement(u)?He.cloneElement(u,void 0,d):null})}return(0,_c.jsx)(t,{...s,ref:o,children:n})});return a.displayName=`${e}.Slot`,a}var aS=VA("Slot");function jA(e){let t=He.forwardRef((a,r)=>{let{children:o,...n}=a;if(tS(o)&&typeof Ec=="function"&&(o=Ec(o._payload)),He.isValidElement(o)){let s=$A(o),i=HA(n,o.props);return o.type!==He.Fragment&&(i.ref=r?Wl(r,s):s),He.cloneElement(o,i)}return He.Children.count(o)>1?He.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var qA=Symbol("radix.slottable");function zA(e){return He.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===qA}function HA(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 $A(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 rS=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,oS=Ac,nS=(e,t)=>a=>{var r;if(t?.variants==null)return oS(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=rS(d)||rS(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,...g}=d;return Object.entries(g).every(x=>{let[w,L]=x;return Array.isArray(L)?L.includes({...n,...i}[w]):{...n,...i}[w]===L})?[...u,c,f]:u},[]);return oS(e,s,l,a?.class,a?.className)};var sS=N(le(),1),WA=nS("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 tt({className:e,variant:t,size:a,asChild:r=!1,...o}){return(0,sS.jsx)(r?aS:"button",{"data-slot":"button",className:Jt(WA({variant:t,size:a,className:e})),...o})}var ES=N(W(),1);var $=N(W(),1);var lS=N(W(),1),YA=N(zh(),1);var Ke=N(W(),1);var Dc=N(le(),1);function iS(e){let t=GA(e),a=Ke.forwardRef((r,o)=>{let{children:n,...s}=r,i=Ke.Children.toArray(n),l=i.find(XA);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,Dc.jsx)(t,{...s,ref:o,children:Ke.isValidElement(u)?Ke.cloneElement(u,void 0,d):null})}return(0,Dc.jsx)(t,{...s,ref:o,children:n})});return a.displayName=`${e}.Slot`,a}function GA(e){let t=Ke.forwardRef((a,r)=>{let{children:o,...n}=a;if(Ke.isValidElement(o)){let s=JA(o),i=QA(n,o.props);return o.type!==Ke.Fragment&&(i.ref=r?Wl(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 KA=Symbol("radix.slottable");function XA(e){return Ke.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===KA}function QA(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 JA(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 uS=N(le(),1),ZA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ls=ZA.reduce((e,t)=>{let a=iS(`Primitive.${t}`),r=lS.forwardRef((o,n)=>{let{asChild:s,...i}=o,l=s?a:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),(0,uS.jsx)(l,{...i,ref:n})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});var Ft=N(W(),1);var dS=N(W(),1),Gl=globalThis?.document?dS.useLayoutEffect:()=>{};var cS=N(W(),1);function eR(e,t){return cS.useReducer((a,r)=>t[a][r]??a,e)}var Is=e=>{let{present:t,children:a}=e,r=tR(t),o=typeof a=="function"?a({present:r.isPresent}):Ft.Children.only(a),n=dr(r.ref,aR(o));return typeof a=="function"||r.isPresent?Ft.cloneElement(o,{ref:n}):null};Is.displayName="Presence";function tR(e){let[t,a]=Ft.useState(),r=Ft.useRef(null),o=Ft.useRef(e),n=Ft.useRef("none"),s=e?"mounted":"unmounted",[i,l]=eR(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return Ft.useEffect(()=>{let u=Mc(r.current);n.current=i==="mounted"?u:"none"},[i]),Gl(()=>{let u=r.current,d=o.current;if(d!==e){let f=n.current,g=Mc(u);e?l("MOUNT"):g==="none"||u?.display==="none"?l("UNMOUNT"):l(d&&f!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Gl(()=>{if(t){let u,d=t.ownerDocument.defaultView??window,c=g=>{let w=Mc(r.current).includes(CSS.escape(g.animationName));if(g.target===t&&w&&(l("ANIMATION_END"),!o.current)){let L=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=L)})}},f=g=>{g.target===t&&(n.current=Mc(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:Ft.useCallback(u=>{r.current=u?getComputedStyle(u):null,a(u)},[])}}function Mc(e){return e?.animationName||"none"}function aR(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 cr=N(W(),1),fS=N(le(),1);function pS(e,t=[]){let a=[];function r(n,s){let i=cr.createContext(s),l=a.length;a=[...a,s];let u=c=>{let{scope:f,children:g,...x}=c,w=f?.[e]?.[l]||i,L=cr.useMemo(()=>x,Object.values(x));return(0,fS.jsx)(w.Provider,{value:L,children:g})};u.displayName=n+"Provider";function d(c,f){let g=f?.[e]?.[l]||i,x=cr.useContext(g);if(x)return x;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=>cr.createContext(s));return function(i){let l=i?.[e]||n;return cr.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return o.scopeName=e,[r,rR(o,...t)]}function rR(...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 cr.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return a.scopeName=t.scopeName,a}var bs=N(W(),1);function ao(e){let t=bs.useRef(e);return bs.useEffect(()=>{t.current=e}),bs.useMemo(()=>(...a)=>t.current?.(...a),[])}var Nc=N(W(),1),oR=N(le(),1),nR=Nc.createContext(void 0);function mS(e){let t=Nc.useContext(nR);return e||t||"ltr"}function hS(e,[t,a]){return Math.min(a,Math.max(t,e))}var oO=!!(typeof window<"u"&&window.document&&window.document.createElement);function ro(e,t,{checkForDefaultPrevented:a=!0}={}){return function(o){if(e?.(o),a===!1||!o.defaultPrevented)return t?.(o)}}var yS=N(W(),1),ce=N(le(),1);function sR(e,t){return yS.useReducer((a,r)=>t[a][r]??a,e)}var vg="ScrollArea",[xS,hO]=pS(vg),[iR,ma]=xS(vg),vS=$.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),[g,x]=$.useState(null),[w,L]=$.useState(null),[y,h]=$.useState(0),[m,S]=$.useState(0),[I,P]=$.useState(!1),[R,A]=$.useState(!1),V=dr(t,me=>l(me)),F=mS(o);return(0,ce.jsx)(iR,{scope:a,type:r,dir:F,scrollHideDelay:n,scrollArea:i,viewport:u,onViewportChange:d,content:c,onContentChange:f,scrollbarX:g,onScrollbarXChange:x,scrollbarXEnabled:I,onScrollbarXEnabledChange:P,scrollbarY:w,onScrollbarYChange:L,scrollbarYEnabled:R,onScrollbarYEnabledChange:A,onCornerWidthChange:h,onCornerHeightChange:S,children:(0,ce.jsx)(Ls.div,{dir:F,...s,ref:V,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":m+"px",...e.style}})})});vS.displayName=vg;var wS="ScrollAreaViewport",CS=$.forwardRef((e,t)=>{let{__scopeScrollArea:a,children:r,nonce:o,...n}=e,s=ma(wS,a),i=$.useRef(null),l=dr(t,i,s.onViewportChange);return(0,ce.jsxs)(ce.Fragment,{children:[(0,ce.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,ce.jsx)(Ls.div,{"data-radix-scroll-area-viewport":"",...n,ref:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:(0,ce.jsx)("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});CS.displayName=wS;var Va="ScrollAreaScrollbar",wg=$.forwardRef((e,t)=>{let{forceMount:a,...r}=e,o=ma(Va,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,ce.jsx)(lR,{...r,ref:t,forceMount:a}):o.type==="scroll"?(0,ce.jsx)(uR,{...r,ref:t,forceMount:a}):o.type==="auto"?(0,ce.jsx)(SS,{...r,ref:t,forceMount:a}):o.type==="always"?(0,ce.jsx)(Cg,{...r,ref:t}):null});wg.displayName=Va;var lR=$.forwardRef((e,t)=>{let{forceMount:a,...r}=e,o=ma(Va,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,ce.jsx)(Is,{present:a||n,children:(0,ce.jsx)(SS,{"data-state":n?"visible":"hidden",...r,ref:t})})}),uR=$.forwardRef((e,t)=>{let{forceMount:a,...r}=e,o=ma(Va,e.__scopeScrollArea),n=e.orientation==="horizontal",s=Uc(()=>l("SCROLL_END"),100),[i,l]=sR("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 g=u[d];c!==g&&(l("SCROLL"),s()),c=g};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[o.viewport,n,l,s]),(0,ce.jsx)(Is,{present:a||i!=="hidden",children:(0,ce.jsx)(Cg,{"data-state":i==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:ro(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:ro(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),SS=$.forwardRef((e,t)=>{let a=ma(Va,e.__scopeScrollArea),{forceMount:r,...o}=e,[n,s]=$.useState(!1),i=e.orientation==="horizontal",l=Uc(()=>{if(a.viewport){let u=a.viewport.offsetWidth<a.viewport.scrollWidth,d=a.viewport.offsetHeight<a.viewport.scrollHeight;s(i?u:d)}},10);return ks(a.viewport,l),ks(a.content,l),(0,ce.jsx)(Is,{present:r||n,children:(0,ce.jsx)(Cg,{"data-state":n?"visible":"hidden",...o,ref:t})})}),Cg=$.forwardRef((e,t)=>{let{orientation:a="vertical",...r}=e,o=ma(Va,e.__scopeScrollArea),n=$.useRef(null),s=$.useRef(0),[i,l]=$.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=kS(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,g){return hR(f,s.current,i,g)}return a==="horizontal"?(0,ce.jsx)(dR,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&n.current){let f=o.viewport.scrollLeft,g=gS(f,i,o.dir);n.current.style.transform=`translate3d(${g}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,ce.jsx)(cR,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&n.current){let f=o.viewport.scrollTop,g=gS(f,i);n.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollTop=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollTop=c(f))}}):null}),dR=$.forwardRef((e,t)=>{let{sizes:a,onSizesChange:r,...o}=e,n=ma(Va,e.__scopeScrollArea),[s,i]=$.useState(),l=$.useRef(null),u=dr(t,l,n.onScrollbarXChange);return $.useEffect(()=>{l.current&&i(getComputedStyle(l.current))},[l]),(0,ce.jsx)(IS,{"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":Bc(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),TS(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:Fc(s.paddingLeft),paddingEnd:Fc(s.paddingRight)}})}})}),cR=$.forwardRef((e,t)=>{let{sizes:a,onSizesChange:r,...o}=e,n=ma(Va,e.__scopeScrollArea),[s,i]=$.useState(),l=$.useRef(null),u=dr(t,l,n.onScrollbarYChange);return $.useEffect(()=>{l.current&&i(getComputedStyle(l.current))},[l]),(0,ce.jsx)(IS,{"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":Bc(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),TS(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:Fc(s.paddingTop),paddingEnd:Fc(s.paddingBottom)}})}})}),[fR,LS]=xS(Va),IS=$.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,g=ma(Va,a),[x,w]=$.useState(null),L=dr(t,V=>w(V)),y=$.useRef(null),h=$.useRef(""),m=g.viewport,S=r.content-r.viewport,I=ao(d),P=ao(l),R=Uc(c,10);function A(V){if(y.current){let F=V.clientX-y.current.left,me=V.clientY-y.current.top;u({x:F,y:me})}}return $.useEffect(()=>{let V=F=>{let me=F.target;x?.contains(me)&&I(F,S)};return document.addEventListener("wheel",V,{passive:!1}),()=>document.removeEventListener("wheel",V,{passive:!1})},[m,x,S,I]),$.useEffect(P,[r,P]),ks(x,R),ks(g.content,R),(0,ce.jsx)(fR,{scope:a,scrollbar:x,hasThumb:o,onThumbChange:ao(n),onThumbPointerUp:ao(s),onThumbPositionChange:P,onThumbPointerDown:ao(i),children:(0,ce.jsx)(Ls.div,{...f,ref:L,style:{position:"absolute",...f.style},onPointerDown:ro(e.onPointerDown,V=>{V.button===0&&(V.target.setPointerCapture(V.pointerId),y.current=x.getBoundingClientRect(),h.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),A(V))}),onPointerMove:ro(e.onPointerMove,A),onPointerUp:ro(e.onPointerUp,V=>{let F=V.target;F.hasPointerCapture(V.pointerId)&&F.releasePointerCapture(V.pointerId),document.body.style.webkitUserSelect=h.current,g.viewport&&(g.viewport.style.scrollBehavior=""),y.current=null})})})}),Oc="ScrollAreaThumb",Sg=$.forwardRef((e,t)=>{let{forceMount:a,...r}=e,o=LS(Oc,e.__scopeScrollArea);return(0,ce.jsx)(Is,{present:a||o.hasThumb,children:(0,ce.jsx)(pR,{ref:t,...r})})}),pR=$.forwardRef((e,t)=>{let{__scopeScrollArea:a,style:r,...o}=e,n=ma(Oc,a),s=LS(Oc,a),{onThumbPositionChange:i}=s,l=dr(t,c=>s.onThumbChange(c)),u=$.useRef(void 0),d=Uc(()=>{u.current&&(u.current(),u.current=void 0)},100);return $.useEffect(()=>{let c=n.viewport;if(c){let f=()=>{if(d(),!u.current){let g=gR(c,i);u.current=g,i()}};return i(),c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)}},[n.viewport,d,i]),(0,ce.jsx)(Ls.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:ro(e.onPointerDownCapture,c=>{let g=c.target.getBoundingClientRect(),x=c.clientX-g.left,w=c.clientY-g.top;s.onThumbPointerDown({x,y:w})}),onPointerUp:ro(e.onPointerUp,s.onThumbPointerUp)})});Sg.displayName=Oc;var Lg="ScrollAreaCorner",bS=$.forwardRef((e,t)=>{let a=ma(Lg,e.__scopeScrollArea),r=!!(a.scrollbarX&&a.scrollbarY);return a.type!=="scroll"&&r?(0,ce.jsx)(mR,{...e,ref:t}):null});bS.displayName=Lg;var mR=$.forwardRef((e,t)=>{let{__scopeScrollArea:a,...r}=e,o=ma(Lg,a),[n,s]=$.useState(0),[i,l]=$.useState(0),u=!!(n&&i);return ks(o.scrollbarX,()=>{let d=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(d),l(d)}),ks(o.scrollbarY,()=>{let d=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(d),s(d)}),u?(0,ce.jsx)(Ls.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 Fc(e){return e?parseInt(e,10):0}function kS(e,t){let a=e/t;return isNaN(a)?0:a}function Bc(e){let t=kS(e.viewport,e.content),a=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-a)*t;return Math.max(r,18)}function hR(e,t,a,r="ltr"){let o=Bc(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 PS([l,u],c)(e)}function gS(e,t,a="ltr"){let r=Bc(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=hS(e,l);return PS([0,s],[0,i])(u)}function PS(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 TS(e,t){return e>0&&e<t}var gR=(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 Uc(e,t){let a=ao(e),r=$.useRef(0);return $.useEffect(()=>()=>window.clearTimeout(r.current),[]),$.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(a,t)},[a,t])}function ks(e,t){let a=ao(t);Gl(()=>{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 AS=vS,RS=CS;var _S=bS;var oo=N(le(),1),Ig=ES.forwardRef(({className:e,children:t,...a},r)=>(0,oo.jsxs)(AS,{"data-slot":"scroll-area",className:Jt("relative",e),...a,children:[(0,oo.jsx)(RS,{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,oo.jsx)(xR,{}),(0,oo.jsx)(_S,{})]}));Ig.displayName="ScrollArea";function xR({className:e,orientation:t="vertical",...a}){return(0,oo.jsx)(wg,{"data-slot":"scroll-area-scrollbar",orientation:t,className:Jt("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,oo.jsx)(Sg,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}var jc=N(W());var DS=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),vR=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,r)=>r?r.toUpperCase():a.toLowerCase()),bg=e=>{let t=vR(e);return t.charAt(0).toUpperCase()+t.slice(1)},Vc=(...e)=>e.filter((t,a,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===a).join(" ").trim(),MS=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var Kl=N(W());var NS={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 OS=(0,Kl.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:r,className:o="",children:n,iconNode:s,...i},l)=>(0,Kl.createElement)("svg",{ref:l,...NS,width:t,height:t,stroke:e,strokeWidth:r?Number(a)*24/Number(t):a,className:Vc("lucide",o),...!n&&!MS(i)&&{"aria-hidden":"true"},...i},[...s.map(([u,d])=>(0,Kl.createElement)(u,d)),...Array.isArray(n)?n:[n]]));var j=(e,t)=>{let a=(0,jc.forwardRef)(({className:r,...o},n)=>(0,jc.createElement)(OS,{ref:n,iconNode:t,className:Vc(`lucide-${DS(bg(e))}`,`lucide-${e}`,r),...o}));return a.displayName=bg(e),a};var wR=[["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"}]],Xl=j("activity",wR);var CR=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Ps=j("arrow-left",CR);var SR=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Ql=j("arrow-up",SR);var LR=[["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"}]],Jl=j("calendar",LR);var IR=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Yl=j("chevron-down",IR);var bR=[["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"}]],ba=j("circle-alert",bR);var kR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],at=j("circle-check",kR);var PR=[["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"}]],ka=j("circle-x",PR);var TR=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],sn=j("clock",TR);var AR=[["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"}]],fr=j("command",AR);var RR=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],pr=j("corner-down-left",RR);var _R=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],ln=j("credit-card",_R);var ER=[["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"}]],un=j("crown",ER);var DR=[["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"}]],dn=j("dollar-sign",DR);var MR=[["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"}]],Ts=j("file-spreadsheet",MR);var NR=[["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"}]],As=j("key",NR);var OR=[["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"}]],Zl=j("laptop",OR);var FR=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Pt=j("loader-circle",FR);var BR=[["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"}]],Rs=j("mail",BR);var UR=[["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"}]],_s=j("map-pin",UR);var VR=[["path",{d:"M5 12h14",key:"1ays0h"}]],cn=j("minus",VR);var jR=[["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"}]],eu=j("paperclip",jR);var qR=[["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"}]],Es=j("refresh-cw",qR);var zR=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],fn=j("search",zR);var HR=[["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"}]],Ds=j("shield",HR);var $R=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],tu=j("smartphone",$R);var WR=[["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"}]],Yt=j("sparkles",WR);var GR=[["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"}]],Bt=j("square-pen",GR);var KR=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],au=j("trending-up",KR);var XR=[["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"}]],Ms=j("users",XR);var QR=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],mr=j("x",QR);var JR=[["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"}]],ru=j("zap",JR);var Fe=N(le(),1);function FS({phase:e,progressSteps:t=[]}){return(0,Fe.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,Fe.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Fe.jsx)(Pt,{className:"h-3.5 w-3.5 animate-spin"}),(0,Fe.jsx)("span",{children:"Thinking\u2026"})]}),e==="searching"&&(0,Fe.jsxs)("div",{className:"space-y-2 animate-in fade-in-0 duration-300",children:[(0,Fe.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Fe.jsx)(fn,{className:"h-3.5 w-3.5 opacity-70"}),(0,Fe.jsx)("span",{children:"Searching across pages\u2026"})]}),(0,Fe.jsxs)("ul",{className:"ml-6 list-disc space-y-1",children:[(0,Fe.jsx)("li",{className:"opacity-90",children:"Checking recent changes"}),(0,Fe.jsx)("li",{className:"opacity-90",children:"Scanning documentation"}),(0,Fe.jsx)("li",{className:"opacity-90",children:"Summarizing relevant sections"})]})]}),(e==="thinking"||e==="executing"||e==="responding")&&t.length>0&&(0,Fe.jsxs)("div",{className:"space-y-2 animate-in fade-in-0 duration-200",children:[t.map((a,r)=>(0,Fe.jsxs)("div",{className:`flex items-center gap-2 transition-opacity duration-200 ${a.completed?"opacity-60":"opacity-100"}`,children:[a.completed?(0,Fe.jsx)(at,{className:"h-3.5 w-3.5 text-green-500 flex-shrink-0"}):(0,Fe.jsx)(Pt,{className:"h-3.5 w-3.5 animate-spin flex-shrink-0"}),(0,Fe.jsx)("span",{className:a.completed?"line-through":"",children:a.message})]},r)),e==="responding"&&(0,Fe.jsxs)("div",{className:"flex items-center gap-2 opacity-100 animate-in fade-in-0 duration-200",children:[(0,Fe.jsx)(Pt,{className:"h-3.5 w-3.5 animate-spin flex-shrink-0"}),(0,Fe.jsx)("span",{children:"Preparing response..."})]})]})]})}var BS=N(W(),1);var Pa=N(le(),1);function US({title:e,links:t}){let[a,r]=BS.useState(!1);return(0,Pa.jsxs)("div",{className:"text-xs text-muted-foreground",children:[(0,Pa.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,Pa.jsxs)("div",{className:"flex items-center gap-1.5",children:[a?(0,Pa.jsx)(Yl,{className:"h-3 w-3 opacity-70"}):(0,Pa.jsx)(fn,{className:"h-3 w-3 opacity-70"}),(0,Pa.jsx)("span",{children:e})]})}),a&&t.length>0&&(0,Pa.jsx)("ul",{className:"ml-5 mt-1 space-y-0.5",children:t.map(o=>(0,Pa.jsx)("li",{children:(0,Pa.jsx)("a",{href:o.href,target:"_blank",rel:"noreferrer",className:"text-primary hover:underline",children:o.label})},o.href))})]})}var nu=N(le(),1),ja=N(W(),1);var VS=N(W(),1),Ns=(0,VS.createContext)({});var jS=N(W(),1);function Os(e){let t=(0,jS.useRef)(null);return t.current===null&&(t.current=e()),t.current}var Pg=N(le(),1),WS=N(W(),1),pn=N(W(),1);var qS=N(W(),1),no=(0,qS.createContext)(null);var HS=N(le(),1),qc=N(W(),1),hr=N(W(),1);var zS=N(W(),1),Fs=(0,zS.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});var kg=class extends qc.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 $S({children:e,isPresent:t}){let a=(0,hr.useId)(),r=(0,hr.useRef)(null),o=(0,hr.useRef)({width:0,height:0,top:0,left:0}),{nonce:n}=(0,hr.useContext)(Fs);return(0,hr.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
16
|
[data-motion-pop-id="${a}"] {
|
|
17
17
|
position: absolute !important;
|
|
18
18
|
width: ${s}px !important;
|
|
@@ -20,30 +20,30 @@ Error generating stack: `+n.message+`
|
|
|
20
20
|
top: ${l}px !important;
|
|
21
21
|
left: ${u}px !important;
|
|
22
22
|
}
|
|
23
|
-
`),()=>{document.head.removeChild(d)}},[t]),(0,jC.jsx)(Lg,{isPresent:t,childRef:r,sizeRef:o,children:Uc.cloneElement(e,{ref:r})})}var zC=({children:e,initial:t,isPresent:a,onExitComplete:r,custom:o,presenceAffectsLayout:n,mode:s})=>{let i=Ns(KR),l=(0,fn.useId)(),u=(0,fn.useCallback)(c=>{i.set(c,!0);for(let f of i.values())if(!f)return;r&&r()},[i,r]),d=(0,fn.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,fn.useMemo)(()=>{i.forEach((c,f)=>i.set(f,!1))},[a]),HC.useEffect(()=>{!a&&!i.size&&r&&r()},[a]),s==="popLayout"&&(e=(0,Ig.jsx)(qC,{isPresent:a,children:e})),(0,Ig.jsx)(oo.Provider,{value:d,children:e})};function KR(){return new Map}var no=M(G(),1);function Vc(e=!0){let t=(0,no.useContext)(oo);if(t===null)return[!0,null];let{isPresent:a,onExitComplete:r,register:o}=t,n=(0,no.useId)();(0,no.useEffect)(()=>{e&&o(n)},[e]);let s=(0,no.useCallback)(()=>e&&r&&r(n),[n,r,e]);return!a&&r?[!1,s]:[!0]}var jc=M(G(),1),ru=e=>e.key||"";function bg(e){let t=[];return jc.Children.forEach(e,a=>{(0,jc.isValidElement)(a)&&t.push(a)}),t}var qc=M(G(),1);var Fs=typeof window<"u";var Hc=Fs?qc.useLayoutEffect:qc.useEffect;var kg=({children:e,custom:t,initial:a=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:n="sync",propagate:s=!1})=>{let[i,l]=Vc(s),u=(0,Va.useMemo)(()=>bg(e),[e]),d=s&&!i?[]:u.map(ru),c=(0,Va.useRef)(!0),f=(0,Va.useRef)(u),g=Ns(()=>new Map),[x,w]=(0,Va.useState)(u),[L,y]=(0,Va.useState)(u);Hc(()=>{c.current=!1,f.current=u;for(let C=0;C<L.length;C++){let I=ru(L[C]);d.includes(I)?g.delete(I):g.get(I)!==!0&&g.set(I,!1)}},[L,d.length,d.join("-")]);let h=[];if(u!==x){let C=[...u];for(let I=0;I<L.length;I++){let P=L[I],R=ru(P);d.includes(R)||(C.splice(I,0,P),h.push(P))}n==="wait"&&h.length&&(C=h),y(bg(C)),w(u);return}let{forceRender:m}=(0,Va.useContext)(Ms);return(0,ou.jsx)(ou.Fragment,{children:L.map(C=>{let I=ru(C),P=s&&!i?!1:u===L||d.includes(I),R=()=>{if(g.has(I))g.set(I,!0);else return;let A=!0;g.forEach(q=>{q||(A=!1)}),A&&(m?.(),y(f.current),s&&l?.(),r&&r())};return(0,ou.jsx)(zC,{isPresent:P,initial:!c.current||a?void 0:!1,custom:P?void 0:t,presenceAffectsLayout:o,mode:n,onExitComplete:P?void 0:R,children:C},I)})})};var ge=e=>e;var hr=ge,Ta=ge;function pn(e){let t;return()=>(t===void 0&&(t=e()),t)}var Yt=(e,t,a)=>{let r=t-e;return r===0?1:(a-e)/r};var Be=e=>e*1e3,dt=e=>e/1e3;var Bs={skipAnimations:!1,useManualTiming:!1};function $C(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 g=c&&r?t:a;return d&&n.add(u),g.has(u)||g.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 zc=["read","resolveKeyframes","update","preRender","render","postRender"],XR=40;function $c(e,t){let a=!1,r=!0,o={delta:0,timestamp:0,isProcessing:!1},n=()=>a=!0,s=zc.reduce((y,h)=>(y[h]=$C(n),y),{}),{read:i,resolveKeyframes:l,update:u,preRender:d,render:c,postRender:f}=s,g=()=>{let y=Bs.useManualTiming?o.timestamp:performance.now();a=!1,o.delta=r?1e3/60:Math.max(Math.min(y-o.timestamp,XR),1),o.timestamp=y,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(g))},x=()=>{a=!0,r=!0,o.isProcessing||e(g)};return{schedule:zc.reduce((y,h)=>{let m=s[h];return y[h]=(C,I=!1,P=!1)=>(a||x(),m.schedule(C,I,P)),y},{}),cancel:y=>{for(let h=0;h<zc.length;h++)s[zc[h]].cancel(y)},state:o,steps:s}}var{schedule:ee,cancel:Zt,state:Ue,steps:Wc}=$c(typeof requestAnimationFrame<"u"?requestAnimationFrame:ge,!0);var WC=M(G(),1),Gc=(0,WC.createContext)({strict:!1});var GC={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"]},gr={};for(let e in GC)gr[e]={isEnabled:t=>GC[e].some(a=>!!t[a])};function KC(e){for(let t in e)gr[t]={...gr[t],...e[t]}}var QR=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 nu(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||QR.has(e)}var XC=e=>!nu(e);function JR(e){e&&(XC=t=>t.startsWith("on")?!nu(t):e(t))}try{JR(Ek("@emotion/is-prop-valid").default)}catch{}function QC(e,t,a){let r={};for(let o in e)o==="values"&&typeof e.values=="object"||(XC(o)||a===!0&&nu(o)||!t&&!nu(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}function JC(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 Zc=M(le(),1);var js=M(G(),1);var YC=M(G(),1),so=(0,YC.createContext)({});var Qc=M(G(),1);function yr(e){return typeof e=="string"||Array.isArray(e)}function io(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}var Kc=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],su=["initial",...Kc];function mn(e){return io(e.animate)||su.some(t=>yr(e[t]))}function Xc(e){return!!(mn(e)||e.variants)}function ZC(e,t){if(mn(e)){let{initial:a,animate:r}=e;return{initial:a===!1||yr(a)?a:void 0,animate:yr(r)?r:void 0}}return e.inherit!==!1?t:{}}function tL(e){let{initial:t,animate:a}=ZC(e,(0,Qc.useContext)(so));return(0,Qc.useMemo)(()=>({initial:t,animate:a}),[eL(t),eL(a)])}function eL(e){return Array.isArray(e)?e.join(" "):e}var aL=Symbol.for("motionComponentSymbol");var rL=M(G(),1);function xr(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function oL(e,t,a){return(0,rL.useCallback)(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),a&&(typeof a=="function"?a(r):xr(a)&&(a.current=r))},[t])}var Ut=M(G(),1);var Us=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase();var YR="framerAppearId",Jc="data-"+Us(YR);var{schedule:Vs,cancel:MU}=$c(queueMicrotask,!1);var nL=M(G(),1),Yc=(0,nL.createContext)({});function sL(e,t,a,r,o){var n,s;let{visualElement:i}=(0,Ut.useContext)(so),l=(0,Ut.useContext)(Gc),u=(0,Ut.useContext)(oo),d=(0,Ut.useContext)(Os).reducedMotion,c=(0,Ut.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,g=(0,Ut.useContext)(Yc);f&&!f.projection&&o&&(f.type==="html"||f.type==="svg")&&ZR(c.current,a,o,g);let x=(0,Ut.useRef)(!1);(0,Ut.useInsertionEffect)(()=>{f&&x.current&&f.update(a,u)});let w=a[Jc],L=(0,Ut.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 Hc(()=>{f&&(x.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),Vs.render(f.render),L.current&&f.animationState&&f.animationState.animateChanges())}),(0,Ut.useEffect)(()=>{f&&(!L.current&&f.animationState&&f.animationState.animateChanges(),L.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)===null||y===void 0||y.call(window,w)}),L.current=!1))}),f}function ZR(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:iL(e.parent)),e.projection.setOptions({layoutId:o,layout:n,alwaysMeasureLayout:!!s||i&&xr(i),visualElement:e,animationType:typeof n=="string"?n:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:u})}function iL(e){if(e)return e.options.allowProjection!==!1?e.projection:iL(e.parent)}function lL({preloadedFeatures:e,createVisualElement:t,useRender:a,useVisualState:r,Component:o}){var n,s;e&&KC(e);function i(u,d){let c,f={...(0,js.useContext)(Os),...u,layoutId:e_(u)},{isStatic:g}=f,x=tL(u),w=r(u,g);if(!g&&Fs){t_(f,e);let L=a_(f);c=L.MeasureLayout,x.visualElement=sL(o,w,f,t,L.ProjectionNode)}return(0,Zc.jsxs)(so.Provider,{value:x,children:[c&&x.visualElement?(0,Zc.jsx)(c,{visualElement:x.visualElement,...f}):null,a(o,u,oL(w,x.visualElement,d),w,g,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,js.forwardRef)(i);return l[aL]=o,l}function e_({layoutId:e}){let t=(0,js.useContext)(Ms).id;return t&&e!==void 0?t+"-"+e:e}function t_(e,t){let a=(0,js.useContext)(Gc).strict}function a_(e){let{drag:t,layout:a}=gr;if(!t&&!a)return{};let r={...t,...a};return{MeasureLayout:t?.isEnabled(e)||a?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}var uL=["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 qs(e){return typeof e!="string"||e.includes("-")?!1:!!(uL.indexOf(e)>-1||/[A-Z]/u.test(e))}var Pg=M(G(),1);function dL(e){let t=[{},{}];return e?.values.forEach((a,r)=>{t[0][r]=a.get(),t[1][r]=a.getVelocity()}),t}function Hs(e,t,a,r){if(typeof t=="function"){let[o,n]=dL(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]=dL(r);t=t(a!==void 0?a:e.custom,o,n)}return t}var iu=e=>Array.isArray(e);var cL=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),fL=e=>iu(e)?e[e.length-1]||0:e;var Ce=e=>!!(e&&e.getVelocity);function zs(e){let t=Ce(e)?e.get():e;return cL(t)?t.toValue():t}function r_({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:a},r,o,n){let s={latestValues:o_(r,o,n,e),renderState:t()};return a&&(s.onMount=i=>a({props:r,current:i,...s}),s.onUpdate=i=>a(i)),s}var ef=e=>(t,a)=>{let r=(0,Pg.useContext)(so),o=(0,Pg.useContext)(oo),n=()=>r_(e,t,r,o);return a?n():Ns(n)};function o_(e,t,a,r){let o={},n=r(e,{});for(let f in n)o[f]=zs(n[f]);let{initial:s,animate:i}=e,l=mn(e),u=Xc(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"&&!io(c)){let f=Array.isArray(c)?c:[c];for(let g=0;g<f.length;g++){let x=Hs(e,f[g]);if(x){let{transitionEnd:w,transition:L,...y}=x;for(let h in y){let m=y[h];if(Array.isArray(m)){let C=d?m.length-1:0;m=m[C]}m!==null&&(o[h]=m)}for(let h in w)o[h]=w[h]}}}return o}var ja=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Vt=new Set(ja);var pL=e=>t=>typeof t=="string"&&t.startsWith(e),tf=pL("--"),n_=pL("var(--"),$s=e=>n_(e)?s_.test(e.split("/*")[0].trim()):!1,s_=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;var af=(e,t)=>t&&typeof e=="number"?t.transform(e):e;var ct=(e,t,a)=>a>t?t:a<e?e:a;var qa={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},vr={...qa,transform:e=>ct(0,1,e)},lu={...qa,default:1};var uu=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ha=uu("deg"),Pt=uu("%"),H=uu("px"),mL=uu("vh"),hL=uu("vw"),Tg={...Pt,parse:e=>Pt.parse(e)/100,transform:e=>Pt.transform(e*100)};var gL={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 yL={rotate:Ha,rotateX:Ha,rotateY:Ha,rotateZ:Ha,scale:lu,scaleX:lu,scaleY:lu,scaleZ:lu,skew:Ha,skewX:Ha,skewY:Ha,distance:H,translateX:H,translateY:H,translateZ:H,x:H,y:H,z:H,perspective:H,transformPerspective:H,opacity:vr,originX:Tg,originY:Tg,originZ:H};var Ag={...qa,transform:Math.round};var Ws={...gL,...yL,zIndex:Ag,size:H,fillOpacity:vr,strokeOpacity:vr,numOctaves:Ag};var i_={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},l_=ja.length;function xL(e,t,a){let r="",o=!0;for(let n=0;n<l_;n++){let s=ja[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=af(i,Ws[s]);if(!l){o=!1;let d=i_[s]||s;r+=`${d}(${u}) `}a&&(t[s]=u)}}return r=r.trim(),a?r=a(t,o?"":r):o&&(r="none"),r}function Gs(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(Vt.has(l)){s=!0;continue}else if(tf(l)){o[l]=u;continue}else{let d=af(u,Ws[l]);l.startsWith("origin")?(i=!0,n[l]=d):r[l]=d}}if(t.transform||(s||a?r.transform=xL(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 u_={offset:"stroke-dashoffset",array:"stroke-dasharray"},d_={offset:"strokeDashoffset",array:"strokeDasharray"};function vL(e,t,a=1,r=0,o=!0){e.pathLength=1;let n=o?u_:d_;e[n.offset]=H.transform(-r);let s=H.transform(t),i=H.transform(a);e[n.array]=`${s} ${i}`}function wL(e,t,a){return typeof e=="string"?e:H.transform(t+a*e)}function SL(e,t,a){let r=wL(t,e.x,e.width),o=wL(a,e.y,e.height);return`${r} ${o}`}function Ks(e,{attrX:t,attrY:a,attrScale:r,originX:o,originY:n,pathLength:s,pathSpacing:i=1,pathOffset:l=0,...u},d,c){if(Gs(e,u,c),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:f,style:g,dimensions:x}=e;f.transform&&(x&&(g.transform=f.transform),delete f.transform),x&&(o!==void 0||n!==void 0||g.transform)&&(g.transformOrigin=SL(x,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&&vL(f,s,i,l,!1)}var Xs=()=>({style:{},transform:{},transformOrigin:{},vars:{}});var rf=()=>({...Xs(),attrs:{}});var Qs=e=>typeof e=="string"&&e.toLowerCase()==="svg";function of(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 nf=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){of(e,t,void 0,r);for(let o in t.attrs)e.setAttribute(nf.has(o)?o:Us(o),t.attrs[o])}var Js={};function CL(e){Object.assign(Js,e)}function lf(e,{layout:t,layoutId:a}){return Vt.has(e)||e.startsWith("origin")||(t||a!==void 0)&&(!!Js[e]||e==="opacity")}function Ys(e,t,a){var r;let{style:o}=e,n={};for(let s in o)(Ce(o[s])||t.style&&Ce(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 uf(e,t,a){let r=Ys(e,t,a);for(let o in e)if(Ce(e[o])||Ce(t[o])){let n=ja.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[n]=e[o]}return r}function c_(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 LL=["x","y","width","height","cx","cy","r"],IL={useVisualState:ef({scrapeMotionValuesFromProps:uf,createRenderState:rf,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(Vt.has(i)){n=!0;break}}if(!n)return;let s=!t;if(t)for(let i=0;i<LL.length;i++){let l=LL[i];e[l]!==t[l]&&(s=!0)}s&&ee.read(()=>{c_(a,r),ee.render(()=>{Ks(r,o,Qs(a.tagName),e.transformTemplate),sf(a,r)})})}})};var bL={useVisualState:ef({scrapeMotionValuesFromProps:Ys,createRenderState:Xs})};var Zs=M(G(),1);var kL=M(G(),1);function Rg(e,t,a){for(let r in t)!Ce(t[r])&&!lf(r,a)&&(e[r]=t[r])}function f_({transformTemplate:e},t){return(0,kL.useMemo)(()=>{let a=Xs();return Gs(a,t,e),Object.assign({},a.vars,a.style)},[t])}function p_(e,t){let a=e.style||{},r={};return Rg(r,a,e),Object.assign(r,f_(e,t)),r}function PL(e,t){let a={},r=p_(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 TL=M(G(),1);function AL(e,t,a,r){let o=(0,TL.useMemo)(()=>{let n=rf();return Ks(n,t,Qs(r),e.transformTemplate),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let n={};Rg(n,e.style,e),o.style={...n,...o.style}}return o}function RL(e=!1){return(a,r,o,{latestValues:n},s)=>{let l=(qs(a)?AL:PL)(r,n,s,a),u=QC(r,typeof a=="string",e),d=a!==Zs.Fragment?{...u,...l,ref:o}:{},{children:c}=r,f=(0,Zs.useMemo)(()=>Ce(c)?c.get():c,[c]);return(0,Zs.createElement)(a,{...d,children:f})}}function _L(e,t){return function(r,{forwardMotionProps:o}={forwardMotionProps:!1}){let s={...qs(r)?IL:bL,preloadedFeatures:e,useRender:RL(o),createVisualElement:t,Component:r};return lL(s)}}function _g(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 lo(e,t,a){let r=e.getProps();return Hs(r,t,a!==void 0?a:r.custom,e)}var Eg=pn(()=>window.ScrollTimeline!==void 0);var du=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(Eg()&&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 cu=class extends du{then(t,a){return Promise.all(this.animations).then(t).catch(a)}};function uo(e,t){return e?e[t]||e.default||e:void 0}function ei(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 co(e){return typeof e=="function"}function fu(e,t){e.timeline=t,e.onfinish=null}var ti=e=>Array.isArray(e)&&typeof e[0]=="number";var Mg={linearEasing:void 0};function EL(e,t){let a=pn(e);return()=>{var r;return(r=Mg[t])!==null&&r!==void 0?r:a()}}var fo=EL(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");var pu=(e,t,a=10)=>{let r="",o=Math.max(Math.round(t/a),2);for(let n=0;n<o;n++)r+=e(Yt(0,o-1,n))+", ";return`linear(${r.substring(0,r.length-2)})`};function cf(e){return!!(typeof e=="function"&&fo()||!e||typeof e=="string"&&(e in df||fo())||ti(e)||Array.isArray(e)&&e.every(cf))}var ai=([e,t,a,r])=>`cubic-bezier(${e}, ${t}, ${a}, ${r})`,df={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ai([0,.65,.55,1]),circOut:ai([.55,0,1,.45]),backIn:ai([.31,.01,.66,-.59]),backOut:ai([.33,1.53,.69,.99])};function ri(e,t){if(e)return typeof e=="function"&&fo()?pu(e,t):ti(e)?ai(e):Array.isArray(e)?e.map(a=>ri(a,t)||df.easeOut):df[e]}var ea={x:!1,y:!1};function oi(){return ea.x||ea.y}function Ng(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 ff(e,t){let a=Ng(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[a,o,()=>r.abort()]}function DL(e){return t=>{t.pointerType==="touch"||oi()||e(t)}}function Og(e,t,a={}){let[r,o,n]=ff(e,a),s=DL(i=>{let{target:l}=i,u=t(i);if(typeof u!="function"||!l)return;let d=DL(c=>{u(c),l.removeEventListener("pointerleave",d)});l.addEventListener("pointerleave",d,o)});return r.forEach(i=>{i.addEventListener("pointerenter",s,o)}),n}var pf=(e,t)=>t?e===t?!0:pf(e,t.parentElement):!1;var hn=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;var m_=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function ML(e){return m_.has(e.tagName)||e.tabIndex!==-1}var gn=new WeakSet;function NL(e){return t=>{t.key==="Enter"&&e(t)}}function Fg(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}var OL=(e,t)=>{let a=e.currentTarget;if(!a)return;let r=NL(()=>{if(gn.has(a))return;Fg(a,"down");let o=NL(()=>{Fg(a,"up")}),n=()=>Fg(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 FL(e){return hn(e)&&!oi()}function Bg(e,t,a={}){let[r,o,n]=ff(e,a),s=i=>{let l=i.currentTarget;if(!FL(i)||gn.has(l))return;gn.add(l);let u=t(i),d=(g,x)=>{window.removeEventListener("pointerup",c),window.removeEventListener("pointercancel",f),!(!FL(g)||!gn.has(l))&&(gn.delete(l),typeof u=="function"&&u(g,{success:x}))},c=g=>{d(g,a.useGlobalTarget||pf(l,g.target))},f=g=>{d(g,!1)};window.addEventListener("pointerup",c,o),window.addEventListener("pointercancel",f,o)};return r.forEach(i=>{!ML(i)&&i.getAttribute("tabindex")===null&&(i.tabIndex=0),(a.useGlobalTarget?window:i).addEventListener("pointerdown",s,o),i.addEventListener("focus",u=>OL(u,o),o)}),n}function Ug(e){return e==="x"||e==="y"?ea[e]?null:(ea[e]=!0,()=>{ea[e]=!1}):ea.x||ea.y?null:(ea.x=ea.y=!0,()=>{ea.x=ea.y=!1})}var mf=new Set(["width","height","top","left","right","bottom",...ja]);var hf;function g_(){hf=void 0}var wt={now:()=>(hf===void 0&&wt.set(Ue.isProcessing||Bs.useManualTiming?Ue.timestamp:performance.now()),hf),set:e=>{hf=e,queueMicrotask(g_)}};function ni(e,t){e.indexOf(t)===-1&&e.push(t)}function si(e,t){let a=e.indexOf(t);a>-1&&e.splice(a,1)}var po=class{constructor(){this.subscriptions=[]}add(t){return ni(this.subscriptions,t),()=>si(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 gf(e,t){return t?e*(1e3/t):0}var UL=30,y_=e=>!isNaN(parseFloat(e)),VL={current:void 0},Vg=class{constructor(t,a={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,o=!0)=>{let n=wt.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=wt.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=y_(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 po);let r=this.events[t].add(a);return t==="change"?()=>{r(),ee.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 VL.current&&VL.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let t=wt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>UL)return 0;let a=Math.min(this.updatedAt-this.prevUpdatedAt,UL);return gf(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 wr(e,t){return new Vg(e,t)}function x_(e,t,a){e.hasValue(t)?e.getValue(t).set(a):e.addValue(t,wr(a))}function jL(e,t){let a=lo(e,t),{transitionEnd:r={},transition:o={},...n}=a||{};n={...n,...r};for(let s in n){let i=fL(n[s]);x_(e,s,i)}}function qL(e){return!!(Ce(e)&&e.add)}function mu(e,t){let a=e.getValue("willChange");if(qL(a))return a.add(t)}function yf(e){return e.props[Jc]}var xf={current:!1};var HL=(e,t,a)=>(((1-3*a+3*t)*e+(3*a-6*t))*e+3*t)*e,v_=1e-7,w_=12;function S_(e,t,a,r,o){let n,s,i=0;do s=t+(a-t)/2,n=HL(s,r,o)-e,n>0?a=s:t=s;while(Math.abs(n)>v_&&++i<w_);return s}function mo(e,t,a,r){if(e===t&&a===r)return ge;let o=n=>S_(n,0,1,e,a);return n=>n===0||n===1?n:HL(o(n),t,r)}var vf=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2;var wf=e=>t=>1-e(1-t);var jg=mo(.33,1.53,.69,.99),hu=wf(jg),Sf=vf(hu);var Cf=e=>(e*=2)<1?.5*hu(e):.5*(2-Math.pow(2,-10*(e-1)));var Lf=e=>1-Math.sin(Math.acos(e)),If=wf(Lf),bf=vf(Lf);var kf=e=>/^0[^.\s]+$/u.test(e);function zL(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||kf(e):!0}var ho=e=>Math.round(e*1e5)/1e5;var ii=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function $L(e){return e==null}var WL=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;var li=(e,t)=>a=>!!(typeof a=="string"&&WL.test(a)&&a.startsWith(e)||t&&!$L(a)&&Object.prototype.hasOwnProperty.call(a,t)),Pf=(e,t,a)=>r=>{if(typeof r!="string")return r;let[o,n,s,i]=r.match(ii);return{[e]:parseFloat(o),[t]:parseFloat(n),[a]:parseFloat(s),alpha:i!==void 0?parseFloat(i):1}};var C_=e=>ct(0,255,e),qg={...qa,transform:e=>Math.round(C_(e))},za={test:li("rgb","red"),parse:Pf("red","green","blue"),transform:({red:e,green:t,blue:a,alpha:r=1})=>"rgba("+qg.transform(e)+", "+qg.transform(t)+", "+qg.transform(a)+", "+ho(vr.transform(r))+")"};function L_(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 gu={test:li("#"),parse:L_,transform:za.transform};var go={test:li("hsl","hue"),parse:Pf("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:a,alpha:r=1})=>"hsla("+Math.round(e)+", "+Pt.transform(ho(t))+", "+Pt.transform(ho(a))+", "+ho(vr.transform(r))+")"};var He={test:e=>za.test(e)||gu.test(e)||go.test(e),parse:e=>za.test(e)?za.parse(e):go.test(e)?go.parse(e):gu.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?za.transform(e):go.transform(e)};var GL=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function I_(e){var t,a;return isNaN(e)&&typeof e=="string"&&(((t=e.match(ii))===null||t===void 0?void 0:t.length)||0)+(((a=e.match(GL))===null||a===void 0?void 0:a.length)||0)>0}var XL="number",QL="color",b_="var",k_="var(",KL="${}",P_=/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 yn(e){let t=e.toString(),a=[],r={color:[],number:[],var:[]},o=[],n=0,i=t.replace(P_,l=>(He.test(l)?(r.color.push(n),o.push(QL),a.push(He.parse(l))):l.startsWith(k_)?(r.var.push(n),o.push(b_),a.push(l)):(r.number.push(n),o.push(XL),a.push(parseFloat(l))),++n,KL)).split(KL);return{values:a,split:i,indexes:r,types:o}}function JL(e){return yn(e).values}function YL(e){let{split:t,types:a}=yn(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===XL?n+=ho(o[s]):i===QL?n+=He.transform(o[s]):n+=o[s]}return n}}var T_=e=>typeof e=="number"?0:e;function A_(e){let t=JL(e);return YL(e)(t.map(T_))}var Tt={test:I_,parse:JL,createTransformer:YL,getAnimatableNone:A_};var R_=new Set(["brightness","contrast","saturate","opacity"]);function __(e){let[t,a]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;let[r]=a.match(ii)||[];if(!r)return e;let o=a.replace(r,""),n=R_.has(t)?1:0;return r!==a&&(n*=100),t+"("+n+o+")"}var E_=/\b([a-z-]*)\(.*?\)/gu,yu={...Tt,getAnimatableNone:e=>{let t=e.match(E_);return t?t.map(__).join(" "):e}};var D_={...Ws,color:He,backgroundColor:He,outlineColor:He,fill:He,stroke:He,borderColor:He,borderTopColor:He,borderRightColor:He,borderBottomColor:He,borderLeftColor:He,filter:yu,WebkitFilter:yu},ui=e=>D_[e];function Tf(e,t){let a=ui(e);return a!==yu&&(a=Tt),a.getAnimatableNone?a.getAnimatableNone(t):void 0}var M_=new Set(["auto","none","0"]);function ZL(e,t,a){let r=0,o;for(;r<e.length&&!o;){let n=e[r];typeof n=="string"&&!M_.has(n)&&yn(n).values.length&&(o=e[r]),r++}if(o&&a)for(let n of t)e[n]=Tf(a,o)}var Hg=e=>e===qa||e===H,eI=(e,t)=>parseFloat(e.split(", ")[t]),tI=(e,t)=>(a,{transform:r})=>{if(r==="none"||!r)return 0;let o=r.match(/^matrix3d\((.+)\)$/u);if(o)return eI(o[1],t);{let n=r.match(/^matrix\((.+)\)$/u);return n?eI(n[1],e):0}},N_=new Set(["x","y","z"]),O_=ja.filter(e=>!N_.has(e));function aI(e){let t=[];return O_.forEach(a=>{let r=e.getValue(a);r!==void 0&&(t.push([a,r.get()]),r.set(a.startsWith("scale")?1:0))}),t}var xn={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:tI(4,13),y:tI(5,14)};xn.translateX=xn.x;xn.translateY=xn.y;var vn=new Set,zg=!1,$g=!1;function rI(){if($g){let e=Array.from(vn).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),a=new Map;t.forEach(r=>{let o=aI(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)})}$g=!1,zg=!1,vn.forEach(e=>e.complete()),vn.clear()}function oI(){vn.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&($g=!0)})}function nI(){oI(),rI()}var yo=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?(vn.add(this),zg||(zg=!0,ee.read(oI),ee.resolveKeyframes(rI))):(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),vn.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,vn.delete(this))}resume(){this.isComplete||this.scheduleResolve()}};var Af=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);var F_=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function B_(e){let t=F_.exec(e);if(!t)return[,];let[,a,r,o]=t;return[`--${a??r}`,o]}var U_=4;function Wg(e,t,a=1){Ta(a<=U_,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);let[r,o]=B_(e);if(!r)return;let n=window.getComputedStyle(t).getPropertyValue(r);if(n){let s=n.trim();return Af(s)?parseFloat(s):s}return $s(o)?Wg(o,t,a+1):o}var Rf=e=>t=>t.test(e);var sI={test:e=>e==="auto",parse:e=>e};var Gg=[qa,H,Pt,Ha,hL,mL,sI],Kg=e=>Gg.find(Rf(e));var di=class extends yo{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(),$s(u))){let d=Wg(u,a.current);d!==void 0&&(t[l]=d),l===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!mf.has(r)||t.length!==2)return;let[o,n]=t,s=Kg(o),i=Kg(n);if(s!==i)if(Hg(s)&&Hg(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++)zL(t[o])&&r.push(o);r.length&&ZL(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=xn[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]=xn[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 Xg=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Tt.test(e)||e==="0")&&!e.startsWith("url("));function V_(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 iI(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=Xg(o,t),i=Xg(n,t);return hr(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:V_(e)||(a==="spring"||co(a))&&r}var j_=e=>e!==null;function xo(e,{repeat:t,repeatType:a="loop"},r){let o=e.filter(j_),n=t&&a!=="loop"&&t%2===1?0:o.length-1;return!n||r===void 0?o[n]:r}var q_=40,ci=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=wt.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>q_?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&nI(),this._resolved}onKeyframesResolved(t,a){this.resolvedAt=wt.now(),this.hasAttemptedResolve=!0;let{name:r,type:o,velocity:n,delay:s,onComplete:i,onUpdate:l,isGenerator:u}=this.options;if(!u&&!iI(t,r,o,n))if(xf.current||!s){l&&l(xo(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 Qg(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 lI({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=Qg(l,i,e+1/3),n=Qg(l,i,e),s=Qg(l,i,e-1/3)}return{red:Math.round(o*255),green:Math.round(n*255),blue:Math.round(s*255),alpha:r}}function fi(e,t){return a=>a>0?t:e}var Jg=(e,t,a)=>{let r=e*e,o=a*(t*t-r)+r;return o<0?0:Math.sqrt(o)},H_=[gu,za,go],z_=e=>H_.find(t=>t.test(e));function uI(e){let t=z_(e);if(hr(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let a=t.parse(e);return t===go&&(a=lI(a)),a}var Yg=(e,t)=>{let a=uI(e),r=uI(t);if(!a||!r)return fi(e,t);let o={...a};return n=>(o.red=Jg(a.red,r.red,n),o.green=Jg(a.green,r.green,n),o.blue=Jg(a.blue,r.blue,n),o.alpha=ie(a.alpha,r.alpha,n),za.transform(o))};var $_=(e,t)=>a=>t(e(a)),$a=(...e)=>e.reduce($_);var _f=new Set(["none","hidden"]);function dI(e,t){return _f.has(e)?a=>a<=0?e:t:a=>a>=1?t:e}function W_(e,t){return a=>ie(e,t,a)}function Ef(e){return typeof e=="number"?W_:typeof e=="string"?$s(e)?fi:He.test(e)?Yg:X_:Array.isArray(e)?cI:typeof e=="object"?He.test(e)?Yg:G_:fi}function cI(e,t){let a=[...e],r=a.length,o=e.map((n,s)=>Ef(n)(n,t[s]));return n=>{for(let s=0;s<r;s++)a[s]=o[s](n);return a}}function G_(e,t){let a={...e,...t},r={};for(let o in a)e[o]!==void 0&&t[o]!==void 0&&(r[o]=Ef(e[o])(e[o],t[o]));return o=>{for(let n in r)a[n]=r[n](o);return a}}function K_(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 X_=(e,t)=>{let a=Tt.createTransformer(t),r=yn(e),o=yn(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?_f.has(e)&&!o.values.length||_f.has(t)&&!r.values.length?dI(e,t):$a(cI(K_(r,o),o.values),a):(hr(!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.`),fi(e,t))};function Df(e,t,a){return typeof e=="number"&&typeof t=="number"&&typeof a=="number"?ie(e,t,a):Ef(e)(e,t)}var Q_=5;function Mf(e,t,a){let r=Math.max(t-Q_,0);return gf(a-e(r),t-r)}var Pe={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 Zg=.001;function fI({duration:e=Pe.duration,bounce:t=Pe.bounce,velocity:a=Pe.velocity,mass:r=Pe.mass}){let o,n;hr(e<=Be(Pe.maxDuration),"Spring duration must be 10 seconds or less");let s=1-t;s=ct(Pe.minDamping,Pe.maxDamping,s),e=ct(Pe.minDuration,Pe.maxDuration,dt(e)),s<1?(o=u=>{let d=u*s,c=d*e,f=d-a,g=Nf(u,s),x=Math.exp(-c);return Zg-f/g*x},n=u=>{let c=u*s*e,f=c*a+a,g=Math.pow(s,2)*Math.pow(u,2)*e,x=Math.exp(-c),w=Nf(Math.pow(u,2),s);return(-o(u)+Zg>0?-1:1)*((f-g)*x)/w}):(o=u=>{let d=Math.exp(-u*e),c=(u-a)*e+1;return-Zg+d*c},n=u=>{let d=Math.exp(-u*e),c=(a-u)*(e*e);return d*c});let i=5/e,l=Y_(o,n,i);if(e=Be(e),isNaN(l))return{stiffness:Pe.stiffness,damping:Pe.damping,duration:e};{let u=Math.pow(l,2)*r;return{stiffness:u,damping:s*2*Math.sqrt(r*u),duration:e}}}var J_=12;function Y_(e,t,a){let r=a;for(let o=1;o<J_;o++)r=r-e(r)/t(r);return r}function Nf(e,t){return e*Math.sqrt(1-t*t)}var Z_=["duration","bounce"],eE=["stiffness","damping","mass"];function pI(e,t){return t.some(a=>e[a]!==void 0)}function tE(e){let t={velocity:Pe.velocity,stiffness:Pe.stiffness,damping:Pe.damping,mass:Pe.mass,isResolvedFromDuration:!1,...e};if(!pI(e,eE)&&pI(e,Z_))if(e.visualDuration){let a=e.visualDuration,r=2*Math.PI/(a*1.2),o=r*r,n=2*ct(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:Pe.mass,stiffness:o,damping:n}}else{let a=fI(e);t={...t,...a,mass:Pe.mass},t.isResolvedFromDuration=!0}return t}function Of(e=Pe.visualDuration,t=Pe.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:g}=tE({...a,velocity:-dt(a.velocity||0)}),x=f||0,w=u/(2*Math.sqrt(l*d)),L=s-n,y=dt(Math.sqrt(l/d)),h=Math.abs(L)<5;r||(r=h?Pe.restSpeed.granular:Pe.restSpeed.default),o||(o=h?Pe.restDelta.granular:Pe.restDelta.default);let m;if(w<1){let I=Nf(y,w);m=P=>{let R=Math.exp(-w*y*P);return s-R*((x+w*y*L)/I*Math.sin(I*P)+L*Math.cos(I*P))}}else if(w===1)m=I=>s-Math.exp(-y*I)*(L+(x+y*L)*I);else{let I=y*Math.sqrt(w*w-1);m=P=>{let R=Math.exp(-w*y*P),A=Math.min(I*P,300);return s-R*((x+w*y*L)*Math.sinh(A)+I*L*Math.cosh(A))/I}}let C={calculatedDuration:g&&c||null,next:I=>{let P=m(I);if(g)i.done=I>=c;else{let R=0;w<1&&(R=I===0?Be(x):Mf(m,I,P));let A=Math.abs(R)<=r,q=Math.abs(s-P)<=o;i.done=A&&q}return i.value=i.done?s:P,i},toString:()=>{let I=Math.min(ei(C),2e4),P=pu(R=>C.next(I*R).value,I,30);return I+"ms "+P}};return C}function ey({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},g=A=>i!==void 0&&A<i||l!==void 0&&A>l,x=A=>i===void 0?l:l===void 0||Math.abs(i-A)<Math.abs(l-A)?i:l,w=a*t,L=c+w,y=s===void 0?L:s(L);y!==L&&(w=y-c);let h=A=>-w*Math.exp(-A/r),m=A=>y+h(A),C=A=>{let q=h(A),B=m(A);f.done=Math.abs(q)<=u,f.value=f.done?y:B},I,P,R=A=>{g(f.value)&&(I=A,P=Of({keyframes:[f.value,x(f.value)],velocity:Mf(m,A,f.value),damping:o,stiffness:n,restDelta:u,restSpeed:d}))};return R(0),{calculatedDuration:null,next:A=>{let q=!1;return!P&&I===void 0&&(q=!0,C(A),R(A)),I!==void 0&&A>=I?P.next(A-I):(!q&&C(A),f)}}}var mI=mo(.42,0,1,1),hI=mo(0,0,.58,1),Ff=mo(.42,0,.58,1);var gI=e=>Array.isArray(e)&&typeof e[0]!="number";var yI={linear:ge,easeIn:mI,easeInOut:Ff,easeOut:hI,circIn:Lf,circInOut:bf,circOut:If,backIn:hu,backInOut:Sf,backOut:jg,anticipate:Cf},ty=e=>{if(ti(e)){Ta(e.length===4,"Cubic bezier arrays must contain four numerical values.");let[t,a,r,o]=e;return mo(t,a,r,o)}else if(typeof e=="string")return Ta(yI[e]!==void 0,`Invalid easing type '${e}'`),yI[e];return e};function aE(e,t,a){let r=[],o=a||Df,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]||ge:t;i=$a(l,i)}r.push(i)}return r}function xI(e,t,{clamp:a=!0,ease:r,mixer:o}={}){let n=e.length;if(Ta(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=aE(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=Yt(e[c],e[c+1],d);return i[c](f)};return a?d=>u(ct(e[0],e[n-1],d)):u}function vI(e,t){let a=e[e.length-1];for(let r=1;r<=t;r++){let o=Yt(0,t,r);e.push(ie(a,1,o))}}function wI(e){let t=[0];return vI(t,e.length-1),t}function SI(e,t){return e.map(a=>a*t)}function rE(e,t){return e.map(()=>t||Ff).splice(0,e.length-1)}function xu({duration:e=300,keyframes:t,times:a,ease:r="easeInOut"}){let o=gI(r)?r.map(ty):ty(r),n={done:!1,value:t[0]},s=SI(a&&a.length===t.length?a:wI(t),e),i=xI(s,t,{ease:Array.isArray(o)?o:rE(t,o)});return{calculatedDuration:e,next:l=>(n.value=i(l),n.done=l>=e,n)}}var CI=e=>{let t=({timestamp:a})=>e(a);return{start:()=>ee.update(t,!0),stop:()=>Zt(t),now:()=>Ue.isProcessing?Ue.timestamp:wt.now()}};var oE={decay:ey,inertia:ey,tween:xu,keyframes:xu,spring:Of},nE=e=>e/100,wn=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:a,motionValue:r,element:o,keyframes:n}=this.options,s=o?.KeyframeResolver||yo,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=co(a)?a:oE[a]||xu,l,u;i!==xu&&typeof t[0]!="number"&&(l=$a(nE,Df(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=ei(d));let{calculatedDuration:c}=d,f=c+o,g=f*(r+1)-o;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:c,resolvedDuration:f,totalDuration:g}}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:A}=this.options;return{done:!0,value:A[A.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:g,repeatType:x,repeatDelay:w,onUpdate:L}=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 y=this.currentTime-f*(this.speed>=0?1:-1),h=this.speed>=0?y<0:y>d;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let m=this.currentTime,C=n;if(g){let A=Math.min(this.currentTime,d)/c,q=Math.floor(A),B=A%1;!B&&A>=1&&(B=1),B===1&&q--,q=Math.min(q,g+1),q%2&&(x==="reverse"?(B=1-B,w&&(B-=w/c)):x==="mirror"&&(C=s)),m=ct(0,1,B)*c}let I=h?{done:!1,value:l[0]}:C.next(m);i&&(I.value=i(I.value));let{done:P}=I;!h&&u!==null&&(P=this.speed>=0?this.currentTime>=d:this.currentTime<=0);let R=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&P);return R&&o!==void 0&&(I.value=xo(l,this.options,o)),L&&L(I.value),R&&this.finish(),I}get duration(){let{resolved:t}=this;return t?dt(t.calculatedDuration):0}get time(){return dt(this.currentTime)}set time(t){t=Be(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=dt(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;let{driver:t=CI,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 LI=new Set(["opacity","clipPath","filter","transform"]);function II(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=ri(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 bI=pn(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));var Bf=10,sE=2e4;function iE(e){return co(e.type)||e.type==="spring"||!cf(e.ease)}function lE(e,t){let a=new wn({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0}),r={done:!1,value:e[0]},o=[],n=0;for(;!r.done&&n<sE;)r=a.sample(n),o.push(r.value),n+=Bf;return{times:void 0,keyframes:o,duration:n-Bf,ease:"linear"}}var kI={anticipate:Cf,backInOut:Sf,circInOut:bf};function uE(e){return e in kI}var vu=class extends ci{constructor(t){super(t);let{name:a,motionValue:r,element:o,keyframes:n}=this.options;this.resolver=new di(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"&&fo()&&uE(n)&&(n=kI[n]),iE(this.options)){let{onComplete:c,onUpdate:f,motionValue:g,element:x,...w}=this.options,L=lE(t,w);t=L.keyframes,t.length===1&&(t[1]=t[0]),r=L.duration,o=L.times,n=L.ease,s="keyframes"}let d=II(i.owner.current,l,t,{...this.options,duration:r,times:o,ease:n});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(fu(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{let{onComplete:c}=this.options;i.set(xo(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 dt(a)}get time(){let{resolved:t}=this;if(!t)return 0;let{animation:a}=t;return dt(a.currentTime||0)}set time(t){let{resolved:a}=this;if(!a)return;let{animation:r}=a;r.currentTime=Be(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 ge;let{animation:r}=a;fu(r,t)}return ge}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,...g}=this.options,x=new wn({...g,keyframes:r,duration:o,type:n,ease:s,times:i,isGenerator:!0}),w=Be(this.time);u.setWithVelocity(x.sample(w-Bf).value,x.sample(w).value,Bf)}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 bI()&&r&&LI.has(r)&&!l&&!u&&!o&&n!=="mirror"&&s!==0&&i!=="inertia"}};var dE={type:"spring",stiffness:500,damping:25,restSpeed:10},cE=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),fE={type:"keyframes",duration:.8},pE={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},PI=(e,{keyframes:t})=>t.length>2?fE:Vt.has(e)?e.startsWith("scale")?cE(t[1]):dE:pE;function TI({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 pi=(e,t,a,r={},o,n)=>s=>{let i=uo(r,e)||{},l=i.delay||r.delay||0,{elapsed:u=0}=r;u=u-Be(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};TI(i)||(d={...d,...PI(e,d)}),d.duration&&(d.duration=Be(d.duration)),d.repeatDelay&&(d.repeatDelay=Be(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)),(xf.current||Bs.skipAnimations)&&(c=!0,d.duration=0,d.delay=0),c&&!n&&t.get()!==void 0){let f=xo(d.keyframes,i);if(f!==void 0)return ee.update(()=>{d.onUpdate(f),d.onComplete()}),new cu([])}return!n&&vu.supports(d)?new vu(d):new wn(d)};function mE({protectedKeys:e,needsAnimating:t},a){let r=e.hasOwnProperty(a)&&t[a]!==!0;return t[a]=!1,r}function Uf(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),g=l[c];if(g===void 0||d&&mE(d,c))continue;let x={delay:a,...uo(s||{},c)},w=!1;if(window.MotionHandoffAnimation){let y=yf(e);if(y){let h=window.MotionHandoffAnimation(y,c,ee);h!==null&&(x.startTime=h,w=!0)}}mu(e,c),f.start(pi(c,f,g,e.shouldReduceMotion&&mf.has(c)?{type:!1}:x,e,w));let L=f.animation;L&&u.push(L)}return i&&Promise.all(u).then(()=>{ee.update(()=>{i&&jL(e,i)})}),u}function Vf(e,t,a={}){var r;let o=lo(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(Uf(e,o,a)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(u=0)=>{let{delayChildren:d=0,staggerChildren:c,staggerDirection:f}=n;return hE(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 hE(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(gE).forEach((u,d)=>{u.notify("AnimationStart",t),s.push(Vf(u,t,{...n,delay:a+l(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(s)}function gE(e,t){return e.sortNodePosition(t)}function AI(e,t,a={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){let o=t.map(n=>Vf(e,n,a));r=Promise.all(o)}else if(typeof t=="string")r=Vf(e,t,a);else{let o=typeof t=="function"?lo(e,t,a.custom):t;r=Promise.all(Uf(e,o,a))}return r.then(()=>{e.notify("AnimationComplete",t)})}var yE=su.length;function ay(e){if(!e)return;if(!e.isControllingVariants){let a=e.parent?ay(e.parent)||{}:{};return e.props.initial!==void 0&&(a.initial=e.props.initial),a}let t={};for(let a=0;a<yE;a++){let r=su[a],o=e.props[r];(yr(o)||o===!1)&&(t[r]=o)}return t}var xE=[...Kc].reverse(),vE=Kc.length;function wE(e){return t=>Promise.all(t.map(({animation:a,options:r})=>AI(e,a,r)))}function _I(e){let t=wE(e),a=RI(),r=!0,o=l=>(u,d)=>{var c;let f=lo(e,d,l==="exit"?(c=e.presenceContext)===null||c===void 0?void 0:c.custom:void 0);if(f){let{transition:g,transitionEnd:x,...w}=f;u={...u,...w,...x}}return u};function n(l){t=l(e)}function s(l){let{props:u}=e,d=ay(e.parent)||{},c=[],f=new Set,g={},x=1/0;for(let L=0;L<vE;L++){let y=xE[L],h=a[y],m=u[y]!==void 0?u[y]:d[y],C=yr(m),I=y===l?h.isActive:null;I===!1&&(x=L);let P=m===d[y]&&m!==u[y]&&C;if(P&&r&&e.manuallyAnimateOnMount&&(P=!1),h.protectedKeys={...g},!h.isActive&&I===null||!m&&!h.prevProp||io(m)||typeof m=="boolean")continue;let R=SE(h.prevProp,m),A=R||y===l&&h.isActive&&!P&&C||L>x&&C,q=!1,B=Array.isArray(m)?m:[m],J=B.reduce(o(y),{});I===!1&&(J={});let{prevResolvedValues:ue={}}=h,pt={...ue,...J},Xa=xe=>{A=!0,f.has(xe)&&(q=!0,f.delete(xe)),h.needsAnimating[xe]=!0;let ze=e.getValue(xe);ze&&(ze.liveStyle=!1)};for(let xe in pt){let ze=J[xe],Ht=ue[xe];if(g.hasOwnProperty(xe))continue;let ma=!1;iu(ze)&&iu(Ht)?ma=!_g(ze,Ht):ma=ze!==Ht,ma?ze!=null?Xa(xe):f.add(xe):ze!==void 0&&f.has(xe)?Xa(xe):h.protectedKeys[xe]=!0}h.prevProp=m,h.prevResolvedValues=J,h.isActive&&(g={...g,...J}),r&&e.blockInitialAnimation&&(A=!1),A&&(!(P&&R)||q)&&c.push(...B.map(xe=>({animation:xe,options:{type:y}})))}if(f.size){let L={};f.forEach(y=>{let h=e.getBaseTarget(y),m=e.getValue(y);m&&(m.liveStyle=!0),L[y]=h??null}),c.push({animation:L})}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 g;return(g=f.animationState)===null||g===void 0?void 0:g.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 SE(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!_g(t,e):!1}function Sn(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function RI(){return{animate:Sn(!0),whileInView:Sn(),whileHover:Sn(),whileTap:Sn(),whileDrag:Sn(),whileFocus:Sn(),exit:Sn()}}var rt=class{constructor(t){this.isMounted=!1,this.node=t}update(){}};var jf=class extends rt{constructor(t){super(t),t.animationState||(t.animationState=_I(t))}updateAnimationControlsSubscription(){let{animate:t}=this.node.getProps();io(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 CE=0,qf=class extends rt{constructor(){super(...arguments),this.id=CE++}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 EI={animation:{Feature:jf},exit:{Feature:qf}};function Sr(e,t,a,r={passive:!0}){return e.addEventListener(t,a,r),()=>e.removeEventListener(t,a)}function Cr(e){return{point:{x:e.pageX,y:e.pageY}}}var DI=e=>t=>hn(t)&&e(t,Cr(t));function vo(e,t,a,r){return Sr(e,t,DI(a),r)}var MI=(e,t)=>Math.abs(e-t);function NI(e,t){let a=MI(e.x,t.x),r=MI(e.y,t.y);return Math.sqrt(a**2+r**2)}var mi=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=oy(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,g=NI(c.offset,{x:0,y:0})>=3;if(!f&&!g)return;let{point:x}=c,{timestamp:w}=Ue;this.history.push({...x,timestamp:w});let{onStart:L,onMove:y}=this.handlers;f||(L&&L(this.lastMoveEvent,c),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,c)},this.handlePointerMove=(c,f)=>{this.lastMoveEvent=c,this.lastMoveEventInfo=ry(f,this.transformPagePoint),ee.update(this.updatePoint,!0)},this.handlePointerUp=(c,f)=>{this.end();let{onEnd:g,onSessionEnd:x,resumeAnimation:w}=this.handlers;if(this.dragSnapToOrigin&&w&&w(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let L=oy(c.type==="pointercancel"?this.lastMoveEventInfo:ry(f,this.transformPagePoint),this.history);this.startEvent&&g&&g(c,L),x&&x(c,L)},!hn(t))return;this.dragSnapToOrigin=n,this.handlers=a,this.transformPagePoint=r,this.contextWindow=o||window;let s=Cr(t),i=ry(s,this.transformPagePoint),{point:l}=i,{timestamp:u}=Ue;this.history=[{...l,timestamp:u}];let{onSessionStart:d}=a;d&&d(t,oy(i,this.history)),this.removeListeners=$a(vo(this.contextWindow,"pointermove",this.handlePointerMove),vo(this.contextWindow,"pointerup",this.handlePointerUp),vo(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Zt(this.updatePoint)}};function ry(e,t){return t?{point:t(e.point)}:e}function OI(e,t){return{x:e.x-t.x,y:e.y-t.y}}function oy({point:e},t){return{point:e,delta:OI(e,FI(t)),offset:OI(e,LE(t)),velocity:IE(t,.1)}}function LE(e){return e[0]}function FI(e){return e[e.length-1]}function IE(e,t){if(e.length<2)return{x:0,y:0};let a=e.length-1,r=null,o=FI(e);for(;a>=0&&(r=e[a],!(o.timestamp-r.timestamp>Be(t)));)a--;if(!r)return{x:0,y:0};let n=dt(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 jI=1e-4,bE=1-jI,kE=1+jI,qI=.01,PE=0-qI,TE=0+qI;function ft(e){return e.max-e.min}function HI(e,t,a){return Math.abs(e-t)<=a}function BI(e,t,a,r=.5){e.origin=r,e.originPoint=ie(t.min,t.max,e.origin),e.scale=ft(a)/ft(t),e.translate=ie(a.min,a.max,e.origin)-e.originPoint,(e.scale>=bE&&e.scale<=kE||isNaN(e.scale))&&(e.scale=1),(e.translate>=PE&&e.translate<=TE||isNaN(e.translate))&&(e.translate=0)}function hi(e,t,a,r){BI(e.x,t.x,a.x,r?r.originX:void 0),BI(e.y,t.y,a.y,r?r.originY:void 0)}function UI(e,t,a){e.min=a.min+t.min,e.max=e.min+ft(t)}function zI(e,t,a){UI(e.x,t.x,a.x),UI(e.y,t.y,a.y)}function VI(e,t,a){e.min=t.min-a.min,e.max=e.min+ft(t)}function gi(e,t,a){VI(e.x,t.x,a.x),VI(e.y,t.y,a.y)}function XI(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 $I(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 QI(e,{top:t,left:a,bottom:r,right:o}){return{x:$I(e.x,a,o),y:$I(e.y,t,r)}}function WI(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 JI(e,t){return{x:WI(e.x,t.x),y:WI(e.y,t.y)}}function YI(e,t){let a=.5,r=ft(e),o=ft(t);return o>r?a=Yt(t.min,t.max-r,e.min):r>o&&(a=Yt(e.min,e.max-o,t.min)),ct(0,1,a)}function ZI(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 Hf=.35;function eb(e=Hf){return e===!1?e=0:e===!0&&(e=Hf),{x:GI(e,"left","right"),y:GI(e,"top","bottom")}}function GI(e,t,a){return{min:KI(e,t),max:KI(e,a)}}function KI(e,t){return typeof e=="number"?e:e[t]||0}var tb=()=>({translate:0,scale:1,origin:0,originPoint:0}),Cn=()=>({x:tb(),y:tb()}),ab=()=>({min:0,max:0}),Te=()=>({x:ab(),y:ab()});function jt(e){return[e("x"),e("y")]}function zf({top:e,left:t,right:a,bottom:r}){return{x:{min:t,max:a},y:{min:e,max:r}}}function rb({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function ob(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 ny(e){return e===void 0||e===1}function $f({scale:e,scaleX:t,scaleY:a}){return!ny(e)||!ny(t)||!ny(a)}function Lr(e){return $f(e)||sy(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function sy(e){return nb(e.x)||nb(e.y)}function nb(e){return e&&e!=="0%"}function wu(e,t,a){let r=e-a,o=t*r;return a+o}function sb(e,t,a,r,o){return o!==void 0&&(e=wu(e,o,r)),wu(e,a,r)+t}function iy(e,t=0,a=1,r,o){e.min=sb(e.min,t,a,r,o),e.max=sb(e.max,t,a,r,o)}function ly(e,{x:t,y:a}){iy(e.x,t.translate,t.scale,t.originPoint),iy(e.y,a.translate,a.scale,a.originPoint)}var ib=.999999999999,lb=1.0000000000001;function db(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&&Ln(e,{x:-n.scroll.offset.x,y:-n.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,ly(e,s)),r&&Lr(n.latestValues)&&Ln(e,n.latestValues))}t.x<lb&&t.x>ib&&(t.x=1),t.y<lb&&t.y>ib&&(t.y=1)}function wo(e,t){e.min=e.min+t,e.max=e.max+t}function ub(e,t,a,r,o=.5){let n=ie(e.min,e.max,o);iy(e,t,a,n,r)}function Ln(e,t){ub(e.x,t.x,t.scaleX,t.scale,t.originX),ub(e.y,t.y,t.scaleY,t.scale,t.originY)}function uy(e,t){return zf(ob(e.getBoundingClientRect(),t))}function cb(e,t,a){let r=uy(e,a),{scroll:o}=t;return o&&(wo(r.x,o.offset.x),wo(r.y,o.offset.y)),r}var Wf=({current:e})=>e?e.ownerDocument.defaultView:null;var AE=new WeakMap,Kf=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=Te(),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(Cr(d).point)},n=(d,c)=>{let{drag:f,dragPropagation:g,onDragStart:x}=this.getProps();if(f&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Ug(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),jt(L=>{let y=this.getAxisMotionValue(L).get()||0;if(Pt.test(y)){let{projection:h}=this.visualElement;if(h&&h.layout){let m=h.layout.layoutBox[L];m&&(y=ft(m)*(parseFloat(y)/100))}}this.originPoint[L]=y}),x&&ee.postRender(()=>x(d,c)),mu(this.visualElement,"transform");let{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},s=(d,c)=>{let{dragPropagation:f,dragDirectionLock:g,onDirectionLock:x,onDrag:w}=this.getProps();if(!f&&!this.openDragLock)return;let{offset:L}=c;if(g&&this.currentDirection===null){this.currentDirection=RE(L),this.currentDirection!==null&&x&&x(this.currentDirection);return}this.updateAxis("x",c.point,L),this.updateAxis("y",c.point,L),this.visualElement.render(),w&&w(d,c)},i=(d,c)=>this.stop(d,c),l=()=>jt(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 mi(t,{onSessionStart:o,onStart:n,onMove:s,onSessionEnd:i,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:Wf(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&&ee.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||!Gf(t,o,this.currentDirection))return;let n=this.getAxisMotionValue(t),s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=XI(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&&xr(a)?this.constraints||(this.constraints=this.resolveRefConstraints()):a&&o?this.constraints=QI(o.layoutBox,a):this.constraints=!1,this.elastic=eb(r),n!==this.constraints&&o&&this.constraints&&!this.hasMutatedConstraints&&jt(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=ZI(o.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){let{dragConstraints:t,onMeasureDragConstraints:a}=this.getProps();if(!t||!xr(t))return!1;let r=t.current;Ta(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=cb(r,o.root,this.visualElement.getTransformPagePoint()),s=JI(o.layout.layoutBox,n);if(a){let i=a(rb(s));this.hasMutatedConstraints=!!i,i&&(s=zf(i))}return s}startAnimation(t){let{drag:a,dragMomentum:r,dragElastic:o,dragTransition:n,dragSnapToOrigin:s,onDragTransitionEnd:i}=this.getProps(),l=this.constraints||{},u=jt(d=>{if(!Gf(d,a,this.currentDirection))return;let c=l&&l[d]||{};s&&(c={min:0,max:0});let f=o?200:1e6,g=o?40:1e7,x={type:"inertia",velocity:r?t[d]:0,bounceStiffness:f,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10,...n,...c};return this.startAxisValueAnimation(d,x)});return Promise.all(u).then(i)}startAxisValueAnimation(t,a){let r=this.getAxisMotionValue(t);return mu(this.visualElement,t),r.start(pi(t,r,0,a,this.visualElement,!1))}stopAnimation(){jt(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){jt(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){jt(a=>{let{drag:r}=this.getProps();if(!Gf(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(!xr(a)||!r||!this.constraints)return;this.stopAnimation();let o={x:0,y:0};jt(s=>{let i=this.getAxisMotionValue(s);if(i&&this.constraints!==!1){let l=i.get();o[s]=YI({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(),jt(s=>{if(!Gf(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;AE.set(this.visualElement,this);let t=this.visualElement.current,a=vo(t,"pointerdown",l=>{let{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(l)}),r=()=>{let{dragConstraints:l}=this.getProps();xr(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()),ee.read(r);let s=Sr(window,"resize",()=>this.scalePositionWithinConstraints()),i=o.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(jt(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=Hf,dragMomentum:i=!0}=t;return{...t,drag:a,dragDirectionLock:r,dragPropagation:o,dragConstraints:n,dragElastic:s,dragMomentum:i}}};function Gf(e,t,a){return(t===!0||t===e)&&(a===null||a===e)}function RE(e,t=10){let a=null;return Math.abs(e.y)>t?a="y":Math.abs(e.x)>t&&(a="x"),a}var Xf=class extends rt{constructor(t){super(t),this.removeGroupControls=ge,this.removeListeners=ge,this.controls=new Kf(t)}mount(){let{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ge}unmount(){this.removeGroupControls(),this.removeListeners()}};var fb=e=>(t,a)=>{e&&ee.postRender(()=>e(t,a))},Qf=class extends rt{constructor(){super(...arguments),this.removePointerDownListener=ge}onPointerDown(t){this.session=new mi(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Wf(this.node)})}createPanHandlers(){let{onPanSessionStart:t,onPanStart:a,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:fb(t),onStart:fb(a),onMove:r,onEnd:(n,s)=>{delete this.session,o&&ee.postRender(()=>o(n,s))}}}mount(){this.removePointerDownListener=vo(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 hb=M(le(),1),Su=M(G(),1);var yi={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function pb(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var xi={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(H.test(e))e=parseFloat(e);else return e;let a=pb(e,t.target.x),r=pb(e,t.target.y);return`${a}% ${r}%`}};var mb={correct:(e,{treeScale:t,projectionDelta:a})=>{let r=e,o=Tt.parse(e);if(o.length>5)return r;let n=Tt.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 dy=class extends Su.Component{componentDidMount(){let{visualElement:t,layoutGroup:a,switchLayoutGroup:r,layoutId:o}=this.props,{projection:n}=t;CL(_E),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()})),yi.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()||ee.postRender(()=>{let i=s.getStack();(!i||!i.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){let{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Vs.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 Jf(e){let[t,a]=Vc(),r=(0,Su.useContext)(Ms);return(0,hb.jsx)(dy,{...e,layoutGroup:r,switchLayoutGroup:(0,Su.useContext)(Yc),isPresent:t,safeToRemove:a})}var _E={borderRadius:{...xi,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:xi,borderTopRightRadius:xi,borderBottomLeftRadius:xi,borderBottomRightRadius:xi,boxShadow:mb};function gb(e,t,a){let r=Ce(e)?e:wr(e);return r.start(pi("",r,t,a)),r.animation}function yb(e){return e instanceof SVGElement&&e.tagName!=="svg"}var xb=(e,t)=>e.depth-t.depth;var Yf=class{constructor(){this.children=[],this.isDirty=!1}add(t){ni(this.children,t),this.isDirty=!0}remove(t){si(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(xb),this.isDirty=!1,this.children.forEach(t)}};function vb(e,t){let a=wt.now(),r=({timestamp:o})=>{let n=o-a;n>=t&&(Zt(r),e(n-t))};return ee.read(r,!0),()=>Zt(r)}var Lb=["TopLeft","TopRight","BottomLeft","BottomRight"],EE=Lb.length,wb=e=>typeof e=="string"?parseFloat(e):e,Sb=e=>typeof e=="number"||H.test(e);function Ib(e,t,a,r,o,n){o?(e.opacity=ie(0,a.opacity!==void 0?a.opacity:1,DE(r)),e.opacityExit=ie(t.opacity!==void 0?t.opacity:1,0,ME(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<EE;s++){let i=`border${Lb[s]}Radius`,l=Cb(t,i),u=Cb(a,i);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||Sb(l)===Sb(u)?(e[i]=Math.max(ie(wb(l),wb(u),r),0),(Pt.test(u)||Pt.test(l))&&(e[i]+="%")):e[i]=u}(t.rotate||a.rotate)&&(e.rotate=ie(t.rotate||0,a.rotate||0,r))}function Cb(e,t){return e[t]!==void 0?e[t]:e.borderRadius}var DE=bb(0,.5,If),ME=bb(.5,.95,ge);function bb(e,t,a){return r=>r<e?0:r>t?1:a(Yt(e,t,r))}function kb(e,t){e.min=t.min,e.max=t.max}function ta(e,t){kb(e.x,t.x),kb(e.y,t.y)}function cy(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Pb(e,t,a,r,o){return e-=t,e=wu(e,1/a,r),o!==void 0&&(e=wu(e,1/o,r)),e}function NE(e,t=0,a=1,r=.5,o,n=e,s=e){if(Pt.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=Pb(e.min,t,a,i,o),e.max=Pb(e.max,t,a,i,o)}function Tb(e,t,[a,r,o],n,s){NE(e,t[a],t[r],t[o],t.scale,n,s)}var OE=["x","scaleX","originX"],FE=["y","scaleY","originY"];function fy(e,t,a,r){Tb(e.x,t,OE,a?a.x:void 0,r?r.x:void 0),Tb(e.y,t,FE,a?a.y:void 0,r?r.y:void 0)}function Ab(e){return e.translate===0&&e.scale===1}function py(e){return Ab(e.x)&&Ab(e.y)}function Rb(e,t){return e.min===t.min&&e.max===t.max}function Eb(e,t){return Rb(e.x,t.x)&&Rb(e.y,t.y)}function _b(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function my(e,t){return _b(e.x,t.x)&&_b(e.y,t.y)}function hy(e){return ft(e.x)/ft(e.y)}function gy(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var Zf=class{constructor(){this.members=[]}add(t){ni(this.members,t),t.scheduleRender()}remove(t){if(si(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 Db(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:g,skewY:x}=a;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),c&&(r+=`rotateX(${c}deg) `),f&&(r+=`rotateY(${f}deg) `),g&&(r+=`skewX(${g}deg) `),x&&(r+=`skewY(${x}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 In={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Cu=typeof window<"u"&&window.MotionDebug!==void 0,yy=["","X","Y","Z"],BE={visibility:"hidden"},Mb=1e3,UE=0;function xy(e,t,a,r){let{latestValues:o}=t;o[e]&&(a[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function qb(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let a=yf(t);if(window.MotionHasOptimisedAnimation(a,"transform")){let{layout:o,layoutId:n}=e.options;window.MotionCancelOptimisedAnimation(a,"transform",ee,!(o||n))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&qb(r)}function ep({attachResizeListener:e,defaultParent:t,measureScroll:a,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(s={},i=t?.()){this.id=UE++,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,Cu&&(In.totalNodes=In.resolvedTargetDeltas=In.recalculatedProjection=0),this.nodes.forEach(qE),this.nodes.forEach(GE),this.nodes.forEach(KE),this.nodes.forEach(HE),Cu&&window.MotionDebug.record(In)},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 Yf)}addEventListener(s,i){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new po),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=yb(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=vb(f,250),yi.hasAnimatedSinceResize&&(yi.hasAnimatedSinceResize=!1,this.nodes.forEach(Ob))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||u)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:f,hasRelativeTargetChanged:g,layout:x})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let w=this.options.transition||d.getDefaultTransition()||ZE,{onLayoutAnimationStart:L,onLayoutAnimationComplete:y}=d.getProps(),h=!this.targetLayout||!my(this.targetLayout,x)||g,m=!f&&g;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||m||f&&(h||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(c,m);let C={...uo(w,"layout"),onPlay:L,onComplete:y};(d.shouldReduceMotion||this.options.layoutRoot)&&(C.delay=0,C.type=!1),this.startAnimation(C)}else f||Ob(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,Zt(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(XE),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&&qb(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(Nb);return}this.isUpdating||this.nodes.forEach($E),this.isUpdating=!1,this.nodes.forEach(WE),this.nodes.forEach(VE),this.nodes.forEach(jE),this.clearAllSnapshots();let i=wt.now();Ue.delta=ct(0,1e3/60,i-Ue.timestamp),Ue.timestamp=i,Ue.isProcessing=!0,Wc.update.process(Ue),Wc.preRender.process(Ue),Wc.render.process(Ue),Ue.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Vs.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(zE),this.sharedNodes.forEach(QE)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ee.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ee.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=Te(),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&&!py(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;s&&(i||Lr(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)),eD(l),{animationId:this.root.animationId,measuredBox:i,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var s;let{visualElement:i}=this.options;if(!i)return Te();let l=i.measureViewportBox();if(!(((s=this.scroll)===null||s===void 0?void 0:s.wasRoot)||this.path.some(tD))){let{scroll:d}=this.root;d&&(wo(l.x,d.offset.x),wo(l.y,d.offset.y))}return l}removeElementScroll(s){var i;let l=Te();if(ta(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&&ta(l,s),wo(l.x,c.offset.x),wo(l.y,c.offset.y))}return l}applyTransform(s,i=!1){let l=Te();ta(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&&Ln(l,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),Lr(d.latestValues)&&Ln(l,d.latestValues)}return Lr(this.latestValues)&&Ln(l,this.latestValues),l}removeTransform(s){let i=Te();ta(i,s);for(let l=0;l<this.path.length;l++){let u=this.path[l];if(!u.instance||!Lr(u.latestValues))continue;$f(u.latestValues)&&u.updateSnapshot();let d=Te(),c=u.measurePageBox();ta(d,c),fy(i,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return Lr(this.latestValues)&&fy(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!==Ue.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=Ue.timestamp,!this.targetDelta&&!this.relativeTarget){let g=this.getClosestProjectingParent();g&&g.layout&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Te(),this.relativeTargetOrigin=Te(),gi(this.relativeTargetOrigin,this.layout.layoutBox,g.layout.layoutBox),ta(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Te(),this.targetWithTransforms=Te()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),zI(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ta(this.target,this.layout.layoutBox),ly(this.target,this.targetDelta)):ta(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;let g=this.getClosestProjectingParent();g&&!!g.resumingFrom==!!this.resumingFrom&&!g.options.layoutScroll&&g.target&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Te(),this.relativeTargetOrigin=Te(),gi(this.relativeTargetOrigin,this.target,g.target),ta(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Cu&&In.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||$f(this.parent.latestValues)||sy(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===Ue.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;ta(this.layoutCorrected,this.layout.layoutBox);let f=this.treeScale.x,g=this.treeScale.y;db(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=Te());let{target:x}=i;if(!x){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(cy(this.prevProjectionDelta.x,this.projectionDelta.x),cy(this.prevProjectionDelta.y,this.projectionDelta.y)),hi(this.projectionDelta,this.layoutCorrected,x,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==g||!gy(this.projectionDelta.x,this.prevProjectionDelta.x)||!gy(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",x)),Cu&&In.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=Cn(),this.projectionDelta=Cn(),this.projectionDeltaWithTransform=Cn()}setAnimationOrigin(s,i=!1){let l=this.snapshot,u=l?l.latestValues:{},d={...this.latestValues},c=Cn();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!i;let f=Te(),g=l?l.source:void 0,x=this.layout?this.layout.source:void 0,w=g!==x,L=this.getStack(),y=!L||L.members.length<=1,h=!!(w&&!y&&this.options.crossfade===!0&&!this.path.some(YE));this.animationProgress=0;let m;this.mixTargetDelta=C=>{let I=C/1e3;Fb(c.x,s.x,I),Fb(c.y,s.y,I),this.setTargetDelta(c),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(gi(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),JE(this.relativeTarget,this.relativeTargetOrigin,f,I),m&&Eb(this.relativeTarget,m)&&(this.isProjectionDirty=!1),m||(m=Te()),ta(m,this.relativeTarget)),w&&(this.animationValues=d,Ib(d,u,this.latestValues,I,h,y)),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&&(Zt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ee.update(()=>{yi.hasAnimatedSinceResize=!0,this.currentAnimation=gb(0,Mb,{...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(Mb),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&&Hb(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Te();let c=ft(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+c;let f=ft(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+f}ta(i,l),Ln(i,d),hi(this.projectionDeltaWithTransform,this.layoutCorrected,i,d)}}registerSharedNode(s,i){this.sharedNodes.has(s)||this.sharedNodes.set(s,new Zf),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&&xy("z",s,u,this.animationValues);for(let d=0;d<yy.length;d++)xy(`rotate${yy[d]}`,s,u,this.animationValues),xy(`skew${yy[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 BE;let u={visibility:""},d=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=zs(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=zs(s?.pointerEvents)||""),this.hasProjected&&!Lr(this.latestValues)&&(w.transform=d?d({},""):"none",this.hasProjected=!1),w}let f=c.animationValues||c.latestValues;this.applyTransformsToTarget(),u.transform=Db(this.projectionDeltaWithTransform,this.treeScale,f),d&&(u.transform=d(f,u.transform));let{x:g,y:x}=this.projectionDelta;u.transformOrigin=`${g.origin*100}% ${x.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 Js){if(f[w]===void 0)continue;let{correct:L,applyTo:y}=Js[w],h=u.transform==="none"?f[w]:L(f[w],c);if(y){let m=y.length;for(let C=0;C<m;C++)u[y[C]]=h}else u[w]=h}return this.options.layoutId&&(u.pointerEvents=c===this?zs(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(Nb),this.root.sharedNodes.clear()}}}function VE(e){e.updateLayout()}function jE(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"?jt(c=>{let f=s?a.measuredBox[c]:a.layoutBox[c],g=ft(f);f.min=r[c].min,f.max=f.min+g}):Hb(n,a.layoutBox,r)&&jt(c=>{let f=s?a.measuredBox[c]:a.layoutBox[c],g=ft(r[c]);f.max=f.min+g,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[c].max=e.relativeTarget[c].min+g)});let i=Cn();hi(i,r,a.layoutBox);let l=Cn();s?hi(l,e.applyTransform(o,!0),a.measuredBox):hi(l,r,a.layoutBox);let u=!py(i),d=!1;if(!e.resumeFrom){let c=e.getClosestProjectingParent();if(c&&!c.resumeFrom){let{snapshot:f,layout:g}=c;if(f&&g){let x=Te();gi(x,a.layoutBox,f.layoutBox);let w=Te();gi(w,r,g.layoutBox),my(x,w)||(d=!0),c.options.layoutRoot&&(e.relativeTarget=w,e.relativeTargetOrigin=x,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 qE(e){Cu&&In.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 HE(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function zE(e){e.clearSnapshot()}function Nb(e){e.clearMeasurements()}function $E(e){e.isLayoutDirty=!1}function WE(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Ob(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function GE(e){e.resolveTargetDelta()}function KE(e){e.calcProjection()}function XE(e){e.resetSkewAndRotation()}function QE(e){e.removeLeadSnapshot()}function Fb(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 Bb(e,t,a,r){e.min=ie(t.min,a.min,r),e.max=ie(t.max,a.max,r)}function JE(e,t,a,r){Bb(e.x,t.x,a.x,r),Bb(e.y,t.y,a.y,r)}function YE(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var ZE={duration:.45,ease:[.4,0,.1,1]},Ub=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Vb=Ub("applewebkit/")&&!Ub("chrome/")?Math.round:ge;function jb(e){e.min=Vb(e.min),e.max=Vb(e.max)}function eD(e){jb(e.x),jb(e.y)}function Hb(e,t,a){return e==="position"||e==="preserve-aspect"&&!HI(hy(t),hy(a),.2)}function tD(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}var zb=ep({attachResizeListener:(e,t)=>Sr(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0});var vy={current:void 0},tp=ep({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!vy.current){let e=new zb({});e.mount(window),e.setOptions({layoutScroll:!0}),vy.current=e}return vy.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"});var $b={pan:{Feature:Qf},drag:{Feature:Xf,ProjectionNode:tp,MeasureLayout:Jf}};function Wb(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&&ee.postRender(()=>n(t,Cr(t)))}var ap=class extends rt{mount(){let{current:t}=this.node;t&&(this.unmount=Og(t,a=>(Wb(this.node,a,"Start"),r=>Wb(this.node,r,"End"))))}unmount(){}};var rp=class extends rt{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=$a(Sr(this.node.current,"focus",()=>this.onFocus()),Sr(this.node.current,"blur",()=>this.onBlur()))}unmount(){}};function Gb(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&&ee.postRender(()=>n(t,Cr(t)))}var op=class extends rt{mount(){let{current:t}=this.node;t&&(this.unmount=Bg(t,a=>(Gb(this.node,a,"Start"),(r,{success:o})=>Gb(this.node,r,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}};var Sy=new WeakMap,wy=new WeakMap,aD=e=>{let t=Sy.get(e.target);t&&t(e)},rD=e=>{e.forEach(aD)};function oD({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(rD,{root:e,...t})),r[o]}function Kb(e,t,a){let r=oD(t);return Sy.set(e,a),r.observe(e),()=>{Sy.delete(e),r.unobserve(e)}}var nD={some:0,all:1},np=class extends rt{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:nD[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 Kb(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(sD(t,a))&&this.startObserver()}unmount(){}};function sD({viewport:e={}},{viewport:t={}}={}){return a=>e[a]!==t[a]}var Xb={inView:{Feature:np},tap:{Feature:op},focus:{Feature:rp},hover:{Feature:ap}};var Qb={layout:{ProjectionNode:tp,MeasureLayout:Jf}};var tk=M(G(),1);var Lu={current:null},sp={current:!1};function Jb(){if(sp.current=!0,!!Fs)if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Lu.current=e.matches;e.addListener(t),t()}else Lu.current=!1}var iD=[...Gg,He,Tt],Yb=e=>iD.find(Rf(e));var Cy=new WeakMap;function Zb(e,t,a){for(let r in t){let o=t[r],n=a[r];if(Ce(o))e.addValue(r,o);else if(Ce(n))e.addValue(r,wr(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,wr(s!==void 0?s:o,{owner:e}))}}for(let r in a)t[r]===void 0&&e.removeValue(r);return t}var ek=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],ip=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=yo,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 g=wt.now();this.renderScheduledAt<g&&(this.renderScheduledAt=g,ee.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=mn(a),this.isVariantNode=Xc(a),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);let{willChange:c,...f}=this.scrapeMotionValuesFromProps(a,{},this);for(let g in f){let x=f[g];l[g]!==void 0&&Ce(x)&&x.set(l[g],!1)}}mount(t){this.current=t,Cy.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||Jb(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Lu.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Cy.delete(this.current),this.projection&&this.projection.unmount(),Zt(this.notifyUpdate),Zt(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=Vt.has(t),o=a.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&ee.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 gr){let a=gr[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):Te()}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<ek.length;r++){let o=ek[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=Zb(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=wr(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"&&(Af(o)||kf(o))?o=parseFloat(o):!Yb(o)&&Tt.test(a)&&(o=Tf(t,a)),this.setBaseTarget(t,Ce(o)?o.get():o)),Ce(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=Hs(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&&!Ce(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 po),this.events[t].add(a)}notify(t,...a){this.events[t]&&this.events[t].notify(...a)}};var vi=class extends ip{constructor(){super(...arguments),this.KeyframeResolver=di}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;Ce(t)&&(this.childSubscription=t.on("change",a=>{this.current&&(this.current.textContent=`${a}`)}))}};function lD(e){return window.getComputedStyle(e)}var lp=class extends vi{constructor(){super(...arguments),this.type="html",this.renderInstance=of}readValueFromInstance(t,a){if(Vt.has(a)){let r=ui(a);return r&&r.default||0}else{let r=lD(t),o=(tf(a)?r.getPropertyValue(a):r[a])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:a}){return uy(t,a)}build(t,a,r){Gs(t,a,r.transformTemplate)}scrapeMotionValuesFromProps(t,a,r){return Ys(t,a,r)}};var up=class extends vi{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Te}getBaseTargetFromProps(t,a){return t[a]}readValueFromInstance(t,a){if(Vt.has(a)){let r=ui(a);return r&&r.default||0}return a=nf.has(a)?a:Us(a),t.getAttribute(a)}scrapeMotionValuesFromProps(t,a,r){return uf(t,a,r)}build(t,a,r){Ks(t,a,this.isSVGTag,r.transformTemplate)}renderInstance(t,a,r,o){sf(t,a,r,o)}mount(t){this.isSVGTag=Qs(t.tagName),super.mount(t)}};var ak=(e,t)=>qs(e)?new up(t):new lp(t,{allowProjection:e!==tk.Fragment});var rk=_L({...EI,...Xb,...$b,...Qb},ak);var Ly=JC(rk);var Iu=M(le(),1);function ok({x:e,y:t,visible:a,onClick:r=!1}){return(0,Iu.jsx)(kg,{children:a&&(0,Iu.jsx)(Ly.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,Iu.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Iu.jsx)("path",{d:"M3 3L10.07 19.97L12.58 12.58L19.97 10.07L3 3Z",fill:"#C4B5FD"})})})})}var wi=M(G(),1);function nk(){let[e,t]=wi.useState({x:0,y:0,visible:!1,onClick:!1}),a=wi.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=wi.useCallback(()=>{t(n=>({...n,visible:!1}))},[]),o=wi.useCallback(()=>{t(n=>({...n,visible:!0}))},[]);return{cursorState:e,moveTo:a,hide:r,show:o}}var Ir=M(G(),1);function sk({productBackendUrl:e,sessionId:t,enabled:a=!0}){let[r,o]=Ir.useState({status:"idle"}),n=Ir.useRef(null),s=Ir.useCallback(async()=>{if(!e||!a){console.log("[useUserAuth] Skipping auth - productBackendUrl:",e,"enabled:",a),o({status:"idle"});return}console.log("[useUserAuth] Starting auth request to product backend..."),console.log("[useUserAuth] Product backend URL:",e),console.log("[useUserAuth] Full request URL:",`${e}/users/me`),o({status:"loading"});try{let l=await fetch(`${e}/users/me`,{method:"GET",credentials:"include",headers:{Accept:"application/json"}});if(console.log("[useUserAuth] Response received - status:",l.status,"ok:",l.ok),!l.ok)throw console.log("[useUserAuth] Auth request failed with status:",l.status),l.status===401?new Error("Please log in to use the chat assistant."):l.status===403?new Error("You do not have permission to access this feature."):new Error(`Authentication failed (${l.status})`);let u=await l.json();console.log("[useUserAuth] Auth SUCCESS - parsed user data:"),console.log("[useUserAuth] id:",u.id),console.log("[useUserAuth] email:",u.email),console.log("[useUserAuth] name:",u.name),console.log("[useUserAuth] role:",u.role),console.log("[useUserAuth] isInternal:",u.isInternal),console.log("[useUserAuth] agreementsSigned:",u.agreementsSigned),console.log("[useUserAuth] lastLoginTime:",u.lastLoginTime),o({status:"authenticated",user:u})}catch(l){console.log("[useUserAuth] Auth ERROR:",l);let u=l instanceof Error?l.message:"Unable to verify your identity. Please try again.";o({status:"error",error:u})}},[e,a]);Ir.useEffect(()=>{t!==n.current&&(n.current=t,s())},[t,s]);let i=Ir.useCallback(()=>{s()},[s]);return{authState:r,retry:i}}var Si=M(le(),1);function St({className:e,...t}){return(0,Si.jsx)("div",{"data-slot":"card",className:Jt("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function Wa({className:e,...t}){return(0,Si.jsx)("div",{"data-slot":"card-header",className:Jt("@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 Ga({className:e,...t}){return(0,Si.jsx)("div",{"data-slot":"card-title",className:Jt("leading-none font-semibold",e),...t})}function Iy({className:e,...t}){return(0,Si.jsx)("div",{"data-slot":"card-description",className:Jt("text-muted-foreground text-sm",e),...t})}function Ct({className:e,...t}){return(0,Si.jsx)("div",{"data-slot":"card-content",className:Jt("px-6",e),...t})}var S=M(le(),1),by=e=>new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),dp=(e,t="USD")=>new Intl.NumberFormat("en-US",{style:"currency",currency:t}).format(e),ky=e=>{switch(e){case"Enterprise":return ln;case"Professional":return au;default:return Kl}},cp=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 bu({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:at};case"failed":return{color:"bg-red-50 text-red-700 border-red-200",icon:ka};case"pending":return{color:"bg-amber-50 text-amber-700 border-amber-200",icon:nn};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:ba}}if(t==="subscription")switch(n){case"active":return{color:"bg-emerald-50 text-emerald-700 border-emerald-200",icon:at};case"cancelled":return{color:"bg-slate-50 text-slate-700 border-slate-200",icon:ka};case"past_due":return{color:"bg-red-50 text-red-700 border-red-200",icon:ba};case"trialing":return{color:"bg-blue-50 text-blue-700 border-blue-200",icon:nn};default:return{color:"bg-gray-50 text-gray-700 border-gray-200",icon:ba}}switch(n){case"active":return{color:"bg-emerald-50 text-emerald-700 border-emerald-200",icon:at};case"inactive":return{color:"bg-slate-50 text-slate-700 border-slate-200",icon:ka};default:return{color:"bg-gray-50 text-gray-700 border-gray-200",icon:ba}}})(),o=r.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 ${r.color}`,children:[(0,S.jsx)(o,{className:"h-3 w-3"}),e]})}function uD({subscription:e}){let t=ky(e.plan);return(0,S.jsxs)(St,{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)(Wa,{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)(Ga,{className:"text-base font-semibold text-gray-900 flex items-center gap-2",children:[(0,S.jsx)(sn,{className:"h-4 w-4 text-gray-500"}),e.id]}),e.customer_email&&(0,S.jsxs)(Iy,{className:"text-sm text-gray-500 flex items-center gap-1.5",children:[(0,S.jsx)(As,{className:"h-3 w-3"}),e.customer_email]})]}),(0,S.jsx)(bu,{status:e.status,type:"subscription"})]})}),(0,S.jsx)(Ct,{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 ${cp(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:[dp(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:[by(e.current_period_start)," - ",by(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:by(e.created_at)})]})]})]})})]})}function dD({subscriptions:e,maxItems:t=5}){let a=e.slice(0,t),r=e.length>t;return e.length===0?(0,S.jsx)(St,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(Ct,{className:"py-8 text-center",children:[(0,S.jsx)(sn,{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)(St,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Wa,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ga,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(sn,{className:"h-4 w-4"}),e.length," Subscription",e.length!==1?"s":""]})}),(0,S.jsxs)(Ct,{className:"p-0",children:[(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:a.map(o=>{let n=ky(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 ${cp(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 ",dp(o.amount,o.currency),"/",o.billing_cycle]})]})]}),(0,S.jsx)(bu,{status:o.status,type:"subscription"})]})},o.id)})}),r&&(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 cD({customer:e}){let t=ky(e.subscription);return(0,S.jsxs)(St,{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)(Wa,{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)(Ga,{className:"text-base font-semibold text-gray-900",children:e.name}),(0,S.jsxs)(Iy,{className:"text-sm text-gray-500 flex items-center gap-1",children:[(0,S.jsx)(As,{className:"h-3 w-3"}),e.email]})]})}),(0,S.jsx)(bu,{status:e.status,type:"customer"})]})}),(0,S.jsx)(Ct,{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 ${cp(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)(un,{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)(Rs,{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)(Ql,{className:"h-3 w-3 text-gray-400"}),e.joinDate]})]})]})]})})]})}function fD({customers:e,maxItems:t=5}){let a=e.slice(0,t),r=e.length>t;return e.length===0?(0,S.jsx)(St,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(Ct,{className:"py-8 text-center",children:[(0,S.jsx)(Ds,{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)(St,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Wa,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ga,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(Ds,{className:"h-4 w-4"}),e.length," Customer",e.length!==1?"s":""]})}),(0,S.jsxs)(Ct,{className:"p-0",children:[(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:a.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 ${cp(o.subscription)}`,children:o.subscription}),(0,S.jsx)(bu,{status:o.status,type:"customer"})]})]})},o.id))}),r&&(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 ik({transactions:e,maxItems:t=5}){let a=e.slice(0,t),r=e.length>t;return e.length===0?(0,S.jsx)(St,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(Ct,{className:"py-8 text-center",children:[(0,S.jsx)(un,{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)(St,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Wa,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ga,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(un,{className:"h-4 w-4"}),e.length," Transaction",e.length!==1?"s":""]})}),(0,S.jsxs)(Ct,{className:"p-0",children:[(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:a.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)(at,{className:"h-4 w-4 text-emerald-600"}):o.status==="failed"?(0,S.jsx)(ka,{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)(nn,{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)(bu,{status:o.status,type:"transaction"})]})]})},o.id))}),r&&(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 pD({apiKeys:e}){return e.length===0?(0,S.jsx)(St,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(Ct,{className:"py-8 text-center",children:[(0,S.jsx)(Ts,{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)(St,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Wa,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ga,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(Ts,{className:"h-4 w-4"}),e.length," API Key",e.length!==1?"s":""]})}),(0,S.jsx)(Ct,{className:"p-0",children:(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:e.map((t,a)=>(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]})]})},a))})})]})}function mD({sessions:e}){let t=a=>{let r=a.toLowerCase();return r.includes("mobile")||r.includes("iphone")||r.includes("android")?eu:Yl};return e.length===0?(0,S.jsx)(St,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(Ct,{className:"py-8 text-center",children:[(0,S.jsx)(Es,{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)(St,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Wa,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ga,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(Es,{className:"h-4 w-4"}),e.length," Active Session",e.length!==1?"s":""]})}),(0,S.jsx)(Ct,{className:"p-0",children:(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:e.map((a,r)=>{let o=t(a.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:a.device}),(0,S.jsxs)("div",{className:"text-xs text-gray-500 flex items-center gap-1",children:[(0,S.jsx)(Rs,{className:"h-3 w-3"}),a.location]})]})]}),(0,S.jsx)("div",{className:"text-xs text-gray-500",children:a.time})]})},r)})})})]})}function hD({stats:e}){return(0,S.jsxs)(St,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Wa,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ga,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(tu,{className:"h-4 w-4"}),"Dashboard Overview"]})}),(0,S.jsx)(Ct,{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:dp(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 gD({customers:e}){return e.length===0?(0,S.jsx)(St,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(Ct,{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 top customers data"})]})}):(0,S.jsxs)(St,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Wa,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ga,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(ln,{className:"h-4 w-4 text-amber-500"}),"Top Customers"]})}),(0,S.jsx)(Ct,{className:"p-0",children:(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:e.map((t,a)=>(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 ${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,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"?dp(t.revenue):t.revenue})]})},a))})})]})}function lk({type:e,data:t}){if(!t)return null;switch(e){case"subscription":return(0,S.jsx)(uD,{subscription:t});case"subscriptions":let a=t.subscriptions||t||[];return(0,S.jsx)(dD,{subscriptions:Array.isArray(a)?a:[a]});case"customer":return(0,S.jsx)(cD,{customer:t.customer||t});case"customers":let r=t.customers||t||[];return(0,S.jsx)(fD,{customers:Array.isArray(r)?r:[r]});case"transactions":let o=t.transactions||t||[];return(0,S.jsx)(ik,{transactions:Array.isArray(o)?o:[o]});case"transaction":return(0,S.jsx)(ik,{transactions:[t],maxItems:1});case"dashboard_stats":return(0,S.jsx)(hD,{stats:t});case"top_customers":let n=t.customers||t||[];return(0,S.jsx)(gD,{customers:Array.isArray(n)?n:[n]});case"api_keys":let s=t.api_keys||t||[];return(0,S.jsx)(pD,{apiKeys:Array.isArray(s)?s:[s]});case"sessions":let i=t.sessions||t||[];return(0,S.jsx)(mD,{sessions:Array.isArray(i)?i:[i]});default:return null}}var bn=M(le(),1);function uk({className:e=""}){return(0,bn.jsx)("div",{className:`flex items-center gap-1 px-4 py-3 ${e}`,children:(0,bn.jsxs)("div",{className:"flex items-center gap-1",children:[(0,bn.jsx)("span",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"0ms",animationDuration:"600ms"}}),(0,bn.jsx)("span",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"150ms",animationDuration:"600ms"}}),(0,bn.jsx)("span",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"300ms",animationDuration:"600ms"}})]})})}var p=M(le(),1),yD="0.2.43",xD="http://localhost:5002",fp=340;function vD(e){return e.replace(/\\\\n/g,`
|
|
23
|
+
`),()=>{document.head.removeChild(d)}},[t]),(0,HS.jsx)(kg,{isPresent:t,childRef:r,sizeRef:o,children:qc.cloneElement(e,{ref:r})})}var GS=({children:e,initial:t,isPresent:a,onExitComplete:r,custom:o,presenceAffectsLayout:n,mode:s})=>{let i=Os(YR),l=(0,pn.useId)(),u=(0,pn.useCallback)(c=>{i.set(c,!0);for(let f of i.values())if(!f)return;r&&r()},[i,r]),d=(0,pn.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,pn.useMemo)(()=>{i.forEach((c,f)=>i.set(f,!1))},[a]),WS.useEffect(()=>{!a&&!i.size&&r&&r()},[a]),s==="popLayout"&&(e=(0,Pg.jsx)($S,{isPresent:a,children:e})),(0,Pg.jsx)(no.Provider,{value:d,children:e})};function YR(){return new Map}var so=N(W(),1);function zc(e=!0){let t=(0,so.useContext)(no);if(t===null)return[!0,null];let{isPresent:a,onExitComplete:r,register:o}=t,n=(0,so.useId)();(0,so.useEffect)(()=>{e&&o(n)},[e]);let s=(0,so.useCallback)(()=>e&&r&&r(n),[n,r,e]);return!a&&r?[!1,s]:[!0]}var Hc=N(W(),1),ou=e=>e.key||"";function Tg(e){let t=[];return Hc.Children.forEach(e,a=>{(0,Hc.isValidElement)(a)&&t.push(a)}),t}var $c=N(W(),1);var Bs=typeof window<"u";var Wc=Bs?$c.useLayoutEffect:$c.useEffect;var Ag=({children:e,custom:t,initial:a=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:n="sync",propagate:s=!1})=>{let[i,l]=zc(s),u=(0,ja.useMemo)(()=>Tg(e),[e]),d=s&&!i?[]:u.map(ou),c=(0,ja.useRef)(!0),f=(0,ja.useRef)(u),g=Os(()=>new Map),[x,w]=(0,ja.useState)(u),[L,y]=(0,ja.useState)(u);Wc(()=>{c.current=!1,f.current=u;for(let S=0;S<L.length;S++){let I=ou(L[S]);d.includes(I)?g.delete(I):g.get(I)!==!0&&g.set(I,!1)}},[L,d.length,d.join("-")]);let h=[];if(u!==x){let S=[...u];for(let I=0;I<L.length;I++){let P=L[I],R=ou(P);d.includes(R)||(S.splice(I,0,P),h.push(P))}n==="wait"&&h.length&&(S=h),y(Tg(S)),w(u);return}let{forceRender:m}=(0,ja.useContext)(Ns);return(0,nu.jsx)(nu.Fragment,{children:L.map(S=>{let I=ou(S),P=s&&!i?!1:u===L||d.includes(I),R=()=>{if(g.has(I))g.set(I,!0);else return;let A=!0;g.forEach(V=>{V||(A=!1)}),A&&(m?.(),y(f.current),s&&l?.(),r&&r())};return(0,nu.jsx)(GS,{isPresent:P,initial:!c.current||a?void 0:!1,custom:P?void 0:t,presenceAffectsLayout:o,mode:n,onExitComplete:P?void 0:R,children:S},I)})})};var ge=e=>e;var gr=ge,Ta=ge;function mn(e){let t;return()=>(t===void 0&&(t=e()),t)}var Zt=(e,t,a)=>{let r=t-e;return r===0?1:(a-e)/r};var Ve=e=>e*1e3,dt=e=>e/1e3;var Us={skipAnimations:!1,useManualTiming:!1};function KS(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 g=c&&r?t:a;return d&&n.add(u),g.has(u)||g.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 Gc=["read","resolveKeyframes","update","preRender","render","postRender"],ZR=40;function Kc(e,t){let a=!1,r=!0,o={delta:0,timestamp:0,isProcessing:!1},n=()=>a=!0,s=Gc.reduce((y,h)=>(y[h]=KS(n),y),{}),{read:i,resolveKeyframes:l,update:u,preRender:d,render:c,postRender:f}=s,g=()=>{let y=Us.useManualTiming?o.timestamp:performance.now();a=!1,o.delta=r?1e3/60:Math.max(Math.min(y-o.timestamp,ZR),1),o.timestamp=y,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(g))},x=()=>{a=!0,r=!0,o.isProcessing||e(g)};return{schedule:Gc.reduce((y,h)=>{let m=s[h];return y[h]=(S,I=!1,P=!1)=>(a||x(),m.schedule(S,I,P)),y},{}),cancel:y=>{for(let h=0;h<Gc.length;h++)s[Gc[h]].cancel(y)},state:o,steps:s}}var{schedule:Z,cancel:ea,state:je,steps:Xc}=Kc(typeof requestAnimationFrame<"u"?requestAnimationFrame:ge,!0);var XS=N(W(),1),Qc=(0,XS.createContext)({strict:!1});var QS={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"]},yr={};for(let e in QS)yr[e]={isEnabled:t=>QS[e].some(a=>!!t[a])};function JS(e){for(let t in e)yr[t]={...yr[t],...e[t]}}var e_=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 su(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||e_.has(e)}var YS=e=>!su(e);function t_(e){e&&(YS=t=>t.startsWith("on")?!su(t):e(t))}try{t_(Ok("@emotion/is-prop-valid").default)}catch{}function ZS(e,t,a){let r={};for(let o in e)o==="values"&&typeof e.values=="object"||(YS(o)||a===!0&&su(o)||!t&&!su(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}function eL(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 af=N(le(),1);var qs=N(W(),1);var tL=N(W(),1),io=(0,tL.createContext)({});var Zc=N(W(),1);function xr(e){return typeof e=="string"||Array.isArray(e)}function lo(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}var Jc=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],iu=["initial",...Jc];function hn(e){return lo(e.animate)||iu.some(t=>xr(e[t]))}function Yc(e){return!!(hn(e)||e.variants)}function aL(e,t){if(hn(e)){let{initial:a,animate:r}=e;return{initial:a===!1||xr(a)?a:void 0,animate:xr(r)?r:void 0}}return e.inherit!==!1?t:{}}function oL(e){let{initial:t,animate:a}=aL(e,(0,Zc.useContext)(io));return(0,Zc.useMemo)(()=>({initial:t,animate:a}),[rL(t),rL(a)])}function rL(e){return Array.isArray(e)?e.join(" "):e}var nL=Symbol.for("motionComponentSymbol");var sL=N(W(),1);function vr(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function iL(e,t,a){return(0,sL.useCallback)(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),a&&(typeof a=="function"?a(r):vr(a)&&(a.current=r))},[t])}var Ut=N(W(),1);var Vs=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase();var a_="framerAppearId",ef="data-"+Vs(a_);var{schedule:js,cancel:BU}=Kc(queueMicrotask,!1);var lL=N(W(),1),tf=(0,lL.createContext)({});function uL(e,t,a,r,o){var n,s;let{visualElement:i}=(0,Ut.useContext)(io),l=(0,Ut.useContext)(Qc),u=(0,Ut.useContext)(no),d=(0,Ut.useContext)(Fs).reducedMotion,c=(0,Ut.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,g=(0,Ut.useContext)(tf);f&&!f.projection&&o&&(f.type==="html"||f.type==="svg")&&r_(c.current,a,o,g);let x=(0,Ut.useRef)(!1);(0,Ut.useInsertionEffect)(()=>{f&&x.current&&f.update(a,u)});let w=a[ef],L=(0,Ut.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 Wc(()=>{f&&(x.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),js.render(f.render),L.current&&f.animationState&&f.animationState.animateChanges())}),(0,Ut.useEffect)(()=>{f&&(!L.current&&f.animationState&&f.animationState.animateChanges(),L.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)===null||y===void 0||y.call(window,w)}),L.current=!1))}),f}function r_(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:dL(e.parent)),e.projection.setOptions({layoutId:o,layout:n,alwaysMeasureLayout:!!s||i&&vr(i),visualElement:e,animationType:typeof n=="string"?n:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:u})}function dL(e){if(e)return e.options.allowProjection!==!1?e.projection:dL(e.parent)}function cL({preloadedFeatures:e,createVisualElement:t,useRender:a,useVisualState:r,Component:o}){var n,s;e&&JS(e);function i(u,d){let c,f={...(0,qs.useContext)(Fs),...u,layoutId:o_(u)},{isStatic:g}=f,x=oL(u),w=r(u,g);if(!g&&Bs){n_(f,e);let L=s_(f);c=L.MeasureLayout,x.visualElement=uL(o,w,f,t,L.ProjectionNode)}return(0,af.jsxs)(io.Provider,{value:x,children:[c&&x.visualElement?(0,af.jsx)(c,{visualElement:x.visualElement,...f}):null,a(o,u,iL(w,x.visualElement,d),w,g,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,qs.forwardRef)(i);return l[nL]=o,l}function o_({layoutId:e}){let t=(0,qs.useContext)(Ns).id;return t&&e!==void 0?t+"-"+e:e}function n_(e,t){let a=(0,qs.useContext)(Qc).strict}function s_(e){let{drag:t,layout:a}=yr;if(!t&&!a)return{};let r={...t,...a};return{MeasureLayout:t?.isEnabled(e)||a?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}var fL=["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:!!(fL.indexOf(e)>-1||/[A-Z]/u.test(e))}var Rg=N(W(),1);function pL(e){let t=[{},{}];return e?.values.forEach((a,r)=>{t[0][r]=a.get(),t[1][r]=a.getVelocity()}),t}function Hs(e,t,a,r){if(typeof t=="function"){let[o,n]=pL(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]=pL(r);t=t(a!==void 0?a:e.custom,o,n)}return t}var lu=e=>Array.isArray(e);var mL=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),hL=e=>lu(e)?e[e.length-1]||0:e;var Se=e=>!!(e&&e.getVelocity);function $s(e){let t=Se(e)?e.get():e;return mL(t)?t.toValue():t}function i_({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:a},r,o,n){let s={latestValues:l_(r,o,n,e),renderState:t()};return a&&(s.onMount=i=>a({props:r,current:i,...s}),s.onUpdate=i=>a(i)),s}var rf=e=>(t,a)=>{let r=(0,Rg.useContext)(io),o=(0,Rg.useContext)(no),n=()=>i_(e,t,r,o);return a?n():Os(n)};function l_(e,t,a,r){let o={},n=r(e,{});for(let f in n)o[f]=$s(n[f]);let{initial:s,animate:i}=e,l=hn(e),u=Yc(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"&&!lo(c)){let f=Array.isArray(c)?c:[c];for(let g=0;g<f.length;g++){let x=Hs(e,f[g]);if(x){let{transitionEnd:w,transition:L,...y}=x;for(let h in y){let m=y[h];if(Array.isArray(m)){let S=d?m.length-1:0;m=m[S]}m!==null&&(o[h]=m)}for(let h in w)o[h]=w[h]}}}return o}var qa=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Vt=new Set(qa);var gL=e=>t=>typeof t=="string"&&t.startsWith(e),of=gL("--"),u_=gL("var(--"),Ws=e=>u_(e)?d_.test(e.split("/*")[0].trim()):!1,d_=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;var nf=(e,t)=>t&&typeof e=="number"?t.transform(e):e;var ct=(e,t,a)=>a>t?t:a<e?e:a;var za={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},wr={...za,transform:e=>ct(0,1,e)},uu={...za,default:1};var du=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ha=du("deg"),Tt=du("%"),z=du("px"),yL=du("vh"),xL=du("vw"),_g={...Tt,parse:e=>Tt.parse(e)/100,transform:e=>Tt.transform(e*100)};var vL={borderWidth:z,borderTopWidth:z,borderRightWidth:z,borderBottomWidth:z,borderLeftWidth:z,borderRadius:z,radius:z,borderTopLeftRadius:z,borderTopRightRadius:z,borderBottomRightRadius:z,borderBottomLeftRadius:z,width:z,maxWidth:z,height:z,maxHeight:z,top:z,right:z,bottom:z,left:z,padding:z,paddingTop:z,paddingRight:z,paddingBottom:z,paddingLeft:z,margin:z,marginTop:z,marginRight:z,marginBottom:z,marginLeft:z,backgroundPositionX:z,backgroundPositionY:z};var wL={rotate:Ha,rotateX:Ha,rotateY:Ha,rotateZ:Ha,scale:uu,scaleX:uu,scaleY:uu,scaleZ:uu,skew:Ha,skewX:Ha,skewY:Ha,distance:z,translateX:z,translateY:z,translateZ:z,x:z,y:z,z,perspective:z,transformPerspective:z,opacity:wr,originX:_g,originY:_g,originZ:z};var Eg={...za,transform:Math.round};var Gs={...vL,...wL,zIndex:Eg,size:z,fillOpacity:wr,strokeOpacity:wr,numOctaves:Eg};var c_={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},f_=qa.length;function CL(e,t,a){let r="",o=!0;for(let n=0;n<f_;n++){let s=qa[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=nf(i,Gs[s]);if(!l){o=!1;let d=c_[s]||s;r+=`${d}(${u}) `}a&&(t[s]=u)}}return r=r.trim(),a?r=a(t,o?"":r):o&&(r="none"),r}function Ks(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(Vt.has(l)){s=!0;continue}else if(of(l)){o[l]=u;continue}else{let d=nf(u,Gs[l]);l.startsWith("origin")?(i=!0,n[l]=d):r[l]=d}}if(t.transform||(s||a?r.transform=CL(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 p_={offset:"stroke-dashoffset",array:"stroke-dasharray"},m_={offset:"strokeDashoffset",array:"strokeDasharray"};function SL(e,t,a=1,r=0,o=!0){e.pathLength=1;let n=o?p_:m_;e[n.offset]=z.transform(-r);let s=z.transform(t),i=z.transform(a);e[n.array]=`${s} ${i}`}function LL(e,t,a){return typeof e=="string"?e:z.transform(t+a*e)}function IL(e,t,a){let r=LL(t,e.x,e.width),o=LL(a,e.y,e.height);return`${r} ${o}`}function Xs(e,{attrX:t,attrY:a,attrScale:r,originX:o,originY:n,pathLength:s,pathSpacing:i=1,pathOffset:l=0,...u},d,c){if(Ks(e,u,c),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:f,style:g,dimensions:x}=e;f.transform&&(x&&(g.transform=f.transform),delete f.transform),x&&(o!==void 0||n!==void 0||g.transform)&&(g.transformOrigin=IL(x,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&&SL(f,s,i,l,!1)}var Qs=()=>({style:{},transform:{},transformOrigin:{},vars:{}});var sf=()=>({...Qs(),attrs:{}});var Js=e=>typeof e=="string"&&e.toLowerCase()==="svg";function lf(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 uf=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 df(e,t,a,r){lf(e,t,void 0,r);for(let o in t.attrs)e.setAttribute(uf.has(o)?o:Vs(o),t.attrs[o])}var Ys={};function bL(e){Object.assign(Ys,e)}function cf(e,{layout:t,layoutId:a}){return Vt.has(e)||e.startsWith("origin")||(t||a!==void 0)&&(!!Ys[e]||e==="opacity")}function Zs(e,t,a){var r;let{style:o}=e,n={};for(let s in o)(Se(o[s])||t.style&&Se(t.style[s])||cf(s,e)||((r=a?.getValue(s))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(n[s]=o[s]);return n}function ff(e,t,a){let r=Zs(e,t,a);for(let o in e)if(Se(e[o])||Se(t[o])){let n=qa.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[n]=e[o]}return r}function h_(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 kL=["x","y","width","height","cx","cy","r"],PL={useVisualState:rf({scrapeMotionValuesFromProps:ff,createRenderState:sf,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(Vt.has(i)){n=!0;break}}if(!n)return;let s=!t;if(t)for(let i=0;i<kL.length;i++){let l=kL[i];e[l]!==t[l]&&(s=!0)}s&&Z.read(()=>{h_(a,r),Z.render(()=>{Xs(r,o,Js(a.tagName),e.transformTemplate),df(a,r)})})}})};var TL={useVisualState:rf({scrapeMotionValuesFromProps:Zs,createRenderState:Qs})};var ei=N(W(),1);var AL=N(W(),1);function Dg(e,t,a){for(let r in t)!Se(t[r])&&!cf(r,a)&&(e[r]=t[r])}function g_({transformTemplate:e},t){return(0,AL.useMemo)(()=>{let a=Qs();return Ks(a,t,e),Object.assign({},a.vars,a.style)},[t])}function y_(e,t){let a=e.style||{},r={};return Dg(r,a,e),Object.assign(r,g_(e,t)),r}function RL(e,t){let a={},r=y_(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 _L=N(W(),1);function EL(e,t,a,r){let o=(0,_L.useMemo)(()=>{let n=sf();return Xs(n,t,Js(r),e.transformTemplate),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let n={};Dg(n,e.style,e),o.style={...n,...o.style}}return o}function DL(e=!1){return(a,r,o,{latestValues:n},s)=>{let l=(zs(a)?EL:RL)(r,n,s,a),u=ZS(r,typeof a=="string",e),d=a!==ei.Fragment?{...u,...l,ref:o}:{},{children:c}=r,f=(0,ei.useMemo)(()=>Se(c)?c.get():c,[c]);return(0,ei.createElement)(a,{...d,children:f})}}function ML(e,t){return function(r,{forwardMotionProps:o}={forwardMotionProps:!1}){let s={...zs(r)?PL:TL,preloadedFeatures:e,useRender:DL(o),createVisualElement:t,Component:r};return cL(s)}}function Mg(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 uo(e,t,a){let r=e.getProps();return Hs(r,t,a!==void 0?a:r.custom,e)}var Ng=mn(()=>window.ScrollTimeline!==void 0);var cu=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(Ng()&&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 fu=class extends cu{then(t,a){return Promise.all(this.animations).then(t).catch(a)}};function co(e,t){return e?e[t]||e.default||e:void 0}function ti(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 fo(e){return typeof e=="function"}function pu(e,t){e.timeline=t,e.onfinish=null}var ai=e=>Array.isArray(e)&&typeof e[0]=="number";var Fg={linearEasing:void 0};function NL(e,t){let a=mn(e);return()=>{var r;return(r=Fg[t])!==null&&r!==void 0?r:a()}}var po=NL(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");var mu=(e,t,a=10)=>{let r="",o=Math.max(Math.round(t/a),2);for(let n=0;n<o;n++)r+=e(Zt(0,o-1,n))+", ";return`linear(${r.substring(0,r.length-2)})`};function mf(e){return!!(typeof e=="function"&&po()||!e||typeof e=="string"&&(e in pf||po())||ai(e)||Array.isArray(e)&&e.every(mf))}var ri=([e,t,a,r])=>`cubic-bezier(${e}, ${t}, ${a}, ${r})`,pf={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ri([0,.65,.55,1]),circOut:ri([.55,0,1,.45]),backIn:ri([.31,.01,.66,-.59]),backOut:ri([.33,1.53,.69,.99])};function oi(e,t){if(e)return typeof e=="function"&&po()?mu(e,t):ai(e)?ri(e):Array.isArray(e)?e.map(a=>oi(a,t)||pf.easeOut):pf[e]}var ta={x:!1,y:!1};function ni(){return ta.x||ta.y}function Bg(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 hf(e,t){let a=Bg(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[a,o,()=>r.abort()]}function OL(e){return t=>{t.pointerType==="touch"||ni()||e(t)}}function Ug(e,t,a={}){let[r,o,n]=hf(e,a),s=OL(i=>{let{target:l}=i,u=t(i);if(typeof u!="function"||!l)return;let d=OL(c=>{u(c),l.removeEventListener("pointerleave",d)});l.addEventListener("pointerleave",d,o)});return r.forEach(i=>{i.addEventListener("pointerenter",s,o)}),n}var gf=(e,t)=>t?e===t?!0:gf(e,t.parentElement):!1;var gn=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;var x_=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function FL(e){return x_.has(e.tagName)||e.tabIndex!==-1}var yn=new WeakSet;function BL(e){return t=>{t.key==="Enter"&&e(t)}}function Vg(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}var UL=(e,t)=>{let a=e.currentTarget;if(!a)return;let r=BL(()=>{if(yn.has(a))return;Vg(a,"down");let o=BL(()=>{Vg(a,"up")}),n=()=>Vg(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 VL(e){return gn(e)&&!ni()}function jg(e,t,a={}){let[r,o,n]=hf(e,a),s=i=>{let l=i.currentTarget;if(!VL(i)||yn.has(l))return;yn.add(l);let u=t(i),d=(g,x)=>{window.removeEventListener("pointerup",c),window.removeEventListener("pointercancel",f),!(!VL(g)||!yn.has(l))&&(yn.delete(l),typeof u=="function"&&u(g,{success:x}))},c=g=>{d(g,a.useGlobalTarget||gf(l,g.target))},f=g=>{d(g,!1)};window.addEventListener("pointerup",c,o),window.addEventListener("pointercancel",f,o)};return r.forEach(i=>{!FL(i)&&i.getAttribute("tabindex")===null&&(i.tabIndex=0),(a.useGlobalTarget?window:i).addEventListener("pointerdown",s,o),i.addEventListener("focus",u=>UL(u,o),o)}),n}function qg(e){return e==="x"||e==="y"?ta[e]?null:(ta[e]=!0,()=>{ta[e]=!1}):ta.x||ta.y?null:(ta.x=ta.y=!0,()=>{ta.x=ta.y=!1})}var yf=new Set(["width","height","top","left","right","bottom",...qa]);var xf;function w_(){xf=void 0}var vt={now:()=>(xf===void 0&&vt.set(je.isProcessing||Us.useManualTiming?je.timestamp:performance.now()),xf),set:e=>{xf=e,queueMicrotask(w_)}};function si(e,t){e.indexOf(t)===-1&&e.push(t)}function ii(e,t){let a=e.indexOf(t);a>-1&&e.splice(a,1)}var mo=class{constructor(){this.subscriptions=[]}add(t){return si(this.subscriptions,t),()=>ii(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 vf(e,t){return t?e*(1e3/t):0}var qL=30,C_=e=>!isNaN(parseFloat(e)),zL={current:void 0},zg=class{constructor(t,a={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,o=!0)=>{let n=vt.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=vt.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=C_(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 mo);let r=this.events[t].add(a);return t==="change"?()=>{r(),Z.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 zL.current&&zL.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let t=vt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>qL)return 0;let a=Math.min(this.updatedAt-this.prevUpdatedAt,qL);return vf(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 Cr(e,t){return new zg(e,t)}function S_(e,t,a){e.hasValue(t)?e.getValue(t).set(a):e.addValue(t,Cr(a))}function HL(e,t){let a=uo(e,t),{transitionEnd:r={},transition:o={},...n}=a||{};n={...n,...r};for(let s in n){let i=hL(n[s]);S_(e,s,i)}}function $L(e){return!!(Se(e)&&e.add)}function hu(e,t){let a=e.getValue("willChange");if($L(a))return a.add(t)}function wf(e){return e.props[ef]}var Cf={current:!1};var WL=(e,t,a)=>(((1-3*a+3*t)*e+(3*a-6*t))*e+3*t)*e,L_=1e-7,I_=12;function b_(e,t,a,r,o){let n,s,i=0;do s=t+(a-t)/2,n=WL(s,r,o)-e,n>0?a=s:t=s;while(Math.abs(n)>L_&&++i<I_);return s}function ho(e,t,a,r){if(e===t&&a===r)return ge;let o=n=>b_(n,0,1,e,a);return n=>n===0||n===1?n:WL(o(n),t,r)}var Sf=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2;var Lf=e=>t=>1-e(1-t);var Hg=ho(.33,1.53,.69,.99),gu=Lf(Hg),If=Sf(gu);var bf=e=>(e*=2)<1?.5*gu(e):.5*(2-Math.pow(2,-10*(e-1)));var kf=e=>1-Math.sin(Math.acos(e)),Pf=Lf(kf),Tf=Sf(kf);var Af=e=>/^0[^.\s]+$/u.test(e);function GL(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Af(e):!0}var go=e=>Math.round(e*1e5)/1e5;var li=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function KL(e){return e==null}var XL=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;var ui=(e,t)=>a=>!!(typeof a=="string"&&XL.test(a)&&a.startsWith(e)||t&&!KL(a)&&Object.prototype.hasOwnProperty.call(a,t)),Rf=(e,t,a)=>r=>{if(typeof r!="string")return r;let[o,n,s,i]=r.match(li);return{[e]:parseFloat(o),[t]:parseFloat(n),[a]:parseFloat(s),alpha:i!==void 0?parseFloat(i):1}};var k_=e=>ct(0,255,e),$g={...za,transform:e=>Math.round(k_(e))},$a={test:ui("rgb","red"),parse:Rf("red","green","blue"),transform:({red:e,green:t,blue:a,alpha:r=1})=>"rgba("+$g.transform(e)+", "+$g.transform(t)+", "+$g.transform(a)+", "+go(wr.transform(r))+")"};function P_(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 yu={test:ui("#"),parse:P_,transform:$a.transform};var yo={test:ui("hsl","hue"),parse:Rf("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:a,alpha:r=1})=>"hsla("+Math.round(e)+", "+Tt.transform(go(t))+", "+Tt.transform(go(a))+", "+go(wr.transform(r))+")"};var $e={test:e=>$a.test(e)||yu.test(e)||yo.test(e),parse:e=>$a.test(e)?$a.parse(e):yo.test(e)?yo.parse(e):yu.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?$a.transform(e):yo.transform(e)};var QL=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function T_(e){var t,a;return isNaN(e)&&typeof e=="string"&&(((t=e.match(li))===null||t===void 0?void 0:t.length)||0)+(((a=e.match(QL))===null||a===void 0?void 0:a.length)||0)>0}var YL="number",ZL="color",A_="var",R_="var(",JL="${}",__=/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 xn(e){let t=e.toString(),a=[],r={color:[],number:[],var:[]},o=[],n=0,i=t.replace(__,l=>($e.test(l)?(r.color.push(n),o.push(ZL),a.push($e.parse(l))):l.startsWith(R_)?(r.var.push(n),o.push(A_),a.push(l)):(r.number.push(n),o.push(YL),a.push(parseFloat(l))),++n,JL)).split(JL);return{values:a,split:i,indexes:r,types:o}}function eI(e){return xn(e).values}function tI(e){let{split:t,types:a}=xn(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===YL?n+=go(o[s]):i===ZL?n+=$e.transform(o[s]):n+=o[s]}return n}}var E_=e=>typeof e=="number"?0:e;function D_(e){let t=eI(e);return tI(e)(t.map(E_))}var At={test:T_,parse:eI,createTransformer:tI,getAnimatableNone:D_};var M_=new Set(["brightness","contrast","saturate","opacity"]);function N_(e){let[t,a]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;let[r]=a.match(li)||[];if(!r)return e;let o=a.replace(r,""),n=M_.has(t)?1:0;return r!==a&&(n*=100),t+"("+n+o+")"}var O_=/\b([a-z-]*)\(.*?\)/gu,xu={...At,getAnimatableNone:e=>{let t=e.match(O_);return t?t.map(N_).join(" "):e}};var F_={...Gs,color:$e,backgroundColor:$e,outlineColor:$e,fill:$e,stroke:$e,borderColor:$e,borderTopColor:$e,borderRightColor:$e,borderBottomColor:$e,borderLeftColor:$e,filter:xu,WebkitFilter:xu},di=e=>F_[e];function _f(e,t){let a=di(e);return a!==xu&&(a=At),a.getAnimatableNone?a.getAnimatableNone(t):void 0}var B_=new Set(["auto","none","0"]);function aI(e,t,a){let r=0,o;for(;r<e.length&&!o;){let n=e[r];typeof n=="string"&&!B_.has(n)&&xn(n).values.length&&(o=e[r]),r++}if(o&&a)for(let n of t)e[n]=_f(a,o)}var Wg=e=>e===za||e===z,rI=(e,t)=>parseFloat(e.split(", ")[t]),oI=(e,t)=>(a,{transform:r})=>{if(r==="none"||!r)return 0;let o=r.match(/^matrix3d\((.+)\)$/u);if(o)return rI(o[1],t);{let n=r.match(/^matrix\((.+)\)$/u);return n?rI(n[1],e):0}},U_=new Set(["x","y","z"]),V_=qa.filter(e=>!U_.has(e));function nI(e){let t=[];return V_.forEach(a=>{let r=e.getValue(a);r!==void 0&&(t.push([a,r.get()]),r.set(a.startsWith("scale")?1:0))}),t}var vn={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:oI(4,13),y:oI(5,14)};vn.translateX=vn.x;vn.translateY=vn.y;var wn=new Set,Gg=!1,Kg=!1;function sI(){if(Kg){let e=Array.from(wn).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),a=new Map;t.forEach(r=>{let o=nI(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)})}Kg=!1,Gg=!1,wn.forEach(e=>e.complete()),wn.clear()}function iI(){wn.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Kg=!0)})}function lI(){iI(),sI()}var xo=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?(wn.add(this),Gg||(Gg=!0,Z.read(iI),Z.resolveKeyframes(sI))):(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),wn.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,wn.delete(this))}resume(){this.isComplete||this.scheduleResolve()}};var Ef=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);var j_=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function q_(e){let t=j_.exec(e);if(!t)return[,];let[,a,r,o]=t;return[`--${a??r}`,o]}var z_=4;function Xg(e,t,a=1){Ta(a<=z_,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);let[r,o]=q_(e);if(!r)return;let n=window.getComputedStyle(t).getPropertyValue(r);if(n){let s=n.trim();return Ef(s)?parseFloat(s):s}return Ws(o)?Xg(o,t,a+1):o}var Df=e=>t=>t.test(e);var uI={test:e=>e==="auto",parse:e=>e};var Qg=[za,z,Tt,Ha,xL,yL,uI],Jg=e=>Qg.find(Df(e));var ci=class extends xo{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(),Ws(u))){let d=Xg(u,a.current);d!==void 0&&(t[l]=d),l===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!yf.has(r)||t.length!==2)return;let[o,n]=t,s=Jg(o),i=Jg(n);if(s!==i)if(Wg(s)&&Wg(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++)GL(t[o])&&r.push(o);r.length&&aI(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=vn[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]=vn[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 Yg=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(At.test(e)||e==="0")&&!e.startsWith("url("));function H_(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 dI(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=Yg(o,t),i=Yg(n,t);return gr(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:H_(e)||(a==="spring"||fo(a))&&r}var $_=e=>e!==null;function vo(e,{repeat:t,repeatType:a="loop"},r){let o=e.filter($_),n=t&&a!=="loop"&&t%2===1?0:o.length-1;return!n||r===void 0?o[n]:r}var W_=40,fi=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=vt.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>W_?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&lI(),this._resolved}onKeyframesResolved(t,a){this.resolvedAt=vt.now(),this.hasAttemptedResolve=!0;let{name:r,type:o,velocity:n,delay:s,onComplete:i,onUpdate:l,isGenerator:u}=this.options;if(!u&&!dI(t,r,o,n))if(Cf.current||!s){l&&l(vo(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 Zg(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 cI({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=Zg(l,i,e+1/3),n=Zg(l,i,e),s=Zg(l,i,e-1/3)}return{red:Math.round(o*255),green:Math.round(n*255),blue:Math.round(s*255),alpha:r}}function pi(e,t){return a=>a>0?t:e}var ey=(e,t,a)=>{let r=e*e,o=a*(t*t-r)+r;return o<0?0:Math.sqrt(o)},G_=[yu,$a,yo],K_=e=>G_.find(t=>t.test(e));function fI(e){let t=K_(e);if(gr(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let a=t.parse(e);return t===yo&&(a=cI(a)),a}var ty=(e,t)=>{let a=fI(e),r=fI(t);if(!a||!r)return pi(e,t);let o={...a};return n=>(o.red=ey(a.red,r.red,n),o.green=ey(a.green,r.green,n),o.blue=ey(a.blue,r.blue,n),o.alpha=ie(a.alpha,r.alpha,n),$a.transform(o))};var X_=(e,t)=>a=>t(e(a)),Wa=(...e)=>e.reduce(X_);var Mf=new Set(["none","hidden"]);function pI(e,t){return Mf.has(e)?a=>a<=0?e:t:a=>a>=1?t:e}function Q_(e,t){return a=>ie(e,t,a)}function Nf(e){return typeof e=="number"?Q_:typeof e=="string"?Ws(e)?pi:$e.test(e)?ty:Z_:Array.isArray(e)?mI:typeof e=="object"?$e.test(e)?ty:J_:pi}function mI(e,t){let a=[...e],r=a.length,o=e.map((n,s)=>Nf(n)(n,t[s]));return n=>{for(let s=0;s<r;s++)a[s]=o[s](n);return a}}function J_(e,t){let a={...e,...t},r={};for(let o in a)e[o]!==void 0&&t[o]!==void 0&&(r[o]=Nf(e[o])(e[o],t[o]));return o=>{for(let n in r)a[n]=r[n](o);return a}}function Y_(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 Z_=(e,t)=>{let a=At.createTransformer(t),r=xn(e),o=xn(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?Mf.has(e)&&!o.values.length||Mf.has(t)&&!r.values.length?pI(e,t):Wa(mI(Y_(r,o),o.values),a):(gr(!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.`),pi(e,t))};function Of(e,t,a){return typeof e=="number"&&typeof t=="number"&&typeof a=="number"?ie(e,t,a):Nf(e)(e,t)}var eE=5;function Ff(e,t,a){let r=Math.max(t-eE,0);return vf(a-e(r),t-r)}var Pe={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 ay=.001;function hI({duration:e=Pe.duration,bounce:t=Pe.bounce,velocity:a=Pe.velocity,mass:r=Pe.mass}){let o,n;gr(e<=Ve(Pe.maxDuration),"Spring duration must be 10 seconds or less");let s=1-t;s=ct(Pe.minDamping,Pe.maxDamping,s),e=ct(Pe.minDuration,Pe.maxDuration,dt(e)),s<1?(o=u=>{let d=u*s,c=d*e,f=d-a,g=Bf(u,s),x=Math.exp(-c);return ay-f/g*x},n=u=>{let c=u*s*e,f=c*a+a,g=Math.pow(s,2)*Math.pow(u,2)*e,x=Math.exp(-c),w=Bf(Math.pow(u,2),s);return(-o(u)+ay>0?-1:1)*((f-g)*x)/w}):(o=u=>{let d=Math.exp(-u*e),c=(u-a)*e+1;return-ay+d*c},n=u=>{let d=Math.exp(-u*e),c=(a-u)*(e*e);return d*c});let i=5/e,l=aE(o,n,i);if(e=Ve(e),isNaN(l))return{stiffness:Pe.stiffness,damping:Pe.damping,duration:e};{let u=Math.pow(l,2)*r;return{stiffness:u,damping:s*2*Math.sqrt(r*u),duration:e}}}var tE=12;function aE(e,t,a){let r=a;for(let o=1;o<tE;o++)r=r-e(r)/t(r);return r}function Bf(e,t){return e*Math.sqrt(1-t*t)}var rE=["duration","bounce"],oE=["stiffness","damping","mass"];function gI(e,t){return t.some(a=>e[a]!==void 0)}function nE(e){let t={velocity:Pe.velocity,stiffness:Pe.stiffness,damping:Pe.damping,mass:Pe.mass,isResolvedFromDuration:!1,...e};if(!gI(e,oE)&&gI(e,rE))if(e.visualDuration){let a=e.visualDuration,r=2*Math.PI/(a*1.2),o=r*r,n=2*ct(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:Pe.mass,stiffness:o,damping:n}}else{let a=hI(e);t={...t,...a,mass:Pe.mass},t.isResolvedFromDuration=!0}return t}function Uf(e=Pe.visualDuration,t=Pe.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:g}=nE({...a,velocity:-dt(a.velocity||0)}),x=f||0,w=u/(2*Math.sqrt(l*d)),L=s-n,y=dt(Math.sqrt(l/d)),h=Math.abs(L)<5;r||(r=h?Pe.restSpeed.granular:Pe.restSpeed.default),o||(o=h?Pe.restDelta.granular:Pe.restDelta.default);let m;if(w<1){let I=Bf(y,w);m=P=>{let R=Math.exp(-w*y*P);return s-R*((x+w*y*L)/I*Math.sin(I*P)+L*Math.cos(I*P))}}else if(w===1)m=I=>s-Math.exp(-y*I)*(L+(x+y*L)*I);else{let I=y*Math.sqrt(w*w-1);m=P=>{let R=Math.exp(-w*y*P),A=Math.min(I*P,300);return s-R*((x+w*y*L)*Math.sinh(A)+I*L*Math.cosh(A))/I}}let S={calculatedDuration:g&&c||null,next:I=>{let P=m(I);if(g)i.done=I>=c;else{let R=0;w<1&&(R=I===0?Ve(x):Ff(m,I,P));let A=Math.abs(R)<=r,V=Math.abs(s-P)<=o;i.done=A&&V}return i.value=i.done?s:P,i},toString:()=>{let I=Math.min(ti(S),2e4),P=mu(R=>S.next(I*R).value,I,30);return I+"ms "+P}};return S}function ry({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},g=A=>i!==void 0&&A<i||l!==void 0&&A>l,x=A=>i===void 0?l:l===void 0||Math.abs(i-A)<Math.abs(l-A)?i:l,w=a*t,L=c+w,y=s===void 0?L:s(L);y!==L&&(w=y-c);let h=A=>-w*Math.exp(-A/r),m=A=>y+h(A),S=A=>{let V=h(A),F=m(A);f.done=Math.abs(V)<=u,f.value=f.done?y:F},I,P,R=A=>{g(f.value)&&(I=A,P=Uf({keyframes:[f.value,x(f.value)],velocity:Ff(m,A,f.value),damping:o,stiffness:n,restDelta:u,restSpeed:d}))};return R(0),{calculatedDuration:null,next:A=>{let V=!1;return!P&&I===void 0&&(V=!0,S(A),R(A)),I!==void 0&&A>=I?P.next(A-I):(!V&&S(A),f)}}}var yI=ho(.42,0,1,1),xI=ho(0,0,.58,1),Vf=ho(.42,0,.58,1);var vI=e=>Array.isArray(e)&&typeof e[0]!="number";var wI={linear:ge,easeIn:yI,easeInOut:Vf,easeOut:xI,circIn:kf,circInOut:Tf,circOut:Pf,backIn:gu,backInOut:If,backOut:Hg,anticipate:bf},oy=e=>{if(ai(e)){Ta(e.length===4,"Cubic bezier arrays must contain four numerical values.");let[t,a,r,o]=e;return ho(t,a,r,o)}else if(typeof e=="string")return Ta(wI[e]!==void 0,`Invalid easing type '${e}'`),wI[e];return e};function sE(e,t,a){let r=[],o=a||Of,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]||ge:t;i=Wa(l,i)}r.push(i)}return r}function CI(e,t,{clamp:a=!0,ease:r,mixer:o}={}){let n=e.length;if(Ta(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=sE(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=Zt(e[c],e[c+1],d);return i[c](f)};return a?d=>u(ct(e[0],e[n-1],d)):u}function SI(e,t){let a=e[e.length-1];for(let r=1;r<=t;r++){let o=Zt(0,t,r);e.push(ie(a,1,o))}}function LI(e){let t=[0];return SI(t,e.length-1),t}function II(e,t){return e.map(a=>a*t)}function iE(e,t){return e.map(()=>t||Vf).splice(0,e.length-1)}function vu({duration:e=300,keyframes:t,times:a,ease:r="easeInOut"}){let o=vI(r)?r.map(oy):oy(r),n={done:!1,value:t[0]},s=II(a&&a.length===t.length?a:LI(t),e),i=CI(s,t,{ease:Array.isArray(o)?o:iE(t,o)});return{calculatedDuration:e,next:l=>(n.value=i(l),n.done=l>=e,n)}}var bI=e=>{let t=({timestamp:a})=>e(a);return{start:()=>Z.update(t,!0),stop:()=>ea(t),now:()=>je.isProcessing?je.timestamp:vt.now()}};var lE={decay:ry,inertia:ry,tween:vu,keyframes:vu,spring:Uf},uE=e=>e/100,Cn=class extends fi{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||xo,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=fo(a)?a:lE[a]||vu,l,u;i!==vu&&typeof t[0]!="number"&&(l=Wa(uE,Of(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=ti(d));let{calculatedDuration:c}=d,f=c+o,g=f*(r+1)-o;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:c,resolvedDuration:f,totalDuration:g}}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:A}=this.options;return{done:!0,value:A[A.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:g,repeatType:x,repeatDelay:w,onUpdate:L}=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 y=this.currentTime-f*(this.speed>=0?1:-1),h=this.speed>=0?y<0:y>d;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let m=this.currentTime,S=n;if(g){let A=Math.min(this.currentTime,d)/c,V=Math.floor(A),F=A%1;!F&&A>=1&&(F=1),F===1&&V--,V=Math.min(V,g+1),V%2&&(x==="reverse"?(F=1-F,w&&(F-=w/c)):x==="mirror"&&(S=s)),m=ct(0,1,F)*c}let I=h?{done:!1,value:l[0]}:S.next(m);i&&(I.value=i(I.value));let{done:P}=I;!h&&u!==null&&(P=this.speed>=0?this.currentTime>=d:this.currentTime<=0);let R=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&P);return R&&o!==void 0&&(I.value=vo(l,this.options,o)),L&&L(I.value),R&&this.finish(),I}get duration(){let{resolved:t}=this;return t?dt(t.calculatedDuration):0}get time(){return dt(this.currentTime)}set time(t){t=Ve(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=dt(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;let{driver:t=bI,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 kI=new Set(["opacity","clipPath","filter","transform"]);function PI(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=oi(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 TI=mn(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));var jf=10,dE=2e4;function cE(e){return fo(e.type)||e.type==="spring"||!mf(e.ease)}function fE(e,t){let a=new Cn({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0}),r={done:!1,value:e[0]},o=[],n=0;for(;!r.done&&n<dE;)r=a.sample(n),o.push(r.value),n+=jf;return{times:void 0,keyframes:o,duration:n-jf,ease:"linear"}}var AI={anticipate:bf,backInOut:If,circInOut:Tf};function pE(e){return e in AI}var wu=class extends fi{constructor(t){super(t);let{name:a,motionValue:r,element:o,keyframes:n}=this.options;this.resolver=new ci(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"&&po()&&pE(n)&&(n=AI[n]),cE(this.options)){let{onComplete:c,onUpdate:f,motionValue:g,element:x,...w}=this.options,L=fE(t,w);t=L.keyframes,t.length===1&&(t[1]=t[0]),r=L.duration,o=L.times,n=L.ease,s="keyframes"}let d=PI(i.owner.current,l,t,{...this.options,duration:r,times:o,ease:n});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(pu(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{let{onComplete:c}=this.options;i.set(vo(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 dt(a)}get time(){let{resolved:t}=this;if(!t)return 0;let{animation:a}=t;return dt(a.currentTime||0)}set time(t){let{resolved:a}=this;if(!a)return;let{animation:r}=a;r.currentTime=Ve(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 ge;let{animation:r}=a;pu(r,t)}return ge}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,...g}=this.options,x=new Cn({...g,keyframes:r,duration:o,type:n,ease:s,times:i,isGenerator:!0}),w=Ve(this.time);u.setWithVelocity(x.sample(w-jf).value,x.sample(w).value,jf)}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 TI()&&r&&kI.has(r)&&!l&&!u&&!o&&n!=="mirror"&&s!==0&&i!=="inertia"}};var mE={type:"spring",stiffness:500,damping:25,restSpeed:10},hE=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),gE={type:"keyframes",duration:.8},yE={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},RI=(e,{keyframes:t})=>t.length>2?gE:Vt.has(e)?e.startsWith("scale")?hE(t[1]):mE:yE;function _I({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 mi=(e,t,a,r={},o,n)=>s=>{let i=co(r,e)||{},l=i.delay||r.delay||0,{elapsed:u=0}=r;u=u-Ve(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};_I(i)||(d={...d,...RI(e,d)}),d.duration&&(d.duration=Ve(d.duration)),d.repeatDelay&&(d.repeatDelay=Ve(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)),(Cf.current||Us.skipAnimations)&&(c=!0,d.duration=0,d.delay=0),c&&!n&&t.get()!==void 0){let f=vo(d.keyframes,i);if(f!==void 0)return Z.update(()=>{d.onUpdate(f),d.onComplete()}),new fu([])}return!n&&wu.supports(d)?new wu(d):new Cn(d)};function xE({protectedKeys:e,needsAnimating:t},a){let r=e.hasOwnProperty(a)&&t[a]!==!0;return t[a]=!1,r}function qf(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),g=l[c];if(g===void 0||d&&xE(d,c))continue;let x={delay:a,...co(s||{},c)},w=!1;if(window.MotionHandoffAnimation){let y=wf(e);if(y){let h=window.MotionHandoffAnimation(y,c,Z);h!==null&&(x.startTime=h,w=!0)}}hu(e,c),f.start(mi(c,f,g,e.shouldReduceMotion&&yf.has(c)?{type:!1}:x,e,w));let L=f.animation;L&&u.push(L)}return i&&Promise.all(u).then(()=>{Z.update(()=>{i&&HL(e,i)})}),u}function zf(e,t,a={}){var r;let o=uo(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(qf(e,o,a)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(u=0)=>{let{delayChildren:d=0,staggerChildren:c,staggerDirection:f}=n;return vE(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 vE(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(wE).forEach((u,d)=>{u.notify("AnimationStart",t),s.push(zf(u,t,{...n,delay:a+l(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(s)}function wE(e,t){return e.sortNodePosition(t)}function EI(e,t,a={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){let o=t.map(n=>zf(e,n,a));r=Promise.all(o)}else if(typeof t=="string")r=zf(e,t,a);else{let o=typeof t=="function"?uo(e,t,a.custom):t;r=Promise.all(qf(e,o,a))}return r.then(()=>{e.notify("AnimationComplete",t)})}var CE=iu.length;function ny(e){if(!e)return;if(!e.isControllingVariants){let a=e.parent?ny(e.parent)||{}:{};return e.props.initial!==void 0&&(a.initial=e.props.initial),a}let t={};for(let a=0;a<CE;a++){let r=iu[a],o=e.props[r];(xr(o)||o===!1)&&(t[r]=o)}return t}var SE=[...Jc].reverse(),LE=Jc.length;function IE(e){return t=>Promise.all(t.map(({animation:a,options:r})=>EI(e,a,r)))}function MI(e){let t=IE(e),a=DI(),r=!0,o=l=>(u,d)=>{var c;let f=uo(e,d,l==="exit"?(c=e.presenceContext)===null||c===void 0?void 0:c.custom:void 0);if(f){let{transition:g,transitionEnd:x,...w}=f;u={...u,...w,...x}}return u};function n(l){t=l(e)}function s(l){let{props:u}=e,d=ny(e.parent)||{},c=[],f=new Set,g={},x=1/0;for(let L=0;L<LE;L++){let y=SE[L],h=a[y],m=u[y]!==void 0?u[y]:d[y],S=xr(m),I=y===l?h.isActive:null;I===!1&&(x=L);let P=m===d[y]&&m!==u[y]&&S;if(P&&r&&e.manuallyAnimateOnMount&&(P=!1),h.protectedKeys={...g},!h.isActive&&I===null||!m&&!h.prevProp||lo(m)||typeof m=="boolean")continue;let R=bE(h.prevProp,m),A=R||y===l&&h.isActive&&!P&&S||L>x&&S,V=!1,F=Array.isArray(m)?m:[m],me=F.reduce(o(y),{});I===!1&&(me={});let{prevResolvedValues:ae={}}=h,Be={...ae,...me},Aa=Me=>{A=!0,f.has(Me)&&(V=!0,f.delete(Me)),h.needsAnimating[Me]=!0;let xe=e.getValue(Me);xe&&(xe.liveStyle=!1)};for(let Me in Be){let xe=me[Me],ot=ae[Me];if(g.hasOwnProperty(Me))continue;let oa=!1;lu(xe)&&lu(ot)?oa=!Mg(xe,ot):oa=xe!==ot,oa?xe!=null?Aa(Me):f.add(Me):xe!==void 0&&f.has(Me)?Aa(Me):h.protectedKeys[Me]=!0}h.prevProp=m,h.prevResolvedValues=me,h.isActive&&(g={...g,...me}),r&&e.blockInitialAnimation&&(A=!1),A&&(!(P&&R)||V)&&c.push(...F.map(Me=>({animation:Me,options:{type:y}})))}if(f.size){let L={};f.forEach(y=>{let h=e.getBaseTarget(y),m=e.getValue(y);m&&(m.liveStyle=!0),L[y]=h??null}),c.push({animation:L})}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 g;return(g=f.animationState)===null||g===void 0?void 0:g.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=DI(),r=!0}}}function bE(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Mg(t,e):!1}function Sn(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function DI(){return{animate:Sn(!0),whileInView:Sn(),whileHover:Sn(),whileTap:Sn(),whileDrag:Sn(),whileFocus:Sn(),exit:Sn()}}var rt=class{constructor(t){this.isMounted=!1,this.node=t}update(){}};var Hf=class extends rt{constructor(t){super(t),t.animationState||(t.animationState=MI(t))}updateAnimationControlsSubscription(){let{animate:t}=this.node.getProps();lo(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 kE=0,$f=class extends rt{constructor(){super(...arguments),this.id=kE++}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:Hf},exit:{Feature:$f}};function Sr(e,t,a,r={passive:!0}){return e.addEventListener(t,a,r),()=>e.removeEventListener(t,a)}function Lr(e){return{point:{x:e.pageX,y:e.pageY}}}var OI=e=>t=>gn(t)&&e(t,Lr(t));function wo(e,t,a,r){return Sr(e,t,OI(a),r)}var FI=(e,t)=>Math.abs(e-t);function BI(e,t){let a=FI(e.x,t.x),r=FI(e.y,t.y);return Math.sqrt(a**2+r**2)}var hi=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=iy(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,g=BI(c.offset,{x:0,y:0})>=3;if(!f&&!g)return;let{point:x}=c,{timestamp:w}=je;this.history.push({...x,timestamp:w});let{onStart:L,onMove:y}=this.handlers;f||(L&&L(this.lastMoveEvent,c),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,c)},this.handlePointerMove=(c,f)=>{this.lastMoveEvent=c,this.lastMoveEventInfo=sy(f,this.transformPagePoint),Z.update(this.updatePoint,!0)},this.handlePointerUp=(c,f)=>{this.end();let{onEnd:g,onSessionEnd:x,resumeAnimation:w}=this.handlers;if(this.dragSnapToOrigin&&w&&w(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let L=iy(c.type==="pointercancel"?this.lastMoveEventInfo:sy(f,this.transformPagePoint),this.history);this.startEvent&&g&&g(c,L),x&&x(c,L)},!gn(t))return;this.dragSnapToOrigin=n,this.handlers=a,this.transformPagePoint=r,this.contextWindow=o||window;let s=Lr(t),i=sy(s,this.transformPagePoint),{point:l}=i,{timestamp:u}=je;this.history=[{...l,timestamp:u}];let{onSessionStart:d}=a;d&&d(t,iy(i,this.history)),this.removeListeners=Wa(wo(this.contextWindow,"pointermove",this.handlePointerMove),wo(this.contextWindow,"pointerup",this.handlePointerUp),wo(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),ea(this.updatePoint)}};function sy(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 iy({point:e},t){return{point:e,delta:UI(e,VI(t)),offset:UI(e,PE(t)),velocity:TE(t,.1)}}function PE(e){return e[0]}function VI(e){return e[e.length-1]}function TE(e,t){if(e.length<2)return{x:0,y:0};let a=e.length-1,r=null,o=VI(e);for(;a>=0&&(r=e[a],!(o.timestamp-r.timestamp>Ve(t)));)a--;if(!r)return{x:0,y:0};let n=dt(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 HI=1e-4,AE=1-HI,RE=1+HI,$I=.01,_E=0-$I,EE=0+$I;function ft(e){return e.max-e.min}function WI(e,t,a){return Math.abs(e-t)<=a}function jI(e,t,a,r=.5){e.origin=r,e.originPoint=ie(t.min,t.max,e.origin),e.scale=ft(a)/ft(t),e.translate=ie(a.min,a.max,e.origin)-e.originPoint,(e.scale>=AE&&e.scale<=RE||isNaN(e.scale))&&(e.scale=1),(e.translate>=_E&&e.translate<=EE||isNaN(e.translate))&&(e.translate=0)}function gi(e,t,a,r){jI(e.x,t.x,a.x,r?r.originX:void 0),jI(e.y,t.y,a.y,r?r.originY:void 0)}function qI(e,t,a){e.min=a.min+t.min,e.max=e.min+ft(t)}function GI(e,t,a){qI(e.x,t.x,a.x),qI(e.y,t.y,a.y)}function zI(e,t,a){e.min=t.min-a.min,e.max=e.min+ft(t)}function yi(e,t,a){zI(e.x,t.x,a.x),zI(e.y,t.y,a.y)}function YI(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 KI(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 ZI(e,{top:t,left:a,bottom:r,right:o}){return{x:KI(e.x,a,o),y:KI(e.y,t,r)}}function XI(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 eb(e,t){return{x:XI(e.x,t.x),y:XI(e.y,t.y)}}function tb(e,t){let a=.5,r=ft(e),o=ft(t);return o>r?a=Zt(t.min,t.max-r,e.min):r>o&&(a=Zt(e.min,e.max-o,t.min)),ct(0,1,a)}function ab(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 Wf=.35;function rb(e=Wf){return e===!1?e=0:e===!0&&(e=Wf),{x:QI(e,"left","right"),y:QI(e,"top","bottom")}}function QI(e,t,a){return{min:JI(e,t),max:JI(e,a)}}function JI(e,t){return typeof e=="number"?e:e[t]||0}var ob=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ln=()=>({x:ob(),y:ob()}),nb=()=>({min:0,max:0}),Te=()=>({x:nb(),y:nb()});function jt(e){return[e("x"),e("y")]}function Gf({top:e,left:t,right:a,bottom:r}){return{x:{min:t,max:a},y:{min:e,max:r}}}function sb({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function ib(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 ly(e){return e===void 0||e===1}function Kf({scale:e,scaleX:t,scaleY:a}){return!ly(e)||!ly(t)||!ly(a)}function Ir(e){return Kf(e)||uy(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function uy(e){return lb(e.x)||lb(e.y)}function lb(e){return e&&e!=="0%"}function Cu(e,t,a){let r=e-a,o=t*r;return a+o}function ub(e,t,a,r,o){return o!==void 0&&(e=Cu(e,o,r)),Cu(e,a,r)+t}function dy(e,t=0,a=1,r,o){e.min=ub(e.min,t,a,r,o),e.max=ub(e.max,t,a,r,o)}function cy(e,{x:t,y:a}){dy(e.x,t.translate,t.scale,t.originPoint),dy(e.y,a.translate,a.scale,a.originPoint)}var db=.999999999999,cb=1.0000000000001;function pb(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&&In(e,{x:-n.scroll.offset.x,y:-n.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,cy(e,s)),r&&Ir(n.latestValues)&&In(e,n.latestValues))}t.x<cb&&t.x>db&&(t.x=1),t.y<cb&&t.y>db&&(t.y=1)}function Co(e,t){e.min=e.min+t,e.max=e.max+t}function fb(e,t,a,r,o=.5){let n=ie(e.min,e.max,o);dy(e,t,a,n,r)}function In(e,t){fb(e.x,t.x,t.scaleX,t.scale,t.originX),fb(e.y,t.y,t.scaleY,t.scale,t.originY)}function fy(e,t){return Gf(ib(e.getBoundingClientRect(),t))}function mb(e,t,a){let r=fy(e,a),{scroll:o}=t;return o&&(Co(r.x,o.offset.x),Co(r.y,o.offset.y)),r}var Xf=({current:e})=>e?e.ownerDocument.defaultView:null;var DE=new WeakMap,Jf=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=Te(),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(Lr(d).point)},n=(d,c)=>{let{drag:f,dragPropagation:g,onDragStart:x}=this.getProps();if(f&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=qg(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),jt(L=>{let y=this.getAxisMotionValue(L).get()||0;if(Tt.test(y)){let{projection:h}=this.visualElement;if(h&&h.layout){let m=h.layout.layoutBox[L];m&&(y=ft(m)*(parseFloat(y)/100))}}this.originPoint[L]=y}),x&&Z.postRender(()=>x(d,c)),hu(this.visualElement,"transform");let{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},s=(d,c)=>{let{dragPropagation:f,dragDirectionLock:g,onDirectionLock:x,onDrag:w}=this.getProps();if(!f&&!this.openDragLock)return;let{offset:L}=c;if(g&&this.currentDirection===null){this.currentDirection=ME(L),this.currentDirection!==null&&x&&x(this.currentDirection);return}this.updateAxis("x",c.point,L),this.updateAxis("y",c.point,L),this.visualElement.render(),w&&w(d,c)},i=(d,c)=>this.stop(d,c),l=()=>jt(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 hi(t,{onSessionStart:o,onStart:n,onMove:s,onSessionEnd:i,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:Xf(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&&Z.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||!Qf(t,o,this.currentDirection))return;let n=this.getAxisMotionValue(t),s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=YI(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&&vr(a)?this.constraints||(this.constraints=this.resolveRefConstraints()):a&&o?this.constraints=ZI(o.layoutBox,a):this.constraints=!1,this.elastic=rb(r),n!==this.constraints&&o&&this.constraints&&!this.hasMutatedConstraints&&jt(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=ab(o.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){let{dragConstraints:t,onMeasureDragConstraints:a}=this.getProps();if(!t||!vr(t))return!1;let r=t.current;Ta(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=mb(r,o.root,this.visualElement.getTransformPagePoint()),s=eb(o.layout.layoutBox,n);if(a){let i=a(sb(s));this.hasMutatedConstraints=!!i,i&&(s=Gf(i))}return s}startAnimation(t){let{drag:a,dragMomentum:r,dragElastic:o,dragTransition:n,dragSnapToOrigin:s,onDragTransitionEnd:i}=this.getProps(),l=this.constraints||{},u=jt(d=>{if(!Qf(d,a,this.currentDirection))return;let c=l&&l[d]||{};s&&(c={min:0,max:0});let f=o?200:1e6,g=o?40:1e7,x={type:"inertia",velocity:r?t[d]:0,bounceStiffness:f,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10,...n,...c};return this.startAxisValueAnimation(d,x)});return Promise.all(u).then(i)}startAxisValueAnimation(t,a){let r=this.getAxisMotionValue(t);return hu(this.visualElement,t),r.start(mi(t,r,0,a,this.visualElement,!1))}stopAnimation(){jt(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){jt(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){jt(a=>{let{drag:r}=this.getProps();if(!Qf(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(!vr(a)||!r||!this.constraints)return;this.stopAnimation();let o={x:0,y:0};jt(s=>{let i=this.getAxisMotionValue(s);if(i&&this.constraints!==!1){let l=i.get();o[s]=tb({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(),jt(s=>{if(!Qf(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;DE.set(this.visualElement,this);let t=this.visualElement.current,a=wo(t,"pointerdown",l=>{let{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(l)}),r=()=>{let{dragConstraints:l}=this.getProps();vr(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()),Z.read(r);let s=Sr(window,"resize",()=>this.scalePositionWithinConstraints()),i=o.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(jt(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=Wf,dragMomentum:i=!0}=t;return{...t,drag:a,dragDirectionLock:r,dragPropagation:o,dragConstraints:n,dragElastic:s,dragMomentum:i}}};function Qf(e,t,a){return(t===!0||t===e)&&(a===null||a===e)}function ME(e,t=10){let a=null;return Math.abs(e.y)>t?a="y":Math.abs(e.x)>t&&(a="x"),a}var Yf=class extends rt{constructor(t){super(t),this.removeGroupControls=ge,this.removeListeners=ge,this.controls=new Jf(t)}mount(){let{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ge}unmount(){this.removeGroupControls(),this.removeListeners()}};var hb=e=>(t,a)=>{e&&Z.postRender(()=>e(t,a))},Zf=class extends rt{constructor(){super(...arguments),this.removePointerDownListener=ge}onPointerDown(t){this.session=new hi(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Xf(this.node)})}createPanHandlers(){let{onPanSessionStart:t,onPanStart:a,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:hb(t),onStart:hb(a),onMove:r,onEnd:(n,s)=>{delete this.session,o&&Z.postRender(()=>o(n,s))}}}mount(){this.removePointerDownListener=wo(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 xb=N(le(),1),Su=N(W(),1);var xi={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function gb(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var vi={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(z.test(e))e=parseFloat(e);else return e;let a=gb(e,t.target.x),r=gb(e,t.target.y);return`${a}% ${r}%`}};var yb={correct:(e,{treeScale:t,projectionDelta:a})=>{let r=e,o=At.parse(e);if(o.length>5)return r;let n=At.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 py=class extends Su.Component{componentDidMount(){let{visualElement:t,layoutGroup:a,switchLayoutGroup:r,layoutId:o}=this.props,{projection:n}=t;bL(NE),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()})),xi.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()||Z.postRender(()=>{let i=s.getStack();(!i||!i.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){let{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),js.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 ep(e){let[t,a]=zc(),r=(0,Su.useContext)(Ns);return(0,xb.jsx)(py,{...e,layoutGroup:r,switchLayoutGroup:(0,Su.useContext)(tf),isPresent:t,safeToRemove:a})}var NE={borderRadius:{...vi,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:vi,borderTopRightRadius:vi,borderBottomLeftRadius:vi,borderBottomRightRadius:vi,boxShadow:yb};function vb(e,t,a){let r=Se(e)?e:Cr(e);return r.start(mi("",r,t,a)),r.animation}function wb(e){return e instanceof SVGElement&&e.tagName!=="svg"}var Cb=(e,t)=>e.depth-t.depth;var tp=class{constructor(){this.children=[],this.isDirty=!1}add(t){si(this.children,t),this.isDirty=!0}remove(t){ii(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Cb),this.isDirty=!1,this.children.forEach(t)}};function Sb(e,t){let a=vt.now(),r=({timestamp:o})=>{let n=o-a;n>=t&&(ea(r),e(n-t))};return Z.read(r,!0),()=>ea(r)}var kb=["TopLeft","TopRight","BottomLeft","BottomRight"],OE=kb.length,Lb=e=>typeof e=="string"?parseFloat(e):e,Ib=e=>typeof e=="number"||z.test(e);function Pb(e,t,a,r,o,n){o?(e.opacity=ie(0,a.opacity!==void 0?a.opacity:1,FE(r)),e.opacityExit=ie(t.opacity!==void 0?t.opacity:1,0,BE(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<OE;s++){let i=`border${kb[s]}Radius`,l=bb(t,i),u=bb(a,i);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||Ib(l)===Ib(u)?(e[i]=Math.max(ie(Lb(l),Lb(u),r),0),(Tt.test(u)||Tt.test(l))&&(e[i]+="%")):e[i]=u}(t.rotate||a.rotate)&&(e.rotate=ie(t.rotate||0,a.rotate||0,r))}function bb(e,t){return e[t]!==void 0?e[t]:e.borderRadius}var FE=Tb(0,.5,Pf),BE=Tb(.5,.95,ge);function Tb(e,t,a){return r=>r<e?0:r>t?1:a(Zt(e,t,r))}function Ab(e,t){e.min=t.min,e.max=t.max}function aa(e,t){Ab(e.x,t.x),Ab(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 Rb(e,t,a,r,o){return e-=t,e=Cu(e,1/a,r),o!==void 0&&(e=Cu(e,1/o,r)),e}function UE(e,t=0,a=1,r=.5,o,n=e,s=e){if(Tt.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=Rb(e.min,t,a,i,o),e.max=Rb(e.max,t,a,i,o)}function _b(e,t,[a,r,o],n,s){UE(e,t[a],t[r],t[o],t.scale,n,s)}var VE=["x","scaleX","originX"],jE=["y","scaleY","originY"];function hy(e,t,a,r){_b(e.x,t,VE,a?a.x:void 0,r?r.x:void 0),_b(e.y,t,jE,a?a.y:void 0,r?r.y:void 0)}function Eb(e){return e.translate===0&&e.scale===1}function gy(e){return Eb(e.x)&&Eb(e.y)}function Db(e,t){return e.min===t.min&&e.max===t.max}function Nb(e,t){return Db(e.x,t.x)&&Db(e.y,t.y)}function Mb(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function yy(e,t){return Mb(e.x,t.x)&&Mb(e.y,t.y)}function xy(e){return ft(e.x)/ft(e.y)}function vy(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var ap=class{constructor(){this.members=[]}add(t){si(this.members,t),t.scheduleRender()}remove(t){if(ii(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 Ob(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:g,skewY:x}=a;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),c&&(r+=`rotateX(${c}deg) `),f&&(r+=`rotateY(${f}deg) `),g&&(r+=`skewX(${g}deg) `),x&&(r+=`skewY(${x}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 bn={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Lu=typeof window<"u"&&window.MotionDebug!==void 0,wy=["","X","Y","Z"],qE={visibility:"hidden"},Fb=1e3,zE=0;function Cy(e,t,a,r){let{latestValues:o}=t;o[e]&&(a[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function $b(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let a=wf(t);if(window.MotionHasOptimisedAnimation(a,"transform")){let{layout:o,layoutId:n}=e.options;window.MotionCancelOptimisedAnimation(a,"transform",Z,!(o||n))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&$b(r)}function rp({attachResizeListener:e,defaultParent:t,measureScroll:a,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(s={},i=t?.()){this.id=zE++,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,Lu&&(bn.totalNodes=bn.resolvedTargetDeltas=bn.recalculatedProjection=0),this.nodes.forEach(WE),this.nodes.forEach(JE),this.nodes.forEach(YE),this.nodes.forEach(GE),Lu&&window.MotionDebug.record(bn)},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 tp)}addEventListener(s,i){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new mo),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=wb(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=Sb(f,250),xi.hasAnimatedSinceResize&&(xi.hasAnimatedSinceResize=!1,this.nodes.forEach(Ub))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||u)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:f,hasRelativeTargetChanged:g,layout:x})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let w=this.options.transition||d.getDefaultTransition()||rD,{onLayoutAnimationStart:L,onLayoutAnimationComplete:y}=d.getProps(),h=!this.targetLayout||!yy(this.targetLayout,x)||g,m=!f&&g;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||m||f&&(h||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(c,m);let S={...co(w,"layout"),onPlay:L,onComplete:y};(d.shouldReduceMotion||this.options.layoutRoot)&&(S.delay=0,S.type=!1),this.startAnimation(S)}else f||Ub(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,ea(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(ZE),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&&$b(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(Bb);return}this.isUpdating||this.nodes.forEach(XE),this.isUpdating=!1,this.nodes.forEach(QE),this.nodes.forEach(HE),this.nodes.forEach($E),this.clearAllSnapshots();let i=vt.now();je.delta=ct(0,1e3/60,i-je.timestamp),je.timestamp=i,je.isProcessing=!0,Xc.update.process(je),Xc.preRender.process(je),Xc.render.process(je),je.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,js.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(KE),this.sharedNodes.forEach(eD)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Z.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Z.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=Te(),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&&!gy(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;s&&(i||Ir(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)),oD(l),{animationId:this.root.animationId,measuredBox:i,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var s;let{visualElement:i}=this.options;if(!i)return Te();let l=i.measureViewportBox();if(!(((s=this.scroll)===null||s===void 0?void 0:s.wasRoot)||this.path.some(nD))){let{scroll:d}=this.root;d&&(Co(l.x,d.offset.x),Co(l.y,d.offset.y))}return l}removeElementScroll(s){var i;let l=Te();if(aa(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&&aa(l,s),Co(l.x,c.offset.x),Co(l.y,c.offset.y))}return l}applyTransform(s,i=!1){let l=Te();aa(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&&In(l,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),Ir(d.latestValues)&&In(l,d.latestValues)}return Ir(this.latestValues)&&In(l,this.latestValues),l}removeTransform(s){let i=Te();aa(i,s);for(let l=0;l<this.path.length;l++){let u=this.path[l];if(!u.instance||!Ir(u.latestValues))continue;Kf(u.latestValues)&&u.updateSnapshot();let d=Te(),c=u.measurePageBox();aa(d,c),hy(i,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return Ir(this.latestValues)&&hy(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!==je.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=je.timestamp,!this.targetDelta&&!this.relativeTarget){let g=this.getClosestProjectingParent();g&&g.layout&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Te(),this.relativeTargetOrigin=Te(),yi(this.relativeTargetOrigin,this.layout.layoutBox,g.layout.layoutBox),aa(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Te(),this.targetWithTransforms=Te()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),GI(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):aa(this.target,this.layout.layoutBox),cy(this.target,this.targetDelta)):aa(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;let g=this.getClosestProjectingParent();g&&!!g.resumingFrom==!!this.resumingFrom&&!g.options.layoutScroll&&g.target&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Te(),this.relativeTargetOrigin=Te(),yi(this.relativeTargetOrigin,this.target,g.target),aa(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Lu&&bn.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Kf(this.parent.latestValues)||uy(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===je.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;aa(this.layoutCorrected,this.layout.layoutBox);let f=this.treeScale.x,g=this.treeScale.y;pb(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=Te());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)),gi(this.projectionDelta,this.layoutCorrected,x,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==g||!vy(this.projectionDelta.x,this.prevProjectionDelta.x)||!vy(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",x)),Lu&&bn.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=Ln(),this.projectionDelta=Ln(),this.projectionDeltaWithTransform=Ln()}setAnimationOrigin(s,i=!1){let l=this.snapshot,u=l?l.latestValues:{},d={...this.latestValues},c=Ln();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!i;let f=Te(),g=l?l.source:void 0,x=this.layout?this.layout.source:void 0,w=g!==x,L=this.getStack(),y=!L||L.members.length<=1,h=!!(w&&!y&&this.options.crossfade===!0&&!this.path.some(aD));this.animationProgress=0;let m;this.mixTargetDelta=S=>{let I=S/1e3;Vb(c.x,s.x,I),Vb(c.y,s.y,I),this.setTargetDelta(c),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(yi(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),tD(this.relativeTarget,this.relativeTargetOrigin,f,I),m&&Nb(this.relativeTarget,m)&&(this.isProjectionDirty=!1),m||(m=Te()),aa(m,this.relativeTarget)),w&&(this.animationValues=d,Pb(d,u,this.latestValues,I,h,y)),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&&(ea(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Z.update(()=>{xi.hasAnimatedSinceResize=!0,this.currentAnimation=vb(0,Fb,{...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(Fb),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&&Wb(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Te();let c=ft(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+c;let f=ft(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+f}aa(i,l),In(i,d),gi(this.projectionDeltaWithTransform,this.layoutCorrected,i,d)}}registerSharedNode(s,i){this.sharedNodes.has(s)||this.sharedNodes.set(s,new ap),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&&Cy("z",s,u,this.animationValues);for(let d=0;d<wy.length;d++)Cy(`rotate${wy[d]}`,s,u,this.animationValues),Cy(`skew${wy[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 qE;let u={visibility:""},d=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=$s(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=$s(s?.pointerEvents)||""),this.hasProjected&&!Ir(this.latestValues)&&(w.transform=d?d({},""):"none",this.hasProjected=!1),w}let f=c.animationValues||c.latestValues;this.applyTransformsToTarget(),u.transform=Ob(this.projectionDeltaWithTransform,this.treeScale,f),d&&(u.transform=d(f,u.transform));let{x:g,y:x}=this.projectionDelta;u.transformOrigin=`${g.origin*100}% ${x.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 Ys){if(f[w]===void 0)continue;let{correct:L,applyTo:y}=Ys[w],h=u.transform==="none"?f[w]:L(f[w],c);if(y){let m=y.length;for(let S=0;S<m;S++)u[y[S]]=h}else u[w]=h}return this.options.layoutId&&(u.pointerEvents=c===this?$s(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(Bb),this.root.sharedNodes.clear()}}}function HE(e){e.updateLayout()}function $E(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"?jt(c=>{let f=s?a.measuredBox[c]:a.layoutBox[c],g=ft(f);f.min=r[c].min,f.max=f.min+g}):Wb(n,a.layoutBox,r)&&jt(c=>{let f=s?a.measuredBox[c]:a.layoutBox[c],g=ft(r[c]);f.max=f.min+g,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[c].max=e.relativeTarget[c].min+g)});let i=Ln();gi(i,r,a.layoutBox);let l=Ln();s?gi(l,e.applyTransform(o,!0),a.measuredBox):gi(l,r,a.layoutBox);let u=!gy(i),d=!1;if(!e.resumeFrom){let c=e.getClosestProjectingParent();if(c&&!c.resumeFrom){let{snapshot:f,layout:g}=c;if(f&&g){let x=Te();yi(x,a.layoutBox,f.layoutBox);let w=Te();yi(w,r,g.layoutBox),yy(x,w)||(d=!0),c.options.layoutRoot&&(e.relativeTarget=w,e.relativeTargetOrigin=x,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 WE(e){Lu&&bn.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 GE(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function KE(e){e.clearSnapshot()}function Bb(e){e.clearMeasurements()}function XE(e){e.isLayoutDirty=!1}function QE(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Ub(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function JE(e){e.resolveTargetDelta()}function YE(e){e.calcProjection()}function ZE(e){e.resetSkewAndRotation()}function eD(e){e.removeLeadSnapshot()}function Vb(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 jb(e,t,a,r){e.min=ie(t.min,a.min,r),e.max=ie(t.max,a.max,r)}function tD(e,t,a,r){jb(e.x,t.x,a.x,r),jb(e.y,t.y,a.y,r)}function aD(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var rD={duration:.45,ease:[.4,0,.1,1]},qb=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),zb=qb("applewebkit/")&&!qb("chrome/")?Math.round:ge;function Hb(e){e.min=zb(e.min),e.max=zb(e.max)}function oD(e){Hb(e.x),Hb(e.y)}function Wb(e,t,a){return e==="position"||e==="preserve-aspect"&&!WI(xy(t),xy(a),.2)}function nD(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}var Gb=rp({attachResizeListener:(e,t)=>Sr(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0});var Sy={current:void 0},op=rp({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Sy.current){let e=new Gb({});e.mount(window),e.setOptions({layoutScroll:!0}),Sy.current=e}return Sy.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"});var Kb={pan:{Feature:Zf},drag:{Feature:Yf,ProjectionNode:op,MeasureLayout:ep}};function Xb(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&&Z.postRender(()=>n(t,Lr(t)))}var np=class extends rt{mount(){let{current:t}=this.node;t&&(this.unmount=Ug(t,a=>(Xb(this.node,a,"Start"),r=>Xb(this.node,r,"End"))))}unmount(){}};var sp=class extends rt{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=Wa(Sr(this.node.current,"focus",()=>this.onFocus()),Sr(this.node.current,"blur",()=>this.onBlur()))}unmount(){}};function Qb(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&&Z.postRender(()=>n(t,Lr(t)))}var ip=class extends rt{mount(){let{current:t}=this.node;t&&(this.unmount=jg(t,a=>(Qb(this.node,a,"Start"),(r,{success:o})=>Qb(this.node,r,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}};var Iy=new WeakMap,Ly=new WeakMap,sD=e=>{let t=Iy.get(e.target);t&&t(e)},iD=e=>{e.forEach(sD)};function lD({root:e,...t}){let a=e||document;Ly.has(a)||Ly.set(a,{});let r=Ly.get(a),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(iD,{root:e,...t})),r[o]}function Jb(e,t,a){let r=lD(t);return Iy.set(e,a),r.observe(e),()=>{Iy.delete(e),r.unobserve(e)}}var uD={some:0,all:1},lp=class extends rt{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:uD[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 Jb(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(dD(t,a))&&this.startObserver()}unmount(){}};function dD({viewport:e={}},{viewport:t={}}={}){return a=>e[a]!==t[a]}var Yb={inView:{Feature:lp},tap:{Feature:ip},focus:{Feature:sp},hover:{Feature:np}};var Zb={layout:{ProjectionNode:op,MeasureLayout:ep}};var ok=N(W(),1);var Iu={current:null},up={current:!1};function ek(){if(up.current=!0,!!Bs)if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Iu.current=e.matches;e.addListener(t),t()}else Iu.current=!1}var cD=[...Qg,$e,At],tk=e=>cD.find(Df(e));var by=new WeakMap;function ak(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,Cr(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,Cr(s!==void 0?s:o,{owner:e}))}}for(let r in a)t[r]===void 0&&e.removeValue(r);return t}var rk=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],dp=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=xo,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 g=vt.now();this.renderScheduledAt<g&&(this.renderScheduledAt=g,Z.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=hn(a),this.isVariantNode=Yc(a),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);let{willChange:c,...f}=this.scrapeMotionValuesFromProps(a,{},this);for(let g in f){let x=f[g];l[g]!==void 0&&Se(x)&&x.set(l[g],!1)}}mount(t){this.current=t,by.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)),up.current||ek(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Iu.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){by.delete(this.current),this.projection&&this.projection.unmount(),ea(this.notifyUpdate),ea(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=Vt.has(t),o=a.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&Z.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 yr){let a=yr[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):Te()}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<rk.length;r++){let o=rk[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=ak(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=Cr(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"&&(Ef(o)||Af(o))?o=parseFloat(o):!tk(o)&&At.test(a)&&(o=_f(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=Hs(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 mo),this.events[t].add(a)}notify(t,...a){this.events[t]&&this.events[t].notify(...a)}};var wi=class extends dp{constructor(){super(...arguments),this.KeyframeResolver=ci}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 fD(e){return window.getComputedStyle(e)}var cp=class extends wi{constructor(){super(...arguments),this.type="html",this.renderInstance=lf}readValueFromInstance(t,a){if(Vt.has(a)){let r=di(a);return r&&r.default||0}else{let r=fD(t),o=(of(a)?r.getPropertyValue(a):r[a])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:a}){return fy(t,a)}build(t,a,r){Ks(t,a,r.transformTemplate)}scrapeMotionValuesFromProps(t,a,r){return Zs(t,a,r)}};var fp=class extends wi{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Te}getBaseTargetFromProps(t,a){return t[a]}readValueFromInstance(t,a){if(Vt.has(a)){let r=di(a);return r&&r.default||0}return a=uf.has(a)?a:Vs(a),t.getAttribute(a)}scrapeMotionValuesFromProps(t,a,r){return ff(t,a,r)}build(t,a,r){Xs(t,a,this.isSVGTag,r.transformTemplate)}renderInstance(t,a,r,o){df(t,a,r,o)}mount(t){this.isSVGTag=Js(t.tagName),super.mount(t)}};var nk=(e,t)=>zs(e)?new fp(t):new cp(t,{allowProjection:e!==ok.Fragment});var sk=ML({...NI,...Yb,...Kb,...Zb},nk);var ky=eL(sk);var bu=N(le(),1);function ik({x:e,y:t,visible:a,onClick:r=!1}){return(0,bu.jsx)(Ag,{children:a&&(0,bu.jsx)(ky.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,bu.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,bu.jsx)("path",{d:"M3 3L10.07 19.97L12.58 12.58L19.97 10.07L3 3Z",fill:"#C4B5FD"})})})})}var Ci=N(W(),1);function lk(){let[e,t]=Ci.useState({x:0,y:0,visible:!1,onClick:!1}),a=Ci.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=Ci.useCallback(()=>{t(n=>({...n,visible:!1}))},[]),o=Ci.useCallback(()=>{t(n=>({...n,visible:!0}))},[]);return{cursorState:e,moveTo:a,hide:r,show:o}}var br=N(W(),1);function uk({productBackendUrl:e,sessionId:t,enabled:a=!0}){let[r,o]=br.useState({status:"idle"}),n=br.useRef(null),s=br.useCallback(async()=>{if(!e||!a){console.log("[useUserAuth] Skipping auth - productBackendUrl:",e,"enabled:",a),o({status:"idle"});return}console.log("[useUserAuth] Starting auth request to product backend..."),console.log("[useUserAuth] Product backend URL:",e),console.log("[useUserAuth] Full request URL:",`${e}/users/me`),o({status:"loading"});try{let l=await fetch(`${e}/users/me`,{method:"GET",credentials:"include",headers:{Accept:"application/json"}});if(console.log("[useUserAuth] Response received - status:",l.status,"ok:",l.ok),!l.ok)throw console.log("[useUserAuth] Auth request failed with status:",l.status),l.status===401?new Error("Please log in to use the chat assistant."):l.status===403?new Error("You do not have permission to access this feature."):new Error(`Authentication failed (${l.status})`);let u=await l.json();console.log("[useUserAuth] Auth SUCCESS - parsed user data:"),console.log("[useUserAuth] id:",u.id),console.log("[useUserAuth] email:",u.email),console.log("[useUserAuth] name:",u.name),console.log("[useUserAuth] role:",u.role),console.log("[useUserAuth] isInternal:",u.isInternal),console.log("[useUserAuth] agreementsSigned:",u.agreementsSigned),console.log("[useUserAuth] lastLoginTime:",u.lastLoginTime),o({status:"authenticated",user:u})}catch(l){console.log("[useUserAuth] Auth ERROR:",l);let u=l instanceof Error?l.message:"Unable to verify your identity. Please try again.";o({status:"error",error:u})}},[e,a]);br.useEffect(()=>{t!==n.current&&(n.current=t,s())},[t,s]);let i=br.useCallback(()=>{s()},[s]);return{authState:r,retry:i}}var pp=N(W(),1);function dk({agentUrl:e,orgId:t}){let[a,r]=pp.useState({status:"idle",config:null,error:null});return pp.useEffect(()=>{if(!e||!t){console.log("[useOrgConfig] Skipping - missing agentUrl or orgId",{agentUrl:e,orgId:t});return}(async()=>{r({status:"loading",config:null,error:null});let n=`${e}/org/${t}/config`;console.log("[useOrgConfig] Fetching org config from:",n);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();console.log("[useOrgConfig] Received config:",i),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 Si=N(le(),1);function wt({className:e,...t}){return(0,Si.jsx)("div",{"data-slot":"card",className:Jt("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function Ga({className:e,...t}){return(0,Si.jsx)("div",{"data-slot":"card-header",className:Jt("@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 Ka({className:e,...t}){return(0,Si.jsx)("div",{"data-slot":"card-title",className:Jt("leading-none font-semibold",e),...t})}function Py({className:e,...t}){return(0,Si.jsx)("div",{"data-slot":"card-description",className:Jt("text-muted-foreground text-sm",e),...t})}function Ct({className:e,...t}){return(0,Si.jsx)("div",{"data-slot":"card-content",className:Jt("px-6",e),...t})}var C=N(le(),1),Ty=e=>new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),mp=(e,t="USD")=>new Intl.NumberFormat("en-US",{style:"currency",currency:t}).format(e),Ay=e=>{switch(e){case"Enterprise":return un;case"Professional":return ru;default:return Xl}},hp=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 ku({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:at};case"failed":return{color:"bg-red-50 text-red-700 border-red-200",icon:ka};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:Es};default:return{color:"bg-gray-50 text-gray-700 border-gray-200",icon:ba}}if(t==="subscription")switch(n){case"active":return{color:"bg-emerald-50 text-emerald-700 border-emerald-200",icon:at};case"cancelled":return{color:"bg-slate-50 text-slate-700 border-slate-200",icon:ka};case"past_due":return{color:"bg-red-50 text-red-700 border-red-200",icon:ba};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:ba}}switch(n){case"active":return{color:"bg-emerald-50 text-emerald-700 border-emerald-200",icon:at};case"inactive":return{color:"bg-slate-50 text-slate-700 border-slate-200",icon:ka};default:return{color:"bg-gray-50 text-gray-700 border-gray-200",icon:ba}}})(),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 pD({subscription:e}){let t=Ay(e.plan);return(0,C.jsxs)(wt,{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)(Ga,{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)(Ka,{className:"text-base font-semibold text-gray-900 flex items-center gap-2",children:[(0,C.jsx)(ln,{className:"h-4 w-4 text-gray-500"}),e.id]}),e.customer_email&&(0,C.jsxs)(Py,{className:"text-sm text-gray-500 flex items-center gap-1.5",children:[(0,C.jsx)(Rs,{className:"h-3 w-3"}),e.customer_email]})]}),(0,C.jsx)(ku,{status:e.status,type:"subscription"})]})}),(0,C.jsx)(Ct,{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 ${hp(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:[mp(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:[Ty(e.current_period_start)," - ",Ty(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:Ty(e.created_at)})]})]})]})})]})}function mD({subscriptions:e,maxItems:t=5}){let a=e.slice(0,t),r=e.length>t;return e.length===0?(0,C.jsx)(wt,{className:"border-gray-200 shadow-sm bg-white",children:(0,C.jsxs)(Ct,{className:"py-8 text-center",children:[(0,C.jsx)(ln,{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)(wt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,C.jsx)(Ga,{className:"pb-2 border-b border-gray-100",children:(0,C.jsxs)(Ka,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,C.jsx)(ln,{className:"h-4 w-4"}),e.length," Subscription",e.length!==1?"s":""]})}),(0,C.jsxs)(Ct,{className:"p-0",children:[(0,C.jsx)("div",{className:"divide-y divide-gray-100",children:a.map(o=>{let n=Ay(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 ${hp(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 ",mp(o.amount,o.currency),"/",o.billing_cycle]})]})]}),(0,C.jsx)(ku,{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 hD({customer:e}){let t=Ay(e.subscription);return(0,C.jsxs)(wt,{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)(Ga,{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)(Ka,{className:"text-base font-semibold text-gray-900",children:e.name}),(0,C.jsxs)(Py,{className:"text-sm text-gray-500 flex items-center gap-1",children:[(0,C.jsx)(Rs,{className:"h-3 w-3"}),e.email]})]})}),(0,C.jsx)(ku,{status:e.status,type:"customer"})]})}),(0,C.jsx)(Ct,{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 ${hp(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)(dn,{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)(_s,{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)(Jl,{className:"h-3 w-3 text-gray-400"}),e.joinDate]})]})]})]})})]})}function gD({customers:e,maxItems:t=5}){let a=e.slice(0,t),r=e.length>t;return e.length===0?(0,C.jsx)(wt,{className:"border-gray-200 shadow-sm bg-white",children:(0,C.jsxs)(Ct,{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 customers found"})]})}):(0,C.jsxs)(wt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,C.jsx)(Ga,{className:"pb-2 border-b border-gray-100",children:(0,C.jsxs)(Ka,{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," Customer",e.length!==1?"s":""]})}),(0,C.jsxs)(Ct,{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 ${hp(o.subscription)}`,children:o.subscription}),(0,C.jsx)(ku,{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 ck({transactions:e,maxItems:t=5}){let a=e.slice(0,t),r=e.length>t;return e.length===0?(0,C.jsx)(wt,{className:"border-gray-200 shadow-sm bg-white",children:(0,C.jsxs)(Ct,{className:"py-8 text-center",children:[(0,C.jsx)(dn,{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)(wt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,C.jsx)(Ga,{className:"pb-2 border-b border-gray-100",children:(0,C.jsxs)(Ka,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,C.jsx)(dn,{className:"h-4 w-4"}),e.length," Transaction",e.length!==1?"s":""]})}),(0,C.jsxs)(Ct,{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)(at,{className:"h-4 w-4 text-emerald-600"}):o.status==="failed"?(0,C.jsx)(ka,{className:"h-4 w-4 text-red-600"}):o.status==="refunded"?(0,C.jsx)(Es,{className:"h-4 w-4 text-slate-600"}):(0,C.jsx)(sn,{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)(ku,{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 yD({apiKeys:e}){return e.length===0?(0,C.jsx)(wt,{className:"border-gray-200 shadow-sm bg-white",children:(0,C.jsxs)(Ct,{className:"py-8 text-center",children:[(0,C.jsx)(As,{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)(wt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,C.jsx)(Ga,{className:"pb-2 border-b border-gray-100",children:(0,C.jsxs)(Ka,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,C.jsx)(As,{className:"h-4 w-4"}),e.length," API Key",e.length!==1?"s":""]})}),(0,C.jsx)(Ct,{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 xD({sessions:e}){let t=a=>{let r=a.toLowerCase();return r.includes("mobile")||r.includes("iphone")||r.includes("android")?tu:Zl};return e.length===0?(0,C.jsx)(wt,{className:"border-gray-200 shadow-sm bg-white",children:(0,C.jsxs)(Ct,{className:"py-8 text-center",children:[(0,C.jsx)(Ds,{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)(wt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,C.jsx)(Ga,{className:"pb-2 border-b border-gray-100",children:(0,C.jsxs)(Ka,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,C.jsx)(Ds,{className:"h-4 w-4"}),e.length," Active Session",e.length!==1?"s":""]})}),(0,C.jsx)(Ct,{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)(_s,{className:"h-3 w-3"}),a.location]})]})]}),(0,C.jsx)("div",{className:"text-xs text-gray-500",children:a.time})]})},r)})})})]})}function vD({stats:e}){return(0,C.jsxs)(wt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,C.jsx)(Ga,{className:"pb-2 border-b border-gray-100",children:(0,C.jsxs)(Ka,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,C.jsx)(au,{className:"h-4 w-4"}),"Dashboard Overview"]})}),(0,C.jsx)(Ct,{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:mp(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 wD({customers:e}){return e.length===0?(0,C.jsx)(wt,{className:"border-gray-200 shadow-sm bg-white",children:(0,C.jsxs)(Ct,{className:"py-8 text-center",children:[(0,C.jsx)(un,{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)(wt,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,C.jsx)(Ga,{className:"pb-2 border-b border-gray-100",children:(0,C.jsxs)(Ka,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,C.jsx)(un,{className:"h-4 w-4 text-amber-500"}),"Top Customers"]})}),(0,C.jsx)(Ct,{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"?mp(t.revenue):t.revenue})]})},a))})})]})}function fk({type:e,data:t}){if(!t)return null;switch(e){case"subscription":return(0,C.jsx)(pD,{subscription:t});case"subscriptions":let a=t.subscriptions||t||[];return(0,C.jsx)(mD,{subscriptions:Array.isArray(a)?a:[a]});case"customer":return(0,C.jsx)(hD,{customer:t.customer||t});case"customers":let r=t.customers||t||[];return(0,C.jsx)(gD,{customers:Array.isArray(r)?r:[r]});case"transactions":let o=t.transactions||t||[];return(0,C.jsx)(ck,{transactions:Array.isArray(o)?o:[o]});case"transaction":return(0,C.jsx)(ck,{transactions:[t],maxItems:1});case"dashboard_stats":return(0,C.jsx)(vD,{stats:t});case"top_customers":let n=t.customers||t||[];return(0,C.jsx)(wD,{customers:Array.isArray(n)?n:[n]});case"api_keys":let s=t.api_keys||t||[];return(0,C.jsx)(yD,{apiKeys:Array.isArray(s)?s:[s]});case"sessions":let i=t.sessions||t||[];return(0,C.jsx)(xD,{sessions:Array.isArray(i)?i:[i]});default:return null}}var kn=N(le(),1);function pk({className:e=""}){return(0,kn.jsx)("div",{className:`flex items-center gap-1 px-4 py-3 ${e}`,children:(0,kn.jsxs)("div",{className:"flex items-center gap-1",children:[(0,kn.jsx)("span",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"0ms",animationDuration:"600ms"}}),(0,kn.jsx)("span",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"150ms",animationDuration:"600ms"}}),(0,kn.jsx)("span",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"300ms",animationDuration:"600ms"}})]})})}var p=N(le(),1),CD="0.2.45",SD="http://localhost:5002",Pu=340;function LD(e){return e.replace(/\\\\n/g,`
|
|
24
24
|
`).replace(/\\\\t/g," ").replace(/\\\\"/g,'"').replace(/\\\\\\\\/g,"\\").replace(/\\n/g,`
|
|
25
|
-
`).replace(/\\t/g," ").replace(/\\"/g,'"').replace(/\\\\/g,"\\")}function
|
|
26
|
-
`),a=[],r=null,o=!1,n=[],s="",i=u=>{let d=[],c=u,f=0;for(;c.length>0;){let g=c.match(/^`([^`]+)`/);if(g){d.push((0,p.jsx)("code",{className:"bg-gray-100 px-1 py-0.5 rounded text-xs font-mono",children:g[1]},f++)),c=c.slice(g[0].length);continue}let x=c.match(/^\*\*([^*]+)\*\*/);if(x){d.push((0,p.jsx)("strong",{children:x[1]},f++)),c=c.slice(x[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 L=c.match(/^\[([^\]]+)\]\(([^)]+)\)/);if(L){d.push((0,p.jsx)("a",{href:L[2],className:"kite-link",target:"_blank",rel:"noopener noreferrer",children:L[1]},f++)),c=c.slice(L[0].length);continue}let y=c.match(/^(https?:\/\/[^\s<>]+|www\.[^\s<>]+)/);if(y){let
|
|
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 x=c[1].length,w=i(c[2]),L=x===1?"text-lg font-bold my-1":x===2?"text-base font-bold my-1":"text-sm font-semibold my-1";a.push((0,p.jsx)("div",{className:L,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 g=d.match(/^\d+[.)]\s+(.+)/);if(g){(!r||r.type!=="ol")&&(l(),r={type:"ol",items:[]}),r.items.push(i(g[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 SD=[{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"}],dk=[{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?"}]}],Py={"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}}]}},CD=[];function LD(){return(0,p.jsxs)("div",{className:"flex flex-col items-center justify-center h-full p-6",children:[(0,p.jsx)(Ft,{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 ID({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)(ro,{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)(ut,{variant:"secondary",size:"sm",onClick:t,className:"h-8 px-4 text-xs",children:"Try Again"})]})}function bD({isOpen:e=!0,onClose:t,onOpen:a,onBack:r,onNavigate:o,onActionComplete:n,currentPage:s,agentUrl:i=xD,startingQuestions:l,startingQuestionsEndpoint:u,userId:d,orgId:c,userName:f,userEmail:g,userOrganization:x,supabaseUrl:w,supabaseAnonKey:L,productBackendUrl:y}={}){let[h,m]=F.useState(CD),[C,I]=F.useState(""),[P,R]=F.useState(()=>crypto.randomUUID()),{authState:A,retry:q}=sk({productBackendUrl:y,sessionId:P,enabled:!!y}),B=F.useMemo(()=>A.status==="authenticated"?{userId:A.user.id,userName:A.user.name,userEmail:A.user.email,userRole:A.user.role,isInternal:A.user.isInternal}:{userId:d||"anonymous",userName:f||"Anonymous User",userEmail:g||"Not provided",userRole:void 0,isInternal:!1},[A,d,f,g]),[J,ue]=F.useState(!1),pt=F.useRef(null),[Xa,So]=F.useState(!1),Ke=F.useRef(null),xe=F.useRef(null),ze=F.useRef(null);F.useEffect(()=>{console.log(`[KiteChat] Chat Panel v${yD} loaded`)},[]);let Ht=F.useCallback(()=>{console.log("[KiteChat] resetSession called",{isEscalated:J,hasSupabase:!!Ke.current,sessionId:P}),J&&Ke.current&&P?(console.log("[KiteChat] Updating customer_status to disconnected for session:",P),Ke.current.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",P).then(v=>{console.log("[KiteChat] Disconnect update result:",v)},v=>{console.error("[KiteChat] Disconnect update failed:",v)})):console.log("[KiteChat] Skipping disconnect update - conditions not met"),R(crypto.randomUUID()),ue(!1),pt.current&&(pt.current.close(),pt.current=null),So(!1),xe.current&&(xe.current.unsubscribe(),xe.current=null)},[J,P]);F.useEffect(()=>{w&&L&&!Ke.current&&(Ke.current=FS(w,L))},[w,L]),F.useEffect(()=>{if(!J||!P||!Ke.current)return;let v=`typing:${P}`,k=Ke.current.channel(v);return console.log(`[KiteChat] Subscribing to typing channel: ${v}`),k.on("broadcast",{event:"typing"},O=>{console.log("[KiteChat] Received typing broadcast:",O);let{sender:D,isTyping:E}=O.payload;D==="agent"&&(console.log(`[KiteChat] Agent typing: ${E}`),So(E),E&&(ze.current&&window.clearTimeout(ze.current),ze.current=window.setTimeout(()=>{So(!1)},5e3)))}).subscribe(O=>{console.log(`[KiteChat] Typing channel status: ${O}`),O==="SUBSCRIBED"&&(xe.current=k,console.log("[KiteChat] Typing channel ready"))}),()=>{k.unsubscribe(),xe.current=null,ze.current&&window.clearTimeout(ze.current)}},[J,P]);let ma=F.useRef(null),Xe=F.useCallback(async v=>{if(!(!Ke.current||!P))try{await Ke.current.from("escalations").update({customer_status:v,customer_last_seen:new Date().toISOString()}).eq("session_id",P)}catch(k){console.error("[KiteChat] Failed to update customer status:",k)}},[P]);F.useEffect(()=>{if(!J||!P||!Ke.current)return;let v=P,k=Ke.current;Xe("active"),ma.current=window.setInterval(()=>{Xe("active")},6e4);let O=()=>{k.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",v)},D=()=>{document.visibilityState==="hidden"?k.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",v):document.visibilityState==="visible"&&Xe("active")};return window.addEventListener("beforeunload",O),document.addEventListener("visibilitychange",D),()=>{window.removeEventListener("beforeunload",O),document.removeEventListener("visibilitychange",D),k.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",v).then(()=>{console.log("[KiteChat] Marked customer as disconnected")},E=>{console.error("[KiteChat] Failed to mark disconnected:",E)}),ma.current&&(window.clearInterval(ma.current),ma.current=null)}},[J,P,Xe]);let ku=F.useCallback(v=>{if(!xe.current){console.log("[KiteChat] Cannot send typing - channel not ready");return}if(!J){console.log("[KiteChat] Cannot send typing - not escalated");return}console.log(`[KiteChat] Sending typing indicator: ${v}`),xe.current.send({type:"broadcast",event:"typing",payload:{sender:"user",isTyping:v}})},[J]),kn=F.useRef(null),pk=F.useCallback(()=>{!J||!Ke.current||(ku(!0),Xe("active"),kn.current&&window.clearTimeout(kn.current),kn.current=window.setTimeout(()=>{ku(!1)},1500))},[J,ku,Xe]),Pn=F.useRef({}),Ry=h.length===0,[Tn,ye]=F.useState("idle"),[mk,Le]=F.useState([]),br=F.useRef([]),hk=h.length?h[h.length-1].role:void 0,[pp,Co]=F.useState("landing"),[_y,Lo]=F.useState(void 0),[gk,Ey]=F.useState(l||SD),[yk,Dy]=F.useState(!1);F.useEffect(()=>{u&&!l&&(Dy(!0),fetch(u).then(v=>v.json()).then(v=>{Array.isArray(v)&&v.length>0&&Ey(v)}).catch(v=>{console.warn("[KiteChat] Failed to fetch starting questions:",v)}).finally(()=>Dy(!1)))},[u,l]),F.useEffect(()=>{l&&Ey(l)},[l]);let[he,kr]=F.useState(void 0),Me=F.useRef(void 0),My=F.useRef(null),[Li,Ii]=F.useState(!1);F.useEffect(()=>{window.resetIntegrationNotification=()=>{localStorage.removeItem("gmailNotificationSeen"),console.log("Integration notification reset! Click the Integrations tab to see it again.")};let v=()=>{if(!localStorage.getItem("gmailNotificationSeen")){Co("landing"),Lo(void 0);let O=Date.now(),D="I see you're exploring integrations. Let me know if there are any other connections we should add.",E={id:O,role:"assistant",kind:"text",content:"",isNotificationMessage:!0};m(Y=>[...Y,E]),Qa(O,D),localStorage.setItem("gmailNotificationSeen","true")}};return window.addEventListener("integrationTabClicked",v),()=>{window.removeEventListener("integrationTabClicked",v)}},[]),F.useEffect(()=>{he?(!Me.current||Me.current.id!==he.id||Me.current.stepIndex!==he.stepIndex)&&(Me.current=he):Me.current=void 0},[he]);let[bi,Pu]=F.useState(null),[Qe,mp]=F.useState(null),[ne,se]=F.useState({}),Ny=F.useRef(null),hp=F.useRef(null),Tu=F.useRef(null),{cursorState:Au,moveTo:Io,hide:An}=nk(),[bo,gp]=F.useState(null),[Oy,Pr]=F.useState(null),yp=F.useRef(null),Rn=F.useRef(null),[Fy,ki]=F.useState(!1),[_n,Ru]=F.useState(""),By=F.useRef(null);F.useEffect(()=>{if(!he||he.id!=="add-api-key"||he.stepIndex!==2)return;let k=setInterval(()=>{let O=document.querySelector('[role="dialog"]'),D=Me.current;if(O&&D&&D.id==="add-api-key"&&D.stepIndex===2){An();let E=Date.now()+1;m(Y=>[...Y,{id:E,role:"assistant",kind:"guideComplete",content:"Perfect! The dialog is now open. You can enter a name and create your API key."}]),kr(void 0),Ii(!0)}},300);return()=>clearInterval(k)},[he,An]),F.useEffect(()=>()=>{Object.values(Pn.current).forEach(v=>window.clearInterval(v)),Pn.current={},br.current.forEach(v=>window.clearTimeout(v)),br.current=[]},[]),F.useEffect(()=>{if(he&&h.length>0){let v=h[h.length-1];if((v.kind==="guideStep"||v.kind==="guideComplete")&&Tu.current&&hp.current){let k=hp.current,O=Tu.current,D=k.getBoundingClientRect(),Y=O.getBoundingClientRect().top-D.top+k.scrollTop;k.scrollTop=Y}}else!he&&h.length>0&&Ny.current?.scrollIntoView({behavior:"smooth"})},[h,Tn,he]);let Uy=F.useMemo(()=>{for(let v=h.length-1;v>=0;v--){let k=h[v];if(k.kind==="bulkSummary"&&k.bulkSummary?.navigationPage&&k.bulkSummary.successes>0)return k.bulkSummary.navigationPage}return null},[h]);F.useEffect(()=>{My.current=Uy},[Uy]),F.useEffect(()=>{yp.current=Oy},[Oy]),F.useEffect(()=>{let v=k=>{if((k.metaKey||k.ctrlKey)&&k.key==="Enter"){let O=yp.current;if(O){k.preventDefault(),k.stopPropagation(),wp(O);return}if(Qe){k.preventDefault(),k.stopPropagation(),vp();return}if(bi){k.preventDefault(),k.stopPropagation(),xp(bi);return}let D=My.current;if(console.log("[DEBUG] Keyboard handler - latestBulkSummaryNavigation:",D,"onNavigate:",!!o),D&&o){console.log("[DEBUG] Navigating via keyboard to:",D.page),k.preventDefault(),k.stopPropagation(),o(D.page,D.subtab);return}if(Li){k.preventDefault(),k.stopPropagation(),jy();return}if(Me.current){k.preventDefault(),k.stopPropagation(),Sp();return}}};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[Qe,bi,he,Li,o]);let Vy=F.useCallback(v=>{if(!i)return;pt.current&&pt.current.close();let k=i.replace(/^http/,"ws")+`/ws/escalation/${v}`,O=new WebSocket(k);O.onmessage=D=>{try{let E=JSON.parse(D.data);E.type==="agent_message"?m(Y=>{let X=E.content,T=E.message_id;return(T?Y.some(b=>b.serverMessageId===T):Y.slice(-5).some(b=>b.content===X))?(console.debug("[KiteChat] Skipping duplicate agent message:",T||X.slice(0,30)),Y):[...Y,{id:Date.now(),role:"agent",kind:"text",content:X,serverMessageId:T}]}):E.type==="error"&&console.error("[KiteChat] Escalation error:",E.message)}catch(E){console.error("[KiteChat] Failed to parse escalation message:",E)}},O.onerror=D=>{console.error("[KiteChat] Escalation WebSocket error:",D)},O.onclose=()=>{console.log("[KiteChat] Escalation WebSocket closed")},pt.current=O},[i]),xk=F.useCallback(async v=>{if(!pt.current||pt.current.readyState!==WebSocket.OPEN)return console.error("[KiteChat] Escalation WebSocket not connected"),!1;try{return pt.current.send(JSON.stringify({type:"user_message",content:v})),Xe("active"),!0}catch(k){return console.error("[KiteChat] Failed to send escalated message:",k),!1}},[Xe]);F.useEffect(()=>()=>{pt.current&&pt.current.close()},[]),F.useEffect(()=>{J&&P&&Vy(P)},[J,P,Vy]);function Qa(v,k,O){let D=k||"",E=O;if(k&&k.startsWith("{")&&k.includes('"response"'))try{let N=0,b=0;for(let W=0;W<k.length;W++)if(k[W]==="{")N++;else if(k[W]==="}"&&(N--,N===0)){b=W+1;break}let K=b>0?k.slice(0,b):k,ae=JSON.parse(K);ae.response&&typeof ae.response=="string"&&(D=ae.response,!E&&ae.followups&&(E=ae.followups))}catch{}D=vD(D);let Y=D.split(" "),X=0,T=window.setInterval(()=>{X+=1,m(N=>N.map(b=>b.id===v?{...b,content:Y.slice(0,X).join(" ")}:b)),X>=Y.length&&(window.clearInterval(T),delete Pn.current[v],E&&E.length>0&&m(N=>N.map(b=>b.id===v?{...b,followups:E}:b)),ye("idle"))},25);Pn.current[v]=T}function vk(v,k){m(O=>O.map(D=>D.id===v?{...D,followupSelected:!0}:D)),_u(k.label)}function jy(){Object.values(Pn.current).forEach(v=>window.clearInterval(v)),Pn.current={},br.current.forEach(v=>window.clearTimeout(v)),br.current=[],An(),Ht(),m([]),I(""),ye("idle"),Co("landing"),Lo(void 0),kr(void 0),Ii(!1),Pu(null),mp(null),se({}),r&&r()}function RD(v){Co("folder"),Lo(v)}function wk(){Co("landing"),Lo(void 0)}function Sk(v){v.preventDefault();let k=C.trim();if(bo){if(!k){let O={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'."};m(D=>[...D,O]);return}Lk(k,bo),I(""),gp(null),Rn.current&&(Rn.current.value="");return}if(k){if(J){let O={id:Date.now(),role:"user",content:k};m(D=>[...D,O]),xk(k),ku(!1),kn.current&&(window.clearTimeout(kn.current),kn.current=null),I("");return}_u(k),I("")}}function Ck(v){let k={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 O={general:"General",billing:"Billing",security:"Security",api:"API Keys",notifications:"Notifications",integrations:"Integrations"};return`${k.settings} (${O[v.subtab]} tab)`}return k[v.page]}function xp(v){o&&o(v.page,v.subtab),Pu(null),m(k=>k.map(O=>O.kind==="navigationAction"&&O.navigationTarget?.page===v.page&&O.navigationTarget?.subtab===v.subtab?{...O,navigationTarget:void 0}:O))}function vp(){if(!Qe)return;let v=ne;if(Qe.type!=="updateCompanyInfo"){if(Qe.type==="addApiKey"){let k=v;if(!k.name||!k.name.trim())return}else if(Qe.type==="addCustomer"){let k=v;if(!k.name||!k.name.trim()||!k.email||!k.email.trim())return}else if(Qe.type==="changePassword"){let k=v;if(!k.currentPassword||!k.newPassword||!k.confirmPassword||k.newPassword!==k.confirmPassword)return}else if(Qe.type==="addWebhook"){let k=v;if(!k.url||!k.url.trim())return}else if(Qe.type==="addPaymentMethod"){let k=v;if(!k.cardNumber||!k.expiryDate)return}else if(Qe.type==="deleteApiKey"){let k=v;if(!k.keyId&&!k.name)return}else if(Qe.type==="refundPayment"){let k=v;if(!k.transactionId&&!k.customer)return}else if(Qe.type==="createSubscription"){let k=v;if(!k.customerEmail&&!k.customerId)return}else if((Qe.type==="toggleBlockRule"||Qe.type==="enableBlockRule"||Qe.type==="disableBlockRule")&&!v.ruleId)return}n&&n(Qe.type,v),m(k=>k.map(O=>O.kind==="actionForm"&&O.actionType===Qe.type?{...O,isSubmitted:!0}:O)),mp(null),se({})}async function _u(v){br.current.forEach(X=>window.clearTimeout(X)),br.current=[];let O=[...h].reverse().find(X=>X.role==="assistant")?.isNotificationMessage===!0,D=Date.now(),E={id:D,role:"user",content:v};if(m(X=>X.map(T=>T.followups&&T.followups.length>0?{...T,followupSelected:!0}:T).concat(E)),O){let X=Date.now()+1,T={id:X,role:"assistant",kind:"text",content:""};m(N=>[...N,T]),Qa(X,"Thank you, your feedback is saved.");return}Pu(null),ye("thinking"),Le([]);let Y=!1;try{let X=new AbortController,T=setTimeout(()=>X.abort(),6e4);console.log("[ChatPanel] Sending chat request to agent backend..."),console.log("[ChatPanel] Agent URL:",i),console.log("[ChatPanel] User data being sent:"),console.log("[ChatPanel] user_id:",B.userId),console.log("[ChatPanel] user_name:",B.userName),console.log("[ChatPanel] user_email:",B.userEmail),console.log("[ChatPanel] user_organization:",x),console.log("[ChatPanel] org_id:",c),console.log("[ChatPanel] authState.status:",A.status);let N=await fetch(`${i}/chat/stream`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:P,message:v,current_page:s||"dashboard",user_id:B.userId,user_name:B.userName,user_email:B.userEmail,user_organization:x,org_id:c}),signal:X.signal});if(clearTimeout(T),!N.ok)throw new Error(`Agent request failed: ${N.status}`);let b=N.body?.getReader();if(!b)throw new Error("No response body");let K=new TextDecoder,ae="";for(;;){let{done:W,value:pe}=await b.read();if(W)break;ae+=K.decode(pe,{stream:!0});let Je=ae.split(`
|
|
25
|
+
`).replace(/\\t/g," ").replace(/\\"/g,'"').replace(/\\\\/g,"\\")}function ID(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 g=c.match(/^`([^`]+)`/);if(g){d.push((0,p.jsx)("code",{className:"bg-gray-100 px-1 py-0.5 rounded text-xs font-mono",children:g[1]},f++)),c=c.slice(g[0].length);continue}let x=c.match(/^\*\*([^*]+)\*\*/);if(x){d.push((0,p.jsx)("strong",{children:x[1]},f++)),c=c.slice(x[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 L=c.match(/^\[([^\]]+)\]\(([^)]+)\)/);if(L){d.push((0,p.jsx)("a",{href:L[2],className:"kite-link",target:"_blank",rel:"noopener noreferrer",children:L[1]},f++)),c=c.slice(L[0].length);continue}let y=c.match(/^(https?:\/\/[^\s<>]+|www\.[^\s<>]+)/);if(y){let S=y[1],I=S.startsWith("www.")?`https://${S}`:S;d.push((0,p.jsx)("a",{href:I,className:"kite-link",target:"_blank",rel:"noopener noreferrer",children:S},f++)),c=c.slice(S.length);continue}let h=c.match(/^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})/);if(h){let S=h[1];d.push((0,p.jsx)("a",{href:`mailto:${S}`,className:"kite-link",children:S},f++)),c=c.slice(S.length);continue}let m=c.search(/[`*\[@h]/);if(m===-1){d.push(c);break}else m===0?(d.push(c[0]),c=c.slice(1)):(d.push(c.slice(0,m)),c=c.slice(m))}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 x=c[1].length,w=i(c[2]),L=x===1?"text-lg font-bold my-1":x===2?"text-base font-bold my-1":"text-sm font-semibold my-1";a.push((0,p.jsx)("div",{className:L,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 g=d.match(/^\d+[.)]\s+(.+)/);if(g){(!r||r.type!=="ol")&&(l(),r={type:"ol",items:[]}),r.items.push(i(g[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 bD=[{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"}],mk=[{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?"}]}],Ry={"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}}]}},kD=[];function PD(){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 TD({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)(mr,{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)(tt,{variant:"secondary",size:"sm",onClick:t,className:"h-8 px-4 text-xs",children:"Try Again"})]})}function AD({isOpen:e=!0,onClose:t,onOpen:a,onBack:r,onNavigate:o,onActionComplete:n,currentPage:s,agentUrl:i=SD,startingQuestions:l,startingQuestionsEndpoint:u,userId:d,orgId:c,userName:f,userEmail:g,userOrganization:x,supabaseUrl:w,supabaseAnonKey:L,productBackendUrl:y}={}){let[h,m]=B.useState(kD),[S,I]=B.useState(""),[P,R]=B.useState(()=>crypto.randomUUID()),A=dk({agentUrl:i,orgId:c||""}),V=A.config?.productBackendUrl||y,{authState:F,retry:me}=uk({productBackendUrl:V,sessionId:P,enabled:!!V&&A.status==="success"});B.useEffect(()=>{if(!V||A.status!=="success")return;(async()=>{let k=`${V}/userSite`;console.log("[KiteChat TEST] Testing GET /userSite endpoint..."),console.log("[KiteChat TEST] URL:",k);try{let D=await fetch(k,{method:"GET",credentials:"include",headers:{Accept:"application/json"}});if(console.log("[KiteChat TEST] /userSite response status:",D.status),console.log("[KiteChat TEST] /userSite response ok:",D.ok),D.ok){let E=await D.json();console.log("[KiteChat TEST] /userSite SUCCESS - data:",E)}else{let E=await D.text();console.log("[KiteChat TEST] /userSite FAILED - status:",D.status,"body:",E)}}catch(D){console.error("[KiteChat TEST] /userSite ERROR:",D)}})()},[V,A.status]);let ae=B.useMemo(()=>F.status==="authenticated"?{userId:F.user.id,userName:F.user.name,userEmail:F.user.email,userRole:F.user.role,isInternal:F.user.isInternal}:{userId:d||"anonymous",userName:f||"Anonymous User",userEmail:g||"Not provided",userRole:void 0,isInternal:!1},[F,d,f,g]),[Be,Aa]=B.useState(!1),St=B.useRef(null),[So,Me]=B.useState(!1),xe=B.useRef(null),ot=B.useRef(null),oa=B.useRef(null);B.useEffect(()=>{console.log(`[KiteChat] Chat Panel v${CD} loaded`)},[]);let zt=B.useCallback(()=>{console.log("[KiteChat] resetSession called",{isEscalated:Be,hasSupabase:!!xe.current,sessionId:P}),Be&&xe.current&&P?(console.log("[KiteChat] Updating customer_status to disconnected for session:",P),xe.current.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",P).then(v=>{console.log("[KiteChat] Disconnect update result:",v)},v=>{console.error("[KiteChat] Disconnect update failed:",v)})):console.log("[KiteChat] Skipping disconnect update - conditions not met"),R(crypto.randomUUID()),Aa(!1),St.current&&(St.current.close(),St.current=null),Me(!1),ot.current&&(ot.current.unsubscribe(),ot.current=null)},[Be,P]);B.useEffect(()=>{w&&L&&!xe.current&&(xe.current=VC(w,L))},[w,L]),B.useEffect(()=>{if(!Be||!P||!xe.current)return;let v=`typing:${P}`,k=xe.current.channel(v);return console.log(`[KiteChat] Subscribing to typing channel: ${v}`),k.on("broadcast",{event:"typing"},D=>{console.log("[KiteChat] Received typing broadcast:",D);let{sender:E,isTyping:M}=D.payload;E==="agent"&&(console.log(`[KiteChat] Agent typing: ${M}`),Me(M),M&&(oa.current&&window.clearTimeout(oa.current),oa.current=window.setTimeout(()=>{Me(!1)},5e3)))}).subscribe(D=>{console.log(`[KiteChat] Typing channel status: ${D}`),D==="SUBSCRIBED"&&(ot.current=k,console.log("[KiteChat] Typing channel ready"))}),()=>{k.unsubscribe(),ot.current=null,oa.current&&window.clearTimeout(oa.current)}},[Be,P]);let Tu=B.useRef(null),kr=B.useCallback(async v=>{if(!(!xe.current||!P))try{await xe.current.from("escalations").update({customer_status:v,customer_last_seen:new Date().toISOString()}).eq("session_id",P)}catch(k){console.error("[KiteChat] Failed to update customer status:",k)}},[P]);B.useEffect(()=>{if(!Be||!P||!xe.current)return;let v=P,k=xe.current;kr("active"),Tu.current=window.setInterval(()=>{kr("active")},6e4);let D=()=>{k.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",v)},E=()=>{document.visibilityState==="hidden"?k.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",v):document.visibilityState==="visible"&&kr("active")};return window.addEventListener("beforeunload",D),document.addEventListener("visibilitychange",E),()=>{window.removeEventListener("beforeunload",D),document.removeEventListener("visibilitychange",E),k.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",v).then(()=>{console.log("[KiteChat] Marked customer as disconnected")},M=>{console.error("[KiteChat] Failed to mark disconnected:",M)}),Tu.current&&(window.clearInterval(Tu.current),Tu.current=null)}},[Be,P,kr]);let Au=B.useCallback(v=>{if(!ot.current){console.log("[KiteChat] Cannot send typing - channel not ready");return}if(!Be){console.log("[KiteChat] Cannot send typing - not escalated");return}console.log(`[KiteChat] Sending typing indicator: ${v}`),ot.current.send({type:"broadcast",event:"typing",payload:{sender:"user",isTyping:v}})},[Be]),Pn=B.useRef(null),yk=B.useCallback(()=>{!Be||!xe.current||(Au(!0),kr("active"),Pn.current&&window.clearTimeout(Pn.current),Pn.current=window.setTimeout(()=>{Au(!1)},1500))},[Be,Au,kr]),Tn=B.useRef({}),Dy=h.length===0,[An,ye]=B.useState("idle"),[xk,Le]=B.useState([]),Pr=B.useRef([]),vk=h.length?h[h.length-1].role:void 0,[gp,Lo]=B.useState("landing"),[My,Io]=B.useState(void 0),[wk,Ny]=B.useState(l||bD),[Ck,Oy]=B.useState(!1);B.useEffect(()=>{u&&!l&&(Oy(!0),fetch(u).then(v=>v.json()).then(v=>{Array.isArray(v)&&v.length>0&&Ny(v)}).catch(v=>{console.warn("[KiteChat] Failed to fetch starting questions:",v)}).finally(()=>Oy(!1)))},[u,l]),B.useEffect(()=>{l&&Ny(l)},[l]);let[he,Tr]=B.useState(void 0),Ne=B.useRef(void 0),Fy=B.useRef(null),[Ii,bi]=B.useState(!1);B.useEffect(()=>{window.resetIntegrationNotification=()=>{localStorage.removeItem("gmailNotificationSeen"),console.log("Integration notification reset! Click the Integrations tab to see it again.")};let v=()=>{if(!localStorage.getItem("gmailNotificationSeen")){Lo("landing"),Io(void 0);let D=Date.now(),E="I see you're exploring integrations. Let me know if there are any other connections we should add.",M={id:D,role:"assistant",kind:"text",content:"",isNotificationMessage:!0};m(J=>[...J,M]),Qa(D,E),localStorage.setItem("gmailNotificationSeen","true")}};return window.addEventListener("integrationTabClicked",v),()=>{window.removeEventListener("integrationTabClicked",v)}},[]),B.useEffect(()=>{he?(!Ne.current||Ne.current.id!==he.id||Ne.current.stepIndex!==he.stepIndex)&&(Ne.current=he):Ne.current=void 0},[he]);let[ki,Ru]=B.useState(null),[Xe,yp]=B.useState(null),[ne,se]=B.useState({}),By=B.useRef(null),xp=B.useRef(null),_u=B.useRef(null),{cursorState:Eu,moveTo:bo,hide:Rn}=lk(),[ko,vp]=B.useState(null),[Uy,Ar]=B.useState(null),wp=B.useRef(null),_n=B.useRef(null),[Vy,Pi]=B.useState(!1),[En,Du]=B.useState(""),jy=B.useRef(null);B.useEffect(()=>{if(!he||he.id!=="add-api-key"||he.stepIndex!==2)return;let k=setInterval(()=>{let D=document.querySelector('[role="dialog"]'),E=Ne.current;if(D&&E&&E.id==="add-api-key"&&E.stepIndex===2){Rn();let M=Date.now()+1;m(J=>[...J,{id:M,role:"assistant",kind:"guideComplete",content:"Perfect! The dialog is now open. You can enter a name and create your API key."}]),Tr(void 0),bi(!0)}},300);return()=>clearInterval(k)},[he,Rn]),B.useEffect(()=>()=>{Object.values(Tn.current).forEach(v=>window.clearInterval(v)),Tn.current={},Pr.current.forEach(v=>window.clearTimeout(v)),Pr.current=[]},[]),B.useEffect(()=>{if(he&&h.length>0){let v=h[h.length-1];if((v.kind==="guideStep"||v.kind==="guideComplete")&&_u.current&&xp.current){let k=xp.current,D=_u.current,E=k.getBoundingClientRect(),J=D.getBoundingClientRect().top-E.top+k.scrollTop;k.scrollTop=J}}else!he&&h.length>0&&By.current?.scrollIntoView({behavior:"smooth"})},[h,An,he]);let qy=B.useMemo(()=>{for(let v=h.length-1;v>=0;v--){let k=h[v];if(k.kind==="bulkSummary"&&k.bulkSummary?.navigationPage&&k.bulkSummary.successes>0)return k.bulkSummary.navigationPage}return null},[h]);B.useEffect(()=>{Fy.current=qy},[qy]),B.useEffect(()=>{wp.current=Uy},[Uy]),B.useEffect(()=>{let v=k=>{if((k.metaKey||k.ctrlKey)&&k.key==="Enter"){let D=wp.current;if(D){k.preventDefault(),k.stopPropagation(),Lp(D);return}if(Xe){k.preventDefault(),k.stopPropagation(),Sp();return}if(ki){k.preventDefault(),k.stopPropagation(),Cp(ki);return}let E=Fy.current;if(console.log("[DEBUG] Keyboard handler - latestBulkSummaryNavigation:",E,"onNavigate:",!!o),E&&o){console.log("[DEBUG] Navigating via keyboard to:",E.page),k.preventDefault(),k.stopPropagation(),o(E.page,E.subtab);return}if(Ii){k.preventDefault(),k.stopPropagation(),Hy();return}if(Ne.current){k.preventDefault(),k.stopPropagation(),Ip();return}}};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[Xe,ki,he,Ii,o]);let zy=B.useCallback(v=>{if(!i)return;St.current&&St.current.close();let k=i.replace(/^http/,"ws")+`/ws/escalation/${v}`,D=new WebSocket(k);D.onmessage=E=>{try{let M=JSON.parse(E.data);M.type==="agent_message"?m(J=>{let X=M.content,T=M.message_id;return(T?J.some(b=>b.serverMessageId===T):J.slice(-5).some(b=>b.content===X))?(console.debug("[KiteChat] Skipping duplicate agent message:",T||X.slice(0,30)),J):[...J,{id:Date.now(),role:"agent",kind:"text",content:X,serverMessageId:T}]}):M.type==="error"&&console.error("[KiteChat] Escalation error:",M.message)}catch(M){console.error("[KiteChat] Failed to parse escalation message:",M)}},D.onerror=E=>{console.error("[KiteChat] Escalation WebSocket error:",E)},D.onclose=()=>{console.log("[KiteChat] Escalation WebSocket closed")},St.current=D},[i]),Sk=B.useCallback(async v=>{if(!St.current||St.current.readyState!==WebSocket.OPEN)return console.error("[KiteChat] Escalation WebSocket not connected"),!1;try{return St.current.send(JSON.stringify({type:"user_message",content:v})),kr("active"),!0}catch(k){return console.error("[KiteChat] Failed to send escalated message:",k),!1}},[kr]);B.useEffect(()=>()=>{St.current&&St.current.close()},[]),B.useEffect(()=>{Be&&P&&zy(P)},[Be,P,zy]);function Qa(v,k,D){let E=k||"",M=D;if(k&&k.startsWith("{")&&k.includes('"response"'))try{let O=0,b=0;for(let G=0;G<k.length;G++)if(k[G]==="{")O++;else if(k[G]==="}"&&(O--,O===0)){b=G+1;break}let K=b>0?k.slice(0,b):k,te=JSON.parse(K);te.response&&typeof te.response=="string"&&(E=te.response,!M&&te.followups&&(M=te.followups))}catch{}E=LD(E);let J=E.split(" "),X=0,T=window.setInterval(()=>{X+=1,m(O=>O.map(b=>b.id===v?{...b,content:J.slice(0,X).join(" ")}:b)),X>=J.length&&(window.clearInterval(T),delete Tn.current[v],M&&M.length>0&&m(O=>O.map(b=>b.id===v?{...b,followups:M}:b)),ye("idle"))},25);Tn.current[v]=T}function Lk(v,k){m(D=>D.map(E=>E.id===v?{...E,followupSelected:!0}:E)),Mu(k.label)}function Hy(){Object.values(Tn.current).forEach(v=>window.clearInterval(v)),Tn.current={},Pr.current.forEach(v=>window.clearTimeout(v)),Pr.current=[],Rn(),zt(),m([]),I(""),ye("idle"),Lo("landing"),Io(void 0),Tr(void 0),bi(!1),Ru(null),yp(null),se({}),r&&r()}function MD(v){Lo("folder"),Io(v)}function Ik(){Lo("landing"),Io(void 0)}function bk(v){v.preventDefault();let k=S.trim();if(ko){if(!k){let D={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'."};m(E=>[...E,D]);return}Pk(k,ko),I(""),vp(null),_n.current&&(_n.current.value="");return}if(k){if(Be){let D={id:Date.now(),role:"user",content:k};m(E=>[...E,D]),Sk(k),Au(!1),Pn.current&&(window.clearTimeout(Pn.current),Pn.current=null),I("");return}Mu(k),I("")}}function kk(v){let k={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 D={general:"General",billing:"Billing",security:"Security",api:"API Keys",notifications:"Notifications",integrations:"Integrations"};return`${k.settings} (${D[v.subtab]} tab)`}return k[v.page]}function Cp(v){o&&o(v.page,v.subtab),Ru(null),m(k=>k.map(D=>D.kind==="navigationAction"&&D.navigationTarget?.page===v.page&&D.navigationTarget?.subtab===v.subtab?{...D,navigationTarget:void 0}:D))}function Sp(){if(!Xe)return;let v=ne;if(Xe.type!=="updateCompanyInfo"){if(Xe.type==="addApiKey"){let k=v;if(!k.name||!k.name.trim())return}else if(Xe.type==="addCustomer"){let k=v;if(!k.name||!k.name.trim()||!k.email||!k.email.trim())return}else if(Xe.type==="changePassword"){let k=v;if(!k.currentPassword||!k.newPassword||!k.confirmPassword||k.newPassword!==k.confirmPassword)return}else if(Xe.type==="addWebhook"){let k=v;if(!k.url||!k.url.trim())return}else if(Xe.type==="addPaymentMethod"){let k=v;if(!k.cardNumber||!k.expiryDate)return}else if(Xe.type==="deleteApiKey"){let k=v;if(!k.keyId&&!k.name)return}else if(Xe.type==="refundPayment"){let k=v;if(!k.transactionId&&!k.customer)return}else if(Xe.type==="createSubscription"){let k=v;if(!k.customerEmail&&!k.customerId)return}else if((Xe.type==="toggleBlockRule"||Xe.type==="enableBlockRule"||Xe.type==="disableBlockRule")&&!v.ruleId)return}n&&n(Xe.type,v),m(k=>k.map(D=>D.kind==="actionForm"&&D.actionType===Xe.type?{...D,isSubmitted:!0}:D)),yp(null),se({})}async function Mu(v){Pr.current.forEach(X=>window.clearTimeout(X)),Pr.current=[];let D=[...h].reverse().find(X=>X.role==="assistant")?.isNotificationMessage===!0,E=Date.now(),M={id:E,role:"user",content:v};if(m(X=>X.map(T=>T.followups&&T.followups.length>0?{...T,followupSelected:!0}:T).concat(M)),D){let X=Date.now()+1,T={id:X,role:"assistant",kind:"text",content:""};m(O=>[...O,T]),Qa(X,"Thank you, your feedback is saved.");return}Ru(null),ye("thinking"),Le([]);let J=!1;try{let X=new AbortController,T=setTimeout(()=>X.abort(),6e4);console.log("[ChatPanel] Sending chat request to agent backend..."),console.log("[ChatPanel] Agent URL:",i),console.log("[ChatPanel] User data being sent:"),console.log("[ChatPanel] user_id:",ae.userId),console.log("[ChatPanel] user_name:",ae.userName),console.log("[ChatPanel] user_email:",ae.userEmail),console.log("[ChatPanel] user_organization:",x),console.log("[ChatPanel] org_id:",c),console.log("[ChatPanel] authState.status:",F.status);let O=await fetch(`${i}/chat/stream`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:P,message:v,current_page:s||"dashboard",user_id:ae.userId,user_name:ae.userName,user_email:ae.userEmail,user_organization:x,org_id:c}),signal:X.signal});if(clearTimeout(T),!O.ok)throw new Error(`Agent request failed: ${O.status}`);let b=O.body?.getReader();if(!b)throw new Error("No response body");let K=new TextDecoder,te="";for(;;){let{done:G,value:fe}=await b.read();if(G)break;te+=K.decode(fe,{stream:!0});let Qe=te.split(`
|
|
28
28
|
|
|
29
|
-
`);
|
|
30
|
-
`),
|
|
29
|
+
`);te=Qe.pop()||"";for(let pt of Qe){if(!pt.trim())continue;let Ja=pt.split(`
|
|
30
|
+
`),Je="",ha="";for(let H of Ja)H.startsWith("event: ")?Je=H.slice(7):H.startsWith("data: ")&&(ha=H.slice(6));if(!(!Je||!ha))try{let H=JSON.parse(ha);if(Je==="progress")H.status==="thinking"?(ye("thinking"),Le([{message:H.message,completed:!1}])):H.status==="searching"?(ye("thinking"),Le([{message:H.message||"Searching knowledge base...",completed:!1}])):H.status==="evaluating"?(ye("thinking"),Le([{message:H.message||"Evaluating sources...",completed:!1}])):H.status==="executing"?(ye("executing"),Le(q=>{let re=q.map(Rt=>({...Rt,completed:!0})),de=re[re.length-1];return(!de||de.message!==H.message)&&re.push({message:H.message,completed:!1}),re})):H.status==="responding"&&(ye("responding"),Le(q=>q.map(re=>({...re,completed:!0}))));else if(Je==="response"){Le([]),J=!0;let q=H;if(q.action==="navigate"&&q.navigation){let re={page:q.navigation.page,subtab:q.navigation.subtab};Ru(re);let de={id:E+1,role:"assistant",kind:"navigationAction",content:q.response||`I can take you to the ${kk(re)}.`,navigationTarget:re};m(Rt=>[...Rt,de]),ye("idle")}else if(q.action==="show_form"&&q.actionType){yp({type:q.actionType,data:q.actionData||{}}),se(q.actionData||{});let re={id:E+1,role:"assistant",kind:"actionForm",content:q.response||q.message||"Please fill in the details below:",actionType:q.actionType,actionData:q.actionData||{}};m(de=>[...de,re]),ye("idle")}else if(q.action==="suggest_bulk"){let re=E+1,de={id:re,role:"assistant",kind:"text",content:""};m(Rt=>[...Rt,de]),Qa(re,q.response||q.message||"For bulk operations, you can upload a CSV file - just click the \u{1F4CE} button!",q.followups),J=!0}else if(q.action==="bulk_preview"){Ar(q.bulk_session_id);let re={id:E+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};m(de=>[...de,re]),ye("idle"),J=!0}else if(q.action==="execute"&&q.executionResult){let re=E+1,de={id:re,role:"assistant",kind:"text",content:"",structuredData:q.structuredData||void 0};m(Rt=>[...Rt,de]),Qa(re,q.response||"Action completed successfully.",q.followups),J=!0,setTimeout(()=>{window.dispatchEvent(new CustomEvent("agentActionComplete",{detail:{result:q.executionResult}}))},100)}else{let re=E+1,de={id:re,role:"assistant",kind:"text",content:""};m(Rt=>[...Rt,de]),Qa(re,q.response||q.message||"",q.followups),J=!0}}else if(Je==="error"){ye("idle"),Le([]),J=!0;let q=E+1,re={id:q,role:"assistant",kind:"text",content:""};m(de=>[...de,re]),Qa(q,H.message||"An error occurred processing your request.")}else if(Je==="done")Le([]),ye("idle"),J=!0;else if(Je==="escalation"){Aa(!0),ye("idle");let re={id:Date.now()+2,role:"assistant",kind:"text",content:H.message||"You've been connected to our support queue. An agent will be with you shortly."};m(de=>[...de,re])}}catch(H){console.error("Failed to parse SSE event:",H)}}}Le([]),J||ye("idle")}catch(X){console.error("Agent request failed:",X),Le([]);let T=E+1,O={id:T,role:"assistant",kind:"text",content:""};m(K=>[...K,O]);let b="I'm having trouble connecting to my backend.";X instanceof Error&&(X.name==="AbortError"?b="The request timed out. The server might be busy - please try again.":X.message.includes("Failed to fetch")||X.message.includes("NetworkError")?b="I'm having trouble connecting to my backend. Please make sure the agent server is running on port 5002.":X.message.includes("Agent request failed:")&&(b="The server encountered an error. Please try again.")),b+=" For simple navigation requests, I can still help you locally.",Qa(T,b)}finally{Le([])}}async function Pk(v,k){Pr.current.forEach(M=>window.clearTimeout(M)),Pr.current=[];let D=Date.now(),E={id:D,role:"user",content:`\u{1F4CE} ${k.name}
|
|
31
31
|
|
|
32
|
-
${v}`};m(
|
|
32
|
+
${v}`};m(M=>[...M,E]),ye("thinking"),Le([{message:"Analyzing CSV file...",completed:!1}]);try{let M=new FormData;M.append("file",k),M.append("message",v),M.append("session_id",P),M.append("current_page",s||"dashboard"),c&&M.append("org_id",c);let J=new AbortController,X=setTimeout(()=>J.abort(),12e4),T=await fetch(`${i}/chat/bulk/stream`,{method:"POST",body:M,signal:J.signal});if(clearTimeout(X),!T.ok)throw new Error(`Bulk upload failed: ${T.status}`);let O=T.body?.getReader();if(!O)throw new Error("No response body");let b=new TextDecoder,K="",te=null;for(;;){let{done:G,value:fe}=await O.read();if(G)break;K+=b.decode(fe,{stream:!0});let Qe=K.split(`
|
|
33
33
|
|
|
34
|
-
`);K=
|
|
35
|
-
`),
|
|
34
|
+
`);K=Qe.pop()||"";for(let pt of Qe){if(!pt.trim())continue;let Ja=pt.split(`
|
|
35
|
+
`),Je="",ha="";for(let H of Ja)H.startsWith("event: ")?Je=H.slice(7):H.startsWith("data: ")&&(ha=H.slice(6));if(!(!Je||!ha))try{let H=JSON.parse(ha);if(Je==="preview"){ye("idle"),Le([]),te=H.bulk_session_id,Ar(te);let q={id:D+1,role:"assistant",kind:"bulkPreview",content:H.message||`I found ${H.csv_data.rowCount} rows in your CSV. Here's a preview:`,csvData:{rowCount:H.csv_data.rowCount,columns:H.csv_data.columns,sampleRows:H.csv_data.sampleRows,fileName:k.name},suggestedAction:H.suggested_action,bulkSessionId:te||void 0};m(re=>[...re,q])}else if(Je==="progress")ye("executing"),Le([{message:`Processing row ${H.row} of ${H.total}...`,completed:!1}]),m(q=>q[q.length-1]?.kind==="bulkProgress"?q.map((de,Rt)=>Rt===q.length-1?{...de,bulkProgress:{processed:H.row,total:H.total,successes:H.successes||0,failures:H.failures||0}}:de):[...q,{id:Date.now(),role:"assistant",kind:"bulkProgress",bulkProgress:{processed:H.row,total:H.total,successes:H.successes||0,failures:H.failures||0}}]);else if(Je==="summary")ye("idle"),Le([]),Ar(null),m(q=>[...q.filter(de=>de.kind!=="bulkProgress"),{id:Date.now(),role:"assistant",kind:"bulkSummary",content:H.message,bulkSummary:{total:H.total,successes:H.successes,failures:H.failures||[],navigationPage:H.navigationPage}}]),setTimeout(()=>{window.dispatchEvent(new CustomEvent("agentActionComplete",{detail:{result:{bulk:!0,total:H.total,successes:H.successes}}}))},100);else if(Je==="error"){ye("idle"),Le([]),Ar(null);let q={id:D+1,role:"assistant",kind:"text",content:H.message||"An error occurred processing your CSV file."};m(re=>[...re,q])}else Je==="done"&&(ye("idle"),Le([]))}catch(H){console.error("Failed to parse bulk SSE event:",H)}}}Le([]),ye("idle")}catch(M){console.error("Bulk upload failed:",M),Le([]),ye("idle");let J="I'm having trouble processing your CSV file.";M instanceof Error&&(M.name==="AbortError"?J="The bulk upload request timed out. The file might be too large or the server is busy - please try again.":M.message.includes("Failed to fetch")||M.message.includes("NetworkError")?J="I'm having trouble connecting to my backend. Please make sure the agent server is running on port 5002.":M.message.includes("Bulk upload failed:")&&(J="The server encountered an error processing your CSV file. Please try again.")),J+=" Please try again.";let X={id:D+1,role:"assistant",kind:"text",content:J};m(T=>[...T,X])}}async function Lp(v){ye("executing"),Le([{message:"Starting bulk operation...",completed:!1}]);try{let k=await fetch(`${i}/chat/bulk/confirm`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({bulk_session_id:v})});if(!k.ok)throw new Error(`Confirm failed: ${k.status}`);let D=k.body?.getReader();if(!D)throw new Error("No response body");let E=new TextDecoder,M="";for(;;){let{done:J,value:X}=await D.read();if(J)break;M+=E.decode(X,{stream:!0});let T=M.split(`
|
|
36
36
|
|
|
37
|
-
`);
|
|
38
|
-
`),K="",ae="";for(let W of b)W.startsWith("event: ")?K=W.slice(7):W.startsWith("data: ")&&(ae=W.slice(6));if(!(!K||!ae))try{let W=JSON.parse(ae);if(K==="progress")Le([{message:`Processing row ${W.row} of ${W.total}...`,completed:!1}]),m(pe=>pe[pe.length-1]?.kind==="bulkProgress"?pe.map((mt,Ja)=>Ja===pe.length-1?{...mt,bulkProgress:{processed:W.row,total:W.total,successes:W.successes||0,failures:W.failures||0}}:mt):[...pe,{id:Date.now(),role:"assistant",kind:"bulkProgress",bulkProgress:{processed:W.row,total:W.total,successes:W.successes||0,failures:W.failures||0}}]);else if(K==="summary")console.log("[DEBUG] Received summary event - data:",W),console.log("[DEBUG] navigationPage from backend:",W.navigationPage),ye("idle"),Le([]),Pr(null),m(pe=>{let Je=pe.filter(Ja=>Ja.kind!=="bulkProgress"&&Ja.kind!=="bulkPreview"),mt={id:Date.now(),role:"assistant",kind:"bulkSummary",content:W.message,bulkSummary:{total:W.total,successes:W.successes,failures:W.failures||[],navigationPage:W.navigationPage}};return console.log("[DEBUG] Creating bulkSummary message:",mt),[...Je,mt]}),setTimeout(()=>{window.dispatchEvent(new CustomEvent("agentActionComplete",{detail:{result:{bulk:!0,total:W.total,successes:W.successes}}}))},100);else if(K==="error"){ye("idle"),Le([]),Pr(null);let pe={id:Date.now(),role:"assistant",kind:"text",content:W.message||"An error occurred during bulk processing."};m(Je=>[...Je,pe])}}catch(W){console.error("Failed to parse confirm SSE event:",W)}}}}catch(k){console.error("Bulk confirm failed:",k),ye("idle"),Le([]),Pr(null);let O={id:Date.now(),role:"assistant",kind:"text",content:"Failed to start bulk operation. Please try again."};m(D=>[...D,O])}}function Ik(){Pr(null),m(v=>v.filter(k=>k.kind!=="bulkPreview"))}function qy(v){_u(v)}function bk(v){let k=Date.now()+Math.floor(Math.random()*1e3);m(O=>[...O,{id:k,role:"assistant",kind:"text",content:v}])}function _D(v){let k=Py[v];if(!k)return;Co("landing"),Lo(void 0);let O={id:v,stepIndex:0};kr(O),Me.current=O,bk(`I'll help you with ${k.title}.`);let D=k.steps[0],E=D.cursorTarget?.selector.includes("[data-page="),Y=D.cursorTarget?.selector.includes("[data-settings-tab=");if(D.cursorTarget&&(E||Y)){let T=D.cursorTarget;Y&&D.navigation&&o&&o(D.navigation.page,void 0),setTimeout(()=>{let b=()=>{let K=document.querySelector(T.selector);K&&K.offsetParent!==null?(Io(T),T.onClick&&setTimeout(()=>{K.click()},1200)):setTimeout(b,200)};b()},Y?800:400)}else if(D.navigation&&o&&o(D.navigation.page,D.navigation.subtab),D.cursorTarget){let T=D.cursorTarget,N=T.selector.includes("data-settings-tab"),b=T.selector.includes("dialog")||T.selector.includes("api-key-name-input");setTimeout(()=>{let ae=()=>{let W=document.querySelector(T.selector);W&&W.offsetParent!==null?(Io(T),T.onClick&&setTimeout(()=>{W.click()},1e3)):N||b?setTimeout(ae,200):(Io(T),T.onClick&&setTimeout(()=>{let pe=document.querySelector(T.selector);pe&&pe.click()},1e3))};ae()},b?700:N?600:400)}let X={id:Date.now()+1,role:"assistant",kind:"guideStep",content:"",guideStepIndex:0};m(T=>[...T,X]),Qa(X.id,D.text)}function Sp(){if(!he)return;let v=Py[he.id];if(!v)return;let k=Me.current;(!k||k.id!==he.id)&&(k=he,Me.current=he);let D=k.stepIndex+1;if(D>=v.steps.length){An();let b=Date.now()+1;m(K=>[...K,{id:b,role:"assistant",kind:"guideComplete",content:"Guide Complete"}]),kr(void 0),Ii(!0);return}let E=v.steps[D],Y={id:he.id,stepIndex:D};kr(Y),Me.current=Y;let X={id:Date.now()+1,role:"assistant",kind:"guideStep",content:"",guideStepIndex:D};m(b=>[...b,X]);let T=E.cursorTarget?.selector.includes("[data-page="),N=E.cursorTarget?.selector.includes("[data-settings-tab=");if(E.cursorTarget&&(T||N)){let b=E.cursorTarget;N&&E.navigation&&o&&o(E.navigation.page,void 0),setTimeout(()=>{let ae=Me.current;if(!ae||ae.id!==v.id||ae.stepIndex!==D)return;let W=()=>{let pe=Me.current;if(!pe||pe.id!==v.id||pe.stepIndex!==D)return;let Je=document.querySelector(b.selector);Je&&Je.offsetParent!==null?(Io(b),b.onClick&&setTimeout(()=>{let mt=Me.current;!mt||mt.id!==v.id||mt.stepIndex!==D||Je.click()},1200)):setTimeout(W,200)};W()},N?800:400)}else if(E.navigation&&o&&o(E.navigation.page,E.navigation.subtab),E.cursorTarget){let b=E.cursorTarget,K=b.selector.includes("dialog")||b.selector.includes("api-key-name-input"),ae=b.selector.includes("data-settings-tab"),W=E.navigation?.subtab&&ae&&b.selector.includes(`data-settings-tab="${E.navigation.subtab}"`),pe=b.onClick&&!W,Je=!!E.navigation,Ye=(!!E.navigation?.subtab?700:Je?400:0)+(K?700:ae?600:400);setTimeout(()=>{let ha=Me.current;if(!ha||ha.id!==v.id||ha.stepIndex!==D)return;let z=()=>{let j=Me.current;if(!j||j.id!==v.id||j.stepIndex!==D)return;let re=document.querySelector(b.selector);re&&re.offsetParent!==null?(Io(b),pe&&setTimeout(()=>{let ce=Me.current;!ce||ce.id!==v.id||ce.stepIndex!==D||re.click()},1e3)):K||ae||b.selector.includes("data-testid")?setTimeout(z,200):(Io(b),pe&&setTimeout(()=>{let ce=Me.current;if(!ce||ce.id!==v.id||ce.stepIndex!==D)return;let At=document.querySelector(b.selector);At&&At.click()},1e3))};z()},Ye)}else An();Qa(X.id,E.text)}function kk(){if(!he)return;let v=Py[he.id];if(!v)return;let k=he.stepIndex-1;if(k>=0){kr({id:he.id,stepIndex:k});let O=v.steps[k];O.navigation&&o&&o(O.navigation.page,O.navigation.subtab),O.cursorTarget?setTimeout(()=>{Io(O.cursorTarget)},500):An();let D=h.filter(E=>E.kind!=="guideStep"&&E.kind!=="guideComplete");m([...D,{id:Date.now(),role:"assistant",kind:"guideStep",content:O.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 ${Fy?"w-[480px]":"w-[320px]"}`,children:Fy?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("input",{ref:By,type:"text",value:_n,onChange:v=>Ru(v.target.value),onKeyDown:v=>{v.key==="Enter"&&_n.trim()?(v.preventDefault(),a?.(),_u(_n.trim()),Ru(""),ki(!1)):v.key==="Escape"&&(ki(!1),Ru(""))},onBlur:()=>{_n.trim()||setTimeout(()=>ki(!1),200)},placeholder:"Ask a question...",className:"flex-1 text-sm text-gray-700 outline-none bg-transparent"}),(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?.(),_n.trim()&&I(_n),Ru(""),ki(!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)(pa,{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:()=>{ki(!0),setTimeout(()=>By.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)(pa,{className:"h-3.5 w-3.5 text-black",fill:"currentColor"})})]})})});if(y){if(A.status==="loading")return(0,p.jsxs)("section",{className:`fixed top-0 right-0 z-40 flex flex-col bg-white border-l border-gray-200 h-full overflow-hidden transition-transform duration-300 ${e?"translate-x-0":"translate-x-full"}`,style:{width:`${fp}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)(pa,{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)(ut,{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)(dn,{className:"h-3.5 w-3.5"})})]}),(0,p.jsx)(LD,{})]});if(A.status==="error")return(0,p.jsxs)("section",{className:`fixed top-0 right-0 z-40 flex flex-col bg-white border-l border-gray-200 h-full overflow-hidden transition-transform duration-300 ${e?"translate-x-0":"translate-x-full"}`,style:{width:`${fp}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)(pa,{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)(ut,{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)(dn,{className:"h-3.5 w-3.5"})})]}),(0,p.jsx)(ID,{error:A.error,onRetry:q})]})}return(0,p.jsxs)("section",{className:`fixed top-0 right-0 z-40 flex flex-col bg-white border-l border-gray-200 h-full overflow-hidden transition-transform duration-300 ${e?"translate-x-0":"translate-x-full"}`,style:{width:`${fp}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)(pa,{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)(ut,{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:()=>{Ht(),m([]),Co("landing"),Lo(void 0),kr(void 0),Me.current=void 0,Ii(!1)},children:(0,p.jsx)(Bt,{className:"h-3 w-3"})}),(0,p.jsx)(ut,{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:()=>{J&&(Ht(),m([]),Co("landing"),Lo(void 0),kr(void 0),Me.current=void 0,Ii(!1)),t?.()},children:(0,p.jsx)(dn,{className:"h-3.5 w-3.5"})})]})]}),(0,p.jsx)("div",{className:Ry?"grid flex-1 place-items-center transition-all duration-300":"flex flex-1 flex-col transition-all duration-300 min-h-0 overflow-hidden",children:Ry?(0,p.jsxs)("div",{className:"w-full overflow-y-auto px-4",children:[(0,p.jsx)("div",{className:"py-3 transition-all duration-300",children:(0,p.jsx)("h2",{className:"text-center text-2xl font-semibold text-gray-900",children:pp==="folder"?dk.find(v=>v.id===_y)?.title||"":"How can I help?"})}),(0,p.jsxs)("div",{className:"pb-4 px-4",children:[pp==="landing"&&(0,p.jsx)(p.Fragment,{children:(0,p.jsx)("div",{className:"flex flex-col gap-1",children:yk?(0,p.jsx)("div",{className:"flex items-center justify-center py-4",children:(0,p.jsx)(Ft,{className:"h-4 w-4 animate-spin text-gray-400"})}):gk.map((v,k)=>{let O=["bg-blue-400","bg-green-400","bg-purple-400","bg-orange-400","bg-pink-400"];return(0,p.jsxs)(ut,{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:()=>qy(v.prompt),children:[(0,p.jsx)("span",{className:`mr-2 inline-block h-1.5 w-1.5 rounded-full ${O[k%O.length]}`}),v.label]},v.id)})})}),pp==="folder"&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,p.jsx)(ut,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 rounded-full hover:bg-gray-100",onClick:wk,"aria-label":"Back to suggestions",children:(0,p.jsx)(ks,{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:dk.find(v=>v.id===_y)?.topics.map(v=>(0,p.jsx)(ut,{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:()=>qy(v.prompt),children:v.label},v.id))})]})]})]}):(0,p.jsx)(p.Fragment,{children:(0,p.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:(0,p.jsx)(Sg,{ref:hp,className:"h-full",children:(0,p.jsxs)("div",{className:"flex flex-col gap-2 px-4 py-3",children:[h.map((v,k)=>{let O=v.role==="user",D=k>0?h[k-1].role:void 0,E=D!==void 0&&D!==v.role,Y=Me.current||he,X=!1;if(Y&&v.kind==="guideStep"?v.guideStepIndex!==void 0?X=v.guideStepIndex===Y.stepIndex:X=k===h.length-1:v.kind==="guideComplete"&&(X=k===h.length-1),v.kind==="guideStep"&&!X)return null;if(O)return(0,p.jsx)("div",{className:`flex justify-end ${E?"mt-3":""}`,children:(0,p.jsx)("div",{className:"max-w-[260px] rounded-2xl rounded-br-md bg-gray-900 px-3 py-2 text-xs text-white shadow-sm",children:v.content})},v.id);if(v.role==="agent")return(0,p.jsxs)("div",{className:`flex flex-col items-start ${E?"mt-3":""}`,children:[E&&(0,p.jsx)("span",{className:"text-[10px] text-gray-500 mb-1 ml-1",children:"Agent"}),(0,p.jsx)("div",{className:"max-w-[260px] rounded-2xl rounded-bl-md bg-white border border-gray-200 px-3 py-2 text-xs text-gray-800 shadow-sm",children:v.content})]},v.id);if(v.kind==="searchSummary")return(0,p.jsx)("div",{className:`${E?"mt-3":""}`,children:(0,p.jsx)(OC,{title:v.title??"Search results",links:v.links??[]})},v.id);if(v.kind==="guideComplete")return(0,p.jsx)("div",{ref:X?Tu:null,className:`${E?"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)(at,{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:`${E?"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)(ut,{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&&xp(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)(fr,{className:"h-3 w-3"}),(0,p.jsx)(pr,{className:"h-3 w-3"})]})]})})]},v.id);if(v.kind==="actionForm"){let T=v.actionType,N=Object.keys(ne).length>0?ne:v.actionData||{};if(v.isSubmitted){let b="";return T==="updateCompanyInfo"?b="Company information has been updated successfully.":T==="addApiKey"?b="API key has been added successfully.":T==="addCustomer"?b="Customer has been added successfully.":T==="enable2FA"?b="Two-factor authentication has been enabled successfully.":T==="disable2FA"?b="Two-factor authentication has been disabled successfully.":T==="changePassword"?b="Your password has been changed successfully.":T==="revokeSession"?b="Session has been revoked successfully.":T==="toggleNotification"?b="Notification preferences have been updated successfully.":T==="connectIntegration"?b="Integration has been connected successfully.":T==="disconnectIntegration"?b="Integration has been disconnected successfully.":T==="addPaymentMethod"?b="Payment method has been added successfully.":T==="removePaymentMethod"?b="Payment method has been removed successfully.":T==="deleteApiKey"?b="API key has been deleted successfully.":T==="addWebhook"?b="Webhook endpoint has been added successfully.":T==="updateCurrency"?b="Currency preference has been updated successfully.":T==="updateTimezone"?b="Timezone has been updated successfully.":T==="refundPayment"?b="Refund has been processed successfully.":T==="exportCertificate"?b="Certificate of Incorporation has been downloaded successfully.":T==="createSubscription"?b="Subscription has been created successfully.":T==="toggleBlockRule"||T==="enableBlockRule"||T==="disableBlockRule"?b="Block rule has been updated successfully.":b="Action completed successfully.",(0,p.jsx)("div",{className:`${E?"mt-3":""}`,children:(0,p.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-6 text-gray-700",children:b})},v.id)}return(0,p.jsxs)("div",{className:`min-w-0 ${E?"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)(De,{placeholder:"Acme Corporation",value:N.companyName||"",onChange:b=>se({...ne,companyName:b.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)(De,{type:"email",placeholder:"contact@acme.com",value:N.email||"",onChange:b=>se({...ne,email:b.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)(De,{placeholder:"123 Main St, San Francisco, CA",value:N.address||"",onChange:b=>se({...ne,address:b.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)(De,{type:"tel",placeholder:"+1 (555) 123-4567",value:N.phone||"",onChange:b=>se({...ne,phone:b.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)(De,{type:"url",placeholder:"https://acme.com",value:N.website||"",onChange:b=>se({...ne,website:b.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)(De,{placeholder:"Production Key",value:N.name||"",onChange:b=>se({...ne,name:b.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)(De,{placeholder:"Acme Corporation",value:N.name||"",onChange:b=>se({...ne,name:b.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)(De,{type:"email",placeholder:"contact@acme.com",value:N.email||"",onChange:b=>se({...ne,email:b.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)(De,{placeholder:"San Francisco, CA",value:N.location||"",onChange:b=>se({...ne,location:b.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:b=>se({...ne,subscription:b.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)(De,{type:"password",value:N.currentPassword||"",onChange:b=>se({...ne,currentPassword:b.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)(De,{type:"password",value:N.newPassword||"",onChange:b=>se({...ne,newPassword:b.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)(De,{type:"password",value:N.confirmPassword||"",onChange:b=>se({...ne,confirmPassword:b.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:b=>se({...ne,notificationType:b.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:b=>se({...ne,enabled:b.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:b=>se({...ne,integrationName:b.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)(De,{placeholder:"1234 5678 9012 3456",value:N.cardNumber||"",onChange:b=>se({...ne,cardNumber:b.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)(De,{placeholder:"MM/YY",value:N.expiryDate||"",onChange:b=>se({...ne,expiryDate:b.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)(De,{placeholder:"e.g., txn_1234 or Acme Corp",value:N.transactionId||N.customer||"",onChange:b=>{let K=b.target.value;K.startsWith("txn_")||/^\d+$/.test(K)?se({...ne,transactionId:K,customer:void 0}):se({...ne,customer:K,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)(De,{placeholder:"$0.00",value:N.amount||"",onChange:b=>se({...ne,amount:b.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)(De,{placeholder:"e.g., Customer request",value:N.reason||"",onChange:b=>se({...ne,reason:b.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)(De,{placeholder:"Production Key",value:N.keyId||N.name||"",onChange:b=>se({...ne,keyId:b.target.value,name:b.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)(De,{type:"url",placeholder:"https://example.com/webhook",value:N.url||"",onChange:b=>se({...ne,url:b.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)(De,{placeholder:"Production Webhook",value:N.name||"",onChange:b=>se({...ne,name:b.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:b=>se({...ne,currency:b.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:b=>se({...ne,timezone:b.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)(De,{placeholder:"MacBook Pro",value:N.device||"",onChange:b=>se({...ne,device:b.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)(De,{type:"email",placeholder:"customer@example.com",value:N.customerEmail||"",onChange:b=>se({...ne,customerEmail:b.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:b=>se({...ne,plan:b.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:b=>se({...ne,billingCycle:b.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:b=>se({...ne,format:b.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:b=>se({...ne,ruleId:b.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)(ut,{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)(fr,{className:"h-3 w-3"}),(0,p.jsx)(pr,{className:"h-3 w-3"})]})]})})]},v.id)}if(v.kind==="bulkPreview"&&v.csvData)return(0,p.jsxs)("div",{className:`${E?"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)(Ps,{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,N)=>(0,p.jsx)("span",{className:"text-xs bg-blue-100 text-blue-700 px-1.5 py-0.5 rounded",children:T},N))})]}),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,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(([b,K],ae)=>(0,p.jsxs)("span",{children:[ae>0&&" \u2022 ",(0,p.jsxs)("span",{className:"text-gray-400",children:[b,":"]})," ",K]},b)),Object.keys(T).length>3&&(0,p.jsxs)("span",{className:"text-gray-400",children:[" ","..."]})]},N))})]}),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)(ut,{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&&wp(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)(fr,{className:"h-3 w-3"}),(0,p.jsx)(pr,{className:"h-3 w-3"})]})]}),(0,p.jsx)(ut,{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:Ik,children:"Cancel"})]})]},v.id);if(v.kind==="bulkProgress"&&v.bulkProgress){let{processed:T,total:N,successes:b,failures:K}=v.bulkProgress,ae=Math.round(T/N*100);return(0,p.jsx)("div",{className:`${E?"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)(Ft,{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:`${ae}%`}})}),(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)(at,{className:"h-3 w-3 text-green-600"}),b," successful"]}),K>0&&(0,p.jsxs)("span",{className:"flex items-center gap-1 text-red-600",children:[(0,p.jsx)(ro,{className:"h-3 w-3"}),K," failed"]})]})]})},v.id)}if(v.kind==="bulkSummary"&&v.bulkSummary){let{total:T,successes:N,failures:b,navigationPage:K}=v.bulkSummary,ae=b.length>0,W=K?.page==="customers"?"Customers":K?.page==="dashboard"?"Dashboard":K?.page==="settings"?"Settings":"Results";return(0,p.jsx)("div",{className:`${E?"mt-3":""}`,children:(0,p.jsxs)("div",{className:`rounded-lg border p-3 ${ae?"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)(at,{className:`h-5 w-5 ${ae?"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: ${N} successful${ae?`, ${b.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)(at,{className:"h-3 w-3"}),N," successful"]}),ae&&(0,p.jsxs)("span",{className:"flex items-center gap-1 text-red-600",children:[(0,p.jsx)(ro,{className:"h-3 w-3"}),b.length," failed"]})]}),ae&&(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:[b.slice(0,5).map((pe,Je)=>(0,p.jsxs)("div",{className:"text-xs text-red-700 bg-red-50 rounded px-2 py-1",children:["Row ",pe.row,":"," ",pe.error||"Unknown error"]},Je)),b.length>5&&(0,p.jsxs)("div",{className:"text-xs text-amber-600",children:["...and ",b.length-5," more"]})]})]}),K&&N>0&&(0,p.jsx)("div",{className:"mt-3 pt-2 border-t border-gray-200",children:(0,p.jsxs)("button",{type:"button",onClick:pe=>{pe.preventDefault(),pe.stopPropagation(),console.log("[DEBUG] Button clicked - navigationPage:",K,"onNavigate:",!!o),o&&K.page?(console.log("[DEBUG] Calling onNavigate with page:",K.page),o(K.page,K.subtab)):console.log("[DEBUG] Condition failed - onNavigate:",!!o,"navigationPage.page:",K.page)},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)(fr,{className:"h-2.5 w-2.5"}),(0,p.jsx)("span",{children:"+"}),(0,p.jsx)(pr,{className:"h-2.5 w-2.5"})]}),(0,p.jsxs)("span",{children:["View ",W]})]})})]})},v.id)}return(0,p.jsx)(F.Fragment,{children:(0,p.jsxs)("div",{ref:X?Tu:null,className:`${E?"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 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 v.role==="assistant"&&T?wD(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)(lk,{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:()=>vk(v.id,T),className:`inline-flex items-center px-3 py-1.5 text-xs font-medium rounded-xl
|
|
37
|
+
`);M=T.pop()||"";for(let O of T){if(!O.trim())continue;let b=O.split(`
|
|
38
|
+
`),K="",te="";for(let G of b)G.startsWith("event: ")?K=G.slice(7):G.startsWith("data: ")&&(te=G.slice(6));if(!(!K||!te))try{let G=JSON.parse(te);if(K==="progress")Le([{message:`Processing row ${G.row} of ${G.total}...`,completed:!1}]),m(fe=>fe[fe.length-1]?.kind==="bulkProgress"?fe.map((pt,Ja)=>Ja===fe.length-1?{...pt,bulkProgress:{processed:G.row,total:G.total,successes:G.successes||0,failures:G.failures||0}}:pt):[...fe,{id:Date.now(),role:"assistant",kind:"bulkProgress",bulkProgress:{processed:G.row,total:G.total,successes:G.successes||0,failures:G.failures||0}}]);else if(K==="summary")console.log("[DEBUG] Received summary event - data:",G),console.log("[DEBUG] navigationPage from backend:",G.navigationPage),ye("idle"),Le([]),Ar(null),m(fe=>{let Qe=fe.filter(Ja=>Ja.kind!=="bulkProgress"&&Ja.kind!=="bulkPreview"),pt={id:Date.now(),role:"assistant",kind:"bulkSummary",content:G.message,bulkSummary:{total:G.total,successes:G.successes,failures:G.failures||[],navigationPage:G.navigationPage}};return console.log("[DEBUG] Creating bulkSummary message:",pt),[...Qe,pt]}),setTimeout(()=>{window.dispatchEvent(new CustomEvent("agentActionComplete",{detail:{result:{bulk:!0,total:G.total,successes:G.successes}}}))},100);else if(K==="error"){ye("idle"),Le([]),Ar(null);let fe={id:Date.now(),role:"assistant",kind:"text",content:G.message||"An error occurred during bulk processing."};m(Qe=>[...Qe,fe])}}catch(G){console.error("Failed to parse confirm SSE event:",G)}}}}catch(k){console.error("Bulk confirm failed:",k),ye("idle"),Le([]),Ar(null);let D={id:Date.now(),role:"assistant",kind:"text",content:"Failed to start bulk operation. Please try again."};m(E=>[...E,D])}}function Tk(){Ar(null),m(v=>v.filter(k=>k.kind!=="bulkPreview"))}function $y(v){Mu(v)}function Ak(v){let k=Date.now()+Math.floor(Math.random()*1e3);m(D=>[...D,{id:k,role:"assistant",kind:"text",content:v}])}function ND(v){let k=Ry[v];if(!k)return;Lo("landing"),Io(void 0);let D={id:v,stepIndex:0};Tr(D),Ne.current=D,Ak(`I'll help you with ${k.title}.`);let E=k.steps[0],M=E.cursorTarget?.selector.includes("[data-page="),J=E.cursorTarget?.selector.includes("[data-settings-tab=");if(E.cursorTarget&&(M||J)){let T=E.cursorTarget;J&&E.navigation&&o&&o(E.navigation.page,void 0),setTimeout(()=>{let b=()=>{let K=document.querySelector(T.selector);K&&K.offsetParent!==null?(bo(T),T.onClick&&setTimeout(()=>{K.click()},1200)):setTimeout(b,200)};b()},J?800:400)}else if(E.navigation&&o&&o(E.navigation.page,E.navigation.subtab),E.cursorTarget){let T=E.cursorTarget,O=T.selector.includes("data-settings-tab"),b=T.selector.includes("dialog")||T.selector.includes("api-key-name-input");setTimeout(()=>{let te=()=>{let G=document.querySelector(T.selector);G&&G.offsetParent!==null?(bo(T),T.onClick&&setTimeout(()=>{G.click()},1e3)):O||b?setTimeout(te,200):(bo(T),T.onClick&&setTimeout(()=>{let fe=document.querySelector(T.selector);fe&&fe.click()},1e3))};te()},b?700:O?600:400)}let X={id:Date.now()+1,role:"assistant",kind:"guideStep",content:"",guideStepIndex:0};m(T=>[...T,X]),Qa(X.id,E.text)}function Ip(){if(!he)return;let v=Ry[he.id];if(!v)return;let k=Ne.current;(!k||k.id!==he.id)&&(k=he,Ne.current=he);let E=k.stepIndex+1;if(E>=v.steps.length){Rn();let b=Date.now()+1;m(K=>[...K,{id:b,role:"assistant",kind:"guideComplete",content:"Guide Complete"}]),Tr(void 0),bi(!0);return}let M=v.steps[E],J={id:he.id,stepIndex:E};Tr(J),Ne.current=J;let X={id:Date.now()+1,role:"assistant",kind:"guideStep",content:"",guideStepIndex:E};m(b=>[...b,X]);let T=M.cursorTarget?.selector.includes("[data-page="),O=M.cursorTarget?.selector.includes("[data-settings-tab=");if(M.cursorTarget&&(T||O)){let b=M.cursorTarget;O&&M.navigation&&o&&o(M.navigation.page,void 0),setTimeout(()=>{let te=Ne.current;if(!te||te.id!==v.id||te.stepIndex!==E)return;let G=()=>{let fe=Ne.current;if(!fe||fe.id!==v.id||fe.stepIndex!==E)return;let Qe=document.querySelector(b.selector);Qe&&Qe.offsetParent!==null?(bo(b),b.onClick&&setTimeout(()=>{let pt=Ne.current;!pt||pt.id!==v.id||pt.stepIndex!==E||Qe.click()},1200)):setTimeout(G,200)};G()},O?800:400)}else if(M.navigation&&o&&o(M.navigation.page,M.navigation.subtab),M.cursorTarget){let b=M.cursorTarget,K=b.selector.includes("dialog")||b.selector.includes("api-key-name-input"),te=b.selector.includes("data-settings-tab"),G=M.navigation?.subtab&&te&&b.selector.includes(`data-settings-tab="${M.navigation.subtab}"`),fe=b.onClick&&!G,Qe=!!M.navigation,Je=(!!M.navigation?.subtab?700:Qe?400:0)+(K?700:te?600:400);setTimeout(()=>{let ha=Ne.current;if(!ha||ha.id!==v.id||ha.stepIndex!==E)return;let H=()=>{let q=Ne.current;if(!q||q.id!==v.id||q.stepIndex!==E)return;let re=document.querySelector(b.selector);re&&re.offsetParent!==null?(bo(b),fe&&setTimeout(()=>{let de=Ne.current;!de||de.id!==v.id||de.stepIndex!==E||re.click()},1e3)):K||te||b.selector.includes("data-testid")?setTimeout(H,200):(bo(b),fe&&setTimeout(()=>{let de=Ne.current;if(!de||de.id!==v.id||de.stepIndex!==E)return;let Rt=document.querySelector(b.selector);Rt&&Rt.click()},1e3))};H()},Je)}else Rn();Qa(X.id,M.text)}function Rk(){if(!he)return;let v=Ry[he.id];if(!v)return;let k=he.stepIndex-1;if(k>=0){Tr({id:he.id,stepIndex:k});let D=v.steps[k];D.navigation&&o&&o(D.navigation.page,D.navigation.subtab),D.cursorTarget?setTimeout(()=>{bo(D.cursorTarget)},500):Rn();let E=h.filter(M=>M.kind!=="guideStep"&&M.kind!=="guideComplete");m([...E,{id:Date.now(),role:"assistant",kind:"guideStep",content:D.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 ${Vy?"w-[480px]":"w-[320px]"}`,children:Vy?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("input",{ref:jy,type:"text",value:En,onChange:v=>Du(v.target.value),onKeyDown:v=>{v.key==="Enter"&&En.trim()?(v.preventDefault(),a?.(),Mu(En.trim()),Du(""),Pi(!1)):v.key==="Escape"&&(Pi(!1),Du(""))},onBlur:()=>{En.trim()||setTimeout(()=>Pi(!1),200)},placeholder:"Ask a question...",className:"flex-1 text-sm text-gray-700 outline-none bg-transparent"}),(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?.(),En.trim()&&I(En),Du(""),Pi(!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)(Yt,{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:()=>{Pi(!0),setTimeout(()=>jy.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)(Yt,{className:"h-3.5 w-3.5 text-black",fill:"currentColor"})})]})})});if(A.status==="loading")return(0,p.jsxs)("section",{className:`fixed top-0 right-0 z-40 flex flex-col bg-white border-l border-gray-200 h-full overflow-hidden transition-transform duration-300 ${e?"translate-x-0":"translate-x-full"}`,style:{width:`${Pu}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)(Yt,{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)(tt,{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)(mr,{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(V){if(F.status==="loading")return(0,p.jsxs)("section",{className:`fixed top-0 right-0 z-40 flex flex-col bg-white border-l border-gray-200 h-full overflow-hidden transition-transform duration-300 ${e?"translate-x-0":"translate-x-full"}`,style:{width:`${Pu}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)(Yt,{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)(tt,{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)(cn,{className:"h-3.5 w-3.5"})})]}),(0,p.jsx)(PD,{})]});if(F.status==="error")return(0,p.jsxs)("section",{className:`fixed top-0 right-0 z-40 flex flex-col bg-white border-l border-gray-200 h-full overflow-hidden transition-transform duration-300 ${e?"translate-x-0":"translate-x-full"}`,style:{width:`${Pu}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)(Yt,{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)(tt,{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)(cn,{className:"h-3.5 w-3.5"})})]}),(0,p.jsx)(TD,{error:F.error,onRetry:me})]})}return(0,p.jsxs)("section",{className:`fixed top-0 right-0 z-40 flex flex-col bg-white border-l border-gray-200 h-full overflow-hidden transition-transform duration-300 ${e?"translate-x-0":"translate-x-full"}`,style:{width:`${Pu}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)(Yt,{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)(tt,{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:()=>{zt(),m([]),Lo("landing"),Io(void 0),Tr(void 0),Ne.current=void 0,bi(!1)},children:(0,p.jsx)(Bt,{className:"h-3 w-3"})}),(0,p.jsx)(tt,{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:()=>{Be&&(zt(),m([]),Lo("landing"),Io(void 0),Tr(void 0),Ne.current=void 0,bi(!1)),t?.()},children:(0,p.jsx)(cn,{className:"h-3.5 w-3.5"})})]})]}),(0,p.jsx)("div",{className:Dy?"grid flex-1 place-items-center transition-all duration-300":"flex flex-1 flex-col transition-all duration-300 min-h-0 overflow-hidden",children:Dy?(0,p.jsxs)("div",{className:"w-full overflow-y-auto px-4",children:[(0,p.jsx)("div",{className:"py-3 transition-all duration-300",children:(0,p.jsx)("h2",{className:"text-center text-2xl font-semibold text-gray-900",children:gp==="folder"?mk.find(v=>v.id===My)?.title||"":"How can I help?"})}),(0,p.jsxs)("div",{className:"pb-4 px-4",children:[gp==="landing"&&(0,p.jsx)(p.Fragment,{children:(0,p.jsx)("div",{className:"flex flex-col gap-1",children:Ck?(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"})}):wk.map((v,k)=>{let D=["bg-blue-400","bg-green-400","bg-purple-400","bg-orange-400","bg-pink-400"];return(0,p.jsxs)(tt,{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:()=>$y(v.prompt),children:[(0,p.jsx)("span",{className:`mr-2 inline-block h-1.5 w-1.5 rounded-full ${D[k%D.length]}`}),v.label]},v.id)})})}),gp==="folder"&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,p.jsx)(tt,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 rounded-full hover:bg-gray-100",onClick:Ik,"aria-label":"Back to suggestions",children:(0,p.jsx)(Ps,{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:mk.find(v=>v.id===My)?.topics.map(v=>(0,p.jsx)(tt,{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:()=>$y(v.prompt),children:v.label},v.id))})]})]})]}):(0,p.jsx)(p.Fragment,{children:(0,p.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:(0,p.jsx)(Ig,{ref:xp,className:"h-full",children:(0,p.jsxs)("div",{className:"flex flex-col gap-2 px-4 py-3",children:[h.map((v,k)=>{let D=v.role==="user",E=k>0?h[k-1].role:void 0,M=E!==void 0&&E!==v.role,J=Ne.current||he,X=!1;if(J&&v.kind==="guideStep"?v.guideStepIndex!==void 0?X=v.guideStepIndex===J.stepIndex:X=k===h.length-1:v.kind==="guideComplete"&&(X=k===h.length-1),v.kind==="guideStep"&&!X)return null;if(D)return(0,p.jsx)("div",{className:`flex justify-end ${M?"mt-3":""}`,children:(0,p.jsx)("div",{className:"max-w-[260px] rounded-2xl rounded-br-md bg-gray-900 px-3 py-2 text-xs text-white shadow-sm",children:v.content})},v.id);if(v.role==="agent")return(0,p.jsxs)("div",{className:`flex flex-col items-start ${M?"mt-3":""}`,children:[M&&(0,p.jsx)("span",{className:"text-[10px] text-gray-500 mb-1 ml-1",children:"Agent"}),(0,p.jsx)("div",{className:"max-w-[260px] rounded-2xl rounded-bl-md bg-white border border-gray-200 px-3 py-2 text-xs text-gray-800 shadow-sm",children:v.content})]},v.id);if(v.kind==="searchSummary")return(0,p.jsx)("div",{className:`${M?"mt-3":""}`,children:(0,p.jsx)(US,{title:v.title??"Search results",links:v.links??[]})},v.id);if(v.kind==="guideComplete")return(0,p.jsx)("div",{ref:X?_u:null,className:`${M?"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)(at,{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:`${M?"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)(tt,{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&&Cp(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)(fr,{className:"h-3 w-3"}),(0,p.jsx)(pr,{className:"h-3 w-3"})]})]})})]},v.id);if(v.kind==="actionForm"){let T=v.actionType,O=Object.keys(ne).length>0?ne:v.actionData||{};if(v.isSubmitted){let b="";return T==="updateCompanyInfo"?b="Company information has been updated successfully.":T==="addApiKey"?b="API key has been added successfully.":T==="addCustomer"?b="Customer has been added successfully.":T==="enable2FA"?b="Two-factor authentication has been enabled successfully.":T==="disable2FA"?b="Two-factor authentication has been disabled successfully.":T==="changePassword"?b="Your password has been changed successfully.":T==="revokeSession"?b="Session has been revoked successfully.":T==="toggleNotification"?b="Notification preferences have been updated successfully.":T==="connectIntegration"?b="Integration has been connected successfully.":T==="disconnectIntegration"?b="Integration has been disconnected successfully.":T==="addPaymentMethod"?b="Payment method has been added successfully.":T==="removePaymentMethod"?b="Payment method has been removed successfully.":T==="deleteApiKey"?b="API key has been deleted successfully.":T==="addWebhook"?b="Webhook endpoint has been added successfully.":T==="updateCurrency"?b="Currency preference has been updated successfully.":T==="updateTimezone"?b="Timezone has been updated successfully.":T==="refundPayment"?b="Refund has been processed successfully.":T==="exportCertificate"?b="Certificate of Incorporation has been downloaded successfully.":T==="createSubscription"?b="Subscription has been created successfully.":T==="toggleBlockRule"||T==="enableBlockRule"||T==="disableBlockRule"?b="Block rule has been updated successfully.":b="Action completed successfully.",(0,p.jsx)("div",{className:`${M?"mt-3":""}`,children:(0,p.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-6 text-gray-700",children:b})},v.id)}return(0,p.jsxs)("div",{className:`min-w-0 ${M?"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)(De,{placeholder:"Acme Corporation",value:O.companyName||"",onChange:b=>se({...ne,companyName:b.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)(De,{type:"email",placeholder:"contact@acme.com",value:O.email||"",onChange:b=>se({...ne,email:b.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)(De,{placeholder:"123 Main St, San Francisco, CA",value:O.address||"",onChange:b=>se({...ne,address:b.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)(De,{type:"tel",placeholder:"+1 (555) 123-4567",value:O.phone||"",onChange:b=>se({...ne,phone:b.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)(De,{type:"url",placeholder:"https://acme.com",value:O.website||"",onChange:b=>se({...ne,website:b.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)(De,{placeholder:"Production Key",value:O.name||"",onChange:b=>se({...ne,name:b.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)(De,{placeholder:"Acme Corporation",value:O.name||"",onChange:b=>se({...ne,name:b.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)(De,{type:"email",placeholder:"contact@acme.com",value:O.email||"",onChange:b=>se({...ne,email:b.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)(De,{placeholder:"San Francisco, CA",value:O.location||"",onChange:b=>se({...ne,location:b.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:O.subscription||"Starter",onChange:b=>se({...ne,subscription:b.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)(De,{type:"password",value:O.currentPassword||"",onChange:b=>se({...ne,currentPassword:b.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)(De,{type:"password",value:O.newPassword||"",onChange:b=>se({...ne,newPassword:b.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)(De,{type:"password",value:O.confirmPassword||"",onChange:b=>se({...ne,confirmPassword:b.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:O.notificationType||"paymentReceived",onChange:b=>se({...ne,notificationType:b.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:O.enabled!==!1,onChange:b=>se({...ne,enabled:b.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:O.integrationName||"Slack",onChange:b=>se({...ne,integrationName:b.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)(De,{placeholder:"1234 5678 9012 3456",value:O.cardNumber||"",onChange:b=>se({...ne,cardNumber:b.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)(De,{placeholder:"MM/YY",value:O.expiryDate||"",onChange:b=>se({...ne,expiryDate:b.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)(De,{placeholder:"e.g., txn_1234 or Acme Corp",value:O.transactionId||O.customer||"",onChange:b=>{let K=b.target.value;K.startsWith("txn_")||/^\d+$/.test(K)?se({...ne,transactionId:K,customer:void 0}):se({...ne,customer:K,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)(De,{placeholder:"$0.00",value:O.amount||"",onChange:b=>se({...ne,amount:b.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)(De,{placeholder:"e.g., Customer request",value:O.reason||"",onChange:b=>se({...ne,reason:b.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)(De,{placeholder:"Production Key",value:O.keyId||O.name||"",onChange:b=>se({...ne,keyId:b.target.value,name:b.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)(De,{type:"url",placeholder:"https://example.com/webhook",value:O.url||"",onChange:b=>se({...ne,url:b.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)(De,{placeholder:"Production Webhook",value:O.name||"",onChange:b=>se({...ne,name:b.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:O.currency||"USD",onChange:b=>se({...ne,currency:b.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:O.timezone||"America/Los_Angeles",onChange:b=>se({...ne,timezone:b.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)(De,{placeholder:"MacBook Pro",value:O.device||"",onChange:b=>se({...ne,device:b.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)(De,{type:"email",placeholder:"customer@example.com",value:O.customerEmail||"",onChange:b=>se({...ne,customerEmail:b.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:O.plan||"Starter",onChange:b=>se({...ne,plan:b.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:O.billingCycle||"monthly",onChange:b=>se({...ne,billingCycle:b.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:O.format||"pdf",onChange:b=>se({...ne,format:b.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:O.ruleId||"rule_1",onChange:b=>se({...ne,ruleId:b.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)(tt,{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:Sp,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)(fr,{className:"h-3 w-3"}),(0,p.jsx)(pr,{className:"h-3 w-3"})]})]})})]},v.id)}if(v.kind==="bulkPreview"&&v.csvData)return(0,p.jsxs)("div",{className:`${M?"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)(Ts,{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,O)=>(0,p.jsx)("span",{className:"text-xs bg-blue-100 text-blue-700 px-1.5 py-0.5 rounded",children:T},O))})]}),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,O)=>(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(([b,K],te)=>(0,p.jsxs)("span",{children:[te>0&&" \u2022 ",(0,p.jsxs)("span",{className:"text-gray-400",children:[b,":"]})," ",K]},b)),Object.keys(T).length>3&&(0,p.jsxs)("span",{className:"text-gray-400",children:[" ","..."]})]},O))})]}),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)(tt,{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&&Lp(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)(fr,{className:"h-3 w-3"}),(0,p.jsx)(pr,{className:"h-3 w-3"})]})]}),(0,p.jsx)(tt,{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:Tk,children:"Cancel"})]})]},v.id);if(v.kind==="bulkProgress"&&v.bulkProgress){let{processed:T,total:O,successes:b,failures:K}=v.bulkProgress,te=Math.round(T/O*100);return(0,p.jsx)("div",{className:`${M?"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 ",O]})]}),(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:`${te}%`}})}),(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)(at,{className:"h-3 w-3 text-green-600"}),b," successful"]}),K>0&&(0,p.jsxs)("span",{className:"flex items-center gap-1 text-red-600",children:[(0,p.jsx)(mr,{className:"h-3 w-3"}),K," failed"]})]})]})},v.id)}if(v.kind==="bulkSummary"&&v.bulkSummary){let{total:T,successes:O,failures:b,navigationPage:K}=v.bulkSummary,te=b.length>0,G=K?.page==="customers"?"Customers":K?.page==="dashboard"?"Dashboard":K?.page==="settings"?"Settings":"Results";return(0,p.jsx)("div",{className:`${M?"mt-3":""}`,children:(0,p.jsxs)("div",{className:`rounded-lg border p-3 ${te?"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)(at,{className:`h-5 w-5 ${te?"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: ${O} successful${te?`, ${b.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)(at,{className:"h-3 w-3"}),O," successful"]}),te&&(0,p.jsxs)("span",{className:"flex items-center gap-1 text-red-600",children:[(0,p.jsx)(mr,{className:"h-3 w-3"}),b.length," failed"]})]}),te&&(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:[b.slice(0,5).map((fe,Qe)=>(0,p.jsxs)("div",{className:"text-xs text-red-700 bg-red-50 rounded px-2 py-1",children:["Row ",fe.row,":"," ",fe.error||"Unknown error"]},Qe)),b.length>5&&(0,p.jsxs)("div",{className:"text-xs text-amber-600",children:["...and ",b.length-5," more"]})]})]}),K&&O>0&&(0,p.jsx)("div",{className:"mt-3 pt-2 border-t border-gray-200",children:(0,p.jsxs)("button",{type:"button",onClick:fe=>{fe.preventDefault(),fe.stopPropagation(),console.log("[DEBUG] Button clicked - navigationPage:",K,"onNavigate:",!!o),o&&K.page?(console.log("[DEBUG] Calling onNavigate with page:",K.page),o(K.page,K.subtab)):console.log("[DEBUG] Condition failed - onNavigate:",!!o,"navigationPage.page:",K.page)},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)(fr,{className:"h-2.5 w-2.5"}),(0,p.jsx)("span",{children:"+"}),(0,p.jsx)(pr,{className:"h-2.5 w-2.5"})]}),(0,p.jsxs)("span",{children:["View ",G]})]})})]})},v.id)}return(0,p.jsx)(B.Fragment,{children:(0,p.jsxs)("div",{ref:X?_u:null,className:`${M?"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 O=T.match(/^(Step\s+\d+:)([\s\S]*)/);if(O)return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("strong",{children:O[1]}),O[2]]})}return v.role==="assistant"&&T?ID(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)(fk,{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:()=>Lk(v.id,T),className:`inline-flex items-center px-3 py-1.5 text-xs font-medium rounded-xl
|
|
39
39
|
bg-white hover:bg-gray-50 text-gray-600 hover:text-gray-800
|
|
40
40
|
border border-gray-200 hover:border-gray-300 shadow-sm
|
|
41
|
-
transition-all duration-150 ease-in-out`,children:T.label},T.id))})]})},v.id)}),(he||
|
|
41
|
+
transition-all duration-150 ease-in-out`,children:T.label},T.id))})]})},v.id)}),(he||Ii)&&(0,p.jsxs)("div",{className:"mt-3 flex items-center gap-2",children:[he&&he.stepIndex>0&&(0,p.jsx)(tt,{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:Rk,children:(0,p.jsx)(Ps,{className:"h-3.5 w-3.5 text-gray-600"})}),(0,p.jsxs)(tt,{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:Ii?Hy:Ip,children:[(0,p.jsx)("span",{children:Ii?"Done":"Next"}),(0,p.jsxs)("span",{className:"flex items-center gap-0.5 text-gray-400",children:[(0,p.jsx)(fr,{className:"h-3 w-3"}),(0,p.jsx)(pr,{className:"h-3 w-3"})]})]})]}),(An==="thinking"||An==="searching"||An==="executing"||An==="responding")&&(0,p.jsx)("div",{className:`${vk==="user"?"mt-3":""}`,children:(0,p.jsx)(FS,{phase:An,progressSteps:xk})}),Be&&So&&(0,p.jsx)("div",{className:"mt-2",children:(0,p.jsx)(pk,{})}),!he&&(0,p.jsx)("div",{ref:By})]})})})})}),(0,p.jsxs)("div",{className:"px-4 py-3 border-t border-gray-100 bg-gray-50/50 shrink-0",children:[ko&&(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)(Ts,{className:"h-4 w-4 text-blue-600"}),(0,p.jsx)("span",{className:"text-xs text-blue-700 flex-1 truncate",children:ko.name}),(0,p.jsx)("button",{type:"button",onClick:()=>{vp(null),_n.current&&(_n.current.value="")},className:"text-blue-600 hover:text-blue-800",children:(0,p.jsx)(mr,{className:"h-4 w-4"})})]}),(0,p.jsxs)("form",{onSubmit:bk,className:"w-full",children:[(0,p.jsx)("input",{ref:_n,type:"file",accept:".csv",className:"hidden",onChange:v=>{let k=v.target.files?.[0];k&&vp(k)}}),(0,p.jsxs)("div",{className:"flex w-full items-start gap-2 rounded-xl border border-gray-200 bg-white px-3 py-2 shadow-sm",children:[(0,p.jsx)(tt,{type:"button",size:"icon",variant:"ghost",onClick:()=>_n.current?.click(),className:"h-5 w-5 rounded-full text-gray-400 hover:text-gray-600 hover:bg-gray-100",title:"Upload CSV for bulk operations",children:(0,p.jsx)(eu,{className:"h-2.5 w-2.5"})}),(0,p.jsx)("textarea",{placeholder:ko?"Describe what to do with this CSV...":"Ask anything...",value:S,onChange:v=>{I(v.target.value),v.target.value.length>0&&yk()},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 k=v.target;k.style.height="auto",k.style.height=Math.min(k.scrollHeight,120)+"px"},onKeyDown:v=>{if(v.key==="Enter"&&!v.shiftKey&&!v.metaKey&&!v.ctrlKey){if(v.preventDefault(),S.trim()||ko){let k=v.currentTarget.closest("form");k&&k.requestSubmit()}return}if((v.metaKey||v.ctrlKey)&&v.key==="Enter"){let k=wp.current;if(k){v.preventDefault(),v.stopPropagation(),Lp(k);return}if(Xe){v.preventDefault(),v.stopPropagation(),Sp();return}if(ki){v.preventDefault(),v.stopPropagation(),Cp(ki);return}if(Ne.current){v.preventDefault(),v.stopPropagation(),Ip();return}}}}),(0,p.jsx)(tt,{type:"submit",size:"icon",disabled:!S.trim()&&!ko,className:"h-6 w-6 rounded-full bg-gray-900 hover:bg-gray-800 disabled:bg-gray-300",children:(0,p.jsx)(Ql,{className:"h-2.5 w-2.5"})})]})]})]}),(0,p.jsx)(ik,{x:Eu.x,y:Eu.y,visible:Eu.visible,onClick:Eu.onClick})]})}function hk({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,userOrganization:g,supabaseUrl:x,supabaseAnonKey:w,productBackendUrl:L}){let[y,h]=B.useState(s),m=i!==void 0?i:y,S=I=>{i===void 0&&h(I),l?.(I)};return B.useEffect(()=>{let I=document.body.style.paddingRight,P=document.body.style.transition;return document.body.style.transition="padding-right 0.3s ease",document.body.style.paddingRight=m?`${Pu}px`:"0px",()=>{document.body.style.paddingRight=I,document.body.style.transition=P}},[m]),(0,p.jsx)(AD,{isOpen:m,onClose:()=>S(!1),onOpen:()=>S(!0),onNavigate:e,onActionComplete:t,currentPage:a,agentUrl:r,startingQuestions:o,startingQuestionsEndpoint:n,userId:u,orgId:d,userName:c,userEmail:f,userOrganization:g,supabaseUrl:x,supabaseAnonKey:w,productBackendUrl:L})}var Ey=N(le(),1),Li=null,qt=null,ra={};function RD({initialConfig:e}){let[t,a]=(0,Xa.useState)(e),[r,o]=(0,Xa.useState)(e.currentPage||"dashboard"),[n,s]=(0,Xa.useState)(!1),i=(0,Xa.useRef)(!1);return(0,Xa.useEffect)(()=>{i.current=n},[n]),(0,Xa.useEffect)(()=>(ra.setCurrentPage=o,ra.setConfig=l=>a(u=>({...u,...l})),ra.setIsOpen=s,ra.getIsOpen=()=>i.current,()=>{ra={}}),[]),(0,Xa.useEffect)(()=>{t.theme==="dark"?qt?.classList.add("dark"):qt?.classList.remove("dark")},[t.theme]),(0,Ey.jsx)(hk,{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,userOrganization:t.userOrganization,supabaseUrl:t.supabaseUrl,supabaseAnonKey:t.supabaseAnonKey,productBackendUrl:t.productBackendUrl})}function _D(){if(console.log("[KiteChat-Debug] injectStyles called",{existingStyle:!!document.getElementById("kite-chat-styles"),cssContentLength:48121}),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 */
|
|
42
42
|
@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-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 .visible{visibility:visible}#kite-chat-root .fixed{position:fixed}#kite-chat-root .relative{position:relative}#kite-chat-root .top-0{top:calc(var(--spacing)*0)}#kite-chat-root .top-1\\/2{top:50%}#kite-chat-root .right-0{right:calc(var(--spacing)*0)}#kite-chat-root .bottom-6{bottom:calc(var(--spacing)*6)}#kite-chat-root .left-1\\/2{left:50%}#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 .min-h-0{min-height:calc(var(--spacing)*0)}#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-\\[320px\\]{width:320px}#kite-chat-root .w-\\[480px\\]{width:480px}#kite-chat-root .w-full{width:100%}#kite-chat-root .max-w-\\[240px\\]{max-width:240px}#kite-chat-root .max-w-\\[260px\\]{max-width:260px}#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 .translate-x-0{--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}#kite-chat-root .translate-x-full{--tw-translate-x:100%;translate:var(--tw-translate-x)var(--tw-translate-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-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-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-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-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-50\\/50{background-color:#f9fafb80}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .bg-gray-50\\/50{background-color:color-mix(in oklab,var(--color-gray-50)50%,transparent)}}#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-400{background-color:var(--color-gray-400)}#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 .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-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-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 .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 .transition-transform{transition-property:transform,translate,scale,rotate;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}@media (hover:hover){#kite-chat-root .group-hover\\:bg-gray-200:is(:where(.group):hover *){background-color:var(--color-gray-200)}}#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-800:hover{background-color:var(--color-gray-800)}#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\\: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 .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-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),console.log("[KiteChat-Debug] Style injected",{styleInHead:!!document.getElementById("kite-chat-styles"),cssLength:e.textContent?.length||0});let t=document.createElement("style");t.id="kite-chat-position",t.textContent=`
|
|
43
43
|
#kite-chat-root {
|
|
44
44
|
/* Container is just a mount point - ChatPanel handles its own positioning */
|
|
45
45
|
}
|
|
46
|
-
`,document.head.appendChild(t)}function
|
|
46
|
+
`,document.head.appendChild(t)}function _y(){console.log("[KiteChat-Debug] init() called",{hasConfig:!!window.KiteChatConfig,configKeys:window.KiteChatConfig?Object.keys(window.KiteChatConfig):[]});let e=window.KiteChatConfig;if(!e){console.error("[KiteChat] Missing window.KiteChatConfig"),console.log("[KiteChat-Debug] FAIL: no config");return}if(!e.userId||!e.orgId){console.error("[KiteChat] userId and orgId are required"),console.log("[KiteChat-Debug] FAIL: missing userId/orgId",{hasUserId:!!e.userId,hasOrgId:!!e.orgId});return}if(Li){console.warn("[KiteChat] Already initialized");return}if(_D(),e.container){let t=typeof e.container=="string"?document.querySelector(e.container):e.container;if(console.log("[KiteChat-Debug] Using custom container",{containerSelector:typeof e.container=="string"?e.container:"HTMLElement",foundContainer:!!t,containerId:t?.id||"NO_ID",containerClasses:t?.className||""}),!t){console.error(`[KiteChat] Container not found: ${e.container}`);return}qt=document.createElement("div"),qt.id="kite-chat-root",t.appendChild(qt),console.log("[KiteChat-Debug] Created inner wrapper with kite-chat-root ID inside custom container")}else qt=document.createElement("div"),qt.id="kite-chat-root",document.body.appendChild(qt),console.log("[KiteChat-Debug] Created default container",{containerId:qt.id});console.log("[KiteChat-Debug] About to render",{finalContainerId:qt?.id||"NO_ID",finalContainerClasses:qt?.className||""}),Li=(0,gk.createRoot)(qt),Li.render((0,Ey.jsx)(RD,{initialConfig:e})),window.KiteChat=ED(),console.log("[KiteChat] Initialized")}function ED(){return{setCurrentPage:e=>ra.setCurrentPage?.(e),setUser:(e,t)=>ra.setConfig?.({userId:e,orgId:t}),setConfig:e=>ra.setConfig?.(e),open:()=>ra.setIsOpen?.(!0),close:()=>ra.setIsOpen?.(!1),toggle:()=>{let e=ra.getIsOpen?.()??!1;ra.setIsOpen?.(!e)},isOpen:()=>ra.getIsOpen?.()??!1,destroy:()=>{Li?.unmount(),Li=null,qt?.remove(),qt=null,window.KiteChat=void 0},isMounted:()=>Li!==null}}typeof window<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",_y):_y());return Ky(DD);})();
|
|
47
47
|
/*! Bundled license information:
|
|
48
48
|
|
|
49
49
|
react/cjs/react.production.min.js:
|