Hamdast1/dist/assets/index-zxxbrZom.js
2026-05-23 12:45:11 +03:30

382 lines
663 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

function vv(e,n){for(var a=0;a<n.length;a++){const s=n[a];if(typeof s!="string"&&!Array.isArray(s)){for(const o in s)if(o!=="default"&&!(o in e)){const l=Object.getOwnPropertyDescriptor(s,o);l&&Object.defineProperty(e,o,l.get?l:{enumerable:!0,get:()=>s[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const d of l.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&s(d)}).observe(document,{childList:!0,subtree:!0});function a(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function s(o){if(o.ep)return;o.ep=!0;const l=a(o);fetch(o.href,l)}})();function _g(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Lu={exports:{}},bi={},Au={exports:{}},et={};/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var p0;function bv(){if(p0)return et;p0=1;var e=Symbol.for("react.element"),n=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),d=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),h=Symbol.iterator;function w(T){return T===null||typeof T!="object"?null:(T=h&&T[h]||T["@@iterator"],typeof T=="function"?T:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,E={};function C(T,A,ee){this.props=T,this.context=A,this.refs=E,this.updater=ee||k}C.prototype.isReactComponent={},C.prototype.setState=function(T,A){if(typeof T!="object"&&typeof T!="function"&&T!=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,T,A,"setState")},C.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function I(){}I.prototype=C.prototype;function M(T,A,ee){this.props=T,this.context=A,this.refs=E,this.updater=ee||k}var _=M.prototype=new I;_.constructor=M,j(_,C.prototype),_.isPureReactComponent=!0;var V=Array.isArray,H=Object.prototype.hasOwnProperty,re={current:null},O={key:!0,ref:!0,__self:!0,__source:!0};function b(T,A,ee){var ie,oe={},ae=null,ue=null;if(A!=null)for(ie in A.ref!==void 0&&(ue=A.ref),A.key!==void 0&&(ae=""+A.key),A)H.call(A,ie)&&!O.hasOwnProperty(ie)&&(oe[ie]=A[ie]);var ye=arguments.length-2;if(ye===1)oe.children=ee;else if(1<ye){for(var ve=Array(ye),Ve=0;Ve<ye;Ve++)ve[Ve]=arguments[Ve+2];oe.children=ve}if(T&&T.defaultProps)for(ie in ye=T.defaultProps,ye)oe[ie]===void 0&&(oe[ie]=ye[ie]);return{$$typeof:e,type:T,key:ae,ref:ue,props:oe,_owner:re.current}}function R(T,A){return{$$typeof:e,type:T.type,key:A,ref:T.ref,props:T.props,_owner:T._owner}}function N(T){return typeof T=="object"&&T!==null&&T.$$typeof===e}function G(T){var A={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(ee){return A[ee]})}var Y=/\/+/g;function X(T,A){return typeof T=="object"&&T!==null&&T.key!=null?G(""+T.key):A.toString(36)}function K(T,A,ee,ie,oe){var ae=typeof T;(ae==="undefined"||ae==="boolean")&&(T=null);var ue=!1;if(T===null)ue=!0;else switch(ae){case"string":case"number":ue=!0;break;case"object":switch(T.$$typeof){case e:case n:ue=!0}}if(ue)return ue=T,oe=oe(ue),T=ie===""?"."+X(ue,0):ie,V(oe)?(ee="",T!=null&&(ee=T.replace(Y,"$&/")+"/"),K(oe,A,ee,"",function(Ve){return Ve})):oe!=null&&(N(oe)&&(oe=R(oe,ee+(!oe.key||ue&&ue.key===oe.key?"":(""+oe.key).replace(Y,"$&/")+"/")+T)),A.push(oe)),1;if(ue=0,ie=ie===""?".":ie+":",V(T))for(var ye=0;ye<T.length;ye++){ae=T[ye];var ve=ie+X(ae,ye);ue+=K(ae,A,ee,ve,oe)}else if(ve=w(T),typeof ve=="function")for(T=ve.call(T),ye=0;!(ae=T.next()).done;)ae=ae.value,ve=ie+X(ae,ye++),ue+=K(ae,A,ee,ve,oe);else if(ae==="object")throw A=String(T),Error("Objects are not valid as a React child (found: "+(A==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":A)+"). If you meant to render a collection of children, use an array instead.");return ue}function te(T,A,ee){if(T==null)return T;var ie=[],oe=0;return K(T,ie,"","",function(ae){return A.call(ee,ae,oe++)}),ie}function q(T){if(T._status===-1){var A=T._result;A=A(),A.then(function(ee){(T._status===0||T._status===-1)&&(T._status=1,T._result=ee)},function(ee){(T._status===0||T._status===-1)&&(T._status=2,T._result=ee)}),T._status===-1&&(T._status=0,T._result=A)}if(T._status===1)return T._result.default;throw T._result}var P={current:null},F={transition:null},U={ReactCurrentDispatcher:P,ReactCurrentBatchConfig:F,ReactCurrentOwner:re};function W(){throw Error("act(...) is not supported in production builds of React.")}return et.Children={map:te,forEach:function(T,A,ee){te(T,function(){A.apply(this,arguments)},ee)},count:function(T){var A=0;return te(T,function(){A++}),A},toArray:function(T){return te(T,function(A){return A})||[]},only:function(T){if(!N(T))throw Error("React.Children.only expected to receive a single React element child.");return T}},et.Component=C,et.Fragment=a,et.Profiler=o,et.PureComponent=M,et.StrictMode=s,et.Suspense=g,et.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=U,et.act=W,et.cloneElement=function(T,A,ee){if(T==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+T+".");var ie=j({},T.props),oe=T.key,ae=T.ref,ue=T._owner;if(A!=null){if(A.ref!==void 0&&(ae=A.ref,ue=re.current),A.key!==void 0&&(oe=""+A.key),T.type&&T.type.defaultProps)var ye=T.type.defaultProps;for(ve in A)H.call(A,ve)&&!O.hasOwnProperty(ve)&&(ie[ve]=A[ve]===void 0&&ye!==void 0?ye[ve]:A[ve])}var ve=arguments.length-2;if(ve===1)ie.children=ee;else if(1<ve){ye=Array(ve);for(var Ve=0;Ve<ve;Ve++)ye[Ve]=arguments[Ve+2];ie.children=ye}return{$$typeof:e,type:T.type,key:oe,ref:ae,props:ie,_owner:ue}},et.createContext=function(T){return T={$$typeof:d,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},T.Provider={$$typeof:l,_context:T},T.Consumer=T},et.createElement=b,et.createFactory=function(T){var A=b.bind(null,T);return A.type=T,A},et.createRef=function(){return{current:null}},et.forwardRef=function(T){return{$$typeof:f,render:T}},et.isValidElement=N,et.lazy=function(T){return{$$typeof:x,_payload:{_status:-1,_result:T},_init:q}},et.memo=function(T,A){return{$$typeof:m,type:T,compare:A===void 0?null:A}},et.startTransition=function(T){var A=F.transition;F.transition={};try{T()}finally{F.transition=A}},et.unstable_act=W,et.useCallback=function(T,A){return P.current.useCallback(T,A)},et.useContext=function(T){return P.current.useContext(T)},et.useDebugValue=function(){},et.useDeferredValue=function(T){return P.current.useDeferredValue(T)},et.useEffect=function(T,A){return P.current.useEffect(T,A)},et.useId=function(){return P.current.useId()},et.useImperativeHandle=function(T,A,ee){return P.current.useImperativeHandle(T,A,ee)},et.useInsertionEffect=function(T,A){return P.current.useInsertionEffect(T,A)},et.useLayoutEffect=function(T,A){return P.current.useLayoutEffect(T,A)},et.useMemo=function(T,A){return P.current.useMemo(T,A)},et.useReducer=function(T,A,ee){return P.current.useReducer(T,A,ee)},et.useRef=function(T){return P.current.useRef(T)},et.useState=function(T){return P.current.useState(T)},et.useSyncExternalStore=function(T,A,ee){return P.current.useSyncExternalStore(T,A,ee)},et.useTransition=function(){return P.current.useTransition()},et.version="18.3.1",et}var m0;function Ul(){return m0||(m0=1,Au.exports=bv()),Au.exports}/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var g0;function wv(){if(g0)return bi;g0=1;var e=Ul(),n=Symbol.for("react.element"),a=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function d(f,g,m){var x,h={},w=null,k=null;m!==void 0&&(w=""+m),g.key!==void 0&&(w=""+g.key),g.ref!==void 0&&(k=g.ref);for(x in g)s.call(g,x)&&!l.hasOwnProperty(x)&&(h[x]=g[x]);if(f&&f.defaultProps)for(x in g=f.defaultProps,g)h[x]===void 0&&(h[x]=g[x]);return{$$typeof:n,type:f,key:w,ref:k,props:h,_owner:o.current}}return bi.Fragment=a,bi.jsx=d,bi.jsxs=d,bi}var x0;function kv(){return x0||(x0=1,Lu.exports=wv()),Lu.exports}var u=kv(),el={},Ou={exports:{}},Tn={},Bu={exports:{}},zu={};/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var y0;function Sv(){return y0||(y0=1,(function(e){function n(F,U){var W=F.length;F.push(U);e:for(;0<W;){var T=W-1>>>1,A=F[T];if(0<o(A,U))F[T]=U,F[W]=A,W=T;else break e}}function a(F){return F.length===0?null:F[0]}function s(F){if(F.length===0)return null;var U=F[0],W=F.pop();if(W!==U){F[0]=W;e:for(var T=0,A=F.length,ee=A>>>1;T<ee;){var ie=2*(T+1)-1,oe=F[ie],ae=ie+1,ue=F[ae];if(0>o(oe,W))ae<A&&0>o(ue,oe)?(F[T]=ue,F[ae]=W,T=ae):(F[T]=oe,F[ie]=W,T=ie);else if(ae<A&&0>o(ue,W))F[T]=ue,F[ae]=W,T=ae;else break e}}return U}function o(F,U){var W=F.sortIndex-U.sortIndex;return W!==0?W:F.id-U.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var d=Date,f=d.now();e.unstable_now=function(){return d.now()-f}}var g=[],m=[],x=1,h=null,w=3,k=!1,j=!1,E=!1,C=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(F){for(var U=a(m);U!==null;){if(U.callback===null)s(m);else if(U.startTime<=F)s(m),U.sortIndex=U.expirationTime,n(g,U);else break;U=a(m)}}function V(F){if(E=!1,_(F),!j)if(a(g)!==null)j=!0,q(H);else{var U=a(m);U!==null&&P(V,U.startTime-F)}}function H(F,U){j=!1,E&&(E=!1,I(b),b=-1),k=!0;var W=w;try{for(_(U),h=a(g);h!==null&&(!(h.expirationTime>U)||F&&!G());){var T=h.callback;if(typeof T=="function"){h.callback=null,w=h.priorityLevel;var A=T(h.expirationTime<=U);U=e.unstable_now(),typeof A=="function"?h.callback=A:h===a(g)&&s(g),_(U)}else s(g);h=a(g)}if(h!==null)var ee=!0;else{var ie=a(m);ie!==null&&P(V,ie.startTime-U),ee=!1}return ee}finally{h=null,w=W,k=!1}}var re=!1,O=null,b=-1,R=5,N=-1;function G(){return!(e.unstable_now()-N<R)}function Y(){if(O!==null){var F=e.unstable_now();N=F;var U=!0;try{U=O(!0,F)}finally{U?X():(re=!1,O=null)}}else re=!1}var X;if(typeof M=="function")X=function(){M(Y)};else if(typeof MessageChannel<"u"){var K=new MessageChannel,te=K.port2;K.port1.onmessage=Y,X=function(){te.postMessage(null)}}else X=function(){C(Y,0)};function q(F){O=F,re||(re=!0,X())}function P(F,U){b=C(function(){F(e.unstable_now())},U)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(F){F.callback=null},e.unstable_continueExecution=function(){j||k||(j=!0,q(H))},e.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<F?Math.floor(1e3/F):5},e.unstable_getCurrentPriorityLevel=function(){return w},e.unstable_getFirstCallbackNode=function(){return a(g)},e.unstable_next=function(F){switch(w){case 1:case 2:case 3:var U=3;break;default:U=w}var W=w;w=U;try{return F()}finally{w=W}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(F,U){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var W=w;w=F;try{return U()}finally{w=W}},e.unstable_scheduleCallback=function(F,U,W){var T=e.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?T+W:T):W=T,F){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=W+A,F={id:x++,callback:U,priorityLevel:F,startTime:W,expirationTime:A,sortIndex:-1},W>T?(F.sortIndex=W,n(m,F),a(g)===null&&F===a(m)&&(E?(I(b),b=-1):E=!0,P(V,W-T))):(F.sortIndex=A,n(g,F),j||k||(j=!0,q(H))),F},e.unstable_shouldYield=G,e.unstable_wrapCallback=function(F){var U=w;return function(){var W=w;w=U;try{return F.apply(this,arguments)}finally{w=W}}}})(zu)),zu}var v0;function Cv(){return v0||(v0=1,Bu.exports=Sv()),Bu.exports}/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var b0;function jv(){if(b0)return Tn;b0=1;var e=Ul(),n=Cv();function a(t){for(var r="https://reactjs.org/docs/error-decoder.html?invariant="+t,i=1;i<arguments.length;i++)r+="&args[]="+encodeURIComponent(arguments[i]);return"Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,o={};function l(t,r){d(t,r),d(t+"Capture",r)}function d(t,r){for(o[t]=r,t=0;t<r.length;t++)s.add(r[t])}var f=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),g=Object.prototype.hasOwnProperty,m=/^[: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]*$/,x={},h={};function w(t){return g.call(h,t)?!0:g.call(x,t)?!1:m.test(t)?h[t]=!0:(x[t]=!0,!1)}function k(t,r,i,c){if(i!==null&&i.type===0)return!1;switch(typeof r){case"function":case"symbol":return!0;case"boolean":return c?!1:i!==null?!i.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function j(t,r,i,c){if(r===null||typeof r>"u"||k(t,r,i,c))return!0;if(c)return!1;if(i!==null)switch(i.type){case 3:return!r;case 4:return r===!1;case 5:return isNaN(r);case 6:return isNaN(r)||1>r}return!1}function E(t,r,i,c,p,y,S){this.acceptsBooleans=r===2||r===3||r===4,this.attributeName=c,this.attributeNamespace=p,this.mustUseProperty=i,this.propertyName=t,this.type=r,this.sanitizeURL=y,this.removeEmptyString=S}var C={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){C[t]=new E(t,0,!1,t,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var r=t[0];C[r]=new E(r,1,!1,t[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(t){C[t]=new E(t,2,!1,t.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){C[t]=new E(t,2,!1,t,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(t){C[t]=new E(t,3,!1,t.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(t){C[t]=new E(t,3,!0,t,null,!1,!1)}),["capture","download"].forEach(function(t){C[t]=new E(t,4,!1,t,null,!1,!1)}),["cols","rows","size","span"].forEach(function(t){C[t]=new E(t,6,!1,t,null,!1,!1)}),["rowSpan","start"].forEach(function(t){C[t]=new E(t,5,!1,t.toLowerCase(),null,!1,!1)});var I=/[\-:]([a-z])/g;function M(t){return t[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(t){var r=t.replace(I,M);C[r]=new E(r,1,!1,t,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var r=t.replace(I,M);C[r]=new E(r,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(t){var r=t.replace(I,M);C[r]=new E(r,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(t){C[t]=new E(t,1,!1,t.toLowerCase(),null,!1,!1)}),C.xlinkHref=new E("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(t){C[t]=new E(t,1,!1,t.toLowerCase(),null,!0,!0)});function _(t,r,i,c){var p=C.hasOwnProperty(r)?C[r]:null;(p!==null?p.type!==0:c||!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(j(r,i,p,c)&&(i=null),c||p===null?w(r)&&(i===null?t.removeAttribute(r):t.setAttribute(r,""+i)):p.mustUseProperty?t[p.propertyName]=i===null?p.type===3?!1:"":i:(r=p.attributeName,c=p.attributeNamespace,i===null?t.removeAttribute(r):(p=p.type,i=p===3||p===4&&i===!0?"":""+i,c?t.setAttributeNS(c,r,i):t.setAttribute(r,i))))}var V=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,H=Symbol.for("react.element"),re=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),N=Symbol.for("react.provider"),G=Symbol.for("react.context"),Y=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),K=Symbol.for("react.suspense_list"),te=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),P=Symbol.for("react.offscreen"),F=Symbol.iterator;function U(t){return t===null||typeof t!="object"?null:(t=F&&t[F]||t["@@iterator"],typeof t=="function"?t:null)}var W=Object.assign,T;function A(t){if(T===void 0)try{throw Error()}catch(i){var r=i.stack.trim().match(/\n( *(at )?)/);T=r&&r[1]||""}return`
`+T+t}var ee=!1;function ie(t,r){if(!t||ee)return"";ee=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(r)if(r=function(){throw Error()},Object.defineProperty(r.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(r,[])}catch(ne){var c=ne}Reflect.construct(t,[],r)}else{try{r.call()}catch(ne){c=ne}t.call(r.prototype)}else{try{throw Error()}catch(ne){c=ne}t()}}catch(ne){if(ne&&c&&typeof ne.stack=="string"){for(var p=ne.stack.split(`
`),y=c.stack.split(`
`),S=p.length-1,D=y.length-1;1<=S&&0<=D&&p[S]!==y[D];)D--;for(;1<=S&&0<=D;S--,D--)if(p[S]!==y[D]){if(S!==1||D!==1)do if(S--,D--,0>D||p[S]!==y[D]){var B=`
`+p[S].replace(" at new "," at ");return t.displayName&&B.includes("<anonymous>")&&(B=B.replace("<anonymous>",t.displayName)),B}while(1<=S&&0<=D);break}}}finally{ee=!1,Error.prepareStackTrace=i}return(t=t?t.displayName||t.name:"")?A(t):""}function oe(t){switch(t.tag){case 5:return A(t.type);case 16:return A("Lazy");case 13:return A("Suspense");case 19:return A("SuspenseList");case 0:case 2:case 15:return t=ie(t.type,!1),t;case 11:return t=ie(t.type.render,!1),t;case 1:return t=ie(t.type,!0),t;default:return""}}function ae(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case O:return"Fragment";case re:return"Portal";case R:return"Profiler";case b:return"StrictMode";case X:return"Suspense";case K:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case G:return(t.displayName||"Context")+".Consumer";case N:return(t._context.displayName||"Context")+".Provider";case Y:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case te:return r=t.displayName||null,r!==null?r:ae(t.type)||"Memo";case q:r=t._payload,t=t._init;try{return ae(t(r))}catch{}}return null}function ue(t){var r=t.type;switch(t.tag){case 24:return"Cache";case 9:return(r.displayName||"Context")+".Consumer";case 10:return(r._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=r.render,t=t.displayName||t.name||"",r.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return r;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ae(r);case 8:return r===b?"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 r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r}return null}function ye(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ve(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Ve(t){var r=ve(t)?"checked":"value",i=Object.getOwnPropertyDescriptor(t.constructor.prototype,r),c=""+t[r];if(!t.hasOwnProperty(r)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var p=i.get,y=i.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return p.call(this)},set:function(S){c=""+S,y.call(this,S)}}),Object.defineProperty(t,r,{enumerable:i.enumerable}),{getValue:function(){return c},setValue:function(S){c=""+S},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function je(t){t._valueTracker||(t._valueTracker=Ve(t))}function Ue(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var i=r.getValue(),c="";return t&&(c=ve(t)?t.checked?"true":"false":t.value),t=c,t!==i?(r.setValue(t),!0):!1}function Oe(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function dt(t,r){var i=r.checked;return W({},r,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:i??t._wrapperState.initialChecked})}function yt(t,r){var i=r.defaultValue==null?"":r.defaultValue,c=r.checked!=null?r.checked:r.defaultChecked;i=ye(r.value!=null?r.value:i),t._wrapperState={initialChecked:c,initialValue:i,controlled:r.type==="checkbox"||r.type==="radio"?r.checked!=null:r.value!=null}}function vt(t,r){r=r.checked,r!=null&&_(t,"checked",r,!1)}function Se(t,r){vt(t,r);var i=ye(r.value),c=r.type;if(i!=null)c==="number"?(i===0&&t.value===""||t.value!=i)&&(t.value=""+i):t.value!==""+i&&(t.value=""+i);else if(c==="submit"||c==="reset"){t.removeAttribute("value");return}r.hasOwnProperty("value")?we(t,r.type,i):r.hasOwnProperty("defaultValue")&&we(t,r.type,ye(r.defaultValue)),r.checked==null&&r.defaultChecked!=null&&(t.defaultChecked=!!r.defaultChecked)}function Re(t,r,i){if(r.hasOwnProperty("value")||r.hasOwnProperty("defaultValue")){var c=r.type;if(!(c!=="submit"&&c!=="reset"||r.value!==void 0&&r.value!==null))return;r=""+t._wrapperState.initialValue,i||r===t.value||(t.value=r),t.defaultValue=r}i=t.name,i!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,i!==""&&(t.name=i)}function we(t,r,i){(r!=="number"||Oe(t.ownerDocument)!==t)&&(i==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+i&&(t.defaultValue=""+i))}var me=Array.isArray;function Fe(t,r,i,c){if(t=t.options,r){r={};for(var p=0;p<i.length;p++)r["$"+i[p]]=!0;for(i=0;i<t.length;i++)p=r.hasOwnProperty("$"+t[i].value),t[i].selected!==p&&(t[i].selected=p),p&&c&&(t[i].defaultSelected=!0)}else{for(i=""+ye(i),r=null,p=0;p<t.length;p++){if(t[p].value===i){t[p].selected=!0,c&&(t[p].defaultSelected=!0);return}r!==null||t[p].disabled||(r=t[p])}r!==null&&(r.selected=!0)}}function be(t,r){if(r.dangerouslySetInnerHTML!=null)throw Error(a(91));return W({},r,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function Ae(t,r){var i=r.value;if(i==null){if(i=r.children,r=r.defaultValue,i!=null){if(r!=null)throw Error(a(92));if(me(i)){if(1<i.length)throw Error(a(93));i=i[0]}r=i}r==null&&(r=""),i=r}t._wrapperState={initialValue:ye(i)}}function Qe(t,r){var i=ye(r.value),c=ye(r.defaultValue);i!=null&&(i=""+i,i!==t.value&&(t.value=i),r.defaultValue==null&&t.defaultValue!==i&&(t.defaultValue=i)),c!=null&&(t.defaultValue=""+c)}function Ge(t){var r=t.textContent;r===t._wrapperState.initialValue&&r!==""&&r!==null&&(t.value=r)}function rt(t){switch(t){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 ht(t,r){return t==null||t==="http://www.w3.org/1999/xhtml"?rt(r):t==="http://www.w3.org/2000/svg"&&r==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var Qt,Pt=(function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(r,i,c,p){MSApp.execUnsafeLocalFunction(function(){return t(r,i,c,p)})}:t})(function(t,r){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=r;else{for(Qt=Qt||document.createElement("div"),Qt.innerHTML="<svg>"+r.valueOf().toString()+"</svg>",r=Qt.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;r.firstChild;)t.appendChild(r.firstChild)}});function Je(t,r){if(r){var i=t.firstChild;if(i&&i===t.lastChild&&i.nodeType===3){i.nodeValue=r;return}}t.textContent=r}var wn={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},ft=["Webkit","ms","Moz","O"];Object.keys(wn).forEach(function(t){ft.forEach(function(r){r=r+t.charAt(0).toUpperCase()+t.substring(1),wn[r]=wn[t]})});function Mn(t,r,i){return r==null||typeof r=="boolean"||r===""?"":i||typeof r!="number"||r===0||wn.hasOwnProperty(t)&&wn[t]?(""+r).trim():r+"px"}function Te(t,r){t=t.style;for(var i in r)if(r.hasOwnProperty(i)){var c=i.indexOf("--")===0,p=Mn(i,r[i],c);i==="float"&&(i="cssFloat"),c?t.setProperty(i,p):t[i]=p}}var Ze=W({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 ot(t,r){if(r){if(Ze[t]&&(r.children!=null||r.dangerouslySetInnerHTML!=null))throw Error(a(137,t));if(r.dangerouslySetInnerHTML!=null){if(r.children!=null)throw Error(a(60));if(typeof r.dangerouslySetInnerHTML!="object"||!("__html"in r.dangerouslySetInnerHTML))throw Error(a(61))}if(r.style!=null&&typeof r.style!="object")throw Error(a(62))}}function it(t,r){if(t.indexOf("-")===-1)return typeof r.is=="string";switch(t){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 Zt=null;function gt(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var xr=null,an=null,Vn=null;function Dr(t){if(t=si(t)){if(typeof xr!="function")throw Error(a(280));var r=t.stateNode;r&&(r=mo(r),xr(t.stateNode,t.type,r))}}function Ye(t){an?Vn?Vn.push(t):Vn=[t]:an=t}function Nt(){if(an){var t=an,r=Vn;if(Vn=an=null,Dr(t),r)for(t=0;t<r.length;t++)Dr(r[t])}}function Lt(t,r){return t(r)}function $t(){}var Fn=!1;function kt(t,r,i){if(Fn)return t(r,i);Fn=!0;try{return Lt(t,r,i)}finally{Fn=!1,(an!==null||Vn!==null)&&($t(),Nt())}}function At(t,r){var i=t.stateNode;if(i===null)return null;var c=mo(i);if(c===null)return null;i=c[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(t=t.type,c=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!c;break e;default:t=!1}if(t)return null;if(i&&typeof i!="function")throw Error(a(231,r,typeof i));return i}var yr=!1;if(f)try{var Ht={};Object.defineProperty(Ht,"passive",{get:function(){yr=!0}}),window.addEventListener("test",Ht,Ht),window.removeEventListener("test",Ht,Ht)}catch{yr=!1}function L(t,r,i,c,p,y,S,D,B){var ne=Array.prototype.slice.call(arguments,3);try{r.apply(i,ne)}catch(fe){this.onError(fe)}}var z=!1,J=null,le=!1,ce=null,Ie={onError:function(t){z=!0,J=t}};function De(t,r,i,c,p,y,S,D,B){z=!1,J=null,L.apply(Ie,arguments)}function Ke(t,r,i,c,p,y,S,D,B){if(De.apply(this,arguments),z){if(z){var ne=J;z=!1,J=null}else throw Error(a(198));le||(le=!0,ce=ne)}}function xe(t){var r=t,i=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,(r.flags&4098)!==0&&(i=r.return),t=r.return;while(t)}return r.tag===3?i:null}function _e(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function $e(t){if(xe(t)!==t)throw Error(a(188))}function Xe(t){var r=t.alternate;if(!r){if(r=xe(t),r===null)throw Error(a(188));return r!==t?null:t}for(var i=t,c=r;;){var p=i.return;if(p===null)break;var y=p.alternate;if(y===null){if(c=p.return,c!==null){i=c;continue}break}if(p.child===y.child){for(y=p.child;y;){if(y===i)return $e(p),t;if(y===c)return $e(p),r;y=y.sibling}throw Error(a(188))}if(i.return!==c.return)i=p,c=y;else{for(var S=!1,D=p.child;D;){if(D===i){S=!0,i=p,c=y;break}if(D===c){S=!0,c=p,i=y;break}D=D.sibling}if(!S){for(D=y.child;D;){if(D===i){S=!0,i=y,c=p;break}if(D===c){S=!0,c=y,i=p;break}D=D.sibling}if(!S)throw Error(a(189))}}if(i.alternate!==c)throw Error(a(190))}if(i.tag!==3)throw Error(a(188));return i.stateNode.current===i?t:r}function Le(t){return t=Xe(t),t!==null?tt(t):null}function tt(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var r=tt(t);if(r!==null)return r;t=t.sibling}return null}var ut=n.unstable_scheduleCallback,Ot=n.unstable_cancelCallback,St=n.unstable_shouldYield,pt=n.unstable_requestPaint,at=n.unstable_now,sn=n.unstable_getCurrentPriorityLevel,_r=n.unstable_ImmediatePriority,nr=n.unstable_UserBlockingPriority,rr=n.unstable_NormalPriority,vr=n.unstable_LowPriority,In=n.unstable_IdlePriority,Wr=null,Wt=null;function Xa(t){if(Wt&&typeof Wt.onCommitFiberRoot=="function")try{Wt.onCommitFiberRoot(Wr,t,void 0,(t.current.flags&128)===128)}catch{}}var on=Math.clz32?Math.clz32:ln,qa=Math.log,st=Math.LN2;function ln(t){return t>>>=0,t===0?32:31-(qa(t)/st|0)|0}var mn=64,kn=4194304;function Kr(t){switch(t&-t){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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Yr(t,r){var i=t.pendingLanes;if(i===0)return 0;var c=0,p=t.suspendedLanes,y=t.pingedLanes,S=i&268435455;if(S!==0){var D=S&~p;D!==0?c=Kr(D):(y&=S,y!==0&&(c=Kr(y)))}else S=i&~p,S!==0?c=Kr(S):y!==0&&(c=Kr(y));if(c===0)return 0;if(r!==0&&r!==c&&(r&p)===0&&(p=c&-c,y=r&-r,p>=y||p===16&&(y&4194240)!==0))return r;if((c&4)!==0&&(c|=i&16),r=t.entangledLanes,r!==0)for(t=t.entanglements,r&=c;0<r;)i=31-on(r),p=1<<i,c|=t[i],r&=~p;return c}function bt(t,r){switch(t){case 1:case 2:case 4:return r+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 r+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 Lr(t,r){for(var i=t.suspendedLanes,c=t.pingedLanes,p=t.expirationTimes,y=t.pendingLanes;0<y;){var S=31-on(y),D=1<<S,B=p[S];B===-1?((D&i)===0||(D&c)!==0)&&(p[S]=bt(D,r)):B<=r&&(t.expiredLanes|=D),y&=~D}}function Ja(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function Qi(){var t=mn;return mn<<=1,(mn&4194240)===0&&(mn=64),t}function ac(t){for(var r=[],i=0;31>i;i++)r.push(t);return r}function Us(t,r,i){t.pendingLanes|=r,r!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,r=31-on(r),t[r]=i}function zy(t,r){var i=t.pendingLanes&~r;t.pendingLanes=r,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=r,t.mutableReadLanes&=r,t.entangledLanes&=r,r=t.entanglements;var c=t.eventTimes;for(t=t.expirationTimes;0<i;){var p=31-on(i),y=1<<p;r[p]=0,c[p]=-1,t[p]=-1,i&=~y}}function sc(t,r){var i=t.entangledLanes|=r;for(t=t.entanglements;i;){var c=31-on(i),p=1<<c;p&r|t[c]&r&&(t[c]|=r),i&=~p}}var mt=0;function Kf(t){return t&=-t,1<t?4<t?(t&268435455)!==0?16:536870912:4:1}var Yf,ic,Gf,Xf,qf,oc=!1,Zi=[],Gr=null,Xr=null,qr=null,$s=new Map,Hs=new Map,Jr=[],Vy="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 Jf(t,r){switch(t){case"focusin":case"focusout":Gr=null;break;case"dragenter":case"dragleave":Xr=null;break;case"mouseover":case"mouseout":qr=null;break;case"pointerover":case"pointerout":$s.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Hs.delete(r.pointerId)}}function Ws(t,r,i,c,p,y){return t===null||t.nativeEvent!==y?(t={blockedOn:r,domEventName:i,eventSystemFlags:c,nativeEvent:y,targetContainers:[p]},r!==null&&(r=si(r),r!==null&&ic(r)),t):(t.eventSystemFlags|=c,r=t.targetContainers,p!==null&&r.indexOf(p)===-1&&r.push(p),t)}function Uy(t,r,i,c,p){switch(r){case"focusin":return Gr=Ws(Gr,t,r,i,c,p),!0;case"dragenter":return Xr=Ws(Xr,t,r,i,c,p),!0;case"mouseover":return qr=Ws(qr,t,r,i,c,p),!0;case"pointerover":var y=p.pointerId;return $s.set(y,Ws($s.get(y)||null,t,r,i,c,p)),!0;case"gotpointercapture":return y=p.pointerId,Hs.set(y,Ws(Hs.get(y)||null,t,r,i,c,p)),!0}return!1}function Qf(t){var r=ja(t.target);if(r!==null){var i=xe(r);if(i!==null){if(r=i.tag,r===13){if(r=_e(i),r!==null){t.blockedOn=r,qf(t.priority,function(){Gf(i)});return}}else if(r===3&&i.stateNode.current.memoizedState.isDehydrated){t.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}t.blockedOn=null}function eo(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var i=cc(t.domEventName,t.eventSystemFlags,r[0],t.nativeEvent);if(i===null){i=t.nativeEvent;var c=new i.constructor(i.type,i);Zt=c,i.target.dispatchEvent(c),Zt=null}else return r=si(i),r!==null&&ic(r),t.blockedOn=i,!1;r.shift()}return!0}function Zf(t,r,i){eo(t)&&i.delete(r)}function $y(){oc=!1,Gr!==null&&eo(Gr)&&(Gr=null),Xr!==null&&eo(Xr)&&(Xr=null),qr!==null&&eo(qr)&&(qr=null),$s.forEach(Zf),Hs.forEach(Zf)}function Ks(t,r){t.blockedOn===r&&(t.blockedOn=null,oc||(oc=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,$y)))}function Ys(t){function r(p){return Ks(p,t)}if(0<Zi.length){Ks(Zi[0],t);for(var i=1;i<Zi.length;i++){var c=Zi[i];c.blockedOn===t&&(c.blockedOn=null)}}for(Gr!==null&&Ks(Gr,t),Xr!==null&&Ks(Xr,t),qr!==null&&Ks(qr,t),$s.forEach(r),Hs.forEach(r),i=0;i<Jr.length;i++)c=Jr[i],c.blockedOn===t&&(c.blockedOn=null);for(;0<Jr.length&&(i=Jr[0],i.blockedOn===null);)Qf(i),i.blockedOn===null&&Jr.shift()}var Qa=V.ReactCurrentBatchConfig,to=!0;function Hy(t,r,i,c){var p=mt,y=Qa.transition;Qa.transition=null;try{mt=1,lc(t,r,i,c)}finally{mt=p,Qa.transition=y}}function Wy(t,r,i,c){var p=mt,y=Qa.transition;Qa.transition=null;try{mt=4,lc(t,r,i,c)}finally{mt=p,Qa.transition=y}}function lc(t,r,i,c){if(to){var p=cc(t,r,i,c);if(p===null)Ec(t,r,c,no,i),Jf(t,c);else if(Uy(p,t,r,i,c))c.stopPropagation();else if(Jf(t,c),r&4&&-1<Vy.indexOf(t)){for(;p!==null;){var y=si(p);if(y!==null&&Yf(y),y=cc(t,r,i,c),y===null&&Ec(t,r,c,no,i),y===p)break;p=y}p!==null&&c.stopPropagation()}else Ec(t,r,c,null,i)}}var no=null;function cc(t,r,i,c){if(no=null,t=gt(c),t=ja(t),t!==null)if(r=xe(t),r===null)t=null;else if(i=r.tag,i===13){if(t=_e(r),t!==null)return t;t=null}else if(i===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;t=null}else r!==t&&(t=null);return no=t,null}function eh(t){switch(t){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(sn()){case _r:return 1;case nr:return 4;case rr:case vr:return 16;case In:return 536870912;default:return 16}default:return 16}}var Qr=null,uc=null,ro=null;function th(){if(ro)return ro;var t,r=uc,i=r.length,c,p="value"in Qr?Qr.value:Qr.textContent,y=p.length;for(t=0;t<i&&r[t]===p[t];t++);var S=i-t;for(c=1;c<=S&&r[i-c]===p[y-c];c++);return ro=p.slice(t,1<c?1-c:void 0)}function ao(t){var r=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&r===13&&(t=13)):t=r,t===10&&(t=13),32<=t||t===13?t:0}function so(){return!0}function nh(){return!1}function Dn(t){function r(i,c,p,y,S){this._reactName=i,this._targetInst=p,this.type=c,this.nativeEvent=y,this.target=S,this.currentTarget=null;for(var D in t)t.hasOwnProperty(D)&&(i=t[D],this[D]=i?i(y):y[D]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?so:nh,this.isPropagationStopped=nh,this}return W(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=so)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=so)},persist:function(){},isPersistent:so}),r}var Za={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},dc=Dn(Za),Gs=W({},Za,{view:0,detail:0}),Ky=Dn(Gs),fc,hc,Xs,io=W({},Gs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:mc,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Xs&&(Xs&&t.type==="mousemove"?(fc=t.screenX-Xs.screenX,hc=t.screenY-Xs.screenY):hc=fc=0,Xs=t),fc)},movementY:function(t){return"movementY"in t?t.movementY:hc}}),rh=Dn(io),Yy=W({},io,{dataTransfer:0}),Gy=Dn(Yy),Xy=W({},Gs,{relatedTarget:0}),pc=Dn(Xy),qy=W({},Za,{animationName:0,elapsedTime:0,pseudoElement:0}),Jy=Dn(qy),Qy=W({},Za,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Zy=Dn(Qy),e2=W({},Za,{data:0}),ah=Dn(e2),t2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},n2={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"},r2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function a2(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=r2[t])?!!r[t]:!1}function mc(){return a2}var s2=W({},Gs,{key:function(t){if(t.key){var r=t2[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=ao(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?n2[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:mc,charCode:function(t){return t.type==="keypress"?ao(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?ao(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),i2=Dn(s2),o2=W({},io,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),sh=Dn(o2),l2=W({},Gs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:mc}),c2=Dn(l2),u2=W({},Za,{propertyName:0,elapsedTime:0,pseudoElement:0}),d2=Dn(u2),f2=W({},io,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),h2=Dn(f2),p2=[9,13,27,32],gc=f&&"CompositionEvent"in window,qs=null;f&&"documentMode"in document&&(qs=document.documentMode);var m2=f&&"TextEvent"in window&&!qs,ih=f&&(!gc||qs&&8<qs&&11>=qs),oh=" ",lh=!1;function ch(t,r){switch(t){case"keyup":return p2.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function uh(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var es=!1;function g2(t,r){switch(t){case"compositionend":return uh(r);case"keypress":return r.which!==32?null:(lh=!0,oh);case"textInput":return t=r.data,t===oh&&lh?null:t;default:return null}}function x2(t,r){if(es)return t==="compositionend"||!gc&&ch(t,r)?(t=th(),ro=uc=Qr=null,es=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return ih&&r.locale!=="ko"?null:r.data;default:return null}}var y2={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 dh(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!y2[t.type]:r==="textarea"}function fh(t,r,i,c){Ye(c),r=fo(r,"onChange"),0<r.length&&(i=new dc("onChange","change",null,i,c),t.push({event:i,listeners:r}))}var Js=null,Qs=null;function v2(t){Rh(t,0)}function oo(t){var r=ss(t);if(Ue(r))return t}function b2(t,r){if(t==="change")return r}var hh=!1;if(f){var xc;if(f){var yc="oninput"in document;if(!yc){var ph=document.createElement("div");ph.setAttribute("oninput","return;"),yc=typeof ph.oninput=="function"}xc=yc}else xc=!1;hh=xc&&(!document.documentMode||9<document.documentMode)}function mh(){Js&&(Js.detachEvent("onpropertychange",gh),Qs=Js=null)}function gh(t){if(t.propertyName==="value"&&oo(Qs)){var r=[];fh(r,Qs,t,gt(t)),kt(v2,r)}}function w2(t,r,i){t==="focusin"?(mh(),Js=r,Qs=i,Js.attachEvent("onpropertychange",gh)):t==="focusout"&&mh()}function k2(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return oo(Qs)}function S2(t,r){if(t==="click")return oo(r)}function C2(t,r){if(t==="input"||t==="change")return oo(r)}function j2(t,r){return t===r&&(t!==0||1/t===1/r)||t!==t&&r!==r}var ar=typeof Object.is=="function"?Object.is:j2;function Zs(t,r){if(ar(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;var i=Object.keys(t),c=Object.keys(r);if(i.length!==c.length)return!1;for(c=0;c<i.length;c++){var p=i[c];if(!g.call(r,p)||!ar(t[p],r[p]))return!1}return!0}function xh(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function yh(t,r){var i=xh(t);t=0;for(var c;i;){if(i.nodeType===3){if(c=t+i.textContent.length,t<=r&&c>=r)return{node:i,offset:r-t};t=c}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=xh(i)}}function vh(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?vh(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function bh(){for(var t=window,r=Oe();r instanceof t.HTMLIFrameElement;){try{var i=typeof r.contentWindow.location.href=="string"}catch{i=!1}if(i)t=r.contentWindow;else break;r=Oe(t.document)}return r}function vc(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}function E2(t){var r=bh(),i=t.focusedElem,c=t.selectionRange;if(r!==i&&i&&i.ownerDocument&&vh(i.ownerDocument.documentElement,i)){if(c!==null&&vc(i)){if(r=c.start,t=c.end,t===void 0&&(t=r),"selectionStart"in i)i.selectionStart=r,i.selectionEnd=Math.min(t,i.value.length);else if(t=(r=i.ownerDocument||document)&&r.defaultView||window,t.getSelection){t=t.getSelection();var p=i.textContent.length,y=Math.min(c.start,p);c=c.end===void 0?y:Math.min(c.end,p),!t.extend&&y>c&&(p=c,c=y,y=p),p=yh(i,y);var S=yh(i,c);p&&S&&(t.rangeCount!==1||t.anchorNode!==p.node||t.anchorOffset!==p.offset||t.focusNode!==S.node||t.focusOffset!==S.offset)&&(r=r.createRange(),r.setStart(p.node,p.offset),t.removeAllRanges(),y>c?(t.addRange(r),t.extend(S.node,S.offset)):(r.setEnd(S.node,S.offset),t.addRange(r)))}}for(r=[],t=i;t=t.parentNode;)t.nodeType===1&&r.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;i<r.length;i++)t=r[i],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var N2=f&&"documentMode"in document&&11>=document.documentMode,ts=null,bc=null,ei=null,wc=!1;function wh(t,r,i){var c=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;wc||ts==null||ts!==Oe(c)||(c=ts,"selectionStart"in c&&vc(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),ei&&Zs(ei,c)||(ei=c,c=fo(bc,"onSelect"),0<c.length&&(r=new dc("onSelect","select",null,r,i),t.push({event:r,listeners:c}),r.target=ts)))}function lo(t,r){var i={};return i[t.toLowerCase()]=r.toLowerCase(),i["Webkit"+t]="webkit"+r,i["Moz"+t]="moz"+r,i}var ns={animationend:lo("Animation","AnimationEnd"),animationiteration:lo("Animation","AnimationIteration"),animationstart:lo("Animation","AnimationStart"),transitionend:lo("Transition","TransitionEnd")},kc={},kh={};f&&(kh=document.createElement("div").style,"AnimationEvent"in window||(delete ns.animationend.animation,delete ns.animationiteration.animation,delete ns.animationstart.animation),"TransitionEvent"in window||delete ns.transitionend.transition);function co(t){if(kc[t])return kc[t];if(!ns[t])return t;var r=ns[t],i;for(i in r)if(r.hasOwnProperty(i)&&i in kh)return kc[t]=r[i];return t}var Sh=co("animationend"),Ch=co("animationiteration"),jh=co("animationstart"),Eh=co("transitionend"),Nh=new Map,Th="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 Zr(t,r){Nh.set(t,r),l(r,[t])}for(var Sc=0;Sc<Th.length;Sc++){var Cc=Th[Sc],T2=Cc.toLowerCase(),P2=Cc[0].toUpperCase()+Cc.slice(1);Zr(T2,"on"+P2)}Zr(Sh,"onAnimationEnd"),Zr(Ch,"onAnimationIteration"),Zr(jh,"onAnimationStart"),Zr("dblclick","onDoubleClick"),Zr("focusin","onFocus"),Zr("focusout","onBlur"),Zr(Eh,"onTransitionEnd"),d("onMouseEnter",["mouseout","mouseover"]),d("onMouseLeave",["mouseout","mouseover"]),d("onPointerEnter",["pointerout","pointerover"]),d("onPointerLeave",["pointerout","pointerover"]),l("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),l("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),l("onBeforeInput",["compositionend","keypress","textInput","paste"]),l("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ti="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(" "),R2=new Set("cancel close invalid load scroll toggle".split(" ").concat(ti));function Ph(t,r,i){var c=t.type||"unknown-event";t.currentTarget=i,Ke(c,r,void 0,t),t.currentTarget=null}function Rh(t,r){r=(r&4)!==0;for(var i=0;i<t.length;i++){var c=t[i],p=c.event;c=c.listeners;e:{var y=void 0;if(r)for(var S=c.length-1;0<=S;S--){var D=c[S],B=D.instance,ne=D.currentTarget;if(D=D.listener,B!==y&&p.isPropagationStopped())break e;Ph(p,D,ne),y=B}else for(S=0;S<c.length;S++){if(D=c[S],B=D.instance,ne=D.currentTarget,D=D.listener,B!==y&&p.isPropagationStopped())break e;Ph(p,D,ne),y=B}}}if(le)throw t=ce,le=!1,ce=null,t}function Ct(t,r){var i=r[Fc];i===void 0&&(i=r[Fc]=new Set);var c=t+"__bubble";i.has(c)||(Mh(r,t,2,!1),i.add(c))}function jc(t,r,i){var c=0;r&&(c|=4),Mh(i,t,c,r)}var uo="_reactListening"+Math.random().toString(36).slice(2);function ni(t){if(!t[uo]){t[uo]=!0,s.forEach(function(i){i!=="selectionchange"&&(R2.has(i)||jc(i,!1,t),jc(i,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[uo]||(r[uo]=!0,jc("selectionchange",!1,r))}}function Mh(t,r,i,c){switch(eh(r)){case 1:var p=Hy;break;case 4:p=Wy;break;default:p=lc}i=p.bind(null,r,i,t),p=void 0,!yr||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(p=!0),c?p!==void 0?t.addEventListener(r,i,{capture:!0,passive:p}):t.addEventListener(r,i,!0):p!==void 0?t.addEventListener(r,i,{passive:p}):t.addEventListener(r,i,!1)}function Ec(t,r,i,c,p){var y=c;if((r&1)===0&&(r&2)===0&&c!==null)e:for(;;){if(c===null)return;var S=c.tag;if(S===3||S===4){var D=c.stateNode.containerInfo;if(D===p||D.nodeType===8&&D.parentNode===p)break;if(S===4)for(S=c.return;S!==null;){var B=S.tag;if((B===3||B===4)&&(B=S.stateNode.containerInfo,B===p||B.nodeType===8&&B.parentNode===p))return;S=S.return}for(;D!==null;){if(S=ja(D),S===null)return;if(B=S.tag,B===5||B===6){c=y=S;continue e}D=D.parentNode}}c=c.return}kt(function(){var ne=y,fe=gt(i),he=[];e:{var de=Nh.get(t);if(de!==void 0){var ke=dc,Ee=t;switch(t){case"keypress":if(ao(i)===0)break e;case"keydown":case"keyup":ke=i2;break;case"focusin":Ee="focus",ke=pc;break;case"focusout":Ee="blur",ke=pc;break;case"beforeblur":case"afterblur":ke=pc;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ke=rh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ke=Gy;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ke=c2;break;case Sh:case Ch:case jh:ke=Jy;break;case Eh:ke=d2;break;case"scroll":ke=Ky;break;case"wheel":ke=h2;break;case"copy":case"cut":case"paste":ke=Zy;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ke=sh}var Pe=(r&4)!==0,Bt=!Pe&&t==="scroll",Q=Pe?de!==null?de+"Capture":null:de;Pe=[];for(var $=ne,Z;$!==null;){Z=$;var pe=Z.stateNode;if(Z.tag===5&&pe!==null&&(Z=pe,Q!==null&&(pe=At($,Q),pe!=null&&Pe.push(ri($,pe,Z)))),Bt)break;$=$.return}0<Pe.length&&(de=new ke(de,Ee,null,i,fe),he.push({event:de,listeners:Pe}))}}if((r&7)===0){e:{if(de=t==="mouseover"||t==="pointerover",ke=t==="mouseout"||t==="pointerout",de&&i!==Zt&&(Ee=i.relatedTarget||i.fromElement)&&(ja(Ee)||Ee[Ar]))break e;if((ke||de)&&(de=fe.window===fe?fe:(de=fe.ownerDocument)?de.defaultView||de.parentWindow:window,ke?(Ee=i.relatedTarget||i.toElement,ke=ne,Ee=Ee?ja(Ee):null,Ee!==null&&(Bt=xe(Ee),Ee!==Bt||Ee.tag!==5&&Ee.tag!==6)&&(Ee=null)):(ke=null,Ee=ne),ke!==Ee)){if(Pe=rh,pe="onMouseLeave",Q="onMouseEnter",$="mouse",(t==="pointerout"||t==="pointerover")&&(Pe=sh,pe="onPointerLeave",Q="onPointerEnter",$="pointer"),Bt=ke==null?de:ss(ke),Z=Ee==null?de:ss(Ee),de=new Pe(pe,$+"leave",ke,i,fe),de.target=Bt,de.relatedTarget=Z,pe=null,ja(fe)===ne&&(Pe=new Pe(Q,$+"enter",Ee,i,fe),Pe.target=Z,Pe.relatedTarget=Bt,pe=Pe),Bt=pe,ke&&Ee)t:{for(Pe=ke,Q=Ee,$=0,Z=Pe;Z;Z=rs(Z))$++;for(Z=0,pe=Q;pe;pe=rs(pe))Z++;for(;0<$-Z;)Pe=rs(Pe),$--;for(;0<Z-$;)Q=rs(Q),Z--;for(;$--;){if(Pe===Q||Q!==null&&Pe===Q.alternate)break t;Pe=rs(Pe),Q=rs(Q)}Pe=null}else Pe=null;ke!==null&&Fh(he,de,ke,Pe,!1),Ee!==null&&Bt!==null&&Fh(he,Bt,Ee,Pe,!0)}}e:{if(de=ne?ss(ne):window,ke=de.nodeName&&de.nodeName.toLowerCase(),ke==="select"||ke==="input"&&de.type==="file")var Me=b2;else if(dh(de))if(hh)Me=C2;else{Me=k2;var Be=w2}else(ke=de.nodeName)&&ke.toLowerCase()==="input"&&(de.type==="checkbox"||de.type==="radio")&&(Me=S2);if(Me&&(Me=Me(t,ne))){fh(he,Me,i,fe);break e}Be&&Be(t,de,ne),t==="focusout"&&(Be=de._wrapperState)&&Be.controlled&&de.type==="number"&&we(de,"number",de.value)}switch(Be=ne?ss(ne):window,t){case"focusin":(dh(Be)||Be.contentEditable==="true")&&(ts=Be,bc=ne,ei=null);break;case"focusout":ei=bc=ts=null;break;case"mousedown":wc=!0;break;case"contextmenu":case"mouseup":case"dragend":wc=!1,wh(he,i,fe);break;case"selectionchange":if(N2)break;case"keydown":case"keyup":wh(he,i,fe)}var ze;if(gc)e:{switch(t){case"compositionstart":var He="onCompositionStart";break e;case"compositionend":He="onCompositionEnd";break e;case"compositionupdate":He="onCompositionUpdate";break e}He=void 0}else es?ch(t,i)&&(He="onCompositionEnd"):t==="keydown"&&i.keyCode===229&&(He="onCompositionStart");He&&(ih&&i.locale!=="ko"&&(es||He!=="onCompositionStart"?He==="onCompositionEnd"&&es&&(ze=th()):(Qr=fe,uc="value"in Qr?Qr.value:Qr.textContent,es=!0)),Be=fo(ne,He),0<Be.length&&(He=new ah(He,t,null,i,fe),he.push({event:He,listeners:Be}),ze?He.data=ze:(ze=uh(i),ze!==null&&(He.data=ze)))),(ze=m2?g2(t,i):x2(t,i))&&(ne=fo(ne,"onBeforeInput"),0<ne.length&&(fe=new ah("onBeforeInput","beforeinput",null,i,fe),he.push({event:fe,listeners:ne}),fe.data=ze))}Rh(he,r)})}function ri(t,r,i){return{instance:t,listener:r,currentTarget:i}}function fo(t,r){for(var i=r+"Capture",c=[];t!==null;){var p=t,y=p.stateNode;p.tag===5&&y!==null&&(p=y,y=At(t,i),y!=null&&c.unshift(ri(t,y,p)),y=At(t,r),y!=null&&c.push(ri(t,y,p))),t=t.return}return c}function rs(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function Fh(t,r,i,c,p){for(var y=r._reactName,S=[];i!==null&&i!==c;){var D=i,B=D.alternate,ne=D.stateNode;if(B!==null&&B===c)break;D.tag===5&&ne!==null&&(D=ne,p?(B=At(i,y),B!=null&&S.unshift(ri(i,B,D))):p||(B=At(i,y),B!=null&&S.push(ri(i,B,D)))),i=i.return}S.length!==0&&t.push({event:r,listeners:S})}var M2=/\r\n?/g,F2=/\u0000|\uFFFD/g;function Ih(t){return(typeof t=="string"?t:""+t).replace(M2,`
`).replace(F2,"")}function ho(t,r,i){if(r=Ih(r),Ih(t)!==r&&i)throw Error(a(425))}function po(){}var Nc=null,Tc=null;function Pc(t,r){return t==="textarea"||t==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var Rc=typeof setTimeout=="function"?setTimeout:void 0,I2=typeof clearTimeout=="function"?clearTimeout:void 0,Dh=typeof Promise=="function"?Promise:void 0,D2=typeof queueMicrotask=="function"?queueMicrotask:typeof Dh<"u"?function(t){return Dh.resolve(null).then(t).catch(_2)}:Rc;function _2(t){setTimeout(function(){throw t})}function Mc(t,r){var i=r,c=0;do{var p=i.nextSibling;if(t.removeChild(i),p&&p.nodeType===8)if(i=p.data,i==="/$"){if(c===0){t.removeChild(p),Ys(r);return}c--}else i!=="$"&&i!=="$?"&&i!=="$!"||c++;i=p}while(i);Ys(r)}function ea(t){for(;t!=null;t=t.nextSibling){var r=t.nodeType;if(r===1||r===3)break;if(r===8){if(r=t.data,r==="$"||r==="$!"||r==="$?")break;if(r==="/$")return null}}return t}function _h(t){t=t.previousSibling;for(var r=0;t;){if(t.nodeType===8){var i=t.data;if(i==="$"||i==="$!"||i==="$?"){if(r===0)return t;r--}else i==="/$"&&r++}t=t.previousSibling}return null}var as=Math.random().toString(36).slice(2),br="__reactFiber$"+as,ai="__reactProps$"+as,Ar="__reactContainer$"+as,Fc="__reactEvents$"+as,L2="__reactListeners$"+as,A2="__reactHandles$"+as;function ja(t){var r=t[br];if(r)return r;for(var i=t.parentNode;i;){if(r=i[Ar]||i[br]){if(i=r.alternate,r.child!==null||i!==null&&i.child!==null)for(t=_h(t);t!==null;){if(i=t[br])return i;t=_h(t)}return r}t=i,i=t.parentNode}return null}function si(t){return t=t[br]||t[Ar],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function ss(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(a(33))}function mo(t){return t[ai]||null}var Ic=[],is=-1;function ta(t){return{current:t}}function jt(t){0>is||(t.current=Ic[is],Ic[is]=null,is--)}function wt(t,r){is++,Ic[is]=t.current,t.current=r}var na={},cn=ta(na),Sn=ta(!1),Ea=na;function os(t,r){var i=t.type.contextTypes;if(!i)return na;var c=t.stateNode;if(c&&c.__reactInternalMemoizedUnmaskedChildContext===r)return c.__reactInternalMemoizedMaskedChildContext;var p={},y;for(y in i)p[y]=r[y];return c&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=r,t.__reactInternalMemoizedMaskedChildContext=p),p}function Cn(t){return t=t.childContextTypes,t!=null}function go(){jt(Sn),jt(cn)}function Lh(t,r,i){if(cn.current!==na)throw Error(a(168));wt(cn,r),wt(Sn,i)}function Ah(t,r,i){var c=t.stateNode;if(r=r.childContextTypes,typeof c.getChildContext!="function")return i;c=c.getChildContext();for(var p in c)if(!(p in r))throw Error(a(108,ue(t)||"Unknown",p));return W({},i,c)}function xo(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||na,Ea=cn.current,wt(cn,t),wt(Sn,Sn.current),!0}function Oh(t,r,i){var c=t.stateNode;if(!c)throw Error(a(169));i?(t=Ah(t,r,Ea),c.__reactInternalMemoizedMergedChildContext=t,jt(Sn),jt(cn),wt(cn,t)):jt(Sn),wt(Sn,i)}var Or=null,yo=!1,Dc=!1;function Bh(t){Or===null?Or=[t]:Or.push(t)}function O2(t){yo=!0,Bh(t)}function ra(){if(!Dc&&Or!==null){Dc=!0;var t=0,r=mt;try{var i=Or;for(mt=1;t<i.length;t++){var c=i[t];do c=c(!0);while(c!==null)}Or=null,yo=!1}catch(p){throw Or!==null&&(Or=Or.slice(t+1)),ut(_r,ra),p}finally{mt=r,Dc=!1}}return null}var ls=[],cs=0,vo=null,bo=0,Un=[],$n=0,Na=null,Br=1,zr="";function Ta(t,r){ls[cs++]=bo,ls[cs++]=vo,vo=t,bo=r}function zh(t,r,i){Un[$n++]=Br,Un[$n++]=zr,Un[$n++]=Na,Na=t;var c=Br;t=zr;var p=32-on(c)-1;c&=~(1<<p),i+=1;var y=32-on(r)+p;if(30<y){var S=p-p%5;y=(c&(1<<S)-1).toString(32),c>>=S,p-=S,Br=1<<32-on(r)+p|i<<p|c,zr=y+t}else Br=1<<y|i<<p|c,zr=t}function _c(t){t.return!==null&&(Ta(t,1),zh(t,1,0))}function Lc(t){for(;t===vo;)vo=ls[--cs],ls[cs]=null,bo=ls[--cs],ls[cs]=null;for(;t===Na;)Na=Un[--$n],Un[$n]=null,zr=Un[--$n],Un[$n]=null,Br=Un[--$n],Un[$n]=null}var _n=null,Ln=null,Tt=!1,sr=null;function Vh(t,r){var i=Yn(5,null,null,0);i.elementType="DELETED",i.stateNode=r,i.return=t,r=t.deletions,r===null?(t.deletions=[i],t.flags|=16):r.push(i)}function Uh(t,r){switch(t.tag){case 5:var i=t.type;return r=r.nodeType!==1||i.toLowerCase()!==r.nodeName.toLowerCase()?null:r,r!==null?(t.stateNode=r,_n=t,Ln=ea(r.firstChild),!0):!1;case 6:return r=t.pendingProps===""||r.nodeType!==3?null:r,r!==null?(t.stateNode=r,_n=t,Ln=null,!0):!1;case 13:return r=r.nodeType!==8?null:r,r!==null?(i=Na!==null?{id:Br,overflow:zr}:null,t.memoizedState={dehydrated:r,treeContext:i,retryLane:1073741824},i=Yn(18,null,null,0),i.stateNode=r,i.return=t,t.child=i,_n=t,Ln=null,!0):!1;default:return!1}}function Ac(t){return(t.mode&1)!==0&&(t.flags&128)===0}function Oc(t){if(Tt){var r=Ln;if(r){var i=r;if(!Uh(t,r)){if(Ac(t))throw Error(a(418));r=ea(i.nextSibling);var c=_n;r&&Uh(t,r)?Vh(c,i):(t.flags=t.flags&-4097|2,Tt=!1,_n=t)}}else{if(Ac(t))throw Error(a(418));t.flags=t.flags&-4097|2,Tt=!1,_n=t}}}function $h(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;_n=t}function wo(t){if(t!==_n)return!1;if(!Tt)return $h(t),Tt=!0,!1;var r;if((r=t.tag!==3)&&!(r=t.tag!==5)&&(r=t.type,r=r!=="head"&&r!=="body"&&!Pc(t.type,t.memoizedProps)),r&&(r=Ln)){if(Ac(t))throw Hh(),Error(a(418));for(;r;)Vh(t,r),r=ea(r.nextSibling)}if($h(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));e:{for(t=t.nextSibling,r=0;t;){if(t.nodeType===8){var i=t.data;if(i==="/$"){if(r===0){Ln=ea(t.nextSibling);break e}r--}else i!=="$"&&i!=="$!"&&i!=="$?"||r++}t=t.nextSibling}Ln=null}}else Ln=_n?ea(t.stateNode.nextSibling):null;return!0}function Hh(){for(var t=Ln;t;)t=ea(t.nextSibling)}function us(){Ln=_n=null,Tt=!1}function Bc(t){sr===null?sr=[t]:sr.push(t)}var B2=V.ReactCurrentBatchConfig;function ii(t,r,i){if(t=i.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(i._owner){if(i=i._owner,i){if(i.tag!==1)throw Error(a(309));var c=i.stateNode}if(!c)throw Error(a(147,t));var p=c,y=""+t;return r!==null&&r.ref!==null&&typeof r.ref=="function"&&r.ref._stringRef===y?r.ref:(r=function(S){var D=p.refs;S===null?delete D[y]:D[y]=S},r._stringRef=y,r)}if(typeof t!="string")throw Error(a(284));if(!i._owner)throw Error(a(290,t))}return t}function ko(t,r){throw t=Object.prototype.toString.call(r),Error(a(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t))}function Wh(t){var r=t._init;return r(t._payload)}function Kh(t){function r(Q,$){if(t){var Z=Q.deletions;Z===null?(Q.deletions=[$],Q.flags|=16):Z.push($)}}function i(Q,$){if(!t)return null;for(;$!==null;)r(Q,$),$=$.sibling;return null}function c(Q,$){for(Q=new Map;$!==null;)$.key!==null?Q.set($.key,$):Q.set($.index,$),$=$.sibling;return Q}function p(Q,$){return Q=da(Q,$),Q.index=0,Q.sibling=null,Q}function y(Q,$,Z){return Q.index=Z,t?(Z=Q.alternate,Z!==null?(Z=Z.index,Z<$?(Q.flags|=2,$):Z):(Q.flags|=2,$)):(Q.flags|=1048576,$)}function S(Q){return t&&Q.alternate===null&&(Q.flags|=2),Q}function D(Q,$,Z,pe){return $===null||$.tag!==6?($=Ru(Z,Q.mode,pe),$.return=Q,$):($=p($,Z),$.return=Q,$)}function B(Q,$,Z,pe){var Me=Z.type;return Me===O?fe(Q,$,Z.props.children,pe,Z.key):$!==null&&($.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===q&&Wh(Me)===$.type)?(pe=p($,Z.props),pe.ref=ii(Q,$,Z),pe.return=Q,pe):(pe=Ko(Z.type,Z.key,Z.props,null,Q.mode,pe),pe.ref=ii(Q,$,Z),pe.return=Q,pe)}function ne(Q,$,Z,pe){return $===null||$.tag!==4||$.stateNode.containerInfo!==Z.containerInfo||$.stateNode.implementation!==Z.implementation?($=Mu(Z,Q.mode,pe),$.return=Q,$):($=p($,Z.children||[]),$.return=Q,$)}function fe(Q,$,Z,pe,Me){return $===null||$.tag!==7?($=La(Z,Q.mode,pe,Me),$.return=Q,$):($=p($,Z),$.return=Q,$)}function he(Q,$,Z){if(typeof $=="string"&&$!==""||typeof $=="number")return $=Ru(""+$,Q.mode,Z),$.return=Q,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case H:return Z=Ko($.type,$.key,$.props,null,Q.mode,Z),Z.ref=ii(Q,null,$),Z.return=Q,Z;case re:return $=Mu($,Q.mode,Z),$.return=Q,$;case q:var pe=$._init;return he(Q,pe($._payload),Z)}if(me($)||U($))return $=La($,Q.mode,Z,null),$.return=Q,$;ko(Q,$)}return null}function de(Q,$,Z,pe){var Me=$!==null?$.key:null;if(typeof Z=="string"&&Z!==""||typeof Z=="number")return Me!==null?null:D(Q,$,""+Z,pe);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case H:return Z.key===Me?B(Q,$,Z,pe):null;case re:return Z.key===Me?ne(Q,$,Z,pe):null;case q:return Me=Z._init,de(Q,$,Me(Z._payload),pe)}if(me(Z)||U(Z))return Me!==null?null:fe(Q,$,Z,pe,null);ko(Q,Z)}return null}function ke(Q,$,Z,pe,Me){if(typeof pe=="string"&&pe!==""||typeof pe=="number")return Q=Q.get(Z)||null,D($,Q,""+pe,Me);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case H:return Q=Q.get(pe.key===null?Z:pe.key)||null,B($,Q,pe,Me);case re:return Q=Q.get(pe.key===null?Z:pe.key)||null,ne($,Q,pe,Me);case q:var Be=pe._init;return ke(Q,$,Z,Be(pe._payload),Me)}if(me(pe)||U(pe))return Q=Q.get(Z)||null,fe($,Q,pe,Me,null);ko($,pe)}return null}function Ee(Q,$,Z,pe){for(var Me=null,Be=null,ze=$,He=$=0,Jt=null;ze!==null&&He<Z.length;He++){ze.index>He?(Jt=ze,ze=null):Jt=ze.sibling;var ct=de(Q,ze,Z[He],pe);if(ct===null){ze===null&&(ze=Jt);break}t&&ze&&ct.alternate===null&&r(Q,ze),$=y(ct,$,He),Be===null?Me=ct:Be.sibling=ct,Be=ct,ze=Jt}if(He===Z.length)return i(Q,ze),Tt&&Ta(Q,He),Me;if(ze===null){for(;He<Z.length;He++)ze=he(Q,Z[He],pe),ze!==null&&($=y(ze,$,He),Be===null?Me=ze:Be.sibling=ze,Be=ze);return Tt&&Ta(Q,He),Me}for(ze=c(Q,ze);He<Z.length;He++)Jt=ke(ze,Q,He,Z[He],pe),Jt!==null&&(t&&Jt.alternate!==null&&ze.delete(Jt.key===null?He:Jt.key),$=y(Jt,$,He),Be===null?Me=Jt:Be.sibling=Jt,Be=Jt);return t&&ze.forEach(function(fa){return r(Q,fa)}),Tt&&Ta(Q,He),Me}function Pe(Q,$,Z,pe){var Me=U(Z);if(typeof Me!="function")throw Error(a(150));if(Z=Me.call(Z),Z==null)throw Error(a(151));for(var Be=Me=null,ze=$,He=$=0,Jt=null,ct=Z.next();ze!==null&&!ct.done;He++,ct=Z.next()){ze.index>He?(Jt=ze,ze=null):Jt=ze.sibling;var fa=de(Q,ze,ct.value,pe);if(fa===null){ze===null&&(ze=Jt);break}t&&ze&&fa.alternate===null&&r(Q,ze),$=y(fa,$,He),Be===null?Me=fa:Be.sibling=fa,Be=fa,ze=Jt}if(ct.done)return i(Q,ze),Tt&&Ta(Q,He),Me;if(ze===null){for(;!ct.done;He++,ct=Z.next())ct=he(Q,ct.value,pe),ct!==null&&($=y(ct,$,He),Be===null?Me=ct:Be.sibling=ct,Be=ct);return Tt&&Ta(Q,He),Me}for(ze=c(Q,ze);!ct.done;He++,ct=Z.next())ct=ke(ze,Q,He,ct.value,pe),ct!==null&&(t&&ct.alternate!==null&&ze.delete(ct.key===null?He:ct.key),$=y(ct,$,He),Be===null?Me=ct:Be.sibling=ct,Be=ct);return t&&ze.forEach(function(yv){return r(Q,yv)}),Tt&&Ta(Q,He),Me}function Bt(Q,$,Z,pe){if(typeof Z=="object"&&Z!==null&&Z.type===O&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case H:e:{for(var Me=Z.key,Be=$;Be!==null;){if(Be.key===Me){if(Me=Z.type,Me===O){if(Be.tag===7){i(Q,Be.sibling),$=p(Be,Z.props.children),$.return=Q,Q=$;break e}}else if(Be.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===q&&Wh(Me)===Be.type){i(Q,Be.sibling),$=p(Be,Z.props),$.ref=ii(Q,Be,Z),$.return=Q,Q=$;break e}i(Q,Be);break}else r(Q,Be);Be=Be.sibling}Z.type===O?($=La(Z.props.children,Q.mode,pe,Z.key),$.return=Q,Q=$):(pe=Ko(Z.type,Z.key,Z.props,null,Q.mode,pe),pe.ref=ii(Q,$,Z),pe.return=Q,Q=pe)}return S(Q);case re:e:{for(Be=Z.key;$!==null;){if($.key===Be)if($.tag===4&&$.stateNode.containerInfo===Z.containerInfo&&$.stateNode.implementation===Z.implementation){i(Q,$.sibling),$=p($,Z.children||[]),$.return=Q,Q=$;break e}else{i(Q,$);break}else r(Q,$);$=$.sibling}$=Mu(Z,Q.mode,pe),$.return=Q,Q=$}return S(Q);case q:return Be=Z._init,Bt(Q,$,Be(Z._payload),pe)}if(me(Z))return Ee(Q,$,Z,pe);if(U(Z))return Pe(Q,$,Z,pe);ko(Q,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"?(Z=""+Z,$!==null&&$.tag===6?(i(Q,$.sibling),$=p($,Z),$.return=Q,Q=$):(i(Q,$),$=Ru(Z,Q.mode,pe),$.return=Q,Q=$),S(Q)):i(Q,$)}return Bt}var ds=Kh(!0),Yh=Kh(!1),So=ta(null),Co=null,fs=null,zc=null;function Vc(){zc=fs=Co=null}function Uc(t){var r=So.current;jt(So),t._currentValue=r}function $c(t,r,i){for(;t!==null;){var c=t.alternate;if((t.childLanes&r)!==r?(t.childLanes|=r,c!==null&&(c.childLanes|=r)):c!==null&&(c.childLanes&r)!==r&&(c.childLanes|=r),t===i)break;t=t.return}}function hs(t,r){Co=t,zc=fs=null,t=t.dependencies,t!==null&&t.firstContext!==null&&((t.lanes&r)!==0&&(jn=!0),t.firstContext=null)}function Hn(t){var r=t._currentValue;if(zc!==t)if(t={context:t,memoizedValue:r,next:null},fs===null){if(Co===null)throw Error(a(308));fs=t,Co.dependencies={lanes:0,firstContext:t}}else fs=fs.next=t;return r}var Pa=null;function Hc(t){Pa===null?Pa=[t]:Pa.push(t)}function Gh(t,r,i,c){var p=r.interleaved;return p===null?(i.next=i,Hc(r)):(i.next=p.next,p.next=i),r.interleaved=i,Vr(t,c)}function Vr(t,r){t.lanes|=r;var i=t.alternate;for(i!==null&&(i.lanes|=r),i=t,t=t.return;t!==null;)t.childLanes|=r,i=t.alternate,i!==null&&(i.childLanes|=r),i=t,t=t.return;return i.tag===3?i.stateNode:null}var aa=!1;function Wc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Xh(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Ur(t,r){return{eventTime:t,lane:r,tag:0,payload:null,callback:null,next:null}}function sa(t,r,i){var c=t.updateQueue;if(c===null)return null;if(c=c.shared,(lt&2)!==0){var p=c.pending;return p===null?r.next=r:(r.next=p.next,p.next=r),c.pending=r,Vr(t,i)}return p=c.interleaved,p===null?(r.next=r,Hc(c)):(r.next=p.next,p.next=r),c.interleaved=r,Vr(t,i)}function jo(t,r,i){if(r=r.updateQueue,r!==null&&(r=r.shared,(i&4194240)!==0)){var c=r.lanes;c&=t.pendingLanes,i|=c,r.lanes=i,sc(t,i)}}function qh(t,r){var i=t.updateQueue,c=t.alternate;if(c!==null&&(c=c.updateQueue,i===c)){var p=null,y=null;if(i=i.firstBaseUpdate,i!==null){do{var S={eventTime:i.eventTime,lane:i.lane,tag:i.tag,payload:i.payload,callback:i.callback,next:null};y===null?p=y=S:y=y.next=S,i=i.next}while(i!==null);y===null?p=y=r:y=y.next=r}else p=y=r;i={baseState:c.baseState,firstBaseUpdate:p,lastBaseUpdate:y,shared:c.shared,effects:c.effects},t.updateQueue=i;return}t=i.lastBaseUpdate,t===null?i.firstBaseUpdate=r:t.next=r,i.lastBaseUpdate=r}function Eo(t,r,i,c){var p=t.updateQueue;aa=!1;var y=p.firstBaseUpdate,S=p.lastBaseUpdate,D=p.shared.pending;if(D!==null){p.shared.pending=null;var B=D,ne=B.next;B.next=null,S===null?y=ne:S.next=ne,S=B;var fe=t.alternate;fe!==null&&(fe=fe.updateQueue,D=fe.lastBaseUpdate,D!==S&&(D===null?fe.firstBaseUpdate=ne:D.next=ne,fe.lastBaseUpdate=B))}if(y!==null){var he=p.baseState;S=0,fe=ne=B=null,D=y;do{var de=D.lane,ke=D.eventTime;if((c&de)===de){fe!==null&&(fe=fe.next={eventTime:ke,lane:0,tag:D.tag,payload:D.payload,callback:D.callback,next:null});e:{var Ee=t,Pe=D;switch(de=r,ke=i,Pe.tag){case 1:if(Ee=Pe.payload,typeof Ee=="function"){he=Ee.call(ke,he,de);break e}he=Ee;break e;case 3:Ee.flags=Ee.flags&-65537|128;case 0:if(Ee=Pe.payload,de=typeof Ee=="function"?Ee.call(ke,he,de):Ee,de==null)break e;he=W({},he,de);break e;case 2:aa=!0}}D.callback!==null&&D.lane!==0&&(t.flags|=64,de=p.effects,de===null?p.effects=[D]:de.push(D))}else ke={eventTime:ke,lane:de,tag:D.tag,payload:D.payload,callback:D.callback,next:null},fe===null?(ne=fe=ke,B=he):fe=fe.next=ke,S|=de;if(D=D.next,D===null){if(D=p.shared.pending,D===null)break;de=D,D=de.next,de.next=null,p.lastBaseUpdate=de,p.shared.pending=null}}while(!0);if(fe===null&&(B=he),p.baseState=B,p.firstBaseUpdate=ne,p.lastBaseUpdate=fe,r=p.shared.interleaved,r!==null){p=r;do S|=p.lane,p=p.next;while(p!==r)}else y===null&&(p.shared.lanes=0);Fa|=S,t.lanes=S,t.memoizedState=he}}function Jh(t,r,i){if(t=r.effects,r.effects=null,t!==null)for(r=0;r<t.length;r++){var c=t[r],p=c.callback;if(p!==null){if(c.callback=null,c=i,typeof p!="function")throw Error(a(191,p));p.call(c)}}}var oi={},wr=ta(oi),li=ta(oi),ci=ta(oi);function Ra(t){if(t===oi)throw Error(a(174));return t}function Kc(t,r){switch(wt(ci,r),wt(li,t),wt(wr,oi),t=r.nodeType,t){case 9:case 11:r=(r=r.documentElement)?r.namespaceURI:ht(null,"");break;default:t=t===8?r.parentNode:r,r=t.namespaceURI||null,t=t.tagName,r=ht(r,t)}jt(wr),wt(wr,r)}function ps(){jt(wr),jt(li),jt(ci)}function Qh(t){Ra(ci.current);var r=Ra(wr.current),i=ht(r,t.type);r!==i&&(wt(li,t),wt(wr,i))}function Yc(t){li.current===t&&(jt(wr),jt(li))}var Rt=ta(0);function No(t){for(var r=t;r!==null;){if(r.tag===13){var i=r.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||i.data==="$?"||i.data==="$!"))return r}else if(r.tag===19&&r.memoizedProps.revealOrder!==void 0){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var Gc=[];function Xc(){for(var t=0;t<Gc.length;t++)Gc[t]._workInProgressVersionPrimary=null;Gc.length=0}var To=V.ReactCurrentDispatcher,qc=V.ReactCurrentBatchConfig,Ma=0,Mt=null,Kt=null,Xt=null,Po=!1,ui=!1,di=0,z2=0;function un(){throw Error(a(321))}function Jc(t,r){if(r===null)return!1;for(var i=0;i<r.length&&i<t.length;i++)if(!ar(t[i],r[i]))return!1;return!0}function Qc(t,r,i,c,p,y){if(Ma=y,Mt=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,To.current=t===null||t.memoizedState===null?H2:W2,t=i(c,p),ui){y=0;do{if(ui=!1,di=0,25<=y)throw Error(a(301));y+=1,Xt=Kt=null,r.updateQueue=null,To.current=K2,t=i(c,p)}while(ui)}if(To.current=Fo,r=Kt!==null&&Kt.next!==null,Ma=0,Xt=Kt=Mt=null,Po=!1,r)throw Error(a(300));return t}function Zc(){var t=di!==0;return di=0,t}function kr(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xt===null?Mt.memoizedState=Xt=t:Xt=Xt.next=t,Xt}function Wn(){if(Kt===null){var t=Mt.alternate;t=t!==null?t.memoizedState:null}else t=Kt.next;var r=Xt===null?Mt.memoizedState:Xt.next;if(r!==null)Xt=r,Kt=t;else{if(t===null)throw Error(a(310));Kt=t,t={memoizedState:Kt.memoizedState,baseState:Kt.baseState,baseQueue:Kt.baseQueue,queue:Kt.queue,next:null},Xt===null?Mt.memoizedState=Xt=t:Xt=Xt.next=t}return Xt}function fi(t,r){return typeof r=="function"?r(t):r}function eu(t){var r=Wn(),i=r.queue;if(i===null)throw Error(a(311));i.lastRenderedReducer=t;var c=Kt,p=c.baseQueue,y=i.pending;if(y!==null){if(p!==null){var S=p.next;p.next=y.next,y.next=S}c.baseQueue=p=y,i.pending=null}if(p!==null){y=p.next,c=c.baseState;var D=S=null,B=null,ne=y;do{var fe=ne.lane;if((Ma&fe)===fe)B!==null&&(B=B.next={lane:0,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),c=ne.hasEagerState?ne.eagerState:t(c,ne.action);else{var he={lane:fe,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null};B===null?(D=B=he,S=c):B=B.next=he,Mt.lanes|=fe,Fa|=fe}ne=ne.next}while(ne!==null&&ne!==y);B===null?S=c:B.next=D,ar(c,r.memoizedState)||(jn=!0),r.memoizedState=c,r.baseState=S,r.baseQueue=B,i.lastRenderedState=c}if(t=i.interleaved,t!==null){p=t;do y=p.lane,Mt.lanes|=y,Fa|=y,p=p.next;while(p!==t)}else p===null&&(i.lanes=0);return[r.memoizedState,i.dispatch]}function tu(t){var r=Wn(),i=r.queue;if(i===null)throw Error(a(311));i.lastRenderedReducer=t;var c=i.dispatch,p=i.pending,y=r.memoizedState;if(p!==null){i.pending=null;var S=p=p.next;do y=t(y,S.action),S=S.next;while(S!==p);ar(y,r.memoizedState)||(jn=!0),r.memoizedState=y,r.baseQueue===null&&(r.baseState=y),i.lastRenderedState=y}return[y,c]}function Zh(){}function ep(t,r){var i=Mt,c=Wn(),p=r(),y=!ar(c.memoizedState,p);if(y&&(c.memoizedState=p,jn=!0),c=c.queue,nu(rp.bind(null,i,c,t),[t]),c.getSnapshot!==r||y||Xt!==null&&Xt.memoizedState.tag&1){if(i.flags|=2048,hi(9,np.bind(null,i,c,p,r),void 0,null),qt===null)throw Error(a(349));(Ma&30)!==0||tp(i,r,p)}return p}function tp(t,r,i){t.flags|=16384,t={getSnapshot:r,value:i},r=Mt.updateQueue,r===null?(r={lastEffect:null,stores:null},Mt.updateQueue=r,r.stores=[t]):(i=r.stores,i===null?r.stores=[t]:i.push(t))}function np(t,r,i,c){r.value=i,r.getSnapshot=c,ap(r)&&sp(t)}function rp(t,r,i){return i(function(){ap(r)&&sp(t)})}function ap(t){var r=t.getSnapshot;t=t.value;try{var i=r();return!ar(t,i)}catch{return!0}}function sp(t){var r=Vr(t,1);r!==null&&cr(r,t,1,-1)}function ip(t){var r=kr();return typeof t=="function"&&(t=t()),r.memoizedState=r.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:fi,lastRenderedState:t},r.queue=t,t=t.dispatch=$2.bind(null,Mt,t),[r.memoizedState,t]}function hi(t,r,i,c){return t={tag:t,create:r,destroy:i,deps:c,next:null},r=Mt.updateQueue,r===null?(r={lastEffect:null,stores:null},Mt.updateQueue=r,r.lastEffect=t.next=t):(i=r.lastEffect,i===null?r.lastEffect=t.next=t:(c=i.next,i.next=t,t.next=c,r.lastEffect=t)),t}function op(){return Wn().memoizedState}function Ro(t,r,i,c){var p=kr();Mt.flags|=t,p.memoizedState=hi(1|r,i,void 0,c===void 0?null:c)}function Mo(t,r,i,c){var p=Wn();c=c===void 0?null:c;var y=void 0;if(Kt!==null){var S=Kt.memoizedState;if(y=S.destroy,c!==null&&Jc(c,S.deps)){p.memoizedState=hi(r,i,y,c);return}}Mt.flags|=t,p.memoizedState=hi(1|r,i,y,c)}function lp(t,r){return Ro(8390656,8,t,r)}function nu(t,r){return Mo(2048,8,t,r)}function cp(t,r){return Mo(4,2,t,r)}function up(t,r){return Mo(4,4,t,r)}function dp(t,r){if(typeof r=="function")return t=t(),r(t),function(){r(null)};if(r!=null)return t=t(),r.current=t,function(){r.current=null}}function fp(t,r,i){return i=i!=null?i.concat([t]):null,Mo(4,4,dp.bind(null,r,t),i)}function ru(){}function hp(t,r){var i=Wn();r=r===void 0?null:r;var c=i.memoizedState;return c!==null&&r!==null&&Jc(r,c[1])?c[0]:(i.memoizedState=[t,r],t)}function pp(t,r){var i=Wn();r=r===void 0?null:r;var c=i.memoizedState;return c!==null&&r!==null&&Jc(r,c[1])?c[0]:(t=t(),i.memoizedState=[t,r],t)}function mp(t,r,i){return(Ma&21)===0?(t.baseState&&(t.baseState=!1,jn=!0),t.memoizedState=i):(ar(i,r)||(i=Qi(),Mt.lanes|=i,Fa|=i,t.baseState=!0),r)}function V2(t,r){var i=mt;mt=i!==0&&4>i?i:4,t(!0);var c=qc.transition;qc.transition={};try{t(!1),r()}finally{mt=i,qc.transition=c}}function gp(){return Wn().memoizedState}function U2(t,r,i){var c=ca(t);if(i={lane:c,action:i,hasEagerState:!1,eagerState:null,next:null},xp(t))yp(r,i);else if(i=Gh(t,r,i,c),i!==null){var p=xn();cr(i,t,c,p),vp(i,r,c)}}function $2(t,r,i){var c=ca(t),p={lane:c,action:i,hasEagerState:!1,eagerState:null,next:null};if(xp(t))yp(r,p);else{var y=t.alternate;if(t.lanes===0&&(y===null||y.lanes===0)&&(y=r.lastRenderedReducer,y!==null))try{var S=r.lastRenderedState,D=y(S,i);if(p.hasEagerState=!0,p.eagerState=D,ar(D,S)){var B=r.interleaved;B===null?(p.next=p,Hc(r)):(p.next=B.next,B.next=p),r.interleaved=p;return}}catch{}finally{}i=Gh(t,r,p,c),i!==null&&(p=xn(),cr(i,t,c,p),vp(i,r,c))}}function xp(t){var r=t.alternate;return t===Mt||r!==null&&r===Mt}function yp(t,r){ui=Po=!0;var i=t.pending;i===null?r.next=r:(r.next=i.next,i.next=r),t.pending=r}function vp(t,r,i){if((i&4194240)!==0){var c=r.lanes;c&=t.pendingLanes,i|=c,r.lanes=i,sc(t,i)}}var Fo={readContext:Hn,useCallback:un,useContext:un,useEffect:un,useImperativeHandle:un,useInsertionEffect:un,useLayoutEffect:un,useMemo:un,useReducer:un,useRef:un,useState:un,useDebugValue:un,useDeferredValue:un,useTransition:un,useMutableSource:un,useSyncExternalStore:un,useId:un,unstable_isNewReconciler:!1},H2={readContext:Hn,useCallback:function(t,r){return kr().memoizedState=[t,r===void 0?null:r],t},useContext:Hn,useEffect:lp,useImperativeHandle:function(t,r,i){return i=i!=null?i.concat([t]):null,Ro(4194308,4,dp.bind(null,r,t),i)},useLayoutEffect:function(t,r){return Ro(4194308,4,t,r)},useInsertionEffect:function(t,r){return Ro(4,2,t,r)},useMemo:function(t,r){var i=kr();return r=r===void 0?null:r,t=t(),i.memoizedState=[t,r],t},useReducer:function(t,r,i){var c=kr();return r=i!==void 0?i(r):r,c.memoizedState=c.baseState=r,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:r},c.queue=t,t=t.dispatch=U2.bind(null,Mt,t),[c.memoizedState,t]},useRef:function(t){var r=kr();return t={current:t},r.memoizedState=t},useState:ip,useDebugValue:ru,useDeferredValue:function(t){return kr().memoizedState=t},useTransition:function(){var t=ip(!1),r=t[0];return t=V2.bind(null,t[1]),kr().memoizedState=t,[r,t]},useMutableSource:function(){},useSyncExternalStore:function(t,r,i){var c=Mt,p=kr();if(Tt){if(i===void 0)throw Error(a(407));i=i()}else{if(i=r(),qt===null)throw Error(a(349));(Ma&30)!==0||tp(c,r,i)}p.memoizedState=i;var y={value:i,getSnapshot:r};return p.queue=y,lp(rp.bind(null,c,y,t),[t]),c.flags|=2048,hi(9,np.bind(null,c,y,i,r),void 0,null),i},useId:function(){var t=kr(),r=qt.identifierPrefix;if(Tt){var i=zr,c=Br;i=(c&~(1<<32-on(c)-1)).toString(32)+i,r=":"+r+"R"+i,i=di++,0<i&&(r+="H"+i.toString(32)),r+=":"}else i=z2++,r=":"+r+"r"+i.toString(32)+":";return t.memoizedState=r},unstable_isNewReconciler:!1},W2={readContext:Hn,useCallback:hp,useContext:Hn,useEffect:nu,useImperativeHandle:fp,useInsertionEffect:cp,useLayoutEffect:up,useMemo:pp,useReducer:eu,useRef:op,useState:function(){return eu(fi)},useDebugValue:ru,useDeferredValue:function(t){var r=Wn();return mp(r,Kt.memoizedState,t)},useTransition:function(){var t=eu(fi)[0],r=Wn().memoizedState;return[t,r]},useMutableSource:Zh,useSyncExternalStore:ep,useId:gp,unstable_isNewReconciler:!1},K2={readContext:Hn,useCallback:hp,useContext:Hn,useEffect:nu,useImperativeHandle:fp,useInsertionEffect:cp,useLayoutEffect:up,useMemo:pp,useReducer:tu,useRef:op,useState:function(){return tu(fi)},useDebugValue:ru,useDeferredValue:function(t){var r=Wn();return Kt===null?r.memoizedState=t:mp(r,Kt.memoizedState,t)},useTransition:function(){var t=tu(fi)[0],r=Wn().memoizedState;return[t,r]},useMutableSource:Zh,useSyncExternalStore:ep,useId:gp,unstable_isNewReconciler:!1};function ir(t,r){if(t&&t.defaultProps){r=W({},r),t=t.defaultProps;for(var i in t)r[i]===void 0&&(r[i]=t[i]);return r}return r}function au(t,r,i,c){r=t.memoizedState,i=i(c,r),i=i==null?r:W({},r,i),t.memoizedState=i,t.lanes===0&&(t.updateQueue.baseState=i)}var Io={isMounted:function(t){return(t=t._reactInternals)?xe(t)===t:!1},enqueueSetState:function(t,r,i){t=t._reactInternals;var c=xn(),p=ca(t),y=Ur(c,p);y.payload=r,i!=null&&(y.callback=i),r=sa(t,y,p),r!==null&&(cr(r,t,p,c),jo(r,t,p))},enqueueReplaceState:function(t,r,i){t=t._reactInternals;var c=xn(),p=ca(t),y=Ur(c,p);y.tag=1,y.payload=r,i!=null&&(y.callback=i),r=sa(t,y,p),r!==null&&(cr(r,t,p,c),jo(r,t,p))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var i=xn(),c=ca(t),p=Ur(i,c);p.tag=2,r!=null&&(p.callback=r),r=sa(t,p,c),r!==null&&(cr(r,t,c,i),jo(r,t,c))}};function bp(t,r,i,c,p,y,S){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(c,y,S):r.prototype&&r.prototype.isPureReactComponent?!Zs(i,c)||!Zs(p,y):!0}function wp(t,r,i){var c=!1,p=na,y=r.contextType;return typeof y=="object"&&y!==null?y=Hn(y):(p=Cn(r)?Ea:cn.current,c=r.contextTypes,y=(c=c!=null)?os(t,p):na),r=new r(i,y),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=Io,t.stateNode=r,r._reactInternals=t,c&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=p,t.__reactInternalMemoizedMaskedChildContext=y),r}function kp(t,r,i,c){t=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(i,c),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(i,c),r.state!==t&&Io.enqueueReplaceState(r,r.state,null)}function su(t,r,i,c){var p=t.stateNode;p.props=i,p.state=t.memoizedState,p.refs={},Wc(t);var y=r.contextType;typeof y=="object"&&y!==null?p.context=Hn(y):(y=Cn(r)?Ea:cn.current,p.context=os(t,y)),p.state=t.memoizedState,y=r.getDerivedStateFromProps,typeof y=="function"&&(au(t,r,y,i),p.state=t.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(r=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),r!==p.state&&Io.enqueueReplaceState(p,p.state,null),Eo(t,i,p,c),p.state=t.memoizedState),typeof p.componentDidMount=="function"&&(t.flags|=4194308)}function ms(t,r){try{var i="",c=r;do i+=oe(c),c=c.return;while(c);var p=i}catch(y){p=`
Error generating stack: `+y.message+`
`+y.stack}return{value:t,source:r,stack:p,digest:null}}function iu(t,r,i){return{value:t,source:null,stack:i??null,digest:r??null}}function ou(t,r){try{console.error(r.value)}catch(i){setTimeout(function(){throw i})}}var Y2=typeof WeakMap=="function"?WeakMap:Map;function Sp(t,r,i){i=Ur(-1,i),i.tag=3,i.payload={element:null};var c=r.value;return i.callback=function(){zo||(zo=!0,ku=c),ou(t,r)},i}function Cp(t,r,i){i=Ur(-1,i),i.tag=3;var c=t.type.getDerivedStateFromError;if(typeof c=="function"){var p=r.value;i.payload=function(){return c(p)},i.callback=function(){ou(t,r)}}var y=t.stateNode;return y!==null&&typeof y.componentDidCatch=="function"&&(i.callback=function(){ou(t,r),typeof c!="function"&&(oa===null?oa=new Set([this]):oa.add(this));var S=r.stack;this.componentDidCatch(r.value,{componentStack:S!==null?S:""})}),i}function jp(t,r,i){var c=t.pingCache;if(c===null){c=t.pingCache=new Y2;var p=new Set;c.set(r,p)}else p=c.get(r),p===void 0&&(p=new Set,c.set(r,p));p.has(i)||(p.add(i),t=ov.bind(null,t,r,i),r.then(t,t))}function Ep(t){do{var r;if((r=t.tag===13)&&(r=t.memoizedState,r=r!==null?r.dehydrated!==null:!0),r)return t;t=t.return}while(t!==null);return null}function Np(t,r,i,c,p){return(t.mode&1)===0?(t===r?t.flags|=65536:(t.flags|=128,i.flags|=131072,i.flags&=-52805,i.tag===1&&(i.alternate===null?i.tag=17:(r=Ur(-1,1),r.tag=2,sa(i,r,1))),i.lanes|=1),t):(t.flags|=65536,t.lanes=p,t)}var G2=V.ReactCurrentOwner,jn=!1;function gn(t,r,i,c){r.child=t===null?Yh(r,null,i,c):ds(r,t.child,i,c)}function Tp(t,r,i,c,p){i=i.render;var y=r.ref;return hs(r,p),c=Qc(t,r,i,c,y,p),i=Zc(),t!==null&&!jn?(r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~p,$r(t,r,p)):(Tt&&i&&_c(r),r.flags|=1,gn(t,r,c,p),r.child)}function Pp(t,r,i,c,p){if(t===null){var y=i.type;return typeof y=="function"&&!Pu(y)&&y.defaultProps===void 0&&i.compare===null&&i.defaultProps===void 0?(r.tag=15,r.type=y,Rp(t,r,y,c,p)):(t=Ko(i.type,null,c,r,r.mode,p),t.ref=r.ref,t.return=r,r.child=t)}if(y=t.child,(t.lanes&p)===0){var S=y.memoizedProps;if(i=i.compare,i=i!==null?i:Zs,i(S,c)&&t.ref===r.ref)return $r(t,r,p)}return r.flags|=1,t=da(y,c),t.ref=r.ref,t.return=r,r.child=t}function Rp(t,r,i,c,p){if(t!==null){var y=t.memoizedProps;if(Zs(y,c)&&t.ref===r.ref)if(jn=!1,r.pendingProps=c=y,(t.lanes&p)!==0)(t.flags&131072)!==0&&(jn=!0);else return r.lanes=t.lanes,$r(t,r,p)}return lu(t,r,i,c,p)}function Mp(t,r,i){var c=r.pendingProps,p=c.children,y=t!==null?t.memoizedState:null;if(c.mode==="hidden")if((r.mode&1)===0)r.memoizedState={baseLanes:0,cachePool:null,transitions:null},wt(xs,An),An|=i;else{if((i&1073741824)===0)return t=y!==null?y.baseLanes|i:i,r.lanes=r.childLanes=1073741824,r.memoizedState={baseLanes:t,cachePool:null,transitions:null},r.updateQueue=null,wt(xs,An),An|=t,null;r.memoizedState={baseLanes:0,cachePool:null,transitions:null},c=y!==null?y.baseLanes:i,wt(xs,An),An|=c}else y!==null?(c=y.baseLanes|i,r.memoizedState=null):c=i,wt(xs,An),An|=c;return gn(t,r,p,i),r.child}function Fp(t,r){var i=r.ref;(t===null&&i!==null||t!==null&&t.ref!==i)&&(r.flags|=512,r.flags|=2097152)}function lu(t,r,i,c,p){var y=Cn(i)?Ea:cn.current;return y=os(r,y),hs(r,p),i=Qc(t,r,i,c,y,p),c=Zc(),t!==null&&!jn?(r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~p,$r(t,r,p)):(Tt&&c&&_c(r),r.flags|=1,gn(t,r,i,p),r.child)}function Ip(t,r,i,c,p){if(Cn(i)){var y=!0;xo(r)}else y=!1;if(hs(r,p),r.stateNode===null)_o(t,r),wp(r,i,c),su(r,i,c,p),c=!0;else if(t===null){var S=r.stateNode,D=r.memoizedProps;S.props=D;var B=S.context,ne=i.contextType;typeof ne=="object"&&ne!==null?ne=Hn(ne):(ne=Cn(i)?Ea:cn.current,ne=os(r,ne));var fe=i.getDerivedStateFromProps,he=typeof fe=="function"||typeof S.getSnapshotBeforeUpdate=="function";he||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(D!==c||B!==ne)&&kp(r,S,c,ne),aa=!1;var de=r.memoizedState;S.state=de,Eo(r,c,S,p),B=r.memoizedState,D!==c||de!==B||Sn.current||aa?(typeof fe=="function"&&(au(r,i,fe,c),B=r.memoizedState),(D=aa||bp(r,i,D,c,de,B,ne))?(he||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"&&(r.flags|=4194308)):(typeof S.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=c,r.memoizedState=B),S.props=c,S.state=B,S.context=ne,c=D):(typeof S.componentDidMount=="function"&&(r.flags|=4194308),c=!1)}else{S=r.stateNode,Xh(t,r),D=r.memoizedProps,ne=r.type===r.elementType?D:ir(r.type,D),S.props=ne,he=r.pendingProps,de=S.context,B=i.contextType,typeof B=="object"&&B!==null?B=Hn(B):(B=Cn(i)?Ea:cn.current,B=os(r,B));var ke=i.getDerivedStateFromProps;(fe=typeof ke=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(D!==he||de!==B)&&kp(r,S,c,B),aa=!1,de=r.memoizedState,S.state=de,Eo(r,c,S,p);var Ee=r.memoizedState;D!==he||de!==Ee||Sn.current||aa?(typeof ke=="function"&&(au(r,i,ke,c),Ee=r.memoizedState),(ne=aa||bp(r,i,ne,c,de,Ee,B)||!1)?(fe||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(c,Ee,B),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(c,Ee,B)),typeof S.componentDidUpdate=="function"&&(r.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof S.componentDidUpdate!="function"||D===t.memoizedProps&&de===t.memoizedState||(r.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||D===t.memoizedProps&&de===t.memoizedState||(r.flags|=1024),r.memoizedProps=c,r.memoizedState=Ee),S.props=c,S.state=Ee,S.context=B,c=ne):(typeof S.componentDidUpdate!="function"||D===t.memoizedProps&&de===t.memoizedState||(r.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||D===t.memoizedProps&&de===t.memoizedState||(r.flags|=1024),c=!1)}return cu(t,r,i,c,y,p)}function cu(t,r,i,c,p,y){Fp(t,r);var S=(r.flags&128)!==0;if(!c&&!S)return p&&Oh(r,i,!1),$r(t,r,y);c=r.stateNode,G2.current=r;var D=S&&typeof i.getDerivedStateFromError!="function"?null:c.render();return r.flags|=1,t!==null&&S?(r.child=ds(r,t.child,null,y),r.child=ds(r,null,D,y)):gn(t,r,D,y),r.memoizedState=c.state,p&&Oh(r,i,!0),r.child}function Dp(t){var r=t.stateNode;r.pendingContext?Lh(t,r.pendingContext,r.pendingContext!==r.context):r.context&&Lh(t,r.context,!1),Kc(t,r.containerInfo)}function _p(t,r,i,c,p){return us(),Bc(p),r.flags|=256,gn(t,r,i,c),r.child}var uu={dehydrated:null,treeContext:null,retryLane:0};function du(t){return{baseLanes:t,cachePool:null,transitions:null}}function Lp(t,r,i){var c=r.pendingProps,p=Rt.current,y=!1,S=(r.flags&128)!==0,D;if((D=S)||(D=t!==null&&t.memoizedState===null?!1:(p&2)!==0),D?(y=!0,r.flags&=-129):(t===null||t.memoizedState!==null)&&(p|=1),wt(Rt,p&1),t===null)return Oc(r),t=r.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?((r.mode&1)===0?r.lanes=1:t.data==="$!"?r.lanes=8:r.lanes=1073741824,null):(S=c.children,t=c.fallback,y?(c=r.mode,y=r.child,S={mode:"hidden",children:S},(c&1)===0&&y!==null?(y.childLanes=0,y.pendingProps=S):y=Yo(S,c,0,null),t=La(t,c,i,null),y.return=r,t.return=r,y.sibling=t,r.child=y,r.child.memoizedState=du(i),r.memoizedState=uu,t):fu(r,S));if(p=t.memoizedState,p!==null&&(D=p.dehydrated,D!==null))return X2(t,r,S,c,D,p,i);if(y){y=c.fallback,S=r.mode,p=t.child,D=p.sibling;var B={mode:"hidden",children:c.children};return(S&1)===0&&r.child!==p?(c=r.child,c.childLanes=0,c.pendingProps=B,r.deletions=null):(c=da(p,B),c.subtreeFlags=p.subtreeFlags&14680064),D!==null?y=da(D,y):(y=La(y,S,i,null),y.flags|=2),y.return=r,c.return=r,c.sibling=y,r.child=c,c=y,y=r.child,S=t.child.memoizedState,S=S===null?du(i):{baseLanes:S.baseLanes|i,cachePool:null,transitions:S.transitions},y.memoizedState=S,y.childLanes=t.childLanes&~i,r.memoizedState=uu,c}return y=t.child,t=y.sibling,c=da(y,{mode:"visible",children:c.children}),(r.mode&1)===0&&(c.lanes=i),c.return=r,c.sibling=null,t!==null&&(i=r.deletions,i===null?(r.deletions=[t],r.flags|=16):i.push(t)),r.child=c,r.memoizedState=null,c}function fu(t,r){return r=Yo({mode:"visible",children:r},t.mode,0,null),r.return=t,t.child=r}function Do(t,r,i,c){return c!==null&&Bc(c),ds(r,t.child,null,i),t=fu(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function X2(t,r,i,c,p,y,S){if(i)return r.flags&256?(r.flags&=-257,c=iu(Error(a(422))),Do(t,r,S,c)):r.memoizedState!==null?(r.child=t.child,r.flags|=128,null):(y=c.fallback,p=r.mode,c=Yo({mode:"visible",children:c.children},p,0,null),y=La(y,p,S,null),y.flags|=2,c.return=r,y.return=r,c.sibling=y,r.child=c,(r.mode&1)!==0&&ds(r,t.child,null,S),r.child.memoizedState=du(S),r.memoizedState=uu,y);if((r.mode&1)===0)return Do(t,r,S,null);if(p.data==="$!"){if(c=p.nextSibling&&p.nextSibling.dataset,c)var D=c.dgst;return c=D,y=Error(a(419)),c=iu(y,c,void 0),Do(t,r,S,c)}if(D=(S&t.childLanes)!==0,jn||D){if(c=qt,c!==null){switch(S&-S){case 4:p=2;break;case 16:p=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:p=32;break;case 536870912:p=268435456;break;default:p=0}p=(p&(c.suspendedLanes|S))!==0?0:p,p!==0&&p!==y.retryLane&&(y.retryLane=p,Vr(t,p),cr(c,t,p,-1))}return Tu(),c=iu(Error(a(421))),Do(t,r,S,c)}return p.data==="$?"?(r.flags|=128,r.child=t.child,r=lv.bind(null,t),p._reactRetry=r,null):(t=y.treeContext,Ln=ea(p.nextSibling),_n=r,Tt=!0,sr=null,t!==null&&(Un[$n++]=Br,Un[$n++]=zr,Un[$n++]=Na,Br=t.id,zr=t.overflow,Na=r),r=fu(r,c.children),r.flags|=4096,r)}function Ap(t,r,i){t.lanes|=r;var c=t.alternate;c!==null&&(c.lanes|=r),$c(t.return,r,i)}function hu(t,r,i,c,p){var y=t.memoizedState;y===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:c,tail:i,tailMode:p}:(y.isBackwards=r,y.rendering=null,y.renderingStartTime=0,y.last=c,y.tail=i,y.tailMode=p)}function Op(t,r,i){var c=r.pendingProps,p=c.revealOrder,y=c.tail;if(gn(t,r,c.children,i),c=Rt.current,(c&2)!==0)c=c&1|2,r.flags|=128;else{if(t!==null&&(t.flags&128)!==0)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Ap(t,i,r);else if(t.tag===19)Ap(t,i,r);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===r)break e;for(;t.sibling===null;){if(t.return===null||t.return===r)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}c&=1}if(wt(Rt,c),(r.mode&1)===0)r.memoizedState=null;else switch(p){case"forwards":for(i=r.child,p=null;i!==null;)t=i.alternate,t!==null&&No(t)===null&&(p=i),i=i.sibling;i=p,i===null?(p=r.child,r.child=null):(p=i.sibling,i.sibling=null),hu(r,!1,p,i,y);break;case"backwards":for(i=null,p=r.child,r.child=null;p!==null;){if(t=p.alternate,t!==null&&No(t)===null){r.child=p;break}t=p.sibling,p.sibling=i,i=p,p=t}hu(r,!0,i,null,y);break;case"together":hu(r,!1,null,null,void 0);break;default:r.memoizedState=null}return r.child}function _o(t,r){(r.mode&1)===0&&t!==null&&(t.alternate=null,r.alternate=null,r.flags|=2)}function $r(t,r,i){if(t!==null&&(r.dependencies=t.dependencies),Fa|=r.lanes,(i&r.childLanes)===0)return null;if(t!==null&&r.child!==t.child)throw Error(a(153));if(r.child!==null){for(t=r.child,i=da(t,t.pendingProps),r.child=i,i.return=r;t.sibling!==null;)t=t.sibling,i=i.sibling=da(t,t.pendingProps),i.return=r;i.sibling=null}return r.child}function q2(t,r,i){switch(r.tag){case 3:Dp(r),us();break;case 5:Qh(r);break;case 1:Cn(r.type)&&xo(r);break;case 4:Kc(r,r.stateNode.containerInfo);break;case 10:var c=r.type._context,p=r.memoizedProps.value;wt(So,c._currentValue),c._currentValue=p;break;case 13:if(c=r.memoizedState,c!==null)return c.dehydrated!==null?(wt(Rt,Rt.current&1),r.flags|=128,null):(i&r.child.childLanes)!==0?Lp(t,r,i):(wt(Rt,Rt.current&1),t=$r(t,r,i),t!==null?t.sibling:null);wt(Rt,Rt.current&1);break;case 19:if(c=(i&r.childLanes)!==0,(t.flags&128)!==0){if(c)return Op(t,r,i);r.flags|=128}if(p=r.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),wt(Rt,Rt.current),c)break;return null;case 22:case 23:return r.lanes=0,Mp(t,r,i)}return $r(t,r,i)}var Bp,pu,zp,Vp;Bp=function(t,r){for(var i=r.child;i!==null;){if(i.tag===5||i.tag===6)t.appendChild(i.stateNode);else if(i.tag!==4&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return;i=i.return}i.sibling.return=i.return,i=i.sibling}},pu=function(){},zp=function(t,r,i,c){var p=t.memoizedProps;if(p!==c){t=r.stateNode,Ra(wr.current);var y=null;switch(i){case"input":p=dt(t,p),c=dt(t,c),y=[];break;case"select":p=W({},p,{value:void 0}),c=W({},c,{value:void 0}),y=[];break;case"textarea":p=be(t,p),c=be(t,c),y=[];break;default:typeof p.onClick!="function"&&typeof c.onClick=="function"&&(t.onclick=po)}ot(i,c);var S;i=null;for(ne in p)if(!c.hasOwnProperty(ne)&&p.hasOwnProperty(ne)&&p[ne]!=null)if(ne==="style"){var D=p[ne];for(S in D)D.hasOwnProperty(S)&&(i||(i={}),i[S]="")}else ne!=="dangerouslySetInnerHTML"&&ne!=="children"&&ne!=="suppressContentEditableWarning"&&ne!=="suppressHydrationWarning"&&ne!=="autoFocus"&&(o.hasOwnProperty(ne)?y||(y=[]):(y=y||[]).push(ne,null));for(ne in c){var B=c[ne];if(D=p!=null?p[ne]:void 0,c.hasOwnProperty(ne)&&B!==D&&(B!=null||D!=null))if(ne==="style")if(D){for(S in D)!D.hasOwnProperty(S)||B&&B.hasOwnProperty(S)||(i||(i={}),i[S]="");for(S in B)B.hasOwnProperty(S)&&D[S]!==B[S]&&(i||(i={}),i[S]=B[S])}else i||(y||(y=[]),y.push(ne,i)),i=B;else ne==="dangerouslySetInnerHTML"?(B=B?B.__html:void 0,D=D?D.__html:void 0,B!=null&&D!==B&&(y=y||[]).push(ne,B)):ne==="children"?typeof B!="string"&&typeof B!="number"||(y=y||[]).push(ne,""+B):ne!=="suppressContentEditableWarning"&&ne!=="suppressHydrationWarning"&&(o.hasOwnProperty(ne)?(B!=null&&ne==="onScroll"&&Ct("scroll",t),y||D===B||(y=[])):(y=y||[]).push(ne,B))}i&&(y=y||[]).push("style",i);var ne=y;(r.updateQueue=ne)&&(r.flags|=4)}},Vp=function(t,r,i,c){i!==c&&(r.flags|=4)};function pi(t,r){if(!Tt)switch(t.tailMode){case"hidden":r=t.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?t.tail=null:i.sibling=null;break;case"collapsed":i=t.tail;for(var c=null;i!==null;)i.alternate!==null&&(c=i),i=i.sibling;c===null?r||t.tail===null?t.tail=null:t.tail.sibling=null:c.sibling=null}}function dn(t){var r=t.alternate!==null&&t.alternate.child===t.child,i=0,c=0;if(r)for(var p=t.child;p!==null;)i|=p.lanes|p.childLanes,c|=p.subtreeFlags&14680064,c|=p.flags&14680064,p.return=t,p=p.sibling;else for(p=t.child;p!==null;)i|=p.lanes|p.childLanes,c|=p.subtreeFlags,c|=p.flags,p.return=t,p=p.sibling;return t.subtreeFlags|=c,t.childLanes=i,r}function J2(t,r,i){var c=r.pendingProps;switch(Lc(r),r.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return dn(r),null;case 1:return Cn(r.type)&&go(),dn(r),null;case 3:return c=r.stateNode,ps(),jt(Sn),jt(cn),Xc(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(t===null||t.child===null)&&(wo(r)?r.flags|=4:t===null||t.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,sr!==null&&(ju(sr),sr=null))),pu(t,r),dn(r),null;case 5:Yc(r);var p=Ra(ci.current);if(i=r.type,t!==null&&r.stateNode!=null)zp(t,r,i,c,p),t.ref!==r.ref&&(r.flags|=512,r.flags|=2097152);else{if(!c){if(r.stateNode===null)throw Error(a(166));return dn(r),null}if(t=Ra(wr.current),wo(r)){c=r.stateNode,i=r.type;var y=r.memoizedProps;switch(c[br]=r,c[ai]=y,t=(r.mode&1)!==0,i){case"dialog":Ct("cancel",c),Ct("close",c);break;case"iframe":case"object":case"embed":Ct("load",c);break;case"video":case"audio":for(p=0;p<ti.length;p++)Ct(ti[p],c);break;case"source":Ct("error",c);break;case"img":case"image":case"link":Ct("error",c),Ct("load",c);break;case"details":Ct("toggle",c);break;case"input":yt(c,y),Ct("invalid",c);break;case"select":c._wrapperState={wasMultiple:!!y.multiple},Ct("invalid",c);break;case"textarea":Ae(c,y),Ct("invalid",c)}ot(i,y),p=null;for(var S in y)if(y.hasOwnProperty(S)){var D=y[S];S==="children"?typeof D=="string"?c.textContent!==D&&(y.suppressHydrationWarning!==!0&&ho(c.textContent,D,t),p=["children",D]):typeof D=="number"&&c.textContent!==""+D&&(y.suppressHydrationWarning!==!0&&ho(c.textContent,D,t),p=["children",""+D]):o.hasOwnProperty(S)&&D!=null&&S==="onScroll"&&Ct("scroll",c)}switch(i){case"input":je(c),Re(c,y,!0);break;case"textarea":je(c),Ge(c);break;case"select":case"option":break;default:typeof y.onClick=="function"&&(c.onclick=po)}c=p,r.updateQueue=c,c!==null&&(r.flags|=4)}else{S=p.nodeType===9?p:p.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=rt(i)),t==="http://www.w3.org/1999/xhtml"?i==="script"?(t=S.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof c.is=="string"?t=S.createElement(i,{is:c.is}):(t=S.createElement(i),i==="select"&&(S=t,c.multiple?S.multiple=!0:c.size&&(S.size=c.size))):t=S.createElementNS(t,i),t[br]=r,t[ai]=c,Bp(t,r,!1,!1),r.stateNode=t;e:{switch(S=it(i,c),i){case"dialog":Ct("cancel",t),Ct("close",t),p=c;break;case"iframe":case"object":case"embed":Ct("load",t),p=c;break;case"video":case"audio":for(p=0;p<ti.length;p++)Ct(ti[p],t);p=c;break;case"source":Ct("error",t),p=c;break;case"img":case"image":case"link":Ct("error",t),Ct("load",t),p=c;break;case"details":Ct("toggle",t),p=c;break;case"input":yt(t,c),p=dt(t,c),Ct("invalid",t);break;case"option":p=c;break;case"select":t._wrapperState={wasMultiple:!!c.multiple},p=W({},c,{value:void 0}),Ct("invalid",t);break;case"textarea":Ae(t,c),p=be(t,c),Ct("invalid",t);break;default:p=c}ot(i,p),D=p;for(y in D)if(D.hasOwnProperty(y)){var B=D[y];y==="style"?Te(t,B):y==="dangerouslySetInnerHTML"?(B=B?B.__html:void 0,B!=null&&Pt(t,B)):y==="children"?typeof B=="string"?(i!=="textarea"||B!=="")&&Je(t,B):typeof B=="number"&&Je(t,""+B):y!=="suppressContentEditableWarning"&&y!=="suppressHydrationWarning"&&y!=="autoFocus"&&(o.hasOwnProperty(y)?B!=null&&y==="onScroll"&&Ct("scroll",t):B!=null&&_(t,y,B,S))}switch(i){case"input":je(t),Re(t,c,!1);break;case"textarea":je(t),Ge(t);break;case"option":c.value!=null&&t.setAttribute("value",""+ye(c.value));break;case"select":t.multiple=!!c.multiple,y=c.value,y!=null?Fe(t,!!c.multiple,y,!1):c.defaultValue!=null&&Fe(t,!!c.multiple,c.defaultValue,!0);break;default:typeof p.onClick=="function"&&(t.onclick=po)}switch(i){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}}c&&(r.flags|=4)}r.ref!==null&&(r.flags|=512,r.flags|=2097152)}return dn(r),null;case 6:if(t&&r.stateNode!=null)Vp(t,r,t.memoizedProps,c);else{if(typeof c!="string"&&r.stateNode===null)throw Error(a(166));if(i=Ra(ci.current),Ra(wr.current),wo(r)){if(c=r.stateNode,i=r.memoizedProps,c[br]=r,(y=c.nodeValue!==i)&&(t=_n,t!==null))switch(t.tag){case 3:ho(c.nodeValue,i,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&ho(c.nodeValue,i,(t.mode&1)!==0)}y&&(r.flags|=4)}else c=(i.nodeType===9?i:i.ownerDocument).createTextNode(c),c[br]=r,r.stateNode=c}return dn(r),null;case 13:if(jt(Rt),c=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(Tt&&Ln!==null&&(r.mode&1)!==0&&(r.flags&128)===0)Hh(),us(),r.flags|=98560,y=!1;else if(y=wo(r),c!==null&&c.dehydrated!==null){if(t===null){if(!y)throw Error(a(318));if(y=r.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(a(317));y[br]=r}else us(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;dn(r),y=!1}else sr!==null&&(ju(sr),sr=null),y=!0;if(!y)return r.flags&65536?r:null}return(r.flags&128)!==0?(r.lanes=i,r):(c=c!==null,c!==(t!==null&&t.memoizedState!==null)&&c&&(r.child.flags|=8192,(r.mode&1)!==0&&(t===null||(Rt.current&1)!==0?Yt===0&&(Yt=3):Tu())),r.updateQueue!==null&&(r.flags|=4),dn(r),null);case 4:return ps(),pu(t,r),t===null&&ni(r.stateNode.containerInfo),dn(r),null;case 10:return Uc(r.type._context),dn(r),null;case 17:return Cn(r.type)&&go(),dn(r),null;case 19:if(jt(Rt),y=r.memoizedState,y===null)return dn(r),null;if(c=(r.flags&128)!==0,S=y.rendering,S===null)if(c)pi(y,!1);else{if(Yt!==0||t!==null&&(t.flags&128)!==0)for(t=r.child;t!==null;){if(S=No(t),S!==null){for(r.flags|=128,pi(y,!1),c=S.updateQueue,c!==null&&(r.updateQueue=c,r.flags|=4),r.subtreeFlags=0,c=i,i=r.child;i!==null;)y=i,t=c,y.flags&=14680066,S=y.alternate,S===null?(y.childLanes=0,y.lanes=t,y.child=null,y.subtreeFlags=0,y.memoizedProps=null,y.memoizedState=null,y.updateQueue=null,y.dependencies=null,y.stateNode=null):(y.childLanes=S.childLanes,y.lanes=S.lanes,y.child=S.child,y.subtreeFlags=0,y.deletions=null,y.memoizedProps=S.memoizedProps,y.memoizedState=S.memoizedState,y.updateQueue=S.updateQueue,y.type=S.type,t=S.dependencies,y.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),i=i.sibling;return wt(Rt,Rt.current&1|2),r.child}t=t.sibling}y.tail!==null&&at()>ys&&(r.flags|=128,c=!0,pi(y,!1),r.lanes=4194304)}else{if(!c)if(t=No(S),t!==null){if(r.flags|=128,c=!0,i=t.updateQueue,i!==null&&(r.updateQueue=i,r.flags|=4),pi(y,!0),y.tail===null&&y.tailMode==="hidden"&&!S.alternate&&!Tt)return dn(r),null}else 2*at()-y.renderingStartTime>ys&&i!==1073741824&&(r.flags|=128,c=!0,pi(y,!1),r.lanes=4194304);y.isBackwards?(S.sibling=r.child,r.child=S):(i=y.last,i!==null?i.sibling=S:r.child=S,y.last=S)}return y.tail!==null?(r=y.tail,y.rendering=r,y.tail=r.sibling,y.renderingStartTime=at(),r.sibling=null,i=Rt.current,wt(Rt,c?i&1|2:i&1),r):(dn(r),null);case 22:case 23:return Nu(),c=r.memoizedState!==null,t!==null&&t.memoizedState!==null!==c&&(r.flags|=8192),c&&(r.mode&1)!==0?(An&1073741824)!==0&&(dn(r),r.subtreeFlags&6&&(r.flags|=8192)):dn(r),null;case 24:return null;case 25:return null}throw Error(a(156,r.tag))}function Q2(t,r){switch(Lc(r),r.tag){case 1:return Cn(r.type)&&go(),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return ps(),jt(Sn),jt(cn),Xc(),t=r.flags,(t&65536)!==0&&(t&128)===0?(r.flags=t&-65537|128,r):null;case 5:return Yc(r),null;case 13:if(jt(Rt),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(a(340));us()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return jt(Rt),null;case 4:return ps(),null;case 10:return Uc(r.type._context),null;case 22:case 23:return Nu(),null;case 24:return null;default:return null}}var Lo=!1,fn=!1,Z2=typeof WeakSet=="function"?WeakSet:Set,Ce=null;function gs(t,r){var i=t.ref;if(i!==null)if(typeof i=="function")try{i(null)}catch(c){Ft(t,r,c)}else i.current=null}function mu(t,r,i){try{i()}catch(c){Ft(t,r,c)}}var Up=!1;function ev(t,r){if(Nc=to,t=bh(),vc(t)){if("selectionStart"in t)var i={start:t.selectionStart,end:t.selectionEnd};else e:{i=(i=t.ownerDocument)&&i.defaultView||window;var c=i.getSelection&&i.getSelection();if(c&&c.rangeCount!==0){i=c.anchorNode;var p=c.anchorOffset,y=c.focusNode;c=c.focusOffset;try{i.nodeType,y.nodeType}catch{i=null;break e}var S=0,D=-1,B=-1,ne=0,fe=0,he=t,de=null;t:for(;;){for(var ke;he!==i||p!==0&&he.nodeType!==3||(D=S+p),he!==y||c!==0&&he.nodeType!==3||(B=S+c),he.nodeType===3&&(S+=he.nodeValue.length),(ke=he.firstChild)!==null;)de=he,he=ke;for(;;){if(he===t)break t;if(de===i&&++ne===p&&(D=S),de===y&&++fe===c&&(B=S),(ke=he.nextSibling)!==null)break;he=de,de=he.parentNode}he=ke}i=D===-1||B===-1?null:{start:D,end:B}}else i=null}i=i||{start:0,end:0}}else i=null;for(Tc={focusedElem:t,selectionRange:i},to=!1,Ce=r;Ce!==null;)if(r=Ce,t=r.child,(r.subtreeFlags&1028)!==0&&t!==null)t.return=r,Ce=t;else for(;Ce!==null;){r=Ce;try{var Ee=r.alternate;if((r.flags&1024)!==0)switch(r.tag){case 0:case 11:case 15:break;case 1:if(Ee!==null){var Pe=Ee.memoizedProps,Bt=Ee.memoizedState,Q=r.stateNode,$=Q.getSnapshotBeforeUpdate(r.elementType===r.type?Pe:ir(r.type,Pe),Bt);Q.__reactInternalSnapshotBeforeUpdate=$}break;case 3:var Z=r.stateNode.containerInfo;Z.nodeType===1?Z.textContent="":Z.nodeType===9&&Z.documentElement&&Z.removeChild(Z.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(pe){Ft(r,r.return,pe)}if(t=r.sibling,t!==null){t.return=r.return,Ce=t;break}Ce=r.return}return Ee=Up,Up=!1,Ee}function mi(t,r,i){var c=r.updateQueue;if(c=c!==null?c.lastEffect:null,c!==null){var p=c=c.next;do{if((p.tag&t)===t){var y=p.destroy;p.destroy=void 0,y!==void 0&&mu(r,i,y)}p=p.next}while(p!==c)}}function Ao(t,r){if(r=r.updateQueue,r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var c=i.create;i.destroy=c()}i=i.next}while(i!==r)}}function gu(t){var r=t.ref;if(r!==null){var i=t.stateNode;switch(t.tag){case 5:t=i;break;default:t=i}typeof r=="function"?r(t):r.current=t}}function $p(t){var r=t.alternate;r!==null&&(t.alternate=null,$p(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&(delete r[br],delete r[ai],delete r[Fc],delete r[L2],delete r[A2])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function Hp(t){return t.tag===5||t.tag===3||t.tag===4}function Wp(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Hp(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function xu(t,r,i){var c=t.tag;if(c===5||c===6)t=t.stateNode,r?i.nodeType===8?i.parentNode.insertBefore(t,r):i.insertBefore(t,r):(i.nodeType===8?(r=i.parentNode,r.insertBefore(t,i)):(r=i,r.appendChild(t)),i=i._reactRootContainer,i!=null||r.onclick!==null||(r.onclick=po));else if(c!==4&&(t=t.child,t!==null))for(xu(t,r,i),t=t.sibling;t!==null;)xu(t,r,i),t=t.sibling}function yu(t,r,i){var c=t.tag;if(c===5||c===6)t=t.stateNode,r?i.insertBefore(t,r):i.appendChild(t);else if(c!==4&&(t=t.child,t!==null))for(yu(t,r,i),t=t.sibling;t!==null;)yu(t,r,i),t=t.sibling}var en=null,or=!1;function ia(t,r,i){for(i=i.child;i!==null;)Kp(t,r,i),i=i.sibling}function Kp(t,r,i){if(Wt&&typeof Wt.onCommitFiberUnmount=="function")try{Wt.onCommitFiberUnmount(Wr,i)}catch{}switch(i.tag){case 5:fn||gs(i,r);case 6:var c=en,p=or;en=null,ia(t,r,i),en=c,or=p,en!==null&&(or?(t=en,i=i.stateNode,t.nodeType===8?t.parentNode.removeChild(i):t.removeChild(i)):en.removeChild(i.stateNode));break;case 18:en!==null&&(or?(t=en,i=i.stateNode,t.nodeType===8?Mc(t.parentNode,i):t.nodeType===1&&Mc(t,i),Ys(t)):Mc(en,i.stateNode));break;case 4:c=en,p=or,en=i.stateNode.containerInfo,or=!0,ia(t,r,i),en=c,or=p;break;case 0:case 11:case 14:case 15:if(!fn&&(c=i.updateQueue,c!==null&&(c=c.lastEffect,c!==null))){p=c=c.next;do{var y=p,S=y.destroy;y=y.tag,S!==void 0&&((y&2)!==0||(y&4)!==0)&&mu(i,r,S),p=p.next}while(p!==c)}ia(t,r,i);break;case 1:if(!fn&&(gs(i,r),c=i.stateNode,typeof c.componentWillUnmount=="function"))try{c.props=i.memoizedProps,c.state=i.memoizedState,c.componentWillUnmount()}catch(D){Ft(i,r,D)}ia(t,r,i);break;case 21:ia(t,r,i);break;case 22:i.mode&1?(fn=(c=fn)||i.memoizedState!==null,ia(t,r,i),fn=c):ia(t,r,i);break;default:ia(t,r,i)}}function Yp(t){var r=t.updateQueue;if(r!==null){t.updateQueue=null;var i=t.stateNode;i===null&&(i=t.stateNode=new Z2),r.forEach(function(c){var p=cv.bind(null,t,c);i.has(c)||(i.add(c),c.then(p,p))})}}function lr(t,r){var i=r.deletions;if(i!==null)for(var c=0;c<i.length;c++){var p=i[c];try{var y=t,S=r,D=S;e:for(;D!==null;){switch(D.tag){case 5:en=D.stateNode,or=!1;break e;case 3:en=D.stateNode.containerInfo,or=!0;break e;case 4:en=D.stateNode.containerInfo,or=!0;break e}D=D.return}if(en===null)throw Error(a(160));Kp(y,S,p),en=null,or=!1;var B=p.alternate;B!==null&&(B.return=null),p.return=null}catch(ne){Ft(p,r,ne)}}if(r.subtreeFlags&12854)for(r=r.child;r!==null;)Gp(r,t),r=r.sibling}function Gp(t,r){var i=t.alternate,c=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(lr(r,t),Sr(t),c&4){try{mi(3,t,t.return),Ao(3,t)}catch(Pe){Ft(t,t.return,Pe)}try{mi(5,t,t.return)}catch(Pe){Ft(t,t.return,Pe)}}break;case 1:lr(r,t),Sr(t),c&512&&i!==null&&gs(i,i.return);break;case 5:if(lr(r,t),Sr(t),c&512&&i!==null&&gs(i,i.return),t.flags&32){var p=t.stateNode;try{Je(p,"")}catch(Pe){Ft(t,t.return,Pe)}}if(c&4&&(p=t.stateNode,p!=null)){var y=t.memoizedProps,S=i!==null?i.memoizedProps:y,D=t.type,B=t.updateQueue;if(t.updateQueue=null,B!==null)try{D==="input"&&y.type==="radio"&&y.name!=null&&vt(p,y),it(D,S);var ne=it(D,y);for(S=0;S<B.length;S+=2){var fe=B[S],he=B[S+1];fe==="style"?Te(p,he):fe==="dangerouslySetInnerHTML"?Pt(p,he):fe==="children"?Je(p,he):_(p,fe,he,ne)}switch(D){case"input":Se(p,y);break;case"textarea":Qe(p,y);break;case"select":var de=p._wrapperState.wasMultiple;p._wrapperState.wasMultiple=!!y.multiple;var ke=y.value;ke!=null?Fe(p,!!y.multiple,ke,!1):de!==!!y.multiple&&(y.defaultValue!=null?Fe(p,!!y.multiple,y.defaultValue,!0):Fe(p,!!y.multiple,y.multiple?[]:"",!1))}p[ai]=y}catch(Pe){Ft(t,t.return,Pe)}}break;case 6:if(lr(r,t),Sr(t),c&4){if(t.stateNode===null)throw Error(a(162));p=t.stateNode,y=t.memoizedProps;try{p.nodeValue=y}catch(Pe){Ft(t,t.return,Pe)}}break;case 3:if(lr(r,t),Sr(t),c&4&&i!==null&&i.memoizedState.isDehydrated)try{Ys(r.containerInfo)}catch(Pe){Ft(t,t.return,Pe)}break;case 4:lr(r,t),Sr(t);break;case 13:lr(r,t),Sr(t),p=t.child,p.flags&8192&&(y=p.memoizedState!==null,p.stateNode.isHidden=y,!y||p.alternate!==null&&p.alternate.memoizedState!==null||(wu=at())),c&4&&Yp(t);break;case 22:if(fe=i!==null&&i.memoizedState!==null,t.mode&1?(fn=(ne=fn)||fe,lr(r,t),fn=ne):lr(r,t),Sr(t),c&8192){if(ne=t.memoizedState!==null,(t.stateNode.isHidden=ne)&&!fe&&(t.mode&1)!==0)for(Ce=t,fe=t.child;fe!==null;){for(he=Ce=fe;Ce!==null;){switch(de=Ce,ke=de.child,de.tag){case 0:case 11:case 14:case 15:mi(4,de,de.return);break;case 1:gs(de,de.return);var Ee=de.stateNode;if(typeof Ee.componentWillUnmount=="function"){c=de,i=de.return;try{r=c,Ee.props=r.memoizedProps,Ee.state=r.memoizedState,Ee.componentWillUnmount()}catch(Pe){Ft(c,i,Pe)}}break;case 5:gs(de,de.return);break;case 22:if(de.memoizedState!==null){Jp(he);continue}}ke!==null?(ke.return=de,Ce=ke):Jp(he)}fe=fe.sibling}e:for(fe=null,he=t;;){if(he.tag===5){if(fe===null){fe=he;try{p=he.stateNode,ne?(y=p.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none"):(D=he.stateNode,B=he.memoizedProps.style,S=B!=null&&B.hasOwnProperty("display")?B.display:null,D.style.display=Mn("display",S))}catch(Pe){Ft(t,t.return,Pe)}}}else if(he.tag===6){if(fe===null)try{he.stateNode.nodeValue=ne?"":he.memoizedProps}catch(Pe){Ft(t,t.return,Pe)}}else if((he.tag!==22&&he.tag!==23||he.memoizedState===null||he===t)&&he.child!==null){he.child.return=he,he=he.child;continue}if(he===t)break e;for(;he.sibling===null;){if(he.return===null||he.return===t)break e;fe===he&&(fe=null),he=he.return}fe===he&&(fe=null),he.sibling.return=he.return,he=he.sibling}}break;case 19:lr(r,t),Sr(t),c&4&&Yp(t);break;case 21:break;default:lr(r,t),Sr(t)}}function Sr(t){var r=t.flags;if(r&2){try{e:{for(var i=t.return;i!==null;){if(Hp(i)){var c=i;break e}i=i.return}throw Error(a(160))}switch(c.tag){case 5:var p=c.stateNode;c.flags&32&&(Je(p,""),c.flags&=-33);var y=Wp(t);yu(t,y,p);break;case 3:case 4:var S=c.stateNode.containerInfo,D=Wp(t);xu(t,D,S);break;default:throw Error(a(161))}}catch(B){Ft(t,t.return,B)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function tv(t,r,i){Ce=t,Xp(t)}function Xp(t,r,i){for(var c=(t.mode&1)!==0;Ce!==null;){var p=Ce,y=p.child;if(p.tag===22&&c){var S=p.memoizedState!==null||Lo;if(!S){var D=p.alternate,B=D!==null&&D.memoizedState!==null||fn;D=Lo;var ne=fn;if(Lo=S,(fn=B)&&!ne)for(Ce=p;Ce!==null;)S=Ce,B=S.child,S.tag===22&&S.memoizedState!==null?Qp(p):B!==null?(B.return=S,Ce=B):Qp(p);for(;y!==null;)Ce=y,Xp(y),y=y.sibling;Ce=p,Lo=D,fn=ne}qp(t)}else(p.subtreeFlags&8772)!==0&&y!==null?(y.return=p,Ce=y):qp(t)}}function qp(t){for(;Ce!==null;){var r=Ce;if((r.flags&8772)!==0){var i=r.alternate;try{if((r.flags&8772)!==0)switch(r.tag){case 0:case 11:case 15:fn||Ao(5,r);break;case 1:var c=r.stateNode;if(r.flags&4&&!fn)if(i===null)c.componentDidMount();else{var p=r.elementType===r.type?i.memoizedProps:ir(r.type,i.memoizedProps);c.componentDidUpdate(p,i.memoizedState,c.__reactInternalSnapshotBeforeUpdate)}var y=r.updateQueue;y!==null&&Jh(r,y,c);break;case 3:var S=r.updateQueue;if(S!==null){if(i=null,r.child!==null)switch(r.child.tag){case 5:i=r.child.stateNode;break;case 1:i=r.child.stateNode}Jh(r,S,i)}break;case 5:var D=r.stateNode;if(i===null&&r.flags&4){i=D;var B=r.memoizedProps;switch(r.type){case"button":case"input":case"select":case"textarea":B.autoFocus&&i.focus();break;case"img":B.src&&(i.src=B.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(r.memoizedState===null){var ne=r.alternate;if(ne!==null){var fe=ne.memoizedState;if(fe!==null){var he=fe.dehydrated;he!==null&&Ys(he)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(a(163))}fn||r.flags&512&&gu(r)}catch(de){Ft(r,r.return,de)}}if(r===t){Ce=null;break}if(i=r.sibling,i!==null){i.return=r.return,Ce=i;break}Ce=r.return}}function Jp(t){for(;Ce!==null;){var r=Ce;if(r===t){Ce=null;break}var i=r.sibling;if(i!==null){i.return=r.return,Ce=i;break}Ce=r.return}}function Qp(t){for(;Ce!==null;){var r=Ce;try{switch(r.tag){case 0:case 11:case 15:var i=r.return;try{Ao(4,r)}catch(B){Ft(r,i,B)}break;case 1:var c=r.stateNode;if(typeof c.componentDidMount=="function"){var p=r.return;try{c.componentDidMount()}catch(B){Ft(r,p,B)}}var y=r.return;try{gu(r)}catch(B){Ft(r,y,B)}break;case 5:var S=r.return;try{gu(r)}catch(B){Ft(r,S,B)}}}catch(B){Ft(r,r.return,B)}if(r===t){Ce=null;break}var D=r.sibling;if(D!==null){D.return=r.return,Ce=D;break}Ce=r.return}}var nv=Math.ceil,Oo=V.ReactCurrentDispatcher,vu=V.ReactCurrentOwner,Kn=V.ReactCurrentBatchConfig,lt=0,qt=null,zt=null,tn=0,An=0,xs=ta(0),Yt=0,gi=null,Fa=0,Bo=0,bu=0,xi=null,En=null,wu=0,ys=1/0,Hr=null,zo=!1,ku=null,oa=null,Vo=!1,la=null,Uo=0,yi=0,Su=null,$o=-1,Ho=0;function xn(){return(lt&6)!==0?at():$o!==-1?$o:$o=at()}function ca(t){return(t.mode&1)===0?1:(lt&2)!==0&&tn!==0?tn&-tn:B2.transition!==null?(Ho===0&&(Ho=Qi()),Ho):(t=mt,t!==0||(t=window.event,t=t===void 0?16:eh(t.type)),t)}function cr(t,r,i,c){if(50<yi)throw yi=0,Su=null,Error(a(185));Us(t,i,c),((lt&2)===0||t!==qt)&&(t===qt&&((lt&2)===0&&(Bo|=i),Yt===4&&ua(t,tn)),Nn(t,c),i===1&&lt===0&&(r.mode&1)===0&&(ys=at()+500,yo&&ra()))}function Nn(t,r){var i=t.callbackNode;Lr(t,r);var c=Yr(t,t===qt?tn:0);if(c===0)i!==null&&Ot(i),t.callbackNode=null,t.callbackPriority=0;else if(r=c&-c,t.callbackPriority!==r){if(i!=null&&Ot(i),r===1)t.tag===0?O2(e0.bind(null,t)):Bh(e0.bind(null,t)),D2(function(){(lt&6)===0&&ra()}),i=null;else{switch(Kf(c)){case 1:i=_r;break;case 4:i=nr;break;case 16:i=rr;break;case 536870912:i=In;break;default:i=rr}i=l0(i,Zp.bind(null,t))}t.callbackPriority=r,t.callbackNode=i}}function Zp(t,r){if($o=-1,Ho=0,(lt&6)!==0)throw Error(a(327));var i=t.callbackNode;if(vs()&&t.callbackNode!==i)return null;var c=Yr(t,t===qt?tn:0);if(c===0)return null;if((c&30)!==0||(c&t.expiredLanes)!==0||r)r=Wo(t,c);else{r=c;var p=lt;lt|=2;var y=n0();(qt!==t||tn!==r)&&(Hr=null,ys=at()+500,Da(t,r));do try{sv();break}catch(D){t0(t,D)}while(!0);Vc(),Oo.current=y,lt=p,zt!==null?r=0:(qt=null,tn=0,r=Yt)}if(r!==0){if(r===2&&(p=Ja(t),p!==0&&(c=p,r=Cu(t,p))),r===1)throw i=gi,Da(t,0),ua(t,c),Nn(t,at()),i;if(r===6)ua(t,c);else{if(p=t.current.alternate,(c&30)===0&&!rv(p)&&(r=Wo(t,c),r===2&&(y=Ja(t),y!==0&&(c=y,r=Cu(t,y))),r===1))throw i=gi,Da(t,0),ua(t,c),Nn(t,at()),i;switch(t.finishedWork=p,t.finishedLanes=c,r){case 0:case 1:throw Error(a(345));case 2:_a(t,En,Hr);break;case 3:if(ua(t,c),(c&130023424)===c&&(r=wu+500-at(),10<r)){if(Yr(t,0)!==0)break;if(p=t.suspendedLanes,(p&c)!==c){xn(),t.pingedLanes|=t.suspendedLanes&p;break}t.timeoutHandle=Rc(_a.bind(null,t,En,Hr),r);break}_a(t,En,Hr);break;case 4:if(ua(t,c),(c&4194240)===c)break;for(r=t.eventTimes,p=-1;0<c;){var S=31-on(c);y=1<<S,S=r[S],S>p&&(p=S),c&=~y}if(c=p,c=at()-c,c=(120>c?120:480>c?480:1080>c?1080:1920>c?1920:3e3>c?3e3:4320>c?4320:1960*nv(c/1960))-c,10<c){t.timeoutHandle=Rc(_a.bind(null,t,En,Hr),c);break}_a(t,En,Hr);break;case 5:_a(t,En,Hr);break;default:throw Error(a(329))}}}return Nn(t,at()),t.callbackNode===i?Zp.bind(null,t):null}function Cu(t,r){var i=xi;return t.current.memoizedState.isDehydrated&&(Da(t,r).flags|=256),t=Wo(t,r),t!==2&&(r=En,En=i,r!==null&&ju(r)),t}function ju(t){En===null?En=t:En.push.apply(En,t)}function rv(t){for(var r=t;;){if(r.flags&16384){var i=r.updateQueue;if(i!==null&&(i=i.stores,i!==null))for(var c=0;c<i.length;c++){var p=i[c],y=p.getSnapshot;p=p.value;try{if(!ar(y(),p))return!1}catch{return!1}}}if(i=r.child,r.subtreeFlags&16384&&i!==null)i.return=r,r=i;else{if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function ua(t,r){for(r&=~bu,r&=~Bo,t.suspendedLanes|=r,t.pingedLanes&=~r,t=t.expirationTimes;0<r;){var i=31-on(r),c=1<<i;t[i]=-1,r&=~c}}function e0(t){if((lt&6)!==0)throw Error(a(327));vs();var r=Yr(t,0);if((r&1)===0)return Nn(t,at()),null;var i=Wo(t,r);if(t.tag!==0&&i===2){var c=Ja(t);c!==0&&(r=c,i=Cu(t,c))}if(i===1)throw i=gi,Da(t,0),ua(t,r),Nn(t,at()),i;if(i===6)throw Error(a(345));return t.finishedWork=t.current.alternate,t.finishedLanes=r,_a(t,En,Hr),Nn(t,at()),null}function Eu(t,r){var i=lt;lt|=1;try{return t(r)}finally{lt=i,lt===0&&(ys=at()+500,yo&&ra())}}function Ia(t){la!==null&&la.tag===0&&(lt&6)===0&&vs();var r=lt;lt|=1;var i=Kn.transition,c=mt;try{if(Kn.transition=null,mt=1,t)return t()}finally{mt=c,Kn.transition=i,lt=r,(lt&6)===0&&ra()}}function Nu(){An=xs.current,jt(xs)}function Da(t,r){t.finishedWork=null,t.finishedLanes=0;var i=t.timeoutHandle;if(i!==-1&&(t.timeoutHandle=-1,I2(i)),zt!==null)for(i=zt.return;i!==null;){var c=i;switch(Lc(c),c.tag){case 1:c=c.type.childContextTypes,c!=null&&go();break;case 3:ps(),jt(Sn),jt(cn),Xc();break;case 5:Yc(c);break;case 4:ps();break;case 13:jt(Rt);break;case 19:jt(Rt);break;case 10:Uc(c.type._context);break;case 22:case 23:Nu()}i=i.return}if(qt=t,zt=t=da(t.current,null),tn=An=r,Yt=0,gi=null,bu=Bo=Fa=0,En=xi=null,Pa!==null){for(r=0;r<Pa.length;r++)if(i=Pa[r],c=i.interleaved,c!==null){i.interleaved=null;var p=c.next,y=i.pending;if(y!==null){var S=y.next;y.next=p,c.next=S}i.pending=c}Pa=null}return t}function t0(t,r){do{var i=zt;try{if(Vc(),To.current=Fo,Po){for(var c=Mt.memoizedState;c!==null;){var p=c.queue;p!==null&&(p.pending=null),c=c.next}Po=!1}if(Ma=0,Xt=Kt=Mt=null,ui=!1,di=0,vu.current=null,i===null||i.return===null){Yt=1,gi=r,zt=null;break}e:{var y=t,S=i.return,D=i,B=r;if(r=tn,D.flags|=32768,B!==null&&typeof B=="object"&&typeof B.then=="function"){var ne=B,fe=D,he=fe.tag;if((fe.mode&1)===0&&(he===0||he===11||he===15)){var de=fe.alternate;de?(fe.updateQueue=de.updateQueue,fe.memoizedState=de.memoizedState,fe.lanes=de.lanes):(fe.updateQueue=null,fe.memoizedState=null)}var ke=Ep(S);if(ke!==null){ke.flags&=-257,Np(ke,S,D,y,r),ke.mode&1&&jp(y,ne,r),r=ke,B=ne;var Ee=r.updateQueue;if(Ee===null){var Pe=new Set;Pe.add(B),r.updateQueue=Pe}else Ee.add(B);break e}else{if((r&1)===0){jp(y,ne,r),Tu();break e}B=Error(a(426))}}else if(Tt&&D.mode&1){var Bt=Ep(S);if(Bt!==null){(Bt.flags&65536)===0&&(Bt.flags|=256),Np(Bt,S,D,y,r),Bc(ms(B,D));break e}}y=B=ms(B,D),Yt!==4&&(Yt=2),xi===null?xi=[y]:xi.push(y),y=S;do{switch(y.tag){case 3:y.flags|=65536,r&=-r,y.lanes|=r;var Q=Sp(y,B,r);qh(y,Q);break e;case 1:D=B;var $=y.type,Z=y.stateNode;if((y.flags&128)===0&&(typeof $.getDerivedStateFromError=="function"||Z!==null&&typeof Z.componentDidCatch=="function"&&(oa===null||!oa.has(Z)))){y.flags|=65536,r&=-r,y.lanes|=r;var pe=Cp(y,D,r);qh(y,pe);break e}}y=y.return}while(y!==null)}a0(i)}catch(Me){r=Me,zt===i&&i!==null&&(zt=i=i.return);continue}break}while(!0)}function n0(){var t=Oo.current;return Oo.current=Fo,t===null?Fo:t}function Tu(){(Yt===0||Yt===3||Yt===2)&&(Yt=4),qt===null||(Fa&268435455)===0&&(Bo&268435455)===0||ua(qt,tn)}function Wo(t,r){var i=lt;lt|=2;var c=n0();(qt!==t||tn!==r)&&(Hr=null,Da(t,r));do try{av();break}catch(p){t0(t,p)}while(!0);if(Vc(),lt=i,Oo.current=c,zt!==null)throw Error(a(261));return qt=null,tn=0,Yt}function av(){for(;zt!==null;)r0(zt)}function sv(){for(;zt!==null&&!St();)r0(zt)}function r0(t){var r=o0(t.alternate,t,An);t.memoizedProps=t.pendingProps,r===null?a0(t):zt=r,vu.current=null}function a0(t){var r=t;do{var i=r.alternate;if(t=r.return,(r.flags&32768)===0){if(i=J2(i,r,An),i!==null){zt=i;return}}else{if(i=Q2(i,r),i!==null){i.flags&=32767,zt=i;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Yt=6,zt=null;return}}if(r=r.sibling,r!==null){zt=r;return}zt=r=t}while(r!==null);Yt===0&&(Yt=5)}function _a(t,r,i){var c=mt,p=Kn.transition;try{Kn.transition=null,mt=1,iv(t,r,i,c)}finally{Kn.transition=p,mt=c}return null}function iv(t,r,i,c){do vs();while(la!==null);if((lt&6)!==0)throw Error(a(327));i=t.finishedWork;var p=t.finishedLanes;if(i===null)return null;if(t.finishedWork=null,t.finishedLanes=0,i===t.current)throw Error(a(177));t.callbackNode=null,t.callbackPriority=0;var y=i.lanes|i.childLanes;if(zy(t,y),t===qt&&(zt=qt=null,tn=0),(i.subtreeFlags&2064)===0&&(i.flags&2064)===0||Vo||(Vo=!0,l0(rr,function(){return vs(),null})),y=(i.flags&15990)!==0,(i.subtreeFlags&15990)!==0||y){y=Kn.transition,Kn.transition=null;var S=mt;mt=1;var D=lt;lt|=4,vu.current=null,ev(t,i),Gp(i,t),E2(Tc),to=!!Nc,Tc=Nc=null,t.current=i,tv(i),pt(),lt=D,mt=S,Kn.transition=y}else t.current=i;if(Vo&&(Vo=!1,la=t,Uo=p),y=t.pendingLanes,y===0&&(oa=null),Xa(i.stateNode),Nn(t,at()),r!==null)for(c=t.onRecoverableError,i=0;i<r.length;i++)p=r[i],c(p.value,{componentStack:p.stack,digest:p.digest});if(zo)throw zo=!1,t=ku,ku=null,t;return(Uo&1)!==0&&t.tag!==0&&vs(),y=t.pendingLanes,(y&1)!==0?t===Su?yi++:(yi=0,Su=t):yi=0,ra(),null}function vs(){if(la!==null){var t=Kf(Uo),r=Kn.transition,i=mt;try{if(Kn.transition=null,mt=16>t?16:t,la===null)var c=!1;else{if(t=la,la=null,Uo=0,(lt&6)!==0)throw Error(a(331));var p=lt;for(lt|=4,Ce=t.current;Ce!==null;){var y=Ce,S=y.child;if((Ce.flags&16)!==0){var D=y.deletions;if(D!==null){for(var B=0;B<D.length;B++){var ne=D[B];for(Ce=ne;Ce!==null;){var fe=Ce;switch(fe.tag){case 0:case 11:case 15:mi(8,fe,y)}var he=fe.child;if(he!==null)he.return=fe,Ce=he;else for(;Ce!==null;){fe=Ce;var de=fe.sibling,ke=fe.return;if($p(fe),fe===ne){Ce=null;break}if(de!==null){de.return=ke,Ce=de;break}Ce=ke}}}var Ee=y.alternate;if(Ee!==null){var Pe=Ee.child;if(Pe!==null){Ee.child=null;do{var Bt=Pe.sibling;Pe.sibling=null,Pe=Bt}while(Pe!==null)}}Ce=y}}if((y.subtreeFlags&2064)!==0&&S!==null)S.return=y,Ce=S;else e:for(;Ce!==null;){if(y=Ce,(y.flags&2048)!==0)switch(y.tag){case 0:case 11:case 15:mi(9,y,y.return)}var Q=y.sibling;if(Q!==null){Q.return=y.return,Ce=Q;break e}Ce=y.return}}var $=t.current;for(Ce=$;Ce!==null;){S=Ce;var Z=S.child;if((S.subtreeFlags&2064)!==0&&Z!==null)Z.return=S,Ce=Z;else e:for(S=$;Ce!==null;){if(D=Ce,(D.flags&2048)!==0)try{switch(D.tag){case 0:case 11:case 15:Ao(9,D)}}catch(Me){Ft(D,D.return,Me)}if(D===S){Ce=null;break e}var pe=D.sibling;if(pe!==null){pe.return=D.return,Ce=pe;break e}Ce=D.return}}if(lt=p,ra(),Wt&&typeof Wt.onPostCommitFiberRoot=="function")try{Wt.onPostCommitFiberRoot(Wr,t)}catch{}c=!0}return c}finally{mt=i,Kn.transition=r}}return!1}function s0(t,r,i){r=ms(i,r),r=Sp(t,r,1),t=sa(t,r,1),r=xn(),t!==null&&(Us(t,1,r),Nn(t,r))}function Ft(t,r,i){if(t.tag===3)s0(t,t,i);else for(;r!==null;){if(r.tag===3){s0(r,t,i);break}else if(r.tag===1){var c=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(oa===null||!oa.has(c))){t=ms(i,t),t=Cp(r,t,1),r=sa(r,t,1),t=xn(),r!==null&&(Us(r,1,t),Nn(r,t));break}}r=r.return}}function ov(t,r,i){var c=t.pingCache;c!==null&&c.delete(r),r=xn(),t.pingedLanes|=t.suspendedLanes&i,qt===t&&(tn&i)===i&&(Yt===4||Yt===3&&(tn&130023424)===tn&&500>at()-wu?Da(t,0):bu|=i),Nn(t,r)}function i0(t,r){r===0&&((t.mode&1)===0?r=1:(r=kn,kn<<=1,(kn&130023424)===0&&(kn=4194304)));var i=xn();t=Vr(t,r),t!==null&&(Us(t,r,i),Nn(t,i))}function lv(t){var r=t.memoizedState,i=0;r!==null&&(i=r.retryLane),i0(t,i)}function cv(t,r){var i=0;switch(t.tag){case 13:var c=t.stateNode,p=t.memoizedState;p!==null&&(i=p.retryLane);break;case 19:c=t.stateNode;break;default:throw Error(a(314))}c!==null&&c.delete(r),i0(t,i)}var o0;o0=function(t,r,i){if(t!==null)if(t.memoizedProps!==r.pendingProps||Sn.current)jn=!0;else{if((t.lanes&i)===0&&(r.flags&128)===0)return jn=!1,q2(t,r,i);jn=(t.flags&131072)!==0}else jn=!1,Tt&&(r.flags&1048576)!==0&&zh(r,bo,r.index);switch(r.lanes=0,r.tag){case 2:var c=r.type;_o(t,r),t=r.pendingProps;var p=os(r,cn.current);hs(r,i),p=Qc(null,r,c,t,p,i);var y=Zc();return r.flags|=1,typeof p=="object"&&p!==null&&typeof p.render=="function"&&p.$$typeof===void 0?(r.tag=1,r.memoizedState=null,r.updateQueue=null,Cn(c)?(y=!0,xo(r)):y=!1,r.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,Wc(r),p.updater=Io,r.stateNode=p,p._reactInternals=r,su(r,c,t,i),r=cu(null,r,c,!0,y,i)):(r.tag=0,Tt&&y&&_c(r),gn(null,r,p,i),r=r.child),r;case 16:c=r.elementType;e:{switch(_o(t,r),t=r.pendingProps,p=c._init,c=p(c._payload),r.type=c,p=r.tag=dv(c),t=ir(c,t),p){case 0:r=lu(null,r,c,t,i);break e;case 1:r=Ip(null,r,c,t,i);break e;case 11:r=Tp(null,r,c,t,i);break e;case 14:r=Pp(null,r,c,ir(c.type,t),i);break e}throw Error(a(306,c,""))}return r;case 0:return c=r.type,p=r.pendingProps,p=r.elementType===c?p:ir(c,p),lu(t,r,c,p,i);case 1:return c=r.type,p=r.pendingProps,p=r.elementType===c?p:ir(c,p),Ip(t,r,c,p,i);case 3:e:{if(Dp(r),t===null)throw Error(a(387));c=r.pendingProps,y=r.memoizedState,p=y.element,Xh(t,r),Eo(r,c,null,i);var S=r.memoizedState;if(c=S.element,y.isDehydrated)if(y={element:c,isDehydrated:!1,cache:S.cache,pendingSuspenseBoundaries:S.pendingSuspenseBoundaries,transitions:S.transitions},r.updateQueue.baseState=y,r.memoizedState=y,r.flags&256){p=ms(Error(a(423)),r),r=_p(t,r,c,i,p);break e}else if(c!==p){p=ms(Error(a(424)),r),r=_p(t,r,c,i,p);break e}else for(Ln=ea(r.stateNode.containerInfo.firstChild),_n=r,Tt=!0,sr=null,i=Yh(r,null,c,i),r.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(us(),c===p){r=$r(t,r,i);break e}gn(t,r,c,i)}r=r.child}return r;case 5:return Qh(r),t===null&&Oc(r),c=r.type,p=r.pendingProps,y=t!==null?t.memoizedProps:null,S=p.children,Pc(c,p)?S=null:y!==null&&Pc(c,y)&&(r.flags|=32),Fp(t,r),gn(t,r,S,i),r.child;case 6:return t===null&&Oc(r),null;case 13:return Lp(t,r,i);case 4:return Kc(r,r.stateNode.containerInfo),c=r.pendingProps,t===null?r.child=ds(r,null,c,i):gn(t,r,c,i),r.child;case 11:return c=r.type,p=r.pendingProps,p=r.elementType===c?p:ir(c,p),Tp(t,r,c,p,i);case 7:return gn(t,r,r.pendingProps,i),r.child;case 8:return gn(t,r,r.pendingProps.children,i),r.child;case 12:return gn(t,r,r.pendingProps.children,i),r.child;case 10:e:{if(c=r.type._context,p=r.pendingProps,y=r.memoizedProps,S=p.value,wt(So,c._currentValue),c._currentValue=S,y!==null)if(ar(y.value,S)){if(y.children===p.children&&!Sn.current){r=$r(t,r,i);break e}}else for(y=r.child,y!==null&&(y.return=r);y!==null;){var D=y.dependencies;if(D!==null){S=y.child;for(var B=D.firstContext;B!==null;){if(B.context===c){if(y.tag===1){B=Ur(-1,i&-i),B.tag=2;var ne=y.updateQueue;if(ne!==null){ne=ne.shared;var fe=ne.pending;fe===null?B.next=B:(B.next=fe.next,fe.next=B),ne.pending=B}}y.lanes|=i,B=y.alternate,B!==null&&(B.lanes|=i),$c(y.return,i,r),D.lanes|=i;break}B=B.next}}else if(y.tag===10)S=y.type===r.type?null:y.child;else if(y.tag===18){if(S=y.return,S===null)throw Error(a(341));S.lanes|=i,D=S.alternate,D!==null&&(D.lanes|=i),$c(S,i,r),S=y.sibling}else S=y.child;if(S!==null)S.return=y;else for(S=y;S!==null;){if(S===r){S=null;break}if(y=S.sibling,y!==null){y.return=S.return,S=y;break}S=S.return}y=S}gn(t,r,p.children,i),r=r.child}return r;case 9:return p=r.type,c=r.pendingProps.children,hs(r,i),p=Hn(p),c=c(p),r.flags|=1,gn(t,r,c,i),r.child;case 14:return c=r.type,p=ir(c,r.pendingProps),p=ir(c.type,p),Pp(t,r,c,p,i);case 15:return Rp(t,r,r.type,r.pendingProps,i);case 17:return c=r.type,p=r.pendingProps,p=r.elementType===c?p:ir(c,p),_o(t,r),r.tag=1,Cn(c)?(t=!0,xo(r)):t=!1,hs(r,i),wp(r,c,p),su(r,c,p,i),cu(null,r,c,!0,t,i);case 19:return Op(t,r,i);case 22:return Mp(t,r,i)}throw Error(a(156,r.tag))};function l0(t,r){return ut(t,r)}function uv(t,r,i,c){this.tag=t,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Yn(t,r,i,c){return new uv(t,r,i,c)}function Pu(t){return t=t.prototype,!(!t||!t.isReactComponent)}function dv(t){if(typeof t=="function")return Pu(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Y)return 11;if(t===te)return 14}return 2}function da(t,r){var i=t.alternate;return i===null?(i=Yn(t.tag,r,t.key,t.mode),i.elementType=t.elementType,i.type=t.type,i.stateNode=t.stateNode,i.alternate=t,t.alternate=i):(i.pendingProps=r,i.type=t.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=t.flags&14680064,i.childLanes=t.childLanes,i.lanes=t.lanes,i.child=t.child,i.memoizedProps=t.memoizedProps,i.memoizedState=t.memoizedState,i.updateQueue=t.updateQueue,r=t.dependencies,i.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},i.sibling=t.sibling,i.index=t.index,i.ref=t.ref,i}function Ko(t,r,i,c,p,y){var S=2;if(c=t,typeof t=="function")Pu(t)&&(S=1);else if(typeof t=="string")S=5;else e:switch(t){case O:return La(i.children,p,y,r);case b:S=8,p|=8;break;case R:return t=Yn(12,i,r,p|2),t.elementType=R,t.lanes=y,t;case X:return t=Yn(13,i,r,p),t.elementType=X,t.lanes=y,t;case K:return t=Yn(19,i,r,p),t.elementType=K,t.lanes=y,t;case P:return Yo(i,p,y,r);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case N:S=10;break e;case G:S=9;break e;case Y:S=11;break e;case te:S=14;break e;case q:S=16,c=null;break e}throw Error(a(130,t==null?t:typeof t,""))}return r=Yn(S,i,r,p),r.elementType=t,r.type=c,r.lanes=y,r}function La(t,r,i,c){return t=Yn(7,t,c,r),t.lanes=i,t}function Yo(t,r,i,c){return t=Yn(22,t,c,r),t.elementType=P,t.lanes=i,t.stateNode={isHidden:!1},t}function Ru(t,r,i){return t=Yn(6,t,null,r),t.lanes=i,t}function Mu(t,r,i){return r=Yn(4,t.children!==null?t.children:[],t.key,r),r.lanes=i,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}function fv(t,r,i,c,p){this.tag=r,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ac(0),this.expirationTimes=ac(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ac(0),this.identifierPrefix=c,this.onRecoverableError=p,this.mutableSourceEagerHydrationData=null}function Fu(t,r,i,c,p,y,S,D,B){return t=new fv(t,r,i,D,B),r===1?(r=1,y===!0&&(r|=8)):r=0,y=Yn(3,null,null,r),t.current=y,y.stateNode=t,y.memoizedState={element:c,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},Wc(y),t}function hv(t,r,i){var c=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:re,key:c==null?null:""+c,children:t,containerInfo:r,implementation:i}}function c0(t){if(!t)return na;t=t._reactInternals;e:{if(xe(t)!==t||t.tag!==1)throw Error(a(170));var r=t;do{switch(r.tag){case 3:r=r.stateNode.context;break e;case 1:if(Cn(r.type)){r=r.stateNode.__reactInternalMemoizedMergedChildContext;break e}}r=r.return}while(r!==null);throw Error(a(171))}if(t.tag===1){var i=t.type;if(Cn(i))return Ah(t,i,r)}return r}function u0(t,r,i,c,p,y,S,D,B){return t=Fu(i,c,!0,t,p,y,S,D,B),t.context=c0(null),i=t.current,c=xn(),p=ca(i),y=Ur(c,p),y.callback=r??null,sa(i,y,p),t.current.lanes=p,Us(t,p,c),Nn(t,c),t}function Go(t,r,i,c){var p=r.current,y=xn(),S=ca(p);return i=c0(i),r.context===null?r.context=i:r.pendingContext=i,r=Ur(y,S),r.payload={element:t},c=c===void 0?null:c,c!==null&&(r.callback=c),t=sa(p,r,S),t!==null&&(cr(t,p,S,y),jo(t,p,S)),S}function Xo(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function d0(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var i=t.retryLane;t.retryLane=i!==0&&i<r?i:r}}function Iu(t,r){d0(t,r),(t=t.alternate)&&d0(t,r)}function pv(){return null}var f0=typeof reportError=="function"?reportError:function(t){console.error(t)};function Du(t){this._internalRoot=t}qo.prototype.render=Du.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(a(409));Go(t,r,null,null)},qo.prototype.unmount=Du.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;Ia(function(){Go(null,t,null,null)}),r[Ar]=null}};function qo(t){this._internalRoot=t}qo.prototype.unstable_scheduleHydration=function(t){if(t){var r=Xf();t={blockedOn:null,target:t,priority:r};for(var i=0;i<Jr.length&&r!==0&&r<Jr[i].priority;i++);Jr.splice(i,0,t),i===0&&Qf(t)}};function _u(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Jo(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function h0(){}function mv(t,r,i,c,p){if(p){if(typeof c=="function"){var y=c;c=function(){var ne=Xo(S);y.call(ne)}}var S=u0(r,c,t,0,null,!1,!1,"",h0);return t._reactRootContainer=S,t[Ar]=S.current,ni(t.nodeType===8?t.parentNode:t),Ia(),S}for(;p=t.lastChild;)t.removeChild(p);if(typeof c=="function"){var D=c;c=function(){var ne=Xo(B);D.call(ne)}}var B=Fu(t,0,!1,null,null,!1,!1,"",h0);return t._reactRootContainer=B,t[Ar]=B.current,ni(t.nodeType===8?t.parentNode:t),Ia(function(){Go(r,B,i,c)}),B}function Qo(t,r,i,c,p){var y=i._reactRootContainer;if(y){var S=y;if(typeof p=="function"){var D=p;p=function(){var B=Xo(S);D.call(B)}}Go(r,S,t,p)}else S=mv(i,r,t,p,c);return Xo(S)}Yf=function(t){switch(t.tag){case 3:var r=t.stateNode;if(r.current.memoizedState.isDehydrated){var i=Kr(r.pendingLanes);i!==0&&(sc(r,i|1),Nn(r,at()),(lt&6)===0&&(ys=at()+500,ra()))}break;case 13:Ia(function(){var c=Vr(t,1);if(c!==null){var p=xn();cr(c,t,1,p)}}),Iu(t,1)}},ic=function(t){if(t.tag===13){var r=Vr(t,134217728);if(r!==null){var i=xn();cr(r,t,134217728,i)}Iu(t,134217728)}},Gf=function(t){if(t.tag===13){var r=ca(t),i=Vr(t,r);if(i!==null){var c=xn();cr(i,t,r,c)}Iu(t,r)}},Xf=function(){return mt},qf=function(t,r){var i=mt;try{return mt=t,r()}finally{mt=i}},xr=function(t,r,i){switch(r){case"input":if(Se(t,i),r=i.name,i.type==="radio"&&r!=null){for(i=t;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll("input[name="+JSON.stringify(""+r)+'][type="radio"]'),r=0;r<i.length;r++){var c=i[r];if(c!==t&&c.form===t.form){var p=mo(c);if(!p)throw Error(a(90));Ue(c),Se(c,p)}}}break;case"textarea":Qe(t,i);break;case"select":r=i.value,r!=null&&Fe(t,!!i.multiple,r,!1)}},Lt=Eu,$t=Ia;var gv={usingClientEntryPoint:!1,Events:[si,ss,mo,Ye,Nt,Eu]},vi={findFiberByHostInstance:ja,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},xv={bundleType:vi.bundleType,version:vi.version,rendererPackageName:vi.rendererPackageName,rendererConfig:vi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:V.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=Le(t),t===null?null:t.stateNode},findFiberByHostInstance:vi.findFiberByHostInstance||pv,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Zo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zo.isDisabled&&Zo.supportsFiber)try{Wr=Zo.inject(xv),Wt=Zo}catch{}}return Tn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=gv,Tn.createPortal=function(t,r){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!_u(r))throw Error(a(200));return hv(t,r,null,i)},Tn.createRoot=function(t,r){if(!_u(t))throw Error(a(299));var i=!1,c="",p=f0;return r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(c=r.identifierPrefix),r.onRecoverableError!==void 0&&(p=r.onRecoverableError)),r=Fu(t,1,!1,null,null,i,!1,c,p),t[Ar]=r.current,ni(t.nodeType===8?t.parentNode:t),new Du(r)},Tn.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var r=t._reactInternals;if(r===void 0)throw typeof t.render=="function"?Error(a(188)):(t=Object.keys(t).join(","),Error(a(268,t)));return t=Le(r),t=t===null?null:t.stateNode,t},Tn.flushSync=function(t){return Ia(t)},Tn.hydrate=function(t,r,i){if(!Jo(r))throw Error(a(200));return Qo(null,t,r,!0,i)},Tn.hydrateRoot=function(t,r,i){if(!_u(t))throw Error(a(405));var c=i!=null&&i.hydratedSources||null,p=!1,y="",S=f0;if(i!=null&&(i.unstable_strictMode===!0&&(p=!0),i.identifierPrefix!==void 0&&(y=i.identifierPrefix),i.onRecoverableError!==void 0&&(S=i.onRecoverableError)),r=u0(r,null,t,1,i??null,p,!1,y,S),t[Ar]=r.current,ni(t),c)for(t=0;t<c.length;t++)i=c[t],p=i._getVersion,p=p(i._source),r.mutableSourceEagerHydrationData==null?r.mutableSourceEagerHydrationData=[i,p]:r.mutableSourceEagerHydrationData.push(i,p);return new qo(r)},Tn.render=function(t,r,i){if(!Jo(r))throw Error(a(200));return Qo(null,t,r,!1,i)},Tn.unmountComponentAtNode=function(t){if(!Jo(t))throw Error(a(40));return t._reactRootContainer?(Ia(function(){Qo(null,null,t,!1,function(){t._reactRootContainer=null,t[Ar]=null})}),!0):!1},Tn.unstable_batchedUpdates=Eu,Tn.unstable_renderSubtreeIntoContainer=function(t,r,i,c){if(!Jo(i))throw Error(a(200));if(t==null||t._reactInternals===void 0)throw Error(a(38));return Qo(t,r,i,!1,c)},Tn.version="18.3.1-next-f1338f8080-20240426",Tn}var w0;function Lg(){if(w0)return Ou.exports;w0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Ou.exports=jv(),Ou.exports}var k0;function Ev(){if(k0)return el;k0=1;var e=Lg();return el.createRoot=e.createRoot,el.hydrateRoot=e.hydrateRoot,el}var Nv=Ev(),v=Ul();const ge=_g(v),Tv=vv({__proto__:null,default:ge},[v]);/**
* react-router v7.15.1
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/var Ag=e=>{throw TypeError(e)},Og=(e,n,a)=>n.has(e)||Ag("Cannot "+a),Gn=(e,n,a)=>(Og(e,n,"read from private field"),a?a.call(e):n.get(e)),Ei=(e,n,a)=>n.has(e)?Ag("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,a),Cr=(e,n,a,s)=>(Og(e,n,"write to private field"),n.set(e,a),a),S0="popstate";function C0(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function Pv(e={}){function n(s,o){var m;let l=(m=o.state)==null?void 0:m.masked,{pathname:d,search:f,hash:g}=l||s.location;return Di("",{pathname:d,search:f,hash:g},o.state&&o.state.usr||null,o.state&&o.state.key||"default",l?{pathname:s.location.pathname,search:s.location.search,hash:s.location.hash}:void 0)}function a(s,o){return typeof o=="string"?o:Mr(o)}return Mv(n,a,null,e)}function qe(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function Dt(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function Rv(){return Math.random().toString(36).substring(2,10)}function j0(e,n){return{usr:e.state,key:e.key,idx:n,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Di(e,n,a=null,s,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof n=="string"?Ir(n):n,state:a,key:n&&n.key||s||Rv(),mask:o}}function Mr({pathname:e="/",search:n="",hash:a=""}){return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),a&&a!=="#"&&(e+=a.charAt(0)==="#"?a:"#"+a),e}function Ir(e){let n={};if(e){let a=e.indexOf("#");a>=0&&(n.hash=e.substring(a),e=e.substring(0,a));let s=e.indexOf("?");s>=0&&(n.search=e.substring(s),e=e.substring(0,s)),e&&(n.pathname=e)}return n}function Mv(e,n,a,s={}){let{window:o=document.defaultView,v5Compat:l=!1}=s,d=o.history,f="POP",g=null,m=x();m==null&&(m=0,d.replaceState({...d.state,idx:m},""));function x(){return(d.state||{idx:null}).idx}function h(){f="POP";let C=x(),I=C==null?null:C-m;m=C,g&&g({action:f,location:E.location,delta:I})}function w(C,I){f="PUSH";let M=C0(C)?C:Di(E.location,C,I);m=x()+1;let _=j0(M,m),V=E.createHref(M.mask||M);try{d.pushState(_,"",V)}catch(H){if(H instanceof DOMException&&H.name==="DataCloneError")throw H;o.location.assign(V)}l&&g&&g({action:f,location:E.location,delta:1})}function k(C,I){f="REPLACE";let M=C0(C)?C:Di(E.location,C,I);m=x();let _=j0(M,m),V=E.createHref(M.mask||M);d.replaceState(_,"",V),l&&g&&g({action:f,location:E.location,delta:0})}function j(C){return Bg(C)}let E={get action(){return f},get location(){return e(o,d)},listen(C){if(g)throw new Error("A history only accepts one active listener");return o.addEventListener(S0,h),g=C,()=>{o.removeEventListener(S0,h),g=null}},createHref(C){return n(o,C)},createURL:j,encodeLocation(C){let I=j(C);return{pathname:I.pathname,search:I.search,hash:I.hash}},push:w,replace:k,go(C){return d.go(C)}};return E}function Bg(e,n=!1){let a="http://localhost";typeof window<"u"&&(a=window.location.origin!=="null"?window.location.origin:window.location.href),qe(a,"No window.location.(origin|href) available to create URL");let s=typeof e=="string"?e:Mr(e);return s=s.replace(/ $/,"%20"),!n&&s.startsWith("//")&&(s=a+s),new URL(s,a)}var Ni,E0=class{constructor(e){if(Ei(this,Ni,new Map),e)for(let[n,a]of e)this.set(n,a)}get(e){if(Gn(this,Ni).has(e))return Gn(this,Ni).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,n){Gn(this,Ni).set(e,n)}};Ni=new WeakMap;var Fv=new Set(["lazy","caseSensitive","path","id","index","children"]);function Iv(e){return Fv.has(e)}var Dv=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function _v(e){return Dv.has(e)}function Lv(e){return e.index===!0}function _i(e,n,a=[],s={},o=!1){return e.map((l,d)=>{let f=[...a,String(d)],g=typeof l.id=="string"?l.id:f.join("-");if(qe(l.index!==!0||!l.children,"Cannot specify children on an index route"),qe(o||!s[g],`Found a route id collision on id "${g}". Route id's must be globally unique within Data Router usages`),Lv(l)){let m={...l,id:g};return s[g]=N0(m,n(m)),m}else{let m={...l,id:g,children:void 0};return s[g]=N0(m,n(m)),l.children&&(m.children=_i(l.children,n,f,s,o)),m}})}function N0(e,n){return Object.assign(e,{...n,...typeof n.lazy=="object"&&n.lazy!=null?{lazy:{...e.lazy,...n.lazy}}:{}})}function zg(e,n,a="/"){return dr(e,n,a,!1)}function dr(e,n,a,s,o){let l=typeof n=="string"?Ir(n):n,d=er(l.pathname||"/",a);if(d==null)return null;let f=o??ml(e),g=null,m=Gv(d);for(let x=0;g==null&&x<f.length;++x)g=Kv(f[x],m,s);return g}function Vg(e,n){let{route:a,pathname:s,params:o}=e;return{id:a.id,pathname:s,params:o,data:n[a.id],loaderData:n[a.id],handle:a.handle}}function ml(e){let n=Ug(e);return Av(n),n}function Ug(e,n=[],a=[],s="",o=!1){let l=(d,f,g=o,m)=>{let x={relativePath:m===void 0?d.path||"":m,caseSensitive:d.caseSensitive===!0,childrenIndex:f,route:d};if(x.relativePath.startsWith("/")){if(!x.relativePath.startsWith(s)&&g)return;qe(x.relativePath.startsWith(s),`Absolute route path "${x.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),x.relativePath=x.relativePath.slice(s.length)}let h=Qn([s,x.relativePath]),w=a.concat(x);d.children&&d.children.length>0&&(qe(d.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),Ug(d.children,n,w,h,g)),!(d.path==null&&!d.index)&&n.push({path:h,score:Hv(h,d.index),routesMeta:w})};return e.forEach((d,f)=>{var g;if(d.path===""||!((g=d.path)!=null&&g.includes("?")))l(d,f);else for(let m of $g(d.path))l(d,f,!0,m)}),n}function $g(e){let n=e.split("/");if(n.length===0)return[];let[a,...s]=n,o=a.endsWith("?"),l=a.replace(/\?$/,"");if(s.length===0)return o?[l,""]:[l];let d=$g(s.join("/")),f=[];return f.push(...d.map(g=>g===""?l:[l,g].join("/"))),o&&f.push(...d),f.map(g=>e.startsWith("/")&&g===""?"/":g)}function Av(e){e.sort((n,a)=>n.score!==a.score?a.score-n.score:Wv(n.routesMeta.map(s=>s.childrenIndex),a.routesMeta.map(s=>s.childrenIndex)))}var Ov=/^:[\w-]+$/,Bv=3,zv=2,Vv=1,Uv=10,$v=-2,T0=e=>e==="*";function Hv(e,n){let a=e.split("/"),s=a.length;return a.some(T0)&&(s+=$v),n&&(s+=zv),a.filter(o=>!T0(o)).reduce((o,l)=>o+(Ov.test(l)?Bv:l===""?Vv:Uv),s)}function Wv(e,n){return e.length===n.length&&e.slice(0,-1).every((s,o)=>s===n[o])?e[e.length-1]-n[n.length-1]:0}function Kv(e,n,a=!1){let{routesMeta:s}=e,o={},l="/",d=[];for(let f=0;f<s.length;++f){let g=s[f],m=f===s.length-1,x=l==="/"?n:n.slice(l.length)||"/",h=Tl({path:g.relativePath,caseSensitive:g.caseSensitive,end:m},x),w=g.route;if(!h&&m&&a&&!s[s.length-1].route.index&&(h=Tl({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},x)),!h)return null;Object.assign(o,h.params),d.push({params:o,pathname:Qn([l,h.pathname]),pathnameBase:Jv(Qn([l,h.pathnameBase])),route:w}),h.pathnameBase!=="/"&&(l=Qn([l,h.pathnameBase]))}return d}function Tl(e,n){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[a,s]=Yv(e.path,e.caseSensitive,e.end),o=n.match(a);if(!o)return null;let l=o[0],d=l.replace(/(.)\/+$/,"$1"),f=o.slice(1);return{params:s.reduce((m,{paramName:x,isOptional:h},w)=>{if(x==="*"){let j=f[w]||"";d=l.slice(0,l.length-j.length).replace(/(.)\/+$/,"$1")}const k=f[w];return h&&!k?m[x]=void 0:m[x]=(k||"").replace(/%2F/g,"/"),m},{}),pathname:l,pathnameBase:d,pattern:e}}function Yv(e,n=!1,a=!0){Dt(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let s=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,f,g,m,x)=>{if(s.push({paramName:f,isOptional:g!=null}),g){let h=x.charAt(m+d.length);return h&&h!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(s.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,n?void 0:"i"),s]}function Gv(e){try{return e.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return Dt(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`),e}}function er(e,n){if(n==="/")return e;if(!e.toLowerCase().startsWith(n.toLowerCase()))return null;let a=n.endsWith("/")?n.length-1:n.length,s=e.charAt(a);return s&&s!=="/"?null:e.slice(a)||"/"}function Xv({basename:e,pathname:n}){return n==="/"?e:Qn([e,n])}var Hg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,qd=e=>Hg.test(e);function qv(e,n="/"){let{pathname:a,search:s="",hash:o=""}=typeof e=="string"?Ir(e):e,l;return a?(a=Jd(a),a.startsWith("/")?l=P0(a.substring(1),"/"):l=P0(a,n)):l=n,{pathname:l,search:Qv(s),hash:Zv(o)}}function P0(e,n){let a=Pl(n).split("/");return e.split("/").forEach(o=>{o===".."?a.length>1&&a.pop():o!=="."&&a.push(o)}),a.length>1?a.join("/"):"/"}function Vu(e,n,a,s){return`Cannot include a '${e}' character in a manually specified \`to.${n}\` field [${JSON.stringify(s)}]. Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Wg(e){return e.filter((n,a)=>a===0||n.route.path&&n.route.path.length>0)}function $l(e){let n=Wg(e);return n.map((a,s)=>s===n.length-1?a.pathname:a.pathnameBase)}function Ui(e,n,a,s=!1){let o;typeof e=="string"?o=Ir(e):(o={...e},qe(!o.pathname||!o.pathname.includes("?"),Vu("?","pathname","search",o)),qe(!o.pathname||!o.pathname.includes("#"),Vu("#","pathname","hash",o)),qe(!o.search||!o.search.includes("#"),Vu("#","search","hash",o)));let l=e===""||o.pathname==="",d=l?"/":o.pathname,f;if(d==null)f=a;else{let h=n.length-1;if(!s&&d.startsWith("..")){let w=d.split("/");for(;w[0]==="..";)w.shift(),h-=1;o.pathname=w.join("/")}f=h>=0?n[h]:"/"}let g=qv(o,f),m=d&&d!=="/"&&d.endsWith("/"),x=(l||d===".")&&a.endsWith("/");return!g.pathname.endsWith("/")&&(m||x)&&(g.pathname+="/"),g}var Jd=e=>e.replace(/\/\/+/g,"/"),Qn=e=>Jd(e.join("/")),Pl=e=>e.replace(/\/+$/,""),Jv=e=>Pl(e).replace(/^\/*/,"/"),Qv=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Zv=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,$i=class{constructor(e,n,a,s=!1){this.status=e,this.statusText=n||"",this.internal=s,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}};function Li(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Hi(e){let n=e.map(a=>a.route.path).filter(Boolean);return Qn(n)||"/"}var Kg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Yg(e,n){let a=e;if(typeof a!="string"||!Hg.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let s=a,o=!1;if(Kg)try{let l=new URL(window.location.href),d=a.startsWith("//")?new URL(l.protocol+a):new URL(a),f=er(d.pathname,n);d.origin===l.origin&&f!=null?a=f+d.search+d.hash:o=!0}catch{Dt(!1,`<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:o,to:a}}var ya=Symbol("Uninstrumented");function eb(e,n){let a={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(o=>o({id:n.id,index:n.index,path:n.path,instrument(l){let d=Object.keys(a);for(let f of d)l[f]&&a[f].push(l[f])}}));let s={};if(typeof n.lazy=="function"&&a.lazy.length>0){let o=Cs(a.lazy,n.lazy,()=>{});o&&(s.lazy=o)}if(typeof n.lazy=="object"){let o=n.lazy;["middleware","loader","action"].forEach(l=>{let d=o[l],f=a[`lazy.${l}`];if(typeof d=="function"&&f.length>0){let g=Cs(f,d,()=>{});g&&(s.lazy=Object.assign(s.lazy||{},{[l]:g}))}})}return["loader","action"].forEach(o=>{let l=n[o];if(typeof l=="function"&&a[o].length>0){let d=l[ya]??l,f=Cs(a[o],d,(...g)=>R0(g[0]));f&&(o==="loader"&&d.hydrate===!0&&(f.hydrate=!0),f[ya]=d,s[o]=f)}}),n.middleware&&n.middleware.length>0&&a.middleware.length>0&&(s.middleware=n.middleware.map(o=>{let l=o[ya]??o,d=Cs(a.middleware,l,(...f)=>R0(f[0]));return d?(d[ya]=l,d):o})),s}function tb(e,n){let a={navigate:[],fetch:[]};if(n.forEach(s=>s({instrument(o){let l=Object.keys(o);for(let d of l)o[d]&&a[d].push(o[d])}})),a.navigate.length>0){let s=e.navigate[ya]??e.navigate,o=Cs(a.navigate,s,(...l)=>{let[d,f]=l;return{to:typeof d=="number"||typeof d=="string"?d:d?Mr(d):".",...M0(e,f??{})}});o&&(o[ya]=s,e.navigate=o)}if(a.fetch.length>0){let s=e.fetch[ya]??e.fetch,o=Cs(a.fetch,s,(...l)=>{let[d,,f,g]=l;return{href:f??".",fetcherKey:d,...M0(e,g??{})}});o&&(o[ya]=s,e.fetch=o)}return e}function Cs(e,n,a){return e.length===0?null:async(...s)=>{let o=await Gg(e,a(...s),()=>n(...s),e.length-1);if(o.type==="error")throw o.value;return o.value}}async function Gg(e,n,a,s){let o=e[s],l;if(o){let d,f=async()=>(d?console.error("You cannot call instrumented handlers more than once"):d=Gg(e,n,a,s-1),l=await d,qe(l,"Expected a result"),l.type==="error"&&l.value instanceof Error?{status:"error",error:l.value}:{status:"success",error:void 0});try{await o(f,n)}catch(g){console.error("An instrumentation function threw an error:",g)}d||await f(),await d}else try{l={type:"success",value:await a()}}catch(d){l={type:"error",value:d}}return l||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function R0(e){let{request:n,context:a,params:s,pattern:o}=e;return{request:nb(n),params:{...s},pattern:o,context:rb(a)}}function M0(e,n){return{currentUrl:Mr(e.state.location),..."formMethod"in n?{formMethod:n.formMethod}:{},..."formEncType"in n?{formEncType:n.formEncType}:{},..."formData"in n?{formData:n.formData}:{},..."body"in n?{body:n.body}:{}}}function nb(e){return{method:e.method,url:e.url,headers:{get:(...n)=>e.headers.get(...n)}}}function rb(e){if(sb(e)){let n={...e};return Object.freeze(n),n}else return{get:n=>e.get(n)}}var ab=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function sb(e){if(e===null||typeof e!="object")return!1;const n=Object.getPrototypeOf(e);return n===Object.prototype||n===null||Object.getOwnPropertyNames(n).sort().join("\0")===ab}var Xg=["POST","PUT","PATCH","DELETE"],ib=new Set(Xg),ob=["GET",...Xg],lb=new Set(ob),qg=new Set([301,302,303,307,308]),cb=new Set([307,308]),Uu={state:"idle",location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ub={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},wi={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},db=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Jg="remix-router-transitions",Qg=Symbol("ResetLoaderData"),Ba,bs,ha,ws,fb=class{constructor(e){Ei(this,Ba),Ei(this,bs),Ei(this,ha),Ei(this,ws),Cr(this,Ba,e),Cr(this,bs,ml(e))}get stableRoutes(){return Gn(this,Ba)}get activeRoutes(){return Gn(this,ha)??Gn(this,Ba)}get branches(){return Gn(this,ws)??Gn(this,bs)}get hasHMRRoutes(){return Gn(this,ha)!=null}setRoutes(e){Cr(this,Ba,e),Cr(this,bs,ml(e))}setHmrRoutes(e){Cr(this,ha,e),Cr(this,ws,ml(e))}commitHmrRoutes(){Gn(this,ha)&&(Cr(this,Ba,Gn(this,ha)),Cr(this,bs,Gn(this,ws)),Cr(this,ha,void 0),Cr(this,ws,void 0))}};Ba=new WeakMap;bs=new WeakMap;ha=new WeakMap;ws=new WeakMap;function hb(e){const n=e.window?e.window:typeof window<"u"?window:void 0,a=typeof n<"u"&&typeof n.document<"u"&&typeof n.document.createElement<"u";qe(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let s=e.hydrationRouteProperties||[],o=e.mapRouteProperties||db,l=o;if(e.instrumentations){let L=e.instrumentations;l=z=>({...o(z),...eb(L.map(J=>J.route).filter(Boolean),z)})}let d={},f=new fb(_i(e.routes,l,void 0,d)),g=e.basename||"/";g.startsWith("/")||(g=`/${g}`);let m=e.dataStrategy||yb,x={...e.future},h=null,w=new Set,k=null,j=null,E=null,C=null,I=e.hydrationData!=null,M=dr(f.activeRoutes,e.history.location,g,!1,f.branches),_=!1,V=null,H,re;if(M==null&&!e.patchRoutesOnNavigation){let L=Xn(404,{pathname:e.history.location.pathname}),{matches:z,route:J}=tl(f.activeRoutes);H=!0,re=!H,M=z,V={[J.id]:L}}else if(M&&!e.hydrationData&&Fn(M,f.activeRoutes,e.history.location.pathname).active&&(M=null),M)if(M.some(L=>L.route.lazy))H=!1,re=!H;else if(!M.some(L=>Qd(L.route)))H=!0,re=!H;else{let L=e.hydrationData?e.hydrationData.loaderData:null,z=e.hydrationData?e.hydrationData.errors:null,J=M;if(z){let le=M.findIndex(ce=>z[ce.route.id]!==void 0);J=J.slice(0,le+1)}re=!1,H=!0,J.forEach(le=>{let ce=Zg(le.route,L,z);re=re||ce.renderFallback,H=H&&!ce.shouldLoad})}else{H=!1,re=!H,M=[];let L=Fn(null,f.activeRoutes,e.history.location.pathname);L.active&&L.matches&&(_=!0,M=L.matches)}let O,b={historyAction:e.history.action,location:e.history.location,matches:M,initialized:H,renderFallback:re,navigation:Uu,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||V,fetchers:new Map,blockers:new Map},R="POP",N=null,G=!1,Y,X=!1,K=new Map,te=null,q=!1,P=!1,F=new Set,U=new Map,W=0,T=-1,A=new Map,ee=new Set,ie=new Map,oe=new Map,ae=new Set,ue=new Map,ye,ve=null;function Ve(){if(h=e.history.listen(({action:L,location:z,delta:J})=>{if(ye){ye(),ye=void 0;return}Dt(ue.size===0||J!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let le=Vn({currentLocation:b.location,nextLocation:z,historyAction:L});if(le&&J!=null){let ce=new Promise(Ie=>{ye=Ie});e.history.go(J*-1),an(le,{state:"blocked",location:z,proceed(){an(le,{state:"proceeding",proceed:void 0,reset:void 0,location:z}),ce.then(()=>e.history.go(J))},reset(){let Ie=new Map(b.blockers);Ie.set(le,wi),Oe({blockers:Ie})}}),N==null||N.resolve(),N=null;return}return Se(L,z)}),a){Lb(n,K);let L=()=>Ab(n,K);n.addEventListener("pagehide",L),te=()=>n.removeEventListener("pagehide",L)}return b.initialized||Se("POP",b.location,{initialHydration:!0}),O}function je(){h&&h(),te&&te(),w.clear(),Y&&Y.abort(),b.fetchers.forEach((L,z)=>Mn(b.fetchers,z)),b.blockers.forEach((L,z)=>xr(z))}function Ue(L){if(w.add(L),k){let{newErrors:z}=k;k=null,L(b,{deletedFetchers:[],newErrors:z,viewTransitionOpts:void 0,flushSync:!1})}return()=>w.delete(L)}function Oe(L,z={}){L.matches&&(L.matches=L.matches.map(ce=>{let Ie=d[ce.route.id],De=ce.route;return De.element!==Ie.element||De.errorElement!==Ie.errorElement||De.hydrateFallbackElement!==Ie.hydrateFallbackElement?{...ce,route:Ie}:ce})),b={...b,...L};let J=[],le=[];b.fetchers.forEach((ce,Ie)=>{ce.state==="idle"&&(ae.has(Ie)?J.push(Ie):le.push(Ie))}),ae.forEach(ce=>{!b.fetchers.has(ce)&&!U.has(ce)&&J.push(ce)}),w.size===0&&(k={newErrors:L.errors??null}),[...w].forEach(ce=>ce(b,{deletedFetchers:J,newErrors:L.errors??null,viewTransitionOpts:z.viewTransitionOpts,flushSync:z.flushSync===!0})),J.forEach(ce=>Mn(b.fetchers,ce)),le.forEach(ce=>b.fetchers.delete(ce))}function dt(L,z,{flushSync:J}={}){var $e,Xe;let le=b.actionData!=null&&b.navigation.formMethod!=null&&hn(b.navigation.formMethod)&&b.navigation.state==="loading"&&(($e=L.state)==null?void 0:$e._isRedirect)!==!0,ce;z.actionData?Object.keys(z.actionData).length>0?ce=z.actionData:ce=null:le?ce=b.actionData:ce=null;let Ie=z.loaderData?U0(b.loaderData,z.loaderData,z.matches||[],z.errors):b.loaderData,De=b.blockers;De.size>0&&(De=new Map(De),De.forEach((Le,tt)=>De.set(tt,wi)));let Ke=q?!1:$t(L,z.matches||b.matches),xe=G===!0||b.navigation.formMethod!=null&&hn(b.navigation.formMethod)&&((Xe=L.state)==null?void 0:Xe._isRedirect)!==!0;f.commitHmrRoutes(),q||R==="POP"||(R==="PUSH"?e.history.push(L,L.state):R==="REPLACE"&&e.history.replace(L,L.state));let _e;if(R==="POP"){let Le=K.get(b.location.pathname);Le&&Le.has(L.pathname)?_e={currentLocation:b.location,nextLocation:L}:K.has(L.pathname)&&(_e={currentLocation:L,nextLocation:b.location})}else if(X){let Le=K.get(b.location.pathname);Le?Le.add(L.pathname):(Le=new Set([L.pathname]),K.set(b.location.pathname,Le)),_e={currentLocation:b.location,nextLocation:L}}Oe({...z,actionData:ce,loaderData:Ie,historyAction:R,location:L,initialized:!0,renderFallback:!1,navigation:Uu,revalidation:"idle",restoreScrollPosition:Ke,preventScrollReset:xe,blockers:De},{viewTransitionOpts:_e,flushSync:J===!0}),R="POP",G=!1,X=!1,q=!1,P=!1,N==null||N.resolve(),N=null,ve==null||ve.resolve(),ve=null}async function yt(L,z){if(N==null||N.resolve(),N=null,typeof L=="number"){N||(N=K0());let ut=N.promise;return e.history.go(L),ut}let J=bd(b.location,b.matches,g,L,z==null?void 0:z.fromRouteId,z==null?void 0:z.relative),{path:le,submission:ce,error:Ie}=F0(!1,J,z),De;z!=null&&z.mask&&(De={pathname:"",search:"",hash:"",...typeof z.mask=="string"?Ir(z.mask):{...b.location.mask,...z.mask}});let Ke=b.location,xe=Di(Ke,le,z&&z.state,void 0,De);xe={...xe,...e.history.encodeLocation(xe)};let _e=z&&z.replace!=null?z.replace:void 0,$e="PUSH";_e===!0?$e="REPLACE":_e===!1||ce!=null&&hn(ce.formMethod)&&ce.formAction===b.location.pathname+b.location.search&&($e="REPLACE");let Xe=z&&"preventScrollReset"in z?z.preventScrollReset===!0:void 0,Le=(z&&z.flushSync)===!0,tt=Vn({currentLocation:Ke,nextLocation:xe,historyAction:$e});if(tt){an(tt,{state:"blocked",location:xe,proceed(){an(tt,{state:"proceeding",proceed:void 0,reset:void 0,location:xe}),yt(L,z)},reset(){let ut=new Map(b.blockers);ut.set(tt,wi),Oe({blockers:ut})}});return}await Se($e,xe,{submission:ce,pendingError:Ie,preventScrollReset:Xe,replace:z&&z.replace,enableViewTransition:z&&z.viewTransition,flushSync:Le,callSiteDefaultShouldRevalidate:z&&z.defaultShouldRevalidate})}function vt(){ve||(ve=K0()),Qt(),Oe({revalidation:"loading"});let L=ve.promise;return b.navigation.state==="submitting"?L:b.navigation.state==="idle"?(Se(b.historyAction,b.location,{startUninterruptedRevalidation:!0}),L):(Se(R||b.historyAction,b.navigation.location,{overrideNavigation:b.navigation,enableViewTransition:X===!0}),L)}async function Se(L,z,J){Y&&Y.abort(),Y=null,R=L,q=(J&&J.startUninterruptedRevalidation)===!0,Lt(b.location,b.matches),G=(J&&J.preventScrollReset)===!0,X=(J&&J.enableViewTransition)===!0;let le=f.activeRoutes,ce=J!=null&&J.initialHydration&&b.matches&&b.matches.length>0&&!_?b.matches:dr(le,z,g,!1,f.branches),Ie=(J&&J.flushSync)===!0;if(ce&&b.initialized&&!P&&Eb(b.location,z)&&!(J&&J.submission&&hn(J.submission.formMethod))){dt(z,{matches:ce},{flushSync:Ie});return}let De=Fn(ce,le,z.pathname);if(De.active&&De.matches&&(ce=De.matches),!ce){let{error:St,notFoundMatches:pt,route:at}=Dr(z.pathname);dt(z,{matches:pt,loaderData:{},errors:{[at.id]:St}},{flushSync:Ie});return}let Ke=J&&J.overrideNavigation?{...J.overrideNavigation,matches:ce,historyAction:L}:void 0;Y=new AbortController;let xe=ks(e.history,z,Y.signal,J&&J.submission),_e=e.getContext?await e.getContext():new E0,$e;if(J&&J.pendingError)$e=[ga(ce).route.id,{type:"error",error:J.pendingError}];else if(J&&J.submission&&hn(J.submission.formMethod)){let St=await Re(xe,z,J.submission,ce,L,_e,De.active,J&&J.initialHydration===!0,{replace:J.replace,flushSync:Ie});if(St.shortCircuited)return;if(St.pendingActionResult){let[pt,at]=St.pendingActionResult;if(On(at)&&Li(at.error)&&at.error.status===404){Y=null,dt(z,{matches:St.matches,loaderData:{},errors:{[pt]:at.error}});return}}ce=St.matches||ce,$e=St.pendingActionResult,Ke=$u(z,ce,L,J.submission),Ie=!1,De.active=!1,xe=ks(e.history,xe.url,xe.signal)}let{shortCircuited:Xe,matches:Le,loaderData:tt,errors:ut,workingFetchers:Ot}=await we(xe,z,ce,L,_e,De.active,Ke,J&&J.submission,J&&J.fetcherSubmission,J&&J.replace,J&&J.initialHydration===!0,Ie,$e,J&&J.callSiteDefaultShouldRevalidate);Xe||(Y=null,dt(z,{matches:Le||ce,...$0($e),loaderData:tt,errors:ut,...Ot?{fetchers:Ot}:{}}))}async function Re(L,z,J,le,ce,Ie,De,Ke,xe={}){Qt();let _e=Db(z,le,ce,J);if(Oe({navigation:_e},{flushSync:xe.flushSync===!0}),De){let Le=await kt(le,z.pathname,L.signal);if(Le.type==="aborted")return{shortCircuited:!0};if(Le.type==="error"){if(Le.partialMatches.length===0){let{matches:ut,route:Ot}=tl(f.activeRoutes);return{matches:ut,pendingActionResult:[Ot.id,{type:"error",error:Le.error}]}}let tt=ga(Le.partialMatches).route.id;return{matches:Le.partialMatches,pendingActionResult:[tt,{type:"error",error:Le.error}]}}else if(Le.matches)le=Le.matches;else{let{notFoundMatches:tt,error:ut,route:Ot}=Dr(z.pathname);return{matches:tt,pendingActionResult:[Ot.id,{type:"error",error:ut}]}}}let $e,Xe=gl(le,z);if(!Xe.route.action&&!Xe.route.lazy)$e={type:"error",error:Xn(405,{method:L.method,pathname:z.pathname,routeId:Xe.route.id})};else{let Le=Ps(l,d,L,z,le,Xe,Ke?[]:s,Ie),tt=await rt(L,z,Le,Ie,null);if($e=tt[Xe.route.id],!$e){for(let ut of le)if(tt[ut.route.id]){$e=tt[ut.route.id];break}}if(L.signal.aborted)return{shortCircuited:!0}}if(Va($e)){let Le;return xe&&xe.replace!=null?Le=xe.replace:Le=B0($e.response.headers.get("Location"),new URL(L.url),g,e.history)===b.location.pathname+b.location.search,await Ge(L,$e,!0,{submission:J,replace:Le}),{shortCircuited:!0}}if(On($e)){let Le=ga(le,Xe.route.id);return(xe&&xe.replace)!==!0&&(R="PUSH"),{matches:le,pendingActionResult:[Le.route.id,$e,Xe.route.id]}}return{matches:le,pendingActionResult:[Xe.route.id,$e]}}async function we(L,z,J,le,ce,Ie,De,Ke,xe,_e,$e,Xe,Le,tt){let ut=De||$u(z,J,le,Ke),Ot=Ke||xe||W0(ut),St=!q&&!$e;if(Ie){if(St){let ln=me(Le);Oe({navigation:ut,...ln!==void 0?{actionData:ln}:{}},{flushSync:Xe})}let st=await kt(J,z.pathname,L.signal);if(st.type==="aborted")return{shortCircuited:!0};if(st.type==="error"){if(st.partialMatches.length===0){let{matches:mn,route:kn}=tl(f.activeRoutes);return{matches:mn,loaderData:{},errors:{[kn.id]:st.error}}}let ln=ga(st.partialMatches).route.id;return{matches:st.partialMatches,loaderData:{},errors:{[ln]:st.error}}}else if(st.matches)J=st.matches;else{let{error:ln,notFoundMatches:mn,route:kn}=Dr(z.pathname);return{matches:mn,loaderData:{},errors:{[kn.id]:ln}}}}let pt=f.activeRoutes,{dsMatches:at,revalidatingFetchers:sn}=I0(L,ce,l,d,e.history,b,J,Ot,z,$e?[]:s,$e===!0,P,F,ae,ie,ee,pt,g,e.patchRoutesOnNavigation!=null,f.branches,Le,tt);if(T=++W,!e.dataStrategy&&!at.some(st=>st.shouldLoad)&&!at.some(st=>st.route.middleware&&st.route.middleware.length>0)&&sn.length===0){let st=new Map(b.fetchers),ln=it(st);return dt(z,{matches:J,loaderData:{},errors:Le&&On(Le[1])?{[Le[0]]:Le[1].error}:null,...$0(Le),...ln?{fetchers:st}:{}},{flushSync:Xe}),{shortCircuited:!0}}if(St){let st={};if(!Ie){st.navigation=ut;let ln=me(Le);ln!==void 0&&(st.actionData=ln)}sn.length>0&&(st.fetchers=Fe(sn)),Oe(st,{flushSync:Xe})}sn.forEach(st=>{Ze(st.key),st.controller&&U.set(st.key,st.controller)});let _r=()=>sn.forEach(st=>Ze(st.key));Y&&Y.signal.addEventListener("abort",_r);let{loaderResults:nr,fetcherResults:rr}=await ht(at,sn,L,z,ce);if(L.signal.aborted)return{shortCircuited:!0};Y&&Y.signal.removeEventListener("abort",_r),sn.forEach(st=>U.delete(st.key));let vr=nl(nr);if(vr)return await Ge(L,vr.result,!0,{replace:_e}),{shortCircuited:!0};if(vr=nl(rr),vr)return ee.add(vr.key),await Ge(L,vr.result,!0,{replace:_e}),{shortCircuited:!0};let In=new Map(b.fetchers),{loaderData:Wr,errors:Wt}=V0(b,J,nr,Le,sn,rr,In);$e&&b.errors&&(Wt={...b.errors,...Wt});let Xa=it(In),on=Zt(T,In),qa=Xa||on||sn.length>0;return{matches:J,loaderData:Wr,errors:Wt,...qa?{workingFetchers:In}:{}}}function me(L){if(L&&!On(L[1]))return{[L[0]]:L[1].data};if(b.actionData)return Object.keys(b.actionData).length===0?null:b.actionData}function Fe(L){let z=new Map(b.fetchers);return L.forEach(J=>{let le=z.get(J.key),ce=ki(void 0,le?le.data:void 0);z.set(J.key,ce)}),z}async function be(L,z,J,le){Ze(L);let ce=(le&&le.flushSync)===!0,Ie=f.activeRoutes,De=bd(b.location,b.matches,g,J,z,le==null?void 0:le.relative),Ke=dr(Ie,De,g,!1,f.branches),xe=Fn(Ke,Ie,De);if(xe.active&&xe.matches&&(Ke=xe.matches),!Ke){Je(L,z,Xn(404,{pathname:De}),{flushSync:ce});return}let{path:_e,submission:$e,error:Xe}=F0(!0,De,le);if(Xe){Je(L,z,Xe,{flushSync:ce});return}let Le=e.getContext?await e.getContext():new E0,tt=(le&&le.preventScrollReset)===!0;if($e&&hn($e.formMethod)){await Ae(L,z,_e,Ke,Le,xe.active,ce,tt,$e,le&&le.defaultShouldRevalidate);return}ie.set(L,{routeId:z,path:_e}),await Qe(L,z,_e,Ke,Le,xe.active,ce,tt,$e)}async function Ae(L,z,J,le,ce,Ie,De,Ke,xe,_e){Qt(),ie.delete(L);let $e=b.fetchers.get(L);Pt(L,_b(xe,$e),{flushSync:De});let Xe=new AbortController,Le=ks(e.history,J,Xe.signal,xe);if(Ie){let bt=await kt(le,new URL(Le.url).pathname,Le.signal,L);if(bt.type==="aborted")return;if(bt.type==="error"){Je(L,z,bt.error,{flushSync:De});return}else if(bt.matches)le=bt.matches;else{Je(L,z,Xn(404,{pathname:J}),{flushSync:De});return}}let tt=gl(le,J);if(!tt.route.action&&!tt.route.lazy){let bt=Xn(405,{method:xe.formMethod,pathname:J,routeId:z});Je(L,z,bt,{flushSync:De});return}U.set(L,Xe);let ut=W,Ot=Ps(l,d,Le,J,le,tt,s,ce),St=await rt(Le,J,Ot,ce,L),pt=St[tt.route.id];if(!pt){for(let bt of Ot)if(St[bt.route.id]){pt=St[bt.route.id];break}}if(Le.signal.aborted){U.get(L)===Xe&&U.delete(L);return}if(ae.has(L)){if(Va(pt)||On(pt)){Pt(L,Er(void 0));return}}else{if(Va(pt))if(U.delete(L),T>ut){Pt(L,Er(void 0));return}else return ee.add(L),Pt(L,ki(xe)),Ge(Le,pt,!1,{fetcherSubmission:xe,preventScrollReset:Ke});if(On(pt)){Je(L,z,pt.error);return}}let at=b.navigation.location||b.location,sn=ks(e.history,at,Xe.signal),_r=f.activeRoutes,nr=b.navigation.state!=="idle"?dr(_r,b.navigation.location,g,!1,f.branches):b.matches;qe(nr,"Didn't find any matches after fetcher action");let rr=++W;A.set(L,rr);let{dsMatches:vr,revalidatingFetchers:In}=I0(sn,ce,l,d,e.history,b,nr,xe,at,s,!1,P,F,ae,ie,ee,_r,g,e.patchRoutesOnNavigation!=null,f.branches,[tt.route.id,pt],_e),Wr=ki(xe,pt.data),Wt=new Map(b.fetchers);Wt.set(L,Wr),In.filter(bt=>bt.key!==L).forEach(bt=>{let Lr=bt.key,Ja=Wt.get(Lr),Qi=ki(void 0,Ja?Ja.data:void 0);Wt.set(Lr,Qi),Ze(Lr),bt.controller&&U.set(Lr,bt.controller)}),Oe({fetchers:Wt});let Xa=()=>In.forEach(bt=>Ze(bt.key));Xe.signal.addEventListener("abort",Xa);let{loaderResults:on,fetcherResults:qa}=await ht(vr,In,sn,at,ce);if(Xe.signal.aborted)return;Xe.signal.removeEventListener("abort",Xa),A.delete(L),U.delete(L),In.forEach(bt=>U.delete(bt.key));let st=b.fetchers.has(L),ln=bt=>{if(!st)return bt;let Lr=new Map(bt.fetchers);return Lr.set(L,Er(pt.data)),{...bt,fetchers:Lr}},mn=nl(on);if(mn)return b=ln(b),Ge(sn,mn.result,!1,{preventScrollReset:Ke});if(mn=nl(qa),mn)return ee.add(mn.key),b=ln(b),Ge(sn,mn.result,!1,{preventScrollReset:Ke});let kn=new Map(b.fetchers);st&&kn.set(L,Er(pt.data));let{loaderData:Kr,errors:Yr}=V0(b,nr,on,void 0,In,qa,kn);Zt(rr,kn),b.navigation.state==="loading"&&rr>T?(qe(R,"Expected pending action"),Y&&Y.abort(),dt(b.navigation.location,{matches:nr,loaderData:Kr,errors:Yr,fetchers:kn})):(Oe({errors:Yr,loaderData:U0(b.loaderData,Kr,nr,Yr),fetchers:kn}),P=!1)}async function Qe(L,z,J,le,ce,Ie,De,Ke,xe){let _e=b.fetchers.get(L);Pt(L,ki(xe,_e?_e.data:void 0),{flushSync:De});let $e=new AbortController,Xe=ks(e.history,J,$e.signal);if(Ie){let pt=await kt(le,new URL(Xe.url).pathname,Xe.signal,L);if(pt.type==="aborted")return;if(pt.type==="error"){Je(L,z,pt.error,{flushSync:De});return}else if(pt.matches)le=pt.matches;else{Je(L,z,Xn(404,{pathname:J}),{flushSync:De});return}}let Le=gl(le,J);U.set(L,$e);let tt=W,ut=Ps(l,d,Xe,J,le,Le,s,ce),Ot=await rt(Xe,J,ut,ce,L),St=Ot[Le.route.id];if(!St){for(let pt of le)if(Ot[pt.route.id]){St=Ot[pt.route.id];break}}if(U.get(L)===$e&&U.delete(L),!Xe.signal.aborted){if(ae.has(L)){Pt(L,Er(void 0));return}if(Va(St))if(T>tt){Pt(L,Er(void 0));return}else{ee.add(L),await Ge(Xe,St,!1,{preventScrollReset:Ke});return}if(On(St)){Je(L,z,St.error);return}Pt(L,Er(St.data))}}async function Ge(L,z,J,{submission:le,fetcherSubmission:ce,preventScrollReset:Ie,replace:De}={}){J||(N==null||N.resolve(),N=null),z.response.headers.has("X-Remix-Revalidate")&&(P=!0);let Ke=z.response.headers.get("Location");qe(Ke,"Expected a Location header on the redirect Response"),Ke=B0(Ke,new URL(L.url),g,e.history);let xe=Di(b.location,Ke,{_isRedirect:!0});if(a){let ut=!1;if(z.response.headers.has("X-Remix-Reload-Document"))ut=!0;else if(qd(Ke)){const Ot=Bg(Ke,!0);ut=Ot.origin!==n.location.origin||er(Ot.pathname,g)==null}if(ut){De?n.location.replace(Ke):n.location.assign(Ke);return}}Y=null;let _e=De===!0||z.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:$e,formAction:Xe,formEncType:Le}=b.navigation;!le&&!ce&&$e&&Xe&&Le&&(le=W0(b.navigation));let tt=le||ce;if(cb.has(z.response.status)&&tt&&hn(tt.formMethod))await Se(_e,xe,{submission:{...tt,formAction:Ke},preventScrollReset:Ie||G,enableViewTransition:J?X:void 0});else{let ut=$u(xe,[],_e,le);await Se(_e,xe,{overrideNavigation:ut,fetcherSubmission:ce,preventScrollReset:Ie||G,enableViewTransition:J?X:void 0})}}async function rt(L,z,J,le,ce){var Ke;let Ie,De={};try{Ie=await bb(m,L,z,J,ce,le,!1)}catch(xe){return J.filter(_e=>_e.shouldLoad).forEach(_e=>{De[_e.route.id]={type:"error",error:xe}}),De}if(L.signal.aborted)return De;if(!hn(L.method))for(let xe of J){if(((Ke=Ie[xe.route.id])==null?void 0:Ke.type)==="error")break;!Ie.hasOwnProperty(xe.route.id)&&!b.loaderData.hasOwnProperty(xe.route.id)&&(!b.errors||!b.errors.hasOwnProperty(xe.route.id))&&xe.shouldCallHandler()&&(Ie[xe.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${xe.route.id}`)})}for(let[xe,_e]of Object.entries(Ie))if(Rb(_e)){let $e=_e.result;De[xe]={type:"redirect",response:Cb($e,L,xe,J,g)}}else De[xe]=await Sb(_e);return De}async function ht(L,z,J,le,ce){let Ie=rt(J,le,L,ce,null),De=Promise.all(z.map(async _e=>{if(_e.matches&&_e.match&&_e.request&&_e.controller){let Xe=(await rt(_e.request,_e.path,_e.matches,ce,_e.key))[_e.match.route.id];return{[_e.key]:Xe}}else return Promise.resolve({[_e.key]:{type:"error",error:Xn(404,{pathname:_e.path})}})})),Ke=await Ie,xe=(await De).reduce((_e,$e)=>Object.assign(_e,$e),{});return{loaderResults:Ke,fetcherResults:xe}}function Qt(){P=!0,ie.forEach((L,z)=>{U.has(z)&&F.add(z),Ze(z)})}function Pt(L,z,J={}){let le=new Map(b.fetchers);le.set(L,z),Oe({fetchers:le},{flushSync:(J&&J.flushSync)===!0})}function Je(L,z,J,le={}){let ce=ga(b.matches,z),Ie=new Map(b.fetchers);Mn(Ie,L),Oe({errors:{[ce.route.id]:J},fetchers:Ie},{flushSync:(le&&le.flushSync)===!0})}function wn(L){return oe.set(L,(oe.get(L)||0)+1),ae.has(L)&&ae.delete(L),b.fetchers.get(L)||ub}function ft(L,z){Ze(L,z==null?void 0:z.reason),Pt(L,Er(null))}function Mn(L,z){let J=b.fetchers.get(z);U.has(z)&&!(J&&J.state==="loading"&&A.has(z))&&Ze(z),ie.delete(z),A.delete(z),ee.delete(z),ae.delete(z),F.delete(z),L.delete(z)}function Te(L){let z=(oe.get(L)||0)-1;z<=0?(oe.delete(L),ae.add(L)):oe.set(L,z),Oe({fetchers:new Map(b.fetchers)})}function Ze(L,z){let J=U.get(L);J&&(J.abort(z),U.delete(L))}function ot(L,z){for(let J of L){let le=z.get(J);qe(le,`Expected fetcher: ${J}`);let ce=Er(le.data);z.set(J,ce)}}function it(L){let z=[],J=!1;for(let le of ee){let ce=L.get(le);qe(ce,`Expected fetcher: ${le}`),ce.state==="loading"&&(ee.delete(le),z.push(le),J=!0)}return ot(z,L),J}function Zt(L,z){let J=[];for(let[le,ce]of A)if(ce<L){let Ie=z.get(le);qe(Ie,`Expected fetcher: ${le}`),Ie.state==="loading"&&(Ze(le),A.delete(le),J.push(le))}return ot(J,z),J.length>0}function gt(L,z){let J=b.blockers.get(L)||wi;return ue.get(L)!==z&&ue.set(L,z),J}function xr(L){b.blockers.delete(L),ue.delete(L)}function an(L,z){let J=b.blockers.get(L)||wi;qe(J.state==="unblocked"&&z.state==="blocked"||J.state==="blocked"&&z.state==="blocked"||J.state==="blocked"&&z.state==="proceeding"||J.state==="blocked"&&z.state==="unblocked"||J.state==="proceeding"&&z.state==="unblocked",`Invalid blocker state transition: ${J.state} -> ${z.state}`);let le=new Map(b.blockers);le.set(L,z),Oe({blockers:le})}function Vn({currentLocation:L,nextLocation:z,historyAction:J}){if(ue.size===0)return;ue.size>1&&Dt(!1,"A router only supports one blocker at a time");let le=Array.from(ue.entries()),[ce,Ie]=le[le.length-1],De=b.blockers.get(ce);if(!(De&&De.state==="proceeding")&&Ie({currentLocation:L,nextLocation:z,historyAction:J}))return ce}function Dr(L){let z=Xn(404,{pathname:L}),J=f.activeRoutes,{matches:le,route:ce}=tl(J);return{notFoundMatches:le,route:ce,error:z}}function Ye(L,z,J){if(j=L,C=z,E=J||null,!I&&b.navigation===Uu){I=!0;let le=$t(b.location,b.matches);le!=null&&Oe({restoreScrollPosition:le})}return()=>{j=null,C=null,E=null}}function Nt(L,z){return E&&E(L,z.map(le=>Vg(le,b.loaderData)))||L.key}function Lt(L,z){if(j&&C){let J=Nt(L,z);j[J]=C()}}function $t(L,z){if(j){let J=Nt(L,z),le=j[J];if(typeof le=="number")return le}return null}function Fn(L,z,J){if(e.patchRoutesOnNavigation){let le=f.branches;if(L){if(Object.keys(L[0].params).length>0)return{active:!0,matches:dr(z,J,g,!0,le)}}else return{active:!0,matches:dr(z,J,g,!0,le)||[]}}return{active:!1,matches:null}}async function kt(L,z,J,le){if(!e.patchRoutesOnNavigation)return{type:"success",matches:L};let ce=L;for(;;){let Ie=d;try{await e.patchRoutesOnNavigation({signal:J,path:z,matches:ce,fetcherKey:le,patch:(_e,$e)=>{J.aborted||D0(_e,$e,f,Ie,l,!1)}})}catch(_e){return{type:"error",error:_e,partialMatches:ce}}if(J.aborted)return{type:"aborted"};let De=f.branches,Ke=dr(f.activeRoutes,z,g,!1,De),xe=null;if(Ke){if(Object.keys(Ke[0].params).length===0)return{type:"success",matches:Ke};if(xe=dr(f.activeRoutes,z,g,!0,De),!(xe&&ce.length<xe.length&&At(ce,xe.slice(0,ce.length))))return{type:"success",matches:Ke}}if(xe||(xe=dr(f.activeRoutes,z,g,!0,De)),!xe||At(ce,xe))return{type:"success",matches:null};ce=xe}}function At(L,z){return L.length===z.length&&L.every((J,le)=>J.route.id===z[le].route.id)}function yr(L){d={},f.setHmrRoutes(_i(L,l,void 0,d))}function Ht(L,z,J=!1){D0(L,z,f,d,l,J),f.hasHMRRoutes||Oe({})}return O={get basename(){return g},get future(){return x},get state(){return b},get routes(){return f.stableRoutes},get branches(){return f.branches},get manifest(){return d},get window(){return n},initialize:Ve,subscribe:Ue,enableScrollRestoration:Ye,navigate:yt,fetch:be,revalidate:vt,createHref:L=>e.history.createHref(L),encodeLocation:L=>e.history.encodeLocation(L),getFetcher:wn,resetFetcher:ft,deleteFetcher:Te,dispose:je,getBlocker:gt,deleteBlocker:xr,patchRoutes:Ht,_internalFetchControllers:U,_internalSetRoutes:yr,_internalSetStateDoNotUseOrYouWillBreakYourApp(L){Oe(L)}},e.instrumentations&&(O=tb(O,e.instrumentations.map(L=>L.router).filter(Boolean))),O}function pb(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function bd(e,n,a,s,o,l){let d,f;if(o){d=[];for(let m of n)if(d.push(m),m.route.id===o){f=m;break}}else d=n,f=n[n.length-1];let g=Ui(s||".",$l(d),er(e.pathname,a)||e.pathname,l==="path");if(s==null&&(g.search=e.search,g.hash=e.hash),(s==null||s===""||s===".")&&f){let m=ef(g.search);if(f.route.index&&!m)g.search=g.search?g.search.replace(/^\?/,"?index&"):"?index";else if(!f.route.index&&m){let x=new URLSearchParams(g.search),h=x.getAll("index");x.delete("index"),h.filter(k=>k).forEach(k=>x.append("index",k));let w=x.toString();g.search=w?`?${w}`:""}}return a!=="/"&&(g.pathname=Xv({basename:a,pathname:g.pathname})),Mr(g)}function F0(e,n,a){if(!a||!pb(a))return{path:n};if(a.formMethod&&!Ib(a.formMethod))return{path:n,error:Xn(405,{method:a.formMethod})};let s=()=>({path:n,error:Xn(400,{type:"invalid-body"})}),l=(a.formMethod||"get").toUpperCase(),d=i1(n);if(a.body!==void 0){if(a.formEncType==="text/plain"){if(!hn(l))return s();let h=typeof a.body=="string"?a.body:a.body instanceof FormData||a.body instanceof URLSearchParams?Array.from(a.body.entries()).reduce((w,[k,j])=>`${w}${k}=${j}
`,""):String(a.body);return{path:n,submission:{formMethod:l,formAction:d,formEncType:a.formEncType,formData:void 0,json:void 0,text:h}}}else if(a.formEncType==="application/json"){if(!hn(l))return s();try{let h=typeof a.body=="string"?JSON.parse(a.body):a.body;return{path:n,submission:{formMethod:l,formAction:d,formEncType:a.formEncType,formData:void 0,json:h,text:void 0}}}catch{return s()}}}qe(typeof FormData=="function","FormData is not available in this environment");let f,g;if(a.formData)f=kd(a.formData),g=a.formData;else if(a.body instanceof FormData)f=kd(a.body),g=a.body;else if(a.body instanceof URLSearchParams)f=a.body,g=z0(f);else if(a.body==null)f=new URLSearchParams,g=new FormData;else try{f=new URLSearchParams(a.body),g=z0(f)}catch{return s()}let m={formMethod:l,formAction:d,formEncType:a&&a.formEncType||"application/x-www-form-urlencoded",formData:g,json:void 0,text:void 0};if(hn(m.formMethod))return{path:n,submission:m};let x=Ir(n);return e&&x.search&&ef(x.search)&&f.append("index",""),x.search=`?${f}`,{path:Mr(x),submission:m}}function I0(e,n,a,s,o,l,d,f,g,m,x,h,w,k,j,E,C,I,M,_,V,H){var q;let re=V?On(V[1])?V[1].error:V[1].data:void 0,O=o.createURL(l.location),b=o.createURL(g),R;if(x&&l.errors){let P=Object.keys(l.errors)[0];R=d.findIndex(F=>F.route.id===P)}else if(V&&On(V[1])){let P=V[0];R=d.findIndex(F=>F.route.id===P)-1}let N=V?V[1].statusCode:void 0,G=N&&N>=400,Y={currentUrl:O,currentParams:((q=l.matches[0])==null?void 0:q.params)||{},nextUrl:b,nextParams:d[0].params,...f,actionResult:re,actionStatus:N},X=Hi(d),K=d.map((P,F)=>{let{route:U}=P,W=null;if(R!=null&&F>R)W=!1;else if(U.lazy)W=!0;else if(!Qd(U))W=!1;else if(x){let{shouldLoad:ie}=Zg(U,l.loaderData,l.errors);W=ie}else mb(l.loaderData,l.matches[F],P)&&(W=!0);if(W!==null)return wd(a,s,e,g,X,P,m,n,W);let T=!1;typeof H=="boolean"?T=H:G?T=!1:(h||O.pathname+O.search===b.pathname+b.search||O.search!==b.search||gb(l.matches[F],P))&&(T=!0);let A={...Y,defaultShouldRevalidate:T},ee=Pi(P,A);return wd(a,s,e,g,X,P,m,n,ee,A,H)}),te=[];return j.forEach((P,F)=>{if(x||!d.some(ae=>ae.route.id===P.routeId)||k.has(F))return;let U=l.fetchers.get(F),W=U&&U.state!=="idle"&&U.data===void 0,T=dr(C,P.path,I??"/",!1,_);if(!T){if(M&&W)return;te.push({key:F,routeId:P.routeId,path:P.path,matches:null,match:null,request:null,controller:null});return}if(E.has(F))return;let A=gl(T,P.path),ee=new AbortController,ie=ks(o,P.path,ee.signal),oe=null;if(w.has(F))w.delete(F),oe=Ps(a,s,ie,P.path,T,A,m,n);else if(W)h&&(oe=Ps(a,s,ie,P.path,T,A,m,n));else{let ae;typeof H=="boolean"?ae=H:G?ae=!1:ae=h;let ue={...Y,defaultShouldRevalidate:ae};Pi(A,ue)&&(oe=Ps(a,s,ie,P.path,T,A,m,n,ue))}oe&&te.push({key:F,routeId:P.routeId,path:P.path,matches:oe,match:A,request:ie,controller:ee})}),{dsMatches:K,revalidatingFetchers:te}}function Qd(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Zg(e,n,a){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Qd(e))return{shouldLoad:!1,renderFallback:!1};let s=n!=null&&e.id in n,o=a!=null&&a[e.id]!==void 0;if(!s&&o)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!s};let l=!s&&!o;return{shouldLoad:l,renderFallback:l}}function mb(e,n,a){let s=!n||a.route.id!==n.route.id,o=!e.hasOwnProperty(a.route.id);return s||o}function gb(e,n){let a=e.route.path;return e.pathname!==n.pathname||a!=null&&a.endsWith("*")&&e.params["*"]!==n.params["*"]}function Pi(e,n){if(e.route.shouldRevalidate){let a=e.route.shouldRevalidate(n);if(typeof a=="boolean")return a}return n.defaultShouldRevalidate}function D0(e,n,a,s,o,l){let d;if(e){let m=s[e];qe(m,`No route found to patch children into: routeId = ${e}`),m.children||(m.children=[]),d=m.children}else d=a.activeRoutes;let f=[],g=[];if(n.forEach(m=>{let x=d.find(h=>e1(m,h));x?g.push({existingRoute:x,newRoute:m}):f.push(m)}),f.length>0){let m=_i(f,o,[e||"_","patch",String((d==null?void 0:d.length)||"0")],s);d.push(...m)}if(l&&g.length>0)for(let m=0;m<g.length;m++){let{existingRoute:x,newRoute:h}=g[m],w=x,[k]=_i([h],o,[],{},!0);Object.assign(w,{element:k.element?k.element:w.element,errorElement:k.errorElement?k.errorElement:w.errorElement,hydrateFallbackElement:k.hydrateFallbackElement?k.hydrateFallbackElement:w.hydrateFallbackElement})}a.hasHMRRoutes||a.setRoutes([...a.activeRoutes])}function e1(e,n){var a;return"id"in e&&"id"in n&&e.id===n.id?!0:e.index===n.index&&e.path===n.path&&e.caseSensitive===n.caseSensitive?(!e.children||e.children.length===0)&&(!n.children||n.children.length===0)?!0:((a=e.children)==null?void 0:a.every((s,o)=>{var l;return(l=n.children)==null?void 0:l.some(d=>e1(s,d))}))??!1:!1}var _0=new WeakMap,t1=({key:e,route:n,manifest:a,mapRouteProperties:s})=>{let o=a[n.id];if(qe(o,"No route found in manifest"),!o.lazy||typeof o.lazy!="object")return;let l=o.lazy[e];if(!l)return;let d=_0.get(o);d||(d={},_0.set(o,d));let f=d[e];if(f)return f;let g=(async()=>{let m=Iv(e),h=o[e]!==void 0&&e!=="hasErrorBoundary";if(m)Dt(!m,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),d[e]=Promise.resolve();else if(h)Dt(!1,`Route "${o.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let w=await l();w!=null&&(Object.assign(o,{[e]:w}),Object.assign(o,s(o)))}typeof o.lazy=="object"&&(o.lazy[e]=void 0,Object.values(o.lazy).every(w=>w===void 0)&&(o.lazy=void 0))})();return d[e]=g,g},L0=new WeakMap;function xb(e,n,a,s,o){let l=a[e.id];if(qe(l,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let x=L0.get(l);if(x)return{lazyRoutePromise:x,lazyHandlerPromise:x};let h=(async()=>{qe(typeof e.lazy=="function","No lazy route function found");let w=await e.lazy(),k={};for(let j in w){let E=w[j];if(E===void 0)continue;let C=_v(j),M=l[j]!==void 0&&j!=="hasErrorBoundary";C?Dt(!C,"Route property "+j+" is not a supported property to be returned from a lazy route function. This property will be ignored."):M?Dt(!M,`Route "${l.id}" has a static property "${j}" defined but its lazy function is also returning a value for this property. The lazy route property "${j}" will be ignored.`):k[j]=E}Object.assign(l,k),Object.assign(l,{...s(l),lazy:void 0})})();return L0.set(l,h),h.catch(()=>{}),{lazyRoutePromise:h,lazyHandlerPromise:h}}let d=Object.keys(e.lazy),f=[],g;for(let x of d){if(o&&o.includes(x))continue;let h=t1({key:x,route:e,manifest:a,mapRouteProperties:s});h&&(f.push(h),x===n&&(g=h))}let m=f.length>0?Promise.all(f).then(()=>{}):void 0;return m==null||m.catch(()=>{}),g==null||g.catch(()=>{}),{lazyRoutePromise:m,lazyHandlerPromise:g}}async function A0(e){let n=e.matches.filter(o=>o.shouldLoad),a={};return(await Promise.all(n.map(o=>o.resolve()))).forEach((o,l)=>{a[n[l].route.id]=o}),a}async function yb(e){return e.matches.some(n=>n.route.middleware)?n1(e,()=>A0(e)):A0(e)}function n1(e,n){return vb(e,n,s=>{if(Fb(s))throw s;return s},Tb,a);function a(s,o,l){if(l)return Promise.resolve(Object.assign(l.value,{[o]:{type:"error",result:s}}));{let{matches:d}=e,f=Math.min(Math.max(d.findIndex(m=>m.route.id===o),0),Math.max(d.findIndex(m=>m.shouldCallHandler()),0)),g=ga(d,d[f].route.id).route.id;return Promise.resolve({[g]:{type:"error",result:s}})}}}async function vb(e,n,a,s,o){let{matches:l,...d}=e,f=l.flatMap(m=>m.route.middleware?m.route.middleware.map(x=>[m.route.id,x]):[]);return await r1(d,f,n,a,s,o)}async function r1(e,n,a,s,o,l,d=0){let{request:f}=e;if(f.signal.aborted)throw f.signal.reason??new Error(`Request aborted: ${f.method} ${f.url}`);let g=n[d];if(!g)return await a();let[m,x]=g,h,w=async()=>{if(h)throw new Error("You may only call `next()` once per middleware");try{return h={value:await r1(e,n,a,s,o,l,d+1)},h.value}catch(k){return h={value:await l(k,m,h)},h.value}};try{let k=await x(e,w),j=k!=null?s(k):void 0;return o(j)?j:h?j??h.value:(h={value:await w()},h.value)}catch(k){return await l(k,m,h)}}function a1(e,n,a,s,o){let l=t1({key:"middleware",route:s.route,manifest:n,mapRouteProperties:e}),d=xb(s.route,hn(a.method)?"action":"loader",n,e,o);return{middleware:l,route:d.lazyRoutePromise,handler:d.lazyHandlerPromise}}function wd(e,n,a,s,o,l,d,f,g,m=null,x){let h=!1,w=a1(e,n,a,l,d);return{...l,_lazyPromises:w,shouldLoad:g,shouldRevalidateArgs:m,shouldCallHandler(k){return h=!0,m?typeof x=="boolean"?Pi(l,{...m,defaultShouldRevalidate:x}):typeof k=="boolean"?Pi(l,{...m,defaultShouldRevalidate:k}):Pi(l,m):g},resolve(k){let{lazy:j,loader:E,middleware:C}=l.route,I=h||g||k&&!hn(a.method)&&(j||E),M=C&&C.length>0&&!E&&!j;return I&&(hn(a.method)||!M)?wb({request:a,path:s,pattern:o,match:l,lazyHandlerPromise:w==null?void 0:w.handler,lazyRoutePromise:w==null?void 0:w.route,handlerOverride:k,scopedContext:f}):Promise.resolve({type:"data",result:void 0})}}}function Ps(e,n,a,s,o,l,d,f,g=null){return o.map(m=>m.route.id!==l.route.id?{...m,shouldLoad:!1,shouldRevalidateArgs:g,shouldCallHandler:()=>!1,_lazyPromises:a1(e,n,a,m,d),resolve:()=>Promise.resolve({type:"data",result:void 0})}:wd(e,n,a,s,Hi(o),m,d,f,!0,g))}async function bb(e,n,a,s,o,l,d){s.some(x=>{var h;return(h=x._lazyPromises)==null?void 0:h.middleware})&&await Promise.all(s.map(x=>{var h;return(h=x._lazyPromises)==null?void 0:h.middleware}));let f={request:n,url:s1(n,a),pattern:Hi(s),params:s[0].params,context:l,matches:s},m=await e({...f,fetcherKey:o,runClientMiddleware:x=>{let h=f;return n1(h,()=>x({...h,fetcherKey:o,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(s.flatMap(x=>{var h,w;return[(h=x._lazyPromises)==null?void 0:h.handler,(w=x._lazyPromises)==null?void 0:w.route]}))}catch{}return m}async function wb({request:e,path:n,pattern:a,match:s,lazyHandlerPromise:o,lazyRoutePromise:l,handlerOverride:d,scopedContext:f}){let g,m,x=hn(e.method),h=x?"action":"loader",w=k=>{let j,E=new Promise((M,_)=>j=_);m=()=>j(),e.signal.addEventListener("abort",m);let C=M=>typeof k!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${h}" [routeId: ${s.route.id}]`)):k({request:e,url:s1(e,n),pattern:a,params:s.params,context:f},...M!==void 0?[M]:[]),I=(async()=>{try{return{type:"data",result:await(d?d(_=>C(_)):C())}}catch(M){return{type:"error",result:M}}})();return Promise.race([I,E])};try{let k=x?s.route.action:s.route.loader;if(o||l)if(k){let j,[E]=await Promise.all([w(k).catch(C=>{j=C}),o,l]);if(j!==void 0)throw j;g=E}else{await o;let j=x?s.route.action:s.route.loader;if(j)[g]=await Promise.all([w(j),l]);else if(h==="action"){let E=new URL(e.url),C=E.pathname+E.search;throw Xn(405,{method:e.method,pathname:C,routeId:s.route.id})}else return{type:"data",result:void 0}}else if(k)g=await w(k);else{let j=new URL(e.url),E=j.pathname+j.search;throw Xn(404,{pathname:E})}}catch(k){return{type:"error",result:k}}finally{m&&e.signal.removeEventListener("abort",m)}return g}async function kb(e){let n=e.headers.get("Content-Type");return n&&/\bapplication\/json\b/.test(n)?e.body==null?null:e.json():e.text()}async function Sb(e){var s,o,l,d,f;let{result:n,type:a}=e;if(Zd(n)){let g;try{g=await kb(n)}catch(m){return{type:"error",error:m}}return a==="error"?{type:"error",error:new $i(n.status,n.statusText,g),statusCode:n.status,headers:n.headers}:{type:"data",data:g,statusCode:n.status,headers:n.headers}}return a==="error"?H0(n)?n.data instanceof Error?{type:"error",error:n.data,statusCode:(s=n.init)==null?void 0:s.status,headers:(o=n.init)!=null&&o.headers?new Headers(n.init.headers):void 0}:{type:"error",error:Nb(n),statusCode:Li(n)?n.status:void 0,headers:(l=n.init)!=null&&l.headers?new Headers(n.init.headers):void 0}:{type:"error",error:n,statusCode:Li(n)?n.status:void 0}:H0(n)?{type:"data",data:n.data,statusCode:(d=n.init)==null?void 0:d.status,headers:(f=n.init)!=null&&f.headers?new Headers(n.init.headers):void 0}:{type:"data",data:n}}function Cb(e,n,a,s,o){let l=e.headers.get("Location");if(qe(l,"Redirects returned/thrown from loaders/actions must have a Location header"),!qd(l)){let d=s.slice(0,s.findIndex(f=>f.route.id===a)+1);l=bd(new URL(n.url),d,o,l),e.headers.set("Location",l)}return e}var O0=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function B0(e,n,a,s){if(qd(e)){let o=e,l=o.startsWith("//")?new URL(n.protocol+o):new URL(o);if(O0.includes(l.protocol))throw new Error("Invalid redirect location");let d=er(l.pathname,a)!=null;if(l.origin===n.origin&&d)return Jd(l.pathname)+l.search+l.hash}try{let o=s.createURL(e);if(O0.includes(o.protocol))throw new Error("Invalid redirect location")}catch{}return e}function ks(e,n,a,s){let o=e.createURL(i1(n)).toString(),l={signal:a};if(s&&hn(s.formMethod)){let{formMethod:d,formEncType:f}=s;l.method=d.toUpperCase(),f==="application/json"?(l.headers=new Headers({"Content-Type":f}),l.body=JSON.stringify(s.json)):f==="text/plain"?l.body=s.text:f==="application/x-www-form-urlencoded"&&s.formData?l.body=kd(s.formData):l.body=s.formData}return new Request(o,l)}function s1(e,n){let a=new URL(e.url),s=typeof n=="string"?Ir(n):n;if(a.pathname=s.pathname||"/",s.search){let o=new URLSearchParams(s.search),l=o.getAll("index");o.delete("index");for(let d of l.filter(Boolean))o.append("index",d);a.search=o.size?`?${o.toString()}`:""}else a.search="";return a.hash=s.hash||"",a}function kd(e){let n=new URLSearchParams;for(let[a,s]of e.entries())n.append(a,typeof s=="string"?s:s.name);return n}function z0(e){let n=new FormData;for(let[a,s]of e.entries())n.append(a,s);return n}function jb(e,n,a,s=!1,o=!1){let l={},d=null,f,g=!1,m={},x=a&&On(a[1])?a[1].error:void 0;return e.forEach(h=>{if(!(h.route.id in n))return;let w=h.route.id,k=n[w];if(qe(!Va(k),"Cannot handle redirect results in processLoaderData"),On(k)){let j=k.error;if(x!==void 0&&(j=x,x=void 0),d=d||{},o)d[w]=j;else{let E=ga(e,w);d[E.route.id]==null&&(d[E.route.id]=j)}s||(l[w]=Qg),g||(g=!0,f=Li(k.error)?k.error.status:500),k.headers&&(m[w]=k.headers)}else l[w]=k.data,k.statusCode&&k.statusCode!==200&&!g&&(f=k.statusCode),k.headers&&(m[w]=k.headers)}),x!==void 0&&a&&(d={[a[0]]:x},a[2]&&(l[a[2]]=void 0)),{loaderData:l,errors:d,statusCode:f||200,loaderHeaders:m}}function V0(e,n,a,s,o,l,d){let{loaderData:f,errors:g}=jb(n,a,s);return o.filter(m=>!m.matches||m.matches.some(x=>x.shouldLoad)).forEach(m=>{let{key:x,match:h,controller:w}=m;if(w&&w.signal.aborted)return;let k=l[x];if(qe(k,"Did not find corresponding fetcher result"),On(k)){let j=ga(e.matches,h==null?void 0:h.route.id);g&&g[j.route.id]||(g={...g,[j.route.id]:k.error}),d.delete(x)}else if(Va(k))qe(!1,"Unhandled fetcher revalidation redirect");else{let j=Er(k.data);d.set(x,j)}}),{loaderData:f,errors:g}}function U0(e,n,a,s){let o=Object.entries(n).filter(([,l])=>l!==Qg).reduce((l,[d,f])=>(l[d]=f,l),{});for(let l of a){let d=l.route.id;if(!n.hasOwnProperty(d)&&e.hasOwnProperty(d)&&l.route.loader&&(o[d]=e[d]),s&&s.hasOwnProperty(d))break}return o}function $0(e){return e?On(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function ga(e,n){return(n?e.slice(0,e.findIndex(s=>s.route.id===n)+1):[...e]).reverse().find(s=>s.route.hasErrorBoundary===!0)||e[0]}function tl(e){let n=e.length===1?e[0]:e.find(a=>a.index||!a.path||a.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:n}],route:n}}function Xn(e,{pathname:n,routeId:a,method:s,type:o,message:l}={}){let d="Unknown Server Error",f="Unknown @remix-run/router error";return e===400?(d="Bad Request",s&&n&&a?f=`You made a ${s} request to "${n}" but did not provide a \`loader\` for route "${a}", so there is no way to handle the request.`:o==="invalid-body"&&(f="Unable to encode submission body")):e===403?(d="Forbidden",f=`Route "${a}" does not match URL "${n}"`):e===404?(d="Not Found",f=`No route matches URL "${n}"`):e===405&&(d="Method Not Allowed",s&&n&&a?f=`You made a ${s.toUpperCase()} request to "${n}" but did not provide an \`action\` for route "${a}", so there is no way to handle the request.`:s&&(f=`Invalid request method "${s.toUpperCase()}"`)),new $i(e||500,d,new Error(f),!0)}function nl(e){let n=Object.entries(e);for(let a=n.length-1;a>=0;a--){let[s,o]=n[a];if(Va(o))return{key:s,result:o}}}function i1(e){let n=typeof e=="string"?Ir(e):e;return Mr({...n,hash:""})}function Eb(e,n){return e.pathname!==n.pathname||e.search!==n.search?!1:e.hash===""?n.hash!=="":e.hash===n.hash?!0:n.hash!==""}function Nb(e){var n,a;return new $i(((n=e.init)==null?void 0:n.status)??500,((a=e.init)==null?void 0:a.statusText)??"Internal Server Error",e.data)}function Tb(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([n,a])=>typeof n=="string"&&Pb(a))}function Pb(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function Rb(e){return Zd(e.result)&&qg.has(e.result.status)}function On(e){return e.type==="error"}function Va(e){return(e&&e.type)==="redirect"}function H0(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Zd(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Mb(e){return qg.has(e)}function Fb(e){return Zd(e)&&Mb(e.status)&&e.headers.has("Location")}function Ib(e){return lb.has(e.toUpperCase())}function hn(e){return ib.has(e.toUpperCase())}function ef(e){return new URLSearchParams(e).getAll("index").some(n=>n==="")}function gl(e,n){let a=typeof n=="string"?Ir(n).search:n.search;if(e[e.length-1].route.index&&ef(a||""))return e[e.length-1];let s=Wg(e);return s[s.length-1]}function W0(e){let{formMethod:n,formAction:a,formEncType:s,text:o,formData:l,json:d}=e;if(!(!n||!a||!s)){if(o!=null)return{formMethod:n,formAction:a,formEncType:s,formData:void 0,json:void 0,text:o};if(l!=null)return{formMethod:n,formAction:a,formEncType:s,formData:l,json:void 0,text:void 0};if(d!==void 0)return{formMethod:n,formAction:a,formEncType:s,formData:void 0,json:d,text:void 0}}}function $u(e,n,a,s){return s?{state:"loading",location:e,matches:n,historyAction:a,formMethod:s.formMethod,formAction:s.formAction,formEncType:s.formEncType,formData:s.formData,json:s.json,text:s.text}:{state:"loading",location:e,matches:n,historyAction:a,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Db(e,n,a,s){return{state:"submitting",location:e,matches:n,historyAction:a,formMethod:s.formMethod,formAction:s.formAction,formEncType:s.formEncType,formData:s.formData,json:s.json,text:s.text}}function ki(e,n){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:n}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:n}}function _b(e,n){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:n?n.data:void 0}}function Er(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Lb(e,n){try{let a=e.sessionStorage.getItem(Jg);if(a){let s=JSON.parse(a);for(let[o,l]of Object.entries(s||{}))l&&Array.isArray(l)&&n.set(o,new Set(l||[]))}}catch{}}function Ab(e,n){if(n.size>0){let a={};for(let[s,o]of n)a[s]=[...o];try{e.sessionStorage.setItem(Jg,JSON.stringify(a))}catch(s){Dt(!1,`Failed to save applied view transitions in sessionStorage (${s}).`)}}}function K0(){let e,n,a=new Promise((s,o)=>{e=async l=>{s(l);try{await a}catch{}},n=async l=>{o(l);try{await a}catch{}}});return{promise:a,resolve:e,reject:n}}var Ya=v.createContext(null);Ya.displayName="DataRouter";var Wi=v.createContext(null);Wi.displayName="DataRouterState";var o1=v.createContext(!1);function l1(){return v.useContext(o1)}var tf=v.createContext({isTransitioning:!1});tf.displayName="ViewTransition";var c1=v.createContext(new Map);c1.displayName="Fetchers";var Ob=v.createContext(null);Ob.displayName="Await";var zn=v.createContext(null);zn.displayName="Navigation";var Hl=v.createContext(null);Hl.displayName="Location";var tr=v.createContext({outlet:null,matches:[],isDataRoute:!1});tr.displayName="Route";var nf=v.createContext(null);nf.displayName="RouteError";var u1="REACT_ROUTER_ERROR",Bb="REDIRECT",zb="ROUTE_ERROR_RESPONSE";function Vb(e){if(e.startsWith(`${u1}:${Bb}:{`))try{let n=JSON.parse(e.slice(28));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.location=="string"&&typeof n.reloadDocument=="boolean"&&typeof n.replace=="boolean")return n}catch{}}function Ub(e){if(e.startsWith(`${u1}:${zb}:{`))try{let n=JSON.parse(e.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new $i(n.status,n.statusText,n.data)}catch{}}function $b(e,{relative:n}={}){qe(As(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:s}=v.useContext(zn),{hash:o,pathname:l,search:d}=Ki(e,{relative:n}),f=l;return a!=="/"&&(f=l==="/"?a:Qn([a,l])),s.createHref({pathname:f,search:d,hash:o})}function As(){return v.useContext(Hl)!=null}function Ut(){return qe(As(),"useLocation() may be used only in the context of a <Router> component."),v.useContext(Hl).location}var d1="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function f1(e){v.useContext(zn).static||v.useLayoutEffect(e)}function bn(){let{isDataRoute:e}=v.useContext(tr);return e?a5():Hb()}function Hb(){qe(As(),"useNavigate() may be used only in the context of a <Router> component.");let e=v.useContext(Ya),{basename:n,navigator:a}=v.useContext(zn),{matches:s}=v.useContext(tr),{pathname:o}=Ut(),l=JSON.stringify($l(s)),d=v.useRef(!1);return f1(()=>{d.current=!0}),v.useCallback((g,m={})=>{if(Dt(d.current,d1),!d.current)return;if(typeof g=="number"){a.go(g);return}let x=Ui(g,JSON.parse(l),o,m.relative==="path");e==null&&n!=="/"&&(x.pathname=x.pathname==="/"?n:Qn([n,x.pathname])),(m.replace?a.replace:a.push)(x,m.state,m)},[n,a,l,o,e])}var Wb=v.createContext(null);function Kb(e){let n=v.useContext(tr).outlet;return v.useMemo(()=>n&&v.createElement(Wb.Provider,{value:e},n),[n,e])}function Wl(){let{matches:e}=v.useContext(tr),n=e[e.length-1];return(n==null?void 0:n.params)??{}}function Ki(e,{relative:n}={}){let{matches:a}=v.useContext(tr),{pathname:s}=Ut(),o=JSON.stringify($l(a));return v.useMemo(()=>Ui(e,JSON.parse(o),s,n==="path"),[e,o,s,n])}function Yb(e,n,a){qe(As(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=v.useContext(zn),{matches:o}=v.useContext(tr),l=o[o.length-1],d=l?l.params:{},f=l?l.pathname:"/",g=l?l.pathnameBase:"/",m=l&&l.route;{let C=m&&m.path||"";m1(f,!m||C.endsWith("*")||C.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${C}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
Please change the parent <Route path="${C}"> to <Route path="${C==="/"?"*":`${C}/*`}">.`)}let x=Ut(),h;h=x;let w=h.pathname||"/",k=w;if(g!=="/"){let C=g.replace(/^\//,"").split("/");k="/"+w.replace(/^\//,"").split("/").slice(C.length).join("/")}let j=a&&a.state.matches.length?a.state.matches.map(C=>Object.assign(C,{route:a.manifest[C.route.id]||C.route})):zg(e,{pathname:k});return Dt(m||j!=null,`No routes matched location "${h.pathname}${h.search}${h.hash}" `),Dt(j==null||j[j.length-1].route.element!==void 0||j[j.length-1].route.Component!==void 0||j[j.length-1].route.lazy!==void 0,`Matched leaf route at location "${h.pathname}${h.search}${h.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),Qb(j&&j.map(C=>Object.assign({},C,{params:Object.assign({},d,C.params),pathname:Qn([g,s.encodeLocation?s.encodeLocation(C.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?g:Qn([g,s.encodeLocation?s.encodeLocation(C.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathnameBase])})),o,a)}function Gb(){let e=r5(),n=Li(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),a=e instanceof Error?e.stack:null,s="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:s},l={padding:"2px 4px",backgroundColor:s},d=null;return console.error("Error handled by React Router default ErrorBoundary:",e),d=v.createElement(v.Fragment,null,v.createElement("p",null,"💿 Hey developer 👋"),v.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",v.createElement("code",{style:l},"ErrorBoundary")," or"," ",v.createElement("code",{style:l},"errorElement")," prop on your route.")),v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},n),a?v.createElement("pre",{style:o},a):null,d)}var Xb=v.createElement(Gb,null),h1=class extends v.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){this.props.onError?this.props.onError(e,n):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const a=Ub(e.digest);a&&(e=a)}let n=e!==void 0?v.createElement(tr.Provider,{value:this.props.routeContext},v.createElement(nf.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?v.createElement(qb,{error:e},n):n}};h1.contextType=o1;var Hu=new WeakMap;function qb({children:e,error:n}){let{basename:a}=v.useContext(zn);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let s=Vb(n.digest);if(s){let o=Hu.get(n);if(o)throw o;let l=Yg(s.location,a);if(Kg&&!Hu.get(n))if(l.isExternal||s.reloadDocument)window.location.href=l.absoluteURL||l.to;else{const d=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(l.to,{replace:s.replace}));throw Hu.set(n,d),d}return v.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l.absoluteURL||l.to}`})}}return e}function Jb({routeContext:e,match:n,children:a}){let s=v.useContext(Ya);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),v.createElement(tr.Provider,{value:e},a)}function Qb(e,n=[],a){let s=a==null?void 0:a.state;if(e==null){if(!s)return null;if(s.errors)e=s.matches;else if(n.length===0&&!s.initialized&&s.matches.length>0)e=s.matches;else return null}let o=e,l=s==null?void 0:s.errors;if(l!=null){let x=o.findIndex(h=>h.route.id&&(l==null?void 0:l[h.route.id])!==void 0);qe(x>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),o=o.slice(0,Math.min(o.length,x+1))}let d=!1,f=-1;if(a&&s){d=s.renderFallback;for(let x=0;x<o.length;x++){let h=o[x];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(f=x),h.route.id){let{loaderData:w,errors:k}=s,j=h.route.loader&&!w.hasOwnProperty(h.route.id)&&(!k||k[h.route.id]===void 0);if(h.route.lazy||j){a.isStatic&&(d=!0),f>=0?o=o.slice(0,f+1):o=[o[0]];break}}}}let g=a==null?void 0:a.onError,m=s&&g?(x,h)=>{var w,k;g(x,{location:s.location,params:((k=(w=s.matches)==null?void 0:w[0])==null?void 0:k.params)??{},pattern:Hi(s.matches),errorInfo:h})}:void 0;return o.reduceRight((x,h,w)=>{let k,j=!1,E=null,C=null;s&&(k=l&&h.route.id?l[h.route.id]:void 0,E=h.route.errorElement||Xb,d&&(f<0&&w===0?(m1("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),j=!0,C=null):f===w&&(j=!0,C=h.route.hydrateFallbackElement||null)));let I=n.concat(o.slice(0,w+1)),M=()=>{let _;return k?_=E:j?_=C:h.route.Component?_=v.createElement(h.route.Component,null):h.route.element?_=h.route.element:_=x,v.createElement(Jb,{match:h,routeContext:{outlet:x,matches:I,isDataRoute:s!=null},children:_})};return s&&(h.route.ErrorBoundary||h.route.errorElement||w===0)?v.createElement(h1,{location:s.location,revalidation:s.revalidation,component:E,error:k,children:M(),routeContext:{outlet:null,matches:I,isDataRoute:!0},onError:m}):M()},null)}function rf(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Zb(e){let n=v.useContext(Ya);return qe(n,rf(e)),n}function p1(e){let n=v.useContext(Wi);return qe(n,rf(e)),n}function e5(e){let n=v.useContext(tr);return qe(n,rf(e)),n}function af(e){let n=e5(e),a=n.matches[n.matches.length-1];return qe(a.route.id,`${e} can only be used on routes that contain a unique "id"`),a.route.id}function t5(){return af("useRouteId")}function n5(){let{matches:e,loaderData:n}=p1("useMatches");return v.useMemo(()=>e.map(a=>Vg(a,n)),[e,n])}function r5(){var s;let e=v.useContext(nf),n=p1("useRouteError"),a=af("useRouteError");return e!==void 0?e:(s=n.errors)==null?void 0:s[a]}function a5(){let{router:e}=Zb("useNavigate"),n=af("useNavigate"),a=v.useRef(!1);return f1(()=>{a.current=!0}),v.useCallback(async(o,l={})=>{Dt(a.current,d1),a.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:n,...l}))},[e,n])}var Y0={};function m1(e,n,a){!n&&!Y0[e]&&(Y0[e]=!0,Dt(!1,a))}var G0={};function X0(e,n){!e&&!G0[n]&&(G0[n]=!0,console.warn(n))}var s5="useOptimistic",q0=Tv[s5],i5=()=>{};function o5(e){return q0?q0(e):[e,i5]}function l5(e){let n={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Dt(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(n,{element:v.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Dt(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(n,{hydrateFallbackElement:v.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Dt(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(n,{errorElement:v.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),n}var c5=["HydrateFallback","hydrateFallbackElement"],u5=class{constructor(){this.status="pending",this.promise=new Promise((e,n)=>{this.resolve=a=>{this.status==="pending"&&(this.status="resolved",e(a))},this.reject=a=>{this.status==="pending"&&(this.status="rejected",n(a))}})}};function d5({router:e,flushSync:n,onError:a,useTransitions:s}){s=l1()||s;let[l,d]=v.useState(e.state),[f,g]=o5(l),[m,x]=v.useState(),[h,w]=v.useState({isTransitioning:!1}),[k,j]=v.useState(),[E,C]=v.useState(),[I,M]=v.useState(),_=v.useRef(new Map),V=v.useCallback((b,{deletedFetchers:R,newErrors:N,flushSync:G,viewTransitionOpts:Y})=>{N&&a&&Object.values(N).forEach(K=>{var te;return a(K,{location:b.location,params:((te=b.matches[0])==null?void 0:te.params)??{},pattern:Hi(b.matches)})}),b.fetchers.forEach((K,te)=>{K.data!==void 0&&_.current.set(te,K.data)}),R.forEach(K=>_.current.delete(K)),X0(G===!1||n!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let X=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(X0(Y==null||X,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!Y||!X){n&&G?n(()=>d(b)):s===!1?d(b):v.startTransition(()=>{s===!0&&g(K=>J0(K,b)),d(b)});return}if(n&&G){n(()=>{E&&(k==null||k.resolve(),E.skipTransition()),w({isTransitioning:!0,flushSync:!0,currentLocation:Y.currentLocation,nextLocation:Y.nextLocation})});let K=e.window.document.startViewTransition(()=>{n(()=>d(b))});K.finished.finally(()=>{n(()=>{j(void 0),C(void 0),x(void 0),w({isTransitioning:!1})})}),n(()=>C(K));return}E?(k==null||k.resolve(),E.skipTransition(),M({state:b,currentLocation:Y.currentLocation,nextLocation:Y.nextLocation})):(x(b),w({isTransitioning:!0,flushSync:!1,currentLocation:Y.currentLocation,nextLocation:Y.nextLocation}))},[e.window,n,E,k,s,g,a]);v.useLayoutEffect(()=>e.subscribe(V),[e,V]),v.useEffect(()=>{h.isTransitioning&&!h.flushSync&&j(new u5)},[h]),v.useEffect(()=>{if(k&&m&&e.window){let b=m,R=k.promise,N=e.window.document.startViewTransition(async()=>{s===!1?d(b):v.startTransition(()=>{s===!0&&g(G=>J0(G,b)),d(b)}),await R});N.finished.finally(()=>{j(void 0),C(void 0),x(void 0),w({isTransitioning:!1})}),C(N)}},[m,k,e.window,s,g]),v.useEffect(()=>{k&&m&&f.location.key===m.location.key&&k.resolve()},[k,E,f.location,m]),v.useEffect(()=>{!h.isTransitioning&&I&&(x(I.state),w({isTransitioning:!0,flushSync:!1,currentLocation:I.currentLocation,nextLocation:I.nextLocation}),M(void 0))},[h.isTransitioning,I]);let H=v.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:b=>e.navigate(b),push:(b,R,N)=>e.navigate(b,{state:R,preventScrollReset:N==null?void 0:N.preventScrollReset}),replace:(b,R,N)=>e.navigate(b,{replace:!0,state:R,preventScrollReset:N==null?void 0:N.preventScrollReset})}),[e]),re=e.basename||"/",O=v.useMemo(()=>({router:e,navigator:H,static:!1,basename:re,onError:a}),[e,H,re,a]);return v.createElement(v.Fragment,null,v.createElement(Ya.Provider,{value:O},v.createElement(Wi.Provider,{value:f},v.createElement(c1.Provider,{value:_.current},v.createElement(tf.Provider,{value:h},v.createElement(p5,{basename:re,location:f.location,navigationType:f.historyAction,navigator:H,useTransitions:s},v.createElement(f5,{routes:e.routes,manifest:e.manifest,future:e.future,state:f,isStatic:!1,onError:a})))))),null)}function J0(e,n){return{...e,navigation:n.navigation.state!=="idle"?n.navigation:e.navigation,revalidation:n.revalidation!=="idle"?n.revalidation:e.revalidation,actionData:n.navigation.state!=="submitting"?n.actionData:e.actionData,fetchers:n.fetchers}}var f5=v.memo(h5);function h5({routes:e,manifest:n,future:a,state:s,isStatic:o,onError:l}){return Yb(e,void 0,{manifest:n,state:s,isStatic:o,onError:l})}function g1({to:e,replace:n,state:a,relative:s}){qe(As(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=v.useContext(zn);Dt(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:l}=v.useContext(tr),{pathname:d}=Ut(),f=bn(),g=Ui(e,$l(l),d,s==="path"),m=JSON.stringify(g);return v.useEffect(()=>{f(JSON.parse(m),{replace:n,state:a,relative:s})},[f,m,s,n,a]),null}function p5({basename:e="/",children:n=null,location:a,navigationType:s="POP",navigator:o,static:l=!1,useTransitions:d}){qe(!As(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),g=v.useMemo(()=>({basename:f,navigator:o,static:l,useTransitions:d,future:{}}),[f,o,l,d]);typeof a=="string"&&(a=Ir(a));let{pathname:m="/",search:x="",hash:h="",state:w=null,key:k="default",mask:j}=a,E=v.useMemo(()=>{let C=er(m,f);return C==null?null:{location:{pathname:C,search:x,hash:h,state:w,key:k,mask:j},navigationType:s}},[f,m,x,h,w,k,s,j]);return Dt(E!=null,`<Router basename="${f}"> is not able to match the URL "${m}${x}${h}" because it does not start with the basename, so the <Router> won't render anything.`),E==null?null:v.createElement(zn.Provider,{value:g},v.createElement(Hl.Provider,{children:n,value:E}))}var xl="get",yl="application/x-www-form-urlencoded";function Kl(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function m5(e){return Kl(e)&&e.tagName.toLowerCase()==="button"}function g5(e){return Kl(e)&&e.tagName.toLowerCase()==="form"}function x5(e){return Kl(e)&&e.tagName.toLowerCase()==="input"}function y5(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function v5(e,n){return e.button===0&&(!n||n==="_self")&&!y5(e)}function Sd(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((n,a)=>{let s=e[a];return n.concat(Array.isArray(s)?s.map(o=>[a,o]):[[a,s]])},[]))}function b5(e,n){let a=Sd(e);return n&&n.forEach((s,o)=>{a.has(o)||n.getAll(o).forEach(l=>{a.append(o,l)})}),a}var rl=null;function w5(){if(rl===null)try{new FormData(document.createElement("form"),0),rl=!1}catch{rl=!0}return rl}var k5=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Wu(e){return e!=null&&!k5.has(e)?(Dt(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${yl}"`),null):e}function S5(e,n){let a,s,o,l,d;if(g5(e)){let f=e.getAttribute("action");s=f?er(f,n):null,a=e.getAttribute("method")||xl,o=Wu(e.getAttribute("enctype"))||yl,l=new FormData(e)}else if(m5(e)||x5(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=e.getAttribute("formaction")||f.getAttribute("action");if(s=g?er(g,n):null,a=e.getAttribute("formmethod")||f.getAttribute("method")||xl,o=Wu(e.getAttribute("formenctype"))||Wu(f.getAttribute("enctype"))||yl,l=new FormData(f,e),!w5()){let{name:m,type:x,value:h}=e;if(x==="image"){let w=m?`${m}.`:"";l.append(`${w}x`,"0"),l.append(`${w}y`,"0")}else m&&l.append(m,h)}}else{if(Kl(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=xl,s=null,o=yl,d=e}return l&&o==="text/plain"&&(d=l,l=void 0),{action:s,method:a.toLowerCase(),encType:o,formData:l,body:d}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function sf(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function x1(e,n,a,s){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return a?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${s}`:o.pathname=`${o.pathname}.${s}`:o.pathname==="/"?o.pathname=`_root.${s}`:n&&er(o.pathname,n)==="/"?o.pathname=`${Pl(n)}/_root.${s}`:o.pathname=`${Pl(o.pathname)}.${s}`,o}async function C5(e,n){if(e.id in n)return n[e.id];try{let a=await import(e.module);return n[e.id]=a,a}catch(a){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(a),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function j5(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function E5(e,n,a){let s=await Promise.all(e.map(async o=>{let l=n.routes[o.route.id];if(l){let d=await C5(l,a);return d.links?d.links():[]}return[]}));return R5(s.flat(1).filter(j5).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function Q0(e,n,a,s,o,l){let d=(g,m)=>a[m]?g.route.id!==a[m].route.id:!0,f=(g,m)=>{var x;return a[m].pathname!==g.pathname||((x=a[m].route.path)==null?void 0:x.endsWith("*"))&&a[m].params["*"]!==g.params["*"]};return l==="assets"?n.filter((g,m)=>d(g,m)||f(g,m)):l==="data"?n.filter((g,m)=>{var h;let x=s.routes[g.route.id];if(!x||!x.hasLoader)return!1;if(d(g,m)||f(g,m))return!0;if(g.route.shouldRevalidate){let w=g.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((h=a[0])==null?void 0:h.params)||{},nextUrl:new URL(e,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof w=="boolean")return w}return!0}):[]}function N5(e,n,{includeHydrateFallback:a}={}){return T5(e.map(s=>{let o=n.routes[s.route.id];if(!o)return[];let l=[o.module];return o.clientActionModule&&(l=l.concat(o.clientActionModule)),o.clientLoaderModule&&(l=l.concat(o.clientLoaderModule)),a&&o.hydrateFallbackModule&&(l=l.concat(o.hydrateFallbackModule)),o.imports&&(l=l.concat(o.imports)),l}).flat(1))}function T5(e){return[...new Set(e)]}function P5(e){let n={},a=Object.keys(e).sort();for(let s of a)n[s]=e[s];return n}function R5(e,n){let a=new Set;return new Set(n),e.reduce((s,o)=>{let l=JSON.stringify(P5(o));return a.has(l)||(a.add(l),s.push({key:l,link:o})),s},[])}function of(){let e=v.useContext(Ya);return sf(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function M5(){let e=v.useContext(Wi);return sf(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var lf=v.createContext(void 0);lf.displayName="FrameworkContext";function cf(){let e=v.useContext(lf);return sf(e,"You must render this element inside a <HydratedRouter> element"),e}function F5(e,n){let a=v.useContext(lf),[s,o]=v.useState(!1),[l,d]=v.useState(!1),{onFocus:f,onBlur:g,onMouseEnter:m,onMouseLeave:x,onTouchStart:h}=n,w=v.useRef(null);v.useEffect(()=>{if(e==="render"&&d(!0),e==="viewport"){let E=I=>{I.forEach(M=>{d(M.isIntersecting)})},C=new IntersectionObserver(E,{threshold:.5});return w.current&&C.observe(w.current),()=>{C.disconnect()}}},[e]),v.useEffect(()=>{if(s){let E=setTimeout(()=>{d(!0)},100);return()=>{clearTimeout(E)}}},[s]);let k=()=>{o(!0)},j=()=>{o(!1),d(!1)};return a?e!=="intent"?[l,w,{}]:[l,w,{onFocus:Si(f,k),onBlur:Si(g,j),onMouseEnter:Si(m,k),onMouseLeave:Si(x,j),onTouchStart:Si(h,k)}]:[!1,w,{}]}function Si(e,n){return a=>{e&&e(a),a.defaultPrevented||n(a)}}function I5({page:e,...n}){let a=l1(),{router:s}=of(),o=v.useMemo(()=>zg(s.routes,e,s.basename),[s.routes,e,s.basename]);return o?a?v.createElement(_5,{page:e,matches:o,...n}):v.createElement(L5,{page:e,matches:o,...n}):null}function D5(e){let{manifest:n,routeModules:a}=cf(),[s,o]=v.useState([]);return v.useEffect(()=>{let l=!1;return E5(e,n,a).then(d=>{l||o(d)}),()=>{l=!0}},[e,n,a]),s}function _5({page:e,matches:n,...a}){let s=Ut(),{future:o}=cf(),{basename:l}=of(),d=v.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let f=x1(e,l,o.unstable_trailingSlashAwareDataRequests,"rsc"),g=!1,m=[];for(let x of n)typeof x.route.shouldRevalidate=="function"?g=!0:m.push(x.route.id);return g&&m.length>0&&f.searchParams.set("_routes",m.join(",")),[f.pathname+f.search]},[l,o.unstable_trailingSlashAwareDataRequests,e,s,n]);return v.createElement(v.Fragment,null,d.map(f=>v.createElement("link",{key:f,rel:"prefetch",as:"fetch",href:f,...a})))}function L5({page:e,matches:n,...a}){let s=Ut(),{future:o,manifest:l,routeModules:d}=cf(),{basename:f}=of(),{loaderData:g,matches:m}=M5(),x=v.useMemo(()=>Q0(e,n,m,l,s,"data"),[e,n,m,l,s]),h=v.useMemo(()=>Q0(e,n,m,l,s,"assets"),[e,n,m,l,s]),w=v.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let E=new Set,C=!1;if(n.forEach(M=>{var V;let _=l.routes[M.route.id];!_||!_.hasLoader||(!x.some(H=>H.route.id===M.route.id)&&M.route.id in g&&((V=d[M.route.id])!=null&&V.shouldRevalidate)||_.hasClientLoader?C=!0:E.add(M.route.id))}),E.size===0)return[];let I=x1(e,f,o.unstable_trailingSlashAwareDataRequests,"data");return C&&E.size>0&&I.searchParams.set("_routes",n.filter(M=>E.has(M.route.id)).map(M=>M.route.id).join(",")),[I.pathname+I.search]},[f,o.unstable_trailingSlashAwareDataRequests,g,s,l,x,n,e,d]),k=v.useMemo(()=>N5(h,l),[h,l]),j=D5(h);return v.createElement(v.Fragment,null,w.map(E=>v.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...a})),k.map(E=>v.createElement("link",{key:E,rel:"modulepreload",href:E,...a})),j.map(({key:E,link:C})=>v.createElement("link",{key:E,nonce:a.nonce,...C,crossOrigin:C.crossOrigin??a.crossOrigin})))}function A5(...e){return n=>{e.forEach(a=>{typeof a=="function"?a(n):a!=null&&(a.current=n)})}}var O5=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{O5&&(window.__reactRouterVersion="7.15.1")}catch{}function B5(e,n){return hb({basename:n==null?void 0:n.basename,getContext:n==null?void 0:n.getContext,future:n==null?void 0:n.future,history:Pv({window:n==null?void 0:n.window}),hydrationData:z5(),routes:e,mapRouteProperties:l5,hydrationRouteProperties:c5,dataStrategy:n==null?void 0:n.dataStrategy,patchRoutesOnNavigation:n==null?void 0:n.patchRoutesOnNavigation,window:n==null?void 0:n.window,instrumentations:n==null?void 0:n.instrumentations}).initialize()}function z5(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:V5(e.errors)}),e}function V5(e){if(!e)return null;let n=Object.entries(e),a={};for(let[s,o]of n)if(o&&o.__type==="RouteErrorResponse")a[s]=new $i(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let l=window[o.__subType];if(typeof l=="function")try{let d=new l(o.message);d.stack="",a[s]=d}catch{}}if(a[s]==null){let l=new Error(o.message);l.stack="",a[s]=l}}else a[s]=o;return a}var y1=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,v1=v.forwardRef(function({onClick:n,discover:a="render",prefetch:s="none",relative:o,reloadDocument:l,replace:d,mask:f,state:g,target:m,to:x,preventScrollReset:h,viewTransition:w,defaultShouldRevalidate:k,...j},E){let{basename:C,navigator:I,useTransitions:M}=v.useContext(zn),_=typeof x=="string"&&y1.test(x),V=Yg(x,C);x=V.to;let H=$b(x,{relative:o}),re=Ut(),O=null;if(f){let te=Ui(f,[],re.mask?re.mask.pathname:"/",!0);C!=="/"&&(te.pathname=te.pathname==="/"?C:Qn([C,te.pathname])),O=I.createHref(te)}let[b,R,N]=F5(s,j),G=H5(x,{replace:d,mask:f,state:g,target:m,preventScrollReset:h,relative:o,viewTransition:w,defaultShouldRevalidate:k,useTransitions:M});function Y(te){n&&n(te),te.defaultPrevented||G(te)}let X=!(V.isExternal||l),K=v.createElement("a",{...j,...N,href:(X?O:void 0)||V.absoluteURL||H,onClick:X?Y:n,ref:A5(E,R),target:m,"data-discover":!_&&a==="render"?"true":void 0});return b&&!_?v.createElement(v.Fragment,null,K,v.createElement(I5,{page:H})):K});v1.displayName="Link";var b1=v.forwardRef(function({"aria-current":n="page",caseSensitive:a=!1,className:s="",end:o=!1,style:l,to:d,viewTransition:f,children:g,...m},x){let h=Ki(d,{relative:m.relative}),w=Ut(),k=v.useContext(Wi),{navigator:j,basename:E}=v.useContext(zn),C=k!=null&&q5(h)&&f===!0,I=j.encodeLocation?j.encodeLocation(h).pathname:h.pathname,M=w.pathname,_=k&&k.navigation&&k.navigation.location?k.navigation.location.pathname:null;a||(M=M.toLowerCase(),_=_?_.toLowerCase():null,I=I.toLowerCase()),_&&E&&(_=er(_,E)||_);const V=I!=="/"&&I.endsWith("/")?I.length-1:I.length;let H=M===I||!o&&M.startsWith(I)&&M.charAt(V)==="/",re=_!=null&&(_===I||!o&&_.startsWith(I)&&_.charAt(I.length)==="/"),O={isActive:H,isPending:re,isTransitioning:C},b=H?n:void 0,R;typeof s=="function"?R=s(O):R=[s,H?"active":null,re?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let N=typeof l=="function"?l(O):l;return v.createElement(v1,{...m,"aria-current":b,className:R,ref:x,style:N,to:d,viewTransition:f},typeof g=="function"?g(O):g)});b1.displayName="NavLink";var U5=v.forwardRef(({discover:e="render",fetcherKey:n,navigate:a,reloadDocument:s,replace:o,state:l,method:d=xl,action:f,onSubmit:g,relative:m,preventScrollReset:x,viewTransition:h,defaultShouldRevalidate:w,...k},j)=>{let{useTransitions:E}=v.useContext(zn),C=G5(),I=X5(f,{relative:m}),M=d.toLowerCase()==="get"?"get":"post",_=typeof f=="string"&&y1.test(f),V=H=>{if(g&&g(H),H.defaultPrevented)return;H.preventDefault();let re=H.nativeEvent.submitter,O=(re==null?void 0:re.getAttribute("formmethod"))||d,b=()=>C(re||H.currentTarget,{fetcherKey:n,method:O,navigate:a,replace:o,state:l,relative:m,preventScrollReset:x,viewTransition:h,defaultShouldRevalidate:w});E&&a!==!1?v.startTransition(()=>b()):b()};return v.createElement("form",{ref:j,method:M,action:I,onSubmit:s?g:V,...k,"data-discover":!_&&e==="render"?"true":void 0})});U5.displayName="Form";function $5(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function w1(e){let n=v.useContext(Ya);return qe(n,$5(e)),n}function H5(e,{target:n,replace:a,mask:s,state:o,preventScrollReset:l,relative:d,viewTransition:f,defaultShouldRevalidate:g,useTransitions:m}={}){let x=bn(),h=Ut(),w=Ki(e,{relative:d});return v.useCallback(k=>{if(v5(k,n)){k.preventDefault();let j=a!==void 0?a:Mr(h)===Mr(w),E=()=>x(e,{replace:j,mask:s,state:o,preventScrollReset:l,relative:d,viewTransition:f,defaultShouldRevalidate:g});m?v.startTransition(()=>E()):E()}},[h,x,w,a,s,o,n,e,l,d,f,g,m])}function W5(e){Dt(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let n=v.useRef(Sd(e)),a=v.useRef(!1),s=Ut(),o=v.useMemo(()=>b5(s.search,a.current?null:n.current),[s.search]),l=bn(),d=v.useCallback((f,g)=>{const m=Sd(typeof f=="function"?f(new URLSearchParams(o)):f);a.current=!0,l("?"+m,g)},[l,o]);return[o,d]}var K5=0,Y5=()=>`__${String(++K5)}__`;function G5(){let{router:e}=w1("useSubmit"),{basename:n}=v.useContext(zn),a=t5(),s=e.fetch,o=e.navigate;return v.useCallback(async(l,d={})=>{let{action:f,method:g,encType:m,formData:x,body:h}=S5(l,n);if(d.navigate===!1){let w=d.fetcherKey||Y5();await s(w,a,d.action||f,{defaultShouldRevalidate:d.defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:x,body:h,formMethod:d.method||g,formEncType:d.encType||m,flushSync:d.flushSync})}else await o(d.action||f,{defaultShouldRevalidate:d.defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:x,body:h,formMethod:d.method||g,formEncType:d.encType||m,replace:d.replace,state:d.state,fromRouteId:a,flushSync:d.flushSync,viewTransition:d.viewTransition})},[s,o,n,a])}function X5(e,{relative:n}={}){let{basename:a}=v.useContext(zn),s=v.useContext(tr);qe(s,"useFormAction must be used inside a RouteContext");let[o]=s.matches.slice(-1),l={...Ki(e||".",{relative:n})},d=Ut();if(e==null){l.search=d.search;let f=new URLSearchParams(l.search),g=f.getAll("index");if(g.some(x=>x==="")){f.delete("index"),g.filter(h=>h).forEach(h=>f.append("index",h));let x=f.toString();l.search=x?`?${x}`:""}}return(!e||e===".")&&o.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(l.pathname=l.pathname==="/"?a:Qn([a,l.pathname])),Mr(l)}function q5(e,{relative:n}={}){let a=v.useContext(tf);qe(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=w1("useViewTransitionState"),o=Ki(e,{relative:n});if(!a.isTransitioning)return!1;let l=er(a.currentLocation.pathname,s)||a.currentLocation.pathname,d=er(a.nextLocation.pathname,s)||a.nextLocation.pathname;return Tl(o.pathname,d)!=null||Tl(o.pathname,l)!=null}var uf=Lg();const J5=_g(uf);function Q5(e){return v.createElement(d5,{flushSync:uf.flushSync,...e})}const nt="http://141.11.1.189",k1=()=>!!localStorage.getItem("accessToken"),Z5=()=>{const e=localStorage.getItem("userInfo");if(!e)return null;try{return JSON.parse(e)}catch{return null}},Ga=()=>localStorage.getItem("accessToken"),ew=()=>localStorage.getItem("username"),tw=async()=>{const e=Ga();if(e)try{await fetch(`${nt}/api/logout`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${e}`},body:""})}catch(n){console.error("خطا در logout از سرور:",n)}localStorage.removeItem("accessToken"),localStorage.removeItem("refreshToken"),localStorage.removeItem("userId"),localStorage.removeItem("username"),localStorage.removeItem("userInfo"),localStorage.removeItem("userProfile")},nw=()=>k1()?!0:(localStorage.removeItem("accessToken"),localStorage.removeItem("refreshToken"),localStorage.removeItem("userId"),localStorage.removeItem("username"),localStorage.removeItem("userInfo"),localStorage.removeItem("userProfile"),!1);function S1({children:e}){const n=Ut();return nw()?u.jsx(u.Fragment,{children:e}):u.jsx(g1,{to:"/login",replace:!0,state:{from:n,error:"لطفاً ابتدا وارد سیستم شوید"}})}const df=v.createContext({});function ff(e){const n=v.useRef(null);return n.current===null&&(n.current=e()),n.current}const rw=typeof window<"u",C1=rw?v.useLayoutEffect:v.useEffect,Yl=v.createContext(null);function hf(e,n){e.indexOf(n)===-1&&e.push(n)}function Rl(e,n){const a=e.indexOf(n);a>-1&&e.splice(a,1)}const Fr=(e,n,a)=>a>n?n:a<e?e:a;let pf=()=>{};const wa={},j1=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function E1(e){return typeof e=="object"&&e!==null}const N1=e=>/^0[^.\s]+$/u.test(e);function T1(e){let n;return()=>(n===void 0&&(n=e()),n)}const Zn=e=>e,aw=(e,n)=>a=>n(e(a)),Yi=(...e)=>e.reduce(aw),Ai=(e,n,a)=>{const s=n-e;return s===0?1:(a-e)/s};class mf{constructor(){this.subscriptions=[]}add(n){return hf(this.subscriptions,n),()=>Rl(this.subscriptions,n)}notify(n,a,s){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](n,a,s);else for(let l=0;l<o;l++){const d=this.subscriptions[l];d&&d(n,a,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Bn=e=>e*1e3,qn=e=>e/1e3;function P1(e,n){return n?e*(1e3/n):0}const R1=(e,n,a)=>(((1-3*a+3*n)*e+(3*a-6*n))*e+3*n)*e,sw=1e-7,iw=12;function ow(e,n,a,s,o){let l,d,f=0;do d=n+(a-n)/2,l=R1(d,s,o)-e,l>0?a=d:n=d;while(Math.abs(l)>sw&&++f<iw);return d}function Gi(e,n,a,s){if(e===n&&a===s)return Zn;const o=l=>ow(l,0,1,e,a);return l=>l===0||l===1?l:R1(o(l),n,s)}const M1=e=>n=>n<=.5?e(2*n)/2:(2-e(2*(1-n)))/2,F1=e=>n=>1-e(1-n),I1=Gi(.33,1.53,.69,.99),gf=F1(I1),D1=M1(gf),_1=e=>e>=1?1:(e*=2)<1?.5*gf(e):.5*(2-Math.pow(2,-10*(e-1))),xf=e=>1-Math.sin(Math.acos(e)),L1=F1(xf),A1=M1(xf),lw=Gi(.42,0,1,1),cw=Gi(0,0,.58,1),O1=Gi(.42,0,.58,1),uw=e=>Array.isArray(e)&&typeof e[0]!="number",B1=e=>Array.isArray(e)&&typeof e[0]=="number",dw={linear:Zn,easeIn:lw,easeInOut:O1,easeOut:cw,circIn:xf,circInOut:A1,circOut:L1,backIn:gf,backInOut:D1,backOut:I1,anticipate:_1},fw=e=>typeof e=="string",Z0=e=>{if(B1(e)){pf(e.length===4);const[n,a,s,o]=e;return Gi(n,a,s,o)}else if(fw(e))return dw[e];return e},al=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function hw(e,n){let a=new Set,s=new Set,o=!1,l=!1;const d=new WeakSet;let f={delta:0,timestamp:0,isProcessing:!1};function g(x){d.has(x)&&(m.schedule(x),e()),x(f)}const m={schedule:(x,h=!1,w=!1)=>{const j=w&&o?a:s;return h&&d.add(x),j.add(x),x},cancel:x=>{s.delete(x),d.delete(x)},process:x=>{if(f=x,o){l=!0;return}o=!0;const h=a;a=s,s=h,a.forEach(g),a.clear(),o=!1,l&&(l=!1,m.process(x))}};return m}const pw=40;function z1(e,n){let a=!1,s=!0;const o={delta:0,timestamp:0,isProcessing:!1},l=()=>a=!0,d=al.reduce((_,V)=>(_[V]=hw(l),_),{}),{setup:f,read:g,resolveKeyframes:m,preUpdate:x,update:h,preRender:w,render:k,postRender:j}=d,E=()=>{const _=wa.useManualTiming,V=_?o.timestamp:performance.now();a=!1,_||(o.delta=s?1e3/60:Math.max(Math.min(V-o.timestamp,pw),1)),o.timestamp=V,o.isProcessing=!0,f.process(o),g.process(o),m.process(o),x.process(o),h.process(o),w.process(o),k.process(o),j.process(o),o.isProcessing=!1,a&&n&&(s=!1,e(E))},C=()=>{a=!0,s=!0,o.isProcessing||e(E)};return{schedule:al.reduce((_,V)=>{const H=d[V];return _[V]=(re,O=!1,b=!1)=>(a||C(),H.schedule(re,O,b)),_},{}),cancel:_=>{for(let V=0;V<al.length;V++)d[al[V]].cancel(_)},state:o,steps:d}}const{schedule:xt,cancel:ka,state:nn,steps:Ku}=z1(typeof requestAnimationFrame<"u"?requestAnimationFrame:Zn,!0);let vl;function mw(){vl=void 0}const yn={now:()=>(vl===void 0&&yn.set(nn.isProcessing||wa.useManualTiming?nn.timestamp:performance.now()),vl),set:e=>{vl=e,queueMicrotask(mw)}},V1=e=>n=>typeof n=="string"&&n.startsWith(e),U1=V1("--"),gw=V1("var(--"),yf=e=>gw(e)?xw.test(e.split("/*")[0].trim()):!1,xw=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function em(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Os={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Oi={...Os,transform:e=>Fr(0,1,e)},sl={...Os,default:1},Ri=e=>Math.round(e*1e5)/1e5,vf=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function yw(e){return e==null}const vw=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,bf=(e,n)=>a=>!!(typeof a=="string"&&vw.test(a)&&a.startsWith(e)||n&&!yw(a)&&Object.prototype.hasOwnProperty.call(a,n)),$1=(e,n,a)=>s=>{if(typeof s!="string")return s;const[o,l,d,f]=s.match(vf);return{[e]:parseFloat(o),[n]:parseFloat(l),[a]:parseFloat(d),alpha:f!==void 0?parseFloat(f):1}},bw=e=>Fr(0,255,e),Yu={...Os,transform:e=>Math.round(bw(e))},Ua={test:bf("rgb","red"),parse:$1("red","green","blue"),transform:({red:e,green:n,blue:a,alpha:s=1})=>"rgba("+Yu.transform(e)+", "+Yu.transform(n)+", "+Yu.transform(a)+", "+Ri(Oi.transform(s))+")"};function ww(e){let n="",a="",s="",o="";return e.length>5?(n=e.substring(1,3),a=e.substring(3,5),s=e.substring(5,7),o=e.substring(7,9)):(n=e.substring(1,2),a=e.substring(2,3),s=e.substring(3,4),o=e.substring(4,5),n+=n,a+=a,s+=s,o+=o),{red:parseInt(n,16),green:parseInt(a,16),blue:parseInt(s,16),alpha:o?parseInt(o,16)/255:1}}const Cd={test:bf("#"),parse:ww,transform:Ua.transform},Xi=e=>({test:n=>typeof n=="string"&&n.endsWith(e)&&n.split(" ").length===1,parse:parseFloat,transform:n=>`${n}${e}`}),pa=Xi("deg"),Rr=Xi("%"),Ne=Xi("px"),kw=Xi("vh"),Sw=Xi("vw"),tm={...Rr,parse:e=>Rr.parse(e)/100,transform:e=>Rr.transform(e*100)},js={test:bf("hsl","hue"),parse:$1("hue","saturation","lightness"),transform:({hue:e,saturation:n,lightness:a,alpha:s=1})=>"hsla("+Math.round(e)+", "+Rr.transform(Ri(n))+", "+Rr.transform(Ri(a))+", "+Ri(Oi.transform(s))+")"},Vt={test:e=>Ua.test(e)||Cd.test(e)||js.test(e),parse:e=>Ua.test(e)?Ua.parse(e):js.test(e)?js.parse(e):Cd.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ua.transform(e):js.transform(e),getAnimatableNone:e=>{const n=Vt.parse(e);return n.alpha=0,Vt.transform(n)}},Cw=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function jw(e){var n,a;return isNaN(e)&&typeof e=="string"&&(((n=e.match(vf))==null?void 0:n.length)||0)+(((a=e.match(Cw))==null?void 0:a.length)||0)>0}const H1="number",W1="color",Ew="var",Nw="var(",nm="${}",Tw=/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 Is(e){const n=e.toString(),a=[],s={color:[],number:[],var:[]},o=[];let l=0;const f=n.replace(Tw,g=>(Vt.test(g)?(s.color.push(l),o.push(W1),a.push(Vt.parse(g))):g.startsWith(Nw)?(s.var.push(l),o.push(Ew),a.push(g)):(s.number.push(l),o.push(H1),a.push(parseFloat(g))),++l,nm)).split(nm);return{values:a,split:f,indexes:s,types:o}}function Pw(e){return Is(e).values}function K1({split:e,types:n}){const a=e.length;return s=>{let o="";for(let l=0;l<a;l++)if(o+=e[l],s[l]!==void 0){const d=n[l];d===H1?o+=Ri(s[l]):d===W1?o+=Vt.transform(s[l]):o+=s[l]}return o}}function Rw(e){return K1(Is(e))}const Mw=e=>typeof e=="number"?0:Vt.test(e)?Vt.getAnimatableNone(e):e,Fw=(e,n)=>typeof e=="number"?n!=null&&n.trim().endsWith("/")?e:0:Mw(e);function Iw(e){const n=Is(e);return K1(n)(n.values.map((s,o)=>Fw(s,n.split[o])))}const pr={test:jw,parse:Pw,createTransformer:Rw,getAnimatableNone:Iw};function Gu(e,n,a){return a<0&&(a+=1),a>1&&(a-=1),a<1/6?e+(n-e)*6*a:a<1/2?n:a<2/3?e+(n-e)*(2/3-a)*6:e}function Dw({hue:e,saturation:n,lightness:a,alpha:s}){e/=360,n/=100,a/=100;let o=0,l=0,d=0;if(!n)o=l=d=a;else{const f=a<.5?a*(1+n):a+n-a*n,g=2*a-f;o=Gu(g,f,e+1/3),l=Gu(g,f,e),d=Gu(g,f,e-1/3)}return{red:Math.round(o*255),green:Math.round(l*255),blue:Math.round(d*255),alpha:s}}function Ml(e,n){return a=>a>0?n:e}const Et=(e,n,a)=>e+(n-e)*a,Xu=(e,n,a)=>{const s=e*e,o=a*(n*n-s)+s;return o<0?0:Math.sqrt(o)},_w=[Cd,Ua,js],Lw=e=>_w.find(n=>n.test(e));function rm(e){const n=Lw(e);if(!n)return!1;let a=n.parse(e);return n===js&&(a=Dw(a)),a}const am=(e,n)=>{const a=rm(e),s=rm(n);if(!a||!s)return Ml(e,n);const o={...a};return l=>(o.red=Xu(a.red,s.red,l),o.green=Xu(a.green,s.green,l),o.blue=Xu(a.blue,s.blue,l),o.alpha=Et(a.alpha,s.alpha,l),Ua.transform(o))},jd=new Set(["none","hidden"]);function Aw(e,n){return jd.has(e)?a=>a<=0?e:n:a=>a>=1?n:e}function Ow(e,n){return a=>Et(e,n,a)}function wf(e){return typeof e=="number"?Ow:typeof e=="string"?yf(e)?Ml:Vt.test(e)?am:Vw:Array.isArray(e)?Y1:typeof e=="object"?Vt.test(e)?am:Bw:Ml}function Y1(e,n){const a=[...e],s=a.length,o=e.map((l,d)=>wf(l)(l,n[d]));return l=>{for(let d=0;d<s;d++)a[d]=o[d](l);return a}}function Bw(e,n){const a={...e,...n},s={};for(const o in a)e[o]!==void 0&&n[o]!==void 0&&(s[o]=wf(e[o])(e[o],n[o]));return o=>{for(const l in s)a[l]=s[l](o);return a}}function zw(e,n){const a=[],s={color:0,var:0,number:0};for(let o=0;o<n.values.length;o++){const l=n.types[o],d=e.indexes[l][s[l]],f=e.values[d]??0;a[o]=f,s[l]++}return a}const Vw=(e,n)=>{const a=pr.createTransformer(n),s=Is(e),o=Is(n);return s.indexes.var.length===o.indexes.var.length&&s.indexes.color.length===o.indexes.color.length&&s.indexes.number.length>=o.indexes.number.length?jd.has(e)&&!o.values.length||jd.has(n)&&!s.values.length?Aw(e,n):Yi(Y1(zw(s,o),o.values),a):Ml(e,n)};function G1(e,n,a){return typeof e=="number"&&typeof n=="number"&&typeof a=="number"?Et(e,n,a):wf(e)(e,n)}const Uw=e=>{const n=({timestamp:a})=>e(a);return{start:(a=!0)=>xt.update(n,a),stop:()=>ka(n),now:()=>nn.isProcessing?nn.timestamp:yn.now()}},X1=(e,n,a=10)=>{let s="";const o=Math.max(Math.round(n/a),2);for(let l=0;l<o;l++)s+=Math.round(e(l/(o-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},Fl=2e4;function kf(e){let n=0;const a=50;let s=e.next(n);for(;!s.done&&n<Fl;)n+=a,s=e.next(n);return n>=Fl?1/0:n}function $w(e,n=100,a){const s=a({...e,keyframes:[0,n]}),o=Math.min(kf(s),Fl);return{type:"keyframes",ease:l=>s.next(o*l).value/n,duration:qn(o)}}const It={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};function Ed(e,n){return e*Math.sqrt(1-n*n)}const Hw=12;function Ww(e,n,a){let s=a;for(let o=1;o<Hw;o++)s=s-e(s)/n(s);return s}const qu=.001;function Kw({duration:e=It.duration,bounce:n=It.bounce,velocity:a=It.velocity,mass:s=It.mass}){let o,l,d=1-n;d=Fr(It.minDamping,It.maxDamping,d),e=Fr(It.minDuration,It.maxDuration,qn(e)),d<1?(o=m=>{const x=m*d,h=x*e,w=x-a,k=Ed(m,d),j=Math.exp(-h);return qu-w/k*j},l=m=>{const h=m*d*e,w=h*a+a,k=Math.pow(d,2)*Math.pow(m,2)*e,j=Math.exp(-h),E=Ed(Math.pow(m,2),d);return(-o(m)+qu>0?-1:1)*((w-k)*j)/E}):(o=m=>{const x=Math.exp(-m*e),h=(m-a)*e+1;return-qu+x*h},l=m=>{const x=Math.exp(-m*e),h=(a-m)*(e*e);return x*h});const f=5/e,g=Ww(o,l,f);if(e=Bn(e),isNaN(g))return{stiffness:It.stiffness,damping:It.damping,duration:e};{const m=Math.pow(g,2)*s;return{stiffness:m,damping:d*2*Math.sqrt(s*m),duration:e}}}const Yw=["duration","bounce"],Gw=["stiffness","damping","mass"];function sm(e,n){return n.some(a=>e[a]!==void 0)}function Xw(e){let n={velocity:It.velocity,stiffness:It.stiffness,damping:It.damping,mass:It.mass,isResolvedFromDuration:!1,...e};if(!sm(e,Gw)&&sm(e,Yw))if(n.velocity=0,e.visualDuration){const a=e.visualDuration,s=2*Math.PI/(a*1.2),o=s*s,l=2*Fr(.05,1,1-(e.bounce||0))*Math.sqrt(o);n={...n,mass:It.mass,stiffness:o,damping:l}}else{const a=Kw({...e,velocity:0});n={...n,...a,mass:It.mass},n.isResolvedFromDuration=!0}return n}function Il(e=It.visualDuration,n=It.bounce){const a=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:n}:e;let{restSpeed:s,restDelta:o}=a;const l=a.keyframes[0],d=a.keyframes[a.keyframes.length-1],f={done:!1,value:l},{stiffness:g,damping:m,mass:x,duration:h,velocity:w,isResolvedFromDuration:k}=Xw({...a,velocity:-qn(a.velocity||0)}),j=w||0,E=m/(2*Math.sqrt(g*x)),C=d-l,I=qn(Math.sqrt(g/x)),M=Math.abs(C)<5;s||(s=M?It.restSpeed.granular:It.restSpeed.default),o||(o=M?It.restDelta.granular:It.restDelta.default);let _,V,H,re,O,b;if(E<1)H=Ed(I,E),re=(j+E*I*C)/H,_=N=>{const G=Math.exp(-E*I*N);return d-G*(re*Math.sin(H*N)+C*Math.cos(H*N))},O=E*I*re+C*H,b=E*I*C-re*H,V=N=>Math.exp(-E*I*N)*(O*Math.sin(H*N)+b*Math.cos(H*N));else if(E===1){_=G=>d-Math.exp(-I*G)*(C+(j+I*C)*G);const N=j+I*C;V=G=>Math.exp(-I*G)*(I*N*G-j)}else{const N=I*Math.sqrt(E*E-1);_=K=>{const te=Math.exp(-E*I*K),q=Math.min(N*K,300);return d-te*((j+E*I*C)*Math.sinh(q)+N*C*Math.cosh(q))/N};const G=(j+E*I*C)/N,Y=E*I*G-C*N,X=E*I*C-G*N;V=K=>{const te=Math.exp(-E*I*K),q=Math.min(N*K,300);return te*(Y*Math.sinh(q)+X*Math.cosh(q))}}const R={calculatedDuration:k&&h||null,velocity:N=>Bn(V(N)),next:N=>{if(!k&&E<1){const Y=Math.exp(-E*I*N),X=Math.sin(H*N),K=Math.cos(H*N),te=d-Y*(re*X+C*K),q=Bn(Y*(O*X+b*K));return f.done=Math.abs(q)<=s&&Math.abs(d-te)<=o,f.value=f.done?d:te,f}const G=_(N);if(k)f.done=N>=h;else{const Y=Bn(V(N));f.done=Math.abs(Y)<=s&&Math.abs(d-G)<=o}return f.value=f.done?d:G,f},toString:()=>{const N=Math.min(kf(R),Fl),G=X1(Y=>R.next(N*Y).value,N,30);return N+"ms "+G},toTransition:()=>{}};return R}Il.applyToOptions=e=>{const n=$w(e,100,Il);return e.ease=n.ease,e.duration=Bn(n.duration),e.type="keyframes",e};const qw=5;function q1(e,n,a){const s=Math.max(n-qw,0);return P1(a-e(s),n-s)}function Nd({keyframes:e,velocity:n=0,power:a=.8,timeConstant:s=325,bounceDamping:o=10,bounceStiffness:l=500,modifyTarget:d,min:f,max:g,restDelta:m=.5,restSpeed:x}){const h=e[0],w={done:!1,value:h},k=b=>f!==void 0&&b<f||g!==void 0&&b>g,j=b=>f===void 0?g:g===void 0||Math.abs(f-b)<Math.abs(g-b)?f:g;let E=a*n;const C=h+E,I=d===void 0?C:d(C);I!==C&&(E=I-h);const M=b=>-E*Math.exp(-b/s),_=b=>I+M(b),V=b=>{const R=M(b),N=_(b);w.done=Math.abs(R)<=m,w.value=w.done?I:N};let H,re;const O=b=>{k(w.value)&&(H=b,re=Il({keyframes:[w.value,j(w.value)],velocity:q1(_,b,w.value),damping:o,stiffness:l,restDelta:m,restSpeed:x}))};return O(0),{calculatedDuration:null,next:b=>{let R=!1;return!re&&H===void 0&&(R=!0,V(b),O(b)),H!==void 0&&b>=H?re.next(b-H):(!R&&V(b),w)}}}function Jw(e,n,a){const s=[],o=a||wa.mix||G1,l=e.length-1;for(let d=0;d<l;d++){let f=o(e[d],e[d+1]);if(n){const g=Array.isArray(n)?n[d]||Zn:n;f=Yi(g,f)}s.push(f)}return s}function Qw(e,n,{clamp:a=!0,ease:s,mixer:o}={}){const l=e.length;if(pf(l===n.length),l===1)return()=>n[0];if(l===2&&n[0]===n[1])return()=>n[1];const d=e[0]===e[1];e[0]>e[l-1]&&(e=[...e].reverse(),n=[...n].reverse());const f=Jw(n,s,o),g=f.length,m=x=>{if(d&&x<e[0])return n[0];let h=0;if(g>1)for(;h<e.length-2&&!(x<e[h+1]);h++);const w=Ai(e[h],e[h+1],x);return f[h](w)};return a?x=>m(Fr(e[0],e[l-1],x)):m}function Zw(e,n){const a=e[e.length-1];for(let s=1;s<=n;s++){const o=Ai(0,n,s);e.push(Et(a,1,o))}}function e3(e){const n=[0];return Zw(n,e.length-1),n}function t3(e,n){return e.map(a=>a*n)}function n3(e,n){return e.map(()=>n||O1).splice(0,e.length-1)}function Mi({duration:e=300,keyframes:n,times:a,ease:s="easeInOut"}){const o=uw(s)?s.map(Z0):Z0(s),l={done:!1,value:n[0]},d=t3(a&&a.length===n.length?a:e3(n),e),f=Qw(d,n,{ease:Array.isArray(o)?o:n3(n,o)});return{calculatedDuration:e,next:g=>(l.value=f(g),l.done=g>=e,l)}}const r3=e=>e!==null;function Gl(e,{repeat:n,repeatType:a="loop"},s,o=1){const l=e.filter(r3),f=o<0||n&&a!=="loop"&&n%2===1?0:l.length-1;return!f||s===void 0?l[f]:s}const a3={decay:Nd,inertia:Nd,tween:Mi,keyframes:Mi,spring:Il};function J1(e){typeof e.type=="string"&&(e.type=a3[e.type])}class Sf{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(n=>{this.resolve=n})}notifyFinished(){this.resolve()}then(n,a){return this.finished.then(n,a)}}const s3=e=>e/100;class Dl extends Sf{constructor(n){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var s,o;const{motionValue:a}=this.options;a&&a.updatedAt!==yn.now()&&this.tick(yn.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(o=(s=this.options).onStop)==null||o.call(s))},this.options=n,this.initAnimation(),this.play(),n.autoplay===!1&&this.pause()}initAnimation(){const{options:n}=this;J1(n);const{type:a=Mi,repeat:s=0,repeatDelay:o=0,repeatType:l,velocity:d=0}=n;let{keyframes:f}=n;const g=a||Mi;g!==Mi&&typeof f[0]!="number"&&(this.mixKeyframes=Yi(s3,G1(f[0],f[1])),f=[0,100]);const m=g({...n,keyframes:f});l==="mirror"&&(this.mirroredGenerator=g({...n,keyframes:[...f].reverse(),velocity:-d})),m.calculatedDuration===null&&(m.calculatedDuration=kf(m));const{calculatedDuration:x}=m;this.calculatedDuration=x,this.resolvedDuration=x+o,this.totalDuration=this.resolvedDuration*(s+1)-o,this.generator=m}updateTime(n){const a=Math.round(n-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=a}tick(n,a=!1){const{generator:s,totalDuration:o,mixKeyframes:l,mirroredGenerator:d,resolvedDuration:f,calculatedDuration:g}=this;if(this.startTime===null)return s.next(0);const{delay:m=0,keyframes:x,repeat:h,repeatType:w,repeatDelay:k,type:j,onUpdate:E,finalKeyframe:C}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,n):this.speed<0&&(this.startTime=Math.min(n-o/this.speed,this.startTime)),a?this.currentTime=n:this.updateTime(n);const I=this.currentTime-m*(this.playbackSpeed>=0?1:-1),M=this.playbackSpeed>=0?I<0:I>o;this.currentTime=Math.max(I,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let _=this.currentTime,V=s;if(h){const b=Math.min(this.currentTime,o)/f;let R=Math.floor(b),N=b%1;!N&&b>=1&&(N=1),N===1&&R--,R=Math.min(R,h+1),!!(R%2)&&(w==="reverse"?(N=1-N,k&&(N-=k/f)):w==="mirror"&&(V=d)),_=Fr(0,1,N)*f}let H;M?(this.delayState.value=x[0],H=this.delayState):H=V.next(_),l&&!M&&(H.value=l(H.value));let{done:re}=H;!M&&g!==null&&(re=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const O=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&re);return O&&j!==Nd&&(H.value=Gl(x,this.options,C,this.speed)),E&&E(H.value),O&&this.finish(),H}then(n,a){return this.finished.then(n,a)}get duration(){return qn(this.calculatedDuration)}get iterationDuration(){const{delay:n=0}=this.options||{};return this.duration+qn(n)}get time(){return qn(this.currentTime)}set time(n){n=Bn(n),this.currentTime=n,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=n:this.driver&&(this.startTime=this.driver.now()-n/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=n,this.tick(n))}getGeneratorVelocity(){const n=this.currentTime;if(n<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(n);const a=this.generator.next(n).value;return q1(s=>this.generator.next(s).value,n,a)}get speed(){return this.playbackSpeed}set speed(n){const a=this.playbackSpeed!==n;a&&this.driver&&this.updateTime(yn.now()),this.playbackSpeed=n,a&&this.driver&&(this.time=qn(this.currentTime))}play(){var o,l;if(this.isStopped)return;const{driver:n=Uw,startTime:a}=this.options;this.driver||(this.driver=n(d=>this.tick(d))),(l=(o=this.options).onPlay)==null||l.call(o);const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=a??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(yn.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var n,a;this.notifyFinished(),this.teardown(),this.state="finished",(a=(n=this.options).onComplete)==null||a.call(n)}cancel(){var n,a;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(a=(n=this.options).onCancel)==null||a.call(n)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(n){return this.startTime=0,this.tick(n,!0)}attachTimeline(n){var a;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(a=this.driver)==null||a.stop(),n.observe(this)}}function i3(e){for(let n=1;n<e.length;n++)e[n]??(e[n]=e[n-1])}const $a=e=>e*180/Math.PI,Td=e=>{const n=$a(Math.atan2(e[1],e[0]));return Pd(n)},o3={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Td,rotateZ:Td,skewX:e=>$a(Math.atan(e[1])),skewY:e=>$a(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Pd=e=>(e=e%360,e<0&&(e+=360),e),im=Td,om=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),lm=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),l3={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:om,scaleY:lm,scale:e=>(om(e)+lm(e))/2,rotateX:e=>Pd($a(Math.atan2(e[6],e[5]))),rotateY:e=>Pd($a(Math.atan2(-e[2],e[0]))),rotateZ:im,rotate:im,skewX:e=>$a(Math.atan(e[4])),skewY:e=>$a(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Rd(e){return e.includes("scale")?1:0}function Md(e,n){if(!e||e==="none")return Rd(n);const a=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,o;if(a)s=l3,o=a;else{const f=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=o3,o=f}if(!o)return Rd(n);const l=s[n],d=o[1].split(",").map(u3);return typeof l=="function"?l(d):d[l]}const c3=(e,n)=>{const{transform:a="none"}=getComputedStyle(e);return Md(a,n)};function u3(e){return parseFloat(e.trim())}const Bs=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],zs=new Set(Bs),cm=e=>e===Os||e===Ne,d3=new Set(["x","y","z"]),f3=Bs.filter(e=>!d3.has(e));function h3(e){const n=[];return f3.forEach(a=>{const s=e.getValue(a);s!==void 0&&(n.push([a,s.get()]),s.set(a.startsWith("scale")?1:0))}),n}const va={width:({x:e},{paddingLeft:n="0",paddingRight:a="0",boxSizing:s})=>{const o=e.max-e.min;return s==="border-box"?o:o-parseFloat(n)-parseFloat(a)},height:({y:e},{paddingTop:n="0",paddingBottom:a="0",boxSizing:s})=>{const o=e.max-e.min;return s==="border-box"?o:o-parseFloat(n)-parseFloat(a)},top:(e,{top:n})=>parseFloat(n),left:(e,{left:n})=>parseFloat(n),bottom:({y:e},{top:n})=>parseFloat(n)+(e.max-e.min),right:({x:e},{left:n})=>parseFloat(n)+(e.max-e.min),x:(e,{transform:n})=>Md(n,"x"),y:(e,{transform:n})=>Md(n,"y")};va.translateX=va.x;va.translateY=va.y;const Ha=new Set;let Fd=!1,Id=!1,Dd=!1;function Q1(){if(Id){const e=Array.from(Ha).filter(s=>s.needsMeasurement),n=new Set(e.map(s=>s.element)),a=new Map;n.forEach(s=>{const o=h3(s);o.length&&(a.set(s,o),s.render())}),e.forEach(s=>s.measureInitialState()),n.forEach(s=>{s.render();const o=a.get(s);o&&o.forEach(([l,d])=>{var f;(f=s.getValue(l))==null||f.set(d)})}),e.forEach(s=>s.measureEndState()),e.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}Id=!1,Fd=!1,Ha.forEach(e=>e.complete(Dd)),Ha.clear()}function Z1(){Ha.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Id=!0)})}function p3(){Dd=!0,Z1(),Q1(),Dd=!1}class Cf{constructor(n,a,s,o,l,d=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...n],this.onComplete=a,this.name=s,this.motionValue=o,this.element=l,this.isAsync=d}scheduleResolve(){this.state="scheduled",this.isAsync?(Ha.add(this),Fd||(Fd=!0,xt.read(Z1),xt.resolveKeyframes(Q1))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:n,name:a,element:s,motionValue:o}=this;if(n[0]===null){const l=o==null?void 0:o.get(),d=n[n.length-1];if(l!==void 0)n[0]=l;else if(s&&a){const f=s.readValue(a,d);f!=null&&(n[0]=f)}n[0]===void 0&&(n[0]=d),o&&l===void 0&&o.set(n[0])}i3(n)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(n=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,n),Ha.delete(this)}cancel(){this.state==="scheduled"&&(Ha.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const m3=e=>e.startsWith("--");function ex(e,n,a){m3(n)?e.style.setProperty(n,a):e.style[n]=a}const g3={};function tx(e,n){const a=T1(e);return()=>g3[n]??a()}const x3=tx(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),nx=tx(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ti=([e,n,a,s])=>`cubic-bezier(${e}, ${n}, ${a}, ${s})`,um={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ti([0,.65,.55,1]),circOut:Ti([.55,0,1,.45]),backIn:Ti([.31,.01,.66,-.59]),backOut:Ti([.33,1.53,.69,.99])};function rx(e,n){if(e)return typeof e=="function"?nx()?X1(e,n):"ease-out":B1(e)?Ti(e):Array.isArray(e)?e.map(a=>rx(a,n)||um.easeOut):um[e]}function y3(e,n,a,{delay:s=0,duration:o=300,repeat:l=0,repeatType:d="loop",ease:f="easeOut",times:g}={},m=void 0){const x={[n]:a};g&&(x.offset=g);const h=rx(f,o);Array.isArray(h)&&(x.easing=h);const w={delay:s,duration:o,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:l+1,direction:d==="reverse"?"alternate":"normal"};return m&&(w.pseudoElement=m),e.animate(x,w)}function ax(e){return typeof e=="function"&&"applyToOptions"in e}function v3({type:e,...n}){return ax(e)&&nx()?e.applyToOptions(n):(n.duration??(n.duration=300),n.ease??(n.ease="easeOut"),n)}class sx extends Sf{constructor(n){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!n)return;const{element:a,name:s,keyframes:o,pseudoElement:l,allowFlatten:d=!1,finalKeyframe:f,onComplete:g}=n;this.isPseudoElement=!!l,this.allowFlatten=d,this.options=n,pf(typeof n.type!="string");const m=v3(n);this.animation=y3(a,s,o,m,l),m.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!l){const x=Gl(o,this.options,f,this.speed);this.updateMotionValue&&this.updateMotionValue(x),ex(a,s,x),this.animation.cancel()}g==null||g(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var n,a;(a=(n=this.animation).finish)==null||a.call(n)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:n}=this;n==="idle"||n==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var a,s,o;const n=(a=this.options)==null?void 0:a.element;!this.isPseudoElement&&(n!=null&&n.isConnected)&&((o=(s=this.animation).commitStyles)==null||o.call(s))}get duration(){var a,s;const n=((s=(a=this.animation.effect)==null?void 0:a.getComputedTiming)==null?void 0:s.call(a).duration)||0;return qn(Number(n))}get iterationDuration(){const{delay:n=0}=this.options||{};return this.duration+qn(n)}get time(){return qn(Number(this.animation.currentTime)||0)}set time(n){const a=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Bn(n),a&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(n){n<0&&(this.finishedTime=null),this.animation.playbackRate=n}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(n){this.manualStartTime=this.animation.startTime=n}attachTimeline({timeline:n,rangeStart:a,rangeEnd:s,observe:o}){var l;return this.allowFlatten&&((l=this.animation.effect)==null||l.updateTiming({easing:"linear"})),this.animation.onfinish=null,n&&x3()?(this.animation.timeline=n,a&&(this.animation.rangeStart=a),s&&(this.animation.rangeEnd=s),Zn):o(this)}}const ix={anticipate:_1,backInOut:D1,circInOut:A1};function b3(e){return e in ix}function w3(e){typeof e.ease=="string"&&b3(e.ease)&&(e.ease=ix[e.ease])}const Ju=10;class k3 extends sx{constructor(n){w3(n),J1(n),super(n),n.startTime!==void 0&&n.autoplay!==!1&&(this.startTime=n.startTime),this.options=n}updateMotionValue(n){const{motionValue:a,onUpdate:s,onComplete:o,element:l,...d}=this.options;if(!a)return;if(n!==void 0){a.set(n);return}const f=new Dl({...d,autoplay:!1}),g=Math.max(Ju,yn.now()-this.startTime),m=Fr(0,Ju,g-Ju),x=f.sample(g).value,{name:h}=this.options;l&&h&&ex(l,h,x),a.setWithVelocity(f.sample(Math.max(0,g-m)).value,x,m),f.stop()}}const dm=(e,n)=>n==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(pr.test(e)||e==="0")&&!e.startsWith("url("));function S3(e){const n=e[0];if(e.length===1)return!0;for(let a=0;a<e.length;a++)if(e[a]!==n)return!0}function C3(e,n,a,s){const o=e[0];if(o===null)return!1;if(n==="display"||n==="visibility")return!0;const l=e[e.length-1],d=dm(o,n),f=dm(l,n);return!d||!f?!1:S3(e)||(a==="spring"||ax(a))&&s}function _d(e){e.duration=0,e.type="keyframes"}const ox=new Set(["opacity","clipPath","filter","transform"]),j3=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function E3(e){for(let n=0;n<e.length;n++)if(typeof e[n]=="string"&&j3.test(e[n]))return!0;return!1}const N3=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),T3=T1(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function P3(e){var h;const{motionValue:n,name:a,repeatDelay:s,repeatType:o,damping:l,type:d,keyframes:f}=e;if(!(((h=n==null?void 0:n.owner)==null?void 0:h.current)instanceof HTMLElement))return!1;const{onUpdate:m,transformTemplate:x}=n.owner.getProps();return T3()&&a&&(ox.has(a)||N3.has(a)&&E3(f))&&(a!=="transform"||!x)&&!m&&!s&&o!=="mirror"&&l!==0&&d!=="inertia"}const R3=40;class M3 extends Sf{constructor({autoplay:n=!0,delay:a=0,type:s="keyframes",repeat:o=0,repeatDelay:l=0,repeatType:d="loop",keyframes:f,name:g,motionValue:m,element:x,...h}){var j;super(),this.stop=()=>{var E,C;this._animation&&(this._animation.stop(),(E=this.stopTimeline)==null||E.call(this)),(C=this.keyframeResolver)==null||C.cancel()},this.createdAt=yn.now();const w={autoplay:n,delay:a,type:s,repeat:o,repeatDelay:l,repeatType:d,name:g,motionValue:m,element:x,...h},k=(x==null?void 0:x.KeyframeResolver)||Cf;this.keyframeResolver=new k(f,(E,C,I)=>this.onKeyframesResolved(E,C,w,!I),g,m,x),(j=this.keyframeResolver)==null||j.scheduleResolve()}onKeyframesResolved(n,a,s,o){var I,M;this.keyframeResolver=void 0;const{name:l,type:d,velocity:f,delay:g,isHandoff:m,onUpdate:x}=s;this.resolvedAt=yn.now();let h=!0;C3(n,l,d,f)||(h=!1,(wa.instantAnimations||!g)&&(x==null||x(Gl(n,s,a))),n[0]=n[n.length-1],_d(s),s.repeat=0);const k={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>R3?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:a,...s,keyframes:n},j=h&&!m&&P3(k),E=(M=(I=k.motionValue)==null?void 0:I.owner)==null?void 0:M.current;let C;if(j)try{C=new k3({...k,element:E})}catch{C=new Dl(k)}else C=new Dl(k);C.finished.then(()=>{this.notifyFinished()}).catch(Zn),this.pendingTimeline&&(this.stopTimeline=C.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=C}get finished(){return this._animation?this.animation.finished:this._finished}then(n,a){return this.finished.finally(n).then(()=>{})}get animation(){var n;return this._animation||((n=this.keyframeResolver)==null||n.resume(),p3()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(n){this.animation.time=n}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(n){this.animation.speed=n}get startTime(){return this.animation.startTime}attachTimeline(n){return this._animation?this.stopTimeline=this.animation.attachTimeline(n):this.pendingTimeline=n,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var n;this._animation&&this.animation.cancel(),(n=this.keyframeResolver)==null||n.cancel()}}function lx(e,n,a,s=0,o=1){const l=Array.from(e).sort((m,x)=>m.sortNodePosition(x)).indexOf(n),d=e.size,f=(d-1)*s;return typeof a=="function"?a(l,d):o===1?l*s:f-l*s}const F3=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function I3(e){const n=F3.exec(e);if(!n)return[,];const[,a,s,o]=n;return[`--${a??s}`,o]}function cx(e,n,a=1){const[s,o]=I3(e);if(!s)return;const l=window.getComputedStyle(n).getPropertyValue(s);if(l){const d=l.trim();return j1(d)?parseFloat(d):d}return yf(o)?cx(o,n,a+1):o}const D3={type:"spring",stiffness:500,damping:25,restSpeed:10},_3=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),L3={type:"keyframes",duration:.8},A3={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},O3=(e,{keyframes:n})=>n.length>2?L3:zs.has(e)?e.startsWith("scale")?_3(n[1]):D3:A3;function ux(e,n){if(e!=null&&e.inherit&&n){const{inherit:a,...s}=e;return{...n,...s}}return e}function jf(e,n){const a=(e==null?void 0:e[n])??(e==null?void 0:e.default)??e;return a!==e?ux(a,e):a}const B3=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function z3(e){for(const n in e)if(!B3.has(n))return!0;return!1}const Ef=(e,n,a,s={},o,l)=>d=>{const f=jf(s,e)||{},g=f.delay||s.delay||0;let{elapsed:m=0}=s;m=m-Bn(g);const x={keyframes:Array.isArray(a)?a:[null,a],ease:"easeOut",velocity:n.getVelocity(),...f,delay:-m,onUpdate:w=>{n.set(w),f.onUpdate&&f.onUpdate(w)},onComplete:()=>{d(),f.onComplete&&f.onComplete()},name:e,motionValue:n,element:l?void 0:o};z3(f)||Object.assign(x,O3(e,x)),x.duration&&(x.duration=Bn(x.duration)),x.repeatDelay&&(x.repeatDelay=Bn(x.repeatDelay)),x.from!==void 0&&(x.keyframes[0]=x.from);let h=!1;if((x.type===!1||x.duration===0&&!x.repeatDelay)&&(_d(x),x.delay===0&&(h=!0)),(wa.instantAnimations||wa.skipAnimations||o!=null&&o.shouldSkipAnimations)&&(h=!0,_d(x),x.delay=0),x.allowFlatten=!f.type&&!f.ease,h&&!l&&n.get()!==void 0){const w=Gl(x.keyframes,f);if(w!==void 0){xt.update(()=>{x.onUpdate(w),x.onComplete()});return}}return f.isSync?new Dl(x):new M3(x)};function fm(e){const n=[{},{}];return e==null||e.values.forEach((a,s)=>{n[0][s]=a.get(),n[1][s]=a.getVelocity()}),n}function Nf(e,n,a,s){if(typeof n=="function"){const[o,l]=fm(s);n=n(a!==void 0?a:e.custom,o,l)}if(typeof n=="string"&&(n=e.variants&&e.variants[n]),typeof n=="function"){const[o,l]=fm(s);n=n(a!==void 0?a:e.custom,o,l)}return n}function Wa(e,n,a){const s=e.getProps();return Nf(s,n,a!==void 0?a:s.custom,e)}const dx=new Set(["width","height","top","left","right","bottom",...Bs]),hm=30,V3=e=>!isNaN(parseFloat(e));class U3{constructor(n,a={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{var l;const o=yn.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&((l=this.events.change)==null||l.notify(this.current),this.dependents))for(const d of this.dependents)d.dirty()},this.hasAnimated=!1,this.setCurrent(n),this.owner=a.owner}setCurrent(n){this.current=n,this.updatedAt=yn.now(),this.canTrackVelocity===null&&n!==void 0&&(this.canTrackVelocity=V3(this.current))}setPrevFrameValue(n=this.current){this.prevFrameValue=n,this.prevUpdatedAt=this.updatedAt}onChange(n){return this.on("change",n)}on(n,a){this.events[n]||(this.events[n]=new mf);const s=this.events[n].add(a);return n==="change"?()=>{s(),xt.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const n in this.events)this.events[n].clear()}attach(n,a){this.passiveEffect=n,this.stopPassiveEffect=a}set(n){this.passiveEffect?this.passiveEffect(n,this.updateAndNotify):this.updateAndNotify(n)}setWithVelocity(n,a,s){this.set(a),this.prev=void 0,this.prevFrameValue=n,this.prevUpdatedAt=this.updatedAt-s}jump(n,a=!0){this.updateAndNotify(n),this.prev=n,this.prevUpdatedAt=this.prevFrameValue=void 0,a&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var n;(n=this.events.change)==null||n.notify(this.current)}addDependent(n){this.dependents||(this.dependents=new Set),this.dependents.add(n)}removeDependent(n){this.dependents&&this.dependents.delete(n)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const n=yn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||n-this.updatedAt>hm)return 0;const a=Math.min(this.updatedAt-this.prevUpdatedAt,hm);return P1(parseFloat(this.current)-parseFloat(this.prevFrameValue),a)}start(n){return this.stop(),new Promise(a=>{this.hasAnimated=!0,this.animation=n(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(){var n,a;(n=this.dependents)==null||n.clear(),(a=this.events.destroy)==null||a.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ds(e,n){return new U3(e,n)}const Ld=e=>Array.isArray(e);function $3(e,n,a){e.hasValue(n)?e.getValue(n).set(a):e.addValue(n,Ds(a))}function H3(e){return Ld(e)?e[e.length-1]||0:e}function W3(e,n){const a=Wa(e,n);let{transitionEnd:s={},transition:o={},...l}=a||{};l={...l,...s};for(const d in l){const f=H3(l[d]);$3(e,d,f)}}const rn=e=>!!(e&&e.getVelocity);function K3(e){return!!(rn(e)&&e.add)}function Ad(e,n){const a=e.getValue("willChange");if(K3(a))return a.add(n);if(!a&&wa.WillChange){const s=new wa.WillChange("auto");e.addValue("willChange",s),s.add(n)}}function Tf(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}const Y3="framerAppearId",fx="data-"+Tf(Y3);function hx(e){return e.props[fx]}function G3({protectedKeys:e,needsAnimating:n},a){const s=e.hasOwnProperty(a)&&n[a]!==!0;return n[a]=!1,s}function px(e,n,{delay:a=0,transitionOverride:s,type:o}={}){let{transition:l,transitionEnd:d,...f}=n;const g=e.getDefaultTransition();l=l?ux(l,g):g;const m=l==null?void 0:l.reduceMotion;s&&(l=s);const x=[],h=o&&e.animationState&&e.animationState.getState()[o];for(const w in f){const k=e.getValue(w,e.latestValues[w]??null),j=f[w];if(j===void 0||h&&G3(h,w))continue;const E={delay:a,...jf(l||{},w)},C=k.get();if(C!==void 0&&!k.isAnimating()&&!Array.isArray(j)&&j===C&&!E.velocity){xt.update(()=>k.set(j));continue}let I=!1;if(window.MotionHandoffAnimation){const V=hx(e);if(V){const H=window.MotionHandoffAnimation(V,w,xt);H!==null&&(E.startTime=H,I=!0)}}Ad(e,w);const M=m??e.shouldReduceMotion;k.start(Ef(w,k,j,M&&dx.has(w)?{type:!1}:E,e,I));const _=k.animation;_&&x.push(_)}if(d){const w=()=>xt.update(()=>{d&&W3(e,d)});x.length?Promise.all(x).then(w):w()}return x}function Od(e,n,a={}){var g;const s=Wa(e,n,a.type==="exit"?(g=e.presenceContext)==null?void 0:g.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=s||{};a.transitionOverride&&(o=a.transitionOverride);const l=s?()=>Promise.all(px(e,s,a)):()=>Promise.resolve(),d=e.variantChildren&&e.variantChildren.size?(m=0)=>{const{delayChildren:x=0,staggerChildren:h,staggerDirection:w}=o;return X3(e,n,m,x,h,w,a)}:()=>Promise.resolve(),{when:f}=o;if(f){const[m,x]=f==="beforeChildren"?[l,d]:[d,l];return m().then(()=>x())}else return Promise.all([l(),d(a.delay)])}function X3(e,n,a=0,s=0,o=0,l=1,d){const f=[];for(const g of e.variantChildren)g.notify("AnimationStart",n),f.push(Od(g,n,{...d,delay:a+(typeof s=="function"?0:s)+lx(e.variantChildren,g,s,o,l)}).then(()=>g.notify("AnimationComplete",n)));return Promise.all(f)}function q3(e,n,a={}){e.notify("AnimationStart",n);let s;if(Array.isArray(n)){const o=n.map(l=>Od(e,l,a));s=Promise.all(o)}else if(typeof n=="string")s=Od(e,n,a);else{const o=typeof n=="function"?Wa(e,n,a.custom):n;s=Promise.all(px(e,o,a))}return s.then(()=>{e.notify("AnimationComplete",n)})}const J3={test:e=>e==="auto",parse:e=>e},mx=e=>n=>n.test(e),gx=[Os,Ne,Rr,pa,Sw,kw,J3],pm=e=>gx.find(mx(e));function Q3(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||N1(e):!0}const Z3=new Set(["brightness","contrast","saturate","opacity"]);function e4(e){const[n,a]=e.slice(0,-1).split("(");if(n==="drop-shadow")return e;const[s]=a.match(vf)||[];if(!s)return e;const o=a.replace(s,"");let l=Z3.has(n)?1:0;return s!==a&&(l*=100),n+"("+l+o+")"}const t4=/\b([a-z-]*)\(.*?\)/gu,Bd={...pr,getAnimatableNone:e=>{const n=e.match(t4);return n?n.map(e4).join(" "):e}},zd={...pr,getAnimatableNone:e=>{const n=pr.parse(e);return pr.createTransformer(e)(n.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},mm={...Os,transform:Math.round},n4={rotate:pa,rotateX:pa,rotateY:pa,rotateZ:pa,scale:sl,scaleX:sl,scaleY:sl,scaleZ:sl,skew:pa,skewX:pa,skewY:pa,distance:Ne,translateX:Ne,translateY:Ne,translateZ:Ne,x:Ne,y:Ne,z:Ne,perspective:Ne,transformPerspective:Ne,opacity:Oi,originX:tm,originY:tm,originZ:Ne},Pf={borderWidth:Ne,borderTopWidth:Ne,borderRightWidth:Ne,borderBottomWidth:Ne,borderLeftWidth:Ne,borderRadius:Ne,borderTopLeftRadius:Ne,borderTopRightRadius:Ne,borderBottomRightRadius:Ne,borderBottomLeftRadius:Ne,width:Ne,maxWidth:Ne,height:Ne,maxHeight:Ne,top:Ne,right:Ne,bottom:Ne,left:Ne,inset:Ne,insetBlock:Ne,insetBlockStart:Ne,insetBlockEnd:Ne,insetInline:Ne,insetInlineStart:Ne,insetInlineEnd:Ne,padding:Ne,paddingTop:Ne,paddingRight:Ne,paddingBottom:Ne,paddingLeft:Ne,paddingBlock:Ne,paddingBlockStart:Ne,paddingBlockEnd:Ne,paddingInline:Ne,paddingInlineStart:Ne,paddingInlineEnd:Ne,margin:Ne,marginTop:Ne,marginRight:Ne,marginBottom:Ne,marginLeft:Ne,marginBlock:Ne,marginBlockStart:Ne,marginBlockEnd:Ne,marginInline:Ne,marginInlineStart:Ne,marginInlineEnd:Ne,fontSize:Ne,backgroundPositionX:Ne,backgroundPositionY:Ne,...n4,zIndex:mm,fillOpacity:Oi,strokeOpacity:Oi,numOctaves:mm},r4={...Pf,color:Vt,backgroundColor:Vt,outlineColor:Vt,fill:Vt,stroke:Vt,borderColor:Vt,borderTopColor:Vt,borderRightColor:Vt,borderBottomColor:Vt,borderLeftColor:Vt,filter:Bd,WebkitFilter:Bd,mask:zd,WebkitMask:zd},xx=e=>r4[e],a4=new Set([Bd,zd]);function yx(e,n){let a=xx(e);return a4.has(a)||(a=pr),a.getAnimatableNone?a.getAnimatableNone(n):void 0}const s4=new Set(["auto","none","0"]);function i4(e,n,a){let s=0,o;for(;s<e.length&&!o;){const l=e[s];typeof l=="string"&&!s4.has(l)&&Is(l).values.length&&(o=e[s]),s++}if(o&&a)for(const l of n)e[l]=yx(a,o)}class o4 extends Cf{constructor(n,a,s,o,l){super(n,a,s,o,l,!0)}readKeyframes(){const{unresolvedKeyframes:n,element:a,name:s}=this;if(!a||!a.current)return;super.readKeyframes();for(let x=0;x<n.length;x++){let h=n[x];if(typeof h=="string"&&(h=h.trim(),yf(h))){const w=cx(h,a.current);w!==void 0&&(n[x]=w),x===n.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!dx.has(s)||n.length!==2)return;const[o,l]=n,d=pm(o),f=pm(l),g=em(o),m=em(l);if(g!==m&&va[s]){this.needsMeasurement=!0;return}if(d!==f)if(cm(d)&&cm(f))for(let x=0;x<n.length;x++){const h=n[x];typeof h=="string"&&(n[x]=parseFloat(h))}else va[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:n,name:a}=this,s=[];for(let o=0;o<n.length;o++)(n[o]===null||Q3(n[o]))&&s.push(o);s.length&&i4(n,s,a)}measureInitialState(){const{element:n,unresolvedKeyframes:a,name:s}=this;if(!n||!n.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=va[s](n.measureViewportBox(),window.getComputedStyle(n.current)),a[0]=this.measuredOrigin;const o=a[a.length-1];o!==void 0&&n.getValue(s,o).jump(o,!1)}measureEndState(){var f;const{element:n,name:a,unresolvedKeyframes:s}=this;if(!n||!n.current)return;const o=n.getValue(a);o&&o.jump(this.measuredOrigin,!1);const l=s.length-1,d=s[l];s[l]=va[a](n.measureViewportBox(),window.getComputedStyle(n.current)),d!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=d),(f=this.removedTransforms)!=null&&f.length&&this.removedTransforms.forEach(([g,m])=>{n.getValue(g).set(m)}),this.resolveNoneKeyframes()}}function vx(e,n,a){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let s=document;const o=(a==null?void 0:a[e])??s.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e).filter(s=>s!=null)}const bx=(e,n)=>n&&typeof e=="number"?n.transform(e):e;function bl(e){return E1(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:Rf}=z1(queueMicrotask,!1),fr={x:!1,y:!1};function wx(){return fr.x||fr.y}function l4(e){return e==="x"||e==="y"?fr[e]?null:(fr[e]=!0,()=>{fr[e]=!1}):fr.x||fr.y?null:(fr.x=fr.y=!0,()=>{fr.x=fr.y=!1})}function kx(e,n){const a=vx(e),s=new AbortController,o={passive:!0,...n,signal:s.signal};return[a,o,()=>s.abort()]}function c4(e){return!(e.pointerType==="touch"||wx())}function u4(e,n,a={}){const[s,o,l]=kx(e,a);return s.forEach(d=>{let f=!1,g=!1,m;const x=()=>{d.removeEventListener("pointerleave",j)},h=C=>{m&&(m(C),m=void 0),x()},w=C=>{f=!1,window.removeEventListener("pointerup",w),window.removeEventListener("pointercancel",w),g&&(g=!1,h(C))},k=()=>{f=!0,window.addEventListener("pointerup",w,o),window.addEventListener("pointercancel",w,o)},j=C=>{if(C.pointerType!=="touch"){if(f){g=!0;return}h(C)}},E=C=>{if(!c4(C))return;g=!1;const I=n(d,C);typeof I=="function"&&(m=I,d.addEventListener("pointerleave",j,o))};d.addEventListener("pointerenter",E,o),d.addEventListener("pointerdown",k,o)}),l}const Sx=(e,n)=>n?e===n?!0:Sx(e,n.parentElement):!1,Mf=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,d4=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function f4(e){return d4.has(e.tagName)||e.isContentEditable===!0}const h4=new Set(["INPUT","SELECT","TEXTAREA"]);function p4(e){return h4.has(e.tagName)||e.isContentEditable===!0}const wl=new WeakSet;function gm(e){return n=>{n.key==="Enter"&&e(n)}}function Qu(e,n){e.dispatchEvent(new PointerEvent("pointer"+n,{isPrimary:!0,bubbles:!0}))}const m4=(e,n)=>{const a=e.currentTarget;if(!a)return;const s=gm(()=>{if(wl.has(a))return;Qu(a,"down");const o=gm(()=>{Qu(a,"up")}),l=()=>Qu(a,"cancel");a.addEventListener("keyup",o,n),a.addEventListener("blur",l,n)});a.addEventListener("keydown",s,n),a.addEventListener("blur",()=>a.removeEventListener("keydown",s),n)};function xm(e){return Mf(e)&&!wx()}const ym=new WeakSet;function g4(e,n,a={}){const[s,o,l]=kx(e,a),d=f=>{const g=f.currentTarget;if(!xm(f)||ym.has(f))return;wl.add(g),a.stopPropagation&&ym.add(f);const m=n(g,f),x=(k,j)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",w),wl.has(g)&&wl.delete(g),xm(k)&&typeof m=="function"&&m(k,{success:j})},h=k=>{x(k,g===window||g===document||a.useGlobalTarget||Sx(g,k.target))},w=k=>{x(k,!1)};window.addEventListener("pointerup",h,o),window.addEventListener("pointercancel",w,o)};return s.forEach(f=>{(a.useGlobalTarget?window:f).addEventListener("pointerdown",d,o),bl(f)&&(f.addEventListener("focus",m=>m4(m,o)),!f4(f)&&!f.hasAttribute("tabindex")&&(f.tabIndex=0))}),l}function Ff(e){return E1(e)&&"ownerSVGElement"in e}const kl=new WeakMap;let ma;const Cx=(e,n,a)=>(s,o)=>o&&o[0]?o[0][e+"Size"]:Ff(s)&&"getBBox"in s?s.getBBox()[n]:s[a],x4=Cx("inline","width","offsetWidth"),y4=Cx("block","height","offsetHeight");function v4({target:e,borderBoxSize:n}){var a;(a=kl.get(e))==null||a.forEach(s=>{s(e,{get width(){return x4(e,n)},get height(){return y4(e,n)}})})}function b4(e){e.forEach(v4)}function w4(){typeof ResizeObserver>"u"||(ma=new ResizeObserver(b4))}function k4(e,n){ma||w4();const a=vx(e);return a.forEach(s=>{let o=kl.get(s);o||(o=new Set,kl.set(s,o)),o.add(n),ma==null||ma.observe(s)}),()=>{a.forEach(s=>{const o=kl.get(s);o==null||o.delete(n),o!=null&&o.size||ma==null||ma.unobserve(s)})}}const Sl=new Set;let Es;function S4(){Es=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Sl.forEach(n=>n(e))},window.addEventListener("resize",Es)}function C4(e){return Sl.add(e),Es||S4(),()=>{Sl.delete(e),!Sl.size&&typeof Es=="function"&&(window.removeEventListener("resize",Es),Es=void 0)}}function vm(e,n){return typeof e=="function"?C4(e):k4(e,n)}function j4(e){return Ff(e)&&e.tagName==="svg"}const E4=[...gx,Vt,pr],N4=e=>E4.find(mx(e)),bm=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ns=()=>({x:bm(),y:bm()}),wm=()=>({min:0,max:0}),Gt=()=>({x:wm(),y:wm()}),T4=new WeakMap;function Xl(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Bi(e){return typeof e=="string"||Array.isArray(e)}const If=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Df=["initial",...If];function ql(e){return Xl(e.animate)||Df.some(n=>Bi(e[n]))}function jx(e){return!!(ql(e)||e.variants)}function P4(e,n,a){for(const s in n){const o=n[s],l=a[s];if(rn(o))e.addValue(s,o);else if(rn(l))e.addValue(s,Ds(o,{owner:e}));else if(l!==o)if(e.hasValue(s)){const d=e.getValue(s);d.liveStyle===!0?d.jump(o):d.hasAnimated||d.set(o)}else{const d=e.getStaticValue(s);e.addValue(s,Ds(d!==void 0?d:o,{owner:e}))}}for(const s in a)n[s]===void 0&&e.removeValue(s);return n}const _l={current:null},_f={current:!1},R4=typeof window<"u";function Ex(){if(_f.current=!0,!!R4)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),n=()=>_l.current=e.matches;e.addEventListener("change",n),n()}else _l.current=!1}const km=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Ll={};function Nx(e){Ll=e}function M4(){return Ll}class F4{scrapeMotionValuesFromProps(n,a,s){return{}}constructor({parent:n,props:a,presenceContext:s,reducedMotionConfig:o,skipAnimations:l,blockInitialAnimation:d,visualState:f},g={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Cf,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const k=yn.now();this.renderScheduledAt<k&&(this.renderScheduledAt=k,xt.render(this.render,!1,!0))};const{latestValues:m,renderState:x}=f;this.latestValues=m,this.baseTarget={...m},this.initialValues=a.initial?{...m}:{},this.renderState=x,this.parent=n,this.props=a,this.presenceContext=s,this.depth=n?n.depth+1:0,this.reducedMotionConfig=o,this.skipAnimationsConfig=l,this.options=g,this.blockInitialAnimation=!!d,this.isControllingVariants=ql(a),this.isVariantNode=jx(a),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(n&&n.current);const{willChange:h,...w}=this.scrapeMotionValuesFromProps(a,{},this);for(const k in w){const j=w[k];m[k]!==void 0&&rn(j)&&j.set(m[k])}}mount(n){var a,s;if(this.hasBeenMounted)for(const o in this.initialValues)(a=this.values.get(o))==null||a.jump(this.initialValues[o]),this.latestValues[o]=this.initialValues[o];this.current=n,T4.set(n,this),this.projection&&!this.projection.instance&&this.projection.mount(n),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((o,l)=>this.bindToMotionValue(l,o)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(_f.current||Ex(),this.shouldReduceMotion=_l.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(s=this.parent)==null||s.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var n;this.projection&&this.projection.unmount(),ka(this.notifyUpdate),ka(this.render),this.valueSubscriptions.forEach(a=>a()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(n=this.parent)==null||n.removeChild(this);for(const a in this.events)this.events[a].clear();for(const a in this.features){const s=this.features[a];s&&(s.unmount(),s.isMounted=!1)}this.current=null}addChild(n){this.children.add(n),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(n)}removeChild(n){this.children.delete(n),this.enteringChildren&&this.enteringChildren.delete(n)}bindToMotionValue(n,a){if(this.valueSubscriptions.has(n)&&this.valueSubscriptions.get(n)(),a.accelerate&&ox.has(n)&&this.current instanceof HTMLElement){const{factory:d,keyframes:f,times:g,ease:m,duration:x}=a.accelerate,h=new sx({element:this.current,name:n,keyframes:f,times:g,ease:m,duration:Bn(x)}),w=d(h);this.valueSubscriptions.set(n,()=>{w(),h.cancel()});return}const s=zs.has(n);s&&this.onBindTransform&&this.onBindTransform();const o=a.on("change",d=>{this.latestValues[n]=d,this.props.onUpdate&&xt.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let l;typeof window<"u"&&window.MotionCheckAppearSync&&(l=window.MotionCheckAppearSync(this,n,a)),this.valueSubscriptions.set(n,()=>{o(),l&&l(),a.owner&&a.stop()})}sortNodePosition(n){return!this.current||!this.sortInstanceNodePosition||this.type!==n.type?0:this.sortInstanceNodePosition(this.current,n.current)}updateFeatures(){let n="animation";for(n in Ll){const a=Ll[n];if(!a)continue;const{isEnabled:s,Feature:o}=a;if(!this.features[n]&&o&&s(this.props)&&(this.features[n]=new o(this)),this.features[n]){const l=this.features[n];l.isMounted?l.update():(l.mount(),l.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Gt()}getStaticValue(n){return this.latestValues[n]}setStaticValue(n,a){this.latestValues[n]=a}update(n,a){(n.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=n,this.prevPresenceContext=this.presenceContext,this.presenceContext=a;for(let s=0;s<km.length;s++){const o=km[s];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const l="on"+o,d=n[l];d&&(this.propEventSubscriptions[o]=this.on(o,d))}this.prevMotionValues=P4(this,this.scrapeMotionValuesFromProps(n,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(n){return this.props.variants?this.props.variants[n]: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(n){const a=this.getClosestVariantNode();if(a)return a.variantChildren&&a.variantChildren.add(n),()=>a.variantChildren.delete(n)}addValue(n,a){const s=this.values.get(n);a!==s&&(s&&this.removeValue(n),this.bindToMotionValue(n,a),this.values.set(n,a),this.latestValues[n]=a.get())}removeValue(n){this.values.delete(n);const a=this.valueSubscriptions.get(n);a&&(a(),this.valueSubscriptions.delete(n)),delete this.latestValues[n],this.removeValueFromRenderState(n,this.renderState)}hasValue(n){return this.values.has(n)}getValue(n,a){if(this.props.values&&this.props.values[n])return this.props.values[n];let s=this.values.get(n);return s===void 0&&a!==void 0&&(s=Ds(a===null?void 0:a,{owner:this}),this.addValue(n,s)),s}readValue(n,a){let s=this.latestValues[n]!==void 0||!this.current?this.latestValues[n]:this.getBaseTargetFromProps(this.props,n)??this.readValueFromInstance(this.current,n,this.options);return s!=null&&(typeof s=="string"&&(j1(s)||N1(s))?s=parseFloat(s):!N4(s)&&pr.test(a)&&(s=yx(n,a)),this.setBaseTarget(n,rn(s)?s.get():s)),rn(s)?s.get():s}setBaseTarget(n,a){this.baseTarget[n]=a}getBaseTarget(n){var l;const{initial:a}=this.props;let s;if(typeof a=="string"||typeof a=="object"){const d=Nf(this.props,a,(l=this.presenceContext)==null?void 0:l.custom);d&&(s=d[n])}if(a&&s!==void 0)return s;const o=this.getBaseTargetFromProps(this.props,n);return o!==void 0&&!rn(o)?o:this.initialValues[n]!==void 0&&s===void 0?void 0:this.baseTarget[n]}on(n,a){return this.events[n]||(this.events[n]=new mf),this.events[n].add(a)}notify(n,...a){this.events[n]&&this.events[n].notify(...a)}scheduleRenderMicrotask(){Rf.render(this.render)}}class Tx extends F4{constructor(){super(...arguments),this.KeyframeResolver=o4}sortInstanceNodePosition(n,a){return n.compareDocumentPosition(a)&2?1:-1}getBaseTargetFromProps(n,a){const s=n.style;return s?s[a]:void 0}removeValueFromRenderState(n,{vars:a,style:s}){delete a[n],delete s[n]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:n}=this.props;rn(n)&&(this.childSubscription=n.on("change",a=>{this.current&&(this.current.textContent=`${a}`)}))}}class Ca{constructor(n){this.isMounted=!1,this.node=n}update(){}}function Px({top:e,left:n,right:a,bottom:s}){return{x:{min:n,max:a},y:{min:e,max:s}}}function I4({x:e,y:n}){return{top:n.min,right:e.max,bottom:n.max,left:e.min}}function D4(e,n){if(!n)return e;const a=n({x:e.left,y:e.top}),s=n({x:e.right,y:e.bottom});return{top:a.y,left:a.x,bottom:s.y,right:s.x}}function Zu(e){return e===void 0||e===1}function Vd({scale:e,scaleX:n,scaleY:a}){return!Zu(e)||!Zu(n)||!Zu(a)}function za(e){return Vd(e)||Rx(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Rx(e){return Sm(e.x)||Sm(e.y)}function Sm(e){return e&&e!=="0%"}function Al(e,n,a){const s=e-a,o=n*s;return a+o}function Cm(e,n,a,s,o){return o!==void 0&&(e=Al(e,o,s)),Al(e,a,s)+n}function Ud(e,n=0,a=1,s,o){e.min=Cm(e.min,n,a,s,o),e.max=Cm(e.max,n,a,s,o)}function Mx(e,{x:n,y:a}){Ud(e.x,n.translate,n.scale,n.originPoint),Ud(e.y,a.translate,a.scale,a.originPoint)}const jm=.999999999999,Em=1.0000000000001;function _4(e,n,a,s=!1){var f;const o=a.length;if(!o)return;n.x=n.y=1;let l,d;for(let g=0;g<o;g++){l=a[g],d=l.projectionDelta;const{visualElement:m}=l.options;m&&m.props.style&&m.props.style.display==="contents"||(s&&l.options.layoutScroll&&l.scroll&&l!==l.root&&(Pr(e.x,-l.scroll.offset.x),Pr(e.y,-l.scroll.offset.y)),d&&(n.x*=d.x.scale,n.y*=d.y.scale,Mx(e,d)),s&&za(l.latestValues)&&Cl(e,l.latestValues,(f=l.layout)==null?void 0:f.layoutBox))}n.x<Em&&n.x>jm&&(n.x=1),n.y<Em&&n.y>jm&&(n.y=1)}function Pr(e,n){e.min+=n,e.max+=n}function Nm(e,n,a,s,o=.5){const l=Et(e.min,e.max,o);Ud(e,n,a,l,s)}function Tm(e,n){return typeof e=="string"?parseFloat(e)/100*(n.max-n.min):e}function Cl(e,n,a){const s=a??e;Nm(e.x,Tm(n.x,s.x),n.scaleX,n.scale,n.originX),Nm(e.y,Tm(n.y,s.y),n.scaleY,n.scale,n.originY)}function Fx(e,n){return Px(D4(e.getBoundingClientRect(),n))}function L4(e,n,a){const s=Fx(e,a),{scroll:o}=n;return o&&(Pr(s.x,o.offset.x),Pr(s.y,o.offset.y)),s}const A4={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},O4=Bs.length;function B4(e,n,a){let s="",o=!0;for(let l=0;l<O4;l++){const d=Bs[l],f=e[d];if(f===void 0)continue;let g=!0;if(typeof f=="number")g=f===(d.startsWith("scale")?1:0);else{const m=parseFloat(f);g=d.startsWith("scale")?m===1:m===0}if(!g||a){const m=bx(f,Pf[d]);if(!g){o=!1;const x=A4[d]||d;s+=`${x}(${m}) `}a&&(n[d]=m)}}return s=s.trim(),a?s=a(n,o?"":s):o&&(s="none"),s}function Lf(e,n,a){const{style:s,vars:o,transformOrigin:l}=e;let d=!1,f=!1;for(const g in n){const m=n[g];if(zs.has(g)){d=!0;continue}else if(U1(g)){o[g]=m;continue}else{const x=bx(m,Pf[g]);g.startsWith("origin")?(f=!0,l[g]=x):s[g]=x}}if(n.transform||(d||a?s.transform=B4(n,e.transform,a):s.transform&&(s.transform="none")),f){const{originX:g="50%",originY:m="50%",originZ:x=0}=l;s.transformOrigin=`${g} ${m} ${x}`}}function Ix(e,{style:n,vars:a},s,o){const l=e.style;let d;for(d in n)l[d]=n[d];o==null||o.applyProjectionStyles(l,s);for(d in a)l.setProperty(d,a[d])}function Pm(e,n){return n.max===n.min?0:e/(n.max-n.min)*100}const Ci={correct:(e,n)=>{if(!n.target)return e;if(typeof e=="string")if(Ne.test(e))e=parseFloat(e);else return e;const a=Pm(e,n.target.x),s=Pm(e,n.target.y);return`${a}% ${s}%`}},z4={correct:(e,{treeScale:n,projectionDelta:a})=>{const s=e,o=pr.parse(e);if(o.length>5)return s;const l=pr.createTransformer(e),d=typeof o[0]!="number"?1:0,f=a.x.scale*n.x,g=a.y.scale*n.y;o[0+d]/=f,o[1+d]/=g;const m=Et(f,g,.5);return typeof o[2+d]=="number"&&(o[2+d]/=m),typeof o[3+d]=="number"&&(o[3+d]/=m),l(o)}},$d={borderRadius:{...Ci,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ci,borderTopRightRadius:Ci,borderBottomLeftRadius:Ci,borderBottomRightRadius:Ci,boxShadow:z4};function Dx(e,{layout:n,layoutId:a}){return zs.has(e)||e.startsWith("origin")||(n||a!==void 0)&&(!!$d[e]||e==="opacity")}function Af(e,n,a){var d;const s=e.style,o=n==null?void 0:n.style,l={};if(!s)return l;for(const f in s)(rn(s[f])||o&&rn(o[f])||Dx(f,e)||((d=a==null?void 0:a.getValue(f))==null?void 0:d.liveStyle)!==void 0)&&(l[f]=s[f]);return l}function V4(e){return window.getComputedStyle(e)}class U4 extends Tx{constructor(){super(...arguments),this.type="html",this.renderInstance=Ix}readValueFromInstance(n,a){var s;if(zs.has(a))return(s=this.projection)!=null&&s.isProjecting?Rd(a):c3(n,a);{const o=V4(n),l=(U1(a)?o.getPropertyValue(a):o[a])||0;return typeof l=="string"?l.trim():l}}measureInstanceViewportBox(n,{transformPagePoint:a}){return Fx(n,a)}build(n,a,s){Lf(n,a,s.transformTemplate)}scrapeMotionValuesFromProps(n,a,s){return Af(n,a,s)}}const $4={offset:"stroke-dashoffset",array:"stroke-dasharray"},H4={offset:"strokeDashoffset",array:"strokeDasharray"};function W4(e,n,a=1,s=0,o=!0){e.pathLength=1;const l=o?$4:H4;e[l.offset]=`${-s}`,e[l.array]=`${n} ${a}`}const K4=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function _x(e,{attrX:n,attrY:a,attrScale:s,pathLength:o,pathSpacing:l=1,pathOffset:d=0,...f},g,m,x){if(Lf(e,f,m),g){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:w}=e;h.transform&&(w.transform=h.transform,delete h.transform),(w.transform||h.transformOrigin)&&(w.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),w.transform&&(w.transformBox=(x==null?void 0:x.transformBox)??"fill-box",delete h.transformBox);for(const k of K4)h[k]!==void 0&&(w[k]=h[k],delete h[k]);n!==void 0&&(h.x=n),a!==void 0&&(h.y=a),s!==void 0&&(h.scale=s),o!==void 0&&W4(h,o,l,d,!1)}const Lx=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"]),Ax=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Y4(e,n,a,s){Ix(e,n,void 0,s);for(const o in n.attrs)e.setAttribute(Lx.has(o)?o:Tf(o),n.attrs[o])}function Ox(e,n,a){const s=Af(e,n,a);for(const o in e)if(rn(e[o])||rn(n[o])){const l=Bs.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;s[l]=e[o]}return s}class G4 extends Tx{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Gt}getBaseTargetFromProps(n,a){return n[a]}readValueFromInstance(n,a){if(zs.has(a)){const s=xx(a);return s&&s.default||0}return a=Lx.has(a)?a:Tf(a),n.getAttribute(a)}scrapeMotionValuesFromProps(n,a,s){return Ox(n,a,s)}build(n,a,s){_x(n,a,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(n,a,s,o){Y4(n,a,s,o)}mount(n){this.isSVGTag=Ax(n.tagName),super.mount(n)}}const X4=Df.length;function Bx(e){if(!e)return;if(!e.isControllingVariants){const a=e.parent?Bx(e.parent)||{}:{};return e.props.initial!==void 0&&(a.initial=e.props.initial),a}const n={};for(let a=0;a<X4;a++){const s=Df[a],o=e.props[s];(Bi(o)||o===!1)&&(n[s]=o)}return n}function zx(e,n){if(!Array.isArray(n))return!1;const a=n.length;if(a!==e.length)return!1;for(let s=0;s<a;s++)if(n[s]!==e[s])return!1;return!0}const q4=[...If].reverse(),J4=If.length;function Q4(e){return n=>Promise.all(n.map(({animation:a,options:s})=>q3(e,a,s)))}function Z4(e){let n=Q4(e),a=Rm(),s=!0,o=!1;const l=m=>(x,h)=>{var k;const w=Wa(e,h,m==="exit"?(k=e.presenceContext)==null?void 0:k.custom:void 0);if(w){const{transition:j,transitionEnd:E,...C}=w;x={...x,...C,...E}}return x};function d(m){n=m(e)}function f(m){const{props:x}=e,h=Bx(e.parent)||{},w=[],k=new Set;let j={},E=1/0;for(let I=0;I<J4;I++){const M=q4[I],_=a[M],V=x[M]!==void 0?x[M]:h[M],H=Bi(V),re=M===m?_.isActive:null;re===!1&&(E=I);let O=V===h[M]&&V!==x[M]&&H;if(O&&(s||o)&&e.manuallyAnimateOnMount&&(O=!1),_.protectedKeys={...j},!_.isActive&&re===null||!V&&!_.prevProp||Xl(V)||typeof V=="boolean")continue;if(M==="exit"&&_.isActive&&re!==!0){_.prevResolvedValues&&(j={...j,..._.prevResolvedValues});continue}const b=ek(_.prevProp,V);let R=b||M===m&&_.isActive&&!O&&H||I>E&&H,N=!1;const G=Array.isArray(V)?V:[V];let Y=G.reduce(l(M),{});re===!1&&(Y={});const{prevResolvedValues:X={}}=_,K={...X,...Y},te=F=>{R=!0,k.has(F)&&(N=!0,k.delete(F)),_.needsAnimating[F]=!0;const U=e.getValue(F);U&&(U.liveStyle=!1)};for(const F in K){const U=Y[F],W=X[F];if(j.hasOwnProperty(F))continue;let T=!1;Ld(U)&&Ld(W)?T=!zx(U,W):T=U!==W,T?U!=null?te(F):k.add(F):U!==void 0&&k.has(F)?te(F):_.protectedKeys[F]=!0}_.prevProp=V,_.prevResolvedValues=Y,_.isActive&&(j={...j,...Y}),(s||o)&&e.blockInitialAnimation&&(R=!1);const q=O&&b;R&&(!q||N)&&w.push(...G.map(F=>{const U={type:M};if(typeof F=="string"&&(s||o)&&!q&&e.manuallyAnimateOnMount&&e.parent){const{parent:W}=e,T=Wa(W,F);if(W.enteringChildren&&T){const{delayChildren:A}=T.transition||{};U.delay=lx(W.enteringChildren,e,A)}}return{animation:F,options:U}}))}if(k.size){const I={};if(typeof x.initial!="boolean"){const M=Wa(e,Array.isArray(x.initial)?x.initial[0]:x.initial);M&&M.transition&&(I.transition=M.transition)}k.forEach(M=>{const _=e.getBaseTarget(M),V=e.getValue(M);V&&(V.liveStyle=!0),I[M]=_??null}),w.push({animation:I})}let C=!!w.length;return s&&(x.initial===!1||x.initial===x.animate)&&!e.manuallyAnimateOnMount&&(C=!1),s=!1,o=!1,C?n(w):Promise.resolve()}function g(m,x){var w;if(a[m].isActive===x)return Promise.resolve();(w=e.variantChildren)==null||w.forEach(k=>{var j;return(j=k.animationState)==null?void 0:j.setActive(m,x)}),a[m].isActive=x;const h=f(m);for(const k in a)a[k].protectedKeys={};return h}return{animateChanges:f,setActive:g,setAnimateFunction:d,getState:()=>a,reset:()=>{a=Rm(),o=!0}}}function ek(e,n){return typeof n=="string"?n!==e:Array.isArray(n)?!zx(n,e):!1}function Aa(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Rm(){return{animate:Aa(!0),whileInView:Aa(),whileHover:Aa(),whileTap:Aa(),whileDrag:Aa(),whileFocus:Aa(),exit:Aa()}}function Hd(e,n){e.min=n.min,e.max=n.max}function ur(e,n){Hd(e.x,n.x),Hd(e.y,n.y)}function Mm(e,n){e.translate=n.translate,e.scale=n.scale,e.originPoint=n.originPoint,e.origin=n.origin}const Vx=1e-4,tk=1-Vx,nk=1+Vx,Ux=.01,rk=0-Ux,ak=0+Ux;function vn(e){return e.max-e.min}function sk(e,n,a){return Math.abs(e-n)<=a}function Fm(e,n,a,s=.5){e.origin=s,e.originPoint=Et(n.min,n.max,e.origin),e.scale=vn(a)/vn(n),e.translate=Et(a.min,a.max,e.origin)-e.originPoint,(e.scale>=tk&&e.scale<=nk||isNaN(e.scale))&&(e.scale=1),(e.translate>=rk&&e.translate<=ak||isNaN(e.translate))&&(e.translate=0)}function Fi(e,n,a,s){Fm(e.x,n.x,a.x,s?s.originX:void 0),Fm(e.y,n.y,a.y,s?s.originY:void 0)}function Im(e,n,a,s=0){const o=s?Et(a.min,a.max,s):a.min;e.min=o+n.min,e.max=e.min+vn(n)}function ik(e,n,a,s){Im(e.x,n.x,a.x,s==null?void 0:s.x),Im(e.y,n.y,a.y,s==null?void 0:s.y)}function Dm(e,n,a,s=0){const o=s?Et(a.min,a.max,s):a.min;e.min=n.min-o,e.max=e.min+vn(n)}function Ol(e,n,a,s){Dm(e.x,n.x,a.x,s==null?void 0:s.x),Dm(e.y,n.y,a.y,s==null?void 0:s.y)}function _m(e,n,a,s,o){return e-=n,e=Al(e,1/a,s),o!==void 0&&(e=Al(e,1/o,s)),e}function ok(e,n=0,a=1,s=.5,o,l=e,d=e){if(Rr.test(n)&&(n=parseFloat(n),n=Et(d.min,d.max,n/100)-d.min),typeof n!="number")return;let f=Et(l.min,l.max,s);e===l&&(f-=n),e.min=_m(e.min,n,a,f,o),e.max=_m(e.max,n,a,f,o)}function Lm(e,n,[a,s,o],l,d){ok(e,n[a],n[s],n[o],n.scale,l,d)}const lk=["x","scaleX","originX"],ck=["y","scaleY","originY"];function Am(e,n,a,s){Lm(e.x,n,lk,a?a.x:void 0,s?s.x:void 0),Lm(e.y,n,ck,a?a.y:void 0,s?s.y:void 0)}function Om(e){return e.translate===0&&e.scale===1}function $x(e){return Om(e.x)&&Om(e.y)}function Bm(e,n){return e.min===n.min&&e.max===n.max}function uk(e,n){return Bm(e.x,n.x)&&Bm(e.y,n.y)}function zm(e,n){return Math.round(e.min)===Math.round(n.min)&&Math.round(e.max)===Math.round(n.max)}function Hx(e,n){return zm(e.x,n.x)&&zm(e.y,n.y)}function Vm(e){return vn(e.x)/vn(e.y)}function Um(e,n){return e.translate===n.translate&&e.scale===n.scale&&e.originPoint===n.originPoint}function Tr(e){return[e("x"),e("y")]}function dk(e,n,a){let s="";const o=e.x.translate/n.x,l=e.y.translate/n.y,d=(a==null?void 0:a.z)||0;if((o||l||d)&&(s=`translate3d(${o}px, ${l}px, ${d}px) `),(n.x!==1||n.y!==1)&&(s+=`scale(${1/n.x}, ${1/n.y}) `),a){const{transformPerspective:m,rotate:x,rotateX:h,rotateY:w,skewX:k,skewY:j}=a;m&&(s=`perspective(${m}px) ${s}`),x&&(s+=`rotate(${x}deg) `),h&&(s+=`rotateX(${h}deg) `),w&&(s+=`rotateY(${w}deg) `),k&&(s+=`skewX(${k}deg) `),j&&(s+=`skewY(${j}deg) `)}const f=e.x.scale*n.x,g=e.y.scale*n.y;return(f!==1||g!==1)&&(s+=`scale(${f}, ${g})`),s||"none"}const Wx=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],fk=Wx.length,$m=e=>typeof e=="string"?parseFloat(e):e,Hm=e=>typeof e=="number"||Ne.test(e);function hk(e,n,a,s,o,l){o?(e.opacity=Et(0,a.opacity??1,pk(s)),e.opacityExit=Et(n.opacity??1,0,mk(s))):l&&(e.opacity=Et(n.opacity??1,a.opacity??1,s));for(let d=0;d<fk;d++){const f=Wx[d];let g=Wm(n,f),m=Wm(a,f);if(g===void 0&&m===void 0)continue;g||(g=0),m||(m=0),g===0||m===0||Hm(g)===Hm(m)?(e[f]=Math.max(Et($m(g),$m(m),s),0),(Rr.test(m)||Rr.test(g))&&(e[f]+="%")):e[f]=m}(n.rotate||a.rotate)&&(e.rotate=Et(n.rotate||0,a.rotate||0,s))}function Wm(e,n){return e[n]!==void 0?e[n]:e.borderRadius}const pk=Kx(0,.5,L1),mk=Kx(.5,.95,Zn);function Kx(e,n,a){return s=>s<e?0:s>n?1:a(Ai(e,n,s))}function gk(e,n,a){const s=rn(e)?e:Ds(e);return s.start(Ef("",s,n,a)),s.animation}function zi(e,n,a,s={passive:!0}){return e.addEventListener(n,a,s),()=>e.removeEventListener(n,a)}const xk=(e,n)=>e.depth-n.depth;class yk{constructor(){this.children=[],this.isDirty=!1}add(n){hf(this.children,n),this.isDirty=!0}remove(n){Rl(this.children,n),this.isDirty=!0}forEach(n){this.isDirty&&this.children.sort(xk),this.isDirty=!1,this.children.forEach(n)}}function vk(e,n){const a=yn.now(),s=({timestamp:o})=>{const l=o-a;l>=n&&(ka(s),e(l-n))};return xt.setup(s,!0),()=>ka(s)}function jl(e){return rn(e)?e.get():e}class bk{constructor(){this.members=[]}add(n){hf(this.members,n);for(let a=this.members.length-1;a>=0;a--){const s=this.members[a];if(s===n||s===this.lead||s===this.prevLead)continue;const o=s.instance;(!o||o.isConnected===!1)&&!s.snapshot&&(Rl(this.members,s),s.unmount())}n.scheduleRender()}remove(n){if(Rl(this.members,n),n===this.prevLead&&(this.prevLead=void 0),n===this.lead){const a=this.members[this.members.length-1];a&&this.promote(a)}}relegate(n){var a;for(let s=this.members.indexOf(n)-1;s>=0;s--){const o=this.members[s];if(o.isPresent!==!1&&((a=o.instance)==null?void 0:a.isConnected)!==!1)return this.promote(o),!0}return!1}promote(n,a){var o;const s=this.lead;if(n!==s&&(this.prevLead=s,this.lead=n,n.show(),s)){s.updateSnapshot(),n.scheduleRender();const{layoutDependency:l}=s.options,{layoutDependency:d}=n.options;(l===void 0||l!==d)&&(n.resumeFrom=s,a&&(s.preserveOpacity=!0),s.snapshot&&(n.snapshot=s.snapshot,n.snapshot.latestValues=s.animationValues||s.latestValues),(o=n.root)!=null&&o.isUpdating&&(n.isLayoutDirty=!0)),n.options.crossfade===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(n=>{var a,s,o,l,d;(s=(a=n.options).onExitComplete)==null||s.call(a),(d=(o=n.resumingFrom)==null?void 0:(l=o.options).onExitComplete)==null||d.call(l)})}scheduleRender(){this.members.forEach(n=>n.instance&&n.scheduleRender(!1))}removeLeadSnapshot(){var n;(n=this.lead)!=null&&n.snapshot&&(this.lead.snapshot=void 0)}}const El={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ed=["","X","Y","Z"],wk=1e3;let kk=0;function td(e,n,a,s){const{latestValues:o}=n;o[e]&&(a[e]=o[e],n.setStaticValue(e,0),s&&(s[e]=0))}function Yx(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:n}=e.options;if(!n)return;const a=hx(n);if(window.MotionHasOptimisedAnimation(a,"transform")){const{layout:o,layoutId:l}=e.options;window.MotionCancelOptimisedAnimation(a,"transform",xt,!(o||l))}const{parent:s}=e;s&&!s.hasCheckedOptimisedAppear&&Yx(s)}function Gx({attachResizeListener:e,defaultParent:n,measureScroll:a,checkIsScrollRoot:s,resetTransform:o}){return class{constructor(d={},f=n==null?void 0:n()){this.id=kk++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(jk),this.nodes.forEach(Mk),this.nodes.forEach(Fk),this.nodes.forEach(Ek)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=d,this.root=f?f.root||f:this,this.path=f?[...f.path,f]:[],this.parent=f,this.depth=f?f.depth+1:0;for(let g=0;g<this.path.length;g++)this.path[g].shouldResetTransform=!0;this.root===this&&(this.nodes=new yk)}addEventListener(d,f){return this.eventHandlers.has(d)||this.eventHandlers.set(d,new mf),this.eventHandlers.get(d).add(f)}notifyListeners(d,...f){const g=this.eventHandlers.get(d);g&&g.notify(...f)}hasListeners(d){return this.eventHandlers.has(d)}mount(d){if(this.instance)return;this.isSVG=Ff(d)&&!j4(d),this.instance=d;const{layoutId:f,layout:g,visualElement:m}=this.options;if(m&&!m.current&&m.mount(d),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(g||f)&&(this.isLayoutDirty=!0),e){let x,h=0;const w=()=>this.root.updateBlockedByResize=!1;xt.read(()=>{h=window.innerWidth}),e(d,()=>{const k=window.innerWidth;k!==h&&(h=k,this.root.updateBlockedByResize=!0,x&&x(),x=vk(w,250),El.hasAnimatedSinceResize&&(El.hasAnimatedSinceResize=!1,this.nodes.forEach(Gm)))})}f&&this.root.registerSharedNode(f,this),this.options.animate!==!1&&m&&(f||g)&&this.addEventListener("didUpdate",({delta:x,hasLayoutChanged:h,hasRelativeLayoutChanged:w,layout:k})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const j=this.options.transition||m.getDefaultTransition()||Ak,{onLayoutAnimationStart:E,onLayoutAnimationComplete:C}=m.getProps(),I=!this.targetLayout||!Hx(this.targetLayout,k),M=!h&&w;if(this.options.layoutRoot||this.resumeFrom||M||h&&(I||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const _={...jf(j,"layout"),onPlay:E,onComplete:C};(m.shouldReduceMotion||this.options.layoutRoot)&&(_.delay=0,_.type=!1),this.startAnimation(_),this.setAnimationOrigin(x,M)}else h||Gm(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=k})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const d=this.getStack();d&&d.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ka(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(Ik),this.animationId++)}getTransformTemplate(){const{visualElement:d}=this.options;return d&&d.getProps().transformTemplate}willUpdate(d=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Yx(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let x=0;x<this.path.length;x++){const h=this.path[x];h.shouldResetTransform=!0,(typeof h.latestValues.x=="string"||typeof h.latestValues.y=="string")&&(h.isLayoutDirty=!0),h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:f,layout:g}=this.options;if(f===void 0&&!g)return;const m=this.getTransformTemplate();this.prevTransformTemplateValue=m?m(this.latestValues,""):void 0,this.updateSnapshot(),d&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const g=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),g&&this.nodes.forEach(Tk),this.nodes.forEach(Km);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Ym);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Pk),this.nodes.forEach(Rk),this.nodes.forEach(Sk),this.nodes.forEach(Ck)):this.nodes.forEach(Ym),this.clearAllSnapshots();const f=yn.now();nn.delta=Fr(0,1e3/60,f-nn.timestamp),nn.timestamp=f,nn.isProcessing=!0,Ku.update.process(nn),Ku.preRender.process(nn),Ku.render.process(nn),nn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Rf.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Nk),this.sharedNodes.forEach(Dk)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,xt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){xt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!vn(this.snapshot.measuredBox.x)&&!vn(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let g=0;g<this.path.length;g++)this.path[g].updateScroll();const d=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=Gt()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:f}=this.options;f&&f.notify("LayoutMeasure",this.layout.layoutBox,d?d.layoutBox:void 0)}updateScroll(d="measure"){let f=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===d&&(f=!1),f&&this.instance){const g=s(this.instance);this.scroll={animationId:this.root.animationId,phase:d,isRoot:g,offset:a(this.instance),wasRoot:this.scroll?this.scroll.isRoot:g}}}resetTransform(){if(!o)return;const d=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,f=this.projectionDelta&&!$x(this.projectionDelta),g=this.getTransformTemplate(),m=g?g(this.latestValues,""):void 0,x=m!==this.prevTransformTemplateValue;d&&this.instance&&(f||za(this.latestValues)||x)&&(o(this.instance,m),this.shouldResetTransform=!1,this.scheduleRender())}measure(d=!0){const f=this.measurePageBox();let g=this.removeElementScroll(f);return d&&(g=this.removeTransform(g)),Ok(g),{animationId:this.root.animationId,measuredBox:f,layoutBox:g,latestValues:{},source:this.id}}measurePageBox(){var m;const{visualElement:d}=this.options;if(!d)return Gt();const f=d.measureViewportBox();if(!(((m=this.scroll)==null?void 0:m.wasRoot)||this.path.some(Bk))){const{scroll:x}=this.root;x&&(Pr(f.x,x.offset.x),Pr(f.y,x.offset.y))}return f}removeElementScroll(d){var g;const f=Gt();if(ur(f,d),(g=this.scroll)!=null&&g.wasRoot)return f;for(let m=0;m<this.path.length;m++){const x=this.path[m],{scroll:h,options:w}=x;x!==this.root&&h&&w.layoutScroll&&(h.wasRoot&&ur(f,d),Pr(f.x,h.offset.x),Pr(f.y,h.offset.y))}return f}applyTransform(d,f=!1,g){var x,h;const m=g||Gt();ur(m,d);for(let w=0;w<this.path.length;w++){const k=this.path[w];!f&&k.options.layoutScroll&&k.scroll&&k!==k.root&&(Pr(m.x,-k.scroll.offset.x),Pr(m.y,-k.scroll.offset.y)),za(k.latestValues)&&Cl(m,k.latestValues,(x=k.layout)==null?void 0:x.layoutBox)}return za(this.latestValues)&&Cl(m,this.latestValues,(h=this.layout)==null?void 0:h.layoutBox),m}removeTransform(d){var g;const f=Gt();ur(f,d);for(let m=0;m<this.path.length;m++){const x=this.path[m];if(!za(x.latestValues))continue;let h;x.instance&&(Vd(x.latestValues)&&x.updateSnapshot(),h=Gt(),ur(h,x.measurePageBox())),Am(f,x.latestValues,(g=x.snapshot)==null?void 0:g.layoutBox,h)}return za(this.latestValues)&&Am(f,this.latestValues),f}setTargetDelta(d){this.targetDelta=d,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(d){this.options={...this.options,...d,crossfade:d.crossfade!==void 0?d.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!==nn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(d=!1){var k;const f=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=f.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=f.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=f.isSharedProjectionDirty);const g=!!this.resumingFrom||this!==f;if(!(d||g&&this.isSharedProjectionDirty||this.isProjectionDirty||(k=this.parent)!=null&&k.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:x,layoutId:h}=this.options;if(!this.layout||!(x||h))return;this.resolvedRelativeTargetAt=nn.timestamp;const w=this.getClosestProjectingParent();w&&this.linkedParentVersion!==w.layoutVersion&&!w.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&w&&w.layout?this.createRelativeTarget(w,this.layout.layoutBox,w.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Gt(),this.targetWithTransforms=Gt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),ik(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):ur(this.target,this.layout.layoutBox),Mx(this.target,this.targetDelta)):ur(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&w&&!!w.resumingFrom==!!this.resumingFrom&&!w.options.layoutScroll&&w.target&&this.animationProgress!==1?this.createRelativeTarget(w,this.target,w.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Vd(this.parent.latestValues)||Rx(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(d,f,g){this.relativeParent=d,this.linkedParentVersion=d.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Gt(),this.relativeTargetOrigin=Gt(),Ol(this.relativeTargetOrigin,f,g,this.options.layoutAnchor||void 0),ur(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var j;const d=this.getLead(),f=!!this.resumingFrom||this!==d;let g=!0;if((this.isProjectionDirty||(j=this.parent)!=null&&j.isProjectionDirty)&&(g=!1),f&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(g=!1),this.resolvedRelativeTargetAt===nn.timestamp&&(g=!1),g)return;const{layout:m,layoutId:x}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(m||x))return;ur(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,w=this.treeScale.y;_4(this.layoutCorrected,this.treeScale,this.path,f),d.layout&&!d.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(d.target=d.layout.layoutBox,d.targetWithTransforms=Gt());const{target:k}=d;if(!k){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Mm(this.prevProjectionDelta.x,this.projectionDelta.x),Mm(this.prevProjectionDelta.y,this.projectionDelta.y)),Fi(this.projectionDelta,this.layoutCorrected,k,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==w||!Um(this.projectionDelta.x,this.prevProjectionDelta.x)||!Um(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",k))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(d=!0){var f;if((f=this.options.visualElement)==null||f.scheduleRender(),d){const g=this.getStack();g&&g.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ns(),this.projectionDelta=Ns(),this.projectionDeltaWithTransform=Ns()}setAnimationOrigin(d,f=!1){const g=this.snapshot,m=g?g.latestValues:{},x={...this.latestValues},h=Ns();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!f;const w=Gt(),k=g?g.source:void 0,j=this.layout?this.layout.source:void 0,E=k!==j,C=this.getStack(),I=!C||C.members.length<=1,M=!!(E&&!I&&this.options.crossfade===!0&&!this.path.some(Lk));this.animationProgress=0;let _;this.mixTargetDelta=V=>{const H=V/1e3;Xm(h.x,d.x,H),Xm(h.y,d.y,H),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ol(w,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),_k(this.relativeTarget,this.relativeTargetOrigin,w,H),_&&uk(this.relativeTarget,_)&&(this.isProjectionDirty=!1),_||(_=Gt()),ur(_,this.relativeTarget)),E&&(this.animationValues=x,hk(x,m,this.latestValues,H,M,I)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=H},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(d){var f,g,m;this.notifyListeners("animationStart"),(f=this.currentAnimation)==null||f.stop(),(m=(g=this.resumingFrom)==null?void 0:g.currentAnimation)==null||m.stop(),this.pendingAnimation&&(ka(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=xt.update(()=>{El.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ds(0)),this.motionValue.jump(0,!1),this.currentAnimation=gk(this.motionValue,[0,1e3],{...d,velocity:0,isSync:!0,onUpdate:x=>{this.mixTargetDelta(x),d.onUpdate&&d.onUpdate(x)},onStop:()=>{},onComplete:()=>{d.onComplete&&d.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const d=this.getStack();d&&d.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(wk),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const d=this.getLead();let{targetWithTransforms:f,target:g,layout:m,latestValues:x}=d;if(!(!f||!g||!m)){if(this!==d&&this.layout&&m&&Xx(this.options.animationType,this.layout.layoutBox,m.layoutBox)){g=this.target||Gt();const h=vn(this.layout.layoutBox.x);g.x.min=d.target.x.min,g.x.max=g.x.min+h;const w=vn(this.layout.layoutBox.y);g.y.min=d.target.y.min,g.y.max=g.y.min+w}ur(f,g),Cl(f,x),Fi(this.projectionDeltaWithTransform,this.layoutCorrected,f,x)}}registerSharedNode(d,f){this.sharedNodes.has(d)||this.sharedNodes.set(d,new bk),this.sharedNodes.get(d).add(f);const m=f.options.initialPromotionConfig;f.promote({transition:m?m.transition:void 0,preserveFollowOpacity:m&&m.shouldPreserveFollowOpacity?m.shouldPreserveFollowOpacity(f):void 0})}isLead(){const d=this.getStack();return d?d.lead===this:!0}getLead(){var f;const{layoutId:d}=this.options;return d?((f=this.getStack())==null?void 0:f.lead)||this:this}getPrevLead(){var f;const{layoutId:d}=this.options;return d?(f=this.getStack())==null?void 0:f.prevLead:void 0}getStack(){const{layoutId:d}=this.options;if(d)return this.root.sharedNodes.get(d)}promote({needsReset:d,transition:f,preserveFollowOpacity:g}={}){const m=this.getStack();m&&m.promote(this,g),d&&(this.projectionDelta=void 0,this.needsReset=!0),f&&this.setOptions({transition:f})}relegate(){const d=this.getStack();return d?d.relegate(this):!1}resetSkewAndRotation(){const{visualElement:d}=this.options;if(!d)return;let f=!1;const{latestValues:g}=d;if((g.z||g.rotate||g.rotateX||g.rotateY||g.rotateZ||g.skewX||g.skewY)&&(f=!0),!f)return;const m={};g.z&&td("z",d,m,this.animationValues);for(let x=0;x<ed.length;x++)td(`rotate${ed[x]}`,d,m,this.animationValues),td(`skew${ed[x]}`,d,m,this.animationValues);d.render();for(const x in m)d.setStaticValue(x,m[x]),this.animationValues&&(this.animationValues[x]=m[x]);d.scheduleRender()}applyProjectionStyles(d,f){if(!this.instance||this.isSVG)return;if(!this.isVisible){d.visibility="hidden";return}const g=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,d.visibility="",d.opacity="",d.pointerEvents=jl(f==null?void 0:f.pointerEvents)||"",d.transform=g?g(this.latestValues,""):"none";return}const m=this.getLead();if(!this.projectionDelta||!this.layout||!m.target){this.options.layoutId&&(d.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,d.pointerEvents=jl(f==null?void 0:f.pointerEvents)||""),this.hasProjected&&!za(this.latestValues)&&(d.transform=g?g({},""):"none",this.hasProjected=!1);return}d.visibility="";const x=m.animationValues||m.latestValues;this.applyTransformsToTarget();let h=dk(this.projectionDeltaWithTransform,this.treeScale,x);g&&(h=g(x,h)),d.transform=h;const{x:w,y:k}=this.projectionDelta;d.transformOrigin=`${w.origin*100}% ${k.origin*100}% 0`,m.animationValues?d.opacity=m===this?x.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:x.opacityExit:d.opacity=m===this?x.opacity!==void 0?x.opacity:"":x.opacityExit!==void 0?x.opacityExit:0;for(const j in $d){if(x[j]===void 0)continue;const{correct:E,applyTo:C,isCSSVariable:I}=$d[j],M=h==="none"?x[j]:E(x[j],m);if(C){const _=C.length;for(let V=0;V<_;V++)d[C[V]]=M}else I?this.options.visualElement.renderState.vars[j]=M:d[j]=M}this.options.layoutId&&(d.pointerEvents=m===this?jl(f==null?void 0:f.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(d=>{var f;return(f=d.currentAnimation)==null?void 0:f.stop()}),this.root.nodes.forEach(Km),this.root.sharedNodes.clear()}}}function Sk(e){e.updateLayout()}function Ck(e){var a;const n=((a=e.resumeFrom)==null?void 0:a.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:o}=e.layout,{animationType:l}=e.options,d=n.source!==e.layout.source;if(l==="size")Tr(h=>{const w=d?n.measuredBox[h]:n.layoutBox[h],k=vn(w);w.min=s[h].min,w.max=w.min+k});else if(l==="x"||l==="y"){const h=l==="x"?"y":"x";Hd(d?n.measuredBox[h]:n.layoutBox[h],s[h])}else Xx(l,n.layoutBox,s)&&Tr(h=>{const w=d?n.measuredBox[h]:n.layoutBox[h],k=vn(s[h]);w.max=w.min+k,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[h].max=e.relativeTarget[h].min+k)});const f=Ns();Fi(f,s,n.layoutBox);const g=Ns();d?Fi(g,e.applyTransform(o,!0),n.measuredBox):Fi(g,s,n.layoutBox);const m=!$x(f);let x=!1;if(!e.resumeFrom){const h=e.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:w,layout:k}=h;if(w&&k){const j=e.options.layoutAnchor||void 0,E=Gt();Ol(E,n.layoutBox,w.layoutBox,j);const C=Gt();Ol(C,s,k.layoutBox,j),Hx(E,C)||(x=!0),h.options.layoutRoot&&(e.relativeTarget=C,e.relativeTargetOrigin=E,e.relativeParent=h)}}}e.notifyListeners("didUpdate",{layout:s,snapshot:n,delta:g,layoutDelta:f,hasLayoutChanged:m,hasRelativeLayoutChanged:x})}else if(e.isLead()){const{onExitComplete:s}=e.options;s&&s()}e.options.transition=void 0}function jk(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Ek(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Nk(e){e.clearSnapshot()}function Km(e){e.clearMeasurements()}function Tk(e){e.isLayoutDirty=!0,e.updateLayout()}function Ym(e){e.isLayoutDirty=!1}function Pk(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Rk(e){const{visualElement:n}=e.options;n&&n.getProps().onBeforeLayoutMeasure&&n.notify("BeforeLayoutMeasure"),e.resetTransform()}function Gm(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Mk(e){e.resolveTargetDelta()}function Fk(e){e.calcProjection()}function Ik(e){e.resetSkewAndRotation()}function Dk(e){e.removeLeadSnapshot()}function Xm(e,n,a){e.translate=Et(n.translate,0,a),e.scale=Et(n.scale,1,a),e.origin=n.origin,e.originPoint=n.originPoint}function qm(e,n,a,s){e.min=Et(n.min,a.min,s),e.max=Et(n.max,a.max,s)}function _k(e,n,a,s){qm(e.x,n.x,a.x,s),qm(e.y,n.y,a.y,s)}function Lk(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Ak={duration:.45,ease:[.4,0,.1,1]},Jm=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Qm=Jm("applewebkit/")&&!Jm("chrome/")?Math.round:Zn;function Zm(e){e.min=Qm(e.min),e.max=Qm(e.max)}function Ok(e){Zm(e.x),Zm(e.y)}function Xx(e,n,a){return e==="position"||e==="preserve-aspect"&&!sk(Vm(n),Vm(a),.2)}function Bk(e){var n;return e!==e.root&&((n=e.scroll)==null?void 0:n.wasRoot)}const zk=Gx({attachResizeListener:(e,n)=>zi(e,"resize",n),measureScroll:()=>{var e,n;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((n=document.body)==null?void 0:n.scrollTop)||0}},checkIsScrollRoot:()=>!0}),nd={current:void 0},qx=Gx({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!nd.current){const e=new zk({});e.mount(window),e.setOptions({layoutScroll:!0}),nd.current=e}return nd.current},resetTransform:(e,n)=>{e.style.transform=n!==void 0?n:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Of=v.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function eg(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}function Vk(...e){return n=>{let a=!1;const s=e.map(o=>{const l=eg(o,n);return!a&&typeof l=="function"&&(a=!0),l});if(a)return()=>{for(let o=0;o<s.length;o++){const l=s[o];typeof l=="function"?l():eg(e[o],null)}}}}function Uk(...e){return v.useCallback(Vk(...e),e)}class $k extends v.Component{getSnapshotBeforeUpdate(n){const a=this.props.childRef.current;if(bl(a)&&n.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const s=a.offsetParent,o=bl(s)&&s.offsetWidth||0,l=bl(s)&&s.offsetHeight||0,d=getComputedStyle(a),f=this.props.sizeRef.current;f.height=parseFloat(d.height),f.width=parseFloat(d.width),f.top=a.offsetTop,f.left=a.offsetLeft,f.right=o-f.width-f.left,f.bottom=l-f.height-f.top}return null}componentDidUpdate(){}render(){return this.props.children}}function Hk({children:e,isPresent:n,anchorX:a,anchorY:s,root:o,pop:l}){var w;const d=v.useId(),f=v.useRef(null),g=v.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:m}=v.useContext(Of),x=((w=e.props)==null?void 0:w.ref)??(e==null?void 0:e.ref),h=Uk(f,x);return v.useInsertionEffect(()=>{const{width:k,height:j,top:E,left:C,right:I,bottom:M}=g.current;if(n||l===!1||!f.current||!k||!j)return;const _=a==="left"?`left: ${C}`:`right: ${I}`,V=s==="bottom"?`bottom: ${M}`:`top: ${E}`;f.current.dataset.motionPopId=d;const H=document.createElement("style");m&&(H.nonce=m);const re=o??document.head;return re.appendChild(H),H.sheet&&H.sheet.insertRule(`
[data-motion-pop-id="${d}"] {
position: absolute !important;
width: ${k}px !important;
height: ${j}px !important;
${_}px !important;
${V}px !important;
}
`),()=>{var O;(O=f.current)==null||O.removeAttribute("data-motion-pop-id"),re.contains(H)&&re.removeChild(H)}},[n]),u.jsx($k,{isPresent:n,childRef:f,sizeRef:g,pop:l,children:l===!1?e:v.cloneElement(e,{ref:h})})}const Wk=({children:e,initial:n,isPresent:a,onExitComplete:s,custom:o,presenceAffectsLayout:l,mode:d,anchorX:f,anchorY:g,root:m})=>{const x=ff(Kk),h=v.useId();let w=!0,k=v.useMemo(()=>(w=!1,{id:h,initial:n,isPresent:a,custom:o,onExitComplete:j=>{x.set(j,!0);for(const E of x.values())if(!E)return;s&&s()},register:j=>(x.set(j,!1),()=>x.delete(j))}),[a,x,s]);return l&&w&&(k={...k}),v.useMemo(()=>{x.forEach((j,E)=>x.set(E,!1))},[a]),v.useEffect(()=>{!a&&!x.size&&s&&s()},[a]),e=u.jsx(Hk,{pop:d==="popLayout",isPresent:a,anchorX:f,anchorY:g,root:m,children:e}),u.jsx(Yl.Provider,{value:k,children:e})};function Kk(){return new Map}function Jx(e=!0){const n=v.useContext(Yl);if(n===null)return[!0,null];const{isPresent:a,onExitComplete:s,register:o}=n,l=v.useId();v.useEffect(()=>{if(e)return o(l)},[e]);const d=v.useCallback(()=>e&&s&&s(l),[l,s,e]);return!a&&s?[!1,d]:[!0]}const il=e=>e.key||"";function tg(e){const n=[];return v.Children.forEach(e,a=>{v.isValidElement(a)&&n.push(a)}),n}const pn=({children:e,custom:n,initial:a=!0,onExitComplete:s,presenceAffectsLayout:o=!0,mode:l="sync",propagate:d=!1,anchorX:f="left",anchorY:g="top",root:m})=>{const[x,h]=Jx(d),w=v.useMemo(()=>tg(e),[e]),k=d&&!x?[]:w.map(il),j=v.useRef(!0),E=v.useRef(w),C=ff(()=>new Map),I=v.useRef(new Set),[M,_]=v.useState(w),[V,H]=v.useState(w);C1(()=>{j.current=!1,E.current=w;for(let b=0;b<V.length;b++){const R=il(V[b]);k.includes(R)?(C.delete(R),I.current.delete(R)):C.get(R)!==!0&&C.set(R,!1)}},[V,k.length,k.join("-")]);const re=[];if(w!==M){let b=[...w];for(let R=0;R<V.length;R++){const N=V[R],G=il(N);k.includes(G)||(b.splice(R,0,N),re.push(N))}return l==="wait"&&re.length&&(b=re),H(tg(b)),_(w),null}const{forceRender:O}=v.useContext(df);return u.jsx(u.Fragment,{children:V.map(b=>{const R=il(b),N=d&&!x?!1:w===V||k.includes(R),G=()=>{if(I.current.has(R))return;if(C.has(R))I.current.add(R),C.set(R,!0);else return;let Y=!0;C.forEach(X=>{X||(Y=!1)}),Y&&(O==null||O(),H(E.current),d&&(h==null||h()),s&&s())};return u.jsx(Wk,{isPresent:N,initial:!j.current||a?void 0:!1,custom:n,presenceAffectsLayout:o,mode:l,root:m,onExitComplete:N?void 0:G,anchorX:f,anchorY:g,children:b},R)})})},Qx=v.createContext({strict:!1}),ng={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let rg=!1;function Yk(){if(rg)return;const e={};for(const n in ng)e[n]={isEnabled:a=>ng[n].some(s=>!!a[s])};Nx(e),rg=!0}function Zx(){return Yk(),M4()}function Gk(e){const n=Zx();for(const a in e)n[a]={...n[a],...e[a]};Nx(n)}const Xk=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Bl(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Xk.has(e)}let ey=e=>!Bl(e);function qk(e){typeof e=="function"&&(ey=n=>n.startsWith("on")?!Bl(n):e(n))}try{qk(require("@emotion/is-prop-valid").default)}catch{}function Jk(e,n,a){const s={};for(const o in e)o==="values"&&typeof e.values=="object"||rn(e[o])||(ey(o)||a===!0&&Bl(o)||!n&&!Bl(o)||e.draggable&&o.startsWith("onDrag"))&&(s[o]=e[o]);return s}const Jl=v.createContext({});function Qk(e,n){if(ql(e)){const{initial:a,animate:s}=e;return{initial:a===!1||Bi(a)?a:void 0,animate:Bi(s)?s:void 0}}return e.inherit!==!1?n:{}}function Zk(e){const{initial:n,animate:a}=Qk(e,v.useContext(Jl));return v.useMemo(()=>({initial:n,animate:a}),[ag(n),ag(a)])}function ag(e){return Array.isArray(e)?e.join(" "):e}const Bf=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ty(e,n,a){for(const s in n)!rn(n[s])&&!Dx(s,a)&&(e[s]=n[s])}function eS({transformTemplate:e},n){return v.useMemo(()=>{const a=Bf();return Lf(a,n,e),Object.assign({},a.vars,a.style)},[n])}function tS(e,n){const a=e.style||{},s={};return ty(s,a,e),Object.assign(s,eS(e,n)),s}function nS(e,n){const a={},s=tS(e,n);return e.drag&&e.dragListener!==!1&&(a.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.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=s,a}const ny=()=>({...Bf(),attrs:{}});function rS(e,n,a,s){const o=v.useMemo(()=>{const l=ny();return _x(l,n,Ax(s),e.transformTemplate,e.style),{...l.attrs,style:{...l.style}}},[n]);if(e.style){const l={};ty(l,e.style,e),o.style={...l,...o.style}}return o}const aS=["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 zf(e){return typeof e!="string"||e.includes("-")?!1:!!(aS.indexOf(e)>-1||/[A-Z]/u.test(e))}function sS(e,n,a,{latestValues:s},o,l=!1,d){const g=(d??zf(e)?rS:nS)(n,s,o,e),m=Jk(n,typeof e=="string",l),x=e!==v.Fragment?{...m,...g,ref:a}:{},{children:h}=n,w=v.useMemo(()=>rn(h)?h.get():h,[h]);return v.createElement(e,{...x,children:w})}function iS({scrapeMotionValuesFromProps:e,createRenderState:n},a,s,o){return{latestValues:oS(a,s,o,e),renderState:n()}}function oS(e,n,a,s){const o={},l=s(e,{});for(const w in l)o[w]=jl(l[w]);let{initial:d,animate:f}=e;const g=ql(e),m=jx(e);n&&m&&!g&&e.inherit!==!1&&(d===void 0&&(d=n.initial),f===void 0&&(f=n.animate));let x=a?a.initial===!1:!1;x=x||d===!1;const h=x?f:d;if(h&&typeof h!="boolean"&&!Xl(h)){const w=Array.isArray(h)?h:[h];for(let k=0;k<w.length;k++){const j=Nf(e,w[k]);if(j){const{transitionEnd:E,transition:C,...I}=j;for(const M in I){let _=I[M];if(Array.isArray(_)){const V=x?_.length-1:0;_=_[V]}_!==null&&(o[M]=_)}for(const M in E)o[M]=E[M]}}}return o}const ry=e=>(n,a)=>{const s=v.useContext(Jl),o=v.useContext(Yl),l=()=>iS(e,n,s,o);return a?l():ff(l)},lS=ry({scrapeMotionValuesFromProps:Af,createRenderState:Bf}),cS=ry({scrapeMotionValuesFromProps:Ox,createRenderState:ny}),uS=Symbol.for("motionComponentSymbol");function dS(e,n,a){const s=v.useRef(a);v.useInsertionEffect(()=>{s.current=a});const o=v.useRef(null);return v.useCallback(l=>{var f;l&&((f=e.onMount)==null||f.call(e,l));const d=s.current;if(typeof d=="function")if(l){const g=d(l);typeof g=="function"&&(o.current=g)}else o.current?(o.current(),o.current=null):d(l);else d&&(d.current=l);n&&(l?n.mount(l):n.unmount())},[n])}const ay=v.createContext({});function Ss(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function fS(e,n,a,s,o,l){var _,V;const{visualElement:d}=v.useContext(Jl),f=v.useContext(Qx),g=v.useContext(Yl),m=v.useContext(Of),x=m.reducedMotion,h=m.skipAnimations,w=v.useRef(null),k=v.useRef(!1);s=s||f.renderer,!w.current&&s&&(w.current=s(e,{visualState:n,parent:d,props:a,presenceContext:g,blockInitialAnimation:g?g.initial===!1:!1,reducedMotionConfig:x,skipAnimations:h,isSVG:l}),k.current&&w.current&&(w.current.manuallyAnimateOnMount=!0));const j=w.current,E=v.useContext(ay);j&&!j.projection&&o&&(j.type==="html"||j.type==="svg")&&hS(w.current,a,o,E);const C=v.useRef(!1);v.useInsertionEffect(()=>{j&&C.current&&j.update(a,g)});const I=a[fx],M=v.useRef(!!I&&typeof window<"u"&&!((_=window.MotionHandoffIsComplete)!=null&&_.call(window,I))&&((V=window.MotionHasOptimisedAnimation)==null?void 0:V.call(window,I)));return C1(()=>{k.current=!0,j&&(C.current=!0,window.MotionIsMounted=!0,j.updateFeatures(),j.scheduleRenderMicrotask(),M.current&&j.animationState&&j.animationState.animateChanges())}),v.useEffect(()=>{j&&(!M.current&&j.animationState&&j.animationState.animateChanges(),M.current&&(queueMicrotask(()=>{var H;(H=window.MotionHandoffMarkAsComplete)==null||H.call(window,I)}),M.current=!1),j.enteringChildren=void 0)}),j}function hS(e,n,a,s){const{layoutId:o,layout:l,drag:d,dragConstraints:f,layoutScroll:g,layoutRoot:m,layoutAnchor:x,layoutCrossfade:h}=n;e.projection=new a(e.latestValues,n["data-framer-portal-id"]?void 0:sy(e.parent)),e.projection.setOptions({layoutId:o,layout:l,alwaysMeasureLayout:!!d||f&&Ss(f),visualElement:e,animationType:typeof l=="string"?l:"both",initialPromotionConfig:s,crossfade:h,layoutScroll:g,layoutRoot:m,layoutAnchor:x})}function sy(e){if(e)return e.options.allowProjection!==!1?e.projection:sy(e.parent)}function rd(e,{forwardMotionProps:n=!1,type:a}={},s,o){s&&Gk(s);const l=a?a==="svg":zf(e),d=l?cS:lS;function f(m,x){let h;const w={...v.useContext(Of),...m,layoutId:pS(m)},{isStatic:k}=w,j=Zk(m),E=d(m,k);if(!k&&typeof window<"u"){mS();const C=gS(w);h=C.MeasureLayout,j.visualElement=fS(e,E,w,o,C.ProjectionNode,l)}return u.jsxs(Jl.Provider,{value:j,children:[h&&j.visualElement?u.jsx(h,{visualElement:j.visualElement,...w}):null,sS(e,m,dS(E,j.visualElement,x),E,k,n,l)]})}f.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const g=v.forwardRef(f);return g[uS]=e,g}function pS({layoutId:e}){const n=v.useContext(df).id;return n&&e!==void 0?n+"-"+e:e}function mS(e,n){v.useContext(Qx).strict}function gS(e){const n=Zx(),{drag:a,layout:s}=n;if(!a&&!s)return{};const o={...a,...s};return{MeasureLayout:a!=null&&a.isEnabled(e)||s!=null&&s.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function xS(e,n){if(typeof Proxy>"u")return rd;const a=new Map,s=(l,d)=>rd(l,d,e,n),o=(l,d)=>s(l,d);return new Proxy(o,{get:(l,d)=>d==="create"?s:(a.has(d)||a.set(d,rd(d,void 0,e,n)),a.get(d))})}const yS=(e,n)=>n.isSVG??zf(e)?new G4(n):new U4(n,{allowProjection:e!==v.Fragment});class vS extends Ca{constructor(n){super(n),n.animationState||(n.animationState=Z4(n))}updateAnimationControlsSubscription(){const{animate:n}=this.node.getProps();Xl(n)&&(this.unmountControls=n.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:n}=this.node.getProps(),{animate:a}=this.node.prevProps||{};n!==a&&this.updateAnimationControlsSubscription()}unmount(){var n;this.node.animationState.reset(),(n=this.unmountControls)==null||n.call(this)}}let bS=0;class wS extends Ca{constructor(){super(...arguments),this.id=bS++,this.isExitComplete=!1}update(){var l;if(!this.node.presenceContext)return;const{isPresent:n,onExitComplete:a}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||n===s)return;if(n&&s===!1){if(this.isExitComplete){const{initial:d,custom:f}=this.node.getProps();if(typeof d=="string"){const g=Wa(this.node,d,f);if(g){const{transition:m,transitionEnd:x,...h}=g;for(const w in h)(l=this.node.getValue(w))==null||l.jump(h[w])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const o=this.node.animationState.setActive("exit",!n);a&&!n&&o.then(()=>{this.isExitComplete=!0,a(this.id)})}mount(){const{register:n,onExitComplete:a}=this.node.presenceContext||{};a&&a(this.id),n&&(this.unmount=n(this.id))}unmount(){}}const kS={animation:{Feature:vS},exit:{Feature:wS}};function qi(e){return{point:{x:e.pageX,y:e.pageY}}}const SS=e=>n=>Mf(n)&&e(n,qi(n));function Ii(e,n,a,s){return zi(e,n,SS(a),s)}const iy=({current:e})=>e?e.ownerDocument.defaultView:null,sg=(e,n)=>Math.abs(e-n);function CS(e,n){const a=sg(e.x,n.x),s=sg(e.y,n.y);return Math.sqrt(a**2+s**2)}const ig=new Set(["auto","scroll"]);class oy{constructor(n,a,{transformPagePoint:s,contextWindow:o=window,dragSnapToOrigin:l=!1,distanceThreshold:d=3,element:f}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=k=>{this.handleScroll(k.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=ol(this.lastRawMoveEventInfo,this.transformPagePoint));const k=ad(this.lastMoveEventInfo,this.history),j=this.startEvent!==null,E=CS(k.offset,{x:0,y:0})>=this.distanceThreshold;if(!j&&!E)return;const{point:C}=k,{timestamp:I}=nn;this.history.push({...C,timestamp:I});const{onStart:M,onMove:_}=this.handlers;j||(M&&M(this.lastMoveEvent,k),this.startEvent=this.lastMoveEvent),_&&_(this.lastMoveEvent,k)},this.handlePointerMove=(k,j)=>{this.lastMoveEvent=k,this.lastRawMoveEventInfo=j,this.lastMoveEventInfo=ol(j,this.transformPagePoint),xt.update(this.updatePoint,!0)},this.handlePointerUp=(k,j)=>{this.end();const{onEnd:E,onSessionEnd:C,resumeAnimation:I}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&I&&I(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const M=ad(k.type==="pointercancel"?this.lastMoveEventInfo:ol(j,this.transformPagePoint),this.history);this.startEvent&&E&&E(k,M),C&&C(k,M)},!Mf(n))return;this.dragSnapToOrigin=l,this.handlers=a,this.transformPagePoint=s,this.distanceThreshold=d,this.contextWindow=o||window;const g=qi(n),m=ol(g,this.transformPagePoint),{point:x}=m,{timestamp:h}=nn;this.history=[{...x,timestamp:h}];const{onSessionStart:w}=a;w&&w(n,ad(m,this.history)),this.removeListeners=Yi(Ii(this.contextWindow,"pointermove",this.handlePointerMove),Ii(this.contextWindow,"pointerup",this.handlePointerUp),Ii(this.contextWindow,"pointercancel",this.handlePointerUp)),f&&this.startScrollTracking(f)}startScrollTracking(n){let a=n.parentElement;for(;a;){const s=getComputedStyle(a);(ig.has(s.overflowX)||ig.has(s.overflowY))&&this.scrollPositions.set(a,{x:a.scrollLeft,y:a.scrollTop}),a=a.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(n){const a=this.scrollPositions.get(n);if(!a)return;const s=n===window,o=s?{x:window.scrollX,y:window.scrollY}:{x:n.scrollLeft,y:n.scrollTop},l={x:o.x-a.x,y:o.y-a.y};l.x===0&&l.y===0||(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=l.x,this.lastMoveEventInfo.point.y+=l.y):this.history.length>0&&(this.history[0].x-=l.x,this.history[0].y-=l.y),this.scrollPositions.set(n,o),xt.update(this.updatePoint,!0))}updateHandlers(n){this.handlers=n}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ka(this.updatePoint)}}function ol(e,n){return n?{point:n(e.point)}:e}function og(e,n){return{x:e.x-n.x,y:e.y-n.y}}function ad({point:e},n){return{point:e,delta:og(e,ly(n)),offset:og(e,jS(n)),velocity:ES(n,.1)}}function jS(e){return e[0]}function ly(e){return e[e.length-1]}function ES(e,n){if(e.length<2)return{x:0,y:0};let a=e.length-1,s=null;const o=ly(e);for(;a>=0&&(s=e[a],!(o.timestamp-s.timestamp>Bn(n)));)a--;if(!s)return{x:0,y:0};s===e[0]&&e.length>2&&o.timestamp-s.timestamp>Bn(n)*2&&(s=e[1]);const l=qn(o.timestamp-s.timestamp);if(l===0)return{x:0,y:0};const d={x:(o.x-s.x)/l,y:(o.y-s.y)/l};return d.x===1/0&&(d.x=0),d.y===1/0&&(d.y=0),d}function NS(e,{min:n,max:a},s){return n!==void 0&&e<n?e=s?Et(n,e,s.min):Math.max(e,n):a!==void 0&&e>a&&(e=s?Et(a,e,s.max):Math.min(e,a)),e}function lg(e,n,a){return{min:n!==void 0?e.min+n:void 0,max:a!==void 0?e.max+a-(e.max-e.min):void 0}}function TS(e,{top:n,left:a,bottom:s,right:o}){return{x:lg(e.x,a,o),y:lg(e.y,n,s)}}function cg(e,n){let a=n.min-e.min,s=n.max-e.max;return n.max-n.min<e.max-e.min&&([a,s]=[s,a]),{min:a,max:s}}function PS(e,n){return{x:cg(e.x,n.x),y:cg(e.y,n.y)}}function RS(e,n){let a=.5;const s=vn(e),o=vn(n);return o>s?a=Ai(n.min,n.max-s,e.min):s>o&&(a=Ai(e.min,e.max-o,n.min)),Fr(0,1,a)}function MS(e,n){const a={};return n.min!==void 0&&(a.min=n.min-e.min),n.max!==void 0&&(a.max=n.max-e.min),a}const Wd=.35;function FS(e=Wd){return e===!1?e=0:e===!0&&(e=Wd),{x:ug(e,"left","right"),y:ug(e,"top","bottom")}}function ug(e,n,a){return{min:dg(e,n),max:dg(e,a)}}function dg(e,n){return typeof e=="number"?e:e[n]||0}const IS=new WeakMap;class DS{constructor(n){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Gt(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=n}start(n,{snapToCursor:a=!1,distanceThreshold:s}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const l=h=>{a&&this.snapToCursor(qi(h).point),this.stopAnimation()},d=(h,w)=>{const{drag:k,dragPropagation:j,onDragStart:E}=this.getProps();if(k&&!j&&(this.openDragLock&&this.openDragLock(),this.openDragLock=l4(k),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=w,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Tr(I=>{let M=this.getAxisMotionValue(I).get()||0;if(Rr.test(M)){const{projection:_}=this.visualElement;if(_&&_.layout){const V=_.layout.layoutBox[I];V&&(M=vn(V)*(parseFloat(M)/100))}}this.originPoint[I]=M}),E&&xt.update(()=>E(h,w),!1,!0),Ad(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},f=(h,w)=>{this.latestPointerEvent=h,this.latestPanInfo=w;const{dragPropagation:k,dragDirectionLock:j,onDirectionLock:E,onDrag:C}=this.getProps();if(!k&&!this.openDragLock)return;const{offset:I}=w;if(j&&this.currentDirection===null){this.currentDirection=LS(I),this.currentDirection!==null&&E&&E(this.currentDirection);return}this.updateAxis("x",w.point,I),this.updateAxis("y",w.point,I),this.visualElement.render(),C&&xt.update(()=>C(h,w),!1,!0)},g=(h,w)=>{this.latestPointerEvent=h,this.latestPanInfo=w,this.stop(h,w),this.latestPointerEvent=null,this.latestPanInfo=null},m=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:x}=this.getProps();this.panSession=new oy(n,{onSessionStart:l,onStart:d,onMove:f,onSessionEnd:g,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:x,distanceThreshold:s,contextWindow:iy(this.visualElement),element:this.visualElement.current})}stop(n,a){const s=n||this.latestPointerEvent,o=a||this.latestPanInfo,l=this.isDragging;if(this.cancel(),!l||!o||!s)return;const{velocity:d}=o;this.startAnimation(d);const{onDragEnd:f}=this.getProps();f&&xt.postRender(()=>f(s,o))}cancel(){this.isDragging=!1;const{projection:n,animationState:a}=this.visualElement;n&&(n.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),a&&a.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(n,a,s){const{drag:o}=this.getProps();if(!s||!ll(n,o,this.currentDirection))return;const l=this.getAxisMotionValue(n);let d=this.originPoint[n]+s[n];this.constraints&&this.constraints[n]&&(d=NS(d,this.constraints[n],this.elastic[n])),l.set(d)}resolveConstraints(){var l;const{dragConstraints:n,dragElastic:a}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(l=this.visualElement.projection)==null?void 0:l.layout,o=this.constraints;n&&Ss(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=TS(s.layoutBox,n):this.constraints=!1,this.elastic=FS(a),o!==this.constraints&&!Ss(n)&&s&&this.constraints&&!this.hasMutatedConstraints&&Tr(d=>{this.constraints!==!1&&this.getAxisMotionValue(d)&&(this.constraints[d]=MS(s.layoutBox[d],this.constraints[d]))})}resolveRefConstraints(){const{dragConstraints:n,onMeasureDragConstraints:a}=this.getProps();if(!n||!Ss(n))return!1;const s=n.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const l=L4(s,o.root,this.visualElement.getTransformPagePoint());let d=PS(o.layout.layoutBox,l);if(a){const f=a(I4(d));this.hasMutatedConstraints=!!f,f&&(d=Px(f))}return d}startAnimation(n){const{drag:a,dragMomentum:s,dragElastic:o,dragTransition:l,dragSnapToOrigin:d,onDragTransitionEnd:f}=this.getProps(),g=this.constraints||{},m=Tr(x=>{if(!ll(x,a,this.currentDirection))return;let h=g&&g[x]||{};(d===!0||d===x)&&(h={min:0,max:0});const w=o?200:1e6,k=o?40:1e7,j={type:"inertia",velocity:s?n[x]:0,bounceStiffness:w,bounceDamping:k,timeConstant:750,restDelta:1,restSpeed:10,...l,...h};return this.startAxisValueAnimation(x,j)});return Promise.all(m).then(f)}startAxisValueAnimation(n,a){const s=this.getAxisMotionValue(n);return Ad(this.visualElement,n),s.start(Ef(n,s,0,a,this.visualElement,!1))}stopAnimation(){Tr(n=>this.getAxisMotionValue(n).stop())}getAxisMotionValue(n){const a=`_drag${n.toUpperCase()}`,s=this.visualElement.getProps(),o=s[a];return o||this.visualElement.getValue(n,(s.initial?s.initial[n]:void 0)||0)}snapToCursor(n){Tr(a=>{const{drag:s}=this.getProps();if(!ll(a,s,this.currentDirection))return;const{projection:o}=this.visualElement,l=this.getAxisMotionValue(a);if(o&&o.layout){const{min:d,max:f}=o.layout.layoutBox[a],g=l.get()||0;l.set(n[a]-Et(d,f,.5)+g)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:n,dragConstraints:a}=this.getProps(),{projection:s}=this.visualElement;if(!Ss(a)||!s||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Tr(d=>{const f=this.getAxisMotionValue(d);if(f&&this.constraints!==!1){const g=f.get();o[d]=RS({min:g,max:g},this.constraints[d])}});const{transformTemplate:l}=this.visualElement.getProps();this.visualElement.current.style.transform=l?l({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.constraints=!1,this.resolveConstraints(),Tr(d=>{if(!ll(d,n,null))return;const f=this.getAxisMotionValue(d),{min:g,max:m}=this.constraints[d];f.set(Et(g,m,o[d]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;IS.set(this.visualElement,this);const n=this.visualElement.current,a=Ii(n,"pointerdown",m=>{const{drag:x,dragListener:h=!0}=this.getProps(),w=m.target,k=w!==n&&p4(w);x&&h&&!k&&this.start(m)});let s;const o=()=>{const{dragConstraints:m}=this.getProps();Ss(m)&&m.current&&(this.constraints=this.resolveRefConstraints(),s||(s=_S(n,m.current,()=>this.scalePositionWithinConstraints())))},{projection:l}=this.visualElement,d=l.addEventListener("measure",o);l&&!l.layout&&(l.root&&l.root.updateScroll(),l.updateLayout()),xt.read(o);const f=zi(window,"resize",()=>this.scalePositionWithinConstraints()),g=l.addEventListener("didUpdate",(({delta:m,hasLayoutChanged:x})=>{this.isDragging&&x&&(Tr(h=>{const w=this.getAxisMotionValue(h);w&&(this.originPoint[h]+=m[h].translate,w.set(w.get()+m[h].translate))}),this.visualElement.render())}));return()=>{f(),a(),d(),g&&g(),s&&s()}}getProps(){const n=this.visualElement.getProps(),{drag:a=!1,dragDirectionLock:s=!1,dragPropagation:o=!1,dragConstraints:l=!1,dragElastic:d=Wd,dragMomentum:f=!0}=n;return{...n,drag:a,dragDirectionLock:s,dragPropagation:o,dragConstraints:l,dragElastic:d,dragMomentum:f}}}function fg(e){let n=!0;return()=>{if(n){n=!1;return}e()}}function _S(e,n,a){const s=vm(e,fg(a)),o=vm(n,fg(a));return()=>{s(),o()}}function ll(e,n,a){return(n===!0||n===e)&&(a===null||a===e)}function LS(e,n=10){let a=null;return Math.abs(e.y)>n?a="y":Math.abs(e.x)>n&&(a="x"),a}class AS extends Ca{constructor(n){super(n),this.removeGroupControls=Zn,this.removeListeners=Zn,this.controls=new DS(n)}mount(){const{dragControls:n}=this.node.getProps();n&&(this.removeGroupControls=n.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Zn}update(){const{dragControls:n}=this.node.getProps(),{dragControls:a}=this.node.prevProps||{};n!==a&&(this.removeGroupControls(),n&&(this.removeGroupControls=n.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const sd=e=>(n,a)=>{e&&xt.update(()=>e(n,a),!1,!0)};class OS extends Ca{constructor(){super(...arguments),this.removePointerDownListener=Zn}onPointerDown(n){this.session=new oy(n,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:iy(this.node)})}createPanHandlers(){const{onPanSessionStart:n,onPanStart:a,onPan:s,onPanEnd:o}=this.node.getProps();return{onSessionStart:sd(n),onStart:sd(a),onMove:sd(s),onEnd:(l,d)=>{delete this.session,o&&xt.postRender(()=>o(l,d))}}}mount(){this.removePointerDownListener=Ii(this.node.current,"pointerdown",n=>this.onPointerDown(n))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let id=!1;class BS extends v.Component{componentDidMount(){const{visualElement:n,layoutGroup:a,switchLayoutGroup:s,layoutId:o}=this.props,{projection:l}=n;l&&(a.group&&a.group.add(l),s&&s.register&&o&&s.register(l),id&&l.root.didUpdate(),l.addEventListener("animationComplete",()=>{this.safeToRemove()}),l.setOptions({...l.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),El.hasEverUpdated=!0}getSnapshotBeforeUpdate(n){const{layoutDependency:a,visualElement:s,drag:o,isPresent:l}=this.props,{projection:d}=s;return d&&(d.isPresent=l,n.layoutDependency!==a&&d.setOptions({...d.options,layoutDependency:a}),id=!0,o||n.layoutDependency!==a||a===void 0||n.isPresent!==l?d.willUpdate():this.safeToRemove(),n.isPresent!==l&&(l?d.promote():d.relegate()||xt.postRender(()=>{const f=d.getStack();(!f||!f.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:n,layoutAnchor:a}=this.props,{projection:s}=n;s&&(s.options.layoutAnchor=a,s.root.didUpdate(),Rf.postRender(()=>{!s.currentAnimation&&s.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:n,layoutGroup:a,switchLayoutGroup:s}=this.props,{projection:o}=n;id=!0,o&&(o.scheduleCheckAfterUnmount(),a&&a.group&&a.group.remove(o),s&&s.deregister&&s.deregister(o))}safeToRemove(){const{safeToRemove:n}=this.props;n&&n()}render(){return null}}function cy(e){const[n,a]=Jx(),s=v.useContext(df);return u.jsx(BS,{...e,layoutGroup:s,switchLayoutGroup:v.useContext(ay),isPresent:n,safeToRemove:a})}const zS={pan:{Feature:OS},drag:{Feature:AS,ProjectionNode:qx,MeasureLayout:cy}};function hg(e,n,a){const{props:s}=e;e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",a==="Start");const o="onHover"+a,l=s[o];l&&xt.postRender(()=>l(n,qi(n)))}class VS extends Ca{mount(){const{current:n}=this.node;n&&(this.unmount=u4(n,(a,s)=>(hg(this.node,s,"Start"),o=>hg(this.node,o,"End"))))}unmount(){}}class US extends Ca{constructor(){super(...arguments),this.isActive=!1}onFocus(){let n=!1;try{n=this.node.current.matches(":focus-visible")}catch{n=!0}!n||!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=Yi(zi(this.node.current,"focus",()=>this.onFocus()),zi(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function pg(e,n,a){const{props:s}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&s.whileTap&&e.animationState.setActive("whileTap",a==="Start");const o="onTap"+(a==="End"?"":a),l=s[o];l&&xt.postRender(()=>l(n,qi(n)))}class $S extends Ca{mount(){const{current:n}=this.node;if(!n)return;const{globalTapTarget:a,propagate:s}=this.node.props;this.unmount=g4(n,(o,l)=>(pg(this.node,l,"Start"),(d,{success:f})=>pg(this.node,d,f?"End":"Cancel")),{useGlobalTarget:a,stopPropagation:(s==null?void 0:s.tap)===!1})}unmount(){}}const Kd=new WeakMap,od=new WeakMap,HS=e=>{const n=Kd.get(e.target);n&&n(e)},WS=e=>{e.forEach(HS)};function KS({root:e,...n}){const a=e||document;od.has(a)||od.set(a,{});const s=od.get(a),o=JSON.stringify(n);return s[o]||(s[o]=new IntersectionObserver(WS,{root:e,...n})),s[o]}function YS(e,n,a){const s=KS(n);return Kd.set(e,a),s.observe(e),()=>{Kd.delete(e),s.unobserve(e)}}const GS={some:0,all:1};class XS extends Ca{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var g;(g=this.stopObserver)==null||g.call(this);const{viewport:n={}}=this.node.getProps(),{root:a,margin:s,amount:o="some",once:l}=n,d={root:a?a.current:void 0,rootMargin:s,threshold:typeof o=="number"?o:GS[o]},f=m=>{const{isIntersecting:x}=m;if(this.isInView===x||(this.isInView=x,l&&!x&&this.hasEnteredView))return;x&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",x);const{onViewportEnter:h,onViewportLeave:w}=this.node.getProps(),k=x?h:w;k&&k(m)};this.stopObserver=YS(this.node.current,d,f)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:n,prevProps:a}=this.node;["amount","margin","root"].some(qS(n,a))&&this.startObserver()}unmount(){var n;(n=this.stopObserver)==null||n.call(this),this.hasEnteredView=!1,this.isInView=!1}}function qS({viewport:e={}},{viewport:n={}}={}){return a=>e[a]!==n[a]}const JS={inView:{Feature:XS},tap:{Feature:$S},focus:{Feature:US},hover:{Feature:VS}},QS={layout:{ProjectionNode:qx,MeasureLayout:cy}},ZS={...kS,...JS,...zS,...QS},se=xS(ZS,yS);function e8(){!_f.current&&Ex();const[e]=v.useState(_l.current);return e}/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const t8=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),n8=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,a,s)=>s?s.toUpperCase():a.toLowerCase()),mg=e=>{const n=n8(e);return n.charAt(0).toUpperCase()+n.slice(1)},uy=(...e)=>e.filter((n,a,s)=>!!n&&n.trim()!==""&&s.indexOf(n)===a).join(" ").trim();/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/var r8={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const a8=v.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:a=2,absoluteStrokeWidth:s,className:o="",children:l,iconNode:d,...f},g)=>v.createElement("svg",{ref:g,...r8,width:n,height:n,stroke:e,strokeWidth:s?Number(a)*24/Number(n):a,className:uy("lucide",o),...f},[...d.map(([m,x])=>v.createElement(m,x)),...Array.isArray(l)?l:[l]]));/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const We=(e,n)=>{const a=v.forwardRef(({className:s,...o},l)=>v.createElement(a8,{ref:l,iconNode:n,className:uy(`lucide-${t8(mg(e))}`,`lucide-${e}`,s),...o}));return a.displayName=mg(e),a};/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const s8=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],i8=We("book-open",s8);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const o8=[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],dy=We("camera",o8);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const l8=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],c8=We("check",l8);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const u8=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Yd=We("chevron-down",u8);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const d8=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],fy=We("chevron-left",d8);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const f8=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],hy=We("chevron-right",f8);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const h8=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],p8=We("circle-check-big",h8);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const m8=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],g8=We("circle-check",m8);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const x8=[["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"}]],py=We("circle-x",x8);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const y8=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]],v8=We("clock-3",y8);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const b8=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],w8=We("clock",b8);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const k8=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],gg=We("download",k8);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const S8=[["path",{d:"M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z",key:"1ptgy4"}],["path",{d:"M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97",key:"1sl1rz"}]],C8=We("droplets",S8);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const j8=[["path",{d:"M14.4 14.4 9.6 9.6",key:"ic80wn"}],["path",{d:"M18.657 21.485a2 2 0 1 1-2.829-2.828l-1.767 1.768a2 2 0 1 1-2.829-2.829l6.364-6.364a2 2 0 1 1 2.829 2.829l-1.768 1.767a2 2 0 1 1 2.828 2.829z",key:"nnl7wr"}],["path",{d:"m21.5 21.5-1.4-1.4",key:"1f1ice"}],["path",{d:"M3.9 3.9 2.5 2.5",key:"1evmna"}],["path",{d:"M6.404 12.768a2 2 0 1 1-2.829-2.829l1.768-1.767a2 2 0 1 1-2.828-2.829l2.828-2.828a2 2 0 1 1 2.829 2.828l1.767-1.768a2 2 0 1 1 2.829 2.829z",key:"yhosts"}]],E8=We("dumbbell",j8);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const N8=[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]],T8=We("gift",N8);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const P8=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],my=We("image",P8);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const R8=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],M8=We("loader-circle",R8);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const F8=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],I8=We("lock",F8);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const D8=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],_8=We("log-out",D8);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const L8=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],A8=We("message-circle",L8);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const O8=[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]],B8=We("mic",O8);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const z8=[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]],V8=We("music",z8);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const U8=[["path",{d:"M15 18h-5",key:"95g1m2"}],["path",{d:"M18 14h-8",key:"sponae"}],["path",{d:"M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-4 0v-9a2 2 0 0 1 2-2h2",key:"39pd36"}],["rect",{width:"8",height:"4",x:"10",y:"6",rx:"1",key:"aywv1n"}]],$8=We("newspaper",U8);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const H8=[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]],W8=We("notebook-pen",H8);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const K8=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],xg=We("package",K8);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Y8=[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]],G8=We("palette",Y8);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const X8=[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]],q8=We("paperclip",X8);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const J8=[["path",{d:"M5.8 11.3 2 22l10.7-3.79",key:"gwxi1d"}],["path",{d:"M4 3h.01",key:"1vcuye"}],["path",{d:"M22 8h.01",key:"1mrtc2"}],["path",{d:"M15 2h.01",key:"1cjtqr"}],["path",{d:"M22 20h.01",key:"1mrys2"}],["path",{d:"m22 2-2.24.75a2.9 2.9 0 0 0-1.96 3.12c.1.86-.57 1.63-1.45 1.63h-.38c-.86 0-1.6.6-1.76 1.44L14 10",key:"hbicv8"}],["path",{d:"m22 13-.82-.33c-.86-.34-1.82.2-1.98 1.11c-.11.7-.72 1.22-1.43 1.22H17",key:"1i94pl"}],["path",{d:"m11 2 .33.82c.34.86-.2 1.82-1.11 1.98C9.52 4.9 9 5.52 9 6.23V7",key:"1cofks"}],["path",{d:"M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z",key:"4kbmks"}]],Q8=We("party-popper",J8);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Z8=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],e6=We("pause",Z8);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const t6=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],n6=We("pen",t6);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const r6=[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]],a6=We("phone",r6);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const s6=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Ql=We("play",s6);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const i6=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Vf=We("plus",i6);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const o6=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],l6=We("save",o6);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const c6=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],gy=We("send",c6);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const u6=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],xy=We("shield-check",u6);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const d6=[["path",{d:"M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z",key:"hou9p0"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}]],f6=We("shopping-bag",d6);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const h6=[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]],p6=We("sparkles",h6);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const m6=[["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"}]],g6=We("square-pen",m6);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const x6=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],y6=We("square",x6);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const v6=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],b6=We("star",v6);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const w6=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],k6=We("sun",w6);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const S6=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],yy=We("trash-2",S6);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const C6=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]],Uf=We("upload",C6);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const j6=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]],vy=We("users",j6);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const E6=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],by=We("video",E6);/**
* @license lucide-react v0.487.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const N6=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],_s=We("x",N6),wy="/assets/0a77244cc5b7dea0bea10275d45df2915d5170ca-B-lUX1TY.png",T6="data:image/svg+xml,%3csvg%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cdefs%3e%3clinearGradient%20id='phoneGrad'%20x1='26'%20y1='16'%20x2='102'%20y2='112'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FFC4FF'/%3e%3cstop%20offset='0.5'%20stop-color='%23D56CFF'/%3e%3cstop%20offset='1'%20stop-color='%238F36EE'/%3e%3c/linearGradient%3e%3c/defs%3e%3cpath%20d='M38.6%2022.7c-2.9.9-5.5%202.8-7.2%205.4-3.3%205-4.9%2012.3-1.5%2023.4%203.7%2012%2011.2%2024.4%2020.8%2034%209.6%209.6%2022%2017.2%2034%2020.8%2011.1%203.4%2018.4%201.8%2023.4-1.5%202.6-1.7%204.5-4.3%205.4-7.2.9-2.9.8-6-.6-8.7l-8.7-16.9a8.3%208.3%200%200%200-10.5-3.9l-10.6%204.1c-1.9.7-4%20.2-5.4-1.2L57%2050.3c-1.4-1.4-1.9-3.5-1.2-5.4l4.1-10.6a8.3%208.3%200%200%200-3.9-10.5l-16.9-8.7a10.5%2010.5%200%200%200-8.7-.6z'%20fill='url(%23phoneGrad)'/%3e%3cpath%20d='M38.6%2022.7c-2.9.9-5.5%202.8-7.2%205.4-3.3%205-4.9%2012.3-1.5%2023.4%203.7%2012%2011.2%2024.4%2020.8%2034%209.6%209.6%2022%2017.2%2034%2020.8%2011.1%203.4%2018.4%201.8%2023.4-1.5%202.6-1.7%204.5-4.3%205.4-7.2.9-2.9.8-6-.6-8.7l-8.7-16.9a8.3%208.3%200%200%200-10.5-3.9l-10.6%204.1c-1.9.7-4%20.2-5.4-1.2L57%2050.3c-1.4-1.4-1.9-3.5-1.2-5.4l4.1-10.6a8.3%208.3%200%200%200-3.9-10.5l-16.9-8.7a10.5%2010.5%200%200%200-8.7-.6z'%20stroke='%23FFD7FF'%20stroke-width='3.25'/%3e%3c/svg%3e",Zl=async()=>{const e=Ga();if(!e)return hr();try{const n=await fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${e}`},body:JSON.stringify({get_user_profile_function:{}})});if(!n.ok)return hr();const a=await n.json();if(a.state===0&&a.data){const s=JSON.parse(a.data);if(s.profile){const o=JSON.parse(s.profile);if(o&&o.length>0){const l=o[0];return localStorage.setItem("userProfile",JSON.stringify(l)),l}}}return hr()}catch{return hr()}},ky=async e=>{const n=Ga();if(!n)return console.warn("توکن احراز هویت یافت نشد"),!1;try{const a=await fetch(`${nt}/api/save`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(e)});if(!a.ok){console.warn(`خطا در ذخیره اطلاعات پروفایل: ${a.status}`);const o=hr();if(o){const l={...o,...e.user};localStorage.setItem("userProfile",JSON.stringify(l))}return!1}return(await a.json()).state===0?(await Zl(),!0):!1}catch(a){console.warn("خطا در ذخیره پروفایل:",a);const s=hr();if(s){const o={...s,...e.user};localStorage.setItem("userProfile",JSON.stringify(o))}return!1}},P6=e=>e?!!(e.name&&e.family&&e.education_level&&e.base):!1,hr=()=>{const e=localStorage.getItem("userProfile");if(!e)return null;try{return JSON.parse(e)}catch{return null}},R6=async()=>{const e=Ga();if(!e)return null;try{const n=await fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${e}`},body:JSON.stringify({get_user_profile_function2:{}})});if(!n.ok)return null;const a=await n.json();if(a.state===0&&a.data){const s=JSON.parse(a.data);return{challenges:s.challenges?JSON.parse(s.challenges):[],coin_transaction:s.coin_transaction?JSON.parse(s.coin_transaction):[],posts:s.posts?JSON.parse(s.posts):[]}}return null}catch{return null}},Sy=v.createContext(void 0);function M6({children:e}){const[n,a]=v.useState(hr()),[s,o]=v.useState(!0),l=async()=>{o(!0);const f=await Zl();a(f),o(!1)};v.useEffect(()=>{l()},[]);const d=P6(n);return u.jsx(Sy.Provider,{value:{profile:n,isProfileComplete:d,isLoading:s,refreshProfile:l},children:e})}function mr(){const e=v.useContext(Sy);if(!e)throw new Error("useProfile must be used within ProfileProvider");return e}const F6=async e=>{const n=Ga();n&&fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${n}`},body:JSON.stringify({user_log_function:{page_title:e}})}).catch(a=>{console.debug("Page log failed:",a)})},Cy=v.createContext(null);function I6({children:e}){const[n,a]=v.useState(null),s=v.useRef(null),o=v.useRef(!0);return v.useEffect(()=>(o.current=!0,s.current=setInterval(()=>{o.current&&n&&!document.hidden&&F6(n)},1e4),()=>{o.current=!1,s.current&&clearInterval(s.current)}),[n]),u.jsx(Cy.Provider,{value:{currentPage:n,setCurrentPage:a},children:e})}function D6(){const e=v.useContext(Cy);if(!e)throw new Error("usePageTrackingContext must be used within PageTrackingProvider");return e}function gr(e){const{setCurrentPage:n}=D6();v.useEffect(()=>(n(e),()=>{n(null)}),[e,n])}const _6=async()=>{const e=Ga();if(!e)return{inbox:[],unreadCount:0};try{const a=await(await fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${e}`},body:JSON.stringify({get_inbox_function:{}})})).json();if(a.state===0&&a.data){const s=JSON.parse(a.data),o=s.inbox?JSON.parse(s.inbox):[],l=o.filter(d=>d.status==="خوانده نشده").length;return{inbox:o,unreadCount:l}}return{inbox:[],unreadCount:0}}catch(n){return console.error("Error loading inbox:",n),{inbox:[],unreadCount:0}}},L6=async e=>{const n=Ga();!n||e.length===0||fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${n}`},body:JSON.stringify({read_inbox_function:{stage_ids:e.join(",")}})}).catch(a=>{console.debug("Mark as read failed:",a)})},jy=v.createContext(null);function A6({children:e}){const[n,a]=v.useState([]),[s,o]=v.useState(0),[l,d]=v.useState(!1),f=v.useCallback(async()=>{d(!0);try{const m=await _6();a(m.inbox),o(m.unreadCount)}catch(m){console.error("Failed to refresh inbox:",m)}finally{d(!1)}},[]),g=v.useCallback(m=>{m.length!==0&&(a(x=>x.map(h=>m.includes(String(h.stageID))?{...h,status:"خوانده شده"}:h)),o(x=>Math.max(0,x-m.length)),L6(m))},[]);return v.useEffect(()=>{f()},[f]),u.jsx(jy.Provider,{value:{messages:n,unreadCount:s,loading:l,refreshInbox:f,markMessagesAsRead:g},children:e})}function Ji(){const e=v.useContext(jy);if(!e)throw new Error("useInbox must be used within InboxProvider");return e}const O6="/assets/login-new-bg-x9sSRPsV.png",B6="/assets/home-bg-C3pbIsUx.jpg",z6="/assets/All%20BG-Bxd0STfA.jpg",Nr=z6,Rn={login:O6,home:B6,profile:Nr,editProfile:Nr,magicBag:Nr,messages:Nr,publicChat:Nr,feed:Nr,challenges:Nr,chatbot:Nr,submitChallenge:Nr};function V6(e){return e==="/"?Rn.home:e.startsWith("/profile")?Rn.profile:e.startsWith("/edit-profile")?Rn.editProfile:e.startsWith("/magic-bag")?Rn.magicBag:e.startsWith("/messages")?Rn.messages:e.startsWith("/public-chat")?Rn.publicChat:Nr}const yg=["۰","۱","۲","۳","۴","۵","۶","۷","۸","۹"],U6=["٠","١","٢","٣","٤","٥","٦","٧","٨","٩"],cl=5,ld={duration:.6,repeat:1/0,repeatType:"mirror",ease:"easeInOut"};function $6(){const e=bn(),n=Ut(),{refreshProfile:a}=mr(),{refreshInbox:s}=Ji();gr("ورود");const[o,l]=v.useState(""),[d,f]=v.useState(""),[g,m]=v.useState("phone"),[x,h]=v.useState(!1),[w,k]=v.useState(0),[j,E]=v.useState(""),[C,I]=v.useState(!1),M=v.useRef(null),_=v.useRef(null),V=v.useRef(null),H=v.useRef(!1);if(v.useEffect(()=>{var P;(P=n.state)!=null&&P.error&&(E(n.state.error),window.history.replaceState({},document.title))},[n]),v.useEffect(()=>{if(g==="code"&&M.current){const P=setTimeout(()=>{var F;(F=M.current)==null||F.focus()},100);return()=>clearTimeout(P)}},[g]),v.useEffect(()=>{if(g==="phone"&&_.current){const P=setTimeout(()=>{var F;(F=_.current)==null||F.focus()},100);return()=>clearTimeout(P)}},[g]),v.useEffect(()=>{g==="code"&&d.length===5&&!x&&!H.current&&(H.current=!0,Y()),d.length<5&&(H.current=!1)},[d,g,x]),v.useEffect(()=>()=>{V.current&&(clearInterval(V.current),V.current=null)},[]),k1()&&!C)return u.jsx(g1,{to:"/",replace:!0});const re=P=>{let F=P;return yg.forEach((U,W)=>{F=F.replace(new RegExp(U,"g"),W.toString())}),U6.forEach((U,W)=>{F=F.replace(new RegExp(U,"g"),W.toString())}),F},O=P=>P.replace(/\d/g,F=>yg[parseInt(F,10)]),b=()=>{V.current&&(clearInterval(V.current),V.current=null)},R=()=>{b(),k(120),V.current=setInterval(()=>{k(P=>P<=1?(b(),0):P-1)},1e3)},N=async P=>{const F=await fetch(`${nt}/api/SignUpLoginBySMS`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8"},body:JSON.stringify(P)}),U=await F.json();return{response:F,result:U}},G=async P=>{P.preventDefault(),h(!0),E("");try{const F=re(o),{response:U,result:W}=await N(F);U.ok&&W.state===0?(m("code"),f(""),H.current=!1,R()):E(W.message||"خطا در ارسال کد تایید")}catch(F){console.error("Error sending code:",F),E("خطا در برقراری ارتباط با سرور")}finally{h(!1)}},Y=async P=>{P==null||P.preventDefault(),h(!0),E("");try{const F=re(o),U=re(d),W=await fetch(`${nt}/api/verifyloginbysms`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mobile:F,code:U})}),T=await W.json();if(W.ok&&T.state===0){I(!0);const A=JSON.parse(T.data);localStorage.setItem("accessToken",A.Token.AccessToken),localStorage.setItem("refreshToken",A.Token.RefreshToken),localStorage.setItem("userId",A.Person.ID.toString()),localStorage.setItem("username",A.Person.ID.toString()),localStorage.setItem("userInfo",JSON.stringify(A.Person)),await a(),await s(),setTimeout(()=>{sessionStorage.setItem("homeEntranceFromLogin","1"),e("/",{replace:!0})},1250)}else H.current=!1,E(T.message||"کد تایید اشتباه است")}catch(F){console.error("Error verifying code:",F),H.current=!1,E("خطا در برقراری ارتباط با سرور")}finally{h(!1)}},X=async()=>{h(!0),E("");try{const P=re(o),{response:F,result:U}=await N(P);F.ok&&U.state===0?(f(""),H.current=!1,R()):E(U.message||"خطا در ارسال مجدد کد")}catch(P){console.error("Error resending code:",P),E("خطا در برقراری ارتباط با سرور")}finally{h(!1)}},K=P=>{const F=Math.floor(P/60),U=P%60;return`${F}:${U.toString().padStart(2,"0")}`},te=()=>{m("phone"),f(""),k(0),E(""),H.current=!1,b()},q=(P,F,U)=>{const W=P.split("");for(;W.length<cl;)W.push("");return W[F]=U,W.join("").slice(0,cl)};return u.jsxs("div",{className:"relative h-[100dvh] overflow-hidden",style:{backgroundImage:`url(${Rn.login})`,backgroundSize:"cover",backgroundPosition:"center -90px",backgroundRepeat:"no-repeat",backgroundColor:"#10053a"},children:[u.jsx("div",{className:"absolute inset-0",style:{background:"linear-gradient(180deg, rgba(22, 10, 62, 0.38) 0%, rgba(24, 10, 64, 0.32) 38%, rgba(22, 8, 58, 0.74) 100%)"}}),u.jsx(pn,{children:C&&u.jsx(se.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.5,ease:"easeInOut"},className:"absolute inset-0 z-50 flex items-center justify-center px-8",style:{background:"radial-gradient(circle at 50% 35%, rgba(195, 114, 255, 0.32) 0%, rgba(53, 22, 102, 0.9) 42%, rgba(19, 8, 54, 0.98) 100%)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)"},children:u.jsxs(se.div,{initial:{opacity:0,y:14,scale:.98},animate:{opacity:1,y:0,scale:1},transition:{duration:.62,ease:[.25,.1,.25,1]},className:"w-full max-w-[280px] rounded-3xl border border-white/20 bg-white/10 p-5 text-center shadow-[0_12px_32px_rgba(0,0,0,0.35)]",children:[u.jsx(se.div,{className:"mx-auto mb-3 h-10 w-10 rounded-full border-2 border-white/25 border-t-white",animate:{rotate:360},transition:{duration:.9,repeat:1/0,ease:"linear"}}),u.jsx("p",{className:"text-base font-semibold text-white",children:"در حال ورود به همدست..."}),u.jsx(se.div,{className:"mx-auto mt-4 h-1.5 w-full overflow-hidden rounded-full bg-white/15",initial:!1,children:u.jsx(se.div,{className:"h-full rounded-full",style:{background:"linear-gradient(90deg, rgba(255,139,91,1) 0%, rgba(238,91,166,1) 45%, rgba(147,78,255,1) 100%)"},initial:{x:"-100%"},animate:{x:"100%"},transition:{duration:1.4,repeat:1/0,ease:"easeInOut"}})})]})})}),u.jsxs("div",{className:"relative z-10 mx-auto flex h-full w-full max-w-[430px] flex-col px-6 pb-8 pt-8 sm:px-7",dir:"rtl",children:[u.jsxs("div",{className:"text-center",children:[u.jsx("img",{src:wy,alt:"همدست",className:"mx-auto h-16 w-auto object-contain"}),u.jsx("p",{className:"mt-1 text-xl font-medium text-white",children:"خوش آمدی قهرمان!"})]}),u.jsxs("section",{className:"mt-auto",children:[u.jsx(pn,{mode:"wait",initial:!1,children:u.jsxs(se.div,{initial:{opacity:0,y:8,scale:.985,filter:"blur(5px)"},animate:{opacity:1,y:0,scale:1,filter:"blur(0px)"},exit:{opacity:0,y:-8,scale:1.015,filter:"blur(5px)"},transition:{duration:.42,ease:[.25,.1,.25,1]},className:"origin-center",children:[u.jsx("h2",{className:"text-center text-[24px] font-bold leading-tight text-white",children:"ورود به حساب کاربری"}),u.jsx("p",{className:"mt-1 text-center text-base text-[#eadfff]",children:g==="phone"?"شماره تلفن خود را وارد کنید":"کد تایید ارسال شده را وارد کنید"})]},`login-copy-${g}`)}),u.jsxs("form",{onSubmit:g==="phone"?G:Y,className:"mt-4 space-y-4",children:[j&&u.jsx("div",{className:"rounded-2xl border border-red-400/40 bg-red-500/20 p-3 text-center text-sm text-red-100",children:j}),u.jsx(pn,{mode:"wait",initial:!1,children:g==="phone"?u.jsx(se.div,{initial:{opacity:0,y:8,filter:"blur(4px)"},animate:{opacity:1,y:0,filter:"blur(0px)"},exit:{opacity:0,y:-8,filter:"blur(4px)"},transition:{duration:.38,ease:"easeInOut"},children:u.jsxs("div",{className:"flex h-14 items-center rounded-full border border-[#d680ff66] px-4",style:{backgroundImage:"linear-gradient(180deg, #2E1B3D 0%, #23183E 100%), linear-gradient(120deg, #7c3aed 0%, #f97316 58%, #facc15 100%)",backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",boxShadow:"0 -7px 20px rgba(7, 0, 18, 0.5), 0 6px 14px rgba(5, 2, 12, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 2px 5px rgba(255, 222, 255, 0.09), inset 0 -2px 0 rgba(12, 7, 27, 0.72), inset 0 -8px 14px rgba(8, 4, 18, 0.34), inset 0 0 0 1px rgba(255, 255, 255, 0.045), inset 0 0 0 2px rgba(17, 10, 35, 0.32)"},dir:"ltr",children:[u.jsxs("button",{type:"button",className:"flex items-center gap-1 text-lg text-white/90",children:[u.jsx("span",{children:"+۹۸"}),u.jsx(Yd,{size:16})]}),u.jsx("div",{className:"mx-3 h-7 w-px bg-white/30"}),u.jsx("input",{id:"phone",type:"tel",inputMode:"numeric",autoFocus:g==="phone",value:O(o),onChange:P=>l(re(P.target.value)),className:"w-full bg-transparent text-left text-lg text-white outline-none placeholder:text-lg placeholder:text-white/45",placeholder:"۹۱۲ ۱۲۳ ۴۵۶۷",required:!0,ref:_}),u.jsx("img",{src:T6,alt:"تلفن",className:"ml-2 h-5 w-5 object-contain opacity-100"})]})},"phone-step"):u.jsxs(se.div,{initial:{opacity:0,y:8,filter:"blur(4px)"},animate:{opacity:1,y:0,filter:"blur(0px)"},exit:{opacity:0,y:-8,filter:"blur(4px)"},transition:{duration:.38,ease:"easeInOut"},children:[u.jsxs("div",{className:"mx-auto mb-2 flex w-[16.5rem] items-center justify-between text-sm text-white/80",children:[u.jsxs("button",{type:"button",onClick:te,className:"flex items-center gap-1 text-[#ffcf7e]",children:[u.jsx(hy,{size:14}),u.jsx("span",{children:"ویرایش شماره تلفن"})]}),u.jsx("span",{children:O(o)})]}),u.jsx("div",{className:"flex justify-center gap-1.5",dir:"ltr",children:Array.from({length:cl},(P,F)=>u.jsx("input",{type:"tel",inputMode:"numeric",pattern:"[0-9]*",maxLength:1,value:O(d[F]||""),onChange:U=>{var T;const W=re(U.target.value);if(W.match(/^[0-9]$/)){if(f(q(d,F,W)),F<cl-1){const A=(T=U.target.parentElement)==null?void 0:T.children[F+1];A==null||A.focus()}}else U.target.value===""&&f(q(d,F,""))},onKeyDown:U=>{var W;if(U.key==="Backspace"){if(d[F])f(q(d,F,""));else if(F>0){f(q(d,F-1,""));const T=(W=U.currentTarget.parentElement)==null?void 0:W.children[F-1];T==null||T.focus()}}},className:"h-13 w-13 rounded-xl border border-[#d680ff66] bg-[#2f1b59]/85 text-center text-2xl text-white outline-none",ref:F===0?M:void 0,autoFocus:g==="code"&&F===0},F))}),u.jsx("div",{className:"mx-auto w-[16.5rem]",children:u.jsx("button",{type:"button",onClick:X,className:"mt-3 text-sm text-[#f7dcff] disabled:opacity-55",disabled:w>0||x,children:w>0?`ارسال دوباره کد (${K(w)})`:"ارسال دوباره کد"})})]},"code-step")}),u.jsx(se.button,{whileTap:{scale:.985},whileHover:{scale:1.01},type:"submit",disabled:x,className:"h-14 w-full rounded-full border border-transparent text-lg font-bold text-white",style:{backgroundImage:"linear-gradient(90deg, rgba(255,139,91,1) 0%, rgba(238,91,166,1) 45%, rgba(147,78,255,1) 100%), linear-gradient(120deg, #7c3aed 0%, #f97316 58%, #facc15 100%)",backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",boxShadow:"0 10px 26px rgba(196, 87, 255, 0.35), inset 0 1px 0 rgba(255,255,255,0.35)"},children:x?u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx("span",{children:"در حال پردازش"}),u.jsxs("span",{className:"inline-flex items-center",dir:"ltr","aria-hidden":"true",children:[u.jsx(se.span,{className:"inline-block",animate:{opacity:[.25,1],y:[0,-2]},transition:{...ld,delay:0},children:"."}),u.jsx(se.span,{className:"inline-block",animate:{opacity:[.25,1],y:[0,-2]},transition:{...ld,delay:.15},children:"."}),u.jsx(se.span,{className:"inline-block",animate:{opacity:[.25,1],y:[0,-2]},transition:{...ld,delay:.3},children:"."})]})]}):g==="phone"?"دریافت کد تایید":"تایید و ورود"})]}),u.jsx("div",{className:"mt-8 rounded-2xl border border-[#db8bff44] bg-[#3a1f67]/48 p-4",children:u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(xy,{className:"h-6 w-6 text-[#f1c0ff]"}),u.jsx("p",{className:"text-sm text-white sm:text-base",children:"اطلاعات شما با استانداردهای ایمنی نرم‌افزار محافظت می‌شود."})]})})]})]})]})}const H6="modulepreload",W6=function(e){return"/"+e},vg={},K6=function(n,a,s){let o=Promise.resolve();if(a&&a.length>0){let d=function(m){return Promise.all(m.map(x=>Promise.resolve(x).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),g=(f==null?void 0:f.nonce)||(f==null?void 0:f.getAttribute("nonce"));o=d(a.map(m=>{if(m=W6(m),m in vg)return;vg[m]=!0;const x=m.endsWith(".css"),h=x?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${h}`))return;const w=document.createElement("link");if(w.rel=x?"stylesheet":H6,x||(w.as="script"),w.crossOrigin="",w.href=m,g&&w.setAttribute("nonce",g),document.head.appendChild(w),x)return new Promise((k,j)=>{w.addEventListener("load",k),w.addEventListener("error",()=>j(new Error(`Unable to preload CSS for ${m}`)))})}))}function l(d){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=d,window.dispatchEvent(f),!f.defaultPrevented)throw d}return o.then(d=>{for(const f of d||[])f.status==="rejected"&&l(f.reason);return n().catch(l)})},Y6="avatarCacheBust",G6=()=>localStorage.getItem(Y6)||"",_t=()=>{const e=localStorage.getItem("accessToken");return e||localStorage.getItem("authToken")},X6=()=>localStorage.getItem("userId"),Ey=e=>{let n=e.message||"خطا در عملیات";return e.data&&typeof e.data=="string"&&/[\u0600-\u06FF]/.test(e.data)&&e.data!==e.message&&(n=`${n}
${e.data}`),n},q6=e=>{try{const n=JSON.parse(e);return JSON.parse(n.feed||"[]")}catch(n){return console.error("Error parsing feed data:",n),[]}},J6=async(e,n=1)=>{const a=_t();if(!a)return{success:!1,data:[],message:"توکن موجود نیست"};try{const o=await(await fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${a}`},body:JSON.stringify({load_feeds_function:{mission_type:e,page_number:n.toString()}})})).json();return o.resultType!==0?{success:!1,data:[],message:o.message}:{success:!0,data:q6(o.data)}}catch(s){return console.error("Error loading feeds:",s),{success:!1,data:[],message:"خطا در بارگذاری فید"}}},Ts=e=>{const n=_t();return`${nt}/api/getimage?stageID=${e}&nameOrID=image&token=${n}`},zl=(e,n)=>{const a=_t(),s=encodeURIComponent(e||"image"),o=encodeURIComponent(G6());return`${nt}/api/getimage?stageID=${n}&nameOrID=image&token=${a}&v=${s}&cb=${o}`},Rs=e=>{const n=_t();return`${nt}/api/getimage?stageID=${e}&nameOrID=image&token=${n}`},Ny=e=>{const n=_t();return`${nt}/api/getFile?stageID=${e}&nameOrID=film&token=${n}`},Ty=e=>{const n=_t();return`${nt}/api/getFile?stageID=${e}&nameOrID=audio&token=${n}`},Q6=e=>X6()===e,bg=async(e,n,a)=>{const s=_t();if(!s){console.error("No auth token found");return}try{fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${s}`},body:JSON.stringify({like_dislike_function:{kind:e,mission_type:n,mission_done_workflowID:a}})}).catch(o=>{console.error("Error submitting like/dislike:",o)})}catch(o){console.error("Error in submitLikeDislike:",o)}},Z6=async(e,n)=>{const a=_t();if(!a){console.error("No auth token found");return}try{fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${a}`},body:JSON.stringify({delete_done_mission_function:{mission_done_workflowID:n,mission_type:e}})}).catch(s=>{console.error("Error deleting post:",s)})}catch(s){console.error("Error in deletePost:",s)}},eC=async(e,n,a,s="")=>{const o=_t();if(!o){console.error("No auth token found");return}try{fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${o}`},body:JSON.stringify({save_comment_function:{mission_type:e,mission_done_workflowID:n,text:a,replay_workflowID:s}})}).catch(l=>{console.error("Error saving comment:",l)})}catch(l){console.error("Error in saveComment:",l)}},tC=async e=>{const n=_t();if(!n)return console.error("No auth token found"),!1;try{const a=await fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${n}`},body:JSON.stringify({delete_comment_function:{comment_id:e}})});return a.ok?(await a.json()).state===0:(console.error("Failed to delete comment"),!1)}catch(a){return console.error("Error deleting comment:",a),!1}},nC=async(e,n=1)=>{const a=_t();if(!a)return console.error("No auth token found"),{comments:[]};try{const s=await fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${a}`},body:JSON.stringify({load_comments_function:{mission_done_workflowID:e,page_number:n.toString()}})}),o=await s.json();if(s.ok&&o.state===0){const l=JSON.parse(o.data);return{comments:JSON.parse(l.comments)}}else return console.error("Error loading comments:",o.message),{comments:[]}}catch(s){return console.error("Error in loadComments:",s),{comments:[]}}},rC=async e=>{const n=_t();if(!n)return console.error("No auth token found"),{missions:[]};try{const a=await fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${n}`},body:JSON.stringify({load_missions_function:{mission_type:e}})}),s=await a.json();if(a.ok&&s.state===0){const o=JSON.parse(s.data);return{missions:JSON.parse(o.missions)}}else return console.error("Error loading missions:",s.message),{missions:[]}}catch(a){return console.error("Error in loadMissions:",a),{missions:[]}}},aC=e=>{const n=_t();return n?`${nt}/api/getimage?stageID=${e}&nameOrID=image&token=${n}`:(console.error("No auth token found for mission image"),"")},sC=async(e,n)=>{const a=_t();if(!a)return console.error("No auth token found"),{doing_mission:null,chats:[]};try{const s=await fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${a}`},body:JSON.stringify({start_mission_function:{mission_type:e,mission_id:n}})}),o=await s.json();if(s.ok&&o.state===0){const l=JSON.parse(o.data),d=JSON.parse(l.doing_mission),f=JSON.parse(l.chats);return{doing_mission:d.length>0?d[0]:null,chats:f}}else return console.error("Error starting mission:",o.message),{doing_mission:null,chats:[]}}catch(s){return console.error("Error in startMission:",s),{doing_mission:null,chats:[]}}},iC=async(e,n)=>{const a=_t();if(console.log("sendChatMessage API called:",{userMessage:e,missionDoneWorkflowID:n,hasToken:!!a}),!a)return console.error("No auth token found"),{success:!1};try{const s={chat_service_function:{user_message:e,mission_done_workflowID:n}};console.log("Sending chat request to server:",JSON.stringify(s));const o=await fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${a}`},body:JSON.stringify(s)}),l=await o.json();if(o.ok&&l.state===0){const d=JSON.parse(l.data),f=Object.keys(d);if(f.length>0){const g=JSON.parse(d[f[0]]);return{success:!0,message:g.message,actions:g.actions,is_mission_end:g.is_mission_end}}return{success:!1}}else return console.error("Error sending chat message:",l.message),{success:!1}}catch(s){return console.error("Error in sendChatMessage:",s),{success:!1}}},Py=async e=>{const n=_t();if(!n)return console.error("No auth token found"),null;try{const a=new FormData;a.append("file",e);const s=new AbortController,o=setTimeout(()=>s.abort(),3e5),l=await fetch(`${nt}/api/UploadFile`,{method:"POST",headers:{Authorization:`Bearer ${n}`},body:a,signal:s.signal});clearTimeout(o);const d=await l.json();return l.ok&&d.state===0?d.data||null:(console.error("Error uploading file:",d.message),null)}catch(a){return a instanceof Error&&a.name==="AbortError"?console.error("Error in uploadFile: Request timeout after 5 minutes"):console.error("Error in uploadFile:",a),null}},Ls=async(e,n={})=>{const a=_t(),{requireResize:s=!1}=n;if(!a)return console.error("uploadImage: No auth token found"),null;try{console.log("uploadImage: Starting upload for file:",e.name,"size:",e.size);const{resizeImage:o}=await K6(async()=>{const{resizeImage:h}=await import("./imageResize-7aJ4C0Tb.js");return{resizeImage:h}},[]);let l=e;try{console.log("uploadImage: Resizing image..."),l=await o(e),console.log("uploadImage: Image resized successfully")}catch(h){if(console.warn("uploadImage: Failed to resize image, uploading original:",h),s)return console.error("uploadImage: Resize is required for this upload. Aborting upload."),null;l=e}const d=new FormData;d.append("file",l),console.log("uploadImage: Sending request to:",`${nt}/api/UploadImage`),console.log("uploadImage: Token:",a.substring(0,20)+"...");const f=new AbortController,g=setTimeout(()=>f.abort(),3e5),m=await fetch(`${nt}/api/UploadImage`,{method:"POST",headers:{Authorization:`Bearer ${a}`},body:d,signal:f.signal});clearTimeout(g),console.log("uploadImage: Response status:",m.status),console.log("uploadImage: Response ok:",m.ok);const x=await m.json();return console.log("uploadImage: Response data:",JSON.stringify(x)),m.ok&&x.state===0?(console.log("uploadImage: Success! Filename:",x.data),x.data||null):(console.error("uploadImage: Error - Message:",x.message,"State:",x.state),null)}catch(o){return o instanceof Error&&o.name==="AbortError"?console.error("Error in uploadImage: Request timeout after 5 minutes"):console.error("Error in uploadImage:",o),null}},ec=async e=>{const n=_t();if(!n)return console.error("No auth token found"),{success:!1,message:"توکن احراز هویت یافت نشد"};try{const a={do_mission_function:{title:e.title||"",mission_type:e.mission_type||"",mission_done_workflowID:e.mission_done_workflowID||"",description:e.description||"",film:e.film||"",image:e.image||"",audio:e.audio||"",team_member:e.team_member||""}};e.enter_code&&(a.do_mission_function.enter_code=e.enter_code);const s=await fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${n}`},body:JSON.stringify(a)}),o=await s.json();if(s.ok&&o.state===0)return{success:!0,message:"ماموریت با موفقیت ثبت شد"};{const l=Ey(o);return console.error("Error submitting mission:",l),{success:!1,message:l}}}catch(a){return console.error("Error in submitMission:",a),{success:!1,message:"خطا در ارتباط با سرور"}}},oC=async(e,n)=>{const a=_t();if(!a)return console.error("No auth token found"),{success:!1,message:"توکن احراز هویت یافت نشد"};try{const s=await fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${a}`},body:JSON.stringify({supervisor_registration_function:{mission_done_workflowID:n,mobile:e}})}),o=await s.json();if(s.ok&&o.state===0)return{success:!0,message:"کد با موفقیت ارسال شد"};{const l=Ey(o);return console.error("Error sending supervisor code:",l),{success:!1,message:l}}}catch(s){return console.error("Error in sendSupervisorCode:",s),{success:!1,message:"خطا در ارتباط با سرور"}}},lC=async()=>{const e=_t();if(!e)return console.error("No auth token found"),{success:!1,data:[],message:"توکن موجود نیست"};try{const a=await(await fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${e}`},body:JSON.stringify({load_magic_bag_mission_function:{}})})).json();if(a.state===0&&a.data){const s=JSON.parse(a.data);return{success:!0,data:JSON.parse(s.magic_bag).filter(d=>d.magic_bag_title)}}else return{success:!1,data:[],message:a.message||"خطا در بارگذاری ماموریت‌ها"}}catch(n){return console.error("Error loading magic bag missions:",n),{success:!1,data:[],message:"خطا در بارگذاری ماموریت‌های کیف جادویی"}}},cd=e=>{const n=_t();return`${nt}/api/getfile?stageID=${e}&nameOrID=magic_bag_file&token=${n}`},cC=e=>{if(!e)return!1;const n=[".jpg",".jpeg",".png",".gif",".bmp",".webp",".svg"],a=e.toLowerCase();return n.some(s=>a.endsWith(s))},Ry=async e=>{const n=_t();if(!n)return console.error("No auth token found"),{success:!1,data:[],message:"توکن موجود نیست"};try{const s=await(await fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${n}`},body:JSON.stringify({load_team_member_function:{team_member:e}})})).json();if(s.state===0&&s.data){const o=JSON.parse(s.data);return{success:!0,data:JSON.parse(o.team_members)}}else return{success:!1,data:[],message:s.message||"خطا در بارگذاری اعضای تیم"}}catch(a){return console.error("Error loading team members:",a),{success:!1,data:[],message:"خطا در بارگذاری اعضای تیم"}}},Ms="/assets/coin-star-ZXR71mmp.png",Jn="/assets/image%205-OPfS95Ik.png",uC=e=>{if(e==null)return"۰";const n="۰۱۲۳۴۵۶۷۸۹";return String(e).replace(/\d/g,a=>n[parseInt(a,10)])};function tc({showBack:e=!1,onBack:n,centerTitle:a,centerSubtitle:s,useNewChatAction:o=!1,onNewChatClick:l}){const d=bn(),{profile:f}=mr(),[g,m]=v.useState(()=>{const E=hr();return(E==null?void 0:E.coin_count)??0});v.useEffect(()=>{(f==null?void 0:f.coin_count)!==null&&(f==null?void 0:f.coin_count)!==void 0&&m(f.coin_count)},[f]);const x=!!(f!=null&&f.image&&(f!=null&&f.user_stage_id)),h=v.useMemo(()=>x?zl(f.image,f.user_stage_id):Jn,[x,f==null?void 0:f.image,f==null?void 0:f.user_stage_id]),w=`${(f==null?void 0:f.name)||""} ${(f==null?void 0:f.family)||""}`.trim()||(f==null?void 0:f.username)||"همراه",k=f!=null&&f.base?`پایه ${f.base}`:(f==null?void 0:f.education_level)||"",j={backgroundImage:`
linear-gradient(180deg, #2E1B3D 0%, #23183E 100%),
linear-gradient(120deg, #7c3aed 0%, #f97316 58%, #facc15 100%)
`,backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",boxShadow:"0 -7px 20px rgba(7, 0, 18, 0.5), 0 6px 14px rgba(5, 2, 12, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 2px 5px rgba(255, 222, 255, 0.09), inset 0 -2px 0 rgba(12, 7, 27, 0.72), inset 0 -8px 14px rgba(8, 4, 18, 0.34), inset 0 0 0 1px rgba(255, 255, 255, 0.045), inset 0 0 0 2px rgba(17, 10, 35, 0.32)",backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)"};return u.jsxs("div",{className:"relative z-20 h-[68px] min-h-[68px] px-4",dir:"rtl",children:[o?u.jsxs("button",{type:"button",onClick:l,className:"absolute left-4 top-1/2 z-20 flex h-10 w-fit -translate-y-1/2 items-center gap-1.5 rounded-full border-[0.5px] border-transparent px-2.5 text-xs font-bold text-white",style:j,"aria-label":"چت جدید",children:[u.jsx(g6,{size:15,color:"#facc15"}),u.jsx("span",{className:"leading-none",children:"چت جدید"})]}):u.jsxs("div",{className:"absolute left-4 top-1/2 z-20 flex h-10 w-fit -translate-y-1/2 items-center gap-[6px] rounded-full border-[0.5px] border-transparent px-2.5",style:j,children:[u.jsx("div",{className:"flex h-5 w-5 items-center justify-center rounded-full border-[0.5px] border-transparent",style:j,children:u.jsx(Vf,{size:11,color:"#ffd6f0",strokeWidth:2.25})}),u.jsx("span",{className:"font-semibold leading-none text-white tracking-tight",style:{fontSize:16},children:uC(g)}),u.jsx("img",{src:Ms,alt:"سکه",className:"-my-0.5 h-7 w-7 object-contain"})]}),e?u.jsx("button",{onClick:n,className:"absolute right-4 top-1/2 z-20 flex h-11 w-11 -translate-y-1/2 items-center justify-center rounded-full border-[0.5px] border-transparent","aria-label":"بازگشت",style:j,children:u.jsx(hy,{size:22,color:"#ffffff"})}):u.jsxs("button",{onClick:()=>d("/profile"),className:"absolute right-4 top-1/2 z-20 flex max-w-[148px] -translate-y-1/2 items-center gap-2 text-right","aria-label":"پروفایل",children:[u.jsx("span",{className:"h-12 w-12 shrink-0 overflow-hidden rounded-full border-[0.5px] border-transparent p-[2px]",style:j,children:x?u.jsx("img",{src:h,alt:"پروفایل",className:"h-full w-full rounded-full object-cover",onError:E=>{E.currentTarget.src=Jn}}):u.jsx("span",{className:"flex h-full w-full items-center justify-center rounded-full",style:j,children:u.jsx("img",{src:Jn,alt:"پروفایل پیش‌فرض",className:"rounded-full object-cover"})})}),u.jsxs("span",{className:"min-w-0 leading-none",children:[u.jsx("span",{className:"block max-w-[86px] truncate text-[12px] font-extrabold leading-4 text-[#FBE7F5]",children:w}),k&&u.jsx("span",{className:"mt-0.5 block max-w-[86px] truncate text-[10px] font-medium leading-3 text-[#F2DFF0]/72",children:k})]})]}),u.jsx("div",{className:"pointer-events-none absolute left-1/2 top-1/2 z-10 flex w-[min(170px,42vw)] -translate-x-1/2 -translate-y-1/2 items-center justify-center text-center",children:a?u.jsxs("div",{className:"w-full",children:[u.jsx("div",{className:"mx-auto max-w-full truncate font-extrabold text-[18px] leading-6",style:{display:"inline-block",background:"linear-gradient(90deg, #F6D8A5 0%, #F3A599 20%, #DB7EB2 48%, #AA6798 72%, #CB75AB 100%)",WebkitBackgroundClip:"text",backgroundClip:"text",WebkitTextFillColor:"transparent",color:"transparent",textShadow:"0 2px 10px rgba(255, 119, 202, 0.4)"},children:a}),s&&u.jsx("div",{className:"mt-0 text-[11px] font-medium",style:{color:"#ffb7dd",textShadow:"0 1px 6px rgba(255, 119, 202, 0.35)"},children:s})]}):u.jsx("img",{src:wy,alt:"مدرسه",className:"h-12 object-contain",style:{filter:"drop-shadow(0 2px 6px rgba(192, 132, 252, 0.55))"}})})]})}const dC={backgroundImage:`
linear-gradient(180deg, #2E1B3D 0%, #23183E 100%),
linear-gradient(120deg, #7c3aed 0%, #f97316 58%, #facc15 100%)
`,backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",border:"0.5px solid transparent",boxShadow:"0 -7px 20px rgba(7, 0, 18, 0.5), 0 6px 14px rgba(5, 2, 12, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 2px 5px rgba(255, 222, 255, 0.09), inset 0 -2px 0 rgba(12, 7, 27, 0.72), inset 0 -8px 14px rgba(8, 4, 18, 0.34), inset 0 0 0 1px rgba(255, 255, 255, 0.045), inset 0 0 0 2px rgba(17, 10, 35, 0.32)",backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)"};function fC({title:e,showBack:n=!1,onBack:a,action:s,onActionClick:o}){const l=e==="اعلان‌ها"||e==="پروفایل"||e==="کیف جادویی";return u.jsxs("header",{className:"app-header relative",children:[u.jsx(tc,{showBack:n,onBack:a,centerTitle:l?e:void 0}),s==="history"&&o&&u.jsx("button",{type:"button",onClick:o,className:"absolute right-[60px] top-1/2 z-30 flex h-10 -translate-y-1/2 items-center rounded-full border-[0.5px] border-transparent px-3 text-[11px] font-bold text-white",style:dC,"aria-label":"تاریخچه چت",children:"تاریخچه"})]})}const My=v.createContext(void 0);function hC({children:e}){const[n,a]=v.useState(!1),s=()=>{a(!0)},o=()=>{a(!1)};return u.jsx(My.Provider,{value:{hasNewItem:n,setHasNewItem:a,addNewItem:s,clearBadge:o},children:e})}function Fy(){const e=v.useContext(My);if(!e)throw new Error("useMagicBag must be used within MagicBagProvider");return e}const pC="/assets/nav-icon-profile-Czwx6ScU.png",mC="/assets/nav-icon-chatbot-CvcoiN6a.png",gC="/assets/nav-icon-bag-BCVFWePV.png",xC="/assets/nav-icon-home-Bhtms1mp.png",yC="/assets/nav-icon-bell-Dd2R6-kz.png",vC=[{id:"chatbot",label:"چت با ربات",path:"/public-chat",icon:mC},{id:"magic-bag",label:"کیف جادویی",path:"/magic-bag",icon:gC},{id:"home",label:"خانه",path:"/",icon:xC},{id:"messages",label:"اعلان‌ها",path:"/messages",icon:yC},{id:"profile",label:"پروفایل",path:"/profile",icon:pC}],bC="drop-shadow(0 0 8px rgba(255, 104, 205, 0.55)) drop-shadow(0 0 14px rgba(255, 104, 205, 0.2))",wC="drop-shadow(0 3px 6px rgba(0, 0, 0, 0.34))",kC="radial-gradient(ellipse at center, rgba(255, 106, 207, 0.22) 0%, rgba(255, 106, 207, 0.08) 56%, transparent 100%)",SC=e=>{if(e>99)return"۹۹+";const n="۰۱۲۳۴۵۶۷۸۹";return String(e).replace(/\d/g,a=>n[parseInt(a,10)])},CC=(e,n,a)=>e==="home"?a==="/":e==="chatbot"?a==="/public-chat"||a.startsWith("/chatbot"):e==="profile"?a==="/profile"||a==="/edit-profile":a===n;function nc({fixed:e=!0}){const n=Ut(),{hasNewItem:a,clearBadge:s}=Fy(),{unreadCount:o}=Ji();return u.jsx("div",{className:e?"app-bottom-nav pointer-events-none fixed bottom-0 left-0 right-0 z-50 w-full transition-opacity duration-200":"bottom-nav app-bottom-nav pointer-events-none w-full transition-opacity duration-200",children:u.jsx("nav",{className:"pointer-events-auto relative mx-auto w-full max-w-[392px] px-1","aria-label":"ناوبری اصلی",style:{paddingBottom:"calc(env(safe-area-inset-bottom, 0px) + 8px)"},children:u.jsx("div",{className:"relative h-[86px] rounded-[999px] border-[0.5px] border-transparent px-1",style:{backgroundImage:`
linear-gradient(180deg, #2E1B3D 0%, #23183E 100%),
linear-gradient(120deg, #7c3aed 0%, #f97316 58%, #facc15 100%)
`,backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",boxShadow:"0 -7px 20px rgba(7, 0, 18, 0.5), 0 6px 14px rgba(5, 2, 12, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 2px 5px rgba(255, 222, 255, 0.09), inset 0 -2px 0 rgba(12, 7, 27, 0.72), inset 0 -8px 14px rgba(8, 4, 18, 0.34), inset 0 0 0 1px rgba(255, 255, 255, 0.045), inset 0 0 0 2px rgba(17, 10, 35, 0.32)",backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)"},children:u.jsx("div",{className:"relative mx-auto grid h-full w-[calc(100%-14px)] grid-cols-5 items-start pt-1.5",dir:"ltr",children:vC.map(l=>{const d=l.id==="magic-bag",f=l.id==="messages"&&o>0;return u.jsx(b1,{to:l.path,end:l.path==="/",onClick:()=>{d&&a&&s()},className:"relative flex h-full min-w-0 flex-col items-center justify-start pb-1 pt-0.5 outline-none","aria-label":l.label,dir:"rtl",children:({isActive:g})=>{const m=g||CC(l.id,l.path,n.pathname);return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"relative",children:[u.jsxs("div",{className:"relative flex h-[37px] w-[37px] items-center justify-center",style:{filter:m?bC:wC},children:[u.jsx("img",{src:l.icon,alt:"",className:"h-[37px] w-[37px] object-contain",style:{opacity:m?1:.92}}),d&&a&&u.jsx("span",{className:"absolute -right-0.5 top-0.5 h-3 w-3 rounded-full border border-white",style:{background:"linear-gradient(135deg, #ff4d66 0%, #d7193f 100%)",boxShadow:"0 0 10px rgba(255, 57, 92, 0.8)"}}),f&&u.jsx("span",{className:"absolute -right-2 -top-1 flex h-5 min-w-5 items-center justify-center rounded-full border border-red-200 px-1 text-[12px] font-bold leading-none text-white",style:{background:"linear-gradient(180deg, #ff403f 0%, #d51d28 100%)",boxShadow:"0 0 12px rgba(255, 58, 70, 0.85)"},children:SC(o)})]}),m&&u.jsx("span",{className:"pointer-events-none absolute left-1/2 top-[39px] h-[12px] w-[40px] -translate-x-1/2 rounded-full",style:{background:kC}})]}),u.jsx("span",{className:"absolute bottom-[14px] left-1/2 block w-[92%] -translate-x-1/2 truncate px-0.5 text-center font-[Alibaba] text-[10px] font-bold leading-4 sm:text-[11px]",style:{opacity:m?1:.92,color:m?"#ff79cf":"#ffd6f0",textShadow:m?"0 0 10px rgba(255, 83, 198, 0.72), 0 2px 4px rgba(0, 0, 0, 0.65)":"0 2px 5px rgba(0, 0, 0, 0.7)"},children:l.label})]})}},l.id)})})})})})}const jC={title:"خانه",showBack:!1,action:"profile"},EC=["/","/public-chat","/magic-bag","/messages","/profile"];function wg(e){return EC.findIndex(n=>e===n||n!=="/"&&e.startsWith(`${n}/`))}const kg={duration:.22,ease:[.22,1,.36,1]};function NC(){const e=Ut(),n=Kb(),a=e.pathname==="/public-chat",s=e.pathname==="/edit-profile",o=e8(),l=v.useRef(e.pathname),d=v.useRef(null),f=v.useMemo(()=>{const h=e.pathname,w=l.current,k=wg(w),j=wg(h);return k!==-1&&j!==-1?j>k?1:j<k?-1:0:0},[e.pathname]);v.useEffect(()=>{var h;l.current=e.pathname,(h=d.current)==null||h.scrollTo({top:0,behavior:"auto"})},[e.pathname]);const g=o?{opacity:0}:f===0?{opacity:0,y:12,scale:.98}:{opacity:0,x:f*32,scale:.98},m=o?{opacity:1}:f===0?{opacity:1,y:0,scale:1}:{opacity:1,x:0,scale:1},x=o?{opacity:0}:f===0?{opacity:0,y:-8,scale:.98}:{opacity:0,x:f*-32,scale:.98};return u.jsx("div",{className:"page-frame",children:u.jsx(pn,{mode:"wait",initial:!1,children:u.jsx(se.div,{className:"page",ref:d,initial:g,animate:m,exit:x,transition:{...kg,duration:o?.12:kg.duration},style:a?{willChange:"opacity, transform",overflowY:"hidden",paddingLeft:"0px",paddingRight:"0px",paddingBottom:"0px"}:s?{willChange:"opacity, transform",paddingBottom:"0px"}:{willChange:"opacity, transform"},children:n},e.pathname)})})}function Ka({position:e="fixed",style:n,zIndex:a=0,imageUrl:s=Rn.home}){return u.jsx("div",{className:`inset-0 w-full ${e==="fixed"?"fixed":"absolute"}`,style:{backgroundImage:`url(${s})`,backgroundSize:"100% auto",backgroundPosition:"top center",backgroundRepeat:"no-repeat",backgroundColor:"#23183E",zIndex:a,...n}})}function TC(){const e=Ut(),n=bn(),a=n5(),s=e.pathname==="/public-chat",o=v.useMemo(()=>{var l;for(let d=a.length-1;d>=0;d-=1){const f=(l=a[d].handle)==null?void 0:l.header;if(f)return f}return jC},[a]);return u.jsxs("div",{className:"app-viewport",children:[u.jsx(Ka,{position:"fixed",zIndex:0,imageUrl:V6(e.pathname)}),u.jsx("div",{className:"app-shell-frame",children:u.jsxs("div",{className:"app-shell",children:[u.jsx(fC,{title:o.title,action:o.action,showBack:!!o.showBack,onBack:o.showBack?()=>n(o.backTo??"/"):void 0,onActionClick:o.action==="history"?()=>window.dispatchEvent(new CustomEvent("public-chat:history")):void 0}),u.jsx(NC,{}),!s&&u.jsx(nc,{fixed:!1})]})})]})}var ul={},Sg;function PC(){if(Sg)return ul;Sg=1,Object.defineProperty(ul,"__esModule",{value:!0});var e=Ul();function n(b){return Array.prototype.slice.call(b)}function a(b,R){var N=Math.floor(b);return N===R||N+1===R?b:R}function s(){return Date.now()}function o(b,R,N){if(R="data-keen-slider-"+R,N===null)return b.removeAttribute(R);b.setAttribute(R,N||"")}function l(b,R){return R=R||document,typeof b=="function"&&(b=b(R)),Array.isArray(b)?b:typeof b=="string"?n(R.querySelectorAll(b)):b instanceof HTMLElement?[b]:b instanceof NodeList?n(b):[]}function d(b){b.raw&&(b=b.raw),b.cancelable&&!b.defaultPrevented&&b.preventDefault()}function f(b){b.raw&&(b=b.raw),b.stopPropagation&&b.stopPropagation()}function g(){var b=[];return{add:function(R,N,G,Y){R.addListener?R.addListener(G):R.addEventListener(N,G,Y),b.push([R,N,G,Y])},input:function(R,N,G,Y){this.add(R,N,(function(X){return function(K){K.nativeEvent&&(K=K.nativeEvent);var te=K.changedTouches||[],q=K.targetTouches||[],P=K.detail&&K.detail.x?K.detail:null;return X({id:P?P.identifier?P.identifier:"i":q[0]?q[0]?q[0].identifier:"e":"d",idChanged:P?P.identifier?P.identifier:"i":te[0]?te[0]?te[0].identifier:"e":"d",raw:K,x:P&&P.x?P.x:q[0]?q[0].screenX:P?P.x:K.pageX,y:P&&P.y?P.y:q[0]?q[0].screenY:P?P.y:K.pageY})}})(G),Y)},purge:function(){b.forEach((function(R){R[0].removeListener?R[0].removeListener(R[2]):R[0].removeEventListener(R[1],R[2],R[3])})),b=[]}}}function m(b,R,N){return Math.min(Math.max(b,R),N)}function x(b){return(b>0?1:0)-(b<0?1:0)||+b}function h(b){var R=b.getBoundingClientRect();return{height:a(R.height,b.offsetHeight),width:a(R.width,b.offsetWidth)}}function w(b,R,N,G){var Y=b&&b[R];return Y==null?N:G&&typeof Y=="function"?Y():Y}function k(b){return Math.round(1e6*b)/1e6}function j(b,R){if(b===R)return!0;var N=typeof b;if(N!==typeof R)return!1;if(N!=="object"||b===null||R===null)return N==="function"&&b.toString()===R.toString();if(b.length!==R.length||Object.getOwnPropertyNames(b).length!==Object.getOwnPropertyNames(R).length)return!1;for(var G in b)if(!j(b[G],R[G]))return!1;return!0}var E=function(){return E=Object.assign||function(b){for(var R,N=1,G=arguments.length;N<G;N++)for(var Y in R=arguments[N])Object.prototype.hasOwnProperty.call(R,Y)&&(b[Y]=R[Y]);return b},E.apply(this,arguments)};function C(b,R,N){for(var G,Y=0,X=R.length;Y<X;Y++)!G&&Y in R||(G||(G=Array.prototype.slice.call(R,0,Y)),G[Y]=R[Y]);return b.concat(G||Array.prototype.slice.call(R))}function I(b){var R,N,G,Y,X,K;function te(W){K||(K=W),q(!0);var T=W-K;T>G&&(T=G);var A=Y[N];if(A[3]<T)return N++,te(W);var ee=A[2],ie=A[4],oe=A[0],ae=A[1]*(0,A[5])(ie===0?1:(T-ee)/ie);if(ae&&b.track.to(oe+ae),T<G)return F();K=null,q(!1),P(null),b.emit("animationEnded")}function q(W){R.active=W}function P(W){R.targetIdx=W}function F(){var W;W=te,X=window.requestAnimationFrame(W)}function U(){var W;W=X,window.cancelAnimationFrame(W),q(!1),P(null),K&&b.emit("animationStopped"),K=null}return R={active:!1,start:function(W){if(U(),b.track.details){var T=0,A=b.track.details.position;N=0,G=0,Y=W.map((function(ee){var ie,oe=Number(A),ae=(ie=ee.earlyExit)!==null&&ie!==void 0?ie:ee.duration,ue=ee.easing,ye=ee.distance*ue(ae/ee.duration)||0;A+=ye;var ve=G;return G+=ae,T+=ye,[oe,ee.distance,ve,G,ee.duration,ue]})),P(b.track.distToIdx(T)),F(),b.emit("animationStarted")}},stop:U,targetIdx:null}}function M(b){var R,N,G,Y,X,K,te,q,P,F,U,W,T,A,ee=1/0,ie=[],oe=null,ae=0;function ue(Re){vt(ae+Re)}function ye(Re){var we=ve(ae+Re).abs;return Ue(we)?we:null}function ve(Re){var we=Math.floor(Math.abs(k(Re/N))),me=k((Re%N+N)%N);me===N&&(me=0);var Fe=x(Re),be=te.indexOf(C([],te).reduce((function(Qe,Ge){return Math.abs(Ge-me)<Math.abs(Qe-me)?Ge:Qe}))),Ae=be;return Fe<0&&we++,be===K&&(Ae=0,we+=Fe>0?1:-1),{abs:Ae+we*K*Fe,origin:be,rel:Ae}}function Ve(Re,we,me){var Fe;if(we||!dt())return je(Re,me);if(!Ue(Re))return null;var be=ve(me??ae),Ae=be.abs,Qe=Re-be.rel,Ge=Ae+Qe;Fe=je(Ge);var rt=je(Ge-K*x(Qe));return(rt!==null&&Math.abs(rt)<Math.abs(Fe)||Fe===null)&&(Fe=rt),k(Fe)}function je(Re,we){if(we==null&&(we=k(ae)),!Ue(Re)||Re===null)return null;Re=Math.round(Re);var me=ve(we),Fe=me.abs,be=me.rel,Ae=me.origin,Qe=yt(Re),Ge=(we%N+N)%N,rt=te[Ae],ht=Math.floor((Re-(Fe-be))/K)*N;return k(rt-Ge-rt+te[Qe]+ht+(Ae===K?N:0))}function Ue(Re){return Oe(Re)===Re}function Oe(Re){return m(Re,P,F)}function dt(){return Y.loop}function yt(Re){return(Re%K+K)%K}function vt(Re){var we;we=Re-ae,ie.push({distance:we,timestamp:s()}),ie.length>6&&(ie=ie.slice(-6)),ae=k(Re);var me=Se().abs;if(me!==oe){var Fe=oe!==null;oe=me,Fe&&b.emit("slideChanged")}}function Se(Re){var we=Re?null:(function(){if(K){var me=dt(),Fe=me?(ae%N+N)%N:ae,be=(me?ae%N:ae)-X[0][2],Ae=0-(be<0&&me?N-Math.abs(be):be),Qe=0,Ge=ve(ae),rt=Ge.abs,ht=Ge.rel,Qt=X[ht][2],Pt=X.map((function(Je,wn){var ft=Ae+Qe;(ft<0-Je[0]||ft>1)&&(ft+=(Math.abs(ft)>N-1&&me?N:0)*x(-ft));var Mn=wn-ht,Te=x(Mn),Ze=Mn+rt;me&&(Te===-1&&ft>Qt&&(Ze+=K),Te===1&&ft<Qt&&(Ze-=K),U!==null&&Ze<U&&(ft+=N),W!==null&&Ze>W&&(ft-=N));var ot=ft+Je[0]+Je[1],it=Math.max(ft>=0&&ot<=1?1:ot<0||ft>1?0:ft<0?Math.min(1,(Je[0]+ft)/Je[0]):(1-ft)/Je[0],0);return Qe+=Je[0]+Je[1],{abs:Ze,distance:Y.rtl?-1*ft+1-Je[0]:ft,portion:it,size:Je[0]}}));return rt=Oe(rt),ht=yt(rt),{abs:Oe(rt),length:G,max:A,maxIdx:F,min:T,minIdx:P,position:ae,progress:me?Fe/N:ae/G,rel:ht,slides:Pt,slidesLength:N}}})();return R.details=we,b.emit("detailsChanged"),we}return R={absToRel:yt,add:ue,details:null,distToIdx:ye,idxToDist:Ve,init:function(Re){if((function(){if(Y=b.options,X=(Y.trackConfig||[]).map((function(be){return[w(be,"size",1),w(be,"spacing",0),w(be,"origin",0)]})),K=X.length){N=k(X.reduce((function(be,Ae){return be+Ae[0]+Ae[1]}),0));var me,Fe=K-1;G=k(N+X[0][2]-X[Fe][0]-X[Fe][2]-X[Fe][1]),te=X.reduce((function(be,Ae){if(!be)return[0];var Qe=X[be.length-1],Ge=be[be.length-1]+(Qe[0]+Qe[2])+Qe[1];return Ge-=Ae[2],be[be.length-1]>Ge&&(Ge=be[be.length-1]),Ge=k(Ge),be.push(Ge),(!me||me<Ge)&&(q=be.length-1),me=Ge,be}),null),G===0&&(q=0),te.push(k(N))}})(),!K)return Se(!0);var we;(function(){var me=b.options.range,Fe=b.options.loop;U=P=Fe?w(Fe,"min",-1/0):0,W=F=Fe?w(Fe,"max",ee):q;var be=w(me,"min",null),Ae=w(me,"max",null);be!==null&&(P=be),Ae!==null&&(F=Ae),T=P===-1/0?P:b.track.idxToDist(P||0,!0,0),A=F===ee?F:Ve(F,!0,0),Ae===null&&(W=F),w(me,"align",!1)&&F!==ee&&X[yt(F)][2]===0&&(A-=1-X[yt(F)][0],F=ye(A-ae)),T=k(T),A=k(A)})(),we=Re,Number(we)===we?ue(je(Oe(Re))):Se()},to:vt,velocity:function(){var Re=s(),we=ie.reduce((function(me,Fe){var be=Fe.distance,Ae=Fe.timestamp;return Re-Ae>200||(x(be)!==x(me.distance)&&me.distance&&(me={distance:0,lastTimestamp:0,time:0}),me.time&&(me.distance+=be),me.lastTimestamp&&(me.time+=Ae-me.lastTimestamp),me.lastTimestamp=Ae),me}),{distance:0,lastTimestamp:0,time:0});return we.distance/we.time||0}}}function _(b){var R,N,G,Y,X,K,te,q;function P(oe){return 2*oe}function F(oe){return m(oe,te,q)}function U(oe){return 1-Math.pow(1-oe,3)}function W(){return G?b.track.velocity():0}function T(){ie();var oe=b.options.mode==="free-snap",ae=b.track,ue=W();Y=x(ue);var ye=b.track.details,ve=[];if(ue||!oe){var Ve=A(ue),je=Ve.dist,Ue=Ve.dur;if(Ue=P(Ue),je*=Y,oe){var Oe=ae.idxToDist(ae.distToIdx(je),!0);Oe&&(je=Oe)}ve.push({distance:je,duration:Ue,easing:U});var dt=ye.position,yt=dt+je;if(yt<X||yt>K){var vt=yt<X?X-dt:K-dt,Se=0,Re=ue;if(x(vt)===Y){var we=Math.min(Math.abs(vt)/Math.abs(je),1),me=(function(Ae){return 1-Math.pow(1-Ae,1/3)})(we)*Ue;ve[0].earlyExit=me,Re=ue*(1-we)}else ve[0].earlyExit=0,Se+=vt;var Fe=A(Re,100),be=Fe.dist*Y;b.options.rubberband&&(ve.push({distance:be,duration:P(Fe.dur),easing:U}),ve.push({distance:-be+Se,duration:500,easing:U}))}b.animator.start(ve)}else b.moveToIdx(F(ye.abs),!0,{duration:500,easing:function(Ae){return 1+--Ae*Ae*Ae*Ae*Ae}})}function A(oe,ae){ae===void 0&&(ae=1e3);var ue=147e-9+(oe=Math.abs(oe))/ae;return{dist:Math.pow(oe,2)/ue,dur:oe/ue}}function ee(){var oe=b.track.details;oe&&(X=oe.min,K=oe.max,te=oe.minIdx,q=oe.maxIdx)}function ie(){b.animator.stop()}b.on("updated",ee),b.on("optionsChanged",ee),b.on("created",ee),b.on("dragStarted",(function(){G=!1,ie(),R=N=b.track.details.abs})),b.on("dragChecked",(function(){G=!0})),b.on("dragEnded",(function(){var oe=b.options.mode;oe==="snap"&&(function(){var ae=b.track,ue=b.track.details,ye=ue.position,ve=x(W());(ye>K||ye<X)&&(ve=0);var Ve=R+ve;ue.slides[ae.absToRel(Ve)].portion===0&&(Ve-=ve),R!==N&&(Ve=N),x(ae.idxToDist(Ve,!0))!==ve&&(Ve+=ve),Ve=F(Ve);var je=ae.idxToDist(Ve,!0);b.animator.start([{distance:je,duration:500,easing:function(Ue){return 1+--Ue*Ue*Ue*Ue*Ue}}])})(),oe!=="free"&&oe!=="free-snap"||T()})),b.on("dragged",(function(){N=b.track.details.abs}))}function V(b){var R,N,G,Y,X,K,te,q,P,F,U,W,T,A,ee,ie,oe,ae,ue=g();function ye(Se){if(K&&q===Se.id){var Re=Ue(Se);if(P){if(!je(Se))return Ve(Se);F=Re,P=!1,b.emit("dragChecked")}if(ie)return F=Re;d(Se);var we=(function(Fe){if(oe===-1/0&&ae===1/0)return Fe;var be=b.track.details,Ae=be.length,Qe=be.position,Ge=m(Fe,oe-Qe,ae-Qe);if(Ae===0)return 0;if(!b.options.rubberband)return Ge;if(Qe<=ae&&Qe>=oe||Qe<oe&&N>0||Qe>ae&&N<0)return Fe;var rt=(Qe<oe?Qe-oe:Qe-ae)/Ae,ht=Y*Ae,Qt=Math.abs(rt*ht),Pt=Math.max(0,1-Qt/X*2);return Pt*Pt*Fe})(te(F-Re)/Y*G);N=x(we);var me=b.track.details.position;(me>oe&&me<ae||me===oe&&N>0||me===ae&&N<0)&&f(Se),U+=we,!W&&Math.abs(U*Y)>5&&(W=!0),b.track.add(we),F=Re,b.emit("dragged")}}function ve(Se){!K&&b.track.details&&b.track.details.length&&(U=0,K=!0,W=!1,P=!0,q=Se.id,je(Se),F=Ue(Se),b.emit("dragStarted"))}function Ve(Se){K&&q===Se.idChanged&&(K=!1,b.emit("dragEnded"))}function je(Se){var Re=Oe(),we=Re?Se.y:Se.x,me=Re?Se.x:Se.y,Fe=T!==void 0&&A!==void 0&&Math.abs(A-me)<=Math.abs(T-we);return T=we,A=me,Fe}function Ue(Se){return Oe()?Se.y:Se.x}function Oe(){return b.options.vertical}function dt(){Y=b.size,X=Oe()?window.innerHeight:window.innerWidth;var Se=b.track.details;Se&&(oe=Se.min,ae=Se.max)}function yt(Se){W&&(f(Se),d(Se))}function vt(){if(ue.purge(),b.options.drag&&!b.options.disabled){var Se;Se=b.options.dragSpeed||1,te=typeof Se=="function"?Se:function(we){return we*Se},G=b.options.rtl?-1:1,dt(),R=b.container,(function(){var we="data-keen-slider-clickable";l("[".concat(we,"]:not([").concat(we,"=false])"),R).map((function(me){ue.add(me,"dragstart",f),ue.add(me,"mousedown",f),ue.add(me,"touchstart",f)}))})(),ue.add(R,"dragstart",(function(we){d(we)})),ue.add(R,"click",yt,{capture:!0}),ue.input(R,"ksDragStart",ve),ue.input(R,"ksDrag",ye),ue.input(R,"ksDragEnd",Ve),ue.input(R,"mousedown",ve),ue.input(R,"mousemove",ye),ue.input(R,"mouseleave",Ve),ue.input(R,"mouseup",Ve),ue.input(R,"touchstart",ve,{passive:!0}),ue.input(R,"touchmove",ye,{passive:!1}),ue.input(R,"touchend",Ve),ue.input(R,"touchcancel",Ve),ue.add(window,"wheel",(function(we){K&&d(we)}));var Re="data-keen-slider-scrollable";l("[".concat(Re,"]:not([").concat(Re,"=false])"),b.container).map((function(we){return(function(me){var Fe;ue.input(me,"touchstart",(function(be){Fe=Ue(be),ie=!0,ee=!0}),{passive:!0}),ue.input(me,"touchmove",(function(be){var Ae=Oe(),Qe=Ae?me.scrollHeight-me.clientHeight:me.scrollWidth-me.clientWidth,Ge=Fe-Ue(be),rt=Ae?me.scrollTop:me.scrollLeft,ht=Ae&&me.style.overflowY==="scroll"||!Ae&&me.style.overflowX==="scroll";if(Fe=Ue(be),(Ge<0&&rt>0||Ge>0&&rt<Qe)&&ee&&ht)return ie=!0;ee=!1,d(be),ie=!1})),ue.input(me,"touchend",(function(){ie=!1}))})(we)}))}}b.on("updated",dt),b.on("optionsChanged",vt),b.on("created",vt),b.on("destroyed",ue.purge)}function H(b){var R,N,G=null;function Y(T,A,ee){b.animator.active?K(T,A,ee):requestAnimationFrame((function(){return K(T,A,ee)}))}function X(){Y(!1,!1,N)}function K(T,A,ee){var ie=0,oe=b.size,ae=b.track.details;if(ae&&R){var ue=ae.slides;R.forEach((function(ye,ve){if(T)!G&&A&&q(ye,null,ee),P(ye,null,ee);else{if(!ue[ve])return;var Ve=ue[ve].size*oe;!G&&A&&q(ye,Ve,ee),P(ye,ue[ve].distance*oe-ie,ee),ie+=Ve}}))}}function te(T){return b.options.renderMode==="performance"?Math.round(T):T}function q(T,A,ee){var ie=ee?"height":"width";A!==null&&(A=te(A)+"px"),T.style["min-"+ie]=A,T.style["max-"+ie]=A}function P(T,A,ee){if(A!==null){A=te(A);var ie=ee?A:0;A="translate3d(".concat(ee?0:A,"px, ").concat(ie,"px, 0)")}T.style.transform=A,T.style["-webkit-transform"]=A}function F(){R&&(K(!0,!0,N),R=null),b.on("detailsChanged",X,!0)}function U(){Y(!1,!0,N)}function W(){F(),N=b.options.vertical,b.options.disabled||b.options.renderMode==="custom"||(G=w(b.options.slides,"perView",null)==="auto",b.on("detailsChanged",X),(R=b.slides).length&&U())}b.on("created",W),b.on("optionsChanged",W),b.on("beforeOptionsChanged",(function(){F()})),b.on("updated",U),b.on("destroyed",F)}function re(b,R){return function(N){var G,Y,X,K,te,q=g();function P(je){var Ue;o(N.container,"reverse",(Ue=N.container,window.getComputedStyle(Ue,null).getPropertyValue("direction")!=="rtl"||je?null:"")),o(N.container,"v",N.options.vertical&&!je?"":null),o(N.container,"disabled",N.options.disabled&&!je?"":null)}function F(){U()&&ie()}function U(){var je=null;if(K.forEach((function(Oe){Oe.matches&&(je=Oe.__media)})),je===G)return!1;G||N.emit("beforeOptionsChanged"),G=je;var Ue=je?X.breakpoints[je]:X;return N.options=E(E({},X),Ue),P(),ve(),Ve(),ae(),!0}function W(je){var Ue=h(je);return(N.options.vertical?Ue.height:Ue.width)/N.size||1}function T(){return N.options.trackConfig.length}function A(je){for(var Ue in G=!1,X=E(E({},R),je),q.purge(),Y=N.size,K=[],X.breakpoints||[]){var Oe=window.matchMedia(Ue);Oe.__media=Ue,K.push(Oe),q.add(Oe,"change",F)}q.add(window,"orientationchange",ye),q.add(window,"resize",ue),U()}function ee(je){N.animator.stop();var Ue=N.track.details;N.track.init(je??(Ue?Ue.abs:0))}function ie(je){ee(je),N.emit("optionsChanged")}function oe(je,Ue){if(je)return A(je),void ie(Ue);ve(),Ve();var Oe=T();ae(),T()!==Oe?ie(Ue):ee(Ue),N.emit("updated")}function ae(){var je=N.options.slides;if(typeof je=="function")return N.options.trackConfig=je(N.size,N.slides);for(var Ue=N.slides,Oe=Ue.length,dt=typeof je=="number"?je:w(je,"number",Oe,!0),yt=[],vt=w(je,"perView",1,!0),Se=w(je,"spacing",0,!0)/N.size||0,Re=vt==="auto"?Se:Se/vt,we=w(je,"origin","auto"),me=0,Fe=0;Fe<dt;Fe++){var be=vt==="auto"?W(Ue[Fe]):1/vt-Se+Re,Ae=we==="center"?.5-be/2:we==="auto"?0:we;yt.push({origin:Ae,size:be,spacing:Se}),me+=be}if(me+=Se*(dt-1),we==="auto"&&!N.options.loop&&vt!==1){var Qe=0;yt.map((function(Ge){var rt=me-Qe;return Qe+=Ge.size+Se,rt>=1||(Ge.origin=1-rt-(me>1?0:1-me)),Ge}))}N.options.trackConfig=yt}function ue(){ve();var je=N.size;N.options.disabled||je===Y||(Y=je,oe())}function ye(){ue(),setTimeout(ue,500),setTimeout(ue,2e3)}function ve(){var je=h(N.container);N.size=(N.options.vertical?je.height:je.width)||1}function Ve(){N.slides=l(N.options.selector,N.container)}N.container=(te=l(b,document)).length?te[0]:null,N.destroy=function(){q.purge(),N.emit("destroyed"),P(!0)},N.prev=function(){N.moveToIdx(N.track.details.abs-1,!0)},N.next=function(){N.moveToIdx(N.track.details.abs+1,!0)},N.update=oe,A(N.options)}}var O=function(b,R,N){try{return(function(G,Y){var X,K={};return X={emit:function(te){K[te]&&K[te].forEach((function(P){P(X)}));var q=X.options&&X.options[te];q&&q(X)},moveToIdx:function(te,q,P){var F=X.track.idxToDist(te,q);if(F){var U=X.options.defaultAnimation;X.animator.start([{distance:F,duration:w(P||U,"duration",500),easing:w(P||U,"easing",(function(W){return 1+--W*W*W*W*W}))}])}},on:function(te,q,P){P===void 0&&(P=!1),K[te]||(K[te]=[]);var F=K[te].indexOf(q);F>-1?P&&delete K[te][F]:P||K[te].push(q)},options:G},(function(){if(X.track=M(X),X.animator=I(X),Y)for(var te=0,q=Y;te<q.length;te++)(0,q[te])(X);X.track.init(X.options.initial||0),X.emit("created")})(),X})(R,C([re(b,{drag:!0,mode:"snap",renderMode:"precision",rubberband:!0,selector:".keen-slider__slide"}),H,V,_],N||[],!0))}catch(G){console.error(G)}};return ul.useKeenSlider=function(b,R){var N=e.useRef(null),G=e.useRef(!1),Y=e.useRef(b),X=e.useCallback((function(K){K?(Y.current=b,N.current=new O(K,b,R),G.current=!1):(N.current&&N.current.destroy&&N.current.destroy(),N.current=null)}),[]);return e.useEffect((function(){j(Y.current,b)||(Y.current=b,N.current&&N.current.update(Y.current))}),[b]),[X,N]},ul}var RC=PC();const Iy={1:{title:"تخته سیاه",serverName:"تخته سیاه",description:"ماموریت‌های آموزشی و خلاقانه",backgroundColor:"#0a1f2e",accentColor:"#8ACEE0",hasFeed:!0},2:{title:"نیمکت",serverName:"نیمکت",description:"لحظات استراحت و گفتگو",backgroundColor:"#0e1a25",accentColor:"#A8D5E2",hasFeed:!0},3:{title:"دفترچه یادداشت",serverName:"دفترچه یادداشت",description:"یادداشت‌ها و خاطرات",backgroundColor:"#1a1f2e",accentColor:"#B8E0F0",hasFeed:!0},4:{title:"دیوار حیاط",serverName:"دیوار حیاط",description:"نقاشی و هنر",backgroundColor:"#0f1f30",accentColor:"#90C8E0",hasFeed:!0},5:{title:"آبخوری",serverName:"آبخوری",description:"تجربه‌های روزانه",backgroundColor:"#1a1530",accentColor:"#A890E0",hasFeed:!0},6:{title:"زنگ ورزش",serverName:"زنگ ورزش",description:"فعالیت‌های ورزشی",backgroundColor:"#0a1f2e",accentColor:"#80D0E0",hasFeed:!0},7:{title:"سه ماه تعطیلی",serverName:"سه ماه تعطیلی",description:"ماجراهای تابستانی",backgroundColor:"#0f1a30",accentColor:"#90D8F0",hasFeed:!1},8:{title:"روزنامه دیواری",serverName:"روزنامه دیواری",description:"اخبار و گزارش‌ها",backgroundColor:"#151a2e",accentColor:"#A0D0E8",hasFeed:!0},9:{title:"زنگ تفریح",serverName:"زنگ تفریح",description:"سرگرمی و بازی",backgroundColor:"#0a1f2e",accentColor:"#8ACEE0",hasFeed:!1}},MC=e=>e&&Iy[e]||null,FC="/assets/takhtesiyah-CZHoAAAB.jpg",IC="/assets/nimkat-erYkVpnh.jpg",DC="/assets/daftarcheyadasht-Cei08k5t.jpg",_C="/assets/divarehayat-CpfZ3_s0.jpg",LC="/assets/abkhori-BLwhFlbe.jpg",AC="/assets/zangvarzsh-iJQNX0Ln.jpg",OC="/assets/semahtatili-CKTx4sxX.jpg",BC="/assets/roznamedivari-D7e7L_HK.jpg",zC="/assets/zangtafrih-YNSka48i.jpg",VC="/assets/takhtesiyah-overlay-D0TInUoR.png",UC="/assets/nimkat-overlay-C8rEc9bN.png",$C="/assets/daftarcheyadasht-overlay-CQxwu2Xs.png",HC="/assets/divarehayat-overlay-DJcovQj8.png",WC="/assets/abkhori-overlay-B1UUEC18.png",KC="/assets/sample-overlay-DE8T3m17.png",YC="/assets/semahtatili-overlay-DuhScTDW.png",GC="/assets/roznamedivari-overlay-Gr9jXnq2.png",XC="/assets/zangtafrih-overlay-3HxwzusR.png",ud="/assets/sample-overlay-DE8T3m17.png",qC=new Set(["7"]),JC={1:FC,2:IC,3:DC,4:_C,5:LC,6:AC,7:OC,8:BC,9:zC},QC={1:i8,2:vy,3:W8,4:G8,5:C8,6:E8,7:k6,8:$8,9:Q8},ZC={1:VC,2:UC,3:$C,4:HC,5:WC,6:KC,7:YC,8:GC,9:XC},ej=e=>{const l=new WeakMap;let d=0,f=!1,g=1;function m(w){return((w+180)%360+360)%360-180}function x(){const w=e.track.details;if(!w)return;const k=360*w.progress,j=360/e.slides.length;if(f){const O=m(k-d);Math.abs(O)>.02&&(g=O>0?1:-1)}d=k,f=!0;const E=k+g*(j*.5);let C=0,I=Number.POSITIVE_INFINITY;e.slides.forEach((O,b)=>{const R=j*b,N=m(R-k),G=Math.abs(N),Y=G<=80,X=O,K=-22,te=G<=12?1:Math.max(0,1-(G-12)/68),q=te*te*(3-2*te),P=m(R-E),F=Math.abs(P);F<I&&(I=F,C=b);const U=1+q*.3,W=23+K,T=l.get(X)??{scale:U,tilt:W},A=T.scale+(U-T.scale)*.22,ee=T.tilt+(W-T.tilt)*.22;l.set(X,{scale:A,tilt:ee}),X.style.transform=`rotateY(${R}deg) translateZ(240px) rotateX(${ee.toFixed(2)}deg) scale(${A.toFixed(3)})`,X.style.setProperty("--ui-counter-tilt",`${(-ee).toFixed(2)}deg`),X.style.opacity=Y?"1":"0",X.style.pointerEvents=Y?"auto":"none"});const M=j*C,_=m(M-k),V=Math.max(0,1-Math.abs(_)/(80*.7)),H=V*V*(3-2*V),re=e.container;re.style.setProperty("--active-overlay-index",`${C}`),re.style.setProperty("--active-overlay-progress",`${H.toFixed(3)}`)}function h(){const w=360*e.track.details.progress;e.container.style.transform=`translateZ(-240px) rotateX(-23deg) rotateY(${-w}deg)`,x()}e.on("created",h),e.on("detailsChanged",h)};function tj(){const e=bn();gr("صفحه اصلی");const[n,a]=v.useState(0),[s,o]=v.useState(0),[l,d]=v.useState(0),f=v.useRef(0),g=v.useRef(0),m=v.useRef(0),x=v.useRef(0),h=v.useRef(0),w=v.useRef(0),k=v.useRef(0),j=v.useRef(1),E=O=>Math.max(0,Math.min(1,O)),C=(O,b)=>b<=0?0:(O%b+b)%b,I=O=>O>.5?O-1:O<-.5?O+1:O,M=O=>O*O*(3-2*O),_=Object.entries(Iy).sort(([O],[b])=>Number(O)-Number(b)).map(([O,b])=>({id:Number(O),topicId:O,title:b.title,subtitle:b.description,Icon:QC[O]||vy,image:JC[O],overlayImage:ZC[O]||ud,disabled:qC.has(O),targetPath:b.hasFeed?`/feed/${O}`:`/challenges/${O}`})),[V]=RC.useKeenSlider({loop:!0,selector:".carousel__item",renderMode:"custom",mode:"free-snap",created(O){const b=O.track.details;if(!b)return;const R=O.slides.length,N=C(b.rel,R);f.current=N,g.current=N,m.current=N,x.current=0,w.current=b.progress*R,h.current=w.current,k.current=b.progress},dragStarted(O){const b=O.track.details;if(!b)return;const R=O.slides.length||1;w.current=b.progress*R,h.current=w.current,k.current=b.progress,O.container.setAttribute("data-drag-start-abs",String(b.abs))},dragEnded(O){const b=O.track.details;if(!b)return;const R=Number.parseFloat(O.container.getAttribute("data-drag-start-abs")||`${b.abs}`),N=b.abs-R;if(Math.abs(N)<=1.05)return;const Y=Math.round(R)+(N>0?1:-1);O.moveToIdx(Y,!0,{duration:360,easing:X=>1-Math.pow(1-X,3)})},animationStarted(O){const b=O.track.details;if(!b)return;const R=O.slides.length||1;w.current=b.progress*R},detailsChanged(O){const b=O.track.details;if(!b)return;const R=O.slides.length;if(!R)return;const N=I(b.progress-k.current);w.current+=N*R;const G=Math.abs(N)>35e-5;if(k.current=b.progress,G&&(j.current=N>0?1:-1),!G&&!O.animator.active){const X=C(b.rel,R);f.current=X,g.current=X,m.current=X,x.current=0,h.current=w.current}else{const X=w.current-Math.floor(w.current),K=X<0?X+1:X,te=j.current>0?K:(1-K)%1,q=0,P=E((te-q)/(1-q)),F=P<=.001?0:P>=.999?1:M(P),U=j.current>0?C(Math.floor(w.current),R):C(Math.ceil(w.current),R),W=C(U+j.current,R);g.current=U,m.current=W,x.current=F,f.current=F>=.999?W:U}const Y=O.container;Y.style.setProperty("--active-overlay-index",String(m.current)),Y.style.setProperty("--active-overlay-progress",x.current.toFixed(3)),a(g.current),o(m.current),d(x.current)}},[ej]),H=v.useMemo(()=>{var O;return((O=_[n])==null?void 0:O.overlayImage)||ud},[_,n]),re=v.useMemo(()=>{var O;return((O=_[s])==null?void 0:O.overlayImage)||ud},[_,s]);return u.jsx("div",{className:"home-page",dir:"rtl",children:u.jsx("div",{className:"home-carousel-wrapper",children:u.jsxs("div",{className:"home-carousel-scene",children:[u.jsxs("div",{className:"home-carousel-floating-overlay",style:{"--floating-progress":l.toFixed(3)},"aria-hidden":"true",children:[u.jsx("img",{src:H,alt:"",className:"home-carousel-floating-overlay-image home-carousel-floating-overlay-image--out"}),u.jsx("img",{src:re,alt:"",className:"home-carousel-floating-overlay-image home-carousel-floating-overlay-image--in"})]}),u.jsx("div",{className:"home-carousel keen-slider",ref:V,dir:"ltr",children:_.map((O,b)=>u.jsx("div",{className:`carousel__item number-slide${b%6+1}`,children:u.jsxs("button",{type:"button",onClick:()=>!O.disabled&&e(O.targetPath),disabled:O.disabled,className:"carousel__cell",style:{cursor:O.disabled?"not-allowed":"pointer"},dir:"rtl",children:[u.jsx("span",{className:"home-carousel-icon-badge","aria-hidden":"true",children:u.jsx(O.Icon,{size:20,strokeWidth:2})}),u.jsxs("div",{className:"home-carousel-text",children:[u.jsx("span",{className:"home-carousel-label",children:O.disabled?`🔒 ${O.title}`:O.title}),u.jsx("span",{className:"home-carousel-subtitle",children:O.subtitle})]}),u.jsx("img",{src:O.image,alt:O.title,className:"home-carousel-image",loading:"eager"})]})},O.id))})]})})})}const nj="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODgiIGhlaWdodD0iODgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjMDAwIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBvcGFjaXR5PSIuMyIgZmlsbD0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIzLjciPjxyZWN0IHg9IjE2IiB5PSIxNiIgd2lkdGg9IjU2IiBoZWlnaHQ9IjU2IiByeD0iNiIvPjxwYXRoIGQ9Im0xNiA1OCAxNi0xOCAzMiAzMiIvPjxjaXJjbGUgY3g9IjUzIiBjeT0iMzUiIHI9IjciLz48L3N2Zz4KCg==";function xa(e){const{fallbackSrc:n,...a}=e,[s,o]=v.useState(!1),l=()=>{o(!0)},{src:d,alt:f,style:g,className:m,...x}=a,h=n||nj;return s?u.jsx("div",{className:`inline-block bg-gray-100 text-center align-middle ${m??""}`,style:g,children:u.jsx("div",{className:"flex items-center justify-center w-full h-full",children:u.jsx("img",{src:h,alt:"Error loading image",...x,"data-original-url":d})})}):u.jsx("img",{src:d,alt:f,className:m,style:g,...x,onError:l})}function rj({isOpen:e,onClose:n,comments:a,postAuthor:s,onAddComment:o,onDeleteComment:l,hasMoreComments:d=!1,isLoadingMoreComments:f=!1,onLoadMoreComments:g}){const[m,x]=v.useState(""),[h,w]=v.useState(null),[k,j]=v.useState(a),[E,C]=v.useState(null),{isProfileComplete:I,profile:M}=mr(),_=bn(),V=v.useMemo(()=>M!=null&&M.image&&(M!=null&&M.user_stage_id)?zl(M.image,M.user_stage_id):Jn,[M==null?void 0:M.image,M==null?void 0:M.user_stage_id]);v.useEffect(()=>{j(a)},[a]),v.useEffect(()=>{const O=document.documentElement,b=document.body,R=b.style.overflow,N=b.style.touchAction,G=b.style.overscrollBehavior,Y=O.style.overflow,X=O.style.touchAction,K=O.style.overscrollBehavior;return e?(b.style.overflow="hidden",b.style.touchAction="none",b.style.overscrollBehavior="none",O.style.overflow="hidden",O.style.touchAction="none",O.style.overscrollBehavior="none",b.classList.add("comments-modal-open")):(b.style.overflow=R,b.style.touchAction=N,b.style.overscrollBehavior=G,O.style.overflow=Y,O.style.touchAction=X,O.style.overscrollBehavior=K,b.classList.remove("comments-modal-open")),()=>{b.style.overflow=R,b.style.touchAction=N,b.style.overscrollBehavior=G,O.style.overflow=Y,O.style.touchAction=X,O.style.overscrollBehavior=K,b.classList.remove("comments-modal-open")}},[e]);const H=()=>{m.trim()&&(o(m,h==null?void 0:h.id),x(""),w(null))},re=({comment:O,isReply:b=!1,parentId:R})=>{const N=(M==null?void 0:M.user_stage_id)===O.userStageId;return u.jsx("div",{className:`${b?"mr-12 mt-3":""}`,dir:"rtl",children:u.jsxs("div",{className:"flex gap-3 items-start",children:[u.jsx("div",{className:"w-8 h-8 rounded-full overflow-hidden flex-shrink-0",style:{border:"2px solid rgba(138, 206, 224, 0.3)"},children:u.jsx(xa,{src:O.authorAvatar,alt:O.author,className:"w-full h-full object-cover",fallbackSrc:Jn})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[u.jsx("span",{className:"text-sm font-bold text-white",children:O.author}),O.author===s&&u.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full",style:{background:"rgba(138, 206, 224, 0.2)",color:"#8ACEE0",border:"1px solid rgba(138, 206, 224, 0.3)"},children:"نویسنده"}),u.jsx("span",{className:"text-xs text-gray-400",children:O.timestamp})]}),u.jsx("p",{className:"text-sm text-white leading-relaxed mb-2",children:O.text}),u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsx("button",{onClick:()=>w({id:O.id,author:O.author}),className:"text-xs font-bold text-gray-400 hover:text-gray-200 transition-colors",children:"پاسخ"}),N&&l&&u.jsxs("button",{onClick:()=>C(O.id),className:"text-xs font-bold text-red-400 hover:text-red-300 transition-colors flex items-center gap-1",children:[u.jsx(yy,{className:"w-3.5 h-3.5"}),u.jsx("span",{children:"حذف"})]})]}),O.replies&&O.replies.length>0&&u.jsx("div",{className:"mt-3 space-y-3",children:O.replies.map(G=>u.jsx(re,{comment:G,isReply:!0,parentId:O.id},G.id))})]})]})})};return typeof document>"u"?null:uf.createPortal(u.jsx(pn,{children:e&&u.jsxs(u.Fragment,{children:[u.jsx(se.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:n,className:"fixed inset-0 bg-black/60 z-[120] backdrop-blur-sm"}),u.jsxs(se.div,{initial:{y:"100%"},animate:{y:0},exit:{y:"100%"},transition:{type:"spring",damping:30,stiffness:300},className:"fixed left-0 right-0 z-[121] rounded-t-3xl overflow-hidden flex flex-col max-w-md mx-auto",style:{background:"linear-gradient(180deg, rgba(46, 27, 61, 0.98) 0%, rgba(35, 24, 62, 0.98) 100%)",border:"1px solid rgba(255, 170, 224, 0.22)",bottom:"env(safe-area-inset-bottom, 0px)",maxHeight:"min(82dvh, 760px)",height:"min(82dvh, 760px)"},children:[u.jsxs("div",{className:"sticky top-0 z-10 px-4 py-3 flex items-center justify-between flex-shrink-0",style:{background:"rgba(46, 27, 61, 0.94)",borderBottom:"1px solid rgba(255, 170, 224, 0.2)"},dir:"rtl",children:[u.jsx("div",{className:"absolute top-2 left-1/2 -translate-x-1/2 w-12 h-1 rounded-full bg-gray-600"}),u.jsx("h2",{className:"text-white font-bold text-base mt-3",children:"نظرات"}),u.jsx("button",{onClick:n,className:"w-8 h-8 rounded-full flex items-center justify-center mt-3",style:{background:"rgba(255, 170, 224, 0.1)"},children:u.jsx(_s,{className:"w-5 h-5 text-gray-300"})})]}),u.jsx("div",{className:"comments-scroll flex-1 overflow-y-auto px-4 py-4 space-y-4",style:{scrollbarWidth:"thin",scrollbarColor:"rgba(255, 170, 224, 0.3) transparent"},children:k.length===0?u.jsxs("div",{className:"flex flex-col items-center justify-center py-16",children:[u.jsx("div",{className:"w-16 h-16 rounded-full flex items-center justify-center mb-3",style:{background:"rgba(138, 206, 224, 0.1)",border:"2px solid rgba(138, 206, 224, 0.2)"},children:u.jsx("svg",{className:"w-8 h-8",style:{color:"#8ACEE0"},fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})})}),u.jsx("p",{className:"text-gray-400 text-sm",children:"هنوز نظری ثبت نشده است"}),u.jsx("p",{className:"text-gray-500 text-xs mt-1",children:"اولین نفری باشید که نظر می‌دهد"})]}):u.jsxs(u.Fragment,{children:[k.map(O=>u.jsx(re,{comment:O},O.id)),d&&u.jsx("div",{className:"pt-2 text-center",children:u.jsx(se.button,{whileTap:{scale:f?1:.97},onClick:g,disabled:f,className:"px-4 py-2 rounded-full text-xs font-bold text-white",style:{background:"linear-gradient(135deg, rgba(96, 147, 157, 0.9) 0%, rgba(76, 127, 137, 0.9) 100%)",border:"1px solid rgba(138, 206, 224, 0.3)",opacity:f?.65:1,cursor:f?"not-allowed":"pointer"},children:f?"در حال بارگذاری...":"نمایش نظرات بیشتر"})})]})}),u.jsx("div",{className:"sticky bottom-0 px-4 py-3 flex-shrink-0",style:{background:"rgba(46, 27, 61, 0.9)",borderTop:"1px solid rgba(255, 170, 224, 0.2)",paddingBottom:"calc(env(safe-area-inset-bottom, 0px) + 10px)"},dir:"rtl",children:I?u.jsxs(u.Fragment,{children:[h&&u.jsxs("div",{className:"mb-2 px-3 py-2 rounded-lg flex items-center justify-between",style:{background:"rgba(138, 206, 224, 0.1)",border:"1px solid rgba(138, 206, 224, 0.2)"},children:[u.jsxs("span",{className:"text-xs text-gray-300",children:["در حال پاسخ به ",u.jsx("span",{style:{color:"#8ACEE0"},children:h.author})]}),u.jsx("button",{onClick:()=>w(null),className:"text-gray-400 hover:text-white",children:u.jsx(_s,{className:"w-4 h-4"})})]}),u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx("div",{className:"w-8 h-8 rounded-full flex-shrink-0 overflow-hidden",style:{background:"linear-gradient(135deg, rgba(138, 206, 224, 0.4) 0%, rgba(62, 121, 131, 0.4) 100%)",border:"1.5px solid rgba(138, 206, 224, 0.5)"},children:u.jsx(xa,{src:V,alt:"پروفایل من",className:"w-full h-full object-cover",fallbackSrc:Jn})}),u.jsx("input",{type:"text",value:m,onChange:O=>x(O.target.value),onKeyPress:O=>O.key==="Enter"&&H(),placeholder:h?`پاسخ به ${h.author}...`:"نظر خود را بنویسید...",className:"flex-1 px-4 py-2.5 rounded-full text-white placeholder-gray-400 outline-none transition-all",style:{fontSize:16,background:"rgba(32, 76, 106, 0.3)",border:"1.5px solid rgba(138, 206, 224, 0.3)"},onFocus:O=>{O.target.style.border="1.5px solid rgba(138, 206, 224, 0.6)",O.target.style.boxShadow="0 0 15px rgba(138, 206, 224, 0.3)"},onBlur:O=>{O.target.style.border="1.5px solid rgba(138, 206, 224, 0.3)",O.target.style.boxShadow="none"}}),m.trim()&&u.jsx(se.button,{initial:{scale:0},animate:{scale:1},exit:{scale:0},whileTap:{scale:.9},onClick:H,className:"px-4 py-2.5 rounded-full text-sm font-bold text-white flex-shrink-0",style:{background:"linear-gradient(135deg, #FFB800 0%, #FF9500 100%)",boxShadow:"0 4px 15px rgba(255, 165, 0, 0.4)"},children:"ارسال"})]})]}):u.jsxs("div",{className:"px-4 py-3 rounded-2xl flex items-center justify-between gap-3",style:{background:"rgba(255, 184, 0, 0.1)",border:"1.5px solid rgba(255, 184, 0, 0.3)"},children:[u.jsx("p",{className:"text-sm text-gray-300 flex-1",children:"برای ثبت نظر، ابتدا پروفایل خود را تکمیل کنید"}),u.jsx(se.button,{whileTap:{scale:.95},onClick:()=>{n(),_("/profile")},className:"px-4 py-2 rounded-full text-xs font-bold text-white flex-shrink-0",style:{background:"linear-gradient(135deg, #FFB800 0%, #FF9500 100%)",boxShadow:"0 2px 8px rgba(255, 165, 0, 0.4)"},children:"تکمیل پروفایل"})]})})]}),u.jsx(pn,{children:E&&u.jsx(se.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[130] flex items-center justify-center p-4",style:{backgroundColor:"rgba(0, 0, 0, 0.7)"},onClick:()=>C(null),children:u.jsxs(se.div,{initial:{scale:.9,y:20},animate:{scale:1,y:0},exit:{scale:.9,y:20},onClick:O=>O.stopPropagation(),className:"w-full max-w-md rounded-3xl overflow-hidden",style:{background:"linear-gradient(180deg, rgba(32, 76, 106, 0.98) 0%, rgba(20, 40, 60, 0.98) 100%)",border:"2px solid rgba(138, 206, 224, 0.3)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.5)"},children:[u.jsx("div",{className:"px-6 py-4 border-b",style:{borderColor:"rgba(138, 206, 224, 0.2)"},children:u.jsx("h3",{className:"text-lg font-bold text-center",style:{color:"#FFFFFF",textShadow:"0 2px 4px rgba(0, 0, 0, 0.3)"},children:"تایید حذف نظر"})}),u.jsx("div",{className:"p-6",dir:"rtl",children:u.jsxs("p",{className:"text-base text-center leading-relaxed",style:{color:"#FFFFFF",textShadow:"0 1px 2px rgba(0, 0, 0, 0.3)"},children:["آیا مطمئن هستید که می‌خواهید این نظر را حذف کنید؟",u.jsx("br",{}),u.jsx("span",{className:"text-sm text-gray-400 mt-2 block",children:"تمام پاسخ‌های این نظر نیز حذف خواهند شد."})]})}),u.jsxs("div",{className:"px-6 py-4 flex gap-3",dir:"rtl",children:[u.jsx(se.button,{whileTap:{scale:.95},onClick:()=>C(null),className:"flex-1 py-3 rounded-full font-bold text-white",style:{background:"linear-gradient(135deg, rgba(96, 96, 96, 0.9) 0%, rgba(64, 64, 64, 0.9) 100%)",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.3)"},children:"انصراف"}),u.jsx(se.button,{whileTap:{scale:.95},onClick:()=>{l&&l(E),C(null)},className:"flex-1 py-3 rounded-full font-bold text-white",style:{background:"linear-gradient(135deg, #ef4444 0%, #dc2626 100%)",boxShadow:"0 4px 12px rgba(239, 68, 68, 0.4)"},children:"حذف نظر"})]})]})})})]})}),document.body)}const Cg="data:image/svg+xml,%3csvg%20width='21'%20height='20'%20viewBox='0%200%2021%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%3e%3cpath%20d='M8.93014%206.45563C9.0872%206.31265%209.35273%206.12763%209.53076%205.98322C9.99282%205.60838%2010.4265%205.26103%2010.8381%204.82861C11.0691%204.58506%2011.2862%204.32893%2011.4884%204.06143C11.7709%203.68056%2011.9337%203.35265%2012.3173%203.04952C13.3709%202.21679%2014.2244%203.15344%2014.1072%204.27919C14.0171%205.14458%2013.7154%205.97962%2013.3158%206.739C13.1517%207.09648%2012.934%207.46294%2012.7408%207.80523C12.6635%207.94209%2012.5018%208.16931%2012.4512%208.30253C12.4927%208.42366%2012.7696%208.38337%2012.883%208.38297L13.4778%208.38304L15.4332%208.38323C15.7122%208.38288%2016.1319%208.36986%2016.3939%208.40266C16.8968%208.47021%2017.3516%208.7341%2017.6573%209.13565C17.9692%209.54186%2018.1046%2010.0547%2018.0335%2010.5603C17.9883%2010.8864%2017.7542%2011.4364%2017.6293%2011.7668L16.9186%2013.639L16.2115%2015.5076C16.0861%2015.8391%2015.961%2016.1948%2015.8168%2016.5163C15.6907%2016.7852%2015.5055%2017.002%2015.2755%2017.1858C14.688%2017.655%2014.0365%2017.5913%2013.336%2017.5914L11.6134%2017.5915L9.85324%2017.5913C9.59195%2017.5913%209.33116%2017.5919%209.06951%2017.5876C8.44789%2017.5776%207.91102%2017.303%207.52476%2016.8163C7.04223%2016.2083%207.13643%2015.5001%207.13651%2014.7746L7.13673%2012.6306L7.13682%2010.2716C7.13673%209.84315%207.11446%209.21564%207.17638%208.81556C7.30178%208.00526%207.83312%207.36588%208.44282%206.85042C8.59578%206.72111%208.76661%206.57232%208.93014%206.45563Z'%20fill='url(%23paint0_linear_69_15)'/%3e%3cpath%20d='M8.93014%206.45563C9.0872%206.31265%209.35273%206.12763%209.53076%205.98322C9.99282%205.60838%2010.4265%205.26103%2010.8381%204.82861C11.0691%204.58506%2011.2862%204.32893%2011.4884%204.06143C11.7709%203.68056%2011.9337%203.35265%2012.3173%203.04952C13.3709%202.21679%2014.2244%203.15344%2014.1072%204.27919C14.0171%205.14458%2013.7154%205.97962%2013.3158%206.739C13.1517%207.09648%2012.934%207.46294%2012.7408%207.80523C12.6635%207.94209%2012.5018%208.16931%2012.4512%208.30253C12.4927%208.42366%2012.7696%208.38337%2012.883%208.38297L13.4778%208.38304L15.4332%208.38323C15.7122%208.38288%2016.1319%208.36986%2016.3939%208.40266C16.8968%208.47021%2017.3516%208.7341%2017.6573%209.13565C17.9692%209.54186%2018.1046%2010.0547%2018.0335%2010.5603C17.9883%2010.8864%2017.7542%2011.4364%2017.6293%2011.7668L16.9186%2013.639L16.2115%2015.5076C16.0861%2015.8391%2015.961%2016.1948%2015.8168%2016.5163C15.6907%2016.7852%2015.5055%2017.002%2015.2755%2017.1858C14.688%2017.655%2014.0365%2017.5913%2013.336%2017.5914L11.6134%2017.5915L9.85324%2017.5913C9.59195%2017.5913%209.33116%2017.5919%209.06951%2017.5876C8.44789%2017.5776%207.91102%2017.303%207.52476%2016.8163C7.04223%2016.2083%207.13643%2015.5001%207.13651%2014.7746L7.13673%2012.6306L7.13682%2010.2716C7.13673%209.84315%207.11446%209.21564%207.17638%208.81556C7.30178%208.00526%207.83312%207.36588%208.44282%206.85042C8.59578%206.72111%208.76661%206.57232%208.93014%206.45563Z'%20fill='url(%23paint1_linear_69_15)'/%3e%3c/g%3e%3cg%3e%3cpath%20d='M3.64002%207.50399C4.59494%207.41054%205.45108%208.17183%205.46613%209.11963C5.46828%209.25479%205.47569%209.38642%205.47559%209.52292L5.47482%2010.1911L5.47518%2012.468L5.47589%2014.7783L5.47625%2015.4611C5.47625%2015.634%205.47708%2015.8864%205.45247%2016.057C5.41099%2016.3528%205.29285%2016.6329%205.10959%2016.87C4.81986%2017.2507%204.41411%2017.4334%203.94826%2017.4977C3.49341%2017.5368%203.07863%2017.42%202.71922%2017.1354C2.38499%2016.8709%202.15171%2016.4572%202.10737%2016.0359C2.08908%2015.862%202.09373%2015.6472%202.09388%2015.4695L2.09431%2014.6733L2.09488%2012.0786L2.09506%2010.0008C2.09485%209.33049%202.00446%208.64776%202.47734%208.09594C2.78563%207.73621%203.16914%207.55069%203.64002%207.50399Z'%20fill='url(%23paint2_linear_69_15)'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_69_15'%20x1='15.0323'%20y1='17.6016'%20x2='10.1059'%20y2='4.60476'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2C6C4'/%3e%3cstop%20offset='0.614493'%20stop-color='%23D7ABBE'/%3e%3cstop%20offset='1'%20stop-color='%23BD8EAF'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_69_15'%20x1='15.0323'%20y1='17.6016'%20x2='10.1059'%20y2='4.60476'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2C6C4'/%3e%3cstop%20offset='0.614493'%20stop-color='%23D7ABBE'/%3e%3cstop%20offset='1'%20stop-color='%23BD8EAF'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_69_15'%20x1='4.53955'%20y1='17.51'%20x2='-0.371472'%20y2='11.5417'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2C6C4'/%3e%3cstop%20offset='0.614493'%20stop-color='%23D7ABBE'/%3e%3cstop%20offset='1'%20stop-color='%23BD8EAF'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",aj="data:image/svg+xml,%3csvg%20width='21'%20height='20'%20viewBox='0%200%2021%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.26151%207.04808C2.36271%206.64226%202.55803%206.19349%202.76705%205.83249C3.43492%204.67778%204.54195%203.83661%205.84047%203.49717C6.16362%203.41264%206.49438%203.35989%206.82797%203.3397C7.26517%203.31378%207.86835%203.33109%208.32121%203.33123L11.018%203.33111L13.0919%203.33118C13.578%203.33125%2014.1163%203.31349%2014.5938%203.38011C15.2393%203.47522%2015.8603%203.69267%2016.4229%204.02056C17.5546%204.68065%2018.3824%205.75166%2018.7308%207.00651C18.7754%207.22104%2018.8471%207.45922%2018.8665%207.67816C18.951%208.63431%2018.8882%209.607%2018.9074%2010.5667C18.9102%2010.7055%2018.9063%2010.8529%2018.8975%2010.9909C18.8426%2011.868%2018.5556%2012.7155%2018.0654%2013.4478C17.3301%2014.549%2016.1835%2015.3155%2014.878%2015.5787C14.2122%2015.7139%2013.6255%2015.6778%2012.9552%2015.6812C12.7386%2015.6823%2012.4033%2015.6699%2012.2037%2015.7035C12.0322%2015.7322%2011.694%2015.9027%2011.52%2015.9831L10.9278%2016.2519L7.8034%2017.6647L6.98947%2018.0321C6.85271%2018.0937%206.70771%2018.165%206.56733%2018.2151C6.53514%2018.2265%206.48044%2018.2428%206.4576%2018.2214C6.43628%2018.2013%206.40266%2018.1859%206.40648%2018.1532C6.42422%2018.0011%206.56988%2017.74%206.63335%2017.6061L7.17221%2016.4669C7.27297%2016.2575%207.37978%2016.0495%207.46758%2015.8343C7.5379%2015.6619%207.38007%2015.681%207.26229%2015.6794C7.19601%2015.6784%207.12854%2015.6812%207.06227%2015.6801C6.6308%2015.672%206.20201%2015.6108%205.78577%2015.4978C4.09155%2015.03%202.76592%2013.7208%202.28812%2012.0432C2.1831%2011.6869%202.12063%2011.3196%202.10196%2010.9489C2.07901%2010.4156%202.10022%209.81715%202.09531%209.27816C2.09064%208.76609%202.08243%208.22179%202.13015%207.71449C2.15306%207.47102%202.21758%207.27584%202.26151%207.04808Z'%20fill='url(%23paint0_linear_69_4)'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_69_4'%20x1='14.2617'%20y1='18.2393'%20x2='10.7933'%20y2='4.18829'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2C6C4'/%3e%3cstop%20offset='0.614493'%20stop-color='%23D7ABBE'/%3e%3cstop%20offset='1'%20stop-color='%23BD8EAF'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e";function Dy({id:e,authorName:n,authorAvatar:a,image:s,title:o,caption:l,likes:d,dislikes:f,comments:g,timestamp:m,initialComments:x,mediaType:h="image",mediaUrl:w,isOwnPost:k=!1,initialLikeState:j="",missionType:E,workflowID:C,onDelete:I,teamMemberIds:M,preloadedTeamMembers:_}){const H={border:"1px solid transparent",backgroundImage:"linear-gradient(180deg, rgba(46, 27, 61, 0.95) 0%, rgba(35, 24, 62, 0.93) 100%), linear-gradient(120deg, rgba(124, 58, 237, 0.72) 0%, rgba(249, 115, 22, 0.56) 58%, rgba(250, 204, 21, 0.42) 100%)",backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",boxShadow:"0 -9px 24px rgba(7, 0, 18, 0.52), 0 14px 30px rgba(5, 2, 12, 0.42), 0 0 20px rgba(255, 121, 207, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.24), inset 0 2px 6px rgba(255, 222, 255, 0.1), inset 0 -2px 0 rgba(12, 7, 27, 0.72), inset 0 -10px 18px rgba(8, 4, 18, 0.36), inset 0 0 0 1px rgba(255, 255, 255, 0.06), inset 0 0 0 2px rgba(17, 10, 35, 0.34)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)"},[re,O]=v.useState(d),[b,R]=v.useState(f),N=()=>j==="پسند"?"liked":j==="عدم پسند"?"disliked":null,[G,Y]=v.useState(N()),[X,K]=v.useState(!1),[te,q]=v.useState(!1),[P,F]=v.useState(!1),[U,W]=v.useState(x||[]),[T,A]=v.useState(!1),[ee,ie]=v.useState(!1),[oe,ae]=v.useState(!1),[ue,ye]=v.useState(!1),[ve,Ve]=v.useState(1),[je,Ue]=v.useState(!1),[Oe,dt]=v.useState(_||[]),[yt,vt]=v.useState(!1),{isProfileComplete:Se}=mr(),Re=bn(),we=Te=>{const Ze=it=>Te.filter(gt=>gt.parent===it).map(gt=>({id:gt.comment_id,author:gt.full_name,authorAvatar:Ts(gt.user_stage_id),text:gt.comment_text,timestamp:gt.datetimee,likes:0,isLiked:!1,userStageId:gt.user_stage_id,replies:Ze(gt.comment_id)}));return Te.filter(it=>!it.parent).map(it=>({id:it.comment_id,author:it.full_name,authorAvatar:Ts(it.user_stage_id),text:it.comment_text,timestamp:it.datetimee,likes:0,isLiked:!1,userStageId:it.user_stage_id,replies:Ze(it.comment_id)}))},me=async(Te,Ze)=>{if(C){Ze?ye(!0):ae(!0);try{const ot=await nC(C,Te),it=we(ot.comments);Ue(ot.comments.length>=25),Ve(Te),W(Zt=>Ze?[...Zt,...it]:it)}catch(ot){console.error("Error loading comments:",ot)}finally{ae(!1),ye(!1)}}};v.useEffect(()=>{X&&C&&me(1,!1)},[X,C]),v.useEffect(()=>{_&&dt(_)},[_]),v.useEffect(()=>{_||M&&M.trim()&&!yt&&(vt(!0),Ry(M).then(Te=>{Te.success&&dt(Te.data)}).catch(Te=>{console.error("Error loading team members:",Te)}).finally(()=>{vt(!1)}))},[M,yt,_]);const Fe=()=>{if(!Se){A(!0);return}let Te;G==="liked"?(O(re-1),Y(null),Te="حذف"):(G==="disliked"&&R(b-1),O(re+1),Y("liked"),Te="پسند"),E&&C&&bg(Te,E,C)},be=()=>{if(!Se){A(!0);return}let Te;G==="disliked"?(R(b-1),Y(null),Te="حذف"):(G==="liked"&&O(re-1),R(b+1),Y("disliked"),Te="عدم پسند"),E&&C&&bg(Te,E,C)},Ae=(Te,Ze)=>{if(!Se){A(!0);return}E&&C&&(eC(E,C,Te,Ze||""),setTimeout(()=>{me(1,!1)},500))},Qe=()=>{ue||oe||!je||me(ve+1,!0)},Ge=Te=>{tC(Te);const Ze=ot=>ot.filter(it=>it.id===Te?!1:(it.replies&&it.replies.length>0&&(it.replies=Ze(it.replies)),!0));W(ot=>Ze(ot))},rt=U.map(Te=>({id:Te.id,author:Te.author,authorAvatar:Te.authorAvatar||Jn,text:Te.text,timestamp:Te.timestamp||"الان",likes:Te.likes||0,isLiked:Te.isLiked||!1,userStageId:Te.userStageId,replies:Te.replies||[]})),ht=Te=>{const Ze=["۰","۱","۲","۳","۴","۵","۶","۷","۸","۹"];return Te.toString().split("").map(ot=>Ze[parseInt(ot)]).join("")},Pt=(Te=>{if(!Te)return"لحظاتی پیش";const Ze=new Date(Te);if(Number.isNaN(Ze.getTime()))return"لحظاتی پیش";const ot=Date.now()-Ze.getTime();if(ot<=0)return"لحظاتی پیش";const it=60*1e3,Zt=60*it,gt=24*Zt,xr=7*gt,an=30*gt;return ot<Zt?`${ht(Math.max(1,Math.floor(ot/it)))} دقیقه پیش`:ot<gt?`${ht(Math.floor(ot/Zt))} ساعت پیش`:ot<an?`${ht(Math.floor(ot/xr))} هفته پیش`:`${ht(Math.floor(ot/an))} ماه پیش`})(m),Je={border:"0.6px solid rgba(255, 205, 236, 0.085)",background:"linear-gradient(130deg, rgba(255, 255, 255, 0.035) 0%, rgba(255, 255, 255, 0.0075) 32%, rgba(160, 106, 224, 0.05) 100%), linear-gradient(180deg, rgba(88, 52, 126, 0.09) 0%, rgba(48, 31, 85, 0.075) 100%)",boxShadow:"inset 0 1px 0 rgba(255, 255, 255, 0.07), inset 0 -1px 0 rgba(45, 24, 70, 0.13), inset 0 0 16px rgba(188, 131, 255, 0.04), 0 8px 22px rgba(8, 3, 18, 0.085)",backdropFilter:"blur(12px) saturate(108%)",WebkitBackdropFilter:"blur(12px) saturate(108%)"},wn={border:"0.6px solid rgba(255, 140, 220, 0.38)",background:"linear-gradient(130deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 32%, rgba(255, 121, 207, 0.12) 100%), linear-gradient(180deg, rgba(88, 52, 126, 0.16) 0%, rgba(48, 31, 85, 0.13) 100%)",boxShadow:"inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 -1px 0 rgba(45, 24, 70, 0.16), inset 0 0 18px rgba(255, 121, 207, 0.16), 0 0 14px rgba(255, 121, 207, 0.2)"},ft={border:"0.6px solid rgba(255, 140, 220, 0.38)",background:"linear-gradient(130deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 32%, rgba(255, 121, 207, 0.12) 100%), linear-gradient(180deg, rgba(88, 52, 126, 0.16) 0%, rgba(48, 31, 85, 0.13) 100%)",boxShadow:"inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 -1px 0 rgba(45, 24, 70, 0.16), inset 0 0 18px rgba(255, 121, 207, 0.16), 0 0 14px rgba(255, 121, 207, 0.2)"},Mn={border:"0.6px solid rgba(255, 205, 236, 0.085)",background:"linear-gradient(130deg, rgba(255, 255, 255, 0.035) 0%, rgba(255, 255, 255, 0.0075) 32%, rgba(160, 106, 224, 0.05) 100%), linear-gradient(180deg, rgba(88, 52, 126, 0.09) 0%, rgba(48, 31, 85, 0.075) 100%)",boxShadow:"inset 0 1px 0 rgba(255, 255, 255, 0.07), inset 0 -1px 0 rgba(45, 24, 70, 0.13), inset 0 0 16px rgba(188, 131, 255, 0.04), 0 8px 22px rgba(8, 3, 18, 0.085)",backdropFilter:"blur(12px) saturate(108%)",WebkitBackdropFilter:"blur(12px) saturate(108%)"};return u.jsxs(se.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"mb-4",children:[u.jsxs("div",{className:"feed-panel rounded-3xl overflow-hidden",style:H,children:[u.jsx("div",{className:"flex items-start px-4 pt-4 pb-2",dir:"rtl",children:u.jsxs("div",{className:"flex items-start gap-2",children:[u.jsx("div",{className:"w-12 h-12 rounded-full overflow-hidden flex-shrink-0",style:{border:"1px solid rgba(255, 170, 224, 0.82)",boxShadow:"0 0 12px rgba(255, 121, 207, 0.35)"},children:u.jsx(xa,{src:a,alt:n,className:"w-full h-full object-cover",fallbackSrc:Jn})}),u.jsxs("div",{className:"pt-0",children:[u.jsx("h3",{className:"font-bold text-[18px] leading-6 text-right text-white",children:n}),u.jsx("p",{className:"text-[11px] font-normal text-right text-white/75",children:Pt})]})]})}),u.jsxs("div",{className:"px-4 pb-3",dir:"rtl",children:[u.jsx("h3",{className:"font-semibold mb-1 text-[14px]",style:{color:"#ffd6f0",textShadow:"0 2px 4px rgba(0, 0, 0, 0.6)"},children:o}),u.jsx("p",{className:"text-white leading-relaxed text-[12px]",style:{display:"-webkit-box",WebkitLineClamp:te?"unset":4,WebkitBoxOrient:"vertical",overflow:"hidden"},children:l}),l.length>150&&u.jsx("button",{onClick:()=>q(!te),className:"text-xs mt-1",style:{color:"#ff9be0"},children:te?"کمتر":"بیشتر"})]}),u.jsx("div",{className:"px-4 pb-3",children:u.jsx("div",{className:"relative w-full rounded-3xl overflow-hidden",style:{background:"linear-gradient(180deg, rgba(47, 27, 66, 0.92) 0%, rgba(34, 22, 58, 0.9) 100%)",boxShadow:"0 4px 16px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 121, 207, 0.1)",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(10, 20, 35, 0.5)"},children:h==="video"?u.jsx("video",{src:w,poster:s,controls:!0,playsInline:!0,className:"w-full h-auto cursor-pointer block",style:{objectFit:"contain",display:"block"}}):h==="audio"?u.jsxs("div",{className:"w-full",children:[s&&u.jsx(xa,{src:s,alt:"کاور صوت",className:"w-full h-auto max-h-[600px] mb-4",style:{objectFit:"contain"}}),u.jsx("audio",{src:w,controls:!0,className:"w-full",style:{background:"rgba(255, 255, 255, 0.1)",borderRadius:"12px"}})]}):u.jsx(xa,{src:s,alt:"پست",className:"w-full h-auto max-h-[600px]",style:{objectFit:"contain"}})})}),u.jsx("div",{className:"mx-[14px] mb-[10px] mt-1",dir:"rtl",children:u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsxs(se.button,{whileTap:{scale:.9},onClick:Fe,className:"flex items-center gap-2 px-3 py-1.5 rounded-full transition-all min-w-[30px] justify-center",style:G==="liked"?{...Je,...wn}:Je,children:[u.jsx("img",{src:Cg,alt:"",className:"w-5 h-5 object-contain",style:{filter:G==="liked"?"saturate(1.28) hue-rotate(-8deg) brightness(1.08) drop-shadow(0 0 6px rgba(255, 121, 207, 0.6))":"none",transition:"filter 60ms linear"}}),u.jsx("span",{className:"text-sm font-bold min-w-[20px] text-center",style:{color:"#FFFFFF",textShadow:"0 1px 2px rgba(0, 0, 0, 0.3)"},children:ht(re)})]}),u.jsxs(se.button,{whileTap:{scale:.9},onClick:be,className:"flex items-center gap-2 px-3 py-1.5 rounded-full transition-all min-w-[30px] justify-center",style:G==="disliked"?{...Je,...ft}:Je,children:[u.jsx("img",{src:Cg,alt:"",className:"w-5 h-5 object-contain rotate-180",style:{filter:G==="disliked"?"saturate(1.28) hue-rotate(-8deg) brightness(1.08) drop-shadow(0 0 6px rgba(255, 121, 207, 0.6))":"none",transition:"filter 60ms linear"}}),u.jsx("span",{className:"text-sm font-bold min-w-[20px] text-center",style:{color:"#FFFFFF",textShadow:"0 1px 2px rgba(0, 0, 0, 0.3)"},children:ht(b)})]})]}),u.jsx("div",{className:"flex items-center",children:u.jsxs(se.button,{whileTap:{scale:.9},onClick:()=>K(!X),className:"flex items-center gap-2 px-3 py-1.5 rounded-full transition-all min-w-[30px] justify-center",style:Je,children:[u.jsx("img",{src:aj,alt:"",className:"w-5 h-5 object-contain",style:{filter:X?"drop-shadow(0 0 6px rgba(255, 121, 207, 0.6))":"none",transition:"filter 120ms ease"}}),u.jsx("span",{className:"text-sm font-bold min-w-[20px] text-center",style:{color:"#FFFFFF",textShadow:"0 1px 2px rgba(0, 0, 0, 0.3)"},children:ht(g)})]})})]})}),Oe.length>0&&u.jsxs("div",{className:"mx-[14px] mb-[16px] rounded-full px-4 py-2.5 flex items-center justify-between",style:Mn,dir:"rtl",children:[u.jsxs("button",{type:"button",onClick:()=>F(!0),className:"flex items-center gap-2",children:[u.jsxs("div",{className:"flex -space-x-2",dir:"ltr",children:[Oe.slice(0,3).map(Te=>u.jsx("div",{className:"w-8 h-8 rounded-full overflow-hidden",style:{boxShadow:"0 2px 8px rgba(0, 0, 0, 0.28)"},children:u.jsx(xa,{src:Ts(Te.StageID.toString()),alt:Te.full_name,className:"w-full h-full object-cover",fallbackSrc:Jn})},Te.StageID)),Oe.length>3&&u.jsxs("div",{className:"w-8 h-8 rounded-full flex items-center justify-center text-[11px] font-bold text-white",style:{background:"rgba(255, 121, 207, 0.35)"},children:["+",ht(Oe.length-3)]})]}),u.jsx("div",{className:"text-[#ffd6f0] text-[14px] whitespace-nowrap",children:"همکاری‌کنندگان"})]}),u.jsx(fy,{size:18,color:"#ffd6f0"})]})]}),u.jsx(rj,{isOpen:X,onClose:()=>K(!1),comments:rt,postAuthor:n,onAddComment:Ae,onDeleteComment:Ge,hasMoreComments:je,isLoadingMoreComments:ue,onLoadMoreComments:Qe}),u.jsx(pn,{children:P&&Oe.length>0&&u.jsx(se.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-50 flex items-center justify-center p-4",style:{backgroundColor:"rgba(0, 0, 0, 0.7)"},onClick:()=>F(!1),children:u.jsxs(se.div,{initial:{scale:.9,y:20},animate:{scale:1,y:0},exit:{scale:.9,y:20},onClick:Te=>Te.stopPropagation(),className:"w-full max-w-md rounded-3xl overflow-hidden",style:{background:"linear-gradient(180deg, rgba(46, 27, 61, 0.98) 0%, rgba(35, 24, 62, 0.98) 100%)",border:"1px solid rgba(255, 170, 224, 0.4)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.5)",backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)",maxHeight:"80vh"},children:[u.jsx("div",{className:"px-6 py-4 border-b",style:{borderColor:"rgba(255, 170, 224, 0.2)"},children:u.jsxs("h3",{className:"text-lg font-bold text-center",style:{color:"#FFFFFF",textShadow:"0 2px 4px rgba(0, 0, 0, 0.3)"},children:["مشارکت‌کنندگان (",ht(Oe.length)," نفر)"]})}),u.jsx("div",{className:"overflow-y-auto p-4",style:{maxHeight:"60vh"},children:u.jsx("div",{className:"space-y-3",children:Oe.map((Te,Ze)=>u.jsxs(se.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:Ze*.05},className:"flex items-center gap-3 p-3 rounded-2xl",style:{background:"linear-gradient(135deg, rgba(85, 48, 121, 0.4) 0%, rgba(48, 31, 85, 0.4) 100%)",border:"1px solid rgba(255, 170, 224, 0.2)"},dir:"rtl",children:[u.jsx("div",{className:"w-12 h-12 rounded-full overflow-hidden flex-shrink-0",style:{boxShadow:"0 2px 8px rgba(0, 0, 0, 0.3)"},children:u.jsx(xa,{src:Ts(Te.StageID.toString()),alt:Te.full_name,className:"w-full h-full object-cover",fallbackSrc:Jn})}),u.jsx("div",{className:"flex-1",children:u.jsx("h4",{className:"font-bold text-base",style:{color:"#FFFFFF",textShadow:"0 1px 2px rgba(0, 0, 0, 0.3)"},children:Te.full_name})})]},Te.StageID))})}),u.jsx("div",{className:"px-6 py-4",children:u.jsx(se.button,{whileTap:{scale:.95},onClick:()=>F(!1),className:"w-full py-3 rounded-full font-bold text-white",style:{background:"linear-gradient(135deg, rgba(255, 121, 207, 0.9) 0%, rgba(124, 58, 237, 0.85) 100%)",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.3)"},children:"بستن"})})]})})}),u.jsx(pn,{children:T&&u.jsx(se.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-50 flex items-center justify-center p-4",style:{backgroundColor:"rgba(0, 0, 0, 0.7)"},onClick:()=>A(!1),children:u.jsxs(se.div,{initial:{scale:.9,y:20},animate:{scale:1,y:0},exit:{scale:.9,y:20},onClick:Te=>Te.stopPropagation(),className:"w-full max-w-md rounded-3xl overflow-hidden",style:{background:"linear-gradient(180deg, rgba(32, 76, 106, 0.98) 0%, rgba(20, 40, 60, 0.98) 100%)",border:"2px solid rgba(138, 206, 224, 0.3)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.5)",maxHeight:"80vh"},children:[u.jsx("div",{className:"px-6 py-4 border-b",style:{borderColor:"rgba(138, 206, 224, 0.2)"},children:u.jsx("h3",{className:"text-lg font-bold text-center",style:{color:"#FFFFFF",textShadow:"0 2px 4px rgba(0, 0, 0, 0.3)"},children:"اخطار"})}),u.jsx("div",{className:"p-6",dir:"rtl",children:u.jsx("p",{className:"text-base text-center leading-relaxed",style:{color:"#FFFFFF",textShadow:"0 1px 2px rgba(0, 0, 0, 0.3)"},children:"برای لایک، دیس‌لایک یا نظر دادن به پست‌ها، ابتدا باید پروفایل خود را تکمیل کنید."})}),u.jsxs("div",{className:"px-6 py-4 flex gap-3",dir:"rtl",children:[u.jsx(se.button,{whileTap:{scale:.95},onClick:()=>A(!1),className:"flex-1 py-3 rounded-full font-bold text-white",style:{background:"linear-gradient(135deg, rgba(96, 96, 96, 0.9) 0%, rgba(64, 64, 64, 0.9) 100%)",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.3)"},children:"بستن"}),u.jsx(se.button,{whileTap:{scale:.95},onClick:()=>{A(!1),Re("/profile")},className:"flex-1 py-3 rounded-full font-bold text-white",style:{background:"linear-gradient(135deg, #FFB800 0%, #FF9500 100%)",boxShadow:"0 4px 12px rgba(255, 165, 0, 0.4)"},children:"تکمیل پروفایل"})]})]})})}),u.jsx(pn,{children:ee&&u.jsx(se.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-50 flex items-center justify-center p-4",style:{backgroundColor:"rgba(0, 0, 0, 0.7)"},onClick:()=>ie(!1),children:u.jsxs(se.div,{initial:{scale:.9,y:20},animate:{scale:1,y:0},exit:{scale:.9,y:20},onClick:Te=>Te.stopPropagation(),className:"w-full max-w-md rounded-3xl overflow-hidden",style:{background:"linear-gradient(180deg, rgba(32, 76, 106, 0.98) 0%, rgba(20, 40, 60, 0.98) 100%)",border:"2px solid rgba(138, 206, 224, 0.3)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.5)",maxHeight:"80vh"},children:[u.jsx("div",{className:"px-6 py-4 border-b",style:{borderColor:"rgba(138, 206, 224, 0.2)"},children:u.jsx("h3",{className:"text-lg font-bold text-center",style:{color:"#FFFFFF",textShadow:"0 2px 4px rgba(0, 0, 0, 0.3)"},children:"تایید حذف"})}),u.jsx("div",{className:"p-6",dir:"rtl",children:u.jsx("p",{className:"text-base text-center leading-relaxed",style:{color:"#FFFFFF",textShadow:"0 1px 2px rgba(0, 0, 0, 0.3)"},children:"آیا مطمئن هستید که می‌خواهید این پست را حذف کنید؟"})}),u.jsxs("div",{className:"px-6 py-4 flex gap-3",dir:"rtl",children:[u.jsx(se.button,{whileTap:{scale:.95},onClick:()=>ie(!1),className:"flex-1 py-3 rounded-full font-bold text-white",style:{background:"linear-gradient(135deg, rgba(96, 96, 96, 0.9) 0%, rgba(64, 64, 64, 0.9) 100%)",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.3)"},children:"انصراف"}),u.jsx(se.button,{whileTap:{scale:.95},onClick:()=>{E&&C&&Z6(E,C),ie(!1),I&&e&&I(e)},className:"flex-1 py-3 rounded-full font-bold text-white",style:{background:"linear-gradient(135deg, #ef4444 0%, #dc2626 100%)",boxShadow:"0 4px 12px rgba(239, 68, 68, 0.4)"},children:"حذف"})]})]})})})]})}const sj=["https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=400&q=80","https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=400&q=80","https://images.unsplash.com/photo-1527980965255-d3b416303d12?w=400&q=80","https://images.unsplash.com/photo-1438761681033-6461ffad8d80?w=400&q=80","https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=400&q=80","https://images.unsplash.com/photo-1500648767791-00dcc994a43e?w=400&q=80","https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=400&q=80","https://images.unsplash.com/photo-1506794778202-cad84cf45f1d?w=400&q=80","https://images.unsplash.com/photo-1554151228-14d9def656e4?w=400&q=80","https://images.unsplash.com/photo-1522075469751-3a6694fb2f61?w=400&q=80","https://images.unsplash.com/photo-1517841905240-472988babdf9?w=400&q=80","https://images.unsplash.com/photo-1542909168-82c3e7fdca5c?w=400&q=80"];function ij({isOpen:e,onClose:n,onSelectAvatar:a,currentAvatar:s}){const[o,l]=v.useState(null),[d,f]=v.useState(null),[g,m]=v.useState(null),[x,h]=v.useState(!1),w=v.useRef(null),k=E=>{var I;const C=(I=E.target.files)==null?void 0:I[0];if(C){m(C);const M=new FileReader;M.onloadend=()=>{const _=M.result;f(_),l(_)},M.readAsDataURL(C)}},j=async()=>{if(console.log("handleConfirm called"),console.log("selectedAvatar:",o),console.log("uploadedImageFile:",g),!!o){h(!0);try{let E=g;if(!g&&o.startsWith("http")){console.log("Downloading suggested avatar from URL:",o);try{const I=await(await fetch(o)).blob(),M=`avatar_${Date.now()}.jpg`;E=new File([I],M,{type:I.type||"image/jpeg"}),console.log("Downloaded file:",E.name,E.size)}catch(C){console.error("Error downloading suggested avatar:",C),alert("خطا در دانلود تصویر. لطفاً دوباره تلاش کنید."),h(!1);return}}if(E){console.log("Starting image upload...",E.name);const C=await Ls(E,{requireResize:!0});console.log("Upload result:",C),C?(console.log("Sending filename to parent:",C),a(C),n()):(console.error("Upload returned null filename"),alert("خطا در آپلود تصویر. لطفاً دوباره تلاش کنید."))}else console.error("No file to upload"),alert("لطفاً یک تصویر انتخاب کنید.")}catch(E){console.error("Error in handleConfirm:",E),alert("خطا در آپلود تصویر. لطفاً دوباره تلاش کنید.")}finally{h(!1)}}};return u.jsx(pn,{children:e&&u.jsx(se.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[100] flex items-center justify-center p-4",style:{backgroundColor:"rgba(0, 0, 0, 0.8)"},onClick:n,children:u.jsxs(se.div,{initial:{scale:.9,y:20},animate:{scale:1,y:0},exit:{scale:.9,y:20},onClick:E=>E.stopPropagation(),className:"w-full max-w-md rounded-3xl overflow-hidden",style:{background:"linear-gradient(180deg, rgba(32, 76, 106, 0.98) 0%, rgba(20, 40, 60, 0.98) 100%)",border:"2px solid rgba(138, 206, 224, 0.3)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.5)",maxHeight:"85vh"},children:[u.jsxs("div",{className:"px-6 py-4 border-b flex items-center justify-between",style:{borderColor:"rgba(138, 206, 224, 0.2)"},children:[u.jsx("h3",{className:"text-lg font-bold",style:{color:"#FFFFFF",textShadow:"0 2px 4px rgba(0, 0, 0, 0.3)"},children:"انتخاب عکس پروفایل"}),u.jsx(se.button,{whileTap:{scale:.9},onClick:n,className:"w-8 h-8 rounded-full flex items-center justify-center",style:{background:"linear-gradient(135deg, rgba(239, 68, 68, 0.9) 0%, rgba(220, 38, 38, 0.9) 100%)",boxShadow:"0 2px 8px rgba(239, 68, 68, 0.4)"},children:u.jsx(_s,{className:"w-5 h-5 text-white"})})]}),u.jsxs("div",{className:"overflow-y-auto p-6",style:{maxHeight:"calc(85vh - 180px)"},children:[u.jsxs("div",{className:"mb-6",children:[u.jsx("h4",{className:"text-sm font-bold mb-3",style:{color:"#8ACEE0",textShadow:"0 1px 2px rgba(0, 0, 0, 0.3)"},children:"آپلود عکس شخصی"}),u.jsx("input",{ref:w,type:"file",accept:"image/*",onChange:k,className:"hidden"}),u.jsxs(se.button,{whileTap:{scale:.95},onClick:()=>{var E;return(E=w.current)==null?void 0:E.click()},className:"w-full py-4 rounded-2xl font-bold text-sm flex items-center justify-center gap-2",style:{background:"linear-gradient(135deg, rgba(96, 147, 157, 0.9) 0%, rgba(76, 127, 137, 0.9) 100%)",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1)",border:"2px solid rgba(138, 206, 224, 0.3)",color:"#FFFFFF",textShadow:"0 2px 4px rgba(0, 0, 0, 0.3)"},children:[u.jsx(Uf,{className:"w-5 h-5"}),u.jsx("span",{children:"انتخاب از گالری"})]}),d&&u.jsx(se.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},className:"mt-4 flex justify-center",children:u.jsx("div",{className:"w-24 h-24 rounded-full overflow-hidden",style:{border:"3px solid rgba(138, 206, 224, 0.5)",boxShadow:"0 4px 16px rgba(138, 206, 224, 0.4), inset 0 -4px 12px rgba(0, 0, 0, 0.3)"},children:u.jsx("img",{src:d,alt:"آپلود شده",className:"w-full h-full object-cover"})})})]}),u.jsxs("div",{children:[u.jsx("h4",{className:"text-sm font-bold mb-3",style:{color:"#8ACEE0",textShadow:"0 1px 2px rgba(0, 0, 0, 0.3)"},children:"عکس‌های پیشنهادی"}),u.jsx("div",{className:"grid grid-cols-4 gap-3",children:sj.map((E,C)=>u.jsxs(se.button,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:C*.05},whileTap:{scale:.9},onClick:()=>{l(E),f(null),m(null)},className:"aspect-square rounded-full overflow-hidden relative",style:{border:o===E?"3px solid rgba(255, 193, 7, 0.8)":"2px solid rgba(138, 206, 224, 0.3)",boxShadow:o===E?"0 4px 16px rgba(255, 193, 7, 0.6), inset 0 0 20px rgba(255, 193, 7, 0.2)":"0 2px 8px rgba(0, 0, 0, 0.3)"},children:[u.jsx("img",{src:E,alt:`آواتار ${C+1}`,className:"w-full h-full object-cover"}),o===E&&u.jsx(se.div,{initial:{scale:0},animate:{scale:1},className:"absolute inset-0 flex items-center justify-center",style:{background:"rgba(255, 193, 7, 0.3)"},children:u.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center",style:{background:"linear-gradient(135deg, rgba(255, 193, 7, 0.95) 0%, rgba(255, 152, 0, 0.95) 100%)",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.4)"},children:u.jsx(dy,{className:"w-3 h-3 text-white"})})})]},C))})]})]}),u.jsxs("div",{className:"px-6 py-4 border-t flex gap-3",style:{borderColor:"rgba(138, 206, 224, 0.2)"},children:[u.jsx(se.button,{whileTap:{scale:.95},onClick:n,className:"flex-1 py-3 rounded-full font-bold text-white",style:{background:"linear-gradient(135deg, rgba(96, 147, 157, 0.6) 0%, rgba(76, 127, 137, 0.6) 100%)",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.3)",border:"1.5px solid rgba(138, 206, 224, 0.3)"},children:"انصراف"}),u.jsx(se.button,{whileTap:{scale:o?.95:1},onClick:j,disabled:!o||x,className:"flex-1 py-3 rounded-full font-bold",style:{background:o&&!x?"linear-gradient(135deg, rgba(255, 193, 7, 0.95) 0%, rgba(255, 152, 0, 0.95) 100%)":"linear-gradient(135deg, rgba(96, 147, 157, 0.3) 0%, rgba(76, 127, 137, 0.3) 100%)",boxShadow:o&&!x?"0 4px 16px rgba(255, 193, 7, 0.5)":"0 2px 8px rgba(0, 0, 0, 0.2)",border:o&&!x?"1.5px solid rgba(255, 200, 50, 0.5)":"1.5px solid rgba(138, 206, 224, 0.2)",color:o&&!x?"#5A3800":"#FFFFFF50",textShadow:o&&!x?"0 1px 0 rgba(255, 255, 255, 0.2)":"none",cursor:o&&!x?"pointer":"not-allowed",opacity:o&&!x?1:.6},children:x?"در حال آپلود...":"تایید"})]})]})})})}function oj(e){return{"تخته سیاه":"1",نیمکت:"2","دفترچه یادداشت":"3","دیوار حیاط":"4",آبخوری:"5","زنگ ورزش":"6","سه ماه تعطیلی":"7","روزنامه دیواری":"8","زنگ تفریح":"9"}[e]||"1"}const lj=e=>e==="انجام شده"?{icon:u.jsx(g8,{className:"w-4 h-4"}),text:"انجام شده",gradient:"linear-gradient(135deg, rgba(32, 201, 151, 0.95) 0%, rgba(16, 185, 129, 0.95) 100%)",border:"rgba(110, 231, 183, 0.6)",shadow:"0 2px 8px rgba(16, 185, 129, 0.35)"}:e==="تایید شده"?{icon:u.jsx(xy,{className:"w-4 h-4"}),text:"تایید شده",gradient:"linear-gradient(135deg, rgba(59, 130, 246, 0.95) 0%, rgba(37, 99, 235, 0.95) 100%)",border:"rgba(147, 197, 253, 0.62)",shadow:"0 2px 8px rgba(37, 99, 235, 0.35)"}:e==="در حال انجام"?{icon:u.jsx(Ql,{className:"w-4 h-4 rotate-180"}),text:"در حال انجام",gradient:"linear-gradient(135deg, rgba(255, 193, 7, 0.9) 0%, rgba(255, 160, 0, 0.9) 100%)",border:"rgba(255, 193, 7, 0.5)",shadow:"0 2px 8px rgba(255, 193, 7, 0.4)"}:e==="رد شده"?{icon:u.jsx(py,{className:"w-4 h-4"}),text:"رد شده",gradient:"linear-gradient(135deg, rgba(239, 68, 68, 0.9) 0%, rgba(220, 38, 38, 0.9) 100%)",border:"rgba(239, 68, 68, 0.5)",shadow:"0 2px 8px rgba(239, 68, 68, 0.4)"}:{icon:u.jsx(w8,{className:"w-4 h-4"}),text:e,gradient:"linear-gradient(135deg, rgba(156, 163, 175, 0.9) 0%, rgba(107, 114, 128, 0.9) 100%)",border:"rgba(156, 163, 175, 0.5)",shadow:"0 2px 8px rgba(156, 163, 175, 0.4)"};function cj(){const e=bn();gr("پروفایل");const{profile:n,refreshProfile:a}=mr(),[s,o]=v.useState(null),[l,d]=v.useState(null),[f,g]=v.useState(!1),[m,x]=v.useState(!0),[h,w]=v.useState("challenges"),[k,j]=v.useState(!1),[E,C]=v.useState([]),[I,M]=v.useState([]),[_,V]=v.useState([]),[H,re]=v.useState(!1);v.useEffect(()=>{const P=Z5();o(P),O()},[]),v.useEffect(()=>{n&&d(n)},[n]);const O=async()=>{x(!0);try{const P=hr();P&&d(P);const F=await Zl();F&&d(F)}catch{}finally{x(!1)}b()},b=async()=>{re(!0);try{const P=await R6();P&&(C(P.challenges),M(P.coin_transaction),V(P.posts))}catch(P){console.error("خطا در بارگذاری داده‌های پروفایل:",P)}finally{re(!1)}},R=async()=>{g(!0);try{await tw(),e("/login",{state:{error:"شما با موفقیت از سیستم خارج شدید"}})}catch(P){console.error("خطا در خروج:",P),e("/login",{state:{error:"شما با موفقیت از سیستم خارج شدید"}})}finally{g(!1)}},N=P=>{if(P==null)return"۰";const F="۰۱۲۳۴۵۶۷۸۹";return String(P).replace(/\d/g,U=>F[parseInt(U)])},G=P=>{if(!P)return"";const F="۰۱۲۳۴۵۶۷۸۹";return P.replace(/\d/g,U=>F[parseInt(U,10)])},Y=P=>P==="انجام شده"?"linear-gradient(180deg, #7EF7C5 0%, #4BCF9F 100%)":P==="تایید شده"?"linear-gradient(180deg, #87D6FF 0%, #5DAEFF 100%)":P==="در حال انجام"?"linear-gradient(180deg, #FFD994 0%, #F5B14A 100%)":P==="رد شده"?"linear-gradient(180deg, #FF8A94 0%, #EF4444 100%)":"linear-gradient(180deg, #F6A6DA 0%, #D777BE 100%)",X=async P=>{if(console.log("handleAvatarSelect called with:",P),l){d({...l,image:P});try{const F=l.username,U={WorkflowID:l.user_workflowID,user:{username:F,name:l.name,family:l.family,education_level:l.education_level,base:l.base,image:P}};console.log("Saving profile with data:",JSON.stringify(U));const W=await ky(U);console.log("Save profile result:",W),console.log("Reloading profile from server..."),await a(),console.log("Profile reloaded successfully")}catch(F){console.error("Error saving avatar:",F),alert("خطا در ذخیره تصویر پروفایل")}}else console.error("No userProfile available")},K=P=>{V(F=>F.filter(U=>U.workflow_ID!==P))},te={backgroundImage:`
linear-gradient(180deg, #2E1B3D 0%, #23183E 100%),
linear-gradient(120deg, #7c3aed 0%, #f97316 58%, #facc15 100%)
`,backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",boxShadow:"0 -7px 20px rgba(7, 0, 18, 0.5), 0 6px 14px rgba(5, 2, 12, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 2px 5px rgba(255, 222, 255, 0.09), inset 0 -2px 0 rgba(12, 7, 27, 0.72), inset 0 -8px 14px rgba(8, 4, 18, 0.34), inset 0 0 0 1px rgba(255, 255, 255, 0.045), inset 0 0 0 2px rgba(17, 10, 35, 0.32)",backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)"},q={backgroundImage:"linear-gradient(180deg, rgba(46, 27, 61, 0.92) 0%, rgba(35, 24, 62, 0.94) 100%), linear-gradient(120deg, #7c3aed 0%, #f97316 58%, #facc15 100%)",backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",border:"0.5px solid transparent"};return u.jsxs("div",{className:"pt-6 pb-2",dir:"rtl",children:[u.jsxs(se.div,{initial:{opacity:0,y:15},animate:{opacity:1,y:0},className:"flex flex-col items-center mb-4",children:[u.jsxs("div",{className:"mb-3 grid w-full grid-cols-3 items-center",children:[u.jsx("div",{className:"flex justify-center",children:u.jsxs(se.button,{whileTap:{scale:f?1:.92},onClick:R,disabled:f,"aria-label":f?"در حال خروج":"خروج",className:"flex h-12 min-w-[92px] items-center justify-center gap-1.5 rounded-full px-3",style:{background:f?"linear-gradient(145deg, rgba(226, 84, 142, 0.72) 0%, rgba(196, 57, 109, 0.72) 100%)":"linear-gradient(145deg, rgba(255, 93, 143, 0.95) 0%, rgba(236, 63, 122, 0.95) 52%, rgba(207, 40, 98, 0.95) 100%)",boxShadow:f?"0 6px 12px rgba(170, 34, 79, 0.3), inset 0 1px 0 rgba(255,255,255,0.18)":"0 10px 18px rgba(207, 40, 98, 0.36), inset 0 1px 0 rgba(255,255,255,0.26)",border:"1px solid rgba(255, 188, 214, 0.5)",opacity:f?.7:1,cursor:f?"not-allowed":"pointer"},children:[u.jsx(_8,{size:16,color:"#fff"}),u.jsx("span",{className:"text-xs font-bold text-white",children:f?"خروج...":"خروج"})]})}),u.jsxs("div",{className:"relative mx-auto",children:[u.jsx(se.div,{initial:{scale:0},animate:{scale:1},transition:{type:"spring",duration:.5},className:"h-24 w-24 rounded-full p-[2px]",style:te,children:u.jsx("div",{className:"flex h-full w-full items-center justify-center overflow-hidden rounded-full",style:te,children:l!=null&&l.image?u.jsx(xa,{src:zl(l.image,l.user_stage_id),alt:"پروفایل",className:"h-full w-full rounded-full object-cover",fallbackSrc:Jn,style:{filter:"drop-shadow(0 3px 6px rgba(138, 206, 224, 0.6))"}}):u.jsx("img",{src:Jn,alt:"پروفایل",className:"h-[84px] w-[84px] rounded-full object-cover"})})}),u.jsx(se.button,{whileTap:{scale:.9},whileHover:{scale:1.1},onClick:()=>j(!0),className:"absolute bottom-0 right-0 flex h-8 w-8 items-center justify-center rounded-full",style:{background:"linear-gradient(135deg, rgba(255, 193, 7, 0.95) 0%, rgba(255, 152, 0, 0.95) 100%)",boxShadow:"0 3px 10px rgba(255, 193, 7, 0.6), 0 0 16px rgba(255, 193, 7, 0.4)",border:"2px solid rgba(255, 255, 255, 0.9)"},children:u.jsx(dy,{className:"h-3.5 w-3.5",style:{color:"#5A3800"}})})]}),u.jsx("div",{className:"flex justify-center",children:((l==null?void 0:l.user_workflowID)||!m)&&u.jsxs(se.button,{whileTap:{scale:.92},onClick:()=>e("/edit-profile"),"aria-label":l!=null&&l.user_workflowID?"ویرایش پروفایل":"تکمیل پروفایل",className:"flex h-12 min-w-[92px] items-center justify-center gap-1.5 rounded-full px-3",style:{background:"linear-gradient(145deg, rgba(255, 211, 92, 0.98) 0%, rgba(255, 180, 64, 0.97) 55%, rgba(244, 148, 34, 0.96) 100%)",backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",boxShadow:"0 10px 20px rgba(245, 158, 11, 0.32), inset 0 1px 0 rgba(255,255,255,0.4)",border:"1px solid rgba(255, 236, 167, 0.55)"},children:[u.jsx(n6,{size:16,color:"#fff"}),u.jsx("span",{className:"text-xs font-bold text-white",children:"ویرایش"})]})})]}),u.jsx("h2",{className:"text-white text-lg font-bold mb-0.5",style:{textShadow:"0 3px 8px rgba(138, 206, 224, 0.6), 0 2px 4px rgba(0, 0, 0, 0.8)"},children:m?"در حال بارگذاری...":l?`${l.name} ${l.family}`:s?`${s.Name} ${s.Family}`:"کاربر گرامی"}),l&&u.jsxs("div",{style:{color:"rgba(138, 206, 224, 0.8)"},className:"text-[10px] mb-3",children:[l.education_level," - پایه ",l.base]})]}),u.jsx("div",{className:"mb-3 flex rounded-2xl p-1",style:q,children:[{id:"challenges",label:"سابقه چالش‌ها"},{id:"coins",label:"سابقه سکه‌ها"},{id:"posts",label:"پست‌ها"}].map(P=>u.jsx(se.button,{whileTap:{scale:.96},onClick:()=>w(P.id),className:"flex flex-1 items-center justify-center gap-1 rounded-xl py-2.5 text-[11px] font-bold transition-all duration-300",style:h===P.id?{background:"linear-gradient(135deg, rgba(174, 117, 255, 0.96) 0%, rgba(138, 82, 238, 0.95) 46%, rgba(102, 55, 204, 0.94) 100%)",color:"#FFFFFF",boxShadow:"0 0 18px rgba(155,108,241,0.4)"}:{color:"rgba(251,231,245,0.72)"},children:P.label},P.id))}),h==="challenges"&&u.jsx("div",{className:"space-y-3",children:H?u.jsx("div",{className:"text-center text-white/60 py-8",children:"در حال بارگذاری..."}):E.length===0?u.jsx("div",{className:"text-center text-white/60 py-8",children:"هنوز چالشی ثبت نشده است"}):E.map((P,F)=>{const U=parseInt(P.coin_count||"0"),W=P.status==="در حال انجام",T=lj(P.status),A=!W&&(P.status==="انجام شده"||P.status==="تایید شده")&&U>0;return u.jsxs(se.div,{initial:{opacity:0,x:-30},animate:{opacity:1,x:0},transition:{delay:F*.08,duration:.3},onClick:()=>{if(W&&P.mission_id){const ee=oj(P.mission_type);e(`/chatbot/${ee}?missionId=${P.mission_id}&missionType=${encodeURIComponent(P.mission_type)}&continueMode=true`)}},className:`relative overflow-hidden rounded-2xl px-4 py-3 ${W?"cursor-pointer":""}`,style:{backgroundImage:"linear-gradient(180deg, rgba(46, 27, 61, 0.92) 0%, rgba(35, 24, 62, 0.94) 100%), linear-gradient(120deg, #7c3aed 0%, #f97316 58%, #facc15 100%)",backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",border:W?"1px solid rgba(255, 205, 122, 0.58)":"0.5px solid rgba(255, 255, 255, 0.16)",boxShadow:W?"0 10px 22px rgba(255, 183, 77, 0.24), inset 0 1px 0 rgba(255,255,255,0.18)":"0 10px 22px rgba(10, 6, 22, 0.28), inset 0 1px 0 rgba(255,255,255,0.14)",opacity:.9},whileHover:W?{scale:1.02,y:-2}:{},whileTap:W?{scale:.98}:{},children:[u.jsx("span",{className:"absolute bottom-0 right-0 top-0 w-1.5",style:{background:Y(P.status),opacity:.92}}),u.jsxs("div",{className:"mb-1.5 flex items-start justify-between gap-2",children:[u.jsx("h3",{className:"flex-1 text-sm font-extrabold text-[#FBE7F5]",children:P.mission_title}),u.jsxs("div",{className:"flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[10px] font-bold text-white",style:{background:T.gradient,border:`1px solid ${T.border}`,boxShadow:T.shadow},children:[u.jsx("span",{children:T.text}),T.icon]})]}),u.jsx("div",{className:"mb-0 text-[11px] font-bold text-[#F2DFF0]/72",children:P.mission_type}),u.jsxs("div",{className:"mt0 flex items-center justify-between text-[11px]",children:[u.jsx("span",{className:"text-[#F2DFF0]/72",children:G(P.datetime1)}),u.jsxs("div",{className:"flex items-center gap-2 rounded-full px-2 py-1",children:[u.jsx("img",{src:Ms,alt:"سکه",className:"h-5 w-5"}),u.jsx("span",{className:"text-base font-extrabold leading-none text-[#FFD873]",children:A?N(U):"۰"})]})]})]},P.mission_done_id)})}),h==="coins"&&u.jsxs("div",{className:"space-y-3",children:[u.jsx(se.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},className:"mb-4 rounded-2xl p-4",style:{backgroundImage:"linear-gradient(180deg, rgba(46, 27, 61, 0.92) 0%, rgba(35, 24, 62, 0.96) 100%), linear-gradient(120deg, rgba(250, 204, 21, 0.28) 0%, rgba(245, 158, 11, 0.24) 50%, rgba(251, 113, 133, 0.26) 100%)",backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",border:"1px solid transparent",boxShadow:"0 12px 24px rgba(25, 12, 46, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.18)"},children:u.jsxs("div",{className:"text-center",children:[u.jsxs("div",{className:"flex items-center justify-center gap-2",children:[u.jsx("img",{src:Ms,alt:"سکه",className:"h-9 w-9"}),u.jsx("span",{className:"text-[32px] font-black leading-none text-[#FFD166]",children:N(l==null?void 0:l.coin_count)})]}),u.jsx("p",{className:"mt-2 text-xs font-bold text-[#FFF4D6]/92",children:"مجموع کل سکه‌ها"}),u.jsx("div",{className:"mx-auto mt-3 h-px w-[72%] rounded-full bg-gradient-to-r from-transparent via-[#FFD166] to-transparent opacity-85"})]})}),H?u.jsx("div",{className:"text-center text-white/60 py-8",children:"در حال بارگذاری..."}):I.length===0?u.jsx("div",{className:"text-center text-white/60 py-8",children:"هنوز تراکنشی ثبت نشده است"}):I.map((P,F)=>{const U=parseInt(P.coin_count||"0"),W=U<0,T=Math.abs(U);return u.jsxs(se.div,{initial:{opacity:0,x:-30},animate:{opacity:1,x:0},transition:{delay:F*.08,duration:.3},className:"relative overflow-hidden rounded-2xl px-4 py-3",style:{backgroundImage:W?"linear-gradient(180deg, rgba(46, 24, 41, 0.9) 0%, rgba(34, 18, 34, 0.94) 100%), linear-gradient(120deg, #fb7185 0%, #ef4444 100%)":"linear-gradient(180deg, rgba(46, 27, 61, 0.92) 0%, rgba(35, 24, 62, 0.96) 100%), linear-gradient(120deg, rgba(250, 204, 21, 0.22) 0%, rgba(245, 158, 11, 0.18) 42%, rgba(251, 113, 133, 0.24) 100%)",backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",border:"1px solid transparent",boxShadow:W?"0 8px 16px rgba(239, 68, 68, 0.18), inset 0 1px 0 rgba(255, 221, 226, 0.2)":"0 8px 16px rgba(25, 12, 46, 0.22), inset 0 1px 0 rgba(255, 244, 200, 0.12)",opacity:.92},children:[u.jsx("span",{className:"absolute bottom-0 right-0 top-0 w-1.5",style:{background:W?"linear-gradient(180deg, #FB7185 0%, #EF4444 100%)":"linear-gradient(180deg, #FFD76A 0%, #F59E0B 100%)",opacity:.95}}),u.jsxs("div",{className:"flex items-center justify-between gap-3",children:[u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx("p",{className:"line-clamp-2 text-xs font-semibold leading-5 text-[#FFF4D6]/92",children:P.description}),u.jsx("p",{className:"mt-1 text-[10px] text-[#FFE9A8]/60",children:"تراکنش سکه"})]}),u.jsxs("div",{className:"flex items-center gap-1.5 rounded-full px-2.5 py-1",style:{background:W?"rgba(239, 68, 68, 0.18)":"rgba(255, 209, 102, 0.12)",border:W?"1px solid rgba(251, 113, 133, 0.42)":"1px solid rgba(255, 224, 140, 0.34)"},children:[u.jsx("img",{src:Ms,alt:"سکه",className:"h-4 w-4",style:{filter:W?"grayscale(100%) brightness(0.8)":"none"}}),u.jsxs("span",{className:"text-sm font-extrabold leading-none",style:{color:W?"#FF9CA8":"#FFD166"},children:[W?"-":"+",N(T)]})]})]})]},`${P.StageID}-${F}`)})]}),h==="posts"&&u.jsx("div",{className:"space-y-4",children:H?u.jsx("div",{className:"text-center text-white/60 py-8",children:"در حال بارگذاری..."}):_.length===0?u.jsx("div",{className:"text-center text-white/60 py-8",children:"هنوز پستی منتشر نشده است"}):_.map((P,F)=>{let U="image",W,T;return P.film?(U="video",W=Ny(P.StageID),T=P.image?Rs(P.StageID):""):P.audio?(U="audio",W=Ty(P.StageID),T=P.image?Rs(P.StageID):""):(U="image",T=P.image?Rs(P.StageID):""),u.jsxs("div",{children:[u.jsxs(se.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},transition:{delay:F*.05},className:"mb-3 flex items-center gap-3",dir:"rtl",children:[u.jsx("div",{className:"h-[1px] flex-1",style:{background:"rgba(138, 206, 224, 0.3)"}}),u.jsx("span",{className:"text-xs text-white/60 px-2",children:P.mission_type}),u.jsx("div",{className:"h-[1px] flex-1",style:{background:"rgba(138, 206, 224, 0.3)"}})]}),u.jsx(Dy,{id:P.workflow_ID,authorName:P.full_name,authorUsername:P.user_id,authorAvatar:Ts(P.person_stage_id),image:T,title:P.title,caption:P.description,likes:P.like_count||0,dislikes:P.dislike_count||0,comments:P.comment_count||0,timestamp:"",topicName:P.mission_type,mediaType:U,mediaUrl:W,isOwnPost:!0,workflowID:P.workflow_ID,missionType:P.mission_type,initialLikeState:P.like_state||"",onDelete:K})]},P.workflow_ID)})}),u.jsx(ij,{isOpen:k,onClose:()=>j(!1),onSelectAvatar:X,currentAvatar:l!=null&&l.image?zl(l.image,l.user_stage_id):void 0})]})}function uj(){const e=bn(),n=Ut();gr("ویرایش پروفایل");const{refreshProfile:a}=mr(),[s,o]=v.useState(!0),[l,d]=v.useState(!1),[f,g]=v.useState(null),[m,x]=v.useState(""),[h,w]=v.useState({name:"",family:"",education_level:"",base:""}),[k,j]=v.useState({});v.useEffect(()=>{var _;E(),(_=n.state)!=null&&_.message&&(x(n.state.message),window.history.replaceState({},document.title),setTimeout(()=>{x("")},5e3))},[n]);const E=async()=>{o(!0);try{const _=hr();_&&(g(_),w({name:_.name||"",family:_.family||"",education_level:_.education_level||"",base:_.base||""}));const V=await Zl();V&&(g(V),w({name:V.name||"",family:V.family||"",education_level:V.education_level||"",base:V.base||""}))}catch{console.warn("عدم دسترسی به سرور - از داده‌های کش استفاده می‌شود")}finally{o(!1)}},C=()=>{const _={};return h.name.trim()||(_.name="نام الزامی است"),h.family.trim()||(_.family="نام خانوادگی الزامی است"),h.education_level||(_.education_level="مقطع تحصیلی الزامی است"),h.base||(_.base="پایه تحصیلی الزامی است"),j(_),Object.keys(_).length===0},I=async _=>{if(_.preventDefault(),!!C()){d(!0);try{const V=ew();if(!V)throw new Error("نام کاربری یافت نشد");const H={username:V,name:h.name,family:h.family,education_level:h.education_level,base:h.base},re=f!=null&&f.user_workflowID?{WorkflowID:f.user_workflowID,user:H}:{user:H};console.log("Saving profile data:",JSON.stringify(re)),await ky(re)?(await a(),e("/profile")):alert("خطا در ذخیره اطلاعات")}catch(V){console.error("خطا در ذخیره:",V),alert("خطا در ذخیره اطلاعات")}finally{d(!1)}}},M=(_,V)=>{w(H=>({...H,[_]:V})),k[_]&&j(H=>{const re={...H};return delete re[_],re})};return s?u.jsx("div",{className:"flex h-full min-h-0 items-center justify-center",dir:"rtl",children:u.jsxs("div",{className:"text-center",children:[u.jsx("div",{className:"mx-auto mb-3 h-10 w-10 animate-spin rounded-full border-4 border-[#ffd6f0]/30 border-t-[#ff79cf]"}),u.jsx("p",{className:"text-sm font-bold text-[#FBE7F5]",children:"در حال بارگذاری پروفایل..."})]})}):u.jsx("div",{className:"relative h-full min-h-0 overflow-hidden",dir:"rtl",children:u.jsx("main",{className:"h-full overflow-y-auto px-4 pb-4 pt-4",style:{maxHeight:"100%"},children:u.jsxs("div",{className:"mx-auto w-full max-w-md",children:[u.jsxs("div",{className:"mb-4 text-center",children:[u.jsx("h1",{className:"text-[20px] font-extrabold text-[#FBE7F5]",children:f!=null&&f.user_workflowID?"ویرایش پروفایل":"تکمیل پروفایل"}),u.jsx("p",{className:"mt-1 text-xs text-[#EED3EC]/82",children:"اطلاعات پایه حساب کاربری را ثبت یا به‌روزرسانی کنید"})]}),m&&u.jsx(se.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"mb-4 rounded-2xl px-4 py-3 text-center text-sm font-bold",style:{backgroundImage:"linear-gradient(180deg, rgba(24, 67, 46, 0.88) 0%, rgba(16, 56, 39, 0.92) 100%), linear-gradient(120deg, #34d399 0%, #10b981 100%)",backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",border:"1px solid rgba(167, 243, 208, 0.4)",color:"#D1FAE5"},children:m}),u.jsxs("form",{id:"edit-profile-form",onSubmit:I,className:"space-y-4",children:[u.jsx("div",{className:"rounded-[22px] border-[0.5px] border-transparent px-4 py-4",style:{backgroundImage:"linear-gradient(180deg, rgba(46, 27, 61, 0.92) 0%, rgba(35, 24, 62, 0.94) 100%), linear-gradient(120deg, #7c3aed 0%, #f97316 58%, #facc15 100%)",backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",boxShadow:"0 -7px 20px rgba(7, 0, 18, 0.36), 0 8px 16px rgba(5, 2, 12, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.12)"},children:u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{children:[u.jsx("label",{className:"mb-2 block text-xs font-semibold text-[#FBE7F5]/92",children:"نام"}),u.jsx("input",{type:"text",value:h.name,onChange:_=>M("name",_.target.value),className:"w-full rounded-xl px-3 py-2.5 text-sm font-bold text-white outline-none",style:{background:"rgba(255,255,255,0.08)",border:k.name?"1px solid rgba(248, 113, 113, 0.62)":"1px solid rgba(255,255,255,0.14)"},placeholder:"نام خود را وارد کنید"}),k.name&&u.jsx("p",{className:"mt-1 text-xs text-red-300",children:k.name})]}),u.jsxs("div",{children:[u.jsx("label",{className:"mb-2 block text-xs font-semibold text-[#FBE7F5]/92",children:"نام خانوادگی"}),u.jsx("input",{type:"text",value:h.family,onChange:_=>M("family",_.target.value),className:"w-full rounded-xl px-3 py-2.5 text-sm font-bold text-white outline-none",style:{background:"rgba(255,255,255,0.08)",border:k.family?"1px solid rgba(248, 113, 113, 0.62)":"1px solid rgba(255,255,255,0.14)"},placeholder:"نام خانوادگی خود را وارد کنید"}),k.family&&u.jsx("p",{className:"mt-1 text-xs text-red-300",children:k.family})]}),u.jsxs("div",{children:[u.jsx("label",{className:"mb-2 block text-xs font-semibold text-[#FBE7F5]/92",children:"مقطع تحصیلی"}),u.jsxs("div",{className:"relative",children:[u.jsxs("select",{value:h.education_level,onChange:_=>M("education_level",_.target.value),className:"w-full appearance-none rounded-xl px-3 py-2.5 pl-10 text-sm font-bold text-white outline-none",style:{background:"rgba(255,255,255,0.08)",border:k.education_level?"1px solid rgba(248, 113, 113, 0.62)":"1px solid rgba(255,255,255,0.14)"},children:[u.jsx("option",{value:"",children:"انتخاب کنید"}),u.jsx("option",{value:"ابتدایی",children:"ابتدایی"}),u.jsx("option",{value:"متوسطه اول",children:"متوسطه اول"}),u.jsx("option",{value:"متوسطه دوم",children:"متوسطه دوم"})]}),u.jsx(Yd,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[#F2DFF0]/72"})]}),k.education_level&&u.jsx("p",{className:"mt-1 text-xs text-red-300",children:k.education_level})]}),u.jsxs("div",{children:[u.jsx("label",{className:"mb-2 block text-xs font-semibold text-[#FBE7F5]/92",children:"پایه تحصیلی"}),u.jsxs("div",{className:"relative",children:[u.jsxs("select",{value:h.base,onChange:_=>M("base",_.target.value),className:"w-full appearance-none rounded-xl px-3 py-2.5 pl-10 text-sm font-bold text-white outline-none",style:{background:"rgba(255,255,255,0.08)",border:k.base?"1px solid rgba(248, 113, 113, 0.62)":"1px solid rgba(255,255,255,0.14)"},children:[u.jsx("option",{value:"",children:"انتخاب کنید"}),h.education_level==="ابتدایی"&&u.jsxs(u.Fragment,{children:[u.jsx("option",{value:"اول",children:"اول"}),u.jsx("option",{value:"دوم",children:"دوم"}),u.jsx("option",{value:"سوم",children:"سوم"}),u.jsx("option",{value:"چهارم",children:"چهارم"}),u.jsx("option",{value:"پنجم",children:"پنجم"}),u.jsx("option",{value:"ششم",children:"ششم"})]}),h.education_level==="متوسطه اول"&&u.jsxs(u.Fragment,{children:[u.jsx("option",{value:"هفتم",children:"هفتم"}),u.jsx("option",{value:"هشتم",children:"هشتم"}),u.jsx("option",{value:"نهم",children:"نهم"})]}),h.education_level==="متوسطه دوم"&&u.jsxs(u.Fragment,{children:[u.jsx("option",{value:"دهم",children:"دهم"}),u.jsx("option",{value:"یازدهم",children:"یازدهم"}),u.jsx("option",{value:"دوازدهم",children:"دوازدهم"})]})]}),u.jsx(Yd,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[#F2DFF0]/72"})]}),k.base&&u.jsx("p",{className:"mt-1 text-xs text-red-300",children:k.base})]})]})}),u.jsxs(se.button,{type:"submit",disabled:l,whileTap:{scale:l?1:.98},className:"flex h-12 w-full items-center justify-center gap-2 rounded-full text-sm font-bold text-white",style:{backgroundImage:l?"linear-gradient(145deg, rgba(72, 58, 105, 0.72) 0%, rgba(42, 35, 77, 0.76) 100%)":"linear-gradient(90deg, rgba(255,139,91,1) 0%, rgba(238,91,166,1) 45%, rgba(147,78,255,1) 100%), linear-gradient(120deg, #7c3aed 0%, #f97316 58%, #facc15 100%)",backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",border:"1px solid transparent",boxShadow:l?"inset 0 1px 0 rgba(255,255,255,0.12)":"0 10px 24px rgba(196, 87, 255, 0.32), inset 0 1px 0 rgba(255,255,255,0.3)",opacity:l?.7:1,cursor:l?"not-allowed":"pointer"},children:[u.jsx(l6,{size:16}),u.jsx("span",{children:l?"در حال ذخیره...":"ذخیره اطلاعات"})]})]})]})})})}const dd="/assets/0469c3ac6223dede16e9f8943a3cac9943835707-RJiYkdb5.png",dj=[{id:"1",name:"نشان ستاره طلایی",price:150,isOwned:!1},{id:"2",name:"آواتار جادوگر",price:250,isOwned:!1},{id:"3",name:"قاب طلایی",price:100,isOwned:!1},{id:"4",name:"پس‌زمینه کهکشانی",price:200,isOwned:!1},{id:"5",name:"نشان شیر",price:80,isOwned:!1},{id:"6",name:"افکت درخشش",price:300,isOwned:!1,isLocked:!0},{id:"7",name:"تاج طلایی",price:180,isOwned:!1},{id:"8",name:"جام قهرمانی",price:220,isOwned:!1}],dl=[{id:"p1",name:"نشان ستاره طلایی",isOwned:!0},{id:"p2",name:"قاب طلایی",isOwned:!0}];function fj(){gr("کیف جادویی");const[e,n]=v.useState("owned"),[a,s]=v.useState([]),[o,l]=v.useState(!1),[d,f]=v.useState(null),g=1e3;return v.useEffect(()=>{e==="owned"&&a.length===0&&(async()=>{l(!0);const x=await lC();x.success?s(x.data):console.error("Error loading magic bag missions:",x.message),l(!1)})()},[e,a.length]),u.jsxs("div",{className:"pt-6 pb-2",dir:"rtl",children:[u.jsxs("div",{className:"mb-4 flex rounded-2xl p-1",style:{backgroundImage:"linear-gradient(180deg, rgba(46, 27, 61, 0.92) 0%, rgba(35, 24, 62, 0.94) 100%), linear-gradient(120deg, #7c3aed 0%, #f97316 58%, #facc15 100%)",backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",border:"0.5px solid transparent"},children:[u.jsxs(se.button,{whileTap:{scale:.97},onClick:()=>n("owned"),className:"flex-1 flex items-center justify-center gap-1.5 rounded-xl py-2.5 text-sm font-bold transition-all duration-300",style:{background:e==="owned"?"linear-gradient(135deg, rgba(174, 117, 255, 0.96) 0%, rgba(138, 82, 238, 0.95) 46%, rgba(102, 55, 204, 0.94) 100%)":"transparent",boxShadow:e==="owned"?"0 0 18px rgba(155,108,241,0.4)":"none",color:e==="owned"?"#FFFFFF":"rgba(251,231,245,0.72)"},children:[u.jsx(xg,{className:"w-4 h-4"}),"ایتم‌های من"]}),u.jsxs(se.button,{whileTap:{scale:.97},onClick:()=>n("shop"),className:"flex-1 flex items-center justify-center gap-1.5 rounded-xl py-2.5 text-sm font-bold transition-all duration-300",style:{background:e==="shop"?"linear-gradient(135deg, rgba(174, 117, 255, 0.96) 0%, rgba(138, 82, 238, 0.95) 46%, rgba(102, 55, 204, 0.94) 100%)":"transparent",boxShadow:e==="shop"?"0 0 18px rgba(155,108,241,0.4)":"none",color:e==="shop"?"#FFFFFF":"rgba(251,231,245,0.72)"},children:[u.jsx(f6,{className:"w-4 h-4"}),"فروشگاه"]})]}),e==="shop"&&u.jsx("div",{className:"grid grid-cols-4 gap-4",children:dj.map((m,x)=>{const h=!m.isLocked&&m.price&&g>=m.price;return u.jsxs(se.button,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:x*.05,duration:.3},whileHover:{scale:m.isLocked?1:1.1,y:-4},whileTap:{scale:m.isLocked?1:.9},disabled:m.isLocked,className:"flex flex-col items-center gap-1.5",children:[u.jsxs("div",{className:"relative w-full",children:[u.jsx("img",{src:dd,alt:m.name,className:"w-full h-auto object-contain",style:{filter:m.isLocked?"grayscale(100%) brightness(0.4)":"drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3))"}}),m.isLocked&&u.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:u.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center",style:{background:"linear-gradient(135deg, rgba(220, 38, 38, 0.95) 0%, rgba(185, 28, 28, 0.95) 100%)",boxShadow:"0 4px 12px rgba(220, 38, 38, 0.8)"},children:u.jsx(I8,{className:"w-4 h-4 text-white"})})}),!m.isLocked&&m.price&&u.jsxs("div",{className:"absolute top-0 left-0 flex items-center gap-1 px-2 py-1 rounded-full",style:{background:h?"linear-gradient(135deg, rgba(44, 34, 66, 0.96) 0%, rgba(30, 22, 50, 0.98) 100%)":"linear-gradient(135deg, rgba(68, 74, 88, 0.96) 0%, rgba(53, 58, 71, 0.98) 100%)",border:`1.5px solid ${h?"rgba(255, 214, 240, 0.45)":"rgba(148, 163, 184, 0.45)"}`,boxShadow:h?"0 2px 8px rgba(15, 10, 25, 0.6)":"0 2px 8px rgba(0, 0, 0, 0.4)"},children:[u.jsx("img",{src:Ms,alt:"سکه",className:"w-4 h-4"}),u.jsx("span",{className:"text-[10px] font-bold",style:{color:h?"#FFF3CC":"rgba(255, 255, 255, 0.74)",textShadow:"none"},children:m.price})]})]}),u.jsx("p",{className:"text-white text-[11px] font-bold text-center leading-tight line-clamp-2 w-full",style:{textShadow:"0 1px 2px rgba(0, 0, 0, 0.5)"},children:m.name})]},m.id)})}),e==="owned"&&u.jsx("div",{children:a.length===0&&dl.length===0?u.jsxs("div",{className:"flex flex-col items-center justify-center py-16",children:[u.jsx("div",{className:"w-24 h-24 rounded-full flex items-center justify-center mb-4",style:{background:"linear-gradient(135deg, rgba(138, 206, 224, 0.2) 0%, rgba(76, 127, 137, 0.2) 100%)",border:"3px solid rgba(138, 206, 224, 0.3)"},children:u.jsx(xg,{className:"w-12 h-12 text-white/50"})}),u.jsx("h3",{className:"text-white text-lg font-bold mb-2",children:"هنوز ایتمی ندارید"}),u.jsx("p",{className:"text-white/60 text-sm text-center",children:"با انجام چالش‌ها و خرید از فروشگاه، ایتم‌های جذاب جمع کنید!"}),u.jsx(se.button,{whileTap:{scale:.95},onClick:()=>n("shop"),className:"mt-6 px-6 py-3 rounded-full font-bold",style:{background:"linear-gradient(135deg, rgba(255, 183, 0, 0.95) 0%, rgba(255, 140, 0, 0.95) 100%)",boxShadow:"0 8px 24px rgba(255, 165, 0, 0.5)",color:"#5A3800"},children:"رفتن به فروشگاه"})]}):u.jsxs(u.Fragment,{children:[a.length>0&&u.jsxs(u.Fragment,{children:[u.jsx("h3",{className:"text-white text-sm font-bold mb-3",style:{textShadow:"0 2px 4px rgba(0, 0, 0, 0.5)"},children:"🏆 از ماموریت‌ها"}),o?u.jsx("div",{className:"grid grid-cols-4 gap-4 mb-6",children:[1,2,3,4].map(m=>u.jsxs("div",{className:"flex flex-col items-center gap-1.5",children:[u.jsx("div",{className:"w-full aspect-square rounded-lg animate-pulse",style:{background:"linear-gradient(135deg, rgba(138, 206, 224, 0.2) 0%, rgba(76, 127, 137, 0.2) 100%)"}}),u.jsx("div",{className:"w-full h-4 rounded animate-pulse",style:{background:"linear-gradient(135deg, rgba(138, 206, 224, 0.2) 0%, rgba(76, 127, 137, 0.2) 100%)"}})]},m))}):u.jsx("div",{className:"grid grid-cols-4 gap-4 mb-6",children:a.map((m,x)=>{const h=cC(m.magic_bag_file),w=()=>{if(h)f({url:cd(m.StageID),title:m.magic_bag_title});else{const k=document.createElement("a");k.href=cd(m.StageID),k.download=m.magic_bag_file||m.magic_bag_title,k.click()}};return u.jsxs(se.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:x*.05,duration:.3},className:"flex flex-col items-center gap-1.5",children:[u.jsxs(se.button,{onClick:w,whileHover:{scale:1.1,y:-4},whileTap:{scale:.9},className:"relative w-full",children:[u.jsx("img",{src:cd(m.StageID),alt:m.magic_bag_title,className:"w-full h-auto object-contain",style:{filter:"drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3))"},onError:k=>{k.currentTarget.src=dd}}),!h&&u.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/30 rounded-lg",children:u.jsx("div",{className:"w-10 h-10 rounded-full flex items-center justify-center",style:{background:"linear-gradient(135deg, rgba(255, 183, 0, 0.95) 0%, rgba(255, 140, 0, 0.95) 100%)",boxShadow:"0 4px 12px rgba(255, 165, 0, 0.8)"},children:u.jsx(gg,{className:"w-5 h-5 text-white"})})})]}),u.jsx("p",{className:"text-white text-[11px] font-bold text-center leading-tight line-clamp-2 w-full",style:{textShadow:"0 1px 2px rgba(0, 0, 0, 0.5)"},children:m.magic_bag_title})]},m.StageID)})})]}),a.length>0&&dl.length>0&&u.jsx("div",{className:"my-5 h-px w-full bg-white/20"}),dl.length>0&&u.jsxs(u.Fragment,{children:[u.jsx("h3",{className:"text-white text-sm font-bold mb-3",style:{textShadow:"0 2px 4px rgba(0, 0, 0, 0.5)"},children:"🛒 خریداری شده"}),u.jsx("div",{className:"grid grid-cols-4 gap-4",children:dl.map((m,x)=>u.jsxs(se.button,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:(a.length+x)*.05,duration:.3},whileHover:{scale:1.1,y:-4},whileTap:{scale:.9},className:"flex flex-col items-center gap-1.5",children:[u.jsx("div",{className:"relative w-full",children:u.jsx("img",{src:dd,alt:m.name,className:"w-full h-auto object-contain",style:{filter:"drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3))"}})}),u.jsx("p",{className:"text-white text-[11px] font-bold text-center leading-tight line-clamp-2 w-full",style:{textShadow:"0 1px 2px rgba(0, 0, 0, 0.5)"},children:m.name})]},m.id))})]})]})}),u.jsx(pn,{children:d&&u.jsx(se.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>f(null),className:"fixed inset-0 z-50 flex items-center justify-center bg-black/90 px-4",style:{backdropFilter:"blur(8px)"},children:u.jsxs(se.div,{initial:{scale:.8,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.8,opacity:0},onClick:m=>m.stopPropagation(),className:"relative max-w-4xl w-full",children:[u.jsx(se.button,{whileTap:{scale:.9},onClick:()=>f(null),className:"absolute -top-12 left-0 w-10 h-10 rounded-full flex items-center justify-center z-10",style:{background:"linear-gradient(135deg, rgba(220, 38, 38, 0.95) 0%, rgba(185, 28, 28, 0.95) 100%)",boxShadow:"0 4px 12px rgba(220, 38, 38, 0.8)"},children:u.jsx(_s,{className:"w-6 h-6 text-white"})}),u.jsx(se.button,{whileTap:{scale:.9},onClick:()=>{const m=document.createElement("a");m.href=d.url,m.download=d.title,m.click()},className:"absolute -top-12 right-0 w-10 h-10 rounded-full flex items-center justify-center z-10",style:{background:"linear-gradient(135deg, rgba(255, 183, 0, 0.95) 0%, rgba(255, 140, 0, 0.95) 100%)",boxShadow:"0 4px 12px rgba(255, 165, 0, 0.8)"},children:u.jsx(gg,{className:"w-6 h-6 text-white"})}),u.jsx("div",{className:"rounded-2xl overflow-hidden",style:{boxShadow:"0 25px 50px rgba(0, 0, 0, 0.5)",border:"2px solid rgba(138, 206, 224, 0.3)"},children:u.jsx("img",{src:d.url,alt:d.title,className:"w-full h-auto max-h-[80vh] object-contain bg-black/50"})}),u.jsx("div",{className:"mt-4 text-center",children:u.jsx("p",{className:"text-white text-lg font-bold",style:{textShadow:"0 2px 4px rgba(0, 0, 0, 0.8)"},children:d.title})})]})})})]})}const hj={backgroundImage:"linear-gradient(180deg, rgba(46, 27, 61, 0.9) 0%, rgba(35, 24, 62, 0.94) 100%), linear-gradient(120deg, #7c3aed 0%, #f97316 58%, #facc15 100%)",backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",border:"0.5px solid transparent",boxShadow:"0 -5px 16px rgba(7, 0, 18, 0.35), 0 8px 14px rgba(5, 2, 12, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.12)"};function pj(){gr("پیام‌ها");const{messages:e,loading:n,markMessagesAsRead:a}=Ji(),s=v.useRef(!1);return v.useEffect(()=>{if(!n&&e.length>0&&!s.current){const o=e.filter(l=>l.status==="خوانده نشده").map(l=>String(l.stageID));o.length>0&&(s.current=!0,a(o))}},[n,e,a]),u.jsx("div",{className:"flex h-full min-h-0 flex-col pb-3 pt-4",children:u.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-4",children:n?u.jsx("div",{className:"flex h-full items-center justify-center",children:u.jsxs("div",{className:"text-center",children:[u.jsx("div",{className:"mx-auto mb-3 h-10 w-10 animate-spin rounded-full border-4 border-[#ffd6f0]/30 border-t-[#ff79cf]"}),u.jsx("p",{className:"text-sm font-bold text-[#FBE7F5]",children:"در حال بارگذاری پیام‌ها..."})]})}):e.length===0?u.jsx("div",{className:"flex h-full items-center justify-center",children:u.jsx("p",{className:"text-sm font-bold text-[#FBE7F5]/88",children:"پیامی وجود ندارد"})}):u.jsx("div",{className:"space-y-3",dir:"rtl",children:e.map((o,l)=>{const d=o.status==="خوانده نشده";return u.jsxs(se.article,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:Math.min(l*.05,.25),duration:.26},className:"relative overflow-hidden rounded-2xl px-4 py-3",style:hj,children:[u.jsx("span",{className:"absolute inset-y-0 right-0 w-1.5",style:{background:d?"linear-gradient(180deg, rgba(255,97,152,0.95) 0%, rgba(234,71,170,0.88) 100%)":"linear-gradient(180deg, rgba(148,163,184,0.35) 0%, rgba(100,116,139,0.28) 100%)"}}),u.jsx("h3",{className:"pr-3 text-sm font-extrabold text-[#FBE7F5]",children:o.title}),u.jsx("p",{className:"mt-1.5 pr-3 text-xs leading-6 text-[#F2DFF0]/88",children:o.Message})]},`${o.user_id}-${l}`)})})})})}const fl=new RegExp("(\\p{Extended_Pictographic}(?:\\uFE0F|\\uFE0E)?(?:\\u200D\\p{Extended_Pictographic}(?:\\uFE0F|\\uFE0E)?)*)","gu");function mj(e){const n=Array.from(e).map(a=>{var s;return(s=a.codePointAt(0))==null?void 0:s.toString(16)}).filter(Boolean).join("-");return`https://cdn.jsdelivr.net/gh/microsoft/fluentui-emoji/assets/${n}/3D/${n}.png`}function gj({emoji:e}){const[n,a]=v.useState(!1);return n?u.jsx("span",{className:"mx-0.5 inline-block translate-y-[1px] text-[0.95em] leading-none",children:e}):u.jsx("img",{src:mj(e),alt:e,loading:"lazy",onError:()=>a(!0),className:"mx-0.5 inline-block h-[1.45em] w-[1.45em] translate-y-[0.32em] object-contain",draggable:!1})}function xj(e){return e.split(fl).map((a,s)=>a?fl.test(a)?(fl.lastIndex=0,u.jsx(gj,{emoji:a},`${a}-${s}`)):(fl.lastIndex=0,a):null)}function Vl({text:e}){return u.jsx(u.Fragment,{children:xj(e)})}function yj({text:e,speed:n=30,onTyping:a}){const[s,o]=v.useState(""),[l,d]=v.useState(0);return v.useEffect(()=>{if(l<e.length){const f=setTimeout(()=>{o(g=>g+e[l]),d(g=>g+1),a&&a()},n);return()=>clearTimeout(f)}},[l,e,n,a]),v.useEffect(()=>{o(""),d(0)},[e]),u.jsxs("p",{className:"text-white text-sm break-words whitespace-pre-wrap",children:[u.jsx(Vl,{text:s}),l<e.length&&u.jsx("span",{className:"inline-block w-1 h-4 bg-white/70 ml-0.5 animate-pulse"})]})}const rc="/assets/chatbot-bot-avatar-Bbf-v3Pj.png",vj=["۰","۱","۲","۳","۴","۵","۶","۷","۸","۹"],ba=e=>e.replace(/\d/g,n=>vj[Number(n)]),jg={user:{background:"linear-gradient(145deg, rgba(218, 94, 142, 0.96) 0%, rgba(162, 56, 110, 0.95) 100%)",boxShadow:"0 0 24px rgba(240,110,168,0.28), 0 12px 28px rgba(84, 22, 60, 0.38), inset 0 1px 0 rgba(255,255,255,0.16)",border:"1px solid rgba(255, 178, 214, 0.58)",backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)"},other:{background:"linear-gradient(145deg, rgba(52, 34, 76, 0.94) 0%, rgba(35, 24, 62, 0.94) 100%)",backgroundImage:"linear-gradient(145deg, rgba(52, 34, 76, 0.94) 0%, rgba(35, 24, 62, 0.94) 100%), linear-gradient(120deg, #7c3aed 0%, #f97316 58%, #facc15 100%)",backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",boxShadow:"0 0 24px rgba(152,104,235,0.24), 0 12px 28px rgba(12, 8, 30, 0.4), inset 0 1px 0 rgba(255,255,255,0.12)",border:"0.5px solid transparent",backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)"}};function bj({messages:e,containerRef:n,endRef:a,onTyping:s}){return u.jsx("div",{ref:n,className:"flex-1 overflow-y-auto px-4 pb-20",dir:"rtl",children:u.jsxs("div",{className:"space-y-3",children:[e.map(o=>{const l=o.type==="user",d=o.type==="loading";return u.jsxs(se.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`flex ${l?"justify-start":"justify-end"} items-start gap-2`,children:[u.jsxs("div",{className:"relative max-w-[75%] rounded-[18px] px-4 py-3",style:l?jg.user:jg.other,children:[o.author&&u.jsx("p",{className:"text-xs font-bold mb-1",style:{color:"#8ACEE0"},children:o.author}),d?u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx(se.span,{className:"w-2 h-2 rounded-full bg-white",animate:{opacity:[.3,1,.3]},transition:{duration:1.5,repeat:1/0,delay:0}}),u.jsx(se.span,{className:"w-2 h-2 rounded-full bg-white",animate:{opacity:[.3,1,.3]},transition:{duration:1.5,repeat:1/0,delay:.2}}),u.jsx(se.span,{className:"w-2 h-2 rounded-full bg-white",animate:{opacity:[.3,1,.3]},transition:{duration:1.5,repeat:1/0,delay:.4}})]}):o.type==="other"&&o.isTyping?u.jsx(yj,{text:o.content,speed:30,onTyping:s}):u.jsx("p",{className:"text-white text-sm break-words whitespace-pre-wrap",children:u.jsx(Vl,{text:o.content})}),u.jsx("p",{className:"text-white/60 text-xs mt-1 text-left",children:ba(o.timestamp)})]}),!l&&u.jsx("div",{className:"-mr-1 mt-1 flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-full",style:{background:"radial-gradient(circle, rgba(255,104,205,0.18) 0%, transparent 68%)",filter:"drop-shadow(0 0 8px rgba(255, 104, 205, 0.55)) drop-shadow(0 0 16px rgba(255, 104, 205, 0.28))"},children:u.jsx("img",{src:rc,alt:"چت‌بات",className:"h-10 w-10 object-contain"})})]},o.id)}),u.jsx("div",{ref:a})]})})}function _y({onSendMessage:e,disabled:n=!1}){const[a,s]=v.useState(""),o=v.useRef(null),l=a.trim().length>0&&!n,d=()=>{l&&(e(a.trim()),s(""),setTimeout(()=>{o.current&&(o.current.style.height="24px",o.current.focus())},0))},f=g=>{g.key};return v.useEffect(()=>{if(o.current){o.current.style.height="auto";const g=o.current.scrollHeight,m=96;o.current.style.height=`${Math.min(g,m)}px`}},[a]),u.jsxs("div",{className:"px-3",children:[u.jsxs("div",{className:"flex min-h-[62px] items-center gap-2 rounded-[32px] p-2",style:{backgroundImage:"linear-gradient(180deg, #2E1B3D 0%, #23183E 100%), linear-gradient(120deg, #7c3aed 0%, #f97316 58%, #facc15 100%)",backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",border:"0.5px solid transparent",boxShadow:"0 -7px 20px rgba(7, 0, 18, 0.5), 0 6px 14px rgba(5, 2, 12, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 2px 5px rgba(255, 222, 255, 0.09), inset 0 -2px 0 rgba(12, 7, 27, 0.72), inset 0 -8px 14px rgba(8, 4, 18, 0.34), inset 0 0 0 1px rgba(255, 255, 255, 0.045), inset 0 0 0 2px rgba(17, 10, 35, 0.32)",backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)"},children:[u.jsx("textarea",{ref:o,value:a,onChange:g=>s(g.target.value),onKeyDown:f,placeholder:"پیام خود را بنویسید...",rows:1,dir:"rtl",disabled:n,"aria-label":"پیام خود را بنویسید",className:"chat-input-textarea block flex-1 resize-none bg-transparent py-0 text-right text-white outline-none placeholder:text-[rgba(207,168,212,0.7)] disabled:opacity-50",style:{fontFamily:"Alibaba, sans-serif",textAlign:"right",minHeight:"24px",maxHeight:"96px",lineHeight:"24px",overflow:"hidden",padding:0,fontSize:"16px"}}),u.jsx(se.button,{type:"button",whileTap:{scale:.92},onClick:d,disabled:!l,"aria-label":"ارسال پیام",className:"flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-full",style:{background:l?"linear-gradient(145deg, #F06EA8 0%, #C9579C 52%, #8A4FCF 100%)":"linear-gradient(145deg, rgba(72, 58, 105, 0.72) 0%, rgba(42, 35, 77, 0.76) 100%)",boxShadow:l?"0 0 18px rgba(240, 110, 168, 0.42), inset 0 1px 0 rgba(255,255,255,0.22)":"inset 0 1px 0 rgba(255,255,255,0.12), 0 0 12px rgba(203,117,171,0.12)",border:l?"1px solid rgba(255, 189, 228, 0.5)":"1px solid rgba(198, 111, 177, 0.22)"},children:n?u.jsx(y6,{className:"h-4 w-4 text-[#CFA8D4]/80"}):u.jsx(gy,{className:`h-5 w-5 ${l?"text-white":"text-[#CFA8D4]/70"}`})})]}),u.jsx("style",{children:`
.chat-input-textarea {
scrollbar-width: none;
-ms-overflow-style: none;
}
.chat-input-textarea::-webkit-scrollbar {
display: none;
}
`})]})}const hl={overlay:{backgroundColor:"rgba(0, 0, 0, 0.72)"},container:{backgroundImage:"linear-gradient(180deg, rgba(46, 27, 61, 0.95) 0%, rgba(35, 24, 62, 0.98) 100%), linear-gradient(120deg, #7c3aed 0%, #f97316 58%, #facc15 100%)",backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",border:"0.5px solid transparent",boxShadow:"0 -7px 20px rgba(7, 0, 18, 0.4), 0 10px 22px rgba(5, 2, 12, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -2px 0 rgba(12, 7, 27, 0.62)",backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)"},chatItem:{background:"rgba(255, 255, 255, 0.07)",border:"1px solid rgba(255, 255, 255, 0.12)",boxShadow:"0 8px 18px rgba(8, 4, 20, 0.24), inset 0 1px 0 rgba(255,255,255,0.1)"},closeButton:{background:"linear-gradient(145deg, rgba(240, 110, 168, 0.95) 0%, rgba(201, 87, 156, 0.94) 52%, rgba(138, 79, 207, 0.93) 100%)",boxShadow:"0 0 16px rgba(240, 110, 168, 0.32), inset 0 1px 0 rgba(255,255,255,0.22)",border:"1px solid rgba(255, 189, 228, 0.5)"}};function wj({isOpen:e,onClose:n,isLoading:a=!1,historyItems:s,onSelectChat:o}){return v.useEffect(()=>{const l=d=>{d.key==="Escape"&&n()};if(e)return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[e,n]),u.jsxs(pn,{children:[e&&u.jsx(se.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[100] flex items-center justify-center p-3",style:hl.overlay,onClick:n,children:u.jsxs(se.div,{initial:{opacity:0,y:14},animate:{opacity:1,y:0},exit:{opacity:0,y:10},onClick:l=>l.stopPropagation(),className:"flex w-full max-w-md min-h-0 flex-col overflow-hidden rounded-3xl",style:{...hl.container,maxHeight:"min(78dvh, 620px)"},children:[u.jsx("div",{className:"border-b px-5 py-4",style:{borderColor:"rgba(255, 255, 255, 0.12)"},children:u.jsx("h3",{className:"text-center text-base font-extrabold text-[#FBE7F5]",style:{textShadow:"0 2px 8px rgba(255, 119, 202, 0.3)"},children:"تاریخچه گفتگوها"})}),u.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",style:{maxHeight:"calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 180px)",scrollbarWidth:"none",msOverflowStyle:"none"},children:a?u.jsx("div",{className:"flex h-40 items-center justify-center",children:u.jsxs("div",{className:"text-center",children:[u.jsx("div",{className:"mx-auto mb-3 h-10 w-10 animate-spin rounded-full border-4 border-[#ffd6f0]/30 border-t-[#ff79cf]"}),u.jsx("p",{className:"text-xs font-bold text-[#FBE7F5]",children:"در حال بارگذاری..."})]})}):s.length===0?u.jsx("div",{className:"flex h-40 items-center justify-center text-center",children:u.jsx("p",{className:"text-sm font-bold text-[#F2DFF0]/72",children:"تاریخچه‌ای پیدا نشد"})}):u.jsx("div",{className:"space-y-3",children:s.map((l,d)=>u.jsxs(se.button,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:d*.05,duration:.2},whileTap:{scale:.95},onClick:()=>{n(),o(l.id)},className:"w-full rounded-2xl p-3.5 text-right",style:hl.chatItem,children:[u.jsxs("div",{className:"flex items-start justify-between gap-2",children:[u.jsx("h4",{className:"line-clamp-1 text-sm font-bold text-[#FBE7F5]",children:l.title}),u.jsx("span",{className:"h-2 w-2 shrink-0 rounded-full bg-[#ff78c6]"})]}),!!l.lastMessage&&u.jsx("p",{className:"mt-1 line-clamp-1 text-xs text-[#F2DFF0]/74",children:l.lastMessage}),u.jsx("p",{className:"mt-1 text-[11px] text-[#F2DFF0]/62",children:l.date}),u.jsx("div",{className:"mt-2 h-px w-full bg-white/8"})]},l.id))})}),u.jsx("div",{className:"border-t px-5 pb-[calc(env(safe-area-inset-bottom,0px)+12px)] pt-3",style:{borderColor:"rgba(255, 255, 255, 0.12)"},children:u.jsx(se.button,{whileTap:{scale:.96},onClick:n,className:"w-full rounded-full py-3 text-sm font-bold text-white",style:hl.closeButton,children:"بستن"})})]})}),u.jsx("style",{children:`
.min-h-0.flex-1.overflow-y-auto::-webkit-scrollbar {
display: none;
}
`})]})}const $f=()=>{const e=localStorage.getItem("accessToken");return e||localStorage.getItem("authToken")},kj=async()=>{console.log("loadChatList: Function called");const e=$f();if(console.log("loadChatList: Token:",e?e.substring(0,20)+"...":"null"),!e)return console.error("loadChatList: No token found"),{success:!1,data:[],message:"توکن احراز هویت یافت نشد"};try{console.log("loadChatList: Sending request to:",`${nt}/api/call`);const n=await fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${e}`},body:JSON.stringify({chat_list_load_function:{}})});console.log("loadChatList: Response status:",n.status);const a=await n.json();if(console.log("loadChatList: Response data:",JSON.stringify(a)),a.state===0){console.log("loadChatList: Parsing result.data");const s=JSON.parse(a.data);console.log("loadChatList: Parsed data:",s);const o=JSON.parse(s.chat_list);return console.log("loadChatList: Chat list:",o),{success:!0,data:o}}else return console.error("loadChatList: API returned error state:",a.state,a.message),{success:!1,data:[],message:a.message}}catch(n){return console.error("loadChatList: Exception caught:",n),{success:!1,data:[],message:"خطا در بارگذاری لیست چت‌ها"}}},Sj=async e=>{const n=$f();if(!n)return{success:!1,data:[],message:"توکن احراز هویت یافت نشد"};try{const s=await(await fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${n}`},body:JSON.stringify({chat_load_function:{chatlist_workflowID:e}})})).json();if(s.state===0){const o=JSON.parse(s.data);return{success:!0,data:JSON.parse(o.chats)}}else return{success:!1,data:[],message:s.message}}catch(a){return console.error("Error loading chat:",a),{success:!1,data:[],message:"خطا در بارگذاری چت"}}},Cj=async(e,n="")=>{const a=$f();if(!a)return{success:!1,message:"توکن احراز هویت یافت نشد"};try{const o=await(await fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${a}`},body:JSON.stringify({public_caht_function:{chatlist_workflowID:n,question:e}})})).json();if(o.state===0){const l=JSON.parse(o.data),d=JSON.parse(l.message);return{success:!0,answer:d.answer,newChatlistWorkflowID:d.chatlist_workflowID2}}else return{success:!1,message:o.message}}catch(s){return console.error("Error sending public chat message:",s),{success:!1,message:"خطا در ارسال پیام"}}},ji=()=>{var n;if(typeof globalThis<"u"&&((n=globalThis.crypto)!=null&&n.randomUUID))return globalThis.crypto.randomUUID();const e=Math.random().toString(36).slice(2,10);return`msg-${Date.now()}-${e}`};function jj(){gr("چت عمومی");const[e,n]=v.useState([]),[a,s]=v.useState(!1),[o,l]=v.useState([]),[d,f]=v.useState(!1),[g,m]=v.useState(""),[x,h]=v.useState(!1),[w,k]=v.useState(!1),[j,E]=v.useState(!0),C=v.useRef(null),I=v.useRef(null),M=()=>{const b=C.current;return b?b.scrollHeight-b.scrollTop-b.clientHeight<100:!0},_=(b=!0)=>{var R;(R=I.current)==null||R.scrollIntoView({behavior:b?"smooth":"auto",block:"end"})};v.useEffect(()=>{j&&_()},[e,j]),v.useEffect(()=>{const b=C.current;if(!b)return;const R=()=>{E(M())};return b.addEventListener("scroll",R,{passive:!0}),()=>b.removeEventListener("scroll",R)},[]);const V=b=>{const R=[];return b.forEach(N=>{N.question&&R.push({id:ji(),type:"user",content:N.question,timestamp:ba(N.datetime1)}),N.answer&&R.push({id:ji(),type:"other",content:N.answer,author:"ربات",timestamp:ba(N.datetime1)})}),R},H=async b=>{s(!1),h(!0),m(b);const R=await Sj(b);if(R.success){const N=V(R.data);n(N),requestAnimationFrame(()=>{requestAnimationFrame(()=>{_(!1)})})}else console.error("Failed to load chat:",R.message),alert("خطا در بارگذاری چت");h(!1)},re=async b=>{const R=b.trim(),N=R.replace(/\r?\n+/g," ").trim();if(!N||w)return;const G={id:ji(),type:"user",content:R,timestamp:new Date().toLocaleTimeString("fa-IR",{hour:"2-digit",minute:"2-digit"})},Y=ji(),X={id:Y,type:"loading",content:"",author:"ربات",timestamp:""};E(!0),n(K=>[...K,G,X]),k(!0);try{const K=await Cj(N,g);if(n(te=>te.filter(q=>q.id!==Y)),K.success&&K.answer){K.newChatlistWorkflowID&&m(K.newChatlistWorkflowID);const te={id:ji(),type:"other",content:K.answer,author:"ربات",timestamp:new Date().toLocaleTimeString("fa-IR",{hour:"2-digit",minute:"2-digit"}),isTyping:!0};n(q=>[...q,te])}else alert(K.message||"خطا در ارسال پیام")}catch{n(te=>te.filter(q=>q.id!==Y)),alert("خطا در ارسال پیام")}finally{k(!1)}},O=v.useCallback(async()=>{s(!0),f(!0);try{const b=await kj();if(b.success){const R=[...b.data].sort((G,Y)=>{const X=Date.parse(G.datetime1||""),K=Date.parse(Y.datetime1||"");return!Number.isNaN(X)&&!Number.isNaN(K)?K-X:0}),N=R.every(G=>Number.isNaN(Date.parse(G.datetime1||"")));l(N?[...b.data].reverse():R)}else console.error("Failed to load chat list:",b.message),alert(b.message||"خطا در بارگذاری تاریخچه")}finally{f(!1)}},[]);return v.useEffect(()=>{const b=()=>{O()},R=()=>{w||x||(s(!1),m(""),n([]),E(!0))};return window.addEventListener("public-chat:history",b),window.addEventListener("public-chat:new-chat",R),()=>{window.removeEventListener("public-chat:history",b),window.removeEventListener("public-chat:new-chat",R)}},[O,x,w]),u.jsxs("div",{className:"relative h-full min-h-0 overflow-hidden",children:[u.jsxs("div",{className:"grid h-full min-h-0 grid-rows-[minmax(0,1fr)_auto]",children:[u.jsx("main",{className:"relative min-h-0 overflow-hidden",children:x?u.jsx("div",{className:"flex h-full items-center justify-center px-5",children:u.jsx("p",{className:"text-sm text-white",children:"در حال بارگذاری..."})}):e.length===0?u.jsx("div",{className:"flex h-full items-center justify-center px-5",children:u.jsx("div",{className:"max-w-sm rounded-[22px] border-[0.5px] border-transparent px-5 py-4 text-center",style:{backgroundImage:"linear-gradient(180deg, rgba(46, 27, 61, 0.92) 0%, rgba(35, 24, 62, 0.94) 100%), linear-gradient(120deg, #7c3aed 0%, #f97316 58%, #facc15 100%)",backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",boxShadow:"0 -7px 20px rgba(7, 0, 18, 0.46), 0 6px 14px rgba(5, 2, 12, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -2px 0 rgba(12, 7, 27, 0.66)",backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)"},children:u.jsxs("div",{className:"text-center",children:[u.jsx("div",{className:"mx-auto mb-2 flex h-14 w-14 items-center justify-center rounded-full border border-[#F0A6D8]/45",style:{background:"radial-gradient(circle at 50% 36%, rgba(255, 187, 232, 0.38) 0%, rgba(134, 74, 164, 0.28) 48%, rgba(26, 18, 54, 0.7) 100%)",boxShadow:"0 0 14px rgba(255,104,205,0.48), 0 0 28px rgba(255,104,205,0.22), inset 0 1px 0 rgba(255,255,255,0.22)"},children:u.jsx("img",{src:rc,alt:"چت‌بات",className:"h-11 w-11 object-contain"})}),u.jsx("p",{className:"mb-1.5 text-base font-bold text-[#FBE7F5]",children:"با ربات همدست چت کن!"}),u.jsx("p",{className:"text-xs text-[#EED3EC]/90",children:"سوالاتت رو بپرس و جواب بگیر"})]})})}):u.jsx("div",{className:"h-full min-h-0",children:u.jsx(bj,{messages:e,containerRef:C,endRef:I,onTyping:()=>{j&&_(!1)}})})}),u.jsx("footer",{className:"shrink-0",style:{paddingBottom:"calc(env(safe-area-inset-bottom, 0px) + 12px)"},children:u.jsx("div",{className:"px-3 pt-2",children:u.jsx(_y,{onSendMessage:re,disabled:w})})})]}),u.jsx(wj,{isOpen:a,onClose:()=>s(!1),isLoading:d,historyItems:o.map(b=>({id:b.chatlist_workflowID,title:b.title||"چت عمومی",date:ba(b.datetime1),lastMessage:""})),onSelectChat:H})]})}const Ej=e=>{const[n,a]=v.useState([]),[s,o]=v.useState(!0),[l,d]=v.useState(!1),[f,g]=v.useState(null),[m,x]=v.useState(1),[h,w]=v.useState(!0),k=v.useRef(!1),j=v.useRef(null),E=v.useCallback(async(M,_)=>{if(!e||!e.hasFeed){o(!1);return}if(!k.current){k.current=!0,_?o(!0):d(!0),g(null);try{const V=await J6(e.serverName,M);if(j.current!==e.serverName)return;if(V.success){const H=V.data;(H.length===0||H.length<25)&&w(!1),a(_?H:re=>{const O=new Set(re.map(R=>R.StageID)),b=H.filter(R=>!O.has(R.StageID));return[...re,...b]})}else g(V.message||"خطا در بارگذاری فید")}catch{j.current===e.serverName&&g("خطا در ارتباط با سرور")}finally{j.current===e.serverName&&(o(!1),d(!1)),k.current=!1}}},[e]);v.useEffect(()=>{if(!e){o(!1);return}return j.current=e.serverName,a([]),x(1),w(!0),g(null),E(1,!0),()=>{j.current=null}},[e,E]);const C=v.useCallback(()=>{if(!h||l||s)return;const M=m+1;x(M),E(M,!1)},[h,l,s,m,E]),I=v.useCallback(M=>{a(_=>_.filter(V=>V.StageID.toString()!==M))},[]);return{feedItems:n,initialLoading:s,loadingMore:l,error:f,hasMore:h,loadMore:C,deletePost:I}},fd=e=>typeof e=="string"&&e.trim().length>0,Nj=(e,n)=>{const a=fd(e.image),s=fd(e.film),o=fd(e.audio);let l="image",d,f="";s?(l="video",d=Ny(e.StageID),f=a?Rs(e.StageID):""):o?(l="audio",d=Ty(e.StageID),f=a?Rs(e.StageID):""):a&&(l="image",f=Rs(e.StageID));const g=e.datetimee||e.datetime1||e.create_date||"";return{id:e.StageID.toString(),authorName:e.full_name,authorUsername:e.full_name,authorAvatar:Ts(e.person_stage_id),image:f,title:e.title,caption:e.description,likes:e.like_count,dislikes:e.dislike_count,comments:e.comment_count,timestamp:g,topicName:n,initialComments:[],mediaType:l,mediaUrl:d,isOwnPost:Q6(e.user_id),initialLikeState:e.like_state,missionType:n,workflowID:e.workflow_ID||e.StageID.toString(),teamMemberIds:e.team_member}};function Ly({topicTitle:e,subtitle:n,onBack:a}){return u.jsx("div",{className:"flex-shrink-0 w-full",children:u.jsx(tc,{showBack:!0,onBack:a,centerTitle:e,centerSubtitle:n})})}function Tj({posts:e,loadingMore:n,error:a,onScroll:s,onDelete:o}){const l=v.useCallback(f=>Math.min(f*.1,1),[]),d=v.useMemo(()=>e.map((f,g)=>u.jsx(se.div,{initial:{opacity:0,y:30},animate:{opacity:1,y:0},transition:{delay:l(g)},children:u.jsx(Dy,{...f,onDelete:o})},f.id)),[e,o,l]);return u.jsx("div",{className:"feed-scroll flex-1 overflow-y-auto px-4 pb-56",onScroll:s,children:u.jsxs("div",{className:"pt-6",children:[d,n&&u.jsx("div",{className:"flex items-center justify-center mt-4 mb-4",children:u.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-[#ff9be0]"})}),a&&u.jsx("div",{className:"text-red-500 text-center mt-4 mb-4",children:a})]})})}function Pj({accentColor:e,onStartMission:n}){return u.jsxs("div",{className:"flex flex-col items-center justify-center px-4 py-16 mt-32",children:[u.jsx("div",{className:"w-24 h-24 rounded-full flex items-center justify-center mb-4",style:{background:"linear-gradient(135deg, rgba(138, 206, 224, 0.15) 0%, rgba(62, 121, 131, 0.15) 100%)",border:"2px solid rgba(138, 206, 224, 0.3)"},children:u.jsx(A8,{className:"w-12 h-12",style:{color:e}})}),u.jsx("h3",{className:"text-white text-lg font-bold mb-2",children:"هنوز پستی وجود ندارد"}),u.jsx("p",{className:"text-gray-400 text-sm text-center mb-6",children:"اولین نفری باش که ماموریتشو به اشتراک میذاره!"}),u.jsx(se.button,{whileTap:{scale:.95},onClick:n,className:"px-6 py-3 rounded-full font-bold text-white",style:{background:"linear-gradient(135deg, #FFB800 0%, #FF9500 100%)",boxShadow:"0 4px 16px rgba(255, 165, 0, 0.4)"},children:"شروع ماموریت جدید"})]})}function Rj({onClick:e}){return u.jsx("div",{className:"feed-floating-cta fixed left-0 right-0 z-40 px-4 max-w-md mx-auto pointer-events-none transition-opacity duration-200",style:{bottom:"calc(env(safe-area-inset-bottom, 0px) + 112px)"},children:u.jsxs(se.button,{onClick:e,whileHover:{scale:1.02,y:-2},whileTap:{scale:.98},animate:{y:[0,-4,0]},transition:{y:{duration:2.5,repeat:1/0,ease:"easeInOut"}},className:"pointer-events-auto ml-auto flex items-center gap-2",style:{filter:"drop-shadow(0 8px 18px rgba(12, 5, 24, 0.45))"},children:[u.jsx("span",{className:"rounded-full px-3 py-1.5 text-[11px] font-semibold text-white",style:{background:"linear-gradient(180deg, rgba(88, 52, 126, 0.92) 0%, rgba(48, 31, 85, 0.9) 100%)",border:"1px solid rgba(255, 170, 224, 0.46)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)"},children:"چالش خودت رو شروع کن"}),u.jsx("span",{className:"h-12 w-12 rounded-full flex items-center justify-center",style:{background:"linear-gradient(180deg, #ff79cf 0%, #a855f7 100%)",boxShadow:"inset 0 1px 0 rgba(255,255,255,0.35), 0 10px 20px rgba(31, 9, 51, 0.45)"},"aria-hidden":!0,children:u.jsx(Vf,{size:26,color:"#fff5fb",strokeWidth:2.5})})]})})}function Mj(e){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",n.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}const Fj=e=>{switch(e){case"success":return _j;case"info":return Aj;case"warning":return Lj;case"error":return Oj;default:return null}},Ij=Array(12).fill(0),Dj=({visible:e,className:n})=>ge.createElement("div",{className:["sonner-loading-wrapper",n].filter(Boolean).join(" "),"data-visible":e},ge.createElement("div",{className:"sonner-spinner"},Ij.map((a,s)=>ge.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),_j=ge.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ge.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Lj=ge.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ge.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Aj=ge.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ge.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Oj=ge.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ge.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Bj=ge.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ge.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ge.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),zj=()=>{const[e,n]=ge.useState(document.hidden);return ge.useEffect(()=>{const a=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",a),()=>window.removeEventListener("visibilitychange",a)},[]),e};let Gd=1;class Vj{constructor(){this.subscribe=n=>(this.subscribers.push(n),()=>{const a=this.subscribers.indexOf(n);this.subscribers.splice(a,1)}),this.publish=n=>{this.subscribers.forEach(a=>a(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n]},this.create=n=>{var a;const{message:s,...o}=n,l=typeof(n==null?void 0:n.id)=="number"||((a=n.id)==null?void 0:a.length)>0?n.id:Gd++,d=this.toasts.find(g=>g.id===l),f=n.dismissible===void 0?!0:n.dismissible;return this.dismissedToasts.has(l)&&this.dismissedToasts.delete(l),d?this.toasts=this.toasts.map(g=>g.id===l?(this.publish({...g,...n,id:l,title:s}),{...g,...n,id:l,dismissible:f,title:s}):g):this.addToast({title:s,...o,dismissible:f,id:l}),l},this.dismiss=n=>(n?(this.dismissedToasts.add(n),requestAnimationFrame(()=>this.subscribers.forEach(a=>a({id:n,dismiss:!0})))):this.toasts.forEach(a=>{this.subscribers.forEach(s=>s({id:a.id,dismiss:!0}))}),n),this.message=(n,a)=>this.create({...a,message:n}),this.error=(n,a)=>this.create({...a,message:n,type:"error"}),this.success=(n,a)=>this.create({...a,type:"success",message:n}),this.info=(n,a)=>this.create({...a,type:"info",message:n}),this.warning=(n,a)=>this.create({...a,type:"warning",message:n}),this.loading=(n,a)=>this.create({...a,type:"loading",message:n}),this.promise=(n,a)=>{if(!a)return;let s;a.loading!==void 0&&(s=this.create({...a,promise:n,type:"loading",message:a.loading,description:typeof a.description!="function"?a.description:void 0}));const o=Promise.resolve(n instanceof Function?n():n);let l=s!==void 0,d;const f=o.then(async m=>{if(d=["resolve",m],ge.isValidElement(m))l=!1,this.create({id:s,type:"default",message:m});else if($j(m)&&!m.ok){l=!1;const h=typeof a.error=="function"?await a.error(`HTTP error! status: ${m.status}`):a.error,w=typeof a.description=="function"?await a.description(`HTTP error! status: ${m.status}`):a.description,j=typeof h=="object"&&!ge.isValidElement(h)?h:{message:h};this.create({id:s,type:"error",description:w,...j})}else if(m instanceof Error){l=!1;const h=typeof a.error=="function"?await a.error(m):a.error,w=typeof a.description=="function"?await a.description(m):a.description,j=typeof h=="object"&&!ge.isValidElement(h)?h:{message:h};this.create({id:s,type:"error",description:w,...j})}else if(a.success!==void 0){l=!1;const h=typeof a.success=="function"?await a.success(m):a.success,w=typeof a.description=="function"?await a.description(m):a.description,j=typeof h=="object"&&!ge.isValidElement(h)?h:{message:h};this.create({id:s,type:"success",description:w,...j})}}).catch(async m=>{if(d=["reject",m],a.error!==void 0){l=!1;const x=typeof a.error=="function"?await a.error(m):a.error,h=typeof a.description=="function"?await a.description(m):a.description,k=typeof x=="object"&&!ge.isValidElement(x)?x:{message:x};this.create({id:s,type:"error",description:h,...k})}}).finally(()=>{l&&(this.dismiss(s),s=void 0),a.finally==null||a.finally.call(a)}),g=()=>new Promise((m,x)=>f.then(()=>d[0]==="reject"?x(d[1]):m(d[1])).catch(x));return typeof s!="string"&&typeof s!="number"?{unwrap:g}:Object.assign(s,{unwrap:g})},this.custom=(n,a)=>{const s=(a==null?void 0:a.id)||Gd++;return this.create({jsx:n(s),id:s,...a}),s},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Pn=new Vj,Uj=(e,n)=>{const a=(n==null?void 0:n.id)||Gd++;return Pn.addToast({title:e,...n,id:a}),a},$j=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Hj=Uj,Wj=()=>Pn.toasts,Kj=()=>Pn.getActiveToasts(),Nl=Object.assign(Hj,{success:Pn.success,info:Pn.info,warning:Pn.warning,error:Pn.error,custom:Pn.custom,message:Pn.message,promise:Pn.promise,dismiss:Pn.dismiss,loading:Pn.loading},{getHistory:Wj,getToasts:Kj});Mj("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}[data-sonner-toaster][data-lifted=true]{transform:translateY(-8px)}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function pl(e){return e.label!==void 0}const Yj=3,Gj="24px",Xj="16px",Eg=4e3,qj=356,Jj=14,Qj=45,Zj=200;function jr(...e){return e.filter(Boolean).join(" ")}function eE(e){const[n,a]=e.split("-"),s=[];return n&&s.push(n),a&&s.push(a),s}const tE=e=>{var n,a,s,o,l,d,f,g,m;const{invert:x,toast:h,unstyled:w,interacting:k,setHeights:j,visibleToasts:E,heights:C,index:I,toasts:M,expanded:_,removeToast:V,defaultRichColors:H,closeButton:re,style:O,cancelButtonStyle:b,actionButtonStyle:R,className:N="",descriptionClassName:G="",duration:Y,position:X,gap:K,expandByDefault:te,classNames:q,icons:P,closeButtonAriaLabel:F="Close toast"}=e,[U,W]=ge.useState(null),[T,A]=ge.useState(null),[ee,ie]=ge.useState(!1),[oe,ae]=ge.useState(!1),[ue,ye]=ge.useState(!1),[ve,Ve]=ge.useState(!1),[je,Ue]=ge.useState(!1),[Oe,dt]=ge.useState(0),[yt,vt]=ge.useState(0),Se=ge.useRef(h.duration||Y||Eg),Re=ge.useRef(null),we=ge.useRef(null),me=I===0,Fe=I+1<=E,be=h.type,Ae=h.dismissible!==!1,Qe=h.className||"",Ge=h.descriptionClassName||"",rt=ge.useMemo(()=>C.findIndex(Ye=>Ye.toastId===h.id)||0,[C,h.id]),ht=ge.useMemo(()=>{var Ye;return(Ye=h.closeButton)!=null?Ye:re},[h.closeButton,re]),Qt=ge.useMemo(()=>h.duration||Y||Eg,[h.duration,Y]),Pt=ge.useRef(0),Je=ge.useRef(0),wn=ge.useRef(0),ft=ge.useRef(null),[Mn,Te]=X.split("-"),Ze=ge.useMemo(()=>C.reduce((Ye,Nt,Lt)=>Lt>=rt?Ye:Ye+Nt.height,0),[C,rt]),ot=zj(),it=h.invert||x,Zt=be==="loading";Je.current=ge.useMemo(()=>rt*K+Ze,[rt,Ze]),ge.useEffect(()=>{Se.current=Qt},[Qt]),ge.useEffect(()=>{ie(!0)},[]),ge.useEffect(()=>{const Ye=we.current;if(Ye){const Nt=Ye.getBoundingClientRect().height;return vt(Nt),j(Lt=>[{toastId:h.id,height:Nt,position:h.position},...Lt]),()=>j(Lt=>Lt.filter($t=>$t.toastId!==h.id))}},[j,h.id]),ge.useLayoutEffect(()=>{if(!ee)return;const Ye=we.current,Nt=Ye.style.height;Ye.style.height="auto";const Lt=Ye.getBoundingClientRect().height;Ye.style.height=Nt,vt(Lt),j($t=>$t.find(kt=>kt.toastId===h.id)?$t.map(kt=>kt.toastId===h.id?{...kt,height:Lt}:kt):[{toastId:h.id,height:Lt,position:h.position},...$t])},[ee,h.title,h.description,j,h.id]);const gt=ge.useCallback(()=>{ae(!0),dt(Je.current),j(Ye=>Ye.filter(Nt=>Nt.toastId!==h.id)),setTimeout(()=>{V(h)},Zj)},[h,V,j,Je]);ge.useEffect(()=>{if(h.promise&&be==="loading"||h.duration===1/0||h.type==="loading")return;let Ye;return _||k||ot?(()=>{if(wn.current<Pt.current){const $t=new Date().getTime()-Pt.current;Se.current=Se.current-$t}wn.current=new Date().getTime()})():(()=>{Se.current!==1/0&&(Pt.current=new Date().getTime(),Ye=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),gt()},Se.current))})(),()=>clearTimeout(Ye)},[_,k,h,be,ot,gt]),ge.useEffect(()=>{h.delete&&gt()},[gt,h.delete]);function xr(){var Ye;if(P!=null&&P.loading){var Nt;return ge.createElement("div",{className:jr(q==null?void 0:q.loader,h==null||(Nt=h.classNames)==null?void 0:Nt.loader,"sonner-loader"),"data-visible":be==="loading"},P.loading)}return ge.createElement(Dj,{className:jr(q==null?void 0:q.loader,h==null||(Ye=h.classNames)==null?void 0:Ye.loader),visible:be==="loading"})}const an=h.icon||(P==null?void 0:P[be])||Fj(be);var Vn,Dr;return ge.createElement("li",{tabIndex:0,ref:we,className:jr(N,Qe,q==null?void 0:q.toast,h==null||(n=h.classNames)==null?void 0:n.toast,q==null?void 0:q.default,q==null?void 0:q[be],h==null||(a=h.classNames)==null?void 0:a[be]),"data-sonner-toast":"","data-rich-colors":(Vn=h.richColors)!=null?Vn:H,"data-styled":!(h.jsx||h.unstyled||w),"data-mounted":ee,"data-promise":!!h.promise,"data-swiped":je,"data-removed":oe,"data-visible":Fe,"data-y-position":Mn,"data-x-position":Te,"data-index":I,"data-front":me,"data-swiping":ue,"data-dismissible":Ae,"data-type":be,"data-invert":it,"data-swipe-out":ve,"data-swipe-direction":T,"data-expanded":!!(_||te&&ee),style:{"--index":I,"--toasts-before":I,"--z-index":M.length-I,"--offset":`${oe?Oe:Je.current}px`,"--initial-height":te?"auto":`${yt}px`,...O,...h.style},onDragEnd:()=>{ye(!1),W(null),ft.current=null},onPointerDown:Ye=>{Zt||!Ae||(Re.current=new Date,dt(Je.current),Ye.target.setPointerCapture(Ye.pointerId),Ye.target.tagName!=="BUTTON"&&(ye(!0),ft.current={x:Ye.clientX,y:Ye.clientY}))},onPointerUp:()=>{var Ye,Nt,Lt;if(ve||!Ae)return;ft.current=null;const $t=Number(((Ye=we.current)==null?void 0:Ye.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Fn=Number(((Nt=we.current)==null?void 0:Nt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),kt=new Date().getTime()-((Lt=Re.current)==null?void 0:Lt.getTime()),At=U==="x"?$t:Fn,yr=Math.abs(At)/kt;if(Math.abs(At)>=Qj||yr>.11){dt(Je.current),h.onDismiss==null||h.onDismiss.call(h,h),A(U==="x"?$t>0?"right":"left":Fn>0?"down":"up"),gt(),Ve(!0);return}else{var Ht,L;(Ht=we.current)==null||Ht.style.setProperty("--swipe-amount-x","0px"),(L=we.current)==null||L.style.setProperty("--swipe-amount-y","0px")}Ue(!1),ye(!1),W(null)},onPointerMove:Ye=>{var Nt,Lt,$t;if(!ft.current||!Ae||((Nt=window.getSelection())==null?void 0:Nt.toString().length)>0)return;const kt=Ye.clientY-ft.current.y,At=Ye.clientX-ft.current.x;var yr;const Ht=(yr=e.swipeDirections)!=null?yr:eE(X);!U&&(Math.abs(At)>1||Math.abs(kt)>1)&&W(Math.abs(At)>Math.abs(kt)?"x":"y");let L={x:0,y:0};const z=J=>1/(1.5+Math.abs(J)/20);if(U==="y"){if(Ht.includes("top")||Ht.includes("bottom"))if(Ht.includes("top")&&kt<0||Ht.includes("bottom")&&kt>0)L.y=kt;else{const J=kt*z(kt);L.y=Math.abs(J)<Math.abs(kt)?J:kt}}else if(U==="x"&&(Ht.includes("left")||Ht.includes("right")))if(Ht.includes("left")&&At<0||Ht.includes("right")&&At>0)L.x=At;else{const J=At*z(At);L.x=Math.abs(J)<Math.abs(At)?J:At}(Math.abs(L.x)>0||Math.abs(L.y)>0)&&Ue(!0),(Lt=we.current)==null||Lt.style.setProperty("--swipe-amount-x",`${L.x}px`),($t=we.current)==null||$t.style.setProperty("--swipe-amount-y",`${L.y}px`)}},ht&&!h.jsx&&be!=="loading"?ge.createElement("button",{"aria-label":F,"data-disabled":Zt,"data-close-button":!0,onClick:Zt||!Ae?()=>{}:()=>{gt(),h.onDismiss==null||h.onDismiss.call(h,h)},className:jr(q==null?void 0:q.closeButton,h==null||(s=h.classNames)==null?void 0:s.closeButton)},(Dr=P==null?void 0:P.close)!=null?Dr:Bj):null,(be||h.icon||h.promise)&&h.icon!==null&&((P==null?void 0:P[be])!==null||h.icon)?ge.createElement("div",{"data-icon":"",className:jr(q==null?void 0:q.icon,h==null||(o=h.classNames)==null?void 0:o.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||xr():null,h.type!=="loading"?an:null):null,ge.createElement("div",{"data-content":"",className:jr(q==null?void 0:q.content,h==null||(l=h.classNames)==null?void 0:l.content)},ge.createElement("div",{"data-title":"",className:jr(q==null?void 0:q.title,h==null||(d=h.classNames)==null?void 0:d.title)},h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title),h.description?ge.createElement("div",{"data-description":"",className:jr(G,Ge,q==null?void 0:q.description,h==null||(f=h.classNames)==null?void 0:f.description)},typeof h.description=="function"?h.description():h.description):null),ge.isValidElement(h.cancel)?h.cancel:h.cancel&&pl(h.cancel)?ge.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||b,onClick:Ye=>{pl(h.cancel)&&Ae&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,Ye),gt())},className:jr(q==null?void 0:q.cancelButton,h==null||(g=h.classNames)==null?void 0:g.cancelButton)},h.cancel.label):null,ge.isValidElement(h.action)?h.action:h.action&&pl(h.action)?ge.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||R,onClick:Ye=>{pl(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,Ye),!Ye.defaultPrevented&&gt())},className:jr(q==null?void 0:q.actionButton,h==null||(m=h.classNames)==null?void 0:m.actionButton)},h.action.label):null)};function Ng(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function nE(e,n){const a={};return[e,n].forEach((s,o)=>{const l=o===1,d=l?"--mobile-offset":"--offset",f=l?Xj:Gj;function g(m){["top","right","bottom","left"].forEach(x=>{a[`${d}-${x}`]=typeof m=="number"?`${m}px`:m})}typeof s=="number"||typeof s=="string"?g(s):typeof s=="object"?["top","right","bottom","left"].forEach(m=>{s[m]===void 0?a[`${d}-${m}`]=f:a[`${d}-${m}`]=typeof s[m]=="number"?`${s[m]}px`:s[m]}):g(f)}),a}const rE=ge.forwardRef(function(n,a){const{invert:s,position:o="bottom-right",hotkey:l=["altKey","KeyT"],expand:d,closeButton:f,className:g,offset:m,mobileOffset:x,theme:h="light",richColors:w,duration:k,style:j,visibleToasts:E=Yj,toastOptions:C,dir:I=Ng(),gap:M=Jj,icons:_,containerAriaLabel:V="Notifications"}=n,[H,re]=ge.useState([]),O=ge.useMemo(()=>Array.from(new Set([o].concat(H.filter(T=>T.position).map(T=>T.position)))),[H,o]),[b,R]=ge.useState([]),[N,G]=ge.useState(!1),[Y,X]=ge.useState(!1),[K,te]=ge.useState(h!=="system"?h:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),q=ge.useRef(null),P=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=ge.useRef(null),U=ge.useRef(!1),W=ge.useCallback(T=>{re(A=>{var ee;return(ee=A.find(ie=>ie.id===T.id))!=null&&ee.delete||Pn.dismiss(T.id),A.filter(({id:ie})=>ie!==T.id)})},[]);return ge.useEffect(()=>Pn.subscribe(T=>{if(T.dismiss){requestAnimationFrame(()=>{re(A=>A.map(ee=>ee.id===T.id?{...ee,delete:!0}:ee))});return}setTimeout(()=>{J5.flushSync(()=>{re(A=>{const ee=A.findIndex(ie=>ie.id===T.id);return ee!==-1?[...A.slice(0,ee),{...A[ee],...T},...A.slice(ee+1)]:[T,...A]})})})}),[H]),ge.useEffect(()=>{if(h!=="system"){te(h);return}if(h==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?te("dark"):te("light")),typeof window>"u")return;const T=window.matchMedia("(prefers-color-scheme: dark)");try{T.addEventListener("change",({matches:A})=>{te(A?"dark":"light")})}catch{T.addListener(({matches:ee})=>{try{te(ee?"dark":"light")}catch(ie){console.error(ie)}})}},[h]),ge.useEffect(()=>{H.length<=1&&G(!1)},[H]),ge.useEffect(()=>{const T=A=>{var ee;if(l.every(ae=>A[ae]||A.code===ae)){var oe;G(!0),(oe=q.current)==null||oe.focus()}A.code==="Escape"&&(document.activeElement===q.current||(ee=q.current)!=null&&ee.contains(document.activeElement))&&G(!1)};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[l]),ge.useEffect(()=>{if(q.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,U.current=!1)}},[q.current]),ge.createElement("section",{ref:a,"aria-label":`${V} ${P}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},O.map((T,A)=>{var ee;const[ie,oe]=T.split("-");return H.length?ge.createElement("ol",{key:T,dir:I==="auto"?Ng():I,tabIndex:-1,ref:q,className:g,"data-sonner-toaster":!0,"data-sonner-theme":K,"data-y-position":ie,"data-lifted":N&&H.length>1&&!d,"data-x-position":oe,style:{"--front-toast-height":`${((ee=b[0])==null?void 0:ee.height)||0}px`,"--width":`${qj}px`,"--gap":`${M}px`,...j,...nE(m,x)},onBlur:ae=>{U.current&&!ae.currentTarget.contains(ae.relatedTarget)&&(U.current=!1,F.current&&(F.current.focus({preventScroll:!0}),F.current=null))},onFocus:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||U.current||(U.current=!0,F.current=ae.relatedTarget)},onMouseEnter:()=>G(!0),onMouseMove:()=>G(!0),onMouseLeave:()=>{Y||G(!1)},onDragEnd:()=>G(!1),onPointerDown:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||X(!0)},onPointerUp:()=>X(!1)},H.filter(ae=>!ae.position&&A===0||ae.position===T).map((ae,ue)=>{var ye,ve;return ge.createElement(tE,{key:ae.id,icons:_,index:ue,toast:ae,defaultRichColors:w,duration:(ye=C==null?void 0:C.duration)!=null?ye:k,className:C==null?void 0:C.className,descriptionClassName:C==null?void 0:C.descriptionClassName,invert:s,visibleToasts:E,closeButton:(ve=C==null?void 0:C.closeButton)!=null?ve:f,interacting:Y,position:T,style:C==null?void 0:C.style,unstyled:C==null?void 0:C.unstyled,classNames:C==null?void 0:C.classNames,cancelButtonStyle:C==null?void 0:C.cancelButtonStyle,actionButtonStyle:C==null?void 0:C.actionButtonStyle,closeButtonAriaLabel:C==null?void 0:C.closeButtonAriaLabel,removeToast:W,toasts:H.filter(Ve=>Ve.position==ae.position),heights:b.filter(Ve=>Ve.position==ae.position),setHeights:R,expandByDefault:d,gap:M,expanded:N,swipeDirections:n.swipeDirections})})):null}))}),Tg=e=>e?new Promise(n=>{const a=new Image;a.onload=()=>{if(a.decode){a.decode().then(()=>n()).catch(()=>n());return}n()},a.onerror=()=>n(),a.src=e}):Promise.resolve(),hd=e=>[e.id,e.image,e.authorAvatar].join("|");function aE(){const{topicId:e}=Wl(),n=bn(),{isProfileComplete:a}=mr(),s=v.useMemo(()=>MC(e),[e]);gr((s==null?void 0:s.title)||"فید");const{feedItems:o,initialLoading:l,loadingMore:d,error:f,hasMore:g,loadMore:m,deletePost:x}=Ej(s),h=v.useMemo(()=>s?o.map(K=>Nj(K,s.serverName)):[],[o,s]),[w,k]=v.useState(()=>new Set),[j,E]=v.useState(!1),[C,I]=v.useState({}),[M,_]=v.useState(()=>new Set);v.useEffect(()=>{let K=!1;const te=h.filter(q=>!w.has(hd(q)));if(te.length!==0)return Promise.all(te.map(async q=>(await Promise.all([Tg(q.image),Tg(q.authorAvatar)]),hd(q)))).then(q=>{K||k(P=>{const F=new Set(P);return q.forEach(U=>F.add(U)),F})}),()=>{K=!0}},[h,w]);const V=v.useMemo(()=>h.filter(K=>w.has(hd(K))),[h,w]),H=v.useMemo(()=>h.filter(K=>typeof K.teamMemberIds=="string"&&K.teamMemberIds.trim().length>0),[h]);v.useEffect(()=>{let K=!1;const te=H.filter(q=>!M.has(q.id));if(te.length!==0)return Promise.all(te.map(async q=>{const P=await Ry(q.teamMemberIds.trim());return{id:q.id,members:P.success?P.data:[]}})).then(q=>{K||(I(P=>{const F={...P};return q.forEach(({id:U,members:W})=>{F[U]=W}),F}),_(P=>{const F=new Set(P);return q.forEach(({id:U})=>F.add(U)),F}))}),()=>{K=!0}},[H,M]);const re=h.length===0||V.length===h.length,O=H.length===0||H.every(K=>M.has(K.id));v.useEffect(()=>{!l&&h.length>0&&re&&O&&E(!0)},[re,O,l,h.length]);const b=v.useCallback(K=>{const te=K.currentTarget,q=te.scrollHeight-te.clientHeight-80;te.scrollTop>=q&&!d&&g&&m()},[d,g,m]),R=v.useCallback(()=>{if(!a){Nl.error("لطفاً ابتدا پروفایل خود را در قسمت 'پروفایل من' تکمیل کنید",{duration:3e3,position:"top-center"});return}n(`/challenges/${e}`)},[n,e,a]),N=v.useCallback(()=>{n("/")},[n]);if(!s)return u.jsx("div",{className:"flex items-center justify-center h-screen text-white",children:"موضوع یافت نشد"});const G=!l&&!f&&h.length===0,Y=!l&&h.length>0&&!j,X=V.length<h.length;return u.jsxs("div",{className:"feed-page-shell fixed inset-0 w-full h-screen overflow-hidden",children:[u.jsx(Ka,{position:"fixed",zIndex:0,imageUrl:Rn.feed}),u.jsxs("div",{className:"relative z-10 max-w-md mx-auto h-full flex flex-col",children:[u.jsx(Ly,{topicTitle:s.title,subtitle:"صفحه پست ها",onBack:N}),l||Y?u.jsx("div",{className:"flex-1 flex items-center justify-center",children:u.jsx("div",{className:"animate-spin rounded-full h-10 w-10 border-b-2 border-white"})}):G?u.jsx(Pj,{accentColor:s.accentColor,onStartMission:R}):u.jsx(Tj,{posts:V.map(K=>({...K,preloadedTeamMembers:C[K.id]})),loadingMore:d||X,error:f,onScroll:b,onDelete:x})]}),u.jsx(Rj,{onClick:R}),u.jsx(nc,{fixed:!0})]})}function sE(){return u.jsx(S1,{children:u.jsx(aE,{})})}const iE="/assets/c11973053d8410ffeb3c76aa4d1da6991076e7e1-Cd6V5TCX.png",oE={backgroundImage:"linear-gradient(180deg, rgba(46, 27, 61, 0.92) 0%, rgba(35, 24, 62, 0.94) 100%), linear-gradient(120deg, #7c3aed 0%, #f97316 58%, #facc15 100%)",backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",border:"0.5px solid transparent",boxShadow:"0 -7px 20px rgba(7, 0, 18, 0.46), 0 6px 14px rgba(5, 2, 12, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -2px 0 rgba(12, 7, 27, 0.66)",backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)"};function Fs({type:e,uploadedFile:n,onUpload:a,onRemove:s,fileName:o,label:l,required:d}){const f=e==="video",m=e==="image"&&!n&&!d,x=n?"0.5px solid transparent":d?"1px dashed rgba(250, 204, 21, 0.7)":"1px dashed rgba(216, 180, 254, 0.65)";return u.jsxs("div",{children:[l&&u.jsxs("label",{className:"mb-3 block text-sm font-bold text-[#FBE7F5]",children:[l,d&&u.jsx("span",{className:"mr-2 text-xs font-normal px-2 py-0.5 rounded-full",style:{background:"rgba(250, 204, 21, 0.22)",color:"#FDE68A",border:"1px solid rgba(250, 204, 21, 0.5)"},children:"الزامی"})]}),u.jsx("div",{className:"relative rounded-2xl overflow-hidden",style:m?{background:"linear-gradient(135deg, rgba(168,115,255,0.28) 0%, rgba(138,82,238,0.24) 100%)",border:x,boxShadow:"none"}:{...oE,border:x},children:n?u.jsxs("div",{className:"relative",children:[f?u.jsxs(u.Fragment,{children:[u.jsx("video",{src:n,className:"w-full h-48 object-cover",controls:!1,muted:!0}),u.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:u.jsx("div",{className:"w-14 h-14 rounded-full flex items-center justify-center",style:{background:"rgba(0,0,0,0.5)",border:"2px solid rgba(255,255,255,0.6)"},children:u.jsx(Ql,{className:"w-6 h-6 text-white fill-white ml-1"})})}),o&&u.jsx("div",{className:"absolute bottom-0 left-0 right-0 px-3 py-2",style:{background:"rgba(0,0,0,0.55)"},children:u.jsx("p",{className:"text-white text-xs truncate",children:o})})]}):u.jsx("img",{src:n,alt:"آپلود شده",className:"w-full h-48 object-cover"}),u.jsx(se.button,{whileTap:{scale:.9},onClick:s,className:"absolute top-2 left-2 w-8 h-8 rounded-full flex items-center justify-center",style:{background:"linear-gradient(145deg, rgba(220, 38, 38, 0.9) 0%, rgba(185, 28, 28, 0.9) 100%)",boxShadow:"0 4px 12px rgba(220, 38, 38, 0.4)"},children:u.jsx(_s,{className:"w-4 h-4 text-white"})})]}):u.jsxs("label",{className:"flex h-48 cursor-pointer flex-col items-center justify-center",children:[d?u.jsx("div",{className:"w-12 h-12 rounded-full flex items-center justify-center mb-2",style:{background:"linear-gradient(135deg, rgba(250, 204, 21, 0.26) 0%, rgba(249, 115, 22, 0.24) 100%)",border:"1px solid rgba(250, 204, 21, 0.5)"},children:u.jsx(my,{className:"w-6 h-6 text-white"})}):f?u.jsx(by,{className:"mb-2 h-12 w-12 text-white"}):u.jsx(Uf,{className:"mb-2 h-12 w-12 text-[#F6D8F0]"}),u.jsx("span",{className:`text-sm ${m?"text-[#F6D8F0]":"text-white"}`,children:f?d?"انتخاب کاور برای ویدیو":"کلیک کنید برای آپلود ویدیو":"کلیک کنید برای آپلود تصویر"}),f&&!d&&u.jsx("span",{className:"mt-1 text-xs text-white",children:"MP4، MOV، AVI پشتیبانی می‌شود"}),d&&u.jsx("span",{className:"mt-1 text-xs text-[#F6D8F0]",children:"تصویری که نمایش داده می‌شود"}),u.jsx("input",{type:"file",accept:f?"video/*":"image/*",onChange:a,className:"hidden"})]})})]})}const lE={backgroundImage:"linear-gradient(180deg, rgba(46, 27, 61, 0.92) 0%, rgba(35, 24, 62, 0.94) 100%), linear-gradient(120deg, #7c3aed 0%, #f97316 58%, #facc15 100%)",backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",border:"1px solid #d680ff66",boxShadow:"0 -7px 20px rgba(7, 0, 18, 0.46), 0 6px 14px rgba(5, 2, 12, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -2px 0 rgba(12, 7, 27, 0.66)",backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)"};function cE(e,n){const[a,s]=v.useState(e);return v.useEffect(()=>{const o=setTimeout(()=>{s(e)},n);return()=>{clearTimeout(o)}},[e,n]),a}async function uE(e){try{const n=localStorage.getItem("accessToken");if(!n)return console.error("No token found"),null;const a=await fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${n}`},body:JSON.stringify({get_person_function:{mobile:e.replace(/^0/,"")}})});if(!a.ok)return null;const s=await a.json();if(s.state===0&&s.data){const o=JSON.parse(s.data);if(o.full_name&&o.user_id)return{fullName:o.full_name,userId:o.user_id}}return null}catch(n){return console.error("Error verifying phone:",n),null}}function dE({teammate:e,canRemove:n,allTeammates:a,currentUserPhone:s,currentUserId:o,onRemove:l,onChange:d,onVerify:f}){const[g,m]=v.useState(!1),[x,h]=v.useState(""),w=cE(e.phone,1e3),k=v.useMemo(()=>a.map(C=>C.phone).join(","),[a]);v.useEffect(()=>{(async()=>{if(w===x)return;if(!w){h("");return}if(!/^09\d{9}$/.test(w)){h("");return}if(a.find(_=>_.id!==e.id&&_.phone===w)){f("","","این شماره قبلاً وارد شده است"),h(w);return}m(!0);const M=await uE(w);if(m(!1),M){if(M.userId===o){f("","","شما نمی‌توانید خودتان را به عنوان عضو اضافه کنید"),h(w);return}f(M.fullName,M.userId)}else f("","","کاربر یافت نشد");h(w)})()},[w,o,k,e.id,x]);const j=e.error||e.fullName===""&&/^09\d{9}$/.test(e.phone),E=e.fullName&&!e.error;return u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("div",{className:"flex-1 relative",children:[u.jsx("input",{type:"tel",value:e.phone,onChange:C=>{const I=C.target.value;(I===""||/^[0-9]*$/.test(I))&&d(I)},placeholder:"۰۹۱۲۳۴۵۶۷۸۹",dir:"ltr",maxLength:11,className:"h-14 w-full rounded-full py-[12px] pl-[43px] pr-[48px] text-base text-white outline-none placeholder:text-white/45",style:lE}),u.jsxs("div",{className:"absolute left-3 top-1/2 -translate-y-1/2",children:[g&&u.jsx(M8,{className:"h-5 w-5 animate-spin text-[#D8B4FE]"}),!g&&E&&u.jsx(p8,{className:"m-[0px] h-5 w-5 text-emerald-300"}),!g&&j&&u.jsx(py,{className:"h-5 w-5 text-rose-300"})]})]}),n&&u.jsx(se.button,{type:"button",whileTap:{scale:.9},onClick:l,className:"w-10 h-10 rounded-full flex items-center justify-center flex-shrink-0",style:{background:"linear-gradient(135deg, rgba(220, 38, 38, 0.85) 0%, rgba(185, 28, 28, 0.85) 100%)",boxShadow:"0 4px 12px rgba(220, 38, 38, 0.4)"},children:u.jsx(_s,{className:"w-5 h-5 text-white"})})]}),!g&&E&&u.jsxs("div",{className:"m-[0px] flex items-center gap-1 px-[8px] py-[0px] text-sm text-emerald-300",children:[u.jsx("span",{children:"✓"}),u.jsx("span",{children:e.fullName})]}),!g&&e.error&&u.jsxs("div",{className:"flex items-center gap-1 px-2 text-sm text-rose-300",children:[u.jsx("span",{children:"✗"}),u.jsx("span",{children:e.error})]}),!g&&!e.error&&e.fullName===""&&/^09\d{9}$/.test(e.phone)&&u.jsxs("div",{className:"flex items-center gap-1 px-2 text-sm text-rose-300",children:[u.jsx("span",{children:"✗"}),u.jsx("span",{children:"کاربر یافت نشد"})]})]})}function Hf({teammates:e,onAdd:n,onRemove:a,onChange:s,onVerify:o}){const[l,d]=v.useState(""),[f,g]=v.useState("");return v.useEffect(()=>{const m=hr();m!=null&&m.username&&d(m.username),m!=null&&m.user_id&&g(m.user_id)},[]),u.jsxs("div",{children:[u.jsx("label",{className:"mb-3 block text-sm font-bold text-[#FBE7F5]",children:"شماره تلفن هم‌تیمی‌ها"}),u.jsxs("div",{className:"space-y-3",children:[e.map(m=>u.jsx(dE,{teammate:m,canRemove:e.length>1,allTeammates:e,currentUserPhone:l,currentUserId:f,onRemove:()=>a(m.id),onChange:x=>s(m.id,x),onVerify:(x,h,w)=>o(m.id,x,h,w)},m.id)),u.jsxs(se.button,{type:"button",whileTap:{scale:.95},onClick:n,className:"w-full px-4 py-3 rounded-2xl text-white text-sm font-bold flex items-center justify-center gap-2",style:{background:"linear-gradient(135deg, rgba(168,115,255,0.28) 0%, rgba(138,82,238,0.24) 100%)",border:"1px dashed rgba(216, 180, 254, 0.65)"},children:[u.jsx(Vf,{className:"w-5 h-5"}),"افزودن هم‌تیمی"]})]})]})}const Pg={backgroundImage:"linear-gradient(180deg, rgba(46, 27, 61, 0.92) 0%, rgba(35, 24, 62, 0.94) 100%), linear-gradient(120deg, #7c3aed 0%, #f97316 58%, #facc15 100%)",backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",border:"1px solid #d680ff66",boxShadow:"0 -7px 20px rgba(7, 0, 18, 0.46), 0 6px 14px rgba(5, 2, 12, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -2px 0 rgba(12, 7, 27, 0.66)",backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)"};function Sa({label:e,value:n,onChange:a,placeholder:s,multiline:o,rows:l=6}){return u.jsxs("div",{children:[u.jsx("label",{className:"mb-3 block text-sm font-bold text-[#FBE7F5]",children:e}),o?u.jsx("textarea",{value:n,onChange:d=>a(d.target.value),placeholder:s,dir:"rtl",rows:l,className:"w-full resize-none rounded-3xl px-4 py-3 text-sm text-white outline-none placeholder:text-white/45",style:Pg}):u.jsx("input",{type:"text",value:n,onChange:d=>a(d.target.value),placeholder:s,dir:"rtl",className:"h-14 w-full rounded-full px-4 text-base text-white outline-none placeholder:text-white/45",style:Pg})]})}const pd=()=>`teammate-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;function md({topicId:e,topicTitle:n,onSubmit:a}){const s=Vs(e),{refreshProfile:o}=mr(),[l,d]=v.useState(""),[f,g]=v.useState(""),[m,x]=v.useState([{id:pd(),phone:""}]),[h,w]=v.useState(null),[k,j]=v.useState(null),[E,C]=v.useState(!1),[I,M]=v.useState(""),_=R=>{var G;const N=(G=R.target.files)==null?void 0:G[0];if(N){j(N);const Y=new FileReader;Y.onloadend=()=>w(Y.result),Y.readAsDataURL(N)}},V=()=>{x([...m,{id:pd(),phone:""}])},H=R=>{const N=m.filter(G=>G.id!==R);x(N.length>0?N:[{id:pd(),phone:""}])},re=(R,N)=>{x(m.map(G=>G.id===R?{...G,phone:N,fullName:void 0,userId:void 0,error:void 0}:G))},O=(R,N,G,Y)=>{x(m.map(X=>X.id===R?{...X,fullName:N,userId:G,error:Y}:X))},b=async()=>{if(!E){C(!0);try{let R="";if(k){M("در حال آپلود تصویر...");const X=await Ls(k);if(X)R=X;else{alert("خطا در آپلود تصویر"),C(!1),M("");return}}const N=m.filter(X=>X.userId).map(X=>X.userId).join(","),G=localStorage.getItem("current_workflow_ID")||"";M("در حال ثبت ماموریت...");const Y=await ec({title:l||"",mission_type:n,mission_done_workflowID:G,description:f||"",film:"",image:R,audio:"",team_member:N});Y.success?(await o(),a({topicId:e,title:l,learnings:f,teammates:N?[N]:[],mediaType:"image",uploadedImage:h})):alert(Y.message||"خطا در ثبت ماموریت")}catch(R){console.error("Error submitting:",R),alert("خطا در ثبت ماموریت")}finally{C(!1),M("")}}};return u.jsxs("div",{className:"space-y-6",dir:"rtl",children:[u.jsx(Fs,{type:"image",uploadedFile:h,onUpload:_,onRemove:()=>w(null),label:"تصویر چالش"}),s.requiresTeammates&&u.jsx(Hf,{teammates:m,onAdd:V,onRemove:H,onChange:re,onVerify:O}),u.jsx(Sa,{label:"عنوان چالش",value:l,onChange:d,placeholder:"عنوان چالش خود را وارد کنید..."}),u.jsx(Sa,{label:"از این چالش چه چیزی یاد گرفتیم",value:f,onChange:g,placeholder:"توضیحات خود را وارد کنید...",multiline:!0,rows:6}),u.jsx(se.button,{whileTap:{scale:.95},onClick:b,disabled:E,className:"w-full py-4 rounded-full text-white text-base font-bold mb-6",style:{backgroundImage:E?"linear-gradient(145deg, rgba(72, 58, 105, 0.72) 0%, rgba(42, 35, 77, 0.76) 100%)":"linear-gradient(90deg, rgba(255,139,91,1) 0%, rgba(238,91,166,1) 45%, rgba(147,78,255,1) 100%), linear-gradient(120deg, #7c3aed 0%, #f97316 58%, #facc15 100%)",backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",boxShadow:E?"inset 0 1px 0 rgba(255,255,255,0.12)":"0 10px 26px rgba(196, 87, 255, 0.35), inset 0 1px 0 rgba(255,255,255,0.35)",border:"1px solid transparent",opacity:E?.7:1,cursor:E?"not-allowed":"pointer"},children:E?"در حال ثبت...":"ثبت نهایی چالش"}),I&&u.jsx(se.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"text-center mb-4 p-4 rounded-2xl",style:{backgroundImage:"linear-gradient(180deg, rgba(46, 27, 61, 0.88) 0%, rgba(35, 24, 62, 0.92) 100%), linear-gradient(120deg, #7c3aed 0%, #f97316 58%, #facc15 100%)",backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",border:"0.5px solid transparent"},children:u.jsxs("div",{className:"flex items-center justify-center gap-3",children:[u.jsx(se.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},className:"w-5 h-5 border-2 border-[#D8B4FE] border-t-transparent rounded-full"}),u.jsx("span",{className:"text-[#FBE7F5] font-bold text-sm",children:I})]})})]})}const gd=()=>`teammate-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;function xd({topicId:e,topicTitle:n,onSubmit:a}){const s=Vs(e),{refreshProfile:o}=mr(),[l,d]=v.useState(""),[f,g]=v.useState(""),[m,x]=v.useState([{id:gd(),phone:""}]),[h,w]=v.useState("image"),[k,j]=v.useState(null),[E,C]=v.useState(null),[I,M]=v.useState(null),[_,V]=v.useState(null),[H,re]=v.useState(null),[O,b]=v.useState(null),[R,N]=v.useState(!1),[G,Y]=v.useState(""),X=ee=>{var oe;const ie=(oe=ee.target.files)==null?void 0:oe[0];if(ie){C(ie);const ae=new FileReader;ae.onloadend=()=>j(ae.result),ae.readAsDataURL(ie)}},K=ee=>{var oe;const ie=(oe=ee.target.files)==null?void 0:oe[0];if(ie){V(ie);const ae=URL.createObjectURL(ie);M({url:ae,name:ie.name}),re(null),b(null)}},te=ee=>{var oe;const ie=(oe=ee.target.files)==null?void 0:oe[0];if(ie){b(ie);const ae=new FileReader;ae.onloadend=()=>re(ae.result),ae.readAsDataURL(ie)}},q=ee=>{w(ee),j(null),C(null),M(null),V(null),re(null),b(null)},P=()=>{x([...m,{id:gd(),phone:""}])},F=ee=>{const ie=m.filter(oe=>oe.id!==ee);x(ie.length>0?ie:[{id:gd(),phone:""}])},U=(ee,ie)=>{x(m.map(oe=>oe.id===ee?{...oe,phone:ie,fullName:void 0,userId:void 0,error:void 0}:oe))},W=(ee,ie,oe,ae)=>{x(m.map(ue=>ue.id===ee?{...ue,fullName:ie,userId:oe,error:ae}:ue))},T=async()=>{if(!R){N(!0);try{let ee="",ie="";if(h==="video"){if(!_||!O){alert("لطفاً ویدیو و کاور آن را انتخاب کنید"),N(!1);return}Y("در حال آپلود ویدیو...");const ye=await Py(_);if(!ye){alert("خطا در آپلود ویدیو"),N(!1),Y("");return}ie=ye,Y("در حال آپلود کاور ویدیو...");const ve=await Ls(O);if(!ve){alert("خطا در آپلود کاور ویدیو"),N(!1),Y("");return}ee=ve}else if(h==="image"&&E){Y("در حال آپلود تصویر...");const ye=await Ls(E);if(!ye){alert("خطا در آپلود تصویر"),N(!1),Y("");return}ee=ye}const oe=m.filter(ye=>ye.userId).map(ye=>ye.userId).join(","),ae=localStorage.getItem("current_workflow_ID")||"";Y("در حال ثبت ماموریت...");const ue=await ec({title:l||"",mission_type:n,mission_done_workflowID:ae,description:f||"",film:ie,image:ee,audio:"",team_member:oe});ue.success?(await o(),a({topicId:e,title:l,learnings:f,teammates:oe?[oe]:[],mediaType:h,uploadedImage:k,uploadedVideo:I,videoCover:H})):alert(ue.message||"خطا در ثبت ماموریت")}catch(ee){console.error("Error submitting:",ee),alert("خطا در ثبت ماموریت")}finally{N(!1),Y("")}}},A=h==="video"&&I!==null&&H===null;return u.jsxs("div",{className:"space-y-6",dir:"rtl",children:[u.jsxs("div",{children:[u.jsx("label",{className:"mb-3 block text-sm font-bold text-[#FBE7F5]",children:"رسانه چالش"}),u.jsx("div",{className:"flex rounded-2xl p-1 mb-4",style:{backgroundImage:"linear-gradient(180deg, rgba(46, 27, 61, 0.92) 0%, rgba(35, 24, 62, 0.94) 100%), linear-gradient(120deg, #7c3aed 0%, #f97316 58%, #facc15 100%)",backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",border:"0.5px solid transparent"},children:["image","video"].map(ee=>u.jsx(se.button,{whileTap:{scale:.96},onClick:()=>q(ee),className:"flex-1 flex items-center justify-center gap-2 py-2.5 rounded-xl text-sm font-bold transition-all duration-300",style:h===ee?{background:"linear-gradient(135deg, rgba(174, 117, 255, 0.96) 0%, rgba(138, 82, 238, 0.95) 46%, rgba(102, 55, 204, 0.94) 100%)",color:"#FFFFFF",boxShadow:"0 0 18px rgba(155,108,241,0.4)"}:{color:"rgba(251,231,245,0.72)"},children:ee==="image"?u.jsxs(u.Fragment,{children:[u.jsx(my,{className:"w-4 h-4"})," عکس"]}):u.jsxs(u.Fragment,{children:[u.jsx(by,{className:"w-4 h-4"})," ویدیو"]})},ee))}),u.jsxs(pn,{mode:"wait",children:[h==="image"&&u.jsx(se.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},transition:{duration:.25},children:u.jsx(Fs,{type:"image",uploadedFile:k,onUpload:X,onRemove:()=>j(null)})},"image-upload"),h==="video"&&u.jsxs(se.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},transition:{duration:.25},className:"space-y-4",children:[u.jsx(Fs,{type:"video",uploadedFile:(I==null?void 0:I.url)||null,onUpload:K,onRemove:()=>{M(null),re(null)},fileName:I==null?void 0:I.name}),u.jsx(pn,{children:I&&u.jsx(se.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.3},children:u.jsx(Fs,{type:"image",uploadedFile:H,onUpload:te,onRemove:()=>re(null),label:"کاور ویدیو",required:!0})})})]},"video-upload")]})]}),s.requiresTeammates&&u.jsx(Hf,{teammates:m,onAdd:P,onRemove:F,onChange:U,onVerify:W}),u.jsx(Sa,{label:"عنوان چالش",value:l,onChange:d,placeholder:"عنوان چالش خود را وارد کنید..."}),u.jsx(Sa,{label:"از این چالش چه چیزی یاد گرفتیم",value:f,onChange:g,placeholder:"توضیحات خود را وارد کنید...",multiline:!0,rows:6}),u.jsx(se.button,{whileTap:{scale:.95},onClick:T,disabled:A||R,className:"w-full py-4 rounded-full text-white text-base font-bold mb-6 transition-opacity",style:{backgroundImage:A||R?"linear-gradient(145deg, rgba(72, 58, 105, 0.72) 0%, rgba(42, 35, 77, 0.76) 100%)":"linear-gradient(90deg, rgba(255,139,91,1) 0%, rgba(238,91,166,1) 45%, rgba(147,78,255,1) 100%), linear-gradient(120deg, #7c3aed 0%, #f97316 58%, #facc15 100%)",backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",boxShadow:A||R?"inset 0 1px 0 rgba(255,255,255,0.12)":"0 10px 26px rgba(196, 87, 255, 0.35), inset 0 1px 0 rgba(255,255,255,0.35)",border:"1px solid transparent"},children:A?"ابتدا کاور ویدیو را انتخاب کنید":R?"در حال ارسال...":"ثبت نهایی چالش"}),G&&u.jsx(se.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"text-center mb-4 p-4 rounded-2xl",style:{backgroundImage:"linear-gradient(180deg, rgba(46, 27, 61, 0.88) 0%, rgba(35, 24, 62, 0.92) 100%), linear-gradient(120deg, #7c3aed 0%, #f97316 58%, #facc15 100%)",backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",border:"0.5px solid transparent"},children:u.jsxs("div",{className:"flex items-center justify-center gap-3",children:[u.jsx(se.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},className:"w-5 h-5 border-2 border-[#D8B4FE] border-t-transparent rounded-full"}),u.jsx("span",{className:"text-[#FBE7F5] font-bold text-sm",children:G})]})})]})}function fE({onSupervisorDataChange:e,initialMobile:n="",initialCode:a=""}){const[s,o]=v.useState(""),[l,d]=v.useState(""),[f,g]=v.useState(!1),[m,x]=v.useState(!1);v.useEffect(()=>{n&&a?(o(n),d(""),g(!0)):n&&!a&&o(n)},[n,a]),v.useEffect(()=>{const k=s.length===10?`0${s}`:s;e(k,l)},[s,l,e]);const h=async()=>{if(!s||s.length<10){alert("لطفاً شماره تلفن معتبر وارد کنید");return}const k=localStorage.getItem("current_workflow_ID");if(!k){alert("خطا: شناسه ماموریت یافت نشد. لطفاً دوباره تلاش کنید.");return}x(!0);const j=s.length===10?`0${s}`:s;try{const E=await oC(j,k);E.success?(g(!0),alert(E.message||`کد تأیید به شماره ${s} ارسال شد`)):alert(E.message||"خطا در ارسال کد. لطفاً دوباره تلاش کنید.")}catch(E){console.error("Error sending supervisor code:",E),alert("خطا در ارتباط با سرور. لطفاً دوباره تلاش کنید.")}finally{x(!1)}},w=()=>{g(!1),d("")};return u.jsxs("div",{className:"relative overflow-hidden rounded-3xl p-6",style:{backgroundImage:"linear-gradient(180deg, rgba(46, 27, 61, 0.92) 0%, rgba(35, 24, 62, 0.94) 100%), linear-gradient(120deg, #7c3aed 0%, #f97316 58%, #facc15 100%)",backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",border:"0.5px solid transparent",boxShadow:"0 -7px 20px rgba(7, 0, 18, 0.46), 0 6px 14px rgba(5, 2, 12, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -2px 0 rgba(12, 7, 27, 0.66)",backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)"},children:[u.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[u.jsx("div",{className:"w-10 h-10 rounded-full flex items-center justify-center",style:{background:"linear-gradient(145deg, #A873FF 0%, #8A52EE 55%, #6637CC 100%)",boxShadow:"0 4px 12px rgba(155,108,241,0.45)"},children:u.jsx(a6,{className:"w-5 h-5 text-white"})}),u.jsxs("div",{className:"flex-1",children:[u.jsx("h3",{className:"text-base font-bold text-[#FBE7F5]",children:"درخواست معرفی ناظر"}),u.jsx("p",{className:"mt-0.5 text-sm text-[#EED3EC]/85",children:"شماره تلفن ناظر خود را وارد کنید"})]})]}),u.jsxs("div",{className:"space-y-4",children:[u.jsx("div",{className:"relative",children:u.jsx("input",{type:"tel",value:s,onChange:k=>o(k.target.value.replace(/\D/g,"")),maxLength:11,placeholder:"09123456789",disabled:f,className:"w-full px-4 py-3 rounded-2xl text-white text-center text-lg font-bold tracking-wider",style:{background:"rgba(26, 18, 54, 0.6)",border:"1px solid rgba(216, 180, 254, 0.45)",outline:"none"},dir:"ltr"})}),!f&&u.jsx(se.button,{whileTap:{scale:.95},onClick:h,disabled:m||s.length<10,className:"w-full py-3 rounded-2xl text-white font-bold flex items-center justify-center gap-2",style:{background:s.length>=10?"linear-gradient(135deg, rgba(174, 117, 255, 0.96) 0%, rgba(138, 82, 238, 0.95) 46%, rgba(102, 55, 204, 0.94) 100%)":"linear-gradient(145deg, rgba(72, 58, 105, 0.72) 0%, rgba(42, 35, 77, 0.76) 100%)",boxShadow:s.length>=10?"0 0 18px rgba(155,108,241,0.4), 0 10px 20px rgba(24, 10, 54, 0.34)":"inset 0 1px 0 rgba(255,255,255,0.12)",cursor:s.length>=10?"pointer":"not-allowed"},children:m?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin"}),"در حال ارسال..."]}):u.jsxs(u.Fragment,{children:[u.jsx(gy,{className:"w-5 h-5"}),"ارسال کد تأیید"]})}),f&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"relative",children:u.jsx("input",{type:"text",value:l,onChange:k=>d(k.target.value.replace(/\D/g,"")),maxLength:6,placeholder:"کد تأیید را وارد کنید",className:"w-full px-4 py-3 rounded-2xl text-white text-center text-xl font-bold tracking-widest",style:{background:"rgba(10, 20, 35, 0.6)",border:"2px solid rgba(168, 144, 224, 0.4)",outline:"none"},dir:"ltr"})}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx("button",{onClick:w,className:"flex-1 py-2.5 rounded-2xl text-white/80 text-sm font-bold hover:text-white transition-colors",style:{background:"rgba(138, 82, 238, 0.22)",border:"1px solid rgba(216, 180, 254, 0.45)"},children:"تغییر شماره"}),u.jsx("button",{onClick:()=>{g(!1),d("")},className:"flex-1 py-2.5 rounded-2xl text-white/80 text-sm font-bold hover:text-white transition-colors",style:{background:"rgba(138, 82, 238, 0.22)",border:"1px solid rgba(216, 180, 254, 0.45)"},children:"ارسال مجدد کد"})]})]})]})]})}function hE({topicId:e,topicTitle:n,onSubmit:a,doingMission:s}){const{refreshProfile:o}=mr(),[l,d]=v.useState(""),[f,g]=v.useState(""),[m,x]=v.useState(null),[h,w]=v.useState(null),[k,j]=v.useState(""),[E,C]=v.useState(""),[I,M]=v.useState(!1),[_,V]=v.useState(""),H=(s==null?void 0:s.mobile)||"",re=(s==null?void 0:s.code)||"",O=N=>{var Y;const G=(Y=N.target.files)==null?void 0:Y[0];if(G){w(G);const X=new FileReader;X.onloadend=()=>x(X.result),X.readAsDataURL(G)}},b=(N,G)=>{j(N),C(G)},R=async()=>{if(k.length<10){alert("لطفاً شماره تلفن ناظر را به طور کامل وارد کنید");return}if(E.length<6){alert("لطفاً کد تأیید 6 رقمی ناظر را وارد کنید");return}if(!I){M(!0);try{let N="";if(h){V("در حال آپلود تصویر...");const K=await Ls(h);if(K)N=K;else{alert("خطا در آپلود تصویر"),M(!1),V("");return}}const G=localStorage.getItem("current_workflow_ID")||"",Y=k.length===10?`0${k}`:k;V("در حال ثبت ماموریت...");const X=await ec({title:l||"",mission_type:n,mission_done_workflowID:G,description:f||"",film:"",image:N,audio:"",team_member:"",enter_code:E});X.success?(await o(),a({topicId:e,title:l,learnings:f,mediaType:"image",uploadedImage:m,supervisor:{phone:k,code:E}})):alert(X.message||"خطا در ثبت ماموریت")}catch(N){console.error("Error submitting:",N),alert("خطا در ثبت ماموریت")}finally{M(!1),V("")}}};return u.jsxs("div",{className:"space-y-6",dir:"rtl",children:[u.jsx(Fs,{type:"image",uploadedFile:m,onUpload:O,onRemove:()=>x(null),label:"تصویر چالش"}),u.jsx(fE,{onSupervisorDataChange:b,initialMobile:H,initialCode:re}),u.jsx(Sa,{label:"عنوان چالش",value:l,onChange:d,placeholder:"عنوان چالش خود را وارد کنید..."}),u.jsx(Sa,{label:"از این چالش چه چیزی یاد گرفتیم",value:f,onChange:g,placeholder:"توضیحات خود را وارد کنید...",multiline:!0,rows:6}),u.jsx(se.button,{whileTap:{scale:.95},onClick:R,disabled:k.length<10||E.length<6||I,className:"w-full py-4 rounded-full text-white text-base font-bold mb-6",style:{backgroundImage:k.length>=10&&E.length>=6&&!I?"linear-gradient(90deg, rgba(255,139,91,1) 0%, rgba(238,91,166,1) 45%, rgba(147,78,255,1) 100%), linear-gradient(120deg, #7c3aed 0%, #f97316 58%, #facc15 100%)":"linear-gradient(145deg, rgba(72, 58, 105, 0.72) 0%, rgba(42, 35, 77, 0.76) 100%)",backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",boxShadow:k.length>=10&&E.length>=6&&!I?"0 10px 26px rgba(196, 87, 255, 0.35), inset 0 1px 0 rgba(255,255,255,0.35)":"inset 0 1px 0 rgba(255,255,255,0.12)",border:"1px solid transparent",cursor:k.length>=10&&E.length>=6&&!I?"pointer":"not-allowed",opacity:I?.7:1},children:k.length<10||E.length<6?"لطفاً شماره و کد ناظر را کامل کنید":I?"در حال ثبت...":"ثبت نهایی چالش"}),_&&u.jsx(se.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"text-center mb-4 p-4 rounded-2xl",style:{backgroundImage:"linear-gradient(180deg, rgba(46, 27, 61, 0.88) 0%, rgba(35, 24, 62, 0.92) 100%), linear-gradient(120deg, #7c3aed 0%, #f97316 58%, #facc15 100%)",backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",border:"0.5px solid transparent"},children:u.jsxs("div",{className:"flex items-center justify-center gap-3",children:[u.jsx(se.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},className:"w-5 h-5 border-2 border-[#D8B4FE] border-t-transparent rounded-full"}),u.jsx("span",{className:"text-[#FBE7F5] font-bold text-sm",children:_})]})})]})}function pE({uploadedAudio:e,onUpload:n,onRemove:a,label:s="پادکست صوتی"}){const o=v.useRef(null);return u.jsxs("div",{className:"relative overflow-hidden rounded-3xl p-6",style:{backgroundImage:"linear-gradient(180deg, rgba(46, 27, 61, 0.92) 0%, rgba(35, 24, 62, 0.94) 100%), linear-gradient(120deg, #7c3aed 0%, #f97316 58%, #facc15 100%)",backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",border:"0.5px solid transparent",boxShadow:"0 -7px 20px rgba(7, 0, 18, 0.46), 0 6px 14px rgba(5, 2, 12, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -2px 0 rgba(12, 7, 27, 0.66)",backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)"},children:[u.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[u.jsx("div",{className:"w-10 h-10 rounded-full flex items-center justify-center",style:{background:"linear-gradient(145deg, #A873FF 0%, #8A52EE 55%, #6637CC 100%)",boxShadow:"0 4px 12px rgba(155,108,241,0.45)"},children:u.jsx(B8,{className:"w-5 h-5 text-white"})}),u.jsxs("div",{children:[u.jsx("h3",{className:"text-base font-bold text-[#FBE7F5]",children:s}),u.jsx("p",{className:"text-sm text-[#EED3EC]/85",children:"MP3, WAV, M4A"})]})]}),e?u.jsxs("div",{className:"relative rounded-2xl p-4",style:{background:"rgba(26, 18, 54, 0.6)",border:"1px solid rgba(216, 180, 254, 0.45)"},children:[u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsx("div",{className:"w-14 h-14 rounded-xl flex items-center justify-center flex-shrink-0",style:{background:"linear-gradient(145deg, #A873FF 0%, #8A52EE 55%, #6637CC 100%)",boxShadow:"0 4px 12px rgba(155,108,241,0.45)"},children:u.jsx(V8,{className:"w-7 h-7 text-white"})}),u.jsx("div",{className:"flex-1 min-w-0",children:u.jsxs("audio",{controls:!0,className:"w-full",style:{maxHeight:"40px"},children:[u.jsx("source",{src:e}),"مرورگر شما از پخش صوت پشتیبانی نمی‌کند."]})})]}),u.jsx(se.button,{whileTap:{scale:.9},onClick:a,className:"absolute -top-3 -left-3 w-10 h-10 rounded-full flex items-center justify-center",style:{background:"linear-gradient(135deg, #ef4444 0%, #dc2626 100%)",boxShadow:"0 4px 12px rgba(239, 68, 68, 0.4)"},children:u.jsx(yy,{className:"w-5 h-5 text-white"})})]}):u.jsxs(se.button,{whileTap:{scale:.98},onClick:()=>{var l;return(l=o.current)==null?void 0:l.click()},className:"w-full py-8 rounded-2xl border-2 border-dashed flex flex-col items-center justify-center gap-3 transition-all hover:bg-white/5",style:{borderColor:"rgba(216, 180, 254, 0.52)"},children:[u.jsx("div",{className:"w-16 h-16 rounded-full flex items-center justify-center",style:{background:"linear-gradient(135deg, rgba(168,115,255,0.25) 0%, rgba(138,82,238,0.25) 100%)"},children:u.jsx(Uf,{className:"h-8 w-8 text-[#D8B4FE]"})}),u.jsxs("div",{className:"text-center",children:[u.jsx("p",{className:"text-base font-bold text-[#FBE7F5]",children:"آپلود فایل صوتی"}),u.jsx("p",{className:"mt-1 text-sm text-[#EED3EC]/80",children:"برای انتخاب فایل کلیک کنید"})]})]}),u.jsx("input",{ref:o,type:"file",accept:"audio/*,.mp3,.wav,.m4a",onChange:n,className:"hidden"})]})}const yd=()=>`teammate-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;function Rg({topicId:e,topicTitle:n,onSubmit:a}){const s=Vs(e),{refreshProfile:o}=mr(),[l,d]=v.useState(""),[f,g]=v.useState(""),[m,x]=v.useState([{id:yd(),phone:""}]),[h,w]=v.useState(null),[k,j]=v.useState(null),[E,C]=v.useState(null),[I,M]=v.useState(null),[_,V]=v.useState(!1),[H,re]=v.useState(""),O=K=>{var q;const te=(q=K.target.files)==null?void 0:q[0];if(te){j(te);const P=new FileReader;P.onloadend=()=>w(P.result),P.readAsDataURL(te)}},b=K=>{var q;const te=(q=K.target.files)==null?void 0:q[0];if(te){M(te);const P=new FileReader;P.onloadend=()=>C(P.result),P.readAsDataURL(te)}},R=()=>{x([...m,{id:yd(),phone:""}])},N=K=>{const te=m.filter(q=>q.id!==K);x(te.length>0?te:[{id:yd(),phone:""}])},G=(K,te)=>{x(m.map(q=>q.id===K?{...q,phone:te,fullName:void 0,userId:void 0,error:void 0}:q))},Y=(K,te,q,P)=>{x(m.map(F=>F.id===K?{...F,fullName:te,userId:q,error:P}:F))},X=async()=>{if(!_){V(!0);try{let K="",te="";if(k){re("در حال آپلود تصویر...");const U=await Ls(k);if(U)K=U;else{alert("خطا در آپلود تصویر"),V(!1),re("");return}}if(I){re("در حال آپلود فایل صوتی...");const U=await Py(I);if(U)te=U;else{alert("خطا در آپلود فایل صوتی"),V(!1),re("");return}if(!k){alert("برای آپلود صوت، تصویر کاور الزامی است"),V(!1),re("");return}}const q=m.filter(U=>U.userId).map(U=>U.userId).join(","),P=localStorage.getItem("current_workflow_ID")||"";re("در حال ثبت ماموریت...");const F=await ec({title:l||"",mission_type:n,mission_done_workflowID:P,description:f||"",film:"",image:K,audio:te,team_member:q});F.success?(await o(),a({topicId:e,title:l,learnings:f,teammates:q?[q]:[],mediaType:"image",uploadedImage:h,uploadedAudio:E})):alert(F.message||"خطا در ثبت ماموریت")}catch(K){console.error("Error submitting:",K),alert("خطا در ثبت ماموریت")}finally{V(!1),re("")}}};return u.jsxs("div",{className:"space-y-6",dir:"rtl",children:[u.jsx(Fs,{type:"image",uploadedFile:h,onUpload:O,onRemove:()=>w(null),label:"تصویر چالش"}),u.jsx(pE,{uploadedAudio:E,onUpload:b,onRemove:()=>C(null),label:"پادکست صوتی"}),s.requiresTeammates&&u.jsx(Hf,{teammates:m,onAdd:R,onRemove:N,onChange:G,onVerify:Y}),u.jsx(Sa,{label:"عنوان چالش",value:l,onChange:d,placeholder:"عنوان چالش خود را وارد کنید..."}),u.jsx(Sa,{label:"از این چالش چه چیزی یاد گرفتیم",value:f,onChange:g,placeholder:"توضیحات خود را وارد کنید...",multiline:!0,rows:6}),u.jsx(se.button,{whileTap:{scale:.95},onClick:X,disabled:_,className:"w-full py-4 rounded-full text-white text-base font-bold mb-6",style:{backgroundImage:_?"linear-gradient(145deg, rgba(72, 58, 105, 0.72) 0%, rgba(42, 35, 77, 0.76) 100%)":"linear-gradient(90deg, rgba(255,139,91,1) 0%, rgba(238,91,166,1) 45%, rgba(147,78,255,1) 100%), linear-gradient(120deg, #7c3aed 0%, #f97316 58%, #facc15 100%)",backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",boxShadow:_?"inset 0 1px 0 rgba(255,255,255,0.12)":"0 10px 26px rgba(196, 87, 255, 0.35), inset 0 1px 0 rgba(255,255,255,0.35)",border:"1px solid transparent",opacity:_?.7:1,cursor:_?"not-allowed":"pointer"},children:_?"در حال ثبت...":"ثبت نهایی چالش"}),H&&u.jsx(se.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"text-center mb-4 p-4 rounded-2xl",style:{backgroundImage:"linear-gradient(180deg, rgba(46, 27, 61, 0.88) 0%, rgba(35, 24, 62, 0.92) 100%), linear-gradient(120deg, #7c3aed 0%, #f97316 58%, #facc15 100%)",backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",border:"0.5px solid transparent"},children:u.jsxs("div",{className:"flex items-center justify-center gap-3",children:[u.jsx(se.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},className:"w-5 h-5 border-2 border-[#D8B4FE] border-t-transparent rounded-full"}),u.jsx("span",{className:"text-[#FBE7F5] font-bold text-sm",children:H})]})})]})}const Mg={1:{id:"1",title:"تخته سیاه",description:"ماموریت‌های آموزشی و خلاقانه",accentColor:"#8ACEE0",backgroundColor:"#0a1f2e",mediaType:"image",requiresTeammates:!0,formComponent:md,challenges:[{id:"chalkboard-1",title:"درس جدید یاد بگیر",description:"یک مفهوم علمی یا درسی جدید را با کمک هم‌کلاسی‌هایت یاد بگیر و برای بقیه توضیح بده."},{id:"chalkboard-2",title:"معلم کوچک",description:"یه درس که بهش مسلطی رو به یه نفر از هم‌کلاسی‌هایت آموزش بده."},{id:"chalkboard-3",title:"سوال خلاقانه",description:"یه سوال مخصوص از معلمت بپرس که فکر همه رو درگیر کنه."}],chatbotIntro:`سلام! به دنیای تخته سیاه خوش اومدی 📚✨
اینجا می‌تونی ماموریت‌های آموزشی جذاب رو قبول کنی و با یادگیری جدید سکه جمع کنی!`},2:{id:"2",title:"نیمکت",description:"لحظات استراحت و گفتگو",accentColor:"#A8D5E2",backgroundColor:"#0e1a25",mediaType:"image",requiresTeammates:!1,formComponent:md,challenges:[{id:"bench-1",title:"دوست جدید پیدا کن",description:"با یه نفر که کمتر باهاش صحبت کردی، حرف بزن و یه چیز جالب ازش یاد بگیر."},{id:"bench-2",title:"گوش شنوا",description:"یه روز کامل سعی کن بیشتر گوش بدی و کمتر صحبت کنی. ببین چقدر چیز یاد می‌گیری."},{id:"bench-3",title:"مشکل‌گشا باش",description:"به یه هم‌کلاسی که مشکل دارد کمک کن. کمکت رو ثبت کن."}],chatbotIntro:`سلام! خوش اومدی به نیمکت 🪑💙
اینجا فضایی برای رشد مهارت‌های اجتماعی و دوستی‌های عمیق‌تره. بریم یه ماموریت باحال شروع کنیم!`},3:{id:"3",title:"دفترچه یادداشت",description:"یادداشت‌ها و خاطرات",accentColor:"#B8E0F0",backgroundColor:"#1a1f2e",mediaType:"both",requiresTeammates:!1,formComponent:xd,challenges:[{id:"notebook-1",title:"روزنگاری",description:"هر روز یه پاراگراف از اتفاقات روزت بنویس. بعد از یه هفته برگرد و بخونش."},{id:"notebook-2",title:"داستان کوتاه",description:"یه داستان کوتاه ۵ جمله‌ای بنویس که شخصیت اصلیش خودت باشی."},{id:"notebook-3",title:"نامه به آینده",description:"یه نامه به خودت در ۵ سال آینده بنویس. ارزوها، هدف‌ها و احساساتت رو بنویس."}],chatbotIntro:`سلام نویسنده کوچولو! 📔✏️
دفترچه یادداشت جایی‌ه که می‌تونی همه چیز رو ثبت کنی. ماموریت‌های نوشتاری خیلی جالبی برات دارم!`},4:{id:"4",title:"دیوار حیاط",description:"نقاشی و هنر",accentColor:"#90C8E0",backgroundColor:"#0f1f30",mediaType:"image",requiresTeammates:!0,formComponent:Rg,challenges:[{id:"wall-1",title:"نقاشی با موضوع محیط‌زیست",description:"یه نقاشی بکش که پیام حفاظت از محیط‌زیست رو داشته باشه."},{id:"wall-2",title:"پرتره دوست",description:"یه پرتره از یکی از دوستانت بکش و بهش هدیه بده."},{id:"wall-3",title:"نقاشی با رنگ طبیعی",description:"از مواد طبیعی مثل چغندر، اسفناج یا زردچوبه رنگ بساز و باهاش نقاشی بکش."}],chatbotIntro:`سلام هنرمند! 🎨🖌️
دیوار حیاط جای ابراز خلاقیته! ماموریت‌های هنری شگفت‌انگیزی برات دارم که می‌تونی با رنگ و نقاشی دنیا رو زیباتر کنی.`},5:{id:"5",title:"آبخوری",description:"تجربه‌های روزانه",accentColor:"#A890E0",backgroundColor:"#1a1530",mediaType:"image",requiresTeammates:!1,formComponent:hE,challenges:[{id:"fountain-1",title:"صرفه‌جویی در آب",description:"یه هفته میزان مصرف آب خانوادت رو بررسی کن و یه راه‌کار برای کاهش مصرف پیدا کن."},{id:"fountain-2",title:"گیاه کوچک",description:"یه گیاه کوچک بکار، هر روز بهش آب بده و رشدش رو عکس بگیر."},{id:"fountain-3",title:"محیط‌زیست‌یار",description:"یه بار در هفته حیاط مدرسه رو از زباله پاک کن و عکس قبل و بعد بگیر."}],chatbotIntro:`سلام! 💧🌿
آبخوری یادآور ارزش آب و طبیعته. اینجا ماموریت‌هایی داریم که می‌تونه تأثیر واقعی روی محیط‌زیست داشته باشه!`},6:{id:"6",title:"زنگ ورزش",description:"فعالیت‌های ورزشی",accentColor:"#80D0E0",backgroundColor:"#0a1f2e",mediaType:"both",requiresTeammates:!0,formComponent:xd,challenges:[{id:"sports-1",title:"۱۰ دقیقه ورزش",description:"هر روز صبح ۱۰ دقیقه ورزش کن. بعد از یه هفته احساست رو گزارش بده."},{id:"sports-2",title:"بازی جدید",description:"یه بازی ورزشی که بلد نیستی رو یاد بگیر و با دوستانت بازی کن."},{id:"sports-3",title:"تیم‌سازی",description:"یه تیم ۴ نفره برای یه بازی گروهی تشکیل بده و یه مسابقه برگزار کن."}],chatbotIntro:`سلام قهرمان! 🏃‍♂️⚽
زنگ ورزش وقت نشاط و سرزندگیه! ماموریت‌های ورزشی که برات دارم نه‌تنها بدنت رو قوی می‌کنه بلکه روح تیمی رو هم تقویت می‌کنه.`},7:{id:"7",title:"سه ماه تعطیلی",description:"ماجراهای تابستانی",accentColor:"#90D8F0",backgroundColor:"#0f1a30",mediaType:"image",requiresTeammates:!1,formComponent:md,challenges:[{id:"vacation-1",title:"سفر خلاقانه",description:"یه جای جدید در شهرت کشف کن. یه پارک، موزه یا مکان تاریخی که هرگز نرفتی."},{id:"vacation-2",title:"مهارت تابستانی",description:"یه مهارت جدید در تابستان یاد بگیر: آشپزی، نقاشی، موسیقی یا هر چیزی که دوست داری."},{id:"vacation-3",title:"کتاب‌خوانی",description:"یه کتاب کامل بخوان و خلاصه‌ای ازش برای دوستانت بنویس."}],chatbotIntro:`سلام! ☀️🌊
سه ماه تعطیلی فرصت طلاییه! اینجا ماموریت‌هایی داریم که تابستانت رو به یه ماجراجویی فوق‌العاده تبدیل می‌کنه.`},8:{id:"8",title:"روزنامه دیواری",description:"اخبار و گزارش‌ها",accentColor:"#A0D0E8",backgroundColor:"#151a2e",mediaType:"both",requiresTeammates:!1,formComponent:xd,challenges:[{id:"newspaper-1",title:"خبرنگار مدرسه",description:"یه رویداد مهم در مدرسه رو گزارش بده: مسابقه، جشن یا اتفاق خاص."},{id:"newspaper-2",title:"مصاحبه با معلم",description:"با یکی از معلمانت مصاحبه کن و داستان تدریسش رو بنویس."},{id:"newspaper-3",title:"شعر و داستان",description:"یه شعر یا داستان کوتاه بنویس و برای روزنامه دیواری کلاست آماده کن."}],chatbotIntro:`سلام خبرنگار کوچولو! 📰✍️
روزنامه دیواری صدای بچه‌های مدرسه‌ست! ماموریت‌هایی داریم که می‌تونی با نوشتن و گزارش، صدات رو به گوش همه برسونی.`},9:{id:"9",title:"زنگ تفریح",description:"سرگرمی و بازی",accentColor:"#8ACEE0",backgroundColor:"#0a1f2e",mediaType:"image",requiresTeammates:!0,formComponent:Rg,challenges:[{id:"recess-1",title:"بازی ابداعی",description:"یه بازی جدید اختراع کن که حداقل ۵ نفر بتونن باهم بازی کنن."},{id:"recess-2",title:"شادی‌آفرین",description:"با یه کار خلاقانه (شعر، نقاشی، بازی) حال هم‌کلاسی‌هایت رو خوب کن."},{id:"recess-3",title:"قصه‌گو",description:"یه قصه جالب بساز و برای بچه‌های کلاست تعریف کن. ببین چقدر خندیدن!"}],chatbotIntro:`سلام بازیگوش! 🎮🎉
زنگ تفریح وقت شادیه! ماموریت‌هایی داریم که خنده و نشاط رو به مدرسه برمی‌گردونه.`}};function Vs(e){return Mg[e]||Mg[1]}const mE=["۰","۱","۲","۳","۴","۵","۶","۷","۸","۹"],Xd=(e,n="")=>(e==null||e===""?n:String(e)).replace(/\d/g,s=>mE[parseInt(s,10)]),gE=e=>{const n=e==null||e===""?"15":String(e);return n.includes("دقیقه")?Xd(n):`${Xd(n)} دقیقه`};function xE(){const e=[{height:"h-[5px]",color:"#D7B6FF"},{height:"h-[8px]",color:"#F2A8D8"},{height:"h-[11px]",color:"#F7C47D"}];return u.jsx("span",{className:"inline-flex h-4 w-4 -translate-y-[2px] items-end justify-center gap-[2px] align-middle","aria-hidden":"true",children:e.map((n,a)=>u.jsx("span",{className:`w-[3px] rounded-full ${n.height}`,style:{backgroundColor:n.color}},a))})}const yE={backgroundImage:`
linear-gradient(180deg, rgba(46, 27, 61, 0.82) 0%, rgba(35, 24, 62, 0.8) 100%),
linear-gradient(128deg, rgba(255, 164, 222, 0.92) 0%, rgba(168, 120, 255, 0.88) 38%, rgba(249, 115, 22, 0.78) 72%, rgba(250, 204, 21, 0.68) 100%)
`,border:"1px solid transparent",backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",boxShadow:"0 -7px 20px rgba(7, 0, 18, 0.52), 0 10px 22px rgba(5, 2, 12, 0.38), 0 0 14px rgba(255, 121, 207, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 2px 5px rgba(255, 222, 255, 0.06), inset 0 -2px 0 rgba(12, 7, 27, 0.74), inset 0 -8px 14px rgba(8, 4, 18, 0.38), inset 0 0 0 1px rgba(255, 255, 255, 0.03), inset 0 0 0 2px rgba(17, 10, 35, 0.36)",backdropFilter:"blur(14px) saturate(118%)",WebkitBackdropFilter:"blur(14px) saturate(118%)"},vE={background:"linear-gradient(132deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.018) 28%, rgba(255, 121, 207, 0.065) 58%, rgba(124, 58, 237, 0.055) 100%), linear-gradient(180deg, rgba(46, 27, 61, 0.72) 0%, rgba(35, 24, 62, 0.8) 100%)",border:"1px solid rgba(255, 191, 229, 0.2)",boxShadow:"inset 0 1px 0 rgba(255,255,255,0.15), inset 0 0 18px rgba(255,121,207,0.05), inset 0 -12px 20px rgba(8,4,18,0.34)"},bE={backgroundImage:`
linear-gradient(180deg, rgba(46, 27, 61, 0.78) 0%, rgba(35, 24, 62, 0.78) 100%),
linear-gradient(135deg, rgba(124, 58, 237, 0.95) 0%, rgba(255, 121, 207, 0.72) 48%, rgba(249, 115, 22, 0.88) 100%)
`,backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",boxShadow:"0 10px 22px rgba(0,0,0,0.38), 0 0 14px rgba(255,121,207,0.16), inset 0 1px 0 rgba(255,255,255,0.2)"},wE={backgroundImage:`
linear-gradient(145deg, rgba(46, 27, 61, 0.82) 0%, rgba(35, 24, 62, 0.88) 100%),
linear-gradient(132deg, rgba(255, 121, 207, 0.74) 0%, rgba(124, 58, 237, 0.7) 48%, rgba(249, 115, 22, 0.64) 100%)
`,backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",boxShadow:"0 8px 18px rgba(0,0,0,0.34), 0 0 12px rgba(255,121,207,0.14), inset 0 1px 0 rgba(255,255,255,0.16), inset 0 -4px 8px rgba(8,4,18,0.38)"},kE={backgroundImage:`
linear-gradient(180deg, #2E1B3D 0%, #23183E 100%),
linear-gradient(120deg, #7c3aed 0%, #f97316 58%, #facc15 100%)
`,backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",boxShadow:"0 -7px 20px rgba(7, 0, 18, 0.5), 0 6px 14px rgba(5, 2, 12, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 2px 5px rgba(255, 222, 255, 0.09), inset 0 -2px 0 rgba(12, 7, 27, 0.72), inset 0 -8px 14px rgba(8, 4, 18, 0.34), inset 0 0 0 1px rgba(255, 255, 255, 0.045), inset 0 0 0 2px rgba(17, 10, 35, 0.32)",backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)"};function Fg(){const e=bn(),{topicId:n="1"}=Wl(),a=Vs(n);gr(`انتخاب چالش ${a.title}`);const s=v.useCallback(h=>{const w=h.mission_workflowID;localStorage.setItem("current_mission_type",a.title),localStorage.setItem("current_mission_id",w),localStorage.setItem("current_mission_title",h.title);const k=new URLSearchParams({continueMode:"true",missionId:w,missionType:a.title});e(`/chatbot/${n}?${k.toString()}`,{state:{selectedMissionTitle:h.title,missionType:a.title}})},[a.title,n,e]),[o,l]=v.useState([]),[d,f]=v.useState(!0),[g,m]=v.useState(!1),x=v.useCallback(()=>{e(`/feed/${n}`)},[e,n]);return v.useEffect(()=>{(async()=>{f(!0);const w=await rC(a.title);l(w.missions),f(!1),n==="3"&&(w.missions.length>0?(m(!0),s(w.missions[0])):(alert("چالشی برای این بخش وجود ندارد"),e(`/feed/${n}`)))})()},[a.title,n,e,s]),u.jsxs("div",{className:"fixed inset-0 w-full h-screen overflow-hidden",children:[u.jsx(Ka,{position:"fixed",zIndex:0,imageUrl:Rn.challenges}),g&&u.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center backdrop-blur-sm",style:{background:"radial-gradient(120% 120% at 50% 0%, rgba(124, 58, 237, 0.36) 0%, rgba(46, 27, 61, 0.9) 55%, rgba(35, 24, 62, 0.96) 100%)"},children:u.jsxs("div",{className:"text-center",children:[u.jsx("div",{className:"inline-block w-12 h-12 border-4 border-[#ffd6f0]/30 border-t-[#ff79cf] rounded-full animate-spin mb-3"}),u.jsx("p",{className:"text-white text-base font-bold",children:"در حال بارگذاری چالش..."})]})}),u.jsxs("div",{className:"relative z-10 max-w-md mx-auto h-full flex flex-col",children:[u.jsx(tc,{showBack:!0,onBack:x,centerTitle:a.title,centerSubtitle:"انتخاب چالش"}),u.jsx("div",{className:"mt-2 flex-1 overflow-y-auto px-4 pb-20",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:u.jsxs("div",{className:"pt-7",children:[u.jsxs("div",{className:"mb-5 rounded-[22px] border-[0.5px] border-transparent px-4 py-3 text-right",style:{backgroundImage:"linear-gradient(180deg, rgba(46, 27, 61, 0.92) 0%, rgba(35, 24, 62, 0.94) 100%), linear-gradient(120deg, #7c3aed 0%, #f97316 58%, #facc15 100%)",backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",boxShadow:"0 -7px 20px rgba(7, 0, 18, 0.46), 0 6px 14px rgba(5, 2, 12, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -2px 0 rgba(12, 7, 27, 0.66)",backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)"},children:[u.jsx("p",{className:"text-[13px] font-bold text-[#FBE7F5]",children:"چالش مناسب رو انتخاب کن و شروع کن"}),u.jsx("p",{className:"mt-1 text-[11px] leading-5 text-[#EED3EC]/90",children:"امتیاز، سختی و زمان هر چالش رو ببین و مستقیم وارد مرحله گفتگو با ربات شو."})]}),u.jsx("div",{className:"w-full space-y-4",dir:"rtl",children:d?u.jsxs(se.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center py-10",children:[u.jsx("div",{className:"inline-block w-10 h-10 border-4 border-[#ffd6f0]/30 border-t-[#ff79cf] rounded-full animate-spin mb-3"}),u.jsx("p",{className:"text-[#ffd6f0] text-xs",children:"در حال بارگذاری چالش‌ها..."})]}):o.length===0?u.jsx(se.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center py-10",children:u.jsx("p",{className:"text-teal-200 text-xs",children:"هیچ چالشی یافت نشد"})}):o.map((h,w)=>u.jsx(se.div,{initial:{x:-80,opacity:0},animate:{x:0,opacity:1},transition:{delay:.3+w*.1,duration:.4},className:"relative",children:u.jsx(se.button,{type:"button",whileHover:{scale:1.01},whileTap:{scale:.99},onClick:()=>s(h),className:"block w-full rounded-[20px] border-[0.5px] border-transparent p-[1px] text-right",style:yE,"aria-label":`شروع چالش ${h.title}`,children:u.jsxs("div",{className:"relative flex min-h-[132px] items-center gap-3 overflow-hidden rounded-[19px] px-3 py-3",style:vE,children:[u.jsx("div",{className:"pointer-events-none absolute inset-0",style:{background:"linear-gradient(115deg, rgba(255,255,255,0.055) 0%, transparent 34%, rgba(255,121,207,0.05) 62%, transparent 100%)"}}),u.jsx("div",{className:"pointer-events-none absolute -left-8 top-0 h-20 w-36 rotate-[-18deg] rounded-full blur-2xl",style:{background:"rgba(255, 121, 207, 0.12)"}}),u.jsx("div",{className:"pointer-events-none absolute bottom-0 right-8 h-16 w-32 rounded-full blur-2xl",style:{background:"rgba(249, 115, 22, 0.1)"}}),u.jsx("div",{className:"relative z-10 h-[104px] w-[104px] flex-shrink-0 overflow-hidden rounded-[16px] border-[0.5px] border-transparent p-[1px]",style:bE,children:u.jsx("img",{src:aC(h.StageID),alt:h.title,className:"h-full w-full rounded-[15px] object-cover",loading:"eager",onError:k=>{k.currentTarget.src=iE,k.currentTarget.style.objectFit="contain"}})}),u.jsxs("div",{className:"relative z-10 min-w-0 flex-1 text-right",children:[u.jsxs("div",{className:"mb-1 flex items-center justify-start gap-2",children:[u.jsx("h3",{className:"truncate text-[18px] font-extrabold leading-7 text-white",children:h.title}),u.jsx("span",{className:"flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full border-[0.5px] border-transparent text-[#ffb7dd]",style:wE,children:u.jsx(b6,{size:13,fill:"currentColor",strokeWidth:1.5})})]}),u.jsx("p",{className:"mb-3 text-[12px] font-medium leading-5 text-[#F4EAF6]/88",style:{display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:h.description}),u.jsxs("div",{className:"flex w-full flex-nowrap items-center justify-between gap-1 text-[10px] font-normal leading-none text-white/90",children:[u.jsxs("span",{className:"inline-flex h-6 shrink-0 items-center gap-1 whitespace-nowrap px-0",children:[u.jsx("span",{className:"leading-none",children:Xd(h.coin_count,"250")}),u.jsx("img",{src:Ms,alt:"سکه",className:"h-4 w-4 shrink-0 object-contain"})]}),u.jsxs("span",{className:"inline-flex h-6 shrink-0 items-center gap-1 whitespace-nowrap px-0",children:[u.jsx("span",{className:"leading-none",children:h.difficulty||"متوسط"}),u.jsx(xE,{})]}),u.jsxs("span",{className:"inline-flex h-6 shrink-0 items-center gap-1 whitespace-nowrap px-0",children:[u.jsx(v8,{size:13,className:"shrink-0 text-[#ffb7dd]",strokeWidth:2.1}),u.jsx("span",{className:"leading-none",children:gE(h.duration)})]})]})]}),u.jsx("span",{className:"relative z-10 flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-full border-[0.5px] border-transparent text-white",style:kE,"aria-hidden":"true",children:u.jsx(fy,{size:22,color:"#ffffff"})})]})})},h.mission_workflowID))})]})})]}),u.jsx(nc,{}),u.jsx("style",{children:`
.flex-1.overflow-y-auto::-webkit-scrollbar {
display: none;
}
`})]})}const SE=()=>{const e=Ut(),[n]=W5(),{refreshInbox:a}=Ji(),[s,o]=v.useState(()=>{const x=e.state;return x!=null&&x.chats||x!=null&&x.doingMission?{chats:x.chats||[],doingMission:x.doingMission||null,missionType:x.missionType||""}:null}),[l,d]=v.useState(!1),[f,g]=v.useState(null),m=v.useRef(!0);return v.useEffect(()=>(m.current=!0,(async()=>{var I;const h=e.state;if(h!=null&&h.chats||h!=null&&h.doingMission)return;const w=n.get("missionId"),k=n.get("missionType"),j=n.get("continueMode");let E=null,C=null;if(j==="true"&&w&&k?(E=k,C=w,localStorage.setItem("current_mission_type",E),localStorage.setItem("current_mission_id",C)):(E=localStorage.getItem("current_mission_type"),C=localStorage.getItem("current_mission_id")),!(!E||!C)){d(!0),g(null);try{const M=await sC(E,C);if(!m.current)return;(I=M.doing_mission)!=null&&I.workflow_ID&&localStorage.setItem("current_workflow_ID",M.doing_mission.workflow_ID),await a(),o({chats:M.chats,doingMission:M.doing_mission,missionType:E})}catch{if(!m.current)return;g("خطا در بارگذاری ماموریت")}finally{m.current&&d(!1)}}})(),()=>{m.current=!1}),[e.pathname,n,a]),{sessionData:s,isLoading:l,error:f}},CE=e=>e===!0||e==="true"||e==="True",jE=({workflowId:e,onMissionEnd:n})=>{const[a,s]=v.useState([]),[o,l]=v.useState(!1),d=v.useRef(0),f=v.useRef(!0),g=v.useRef(null),m=v.useCallback(async(x,h)=>{console.log("sendMessage called:",{messageText:x,workflowId:e,isSending:o,skipUserMessage:h==null?void 0:h.skipUserMessage});const w=x.trim(),k=w.replace(/\r?\n+/g," ").trim();if(!k||!e){console.log("sendMessage aborted:",{hasMessage:!!k,hasWorkflowId:!!e});return}if(o){console.log("Already sending, skipping");return}const j=++d.current,E=k;try{if(l(!0),!(h!=null&&h.skipUserMessage)){const V={id:`user-${Date.now()}`,type:"user",content:w,mediaType:"text",timestamp:new Date,datetime1:new Date().toLocaleString("fa-IR")};f.current&&j===d.current&&s(H=>[...H,V])}const C=`bot-${Date.now()}`,I=new Date,M=I.toLocaleString("fa-IR");s(V=>[...V,{id:C,type:"bot",content:"",mediaType:"text",timestamp:I,datetime1:M,isTyping:!0}]);const _=await iC(E,e);if(!f.current||j!==d.current)return;if(_.success&&_.message){const V=CE(_.is_mission_end);g.current&&clearInterval(g.current);let H;_.actions&&_.actions.length>0&&_.actions[0].multi_choice&&(H=_.actions[0].multi_choice.map((b,R)=>({id:`action-${Date.now()}-${R}`,label:b,action:`multi_choice_${R}`}))),V&&(H||(H=[]),H.push({id:`submit-challenge-${Date.now()}`,label:"🎯 رفتن به مرحله بعد و ثبت ماموریت",action:"submit-challenge"}),n&&n());let re=0;const O=_.message;g.current=setInterval(()=>{if(!f.current||j!==d.current){g.current&&(clearInterval(g.current),g.current=null);return}if(re<O.length){const b=O.slice(0,re+1);s(R=>R.map(N=>N.id===C?{...N,content:b,isTyping:!0}:N)),re++;return}g.current&&(clearInterval(g.current),g.current=null),s(b=>b.map(R=>R.id===C?{...R,content:O,isTyping:!1,buttons:H}:R))},30)}else s(V=>V.map(H=>H.id===C?{...H,content:"متأسفانه خطایی رخ داد. لطفاً دوباره تلاش کنید.",isTyping:!1}:H))}catch{if(!f.current||j!==d.current)return;s(I=>I.map(M=>M.type==="bot"&&M.isTyping?{...M,content:"متأسفانه خطایی رخ داد. لطفاً دوباره تلاش کنید.",isTyping:!1}:M))}finally{f.current&&j===d.current&&l(!1)}},[e,o,n]);return{messages:a,setMessages:s,isSending:o,sendMessage:m,isTyping:!1,typingText:""}},EE=e=>e===!0||e==="true"||e==="True",NE=e=>{const n=[];if(e.forEach((a,s)=>{const o=a.question&&a.question.trim().toLowerCase()==="شروع";a.question&&a.question.trim()&&!o&&n.push({id:`user-${s}`,type:"user",content:a.question,mediaType:"text",timestamp:new Date,datetime1:a.datetime1}),a.answer&&a.answer.trim()&&n.push({id:`bot-${s}`,type:"bot",content:a.answer,mediaType:"text",timestamp:new Date,datetime1:a.datetime1})}),e.length>0&&n.length>0){const a=e[e.length-1];let s=-1;for(let o=n.length-1;o>=0;o--)if(n[o].type==="bot"){s=o;break}if(s!==-1){let o;a.actions&&a.actions.length>0&&a.actions[0].multi_choice&&(o=a.actions[0].multi_choice.map((l,d)=>({id:`action-init-${d}`,label:l,action:`multi_choice_${d}`}))),EE(a.is_mission_end)===!0&&(o||(o=[]),o.push({id:"submit-challenge-init",label:"🎯 رفتن به مرحله بعد و ثبت ماموریت",action:"submit-challenge"})),o&&o.length>0&&(n[s].buttons=o)}}return n},TE=e=>e==="3"?"/feed/3":-1;function PE({date:e}){return e?u.jsx("div",{className:"sticky z-20 flex justify-center",style:{top:"10px"},children:u.jsx("div",{className:"rounded-full px-4 py-1.5 text-[11px] font-bold text-[#F7D8EF] backdrop-blur-md",style:{background:"linear-gradient(145deg, rgba(35, 28, 69, 0.76) 0%, rgba(25, 22, 55, 0.72) 100%)",boxShadow:"0 0 18px rgba(203,117,171,0.22), 0 8px 18px rgba(8,6,28,0.28), inset 0 1px 0 rgba(255,255,255,0.12)",border:"1px solid rgba(198, 111, 177, 0.36)"},children:`${e}`})}):null}const Ay=e=>{const n=e.trim();if(!n)return{date:"",time:""};if(n.includes(" - ")){const[s="",o=""]=n.split(" - ");return{date:s.trim(),time:o.trim()}}const a=n.match(/^(.+?)[،,]\s*(.+)$/);return a?{date:a[1].trim(),time:a[2].trim()}:{date:n,time:""}},RE=(e,n)=>e?ba(Ay(e).date):n?ba(n.toLocaleDateString("fa-IR")):"",ME=(e,n)=>{if(e){const{time:a}=Ay(e);if(a)return ba(a)}return n?FE(n):""},FE=e=>ba(e.toLocaleTimeString("fa-IR",{hour:"2-digit",minute:"2-digit"}));function IE({duration:e,audioUrl:n}){const[a,s]=v.useState(!1),[o,l]=v.useState(0),[d,f]=v.useState(0),g=()=>{if(s(!a),!a){const m=setInterval(()=>{f(x=>x>=100?(clearInterval(m),s(!1),0):x+1)},100)}};return u.jsxs("div",{className:"rounded-2xl px-4 py-3 flex items-center gap-3 min-w-[240px]",style:{background:"linear-gradient(135deg, rgba(100, 200, 255, 0.9) 0%, rgba(50, 150, 220, 0.9) 100%)",boxShadow:"0 4px 16px rgba(100, 200, 255, 0.4), inset 0 1px 2px rgba(255, 255, 255, 0.3)",border:"1.5px solid rgba(150, 220, 255, 0.4)"},children:[u.jsx("button",{onClick:g,className:"w-10 h-10 rounded-full flex items-center justify-center flex-shrink-0 transition-all",style:{background:"rgba(255, 255, 255, 0.25)"},children:a?u.jsx(e6,{className:"w-5 h-5 text-white fill-white"}):u.jsx(Ql,{className:"w-5 h-5 text-white fill-white",style:{marginLeft:"2px"}})}),u.jsxs("div",{className:"flex-1 flex flex-col gap-1",children:[u.jsx("div",{className:"h-1 rounded-full bg-white/20 overflow-hidden",children:u.jsx("div",{className:"h-full rounded-full transition-all duration-100",style:{width:`${d}%`,background:"linear-gradient(90deg, #FFFFFF 0%, #E0F7FF 100%)"}})}),u.jsx("div",{className:"flex justify-between items-center",children:u.jsx("span",{className:"text-white/80 text-xs",children:e})})]})]})}function DE({thumbnailUrl:e,duration:n,videoUrl:a}){const[s,o]=v.useState(!1);return u.jsx("div",{className:"rounded-2xl p-3",style:{background:"linear-gradient(135deg, rgba(100, 200, 255, 0.9) 0%, rgba(50, 150, 220, 0.9) 100%)",border:"1.5px solid rgba(150, 220, 255, 0.4)",boxShadow:"0 4px 16px rgba(100, 200, 255, 0.4)"},children:u.jsxs("div",{className:"relative rounded-xl overflow-hidden group cursor-pointer",children:[u.jsx("img",{src:e,alt:"ویدیو",className:"w-full h-auto max-h-64 object-cover"}),u.jsx("div",{className:"absolute inset-0 flex items-center justify-center transition-all",style:{background:"rgba(0, 0, 0, 0.3)"},children:u.jsx("div",{className:"w-16 h-16 rounded-full flex items-center justify-center transition-all group-hover:scale-110",style:{background:"rgba(255, 255, 255, 0.9)",boxShadow:"0 4px 16px rgba(0, 0, 0, 0.3)"},children:u.jsx(Ql,{className:"w-7 h-7 fill-blue-500 text-blue-500",style:{marginLeft:"3px"}})})}),u.jsx("div",{className:"absolute bottom-3 right-3 px-2 py-1 rounded text-xs font-bold text-white",style:{background:"rgba(0, 0, 0, 0.6)"},children:n})]})})}const Vi={background:"linear-gradient(145deg, rgba(218, 94, 142, 0.96) 0%, rgba(162, 56, 110, 0.95) 100%)",boxShadow:"0 0 24px rgba(240,110,168,0.28), 0 12px 28px rgba(84, 22, 60, 0.38), inset 0 1px 0 rgba(255,255,255,0.16)",border:"1px solid rgba(255, 178, 214, 0.58)",backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)"},Wf={background:"linear-gradient(145deg, rgba(52, 34, 76, 0.94) 0%, rgba(35, 24, 62, 0.94) 100%)",backgroundImage:"linear-gradient(145deg, rgba(52, 34, 76, 0.94) 0%, rgba(35, 24, 62, 0.94) 100%), linear-gradient(120deg, #7c3aed 0%, #f97316 58%, #facc15 100%)",backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",boxShadow:"0 0 24px rgba(152,104,235,0.24), 0 12px 28px rgba(12, 8, 30, 0.4), inset 0 1px 0 rgba(255,255,255,0.12)",border:"0.5px solid transparent",backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)"},_E={background:Vi.background,boxShadow:"0 12px 28px rgba(84, 22, 60, 0.38)",border:Vi.border},LE={background:Wf.background,boxShadow:"0 12px 28px rgba(12, 8, 30, 0.4)",border:"1px solid rgba(186, 145, 235, 0.4)"},AE={background:Vi.background,boxShadow:"0 12px 28px rgba(84, 22, 60, 0.38), inset 0 1px 0 rgba(255,255,255,0.12)",border:Vi.border},OE={background:Wf.background,boxShadow:"0 12px 28px rgba(12, 8, 30, 0.4), inset 0 1px 0 rgba(255,255,255,0.12)",border:"1px solid rgba(186, 145, 235, 0.4)"},vd={background:"linear-gradient(180deg, rgba(46, 27, 61, 0.95) 0%, rgba(35, 24, 62, 0.97) 100%), linear-gradient(120deg, rgba(124, 58, 237, 0.5) 0%, rgba(249, 115, 22, 0.32) 58%, rgba(250, 204, 21, 0.25) 100%)",backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",border:"1px solid transparent",boxShadow:"0 14px 34px rgba(10, 5, 24, 0.42), 0 0 22px rgba(255, 121, 207, 0.18), inset 0 1px 0 rgba(255,255,255,0.16)",color:"#FBE7F5",backdropFilter:"blur(16px)",WebkitBackdropFilter:"blur(16px)",width:"fit-content",minWidth:"unset",maxWidth:"max-content",whiteSpace:"nowrap",margin:"0 auto"};function BE({message:e,animationDelay:n,onButtonClick:a}){var C;const s=e.type==="user",o=!s,l=ME(e.datetime1,e.timestamp),d=s?Vi:Wf,f=s?_E:LE,g=s?AE:OE,m=v.useRef(0),x=e.mediaType==="file"?e.mediaUrl||"":((C=e.content)==null?void 0:C.trim())||"",h=I=>{const M=document.createElement("textarea");M.value=I,M.setAttribute("readonly","true"),M.style.position="fixed",M.style.opacity="0",M.style.pointerEvents="none",M.style.top="0",M.style.left="0",document.body.appendChild(M),M.focus(),M.select(),M.setSelectionRange(0,I.length);let _=!1;try{_=document.execCommand("copy")}finally{document.body.removeChild(M)}return _},w=async()=>{var I;if(x)try{if((I=navigator.clipboard)!=null&&I.writeText&&window.isSecureContext)await navigator.clipboard.writeText(x);else if(!h(x))throw new Error("fallback copy failed");Nl.success("پیام کپی شد",{position:"bottom-center",style:vd})}catch{if(h(x)){Nl.success("پیام کپی شد",{position:"bottom-center",style:vd});return}Nl.error("کپی پیام انجام نشد",{position:"bottom-center",style:vd})}},k=()=>{x&&(m.current=Date.now())},j=()=>{if(!x)return;const I=Date.now()-m.current;m.current=0,I>=450&&w()},E=()=>{m.current=0};return u.jsxs(se.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3,delay:n},className:`flex ${o?"justify-end":"justify-start"} items-start gap-2`,children:[u.jsxs("div",{className:`max-w-[75%] ${o?"ml-0":"mr-0"}`,children:[e.mediaType==="text"&&u.jsx("div",{className:"relative rounded-[18px] px-5 py-3",style:d,onPointerDown:k,onPointerUp:j,onPointerLeave:E,onPointerCancel:E,onContextMenu:I=>{x&&(I.preventDefault(),w())},children:o&&e.isTyping&&!e.content?u.jsxs("div",{className:"flex items-center gap-1 py-1",children:[u.jsx(se.span,{className:"h-2 w-2 rounded-full bg-white/70",animate:{opacity:[.3,1,.3]},transition:{duration:1.3,repeat:1/0,delay:0}}),u.jsx(se.span,{className:"h-2 w-2 rounded-full bg-white/70",animate:{opacity:[.3,1,.3]},transition:{duration:1.3,repeat:1/0,delay:.2}}),u.jsx(se.span,{className:"h-2 w-2 rounded-full bg-white/70",animate:{opacity:[.3,1,.3]},transition:{duration:1.3,repeat:1/0,delay:.4}})]}):u.jsxs("p",{className:"text-white text-sm leading-relaxed whitespace-pre-line",children:[u.jsx(Vl,{text:e.content}),o&&e.isTyping&&u.jsx("span",{className:"ml-0.5 inline-block h-4 w-0.5 animate-pulse bg-white/70",style:{verticalAlign:"text-bottom"}})]})}),e.mediaType==="image"&&e.content&&u.jsx("div",{className:"rounded-2xl p-3",style:f,onPointerDown:k,onPointerUp:j,onPointerLeave:E,onPointerCancel:E,onContextMenu:I=>{x&&(I.preventDefault(),w())},children:u.jsx("div",{className:"rounded-xl overflow-hidden",style:{boxShadow:"0 2px 8px rgba(0, 0, 0, 0.2)"},children:u.jsx("img",{src:e.content,alt:"تصویر",className:"w-full h-auto max-h-64 object-cover"})})}),e.mediaType==="audio"&&e.mediaUrl&&u.jsx(IE,{duration:e.duration||"0:00",audioUrl:e.mediaUrl}),e.mediaType==="video"&&e.content&&e.mediaUrl&&u.jsx(DE,{thumbnailUrl:e.content,duration:e.duration||"0:00",videoUrl:e.mediaUrl}),e.mediaType==="file"&&e.mediaUrl&&u.jsxs("div",{className:"rounded-3xl px-5 py-4 flex items-center gap-3",style:g,onPointerDown:k,onPointerUp:j,onPointerLeave:E,onPointerCancel:E,onContextMenu:I=>{x&&(I.preventDefault(),w())},children:[u.jsx("div",{className:"w-10 h-10 rounded-lg flex items-center justify-center flex-shrink-0",style:{background:"linear-gradient(135deg, #FFD700 0%, #FFA500 100%)",boxShadow:"0 2px 8px rgba(255, 215, 0, 0.4)"},children:u.jsx(q8,{className:"w-5 h-5 text-white"})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("p",{className:"text-white text-sm font-bold truncate",children:e.mediaUrl}),u.jsx("p",{className:"text-white/70 text-xs",children:"فایل"})]}),u.jsx("button",{className:"text-white hover:text-white/80 text-xs font-bold px-3 py-1 rounded-lg transition-all",style:{background:"rgba(255, 255, 255, 0.2)"},"aria-label":"دانلود فایل",children:"دانلود"})]}),e.buttons&&e.buttons.length>0&&u.jsx("div",{className:"mt-3 space-y-2",children:e.buttons.map(I=>u.jsx(se.button,{whileTap:{scale:.95},onClick:()=>a(I.id,I.action),className:"w-full rounded-[18px] px-4 py-3 text-center text-sm font-bold transition-all",style:{background:"linear-gradient(135deg, rgba(174, 117, 255, 0.96) 0%, rgba(138, 82, 238, 0.95) 46%, rgba(102, 55, 204, 0.94) 100%)",boxShadow:"0 0 18px rgba(155,108,241,0.4), 0 10px 20px rgba(24, 10, 54, 0.34), inset 0 1px 0 rgba(255,255,255,0.28)",border:"1px solid rgba(212, 184, 255, 0.62)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",color:"#FFFFFF"},"aria-label":I.label,children:u.jsx(Vl,{text:I.label})},I.id))}),u.jsx("div",{className:`mt-1 text-xs ${o?"text-left":"text-right"}`,style:{color:"rgba(255, 255, 255, 0.5)"},children:l})]}),o&&u.jsx("div",{className:"flex-shrink-0",children:u.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full border border-[#F0A6D8]/45",style:{background:"radial-gradient(circle at 50% 36%, rgba(255, 187, 232, 0.38) 0%, rgba(134, 74, 164, 0.28) 48%, rgba(26, 18, 54, 0.7) 100%)",boxShadow:"0 0 14px rgba(255,104,205,0.48), 0 0 28px rgba(255,104,205,0.22), inset 0 1px 0 rgba(255,255,255,0.22)"},children:u.jsx("img",{src:rc,alt:"چت‌بات",className:"h-[43px] w-[43px] object-contain"})})})]})}const zE={background:"linear-gradient(145deg, rgba(52, 34, 76, 0.94) 0%, rgba(35, 24, 62, 0.94) 100%)",boxShadow:"0 0 24px rgba(152,104,235,0.24), 0 12px 28px rgba(12, 8, 30, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.12)",border:"1px solid rgba(186, 145, 235, 0.4)"};function VE({isTyping:e,typingText:n}){return u.jsx(pn,{mode:"wait",children:e&&u.jsxs(se.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},transition:{duration:.2},className:"flex justify-end items-start gap-2",role:"status","aria-live":"polite","aria-label":n?"در حال نوشتن پاسخ":"در حال تایپ",children:[u.jsx("div",{className:"rounded-3xl px-5 py-3 min-h-[44px] flex items-center",style:zE,children:n?u.jsxs("p",{className:"text-white text-sm leading-relaxed whitespace-pre-line",style:{minHeight:"1.25rem"},children:[n,u.jsx("span",{className:"inline-block w-0.5 h-4 bg-white/70 animate-pulse ml-0.5",style:{verticalAlign:"text-bottom"}})]}):u.jsxs("div",{className:"flex gap-1",children:[u.jsx("div",{className:"w-2 h-2 rounded-full bg-white/60 chat-typing-dot",style:{animationDelay:"0s"}}),u.jsx("div",{className:"w-2 h-2 rounded-full bg-white/60 chat-typing-dot",style:{animationDelay:"0.2s"}}),u.jsx("div",{className:"w-2 h-2 rounded-full bg-white/60 chat-typing-dot",style:{animationDelay:"0.4s"}})]})}),u.jsx("div",{className:"flex-shrink-0",children:u.jsx("img",{src:rc,alt:"چت‌بات",className:"w-12 h-12 rounded-full object-contain",style:{filter:"drop-shadow(0 2px 8px rgba(138, 206, 224, 0.5))"}})})]},"typing-indicator")})}const Oy=v.forwardRef(({messages:e,onButtonClick:n,isTyping:a,typingText:s},o)=>{const l=v.useRef(null),d=v.useMemo(()=>{const g=[];for(const m of e){const x=RE(m.datetime1,m.timestamp)||"",h=g[g.length-1];!h||h.date!==x?g.push({id:`group-${g.length}-${x||"unknown"}`,date:x,messages:[m]}):h.messages.push(m)}return g},[e]),f=()=>{var g;(g=l.current)==null||g.scrollIntoView({behavior:"smooth"})};return v.useImperativeHandle(o,()=>({scrollToBottom:f})),v.useEffect(()=>{f()},[e,a,s]),u.jsxs("div",{className:"space-y-4",dir:"rtl",children:[d.map(g=>u.jsxs("div",{className:"space-y-4",children:[u.jsx(PE,{date:g.date}),g.messages.map((m,x)=>{const h=Math.min(x*.05,1);return u.jsx(BE,{message:m,animationDelay:h,onButtonClick:n},m.id)})]},g.id)),u.jsx(VE,{isTyping:a,typingText:s}),u.jsx("div",{ref:l})]})});Oy.displayName="ChatMessageList";function Ig(){var re,O,b,R,N,G;const e=bn(),n=Ut(),{topicId:a="1"}=Wl(),s=Vs(a),o=n.state;gr(`چت‌بات ${s.title}`);const{sessionData:l,isLoading:d,error:f}=SE(),g=((re=o==null?void 0:o.selectedMissionTitle)==null?void 0:re.trim())||((O=localStorage.getItem("current_mission_title"))==null?void 0:O.trim())||((R=(b=l==null?void 0:l.doingMission)==null?void 0:b.title)==null?void 0:R.trim()),[m,x]=v.useState(!1),{messages:h,setMessages:w,isSending:k,sendMessage:j,isTyping:E,typingText:C}=jE({workflowId:((N=l==null?void 0:l.doingMission)==null?void 0:N.workflow_ID)||null,onMissionEnd:()=>x(!0)}),I=v.useRef(!1),M=v.useRef(null),_=v.useRef(null);v.useEffect(()=>{if(l!=null&&l.chats&&l.chats.length>0){const Y=NE(l.chats);w(Y);const X=l.chats[l.chats.length-1];((X==null?void 0:X.is_mission_end)===!0||(X==null?void 0:X.is_mission_end)==="True")&&x(!0)}},[l,w]),v.useEffect(()=>{var K;const Y=(K=l==null?void 0:l.doingMission)==null?void 0:K.workflow_ID;if(!Y||(M.current!==Y&&(M.current=Y,I.current=!1),I.current))return;((l==null?void 0:l.chats)||[]).length===0&&(I.current=!0,j("شروع",{skipUserMessage:!0}))},[(G=l==null?void 0:l.doingMission)==null?void 0:G.workflow_ID,l==null?void 0:l.chats,j]);const V=(Y,X)=>{var K;if(X==="submit-challenge"){e(`/submit/${a}`,{state:{doingMission:l==null?void 0:l.doingMission}});return}if(X.startsWith("multi_choice_")){const te=h.find(q=>{var P;return(P=q.buttons)==null?void 0:P.some(F=>F.id===Y)});if(te){const q=(K=te.buttons)==null?void 0:K.find(P=>P.id===Y);q&&j(q.label)}}},H=()=>{const Y=TE(a);e(Y)};return d?u.jsxs("div",{className:"relative h-[100dvh] w-full overflow-hidden",children:[u.jsx(Ka,{position:"fixed",zIndex:0,imageUrl:Rn.chatbot}),u.jsx("div",{className:"relative z-10 flex h-full items-center justify-center text-center text-white",children:u.jsxs("div",{children:[u.jsx("div",{className:"mx-auto mb-3 h-10 w-10 animate-spin rounded-full border-4 border-[#ffd6f0]/30 border-t-[#ff79cf]"}),u.jsx("p",{className:"text-base font-bold",children:"در حال بارگذاری..."})]})})]}):f?u.jsxs("div",{className:"relative h-[100dvh] w-full overflow-hidden",children:[u.jsx(Ka,{position:"fixed",zIndex:0,imageUrl:Rn.chatbot}),u.jsx("div",{className:"relative z-10 flex h-full items-center justify-center px-4 text-center text-white",children:u.jsxs("div",{children:[u.jsx("p",{className:"text-base text-red-400",children:f}),u.jsx("button",{onClick:H,className:"mt-3 rounded-lg bg-white/20 px-5 py-1.5 text-sm transition hover:bg-white/30",children:"بازگشت"})]})})]}):u.jsxs("div",{className:"relative h-[100dvh] w-full overflow-hidden",children:[u.jsx(Ka,{position:"fixed",zIndex:0,imageUrl:Rn.chatbot}),u.jsxs("div",{className:"relative z-10 mx-auto grid h-full w-full max-w-md grid-rows-[auto_minmax(0,1fr)_auto]",children:[u.jsx("div",{className:"shrink-0",children:u.jsx(Ly,{topicTitle:g||s.title,subtitle:g?s.title:void 0,onBack:H})}),u.jsx("main",{className:"min-h-0 overflow-y-auto px-3 pb-2",style:{maskImage:"linear-gradient(to bottom, transparent 0%, black 48px)",WebkitMaskImage:"linear-gradient(to bottom, transparent 0%, black 48px)",scrollbarWidth:"none",msOverflowStyle:"none"},children:u.jsx("div",{className:"pt-8",children:u.jsx(Oy,{ref:_,messages:h,onButtonClick:V,isTyping:E,typingText:C})})}),u.jsx("footer",{className:"shrink-0",style:{paddingBottom:"calc(env(safe-area-inset-bottom, 0px) + 12px)"},children:u.jsx("div",{className:"px-3 pt-2",children:u.jsx(_y,{onSendMessage:j,disabled:k||E})})})]}),u.jsx("style",{children:`
main::-webkit-scrollbar {
display: none;
}
`})]})}function UE({isOpen:e,onClose:n,topicTitle:a}){const s=v.useMemo(()=>{const o=typeof window<"u"?window.innerWidth:390;return Array.from({length:20},(l,d)=>({id:d,x:Math.random()*o,duration:3+Math.random()*2,delay:Math.random()*2,color:d%2===0?"#FFB800":"#8ACEE0"}))},[]);return u.jsx(pn,{children:e&&u.jsxs(se.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[100] flex items-center justify-center p-4",onClick:n,children:[u.jsx(se.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"absolute inset-0",style:{background:"radial-gradient(circle at center, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.95) 100%)",backdropFilter:"blur(8px)"}}),u.jsxs(se.div,{initial:{scale:.5,opacity:0,y:50},animate:{scale:1,opacity:1,y:0},exit:{scale:.8,opacity:0,y:30},transition:{type:"spring",stiffness:300,damping:25},onClick:o=>o.stopPropagation(),className:"relative max-w-sm w-full",dir:"rtl",children:[Array.from({length:12}).map((o,l)=>u.jsx(se.div,{initial:{opacity:0,scale:0},animate:{opacity:[0,1,0],scale:[0,1.5,0],x:[0,Math.cos(l/12*2*Math.PI)*100],y:[0,Math.sin(l/12*2*Math.PI)*100]},transition:{duration:2,delay:l*.1,repeat:1/0,repeatDelay:1},className:"absolute top-1/2 left-1/2 w-2 h-2 rounded-full",style:{background:"radial-gradient(circle, rgba(255, 215, 0, 1) 0%, rgba(255, 165, 0, 0.8) 100%)",boxShadow:"0 0 10px rgba(255, 215, 0, 0.8)"}},l)),u.jsxs("div",{className:"relative overflow-hidden rounded-3xl p-8",style:{background:"linear-gradient(135deg, rgba(30, 60, 90, 0.95) 0%, rgba(20, 40, 70, 0.98) 100%)",border:"3px solid rgba(138, 206, 224, 0.6)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(138, 206, 224, 0.3), inset 0 2px 10px rgba(138, 206, 224, 0.2)"},children:[u.jsx(se.div,{animate:{background:["radial-gradient(circle at 20% 20%, rgba(138, 206, 224, 0.15) 0%, transparent 50%)","radial-gradient(circle at 80% 80%, rgba(138, 206, 224, 0.15) 0%, transparent 50%)","radial-gradient(circle at 20% 20%, rgba(138, 206, 224, 0.15) 0%, transparent 50%)"]},transition:{duration:4,repeat:1/0},className:"absolute inset-0 pointer-events-none"}),u.jsx("div",{className:"flex justify-center mb-4",children:u.jsxs(se.div,{initial:{scale:0,rotate:-180},animate:{scale:1,rotate:0},transition:{delay:.2,type:"spring",stiffness:200},className:"relative",children:[u.jsx("div",{className:"w-20 h-20 rounded-full flex items-center justify-center",style:{background:"linear-gradient(135deg, #4ade80 0%, #22c55e 100%)",boxShadow:"0 10px 30px rgba(34, 197, 94, 0.5), inset 0 2px 10px rgba(255, 255, 255, 0.3)"},children:u.jsx(c8,{className:"w-10 h-10 text-white",strokeWidth:3})}),u.jsx(se.div,{animate:{scale:[1,1.3,1],opacity:[.5,0,.5]},transition:{duration:2,repeat:1/0},className:"absolute inset-0 rounded-full",style:{background:"radial-gradient(circle, rgba(74, 222, 128, 0.6) 0%, transparent 70%)"}})]})}),u.jsx(se.h2,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.3},className:"text-2xl font-black text-center mb-3",style:{color:"#8ACEE0",textShadow:"0 2px 10px rgba(138, 206, 224, 0.5), 0 0 20px rgba(138, 206, 224, 0.3)"},children:"🎉 تبریک! 🎉"}),u.jsxs(se.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.5},className:"space-y-3 mb-6",children:[u.jsx("p",{className:"text-white text-center text-base leading-relaxed font-bold",children:"چالش با موفقیت به پایان رسید!"}),u.jsx("p",{className:"text-white/80 text-center text-sm leading-relaxed",children:"پست شما بعد از بررسی منتشر می‌شود"})]}),u.jsx(se.div,{initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},transition:{delay:.7,type:"spring",stiffness:150},className:"relative mb-6",children:u.jsxs("div",{className:"relative overflow-hidden rounded-2xl p-6",style:{background:"linear-gradient(135deg, rgba(255, 184, 0, 0.2) 0%, rgba(255, 140, 0, 0.15) 100%)",border:"2px solid rgba(255, 184, 0, 0.5)",boxShadow:"0 10px 30px rgba(255, 165, 0, 0.3), inset 0 2px 8px rgba(255, 255, 255, 0.2)"},children:[u.jsx(se.div,{animate:{x:["-100%","200%"]},transition:{duration:2,repeat:1/0,repeatDelay:1},className:"absolute inset-0",style:{background:"linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%)"}}),u.jsxs("div",{className:"flex items-center justify-center gap-3 mb-2",children:[u.jsx(se.div,{animate:{rotate:[0,10,-10,0]},transition:{duration:1,repeat:1/0,repeatDelay:1},children:u.jsx(T8,{className:"w-8 h-8",style:{color:"#FFB800"}})}),u.jsx("h3",{className:"text-xl font-black",style:{color:"#FFB800",textShadow:"0 2px 10px rgba(255, 184, 0, 0.5)"},children:"جایزه دریافت شد!"}),u.jsx(se.div,{animate:{rotate:[0,-10,10,0]},transition:{duration:1,repeat:1/0,repeatDelay:1,delay:.2},children:u.jsx(p6,{className:"w-7 h-7",style:{color:"#FFB800"}})})]}),u.jsxs("p",{className:"text-white text-center text-base font-bold leading-relaxed",children:["مدال ",u.jsx("span",{style:{color:"#FFB800"},children:a})," به کیف جادوییت اضافه شد!"]})]})}),u.jsx(se.button,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.9},whileHover:{scale:1.05},whileTap:{scale:.95},onClick:n,className:"w-full py-4 rounded-full font-black text-lg",style:{background:"linear-gradient(180deg, #8ACEE0 0%, #5A9FB0 100%)",boxShadow:"0 6px 20px rgba(138, 206, 224, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.3)",color:"#0a1f2e",textShadow:"0 1px 0 rgba(255, 255, 255, 0.3)"},children:"باشه، بریم!"})]})]}),s.map(o=>u.jsx(se.div,{initial:{x:o.x,y:window.innerHeight+20,opacity:0},animate:{y:-20,opacity:[0,1,0]},transition:{duration:o.duration,delay:o.delay,repeat:1/0},className:"absolute w-1 h-1 rounded-full",style:{background:o.color,boxShadow:`0 0 6px ${o.color}`}},`particle-${o.id}`))]})})}function Dg(){var M,_;const e=bn(),n=Ut(),{topicId:a="1"}=Wl(),s=Vs(a);gr(`ثبت ماموریت ${s.title}`);const{addNewItem:o}=Fy(),{refreshInbox:l}=Ji(),[d,f]=v.useState(!1),g=v.useRef(null),[m,x]=v.useState(172),h=(M=n.state)==null?void 0:M.doingMission,w=(_=n.state)==null?void 0:_.selectedMissionTitle,k=v.useMemo(()=>w||localStorage.getItem("current_mission_title")||(h==null?void 0:h.title)||"چالش انتخاب‌شده",[w,h]),j=v.useCallback(()=>{e(-1)},[e]),E=V=>{console.log("Submitting challenge:",V),f(!0),o(),l()},C=()=>{f(!1),e(`/feed/${a}`)},I=s.formComponent;return v.useLayoutEffect(()=>{const V=()=>{var O;const re=((O=g.current)==null?void 0:O.getBoundingClientRect().height)??0;re>0&&x(Math.ceil(re))};V();const H=new ResizeObserver(()=>{V()});return g.current&&H.observe(g.current),window.addEventListener("resize",V),()=>{H.disconnect(),window.removeEventListener("resize",V)}},[]),u.jsxs("div",{className:"min-h-screen w-full relative overflow-hidden",children:[u.jsx(Ka,{position:"fixed",zIndex:0,imageUrl:Rn.submitChallenge}),u.jsxs("div",{className:"relative z-10 max-w-md mx-auto",children:[u.jsxs("div",{ref:g,children:[u.jsx(tc,{showBack:!0,onBack:j}),u.jsx("div",{className:"px-4 pb-2 text-center",children:u.jsx("h2",{className:"mt-1 text-[20px] font-extrabold leading-8",style:{display:"inline-block",background:"linear-gradient(90deg, #F6D8A5 0%, #F3A599 20%, #DB7EB2 48%, #AA6798 72%, #CB75AB 100%)",WebkitBackgroundClip:"text",backgroundClip:"text",WebkitTextFillColor:"transparent",color:"transparent",textShadow:"0 2px 10px rgba(255, 119, 202, 0.4)"},children:`ثبت چالش ${k}`})})]}),u.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 max-w-md mx-auto overflow-hidden",style:{paddingTop:`${m}px`,zIndex:1},children:u.jsx("div",{className:"h-full overflow-y-auto relative px-[24px] pt-[2px] pb-[132px]",style:{scrollbarWidth:"none",msOverflowStyle:"none",maskImage:"linear-gradient(to bottom, transparent 0%, black 4px)",WebkitMaskImage:"linear-gradient(to bottom, transparent 0%, black 4px)"},children:u.jsx(I,{topicId:a,topicTitle:s.title,onSubmit:E,doingMission:h})})})]}),u.jsx("style",{children:`
.h-full.overflow-y-auto::-webkit-scrollbar { display: none; }
`}),u.jsx(nc,{}),u.jsx(UE,{isOpen:d,onClose:C,topicTitle:s.title})]})}function By(e){return u.jsx(S1,{children:e})}function Oa(e){return By(u.jsx(e,{}))}const $E=B5([{path:"/login",element:u.jsx($6,{})},{path:"/",element:By(u.jsx(TC,{})),handle:{header:{title:"خانه",showBack:!1,action:"profile"}},children:[{index:!0,element:u.jsx(tj,{}),handle:{header:{title:"خانه",showBack:!1,action:"profile"}}},{path:"public-chat",element:u.jsx(jj,{}),handle:{header:{title:"چت با ربات",showBack:!0,backTo:"/",action:"history"}}},{path:"magic-bag",element:u.jsx(fj,{}),handle:{header:{title:"کیف جادویی",showBack:!1,action:"profile"}}},{path:"messages",element:u.jsx(pj,{}),handle:{header:{title:"اعلان‌ها",showBack:!1,action:"profile"}}},{path:"profile",element:u.jsx(cj,{}),handle:{header:{title:"پروفایل",showBack:!1,action:"profile"}}},{path:"edit-profile",element:u.jsx(uj,{}),handle:{header:{title:"ویرایش پروفایل",showBack:!0,backTo:"/profile",action:"settings"}}}]},{path:"/feed/:topicId",element:Oa(sE)},{path:"/challenges/:topicId",element:Oa(Fg)},{path:"/chatbot/:topicId",element:Oa(Ig)},{path:"/submit/:topicId",element:Oa(Dg)},{path:"/challenges",element:Oa(Fg)},{path:"/chatbot",element:Oa(Ig)},{path:"/submit-challenge",element:Oa(Dg)}]);function HE(){return u.jsx("div",{className:"fixed inset-0 flex items-center justify-center",style:{background:"radial-gradient(120% 120% at 50% 0%, rgba(124, 58, 237, 0.32) 0%, rgba(46, 27, 61, 1) 52%, rgba(35, 24, 62, 1) 100%)"},children:u.jsx("div",{className:"h-9 w-9 animate-spin rounded-full border-2 border-[#ffd6f0]/30 border-t-[#ff79cf]","aria-label":"در حال بارگذاری"})})}function WE(){return u.jsx(M6,{children:u.jsx(hC,{children:u.jsx(A6,{children:u.jsxs(I6,{children:[u.jsx(Q5,{router:$E,fallbackElement:u.jsx(HE,{})}),u.jsx(rE,{position:"top-center",richColors:!0,dir:"rtl",toastOptions:{style:{fontFamily:"Alibaba, sans-serif",direction:"rtl",textAlign:"right"}}})]})})})})}Nv.createRoot(document.getElementById("root")).render(u.jsx(WE,{}));