@alfatech/livechat 2026.4.0-2.1 → 2026.4.1-3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.css +1 -1
- package/dist/main.js +28 -28
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var jg=e=>{throw TypeError(e)};var e2=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var rd=(e,t,n)=>t.has(e)||jg("Cannot "+n);var T=(e,t,n)=>(rd(e,t,"read from private field"),n?n.call(e):t.get(e)),fe=(e,t,n)=>t.has(e)?jg("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),le=(e,t,n,r)=>(rd(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),we=(e,t,n)=>(rd(e,t,"access private method"),n);var yl=(e,t,n,r)=>({set _(i){le(e,t,i,n)},get _(){return T(e,t,r)}});var s$=e2((rn,sn)=>{function t2(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var mh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Pr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Jx={exports:{}},lu={},e1={exports:{}},Ce={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@ var bg=e=>{throw TypeError(e)};var zC=(e,t)=>()=>(t||e((t={exports:{}}).exports,
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var rl=Symbol.for("react.element"),n2=Symbol.for("react.portal"),r2=Symbol.for("react.fragment"),i2=Symbol.for("react.strict_mode"),s2=Symbol.for("react.profiler"),o2=Symbol.for("react.provider"),a2=Symbol.for("react.context"),l2=Symbol.for("react.forward_ref"),c2=Symbol.for("react.suspense"),u2=Symbol.for("react.memo"),d2=Symbol.for("react.lazy"),Rg=Symbol.iterator;function f2(e){return e===null||typeof e!="object"?null:(e=Rg&&e[Rg]||e["@@iterator"],typeof e=="function"?e:null)}var t1={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},n1=Object.assign,r1={};function To(e,t,n){this.props=e,this.context=t,this.refs=r1,this.updater=n||t1}To.prototype.isReactComponent={};To.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};To.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function i1(){}i1.prototype=To.prototype;function gh(e,t,n){this.props=e,this.context=t,this.refs=r1,this.updater=n||t1}var vh=gh.prototype=new i1;vh.constructor=gh;n1(vh,To.prototype);vh.isPureReactComponent=!0;var Pg=Array.isArray,s1=Object.prototype.hasOwnProperty,yh={current:null},o1={key:!0,ref:!0,__self:!0,__source:!0};function a1(e,t,n){var r,i={},s=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)s1.call(t,r)&&!o1.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];i.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return{$$typeof:rl,type:e,key:s,ref:o,props:i,_owner:yh.current}}function p2(e,t){return{$$typeof:rl,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function xh(e){return typeof e=="object"&&e!==null&&e.$$typeof===rl}function h2(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Mg=/\/+/g;function id(e,t){return typeof e=="object"&&e!==null&&e.key!=null?h2(""+e.key):t.toString(36)}function Ql(e,t,n,r,i){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case rl:case n2:o=!0}}if(o)return o=e,i=i(o),e=r===""?"."+id(o,0):r,Pg(i)?(n="",e!=null&&(n=e.replace(Mg,"$&/")+"/"),Ql(i,t,n,"",function(c){return c})):i!=null&&(xh(i)&&(i=p2(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(Mg,"$&/")+"/")+e)),t.push(i)),1;if(o=0,r=r===""?".":r+":",Pg(e))for(var a=0;a<e.length;a++){s=e[a];var l=r+id(s,a);o+=Ql(s,t,n,l,i)}else if(l=f2(e),typeof l=="function")for(e=l.call(e),a=0;!(s=e.next()).done;)s=s.value,l=r+id(s,a++),o+=Ql(s,t,n,l,i);else if(s==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function xl(e,t,n){if(e==null)return e;var r=[],i=0;return Ql(e,r,"","",function(s){return t.call(n,s,i++)}),r}function m2(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Lt={current:null},Kl={transition:null},g2={ReactCurrentDispatcher:Lt,ReactCurrentBatchConfig:Kl,ReactCurrentOwner:yh};function l1(){throw Error("act(...) is not supported in production builds of React.")}Ce.Children={map:xl,forEach:function(e,t,n){xl(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return xl(e,function(){t++}),t},toArray:function(e){return xl(e,function(t){return t})||[]},only:function(e){if(!xh(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ce.Component=To;Ce.Fragment=r2;Ce.Profiler=s2;Ce.PureComponent=gh;Ce.StrictMode=i2;Ce.Suspense=c2;Ce.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=g2;Ce.act=l1;Ce.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=n1({},e.props),i=e.key,s=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,o=yh.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)s1.call(t,l)&&!o1.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:rl,type:e.type,key:i,ref:s,props:r,_owner:o}};Ce.createContext=function(e){return e={$$typeof:a2,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:o2,_context:e},e.Consumer=e};Ce.createElement=a1;Ce.createFactory=function(e){var t=a1.bind(null,e);return t.type=e,t};Ce.createRef=function(){return{current:null}};Ce.forwardRef=function(e){return{$$typeof:l2,render:e}};Ce.isValidElement=xh;Ce.lazy=function(e){return{$$typeof:d2,_payload:{_status:-1,_result:e},_init:m2}};Ce.memo=function(e,t){return{$$typeof:u2,type:e,compare:t===void 0?null:t}};Ce.startTransition=function(e){var t=Kl.transition;Kl.transition={};try{e()}finally{Kl.transition=t}};Ce.unstable_act=l1;Ce.useCallback=function(e,t){return Lt.current.useCallback(e,t)};Ce.useContext=function(e){return Lt.current.useContext(e)};Ce.useDebugValue=function(){};Ce.useDeferredValue=function(e){return Lt.current.useDeferredValue(e)};Ce.useEffect=function(e,t){return Lt.current.useEffect(e,t)};Ce.useId=function(){return Lt.current.useId()};Ce.useImperativeHandle=function(e,t,n){return Lt.current.useImperativeHandle(e,t,n)};Ce.useInsertionEffect=function(e,t){return Lt.current.useInsertionEffect(e,t)};Ce.useLayoutEffect=function(e,t){return Lt.current.useLayoutEffect(e,t)};Ce.useMemo=function(e,t){return Lt.current.useMemo(e,t)};Ce.useReducer=function(e,t,n){return Lt.current.useReducer(e,t,n)};Ce.useRef=function(e){return Lt.current.useRef(e)};Ce.useState=function(e){return Lt.current.useState(e)};Ce.useSyncExternalStore=function(e,t,n){return Lt.current.useSyncExternalStore(e,t,n)};Ce.useTransition=function(){return Lt.current.useTransition()};Ce.version="18.3.1";e1.exports=Ce;var g=e1.exports;const ee=Pr(g),v2=t2({__proto__:null,default:ee},[g]);/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.production.min.js
|
|
12
12
|
*
|
|
@@ -14,7 +14,7 @@ var bg=e=>{throw TypeError(e)};var zC=(e,t)=>()=>(t||e((t={exports:{}}).exports,
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
17
|
+
*/var y2=g,x2=Symbol.for("react.element"),w2=Symbol.for("react.fragment"),b2=Object.prototype.hasOwnProperty,k2=y2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,S2={key:!0,ref:!0,__self:!0,__source:!0};function c1(e,t,n){var r,i={},s=null,o=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)b2.call(t,r)&&!S2.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:x2,type:e,key:s,ref:o,props:i,_owner:k2.current}}lu.Fragment=w2;lu.jsx=c1;lu.jsxs=c1;Jx.exports=lu;var f=Jx.exports,u1={exports:{}},ln={},d1={exports:{}},f1={};/**
|
|
18
18
|
* @license React
|
|
19
19
|
* scheduler.production.min.js
|
|
20
20
|
*
|
|
@@ -22,7 +22,7 @@ var bg=e=>{throw TypeError(e)};var zC=(e,t)=>()=>(t||e((t={exports:{}}).exports,
|
|
|
22
22
|
*
|
|
23
23
|
* This source code is licensed under the MIT license found in the
|
|
24
24
|
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/(function(e){function t(R,z){var
|
|
25
|
+
*/(function(e){function t(R,z){var H=R.length;R.push(z);e:for(;0<H;){var W=H-1>>>1,G=R[W];if(0<i(G,z))R[W]=z,R[H]=G,H=W;else break e}}function n(R){return R.length===0?null:R[0]}function r(R){if(R.length===0)return null;var z=R[0],H=R.pop();if(H!==z){R[0]=H;e:for(var W=0,G=R.length,te=G>>>1;W<te;){var se=2*(W+1)-1,pe=R[se],ue=se+1,ke=R[ue];if(0>i(pe,H))ue<G&&0>i(ke,pe)?(R[W]=ke,R[ue]=H,W=ue):(R[W]=pe,R[se]=H,W=se);else if(ue<G&&0>i(ke,H))R[W]=ke,R[ue]=H,W=ue;else break e}}return z}function i(R,z){var H=R.sortIndex-z.sortIndex;return H!==0?H:R.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],c=[],d=1,u=null,p=3,h=!1,y=!1,w=!1,b=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(R){for(var z=n(c);z!==null;){if(z.callback===null)r(c);else if(z.startTime<=R)r(c),z.sortIndex=z.expirationTime,t(l,z);else break;z=n(c)}}function S(R){if(w=!1,x(R),!y)if(n(l)!==null)y=!0,I(C);else{var z=n(c);z!==null&&N(S,z.startTime-R)}}function C(R,z){y=!1,w&&(w=!1,m(A),A=-1),h=!0;var H=p;try{for(x(z),u=n(l);u!==null&&(!(u.expirationTime>z)||R&&!L());){var W=u.callback;if(typeof W=="function"){u.callback=null,p=u.priorityLevel;var G=W(u.expirationTime<=z);z=e.unstable_now(),typeof G=="function"?u.callback=G:u===n(l)&&r(l),x(z)}else r(l);u=n(l)}if(u!==null)var te=!0;else{var se=n(c);se!==null&&N(S,se.startTime-z),te=!1}return te}finally{u=null,p=H,h=!1}}var _=!1,j=null,A=-1,E=5,D=-1;function L(){return!(e.unstable_now()-D<E)}function O(){if(j!==null){var R=e.unstable_now();D=R;var z=!0;try{z=j(!0,R)}finally{z?q():(_=!1,j=null)}}else _=!1}var q;if(typeof v=="function")q=function(){v(O)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,B=$.port2;$.port1.onmessage=O,q=function(){B.postMessage(null)}}else q=function(){b(O,0)};function I(R){j=R,_||(_=!0,q())}function N(R,z){A=b(function(){R(e.unstable_now())},z)}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(R){R.callback=null},e.unstable_continueExecution=function(){y||h||(y=!0,I(C))},e.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<R?Math.floor(1e3/R):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(R){switch(p){case 1:case 2:case 3:var z=3;break;default:z=p}var H=p;p=z;try{return R()}finally{p=H}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(R,z){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var H=p;p=R;try{return z()}finally{p=H}},e.unstable_scheduleCallback=function(R,z,H){var W=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?W+H:W):H=W,R){case 1:var G=-1;break;case 2:G=250;break;case 5:G=1073741823;break;case 4:G=1e4;break;default:G=5e3}return G=H+G,R={id:d++,callback:z,priorityLevel:R,startTime:H,expirationTime:G,sortIndex:-1},H>W?(R.sortIndex=H,t(c,R),n(l)===null&&R===n(c)&&(w?(m(A),A=-1):w=!0,N(S,H-W))):(R.sortIndex=G,t(l,R),y||h||(y=!0,I(C))),R},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(R){var z=p;return function(){var H=p;p=z;try{return R.apply(this,arguments)}finally{p=H}}}})(f1);d1.exports=f1;var C2=d1.exports;/**
|
|
26
26
|
* @license React
|
|
27
27
|
* react-dom.production.min.js
|
|
28
28
|
*
|
|
@@ -30,14 +30,14 @@ var bg=e=>{throw TypeError(e)};var zC=(e,t)=>()=>(t||e((t={exports:{}}).exports,
|
|
|
30
30
|
*
|
|
31
31
|
* This source code is licensed under the MIT license found in the
|
|
32
32
|
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var
|
|
34
|
-
`+
|
|
33
|
+
*/var _2=g,an=C2;function X(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var p1=new Set,ba={};function os(e,t){uo(e,t),uo(e+"Capture",t)}function uo(e,t){for(ba[e]=t,e=0;e<t.length;e++)p1.add(t[e])}var Cr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),pf=Object.prototype.hasOwnProperty,T2=/^[: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]*$/,Ng={},Og={};function E2(e){return pf.call(Og,e)?!0:pf.call(Ng,e)?!1:T2.test(e)?Og[e]=!0:(Ng[e]=!0,!1)}function A2(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function j2(e,t,n,r){if(t===null||typeof t>"u"||A2(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ft(e,t,n,r,i,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var kt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){kt[e]=new Ft(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];kt[t]=new Ft(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){kt[e]=new Ft(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){kt[e]=new Ft(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){kt[e]=new Ft(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){kt[e]=new Ft(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){kt[e]=new Ft(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){kt[e]=new Ft(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){kt[e]=new Ft(e,5,!1,e.toLowerCase(),null,!1,!1)});var wh=/[\-:]([a-z])/g;function bh(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(wh,bh);kt[t]=new Ft(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(wh,bh);kt[t]=new Ft(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(wh,bh);kt[t]=new Ft(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){kt[e]=new Ft(e,1,!1,e.toLowerCase(),null,!1,!1)});kt.xlinkHref=new Ft("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){kt[e]=new Ft(e,1,!1,e.toLowerCase(),null,!0,!0)});function kh(e,t,n,r){var i=kt.hasOwnProperty(t)?kt[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(j2(t,n,i,r)&&(n=null),r||i===null?E2(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Mr=_2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,wl=Symbol.for("react.element"),Ss=Symbol.for("react.portal"),Cs=Symbol.for("react.fragment"),Sh=Symbol.for("react.strict_mode"),hf=Symbol.for("react.profiler"),h1=Symbol.for("react.provider"),m1=Symbol.for("react.context"),Ch=Symbol.for("react.forward_ref"),mf=Symbol.for("react.suspense"),gf=Symbol.for("react.suspense_list"),_h=Symbol.for("react.memo"),$r=Symbol.for("react.lazy"),g1=Symbol.for("react.offscreen"),Dg=Symbol.iterator;function Lo(e){return e===null||typeof e!="object"?null:(e=Dg&&e[Dg]||e["@@iterator"],typeof e=="function"?e:null)}var Ke=Object.assign,sd;function Qo(e){if(sd===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);sd=t&&t[1]||""}return`
|
|
34
|
+
`+sd+e}var od=!1;function ad(e,t){if(!e||od)return"";od=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var i=c.stack.split(`
|
|
35
35
|
`),s=r.stack.split(`
|
|
36
36
|
`),o=i.length-1,a=s.length-1;1<=o&&0<=a&&i[o]!==s[a];)a--;for(;1<=o&&0<=a;o--,a--)if(i[o]!==s[a]){if(o!==1||a!==1)do if(o--,a--,0>a||i[o]!==s[a]){var l=`
|
|
37
|
-
`+i[o].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{td=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ho(e):""}function v2(e){switch(e.tag){case 5:return Ho(e.type);case 16:return Ho("Lazy");case 13:return Ho("Suspense");case 19:return Ho("SuspenseList");case 0:case 2:case 15:return e=nd(e.type,!1),e;case 11:return e=nd(e.type.render,!1),e;case 1:return e=nd(e.type,!0),e;default:return""}}function df(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ss:return"Fragment";case ks:return"Portal";case lf:return"Profiler";case gh:return"StrictMode";case cf:return"Suspense";case uf:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case n1:return(e.displayName||"Context")+".Consumer";case t1:return(e._context.displayName||"Context")+".Provider";case vh:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case yh:return t=e.displayName||null,t!==null?t:df(e.type)||"Memo";case Fr:t=e._payload,e=e._init;try{return df(e(t))}catch{}}return null}function y2(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return df(t);case 8:return t===gh?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function di(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function i1(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function x2(e){var t=i1(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function gl(e){e._valueTracker||(e._valueTracker=x2(e))}function s1(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=i1(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function pc(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function ff(e,t){var n=t.checked;return Qe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function jg(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=di(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function o1(e,t){t=t.checked,t!=null&&mh(e,"checked",t,!1)}function pf(e,t){o1(e,t);var n=di(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?hf(e,t.type,n):t.hasOwnProperty("defaultValue")&&hf(e,t.type,di(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ag(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function hf(e,t,n){(t!=="number"||pc(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Wo=Array.isArray;function $s(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+di(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function mf(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(Y(91));return Qe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Rg(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(Y(92));if(Wo(n)){if(1<n.length)throw Error(Y(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:di(n)}}function a1(e,t){var n=di(t.value),r=di(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Pg(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function l1(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function gf(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?l1(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var vl,c1=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(vl=vl||document.createElement("div"),vl.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=vl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function va(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Jo={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},w2=["Webkit","ms","Moz","O"];Object.keys(Jo).forEach(function(e){w2.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Jo[t]=Jo[e]})});function u1(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Jo.hasOwnProperty(e)&&Jo[e]?(""+t).trim():t+"px"}function d1(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=u1(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var b2=Qe({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 vf(e,t){if(t){if(b2[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Y(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Y(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Y(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Y(62))}}function yf(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var xf=null;function xh(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wf=null,zs=null,Vs=null;function Mg(e){if(e=tl(e)){if(typeof wf!="function")throw Error(Y(280));var t=e.stateNode;t&&(t=lu(t),wf(e.stateNode,e.type,t))}}function f1(e){zs?Vs?Vs.push(e):Vs=[e]:zs=e}function p1(){if(zs){var e=zs,t=Vs;if(Vs=zs=null,Mg(e),t)for(e=0;e<t.length;e++)Mg(t[e])}}function h1(e,t){return e(t)}function m1(){}var rd=!1;function g1(e,t,n){if(rd)return e(t,n);rd=!0;try{return h1(e,t,n)}finally{rd=!1,(zs!==null||Vs!==null)&&(m1(),p1())}}function ya(e,t){var n=e.stateNode;if(n===null)return null;var r=lu(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(Y(231,t,typeof n));return n}var bf=!1;if(Cr)try{var No={};Object.defineProperty(No,"passive",{get:function(){bf=!0}}),window.addEventListener("test",No,No),window.removeEventListener("test",No,No)}catch{bf=!1}function k2(e,t,n,r,i,s,o,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(d){this.onError(d)}}var ea=!1,hc=null,mc=!1,kf=null,S2={onError:function(e){ea=!0,hc=e}};function C2(e,t,n,r,i,s,o,a,l){ea=!1,hc=null,k2.apply(S2,arguments)}function T2(e,t,n,r,i,s,o,a,l){if(C2.apply(this,arguments),ea){if(ea){var c=hc;ea=!1,hc=null}else throw Error(Y(198));mc||(mc=!0,kf=c)}}function os(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function v1(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Og(e){if(os(e)!==e)throw Error(Y(188))}function _2(e){var t=e.alternate;if(!t){if(t=os(e),t===null)throw Error(Y(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return Og(i),e;if(s===r)return Og(i),t;s=s.sibling}throw Error(Y(188))}if(n.return!==r.return)n=i,r=s;else{for(var o=!1,a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o)throw Error(Y(189))}}if(n.alternate!==r)throw Error(Y(190))}if(n.tag!==3)throw Error(Y(188));return n.stateNode.current===n?e:t}function y1(e){return e=_2(e),e!==null?x1(e):null}function x1(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=x1(e);if(t!==null)return t;e=e.sibling}return null}var w1=on.unstable_scheduleCallback,Ng=on.unstable_cancelCallback,E2=on.unstable_shouldYield,j2=on.unstable_requestPaint,nt=on.unstable_now,A2=on.unstable_getCurrentPriorityLevel,wh=on.unstable_ImmediatePriority,b1=on.unstable_UserBlockingPriority,gc=on.unstable_NormalPriority,R2=on.unstable_LowPriority,k1=on.unstable_IdlePriority,iu=null,tr=null;function P2(e){if(tr&&typeof tr.onCommitFiberRoot=="function")try{tr.onCommitFiberRoot(iu,e,void 0,(e.current.flags&128)===128)}catch{}}var Fn=Math.clz32?Math.clz32:N2,M2=Math.log,O2=Math.LN2;function N2(e){return e>>>=0,e===0?32:31-(M2(e)/O2|0)|0}var yl=64,xl=4194304;function qo(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function vc(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~i;a!==0?r=qo(a):(s&=o,s!==0&&(r=qo(s)))}else o=n&~i,o!==0?r=qo(o):s!==0&&(r=qo(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Fn(t),i=1<<n,r|=e[n],t&=~i;return r}function D2(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function I2(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var o=31-Fn(s),a=1<<o,l=i[o];l===-1?(!(a&n)||a&r)&&(i[o]=D2(a,t)):l<=t&&(e.expiredLanes|=a),s&=~a}}function Sf(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function S1(){var e=yl;return yl<<=1,!(yl&4194240)&&(yl=64),e}function id(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ja(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Fn(t),e[t]=n}function L2(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-Fn(n),s=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~s}}function bh(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Fn(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Re=0;function C1(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var T1,kh,_1,E1,j1,Cf=!1,wl=[],ti=null,ni=null,ri=null,xa=new Map,wa=new Map,zr=[],F2="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 Dg(e,t){switch(e){case"focusin":case"focusout":ti=null;break;case"dragenter":case"dragleave":ni=null;break;case"mouseover":case"mouseout":ri=null;break;case"pointerover":case"pointerout":xa.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":wa.delete(t.pointerId)}}function Do(e,t,n,r,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},t!==null&&(t=tl(t),t!==null&&kh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function B2(e,t,n,r,i){switch(t){case"focusin":return ti=Do(ti,e,t,n,r,i),!0;case"dragenter":return ni=Do(ni,e,t,n,r,i),!0;case"mouseover":return ri=Do(ri,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return xa.set(s,Do(xa.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,wa.set(s,Do(wa.get(s)||null,e,t,n,r,i)),!0}return!1}function A1(e){var t=Pi(e.target);if(t!==null){var n=os(t);if(n!==null){if(t=n.tag,t===13){if(t=v1(n),t!==null){e.blockedOn=t,j1(e.priority,function(){_1(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ql(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Tf(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);xf=r,n.target.dispatchEvent(r),xf=null}else return t=tl(n),t!==null&&kh(t),e.blockedOn=n,!1;t.shift()}return!0}function Ig(e,t,n){ql(e)&&n.delete(t)}function $2(){Cf=!1,ti!==null&&ql(ti)&&(ti=null),ni!==null&&ql(ni)&&(ni=null),ri!==null&&ql(ri)&&(ri=null),xa.forEach(Ig),wa.forEach(Ig)}function Io(e,t){e.blockedOn===t&&(e.blockedOn=null,Cf||(Cf=!0,on.unstable_scheduleCallback(on.unstable_NormalPriority,$2)))}function ba(e){function t(i){return Io(i,e)}if(0<wl.length){Io(wl[0],e);for(var n=1;n<wl.length;n++){var r=wl[n];r.blockedOn===e&&(r.blockedOn=null)}}for(ti!==null&&Io(ti,e),ni!==null&&Io(ni,e),ri!==null&&Io(ri,e),xa.forEach(t),wa.forEach(t),n=0;n<zr.length;n++)r=zr[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<zr.length&&(n=zr[0],n.blockedOn===null);)A1(n),n.blockedOn===null&&zr.shift()}var Us=Pr.ReactCurrentBatchConfig,yc=!0;function z2(e,t,n,r){var i=Re,s=Us.transition;Us.transition=null;try{Re=1,Sh(e,t,n,r)}finally{Re=i,Us.transition=s}}function V2(e,t,n,r){var i=Re,s=Us.transition;Us.transition=null;try{Re=4,Sh(e,t,n,r)}finally{Re=i,Us.transition=s}}function Sh(e,t,n,r){if(yc){var i=Tf(e,t,n,r);if(i===null)hd(e,t,r,xc,n),Dg(e,r);else if(B2(i,e,t,n,r))r.stopPropagation();else if(Dg(e,r),t&4&&-1<F2.indexOf(e)){for(;i!==null;){var s=tl(i);if(s!==null&&T1(s),s=Tf(e,t,n,r),s===null&&hd(e,t,r,xc,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else hd(e,t,r,null,n)}}var xc=null;function Tf(e,t,n,r){if(xc=null,e=xh(r),e=Pi(e),e!==null)if(t=os(e),t===null)e=null;else if(n=t.tag,n===13){if(e=v1(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return xc=e,null}function R1(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(A2()){case wh:return 1;case b1:return 4;case gc:case R2:return 16;case k1:return 536870912;default:return 16}default:return 16}}var Zr=null,Ch=null,Gl=null;function P1(){if(Gl)return Gl;var e,t=Ch,n=t.length,r,i="value"in Zr?Zr.value:Zr.textContent,s=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[s-r];r++);return Gl=i.slice(e,1<r?1-r:void 0)}function Yl(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function bl(){return!0}function Lg(){return!1}function ln(e){function t(n,r,i,s,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?bl:Lg,this.isPropagationStopped=Lg,this}return Qe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=bl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=bl)},persist:function(){},isPersistent:bl}),t}var So={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Th=ln(So),el=Qe({},So,{view:0,detail:0}),U2=ln(el),sd,od,Lo,su=Qe({},el,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:_h,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Lo&&(Lo&&e.type==="mousemove"?(sd=e.screenX-Lo.screenX,od=e.screenY-Lo.screenY):od=sd=0,Lo=e),sd)},movementY:function(e){return"movementY"in e?e.movementY:od}}),Fg=ln(su),H2=Qe({},su,{dataTransfer:0}),W2=ln(H2),q2=Qe({},el,{relatedTarget:0}),ad=ln(q2),G2=Qe({},So,{animationName:0,elapsedTime:0,pseudoElement:0}),Y2=ln(G2),Q2=Qe({},So,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),K2=ln(Q2),X2=Qe({},So,{data:0}),Bg=ln(X2),Z2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},J2={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"},eT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function tT(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=eT[e])?!!t[e]:!1}function _h(){return tT}var nT=Qe({},el,{key:function(e){if(e.key){var t=Z2[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Yl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?J2[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:_h,charCode:function(e){return e.type==="keypress"?Yl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Yl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),rT=ln(nT),iT=Qe({},su,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),$g=ln(iT),sT=Qe({},el,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:_h}),oT=ln(sT),aT=Qe({},So,{propertyName:0,elapsedTime:0,pseudoElement:0}),lT=ln(aT),cT=Qe({},su,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),uT=ln(cT),dT=[9,13,27,32],Eh=Cr&&"CompositionEvent"in window,ta=null;Cr&&"documentMode"in document&&(ta=document.documentMode);var fT=Cr&&"TextEvent"in window&&!ta,M1=Cr&&(!Eh||ta&&8<ta&&11>=ta),zg=" ",Vg=!1;function O1(e,t){switch(e){case"keyup":return dT.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function N1(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Cs=!1;function pT(e,t){switch(e){case"compositionend":return N1(t);case"keypress":return t.which!==32?null:(Vg=!0,zg);case"textInput":return e=t.data,e===zg&&Vg?null:e;default:return null}}function hT(e,t){if(Cs)return e==="compositionend"||!Eh&&O1(e,t)?(e=P1(),Gl=Ch=Zr=null,Cs=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return M1&&t.locale!=="ko"?null:t.data;default:return null}}var mT={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 Ug(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!mT[e.type]:t==="textarea"}function D1(e,t,n,r){f1(r),t=wc(t,"onChange"),0<t.length&&(n=new Th("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var na=null,ka=null;function gT(e){q1(e,0)}function ou(e){var t=Es(e);if(s1(t))return e}function vT(e,t){if(e==="change")return t}var I1=!1;if(Cr){var ld;if(Cr){var cd="oninput"in document;if(!cd){var Hg=document.createElement("div");Hg.setAttribute("oninput","return;"),cd=typeof Hg.oninput=="function"}ld=cd}else ld=!1;I1=ld&&(!document.documentMode||9<document.documentMode)}function Wg(){na&&(na.detachEvent("onpropertychange",L1),ka=na=null)}function L1(e){if(e.propertyName==="value"&&ou(ka)){var t=[];D1(t,ka,e,xh(e)),g1(gT,t)}}function yT(e,t,n){e==="focusin"?(Wg(),na=t,ka=n,na.attachEvent("onpropertychange",L1)):e==="focusout"&&Wg()}function xT(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ou(ka)}function wT(e,t){if(e==="click")return ou(t)}function bT(e,t){if(e==="input"||e==="change")return ou(t)}function kT(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var zn=typeof Object.is=="function"?Object.is:kT;function Sa(e,t){if(zn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!af.call(t,i)||!zn(e[i],t[i]))return!1}return!0}function qg(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Gg(e,t){var n=qg(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=qg(n)}}function F1(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?F1(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function B1(){for(var e=window,t=pc();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=pc(e.document)}return t}function jh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function ST(e){var t=B1(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&F1(n.ownerDocument.documentElement,n)){if(r!==null&&jh(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=Gg(n,s);var o=Gg(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var CT=Cr&&"documentMode"in document&&11>=document.documentMode,Ts=null,_f=null,ra=null,Ef=!1;function Yg(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ef||Ts==null||Ts!==pc(r)||(r=Ts,"selectionStart"in r&&jh(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ra&&Sa(ra,r)||(ra=r,r=wc(_f,"onSelect"),0<r.length&&(t=new Th("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Ts)))}function kl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var _s={animationend:kl("Animation","AnimationEnd"),animationiteration:kl("Animation","AnimationIteration"),animationstart:kl("Animation","AnimationStart"),transitionend:kl("Transition","TransitionEnd")},ud={},$1={};Cr&&($1=document.createElement("div").style,"AnimationEvent"in window||(delete _s.animationend.animation,delete _s.animationiteration.animation,delete _s.animationstart.animation),"TransitionEvent"in window||delete _s.transitionend.transition);function au(e){if(ud[e])return ud[e];if(!_s[e])return e;var t=_s[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in $1)return ud[e]=t[n];return e}var z1=au("animationend"),V1=au("animationiteration"),U1=au("animationstart"),H1=au("transitionend"),W1=new Map,Qg="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 vi(e,t){W1.set(e,t),ss(t,[e])}for(var dd=0;dd<Qg.length;dd++){var fd=Qg[dd],TT=fd.toLowerCase(),_T=fd[0].toUpperCase()+fd.slice(1);vi(TT,"on"+_T)}vi(z1,"onAnimationEnd");vi(V1,"onAnimationIteration");vi(U1,"onAnimationStart");vi("dblclick","onDoubleClick");vi("focusin","onFocus");vi("focusout","onBlur");vi(H1,"onTransitionEnd");oo("onMouseEnter",["mouseout","mouseover"]);oo("onMouseLeave",["mouseout","mouseover"]);oo("onPointerEnter",["pointerout","pointerover"]);oo("onPointerLeave",["pointerout","pointerover"]);ss("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ss("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ss("onBeforeInput",["compositionend","keypress","textInput","paste"]);ss("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ss("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ss("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Go="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(" "),ET=new Set("cancel close invalid load scroll toggle".split(" ").concat(Go));function Kg(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,T2(r,t,void 0,e),e.currentTarget=null}function q1(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==s&&i.isPropagationStopped())break e;Kg(i,a,c),s=l}else for(o=0;o<r.length;o++){if(a=r[o],l=a.instance,c=a.currentTarget,a=a.listener,l!==s&&i.isPropagationStopped())break e;Kg(i,a,c),s=l}}}if(mc)throw e=kf,mc=!1,kf=null,e}function Fe(e,t){var n=t[Mf];n===void 0&&(n=t[Mf]=new Set);var r=e+"__bubble";n.has(r)||(G1(t,e,2,!1),n.add(r))}function pd(e,t,n){var r=0;t&&(r|=4),G1(n,e,r,t)}var Sl="_reactListening"+Math.random().toString(36).slice(2);function Ca(e){if(!e[Sl]){e[Sl]=!0,e1.forEach(function(n){n!=="selectionchange"&&(ET.has(n)||pd(n,!1,e),pd(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Sl]||(t[Sl]=!0,pd("selectionchange",!1,t))}}function G1(e,t,n,r){switch(R1(t)){case 1:var i=z2;break;case 4:i=V2;break;default:i=Sh}n=i.bind(null,t,n,e),i=void 0,!bf||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function hd(e,t,n,r,i){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;o=o.return}for(;a!==null;){if(o=Pi(a),o===null)return;if(l=o.tag,l===5||l===6){r=s=o;continue e}a=a.parentNode}}r=r.return}g1(function(){var c=s,d=xh(n),u=[];e:{var p=W1.get(e);if(p!==void 0){var m=Th,y=e;switch(e){case"keypress":if(Yl(n)===0)break e;case"keydown":case"keyup":m=rT;break;case"focusin":y="focus",m=ad;break;case"focusout":y="blur",m=ad;break;case"beforeblur":case"afterblur":m=ad;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=Fg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=W2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=oT;break;case z1:case V1:case U1:m=Y2;break;case H1:m=lT;break;case"scroll":m=U2;break;case"wheel":m=uT;break;case"copy":case"cut":case"paste":m=K2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=$g}var w=(t&4)!==0,x=!w&&e==="scroll",h=w?p!==null?p+"Capture":null:p;w=[];for(var g=c,k;g!==null;){k=g;var C=k.stateNode;if(k.tag===5&&C!==null&&(k=C,h!==null&&(C=ya(g,h),C!=null&&w.push(Ta(g,C,k)))),x)break;g=g.return}0<w.length&&(p=new m(p,y,null,n,d),u.push({event:p,listeners:w}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",p&&n!==xf&&(y=n.relatedTarget||n.fromElement)&&(Pi(y)||y[Tr]))break e;if((m||p)&&(p=d.window===d?d:(p=d.ownerDocument)?p.defaultView||p.parentWindow:window,m?(y=n.relatedTarget||n.toElement,m=c,y=y?Pi(y):null,y!==null&&(x=os(y),y!==x||y.tag!==5&&y.tag!==6)&&(y=null)):(m=null,y=c),m!==y)){if(w=Fg,C="onMouseLeave",h="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(w=$g,C="onPointerLeave",h="onPointerEnter",g="pointer"),x=m==null?p:Es(m),k=y==null?p:Es(y),p=new w(C,g+"leave",m,n,d),p.target=x,p.relatedTarget=k,C=null,Pi(d)===c&&(w=new w(h,g+"enter",y,n,d),w.target=k,w.relatedTarget=x,C=w),x=C,m&&y)t:{for(w=m,h=y,g=0,k=w;k;k=ws(k))g++;for(k=0,C=h;C;C=ws(C))k++;for(;0<g-k;)w=ws(w),g--;for(;0<k-g;)h=ws(h),k--;for(;g--;){if(w===h||h!==null&&w===h.alternate)break t;w=ws(w),h=ws(h)}w=null}else w=null;m!==null&&Xg(u,p,m,w,!1),y!==null&&x!==null&&Xg(u,x,y,w,!0)}}e:{if(p=c?Es(c):window,m=p.nodeName&&p.nodeName.toLowerCase(),m==="select"||m==="input"&&p.type==="file")var S=vT;else if(Ug(p))if(I1)S=bT;else{S=xT;var T=yT}else(m=p.nodeName)&&m.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(S=wT);if(S&&(S=S(e,c))){D1(u,S,n,d);break e}T&&T(e,p,c),e==="focusout"&&(T=p._wrapperState)&&T.controlled&&p.type==="number"&&hf(p,"number",p.value)}switch(T=c?Es(c):window,e){case"focusin":(Ug(T)||T.contentEditable==="true")&&(Ts=T,_f=c,ra=null);break;case"focusout":ra=_f=Ts=null;break;case"mousedown":Ef=!0;break;case"contextmenu":case"mouseup":case"dragend":Ef=!1,Yg(u,n,d);break;case"selectionchange":if(CT)break;case"keydown":case"keyup":Yg(u,n,d)}var j;if(Eh)e:{switch(e){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else Cs?O1(e,n)&&(E="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(E="onCompositionStart");E&&(M1&&n.locale!=="ko"&&(Cs||E!=="onCompositionStart"?E==="onCompositionEnd"&&Cs&&(j=P1()):(Zr=d,Ch="value"in Zr?Zr.value:Zr.textContent,Cs=!0)),T=wc(c,E),0<T.length&&(E=new Bg(E,e,null,n,d),u.push({event:E,listeners:T}),j?E.data=j:(j=N1(n),j!==null&&(E.data=j)))),(j=fT?pT(e,n):hT(e,n))&&(c=wc(c,"onBeforeInput"),0<c.length&&(d=new Bg("onBeforeInput","beforeinput",null,n,d),u.push({event:d,listeners:c}),d.data=j))}q1(u,t)})}function Ta(e,t,n){return{instance:e,listener:t,currentTarget:n}}function wc(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=ya(e,n),s!=null&&r.unshift(Ta(e,s,i)),s=ya(e,t),s!=null&&r.push(Ta(e,s,i))),e=e.return}return r}function ws(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Xg(e,t,n,r,i){for(var s=t._reactName,o=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,i?(l=ya(n,s),l!=null&&o.unshift(Ta(n,l,a))):i||(l=ya(n,s),l!=null&&o.push(Ta(n,l,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var jT=/\r\n?/g,AT=/\u0000|\uFFFD/g;function Zg(e){return(typeof e=="string"?e:""+e).replace(jT,`
|
|
38
|
-
`).replace(AT,"")}function Cl(e,t,n){if(t=Zg(t),Zg(e)!==t&&n)throw Error(Y(425))}function bc(){}var jf=null,Af=null;function Rf(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Pf=typeof setTimeout=="function"?setTimeout:void 0,RT=typeof clearTimeout=="function"?clearTimeout:void 0,Jg=typeof Promise=="function"?Promise:void 0,PT=typeof queueMicrotask=="function"?queueMicrotask:typeof Jg<"u"?function(e){return Jg.resolve(null).then(e).catch(MT)}:Pf;function MT(e){setTimeout(function(){throw e})}function md(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),ba(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);ba(t)}function ii(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function ev(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Co=Math.random().toString(36).slice(2),Jn="__reactFiber$"+Co,_a="__reactProps$"+Co,Tr="__reactContainer$"+Co,Mf="__reactEvents$"+Co,OT="__reactListeners$"+Co,NT="__reactHandles$"+Co;function Pi(e){var t=e[Jn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Tr]||n[Jn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ev(e);e!==null;){if(n=e[Jn])return n;e=ev(e)}return t}e=n,n=e.parentNode}return null}function tl(e){return e=e[Jn]||e[Tr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Es(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Y(33))}function lu(e){return e[_a]||null}var Of=[],js=-1;function yi(e){return{current:e}}function $e(e){0>js||(e.current=Of[js],Of[js]=null,js--)}function Ie(e,t){js++,Of[js]=e.current,e.current=t}var fi={},Pt=yi(fi),Gt=yi(!1),Xi=fi;function ao(e,t){var n=e.type.contextTypes;if(!n)return fi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Yt(e){return e=e.childContextTypes,e!=null}function kc(){$e(Gt),$e(Pt)}function tv(e,t,n){if(Pt.current!==fi)throw Error(Y(168));Ie(Pt,t),Ie(Gt,n)}function Y1(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(Y(108,y2(e)||"Unknown",i));return Qe({},n,r)}function Sc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||fi,Xi=Pt.current,Ie(Pt,e),Ie(Gt,Gt.current),!0}function nv(e,t,n){var r=e.stateNode;if(!r)throw Error(Y(169));n?(e=Y1(e,t,Xi),r.__reactInternalMemoizedMergedChildContext=e,$e(Gt),$e(Pt),Ie(Pt,e)):$e(Gt),Ie(Gt,n)}var vr=null,cu=!1,gd=!1;function Q1(e){vr===null?vr=[e]:vr.push(e)}function DT(e){cu=!0,Q1(e)}function xi(){if(!gd&&vr!==null){gd=!0;var e=0,t=Re;try{var n=vr;for(Re=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}vr=null,cu=!1}catch(i){throw vr!==null&&(vr=vr.slice(e+1)),w1(wh,xi),i}finally{Re=t,gd=!1}}return null}var As=[],Rs=0,Cc=null,Tc=0,yn=[],xn=0,Zi=null,wr=1,br="";function _i(e,t){As[Rs++]=Tc,As[Rs++]=Cc,Cc=e,Tc=t}function K1(e,t,n){yn[xn++]=wr,yn[xn++]=br,yn[xn++]=Zi,Zi=e;var r=wr;e=br;var i=32-Fn(r)-1;r&=~(1<<i),n+=1;var s=32-Fn(t)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,wr=1<<32-Fn(t)+i|n<<i|r,br=s+e}else wr=1<<s|n<<i|r,br=e}function Ah(e){e.return!==null&&(_i(e,1),K1(e,1,0))}function Rh(e){for(;e===Cc;)Cc=As[--Rs],As[Rs]=null,Tc=As[--Rs],As[Rs]=null;for(;e===Zi;)Zi=yn[--xn],yn[xn]=null,br=yn[--xn],yn[xn]=null,wr=yn[--xn],yn[xn]=null}var sn=null,tn=null,Ue=!1,Dn=null;function X1(e,t){var n=bn(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function rv(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,sn=e,tn=ii(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,sn=e,tn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Zi!==null?{id:wr,overflow:br}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=bn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,sn=e,tn=null,!0):!1;default:return!1}}function Nf(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Df(e){if(Ue){var t=tn;if(t){var n=t;if(!rv(e,t)){if(Nf(e))throw Error(Y(418));t=ii(n.nextSibling);var r=sn;t&&rv(e,t)?X1(r,n):(e.flags=e.flags&-4097|2,Ue=!1,sn=e)}}else{if(Nf(e))throw Error(Y(418));e.flags=e.flags&-4097|2,Ue=!1,sn=e}}}function iv(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;sn=e}function Tl(e){if(e!==sn)return!1;if(!Ue)return iv(e),Ue=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Rf(e.type,e.memoizedProps)),t&&(t=tn)){if(Nf(e))throw Z1(),Error(Y(418));for(;t;)X1(e,t),t=ii(t.nextSibling)}if(iv(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Y(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){tn=ii(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}tn=null}}else tn=sn?ii(e.stateNode.nextSibling):null;return!0}function Z1(){for(var e=tn;e;)e=ii(e.nextSibling)}function lo(){tn=sn=null,Ue=!1}function Ph(e){Dn===null?Dn=[e]:Dn.push(e)}var IT=Pr.ReactCurrentBatchConfig;function Fo(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(Y(309));var r=n.stateNode}if(!r)throw Error(Y(147,e));var i=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(o){var a=i.refs;o===null?delete a[s]:a[s]=o},t._stringRef=s,t)}if(typeof e!="string")throw Error(Y(284));if(!n._owner)throw Error(Y(290,e))}return e}function _l(e,t){throw e=Object.prototype.toString.call(t),Error(Y(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function sv(e){var t=e._init;return t(e._payload)}function J1(e){function t(h,g){if(e){var k=h.deletions;k===null?(h.deletions=[g],h.flags|=16):k.push(g)}}function n(h,g){if(!e)return null;for(;g!==null;)t(h,g),g=g.sibling;return null}function r(h,g){for(h=new Map;g!==null;)g.key!==null?h.set(g.key,g):h.set(g.index,g),g=g.sibling;return h}function i(h,g){return h=li(h,g),h.index=0,h.sibling=null,h}function s(h,g,k){return h.index=k,e?(k=h.alternate,k!==null?(k=k.index,k<g?(h.flags|=2,g):k):(h.flags|=2,g)):(h.flags|=1048576,g)}function o(h){return e&&h.alternate===null&&(h.flags|=2),h}function a(h,g,k,C){return g===null||g.tag!==6?(g=Sd(k,h.mode,C),g.return=h,g):(g=i(g,k),g.return=h,g)}function l(h,g,k,C){var S=k.type;return S===Ss?d(h,g,k.props.children,C,k.key):g!==null&&(g.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Fr&&sv(S)===g.type)?(C=i(g,k.props),C.ref=Fo(h,g,k),C.return=h,C):(C=tc(k.type,k.key,k.props,null,h.mode,C),C.ref=Fo(h,g,k),C.return=h,C)}function c(h,g,k,C){return g===null||g.tag!==4||g.stateNode.containerInfo!==k.containerInfo||g.stateNode.implementation!==k.implementation?(g=Cd(k,h.mode,C),g.return=h,g):(g=i(g,k.children||[]),g.return=h,g)}function d(h,g,k,C,S){return g===null||g.tag!==7?(g=Wi(k,h.mode,C,S),g.return=h,g):(g=i(g,k),g.return=h,g)}function u(h,g,k){if(typeof g=="string"&&g!==""||typeof g=="number")return g=Sd(""+g,h.mode,k),g.return=h,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case ml:return k=tc(g.type,g.key,g.props,null,h.mode,k),k.ref=Fo(h,null,g),k.return=h,k;case ks:return g=Cd(g,h.mode,k),g.return=h,g;case Fr:var C=g._init;return u(h,C(g._payload),k)}if(Wo(g)||Oo(g))return g=Wi(g,h.mode,k,null),g.return=h,g;_l(h,g)}return null}function p(h,g,k,C){var S=g!==null?g.key:null;if(typeof k=="string"&&k!==""||typeof k=="number")return S!==null?null:a(h,g,""+k,C);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case ml:return k.key===S?l(h,g,k,C):null;case ks:return k.key===S?c(h,g,k,C):null;case Fr:return S=k._init,p(h,g,S(k._payload),C)}if(Wo(k)||Oo(k))return S!==null?null:d(h,g,k,C,null);_l(h,k)}return null}function m(h,g,k,C,S){if(typeof C=="string"&&C!==""||typeof C=="number")return h=h.get(k)||null,a(g,h,""+C,S);if(typeof C=="object"&&C!==null){switch(C.$$typeof){case ml:return h=h.get(C.key===null?k:C.key)||null,l(g,h,C,S);case ks:return h=h.get(C.key===null?k:C.key)||null,c(g,h,C,S);case Fr:var T=C._init;return m(h,g,k,T(C._payload),S)}if(Wo(C)||Oo(C))return h=h.get(k)||null,d(g,h,C,S,null);_l(g,C)}return null}function y(h,g,k,C){for(var S=null,T=null,j=g,E=g=0,A=null;j!==null&&E<k.length;E++){j.index>E?(A=j,j=null):A=j.sibling;var I=p(h,j,k[E],C);if(I===null){j===null&&(j=A);break}e&&j&&I.alternate===null&&t(h,j),g=s(I,g,E),T===null?S=I:T.sibling=I,T=I,j=A}if(E===k.length)return n(h,j),Ue&&_i(h,E),S;if(j===null){for(;E<k.length;E++)j=u(h,k[E],C),j!==null&&(g=s(j,g,E),T===null?S=j:T.sibling=j,T=j);return Ue&&_i(h,E),S}for(j=r(h,j);E<k.length;E++)A=m(j,h,E,k[E],C),A!==null&&(e&&A.alternate!==null&&j.delete(A.key===null?E:A.key),g=s(A,g,E),T===null?S=A:T.sibling=A,T=A);return e&&j.forEach(function(N){return t(h,N)}),Ue&&_i(h,E),S}function w(h,g,k,C){var S=Oo(k);if(typeof S!="function")throw Error(Y(150));if(k=S.call(k),k==null)throw Error(Y(151));for(var T=S=null,j=g,E=g=0,A=null,I=k.next();j!==null&&!I.done;E++,I=k.next()){j.index>E?(A=j,j=null):A=j.sibling;var N=p(h,j,I.value,C);if(N===null){j===null&&(j=A);break}e&&j&&N.alternate===null&&t(h,j),g=s(N,g,E),T===null?S=N:T.sibling=N,T=N,j=A}if(I.done)return n(h,j),Ue&&_i(h,E),S;if(j===null){for(;!I.done;E++,I=k.next())I=u(h,I.value,C),I!==null&&(g=s(I,g,E),T===null?S=I:T.sibling=I,T=I);return Ue&&_i(h,E),S}for(j=r(h,j);!I.done;E++,I=k.next())I=m(j,h,E,I.value,C),I!==null&&(e&&I.alternate!==null&&j.delete(I.key===null?E:I.key),g=s(I,g,E),T===null?S=I:T.sibling=I,T=I);return e&&j.forEach(function(D){return t(h,D)}),Ue&&_i(h,E),S}function x(h,g,k,C){if(typeof k=="object"&&k!==null&&k.type===Ss&&k.key===null&&(k=k.props.children),typeof k=="object"&&k!==null){switch(k.$$typeof){case ml:e:{for(var S=k.key,T=g;T!==null;){if(T.key===S){if(S=k.type,S===Ss){if(T.tag===7){n(h,T.sibling),g=i(T,k.props.children),g.return=h,h=g;break e}}else if(T.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Fr&&sv(S)===T.type){n(h,T.sibling),g=i(T,k.props),g.ref=Fo(h,T,k),g.return=h,h=g;break e}n(h,T);break}else t(h,T);T=T.sibling}k.type===Ss?(g=Wi(k.props.children,h.mode,C,k.key),g.return=h,h=g):(C=tc(k.type,k.key,k.props,null,h.mode,C),C.ref=Fo(h,g,k),C.return=h,h=C)}return o(h);case ks:e:{for(T=k.key;g!==null;){if(g.key===T)if(g.tag===4&&g.stateNode.containerInfo===k.containerInfo&&g.stateNode.implementation===k.implementation){n(h,g.sibling),g=i(g,k.children||[]),g.return=h,h=g;break e}else{n(h,g);break}else t(h,g);g=g.sibling}g=Cd(k,h.mode,C),g.return=h,h=g}return o(h);case Fr:return T=k._init,x(h,g,T(k._payload),C)}if(Wo(k))return y(h,g,k,C);if(Oo(k))return w(h,g,k,C);_l(h,k)}return typeof k=="string"&&k!==""||typeof k=="number"?(k=""+k,g!==null&&g.tag===6?(n(h,g.sibling),g=i(g,k),g.return=h,h=g):(n(h,g),g=Sd(k,h.mode,C),g.return=h,h=g),o(h)):n(h,g)}return x}var co=J1(!0),ew=J1(!1),_c=yi(null),Ec=null,Ps=null,Mh=null;function Oh(){Mh=Ps=Ec=null}function Nh(e){var t=_c.current;$e(_c),e._currentValue=t}function If(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Hs(e,t){Ec=e,Mh=Ps=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(qt=!0),e.firstContext=null)}function Cn(e){var t=e._currentValue;if(Mh!==e)if(e={context:e,memoizedValue:t,next:null},Ps===null){if(Ec===null)throw Error(Y(308));Ps=e,Ec.dependencies={lanes:0,firstContext:e}}else Ps=Ps.next=e;return t}var Mi=null;function Dh(e){Mi===null?Mi=[e]:Mi.push(e)}function tw(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Dh(t)):(n.next=i.next,i.next=n),t.interleaved=n,_r(e,r)}function _r(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Br=!1;function Ih(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function nw(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function kr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function si(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,je&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,_r(e,n)}return i=r.interleaved,i===null?(t.next=t,Dh(r)):(t.next=i.next,i.next=t),r.interleaved=t,_r(e,n)}function Ql(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,bh(e,n)}}function ov(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function jc(e,t,n,r){var i=e.updateQueue;Br=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,c=l.next;l.next=null,o===null?s=c:o.next=c,o=l;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=c:a.next=c,d.lastBaseUpdate=l))}if(s!==null){var u=i.baseState;o=0,d=c=l=null,a=s;do{var p=a.lane,m=a.eventTime;if((r&p)===p){d!==null&&(d=d.next={eventTime:m,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=e,w=a;switch(p=t,m=n,w.tag){case 1:if(y=w.payload,typeof y=="function"){u=y.call(m,u,p);break e}u=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=w.payload,p=typeof y=="function"?y.call(m,u,p):y,p==null)break e;u=Qe({},u,p);break e;case 2:Br=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,p=i.effects,p===null?i.effects=[a]:p.push(a))}else m={eventTime:m,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(c=d=m,l=u):d=d.next=m,o|=p;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;p=a,a=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(d===null&&(l=u),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);es|=o,e.lanes=o,e.memoizedState=u}}function av(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(Y(191,i));i.call(r)}}}var nl={},nr=yi(nl),Ea=yi(nl),ja=yi(nl);function Oi(e){if(e===nl)throw Error(Y(174));return e}function Lh(e,t){switch(Ie(ja,t),Ie(Ea,e),Ie(nr,nl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:gf(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=gf(t,e)}$e(nr),Ie(nr,t)}function uo(){$e(nr),$e(Ea),$e(ja)}function rw(e){Oi(ja.current);var t=Oi(nr.current),n=gf(t,e.type);t!==n&&(Ie(Ea,e),Ie(nr,n))}function Fh(e){Ea.current===e&&($e(nr),$e(Ea))}var qe=yi(0);function Ac(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var vd=[];function Bh(){for(var e=0;e<vd.length;e++)vd[e]._workInProgressVersionPrimary=null;vd.length=0}var Kl=Pr.ReactCurrentDispatcher,yd=Pr.ReactCurrentBatchConfig,Ji=0,Ye=null,lt=null,pt=null,Rc=!1,ia=!1,Aa=0,LT=0;function Ct(){throw Error(Y(321))}function $h(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!zn(e[n],t[n]))return!1;return!0}function zh(e,t,n,r,i,s){if(Ji=s,Ye=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Kl.current=e===null||e.memoizedState===null?zT:VT,e=n(r,i),ia){s=0;do{if(ia=!1,Aa=0,25<=s)throw Error(Y(301));s+=1,pt=lt=null,t.updateQueue=null,Kl.current=UT,e=n(r,i)}while(ia)}if(Kl.current=Pc,t=lt!==null&<.next!==null,Ji=0,pt=lt=Ye=null,Rc=!1,t)throw Error(Y(300));return e}function Vh(){var e=Aa!==0;return Aa=0,e}function Gn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return pt===null?Ye.memoizedState=pt=e:pt=pt.next=e,pt}function Tn(){if(lt===null){var e=Ye.alternate;e=e!==null?e.memoizedState:null}else e=lt.next;var t=pt===null?Ye.memoizedState:pt.next;if(t!==null)pt=t,lt=e;else{if(e===null)throw Error(Y(310));lt=e,e={memoizedState:lt.memoizedState,baseState:lt.baseState,baseQueue:lt.baseQueue,queue:lt.queue,next:null},pt===null?Ye.memoizedState=pt=e:pt=pt.next=e}return pt}function Ra(e,t){return typeof t=="function"?t(e):t}function xd(e){var t=Tn(),n=t.queue;if(n===null)throw Error(Y(311));n.lastRenderedReducer=e;var r=lt,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var a=o=null,l=null,c=s;do{var d=c.lane;if((Ji&d)===d)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var u={lane:d,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=u,o=r):l=l.next=u,Ye.lanes|=d,es|=d}c=c.next}while(c!==null&&c!==s);l===null?o=r:l.next=a,zn(r,t.memoizedState)||(qt=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do s=i.lane,Ye.lanes|=s,es|=s,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function wd(e){var t=Tn(),n=t.queue;if(n===null)throw Error(Y(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,s=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do s=e(s,o.action),o=o.next;while(o!==i);zn(s,t.memoizedState)||(qt=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function iw(){}function sw(e,t){var n=Ye,r=Tn(),i=t(),s=!zn(r.memoizedState,i);if(s&&(r.memoizedState=i,qt=!0),r=r.queue,Uh(lw.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||pt!==null&&pt.memoizedState.tag&1){if(n.flags|=2048,Pa(9,aw.bind(null,n,r,i,t),void 0,null),ht===null)throw Error(Y(349));Ji&30||ow(n,t,i)}return i}function ow(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ye.updateQueue,t===null?(t={lastEffect:null,stores:null},Ye.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function aw(e,t,n,r){t.value=n,t.getSnapshot=r,cw(t)&&uw(e)}function lw(e,t,n){return n(function(){cw(t)&&uw(e)})}function cw(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!zn(e,n)}catch{return!0}}function uw(e){var t=_r(e,1);t!==null&&Bn(t,e,1,-1)}function lv(e){var t=Gn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ra,lastRenderedState:e},t.queue=e,e=e.dispatch=$T.bind(null,Ye,e),[t.memoizedState,e]}function Pa(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ye.updateQueue,t===null?(t={lastEffect:null,stores:null},Ye.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function dw(){return Tn().memoizedState}function Xl(e,t,n,r){var i=Gn();Ye.flags|=e,i.memoizedState=Pa(1|t,n,void 0,r===void 0?null:r)}function uu(e,t,n,r){var i=Tn();r=r===void 0?null:r;var s=void 0;if(lt!==null){var o=lt.memoizedState;if(s=o.destroy,r!==null&&$h(r,o.deps)){i.memoizedState=Pa(t,n,s,r);return}}Ye.flags|=e,i.memoizedState=Pa(1|t,n,s,r)}function cv(e,t){return Xl(8390656,8,e,t)}function Uh(e,t){return uu(2048,8,e,t)}function fw(e,t){return uu(4,2,e,t)}function pw(e,t){return uu(4,4,e,t)}function hw(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function mw(e,t,n){return n=n!=null?n.concat([e]):null,uu(4,4,hw.bind(null,t,e),n)}function Hh(){}function gw(e,t){var n=Tn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&$h(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function vw(e,t){var n=Tn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&$h(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function yw(e,t,n){return Ji&21?(zn(n,t)||(n=S1(),Ye.lanes|=n,es|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,qt=!0),e.memoizedState=n)}function FT(e,t){var n=Re;Re=n!==0&&4>n?n:4,e(!0);var r=yd.transition;yd.transition={};try{e(!1),t()}finally{Re=n,yd.transition=r}}function xw(){return Tn().memoizedState}function BT(e,t,n){var r=ai(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ww(e))bw(t,n);else if(n=tw(e,t,n,r),n!==null){var i=It();Bn(n,e,r,i),kw(n,t,r)}}function $T(e,t,n){var r=ai(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ww(e))bw(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,zn(a,o)){var l=t.interleaved;l===null?(i.next=i,Dh(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=tw(e,t,i,r),n!==null&&(i=It(),Bn(n,e,r,i),kw(n,t,r))}}function ww(e){var t=e.alternate;return e===Ye||t!==null&&t===Ye}function bw(e,t){ia=Rc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function kw(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,bh(e,n)}}var Pc={readContext:Cn,useCallback:Ct,useContext:Ct,useEffect:Ct,useImperativeHandle:Ct,useInsertionEffect:Ct,useLayoutEffect:Ct,useMemo:Ct,useReducer:Ct,useRef:Ct,useState:Ct,useDebugValue:Ct,useDeferredValue:Ct,useTransition:Ct,useMutableSource:Ct,useSyncExternalStore:Ct,useId:Ct,unstable_isNewReconciler:!1},zT={readContext:Cn,useCallback:function(e,t){return Gn().memoizedState=[e,t===void 0?null:t],e},useContext:Cn,useEffect:cv,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Xl(4194308,4,hw.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Xl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Xl(4,2,e,t)},useMemo:function(e,t){var n=Gn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Gn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=BT.bind(null,Ye,e),[r.memoizedState,e]},useRef:function(e){var t=Gn();return e={current:e},t.memoizedState=e},useState:lv,useDebugValue:Hh,useDeferredValue:function(e){return Gn().memoizedState=e},useTransition:function(){var e=lv(!1),t=e[0];return e=FT.bind(null,e[1]),Gn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ye,i=Gn();if(Ue){if(n===void 0)throw Error(Y(407));n=n()}else{if(n=t(),ht===null)throw Error(Y(349));Ji&30||ow(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,cv(lw.bind(null,r,s,e),[e]),r.flags|=2048,Pa(9,aw.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Gn(),t=ht.identifierPrefix;if(Ue){var n=br,r=wr;n=(r&~(1<<32-Fn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Aa++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=LT++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},VT={readContext:Cn,useCallback:gw,useContext:Cn,useEffect:Uh,useImperativeHandle:mw,useInsertionEffect:fw,useLayoutEffect:pw,useMemo:vw,useReducer:xd,useRef:dw,useState:function(){return xd(Ra)},useDebugValue:Hh,useDeferredValue:function(e){var t=Tn();return yw(t,lt.memoizedState,e)},useTransition:function(){var e=xd(Ra)[0],t=Tn().memoizedState;return[e,t]},useMutableSource:iw,useSyncExternalStore:sw,useId:xw,unstable_isNewReconciler:!1},UT={readContext:Cn,useCallback:gw,useContext:Cn,useEffect:Uh,useImperativeHandle:mw,useInsertionEffect:fw,useLayoutEffect:pw,useMemo:vw,useReducer:wd,useRef:dw,useState:function(){return wd(Ra)},useDebugValue:Hh,useDeferredValue:function(e){var t=Tn();return lt===null?t.memoizedState=e:yw(t,lt.memoizedState,e)},useTransition:function(){var e=wd(Ra)[0],t=Tn().memoizedState;return[e,t]},useMutableSource:iw,useSyncExternalStore:sw,useId:xw,unstable_isNewReconciler:!1};function Pn(e,t){if(e&&e.defaultProps){t=Qe({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Lf(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Qe({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var du={isMounted:function(e){return(e=e._reactInternals)?os(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=It(),i=ai(e),s=kr(r,i);s.payload=t,n!=null&&(s.callback=n),t=si(e,s,i),t!==null&&(Bn(t,e,i,r),Ql(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=It(),i=ai(e),s=kr(r,i);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=si(e,s,i),t!==null&&(Bn(t,e,i,r),Ql(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=It(),r=ai(e),i=kr(n,r);i.tag=2,t!=null&&(i.callback=t),t=si(e,i,r),t!==null&&(Bn(t,e,r,n),Ql(t,e,r))}};function uv(e,t,n,r,i,s,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,o):t.prototype&&t.prototype.isPureReactComponent?!Sa(n,r)||!Sa(i,s):!0}function Sw(e,t,n){var r=!1,i=fi,s=t.contextType;return typeof s=="object"&&s!==null?s=Cn(s):(i=Yt(t)?Xi:Pt.current,r=t.contextTypes,s=(r=r!=null)?ao(e,i):fi),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=du,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function dv(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&du.enqueueReplaceState(t,t.state,null)}function Ff(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Ih(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=Cn(s):(s=Yt(t)?Xi:Pt.current,i.context=ao(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(Lf(e,t,s,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&du.enqueueReplaceState(i,i.state,null),jc(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function fo(e,t){try{var n="",r=t;do n+=v2(r),r=r.return;while(r);var i=n}catch(s){i=`
|
|
37
|
+
`+i[o].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{od=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Qo(e):""}function R2(e){switch(e.tag){case 5:return Qo(e.type);case 16:return Qo("Lazy");case 13:return Qo("Suspense");case 19:return Qo("SuspenseList");case 0:case 2:case 15:return e=ad(e.type,!1),e;case 11:return e=ad(e.type.render,!1),e;case 1:return e=ad(e.type,!0),e;default:return""}}function vf(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Cs:return"Fragment";case Ss:return"Portal";case hf:return"Profiler";case Sh:return"StrictMode";case mf:return"Suspense";case gf:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case m1:return(e.displayName||"Context")+".Consumer";case h1:return(e._context.displayName||"Context")+".Provider";case Ch:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case _h:return t=e.displayName||null,t!==null?t:vf(e.type)||"Memo";case $r:t=e._payload,e=e._init;try{return vf(e(t))}catch{}}return null}function P2(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return vf(t);case 8:return t===Sh?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function fi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function v1(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function M2(e){var t=v1(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function bl(e){e._valueTracker||(e._valueTracker=M2(e))}function y1(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=v1(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function yc(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function yf(e,t){var n=t.checked;return Ke({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ig(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=fi(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function x1(e,t){t=t.checked,t!=null&&kh(e,"checked",t,!1)}function xf(e,t){x1(e,t);var n=fi(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?wf(e,t.type,n):t.hasOwnProperty("defaultValue")&&wf(e,t.type,fi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Lg(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function wf(e,t,n){(t!=="number"||yc(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ko=Array.isArray;function Vs(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+fi(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function bf(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(X(91));return Ke({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Fg(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(X(92));if(Ko(n)){if(1<n.length)throw Error(X(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:fi(n)}}function w1(e,t){var n=fi(t.value),r=fi(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function $g(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function b1(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function kf(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?b1(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var kl,k1=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(kl=kl||document.createElement("div"),kl.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=kl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ka(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var sa={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},N2=["Webkit","ms","Moz","O"];Object.keys(sa).forEach(function(e){N2.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),sa[t]=sa[e]})});function S1(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||sa.hasOwnProperty(e)&&sa[e]?(""+t).trim():t+"px"}function C1(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=S1(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var O2=Ke({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 Sf(e,t){if(t){if(O2[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(X(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(X(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(X(61))}if(t.style!=null&&typeof t.style!="object")throw Error(X(62))}}function Cf(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var _f=null;function Th(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Tf=null,Us=null,Hs=null;function Bg(e){if(e=ol(e)){if(typeof Tf!="function")throw Error(X(280));var t=e.stateNode;t&&(t=pu(t),Tf(e.stateNode,e.type,t))}}function _1(e){Us?Hs?Hs.push(e):Hs=[e]:Us=e}function T1(){if(Us){var e=Us,t=Hs;if(Hs=Us=null,Bg(e),t)for(e=0;e<t.length;e++)Bg(t[e])}}function E1(e,t){return e(t)}function A1(){}var ld=!1;function j1(e,t,n){if(ld)return e(t,n);ld=!0;try{return E1(e,t,n)}finally{ld=!1,(Us!==null||Hs!==null)&&(A1(),T1())}}function Sa(e,t){var n=e.stateNode;if(n===null)return null;var r=pu(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(X(231,t,typeof n));return n}var Ef=!1;if(Cr)try{var Fo={};Object.defineProperty(Fo,"passive",{get:function(){Ef=!0}}),window.addEventListener("test",Fo,Fo),window.removeEventListener("test",Fo,Fo)}catch{Ef=!1}function D2(e,t,n,r,i,s,o,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(d){this.onError(d)}}var oa=!1,xc=null,wc=!1,Af=null,I2={onError:function(e){oa=!0,xc=e}};function L2(e,t,n,r,i,s,o,a,l){oa=!1,xc=null,D2.apply(I2,arguments)}function F2(e,t,n,r,i,s,o,a,l){if(L2.apply(this,arguments),oa){if(oa){var c=xc;oa=!1,xc=null}else throw Error(X(198));wc||(wc=!0,Af=c)}}function as(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function R1(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function zg(e){if(as(e)!==e)throw Error(X(188))}function $2(e){var t=e.alternate;if(!t){if(t=as(e),t===null)throw Error(X(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return zg(i),e;if(s===r)return zg(i),t;s=s.sibling}throw Error(X(188))}if(n.return!==r.return)n=i,r=s;else{for(var o=!1,a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o)throw Error(X(189))}}if(n.alternate!==r)throw Error(X(190))}if(n.tag!==3)throw Error(X(188));return n.stateNode.current===n?e:t}function P1(e){return e=$2(e),e!==null?M1(e):null}function M1(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=M1(e);if(t!==null)return t;e=e.sibling}return null}var N1=an.unstable_scheduleCallback,Vg=an.unstable_cancelCallback,B2=an.unstable_shouldYield,z2=an.unstable_requestPaint,nt=an.unstable_now,V2=an.unstable_getCurrentPriorityLevel,Eh=an.unstable_ImmediatePriority,O1=an.unstable_UserBlockingPriority,bc=an.unstable_NormalPriority,U2=an.unstable_LowPriority,D1=an.unstable_IdlePriority,cu=null,tr=null;function H2(e){if(tr&&typeof tr.onCommitFiberRoot=="function")try{tr.onCommitFiberRoot(cu,e,void 0,(e.current.flags&128)===128)}catch{}}var $n=Math.clz32?Math.clz32:G2,W2=Math.log,q2=Math.LN2;function G2(e){return e>>>=0,e===0?32:31-(W2(e)/q2|0)|0}var Sl=64,Cl=4194304;function Xo(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function kc(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~i;a!==0?r=Xo(a):(s&=o,s!==0&&(r=Xo(s)))}else o=n&~i,o!==0?r=Xo(o):s!==0&&(r=Xo(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-$n(t),i=1<<n,r|=e[n],t&=~i;return r}function Y2(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Q2(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var o=31-$n(s),a=1<<o,l=i[o];l===-1?(!(a&n)||a&r)&&(i[o]=Y2(a,t)):l<=t&&(e.expiredLanes|=a),s&=~a}}function jf(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function I1(){var e=Sl;return Sl<<=1,!(Sl&4194240)&&(Sl=64),e}function cd(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function il(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-$n(t),e[t]=n}function K2(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-$n(n),s=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~s}}function Ah(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-$n(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Pe=0;function L1(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var F1,jh,$1,B1,z1,Rf=!1,_l=[],ni=null,ri=null,ii=null,Ca=new Map,_a=new Map,Vr=[],X2="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 Ug(e,t){switch(e){case"focusin":case"focusout":ni=null;break;case"dragenter":case"dragleave":ri=null;break;case"mouseover":case"mouseout":ii=null;break;case"pointerover":case"pointerout":Ca.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":_a.delete(t.pointerId)}}function $o(e,t,n,r,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},t!==null&&(t=ol(t),t!==null&&jh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Z2(e,t,n,r,i){switch(t){case"focusin":return ni=$o(ni,e,t,n,r,i),!0;case"dragenter":return ri=$o(ri,e,t,n,r,i),!0;case"mouseover":return ii=$o(ii,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return Ca.set(s,$o(Ca.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,_a.set(s,$o(_a.get(s)||null,e,t,n,r,i)),!0}return!1}function V1(e){var t=Pi(e.target);if(t!==null){var n=as(t);if(n!==null){if(t=n.tag,t===13){if(t=R1(n),t!==null){e.blockedOn=t,z1(e.priority,function(){$1(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Xl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Pf(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);_f=r,n.target.dispatchEvent(r),_f=null}else return t=ol(n),t!==null&&jh(t),e.blockedOn=n,!1;t.shift()}return!0}function Hg(e,t,n){Xl(e)&&n.delete(t)}function J2(){Rf=!1,ni!==null&&Xl(ni)&&(ni=null),ri!==null&&Xl(ri)&&(ri=null),ii!==null&&Xl(ii)&&(ii=null),Ca.forEach(Hg),_a.forEach(Hg)}function Bo(e,t){e.blockedOn===t&&(e.blockedOn=null,Rf||(Rf=!0,an.unstable_scheduleCallback(an.unstable_NormalPriority,J2)))}function Ta(e){function t(i){return Bo(i,e)}if(0<_l.length){Bo(_l[0],e);for(var n=1;n<_l.length;n++){var r=_l[n];r.blockedOn===e&&(r.blockedOn=null)}}for(ni!==null&&Bo(ni,e),ri!==null&&Bo(ri,e),ii!==null&&Bo(ii,e),Ca.forEach(t),_a.forEach(t),n=0;n<Vr.length;n++)r=Vr[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Vr.length&&(n=Vr[0],n.blockedOn===null);)V1(n),n.blockedOn===null&&Vr.shift()}var Ws=Mr.ReactCurrentBatchConfig,Sc=!0;function e_(e,t,n,r){var i=Pe,s=Ws.transition;Ws.transition=null;try{Pe=1,Rh(e,t,n,r)}finally{Pe=i,Ws.transition=s}}function t_(e,t,n,r){var i=Pe,s=Ws.transition;Ws.transition=null;try{Pe=4,Rh(e,t,n,r)}finally{Pe=i,Ws.transition=s}}function Rh(e,t,n,r){if(Sc){var i=Pf(e,t,n,r);if(i===null)xd(e,t,r,Cc,n),Ug(e,r);else if(Z2(i,e,t,n,r))r.stopPropagation();else if(Ug(e,r),t&4&&-1<X2.indexOf(e)){for(;i!==null;){var s=ol(i);if(s!==null&&F1(s),s=Pf(e,t,n,r),s===null&&xd(e,t,r,Cc,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else xd(e,t,r,null,n)}}var Cc=null;function Pf(e,t,n,r){if(Cc=null,e=Th(r),e=Pi(e),e!==null)if(t=as(e),t===null)e=null;else if(n=t.tag,n===13){if(e=R1(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Cc=e,null}function U1(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(V2()){case Eh:return 1;case O1:return 4;case bc:case U2:return 16;case D1:return 536870912;default:return 16}default:return 16}}var Jr=null,Ph=null,Zl=null;function H1(){if(Zl)return Zl;var e,t=Ph,n=t.length,r,i="value"in Jr?Jr.value:Jr.textContent,s=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[s-r];r++);return Zl=i.slice(e,1<r?1-r:void 0)}function Jl(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Tl(){return!0}function Wg(){return!1}function cn(e){function t(n,r,i,s,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Tl:Wg,this.isPropagationStopped=Wg,this}return Ke(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Tl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Tl)},persist:function(){},isPersistent:Tl}),t}var Eo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Mh=cn(Eo),sl=Ke({},Eo,{view:0,detail:0}),n_=cn(sl),ud,dd,zo,uu=Ke({},sl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Nh,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==zo&&(zo&&e.type==="mousemove"?(ud=e.screenX-zo.screenX,dd=e.screenY-zo.screenY):dd=ud=0,zo=e),ud)},movementY:function(e){return"movementY"in e?e.movementY:dd}}),qg=cn(uu),r_=Ke({},uu,{dataTransfer:0}),i_=cn(r_),s_=Ke({},sl,{relatedTarget:0}),fd=cn(s_),o_=Ke({},Eo,{animationName:0,elapsedTime:0,pseudoElement:0}),a_=cn(o_),l_=Ke({},Eo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),c_=cn(l_),u_=Ke({},Eo,{data:0}),Gg=cn(u_),d_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},f_={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"},p_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function h_(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=p_[e])?!!t[e]:!1}function Nh(){return h_}var m_=Ke({},sl,{key:function(e){if(e.key){var t=d_[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Jl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?f_[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Nh,charCode:function(e){return e.type==="keypress"?Jl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Jl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),g_=cn(m_),v_=Ke({},uu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Yg=cn(v_),y_=Ke({},sl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Nh}),x_=cn(y_),w_=Ke({},Eo,{propertyName:0,elapsedTime:0,pseudoElement:0}),b_=cn(w_),k_=Ke({},uu,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),S_=cn(k_),C_=[9,13,27,32],Oh=Cr&&"CompositionEvent"in window,aa=null;Cr&&"documentMode"in document&&(aa=document.documentMode);var __=Cr&&"TextEvent"in window&&!aa,W1=Cr&&(!Oh||aa&&8<aa&&11>=aa),Qg=" ",Kg=!1;function q1(e,t){switch(e){case"keyup":return C_.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function G1(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var _s=!1;function T_(e,t){switch(e){case"compositionend":return G1(t);case"keypress":return t.which!==32?null:(Kg=!0,Qg);case"textInput":return e=t.data,e===Qg&&Kg?null:e;default:return null}}function E_(e,t){if(_s)return e==="compositionend"||!Oh&&q1(e,t)?(e=H1(),Zl=Ph=Jr=null,_s=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return W1&&t.locale!=="ko"?null:t.data;default:return null}}var A_={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 Xg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!A_[e.type]:t==="textarea"}function Y1(e,t,n,r){_1(r),t=_c(t,"onChange"),0<t.length&&(n=new Mh("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var la=null,Ea=null;function j_(e){sw(e,0)}function du(e){var t=As(e);if(y1(t))return e}function R_(e,t){if(e==="change")return t}var Q1=!1;if(Cr){var pd;if(Cr){var hd="oninput"in document;if(!hd){var Zg=document.createElement("div");Zg.setAttribute("oninput","return;"),hd=typeof Zg.oninput=="function"}pd=hd}else pd=!1;Q1=pd&&(!document.documentMode||9<document.documentMode)}function Jg(){la&&(la.detachEvent("onpropertychange",K1),Ea=la=null)}function K1(e){if(e.propertyName==="value"&&du(Ea)){var t=[];Y1(t,Ea,e,Th(e)),j1(j_,t)}}function P_(e,t,n){e==="focusin"?(Jg(),la=t,Ea=n,la.attachEvent("onpropertychange",K1)):e==="focusout"&&Jg()}function M_(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return du(Ea)}function N_(e,t){if(e==="click")return du(t)}function O_(e,t){if(e==="input"||e==="change")return du(t)}function D_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Vn=typeof Object.is=="function"?Object.is:D_;function Aa(e,t){if(Vn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!pf.call(t,i)||!Vn(e[i],t[i]))return!1}return!0}function ev(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function tv(e,t){var n=ev(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ev(n)}}function X1(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?X1(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Z1(){for(var e=window,t=yc();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=yc(e.document)}return t}function Dh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function I_(e){var t=Z1(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&X1(n.ownerDocument.documentElement,n)){if(r!==null&&Dh(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=tv(n,s);var o=tv(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var L_=Cr&&"documentMode"in document&&11>=document.documentMode,Ts=null,Mf=null,ca=null,Nf=!1;function nv(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Nf||Ts==null||Ts!==yc(r)||(r=Ts,"selectionStart"in r&&Dh(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ca&&Aa(ca,r)||(ca=r,r=_c(Mf,"onSelect"),0<r.length&&(t=new Mh("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Ts)))}function El(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Es={animationend:El("Animation","AnimationEnd"),animationiteration:El("Animation","AnimationIteration"),animationstart:El("Animation","AnimationStart"),transitionend:El("Transition","TransitionEnd")},md={},J1={};Cr&&(J1=document.createElement("div").style,"AnimationEvent"in window||(delete Es.animationend.animation,delete Es.animationiteration.animation,delete Es.animationstart.animation),"TransitionEvent"in window||delete Es.transitionend.transition);function fu(e){if(md[e])return md[e];if(!Es[e])return e;var t=Es[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in J1)return md[e]=t[n];return e}var ew=fu("animationend"),tw=fu("animationiteration"),nw=fu("animationstart"),rw=fu("transitionend"),iw=new Map,rv="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 vi(e,t){iw.set(e,t),os(t,[e])}for(var gd=0;gd<rv.length;gd++){var vd=rv[gd],F_=vd.toLowerCase(),$_=vd[0].toUpperCase()+vd.slice(1);vi(F_,"on"+$_)}vi(ew,"onAnimationEnd");vi(tw,"onAnimationIteration");vi(nw,"onAnimationStart");vi("dblclick","onDoubleClick");vi("focusin","onFocus");vi("focusout","onBlur");vi(rw,"onTransitionEnd");uo("onMouseEnter",["mouseout","mouseover"]);uo("onMouseLeave",["mouseout","mouseover"]);uo("onPointerEnter",["pointerout","pointerover"]);uo("onPointerLeave",["pointerout","pointerover"]);os("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));os("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));os("onBeforeInput",["compositionend","keypress","textInput","paste"]);os("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));os("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));os("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Zo="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(" "),B_=new Set("cancel close invalid load scroll toggle".split(" ").concat(Zo));function iv(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,F2(r,t,void 0,e),e.currentTarget=null}function sw(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==s&&i.isPropagationStopped())break e;iv(i,a,c),s=l}else for(o=0;o<r.length;o++){if(a=r[o],l=a.instance,c=a.currentTarget,a=a.listener,l!==s&&i.isPropagationStopped())break e;iv(i,a,c),s=l}}}if(wc)throw e=Af,wc=!1,Af=null,e}function ze(e,t){var n=t[Ff];n===void 0&&(n=t[Ff]=new Set);var r=e+"__bubble";n.has(r)||(ow(t,e,2,!1),n.add(r))}function yd(e,t,n){var r=0;t&&(r|=4),ow(n,e,r,t)}var Al="_reactListening"+Math.random().toString(36).slice(2);function ja(e){if(!e[Al]){e[Al]=!0,p1.forEach(function(n){n!=="selectionchange"&&(B_.has(n)||yd(n,!1,e),yd(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Al]||(t[Al]=!0,yd("selectionchange",!1,t))}}function ow(e,t,n,r){switch(U1(t)){case 1:var i=e_;break;case 4:i=t_;break;default:i=Rh}n=i.bind(null,t,n,e),i=void 0,!Ef||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function xd(e,t,n,r,i){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;o=o.return}for(;a!==null;){if(o=Pi(a),o===null)return;if(l=o.tag,l===5||l===6){r=s=o;continue e}a=a.parentNode}}r=r.return}j1(function(){var c=s,d=Th(n),u=[];e:{var p=iw.get(e);if(p!==void 0){var h=Mh,y=e;switch(e){case"keypress":if(Jl(n)===0)break e;case"keydown":case"keyup":h=g_;break;case"focusin":y="focus",h=fd;break;case"focusout":y="blur",h=fd;break;case"beforeblur":case"afterblur":h=fd;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=qg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=i_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=x_;break;case ew:case tw:case nw:h=a_;break;case rw:h=b_;break;case"scroll":h=n_;break;case"wheel":h=S_;break;case"copy":case"cut":case"paste":h=c_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Yg}var w=(t&4)!==0,b=!w&&e==="scroll",m=w?p!==null?p+"Capture":null:p;w=[];for(var v=c,x;v!==null;){x=v;var S=x.stateNode;if(x.tag===5&&S!==null&&(x=S,m!==null&&(S=Sa(v,m),S!=null&&w.push(Ra(v,S,x)))),b)break;v=v.return}0<w.length&&(p=new h(p,y,null,n,d),u.push({event:p,listeners:w}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",p&&n!==_f&&(y=n.relatedTarget||n.fromElement)&&(Pi(y)||y[_r]))break e;if((h||p)&&(p=d.window===d?d:(p=d.ownerDocument)?p.defaultView||p.parentWindow:window,h?(y=n.relatedTarget||n.toElement,h=c,y=y?Pi(y):null,y!==null&&(b=as(y),y!==b||y.tag!==5&&y.tag!==6)&&(y=null)):(h=null,y=c),h!==y)){if(w=qg,S="onMouseLeave",m="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(w=Yg,S="onPointerLeave",m="onPointerEnter",v="pointer"),b=h==null?p:As(h),x=y==null?p:As(y),p=new w(S,v+"leave",h,n,d),p.target=b,p.relatedTarget=x,S=null,Pi(d)===c&&(w=new w(m,v+"enter",y,n,d),w.target=x,w.relatedTarget=b,S=w),b=S,h&&y)t:{for(w=h,m=y,v=0,x=w;x;x=bs(x))v++;for(x=0,S=m;S;S=bs(S))x++;for(;0<v-x;)w=bs(w),v--;for(;0<x-v;)m=bs(m),x--;for(;v--;){if(w===m||m!==null&&w===m.alternate)break t;w=bs(w),m=bs(m)}w=null}else w=null;h!==null&&sv(u,p,h,w,!1),y!==null&&b!==null&&sv(u,b,y,w,!0)}}e:{if(p=c?As(c):window,h=p.nodeName&&p.nodeName.toLowerCase(),h==="select"||h==="input"&&p.type==="file")var C=R_;else if(Xg(p))if(Q1)C=O_;else{C=M_;var _=P_}else(h=p.nodeName)&&h.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(C=N_);if(C&&(C=C(e,c))){Y1(u,C,n,d);break e}_&&_(e,p,c),e==="focusout"&&(_=p._wrapperState)&&_.controlled&&p.type==="number"&&wf(p,"number",p.value)}switch(_=c?As(c):window,e){case"focusin":(Xg(_)||_.contentEditable==="true")&&(Ts=_,Mf=c,ca=null);break;case"focusout":ca=Mf=Ts=null;break;case"mousedown":Nf=!0;break;case"contextmenu":case"mouseup":case"dragend":Nf=!1,nv(u,n,d);break;case"selectionchange":if(L_)break;case"keydown":case"keyup":nv(u,n,d)}var j;if(Oh)e:{switch(e){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else _s?q1(e,n)&&(A="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(A="onCompositionStart");A&&(W1&&n.locale!=="ko"&&(_s||A!=="onCompositionStart"?A==="onCompositionEnd"&&_s&&(j=H1()):(Jr=d,Ph="value"in Jr?Jr.value:Jr.textContent,_s=!0)),_=_c(c,A),0<_.length&&(A=new Gg(A,e,null,n,d),u.push({event:A,listeners:_}),j?A.data=j:(j=G1(n),j!==null&&(A.data=j)))),(j=__?T_(e,n):E_(e,n))&&(c=_c(c,"onBeforeInput"),0<c.length&&(d=new Gg("onBeforeInput","beforeinput",null,n,d),u.push({event:d,listeners:c}),d.data=j))}sw(u,t)})}function Ra(e,t,n){return{instance:e,listener:t,currentTarget:n}}function _c(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=Sa(e,n),s!=null&&r.unshift(Ra(e,s,i)),s=Sa(e,t),s!=null&&r.push(Ra(e,s,i))),e=e.return}return r}function bs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function sv(e,t,n,r,i){for(var s=t._reactName,o=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,i?(l=Sa(n,s),l!=null&&o.unshift(Ra(n,l,a))):i||(l=Sa(n,s),l!=null&&o.push(Ra(n,l,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var z_=/\r\n?/g,V_=/\u0000|\uFFFD/g;function ov(e){return(typeof e=="string"?e:""+e).replace(z_,`
|
|
38
|
+
`).replace(V_,"")}function jl(e,t,n){if(t=ov(t),ov(e)!==t&&n)throw Error(X(425))}function Tc(){}var Of=null,Df=null;function If(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Lf=typeof setTimeout=="function"?setTimeout:void 0,U_=typeof clearTimeout=="function"?clearTimeout:void 0,av=typeof Promise=="function"?Promise:void 0,H_=typeof queueMicrotask=="function"?queueMicrotask:typeof av<"u"?function(e){return av.resolve(null).then(e).catch(W_)}:Lf;function W_(e){setTimeout(function(){throw e})}function wd(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),Ta(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Ta(t)}function si(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function lv(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Ao=Math.random().toString(36).slice(2),er="__reactFiber$"+Ao,Pa="__reactProps$"+Ao,_r="__reactContainer$"+Ao,Ff="__reactEvents$"+Ao,q_="__reactListeners$"+Ao,G_="__reactHandles$"+Ao;function Pi(e){var t=e[er];if(t)return t;for(var n=e.parentNode;n;){if(t=n[_r]||n[er]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=lv(e);e!==null;){if(n=e[er])return n;e=lv(e)}return t}e=n,n=e.parentNode}return null}function ol(e){return e=e[er]||e[_r],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function As(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(X(33))}function pu(e){return e[Pa]||null}var $f=[],js=-1;function yi(e){return{current:e}}function Ue(e){0>js||(e.current=$f[js],$f[js]=null,js--)}function $e(e,t){js++,$f[js]=e.current,e.current=t}var pi={},Pt=yi(pi),Gt=yi(!1),Zi=pi;function fo(e,t){var n=e.type.contextTypes;if(!n)return pi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Yt(e){return e=e.childContextTypes,e!=null}function Ec(){Ue(Gt),Ue(Pt)}function cv(e,t,n){if(Pt.current!==pi)throw Error(X(168));$e(Pt,t),$e(Gt,n)}function aw(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(X(108,P2(e)||"Unknown",i));return Ke({},n,r)}function Ac(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||pi,Zi=Pt.current,$e(Pt,e),$e(Gt,Gt.current),!0}function uv(e,t,n){var r=e.stateNode;if(!r)throw Error(X(169));n?(e=aw(e,t,Zi),r.__reactInternalMemoizedMergedChildContext=e,Ue(Gt),Ue(Pt),$e(Pt,e)):Ue(Gt),$e(Gt,n)}var vr=null,hu=!1,bd=!1;function lw(e){vr===null?vr=[e]:vr.push(e)}function Y_(e){hu=!0,lw(e)}function xi(){if(!bd&&vr!==null){bd=!0;var e=0,t=Pe;try{var n=vr;for(Pe=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}vr=null,hu=!1}catch(i){throw vr!==null&&(vr=vr.slice(e+1)),N1(Eh,xi),i}finally{Pe=t,bd=!1}}return null}var Rs=[],Ps=0,jc=null,Rc=0,xn=[],wn=0,Ji=null,wr=1,br="";function Ti(e,t){Rs[Ps++]=Rc,Rs[Ps++]=jc,jc=e,Rc=t}function cw(e,t,n){xn[wn++]=wr,xn[wn++]=br,xn[wn++]=Ji,Ji=e;var r=wr;e=br;var i=32-$n(r)-1;r&=~(1<<i),n+=1;var s=32-$n(t)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,wr=1<<32-$n(t)+i|n<<i|r,br=s+e}else wr=1<<s|n<<i|r,br=e}function Ih(e){e.return!==null&&(Ti(e,1),cw(e,1,0))}function Lh(e){for(;e===jc;)jc=Rs[--Ps],Rs[Ps]=null,Rc=Rs[--Ps],Rs[Ps]=null;for(;e===Ji;)Ji=xn[--wn],xn[wn]=null,br=xn[--wn],xn[wn]=null,wr=xn[--wn],xn[wn]=null}var on=null,nn=null,We=!1,In=null;function uw(e,t){var n=kn(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function dv(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,on=e,nn=si(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,on=e,nn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Ji!==null?{id:wr,overflow:br}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=kn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,on=e,nn=null,!0):!1;default:return!1}}function Bf(e){return(e.mode&1)!==0&&(e.flags&128)===0}function zf(e){if(We){var t=nn;if(t){var n=t;if(!dv(e,t)){if(Bf(e))throw Error(X(418));t=si(n.nextSibling);var r=on;t&&dv(e,t)?uw(r,n):(e.flags=e.flags&-4097|2,We=!1,on=e)}}else{if(Bf(e))throw Error(X(418));e.flags=e.flags&-4097|2,We=!1,on=e}}}function fv(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;on=e}function Rl(e){if(e!==on)return!1;if(!We)return fv(e),We=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!If(e.type,e.memoizedProps)),t&&(t=nn)){if(Bf(e))throw dw(),Error(X(418));for(;t;)uw(e,t),t=si(t.nextSibling)}if(fv(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(X(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){nn=si(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}nn=null}}else nn=on?si(e.stateNode.nextSibling):null;return!0}function dw(){for(var e=nn;e;)e=si(e.nextSibling)}function po(){nn=on=null,We=!1}function Fh(e){In===null?In=[e]:In.push(e)}var Q_=Mr.ReactCurrentBatchConfig;function Vo(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(X(309));var r=n.stateNode}if(!r)throw Error(X(147,e));var i=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(o){var a=i.refs;o===null?delete a[s]:a[s]=o},t._stringRef=s,t)}if(typeof e!="string")throw Error(X(284));if(!n._owner)throw Error(X(290,e))}return e}function Pl(e,t){throw e=Object.prototype.toString.call(t),Error(X(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function pv(e){var t=e._init;return t(e._payload)}function fw(e){function t(m,v){if(e){var x=m.deletions;x===null?(m.deletions=[v],m.flags|=16):x.push(v)}}function n(m,v){if(!e)return null;for(;v!==null;)t(m,v),v=v.sibling;return null}function r(m,v){for(m=new Map;v!==null;)v.key!==null?m.set(v.key,v):m.set(v.index,v),v=v.sibling;return m}function i(m,v){return m=ci(m,v),m.index=0,m.sibling=null,m}function s(m,v,x){return m.index=x,e?(x=m.alternate,x!==null?(x=x.index,x<v?(m.flags|=2,v):x):(m.flags|=2,v)):(m.flags|=1048576,v)}function o(m){return e&&m.alternate===null&&(m.flags|=2),m}function a(m,v,x,S){return v===null||v.tag!==6?(v=Ad(x,m.mode,S),v.return=m,v):(v=i(v,x),v.return=m,v)}function l(m,v,x,S){var C=x.type;return C===Cs?d(m,v,x.props.children,S,x.key):v!==null&&(v.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===$r&&pv(C)===v.type)?(S=i(v,x.props),S.ref=Vo(m,v,x),S.return=m,S):(S=oc(x.type,x.key,x.props,null,m.mode,S),S.ref=Vo(m,v,x),S.return=m,S)}function c(m,v,x,S){return v===null||v.tag!==4||v.stateNode.containerInfo!==x.containerInfo||v.stateNode.implementation!==x.implementation?(v=jd(x,m.mode,S),v.return=m,v):(v=i(v,x.children||[]),v.return=m,v)}function d(m,v,x,S,C){return v===null||v.tag!==7?(v=Wi(x,m.mode,S,C),v.return=m,v):(v=i(v,x),v.return=m,v)}function u(m,v,x){if(typeof v=="string"&&v!==""||typeof v=="number")return v=Ad(""+v,m.mode,x),v.return=m,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case wl:return x=oc(v.type,v.key,v.props,null,m.mode,x),x.ref=Vo(m,null,v),x.return=m,x;case Ss:return v=jd(v,m.mode,x),v.return=m,v;case $r:var S=v._init;return u(m,S(v._payload),x)}if(Ko(v)||Lo(v))return v=Wi(v,m.mode,x,null),v.return=m,v;Pl(m,v)}return null}function p(m,v,x,S){var C=v!==null?v.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return C!==null?null:a(m,v,""+x,S);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case wl:return x.key===C?l(m,v,x,S):null;case Ss:return x.key===C?c(m,v,x,S):null;case $r:return C=x._init,p(m,v,C(x._payload),S)}if(Ko(x)||Lo(x))return C!==null?null:d(m,v,x,S,null);Pl(m,x)}return null}function h(m,v,x,S,C){if(typeof S=="string"&&S!==""||typeof S=="number")return m=m.get(x)||null,a(v,m,""+S,C);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case wl:return m=m.get(S.key===null?x:S.key)||null,l(v,m,S,C);case Ss:return m=m.get(S.key===null?x:S.key)||null,c(v,m,S,C);case $r:var _=S._init;return h(m,v,x,_(S._payload),C)}if(Ko(S)||Lo(S))return m=m.get(x)||null,d(v,m,S,C,null);Pl(v,S)}return null}function y(m,v,x,S){for(var C=null,_=null,j=v,A=v=0,E=null;j!==null&&A<x.length;A++){j.index>A?(E=j,j=null):E=j.sibling;var D=p(m,j,x[A],S);if(D===null){j===null&&(j=E);break}e&&j&&D.alternate===null&&t(m,j),v=s(D,v,A),_===null?C=D:_.sibling=D,_=D,j=E}if(A===x.length)return n(m,j),We&&Ti(m,A),C;if(j===null){for(;A<x.length;A++)j=u(m,x[A],S),j!==null&&(v=s(j,v,A),_===null?C=j:_.sibling=j,_=j);return We&&Ti(m,A),C}for(j=r(m,j);A<x.length;A++)E=h(j,m,A,x[A],S),E!==null&&(e&&E.alternate!==null&&j.delete(E.key===null?A:E.key),v=s(E,v,A),_===null?C=E:_.sibling=E,_=E);return e&&j.forEach(function(L){return t(m,L)}),We&&Ti(m,A),C}function w(m,v,x,S){var C=Lo(x);if(typeof C!="function")throw Error(X(150));if(x=C.call(x),x==null)throw Error(X(151));for(var _=C=null,j=v,A=v=0,E=null,D=x.next();j!==null&&!D.done;A++,D=x.next()){j.index>A?(E=j,j=null):E=j.sibling;var L=p(m,j,D.value,S);if(L===null){j===null&&(j=E);break}e&&j&&L.alternate===null&&t(m,j),v=s(L,v,A),_===null?C=L:_.sibling=L,_=L,j=E}if(D.done)return n(m,j),We&&Ti(m,A),C;if(j===null){for(;!D.done;A++,D=x.next())D=u(m,D.value,S),D!==null&&(v=s(D,v,A),_===null?C=D:_.sibling=D,_=D);return We&&Ti(m,A),C}for(j=r(m,j);!D.done;A++,D=x.next())D=h(j,m,A,D.value,S),D!==null&&(e&&D.alternate!==null&&j.delete(D.key===null?A:D.key),v=s(D,v,A),_===null?C=D:_.sibling=D,_=D);return e&&j.forEach(function(O){return t(m,O)}),We&&Ti(m,A),C}function b(m,v,x,S){if(typeof x=="object"&&x!==null&&x.type===Cs&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case wl:e:{for(var C=x.key,_=v;_!==null;){if(_.key===C){if(C=x.type,C===Cs){if(_.tag===7){n(m,_.sibling),v=i(_,x.props.children),v.return=m,m=v;break e}}else if(_.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===$r&&pv(C)===_.type){n(m,_.sibling),v=i(_,x.props),v.ref=Vo(m,_,x),v.return=m,m=v;break e}n(m,_);break}else t(m,_);_=_.sibling}x.type===Cs?(v=Wi(x.props.children,m.mode,S,x.key),v.return=m,m=v):(S=oc(x.type,x.key,x.props,null,m.mode,S),S.ref=Vo(m,v,x),S.return=m,m=S)}return o(m);case Ss:e:{for(_=x.key;v!==null;){if(v.key===_)if(v.tag===4&&v.stateNode.containerInfo===x.containerInfo&&v.stateNode.implementation===x.implementation){n(m,v.sibling),v=i(v,x.children||[]),v.return=m,m=v;break e}else{n(m,v);break}else t(m,v);v=v.sibling}v=jd(x,m.mode,S),v.return=m,m=v}return o(m);case $r:return _=x._init,b(m,v,_(x._payload),S)}if(Ko(x))return y(m,v,x,S);if(Lo(x))return w(m,v,x,S);Pl(m,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,v!==null&&v.tag===6?(n(m,v.sibling),v=i(v,x),v.return=m,m=v):(n(m,v),v=Ad(x,m.mode,S),v.return=m,m=v),o(m)):n(m,v)}return b}var ho=fw(!0),pw=fw(!1),Pc=yi(null),Mc=null,Ms=null,$h=null;function Bh(){$h=Ms=Mc=null}function zh(e){var t=Pc.current;Ue(Pc),e._currentValue=t}function Vf(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function qs(e,t){Mc=e,$h=Ms=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(qt=!0),e.firstContext=null)}function _n(e){var t=e._currentValue;if($h!==e)if(e={context:e,memoizedValue:t,next:null},Ms===null){if(Mc===null)throw Error(X(308));Ms=e,Mc.dependencies={lanes:0,firstContext:e}}else Ms=Ms.next=e;return t}var Mi=null;function Vh(e){Mi===null?Mi=[e]:Mi.push(e)}function hw(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Vh(t)):(n.next=i.next,i.next=n),t.interleaved=n,Tr(e,r)}function Tr(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Br=!1;function Uh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function mw(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function kr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function oi(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ae&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Tr(e,n)}return i=r.interleaved,i===null?(t.next=t,Vh(r)):(t.next=i.next,i.next=t),r.interleaved=t,Tr(e,n)}function ec(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ah(e,n)}}function hv(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Nc(e,t,n,r){var i=e.updateQueue;Br=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,c=l.next;l.next=null,o===null?s=c:o.next=c,o=l;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=c:a.next=c,d.lastBaseUpdate=l))}if(s!==null){var u=i.baseState;o=0,d=c=l=null,a=s;do{var p=a.lane,h=a.eventTime;if((r&p)===p){d!==null&&(d=d.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=e,w=a;switch(p=t,h=n,w.tag){case 1:if(y=w.payload,typeof y=="function"){u=y.call(h,u,p);break e}u=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=w.payload,p=typeof y=="function"?y.call(h,u,p):y,p==null)break e;u=Ke({},u,p);break e;case 2:Br=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,p=i.effects,p===null?i.effects=[a]:p.push(a))}else h={eventTime:h,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(c=d=h,l=u):d=d.next=h,o|=p;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;p=a,a=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(d===null&&(l=u),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);ts|=o,e.lanes=o,e.memoizedState=u}}function mv(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(X(191,i));i.call(r)}}}var al={},nr=yi(al),Ma=yi(al),Na=yi(al);function Ni(e){if(e===al)throw Error(X(174));return e}function Hh(e,t){switch($e(Na,t),$e(Ma,e),$e(nr,al),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:kf(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=kf(t,e)}Ue(nr),$e(nr,t)}function mo(){Ue(nr),Ue(Ma),Ue(Na)}function gw(e){Ni(Na.current);var t=Ni(nr.current),n=kf(t,e.type);t!==n&&($e(Ma,e),$e(nr,n))}function Wh(e){Ma.current===e&&(Ue(nr),Ue(Ma))}var Ge=yi(0);function Oc(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var kd=[];function qh(){for(var e=0;e<kd.length;e++)kd[e]._workInProgressVersionPrimary=null;kd.length=0}var tc=Mr.ReactCurrentDispatcher,Sd=Mr.ReactCurrentBatchConfig,es=0,Qe=null,lt=null,pt=null,Dc=!1,ua=!1,Oa=0,K_=0;function Ct(){throw Error(X(321))}function Gh(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Vn(e[n],t[n]))return!1;return!0}function Yh(e,t,n,r,i,s){if(es=s,Qe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,tc.current=e===null||e.memoizedState===null?eT:tT,e=n(r,i),ua){s=0;do{if(ua=!1,Oa=0,25<=s)throw Error(X(301));s+=1,pt=lt=null,t.updateQueue=null,tc.current=nT,e=n(r,i)}while(ua)}if(tc.current=Ic,t=lt!==null&<.next!==null,es=0,pt=lt=Qe=null,Dc=!1,t)throw Error(X(300));return e}function Qh(){var e=Oa!==0;return Oa=0,e}function Yn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return pt===null?Qe.memoizedState=pt=e:pt=pt.next=e,pt}function Tn(){if(lt===null){var e=Qe.alternate;e=e!==null?e.memoizedState:null}else e=lt.next;var t=pt===null?Qe.memoizedState:pt.next;if(t!==null)pt=t,lt=e;else{if(e===null)throw Error(X(310));lt=e,e={memoizedState:lt.memoizedState,baseState:lt.baseState,baseQueue:lt.baseQueue,queue:lt.queue,next:null},pt===null?Qe.memoizedState=pt=e:pt=pt.next=e}return pt}function Da(e,t){return typeof t=="function"?t(e):t}function Cd(e){var t=Tn(),n=t.queue;if(n===null)throw Error(X(311));n.lastRenderedReducer=e;var r=lt,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var a=o=null,l=null,c=s;do{var d=c.lane;if((es&d)===d)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var u={lane:d,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=u,o=r):l=l.next=u,Qe.lanes|=d,ts|=d}c=c.next}while(c!==null&&c!==s);l===null?o=r:l.next=a,Vn(r,t.memoizedState)||(qt=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do s=i.lane,Qe.lanes|=s,ts|=s,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function _d(e){var t=Tn(),n=t.queue;if(n===null)throw Error(X(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,s=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do s=e(s,o.action),o=o.next;while(o!==i);Vn(s,t.memoizedState)||(qt=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function vw(){}function yw(e,t){var n=Qe,r=Tn(),i=t(),s=!Vn(r.memoizedState,i);if(s&&(r.memoizedState=i,qt=!0),r=r.queue,Kh(bw.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||pt!==null&&pt.memoizedState.tag&1){if(n.flags|=2048,Ia(9,ww.bind(null,n,r,i,t),void 0,null),ht===null)throw Error(X(349));es&30||xw(n,t,i)}return i}function xw(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Qe.updateQueue,t===null?(t={lastEffect:null,stores:null},Qe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ww(e,t,n,r){t.value=n,t.getSnapshot=r,kw(t)&&Sw(e)}function bw(e,t,n){return n(function(){kw(t)&&Sw(e)})}function kw(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Vn(e,n)}catch{return!0}}function Sw(e){var t=Tr(e,1);t!==null&&Bn(t,e,1,-1)}function gv(e){var t=Yn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Da,lastRenderedState:e},t.queue=e,e=e.dispatch=J_.bind(null,Qe,e),[t.memoizedState,e]}function Ia(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Qe.updateQueue,t===null?(t={lastEffect:null,stores:null},Qe.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Cw(){return Tn().memoizedState}function nc(e,t,n,r){var i=Yn();Qe.flags|=e,i.memoizedState=Ia(1|t,n,void 0,r===void 0?null:r)}function mu(e,t,n,r){var i=Tn();r=r===void 0?null:r;var s=void 0;if(lt!==null){var o=lt.memoizedState;if(s=o.destroy,r!==null&&Gh(r,o.deps)){i.memoizedState=Ia(t,n,s,r);return}}Qe.flags|=e,i.memoizedState=Ia(1|t,n,s,r)}function vv(e,t){return nc(8390656,8,e,t)}function Kh(e,t){return mu(2048,8,e,t)}function _w(e,t){return mu(4,2,e,t)}function Tw(e,t){return mu(4,4,e,t)}function Ew(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Aw(e,t,n){return n=n!=null?n.concat([e]):null,mu(4,4,Ew.bind(null,t,e),n)}function Xh(){}function jw(e,t){var n=Tn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Gh(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Rw(e,t){var n=Tn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Gh(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Pw(e,t,n){return es&21?(Vn(n,t)||(n=I1(),Qe.lanes|=n,ts|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,qt=!0),e.memoizedState=n)}function X_(e,t){var n=Pe;Pe=n!==0&&4>n?n:4,e(!0);var r=Sd.transition;Sd.transition={};try{e(!1),t()}finally{Pe=n,Sd.transition=r}}function Mw(){return Tn().memoizedState}function Z_(e,t,n){var r=li(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Nw(e))Ow(t,n);else if(n=hw(e,t,n,r),n!==null){var i=It();Bn(n,e,r,i),Dw(n,t,r)}}function J_(e,t,n){var r=li(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Nw(e))Ow(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,Vn(a,o)){var l=t.interleaved;l===null?(i.next=i,Vh(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=hw(e,t,i,r),n!==null&&(i=It(),Bn(n,e,r,i),Dw(n,t,r))}}function Nw(e){var t=e.alternate;return e===Qe||t!==null&&t===Qe}function Ow(e,t){ua=Dc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Dw(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ah(e,n)}}var Ic={readContext:_n,useCallback:Ct,useContext:Ct,useEffect:Ct,useImperativeHandle:Ct,useInsertionEffect:Ct,useLayoutEffect:Ct,useMemo:Ct,useReducer:Ct,useRef:Ct,useState:Ct,useDebugValue:Ct,useDeferredValue:Ct,useTransition:Ct,useMutableSource:Ct,useSyncExternalStore:Ct,useId:Ct,unstable_isNewReconciler:!1},eT={readContext:_n,useCallback:function(e,t){return Yn().memoizedState=[e,t===void 0?null:t],e},useContext:_n,useEffect:vv,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,nc(4194308,4,Ew.bind(null,t,e),n)},useLayoutEffect:function(e,t){return nc(4194308,4,e,t)},useInsertionEffect:function(e,t){return nc(4,2,e,t)},useMemo:function(e,t){var n=Yn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Yn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Z_.bind(null,Qe,e),[r.memoizedState,e]},useRef:function(e){var t=Yn();return e={current:e},t.memoizedState=e},useState:gv,useDebugValue:Xh,useDeferredValue:function(e){return Yn().memoizedState=e},useTransition:function(){var e=gv(!1),t=e[0];return e=X_.bind(null,e[1]),Yn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Qe,i=Yn();if(We){if(n===void 0)throw Error(X(407));n=n()}else{if(n=t(),ht===null)throw Error(X(349));es&30||xw(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,vv(bw.bind(null,r,s,e),[e]),r.flags|=2048,Ia(9,ww.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Yn(),t=ht.identifierPrefix;if(We){var n=br,r=wr;n=(r&~(1<<32-$n(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Oa++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=K_++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},tT={readContext:_n,useCallback:jw,useContext:_n,useEffect:Kh,useImperativeHandle:Aw,useInsertionEffect:_w,useLayoutEffect:Tw,useMemo:Rw,useReducer:Cd,useRef:Cw,useState:function(){return Cd(Da)},useDebugValue:Xh,useDeferredValue:function(e){var t=Tn();return Pw(t,lt.memoizedState,e)},useTransition:function(){var e=Cd(Da)[0],t=Tn().memoizedState;return[e,t]},useMutableSource:vw,useSyncExternalStore:yw,useId:Mw,unstable_isNewReconciler:!1},nT={readContext:_n,useCallback:jw,useContext:_n,useEffect:Kh,useImperativeHandle:Aw,useInsertionEffect:_w,useLayoutEffect:Tw,useMemo:Rw,useReducer:_d,useRef:Cw,useState:function(){return _d(Da)},useDebugValue:Xh,useDeferredValue:function(e){var t=Tn();return lt===null?t.memoizedState=e:Pw(t,lt.memoizedState,e)},useTransition:function(){var e=_d(Da)[0],t=Tn().memoizedState;return[e,t]},useMutableSource:vw,useSyncExternalStore:yw,useId:Mw,unstable_isNewReconciler:!1};function Mn(e,t){if(e&&e.defaultProps){t=Ke({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Uf(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Ke({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var gu={isMounted:function(e){return(e=e._reactInternals)?as(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=It(),i=li(e),s=kr(r,i);s.payload=t,n!=null&&(s.callback=n),t=oi(e,s,i),t!==null&&(Bn(t,e,i,r),ec(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=It(),i=li(e),s=kr(r,i);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=oi(e,s,i),t!==null&&(Bn(t,e,i,r),ec(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=It(),r=li(e),i=kr(n,r);i.tag=2,t!=null&&(i.callback=t),t=oi(e,i,r),t!==null&&(Bn(t,e,r,n),ec(t,e,r))}};function yv(e,t,n,r,i,s,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,o):t.prototype&&t.prototype.isPureReactComponent?!Aa(n,r)||!Aa(i,s):!0}function Iw(e,t,n){var r=!1,i=pi,s=t.contextType;return typeof s=="object"&&s!==null?s=_n(s):(i=Yt(t)?Zi:Pt.current,r=t.contextTypes,s=(r=r!=null)?fo(e,i):pi),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=gu,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function xv(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&gu.enqueueReplaceState(t,t.state,null)}function Hf(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Uh(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=_n(s):(s=Yt(t)?Zi:Pt.current,i.context=fo(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(Uf(e,t,s,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&gu.enqueueReplaceState(i,i.state,null),Nc(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function go(e,t){try{var n="",r=t;do n+=R2(r),r=r.return;while(r);var i=n}catch(s){i=`
|
|
39
39
|
Error generating stack: `+s.message+`
|
|
40
|
-
`+s.stack}return{value:e,source:t,stack:i,digest:null}}function bd(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Bf(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var HT=typeof WeakMap=="function"?WeakMap:Map;function Cw(e,t,n){n=kr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Oc||(Oc=!0,Qf=r),Bf(e,t)},n}function Tw(e,t,n){n=kr(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Bf(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Bf(e,t),typeof r!="function"&&(oi===null?oi=new Set([this]):oi.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function fv(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new HT;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=i_.bind(null,e,t,n),t.then(e,e))}function pv(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function hv(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=kr(-1,1),t.tag=2,si(n,t,1))),n.lanes|=1),e)}var WT=Pr.ReactCurrentOwner,qt=!1;function Nt(e,t,n,r){t.child=e===null?ew(t,null,n,r):co(t,e.child,n,r)}function mv(e,t,n,r,i){n=n.render;var s=t.ref;return Hs(t,i),r=zh(e,t,n,r,s,i),n=Vh(),e!==null&&!qt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Er(e,t,i)):(Ue&&n&&Ah(t),t.flags|=1,Nt(e,t,r,i),t.child)}function gv(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!Zh(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,_w(e,t,s,r,i)):(e=tc(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&i)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:Sa,n(o,r)&&e.ref===t.ref)return Er(e,t,i)}return t.flags|=1,e=li(s,r),e.ref=t.ref,e.return=t,t.child=e}function _w(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(Sa(s,r)&&e.ref===t.ref)if(qt=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(qt=!0);else return t.lanes=e.lanes,Er(e,t,i)}return $f(e,t,n,r,i)}function Ew(e,t,n){var r=t.pendingProps,i=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ie(Os,Jt),Jt|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ie(Os,Jt),Jt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,Ie(Os,Jt),Jt|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,Ie(Os,Jt),Jt|=r;return Nt(e,t,i,n),t.child}function jw(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function $f(e,t,n,r,i){var s=Yt(n)?Xi:Pt.current;return s=ao(t,s),Hs(t,i),n=zh(e,t,n,r,s,i),r=Vh(),e!==null&&!qt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Er(e,t,i)):(Ue&&r&&Ah(t),t.flags|=1,Nt(e,t,n,i),t.child)}function vv(e,t,n,r,i){if(Yt(n)){var s=!0;Sc(t)}else s=!1;if(Hs(t,i),t.stateNode===null)Zl(e,t),Sw(t,n,r),Ff(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,c=n.contextType;typeof c=="object"&&c!==null?c=Cn(c):(c=Yt(n)?Xi:Pt.current,c=ao(t,c));var d=n.getDerivedStateFromProps,u=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";u||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==c)&&dv(t,o,r,c),Br=!1;var p=t.memoizedState;o.state=p,jc(t,r,o,i),l=t.memoizedState,a!==r||p!==l||Gt.current||Br?(typeof d=="function"&&(Lf(t,n,d,r),l=t.memoizedState),(a=Br||uv(t,n,a,r,p,l,c))?(u||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=c,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,nw(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:Pn(t.type,a),o.props=c,u=t.pendingProps,p=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=Cn(l):(l=Yt(n)?Xi:Pt.current,l=ao(t,l));var m=n.getDerivedStateFromProps;(d=typeof m=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==u||p!==l)&&dv(t,o,r,l),Br=!1,p=t.memoizedState,o.state=p,jc(t,r,o,i);var y=t.memoizedState;a!==u||p!==y||Gt.current||Br?(typeof m=="function"&&(Lf(t,n,m,r),y=t.memoizedState),(c=Br||uv(t,n,c,r,p,y,l)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,y,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,y,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),o.props=r,o.state=y,o.context=l,r=c):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return zf(e,t,n,r,s,i)}function zf(e,t,n,r,i,s){jw(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&nv(t,n,!1),Er(e,t,s);r=t.stateNode,WT.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=co(t,e.child,null,s),t.child=co(t,null,a,s)):Nt(e,t,a,s),t.memoizedState=r.state,i&&nv(t,n,!0),t.child}function Aw(e){var t=e.stateNode;t.pendingContext?tv(e,t.pendingContext,t.pendingContext!==t.context):t.context&&tv(e,t.context,!1),Lh(e,t.containerInfo)}function yv(e,t,n,r,i){return lo(),Ph(i),t.flags|=256,Nt(e,t,n,r),t.child}var Vf={dehydrated:null,treeContext:null,retryLane:0};function Uf(e){return{baseLanes:e,cachePool:null,transitions:null}}function Rw(e,t,n){var r=t.pendingProps,i=qe.current,s=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(i&2)!==0),a?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Ie(qe,i&1),e===null)return Df(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,s?(r=t.mode,s=t.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=hu(o,r,0,null),e=Wi(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Uf(n),t.memoizedState=Vf,e):Wh(t,o));if(i=e.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return qT(e,t,o,r,a,i,n);if(s){s=r.fallback,o=t.mode,i=e.child,a=i.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=li(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=li(a,s):(s=Wi(s,o,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,o=e.child.memoizedState,o=o===null?Uf(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~n,t.memoizedState=Vf,r}return s=e.child,e=s.sibling,r=li(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Wh(e,t){return t=hu({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function El(e,t,n,r){return r!==null&&Ph(r),co(t,e.child,null,n),e=Wh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function qT(e,t,n,r,i,s,o){if(n)return t.flags&256?(t.flags&=-257,r=bd(Error(Y(422))),El(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=hu({mode:"visible",children:r.children},i,0,null),s=Wi(s,i,o,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&co(t,e.child,null,o),t.child.memoizedState=Uf(o),t.memoizedState=Vf,s);if(!(t.mode&1))return El(e,t,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(Y(419)),r=bd(s,r,void 0),El(e,t,o,r)}if(a=(o&e.childLanes)!==0,qt||a){if(r=ht,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=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:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,_r(e,i),Bn(r,e,i,-1))}return Xh(),r=bd(Error(Y(421))),El(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=s_.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,tn=ii(i.nextSibling),sn=t,Ue=!0,Dn=null,e!==null&&(yn[xn++]=wr,yn[xn++]=br,yn[xn++]=Zi,wr=e.id,br=e.overflow,Zi=t),t=Wh(t,r.children),t.flags|=4096,t)}function xv(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),If(e.return,t,n)}function kd(e,t,n,r,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function Pw(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(Nt(e,t,r.children,n),r=qe.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&xv(e,n,t);else if(e.tag===19)xv(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Ie(qe,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Ac(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),kd(t,!1,i,n,s);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Ac(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}kd(t,!0,n,null,s);break;case"together":kd(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Zl(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Er(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),es|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Y(153));if(t.child!==null){for(e=t.child,n=li(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=li(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function GT(e,t,n){switch(t.tag){case 3:Aw(t),lo();break;case 5:rw(t);break;case 1:Yt(t.type)&&Sc(t);break;case 4:Lh(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Ie(_c,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Ie(qe,qe.current&1),t.flags|=128,null):n&t.child.childLanes?Rw(e,t,n):(Ie(qe,qe.current&1),e=Er(e,t,n),e!==null?e.sibling:null);Ie(qe,qe.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Pw(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ie(qe,qe.current),r)break;return null;case 22:case 23:return t.lanes=0,Ew(e,t,n)}return Er(e,t,n)}var Mw,Hf,Ow,Nw;Mw=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Hf=function(){};Ow=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Oi(nr.current);var s=null;switch(n){case"input":i=ff(e,i),r=ff(e,r),s=[];break;case"select":i=Qe({},i,{value:void 0}),r=Qe({},r,{value:void 0}),s=[];break;case"textarea":i=mf(e,i),r=mf(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=bc)}vf(n,r);var o;n=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var a=i[c];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(ga.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in r){var l=r[c];if(a=i!=null?i[c]:void 0,r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(s||(s=[]),s.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(ga.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Fe("scroll",e),s||a===l||(s=[])):(s=s||[]).push(c,l))}n&&(s=s||[]).push("style",n);var c=s;(t.updateQueue=c)&&(t.flags|=4)}};Nw=function(e,t,n,r){n!==r&&(t.flags|=4)};function Bo(e,t){if(!Ue)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Tt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function YT(e,t,n){var r=t.pendingProps;switch(Rh(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Tt(t),null;case 1:return Yt(t.type)&&kc(),Tt(t),null;case 3:return r=t.stateNode,uo(),$e(Gt),$e(Pt),Bh(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Tl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Dn!==null&&(Zf(Dn),Dn=null))),Hf(e,t),Tt(t),null;case 5:Fh(t);var i=Oi(ja.current);if(n=t.type,e!==null&&t.stateNode!=null)Ow(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(Y(166));return Tt(t),null}if(e=Oi(nr.current),Tl(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Jn]=t,r[_a]=s,e=(t.mode&1)!==0,n){case"dialog":Fe("cancel",r),Fe("close",r);break;case"iframe":case"object":case"embed":Fe("load",r);break;case"video":case"audio":for(i=0;i<Go.length;i++)Fe(Go[i],r);break;case"source":Fe("error",r);break;case"img":case"image":case"link":Fe("error",r),Fe("load",r);break;case"details":Fe("toggle",r);break;case"input":jg(r,s),Fe("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Fe("invalid",r);break;case"textarea":Rg(r,s),Fe("invalid",r)}vf(n,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&Cl(r.textContent,a,e),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&Cl(r.textContent,a,e),i=["children",""+a]):ga.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&Fe("scroll",r)}switch(n){case"input":gl(r),Ag(r,s,!0);break;case"textarea":gl(r),Pg(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=bc)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=l1(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Jn]=t,e[_a]=r,Mw(e,t,!1,!1),t.stateNode=e;e:{switch(o=yf(n,r),n){case"dialog":Fe("cancel",e),Fe("close",e),i=r;break;case"iframe":case"object":case"embed":Fe("load",e),i=r;break;case"video":case"audio":for(i=0;i<Go.length;i++)Fe(Go[i],e);i=r;break;case"source":Fe("error",e),i=r;break;case"img":case"image":case"link":Fe("error",e),Fe("load",e),i=r;break;case"details":Fe("toggle",e),i=r;break;case"input":jg(e,r),i=ff(e,r),Fe("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Qe({},r,{value:void 0}),Fe("invalid",e);break;case"textarea":Rg(e,r),i=mf(e,r),Fe("invalid",e);break;default:i=r}vf(n,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?d1(e,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&c1(e,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&va(e,l):typeof l=="number"&&va(e,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(ga.hasOwnProperty(s)?l!=null&&s==="onScroll"&&Fe("scroll",e):l!=null&&mh(e,s,l,o))}switch(n){case"input":gl(e),Ag(e,r,!1);break;case"textarea":gl(e),Pg(e);break;case"option":r.value!=null&&e.setAttribute("value",""+di(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?$s(e,!!r.multiple,s,!1):r.defaultValue!=null&&$s(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=bc)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Tt(t),null;case 6:if(e&&t.stateNode!=null)Nw(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(Y(166));if(n=Oi(ja.current),Oi(nr.current),Tl(t)){if(r=t.stateNode,n=t.memoizedProps,r[Jn]=t,(s=r.nodeValue!==n)&&(e=sn,e!==null))switch(e.tag){case 3:Cl(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Cl(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Jn]=t,t.stateNode=r}return Tt(t),null;case 13:if($e(qe),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ue&&tn!==null&&t.mode&1&&!(t.flags&128))Z1(),lo(),t.flags|=98560,s=!1;else if(s=Tl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(Y(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(Y(317));s[Jn]=t}else lo(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Tt(t),s=!1}else Dn!==null&&(Zf(Dn),Dn=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||qe.current&1?ut===0&&(ut=3):Xh())),t.updateQueue!==null&&(t.flags|=4),Tt(t),null);case 4:return uo(),Hf(e,t),e===null&&Ca(t.stateNode.containerInfo),Tt(t),null;case 10:return Nh(t.type._context),Tt(t),null;case 17:return Yt(t.type)&&kc(),Tt(t),null;case 19:if($e(qe),s=t.memoizedState,s===null)return Tt(t),null;if(r=(t.flags&128)!==0,o=s.rendering,o===null)if(r)Bo(s,!1);else{if(ut!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Ac(e),o!==null){for(t.flags|=128,Bo(s,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,e=o.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Ie(qe,qe.current&1|2),t.child}e=e.sibling}s.tail!==null&&nt()>po&&(t.flags|=128,r=!0,Bo(s,!1),t.lanes=4194304)}else{if(!r)if(e=Ac(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Bo(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Ue)return Tt(t),null}else 2*nt()-s.renderingStartTime>po&&n!==1073741824&&(t.flags|=128,r=!0,Bo(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=nt(),t.sibling=null,n=qe.current,Ie(qe,r?n&1|2:n&1),t):(Tt(t),null);case 22:case 23:return Kh(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Jt&1073741824&&(Tt(t),t.subtreeFlags&6&&(t.flags|=8192)):Tt(t),null;case 24:return null;case 25:return null}throw Error(Y(156,t.tag))}function QT(e,t){switch(Rh(t),t.tag){case 1:return Yt(t.type)&&kc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return uo(),$e(Gt),$e(Pt),Bh(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Fh(t),null;case 13:if($e(qe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Y(340));lo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $e(qe),null;case 4:return uo(),null;case 10:return Nh(t.type._context),null;case 22:case 23:return Kh(),null;case 24:return null;default:return null}}var jl=!1,jt=!1,KT=typeof WeakSet=="function"?WeakSet:Set,ce=null;function Ms(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ze(e,t,r)}else n.current=null}function Wf(e,t,n){try{n()}catch(r){Ze(e,t,r)}}var wv=!1;function XT(e,t){if(jf=yc,e=B1(),jh(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,c=0,d=0,u=e,p=null;t:for(;;){for(var m;u!==n||i!==0&&u.nodeType!==3||(a=o+i),u!==s||r!==0&&u.nodeType!==3||(l=o+r),u.nodeType===3&&(o+=u.nodeValue.length),(m=u.firstChild)!==null;)p=u,u=m;for(;;){if(u===e)break t;if(p===n&&++c===i&&(a=o),p===s&&++d===r&&(l=o),(m=u.nextSibling)!==null)break;u=p,p=u.parentNode}u=m}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Af={focusedElem:e,selectionRange:n},yc=!1,ce=t;ce!==null;)if(t=ce,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ce=e;else for(;ce!==null;){t=ce;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var w=y.memoizedProps,x=y.memoizedState,h=t.stateNode,g=h.getSnapshotBeforeUpdate(t.elementType===t.type?w:Pn(t.type,w),x);h.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var k=t.stateNode.containerInfo;k.nodeType===1?k.textContent="":k.nodeType===9&&k.documentElement&&k.removeChild(k.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Y(163))}}catch(C){Ze(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,ce=e;break}ce=t.return}return y=wv,wv=!1,y}function sa(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&Wf(t,n,s)}i=i.next}while(i!==r)}}function fu(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function qf(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Dw(e){var t=e.alternate;t!==null&&(e.alternate=null,Dw(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Jn],delete t[_a],delete t[Mf],delete t[OT],delete t[NT])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Iw(e){return e.tag===5||e.tag===3||e.tag===4}function bv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Iw(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Gf(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=bc));else if(r!==4&&(e=e.child,e!==null))for(Gf(e,t,n),e=e.sibling;e!==null;)Gf(e,t,n),e=e.sibling}function Yf(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Yf(e,t,n),e=e.sibling;e!==null;)Yf(e,t,n),e=e.sibling}var xt=null,On=!1;function Dr(e,t,n){for(n=n.child;n!==null;)Lw(e,t,n),n=n.sibling}function Lw(e,t,n){if(tr&&typeof tr.onCommitFiberUnmount=="function")try{tr.onCommitFiberUnmount(iu,n)}catch{}switch(n.tag){case 5:jt||Ms(n,t);case 6:var r=xt,i=On;xt=null,Dr(e,t,n),xt=r,On=i,xt!==null&&(On?(e=xt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):xt.removeChild(n.stateNode));break;case 18:xt!==null&&(On?(e=xt,n=n.stateNode,e.nodeType===8?md(e.parentNode,n):e.nodeType===1&&md(e,n),ba(e)):md(xt,n.stateNode));break;case 4:r=xt,i=On,xt=n.stateNode.containerInfo,On=!0,Dr(e,t,n),xt=r,On=i;break;case 0:case 11:case 14:case 15:if(!jt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Wf(n,t,o),i=i.next}while(i!==r)}Dr(e,t,n);break;case 1:if(!jt&&(Ms(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Ze(n,t,a)}Dr(e,t,n);break;case 21:Dr(e,t,n);break;case 22:n.mode&1?(jt=(r=jt)||n.memoizedState!==null,Dr(e,t,n),jt=r):Dr(e,t,n);break;default:Dr(e,t,n)}}function kv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new KT),t.forEach(function(r){var i=o_.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function jn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:xt=a.stateNode,On=!1;break e;case 3:xt=a.stateNode.containerInfo,On=!0;break e;case 4:xt=a.stateNode.containerInfo,On=!0;break e}a=a.return}if(xt===null)throw Error(Y(160));Lw(s,o,i),xt=null,On=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(c){Ze(i,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Fw(t,e),t=t.sibling}function Fw(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(jn(t,e),Hn(e),r&4){try{sa(3,e,e.return),fu(3,e)}catch(w){Ze(e,e.return,w)}try{sa(5,e,e.return)}catch(w){Ze(e,e.return,w)}}break;case 1:jn(t,e),Hn(e),r&512&&n!==null&&Ms(n,n.return);break;case 5:if(jn(t,e),Hn(e),r&512&&n!==null&&Ms(n,n.return),e.flags&32){var i=e.stateNode;try{va(i,"")}catch(w){Ze(e,e.return,w)}}if(r&4&&(i=e.stateNode,i!=null)){var s=e.memoizedProps,o=n!==null?n.memoizedProps:s,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&o1(i,s),yf(a,o);var c=yf(a,s);for(o=0;o<l.length;o+=2){var d=l[o],u=l[o+1];d==="style"?d1(i,u):d==="dangerouslySetInnerHTML"?c1(i,u):d==="children"?va(i,u):mh(i,d,u,c)}switch(a){case"input":pf(i,s);break;case"textarea":a1(i,s);break;case"select":var p=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var m=s.value;m!=null?$s(i,!!s.multiple,m,!1):p!==!!s.multiple&&(s.defaultValue!=null?$s(i,!!s.multiple,s.defaultValue,!0):$s(i,!!s.multiple,s.multiple?[]:"",!1))}i[_a]=s}catch(w){Ze(e,e.return,w)}}break;case 6:if(jn(t,e),Hn(e),r&4){if(e.stateNode===null)throw Error(Y(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(w){Ze(e,e.return,w)}}break;case 3:if(jn(t,e),Hn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ba(t.containerInfo)}catch(w){Ze(e,e.return,w)}break;case 4:jn(t,e),Hn(e);break;case 13:jn(t,e),Hn(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(Yh=nt())),r&4&&kv(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(jt=(c=jt)||d,jn(t,e),jt=c):jn(t,e),Hn(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!d&&e.mode&1)for(ce=e,d=e.child;d!==null;){for(u=ce=d;ce!==null;){switch(p=ce,m=p.child,p.tag){case 0:case 11:case 14:case 15:sa(4,p,p.return);break;case 1:Ms(p,p.return);var y=p.stateNode;if(typeof y.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(w){Ze(r,n,w)}}break;case 5:Ms(p,p.return);break;case 22:if(p.memoizedState!==null){Cv(u);continue}}m!==null?(m.return=p,ce=m):Cv(u)}d=d.sibling}e:for(d=null,u=e;;){if(u.tag===5){if(d===null){d=u;try{i=u.stateNode,c?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=u.stateNode,l=u.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=u1("display",o))}catch(w){Ze(e,e.return,w)}}}else if(u.tag===6){if(d===null)try{u.stateNode.nodeValue=c?"":u.memoizedProps}catch(w){Ze(e,e.return,w)}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===e)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===e)break e;for(;u.sibling===null;){if(u.return===null||u.return===e)break e;d===u&&(d=null),u=u.return}d===u&&(d=null),u.sibling.return=u.return,u=u.sibling}}break;case 19:jn(t,e),Hn(e),r&4&&kv(e);break;case 21:break;default:jn(t,e),Hn(e)}}function Hn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Iw(n)){var r=n;break e}n=n.return}throw Error(Y(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(va(i,""),r.flags&=-33);var s=bv(e);Yf(e,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,a=bv(e);Gf(e,a,o);break;default:throw Error(Y(161))}}catch(l){Ze(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ZT(e,t,n){ce=e,Bw(e)}function Bw(e,t,n){for(var r=(e.mode&1)!==0;ce!==null;){var i=ce,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||jl;if(!o){var a=i.alternate,l=a!==null&&a.memoizedState!==null||jt;a=jl;var c=jt;if(jl=o,(jt=l)&&!c)for(ce=i;ce!==null;)o=ce,l=o.child,o.tag===22&&o.memoizedState!==null?Tv(i):l!==null?(l.return=o,ce=l):Tv(i);for(;s!==null;)ce=s,Bw(s),s=s.sibling;ce=i,jl=a,jt=c}Sv(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,ce=s):Sv(e)}}function Sv(e){for(;ce!==null;){var t=ce;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:jt||fu(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!jt)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Pn(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&av(t,s,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}av(t,o,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var d=c.memoizedState;if(d!==null){var u=d.dehydrated;u!==null&&ba(u)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Y(163))}jt||t.flags&512&&qf(t)}catch(p){Ze(t,t.return,p)}}if(t===e){ce=null;break}if(n=t.sibling,n!==null){n.return=t.return,ce=n;break}ce=t.return}}function Cv(e){for(;ce!==null;){var t=ce;if(t===e){ce=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ce=n;break}ce=t.return}}function Tv(e){for(;ce!==null;){var t=ce;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{fu(4,t)}catch(l){Ze(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){Ze(t,i,l)}}var s=t.return;try{qf(t)}catch(l){Ze(t,s,l)}break;case 5:var o=t.return;try{qf(t)}catch(l){Ze(t,o,l)}}}catch(l){Ze(t,t.return,l)}if(t===e){ce=null;break}var a=t.sibling;if(a!==null){a.return=t.return,ce=a;break}ce=t.return}}var JT=Math.ceil,Mc=Pr.ReactCurrentDispatcher,qh=Pr.ReactCurrentOwner,kn=Pr.ReactCurrentBatchConfig,je=0,ht=null,it=null,bt=0,Jt=0,Os=yi(0),ut=0,Ma=null,es=0,pu=0,Gh=0,oa=null,Ht=null,Yh=0,po=1/0,gr=null,Oc=!1,Qf=null,oi=null,Al=!1,Jr=null,Nc=0,aa=0,Kf=null,Jl=-1,ec=0;function It(){return je&6?nt():Jl!==-1?Jl:Jl=nt()}function ai(e){return e.mode&1?je&2&&bt!==0?bt&-bt:IT.transition!==null?(ec===0&&(ec=S1()),ec):(e=Re,e!==0||(e=window.event,e=e===void 0?16:R1(e.type)),e):1}function Bn(e,t,n,r){if(50<aa)throw aa=0,Kf=null,Error(Y(185));Ja(e,n,r),(!(je&2)||e!==ht)&&(e===ht&&(!(je&2)&&(pu|=n),ut===4&&Vr(e,bt)),Qt(e,r),n===1&&je===0&&!(t.mode&1)&&(po=nt()+500,cu&&xi()))}function Qt(e,t){var n=e.callbackNode;I2(e,t);var r=vc(e,e===ht?bt:0);if(r===0)n!==null&&Ng(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Ng(n),t===1)e.tag===0?DT(_v.bind(null,e)):Q1(_v.bind(null,e)),PT(function(){!(je&6)&&xi()}),n=null;else{switch(C1(r)){case 1:n=wh;break;case 4:n=b1;break;case 16:n=gc;break;case 536870912:n=k1;break;default:n=gc}n=Gw(n,$w.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function $w(e,t){if(Jl=-1,ec=0,je&6)throw Error(Y(327));var n=e.callbackNode;if(Ws()&&e.callbackNode!==n)return null;var r=vc(e,e===ht?bt:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Dc(e,r);else{t=r;var i=je;je|=2;var s=Vw();(ht!==e||bt!==t)&&(gr=null,po=nt()+500,Hi(e,t));do try{n_();break}catch(a){zw(e,a)}while(!0);Oh(),Mc.current=s,je=i,it!==null?t=0:(ht=null,bt=0,t=ut)}if(t!==0){if(t===2&&(i=Sf(e),i!==0&&(r=i,t=Xf(e,i))),t===1)throw n=Ma,Hi(e,0),Vr(e,r),Qt(e,nt()),n;if(t===6)Vr(e,r);else{if(i=e.current.alternate,!(r&30)&&!e_(i)&&(t=Dc(e,r),t===2&&(s=Sf(e),s!==0&&(r=s,t=Xf(e,s))),t===1))throw n=Ma,Hi(e,0),Vr(e,r),Qt(e,nt()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(Y(345));case 2:Ei(e,Ht,gr);break;case 3:if(Vr(e,r),(r&130023424)===r&&(t=Yh+500-nt(),10<t)){if(vc(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){It(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Pf(Ei.bind(null,e,Ht,gr),t);break}Ei(e,Ht,gr);break;case 4:if(Vr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-Fn(r);s=1<<o,o=t[o],o>i&&(i=o),r&=~s}if(r=i,r=nt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*JT(r/1960))-r,10<r){e.timeoutHandle=Pf(Ei.bind(null,e,Ht,gr),r);break}Ei(e,Ht,gr);break;case 5:Ei(e,Ht,gr);break;default:throw Error(Y(329))}}}return Qt(e,nt()),e.callbackNode===n?$w.bind(null,e):null}function Xf(e,t){var n=oa;return e.current.memoizedState.isDehydrated&&(Hi(e,t).flags|=256),e=Dc(e,t),e!==2&&(t=Ht,Ht=n,t!==null&&Zf(t)),e}function Zf(e){Ht===null?Ht=e:Ht.push.apply(Ht,e)}function e_(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!zn(s(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Vr(e,t){for(t&=~Gh,t&=~pu,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Fn(t),r=1<<n;e[n]=-1,t&=~r}}function _v(e){if(je&6)throw Error(Y(327));Ws();var t=vc(e,0);if(!(t&1))return Qt(e,nt()),null;var n=Dc(e,t);if(e.tag!==0&&n===2){var r=Sf(e);r!==0&&(t=r,n=Xf(e,r))}if(n===1)throw n=Ma,Hi(e,0),Vr(e,t),Qt(e,nt()),n;if(n===6)throw Error(Y(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ei(e,Ht,gr),Qt(e,nt()),null}function Qh(e,t){var n=je;je|=1;try{return e(t)}finally{je=n,je===0&&(po=nt()+500,cu&&xi())}}function ts(e){Jr!==null&&Jr.tag===0&&!(je&6)&&Ws();var t=je;je|=1;var n=kn.transition,r=Re;try{if(kn.transition=null,Re=1,e)return e()}finally{Re=r,kn.transition=n,je=t,!(je&6)&&xi()}}function Kh(){Jt=Os.current,$e(Os)}function Hi(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,RT(n)),it!==null)for(n=it.return;n!==null;){var r=n;switch(Rh(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&kc();break;case 3:uo(),$e(Gt),$e(Pt),Bh();break;case 5:Fh(r);break;case 4:uo();break;case 13:$e(qe);break;case 19:$e(qe);break;case 10:Nh(r.type._context);break;case 22:case 23:Kh()}n=n.return}if(ht=e,it=e=li(e.current,null),bt=Jt=t,ut=0,Ma=null,Gh=pu=es=0,Ht=oa=null,Mi!==null){for(t=0;t<Mi.length;t++)if(n=Mi[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var o=s.next;s.next=i,r.next=o}n.pending=r}Mi=null}return e}function zw(e,t){do{var n=it;try{if(Oh(),Kl.current=Pc,Rc){for(var r=Ye.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Rc=!1}if(Ji=0,pt=lt=Ye=null,ia=!1,Aa=0,qh.current=null,n===null||n.return===null){ut=1,Ma=t,it=null;break}e:{var s=e,o=n.return,a=n,l=t;if(t=bt,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,d=a,u=d.tag;if(!(d.mode&1)&&(u===0||u===11||u===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=pv(o);if(m!==null){m.flags&=-257,hv(m,o,a,s,t),m.mode&1&&fv(s,c,t),t=m,l=c;var y=t.updateQueue;if(y===null){var w=new Set;w.add(l),t.updateQueue=w}else y.add(l);break e}else{if(!(t&1)){fv(s,c,t),Xh();break e}l=Error(Y(426))}}else if(Ue&&a.mode&1){var x=pv(o);if(x!==null){!(x.flags&65536)&&(x.flags|=256),hv(x,o,a,s,t),Ph(fo(l,a));break e}}s=l=fo(l,a),ut!==4&&(ut=2),oa===null?oa=[s]:oa.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var h=Cw(s,l,t);ov(s,h);break e;case 1:a=l;var g=s.type,k=s.stateNode;if(!(s.flags&128)&&(typeof g.getDerivedStateFromError=="function"||k!==null&&typeof k.componentDidCatch=="function"&&(oi===null||!oi.has(k)))){s.flags|=65536,t&=-t,s.lanes|=t;var C=Tw(s,a,t);ov(s,C);break e}}s=s.return}while(s!==null)}Hw(n)}catch(S){t=S,it===n&&n!==null&&(it=n=n.return);continue}break}while(!0)}function Vw(){var e=Mc.current;return Mc.current=Pc,e===null?Pc:e}function Xh(){(ut===0||ut===3||ut===2)&&(ut=4),ht===null||!(es&268435455)&&!(pu&268435455)||Vr(ht,bt)}function Dc(e,t){var n=je;je|=2;var r=Vw();(ht!==e||bt!==t)&&(gr=null,Hi(e,t));do try{t_();break}catch(i){zw(e,i)}while(!0);if(Oh(),je=n,Mc.current=r,it!==null)throw Error(Y(261));return ht=null,bt=0,ut}function t_(){for(;it!==null;)Uw(it)}function n_(){for(;it!==null&&!E2();)Uw(it)}function Uw(e){var t=qw(e.alternate,e,Jt);e.memoizedProps=e.pendingProps,t===null?Hw(e):it=t,qh.current=null}function Hw(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=QT(n,t),n!==null){n.flags&=32767,it=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ut=6,it=null;return}}else if(n=YT(n,t,Jt),n!==null){it=n;return}if(t=t.sibling,t!==null){it=t;return}it=t=e}while(t!==null);ut===0&&(ut=5)}function Ei(e,t,n){var r=Re,i=kn.transition;try{kn.transition=null,Re=1,r_(e,t,n,r)}finally{kn.transition=i,Re=r}return null}function r_(e,t,n,r){do Ws();while(Jr!==null);if(je&6)throw Error(Y(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(Y(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(L2(e,s),e===ht&&(it=ht=null,bt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Al||(Al=!0,Gw(gc,function(){return Ws(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=kn.transition,kn.transition=null;var o=Re;Re=1;var a=je;je|=4,qh.current=null,XT(e,n),Fw(n,e),ST(Af),yc=!!jf,Af=jf=null,e.current=n,ZT(n),j2(),je=a,Re=o,kn.transition=s}else e.current=n;if(Al&&(Al=!1,Jr=e,Nc=i),s=e.pendingLanes,s===0&&(oi=null),P2(n.stateNode),Qt(e,nt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Oc)throw Oc=!1,e=Qf,Qf=null,e;return Nc&1&&e.tag!==0&&Ws(),s=e.pendingLanes,s&1?e===Kf?aa++:(aa=0,Kf=e):aa=0,xi(),null}function Ws(){if(Jr!==null){var e=C1(Nc),t=kn.transition,n=Re;try{if(kn.transition=null,Re=16>e?16:e,Jr===null)var r=!1;else{if(e=Jr,Jr=null,Nc=0,je&6)throw Error(Y(331));var i=je;for(je|=4,ce=e.current;ce!==null;){var s=ce,o=s.child;if(ce.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(ce=c;ce!==null;){var d=ce;switch(d.tag){case 0:case 11:case 15:sa(8,d,s)}var u=d.child;if(u!==null)u.return=d,ce=u;else for(;ce!==null;){d=ce;var p=d.sibling,m=d.return;if(Dw(d),d===c){ce=null;break}if(p!==null){p.return=m,ce=p;break}ce=m}}}var y=s.alternate;if(y!==null){var w=y.child;if(w!==null){y.child=null;do{var x=w.sibling;w.sibling=null,w=x}while(w!==null)}}ce=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,ce=o;else e:for(;ce!==null;){if(s=ce,s.flags&2048)switch(s.tag){case 0:case 11:case 15:sa(9,s,s.return)}var h=s.sibling;if(h!==null){h.return=s.return,ce=h;break e}ce=s.return}}var g=e.current;for(ce=g;ce!==null;){o=ce;var k=o.child;if(o.subtreeFlags&2064&&k!==null)k.return=o,ce=k;else e:for(o=g;ce!==null;){if(a=ce,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:fu(9,a)}}catch(S){Ze(a,a.return,S)}if(a===o){ce=null;break e}var C=a.sibling;if(C!==null){C.return=a.return,ce=C;break e}ce=a.return}}if(je=i,xi(),tr&&typeof tr.onPostCommitFiberRoot=="function")try{tr.onPostCommitFiberRoot(iu,e)}catch{}r=!0}return r}finally{Re=n,kn.transition=t}}return!1}function Ev(e,t,n){t=fo(n,t),t=Cw(e,t,1),e=si(e,t,1),t=It(),e!==null&&(Ja(e,1,t),Qt(e,t))}function Ze(e,t,n){if(e.tag===3)Ev(e,e,n);else for(;t!==null;){if(t.tag===3){Ev(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(oi===null||!oi.has(r))){e=fo(n,e),e=Tw(t,e,1),t=si(t,e,1),e=It(),t!==null&&(Ja(t,1,e),Qt(t,e));break}}t=t.return}}function i_(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=It(),e.pingedLanes|=e.suspendedLanes&n,ht===e&&(bt&n)===n&&(ut===4||ut===3&&(bt&130023424)===bt&&500>nt()-Yh?Hi(e,0):Gh|=n),Qt(e,t)}function Ww(e,t){t===0&&(e.mode&1?(t=xl,xl<<=1,!(xl&130023424)&&(xl=4194304)):t=1);var n=It();e=_r(e,t),e!==null&&(Ja(e,t,n),Qt(e,n))}function s_(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ww(e,n)}function o_(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(Y(314))}r!==null&&r.delete(t),Ww(e,n)}var qw;qw=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Gt.current)qt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return qt=!1,GT(e,t,n);qt=!!(e.flags&131072)}else qt=!1,Ue&&t.flags&1048576&&K1(t,Tc,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Zl(e,t),e=t.pendingProps;var i=ao(t,Pt.current);Hs(t,n),i=zh(null,t,r,e,i,n);var s=Vh();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Yt(r)?(s=!0,Sc(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Ih(t),i.updater=du,t.stateNode=i,i._reactInternals=t,Ff(t,r,e,n),t=zf(null,t,r,!0,s,n)):(t.tag=0,Ue&&s&&Ah(t),Nt(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Zl(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=l_(r),e=Pn(r,e),i){case 0:t=$f(null,t,r,e,n);break e;case 1:t=vv(null,t,r,e,n);break e;case 11:t=mv(null,t,r,e,n);break e;case 14:t=gv(null,t,r,Pn(r.type,e),n);break e}throw Error(Y(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Pn(r,i),$f(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Pn(r,i),vv(e,t,r,i,n);case 3:e:{if(Aw(t),e===null)throw Error(Y(387));r=t.pendingProps,s=t.memoizedState,i=s.element,nw(e,t),jc(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=fo(Error(Y(423)),t),t=yv(e,t,r,n,i);break e}else if(r!==i){i=fo(Error(Y(424)),t),t=yv(e,t,r,n,i);break e}else for(tn=ii(t.stateNode.containerInfo.firstChild),sn=t,Ue=!0,Dn=null,n=ew(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(lo(),r===i){t=Er(e,t,n);break e}Nt(e,t,r,n)}t=t.child}return t;case 5:return rw(t),e===null&&Df(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,Rf(r,i)?o=null:s!==null&&Rf(r,s)&&(t.flags|=32),jw(e,t),Nt(e,t,o,n),t.child;case 6:return e===null&&Df(t),null;case 13:return Rw(e,t,n);case 4:return Lh(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=co(t,null,r,n):Nt(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Pn(r,i),mv(e,t,r,i,n);case 7:return Nt(e,t,t.pendingProps,n),t.child;case 8:return Nt(e,t,t.pendingProps.children,n),t.child;case 12:return Nt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,Ie(_c,r._currentValue),r._currentValue=o,s!==null)if(zn(s.value,o)){if(s.children===i.children&&!Gt.current){t=Er(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=kr(-1,n&-n),l.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?l.next=l:(l.next=d.next,d.next=l),c.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),If(s.return,n,t),a.lanes|=n;break}l=l.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(Y(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),If(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Nt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Hs(t,n),i=Cn(i),r=r(i),t.flags|=1,Nt(e,t,r,n),t.child;case 14:return r=t.type,i=Pn(r,t.pendingProps),i=Pn(r.type,i),gv(e,t,r,i,n);case 15:return _w(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Pn(r,i),Zl(e,t),t.tag=1,Yt(r)?(e=!0,Sc(t)):e=!1,Hs(t,n),Sw(t,r,i),Ff(t,r,i,n),zf(null,t,r,!0,e,n);case 19:return Pw(e,t,n);case 22:return Ew(e,t,n)}throw Error(Y(156,t.tag))};function Gw(e,t){return w1(e,t)}function a_(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function bn(e,t,n,r){return new a_(e,t,n,r)}function Zh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function l_(e){if(typeof e=="function")return Zh(e)?1:0;if(e!=null){if(e=e.$$typeof,e===vh)return 11;if(e===yh)return 14}return 2}function li(e,t){var n=e.alternate;return n===null?(n=bn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function tc(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")Zh(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Ss:return Wi(n.children,i,s,t);case gh:o=8,i|=8;break;case lf:return e=bn(12,n,t,i|2),e.elementType=lf,e.lanes=s,e;case cf:return e=bn(13,n,t,i),e.elementType=cf,e.lanes=s,e;case uf:return e=bn(19,n,t,i),e.elementType=uf,e.lanes=s,e;case r1:return hu(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case t1:o=10;break e;case n1:o=9;break e;case vh:o=11;break e;case yh:o=14;break e;case Fr:o=16,r=null;break e}throw Error(Y(130,e==null?e:typeof e,""))}return t=bn(o,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function Wi(e,t,n,r){return e=bn(7,e,r,t),e.lanes=n,e}function hu(e,t,n,r){return e=bn(22,e,r,t),e.elementType=r1,e.lanes=n,e.stateNode={isHidden:!1},e}function Sd(e,t,n){return e=bn(6,e,null,t),e.lanes=n,e}function Cd(e,t,n){return t=bn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function c_(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=id(0),this.expirationTimes=id(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=id(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Jh(e,t,n,r,i,s,o,a,l){return e=new c_(e,t,n,a,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=bn(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ih(s),e}function u_(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ks,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Yw(e){if(!e)return fi;e=e._reactInternals;e:{if(os(e)!==e||e.tag!==1)throw Error(Y(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Yt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(Y(171))}if(e.tag===1){var n=e.type;if(Yt(n))return Y1(e,n,t)}return t}function Qw(e,t,n,r,i,s,o,a,l){return e=Jh(n,r,!0,e,i,s,o,a,l),e.context=Yw(null),n=e.current,r=It(),i=ai(n),s=kr(r,i),s.callback=t??null,si(n,s,i),e.current.lanes=i,Ja(e,i,r),Qt(e,r),e}function mu(e,t,n,r){var i=t.current,s=It(),o=ai(i);return n=Yw(n),t.context===null?t.context=n:t.pendingContext=n,t=kr(s,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=si(i,t,o),e!==null&&(Bn(e,i,o,s),Ql(e,i,o)),o}function Ic(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function jv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function em(e,t){jv(e,t),(e=e.alternate)&&jv(e,t)}function d_(){return null}var Kw=typeof reportError=="function"?reportError:function(e){console.error(e)};function tm(e){this._internalRoot=e}gu.prototype.render=tm.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Y(409));mu(e,t,null,null)};gu.prototype.unmount=tm.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ts(function(){mu(null,e,null,null)}),t[Tr]=null}};function gu(e){this._internalRoot=e}gu.prototype.unstable_scheduleHydration=function(e){if(e){var t=E1();e={blockedOn:null,target:e,priority:t};for(var n=0;n<zr.length&&t!==0&&t<zr[n].priority;n++);zr.splice(n,0,e),n===0&&A1(e)}};function nm(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function vu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Av(){}function f_(e,t,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var c=Ic(o);s.call(c)}}var o=Qw(t,r,e,0,null,!1,!1,"",Av);return e._reactRootContainer=o,e[Tr]=o.current,Ca(e.nodeType===8?e.parentNode:e),ts(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var c=Ic(l);a.call(c)}}var l=Jh(e,0,!1,null,null,!1,!1,"",Av);return e._reactRootContainer=l,e[Tr]=l.current,Ca(e.nodeType===8?e.parentNode:e),ts(function(){mu(t,l,n,r)}),l}function yu(e,t,n,r,i){var s=n._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var a=i;i=function(){var l=Ic(o);a.call(l)}}mu(t,o,e,i)}else o=f_(n,t,e,i,r);return Ic(o)}T1=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=qo(t.pendingLanes);n!==0&&(bh(t,n|1),Qt(t,nt()),!(je&6)&&(po=nt()+500,xi()))}break;case 13:ts(function(){var r=_r(e,1);if(r!==null){var i=It();Bn(r,e,1,i)}}),em(e,1)}};kh=function(e){if(e.tag===13){var t=_r(e,134217728);if(t!==null){var n=It();Bn(t,e,134217728,n)}em(e,134217728)}};_1=function(e){if(e.tag===13){var t=ai(e),n=_r(e,t);if(n!==null){var r=It();Bn(n,e,t,r)}em(e,t)}};E1=function(){return Re};j1=function(e,t){var n=Re;try{return Re=e,t()}finally{Re=n}};wf=function(e,t,n){switch(t){case"input":if(pf(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=lu(r);if(!i)throw Error(Y(90));s1(r),pf(r,i)}}}break;case"textarea":a1(e,n);break;case"select":t=n.value,t!=null&&$s(e,!!n.multiple,t,!1)}};h1=Qh;m1=ts;var p_={usingClientEntryPoint:!1,Events:[tl,Es,lu,f1,p1,Qh]},$o={findFiberByHostInstance:Pi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},h_={bundleType:$o.bundleType,version:$o.version,rendererPackageName:$o.rendererPackageName,rendererConfig:$o.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Pr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=y1(e),e===null?null:e.stateNode},findFiberByHostInstance:$o.findFiberByHostInstance||d_,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 Rl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Rl.isDisabled&&Rl.supportsFiber)try{iu=Rl.inject(h_),tr=Rl}catch{}}an.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=p_;an.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!nm(t))throw Error(Y(200));return u_(e,t,null,n)};an.createRoot=function(e,t){if(!nm(e))throw Error(Y(299));var n=!1,r="",i=Kw;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=Jh(e,1,!1,null,null,n,!1,r,i),e[Tr]=t.current,Ca(e.nodeType===8?e.parentNode:e),new tm(t)};an.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(Y(188)):(e=Object.keys(e).join(","),Error(Y(268,e)));return e=y1(t),e=e===null?null:e.stateNode,e};an.flushSync=function(e){return ts(e)};an.hydrate=function(e,t,n){if(!vu(t))throw Error(Y(200));return yu(null,e,t,!0,n)};an.hydrateRoot=function(e,t,n){if(!nm(e))throw Error(Y(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",o=Kw;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=Qw(t,null,e,1,n??null,i,!1,s,o),e[Tr]=t.current,Ca(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new gu(t)};an.render=function(e,t,n){if(!vu(t))throw Error(Y(200));return yu(null,e,t,!1,n)};an.unmountComponentAtNode=function(e){if(!vu(e))throw Error(Y(40));return e._reactRootContainer?(ts(function(){yu(null,null,e,!1,function(){e._reactRootContainer=null,e[Tr]=null})}),!0):!1};an.unstable_batchedUpdates=Qh;an.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!vu(n))throw Error(Y(200));if(e==null||e._reactInternals===void 0)throw Error(Y(38));return yu(e,t,n,!1,r)};an.version="18.3.1-next-f1338f8080-20240426";function Xw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Xw)}catch(e){console.error(e)}}Xw(),Xx.exports=an;var Zw=Xx.exports;const m_=Rr(Zw);var Jw,Rv=Zw;Jw=Rv.createRoot,Rv.hydrateRoot;const g_="@alfatech/livechat",v_="v2026.04.02.1",y_="module",x_="https://api.chatier.app",w_="wss://api.chatier.app",b_=["dist","README.md","component/chatier.js"],k_="dist/widget.js",S_={name:"Uygar Öztürk Ceylan",email:"uygaroztcyln@gmail.com"},C_={dev:"vite",dev2:"vite --config vite.config.2.ts",build:"tsc -b && vite build",lint:"biome lint --write",prepare:"husky",format:"biome format --write && yarn lint",preview:"vite preview","build:mobile":"tsc -b && vite build --config vite.config.app.ts && mv dist-app/index-app.html dist-app/index.html","preview:mobile":"vite preview --config vite.config.app.ts --outDir dist-app","dev:mobile":"vite --config vite.config.app.ts"},T_={"@headlessui/react":"^2.2.2","@tailwindcss/vite":"^4.1.4","@tanstack/react-query":"^5.59.20",classnames:"^2.5.1",dayjs:"^1.11.13",formik:"^2.4.6","framer-motion":"^12.7.4","lucide-react":"^0.511.0",react:"^18.3.1","react-dom":"^18.3.1","react-dropzone":"^14.3.8","react-router-dom":"^6.26.2","socket.io-client":"^4.8.1",sonner:"^2.0.1",yup:"^1.4.0",zustand:"^4.5.5"},__={"@biomejs/biome":"^1.8.3","@types/node":"^22.5.4","@types/react":"^18.3.3","@types/react-dom":"^18.3.0","@vitejs/plugin-react-swc":"^3.5.0",globals:"^15.9.0",husky:"^9.1.5",tailwindcss:"^4.1.4",typescript:"^5.5.3",vite:"^5.4.1"},eb={name:g_,private:!1,version:v_,type:y_,apiURL:x_,wsURL:w_,files:b_,main:k_,author:S_,scripts:C_,dependencies:T_,devDependencies:__,"lint-staged":{"./**/*.{js,ts,tsx,json}":["npm run format"]}},tb=eb.apiURL,E_=eb.wsURL,j_=e=>[{limit:Number.parseInt(e.headers.get("X-Ratelimit-Limit")||"0"),remaining:Number.parseInt(e.headers.get("X-Ratelimit-Remaining")||"0"),reset:Number.parseInt(e.headers.get("X-Ratelimit-Reset")||"0"),retryAfter:Number.parseInt(e.headers.get("Retry-After")||"0")},429],A_=(e,t)=>[{message:"message"in t?t.message:"Not Found"},404],R_={429:j_,404:A_};async function Mr(e,t={}){const n={};!(t.body instanceof FormData)&&t.body&&(n["Content-Type"]="application/json");const r=await fetch(`${tb}/${e}`,{...t,credentials:"include",headers:{...t.headers,...n}}).catch(s=>new Response(null,{status:500}));if(!r.ok){let s={};try{return s=await r.json(),[s,r.status]}catch{}const o=R_[r.status];return o?o(r,s):[{},r.status]}const i=r.headers.get("Content-Type");return i&&i.includes("application/json")?[await r.json(),r.status]:[await r.text(),r.status]}const $n=e=>[200,201,204].includes(e),P_=(e,{arrayWithBrackets:t=!1,arrayWithBracketAndIndex:n=!0}={})=>{const r=new FormData;for(const[i,s]of Object.entries(e)){if(Array.isArray(s)){for(const o in s)t?r.append(`${i}[]`,s[o]):n?r.append(`${i}[${o}]`,s[o]):r.append(i,s[o]);continue}typeof s<"u"&&s!==null&&r.append(i,s)}return r};var To=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ns=typeof window>"u"||"Deno"in globalThis;function vn(){}function M_(e,t){return typeof e=="function"?e(t):e}function Jf(e){return typeof e=="number"&&e>=0&&e!==1/0}function nb(e,t){return Math.max(e+(t||0)-Date.now(),0)}function qs(e,t){return typeof e=="function"?e(t):e}function In(e,t){return typeof e=="function"?e(t):e}function Pv(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:a}=e;if(o){if(r){if(t.queryHash!==rm(o,t.options))return!1}else if(!Oa(t.queryKey,o))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||i&&i!==t.state.fetchStatus||s&&!s(t))}function Mv(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(rs(t.options.mutationKey)!==rs(s))return!1}else if(!Oa(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function rm(e,t){return((t==null?void 0:t.queryKeyHashFn)||rs)(e)}function rs(e){return JSON.stringify(e,(t,n)=>ep(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Oa(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Oa(e[n],t[n])):!1}function rb(e,t){if(e===t)return e;const n=Ov(e)&&Ov(t);if(n||ep(e)&&ep(t)){const r=n?e:Object.keys(e),i=r.length,s=n?t:Object.keys(t),o=s.length,a=n?[]:{};let l=0;for(let c=0;c<o;c++){const d=n?c:s[c];(!n&&r.includes(d)||n)&&e[d]===void 0&&t[d]===void 0?(a[d]=void 0,l++):(a[d]=rb(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&l++)}return i===o&&l===i?e:a}return t}function Lc(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Ov(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ep(e){if(!Nv(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Nv(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Nv(e){return Object.prototype.toString.call(e)==="[object Object]"}function O_(e){return new Promise(t=>{setTimeout(t,e)})}function tp(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?rb(e,t):t}function N_(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function D_(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var im=Symbol();function ib(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===im?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Li,Ur,Gs,Rx,I_=(Rx=class extends To{constructor(){super();pe(this,Li);pe(this,Ur);pe(this,Gs);le(this,Gs,t=>{if(!ns&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){_(this,Ur)||this.setEventListener(_(this,Gs))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,Ur))==null||t.call(this),le(this,Ur,void 0))}setEventListener(t){var n;le(this,Gs,t),(n=_(this,Ur))==null||n.call(this),le(this,Ur,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){_(this,Li)!==t&&(le(this,Li,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof _(this,Li)=="boolean"?_(this,Li):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Li=new WeakMap,Ur=new WeakMap,Gs=new WeakMap,Rx),sm=new I_,Ys,Hr,Qs,Px,L_=(Px=class extends To{constructor(){super();pe(this,Ys,!0);pe(this,Hr);pe(this,Qs);le(this,Qs,t=>{if(!ns&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){_(this,Hr)||this.setEventListener(_(this,Qs))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,Hr))==null||t.call(this),le(this,Hr,void 0))}setEventListener(t){var n;le(this,Qs,t),(n=_(this,Hr))==null||n.call(this),le(this,Hr,t(this.setOnline.bind(this)))}setOnline(t){_(this,Ys)!==t&&(le(this,Ys,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return _(this,Ys)}},Ys=new WeakMap,Hr=new WeakMap,Qs=new WeakMap,Px),Fc=new L_;function np(){let e,t;const n=new Promise((i,s)=>{e=i,t=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}function F_(e){return Math.min(1e3*2**e,3e4)}function sb(e){return(e??"online")==="online"?Fc.isOnline():!0}var ob=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Td(e){return e instanceof ob}function ab(e){let t=!1,n=0,r=!1,i;const s=np(),o=w=>{var x;r||(p(new ob(w)),(x=e.abort)==null||x.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>sm.isFocused()&&(e.networkMode==="always"||Fc.isOnline())&&e.canRun(),d=()=>sb(e.networkMode)&&e.canRun(),u=w=>{var x;r||(r=!0,(x=e.onSuccess)==null||x.call(e,w),i==null||i(),s.resolve(w))},p=w=>{var x;r||(r=!0,(x=e.onError)==null||x.call(e,w),i==null||i(),s.reject(w))},m=()=>new Promise(w=>{var x;i=h=>{(r||c())&&w(h)},(x=e.onPause)==null||x.call(e)}).then(()=>{var w;i=void 0,r||(w=e.onContinue)==null||w.call(e)}),y=()=>{if(r)return;let w;const x=n===0?e.initialPromise:void 0;try{w=x??e.fn()}catch(h){w=Promise.reject(h)}Promise.resolve(w).then(u).catch(h=>{var T;if(r)return;const g=e.retry??(ns?0:3),k=e.retryDelay??F_,C=typeof k=="function"?k(n,h):k,S=g===!0||typeof g=="number"&&n<g||typeof g=="function"&&g(n,h);if(t||!S){p(h);return}n++,(T=e.onFail)==null||T.call(e,n,h),O_(C).then(()=>c()?void 0:m()).then(()=>{t?p(h):y()})})};return{promise:s,cancel:o,continue:()=>(i==null||i(),s),cancelRetry:a,continueRetry:l,canStart:d,start:()=>(d()?y():m().then(y),s)}}function B_(){let e=[],t=0,n=a=>{a()},r=a=>{a()},i=a=>setTimeout(a,0);const s=a=>{t?e.push(a):i(()=>{n(a)})},o=()=>{const a=e;e=[],a.length&&i(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||o()}return l},batchCalls:a=>(...l)=>{s(()=>{a(...l)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{i=a}}}var ct=B_(),Fi,Mx,lb=(Mx=class{constructor(){pe(this,Fi)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Jf(this.gcTime)&&le(this,Fi,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ns?1/0:5*60*1e3))}clearGcTimeout(){_(this,Fi)&&(clearTimeout(_(this,Fi)),le(this,Fi,void 0))}},Fi=new WeakMap,Mx),Ks,Xs,gn,_t,Ya,Bi,Mn,hr,Ox,$_=(Ox=class extends lb{constructor(t){super();pe(this,Mn);pe(this,Ks);pe(this,Xs);pe(this,gn);pe(this,_t);pe(this,Ya);pe(this,Bi);le(this,Bi,!1),le(this,Ya,t.defaultOptions),this.setOptions(t.options),this.observers=[],le(this,gn,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,le(this,Ks,z_(this.options)),this.state=t.state??_(this,Ks),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=_(this,_t))==null?void 0:t.promise}setOptions(t){this.options={..._(this,Ya),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&_(this,gn).remove(this)}setData(t,n){const r=tp(this.state.data,t,this.options);return ke(this,Mn,hr).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){ke(this,Mn,hr).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=_(this,_t))==null?void 0:r.promise;return(i=_(this,_t))==null||i.cancel(t),n?n.then(vn).catch(vn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(_(this,Ks))}isActive(){return this.observers.some(t=>In(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===im||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!nb(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=_(this,_t))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=_(this,_t))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),_(this,gn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(_(this,_t)&&(_(this,Bi)?_(this,_t).cancel({revert:!0}):_(this,_t).cancelRetry()),this.scheduleGc()),_(this,gn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ke(this,Mn,hr).call(this,{type:"invalidate"})}fetch(t,n){var l,c,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(_(this,_t))return _(this,_t).continueRetry(),_(this,_t).promise}if(t&&this.setOptions(t),!this.options.queryFn){const u=this.observers.find(p=>p.options.queryFn);u&&this.setOptions(u.options)}const r=new AbortController,i=u=>{Object.defineProperty(u,"signal",{enumerable:!0,get:()=>(le(this,Bi,!0),r.signal)})},s=()=>{const u=ib(this.options,n),p={queryKey:this.queryKey,meta:this.meta};return i(p),le(this,Bi,!1),this.options.persister?this.options.persister(u,p,this):u(p)},o={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(o),(l=this.options.behavior)==null||l.onFetch(o,this),le(this,Xs,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=o.fetchOptions)==null?void 0:c.meta))&&ke(this,Mn,hr).call(this,{type:"fetch",meta:(d=o.fetchOptions)==null?void 0:d.meta});const a=u=>{var p,m,y,w;Td(u)&&u.silent||ke(this,Mn,hr).call(this,{type:"error",error:u}),Td(u)||((m=(p=_(this,gn).config).onError)==null||m.call(p,u,this),(w=(y=_(this,gn).config).onSettled)==null||w.call(y,this.state.data,u,this)),this.scheduleGc()};return le(this,_t,ab({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:u=>{var p,m,y,w;if(u===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(u)}catch(x){a(x);return}(m=(p=_(this,gn).config).onSuccess)==null||m.call(p,u,this),(w=(y=_(this,gn).config).onSettled)==null||w.call(y,u,this.state.error,this),this.scheduleGc()},onError:a,onFail:(u,p)=>{ke(this,Mn,hr).call(this,{type:"failed",failureCount:u,error:p})},onPause:()=>{ke(this,Mn,hr).call(this,{type:"pause"})},onContinue:()=>{ke(this,Mn,hr).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),_(this,_t).start()}},Ks=new WeakMap,Xs=new WeakMap,gn=new WeakMap,_t=new WeakMap,Ya=new WeakMap,Bi=new WeakMap,Mn=new WeakSet,hr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...cb(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return Td(i)&&i.revert&&_(this,Xs)?{..._(this,Xs),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),ct.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),_(this,gn).notify({query:this,type:"updated",action:t})})},Ox);function cb(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:sb(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function z_(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Qn,Nx,V_=(Nx=class extends To{constructor(t={}){super();pe(this,Qn);this.config=t,le(this,Qn,new Map)}build(t,n,r){const i=n.queryKey,s=n.queryHash??rm(i,n);let o=this.get(s);return o||(o=new $_({cache:this,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){_(this,Qn).has(t.queryHash)||(_(this,Qn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=_(this,Qn).get(t.queryHash);n&&(t.destroy(),n===t&&_(this,Qn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ct.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return _(this,Qn).get(t)}getAll(){return[..._(this,Qn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Pv(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Pv(t,r)):n}notify(t){ct.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){ct.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ct.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Qn=new WeakMap,Nx),Kn,Mt,$i,Xn,Ir,Dx,U_=(Dx=class extends lb{constructor(t){super();pe(this,Xn);pe(this,Kn);pe(this,Mt);pe(this,$i);this.mutationId=t.mutationId,le(this,Mt,t.mutationCache),le(this,Kn,[]),this.state=t.state||ub(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){_(this,Kn).includes(t)||(_(this,Kn).push(t),this.clearGcTimeout(),_(this,Mt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){le(this,Kn,_(this,Kn).filter(n=>n!==t)),this.scheduleGc(),_(this,Mt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){_(this,Kn).length||(this.state.status==="pending"?this.scheduleGc():_(this,Mt).remove(this))}continue(){var t;return((t=_(this,$i))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,s,o,a,l,c,d,u,p,m,y,w,x,h,g,k,C,S,T,j;le(this,$i,ab({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(E,A)=>{ke(this,Xn,Ir).call(this,{type:"failed",failureCount:E,error:A})},onPause:()=>{ke(this,Xn,Ir).call(this,{type:"pause"})},onContinue:()=>{ke(this,Xn,Ir).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>_(this,Mt).canRun(this)}));const n=this.state.status==="pending",r=!_(this,$i).canStart();try{if(!n){ke(this,Xn,Ir).call(this,{type:"pending",variables:t,isPaused:r}),await((s=(i=_(this,Mt).config).onMutate)==null?void 0:s.call(i,t,this));const A=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,t));A!==this.state.context&&ke(this,Xn,Ir).call(this,{type:"pending",context:A,variables:t,isPaused:r})}const E=await _(this,$i).start();return await((c=(l=_(this,Mt).config).onSuccess)==null?void 0:c.call(l,E,t,this.state.context,this)),await((u=(d=this.options).onSuccess)==null?void 0:u.call(d,E,t,this.state.context)),await((m=(p=_(this,Mt).config).onSettled)==null?void 0:m.call(p,E,null,this.state.variables,this.state.context,this)),await((w=(y=this.options).onSettled)==null?void 0:w.call(y,E,null,t,this.state.context)),ke(this,Xn,Ir).call(this,{type:"success",data:E}),E}catch(E){try{throw await((h=(x=_(this,Mt).config).onError)==null?void 0:h.call(x,E,t,this.state.context,this)),await((k=(g=this.options).onError)==null?void 0:k.call(g,E,t,this.state.context)),await((S=(C=_(this,Mt).config).onSettled)==null?void 0:S.call(C,void 0,E,this.state.variables,this.state.context,this)),await((j=(T=this.options).onSettled)==null?void 0:j.call(T,void 0,E,t,this.state.context)),E}finally{ke(this,Xn,Ir).call(this,{type:"error",error:E})}}finally{_(this,Mt).runNext(this)}}},Kn=new WeakMap,Mt=new WeakMap,$i=new WeakMap,Xn=new WeakSet,Ir=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),ct.batch(()=>{_(this,Kn).forEach(r=>{r.onMutationUpdate(t)}),_(this,Mt).notify({mutation:this,type:"updated",action:t})})},Dx);function ub(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Zt,Qa,Ix,H_=(Ix=class extends To{constructor(t={}){super();pe(this,Zt);pe(this,Qa);this.config=t,le(this,Zt,new Map),le(this,Qa,Date.now())}build(t,n,r){const i=new U_({mutationCache:this,mutationId:++pl(this,Qa)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){const n=Pl(t),r=_(this,Zt).get(n)??[];r.push(t),_(this,Zt).set(n,r),this.notify({type:"added",mutation:t})}remove(t){var r;const n=Pl(t);if(_(this,Zt).has(n)){const i=(r=_(this,Zt).get(n))==null?void 0:r.filter(s=>s!==t);i&&(i.length===0?_(this,Zt).delete(n):_(this,Zt).set(n,i))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=(r=_(this,Zt).get(Pl(t)))==null?void 0:r.find(i=>i.state.status==="pending");return!n||n===t}runNext(t){var r;const n=(r=_(this,Zt).get(Pl(t)))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){ct.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[..._(this,Zt).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Mv(n,r))}findAll(t={}){return this.getAll().filter(n=>Mv(t,n))}notify(t){ct.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return ct.batch(()=>Promise.all(t.map(n=>n.continue().catch(vn))))}},Zt=new WeakMap,Qa=new WeakMap,Ix);function Pl(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function Dv(e){return{onFetch:(t,n)=>{var d,u,p,m,y;const r=t.options,i=(p=(u=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:u.fetchMore)==null?void 0:p.direction,s=((m=t.state.data)==null?void 0:m.pages)||[],o=((y=t.state.data)==null?void 0:y.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let w=!1;const x=k=>{Object.defineProperty(k,"signal",{enumerable:!0,get:()=>(t.signal.aborted?w=!0:t.signal.addEventListener("abort",()=>{w=!0}),t.signal)})},h=ib(t.options,t.fetchOptions),g=async(k,C,S)=>{if(w)return Promise.reject();if(C==null&&k.pages.length)return Promise.resolve(k);const T={queryKey:t.queryKey,pageParam:C,direction:S?"backward":"forward",meta:t.options.meta};x(T);const j=await h(T),{maxPages:E}=t.options,A=S?D_:N_;return{pages:A(k.pages,j,E),pageParams:A(k.pageParams,C,E)}};if(i&&s.length){const k=i==="backward",C=k?W_:Iv,S={pages:s,pageParams:o},T=C(r,S);a=await g(S,T,k)}else{const k=e??s.length;do{const C=l===0?o[0]??r.initialPageParam:Iv(r,a);if(l>0&&C==null)break;a=await g(a,C),l++}while(l<k)}return a};t.options.persister?t.fetchFn=()=>{var w,x;return(x=(w=t.options).persister)==null?void 0:x.call(w,c,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function Iv(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function W_(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Ke,Wr,qr,Zs,Js,Gr,eo,to,Lx,q_=(Lx=class{constructor(e={}){pe(this,Ke);pe(this,Wr);pe(this,qr);pe(this,Zs);pe(this,Js);pe(this,Gr);pe(this,eo);pe(this,to);le(this,Ke,e.queryCache||new V_),le(this,Wr,e.mutationCache||new H_),le(this,qr,e.defaultOptions||{}),le(this,Zs,new Map),le(this,Js,new Map),le(this,Gr,0)}mount(){pl(this,Gr)._++,_(this,Gr)===1&&(le(this,eo,sm.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,Ke).onFocus())})),le(this,to,Fc.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,Ke).onOnline())})))}unmount(){var e,t;pl(this,Gr)._--,_(this,Gr)===0&&((e=_(this,eo))==null||e.call(this),le(this,eo,void 0),(t=_(this,to))==null||t.call(this),le(this,to,void 0))}isFetching(e){return _(this,Ke).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return _(this,Wr).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=_(this,Ke).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);if(t===void 0)return this.fetchQuery(e);{const n=this.defaultQueryOptions(e),r=_(this,Ke).build(this,n);return e.revalidateIfStale&&r.isStaleByTime(qs(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return _(this,Ke).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=_(this,Ke).get(r.queryHash),s=i==null?void 0:i.state.data,o=M_(t,s);if(o!==void 0)return _(this,Ke).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return ct.batch(()=>_(this,Ke).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=_(this,Ke).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=_(this,Ke);ct.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=_(this,Ke),r={type:"active",...e};return ct.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=ct.batch(()=>_(this,Ke).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(vn).catch(vn)}invalidateQueries(e,t={}){return ct.batch(()=>{if(_(this,Ke).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none")return Promise.resolve();const n={...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"};return this.refetchQueries(n,t)})}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=ct.batch(()=>_(this,Ke).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(vn)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(vn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=_(this,Ke).build(this,t);return n.isStaleByTime(qs(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(vn).catch(vn)}fetchInfiniteQuery(e){return e.behavior=Dv(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(vn).catch(vn)}ensureInfiniteQueryData(e){return e.behavior=Dv(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Fc.isOnline()?_(this,Wr).resumePausedMutations():Promise.resolve()}getQueryCache(){return _(this,Ke)}getMutationCache(){return _(this,Wr)}getDefaultOptions(){return _(this,qr)}setDefaultOptions(e){le(this,qr,e)}setQueryDefaults(e,t){_(this,Zs).set(rs(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[..._(this,Zs).values()],n={};return t.forEach(r=>{Oa(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){_(this,Js).set(rs(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[..._(this,Js).values()];let n={};return t.forEach(r=>{Oa(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={..._(this,qr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=rm(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.enabled!==!0&&t.queryFn===im&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{..._(this,qr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){_(this,Ke).clear(),_(this,Wr).clear()}},Ke=new WeakMap,Wr=new WeakMap,qr=new WeakMap,Zs=new WeakMap,Js=new WeakMap,Gr=new WeakMap,eo=new WeakMap,to=new WeakMap,Lx),zt,_e,Ka,Ot,zi,no,Yr,Zn,Xa,ro,io,Vi,Ui,Qr,so,Ae,Yo,rp,ip,sp,op,ap,lp,cp,db,Fx,G_=(Fx=class extends To{constructor(t,n){super();pe(this,Ae);pe(this,zt);pe(this,_e);pe(this,Ka);pe(this,Ot);pe(this,zi);pe(this,no);pe(this,Yr);pe(this,Zn);pe(this,Xa);pe(this,ro);pe(this,io);pe(this,Vi);pe(this,Ui);pe(this,Qr);pe(this,so,new Set);this.options=n,le(this,zt,t),le(this,Zn,null),le(this,Yr,np()),this.options.experimental_prefetchInRender||_(this,Yr).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(_(this,_e).addObserver(this),Lv(_(this,_e),this.options)?ke(this,Ae,Yo).call(this):this.updateResult(),ke(this,Ae,op).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return up(_(this,_e),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return up(_(this,_e),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ke(this,Ae,ap).call(this),ke(this,Ae,lp).call(this),_(this,_e).removeObserver(this)}setOptions(t,n){const r=this.options,i=_(this,_e);if(this.options=_(this,zt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof In(this.options.enabled,_(this,_e))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ke(this,Ae,cp).call(this),_(this,_e).setOptions(this.options),r._defaulted&&!Lc(this.options,r)&&_(this,zt).getQueryCache().notify({type:"observerOptionsUpdated",query:_(this,_e),observer:this});const s=this.hasListeners();s&&Fv(_(this,_e),i,this.options,r)&&ke(this,Ae,Yo).call(this),this.updateResult(n),s&&(_(this,_e)!==i||In(this.options.enabled,_(this,_e))!==In(r.enabled,_(this,_e))||qs(this.options.staleTime,_(this,_e))!==qs(r.staleTime,_(this,_e)))&&ke(this,Ae,rp).call(this);const o=ke(this,Ae,ip).call(this);s&&(_(this,_e)!==i||In(this.options.enabled,_(this,_e))!==In(r.enabled,_(this,_e))||o!==_(this,Qr))&&ke(this,Ae,sp).call(this,o)}getOptimisticResult(t){const n=_(this,zt).getQueryCache().build(_(this,zt),t),r=this.createResult(n,t);return Q_(this,r)&&(le(this,Ot,r),le(this,no,this.options),le(this,zi,_(this,_e).state)),r}getCurrentResult(){return _(this,Ot)}trackResult(t,n){const r={};return Object.keys(t).forEach(i=>{Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),n==null||n(i),t[i])})}),r}trackProp(t){_(this,so).add(t)}getCurrentQuery(){return _(this,_e)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=_(this,zt).defaultQueryOptions(t),r=_(this,zt).getQueryCache().build(_(this,zt),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return ke(this,Ae,Yo).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),_(this,Ot)))}createResult(t,n){var E;const r=_(this,_e),i=this.options,s=_(this,Ot),o=_(this,zi),a=_(this,no),c=t!==r?t.state:_(this,Ka),{state:d}=t;let u={...d},p=!1,m;if(n._optimisticResults){const A=this.hasListeners(),I=!A&&Lv(t,n),N=A&&Fv(t,r,n,i);(I||N)&&(u={...u,...cb(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:y,errorUpdatedAt:w,status:x}=u;if(n.select&&u.data!==void 0)if(s&&u.data===(o==null?void 0:o.data)&&n.select===_(this,Xa))m=_(this,ro);else try{le(this,Xa,n.select),m=n.select(u.data),m=tp(s==null?void 0:s.data,m,n),le(this,ro,m),le(this,Zn,null)}catch(A){le(this,Zn,A)}else m=u.data;if(n.placeholderData!==void 0&&m===void 0&&x==="pending"){let A;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))A=s.data;else if(A=typeof n.placeholderData=="function"?n.placeholderData((E=_(this,io))==null?void 0:E.state.data,_(this,io)):n.placeholderData,n.select&&A!==void 0)try{A=n.select(A),le(this,Zn,null)}catch(I){le(this,Zn,I)}A!==void 0&&(x="success",m=tp(s==null?void 0:s.data,A,n),p=!0)}_(this,Zn)&&(y=_(this,Zn),m=_(this,ro),w=Date.now(),x="error");const h=u.fetchStatus==="fetching",g=x==="pending",k=x==="error",C=g&&h,S=m!==void 0,j={status:x,fetchStatus:u.fetchStatus,isPending:g,isSuccess:x==="success",isError:k,isInitialLoading:C,isLoading:C,data:m,dataUpdatedAt:u.dataUpdatedAt,error:y,errorUpdatedAt:w,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:h,isRefetching:h&&!g,isLoadingError:k&&!S,isPaused:u.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:k&&S,isStale:om(t,n),refetch:this.refetch,promise:_(this,Yr)};if(this.options.experimental_prefetchInRender){const A=D=>{j.status==="error"?D.reject(j.error):j.data!==void 0&&D.resolve(j.data)},I=()=>{const D=le(this,Yr,j.promise=np());A(D)},N=_(this,Yr);switch(N.status){case"pending":t.queryHash===r.queryHash&&A(N);break;case"fulfilled":(j.status==="error"||j.data!==N.value)&&I();break;case"rejected":(j.status!=="error"||j.error!==N.reason)&&I();break}}return j}updateResult(t){const n=_(this,Ot),r=this.createResult(_(this,_e),this.options);if(le(this,zi,_(this,_e).state),le(this,no,this.options),_(this,zi).data!==void 0&&le(this,io,_(this,_e)),Lc(r,n))return;le(this,Ot,r);const i={},s=()=>{if(!n)return!0;const{notifyOnChangeProps:o}=this.options,a=typeof o=="function"?o():o;if(a==="all"||!a&&!_(this,so).size)return!0;const l=new Set(a??_(this,so));return this.options.throwOnError&&l.add("error"),Object.keys(_(this,Ot)).some(c=>{const d=c;return _(this,Ot)[d]!==n[d]&&l.has(d)})};(t==null?void 0:t.listeners)!==!1&&s()&&(i.listeners=!0),ke(this,Ae,db).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ke(this,Ae,op).call(this)}},zt=new WeakMap,_e=new WeakMap,Ka=new WeakMap,Ot=new WeakMap,zi=new WeakMap,no=new WeakMap,Yr=new WeakMap,Zn=new WeakMap,Xa=new WeakMap,ro=new WeakMap,io=new WeakMap,Vi=new WeakMap,Ui=new WeakMap,Qr=new WeakMap,so=new WeakMap,Ae=new WeakSet,Yo=function(t){ke(this,Ae,cp).call(this);let n=_(this,_e).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(vn)),n},rp=function(){ke(this,Ae,ap).call(this);const t=qs(this.options.staleTime,_(this,_e));if(ns||_(this,Ot).isStale||!Jf(t))return;const r=nb(_(this,Ot).dataUpdatedAt,t)+1;le(this,Vi,setTimeout(()=>{_(this,Ot).isStale||this.updateResult()},r))},ip=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(_(this,_e)):this.options.refetchInterval)??!1},sp=function(t){ke(this,Ae,lp).call(this),le(this,Qr,t),!(ns||In(this.options.enabled,_(this,_e))===!1||!Jf(_(this,Qr))||_(this,Qr)===0)&&le(this,Ui,setInterval(()=>{(this.options.refetchIntervalInBackground||sm.isFocused())&&ke(this,Ae,Yo).call(this)},_(this,Qr)))},op=function(){ke(this,Ae,rp).call(this),ke(this,Ae,sp).call(this,ke(this,Ae,ip).call(this))},ap=function(){_(this,Vi)&&(clearTimeout(_(this,Vi)),le(this,Vi,void 0))},lp=function(){_(this,Ui)&&(clearInterval(_(this,Ui)),le(this,Ui,void 0))},cp=function(){const t=_(this,zt).getQueryCache().build(_(this,zt),this.options);if(t===_(this,_e))return;const n=_(this,_e);le(this,_e,t),le(this,Ka,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},db=function(t){ct.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(_(this,Ot))}),_(this,zt).getQueryCache().notify({query:_(this,_e),type:"observerResultsUpdated"})})},Fx);function Y_(e,t){return In(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Lv(e,t){return Y_(e,t)||e.state.data!==void 0&&up(e,t,t.refetchOnMount)}function up(e,t,n){if(In(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&om(e,t)}return!1}function Fv(e,t,n,r){return(e!==t||In(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&om(e,n)}function om(e,t){return In(t.enabled,e)!==!1&&e.isStaleByTime(qs(t.staleTime,e))}function Q_(e,t){return!Lc(e.getCurrentResult(),t)}var Kr,Xr,Vt,xr,Sr,nc,dp,Bx,K_=(Bx=class extends To{constructor(t,n){super();pe(this,Sr);pe(this,Kr);pe(this,Xr);pe(this,Vt);pe(this,xr);le(this,Kr,t),this.setOptions(n),this.bindMethods(),ke(this,Sr,nc).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const n=this.options;this.options=_(this,Kr).defaultMutationOptions(t),Lc(this.options,n)||_(this,Kr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:_(this,Vt),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&rs(n.mutationKey)!==rs(this.options.mutationKey)?this.reset():((r=_(this,Vt))==null?void 0:r.state.status)==="pending"&&_(this,Vt).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=_(this,Vt))==null||t.removeObserver(this)}onMutationUpdate(t){ke(this,Sr,nc).call(this),ke(this,Sr,dp).call(this,t)}getCurrentResult(){return _(this,Xr)}reset(){var t;(t=_(this,Vt))==null||t.removeObserver(this),le(this,Vt,void 0),ke(this,Sr,nc).call(this),ke(this,Sr,dp).call(this)}mutate(t,n){var r;return le(this,xr,n),(r=_(this,Vt))==null||r.removeObserver(this),le(this,Vt,_(this,Kr).getMutationCache().build(_(this,Kr),this.options)),_(this,Vt).addObserver(this),_(this,Vt).execute(t)}},Kr=new WeakMap,Xr=new WeakMap,Vt=new WeakMap,xr=new WeakMap,Sr=new WeakSet,nc=function(){var n;const t=((n=_(this,Vt))==null?void 0:n.state)??ub();le(this,Xr,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},dp=function(t){ct.batch(()=>{var n,r,i,s,o,a,l,c;if(_(this,xr)&&this.hasListeners()){const d=_(this,Xr).variables,u=_(this,Xr).context;(t==null?void 0:t.type)==="success"?((r=(n=_(this,xr)).onSuccess)==null||r.call(n,t.data,d,u),(s=(i=_(this,xr)).onSettled)==null||s.call(i,t.data,null,d,u)):(t==null?void 0:t.type)==="error"&&((a=(o=_(this,xr)).onError)==null||a.call(o,t.error,d,u),(c=(l=_(this,xr)).onSettled)==null||c.call(l,void 0,t.error,d,u))}this.listeners.forEach(d=>{d(_(this,Xr))})})},Bx),fb=v.createContext(void 0),pb=e=>{const t=v.useContext(fb);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},X_=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),f.jsx(fb.Provider,{value:e,children:t})),hb=v.createContext(!1),Z_=()=>v.useContext(hb);hb.Provider;function J_(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var eE=v.createContext(J_()),tE=()=>v.useContext(eE);function mb(e,t){return typeof e=="function"?e(...t):!!e}function fp(){}var nE=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},rE=e=>{v.useEffect(()=>{e.clearReset()},[e])},iE=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&mb(n,[e.error,r]),sE=e=>{e.suspense&&(e.staleTime===void 0&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},oE=(e,t)=>e.isLoading&&e.isFetching&&!t,aE=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Bv=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function lE(e,t,n){var d,u,p,m,y;const r=pb(),i=Z_(),s=tE(),o=r.defaultQueryOptions(e);(u=(d=r.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||u.call(d,o),o._optimisticResults=i?"isRestoring":"optimistic",sE(o),nE(o,s),rE(s);const a=!r.getQueryCache().get(o.queryHash),[l]=v.useState(()=>new t(r,o)),c=l.getOptimisticResult(o);if(v.useSyncExternalStore(v.useCallback(w=>{const x=i?fp:l.subscribe(ct.batchCalls(w));return l.updateResult(),x},[l,i]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),v.useEffect(()=>{l.setOptions(o,{listeners:!1})},[o,l]),aE(o,c))throw Bv(o,l,s);if(iE({result:c,errorResetBoundary:s,throwOnError:o.throwOnError,query:r.getQueryCache().get(o.queryHash)}))throw c.error;if((m=(p=r.getDefaultOptions().queries)==null?void 0:p._experimental_afterQuery)==null||m.call(p,o,c),o.experimental_prefetchInRender&&!ns&&oE(c,i)){const w=a?Bv(o,l,s):(y=r.getQueryCache().get(o.queryHash))==null?void 0:y.promise;w==null||w.catch(fp).finally(()=>{l.updateResult()})}return o.notifyOnChangeProps?c:l.trackResult(c)}function gb(e,t){return lE(e,G_)}function am(e,t){const n=pb(),[r]=v.useState(()=>new K_(n,e));v.useEffect(()=>{r.setOptions(e)},[r,e]);const i=v.useSyncExternalStore(v.useCallback(o=>r.subscribe(ct.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=v.useCallback((o,a)=>{r.mutate(o,a).catch(fp)},[r]);if(i.error&&mb(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}const cE=(e,t)=>gb({queryKey:["widgets",e,t],queryFn:()=>uE(e,t),retry:!1,throwOnError:!1}),uE=async(e,t)=>{const n=`widgets/with-link/${e}${t?`?device_id=${t}`:""}`,[r,i]=await Mr(n);if(i===204)throw new Error("User is banned");return r};var b=(e=>(e.Border="widget_border",e.Background="widget_background",e.InputBackground="widget_input_background",e.InputText="widget_input_text",e.InputBorder="widget_input_border",e.ButtonBackground="widget_button_background",e.ButtonText="widget_button_text",e.TooltipBackground="widget_tooltip_background",e.TooltipText="widget_tooltip_text",e.TooltipBorder="widget_tooltip_border",e.HeaderBackground="widget_header_background",e.HeaderText="widget_header_text",e.HeaderBorder="widget_header_border",e.FooterBackground="widget_footer_background",e.FooterText="widget_footer_text",e.FooterBorder="widget_footer_border",e.MessageAdminBackground="widget_message_admin_background",e.MessageAdminText="widget_message_admin_text",e.MessageVisitorBackground="widget_message_visitor_background",e.MessageVisitorText="widget_message_visitor_text",e.MessageAgentBackground="widget_message_agent_background",e.MessageAgentText="widget_message_agent_text",e.GreeterTopBackground="widget_greeter_top_background",e.GreeterTopText="widget_greeter_top_text",e.GreeterBackground="widget_greeter_background",e.GreeterText="widget_greeter_text",e.GreeterBorder="widget_greeter_border",e.GreeterButtonBackground="widget_greeter_button_background",e.GreeterButtonText="widget_greeter_button_text",e.CloseButtonBackground="widget_close_button_background",e.CloseButtonText="widget_close_button_text",e.CloseButtonHover="widget_close_button_hover",e.IconColor="widget_icon_color",e.IconBackground="widget_icon_background",e.ErrorBackground="widget_error_background",e.ErrorText="widget_error_text",e.ErrorBorder="widget_error_border",e.SuccessBackground="widget_success_background",e.SuccessText="widget_success_text",e.SuccessBorder="widget_success_border",e.WarningBackground="widget_warning_background",e.WarningText="widget_warning_text",e.WarningBorder="widget_warning_border",e.LinkColor="widget_link_color",e.LinkHoverColor="widget_link_hover_color",e.DividerColor="widget_divider_color",e.ShadowColor="widget_shadow_color",e.StarActiveColor="widget_star_active_color",e.StarInactiveColor="widget_star_inactive_color",e.ModalOverlayColor="widget_modal_overlay_color",e.ChatCloseConfirmText="widget_chat_close_confirm_text",e.RatingHeaderBackground="widget_rating_header_background",e.RatingHeaderText="widget_rating_header_text",e.RatingSuccessBackground="widget_rating_success_background",e.RatingSuccessText="widget_rating_success_text",e.RatingRateConversationText="widget_rating_rate_conversation_text",e))(b||{}),re=(e=>(e.TooltipDefault="tooltip_default",e.TooltipActive="tooltip_active",e.CloseButtonAria="close_button_aria",e.MessagePlaceholder="message_placeholder",e.FileUploadDisabled="file_upload_disabled",e.NewMessagesNotification="new_messages_notification",e.ChatCloseConfirm="chat_close_confirm",e.ChatCloseWarning="chat_close_warning",e.ChatSettings="chat_settings",e.ChatEndConversation="chat_end_conversation",e.CancelAction="cancel_action",e.CloseAction="close_action",e.QuickActions="quick_actions",e.GreetingStartChat="greeting_start_chat",e.RateLimitMessage="rate_limit_message",e.RatingHeaderEvaluate="rating_header_evaluate",e.RatingHeaderThanks="rating_header_thanks",e.RatingDescription="rating_description",e.RatingRateConversation="rating_rate_conversation",e.RatingComment="rating_comment",e.RatingCommentPlaceholder="rating_comment_placeholder",e.RatingSubmit="rating_submit",e.RatingNewConversation="rating_new_conversation",e.RatingThankYouTitle="rating_thank_you_title",e.RatingThankYouDescription="rating_thank_you_description",e.RatingCountdown="rating_countdown",e.RatingMinimumError="rating_minimum_error",e.RatingYourScore="rating_your_score",e.PoweredBy="powered_by",e.NotificationSoundOn="notification_sound_on",e.NotificationSoundOff="notification_sound_off",e))(re||{}),Ne=(e=>(e.Light="light",e.Dark="dark",e.System="system",e))(Ne||{});function dE(e){return!!e&&typeof e.public_id=="string"&&typeof e.link_id=="string"&&typeof e.name=="string"&&typeof e.is_browser_notification_enabled=="boolean"&&typeof e.is_hidden_on_offline=="boolean"&&typeof e.is_upload_disabled=="boolean"}/**
|
|
40
|
+
`+s.stack}return{value:e,source:t,stack:i,digest:null}}function Td(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Wf(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var rT=typeof WeakMap=="function"?WeakMap:Map;function Lw(e,t,n){n=kr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Fc||(Fc=!0,tp=r),Wf(e,t)},n}function Fw(e,t,n){n=kr(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Wf(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Wf(e,t),typeof r!="function"&&(ai===null?ai=new Set([this]):ai.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function wv(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new rT;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=vT.bind(null,e,t,n),t.then(e,e))}function bv(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function kv(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=kr(-1,1),t.tag=2,oi(n,t,1))),n.lanes|=1),e)}var iT=Mr.ReactCurrentOwner,qt=!1;function Ot(e,t,n,r){t.child=e===null?pw(t,null,n,r):ho(t,e.child,n,r)}function Sv(e,t,n,r,i){n=n.render;var s=t.ref;return qs(t,i),r=Yh(e,t,n,r,s,i),n=Qh(),e!==null&&!qt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Er(e,t,i)):(We&&n&&Ih(t),t.flags|=1,Ot(e,t,r,i),t.child)}function Cv(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!sm(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,$w(e,t,s,r,i)):(e=oc(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&i)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:Aa,n(o,r)&&e.ref===t.ref)return Er(e,t,i)}return t.flags|=1,e=ci(s,r),e.ref=t.ref,e.return=t,t.child=e}function $w(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(Aa(s,r)&&e.ref===t.ref)if(qt=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(qt=!0);else return t.lanes=e.lanes,Er(e,t,i)}return qf(e,t,n,r,i)}function Bw(e,t,n){var r=t.pendingProps,i=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},$e(Os,Jt),Jt|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,$e(Os,Jt),Jt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,$e(Os,Jt),Jt|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,$e(Os,Jt),Jt|=r;return Ot(e,t,i,n),t.child}function zw(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function qf(e,t,n,r,i){var s=Yt(n)?Zi:Pt.current;return s=fo(t,s),qs(t,i),n=Yh(e,t,n,r,s,i),r=Qh(),e!==null&&!qt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Er(e,t,i)):(We&&r&&Ih(t),t.flags|=1,Ot(e,t,n,i),t.child)}function _v(e,t,n,r,i){if(Yt(n)){var s=!0;Ac(t)}else s=!1;if(qs(t,i),t.stateNode===null)rc(e,t),Iw(t,n,r),Hf(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,c=n.contextType;typeof c=="object"&&c!==null?c=_n(c):(c=Yt(n)?Zi:Pt.current,c=fo(t,c));var d=n.getDerivedStateFromProps,u=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";u||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==c)&&xv(t,o,r,c),Br=!1;var p=t.memoizedState;o.state=p,Nc(t,r,o,i),l=t.memoizedState,a!==r||p!==l||Gt.current||Br?(typeof d=="function"&&(Uf(t,n,d,r),l=t.memoizedState),(a=Br||yv(t,n,a,r,p,l,c))?(u||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=c,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,mw(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:Mn(t.type,a),o.props=c,u=t.pendingProps,p=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=_n(l):(l=Yt(n)?Zi:Pt.current,l=fo(t,l));var h=n.getDerivedStateFromProps;(d=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==u||p!==l)&&xv(t,o,r,l),Br=!1,p=t.memoizedState,o.state=p,Nc(t,r,o,i);var y=t.memoizedState;a!==u||p!==y||Gt.current||Br?(typeof h=="function"&&(Uf(t,n,h,r),y=t.memoizedState),(c=Br||yv(t,n,c,r,p,y,l)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,y,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,y,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),o.props=r,o.state=y,o.context=l,r=c):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return Gf(e,t,n,r,s,i)}function Gf(e,t,n,r,i,s){zw(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&uv(t,n,!1),Er(e,t,s);r=t.stateNode,iT.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=ho(t,e.child,null,s),t.child=ho(t,null,a,s)):Ot(e,t,a,s),t.memoizedState=r.state,i&&uv(t,n,!0),t.child}function Vw(e){var t=e.stateNode;t.pendingContext?cv(e,t.pendingContext,t.pendingContext!==t.context):t.context&&cv(e,t.context,!1),Hh(e,t.containerInfo)}function Tv(e,t,n,r,i){return po(),Fh(i),t.flags|=256,Ot(e,t,n,r),t.child}var Yf={dehydrated:null,treeContext:null,retryLane:0};function Qf(e){return{baseLanes:e,cachePool:null,transitions:null}}function Uw(e,t,n){var r=t.pendingProps,i=Ge.current,s=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(i&2)!==0),a?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),$e(Ge,i&1),e===null)return zf(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,s?(r=t.mode,s=t.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=xu(o,r,0,null),e=Wi(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Qf(n),t.memoizedState=Yf,e):Zh(t,o));if(i=e.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return sT(e,t,o,r,a,i,n);if(s){s=r.fallback,o=t.mode,i=e.child,a=i.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=ci(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=ci(a,s):(s=Wi(s,o,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,o=e.child.memoizedState,o=o===null?Qf(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~n,t.memoizedState=Yf,r}return s=e.child,e=s.sibling,r=ci(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Zh(e,t){return t=xu({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Ml(e,t,n,r){return r!==null&&Fh(r),ho(t,e.child,null,n),e=Zh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function sT(e,t,n,r,i,s,o){if(n)return t.flags&256?(t.flags&=-257,r=Td(Error(X(422))),Ml(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=xu({mode:"visible",children:r.children},i,0,null),s=Wi(s,i,o,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&ho(t,e.child,null,o),t.child.memoizedState=Qf(o),t.memoizedState=Yf,s);if(!(t.mode&1))return Ml(e,t,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(X(419)),r=Td(s,r,void 0),Ml(e,t,o,r)}if(a=(o&e.childLanes)!==0,qt||a){if(r=ht,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=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:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,Tr(e,i),Bn(r,e,i,-1))}return im(),r=Td(Error(X(421))),Ml(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=yT.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,nn=si(i.nextSibling),on=t,We=!0,In=null,e!==null&&(xn[wn++]=wr,xn[wn++]=br,xn[wn++]=Ji,wr=e.id,br=e.overflow,Ji=t),t=Zh(t,r.children),t.flags|=4096,t)}function Ev(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Vf(e.return,t,n)}function Ed(e,t,n,r,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function Hw(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(Ot(e,t,r.children,n),r=Ge.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ev(e,n,t);else if(e.tag===19)Ev(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if($e(Ge,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Oc(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Ed(t,!1,i,n,s);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Oc(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Ed(t,!0,n,null,s);break;case"together":Ed(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function rc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Er(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ts|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(X(153));if(t.child!==null){for(e=t.child,n=ci(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ci(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function oT(e,t,n){switch(t.tag){case 3:Vw(t),po();break;case 5:gw(t);break;case 1:Yt(t.type)&&Ac(t);break;case 4:Hh(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;$e(Pc,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?($e(Ge,Ge.current&1),t.flags|=128,null):n&t.child.childLanes?Uw(e,t,n):($e(Ge,Ge.current&1),e=Er(e,t,n),e!==null?e.sibling:null);$e(Ge,Ge.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Hw(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),$e(Ge,Ge.current),r)break;return null;case 22:case 23:return t.lanes=0,Bw(e,t,n)}return Er(e,t,n)}var Ww,Kf,qw,Gw;Ww=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Kf=function(){};qw=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Ni(nr.current);var s=null;switch(n){case"input":i=yf(e,i),r=yf(e,r),s=[];break;case"select":i=Ke({},i,{value:void 0}),r=Ke({},r,{value:void 0}),s=[];break;case"textarea":i=bf(e,i),r=bf(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Tc)}Sf(n,r);var o;n=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var a=i[c];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(ba.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in r){var l=r[c];if(a=i!=null?i[c]:void 0,r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(s||(s=[]),s.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(ba.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&ze("scroll",e),s||a===l||(s=[])):(s=s||[]).push(c,l))}n&&(s=s||[]).push("style",n);var c=s;(t.updateQueue=c)&&(t.flags|=4)}};Gw=function(e,t,n,r){n!==r&&(t.flags|=4)};function Uo(e,t){if(!We)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function _t(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function aT(e,t,n){var r=t.pendingProps;switch(Lh(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return _t(t),null;case 1:return Yt(t.type)&&Ec(),_t(t),null;case 3:return r=t.stateNode,mo(),Ue(Gt),Ue(Pt),qh(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Rl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,In!==null&&(ip(In),In=null))),Kf(e,t),_t(t),null;case 5:Wh(t);var i=Ni(Na.current);if(n=t.type,e!==null&&t.stateNode!=null)qw(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(X(166));return _t(t),null}if(e=Ni(nr.current),Rl(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[er]=t,r[Pa]=s,e=(t.mode&1)!==0,n){case"dialog":ze("cancel",r),ze("close",r);break;case"iframe":case"object":case"embed":ze("load",r);break;case"video":case"audio":for(i=0;i<Zo.length;i++)ze(Zo[i],r);break;case"source":ze("error",r);break;case"img":case"image":case"link":ze("error",r),ze("load",r);break;case"details":ze("toggle",r);break;case"input":Ig(r,s),ze("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},ze("invalid",r);break;case"textarea":Fg(r,s),ze("invalid",r)}Sf(n,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&jl(r.textContent,a,e),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&jl(r.textContent,a,e),i=["children",""+a]):ba.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&ze("scroll",r)}switch(n){case"input":bl(r),Lg(r,s,!0);break;case"textarea":bl(r),$g(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=Tc)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=b1(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[er]=t,e[Pa]=r,Ww(e,t,!1,!1),t.stateNode=e;e:{switch(o=Cf(n,r),n){case"dialog":ze("cancel",e),ze("close",e),i=r;break;case"iframe":case"object":case"embed":ze("load",e),i=r;break;case"video":case"audio":for(i=0;i<Zo.length;i++)ze(Zo[i],e);i=r;break;case"source":ze("error",e),i=r;break;case"img":case"image":case"link":ze("error",e),ze("load",e),i=r;break;case"details":ze("toggle",e),i=r;break;case"input":Ig(e,r),i=yf(e,r),ze("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Ke({},r,{value:void 0}),ze("invalid",e);break;case"textarea":Fg(e,r),i=bf(e,r),ze("invalid",e);break;default:i=r}Sf(n,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?C1(e,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&k1(e,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&ka(e,l):typeof l=="number"&&ka(e,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(ba.hasOwnProperty(s)?l!=null&&s==="onScroll"&&ze("scroll",e):l!=null&&kh(e,s,l,o))}switch(n){case"input":bl(e),Lg(e,r,!1);break;case"textarea":bl(e),$g(e);break;case"option":r.value!=null&&e.setAttribute("value",""+fi(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?Vs(e,!!r.multiple,s,!1):r.defaultValue!=null&&Vs(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Tc)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return _t(t),null;case 6:if(e&&t.stateNode!=null)Gw(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(X(166));if(n=Ni(Na.current),Ni(nr.current),Rl(t)){if(r=t.stateNode,n=t.memoizedProps,r[er]=t,(s=r.nodeValue!==n)&&(e=on,e!==null))switch(e.tag){case 3:jl(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&jl(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[er]=t,t.stateNode=r}return _t(t),null;case 13:if(Ue(Ge),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(We&&nn!==null&&t.mode&1&&!(t.flags&128))dw(),po(),t.flags|=98560,s=!1;else if(s=Rl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(X(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(X(317));s[er]=t}else po(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;_t(t),s=!1}else In!==null&&(ip(In),In=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Ge.current&1?ut===0&&(ut=3):im())),t.updateQueue!==null&&(t.flags|=4),_t(t),null);case 4:return mo(),Kf(e,t),e===null&&ja(t.stateNode.containerInfo),_t(t),null;case 10:return zh(t.type._context),_t(t),null;case 17:return Yt(t.type)&&Ec(),_t(t),null;case 19:if(Ue(Ge),s=t.memoizedState,s===null)return _t(t),null;if(r=(t.flags&128)!==0,o=s.rendering,o===null)if(r)Uo(s,!1);else{if(ut!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Oc(e),o!==null){for(t.flags|=128,Uo(s,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,e=o.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return $e(Ge,Ge.current&1|2),t.child}e=e.sibling}s.tail!==null&&nt()>vo&&(t.flags|=128,r=!0,Uo(s,!1),t.lanes=4194304)}else{if(!r)if(e=Oc(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Uo(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!We)return _t(t),null}else 2*nt()-s.renderingStartTime>vo&&n!==1073741824&&(t.flags|=128,r=!0,Uo(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=nt(),t.sibling=null,n=Ge.current,$e(Ge,r?n&1|2:n&1),t):(_t(t),null);case 22:case 23:return rm(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Jt&1073741824&&(_t(t),t.subtreeFlags&6&&(t.flags|=8192)):_t(t),null;case 24:return null;case 25:return null}throw Error(X(156,t.tag))}function lT(e,t){switch(Lh(t),t.tag){case 1:return Yt(t.type)&&Ec(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return mo(),Ue(Gt),Ue(Pt),qh(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Wh(t),null;case 13:if(Ue(Ge),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(X(340));po()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ue(Ge),null;case 4:return mo(),null;case 10:return zh(t.type._context),null;case 22:case 23:return rm(),null;case 24:return null;default:return null}}var Nl=!1,At=!1,cT=typeof WeakSet=="function"?WeakSet:Set,ce=null;function Ns(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Je(e,t,r)}else n.current=null}function Xf(e,t,n){try{n()}catch(r){Je(e,t,r)}}var Av=!1;function uT(e,t){if(Of=Sc,e=Z1(),Dh(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,c=0,d=0,u=e,p=null;t:for(;;){for(var h;u!==n||i!==0&&u.nodeType!==3||(a=o+i),u!==s||r!==0&&u.nodeType!==3||(l=o+r),u.nodeType===3&&(o+=u.nodeValue.length),(h=u.firstChild)!==null;)p=u,u=h;for(;;){if(u===e)break t;if(p===n&&++c===i&&(a=o),p===s&&++d===r&&(l=o),(h=u.nextSibling)!==null)break;u=p,p=u.parentNode}u=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Df={focusedElem:e,selectionRange:n},Sc=!1,ce=t;ce!==null;)if(t=ce,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ce=e;else for(;ce!==null;){t=ce;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var w=y.memoizedProps,b=y.memoizedState,m=t.stateNode,v=m.getSnapshotBeforeUpdate(t.elementType===t.type?w:Mn(t.type,w),b);m.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(X(163))}}catch(S){Je(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,ce=e;break}ce=t.return}return y=Av,Av=!1,y}function da(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&Xf(t,n,s)}i=i.next}while(i!==r)}}function vu(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Zf(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Yw(e){var t=e.alternate;t!==null&&(e.alternate=null,Yw(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[er],delete t[Pa],delete t[Ff],delete t[q_],delete t[G_])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Qw(e){return e.tag===5||e.tag===3||e.tag===4}function jv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Qw(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Jf(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Tc));else if(r!==4&&(e=e.child,e!==null))for(Jf(e,t,n),e=e.sibling;e!==null;)Jf(e,t,n),e=e.sibling}function ep(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(ep(e,t,n),e=e.sibling;e!==null;)ep(e,t,n),e=e.sibling}var xt=null,On=!1;function Ir(e,t,n){for(n=n.child;n!==null;)Kw(e,t,n),n=n.sibling}function Kw(e,t,n){if(tr&&typeof tr.onCommitFiberUnmount=="function")try{tr.onCommitFiberUnmount(cu,n)}catch{}switch(n.tag){case 5:At||Ns(n,t);case 6:var r=xt,i=On;xt=null,Ir(e,t,n),xt=r,On=i,xt!==null&&(On?(e=xt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):xt.removeChild(n.stateNode));break;case 18:xt!==null&&(On?(e=xt,n=n.stateNode,e.nodeType===8?wd(e.parentNode,n):e.nodeType===1&&wd(e,n),Ta(e)):wd(xt,n.stateNode));break;case 4:r=xt,i=On,xt=n.stateNode.containerInfo,On=!0,Ir(e,t,n),xt=r,On=i;break;case 0:case 11:case 14:case 15:if(!At&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Xf(n,t,o),i=i.next}while(i!==r)}Ir(e,t,n);break;case 1:if(!At&&(Ns(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Je(n,t,a)}Ir(e,t,n);break;case 21:Ir(e,t,n);break;case 22:n.mode&1?(At=(r=At)||n.memoizedState!==null,Ir(e,t,n),At=r):Ir(e,t,n);break;default:Ir(e,t,n)}}function Rv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new cT),t.forEach(function(r){var i=xT.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function jn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:xt=a.stateNode,On=!1;break e;case 3:xt=a.stateNode.containerInfo,On=!0;break e;case 4:xt=a.stateNode.containerInfo,On=!0;break e}a=a.return}if(xt===null)throw Error(X(160));Kw(s,o,i),xt=null,On=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(c){Je(i,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Xw(t,e),t=t.sibling}function Xw(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(jn(t,e),Wn(e),r&4){try{da(3,e,e.return),vu(3,e)}catch(w){Je(e,e.return,w)}try{da(5,e,e.return)}catch(w){Je(e,e.return,w)}}break;case 1:jn(t,e),Wn(e),r&512&&n!==null&&Ns(n,n.return);break;case 5:if(jn(t,e),Wn(e),r&512&&n!==null&&Ns(n,n.return),e.flags&32){var i=e.stateNode;try{ka(i,"")}catch(w){Je(e,e.return,w)}}if(r&4&&(i=e.stateNode,i!=null)){var s=e.memoizedProps,o=n!==null?n.memoizedProps:s,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&x1(i,s),Cf(a,o);var c=Cf(a,s);for(o=0;o<l.length;o+=2){var d=l[o],u=l[o+1];d==="style"?C1(i,u):d==="dangerouslySetInnerHTML"?k1(i,u):d==="children"?ka(i,u):kh(i,d,u,c)}switch(a){case"input":xf(i,s);break;case"textarea":w1(i,s);break;case"select":var p=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var h=s.value;h!=null?Vs(i,!!s.multiple,h,!1):p!==!!s.multiple&&(s.defaultValue!=null?Vs(i,!!s.multiple,s.defaultValue,!0):Vs(i,!!s.multiple,s.multiple?[]:"",!1))}i[Pa]=s}catch(w){Je(e,e.return,w)}}break;case 6:if(jn(t,e),Wn(e),r&4){if(e.stateNode===null)throw Error(X(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(w){Je(e,e.return,w)}}break;case 3:if(jn(t,e),Wn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ta(t.containerInfo)}catch(w){Je(e,e.return,w)}break;case 4:jn(t,e),Wn(e);break;case 13:jn(t,e),Wn(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(tm=nt())),r&4&&Rv(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(At=(c=At)||d,jn(t,e),At=c):jn(t,e),Wn(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!d&&e.mode&1)for(ce=e,d=e.child;d!==null;){for(u=ce=d;ce!==null;){switch(p=ce,h=p.child,p.tag){case 0:case 11:case 14:case 15:da(4,p,p.return);break;case 1:Ns(p,p.return);var y=p.stateNode;if(typeof y.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(w){Je(r,n,w)}}break;case 5:Ns(p,p.return);break;case 22:if(p.memoizedState!==null){Mv(u);continue}}h!==null?(h.return=p,ce=h):Mv(u)}d=d.sibling}e:for(d=null,u=e;;){if(u.tag===5){if(d===null){d=u;try{i=u.stateNode,c?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=u.stateNode,l=u.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=S1("display",o))}catch(w){Je(e,e.return,w)}}}else if(u.tag===6){if(d===null)try{u.stateNode.nodeValue=c?"":u.memoizedProps}catch(w){Je(e,e.return,w)}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===e)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===e)break e;for(;u.sibling===null;){if(u.return===null||u.return===e)break e;d===u&&(d=null),u=u.return}d===u&&(d=null),u.sibling.return=u.return,u=u.sibling}}break;case 19:jn(t,e),Wn(e),r&4&&Rv(e);break;case 21:break;default:jn(t,e),Wn(e)}}function Wn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Qw(n)){var r=n;break e}n=n.return}throw Error(X(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(ka(i,""),r.flags&=-33);var s=jv(e);ep(e,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,a=jv(e);Jf(e,a,o);break;default:throw Error(X(161))}}catch(l){Je(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function dT(e,t,n){ce=e,Zw(e)}function Zw(e,t,n){for(var r=(e.mode&1)!==0;ce!==null;){var i=ce,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||Nl;if(!o){var a=i.alternate,l=a!==null&&a.memoizedState!==null||At;a=Nl;var c=At;if(Nl=o,(At=l)&&!c)for(ce=i;ce!==null;)o=ce,l=o.child,o.tag===22&&o.memoizedState!==null?Nv(i):l!==null?(l.return=o,ce=l):Nv(i);for(;s!==null;)ce=s,Zw(s),s=s.sibling;ce=i,Nl=a,At=c}Pv(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,ce=s):Pv(e)}}function Pv(e){for(;ce!==null;){var t=ce;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:At||vu(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!At)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Mn(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&mv(t,s,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}mv(t,o,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var d=c.memoizedState;if(d!==null){var u=d.dehydrated;u!==null&&Ta(u)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(X(163))}At||t.flags&512&&Zf(t)}catch(p){Je(t,t.return,p)}}if(t===e){ce=null;break}if(n=t.sibling,n!==null){n.return=t.return,ce=n;break}ce=t.return}}function Mv(e){for(;ce!==null;){var t=ce;if(t===e){ce=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ce=n;break}ce=t.return}}function Nv(e){for(;ce!==null;){var t=ce;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{vu(4,t)}catch(l){Je(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){Je(t,i,l)}}var s=t.return;try{Zf(t)}catch(l){Je(t,s,l)}break;case 5:var o=t.return;try{Zf(t)}catch(l){Je(t,o,l)}}}catch(l){Je(t,t.return,l)}if(t===e){ce=null;break}var a=t.sibling;if(a!==null){a.return=t.return,ce=a;break}ce=t.return}}var fT=Math.ceil,Lc=Mr.ReactCurrentDispatcher,Jh=Mr.ReactCurrentOwner,Sn=Mr.ReactCurrentBatchConfig,Ae=0,ht=null,it=null,bt=0,Jt=0,Os=yi(0),ut=0,La=null,ts=0,yu=0,em=0,fa=null,Ht=null,tm=0,vo=1/0,gr=null,Fc=!1,tp=null,ai=null,Ol=!1,ei=null,$c=0,pa=0,np=null,ic=-1,sc=0;function It(){return Ae&6?nt():ic!==-1?ic:ic=nt()}function li(e){return e.mode&1?Ae&2&&bt!==0?bt&-bt:Q_.transition!==null?(sc===0&&(sc=I1()),sc):(e=Pe,e!==0||(e=window.event,e=e===void 0?16:U1(e.type)),e):1}function Bn(e,t,n,r){if(50<pa)throw pa=0,np=null,Error(X(185));il(e,n,r),(!(Ae&2)||e!==ht)&&(e===ht&&(!(Ae&2)&&(yu|=n),ut===4&&Ur(e,bt)),Qt(e,r),n===1&&Ae===0&&!(t.mode&1)&&(vo=nt()+500,hu&&xi()))}function Qt(e,t){var n=e.callbackNode;Q2(e,t);var r=kc(e,e===ht?bt:0);if(r===0)n!==null&&Vg(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Vg(n),t===1)e.tag===0?Y_(Ov.bind(null,e)):lw(Ov.bind(null,e)),H_(function(){!(Ae&6)&&xi()}),n=null;else{switch(L1(r)){case 1:n=Eh;break;case 4:n=O1;break;case 16:n=bc;break;case 536870912:n=D1;break;default:n=bc}n=ob(n,Jw.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Jw(e,t){if(ic=-1,sc=0,Ae&6)throw Error(X(327));var n=e.callbackNode;if(Gs()&&e.callbackNode!==n)return null;var r=kc(e,e===ht?bt:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Bc(e,r);else{t=r;var i=Ae;Ae|=2;var s=tb();(ht!==e||bt!==t)&&(gr=null,vo=nt()+500,Hi(e,t));do try{mT();break}catch(a){eb(e,a)}while(!0);Bh(),Lc.current=s,Ae=i,it!==null?t=0:(ht=null,bt=0,t=ut)}if(t!==0){if(t===2&&(i=jf(e),i!==0&&(r=i,t=rp(e,i))),t===1)throw n=La,Hi(e,0),Ur(e,r),Qt(e,nt()),n;if(t===6)Ur(e,r);else{if(i=e.current.alternate,!(r&30)&&!pT(i)&&(t=Bc(e,r),t===2&&(s=jf(e),s!==0&&(r=s,t=rp(e,s))),t===1))throw n=La,Hi(e,0),Ur(e,r),Qt(e,nt()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(X(345));case 2:Ei(e,Ht,gr);break;case 3:if(Ur(e,r),(r&130023424)===r&&(t=tm+500-nt(),10<t)){if(kc(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){It(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Lf(Ei.bind(null,e,Ht,gr),t);break}Ei(e,Ht,gr);break;case 4:if(Ur(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-$n(r);s=1<<o,o=t[o],o>i&&(i=o),r&=~s}if(r=i,r=nt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*fT(r/1960))-r,10<r){e.timeoutHandle=Lf(Ei.bind(null,e,Ht,gr),r);break}Ei(e,Ht,gr);break;case 5:Ei(e,Ht,gr);break;default:throw Error(X(329))}}}return Qt(e,nt()),e.callbackNode===n?Jw.bind(null,e):null}function rp(e,t){var n=fa;return e.current.memoizedState.isDehydrated&&(Hi(e,t).flags|=256),e=Bc(e,t),e!==2&&(t=Ht,Ht=n,t!==null&&ip(t)),e}function ip(e){Ht===null?Ht=e:Ht.push.apply(Ht,e)}function pT(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!Vn(s(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ur(e,t){for(t&=~em,t&=~yu,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-$n(t),r=1<<n;e[n]=-1,t&=~r}}function Ov(e){if(Ae&6)throw Error(X(327));Gs();var t=kc(e,0);if(!(t&1))return Qt(e,nt()),null;var n=Bc(e,t);if(e.tag!==0&&n===2){var r=jf(e);r!==0&&(t=r,n=rp(e,r))}if(n===1)throw n=La,Hi(e,0),Ur(e,t),Qt(e,nt()),n;if(n===6)throw Error(X(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ei(e,Ht,gr),Qt(e,nt()),null}function nm(e,t){var n=Ae;Ae|=1;try{return e(t)}finally{Ae=n,Ae===0&&(vo=nt()+500,hu&&xi())}}function ns(e){ei!==null&&ei.tag===0&&!(Ae&6)&&Gs();var t=Ae;Ae|=1;var n=Sn.transition,r=Pe;try{if(Sn.transition=null,Pe=1,e)return e()}finally{Pe=r,Sn.transition=n,Ae=t,!(Ae&6)&&xi()}}function rm(){Jt=Os.current,Ue(Os)}function Hi(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,U_(n)),it!==null)for(n=it.return;n!==null;){var r=n;switch(Lh(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Ec();break;case 3:mo(),Ue(Gt),Ue(Pt),qh();break;case 5:Wh(r);break;case 4:mo();break;case 13:Ue(Ge);break;case 19:Ue(Ge);break;case 10:zh(r.type._context);break;case 22:case 23:rm()}n=n.return}if(ht=e,it=e=ci(e.current,null),bt=Jt=t,ut=0,La=null,em=yu=ts=0,Ht=fa=null,Mi!==null){for(t=0;t<Mi.length;t++)if(n=Mi[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var o=s.next;s.next=i,r.next=o}n.pending=r}Mi=null}return e}function eb(e,t){do{var n=it;try{if(Bh(),tc.current=Ic,Dc){for(var r=Qe.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Dc=!1}if(es=0,pt=lt=Qe=null,ua=!1,Oa=0,Jh.current=null,n===null||n.return===null){ut=1,La=t,it=null;break}e:{var s=e,o=n.return,a=n,l=t;if(t=bt,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,d=a,u=d.tag;if(!(d.mode&1)&&(u===0||u===11||u===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var h=bv(o);if(h!==null){h.flags&=-257,kv(h,o,a,s,t),h.mode&1&&wv(s,c,t),t=h,l=c;var y=t.updateQueue;if(y===null){var w=new Set;w.add(l),t.updateQueue=w}else y.add(l);break e}else{if(!(t&1)){wv(s,c,t),im();break e}l=Error(X(426))}}else if(We&&a.mode&1){var b=bv(o);if(b!==null){!(b.flags&65536)&&(b.flags|=256),kv(b,o,a,s,t),Fh(go(l,a));break e}}s=l=go(l,a),ut!==4&&(ut=2),fa===null?fa=[s]:fa.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var m=Lw(s,l,t);hv(s,m);break e;case 1:a=l;var v=s.type,x=s.stateNode;if(!(s.flags&128)&&(typeof v.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(ai===null||!ai.has(x)))){s.flags|=65536,t&=-t,s.lanes|=t;var S=Fw(s,a,t);hv(s,S);break e}}s=s.return}while(s!==null)}rb(n)}catch(C){t=C,it===n&&n!==null&&(it=n=n.return);continue}break}while(!0)}function tb(){var e=Lc.current;return Lc.current=Ic,e===null?Ic:e}function im(){(ut===0||ut===3||ut===2)&&(ut=4),ht===null||!(ts&268435455)&&!(yu&268435455)||Ur(ht,bt)}function Bc(e,t){var n=Ae;Ae|=2;var r=tb();(ht!==e||bt!==t)&&(gr=null,Hi(e,t));do try{hT();break}catch(i){eb(e,i)}while(!0);if(Bh(),Ae=n,Lc.current=r,it!==null)throw Error(X(261));return ht=null,bt=0,ut}function hT(){for(;it!==null;)nb(it)}function mT(){for(;it!==null&&!B2();)nb(it)}function nb(e){var t=sb(e.alternate,e,Jt);e.memoizedProps=e.pendingProps,t===null?rb(e):it=t,Jh.current=null}function rb(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=lT(n,t),n!==null){n.flags&=32767,it=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ut=6,it=null;return}}else if(n=aT(n,t,Jt),n!==null){it=n;return}if(t=t.sibling,t!==null){it=t;return}it=t=e}while(t!==null);ut===0&&(ut=5)}function Ei(e,t,n){var r=Pe,i=Sn.transition;try{Sn.transition=null,Pe=1,gT(e,t,n,r)}finally{Sn.transition=i,Pe=r}return null}function gT(e,t,n,r){do Gs();while(ei!==null);if(Ae&6)throw Error(X(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(X(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(K2(e,s),e===ht&&(it=ht=null,bt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Ol||(Ol=!0,ob(bc,function(){return Gs(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=Sn.transition,Sn.transition=null;var o=Pe;Pe=1;var a=Ae;Ae|=4,Jh.current=null,uT(e,n),Xw(n,e),I_(Df),Sc=!!Of,Df=Of=null,e.current=n,dT(n),z2(),Ae=a,Pe=o,Sn.transition=s}else e.current=n;if(Ol&&(Ol=!1,ei=e,$c=i),s=e.pendingLanes,s===0&&(ai=null),H2(n.stateNode),Qt(e,nt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Fc)throw Fc=!1,e=tp,tp=null,e;return $c&1&&e.tag!==0&&Gs(),s=e.pendingLanes,s&1?e===np?pa++:(pa=0,np=e):pa=0,xi(),null}function Gs(){if(ei!==null){var e=L1($c),t=Sn.transition,n=Pe;try{if(Sn.transition=null,Pe=16>e?16:e,ei===null)var r=!1;else{if(e=ei,ei=null,$c=0,Ae&6)throw Error(X(331));var i=Ae;for(Ae|=4,ce=e.current;ce!==null;){var s=ce,o=s.child;if(ce.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(ce=c;ce!==null;){var d=ce;switch(d.tag){case 0:case 11:case 15:da(8,d,s)}var u=d.child;if(u!==null)u.return=d,ce=u;else for(;ce!==null;){d=ce;var p=d.sibling,h=d.return;if(Yw(d),d===c){ce=null;break}if(p!==null){p.return=h,ce=p;break}ce=h}}}var y=s.alternate;if(y!==null){var w=y.child;if(w!==null){y.child=null;do{var b=w.sibling;w.sibling=null,w=b}while(w!==null)}}ce=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,ce=o;else e:for(;ce!==null;){if(s=ce,s.flags&2048)switch(s.tag){case 0:case 11:case 15:da(9,s,s.return)}var m=s.sibling;if(m!==null){m.return=s.return,ce=m;break e}ce=s.return}}var v=e.current;for(ce=v;ce!==null;){o=ce;var x=o.child;if(o.subtreeFlags&2064&&x!==null)x.return=o,ce=x;else e:for(o=v;ce!==null;){if(a=ce,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:vu(9,a)}}catch(C){Je(a,a.return,C)}if(a===o){ce=null;break e}var S=a.sibling;if(S!==null){S.return=a.return,ce=S;break e}ce=a.return}}if(Ae=i,xi(),tr&&typeof tr.onPostCommitFiberRoot=="function")try{tr.onPostCommitFiberRoot(cu,e)}catch{}r=!0}return r}finally{Pe=n,Sn.transition=t}}return!1}function Dv(e,t,n){t=go(n,t),t=Lw(e,t,1),e=oi(e,t,1),t=It(),e!==null&&(il(e,1,t),Qt(e,t))}function Je(e,t,n){if(e.tag===3)Dv(e,e,n);else for(;t!==null;){if(t.tag===3){Dv(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ai===null||!ai.has(r))){e=go(n,e),e=Fw(t,e,1),t=oi(t,e,1),e=It(),t!==null&&(il(t,1,e),Qt(t,e));break}}t=t.return}}function vT(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=It(),e.pingedLanes|=e.suspendedLanes&n,ht===e&&(bt&n)===n&&(ut===4||ut===3&&(bt&130023424)===bt&&500>nt()-tm?Hi(e,0):em|=n),Qt(e,t)}function ib(e,t){t===0&&(e.mode&1?(t=Cl,Cl<<=1,!(Cl&130023424)&&(Cl=4194304)):t=1);var n=It();e=Tr(e,t),e!==null&&(il(e,t,n),Qt(e,n))}function yT(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ib(e,n)}function xT(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(X(314))}r!==null&&r.delete(t),ib(e,n)}var sb;sb=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Gt.current)qt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return qt=!1,oT(e,t,n);qt=!!(e.flags&131072)}else qt=!1,We&&t.flags&1048576&&cw(t,Rc,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;rc(e,t),e=t.pendingProps;var i=fo(t,Pt.current);qs(t,n),i=Yh(null,t,r,e,i,n);var s=Qh();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Yt(r)?(s=!0,Ac(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Uh(t),i.updater=gu,t.stateNode=i,i._reactInternals=t,Hf(t,r,e,n),t=Gf(null,t,r,!0,s,n)):(t.tag=0,We&&s&&Ih(t),Ot(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(rc(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=bT(r),e=Mn(r,e),i){case 0:t=qf(null,t,r,e,n);break e;case 1:t=_v(null,t,r,e,n);break e;case 11:t=Sv(null,t,r,e,n);break e;case 14:t=Cv(null,t,r,Mn(r.type,e),n);break e}throw Error(X(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Mn(r,i),qf(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Mn(r,i),_v(e,t,r,i,n);case 3:e:{if(Vw(t),e===null)throw Error(X(387));r=t.pendingProps,s=t.memoizedState,i=s.element,mw(e,t),Nc(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=go(Error(X(423)),t),t=Tv(e,t,r,n,i);break e}else if(r!==i){i=go(Error(X(424)),t),t=Tv(e,t,r,n,i);break e}else for(nn=si(t.stateNode.containerInfo.firstChild),on=t,We=!0,In=null,n=pw(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(po(),r===i){t=Er(e,t,n);break e}Ot(e,t,r,n)}t=t.child}return t;case 5:return gw(t),e===null&&zf(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,If(r,i)?o=null:s!==null&&If(r,s)&&(t.flags|=32),zw(e,t),Ot(e,t,o,n),t.child;case 6:return e===null&&zf(t),null;case 13:return Uw(e,t,n);case 4:return Hh(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ho(t,null,r,n):Ot(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Mn(r,i),Sv(e,t,r,i,n);case 7:return Ot(e,t,t.pendingProps,n),t.child;case 8:return Ot(e,t,t.pendingProps.children,n),t.child;case 12:return Ot(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,$e(Pc,r._currentValue),r._currentValue=o,s!==null)if(Vn(s.value,o)){if(s.children===i.children&&!Gt.current){t=Er(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=kr(-1,n&-n),l.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?l.next=l:(l.next=d.next,d.next=l),c.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Vf(s.return,n,t),a.lanes|=n;break}l=l.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(X(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Vf(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Ot(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,qs(t,n),i=_n(i),r=r(i),t.flags|=1,Ot(e,t,r,n),t.child;case 14:return r=t.type,i=Mn(r,t.pendingProps),i=Mn(r.type,i),Cv(e,t,r,i,n);case 15:return $w(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Mn(r,i),rc(e,t),t.tag=1,Yt(r)?(e=!0,Ac(t)):e=!1,qs(t,n),Iw(t,r,i),Hf(t,r,i,n),Gf(null,t,r,!0,e,n);case 19:return Hw(e,t,n);case 22:return Bw(e,t,n)}throw Error(X(156,t.tag))};function ob(e,t){return N1(e,t)}function wT(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function kn(e,t,n,r){return new wT(e,t,n,r)}function sm(e){return e=e.prototype,!(!e||!e.isReactComponent)}function bT(e){if(typeof e=="function")return sm(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ch)return 11;if(e===_h)return 14}return 2}function ci(e,t){var n=e.alternate;return n===null?(n=kn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function oc(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")sm(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Cs:return Wi(n.children,i,s,t);case Sh:o=8,i|=8;break;case hf:return e=kn(12,n,t,i|2),e.elementType=hf,e.lanes=s,e;case mf:return e=kn(13,n,t,i),e.elementType=mf,e.lanes=s,e;case gf:return e=kn(19,n,t,i),e.elementType=gf,e.lanes=s,e;case g1:return xu(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case h1:o=10;break e;case m1:o=9;break e;case Ch:o=11;break e;case _h:o=14;break e;case $r:o=16,r=null;break e}throw Error(X(130,e==null?e:typeof e,""))}return t=kn(o,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function Wi(e,t,n,r){return e=kn(7,e,r,t),e.lanes=n,e}function xu(e,t,n,r){return e=kn(22,e,r,t),e.elementType=g1,e.lanes=n,e.stateNode={isHidden:!1},e}function Ad(e,t,n){return e=kn(6,e,null,t),e.lanes=n,e}function jd(e,t,n){return t=kn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function kT(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=cd(0),this.expirationTimes=cd(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=cd(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function om(e,t,n,r,i,s,o,a,l){return e=new kT(e,t,n,a,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=kn(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Uh(s),e}function ST(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ss,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function ab(e){if(!e)return pi;e=e._reactInternals;e:{if(as(e)!==e||e.tag!==1)throw Error(X(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Yt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(X(171))}if(e.tag===1){var n=e.type;if(Yt(n))return aw(e,n,t)}return t}function lb(e,t,n,r,i,s,o,a,l){return e=om(n,r,!0,e,i,s,o,a,l),e.context=ab(null),n=e.current,r=It(),i=li(n),s=kr(r,i),s.callback=t??null,oi(n,s,i),e.current.lanes=i,il(e,i,r),Qt(e,r),e}function wu(e,t,n,r){var i=t.current,s=It(),o=li(i);return n=ab(n),t.context===null?t.context=n:t.pendingContext=n,t=kr(s,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=oi(i,t,o),e!==null&&(Bn(e,i,o,s),ec(e,i,o)),o}function zc(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Iv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function am(e,t){Iv(e,t),(e=e.alternate)&&Iv(e,t)}function CT(){return null}var cb=typeof reportError=="function"?reportError:function(e){console.error(e)};function lm(e){this._internalRoot=e}bu.prototype.render=lm.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(X(409));wu(e,t,null,null)};bu.prototype.unmount=lm.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ns(function(){wu(null,e,null,null)}),t[_r]=null}};function bu(e){this._internalRoot=e}bu.prototype.unstable_scheduleHydration=function(e){if(e){var t=B1();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Vr.length&&t!==0&&t<Vr[n].priority;n++);Vr.splice(n,0,e),n===0&&V1(e)}};function cm(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ku(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Lv(){}function _T(e,t,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var c=zc(o);s.call(c)}}var o=lb(t,r,e,0,null,!1,!1,"",Lv);return e._reactRootContainer=o,e[_r]=o.current,ja(e.nodeType===8?e.parentNode:e),ns(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var c=zc(l);a.call(c)}}var l=om(e,0,!1,null,null,!1,!1,"",Lv);return e._reactRootContainer=l,e[_r]=l.current,ja(e.nodeType===8?e.parentNode:e),ns(function(){wu(t,l,n,r)}),l}function Su(e,t,n,r,i){var s=n._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var a=i;i=function(){var l=zc(o);a.call(l)}}wu(t,o,e,i)}else o=_T(n,t,e,i,r);return zc(o)}F1=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Xo(t.pendingLanes);n!==0&&(Ah(t,n|1),Qt(t,nt()),!(Ae&6)&&(vo=nt()+500,xi()))}break;case 13:ns(function(){var r=Tr(e,1);if(r!==null){var i=It();Bn(r,e,1,i)}}),am(e,1)}};jh=function(e){if(e.tag===13){var t=Tr(e,134217728);if(t!==null){var n=It();Bn(t,e,134217728,n)}am(e,134217728)}};$1=function(e){if(e.tag===13){var t=li(e),n=Tr(e,t);if(n!==null){var r=It();Bn(n,e,t,r)}am(e,t)}};B1=function(){return Pe};z1=function(e,t){var n=Pe;try{return Pe=e,t()}finally{Pe=n}};Tf=function(e,t,n){switch(t){case"input":if(xf(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=pu(r);if(!i)throw Error(X(90));y1(r),xf(r,i)}}}break;case"textarea":w1(e,n);break;case"select":t=n.value,t!=null&&Vs(e,!!n.multiple,t,!1)}};E1=nm;A1=ns;var TT={usingClientEntryPoint:!1,Events:[ol,As,pu,_1,T1,nm]},Ho={findFiberByHostInstance:Pi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ET={bundleType:Ho.bundleType,version:Ho.version,rendererPackageName:Ho.rendererPackageName,rendererConfig:Ho.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Mr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=P1(e),e===null?null:e.stateNode},findFiberByHostInstance:Ho.findFiberByHostInstance||CT,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 Dl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Dl.isDisabled&&Dl.supportsFiber)try{cu=Dl.inject(ET),tr=Dl}catch{}}ln.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=TT;ln.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!cm(t))throw Error(X(200));return ST(e,t,null,n)};ln.createRoot=function(e,t){if(!cm(e))throw Error(X(299));var n=!1,r="",i=cb;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=om(e,1,!1,null,null,n,!1,r,i),e[_r]=t.current,ja(e.nodeType===8?e.parentNode:e),new lm(t)};ln.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(X(188)):(e=Object.keys(e).join(","),Error(X(268,e)));return e=P1(t),e=e===null?null:e.stateNode,e};ln.flushSync=function(e){return ns(e)};ln.hydrate=function(e,t,n){if(!ku(t))throw Error(X(200));return Su(null,e,t,!0,n)};ln.hydrateRoot=function(e,t,n){if(!cm(e))throw Error(X(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",o=cb;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=lb(t,null,e,1,n??null,i,!1,s,o),e[_r]=t.current,ja(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new bu(t)};ln.render=function(e,t,n){if(!ku(t))throw Error(X(200));return Su(null,e,t,!1,n)};ln.unmountComponentAtNode=function(e){if(!ku(e))throw Error(X(40));return e._reactRootContainer?(ns(function(){Su(null,null,e,!1,function(){e._reactRootContainer=null,e[_r]=null})}),!0):!1};ln.unstable_batchedUpdates=nm;ln.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!ku(n))throw Error(X(200));if(e==null||e._reactInternals===void 0)throw Error(X(38));return Su(e,t,n,!1,r)};ln.version="18.3.1-next-f1338f8080-20240426";function ub(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ub)}catch(e){console.error(e)}}ub(),u1.exports=ln;var db=u1.exports;const AT=Pr(db);var fb,Fv=db;fb=Fv.createRoot,Fv.hydrateRoot;const jT="@alfatech/livechat",RT="v2026.04.13.1",PT="module",MT="https://api.chatier.app",NT="wss://api.chatier.app",OT=["dist","README.md","component/chatier.js"],DT="dist/widget.js",IT={name:"Uygar Öztürk Ceylan",email:"uygaroztcyln@gmail.com"},LT={dev:"vite",dev2:"vite --config vite.config.2.ts",build:"tsc -b && vite build",lint:"biome lint --write",prepare:"husky",format:"biome format --write && yarn lint",preview:"vite preview","build:mobile":"tsc -b && vite build --config vite.config.app.ts && mv dist-app/index-app.html dist-app/index.html","preview:mobile":"vite preview --config vite.config.app.ts --outDir dist-app","dev:mobile":"vite --config vite.config.app.ts"},FT={"@headlessui/react":"^2.2.2","@tailwindcss/vite":"^4.1.4","@tanstack/react-query":"^5.59.20",classnames:"^2.5.1",dayjs:"^1.11.13",formik:"^2.4.6","framer-motion":"^12.7.4","lucide-react":"^0.511.0",react:"^18.3.1","react-dom":"^18.3.1","react-dropzone":"^14.3.8","react-router-dom":"^6.26.2","socket.io-client":"^4.8.1",sonner:"^2.0.1",yup:"^1.4.0",zustand:"^4.5.5"},$T={"@biomejs/biome":"^1.8.3","@types/node":"^22.5.4","@types/react":"^18.3.3","@types/react-dom":"^18.3.0","@vitejs/plugin-react-swc":"^3.5.0",globals:"^15.9.0",husky:"^9.1.5",tailwindcss:"^4.1.4",typescript:"^5.5.3",vite:"^5.4.1"},pb={name:jT,private:!1,version:RT,type:PT,apiURL:MT,wsURL:NT,files:OT,main:DT,author:IT,scripts:LT,dependencies:FT,devDependencies:$T,"lint-staged":{"./**/*.{js,ts,tsx,json}":["npm run format"]}},hb=pb.apiURL,BT=pb.wsURL,zT=e=>[{limit:Number.parseInt(e.headers.get("X-Ratelimit-Limit")||"0"),remaining:Number.parseInt(e.headers.get("X-Ratelimit-Remaining")||"0"),reset:Number.parseInt(e.headers.get("X-Ratelimit-Reset")||"0"),retryAfter:Number.parseInt(e.headers.get("Retry-After")||"0")},429],VT=(e,t)=>[{message:"message"in t?t.message:"Not Found"},404],UT={429:zT,404:VT};async function Nr(e,t={}){const n={};!(t.body instanceof FormData)&&t.body&&(n["Content-Type"]="application/json");const r=await fetch(`${hb}/${e}`,{...t,credentials:"include",headers:{...t.headers,...n}}).catch(s=>new Response(null,{status:500}));if(!r.ok){let s={};try{return s=await r.json(),[s,r.status]}catch{}const o=UT[r.status];return o?o(r,s):[{},r.status]}const i=r.headers.get("Content-Type");return i&&i.includes("application/json")?[await r.json(),r.status]:[await r.text(),r.status]}const zn=e=>[200,201,204].includes(e),HT=(e,{arrayWithBrackets:t=!1,arrayWithBracketAndIndex:n=!0}={})=>{const r=new FormData;for(const[i,s]of Object.entries(e)){if(Array.isArray(s)){for(const o in s)t?r.append(`${i}[]`,s[o]):n?r.append(`${i}[${o}]`,s[o]):r.append(i,s[o]);continue}typeof s<"u"&&s!==null&&r.append(i,s)}return r};var jo=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},rs=typeof window>"u"||"Deno"in globalThis;function yn(){}function WT(e,t){return typeof e=="function"?e(t):e}function sp(e){return typeof e=="number"&&e>=0&&e!==1/0}function mb(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ys(e,t){return typeof e=="function"?e(t):e}function Ln(e,t){return typeof e=="function"?e(t):e}function $v(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:a}=e;if(o){if(r){if(t.queryHash!==um(o,t.options))return!1}else if(!Fa(t.queryKey,o))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||i&&i!==t.state.fetchStatus||s&&!s(t))}function Bv(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(is(t.options.mutationKey)!==is(s))return!1}else if(!Fa(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function um(e,t){return((t==null?void 0:t.queryKeyHashFn)||is)(e)}function is(e){return JSON.stringify(e,(t,n)=>op(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Fa(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Fa(e[n],t[n])):!1}function gb(e,t){if(e===t)return e;const n=zv(e)&&zv(t);if(n||op(e)&&op(t)){const r=n?e:Object.keys(e),i=r.length,s=n?t:Object.keys(t),o=s.length,a=n?[]:{};let l=0;for(let c=0;c<o;c++){const d=n?c:s[c];(!n&&r.includes(d)||n)&&e[d]===void 0&&t[d]===void 0?(a[d]=void 0,l++):(a[d]=gb(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&l++)}return i===o&&l===i?e:a}return t}function Vc(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function zv(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function op(e){if(!Vv(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Vv(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Vv(e){return Object.prototype.toString.call(e)==="[object Object]"}function qT(e){return new Promise(t=>{setTimeout(t,e)})}function ap(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?gb(e,t):t}function GT(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function YT(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var dm=Symbol();function vb(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===dm?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Li,Hr,Xs,Ux,QT=(Ux=class extends jo{constructor(){super();fe(this,Li);fe(this,Hr);fe(this,Xs);le(this,Xs,t=>{if(!rs&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){T(this,Hr)||this.setEventListener(T(this,Xs))}onUnsubscribe(){var t;this.hasListeners()||((t=T(this,Hr))==null||t.call(this),le(this,Hr,void 0))}setEventListener(t){var n;le(this,Xs,t),(n=T(this,Hr))==null||n.call(this),le(this,Hr,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){T(this,Li)!==t&&(le(this,Li,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof T(this,Li)=="boolean"?T(this,Li):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Li=new WeakMap,Hr=new WeakMap,Xs=new WeakMap,Ux),fm=new QT,Zs,Wr,Js,Hx,KT=(Hx=class extends jo{constructor(){super();fe(this,Zs,!0);fe(this,Wr);fe(this,Js);le(this,Js,t=>{if(!rs&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){T(this,Wr)||this.setEventListener(T(this,Js))}onUnsubscribe(){var t;this.hasListeners()||((t=T(this,Wr))==null||t.call(this),le(this,Wr,void 0))}setEventListener(t){var n;le(this,Js,t),(n=T(this,Wr))==null||n.call(this),le(this,Wr,t(this.setOnline.bind(this)))}setOnline(t){T(this,Zs)!==t&&(le(this,Zs,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return T(this,Zs)}},Zs=new WeakMap,Wr=new WeakMap,Js=new WeakMap,Hx),Uc=new KT;function lp(){let e,t;const n=new Promise((i,s)=>{e=i,t=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}function XT(e){return Math.min(1e3*2**e,3e4)}function yb(e){return(e??"online")==="online"?Uc.isOnline():!0}var xb=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Rd(e){return e instanceof xb}function wb(e){let t=!1,n=0,r=!1,i;const s=lp(),o=w=>{var b;r||(p(new xb(w)),(b=e.abort)==null||b.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>fm.isFocused()&&(e.networkMode==="always"||Uc.isOnline())&&e.canRun(),d=()=>yb(e.networkMode)&&e.canRun(),u=w=>{var b;r||(r=!0,(b=e.onSuccess)==null||b.call(e,w),i==null||i(),s.resolve(w))},p=w=>{var b;r||(r=!0,(b=e.onError)==null||b.call(e,w),i==null||i(),s.reject(w))},h=()=>new Promise(w=>{var b;i=m=>{(r||c())&&w(m)},(b=e.onPause)==null||b.call(e)}).then(()=>{var w;i=void 0,r||(w=e.onContinue)==null||w.call(e)}),y=()=>{if(r)return;let w;const b=n===0?e.initialPromise:void 0;try{w=b??e.fn()}catch(m){w=Promise.reject(m)}Promise.resolve(w).then(u).catch(m=>{var _;if(r)return;const v=e.retry??(rs?0:3),x=e.retryDelay??XT,S=typeof x=="function"?x(n,m):x,C=v===!0||typeof v=="number"&&n<v||typeof v=="function"&&v(n,m);if(t||!C){p(m);return}n++,(_=e.onFail)==null||_.call(e,n,m),qT(S).then(()=>c()?void 0:h()).then(()=>{t?p(m):y()})})};return{promise:s,cancel:o,continue:()=>(i==null||i(),s),cancelRetry:a,continueRetry:l,canStart:d,start:()=>(d()?y():h().then(y),s)}}function ZT(){let e=[],t=0,n=a=>{a()},r=a=>{a()},i=a=>setTimeout(a,0);const s=a=>{t?e.push(a):i(()=>{n(a)})},o=()=>{const a=e;e=[],a.length&&i(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||o()}return l},batchCalls:a=>(...l)=>{s(()=>{a(...l)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{i=a}}}var ct=ZT(),Fi,Wx,bb=(Wx=class{constructor(){fe(this,Fi)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),sp(this.gcTime)&&le(this,Fi,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(rs?1/0:5*60*1e3))}clearGcTimeout(){T(this,Fi)&&(clearTimeout(T(this,Fi)),le(this,Fi,void 0))}},Fi=new WeakMap,Wx),eo,to,vn,Tt,Ja,$i,Nn,hr,qx,JT=(qx=class extends bb{constructor(t){super();fe(this,Nn);fe(this,eo);fe(this,to);fe(this,vn);fe(this,Tt);fe(this,Ja);fe(this,$i);le(this,$i,!1),le(this,Ja,t.defaultOptions),this.setOptions(t.options),this.observers=[],le(this,vn,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,le(this,eo,eE(this.options)),this.state=t.state??T(this,eo),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=T(this,Tt))==null?void 0:t.promise}setOptions(t){this.options={...T(this,Ja),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&T(this,vn).remove(this)}setData(t,n){const r=ap(this.state.data,t,this.options);return we(this,Nn,hr).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){we(this,Nn,hr).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=T(this,Tt))==null?void 0:r.promise;return(i=T(this,Tt))==null||i.cancel(t),n?n.then(yn).catch(yn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(T(this,eo))}isActive(){return this.observers.some(t=>Ln(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===dm||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!mb(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=T(this,Tt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=T(this,Tt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),T(this,vn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(T(this,Tt)&&(T(this,$i)?T(this,Tt).cancel({revert:!0}):T(this,Tt).cancelRetry()),this.scheduleGc()),T(this,vn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||we(this,Nn,hr).call(this,{type:"invalidate"})}fetch(t,n){var l,c,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(T(this,Tt))return T(this,Tt).continueRetry(),T(this,Tt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const u=this.observers.find(p=>p.options.queryFn);u&&this.setOptions(u.options)}const r=new AbortController,i=u=>{Object.defineProperty(u,"signal",{enumerable:!0,get:()=>(le(this,$i,!0),r.signal)})},s=()=>{const u=vb(this.options,n),p={queryKey:this.queryKey,meta:this.meta};return i(p),le(this,$i,!1),this.options.persister?this.options.persister(u,p,this):u(p)},o={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(o),(l=this.options.behavior)==null||l.onFetch(o,this),le(this,to,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=o.fetchOptions)==null?void 0:c.meta))&&we(this,Nn,hr).call(this,{type:"fetch",meta:(d=o.fetchOptions)==null?void 0:d.meta});const a=u=>{var p,h,y,w;Rd(u)&&u.silent||we(this,Nn,hr).call(this,{type:"error",error:u}),Rd(u)||((h=(p=T(this,vn).config).onError)==null||h.call(p,u,this),(w=(y=T(this,vn).config).onSettled)==null||w.call(y,this.state.data,u,this)),this.scheduleGc()};return le(this,Tt,wb({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:u=>{var p,h,y,w;if(u===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(u)}catch(b){a(b);return}(h=(p=T(this,vn).config).onSuccess)==null||h.call(p,u,this),(w=(y=T(this,vn).config).onSettled)==null||w.call(y,u,this.state.error,this),this.scheduleGc()},onError:a,onFail:(u,p)=>{we(this,Nn,hr).call(this,{type:"failed",failureCount:u,error:p})},onPause:()=>{we(this,Nn,hr).call(this,{type:"pause"})},onContinue:()=>{we(this,Nn,hr).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),T(this,Tt).start()}},eo=new WeakMap,to=new WeakMap,vn=new WeakMap,Tt=new WeakMap,Ja=new WeakMap,$i=new WeakMap,Nn=new WeakSet,hr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...kb(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return Rd(i)&&i.revert&&T(this,to)?{...T(this,to),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),ct.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),T(this,vn).notify({query:this,type:"updated",action:t})})},qx);function kb(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:yb(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function eE(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Kn,Gx,tE=(Gx=class extends jo{constructor(t={}){super();fe(this,Kn);this.config=t,le(this,Kn,new Map)}build(t,n,r){const i=n.queryKey,s=n.queryHash??um(i,n);let o=this.get(s);return o||(o=new JT({cache:this,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){T(this,Kn).has(t.queryHash)||(T(this,Kn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=T(this,Kn).get(t.queryHash);n&&(t.destroy(),n===t&&T(this,Kn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ct.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return T(this,Kn).get(t)}getAll(){return[...T(this,Kn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>$v(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>$v(t,r)):n}notify(t){ct.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){ct.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ct.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Kn=new WeakMap,Gx),Xn,Mt,Bi,Zn,Lr,Yx,nE=(Yx=class extends bb{constructor(t){super();fe(this,Zn);fe(this,Xn);fe(this,Mt);fe(this,Bi);this.mutationId=t.mutationId,le(this,Mt,t.mutationCache),le(this,Xn,[]),this.state=t.state||Sb(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){T(this,Xn).includes(t)||(T(this,Xn).push(t),this.clearGcTimeout(),T(this,Mt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){le(this,Xn,T(this,Xn).filter(n=>n!==t)),this.scheduleGc(),T(this,Mt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){T(this,Xn).length||(this.state.status==="pending"?this.scheduleGc():T(this,Mt).remove(this))}continue(){var t;return((t=T(this,Bi))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,s,o,a,l,c,d,u,p,h,y,w,b,m,v,x,S,C,_,j;le(this,Bi,wb({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(A,E)=>{we(this,Zn,Lr).call(this,{type:"failed",failureCount:A,error:E})},onPause:()=>{we(this,Zn,Lr).call(this,{type:"pause"})},onContinue:()=>{we(this,Zn,Lr).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>T(this,Mt).canRun(this)}));const n=this.state.status==="pending",r=!T(this,Bi).canStart();try{if(!n){we(this,Zn,Lr).call(this,{type:"pending",variables:t,isPaused:r}),await((s=(i=T(this,Mt).config).onMutate)==null?void 0:s.call(i,t,this));const E=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,t));E!==this.state.context&&we(this,Zn,Lr).call(this,{type:"pending",context:E,variables:t,isPaused:r})}const A=await T(this,Bi).start();return await((c=(l=T(this,Mt).config).onSuccess)==null?void 0:c.call(l,A,t,this.state.context,this)),await((u=(d=this.options).onSuccess)==null?void 0:u.call(d,A,t,this.state.context)),await((h=(p=T(this,Mt).config).onSettled)==null?void 0:h.call(p,A,null,this.state.variables,this.state.context,this)),await((w=(y=this.options).onSettled)==null?void 0:w.call(y,A,null,t,this.state.context)),we(this,Zn,Lr).call(this,{type:"success",data:A}),A}catch(A){try{throw await((m=(b=T(this,Mt).config).onError)==null?void 0:m.call(b,A,t,this.state.context,this)),await((x=(v=this.options).onError)==null?void 0:x.call(v,A,t,this.state.context)),await((C=(S=T(this,Mt).config).onSettled)==null?void 0:C.call(S,void 0,A,this.state.variables,this.state.context,this)),await((j=(_=this.options).onSettled)==null?void 0:j.call(_,void 0,A,t,this.state.context)),A}finally{we(this,Zn,Lr).call(this,{type:"error",error:A})}}finally{T(this,Mt).runNext(this)}}},Xn=new WeakMap,Mt=new WeakMap,Bi=new WeakMap,Zn=new WeakSet,Lr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),ct.batch(()=>{T(this,Xn).forEach(r=>{r.onMutationUpdate(t)}),T(this,Mt).notify({mutation:this,type:"updated",action:t})})},Yx);function Sb(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Zt,el,Qx,rE=(Qx=class extends jo{constructor(t={}){super();fe(this,Zt);fe(this,el);this.config=t,le(this,Zt,new Map),le(this,el,Date.now())}build(t,n,r){const i=new nE({mutationCache:this,mutationId:++yl(this,el)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){const n=Il(t),r=T(this,Zt).get(n)??[];r.push(t),T(this,Zt).set(n,r),this.notify({type:"added",mutation:t})}remove(t){var r;const n=Il(t);if(T(this,Zt).has(n)){const i=(r=T(this,Zt).get(n))==null?void 0:r.filter(s=>s!==t);i&&(i.length===0?T(this,Zt).delete(n):T(this,Zt).set(n,i))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=(r=T(this,Zt).get(Il(t)))==null?void 0:r.find(i=>i.state.status==="pending");return!n||n===t}runNext(t){var r;const n=(r=T(this,Zt).get(Il(t)))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){ct.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...T(this,Zt).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Bv(n,r))}findAll(t={}){return this.getAll().filter(n=>Bv(t,n))}notify(t){ct.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return ct.batch(()=>Promise.all(t.map(n=>n.continue().catch(yn))))}},Zt=new WeakMap,el=new WeakMap,Qx);function Il(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function Uv(e){return{onFetch:(t,n)=>{var d,u,p,h,y;const r=t.options,i=(p=(u=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:u.fetchMore)==null?void 0:p.direction,s=((h=t.state.data)==null?void 0:h.pages)||[],o=((y=t.state.data)==null?void 0:y.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let w=!1;const b=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(t.signal.aborted?w=!0:t.signal.addEventListener("abort",()=>{w=!0}),t.signal)})},m=vb(t.options,t.fetchOptions),v=async(x,S,C)=>{if(w)return Promise.reject();if(S==null&&x.pages.length)return Promise.resolve(x);const _={queryKey:t.queryKey,pageParam:S,direction:C?"backward":"forward",meta:t.options.meta};b(_);const j=await m(_),{maxPages:A}=t.options,E=C?YT:GT;return{pages:E(x.pages,j,A),pageParams:E(x.pageParams,S,A)}};if(i&&s.length){const x=i==="backward",S=x?iE:Hv,C={pages:s,pageParams:o},_=S(r,C);a=await v(C,_,x)}else{const x=e??s.length;do{const S=l===0?o[0]??r.initialPageParam:Hv(r,a);if(l>0&&S==null)break;a=await v(a,S),l++}while(l<x)}return a};t.options.persister?t.fetchFn=()=>{var w,b;return(b=(w=t.options).persister)==null?void 0:b.call(w,c,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function Hv(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function iE(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Xe,qr,Gr,no,ro,Yr,io,so,Kx,sE=(Kx=class{constructor(e={}){fe(this,Xe);fe(this,qr);fe(this,Gr);fe(this,no);fe(this,ro);fe(this,Yr);fe(this,io);fe(this,so);le(this,Xe,e.queryCache||new tE),le(this,qr,e.mutationCache||new rE),le(this,Gr,e.defaultOptions||{}),le(this,no,new Map),le(this,ro,new Map),le(this,Yr,0)}mount(){yl(this,Yr)._++,T(this,Yr)===1&&(le(this,io,fm.subscribe(async e=>{e&&(await this.resumePausedMutations(),T(this,Xe).onFocus())})),le(this,so,Uc.subscribe(async e=>{e&&(await this.resumePausedMutations(),T(this,Xe).onOnline())})))}unmount(){var e,t;yl(this,Yr)._--,T(this,Yr)===0&&((e=T(this,io))==null||e.call(this),le(this,io,void 0),(t=T(this,so))==null||t.call(this),le(this,so,void 0))}isFetching(e){return T(this,Xe).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return T(this,qr).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=T(this,Xe).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);if(t===void 0)return this.fetchQuery(e);{const n=this.defaultQueryOptions(e),r=T(this,Xe).build(this,n);return e.revalidateIfStale&&r.isStaleByTime(Ys(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return T(this,Xe).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=T(this,Xe).get(r.queryHash),s=i==null?void 0:i.state.data,o=WT(t,s);if(o!==void 0)return T(this,Xe).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return ct.batch(()=>T(this,Xe).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=T(this,Xe).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=T(this,Xe);ct.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=T(this,Xe),r={type:"active",...e};return ct.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=ct.batch(()=>T(this,Xe).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(yn).catch(yn)}invalidateQueries(e,t={}){return ct.batch(()=>{if(T(this,Xe).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none")return Promise.resolve();const n={...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"};return this.refetchQueries(n,t)})}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=ct.batch(()=>T(this,Xe).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(yn)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(yn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=T(this,Xe).build(this,t);return n.isStaleByTime(Ys(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(yn).catch(yn)}fetchInfiniteQuery(e){return e.behavior=Uv(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(yn).catch(yn)}ensureInfiniteQueryData(e){return e.behavior=Uv(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Uc.isOnline()?T(this,qr).resumePausedMutations():Promise.resolve()}getQueryCache(){return T(this,Xe)}getMutationCache(){return T(this,qr)}getDefaultOptions(){return T(this,Gr)}setDefaultOptions(e){le(this,Gr,e)}setQueryDefaults(e,t){T(this,no).set(is(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...T(this,no).values()],n={};return t.forEach(r=>{Fa(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){T(this,ro).set(is(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...T(this,ro).values()];let n={};return t.forEach(r=>{Fa(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...T(this,Gr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=um(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.enabled!==!0&&t.queryFn===dm&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...T(this,Gr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){T(this,Xe).clear(),T(this,qr).clear()}},Xe=new WeakMap,qr=new WeakMap,Gr=new WeakMap,no=new WeakMap,ro=new WeakMap,Yr=new WeakMap,io=new WeakMap,so=new WeakMap,Kx),zt,_e,tl,Nt,zi,oo,Qr,Jn,nl,ao,lo,Vi,Ui,Kr,co,je,Jo,cp,up,dp,fp,pp,hp,mp,Cb,Xx,oE=(Xx=class extends jo{constructor(t,n){super();fe(this,je);fe(this,zt);fe(this,_e);fe(this,tl);fe(this,Nt);fe(this,zi);fe(this,oo);fe(this,Qr);fe(this,Jn);fe(this,nl);fe(this,ao);fe(this,lo);fe(this,Vi);fe(this,Ui);fe(this,Kr);fe(this,co,new Set);this.options=n,le(this,zt,t),le(this,Jn,null),le(this,Qr,lp()),this.options.experimental_prefetchInRender||T(this,Qr).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(T(this,_e).addObserver(this),Wv(T(this,_e),this.options)?we(this,je,Jo).call(this):this.updateResult(),we(this,je,fp).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return gp(T(this,_e),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return gp(T(this,_e),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,we(this,je,pp).call(this),we(this,je,hp).call(this),T(this,_e).removeObserver(this)}setOptions(t,n){const r=this.options,i=T(this,_e);if(this.options=T(this,zt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ln(this.options.enabled,T(this,_e))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");we(this,je,mp).call(this),T(this,_e).setOptions(this.options),r._defaulted&&!Vc(this.options,r)&&T(this,zt).getQueryCache().notify({type:"observerOptionsUpdated",query:T(this,_e),observer:this});const s=this.hasListeners();s&&qv(T(this,_e),i,this.options,r)&&we(this,je,Jo).call(this),this.updateResult(n),s&&(T(this,_e)!==i||Ln(this.options.enabled,T(this,_e))!==Ln(r.enabled,T(this,_e))||Ys(this.options.staleTime,T(this,_e))!==Ys(r.staleTime,T(this,_e)))&&we(this,je,cp).call(this);const o=we(this,je,up).call(this);s&&(T(this,_e)!==i||Ln(this.options.enabled,T(this,_e))!==Ln(r.enabled,T(this,_e))||o!==T(this,Kr))&&we(this,je,dp).call(this,o)}getOptimisticResult(t){const n=T(this,zt).getQueryCache().build(T(this,zt),t),r=this.createResult(n,t);return lE(this,r)&&(le(this,Nt,r),le(this,oo,this.options),le(this,zi,T(this,_e).state)),r}getCurrentResult(){return T(this,Nt)}trackResult(t,n){const r={};return Object.keys(t).forEach(i=>{Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),n==null||n(i),t[i])})}),r}trackProp(t){T(this,co).add(t)}getCurrentQuery(){return T(this,_e)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=T(this,zt).defaultQueryOptions(t),r=T(this,zt).getQueryCache().build(T(this,zt),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return we(this,je,Jo).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),T(this,Nt)))}createResult(t,n){var A;const r=T(this,_e),i=this.options,s=T(this,Nt),o=T(this,zi),a=T(this,oo),c=t!==r?t.state:T(this,tl),{state:d}=t;let u={...d},p=!1,h;if(n._optimisticResults){const E=this.hasListeners(),D=!E&&Wv(t,n),L=E&&qv(t,r,n,i);(D||L)&&(u={...u,...kb(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:y,errorUpdatedAt:w,status:b}=u;if(n.select&&u.data!==void 0)if(s&&u.data===(o==null?void 0:o.data)&&n.select===T(this,nl))h=T(this,ao);else try{le(this,nl,n.select),h=n.select(u.data),h=ap(s==null?void 0:s.data,h,n),le(this,ao,h),le(this,Jn,null)}catch(E){le(this,Jn,E)}else h=u.data;if(n.placeholderData!==void 0&&h===void 0&&b==="pending"){let E;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))E=s.data;else if(E=typeof n.placeholderData=="function"?n.placeholderData((A=T(this,lo))==null?void 0:A.state.data,T(this,lo)):n.placeholderData,n.select&&E!==void 0)try{E=n.select(E),le(this,Jn,null)}catch(D){le(this,Jn,D)}E!==void 0&&(b="success",h=ap(s==null?void 0:s.data,E,n),p=!0)}T(this,Jn)&&(y=T(this,Jn),h=T(this,ao),w=Date.now(),b="error");const m=u.fetchStatus==="fetching",v=b==="pending",x=b==="error",S=v&&m,C=h!==void 0,j={status:b,fetchStatus:u.fetchStatus,isPending:v,isSuccess:b==="success",isError:x,isInitialLoading:S,isLoading:S,data:h,dataUpdatedAt:u.dataUpdatedAt,error:y,errorUpdatedAt:w,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:m,isRefetching:m&&!v,isLoadingError:x&&!C,isPaused:u.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:x&&C,isStale:pm(t,n),refetch:this.refetch,promise:T(this,Qr)};if(this.options.experimental_prefetchInRender){const E=O=>{j.status==="error"?O.reject(j.error):j.data!==void 0&&O.resolve(j.data)},D=()=>{const O=le(this,Qr,j.promise=lp());E(O)},L=T(this,Qr);switch(L.status){case"pending":t.queryHash===r.queryHash&&E(L);break;case"fulfilled":(j.status==="error"||j.data!==L.value)&&D();break;case"rejected":(j.status!=="error"||j.error!==L.reason)&&D();break}}return j}updateResult(t){const n=T(this,Nt),r=this.createResult(T(this,_e),this.options);if(le(this,zi,T(this,_e).state),le(this,oo,this.options),T(this,zi).data!==void 0&&le(this,lo,T(this,_e)),Vc(r,n))return;le(this,Nt,r);const i={},s=()=>{if(!n)return!0;const{notifyOnChangeProps:o}=this.options,a=typeof o=="function"?o():o;if(a==="all"||!a&&!T(this,co).size)return!0;const l=new Set(a??T(this,co));return this.options.throwOnError&&l.add("error"),Object.keys(T(this,Nt)).some(c=>{const d=c;return T(this,Nt)[d]!==n[d]&&l.has(d)})};(t==null?void 0:t.listeners)!==!1&&s()&&(i.listeners=!0),we(this,je,Cb).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&we(this,je,fp).call(this)}},zt=new WeakMap,_e=new WeakMap,tl=new WeakMap,Nt=new WeakMap,zi=new WeakMap,oo=new WeakMap,Qr=new WeakMap,Jn=new WeakMap,nl=new WeakMap,ao=new WeakMap,lo=new WeakMap,Vi=new WeakMap,Ui=new WeakMap,Kr=new WeakMap,co=new WeakMap,je=new WeakSet,Jo=function(t){we(this,je,mp).call(this);let n=T(this,_e).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(yn)),n},cp=function(){we(this,je,pp).call(this);const t=Ys(this.options.staleTime,T(this,_e));if(rs||T(this,Nt).isStale||!sp(t))return;const r=mb(T(this,Nt).dataUpdatedAt,t)+1;le(this,Vi,setTimeout(()=>{T(this,Nt).isStale||this.updateResult()},r))},up=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(T(this,_e)):this.options.refetchInterval)??!1},dp=function(t){we(this,je,hp).call(this),le(this,Kr,t),!(rs||Ln(this.options.enabled,T(this,_e))===!1||!sp(T(this,Kr))||T(this,Kr)===0)&&le(this,Ui,setInterval(()=>{(this.options.refetchIntervalInBackground||fm.isFocused())&&we(this,je,Jo).call(this)},T(this,Kr)))},fp=function(){we(this,je,cp).call(this),we(this,je,dp).call(this,we(this,je,up).call(this))},pp=function(){T(this,Vi)&&(clearTimeout(T(this,Vi)),le(this,Vi,void 0))},hp=function(){T(this,Ui)&&(clearInterval(T(this,Ui)),le(this,Ui,void 0))},mp=function(){const t=T(this,zt).getQueryCache().build(T(this,zt),this.options);if(t===T(this,_e))return;const n=T(this,_e);le(this,_e,t),le(this,tl,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Cb=function(t){ct.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(T(this,Nt))}),T(this,zt).getQueryCache().notify({query:T(this,_e),type:"observerResultsUpdated"})})},Xx);function aE(e,t){return Ln(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Wv(e,t){return aE(e,t)||e.state.data!==void 0&&gp(e,t,t.refetchOnMount)}function gp(e,t,n){if(Ln(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&pm(e,t)}return!1}function qv(e,t,n,r){return(e!==t||Ln(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&pm(e,n)}function pm(e,t){return Ln(t.enabled,e)!==!1&&e.isStaleByTime(Ys(t.staleTime,e))}function lE(e,t){return!Vc(e.getCurrentResult(),t)}var Xr,Zr,Vt,xr,Sr,ac,vp,Zx,cE=(Zx=class extends jo{constructor(t,n){super();fe(this,Sr);fe(this,Xr);fe(this,Zr);fe(this,Vt);fe(this,xr);le(this,Xr,t),this.setOptions(n),this.bindMethods(),we(this,Sr,ac).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const n=this.options;this.options=T(this,Xr).defaultMutationOptions(t),Vc(this.options,n)||T(this,Xr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:T(this,Vt),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&is(n.mutationKey)!==is(this.options.mutationKey)?this.reset():((r=T(this,Vt))==null?void 0:r.state.status)==="pending"&&T(this,Vt).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=T(this,Vt))==null||t.removeObserver(this)}onMutationUpdate(t){we(this,Sr,ac).call(this),we(this,Sr,vp).call(this,t)}getCurrentResult(){return T(this,Zr)}reset(){var t;(t=T(this,Vt))==null||t.removeObserver(this),le(this,Vt,void 0),we(this,Sr,ac).call(this),we(this,Sr,vp).call(this)}mutate(t,n){var r;return le(this,xr,n),(r=T(this,Vt))==null||r.removeObserver(this),le(this,Vt,T(this,Xr).getMutationCache().build(T(this,Xr),this.options)),T(this,Vt).addObserver(this),T(this,Vt).execute(t)}},Xr=new WeakMap,Zr=new WeakMap,Vt=new WeakMap,xr=new WeakMap,Sr=new WeakSet,ac=function(){var n;const t=((n=T(this,Vt))==null?void 0:n.state)??Sb();le(this,Zr,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},vp=function(t){ct.batch(()=>{var n,r,i,s,o,a,l,c;if(T(this,xr)&&this.hasListeners()){const d=T(this,Zr).variables,u=T(this,Zr).context;(t==null?void 0:t.type)==="success"?((r=(n=T(this,xr)).onSuccess)==null||r.call(n,t.data,d,u),(s=(i=T(this,xr)).onSettled)==null||s.call(i,t.data,null,d,u)):(t==null?void 0:t.type)==="error"&&((a=(o=T(this,xr)).onError)==null||a.call(o,t.error,d,u),(c=(l=T(this,xr)).onSettled)==null||c.call(l,void 0,t.error,d,u))}this.listeners.forEach(d=>{d(T(this,Zr))})})},Zx),_b=g.createContext(void 0),Tb=e=>{const t=g.useContext(_b);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},uE=({client:e,children:t})=>(g.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),f.jsx(_b.Provider,{value:e,children:t})),Eb=g.createContext(!1),dE=()=>g.useContext(Eb);Eb.Provider;function fE(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var pE=g.createContext(fE()),hE=()=>g.useContext(pE);function Ab(e,t){return typeof e=="function"?e(...t):!!e}function yp(){}var mE=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},gE=e=>{g.useEffect(()=>{e.clearReset()},[e])},vE=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&Ab(n,[e.error,r]),yE=e=>{e.suspense&&(e.staleTime===void 0&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},xE=(e,t)=>e.isLoading&&e.isFetching&&!t,wE=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Gv=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function bE(e,t,n){var d,u,p,h,y;const r=Tb(),i=dE(),s=hE(),o=r.defaultQueryOptions(e);(u=(d=r.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||u.call(d,o),o._optimisticResults=i?"isRestoring":"optimistic",yE(o),mE(o,s),gE(s);const a=!r.getQueryCache().get(o.queryHash),[l]=g.useState(()=>new t(r,o)),c=l.getOptimisticResult(o);if(g.useSyncExternalStore(g.useCallback(w=>{const b=i?yp:l.subscribe(ct.batchCalls(w));return l.updateResult(),b},[l,i]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),g.useEffect(()=>{l.setOptions(o,{listeners:!1})},[o,l]),wE(o,c))throw Gv(o,l,s);if(vE({result:c,errorResetBoundary:s,throwOnError:o.throwOnError,query:r.getQueryCache().get(o.queryHash)}))throw c.error;if((h=(p=r.getDefaultOptions().queries)==null?void 0:p._experimental_afterQuery)==null||h.call(p,o,c),o.experimental_prefetchInRender&&!rs&&xE(c,i)){const w=a?Gv(o,l,s):(y=r.getQueryCache().get(o.queryHash))==null?void 0:y.promise;w==null||w.catch(yp).finally(()=>{l.updateResult()})}return o.notifyOnChangeProps?c:l.trackResult(c)}function jb(e,t){return bE(e,oE)}function hm(e,t){const n=Tb(),[r]=g.useState(()=>new cE(n,e));g.useEffect(()=>{r.setOptions(e)},[r,e]);const i=g.useSyncExternalStore(g.useCallback(o=>r.subscribe(ct.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=g.useCallback((o,a)=>{r.mutate(o,a).catch(yp)},[r]);if(i.error&&Ab(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}const kE=(e,t)=>jb({queryKey:["widgets",e,t],queryFn:()=>SE(e,t),retry:!1,throwOnError:!1}),SE=async(e,t)=>{const n=`widgets/with-link/${e}${t?`?device_id=${t}`:""}`,[r,i]=await Nr(n);if(i===204)throw new Error("User is banned");return r};var k=(e=>(e.Border="widget_border",e.Background="widget_background",e.InputBackground="widget_input_background",e.InputText="widget_input_text",e.InputBorder="widget_input_border",e.ButtonBackground="widget_button_background",e.ButtonText="widget_button_text",e.TooltipBackground="widget_tooltip_background",e.TooltipText="widget_tooltip_text",e.TooltipBorder="widget_tooltip_border",e.HeaderBackground="widget_header_background",e.HeaderText="widget_header_text",e.HeaderBorder="widget_header_border",e.FooterBackground="widget_footer_background",e.FooterText="widget_footer_text",e.FooterBorder="widget_footer_border",e.MessageAdminBackground="widget_message_admin_background",e.MessageAdminText="widget_message_admin_text",e.MessageVisitorBackground="widget_message_visitor_background",e.MessageVisitorText="widget_message_visitor_text",e.MessageAgentBackground="widget_message_agent_background",e.MessageAgentText="widget_message_agent_text",e.GreeterTopBackground="widget_greeter_top_background",e.GreeterTopText="widget_greeter_top_text",e.GreeterBackground="widget_greeter_background",e.GreeterText="widget_greeter_text",e.GreeterBorder="widget_greeter_border",e.GreeterButtonBackground="widget_greeter_button_background",e.GreeterButtonText="widget_greeter_button_text",e.CloseButtonBackground="widget_close_button_background",e.CloseButtonText="widget_close_button_text",e.CloseButtonHover="widget_close_button_hover",e.IconColor="widget_icon_color",e.IconBackground="widget_icon_background",e.ErrorBackground="widget_error_background",e.ErrorText="widget_error_text",e.ErrorBorder="widget_error_border",e.SuccessBackground="widget_success_background",e.SuccessText="widget_success_text",e.SuccessBorder="widget_success_border",e.WarningBackground="widget_warning_background",e.WarningText="widget_warning_text",e.WarningBorder="widget_warning_border",e.LinkColor="widget_link_color",e.LinkHoverColor="widget_link_hover_color",e.DividerColor="widget_divider_color",e.ShadowColor="widget_shadow_color",e.StarActiveColor="widget_star_active_color",e.StarInactiveColor="widget_star_inactive_color",e.ModalOverlayColor="widget_modal_overlay_color",e.ChatCloseConfirmText="widget_chat_close_confirm_text",e.RatingHeaderBackground="widget_rating_header_background",e.RatingHeaderText="widget_rating_header_text",e.RatingSuccessBackground="widget_rating_success_background",e.RatingSuccessText="widget_rating_success_text",e.RatingRateConversationText="widget_rating_rate_conversation_text",e))(k||{}),ie=(e=>(e.TooltipDefault="tooltip_default",e.TooltipActive="tooltip_active",e.CloseButtonAria="close_button_aria",e.MessagePlaceholder="message_placeholder",e.FileUploadDisabled="file_upload_disabled",e.NewMessagesNotification="new_messages_notification",e.ChatCloseConfirm="chat_close_confirm",e.ChatCloseWarning="chat_close_warning",e.ChatSettings="chat_settings",e.ChatEndConversation="chat_end_conversation",e.CancelAction="cancel_action",e.CloseAction="close_action",e.QuickActions="quick_actions",e.GreetingStartChat="greeting_start_chat",e.RateLimitMessage="rate_limit_message",e.RatingHeaderEvaluate="rating_header_evaluate",e.RatingHeaderThanks="rating_header_thanks",e.RatingDescription="rating_description",e.RatingRateConversation="rating_rate_conversation",e.RatingComment="rating_comment",e.RatingCommentPlaceholder="rating_comment_placeholder",e.RatingSubmit="rating_submit",e.RatingNewConversation="rating_new_conversation",e.RatingThankYouTitle="rating_thank_you_title",e.RatingThankYouDescription="rating_thank_you_description",e.RatingCountdown="rating_countdown",e.RatingMinimumError="rating_minimum_error",e.RatingYourScore="rating_your_score",e.PoweredBy="powered_by",e.NotificationSoundOn="notification_sound_on",e.NotificationSoundOff="notification_sound_off",e))(ie||{}),Le=(e=>(e.Light="light",e.Dark="dark",e.System="system",e))(Le||{});function CE(e){return!!e&&typeof e.public_id=="string"&&typeof e.link_id=="string"&&typeof e.name=="string"&&typeof e.is_browser_notification_enabled=="boolean"&&typeof e.is_hidden_on_offline=="boolean"&&typeof e.is_upload_disabled=="boolean"}/**
|
|
41
41
|
* @remix-run/router v1.21.0
|
|
42
42
|
*
|
|
43
43
|
* Copyright (c) Remix Software Inc.
|
|
@@ -46,7 +46,7 @@ Error generating stack: `+s.message+`
|
|
|
46
46
|
* LICENSE.md file in the root directory of this source tree.
|
|
47
47
|
*
|
|
48
48
|
* @license MIT
|
|
49
|
-
*/function
|
|
49
|
+
*/function Hc(){return Hc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Hc.apply(this,arguments)}var ti;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(ti||(ti={}));function _E(e){e===void 0&&(e={});let{initialEntries:t=["/"],initialIndex:n,v5Compat:r=!1}=e,i;i=t.map((h,y)=>d(h,typeof h=="string"?null:h.state,y===0?"default":void 0));let s=l(n??i.length-1),o=ti.Pop,a=null;function l(h){return Math.min(Math.max(h,0),i.length-1)}function c(){return i[s]}function d(h,y,w){y===void 0&&(y=null);let b=EE(i?c().pathname:"/",h,y,w);return mm(b.pathname.charAt(0)==="/","relative pathnames are not supported in memory history: "+JSON.stringify(h)),b}function u(h){return typeof h=="string"?h:AE(h)}return{get index(){return s},get action(){return o},get location(){return c()},createHref:u,createURL(h){return new URL(u(h),"http://localhost")},encodeLocation(h){let y=typeof h=="string"?ls(h):h;return{pathname:y.pathname||"",search:y.search||"",hash:y.hash||""}},push(h,y){o=ti.Push;let w=d(h,y);s+=1,i.splice(s,i.length,w),r&&a&&a({action:o,location:w,delta:1})},replace(h,y){o=ti.Replace;let w=d(h,y);i[s]=w,r&&a&&a({action:o,location:w,delta:0})},go(h){o=ti.Pop;let y=l(s+h),w=i[y];s=y,a&&a({action:o,location:w,delta:h})},listen(h){return a=h,()=>{a=null}}}}function mt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function mm(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function TE(){return Math.random().toString(36).substr(2,8)}function EE(e,t,n,r){return n===void 0&&(n=null),Hc({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ls(t):t,{state:n,key:t&&t.key||r||TE()})}function AE(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function ls(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}var Yv;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Yv||(Yv={}));function jE(e,t,n){return n===void 0&&(n="/"),RE(e,t,n,!1)}function RE(e,t,n,r){let i=typeof t=="string"?ls(t):t,s=Mb(i.pathname||"/",n);if(s==null)return null;let o=Rb(e);PE(o);let a=null;for(let l=0;a==null&&l<o.length;++l){let c=VE(s);a=BE(o[l],c,r)}return a}function Rb(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(s,o,a)=>{let l={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};l.relativePath.startsWith("/")&&(mt(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let c=qi([r,l.relativePath]),d=n.concat(l);s.children&&s.children.length>0&&(mt(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),Rb(s.children,t,d,c)),!(s.path==null&&!s.index)&&t.push({path:c,score:FE(c,s.index),routesMeta:d})};return e.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))i(s,o);else for(let l of Pb(s.path))i(s,o,l)}),t}function Pb(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let o=Pb(r.join("/")),a=[];return a.push(...o.map(l=>l===""?s:[s,l].join("/"))),i&&a.push(...o),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function PE(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:$E(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const ME=/^:[\w-]+$/,NE=3,OE=2,DE=1,IE=10,LE=-2,Qv=e=>e==="*";function FE(e,t){let n=e.split("/"),r=n.length;return n.some(Qv)&&(r+=LE),t&&(r+=OE),n.filter(i=>!Qv(i)).reduce((i,s)=>i+(ME.test(s)?NE:s===""?DE:IE),r)}function $E(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function BE(e,t,n){let{routesMeta:r}=e,i={},s="/",o=[];for(let a=0;a<r.length;++a){let l=r[a],c=a===r.length-1,d=s==="/"?t:t.slice(s.length)||"/",u=Kv({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},d),p=l.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=Kv({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},d)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:qi([s,u.pathname]),pathnameBase:YE(qi([s,u.pathnameBase])),route:p}),u.pathnameBase!=="/"&&(s=qi([s,u.pathnameBase]))}return o}function Kv(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=zE(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let s=i[0],o=s.replace(/(.)\/+$/,"$1"),a=i.slice(1);return{params:r.reduce((c,d,u)=>{let{paramName:p,isOptional:h}=d;if(p==="*"){let w=a[u]||"";o=s.slice(0,s.length-w.length).replace(/(.)\/+$/,"$1")}const y=a[u];return h&&!y?c[p]=void 0:c[p]=(y||"").replace(/%2F/g,"/"),c},{}),pathname:s,pathnameBase:o,pattern:e}}function zE(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),mm(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 r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function VE(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return mm(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Mb(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function UE(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?ls(e):e;return{pathname:n?n.startsWith("/")?n:HE(n,t):t,search:QE(r),hash:KE(i)}}function HE(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Pd(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function WE(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function qE(e,t){let n=WE(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function GE(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=ls(e):(i=Hc({},e),mt(!i.pathname||!i.pathname.includes("?"),Pd("?","pathname","search",i)),mt(!i.pathname||!i.pathname.includes("#"),Pd("#","pathname","hash",i)),mt(!i.search||!i.search.includes("#"),Pd("#","search","hash",i)));let s=e===""||i.pathname==="",o=s?"/":i.pathname,a;if(o==null)a=n;else{let u=t.length-1;if(!r&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),u-=1;i.pathname=p.join("/")}a=u>=0?t[u]:"/"}let l=UE(i,a),c=o&&o!=="/"&&o.endsWith("/"),d=(s||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||d)&&(l.pathname+="/"),l}const qi=e=>e.join("/").replace(/\/\/+/g,"/"),YE=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),QE=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,KE=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function XE(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Nb=["post","put","patch","delete"];new Set(Nb);const ZE=["get",...Nb];new Set(ZE);/**
|
|
50
50
|
* React Router v6.28.0
|
|
51
51
|
*
|
|
52
52
|
* Copyright (c) Remix Software Inc.
|
|
@@ -55,11 +55,11 @@ Error generating stack: `+s.message+`
|
|
|
55
55
|
* LICENSE.md file in the root directory of this source tree.
|
|
56
56
|
*
|
|
57
57
|
* @license MIT
|
|
58
|
-
*/function
|
|
58
|
+
*/function $a(){return $a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$a.apply(this,arguments)}const gm=g.createContext(null),JE=g.createContext(null),Cu=g.createContext(null),_u=g.createContext(null),Ro=g.createContext({outlet:null,matches:[],isDataRoute:!1}),Ob=g.createContext(null);function Tu(){return g.useContext(_u)!=null}function vm(){return Tu()||mt(!1),g.useContext(_u).location}function Db(e){g.useContext(Cu).static||g.useLayoutEffect(e)}function eA(){let{isDataRoute:e}=g.useContext(Ro);return e?pA():tA()}function tA(){Tu()||mt(!1);let e=g.useContext(gm),{basename:t,future:n,navigator:r}=g.useContext(Cu),{matches:i}=g.useContext(Ro),{pathname:s}=vm(),o=JSON.stringify(qE(i,n.v7_relativeSplatPath)),a=g.useRef(!1);return Db(()=>{a.current=!0}),g.useCallback(function(c,d){if(d===void 0&&(d={}),!a.current)return;if(typeof c=="number"){r.go(c);return}let u=GE(c,JSON.parse(o),s,d.relative==="path");e==null&&t!=="/"&&(u.pathname=u.pathname==="/"?t:qi([t,u.pathname])),(d.replace?r.replace:r.push)(u,d.state,d)},[t,r,o,s,e])}function nA(e,t){return rA(e,t)}function rA(e,t,n,r){Tu()||mt(!1);let{navigator:i}=g.useContext(Cu),{matches:s}=g.useContext(Ro),o=s[s.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let c=vm(),d;if(t){var u;let b=typeof t=="string"?ls(t):t;l==="/"||(u=b.pathname)!=null&&u.startsWith(l)||mt(!1),d=b}else d=c;let p=d.pathname||"/",h=p;if(l!=="/"){let b=l.replace(/^\//,"").split("/");h="/"+p.replace(/^\//,"").split("/").slice(b.length).join("/")}let y=jE(e,{pathname:h}),w=lA(y&&y.map(b=>Object.assign({},b,{params:Object.assign({},a,b.params),pathname:qi([l,i.encodeLocation?i.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?l:qi([l,i.encodeLocation?i.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),s,n,r);return t&&w?g.createElement(_u.Provider,{value:{location:$a({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:ti.Pop}},w):w}function iA(){let e=fA(),t=XE(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},t),n?g.createElement("pre",{style:i},n):null,null)}const sA=g.createElement(iA,null);class oA extends g.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?g.createElement(Ro.Provider,{value:this.props.routeContext},g.createElement(Ob.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function aA(e){let{routeContext:t,match:n,children:r}=e,i=g.useContext(gm);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),g.createElement(Ro.Provider,{value:t},r)}function lA(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var s;if(!n)return null;if(n.errors)e=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,a=(i=n)==null?void 0:i.errors;if(a!=null){let d=o.findIndex(u=>u.route.id&&(a==null?void 0:a[u.route.id])!==void 0);d>=0||mt(!1),o=o.slice(0,Math.min(o.length,d+1))}let l=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<o.length;d++){let u=o[d];if((u.route.HydrateFallback||u.route.hydrateFallbackElement)&&(c=d),u.route.id){let{loaderData:p,errors:h}=n,y=u.route.loader&&p[u.route.id]===void 0&&(!h||h[u.route.id]===void 0);if(u.route.lazy||y){l=!0,c>=0?o=o.slice(0,c+1):o=[o[0]];break}}}return o.reduceRight((d,u,p)=>{let h,y=!1,w=null,b=null;n&&(h=a&&u.route.id?a[u.route.id]:void 0,w=u.route.errorElement||sA,l&&(c<0&&p===0?(y=!0,b=null):c===p&&(y=!0,b=u.route.hydrateFallbackElement||null)));let m=t.concat(o.slice(0,p+1)),v=()=>{let x;return h?x=w:y?x=b:u.route.Component?x=g.createElement(u.route.Component,null):u.route.element?x=u.route.element:x=d,g.createElement(aA,{match:u,routeContext:{outlet:d,matches:m,isDataRoute:n!=null},children:x})};return n&&(u.route.ErrorBoundary||u.route.errorElement||p===0)?g.createElement(oA,{location:n.location,revalidation:n.revalidation,component:w,error:h,children:v(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):v()},null)}var Ib=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Ib||{}),Wc=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Wc||{});function cA(e){let t=g.useContext(gm);return t||mt(!1),t}function uA(e){let t=g.useContext(JE);return t||mt(!1),t}function dA(e){let t=g.useContext(Ro);return t||mt(!1),t}function Lb(e){let t=dA(),n=t.matches[t.matches.length-1];return n.route.id||mt(!1),n.route.id}function fA(){var e;let t=g.useContext(Ob),n=uA(Wc.UseRouteError),r=Lb(Wc.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function pA(){let{router:e}=cA(Ib.UseNavigateStable),t=Lb(Wc.UseNavigateStable),n=g.useRef(!1);return Db(()=>{n.current=!0}),g.useCallback(function(i,s){s===void 0&&(s={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,$a({fromRouteId:t},s)))},[e,t])}const Xv={};function hA(e,t){Xv[t]||(Xv[t]=!0,console.warn(t))}const Zv=(e,t,n)=>hA(e,"⚠️ React Router Future Flag Warning: "+t+". "+("You can use the `"+e+"` future flag to opt-in early. ")+("For more information, see "+n+"."));function mA(e,t){e!=null&&e.v7_startTransition||Zv("v7_startTransition","React Router will begin wrapping state updates in `React.startTransition` in v7","https://reactrouter.com/v6/upgrading/future#v7_starttransition"),!(e!=null&&e.v7_relativeSplatPath)&&!t&&Zv("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath")}const gA="startTransition",Jv=v2[gA];function vA(e){let{basename:t,children:n,initialEntries:r,initialIndex:i,future:s}=e,o=g.useRef();o.current==null&&(o.current=_E({initialEntries:r,initialIndex:i,v5Compat:!0}));let a=o.current,[l,c]=g.useState({action:a.action,location:a.location}),{v7_startTransition:d}=s||{},u=g.useCallback(p=>{d&&Jv?Jv(()=>c(p)):c(p)},[c,d]);return g.useLayoutEffect(()=>a.listen(u),[a,u]),g.useEffect(()=>mA(s),[s]),g.createElement(yA,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:a,future:s})}function xp(e){mt(!1)}function yA(e){let{basename:t="/",children:n=null,location:r,navigationType:i=ti.Pop,navigator:s,static:o=!1,future:a}=e;Tu()&&mt(!1);let l=t.replace(/^\/*/,"/"),c=g.useMemo(()=>({basename:l,navigator:s,static:o,future:$a({v7_relativeSplatPath:!1},a)}),[l,a,s,o]);typeof r=="string"&&(r=ls(r));let{pathname:d="/",search:u="",hash:p="",state:h=null,key:y="default"}=r,w=g.useMemo(()=>{let b=Mb(d,l);return b==null?null:{location:{pathname:b,search:u,hash:p,state:h,key:y},navigationType:i}},[l,d,u,p,h,y,i]);return w==null?null:g.createElement(Cu.Provider,{value:c},g.createElement(_u.Provider,{children:n,value:w}))}function xA(e){let{children:t,location:n}=e;return nA(wp(t),n)}new Promise(()=>{});function wp(e,t){t===void 0&&(t=[]);let n=[];return g.Children.forEach(e,(r,i)=>{if(!g.isValidElement(r))return;let s=[...t,i];if(r.type===g.Fragment){n.push.apply(n,wp(r.props.children,s));return}r.type!==xp&&mt(!1),!r.props.index||!r.props.children||mt(!1);let o={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=wp(r.props.children,s)),n.push(o)}),n}var Fb={exports:{}};/*!
|
|
59
59
|
Copyright (c) 2018 Jed Watson.
|
|
60
60
|
Licensed under the MIT License (MIT), see
|
|
61
61
|
http://jedwatson.github.io/classnames
|
|
62
|
-
*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var s="",o=0;o<arguments.length;o++){var a=arguments[o];a&&(s=i(s,r(a)))}return s}function r(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return n.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var o="";for(var a in s)t.call(s,a)&&s[a]&&(o=i(o,a));return o}function i(s,o){return o?s?s+" "+o:s+o:s}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(Tb);var aj=Tb.exports;const ze=Rr(aj);function lj(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const cj=e=>{switch(e){case"success":return fj;case"info":return hj;case"warning":return pj;case"error":return mj;default:return null}},uj=Array(12).fill(0),dj=({visible:e,className:t})=>J.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},J.createElement("div",{className:"sonner-spinner"},uj.map((n,r)=>J.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),fj=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},J.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"})),pj=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},J.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"})),hj=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},J.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"})),mj=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},J.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"})),gj=J.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"},J.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),J.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),vj=()=>{const[e,t]=J.useState(document.hidden);return J.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let mp=1;class yj{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...i}=t,s=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:mp++,o=this.toasts.find(l=>l.id===s),a=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),o?this.toasts=this.toasts.map(l=>l.id===s?(this.publish({...l,...t,id:s,title:r}),{...l,...t,id:s,dismissible:a,title:r}):l):this.addToast({title:r,...i,dismissible:a,id:s}),s},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0}))),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let s=r!==void 0,o;const a=i.then(async c=>{if(o=["resolve",c],J.isValidElement(c))s=!1,this.create({id:r,type:"default",message:c});else if(wj(c)&&!c.ok){s=!1;const u=typeof n.error=="function"?await n.error(`HTTP error! status: ${c.status}`):n.error,p=typeof n.description=="function"?await n.description(`HTTP error! status: ${c.status}`):n.description,m=typeof u=="object"?u:{message:u};this.create({id:r,type:"error",description:p,...m})}else if(c instanceof Error){s=!1;const u=typeof n.error=="function"?await n.error(c):n.error,p=typeof n.description=="function"?await n.description(c):n.description,m=typeof u=="object"?u:{message:u};this.create({id:r,type:"error",description:p,...m})}else if(n.success!==void 0){s=!1;const u=typeof n.success=="function"?await n.success(c):n.success,p=typeof n.description=="function"?await n.description(c):n.description,m=typeof u=="object"?u:{message:u};this.create({id:r,type:"success",description:p,...m})}}).catch(async c=>{if(o=["reject",c],n.error!==void 0){s=!1;const d=typeof n.error=="function"?await n.error(c):n.error,u=typeof n.description=="function"?await n.description(c):n.description,p=typeof d=="object"?d:{message:d};this.create({id:r,type:"error",description:u,...p})}}).finally(()=>{s&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),l=()=>new Promise((c,d)=>a.then(()=>o[0]==="reject"?d(o[1]):c(o[1])).catch(d));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||mp++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Ut=new yj,xj=(e,t)=>{const n=(t==null?void 0:t.id)||mp++;return Ut.addToast({title:e,...t,id:n}),n},wj=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",bj=xj,kj=()=>Ut.toasts,Sj=()=>Ut.getActiveToasts(),_b=Object.assign(bj,{success:Ut.success,info:Ut.info,warning:Ut.warning,error:Ut.error,custom:Ut.custom,message:Ut.message,promise:Ut.promise,dismiss:Ut.dismiss,loading:Ut.loading},{getHistory:kj,getToasts:Sj});lj("[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-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]::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 Ml(e){return e.label!==void 0}const Cj=3,Tj="24px",_j="16px",qv=4e3,Ej=356,jj=14,Aj=45,Rj=200;function Wn(...e){return e.filter(Boolean).join(" ")}function Pj(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const Mj=e=>{var t,n,r,i,s,o,a,l,c;const{invert:d,toast:u,unstyled:p,interacting:m,setHeights:y,visibleToasts:w,heights:x,index:h,toasts:g,expanded:k,removeToast:C,defaultRichColors:S,closeButton:T,style:j,cancelButtonStyle:E,actionButtonStyle:A,className:I="",descriptionClassName:N="",duration:D,position:G,gap:B,expandByDefault:F,classNames:M,icons:$,closeButtonAriaLabel:R="Close toast"}=e,[z,U]=J.useState(null),[W,q]=J.useState(null),[ne,oe]=J.useState(!1),[me,ue]=J.useState(!1),[Q,de]=J.useState(!1),[H,te]=J.useState(!1),[O,ee]=J.useState(!1),[K,xe]=J.useState(0),[ge,He]=J.useState(0),ot=J.useRef(u.duration||D||qv),Bt=J.useRef(null),se=J.useRef(null),ve=h===0,Je=h+1<=w,P=u.type,Z=u.dismissible!==!1,L=u.className||"",V=u.descriptionClassName||"",ae=J.useMemo(()=>x.findIndex(be=>be.toastId===u.id)||0,[x,u.id]),fe=J.useMemo(()=>{var be;return(be=u.closeButton)!=null?be:T},[u.closeButton,T]),Ce=J.useMemo(()=>u.duration||D||qv,[u.duration,D]),at=J.useRef(0),vt=J.useRef(0),Vn=J.useRef(0),un=J.useRef(null),[ys,fr]=G.split("-"),Nr=J.useMemo(()=>x.reduce((be,dt,St)=>St>=ae?be:be+dt.height,0),[x,ae]),xs=vj(),Mo=u.invert||d,ki=P==="loading";vt.current=J.useMemo(()=>ae*B+Nr,[ae,Nr]),J.useEffect(()=>{ot.current=Ce},[Ce]),J.useEffect(()=>{oe(!0)},[]),J.useEffect(()=>{const be=se.current;if(be){const dt=be.getBoundingClientRect().height;return He(dt),y(St=>[{toastId:u.id,height:dt,position:u.position},...St]),()=>y(St=>St.filter(Kt=>Kt.toastId!==u.id))}},[y,u.id]),J.useLayoutEffect(()=>{if(!ne)return;const be=se.current,dt=be.style.height;be.style.height="auto";const St=be.getBoundingClientRect().height;be.style.height=dt,He(St),y(Kt=>Kt.find(yt=>yt.toastId===u.id)?Kt.map(yt=>yt.toastId===u.id?{...yt,height:St}:yt):[{toastId:u.id,height:St,position:u.position},...Kt])},[ne,u.title,u.description,y,u.id]);const Un=J.useCallback(()=>{ue(!0),xe(vt.current),y(be=>be.filter(dt=>dt.toastId!==u.id)),setTimeout(()=>{C(u)},Rj)},[u,C,y,vt]);J.useEffect(()=>{if(u.promise&&P==="loading"||u.duration===1/0||u.type==="loading")return;let be;return k||m||xs?(()=>{if(Vn.current<at.current){const Kt=new Date().getTime()-at.current;ot.current=ot.current-Kt}Vn.current=new Date().getTime()})():(()=>{ot.current!==1/0&&(at.current=new Date().getTime(),be=setTimeout(()=>{u.onAutoClose==null||u.onAutoClose.call(u,u),Un()},ot.current))})(),()=>clearTimeout(be)},[k,m,u,P,xs,Un]),J.useEffect(()=>{u.delete&&Un()},[Un,u.delete]);function $C(){var be;if($!=null&&$.loading){var dt;return J.createElement("div",{className:Wn(M==null?void 0:M.loader,u==null||(dt=u.classNames)==null?void 0:dt.loader,"sonner-loader"),"data-visible":P==="loading"},$.loading)}return J.createElement(dj,{className:Wn(M==null?void 0:M.loader,u==null||(be=u.classNames)==null?void 0:be.loader),visible:P==="loading"})}var yg,xg;return J.createElement("li",{tabIndex:0,ref:se,className:Wn(I,L,M==null?void 0:M.toast,u==null||(t=u.classNames)==null?void 0:t.toast,M==null?void 0:M.default,M==null?void 0:M[P],u==null||(n=u.classNames)==null?void 0:n[P]),"data-sonner-toast":"","data-rich-colors":(yg=u.richColors)!=null?yg:S,"data-styled":!(u.jsx||u.unstyled||p),"data-mounted":ne,"data-promise":!!u.promise,"data-swiped":O,"data-removed":me,"data-visible":Je,"data-y-position":ys,"data-x-position":fr,"data-index":h,"data-front":ve,"data-swiping":Q,"data-dismissible":Z,"data-type":P,"data-invert":Mo,"data-swipe-out":H,"data-swipe-direction":W,"data-expanded":!!(k||F&&ne),style:{"--index":h,"--toasts-before":h,"--z-index":g.length-h,"--offset":`${me?K:vt.current}px`,"--initial-height":F?"auto":`${ge}px`,...j,...u.style},onDragEnd:()=>{de(!1),U(null),un.current=null},onPointerDown:be=>{ki||!Z||(Bt.current=new Date,xe(vt.current),be.target.setPointerCapture(be.pointerId),be.target.tagName!=="BUTTON"&&(de(!0),un.current={x:be.clientX,y:be.clientY}))},onPointerUp:()=>{var be,dt,St;if(H||!Z)return;un.current=null;const Kt=Number(((be=se.current)==null?void 0:be.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),dl=Number(((dt=se.current)==null?void 0:dt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),yt=new Date().getTime()-((St=Bt.current)==null?void 0:St.getTime()),dn=z==="x"?Kt:dl,fl=Math.abs(dn)/yt;if(Math.abs(dn)>=Aj||fl>.11){xe(vt.current),u.onDismiss==null||u.onDismiss.call(u,u),q(z==="x"?Kt>0?"right":"left":dl>0?"down":"up"),Un(),te(!0);return}else{var _n,En;(_n=se.current)==null||_n.style.setProperty("--swipe-amount-x","0px"),(En=se.current)==null||En.style.setProperty("--swipe-amount-y","0px")}ee(!1),de(!1),U(null)},onPointerMove:be=>{var dt,St,Kt;if(!un.current||!Z||((dt=window.getSelection())==null?void 0:dt.toString().length)>0)return;const yt=be.clientY-un.current.y,dn=be.clientX-un.current.x;var fl;const _n=(fl=e.swipeDirections)!=null?fl:Pj(G);!z&&(Math.abs(dn)>1||Math.abs(yt)>1)&&U(Math.abs(dn)>Math.abs(yt)?"x":"y");let En={x:0,y:0};const wg=Si=>1/(1.5+Math.abs(Si)/20);if(z==="y"){if(_n.includes("top")||_n.includes("bottom"))if(_n.includes("top")&&yt<0||_n.includes("bottom")&&yt>0)En.y=yt;else{const Si=yt*wg(yt);En.y=Math.abs(Si)<Math.abs(yt)?Si:yt}}else if(z==="x"&&(_n.includes("left")||_n.includes("right")))if(_n.includes("left")&&dn<0||_n.includes("right")&&dn>0)En.x=dn;else{const Si=dn*wg(dn);En.x=Math.abs(Si)<Math.abs(dn)?Si:dn}(Math.abs(En.x)>0||Math.abs(En.y)>0)&&ee(!0),(St=se.current)==null||St.style.setProperty("--swipe-amount-x",`${En.x}px`),(Kt=se.current)==null||Kt.style.setProperty("--swipe-amount-y",`${En.y}px`)}},fe&&!u.jsx&&P!=="loading"?J.createElement("button",{"aria-label":R,"data-disabled":ki,"data-close-button":!0,onClick:ki||!Z?()=>{}:()=>{Un(),u.onDismiss==null||u.onDismiss.call(u,u)},className:Wn(M==null?void 0:M.closeButton,u==null||(r=u.classNames)==null?void 0:r.closeButton)},(xg=$==null?void 0:$.close)!=null?xg:gj):null,P||u.icon||u.promise?J.createElement("div",{"data-icon":"",className:Wn(M==null?void 0:M.icon,u==null||(i=u.classNames)==null?void 0:i.icon)},u.promise||u.type==="loading"&&!u.icon?u.icon||$C():null,u.type!=="loading"?u.icon||($==null?void 0:$[P])||cj(P):null):null,J.createElement("div",{"data-content":"",className:Wn(M==null?void 0:M.content,u==null||(s=u.classNames)==null?void 0:s.content)},J.createElement("div",{"data-title":"",className:Wn(M==null?void 0:M.title,u==null||(o=u.classNames)==null?void 0:o.title)},u.jsx?u.jsx:typeof u.title=="function"?u.title():u.title),u.description?J.createElement("div",{"data-description":"",className:Wn(N,V,M==null?void 0:M.description,u==null||(a=u.classNames)==null?void 0:a.description)},typeof u.description=="function"?u.description():u.description):null),J.isValidElement(u.cancel)?u.cancel:u.cancel&&Ml(u.cancel)?J.createElement("button",{"data-button":!0,"data-cancel":!0,style:u.cancelButtonStyle||E,onClick:be=>{Ml(u.cancel)&&Z&&(u.cancel.onClick==null||u.cancel.onClick.call(u.cancel,be),Un())},className:Wn(M==null?void 0:M.cancelButton,u==null||(l=u.classNames)==null?void 0:l.cancelButton)},u.cancel.label):null,J.isValidElement(u.action)?u.action:u.action&&Ml(u.action)?J.createElement("button",{"data-button":!0,"data-action":!0,style:u.actionButtonStyle||A,onClick:be=>{Ml(u.action)&&(u.action.onClick==null||u.action.onClick.call(u.action,be),!be.defaultPrevented&&Un())},className:Wn(M==null?void 0:M.actionButton,u==null||(c=u.classNames)==null?void 0:c.actionButton)},u.action.label):null)};function Gv(){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 Oj(e,t){const n={};return[e,t].forEach((r,i)=>{const s=i===1,o=s?"--mobile-offset":"--offset",a=s?_j:Tj;function l(c){["top","right","bottom","left"].forEach(d=>{n[`${o}-${d}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${o}-${c}`]=a:n[`${o}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):l(a)}),n}const Nj=J.forwardRef(function(t,n){const{invert:r,position:i="bottom-right",hotkey:s=["altKey","KeyT"],expand:o,closeButton:a,className:l,offset:c,mobileOffset:d,theme:u="light",richColors:p,duration:m,style:y,visibleToasts:w=Cj,toastOptions:x,dir:h=Gv(),gap:g=jj,icons:k,containerAriaLabel:C="Notifications"}=t,[S,T]=J.useState([]),j=J.useMemo(()=>Array.from(new Set([i].concat(S.filter(W=>W.position).map(W=>W.position)))),[S,i]),[E,A]=J.useState([]),[I,N]=J.useState(!1),[D,G]=J.useState(!1),[B,F]=J.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),M=J.useRef(null),$=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),R=J.useRef(null),z=J.useRef(!1),U=J.useCallback(W=>{T(q=>{var ne;return(ne=q.find(oe=>oe.id===W.id))!=null&&ne.delete||Ut.dismiss(W.id),q.filter(({id:oe})=>oe!==W.id)})},[]);return J.useEffect(()=>Ut.subscribe(W=>{if(W.dismiss){const q=S.map(ne=>ne.id===W.id?{...ne,delete:!0}:ne);requestAnimationFrame(()=>{T(q)});return}setTimeout(()=>{m_.flushSync(()=>{T(q=>{const ne=q.findIndex(oe=>oe.id===W.id);return ne!==-1?[...q.slice(0,ne),{...q[ne],...W},...q.slice(ne+1)]:[W,...q]})})})}),[S]),J.useEffect(()=>{if(u!=="system"){F(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?F("dark"):F("light")),typeof window>"u")return;const W=window.matchMedia("(prefers-color-scheme: dark)");try{W.addEventListener("change",({matches:q})=>{F(q?"dark":"light")})}catch{W.addListener(({matches:ne})=>{try{F(ne?"dark":"light")}catch(oe){console.error(oe)}})}},[u]),J.useEffect(()=>{S.length<=1&&N(!1)},[S]),J.useEffect(()=>{const W=q=>{var ne;if(s.every(ue=>q[ue]||q.code===ue)){var me;N(!0),(me=M.current)==null||me.focus()}q.code==="Escape"&&(document.activeElement===M.current||(ne=M.current)!=null&&ne.contains(document.activeElement))&&N(!1)};return document.addEventListener("keydown",W),()=>document.removeEventListener("keydown",W)},[s]),J.useEffect(()=>{if(M.current)return()=>{R.current&&(R.current.focus({preventScroll:!0}),R.current=null,z.current=!1)}},[M.current]),J.createElement("section",{ref:n,"aria-label":`${C} ${$}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},j.map((W,q)=>{var ne;const[oe,me]=W.split("-");return S.length?J.createElement("ol",{key:W,dir:h==="auto"?Gv():h,tabIndex:-1,ref:M,className:l,"data-sonner-toaster":!0,"data-sonner-theme":B,"data-y-position":oe,"data-lifted":I&&S.length>1&&!o,"data-x-position":me,style:{"--front-toast-height":`${((ne=E[0])==null?void 0:ne.height)||0}px`,"--width":`${Ej}px`,"--gap":`${g}px`,...y,...Oj(c,d)},onBlur:ue=>{z.current&&!ue.currentTarget.contains(ue.relatedTarget)&&(z.current=!1,R.current&&(R.current.focus({preventScroll:!0}),R.current=null))},onFocus:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||z.current||(z.current=!0,R.current=ue.relatedTarget)},onMouseEnter:()=>N(!0),onMouseMove:()=>N(!0),onMouseLeave:()=>{D||N(!1)},onDragEnd:()=>N(!1),onPointerDown:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||G(!0)},onPointerUp:()=>G(!1)},S.filter(ue=>!ue.position&&q===0||ue.position===W).map((ue,Q)=>{var de,H;return J.createElement(Mj,{key:ue.id,icons:k,index:Q,toast:ue,defaultRichColors:p,duration:(de=x==null?void 0:x.duration)!=null?de:m,className:x==null?void 0:x.className,descriptionClassName:x==null?void 0:x.descriptionClassName,invert:r,visibleToasts:w,closeButton:(H=x==null?void 0:x.closeButton)!=null?H:a,interacting:D,position:W,style:x==null?void 0:x.style,unstyled:x==null?void 0:x.unstyled,classNames:x==null?void 0:x.classNames,cancelButtonStyle:x==null?void 0:x.cancelButtonStyle,actionButtonStyle:x==null?void 0:x.actionButtonStyle,closeButtonAriaLabel:x==null?void 0:x.closeButtonAriaLabel,removeToast:U,toasts:S.filter(te=>te.position==ue.position),heights:E.filter(te=>te.position==ue.position),setHeights:A,expandByDefault:o,gap:g,expanded:I,swipeDirections:t.swipeDirections})})):null}))});function er(e){return _b.custom(t=>f.jsx(Dj,{id:t,title:e.title,description:e.description,variant:e.variant}))}const Ed={success:{bg:"bg-green-100 border-green-200",text:"text-green-800"},error:{bg:"bg-red-100 border-red-200",text:"text-red-800"},warning:{bg:"bg-orange-100 border-orange-200",text:"text-orange-800"},info:{bg:"bg-blue-100 border-blue-200",text:"text-blue-800"}};function Dj(e){const{title:t,description:n,button:r,id:i,variant:s}=e;return f.jsxs("div",{className:ze("flex rounded-lg shadow-lg ring-1 ring-black/5 w-full md:max-w-[364px] items-center p-3 backdrop-blur-sm border mb-2",Ed[s||"info"].bg),children:[f.jsx("div",{className:"flex flex-1 items-center",children:f.jsxs("div",{className:"w-full",children:[t&&f.jsx("p",{className:ze("text-sm font-medium",Ed[s||"info"].text),children:t}),f.jsx("p",{className:ze("text-sm",Ed[s||"info"].text,{"mt-1":!!t}),children:n})]})}),r&&f.jsx("div",{className:"ml-5 shrink-0 rounded-md text-sm font-medium text-indigo-600 hover:text-indigo-500 focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 focus:outline-hidden",children:f.jsx("button",{className:"rounded bg-indigo-50 px-3 py-1 text-sm font-semibold text-indigo-600 hover:bg-indigo-100",onClick:()=>{r.onClick(),_b.dismiss(i)},children:r.label})})]})}function Ij(e){return Array.isArray(e)&&e[0].field!==void 0}const ho=(e,t)=>{var n;if(Ij(e)){for(const r of e)(n=t==null?void 0:t.form)==null||n.setFieldError(r.field,r.message);return}if(e&&e.message){t!=null&&t.noToast||er({description:e.message,variant:"error"});return}if(e&&e.error){t!=null&&t.noToast||er({description:e.error,variant:"error"});return}},Lj=[{code:429,text:"Çok fazla istek gönderdiniz. Lütfen biraz bekleyin"},{code:401,text:"Bu işlemi yapabilmek için giriş yapmalısınız"},{code:403,text:"Bu işlemi yapabilmek için yetkiniz yok"},{code:500,text:"Sunucu hatası oluştu"},{code:422,text:"Form doğrulaması başarısız oldu"},{code:413,text:"Yüklenen dosya boyutu izin verilen sınırı aştı"}],Fj=[{code:"FST_REQ_FILE_TOO_LARGE",text:"Yüklenen dosya boyutu izin verilen sınırı aştı"}],Bj=(e,t)=>{if($n(t))return!1;if(e===null)return er({description:"Bir hata oluştu",variant:"error"}),!0;if(typeof e=="object"&&e){const r=e.code;if(r){const i=Fj.find(s=>s.code===r);if(i)return er({description:i.text,variant:"error"}),!0}if(e.message)return er({description:e.message,variant:"error"}),!0}const n=Lj.find(r=>r.code===t);return er({description:n?n.text:"Bir hata oluştu",variant:"error"}),!0},$j={xs:{default:"!p-1",rounded:"!p-1"},sm:{default:"text-xs px-2 py-1.5",rounded:"p-1.5"},md:{default:"text-xs px-3 py-1.5",rounded:"p-2"},lg:{default:"text-sm px-4 py-2",rounded:"p-2.5"},xl:{default:"text-base px-5 py-3",rounded:"p-3"}},Yv={primary:{solid:"!border !border-transparent transition-colors",outline:"!bg-transparent !border transition-colors",subtle:"border border-transparent transition-colors",link:"hover:underline px-1.5 py-0 bg-transparent !border-none transition-colors"},secondary:{solid:"border border-transparent transition-colors",outline:"bg-transparent border transition-colors",subtle:"border border-transparent transition-colors",link:"hover:underline px-1.5 py-0 bg-transparent !border-none transition-colors"},danger:{solid:"border border-transparent transition-colors",outline:"bg-transparent border transition-colors",subtle:"border border-transparent transition-colors",link:"hover:underline px-1.5 py-0 bg-transparent !border-none transition-colors"},success:{solid:"border border-transparent transition-colors",outline:"bg-transparent border transition-colors",subtle:"border border-transparent transition-colors",link:"hover:underline px-1.5 py-0 bg-transparent !border-none transition-colors"},warning:{solid:"border border-transparent transition-colors",outline:"bg-transparent border transition-colors",subtle:"border border-transparent transition-colors",link:"hover:underline px-1.5 py-0 bg-transparent !border-none transition-colors"}},dm=v.createContext({});function ku(e){const t=v.useRef(null);return t.current===null&&(t.current=e()),t.current}const fm=typeof window<"u",Eb=fm?v.useLayoutEffect:v.useEffect,Su=v.createContext(null),pm=v.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class zj extends v.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,i=r instanceof HTMLElement&&r.offsetWidth||0,s=this.props.sizeRef.current;s.height=n.offsetHeight||0,s.width=n.offsetWidth||0,s.top=n.offsetTop,s.left=n.offsetLeft,s.right=i-s.width-s.left}return null}componentDidUpdate(){}render(){return this.props.children}}function Vj({children:e,isPresent:t,anchorX:n}){const r=v.useId(),i=v.useRef(null),s=v.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:o}=v.useContext(pm);return v.useInsertionEffect(()=>{const{width:a,height:l,top:c,left:d,right:u}=s.current;if(t||!i.current||!a||!l)return;const p=n==="left"?`left: ${d}`:`right: ${u}`;i.current.dataset.motionPopId=r;const m=document.createElement("style");return o&&(m.nonce=o),document.head.appendChild(m),m.sheet&&m.sheet.insertRule(`
|
|
62
|
+
*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var s="",o=0;o<arguments.length;o++){var a=arguments[o];a&&(s=i(s,r(a)))}return s}function r(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return n.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var o="";for(var a in s)t.call(s,a)&&s[a]&&(o=i(o,a));return o}function i(s,o){return o?s?s+" "+o:s+o:s}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(Fb);var wA=Fb.exports;const Ie=Pr(wA);function bA(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const kA=e=>{switch(e){case"success":return _A;case"info":return EA;case"warning":return TA;case"error":return AA;default:return null}},SA=Array(12).fill(0),CA=({visible:e,className:t})=>ee.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ee.createElement("div",{className:"sonner-spinner"},SA.map((n,r)=>ee.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),_A=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ee.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"})),TA=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ee.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"})),EA=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ee.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"})),AA=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ee.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"})),jA=ee.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"},ee.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ee.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),RA=()=>{const[e,t]=ee.useState(document.hidden);return ee.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let bp=1;class PA{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...i}=t,s=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:bp++,o=this.toasts.find(l=>l.id===s),a=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),o?this.toasts=this.toasts.map(l=>l.id===s?(this.publish({...l,...t,id:s,title:r}),{...l,...t,id:s,dismissible:a,title:r}):l):this.addToast({title:r,...i,dismissible:a,id:s}),s},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0}))),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let s=r!==void 0,o;const a=i.then(async c=>{if(o=["resolve",c],ee.isValidElement(c))s=!1,this.create({id:r,type:"default",message:c});else if(NA(c)&&!c.ok){s=!1;const u=typeof n.error=="function"?await n.error(`HTTP error! status: ${c.status}`):n.error,p=typeof n.description=="function"?await n.description(`HTTP error! status: ${c.status}`):n.description,h=typeof u=="object"?u:{message:u};this.create({id:r,type:"error",description:p,...h})}else if(c instanceof Error){s=!1;const u=typeof n.error=="function"?await n.error(c):n.error,p=typeof n.description=="function"?await n.description(c):n.description,h=typeof u=="object"?u:{message:u};this.create({id:r,type:"error",description:p,...h})}else if(n.success!==void 0){s=!1;const u=typeof n.success=="function"?await n.success(c):n.success,p=typeof n.description=="function"?await n.description(c):n.description,h=typeof u=="object"?u:{message:u};this.create({id:r,type:"success",description:p,...h})}}).catch(async c=>{if(o=["reject",c],n.error!==void 0){s=!1;const d=typeof n.error=="function"?await n.error(c):n.error,u=typeof n.description=="function"?await n.description(c):n.description,p=typeof d=="object"?d:{message:d};this.create({id:r,type:"error",description:u,...p})}}).finally(()=>{s&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),l=()=>new Promise((c,d)=>a.then(()=>o[0]==="reject"?d(o[1]):c(o[1])).catch(d));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||bp++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Ut=new PA,MA=(e,t)=>{const n=(t==null?void 0:t.id)||bp++;return Ut.addToast({title:e,...t,id:n}),n},NA=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",OA=MA,DA=()=>Ut.toasts,IA=()=>Ut.getActiveToasts(),$b=Object.assign(OA,{success:Ut.success,info:Ut.info,warning:Ut.warning,error:Ut.error,custom:Ut.custom,message:Ut.message,promise:Ut.promise,dismiss:Ut.dismiss,loading:Ut.loading},{getHistory:DA,getToasts:IA});bA("[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-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]::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 Ll(e){return e.label!==void 0}const LA=3,FA="24px",$A="16px",ey=4e3,BA=356,zA=14,VA=45,UA=200;function qn(...e){return e.filter(Boolean).join(" ")}function HA(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const WA=e=>{var t,n,r,i,s,o,a,l,c;const{invert:d,toast:u,unstyled:p,interacting:h,setHeights:y,visibleToasts:w,heights:b,index:m,toasts:v,expanded:x,removeToast:S,defaultRichColors:C,closeButton:_,style:j,cancelButtonStyle:A,actionButtonStyle:E,className:D="",descriptionClassName:L="",duration:O,position:q,gap:$,expandByDefault:B,classNames:I,icons:N,closeButtonAriaLabel:R="Close toast"}=e,[z,H]=ee.useState(null),[W,G]=ee.useState(null),[te,se]=ee.useState(!1),[pe,ue]=ee.useState(!1),[ke,Ne]=ee.useState(!1),[Q,V]=ee.useState(!1),[P,K]=ee.useState(!1),[Y,me]=ee.useState(0),[re,Ee]=ee.useState(0),ot=ee.useRef(u.duration||O||ey),$t=ee.useRef(null),oe=ee.useRef(null),ye=m===0,Oe=m+1<=w,M=u.type,J=u.dismissible!==!1,F=u.className||"",U=u.descriptionClassName||"",ae=ee.useMemo(()=>b.findIndex(xe=>xe.toastId===u.id)||0,[b,u.id]),de=ee.useMemo(()=>{var xe;return(xe=u.closeButton)!=null?xe:_},[u.closeButton,_]),Se=ee.useMemo(()=>u.duration||O||ey,[u.duration,O]),at=ee.useRef(0),vt=ee.useRef(0),Un=ee.useRef(0),dn=ee.useRef(null),[xs,fr]=q.split("-"),Dr=ee.useMemo(()=>b.reduce((xe,dt,St)=>St>=ae?xe:xe+dt.height,0),[b,ae]),ws=RA(),Io=u.invert||d,ki=M==="loading";vt.current=ee.useMemo(()=>ae*$+Dr,[ae,Dr]),ee.useEffect(()=>{ot.current=Se},[Se]),ee.useEffect(()=>{se(!0)},[]),ee.useEffect(()=>{const xe=oe.current;if(xe){const dt=xe.getBoundingClientRect().height;return Ee(dt),y(St=>[{toastId:u.id,height:dt,position:u.position},...St]),()=>y(St=>St.filter(Kt=>Kt.toastId!==u.id))}},[y,u.id]),ee.useLayoutEffect(()=>{if(!te)return;const xe=oe.current,dt=xe.style.height;xe.style.height="auto";const St=xe.getBoundingClientRect().height;xe.style.height=dt,Ee(St),y(Kt=>Kt.find(yt=>yt.toastId===u.id)?Kt.map(yt=>yt.toastId===u.id?{...yt,height:St}:yt):[{toastId:u.id,height:St,position:u.position},...Kt])},[te,u.title,u.description,y,u.id]);const Hn=ee.useCallback(()=>{ue(!0),me(vt.current),y(xe=>xe.filter(dt=>dt.toastId!==u.id)),setTimeout(()=>{S(u)},UA)},[u,S,y,vt]);ee.useEffect(()=>{if(u.promise&&M==="loading"||u.duration===1/0||u.type==="loading")return;let xe;return x||h||ws?(()=>{if(Un.current<at.current){const Kt=new Date().getTime()-at.current;ot.current=ot.current-Kt}Un.current=new Date().getTime()})():(()=>{ot.current!==1/0&&(at.current=new Date().getTime(),xe=setTimeout(()=>{u.onAutoClose==null||u.onAutoClose.call(u,u),Hn()},ot.current))})(),()=>clearTimeout(xe)},[x,h,u,M,ws,Hn]),ee.useEffect(()=>{u.delete&&Hn()},[Hn,u.delete]);function JC(){var xe;if(N!=null&&N.loading){var dt;return ee.createElement("div",{className:qn(I==null?void 0:I.loader,u==null||(dt=u.classNames)==null?void 0:dt.loader,"sonner-loader"),"data-visible":M==="loading"},N.loading)}return ee.createElement(CA,{className:qn(I==null?void 0:I.loader,u==null||(xe=u.classNames)==null?void 0:xe.loader),visible:M==="loading"})}var Tg,Eg;return ee.createElement("li",{tabIndex:0,ref:oe,className:qn(D,F,I==null?void 0:I.toast,u==null||(t=u.classNames)==null?void 0:t.toast,I==null?void 0:I.default,I==null?void 0:I[M],u==null||(n=u.classNames)==null?void 0:n[M]),"data-sonner-toast":"","data-rich-colors":(Tg=u.richColors)!=null?Tg:C,"data-styled":!(u.jsx||u.unstyled||p),"data-mounted":te,"data-promise":!!u.promise,"data-swiped":P,"data-removed":pe,"data-visible":Oe,"data-y-position":xs,"data-x-position":fr,"data-index":m,"data-front":ye,"data-swiping":ke,"data-dismissible":J,"data-type":M,"data-invert":Io,"data-swipe-out":Q,"data-swipe-direction":W,"data-expanded":!!(x||B&&te),style:{"--index":m,"--toasts-before":m,"--z-index":v.length-m,"--offset":`${pe?Y:vt.current}px`,"--initial-height":B?"auto":`${re}px`,...j,...u.style},onDragEnd:()=>{Ne(!1),H(null),dn.current=null},onPointerDown:xe=>{ki||!J||($t.current=new Date,me(vt.current),xe.target.setPointerCapture(xe.pointerId),xe.target.tagName!=="BUTTON"&&(Ne(!0),dn.current={x:xe.clientX,y:xe.clientY}))},onPointerUp:()=>{var xe,dt,St;if(Q||!J)return;dn.current=null;const Kt=Number(((xe=oe.current)==null?void 0:xe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),gl=Number(((dt=oe.current)==null?void 0:dt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),yt=new Date().getTime()-((St=$t.current)==null?void 0:St.getTime()),fn=z==="x"?Kt:gl,vl=Math.abs(fn)/yt;if(Math.abs(fn)>=VA||vl>.11){me(vt.current),u.onDismiss==null||u.onDismiss.call(u,u),G(z==="x"?Kt>0?"right":"left":gl>0?"down":"up"),Hn(),V(!0);return}else{var En,An;(En=oe.current)==null||En.style.setProperty("--swipe-amount-x","0px"),(An=oe.current)==null||An.style.setProperty("--swipe-amount-y","0px")}K(!1),Ne(!1),H(null)},onPointerMove:xe=>{var dt,St,Kt;if(!dn.current||!J||((dt=window.getSelection())==null?void 0:dt.toString().length)>0)return;const yt=xe.clientY-dn.current.y,fn=xe.clientX-dn.current.x;var vl;const En=(vl=e.swipeDirections)!=null?vl:HA(q);!z&&(Math.abs(fn)>1||Math.abs(yt)>1)&&H(Math.abs(fn)>Math.abs(yt)?"x":"y");let An={x:0,y:0};const Ag=Si=>1/(1.5+Math.abs(Si)/20);if(z==="y"){if(En.includes("top")||En.includes("bottom"))if(En.includes("top")&&yt<0||En.includes("bottom")&&yt>0)An.y=yt;else{const Si=yt*Ag(yt);An.y=Math.abs(Si)<Math.abs(yt)?Si:yt}}else if(z==="x"&&(En.includes("left")||En.includes("right")))if(En.includes("left")&&fn<0||En.includes("right")&&fn>0)An.x=fn;else{const Si=fn*Ag(fn);An.x=Math.abs(Si)<Math.abs(fn)?Si:fn}(Math.abs(An.x)>0||Math.abs(An.y)>0)&&K(!0),(St=oe.current)==null||St.style.setProperty("--swipe-amount-x",`${An.x}px`),(Kt=oe.current)==null||Kt.style.setProperty("--swipe-amount-y",`${An.y}px`)}},de&&!u.jsx&&M!=="loading"?ee.createElement("button",{"aria-label":R,"data-disabled":ki,"data-close-button":!0,onClick:ki||!J?()=>{}:()=>{Hn(),u.onDismiss==null||u.onDismiss.call(u,u)},className:qn(I==null?void 0:I.closeButton,u==null||(r=u.classNames)==null?void 0:r.closeButton)},(Eg=N==null?void 0:N.close)!=null?Eg:jA):null,M||u.icon||u.promise?ee.createElement("div",{"data-icon":"",className:qn(I==null?void 0:I.icon,u==null||(i=u.classNames)==null?void 0:i.icon)},u.promise||u.type==="loading"&&!u.icon?u.icon||JC():null,u.type!=="loading"?u.icon||(N==null?void 0:N[M])||kA(M):null):null,ee.createElement("div",{"data-content":"",className:qn(I==null?void 0:I.content,u==null||(s=u.classNames)==null?void 0:s.content)},ee.createElement("div",{"data-title":"",className:qn(I==null?void 0:I.title,u==null||(o=u.classNames)==null?void 0:o.title)},u.jsx?u.jsx:typeof u.title=="function"?u.title():u.title),u.description?ee.createElement("div",{"data-description":"",className:qn(L,U,I==null?void 0:I.description,u==null||(a=u.classNames)==null?void 0:a.description)},typeof u.description=="function"?u.description():u.description):null),ee.isValidElement(u.cancel)?u.cancel:u.cancel&&Ll(u.cancel)?ee.createElement("button",{"data-button":!0,"data-cancel":!0,style:u.cancelButtonStyle||A,onClick:xe=>{Ll(u.cancel)&&J&&(u.cancel.onClick==null||u.cancel.onClick.call(u.cancel,xe),Hn())},className:qn(I==null?void 0:I.cancelButton,u==null||(l=u.classNames)==null?void 0:l.cancelButton)},u.cancel.label):null,ee.isValidElement(u.action)?u.action:u.action&&Ll(u.action)?ee.createElement("button",{"data-button":!0,"data-action":!0,style:u.actionButtonStyle||E,onClick:xe=>{Ll(u.action)&&(u.action.onClick==null||u.action.onClick.call(u.action,xe),!xe.defaultPrevented&&Hn())},className:qn(I==null?void 0:I.actionButton,u==null||(c=u.classNames)==null?void 0:c.actionButton)},u.action.label):null)};function ty(){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 qA(e,t){const n={};return[e,t].forEach((r,i)=>{const s=i===1,o=s?"--mobile-offset":"--offset",a=s?$A:FA;function l(c){["top","right","bottom","left"].forEach(d=>{n[`${o}-${d}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${o}-${c}`]=a:n[`${o}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):l(a)}),n}const GA=ee.forwardRef(function(t,n){const{invert:r,position:i="bottom-right",hotkey:s=["altKey","KeyT"],expand:o,closeButton:a,className:l,offset:c,mobileOffset:d,theme:u="light",richColors:p,duration:h,style:y,visibleToasts:w=LA,toastOptions:b,dir:m=ty(),gap:v=zA,icons:x,containerAriaLabel:S="Notifications"}=t,[C,_]=ee.useState([]),j=ee.useMemo(()=>Array.from(new Set([i].concat(C.filter(W=>W.position).map(W=>W.position)))),[C,i]),[A,E]=ee.useState([]),[D,L]=ee.useState(!1),[O,q]=ee.useState(!1),[$,B]=ee.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),I=ee.useRef(null),N=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),R=ee.useRef(null),z=ee.useRef(!1),H=ee.useCallback(W=>{_(G=>{var te;return(te=G.find(se=>se.id===W.id))!=null&&te.delete||Ut.dismiss(W.id),G.filter(({id:se})=>se!==W.id)})},[]);return ee.useEffect(()=>Ut.subscribe(W=>{if(W.dismiss){const G=C.map(te=>te.id===W.id?{...te,delete:!0}:te);requestAnimationFrame(()=>{_(G)});return}setTimeout(()=>{AT.flushSync(()=>{_(G=>{const te=G.findIndex(se=>se.id===W.id);return te!==-1?[...G.slice(0,te),{...G[te],...W},...G.slice(te+1)]:[W,...G]})})})}),[C]),ee.useEffect(()=>{if(u!=="system"){B(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?B("dark"):B("light")),typeof window>"u")return;const W=window.matchMedia("(prefers-color-scheme: dark)");try{W.addEventListener("change",({matches:G})=>{B(G?"dark":"light")})}catch{W.addListener(({matches:te})=>{try{B(te?"dark":"light")}catch(se){console.error(se)}})}},[u]),ee.useEffect(()=>{C.length<=1&&L(!1)},[C]),ee.useEffect(()=>{const W=G=>{var te;if(s.every(ue=>G[ue]||G.code===ue)){var pe;L(!0),(pe=I.current)==null||pe.focus()}G.code==="Escape"&&(document.activeElement===I.current||(te=I.current)!=null&&te.contains(document.activeElement))&&L(!1)};return document.addEventListener("keydown",W),()=>document.removeEventListener("keydown",W)},[s]),ee.useEffect(()=>{if(I.current)return()=>{R.current&&(R.current.focus({preventScroll:!0}),R.current=null,z.current=!1)}},[I.current]),ee.createElement("section",{ref:n,"aria-label":`${S} ${N}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},j.map((W,G)=>{var te;const[se,pe]=W.split("-");return C.length?ee.createElement("ol",{key:W,dir:m==="auto"?ty():m,tabIndex:-1,ref:I,className:l,"data-sonner-toaster":!0,"data-sonner-theme":$,"data-y-position":se,"data-lifted":D&&C.length>1&&!o,"data-x-position":pe,style:{"--front-toast-height":`${((te=A[0])==null?void 0:te.height)||0}px`,"--width":`${BA}px`,"--gap":`${v}px`,...y,...qA(c,d)},onBlur:ue=>{z.current&&!ue.currentTarget.contains(ue.relatedTarget)&&(z.current=!1,R.current&&(R.current.focus({preventScroll:!0}),R.current=null))},onFocus:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||z.current||(z.current=!0,R.current=ue.relatedTarget)},onMouseEnter:()=>L(!0),onMouseMove:()=>L(!0),onMouseLeave:()=>{O||L(!1)},onDragEnd:()=>L(!1),onPointerDown:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||q(!0)},onPointerUp:()=>q(!1)},C.filter(ue=>!ue.position&&G===0||ue.position===W).map((ue,ke)=>{var Ne,Q;return ee.createElement(WA,{key:ue.id,icons:x,index:ke,toast:ue,defaultRichColors:p,duration:(Ne=b==null?void 0:b.duration)!=null?Ne:h,className:b==null?void 0:b.className,descriptionClassName:b==null?void 0:b.descriptionClassName,invert:r,visibleToasts:w,closeButton:(Q=b==null?void 0:b.closeButton)!=null?Q:a,interacting:O,position:W,style:b==null?void 0:b.style,unstyled:b==null?void 0:b.unstyled,classNames:b==null?void 0:b.classNames,cancelButtonStyle:b==null?void 0:b.cancelButtonStyle,actionButtonStyle:b==null?void 0:b.actionButtonStyle,closeButtonAriaLabel:b==null?void 0:b.closeButtonAriaLabel,removeToast:H,toasts:C.filter(V=>V.position==ue.position),heights:A.filter(V=>V.position==ue.position),setHeights:E,expandByDefault:o,gap:v,expanded:D,swipeDirections:t.swipeDirections})})):null}))});function en(e){return $b.custom(t=>f.jsx(YA,{id:t,title:e.title,description:e.description,variant:e.variant}))}const Md={success:{bg:"bg-green-100 border-green-200",text:"text-green-800"},error:{bg:"bg-red-100 border-red-200",text:"text-red-800"},warning:{bg:"bg-orange-100 border-orange-200",text:"text-orange-800"},info:{bg:"bg-blue-100 border-blue-200",text:"text-blue-800"}};function YA(e){const{title:t,description:n,button:r,id:i,variant:s}=e;return f.jsxs("div",{className:Ie("flex rounded-lg shadow-lg ring-1 ring-black/5 w-full md:max-w-[364px] items-center p-3 backdrop-blur-sm border mb-2",Md[s||"info"].bg),children:[f.jsx("div",{className:"flex flex-1 items-center",children:f.jsxs("div",{className:"w-full",children:[t&&f.jsx("p",{className:Ie("text-sm font-medium",Md[s||"info"].text),children:t}),f.jsx("p",{className:Ie("text-sm",Md[s||"info"].text,{"mt-1":!!t}),children:n})]})}),r&&f.jsx("div",{className:"ml-5 shrink-0 rounded-md text-sm font-medium text-indigo-600 hover:text-indigo-500 focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 focus:outline-hidden",children:f.jsx("button",{className:"rounded bg-indigo-50 px-3 py-1 text-sm font-semibold text-indigo-600 hover:bg-indigo-100",onClick:()=>{r.onClick(),$b.dismiss(i)},children:r.label})})]})}function QA(e){return Array.isArray(e)&&e[0].field!==void 0}const yo=(e,t)=>{var n;if(QA(e)){for(const r of e)(n=t==null?void 0:t.form)==null||n.setFieldError(r.field,r.message);return}if(e&&e.message){t!=null&&t.noToast||en({description:e.message,variant:"error"});return}if(e&&e.error){t!=null&&t.noToast||en({description:e.error,variant:"error"});return}},KA=[{code:429,text:"Çok fazla istek gönderdiniz. Lütfen biraz bekleyin"},{code:401,text:"Bu işlemi yapabilmek için giriş yapmalısınız"},{code:403,text:"Bu işlemi yapabilmek için yetkiniz yok"},{code:500,text:"Sunucu hatası oluştu"},{code:422,text:"Form doğrulaması başarısız oldu"},{code:413,text:"Yüklenen dosya boyutu izin verilen sınırı aştı"}],XA=[{code:"FST_REQ_FILE_TOO_LARGE",text:"Yüklenen dosya boyutu izin verilen sınırı aştı"},{code:"AUTH_TOKEN_NOT_PRESENT",text:"Oturum bilgisi bulunamadı. Lütfen sohbeti yeniden başlatın"},{code:"AUTH_TOKEN_NOT_VALID",text:"Oturum süreniz dolmuş olabilir. Lütfen sohbeti yeniden başlatın"},{code:"AUTH_VERIFY_REQUIRED",text:"Hesap doğrulaması gerekiyor. Lütfen doğrulama adımını tamamlayın"},{code:"AUTH_INVALID_OWNER_TYPE",text:"Bu işlem için geçerli ziyaretçi oturumu bulunamadı"}],Wo=(e,t)=>t?`${e} (Kod: ${t})`:e,ZA=(e,t)=>{if(zn(t))return!1;if(e===null)return en({description:"Bir hata oluştu",variant:"error"}),!0;if(typeof e=="object"&&e){const r=e.code;if(r){const i=XA.find(s=>s.code===r);if(i)return en({description:Wo(i.text,r),variant:"error"}),!0}if(t===401){if(e.tokenNotPresent)return en({description:Wo("Oturum bilgisi bulunamadı. Lütfen sohbeti yeniden başlatın","AUTH_TOKEN_NOT_PRESENT"),variant:"error"}),!0;if(e.tokenNotValid)return en({description:Wo("Oturum süreniz dolmuş olabilir. Lütfen sohbeti yeniden başlatın","AUTH_TOKEN_NOT_VALID"),variant:"error"}),!0;if(e.verifyRequired)return en({description:Wo("Hesap doğrulaması gerekiyor. Lütfen doğrulama adımını tamamlayın","AUTH_VERIFY_REQUIRED"),variant:"error"}),!0}if(e.message)return en({description:Wo(e.message,r),variant:"error"}),!0}const n=KA.find(r=>r.code===t);return en({description:n?n.text:"Bir hata oluştu",variant:"error"}),!0},JA={xs:{default:"!p-1",rounded:"!p-1"},sm:{default:"text-xs px-2 py-1.5",rounded:"p-1.5"},md:{default:"text-xs px-3 py-1.5",rounded:"p-2"},lg:{default:"text-sm px-4 py-2",rounded:"p-2.5"},xl:{default:"text-base px-5 py-3",rounded:"p-3"}},ny={primary:{solid:"!border !border-transparent transition-colors",outline:"!bg-transparent !border transition-colors",subtle:"border border-transparent transition-colors",link:"hover:underline px-1.5 py-0 bg-transparent !border-none transition-colors"},secondary:{solid:"border border-transparent transition-colors",outline:"bg-transparent border transition-colors",subtle:"border border-transparent transition-colors",link:"hover:underline px-1.5 py-0 bg-transparent !border-none transition-colors"},danger:{solid:"border border-transparent transition-colors",outline:"bg-transparent border transition-colors",subtle:"border border-transparent transition-colors",link:"hover:underline px-1.5 py-0 bg-transparent !border-none transition-colors"},success:{solid:"border border-transparent transition-colors",outline:"bg-transparent border transition-colors",subtle:"border border-transparent transition-colors",link:"hover:underline px-1.5 py-0 bg-transparent !border-none transition-colors"},warning:{solid:"border border-transparent transition-colors",outline:"bg-transparent border transition-colors",subtle:"border border-transparent transition-colors",link:"hover:underline px-1.5 py-0 bg-transparent !border-none transition-colors"}},ym=g.createContext({});function Eu(e){const t=g.useRef(null);return t.current===null&&(t.current=e()),t.current}const xm=typeof window<"u",Bb=xm?g.useLayoutEffect:g.useEffect,Au=g.createContext(null),wm=g.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class ej extends g.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,i=r instanceof HTMLElement&&r.offsetWidth||0,s=this.props.sizeRef.current;s.height=n.offsetHeight||0,s.width=n.offsetWidth||0,s.top=n.offsetTop,s.left=n.offsetLeft,s.right=i-s.width-s.left}return null}componentDidUpdate(){}render(){return this.props.children}}function tj({children:e,isPresent:t,anchorX:n}){const r=g.useId(),i=g.useRef(null),s=g.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:o}=g.useContext(wm);return g.useInsertionEffect(()=>{const{width:a,height:l,top:c,left:d,right:u}=s.current;if(t||!i.current||!a||!l)return;const p=n==="left"?`left: ${d}`:`right: ${u}`;i.current.dataset.motionPopId=r;const h=document.createElement("style");return o&&(h.nonce=o),document.head.appendChild(h),h.sheet&&h.sheet.insertRule(`
|
|
63
63
|
[data-motion-pop-id="${r}"] {
|
|
64
64
|
position: absolute !important;
|
|
65
65
|
width: ${a}px !important;
|
|
@@ -67,7 +67,7 @@ Error generating stack: `+s.message+`
|
|
|
67
67
|
${p}px !important;
|
|
68
68
|
top: ${c}px !important;
|
|
69
69
|
}
|
|
70
|
-
`),()=>{document.head.removeChild(m)}},[t]),f.jsx(zj,{isPresent:t,childRef:i,sizeRef:s,children:v.cloneElement(e,{ref:i})})}const Uj=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:o,anchorX:a})=>{const l=ku(Hj),c=v.useId();let d=!0,u=v.useMemo(()=>(d=!1,{id:c,initial:t,isPresent:n,custom:i,onExitComplete:p=>{l.set(p,!0);for(const m of l.values())if(!m)return;r&&r()},register:p=>(l.set(p,!1),()=>l.delete(p))}),[n,l,r]);return s&&d&&(u={...u}),v.useMemo(()=>{l.forEach((p,m)=>l.set(m,!1))},[n]),v.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),o==="popLayout"&&(e=f.jsx(Vj,{isPresent:n,anchorX:a,children:e})),f.jsx(Su.Provider,{value:u,children:e})};function Hj(){return new Map}function jb(e=!0){const t=v.useContext(Su);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,s=v.useId();v.useEffect(()=>{if(e)return i(s)},[e]);const o=v.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,o]:[!0]}const Ol=e=>e.key||"";function Qv(e){const t=[];return v.Children.forEach(e,n=>{v.isValidElement(n)&&t.push(n)}),t}const jr=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:o=!1,anchorX:a="left"})=>{const[l,c]=jb(o),d=v.useMemo(()=>Qv(e),[e]),u=o&&!l?[]:d.map(Ol),p=v.useRef(!0),m=v.useRef(d),y=ku(()=>new Map),[w,x]=v.useState(d),[h,g]=v.useState(d);Eb(()=>{p.current=!1,m.current=d;for(let S=0;S<h.length;S++){const T=Ol(h[S]);u.includes(T)?y.delete(T):y.get(T)!==!0&&y.set(T,!1)}},[h,u.length,u.join("-")]);const k=[];if(d!==w){let S=[...d];for(let T=0;T<h.length;T++){const j=h[T],E=Ol(j);u.includes(E)||(S.splice(T,0,j),k.push(j))}return s==="wait"&&k.length&&(S=k),g(Qv(S)),x(d),null}const{forceRender:C}=v.useContext(dm);return f.jsx(f.Fragment,{children:h.map(S=>{const T=Ol(S),j=o&&!l?!1:d===h||u.includes(T),E=()=>{if(y.has(T))y.set(T,!0);else return;let A=!0;y.forEach(I=>{I||(A=!1)}),A&&(C==null||C(),g(m.current),o&&(c==null||c()),r&&r())};return f.jsx(Uj,{isPresent:j,initial:!p.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:s,onExitComplete:j?void 0:E,anchorX:a,children:S},T)})})};function hm(e,t){e.indexOf(t)===-1&&e.push(t)}function mm(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}let gp=()=>{};const vp={skipAnimations:!1,useManualTiming:!1};function gm(e){let t;return()=>(t===void 0&&(t=e()),t)}const Sn=e=>e,Da=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class vm{constructor(){this.subscriptions=[]}add(t){return hm(this.subscriptions,t),()=>mm(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let s=0;s<i;s++){const o=this.subscriptions[s];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const rr=e=>e*1e3,ir=e=>e/1e3;function Ab(e,t){return t?e*(1e3/t):0}const Wj=gm(()=>window.ScrollTimeline!==void 0);class qj{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(i=>{if(Wj()&&i.attachTimeline)return i.attachTimeline(t);if(typeof n=="function")return n(i)});return()=>{r.forEach((i,s)=>{i&&i(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class Gj extends qj{then(t,n){return this.finished.finally(t).then(()=>{})}}const Kv={value:null,addProjectionMetrics:null},ym=e=>Array.isArray(e)&&typeof e[0]=="number",Yj={};function Qj(e,t){const n=gm(e);return()=>Yj[t]??n()}const Ia=Qj(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Rb=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let s=0;s<i;s++)r+=e(s/(i-1))+", ";return`linear(${r.substring(0,r.length-2)})`},Qo=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,yp={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Qo([0,.65,.55,1]),circOut:Qo([.55,0,1,.45]),backIn:Qo([.31,.01,.66,-.59]),backOut:Qo([.33,1.53,.69,.99])};function Pb(e,t){if(e)return typeof e=="function"&&Ia()?Rb(e,t):ym(e)?Qo(e):Array.isArray(e)?e.map(n=>Pb(n,t)||yp.easeOut):yp[e]}function Kj(e,t,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a="easeInOut",times:l}={},c=void 0){const d={[t]:n};l&&(d.offset=l);const u=Pb(a,i);return Array.isArray(u)&&(d.easing=u),e.animate(d,{delay:r,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal",pseudoElement:c})}function xm(e){return typeof e=="function"&&"applyToOptions"in e}function wm(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const zc=2e4;function bm(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<zc;)t+=n,r=e.next(t);return t>=zc?1/0:t}function Xj(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(bm(r),zc);return{type:"keyframes",ease:s=>r.next(i*s).value/t,duration:ir(i)}}function Mb(e){return!!(typeof e=="function"&&Ia()||!e||typeof e=="string"&&(e in yp||Ia())||ym(e)||Array.isArray(e)&&e.every(Mb))}function Xv(e,t){e.timeline=t,e.onfinish=null}const Nl=["read","resolveKeyframes","update","preRender","render","postRender"];function Zj(e,t){let n=new Set,r=new Set,i=!1,s=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function c(u){o.has(u)&&(d.schedule(u),e()),l++,u(a)}const d={schedule:(u,p=!1,m=!1)=>{const w=m&&i?n:r;return p&&o.add(u),w.has(u)||w.add(u),u},cancel:u=>{r.delete(u),o.delete(u)},process:u=>{if(a=u,i){s=!0;return}i=!0,[n,r]=[r,n],n.forEach(c),t&&Kv.value&&Kv.value.frameloop[t].push(l),l=0,n.clear(),i=!1,s&&(s=!1,d.process(u))}};return d}const Jj=40;function Ob(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=Nl.reduce((h,g)=>(h[g]=Zj(s,t?g:void 0),h),{}),{read:a,resolveKeyframes:l,update:c,preRender:d,render:u,postRender:p}=o,m=()=>{const h=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(h-i.timestamp,Jj),1),i.timestamp=h,i.isProcessing=!0,a.process(i),l.process(i),c.process(i),d.process(i),u.process(i),p.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(m))},y=()=>{n=!0,r=!0,i.isProcessing||e(m)};return{schedule:Nl.reduce((h,g)=>{const k=o[g];return h[g]=(C,S=!1,T=!1)=>(n||y(),k.schedule(C,S,T)),h},{}),cancel:h=>{for(let g=0;g<Nl.length;g++)o[Nl[g]].cancel(h)},state:i,steps:o}}const{schedule:km,cancel:VB}=Ob(queueMicrotask,!1),{schedule:Le,cancel:pi,state:wt,steps:jd}=Ob(typeof requestAnimationFrame<"u"?requestAnimationFrame:Sn,!0);let rc;function eA(){rc=void 0}const sr={now:()=>(rc===void 0&&sr.set(wt.isProcessing||vp.useManualTiming?wt.timestamp:performance.now()),rc),set:e=>{rc=e,queueMicrotask(eA)}},Rn={x:!1,y:!1};function Nb(){return Rn.x||Rn.y}function tA(e){return e==="x"||e==="y"?Rn[e]?null:(Rn[e]=!0,()=>{Rn[e]=!1}):Rn.x||Rn.y?null:(Rn.x=Rn.y=!0,()=>{Rn.x=Rn.y=!1})}function nA(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){const i=document.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}function Db(e,t){const n=nA(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function Zv(e){return!(e.pointerType==="touch"||Nb())}function rA(e,t,n={}){const[r,i,s]=Db(e,n),o=a=>{if(!Zv(a))return;const{target:l}=a,c=t(l,a);if(typeof c!="function"||!l)return;const d=u=>{Zv(u)&&(c(u),l.removeEventListener("pointerleave",d))};l.addEventListener("pointerleave",d,i)};return r.forEach(a=>{a.addEventListener("pointerenter",o,i)}),s}const Ib=(e,t)=>t?e===t?!0:Ib(e,t.parentElement):!1,Sm=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,iA=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function sA(e){return iA.has(e.tagName)||e.tabIndex!==-1}const Ko=new WeakSet;function Jv(e){return t=>{t.key==="Enter"&&e(t)}}function Ad(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const oA=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Jv(()=>{if(Ko.has(n))return;Ad(n,"down");const i=Jv(()=>{Ad(n,"up")}),s=()=>Ad(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function ey(e){return Sm(e)&&!Nb()}function aA(e,t,n={}){const[r,i,s]=Db(e,n),o=a=>{const l=a.currentTarget;if(!ey(a)||Ko.has(l))return;Ko.add(l);const c=t(l,a),d=(m,y)=>{window.removeEventListener("pointerup",u),window.removeEventListener("pointercancel",p),!(!ey(m)||!Ko.has(l))&&(Ko.delete(l),typeof c=="function"&&c(m,{success:y}))},u=m=>{d(m,l===window||l===document||n.useGlobalTarget||Ib(l,m.target))},p=m=>{d(m,!1)};window.addEventListener("pointerup",u,i),window.addEventListener("pointercancel",p,i)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),a instanceof HTMLElement&&(a.addEventListener("focus",c=>oA(c,i)),!sA(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}const ty=30,lA=e=>!isNaN(parseFloat(e));class cA{constructor(t,n={}){this.version="12.7.4",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const s=sr.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=sr.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=lA(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new vm);const r=this.events[t].add(n);return t==="change"?()=>{r(),Le.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=sr.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>ty)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,ty);return Ab(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function La(e,t){return new cA(e,t)}const Lb=v.createContext({strict:!1}),ny={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"]},mo={};for(const e in ny)mo[e]={isEnabled:t=>ny[e].some(n=>!!t[n])};function uA(e){for(const t in e)mo[t]={...mo[t],...e[t]}}const dA=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Vc(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||dA.has(e)}let Fb=e=>!Vc(e);function fA(e){e&&(Fb=t=>t.startsWith("on")?!Vc(t):e(t))}try{fA(require("@emotion/is-prop-valid").default)}catch{}function pA(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(Fb(i)||n===!0&&Vc(i)||!t&&!Vc(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function hA(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>e(...r);return new Proxy(n,{get:(r,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}const Cu=v.createContext({});function Tu(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Fa(e){return typeof e=="string"||Array.isArray(e)}const Cm=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Tm=["initial",...Cm];function _u(e){return Tu(e.animate)||Tm.some(t=>Fa(e[t]))}function Bb(e){return!!(_u(e)||e.variants)}function mA(e,t){if(_u(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Fa(n)?n:void 0,animate:Fa(r)?r:void 0}}return e.inherit!==!1?t:{}}function gA(e){const{initial:t,animate:n}=mA(e,v.useContext(Cu));return v.useMemo(()=>({initial:t,animate:n}),[ry(t),ry(n)])}function ry(e){return Array.isArray(e)?e.join(" "):e}const vA=Symbol.for("motionComponentSymbol");function Ns(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function yA(e,t,n){return v.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Ns(n)&&(n.current=r))},[t])}const _m=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),xA="framerAppearId",$b="data-"+_m(xA),zb=v.createContext({});function wA(e,t,n,r,i){var w,x;const{visualElement:s}=v.useContext(Cu),o=v.useContext(Lb),a=v.useContext(Su),l=v.useContext(pm).reducedMotion,c=v.useRef(null);r=r||o.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:s,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const d=c.current,u=v.useContext(zb);d&&!d.projection&&i&&(d.type==="html"||d.type==="svg")&&bA(c.current,n,i,u);const p=v.useRef(!1);v.useInsertionEffect(()=>{d&&p.current&&d.update(n,a)});const m=n[$b],y=v.useRef(!!m&&!((w=window.MotionHandoffIsComplete)!=null&&w.call(window,m))&&((x=window.MotionHasOptimisedAnimation)==null?void 0:x.call(window,m)));return Eb(()=>{d&&(p.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),km.render(d.render),y.current&&d.animationState&&d.animationState.animateChanges())}),v.useEffect(()=>{d&&(!y.current&&d.animationState&&d.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var h;(h=window.MotionHandoffMarkAsComplete)==null||h.call(window,m)}),y.current=!1))}),d}function bA(e,t,n,r){const{layoutId:i,layout:s,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Vb(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&Ns(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:l,layoutRoot:c})}function Vb(e){if(e)return e.options.allowProjection!==!1?e.projection:Vb(e.parent)}function kA({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&uA(e);function s(a,l){let c;const d={...v.useContext(pm),...a,layoutId:SA(a)},{isStatic:u}=d,p=gA(a),m=r(a,u);if(!u&&fm){CA();const y=TA(d);c=y.MeasureLayout,p.visualElement=wA(i,m,d,t,y.ProjectionNode)}return f.jsxs(Cu.Provider,{value:p,children:[c&&p.visualElement?f.jsx(c,{visualElement:p.visualElement,...d}):null,n(i,a,yA(m,p.visualElement,l),m,u,p.visualElement)]})}s.displayName=`motion.${typeof i=="string"?i:`create(${i.displayName??i.name??""})`}`;const o=v.forwardRef(s);return o[vA]=i,o}function SA({layoutId:e}){const t=v.useContext(dm).id;return t&&e!==void 0?t+"-"+e:e}function CA(e,t){v.useContext(Lb).strict}function TA(e){const{drag:t,layout:n}=mo;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const Ub=e=>t=>typeof t=="string"&&t.startsWith(e),Em=Ub("--"),_A=Ub("var(--"),jm=e=>_A(e)?EA.test(e.split("/*")[0].trim()):!1,EA=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Ba={};function jA(e){for(const t in e)Ba[t]=e[t],Em(t)&&(Ba[t].isCSSVariable=!0)}const Eo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ls=new Set(Eo);function Hb(e,{layout:t,layoutId:n}){return ls.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Ba[e]||e==="opacity")}const At=e=>!!(e&&e.getVelocity),Wb=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Ar=(e,t,n)=>n>t?t:n<e?e:n,jo={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},$a={...jo,transform:e=>Ar(0,1,e)},Dl={...jo,default:1},rl=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Lr=rl("deg"),or=rl("%"),he=rl("px"),AA=rl("vh"),RA=rl("vw"),iy={...or,parse:e=>or.parse(e)/100,transform:e=>or.transform(e*100)},PA={borderWidth:he,borderTopWidth:he,borderRightWidth:he,borderBottomWidth:he,borderLeftWidth:he,borderRadius:he,radius:he,borderTopLeftRadius:he,borderTopRightRadius:he,borderBottomRightRadius:he,borderBottomLeftRadius:he,width:he,maxWidth:he,height:he,maxHeight:he,top:he,right:he,bottom:he,left:he,padding:he,paddingTop:he,paddingRight:he,paddingBottom:he,paddingLeft:he,margin:he,marginTop:he,marginRight:he,marginBottom:he,marginLeft:he,backgroundPositionX:he,backgroundPositionY:he},MA={rotate:Lr,rotateX:Lr,rotateY:Lr,rotateZ:Lr,scale:Dl,scaleX:Dl,scaleY:Dl,scaleZ:Dl,skew:Lr,skewX:Lr,skewY:Lr,distance:he,translateX:he,translateY:he,translateZ:he,x:he,y:he,z:he,perspective:he,transformPerspective:he,opacity:$a,originX:iy,originY:iy,originZ:he},sy={...jo,transform:Math.round},Am={...PA,...MA,zIndex:sy,size:he,fillOpacity:$a,strokeOpacity:$a,numOctaves:sy},OA={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},NA=Eo.length;function DA(e,t,n){let r="",i=!0;for(let s=0;s<NA;s++){const o=Eo[s],a=e[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=Wb(a,Am[o]);if(!l){i=!1;const d=OA[o]||o;r+=`${d}(${c}) `}n&&(t[o]=c)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function Rm(e,t,n){const{style:r,vars:i,transformOrigin:s}=e;let o=!1,a=!1;for(const l in t){const c=t[l];if(ls.has(l)){o=!0;continue}else if(Em(l)){i[l]=c;continue}else{const d=Wb(c,Am[l]);l.startsWith("origin")?(a=!0,s[l]=d):r[l]=d}}if(t.transform||(o||n?r.transform=DA(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:d=0}=s;r.transformOrigin=`${l} ${c} ${d}`}}const Pm=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function qb(e,t,n){for(const r in t)!At(t[r])&&!Hb(r,n)&&(e[r]=t[r])}function IA({transformTemplate:e},t){return v.useMemo(()=>{const n=Pm();return Rm(n,t,e),Object.assign({},n.vars,n.style)},[t])}function LA(e,t){const n=e.style||{},r={};return qb(r,n,e),Object.assign(r,IA(e,t)),r}function FA(e,t){const n={},r=LA(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const BA=["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 Mm(e){return typeof e!="string"||e.includes("-")?!1:!!(BA.indexOf(e)>-1||/[A-Z]/u.test(e))}const $A={offset:"stroke-dashoffset",array:"stroke-dasharray"},zA={offset:"strokeDashoffset",array:"strokeDasharray"};function VA(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?$A:zA;e[s.offset]=he.transform(-r);const o=he.transform(t),a=he.transform(n);e[s.array]=`${o} ${a}`}function oy(e,t,n){return typeof e=="string"?e:he.transform(t+n*e)}function UA(e,t,n){const r=oy(t,e.x,e.width),i=oy(n,e.y,e.height);return`${r} ${i}`}function Om(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...c},d,u){if(Rm(e,c,u),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:p,style:m,dimensions:y}=e;p.transform&&(y&&(m.transform=p.transform),delete p.transform),y&&(i!==void 0||s!==void 0||m.transform)&&(m.transformOrigin=UA(y,i!==void 0?i:.5,s!==void 0?s:.5)),t!==void 0&&(p.x=t),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),o!==void 0&&VA(p,o,a,l,!1)}const Gb=()=>({...Pm(),attrs:{}}),Nm=e=>typeof e=="string"&&e.toLowerCase()==="svg";function HA(e,t,n,r){const i=v.useMemo(()=>{const s=Gb();return Om(s,t,Nm(r),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};qb(s,e.style,e),i.style={...s,...i.style}}return i}function WA(e=!1){return(n,r,i,{latestValues:s},o)=>{const l=(Mm(n)?HA:FA)(r,s,o,n),c=pA(r,typeof n=="string",e),d=n!==v.Fragment?{...c,...l,ref:i}:{},{children:u}=r,p=v.useMemo(()=>At(u)?u.get():u,[u]);return v.createElement(n,{...d,children:p})}}function ay(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Dm(e,t,n,r){if(typeof t=="function"){const[i,s]=ay(r);t=t(n!==void 0?n:e.custom,i,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,s]=ay(r);t=t(n!==void 0?n:e.custom,i,s)}return t}const xp=e=>Array.isArray(e),qA=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),GA=e=>xp(e)?e[e.length-1]||0:e;function ic(e){const t=At(e)?e.get():e;return qA(t)?t.toValue():t}function YA({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,i,s){const o={latestValues:QA(r,i,s,e),renderState:t()};return n&&(o.onMount=a=>n({props:r,current:a,...o}),o.onUpdate=a=>n(a)),o}const Yb=e=>(t,n)=>{const r=v.useContext(Cu),i=v.useContext(Su),s=()=>YA(e,t,r,i);return n?s():ku(s)};function QA(e,t,n,r){const i={},s=r(e,{});for(const p in s)i[p]=ic(s[p]);let{initial:o,animate:a}=e;const l=_u(e),c=Bb(e);t&&c&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const u=d?a:o;if(u&&typeof u!="boolean"&&!Tu(u)){const p=Array.isArray(u)?u:[u];for(let m=0;m<p.length;m++){const y=Dm(e,p[m]);if(y){const{transitionEnd:w,transition:x,...h}=y;for(const g in h){let k=h[g];if(Array.isArray(k)){const C=d?k.length-1:0;k=k[C]}k!==null&&(i[g]=k)}for(const g in w)i[g]=w[g]}}}return i}function Im(e,t,n){var s;const{style:r}=e,i={};for(const o in r)(At(r[o])||t.style&&At(t.style[o])||Hb(o,e)||((s=n==null?void 0:n.getValue(o))==null?void 0:s.liveStyle)!==void 0)&&(i[o]=r[o]);return i}const KA={useVisualState:Yb({scrapeMotionValuesFromProps:Im,createRenderState:Pm})};function Qb(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}function Kb(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const s in n)e.style.setProperty(s,n[s])}const Xb=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Zb(e,t,n,r){Kb(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(Xb.has(i)?i:_m(i),t.attrs[i])}function Jb(e,t,n){const r=Im(e,t,n);for(const i in e)if(At(e[i])||At(t[i])){const s=Eo.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=e[i]}return r}const ly=["x","y","width","height","cx","cy","r"],XA={useVisualState:Yb({scrapeMotionValuesFromProps:Jb,createRenderState:Gb,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:i})=>{if(!n)return;let s=!!e.drag;if(!s){for(const a in i)if(ls.has(a)){s=!0;break}}if(!s)return;let o=!t;if(t)for(let a=0;a<ly.length;a++){const l=ly[a];e[l]!==t[l]&&(o=!0)}o&&Le.read(()=>{Qb(n,r),Le.render(()=>{Om(r,i,Nm(n.tagName),e.transformTemplate),Zb(n,r)})})}})};function ZA(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...Mm(r)?XA:KA,preloadedFeatures:e,useRender:WA(i),createVisualElement:t,Component:r};return kA(o)}}function za(e,t,n){const r=e.getProps();return Dm(r,t,n!==void 0?n:r.custom,e)}const ek=new Set(["width","height","top","left","right","bottom",...Eo]);function JA(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,La(n))}function e5(e,t){const n=za(e,t);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const o in s){const a=GA(s[o]);JA(e,o,a)}}function t5(e){return!!(At(e)&&e.add)}function wp(e,t){const n=e.getValue("willChange");if(t5(n))return n.add(t);if(!n&&vp.WillChange){const r=new vp.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function tk(e){return e.props[$b]}const nk=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,n5=1e-7,r5=12;function i5(e,t,n,r,i){let s,o,a=0;do o=t+(n-t)/2,s=nk(o,r,i)-e,s>0?n=o:t=o;while(Math.abs(s)>n5&&++a<r5);return o}function il(e,t,n,r){if(e===t&&n===r)return Sn;const i=s=>i5(s,0,1,e,n);return s=>s===0||s===1?s:nk(i(s),t,r)}const rk=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ik=e=>t=>1-e(1-t),sk=il(.33,1.53,.69,.99),Lm=ik(sk),ok=rk(Lm),ak=e=>(e*=2)<1?.5*Lm(e):.5*(2-Math.pow(2,-10*(e-1))),Fm=e=>1-Math.sin(Math.acos(e)),lk=ik(Fm),ck=rk(Fm),uk=e=>/^0[^.\s]+$/u.test(e);function s5(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||uk(e):!0}const la=e=>Math.round(e*1e5)/1e5,Bm=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function o5(e){return e==null}const a5=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,$m=(e,t)=>n=>!!(typeof n=="string"&&a5.test(n)&&n.startsWith(e)||t&&!o5(n)&&Object.prototype.hasOwnProperty.call(n,t)),dk=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,s,o,a]=r.match(Bm);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},l5=e=>Ar(0,255,e),Rd={...jo,transform:e=>Math.round(l5(e))},Ni={test:$m("rgb","red"),parse:dk("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Rd.transform(e)+", "+Rd.transform(t)+", "+Rd.transform(n)+", "+la($a.transform(r))+")"};function c5(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const bp={test:$m("#"),parse:c5,transform:Ni.transform},Ds={test:$m("hsl","hue"),parse:dk("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+or.transform(la(t))+", "+or.transform(la(n))+", "+la($a.transform(r))+")"},Et={test:e=>Ni.test(e)||bp.test(e)||Ds.test(e),parse:e=>Ni.test(e)?Ni.parse(e):Ds.test(e)?Ds.parse(e):bp.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ni.transform(e):Ds.transform(e)},u5=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function d5(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Bm))==null?void 0:t.length)||0)+(((n=e.match(u5))==null?void 0:n.length)||0)>0}const fk="number",pk="color",f5="var",p5="var(",cy="${}",h5=/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 Va(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const a=t.replace(h5,l=>(Et.test(l)?(r.color.push(s),i.push(pk),n.push(Et.parse(l))):l.startsWith(p5)?(r.var.push(s),i.push(f5),n.push(l)):(r.number.push(s),i.push(fk),n.push(parseFloat(l))),++s,cy)).split(cy);return{values:n,split:a,indexes:r,types:i}}function hk(e){return Va(e).values}function mk(e){const{split:t,types:n}=Va(e),r=t.length;return i=>{let s="";for(let o=0;o<r;o++)if(s+=t[o],i[o]!==void 0){const a=n[o];a===fk?s+=la(i[o]):a===pk?s+=Et.transform(i[o]):s+=i[o]}return s}}const m5=e=>typeof e=="number"?0:e;function g5(e){const t=hk(e);return mk(e)(t.map(m5))}const hi={test:d5,parse:hk,createTransformer:mk,getAnimatableNone:g5},v5=new Set(["brightness","contrast","saturate","opacity"]);function y5(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Bm)||[];if(!r)return e;const i=n.replace(r,"");let s=v5.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const x5=/\b([a-z-]*)\(.*?\)/gu,kp={...hi,getAnimatableNone:e=>{const t=e.match(x5);return t?t.map(y5).join(" "):e}},w5={...Am,color:Et,backgroundColor:Et,outlineColor:Et,fill:Et,stroke:Et,borderColor:Et,borderTopColor:Et,borderRightColor:Et,borderBottomColor:Et,borderLeftColor:Et,filter:kp,WebkitFilter:kp},gk=e=>w5[e];function vk(e,t){let n=gk(e);return n!==kp&&(n=hi),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const b5=new Set(["auto","none","0"]);function k5(e,t,n){let r=0,i;for(;r<e.length&&!i;){const s=e[r];typeof s=="string"&&!b5.has(s)&&Va(s).values.length&&(i=e[r]),r++}if(i&&n)for(const s of t)e[s]=vk(n,i)}const Di=e=>e*180/Math.PI,Sp=e=>{const t=Di(Math.atan2(e[1],e[0]));return Cp(t)},S5={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Sp,rotateZ:Sp,skewX:e=>Di(Math.atan(e[1])),skewY:e=>Di(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Cp=e=>(e=e%360,e<0&&(e+=360),e),uy=Sp,dy=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),fy=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),C5={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:dy,scaleY:fy,scale:e=>(dy(e)+fy(e))/2,rotateX:e=>Cp(Di(Math.atan2(e[6],e[5]))),rotateY:e=>Cp(Di(Math.atan2(-e[2],e[0]))),rotateZ:uy,rotate:uy,skewX:e=>Di(Math.atan(e[4])),skewY:e=>Di(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function py(e){return e.includes("scale")?1:0}function Tp(e,t){if(!e||e==="none")return py(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=C5,i=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=S5,i=a}if(!i)return py(t);const s=r[t],o=i[1].split(",").map(_5);return typeof s=="function"?s(o):o[s]}const T5=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Tp(n,t)};function _5(e){return parseFloat(e.trim())}const hy=e=>e===jo||e===he,E5=new Set(["x","y","z"]),j5=Eo.filter(e=>!E5.has(e));function A5(e){const t=[];return j5.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const go={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Tp(t,"x"),y:(e,{transform:t})=>Tp(t,"y")};go.translateX=go.x;go.translateY=go.y;const Gi=new Set;let _p=!1,Ep=!1;function yk(){if(Ep){const e=Array.from(Gi).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=A5(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,o])=>{var a;(a=r.getValue(s))==null||a.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Ep=!1,_p=!1,Gi.forEach(e=>e.complete()),Gi.clear()}function xk(){Gi.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Ep=!0)})}function R5(){xk(),yk()}class zm{constructor(t,n,r,i,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Gi.add(this),_p||(_p=!0,Le.read(xk),Le.resolveKeyframes(yk))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;for(let s=0;s<t.length;s++)if(t[s]===null)if(s===0){const o=i==null?void 0:i.get(),a=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const l=r.readValue(n,a);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=a),i&&o===void 0&&i.set(t[0])}else t[s]=t[s-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Gi.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Gi.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const wk=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),P5=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function M5(e){const t=P5.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function bk(e,t,n=1){const[r,i]=M5(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const o=s.trim();return wk(o)?parseFloat(o):o}return jm(i)?bk(i,t,n+1):i}const kk=e=>t=>t.test(e),O5={test:e=>e==="auto",parse:e=>e},Sk=[jo,he,or,Lr,RA,AA,O5],my=e=>Sk.find(kk(e));class Ck extends zm{constructor(t,n,r,i,s){super(t,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),jm(c))){const d=bk(c,n.current);d!==void 0&&(t[l]=d),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!ek.has(r)||t.length!==2)return;const[i,s]=t,o=my(i),a=my(s);if(o!==a)if(hy(o)&&hy(a))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)s5(t[i])&&r.push(i);r.length&&k5(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=go[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const i=t.getValue(n);i&&i.jump(this.measuredOrigin,!1);const s=r.length-1,o=r[s];r[s]=go[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([l,c])=>{t.getValue(l).set(c)}),this.resolveNoneKeyframes()}}const gy=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(hi.test(e)||e==="0")&&!e.startsWith("url("));function N5(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function D5(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],o=gy(i,t),a=gy(s,t);return!o||!a?!1:N5(e)||(n==="spring"||xm(n))&&r}const I5=e=>e!==null;function Eu(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(I5),s=t&&n!=="loop"&&t%2===1?0:i.length-1;return!s||r===void 0?i[s]:r}const L5=40;class Tk{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=sr.now(),this.options={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:o,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>L5?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&R5(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=sr.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:s,delay:o,onComplete:a,onUpdate:l,isGenerator:c}=this.options;if(!c&&!D5(t,r,i,s))if(o)this.options.duration=0;else{l&&l(Eu(t,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const d=this.initPlayback(t,n);d!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...d},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear")}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Ge=(e,t,n)=>e+(t-e)*n;function Pd(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function F5({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,s=0,o=0;if(!t)i=s=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;i=Pd(l,a,e+1/3),s=Pd(l,a,e),o=Pd(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}function Uc(e,t){return n=>n>0?t:e}const Md=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},B5=[bp,Ni,Ds],$5=e=>B5.find(t=>t.test(e));function vy(e){const t=$5(e);if(!t)return!1;let n=t.parse(e);return t===Ds&&(n=F5(n)),n}const yy=(e,t)=>{const n=vy(e),r=vy(t);if(!n||!r)return Uc(e,t);const i={...n};return s=>(i.red=Md(n.red,r.red,s),i.green=Md(n.green,r.green,s),i.blue=Md(n.blue,r.blue,s),i.alpha=Ge(n.alpha,r.alpha,s),Ni.transform(i))},z5=(e,t)=>n=>t(e(n)),sl=(...e)=>e.reduce(z5),jp=new Set(["none","hidden"]);function V5(e,t){return jp.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function U5(e,t){return n=>Ge(e,t,n)}function Vm(e){return typeof e=="number"?U5:typeof e=="string"?jm(e)?Uc:Et.test(e)?yy:q5:Array.isArray(e)?_k:typeof e=="object"?Et.test(e)?yy:H5:Uc}function _k(e,t){const n=[...e],r=n.length,i=e.map((s,o)=>Vm(s)(s,t[o]));return s=>{for(let o=0;o<r;o++)n[o]=i[o](s);return n}}function H5(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Vm(e[i])(e[i],t[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function W5(e,t){const n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const s=t.types[i],o=e.indexes[s][r[s]],a=e.values[o]??0;n[i]=a,r[s]++}return n}const q5=(e,t)=>{const n=hi.createTransformer(t),r=Va(e),i=Va(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?jp.has(e)&&!i.values.length||jp.has(t)&&!r.values.length?V5(e,t):sl(_k(W5(r,i),i.values),n):Uc(e,t)};function Ek(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Ge(e,t,n):Vm(e)(e,t)}const G5=5;function jk(e,t,n){const r=Math.max(t-G5,0);return Ab(n-e(r),t-r)}const Xe={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},Od=.001;function Y5({duration:e=Xe.duration,bounce:t=Xe.bounce,velocity:n=Xe.velocity,mass:r=Xe.mass}){let i,s,o=1-t;o=Ar(Xe.minDamping,Xe.maxDamping,o),e=Ar(Xe.minDuration,Xe.maxDuration,ir(e)),o<1?(i=c=>{const d=c*o,u=d*e,p=d-n,m=Ap(c,o),y=Math.exp(-u);return Od-p/m*y},s=c=>{const u=c*o*e,p=u*n+n,m=Math.pow(o,2)*Math.pow(c,2)*e,y=Math.exp(-u),w=Ap(Math.pow(c,2),o);return(-i(c)+Od>0?-1:1)*((p-m)*y)/w}):(i=c=>{const d=Math.exp(-c*e),u=(c-n)*e+1;return-Od+d*u},s=c=>{const d=Math.exp(-c*e),u=(n-c)*(e*e);return d*u});const a=5/e,l=K5(i,s,a);if(e=rr(e),isNaN(l))return{stiffness:Xe.stiffness,damping:Xe.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const Q5=12;function K5(e,t,n){let r=n;for(let i=1;i<Q5;i++)r=r-e(r)/t(r);return r}function Ap(e,t){return e*Math.sqrt(1-t*t)}const X5=["duration","bounce"],Z5=["stiffness","damping","mass"];function xy(e,t){return t.some(n=>e[n]!==void 0)}function J5(e){let t={velocity:Xe.velocity,stiffness:Xe.stiffness,damping:Xe.damping,mass:Xe.mass,isResolvedFromDuration:!1,...e};if(!xy(e,Z5)&&xy(e,X5))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*Ar(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Xe.mass,stiffness:i,damping:s}}else{const n=Y5(e);t={...t,...n,mass:Xe.mass},t.isResolvedFromDuration=!0}return t}function Hc(e=Xe.visualDuration,t=Xe.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:c,mass:d,duration:u,velocity:p,isResolvedFromDuration:m}=J5({...n,velocity:-ir(n.velocity||0)}),y=p||0,w=c/(2*Math.sqrt(l*d)),x=o-s,h=ir(Math.sqrt(l/d)),g=Math.abs(x)<5;r||(r=g?Xe.restSpeed.granular:Xe.restSpeed.default),i||(i=g?Xe.restDelta.granular:Xe.restDelta.default);let k;if(w<1){const S=Ap(h,w);k=T=>{const j=Math.exp(-w*h*T);return o-j*((y+w*h*x)/S*Math.sin(S*T)+x*Math.cos(S*T))}}else if(w===1)k=S=>o-Math.exp(-h*S)*(x+(y+h*x)*S);else{const S=h*Math.sqrt(w*w-1);k=T=>{const j=Math.exp(-w*h*T),E=Math.min(S*T,300);return o-j*((y+w*h*x)*Math.sinh(E)+S*x*Math.cosh(E))/S}}const C={calculatedDuration:m&&u||null,next:S=>{const T=k(S);if(m)a.done=S>=u;else{let j=0;w<1&&(j=S===0?rr(y):jk(k,S,T));const E=Math.abs(j)<=r,A=Math.abs(o-T)<=i;a.done=E&&A}return a.value=a.done?o:T,a},toString:()=>{const S=Math.min(bm(C),zc),T=Rb(j=>C.next(S*j).value,S,30);return S+"ms "+T},toTransition:()=>{}};return C}Hc.applyToOptions=e=>{const t=Xj(e,100,Hc);return e.ease=Ia()?t.ease:"easeOut",e.duration=rr(t.duration),e.type="keyframes",e};function wy({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:d}){const u=e[0],p={done:!1,value:u},m=E=>a!==void 0&&E<a||l!==void 0&&E>l,y=E=>a===void 0?l:l===void 0||Math.abs(a-E)<Math.abs(l-E)?a:l;let w=n*t;const x=u+w,h=o===void 0?x:o(x);h!==x&&(w=h-u);const g=E=>-w*Math.exp(-E/r),k=E=>h+g(E),C=E=>{const A=g(E),I=k(E);p.done=Math.abs(A)<=c,p.value=p.done?h:I};let S,T;const j=E=>{m(p.value)&&(S=E,T=Hc({keyframes:[p.value,y(p.value)],velocity:jk(k,E,p.value),damping:i,stiffness:s,restDelta:c,restSpeed:d}))};return j(0),{calculatedDuration:null,next:E=>{let A=!1;return!T&&S===void 0&&(A=!0,C(E),j(E)),S!==void 0&&E>=S?T.next(E-S):(!A&&C(E),p)}}}const e3=il(.42,0,1,1),t3=il(0,0,.58,1),Ak=il(.42,0,.58,1),n3=e=>Array.isArray(e)&&typeof e[0]!="number",by={linear:Sn,easeIn:e3,easeInOut:Ak,easeOut:t3,circIn:Fm,circInOut:ck,circOut:lk,backIn:Lm,backInOut:ok,backOut:sk,anticipate:ak},ky=e=>{if(ym(e)){gp(e.length===4);const[t,n,r,i]=e;return il(t,n,r,i)}else if(typeof e=="string")return gp(by[e]!==void 0),by[e];return e};function r3(e,t,n){const r=[],i=n||Ek,s=e.length-1;for(let o=0;o<s;o++){let a=i(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||Sn:t;a=sl(l,a)}r.push(a)}return r}function i3(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const s=e.length;if(gp(s===t.length),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=r3(t,r,i),l=a.length,c=d=>{if(o&&d<e[0])return t[0];let u=0;if(l>1)for(;u<e.length-2&&!(d<e[u+1]);u++);const p=Da(e[u],e[u+1],d);return a[u](p)};return n?d=>c(Ar(e[0],e[s-1],d)):c}function s3(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Da(0,t,r);e.push(Ge(n,1,i))}}function o3(e){const t=[0];return s3(t,e.length-1),t}function a3(e,t){return e.map(n=>n*t)}function l3(e,t){return e.map(()=>t||Ak).splice(0,e.length-1)}function Wc({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=n3(r)?r.map(ky):ky(r),s={done:!1,value:t[0]},o=a3(n&&n.length===t.length?n:o3(t),e),a=i3(o,t,{ease:Array.isArray(i)?i:l3(t,i)});return{calculatedDuration:e,next:l=>(s.value=a(l),s.done=l>=e,s)}}const c3=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Le.update(t,!0),stop:()=>pi(t),now:()=>wt.isProcessing?wt.timestamp:sr.now()}},u3={decay:wy,inertia:wy,tween:Wc,keyframes:Wc,spring:Hc},d3=e=>e/100;class Um extends Tk{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:i,keyframes:s}=this.options,o=(i==null?void 0:i.KeyframeResolver)||zm,a=(l,c)=>this.onKeyframesResolved(l,c);this.resolver=new o(s,a,n,r,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=this.options,a=xm(n)?n:u3[n]||Wc;let l,c;a!==Wc&&typeof t[0]!="number"&&(l=sl(d3,Ek(t[0],t[1])),t=[0,100]);const d=a({...this.options,keyframes:t});s==="mirror"&&(c=a({...this.options,keyframes:[...t].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=bm(d));const{calculatedDuration:u}=d,p=u+i,m=p*(r+1)-i;return{generator:d,mirroredGenerator:c,mapPercentToKeyframes:l,calculatedDuration:u,resolvedDuration:p,totalDuration:m}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:E}=this.options;return{done:!0,value:E[E.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:c,totalDuration:d,resolvedDuration:u}=r;if(this.startTime===null)return s.next(0);const{delay:p,repeat:m,repeatType:y,repeatDelay:w,onUpdate:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const h=this.currentTime-p*(this.speed>=0?1:-1),g=this.speed>=0?h<0:h>d;this.currentTime=Math.max(h,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let k=this.currentTime,C=s;if(m){const E=Math.min(this.currentTime,d)/u;let A=Math.floor(E),I=E%1;!I&&E>=1&&(I=1),I===1&&A--,A=Math.min(A,m+1),!!(A%2)&&(y==="reverse"?(I=1-I,w&&(I-=w/u)):y==="mirror"&&(C=o)),k=Ar(0,1,I)*u}const S=g?{done:!1,value:l[0]}:C.next(k);a&&(S.value=a(S.value));let{done:T}=S;!g&&c!==null&&(T=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const j=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&T);return j&&i!==void 0&&(S.value=Eu(l,this.options,i)),x&&x(S.value),j&&this.finish(),S}get duration(){const{resolved:t}=this;return t?ir(t.calculatedDuration):0}get time(){return ir(this.currentTime)}set time(t){t=rr(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=ir(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=c3,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=this.currentTime??0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}get finished(){return this.currentFinishedPromise}}const f3=new Set(["opacity","clipPath","filter","transform"]),p3=gm(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),qc=10,h3=2e4;function m3(e){return xm(e.type)||e.type==="spring"||!Mb(e.ease)}function g3(e,t){const n=new Um({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const i=[];let s=0;for(;!r.done&&s<h3;)r=n.sample(s),i.push(r.value),s+=qc;return{times:void 0,keyframes:i,duration:s-qc,ease:"linear"}}const Rk={anticipate:ak,backInOut:ok,circInOut:ck};function v3(e){return e in Rk}class Sy extends Tk{constructor(t){super(t);const{name:n,motionValue:r,element:i,keyframes:s}=this.options;this.resolver=new Ck(s,(o,a)=>this.onKeyframesResolved(o,a),n,r,i),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:i,ease:s,type:o,motionValue:a,name:l,startTime:c}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof s=="string"&&Ia()&&v3(s)&&(s=Rk[s]),m3(this.options)){const{onComplete:u,onUpdate:p,motionValue:m,element:y,...w}=this.options,x=g3(t,w);t=x.keyframes,t.length===1&&(t[1]=t[0]),r=x.duration,i=x.times,s=x.ease,o="keyframes"}const d=Kj(a.owner.current,l,t,{...this.options,duration:r,times:i,ease:s});return d.startTime=c??this.calcStartTime(),this.pendingTimeline?(Xv(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:u}=this.options;a.set(Eu(t,this.options,n)),u&&u(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:r,times:i,type:o,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return ir(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return ir(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=rr(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}get finished(){return this.resolved.animation.finished}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return Sn;const{animation:r}=n;Xv(r,t)}return Sn}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:i,type:s,ease:o,times:a}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:d,onComplete:u,element:p,...m}=this.options,y=new Um({...m,keyframes:r,duration:i,type:s,ease:o,times:a,isGenerator:!0}),w=rr(this.time);c.setWithVelocity(y.sample(w-qc).value,y.sample(w).value,qc)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:i,repeatType:s,damping:o,type:a}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=n.owner.getProps();return p3()&&r&&f3.has(r)&&(r!=="transform"||!c)&&!l&&!i&&s!=="mirror"&&o!==0&&a!=="inertia"}}const y3={type:"spring",stiffness:500,damping:25,restSpeed:10},x3=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),w3={type:"keyframes",duration:.8},b3={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},k3=(e,{keyframes:t})=>t.length>2?w3:ls.has(e)?e.startsWith("scale")?x3(t[1]):y3:b3;function S3({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:l,elapsed:c,...d}){return!!Object.keys(d).length}const Hm=(e,t,n,r={},i,s)=>o=>{const a=wm(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-rr(l);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:p=>{t.set(p),a.onUpdate&&a.onUpdate(p)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:i};S3(a)||(d={...d,...k3(e,d)}),d.duration&&(d.duration=rr(d.duration)),d.repeatDelay&&(d.repeatDelay=rr(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let u=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(u=!0)),d.allowFlatten=!a.type&&!a.ease,u&&!s&&t.get()!==void 0){const p=Eu(d.keyframes,a);if(p!==void 0)return Le.update(()=>{d.onUpdate(p),d.onComplete()}),new Gj([])}return!s&&Sy.supports(d)?new Sy(d):new Um(d)};function C3({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Pk(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:s=e.getDefaultTransition(),transitionEnd:o,...a}=t;r&&(s=r);const l=[],c=i&&e.animationState&&e.animationState.getState()[i];for(const d in a){const u=e.getValue(d,e.latestValues[d]??null),p=a[d];if(p===void 0||c&&C3(c,d))continue;const m={delay:n,...wm(s||{},d)};let y=!1;if(window.MotionHandoffAnimation){const x=tk(e);if(x){const h=window.MotionHandoffAnimation(x,d,Le);h!==null&&(m.startTime=h,y=!0)}}wp(e,d),u.start(Hm(d,u,p,e.shouldReduceMotion&&ek.has(d)?{type:!1}:m,e,y));const w=u.animation;w&&l.push(w)}return o&&Promise.all(l).then(()=>{Le.update(()=>{o&&e5(e,o)})}),l}function Rp(e,t,n={}){var l;const r=za(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const s=r?()=>Promise.all(Pk(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:d=0,staggerChildren:u,staggerDirection:p}=i;return T3(e,t,d+c,u,p,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[c,d]=a==="beforeChildren"?[s,o]:[o,s];return c().then(()=>d())}else return Promise.all([s(),o(n.delay)])}function T3(e,t,n=0,r=0,i=1,s){const o=[],a=(e.variantChildren.size-1)*r,l=i===1?(c=0)=>c*r:(c=0)=>a-c*r;return Array.from(e.variantChildren).sort(_3).forEach((c,d)=>{c.notify("AnimationStart",t),o.push(Rp(c,t,{...s,delay:n+l(d)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(o)}function _3(e,t){return e.sortNodePosition(t)}function E3(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>Rp(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=Rp(e,t,n);else{const i=typeof t=="function"?za(e,t,n.custom):t;r=Promise.all(Pk(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function Mk(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const j3=Tm.length;function Ok(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Ok(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<j3;n++){const r=Tm[n],i=e.props[r];(Fa(i)||i===!1)&&(t[r]=i)}return t}const A3=[...Cm].reverse(),R3=Cm.length;function P3(e){return t=>Promise.all(t.map(({animation:n,options:r})=>E3(e,n,r)))}function M3(e){let t=P3(e),n=Cy(),r=!0;const i=l=>(c,d)=>{var p;const u=za(e,d,l==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(u){const{transition:m,transitionEnd:y,...w}=u;c={...c,...w,...y}}return c};function s(l){t=l(e)}function o(l){const{props:c}=e,d=Ok(e.parent)||{},u=[],p=new Set;let m={},y=1/0;for(let x=0;x<R3;x++){const h=A3[x],g=n[h],k=c[h]!==void 0?c[h]:d[h],C=Fa(k),S=h===l?g.isActive:null;S===!1&&(y=x);let T=k===d[h]&&k!==c[h]&&C;if(T&&r&&e.manuallyAnimateOnMount&&(T=!1),g.protectedKeys={...m},!g.isActive&&S===null||!k&&!g.prevProp||Tu(k)||typeof k=="boolean")continue;const j=O3(g.prevProp,k);let E=j||h===l&&g.isActive&&!T&&C||x>y&&C,A=!1;const I=Array.isArray(k)?k:[k];let N=I.reduce(i(h),{});S===!1&&(N={});const{prevResolvedValues:D={}}=g,G={...D,...N},B=$=>{E=!0,p.has($)&&(A=!0,p.delete($)),g.needsAnimating[$]=!0;const R=e.getValue($);R&&(R.liveStyle=!1)};for(const $ in G){const R=N[$],z=D[$];if(m.hasOwnProperty($))continue;let U=!1;xp(R)&&xp(z)?U=!Mk(R,z):U=R!==z,U?R!=null?B($):p.add($):R!==void 0&&p.has($)?B($):g.protectedKeys[$]=!0}g.prevProp=k,g.prevResolvedValues=N,g.isActive&&(m={...m,...N}),r&&e.blockInitialAnimation&&(E=!1),E&&(!(T&&j)||A)&&u.push(...I.map($=>({animation:$,options:{type:h}})))}if(p.size){const x={};if(typeof c.initial!="boolean"){const h=za(e,Array.isArray(c.initial)?c.initial[0]:c.initial);h&&h.transition&&(x.transition=h.transition)}p.forEach(h=>{const g=e.getBaseTarget(h),k=e.getValue(h);k&&(k.liveStyle=!0),x[h]=g??null}),u.push({animation:x})}let w=!!u.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(w=!1),r=!1,w?t(u):Promise.resolve()}function a(l,c){var u;if(n[l].isActive===c)return Promise.resolve();(u=e.variantChildren)==null||u.forEach(p=>{var m;return(m=p.animationState)==null?void 0:m.setActive(l,c)}),n[l].isActive=c;const d=o(l);for(const p in n)n[p].protectedKeys={};return d}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=Cy(),r=!0}}}function O3(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Mk(t,e):!1}function Ci(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Cy(){return{animate:Ci(!0),whileInView:Ci(),whileHover:Ci(),whileTap:Ci(),whileDrag:Ci(),whileFocus:Ci(),exit:Ci()}}class wi{constructor(t){this.isMounted=!1,this.node=t}update(){}}class N3 extends wi{constructor(t){super(t),t.animationState||(t.animationState=M3(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Tu(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let D3=0;class I3 extends wi{constructor(){super(...arguments),this.id=D3++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const L3={animation:{Feature:N3},exit:{Feature:I3}};function Ua(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function ol(e){return{point:{x:e.pageX,y:e.pageY}}}const F3=e=>t=>Sm(t)&&e(t,ol(t));function ca(e,t,n,r){return Ua(e,t,F3(n),r)}function Nk({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function B3({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function $3(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}const Dk=1e-4,z3=1-Dk,V3=1+Dk,Ik=.01,U3=0-Ik,H3=0+Ik;function Dt(e){return e.max-e.min}function W3(e,t,n){return Math.abs(e-t)<=n}function Ty(e,t,n,r=.5){e.origin=r,e.originPoint=Ge(t.min,t.max,e.origin),e.scale=Dt(n)/Dt(t),e.translate=Ge(n.min,n.max,e.origin)-e.originPoint,(e.scale>=z3&&e.scale<=V3||isNaN(e.scale))&&(e.scale=1),(e.translate>=U3&&e.translate<=H3||isNaN(e.translate))&&(e.translate=0)}function ua(e,t,n,r){Ty(e.x,t.x,n.x,r?r.originX:void 0),Ty(e.y,t.y,n.y,r?r.originY:void 0)}function _y(e,t,n){e.min=n.min+t.min,e.max=e.min+Dt(t)}function q3(e,t,n){_y(e.x,t.x,n.x),_y(e.y,t.y,n.y)}function Ey(e,t,n){e.min=t.min-n.min,e.max=e.min+Dt(t)}function da(e,t,n){Ey(e.x,t.x,n.x),Ey(e.y,t.y,n.y)}const jy=()=>({translate:0,scale:1,origin:0,originPoint:0}),Is=()=>({x:jy(),y:jy()}),Ay=()=>({min:0,max:0}),et=()=>({x:Ay(),y:Ay()});function hn(e){return[e("x"),e("y")]}function Nd(e){return e===void 0||e===1}function Pp({scale:e,scaleX:t,scaleY:n}){return!Nd(e)||!Nd(t)||!Nd(n)}function ji(e){return Pp(e)||Lk(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Lk(e){return Ry(e.x)||Ry(e.y)}function Ry(e){return e&&e!=="0%"}function Gc(e,t,n){const r=e-n,i=t*r;return n+i}function Py(e,t,n,r,i){return i!==void 0&&(e=Gc(e,i,r)),Gc(e,n,r)+t}function Mp(e,t=0,n=1,r,i){e.min=Py(e.min,t,n,r,i),e.max=Py(e.max,t,n,r,i)}function Fk(e,{x:t,y:n}){Mp(e.x,t.translate,t.scale,t.originPoint),Mp(e.y,n.translate,n.scale,n.originPoint)}const My=.999999999999,Oy=1.0000000000001;function G3(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let s,o;for(let a=0;a<i;a++){s=n[a],o=s.projectionDelta;const{visualElement:l}=s.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&Fs(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Fk(e,o)),r&&ji(s.latestValues)&&Fs(e,s.latestValues))}t.x<Oy&&t.x>My&&(t.x=1),t.y<Oy&&t.y>My&&(t.y=1)}function Ls(e,t){e.min=e.min+t,e.max=e.max+t}function Ny(e,t,n,r,i=.5){const s=Ge(e.min,e.max,i);Mp(e,t,n,s,r)}function Fs(e,t){Ny(e.x,t.x,t.scaleX,t.scale,t.originX),Ny(e.y,t.y,t.scaleY,t.scale,t.originY)}function Bk(e,t){return Nk($3(e.getBoundingClientRect(),t))}function Y3(e,t,n){const r=Bk(e,n),{scroll:i}=t;return i&&(Ls(r.x,i.offset.x),Ls(r.y,i.offset.y)),r}const $k=({current:e})=>e?e.ownerDocument.defaultView:null,Dy=(e,t)=>Math.abs(e-t);function Q3(e,t){const n=Dy(e.x,t.x),r=Dy(e.y,t.y);return Math.sqrt(n**2+r**2)}class zk{constructor(t,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=Id(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,m=Q3(u.offset,{x:0,y:0})>=3;if(!p&&!m)return;const{point:y}=u,{timestamp:w}=wt;this.history.push({...y,timestamp:w});const{onStart:x,onMove:h}=this.handlers;p||(x&&x(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),h&&h(this.lastMoveEvent,u)},this.handlePointerMove=(u,p)=>{this.lastMoveEvent=u,this.lastMoveEventInfo=Dd(p,this.transformPagePoint),Le.update(this.updatePoint,!0)},this.handlePointerUp=(u,p)=>{this.end();const{onEnd:m,onSessionEnd:y,resumeAnimation:w}=this.handlers;if(this.dragSnapToOrigin&&w&&w(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=Id(u.type==="pointercancel"?this.lastMoveEventInfo:Dd(p,this.transformPagePoint),this.history);this.startEvent&&m&&m(u,x),y&&y(u,x)},!Sm(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const o=ol(t),a=Dd(o,this.transformPagePoint),{point:l}=a,{timestamp:c}=wt;this.history=[{...l,timestamp:c}];const{onSessionStart:d}=n;d&&d(t,Id(a,this.history)),this.removeListeners=sl(ca(this.contextWindow,"pointermove",this.handlePointerMove),ca(this.contextWindow,"pointerup",this.handlePointerUp),ca(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),pi(this.updatePoint)}}function Dd(e,t){return t?{point:t(e.point)}:e}function Iy(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Id({point:e},t){return{point:e,delta:Iy(e,Vk(t)),offset:Iy(e,K3(t)),velocity:X3(t,.1)}}function K3(e){return e[0]}function Vk(e){return e[e.length-1]}function X3(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=Vk(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>rr(t)));)n--;if(!r)return{x:0,y:0};const s=ir(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const o={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Z3(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Ge(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Ge(n,e,r.max):Math.min(e,n)),e}function Ly(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function J3(e,{top:t,left:n,bottom:r,right:i}){return{x:Ly(e.x,n,i),y:Ly(e.y,t,r)}}function Fy(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function eR(e,t){return{x:Fy(e.x,t.x),y:Fy(e.y,t.y)}}function tR(e,t){let n=.5;const r=Dt(e),i=Dt(t);return i>r?n=Da(t.min,t.max-r,e.min):r>i&&(n=Da(e.min,e.max-i,t.min)),Ar(0,1,n)}function nR(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Op=.35;function rR(e=Op){return e===!1?e=0:e===!0&&(e=Op),{x:By(e,"left","right"),y:By(e,"top","bottom")}}function By(e,t,n){return{min:$y(e,t),max:$y(e,n)}}function $y(e,t){return typeof e=="number"?e:e[t]||0}const iR=new WeakMap;class sR{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=et(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=d=>{const{dragSnapToOrigin:u}=this.getProps();u?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(ol(d).point)},s=(d,u)=>{const{drag:p,dragPropagation:m,onDragStart:y}=this.getProps();if(p&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=tA(p),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),hn(x=>{let h=this.getAxisMotionValue(x).get()||0;if(or.test(h)){const{projection:g}=this.visualElement;if(g&&g.layout){const k=g.layout.layoutBox[x];k&&(h=Dt(k)*(parseFloat(h)/100))}}this.originPoint[x]=h}),y&&Le.postRender(()=>y(d,u)),wp(this.visualElement,"transform");const{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},o=(d,u)=>{const{dragPropagation:p,dragDirectionLock:m,onDirectionLock:y,onDrag:w}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:x}=u;if(m&&this.currentDirection===null){this.currentDirection=oR(x),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",u.point,x),this.updateAxis("y",u.point,x),this.visualElement.render(),w&&w(d,u)},a=(d,u)=>this.stop(d,u),l=()=>hn(d=>{var u;return this.getAnimationState(d)==="paused"&&((u=this.getAxisMotionValue(d).animation)==null?void 0:u.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new zk(t,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:$k(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&Le.postRender(()=>s(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!Il(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=Z3(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){var s;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,i=this.constraints;t&&Ns(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=J3(r.layoutBox,t):this.constraints=!1,this.elastic=rR(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&hn(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=nR(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Ns(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=Y3(r,i.root,this.visualElement.getTransformPagePoint());let o=eR(i.layout.layoutBox,s);if(n){const a=n(B3(o));this.hasMutatedConstraints=!!a,a&&(o=Nk(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=hn(d=>{if(!Il(d,n,this.currentDirection))return;let u=l&&l[d]||{};o&&(u={min:0,max:0});const p=i?200:1e6,m=i?40:1e7,y={type:"inertia",velocity:r?t[d]:0,bounceStiffness:p,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...s,...u};return this.startAxisValueAnimation(d,y)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return wp(this.visualElement,t),r.start(Hm(t,r,0,n,this.visualElement,!1))}stopAnimation(){hn(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){hn(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){hn(n=>{const{drag:r}=this.getProps();if(!Il(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n];s.set(t[n]-Ge(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Ns(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};hn(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=tR({min:l,max:l},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),hn(o=>{if(!Il(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(Ge(l,c,i[o]))})}addListeners(){if(!this.visualElement.current)return;iR.set(this.visualElement,this);const t=this.visualElement.current,n=ca(t,"pointerdown",l=>{const{drag:c,dragListener:d=!0}=this.getProps();c&&d&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Ns(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Le.read(r);const o=Ua(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(hn(d=>{const u=this.getAxisMotionValue(d);u&&(this.originPoint[d]+=l[d].translate,u.set(u.get()+l[d].translate))}),this.visualElement.render())});return()=>{o(),n(),s(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=Op,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function Il(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function oR(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class aR extends wi{constructor(t){super(t),this.removeGroupControls=Sn,this.removeListeners=Sn,this.controls=new sR(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Sn}unmount(){this.removeGroupControls(),this.removeListeners()}}const zy=e=>(t,n)=>{e&&Le.postRender(()=>e(t,n))};class lR extends wi{constructor(){super(...arguments),this.removePointerDownListener=Sn}onPointerDown(t){this.session=new zk(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:$k(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:zy(t),onStart:zy(n),onMove:r,onEnd:(s,o)=>{delete this.session,i&&Le.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=ca(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const sc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Vy(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const zo={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(he.test(e))e=parseFloat(e);else return e;const n=Vy(e,t.target.x),r=Vy(e,t.target.y);return`${n}% ${r}%`}},cR={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=hi.parse(e);if(i.length>5)return r;const s=hi.createTransformer(e),o=typeof i[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;i[0+o]/=a,i[1+o]/=l;const c=Ge(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=c),typeof i[3+o]=="number"&&(i[3+o]/=c),s(i)}};class uR extends v.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=t;jA(dR),s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),sc.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,o=r.projection;return o&&(o.isPresent=s,i||t.layoutDependency!==n||n===void 0||t.isPresent!==s?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||Le.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),km.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Uk(e){const[t,n]=jb(),r=v.useContext(dm);return f.jsx(uR,{...e,layoutGroup:r,switchLayoutGroup:v.useContext(zb),isPresent:t,safeToRemove:n})}const dR={borderRadius:{...zo,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:zo,borderTopRightRadius:zo,borderBottomLeftRadius:zo,borderBottomRightRadius:zo,boxShadow:cR};function fR(e,t,n){const r=At(e)?e:La(e);return r.start(Hm("",r,t,n)),r.animation}function pR(e){return e instanceof SVGElement&&e.tagName!=="svg"}const hR=(e,t)=>e.depth-t.depth;class mR{constructor(){this.children=[],this.isDirty=!1}add(t){hm(this.children,t),this.isDirty=!0}remove(t){mm(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(hR),this.isDirty=!1,this.children.forEach(t)}}function gR(e,t){const n=sr.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(pi(r),e(s-t))};return Le.read(r,!0),()=>pi(r)}const Hk=["TopLeft","TopRight","BottomLeft","BottomRight"],vR=Hk.length,Uy=e=>typeof e=="string"?parseFloat(e):e,Hy=e=>typeof e=="number"||he.test(e);function yR(e,t,n,r,i,s){i?(e.opacity=Ge(0,n.opacity??1,xR(r)),e.opacityExit=Ge(t.opacity??1,0,wR(r))):s&&(e.opacity=Ge(t.opacity??1,n.opacity??1,r));for(let o=0;o<vR;o++){const a=`border${Hk[o]}Radius`;let l=Wy(t,a),c=Wy(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Hy(l)===Hy(c)?(e[a]=Math.max(Ge(Uy(l),Uy(c),r),0),(or.test(c)||or.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=Ge(t.rotate||0,n.rotate||0,r))}function Wy(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const xR=Wk(0,.5,lk),wR=Wk(.5,.95,Sn);function Wk(e,t,n){return r=>r<e?0:r>t?1:n(Da(e,t,r))}function qy(e,t){e.min=t.min,e.max=t.max}function fn(e,t){qy(e.x,t.x),qy(e.y,t.y)}function Gy(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Yy(e,t,n,r,i){return e-=t,e=Gc(e,1/n,r),i!==void 0&&(e=Gc(e,1/i,r)),e}function bR(e,t=0,n=1,r=.5,i,s=e,o=e){if(or.test(t)&&(t=parseFloat(t),t=Ge(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=Ge(s.min,s.max,r);e===s&&(a-=t),e.min=Yy(e.min,t,n,a,i),e.max=Yy(e.max,t,n,a,i)}function Qy(e,t,[n,r,i],s,o){bR(e,t[n],t[r],t[i],t.scale,s,o)}const kR=["x","scaleX","originX"],SR=["y","scaleY","originY"];function Ky(e,t,n,r){Qy(e.x,t,kR,n?n.x:void 0,r?r.x:void 0),Qy(e.y,t,SR,n?n.y:void 0,r?r.y:void 0)}function Xy(e){return e.translate===0&&e.scale===1}function qk(e){return Xy(e.x)&&Xy(e.y)}function Zy(e,t){return e.min===t.min&&e.max===t.max}function CR(e,t){return Zy(e.x,t.x)&&Zy(e.y,t.y)}function Jy(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Gk(e,t){return Jy(e.x,t.x)&&Jy(e.y,t.y)}function e0(e){return Dt(e.x)/Dt(e.y)}function t0(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class TR{constructor(){this.members=[]}add(t){hm(this.members,t),t.scheduleRender()}remove(t){if(mm(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function _R(e,t,n){let r="";const i=e.x.translate/t.x,s=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((i||s||o)&&(r=`translate3d(${i}px, ${s}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:d,rotateX:u,rotateY:p,skewX:m,skewY:y}=n;c&&(r=`perspective(${c}px) ${r}`),d&&(r+=`rotate(${d}deg) `),u&&(r+=`rotateX(${u}deg) `),p&&(r+=`rotateY(${p}deg) `),m&&(r+=`skewX(${m}deg) `),y&&(r+=`skewY(${y}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const Ld=["","X","Y","Z"],ER={visibility:"hidden"},n0=1e3;let jR=0;function Fd(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Yk(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=tk(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Le,!(i||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Yk(r)}function Qk({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},a=t==null?void 0:t()){this.id=jR++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(PR),this.nodes.forEach(IR),this.nodes.forEach(LR),this.nodes.forEach(MR)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new mR)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new vm),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=pR(o),this.instance=o;const{layoutId:l,layout:c,visualElement:d}=this.options;if(d&&!d.current&&d.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(c||l)&&(this.isLayoutDirty=!0),e){let u;const p=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,u&&u(),u=gR(p,250),sc.hasAnimatedSinceResize&&(sc.hasAnimatedSinceResize=!1,this.nodes.forEach(i0))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||c)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:p,hasRelativeLayoutChanged:m,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const w=this.options.transition||d.getDefaultTransition()||VR,{onLayoutAnimationStart:x,onLayoutAnimationComplete:h}=d.getProps(),g=!this.targetLayout||!Gk(this.targetLayout,y),k=!p&&m;if(this.options.layoutRoot||this.resumeFrom||k||p&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(u,k);const C={...wm(w,"layout"),onPlay:x,onComplete:h};(d.shouldReduceMotion||this.options.layoutRoot)&&(C.delay=0,C.type=!1),this.startAnimation(C)}else p||i0(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,pi(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(FR),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Yk(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const u=this.path[d];u.shouldResetTransform=!0,u.updateScroll("snapshot"),u.options.layoutRoot&&u.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(r0);return}this.isUpdating||this.nodes.forEach(NR),this.isUpdating=!1,this.nodes.forEach(DR),this.nodes.forEach(AR),this.nodes.forEach(RR),this.clearAllSnapshots();const a=sr.now();wt.delta=Ar(0,1e3/60,a-wt.timestamp),wt.timestamp=a,wt.isProcessing=!0,jd.update.process(wt),jd.preRender.process(wt),jd.render.process(wt),wt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,km.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(OR),this.sharedNodes.forEach(BR)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Le.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Le.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Dt(this.snapshot.measuredBox.x)&&!Dt(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=et(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!qk(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,d=c!==this.prevTransformTemplateValue;o&&(a||ji(this.latestValues)||d)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),UR(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:o}=this.options;if(!o)return et();const a=o.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(HR))){const{scroll:d}=this.root;d&&(Ls(a.x,d.offset.x),Ls(a.y,d.offset.y))}return a}removeElementScroll(o){var l;const a=et();if(fn(a,o),(l=this.scroll)!=null&&l.wasRoot)return a;for(let c=0;c<this.path.length;c++){const d=this.path[c],{scroll:u,options:p}=d;d!==this.root&&u&&p.layoutScroll&&(u.wasRoot&&fn(a,o),Ls(a.x,u.offset.x),Ls(a.y,u.offset.y))}return a}applyTransform(o,a=!1){const l=et();fn(l,o);for(let c=0;c<this.path.length;c++){const d=this.path[c];!a&&d.options.layoutScroll&&d.scroll&&d!==d.root&&Fs(l,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),ji(d.latestValues)&&Fs(l,d.latestValues)}return ji(this.latestValues)&&Fs(l,this.latestValues),l}removeTransform(o){const a=et();fn(a,o);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!ji(c.latestValues))continue;Pp(c.latestValues)&&c.updateSnapshot();const d=et(),u=c.measurePageBox();fn(d,u),Ky(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,d)}return ji(this.latestValues)&&Ky(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.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!==wt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var p;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:u}=this.options;if(!(!this.layout||!(d||u))){if(this.resolvedRelativeTargetAt=wt.timestamp,!this.targetDelta&&!this.relativeTarget){const m=this.getClosestProjectingParent();m&&m.layout&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=et(),this.relativeTargetOrigin=et(),da(this.relativeTargetOrigin,this.layout.layoutBox,m.layout.layoutBox),fn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=et(),this.targetWithTransforms=et()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),q3(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):fn(this.target,this.layout.layoutBox),Fk(this.target,this.targetDelta)):fn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const m=this.getClosestProjectingParent();m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=et(),this.relativeTargetOrigin=et(),da(this.relativeTargetOrigin,this.target,m.target),fn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Pp(this.parent.latestValues)||Lk(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var y;const o=this.getLead(),a=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===wt.timestamp&&(l=!1),l)return;const{layout:c,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||d))return;fn(this.layoutCorrected,this.layout.layoutBox);const u=this.treeScale.x,p=this.treeScale.y;G3(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=et());const{target:m}=o;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Gy(this.prevProjectionDelta.x,this.projectionDelta.x),Gy(this.prevProjectionDelta.y,this.projectionDelta.y)),ua(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==u||this.treeScale.y!==p||!t0(this.projectionDelta.x,this.prevProjectionDelta.x)||!t0(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Is(),this.projectionDelta=Is(),this.projectionDeltaWithTransform=Is()}setAnimationOrigin(o,a=!1){const l=this.snapshot,c=l?l.latestValues:{},d={...this.latestValues},u=Is();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const p=et(),m=l?l.source:void 0,y=this.layout?this.layout.source:void 0,w=m!==y,x=this.getStack(),h=!x||x.members.length<=1,g=!!(w&&!h&&this.options.crossfade===!0&&!this.path.some(zR));this.animationProgress=0;let k;this.mixTargetDelta=C=>{const S=C/1e3;s0(u.x,o.x,S),s0(u.y,o.y,S),this.setTargetDelta(u),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(da(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),$R(this.relativeTarget,this.relativeTargetOrigin,p,S),k&&CR(this.relativeTarget,k)&&(this.isProjectionDirty=!1),k||(k=et()),fn(k,this.relativeTarget)),w&&(this.animationValues=d,yR(d,c,this.latestValues,S,g,h)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(pi(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Le.update(()=>{sc.hasAnimatedSinceResize=!0,this.currentAnimation=fR(0,n0,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(n0),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:d}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&Kk(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||et();const u=Dt(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+u;const p=Dt(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+p}fn(a,l),Fs(a,d),ua(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new TR),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&Fd("z",o,c,this.animationValues);for(let d=0;d<Ld.length;d++)Fd(`rotate${Ld[d]}`,o,c,this.animationValues),Fd(`skew${Ld[d]}`,o,c,this.animationValues);o.render();for(const d in c)o.setStaticValue(d,c[d]),this.animationValues&&(this.animationValues[d]=c[d]);o.scheduleRender()}getProjectionStyles(o){if(!this.instance||this.isSVG)return;if(!this.isVisible)return ER;const a={visibility:""},l=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,a.opacity="",a.pointerEvents=ic(o==null?void 0:o.pointerEvents)||"",a.transform=l?l(this.latestValues,""):"none",a;const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){const m={};return this.options.layoutId&&(m.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,m.pointerEvents=ic(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!ji(this.latestValues)&&(m.transform=l?l({},""):"none",this.hasProjected=!1),m}const d=c.animationValues||c.latestValues;this.applyTransformsToTarget(),a.transform=_R(this.projectionDeltaWithTransform,this.treeScale,d),l&&(a.transform=l(d,a.transform));const{x:u,y:p}=this.projectionDelta;a.transformOrigin=`${u.origin*100}% ${p.origin*100}% 0`,c.animationValues?a.opacity=c===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:a.opacity=c===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const m in Ba){if(d[m]===void 0)continue;const{correct:y,applyTo:w,isCSSVariable:x}=Ba[m],h=a.transform==="none"?d[m]:y(d[m],c);if(w){const g=w.length;for(let k=0;k<g;k++)a[w[k]]=h}else x?this.options.visualElement.renderState.vars[m]=h:a[m]=h}return this.options.layoutId&&(a.pointerEvents=c===this?ic(o==null?void 0:o.pointerEvents)||"":"none"),a}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(r0),this.root.sharedNodes.clear()}}}function AR(e){e.updateLayout()}function RR(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:s}=e.options,o=t.source!==e.layout.source;s==="size"?hn(u=>{const p=o?t.measuredBox[u]:t.layoutBox[u],m=Dt(p);p.min=r[u].min,p.max=p.min+m}):Kk(s,t.layoutBox,r)&&hn(u=>{const p=o?t.measuredBox[u]:t.layoutBox[u],m=Dt(r[u]);p.max=p.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+m)});const a=Is();ua(a,r,t.layoutBox);const l=Is();o?ua(l,e.applyTransform(i,!0),t.measuredBox):ua(l,r,t.layoutBox);const c=!qk(a);let d=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:p,layout:m}=u;if(p&&m){const y=et();da(y,t.layoutBox,p.layoutBox);const w=et();da(w,r,m.layoutBox),Gk(y,w)||(d=!0),u.options.layoutRoot&&(e.relativeTarget=w,e.relativeTargetOrigin=y,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function PR(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 MR(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function OR(e){e.clearSnapshot()}function r0(e){e.clearMeasurements()}function NR(e){e.isLayoutDirty=!1}function DR(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function i0(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function IR(e){e.resolveTargetDelta()}function LR(e){e.calcProjection()}function FR(e){e.resetSkewAndRotation()}function BR(e){e.removeLeadSnapshot()}function s0(e,t,n){e.translate=Ge(t.translate,0,n),e.scale=Ge(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function o0(e,t,n,r){e.min=Ge(t.min,n.min,r),e.max=Ge(t.max,n.max,r)}function $R(e,t,n,r){o0(e.x,t.x,n.x,r),o0(e.y,t.y,n.y,r)}function zR(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const VR={duration:.45,ease:[.4,0,.1,1]},a0=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),l0=a0("applewebkit/")&&!a0("chrome/")?Math.round:Sn;function c0(e){e.min=l0(e.min),e.max=l0(e.max)}function UR(e){c0(e.x),c0(e.y)}function Kk(e,t,n){return e==="position"||e==="preserve-aspect"&&!W3(e0(t),e0(n),.2)}function HR(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const WR=Qk({attachResizeListener:(e,t)=>Ua(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Bd={current:void 0},Xk=Qk({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Bd.current){const e=new WR({});e.mount(window),e.setOptions({layoutScroll:!0}),Bd.current=e}return Bd.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),qR={pan:{Feature:lR},drag:{Feature:aR,ProjectionNode:Xk,MeasureLayout:Uk}};function u0(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&Le.postRender(()=>s(t,ol(t)))}class GR extends wi{mount(){const{current:t}=this.node;t&&(this.unmount=rA(t,(n,r)=>(u0(this.node,r,"Start"),i=>u0(this.node,i,"End"))))}unmount(){}}class YR extends wi{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=sl(Ua(this.node.current,"focus",()=>this.onFocus()),Ua(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function d0(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),s=r[i];s&&Le.postRender(()=>s(t,ol(t)))}class QR extends wi{mount(){const{current:t}=this.node;t&&(this.unmount=aA(t,(n,r)=>(d0(this.node,r,"Start"),(i,{success:s})=>d0(this.node,i,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Np=new WeakMap,$d=new WeakMap,KR=e=>{const t=Np.get(e.target);t&&t(e)},XR=e=>{e.forEach(KR)};function ZR({root:e,...t}){const n=e||document;$d.has(n)||$d.set(n,{});const r=$d.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(XR,{root:e,...t})),r[i]}function JR(e,t,n){const r=ZR(t);return Np.set(e,n),r.observe(e),()=>{Np.delete(e),r.unobserve(e)}}const eP={some:0,all:1};class tP extends wi{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:eP[i]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,s&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:d,onViewportLeave:u}=this.node.getProps(),p=c?d:u;p&&p(l)};return JR(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(nP(t,n))&&this.startObserver()}unmount(){}}function nP({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const rP={inView:{Feature:tP},tap:{Feature:QR},focus:{Feature:YR},hover:{Feature:GR}},iP={layout:{ProjectionNode:Xk,MeasureLayout:Uk}},Dp={current:null},Zk={current:!1};function sP(){if(Zk.current=!0,!!fm)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Dp.current=e.matches;e.addListener(t),t()}else Dp.current=!1}const oP=[...Sk,Et,hi],aP=e=>oP.find(kk(e)),lP=new WeakMap;function cP(e,t,n){for(const r in t){const i=t[r],s=n[r];if(At(i))e.addValue(r,i);else if(At(s))e.addValue(r,La(i,{owner:e}));else if(s!==i)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=e.getStaticValue(r);e.addValue(r,La(o!==void 0?o:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const f0=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class uP{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=zm,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const m=sr.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,Le.render(this.render,!1,!0))};const{latestValues:l,renderState:c,onUpdate:d}=o;this.onUpdate=d,this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=_u(n),this.isVariantNode=Bb(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...p}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in p){const y=p[m];l[m]!==void 0&&At(y)&&y.set(l[m],!1)}}mount(t){this.current=t,lP.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),Zk.current||sP(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Dp.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),pi(this.notifyUpdate),pi(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=ls.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&Le.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in mo){const n=mo[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):et()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<f0.length;r++){const i=f0[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,o=t[s];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=cP(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=La(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(wk(r)||uk(r))?r=parseFloat(r):!aP(r)&&hi.test(n)&&(r=vk(t,n)),this.setBaseTarget(t,At(r)?r.get():r)),At(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var s;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=Dm(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);o&&(r=o[t])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!At(i)?i:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new vm),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Jk extends uP{constructor(){super(...arguments),this.KeyframeResolver=Ck}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;At(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function dP(e){return window.getComputedStyle(e)}class fP extends Jk{constructor(){super(...arguments),this.type="html",this.renderInstance=Kb}readValueFromInstance(t,n){if(ls.has(n))return T5(t,n);{const r=dP(t),i=(Em(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Bk(t,n)}build(t,n,r){Rm(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Im(t,n,r)}}class pP extends Jk{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=et,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&Qb(this.current,this.renderState)}}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(ls.has(n)){const r=gk(n);return r&&r.default||0}return n=Xb.has(n)?n:_m(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Jb(t,n,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&Le.postRender(this.updateDimensions)}build(t,n,r){Om(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){Zb(t,n,r,i)}mount(t){this.isSVGTag=Nm(t.tagName),super.mount(t)}}const hP=(e,t)=>Mm(e)?new pP(t):new fP(t,{allowProjection:e!==v.Fragment}),mP=ZA({...L3,...rP,...qR,...iP},hP),Pe=hA(mP);class gP{constructor(){this.componentControls=new Set}subscribe(t){return this.componentControls.add(t),()=>this.componentControls.delete(t)}start(t,n){this.componentControls.forEach(r=>{r.start(t.nativeEvent||t,n)})}}const vP=()=>new gP;function yP(){return ku(vP)}var $r=(e=>(e.None="none",e.Sm="sm",e.Md="md",e.Lg="lg",e.Xl="xl",e.Full="full",e))($r||{});const eS=v.createContext({}),xP={[re.TooltipDefault]:"Bizimle sohbet edin!",[re.TooltipActive]:"Yeni mesajlar var!",[re.CloseButtonAria]:"Kapat",[re.MessagePlaceholder]:"Mesajınızı yazın",[re.FileUploadDisabled]:"Dosya gönderim izniniz olmadığı için yükleyemezsiniz",[re.NewMessagesNotification]:"Yeni mesajlar var!",[re.ChatCloseConfirm]:"Sohbeti kapatmak istediğinizden emin misiniz?",[re.ChatCloseWarning]:"Bu işlem geri alınamaz.",[re.ChatSettings]:"Sohbet Ayarları",[re.ChatEndConversation]:"Sohbeti Sonlandır",[re.CancelAction]:"Vazgeç",[re.CloseAction]:"Kapat",[re.QuickActions]:"Hızlı işlemler",[re.GreetingStartChat]:"Sohbete başla",[re.RateLimitMessage]:"Çok fazla mesaj gönderdiniz. Lütfen {seconds} saniye bekleyin.",[re.RatingHeaderEvaluate]:"Görüşmenizi Değerlendirin",[re.RatingHeaderThanks]:"Teşekkürler!",[re.RatingDescription]:"Lütfen hizmetimizi değerlendirin. Görüşleriniz bizim için önemli.",[re.RatingRateConversation]:"Görüşmeyi puanlayın",[re.RatingComment]:"Yorumunuz (İsteğe bağlı)",[re.RatingCommentPlaceholder]:"Görüşme hakkında düşüncelerinizi paylaşın...",[re.RatingSubmit]:"Değerlendirmeyi Gönder",[re.RatingNewConversation]:"Yeni Görüşme Başlat",[re.RatingThankYouTitle]:"Değerlendirmeniz için teşekkürler!",[re.RatingThankYouDescription]:"Geri bildiriminiz bizim için çok değerli.",[re.RatingCountdown]:"Ekran {seconds} saniye içinde kapanacaktır.",[re.RatingMinimumError]:"Lütfen en az 1 yıldız seçiniz.",[re.RatingYourScore]:"Puanınız: {score}",[re.PoweredBy]:"Powered by",[re.NotificationSoundOn]:"Bildirim sesi aç",[re.NotificationSoundOff]:"Bildirim sesi kapat"},wP={[b.Background]:"#ffffff",[b.Border]:"#e2e8f0",[b.TooltipText]:"#1e40af",[b.TooltipBackground]:"#dbeafe",[b.TooltipBorder]:"#3b82f6",[b.HeaderBackground]:"#ffffff",[b.HeaderBorder]:"#e2e8f0",[b.HeaderText]:"#1e293b",[b.FooterBackground]:"#f8fafc",[b.FooterBorder]:"#e2e8f0",[b.FooterText]:"#475569",[b.MessageAdminBackground]:"#f1f5f9",[b.MessageAdminText]:"#334155",[b.MessageVisitorBackground]:"#3b82f6",[b.MessageVisitorText]:"#ffffff",[b.MessageAgentBackground]:"#ede9fe",[b.MessageAgentText]:"#5b21b6",[b.GreeterBackground]:"#ffffff",[b.GreeterText]:"#334155",[b.GreeterBorder]:"#e2e8f0",[b.GreeterTopBackground]:"linear-gradient(135deg, #3b82f6 0%, #2563eb 100%)",[b.GreeterTopText]:"#ffffff",[b.GreeterButtonBackground]:"#3b82f6",[b.GreeterButtonText]:"#ffffff",[b.ButtonBackground]:"#3b82f6",[b.ButtonText]:"#ffffff",[b.InputBackground]:"#f8fafc",[b.InputText]:"#1e293b",[b.InputBorder]:"#e2e8f0",[b.CloseButtonBackground]:"#f1f5f9",[b.CloseButtonText]:"#475569",[b.CloseButtonHover]:"#e2e8f0",[b.IconColor]:"#64748b",[b.IconBackground]:"transparent",[b.ErrorBackground]:"#fef2f2",[b.ErrorText]:"#dc2626",[b.ErrorBorder]:"#fca5a5",[b.SuccessBackground]:"#f0fdf4",[b.SuccessText]:"#16a34a",[b.SuccessBorder]:"#86efac",[b.WarningBackground]:"#fffbeb",[b.WarningText]:"#d97706",[b.WarningBorder]:"#fcd34d",[b.LinkColor]:"#2563eb",[b.LinkHoverColor]:"#1d4ed8",[b.DividerColor]:"#e2e8f0",[b.ShadowColor]:"rgba(0, 0, 0, 0.1)",[b.StarActiveColor]:"#f59e0b",[b.StarInactiveColor]:"#e2e8f0",[b.ModalOverlayColor]:"rgba(0, 0, 0, 0.4)",[b.ChatCloseConfirmText]:"#dc2626",[b.RatingHeaderBackground]:"#3b82f6",[b.RatingHeaderText]:"#ffffff",[b.RatingSuccessBackground]:"#ffffff",[b.RatingSuccessText]:"#334155",[b.RatingRateConversationText]:"#1e293b"},bP={[b.Background]:"#0a0a0a",[b.Border]:"#262626",[b.TooltipText]:"#e5e5e5",[b.TooltipBackground]:"#262626",[b.TooltipBorder]:"#404040",[b.HeaderBackground]:"#171717",[b.HeaderBorder]:"#262626",[b.HeaderText]:"#fafafa",[b.FooterBackground]:"#0a0a0a",[b.FooterBorder]:"#262626",[b.FooterText]:"#a3a3a3",[b.MessageAdminBackground]:"#262626",[b.MessageAdminText]:"#e5e5e5",[b.MessageVisitorBackground]:"#171717",[b.MessageVisitorText]:"#e5e5e5",[b.MessageAgentBackground]:"#5b21b6",[b.MessageAgentText]:"#e9d5ff",[b.GreeterBackground]:"#171717",[b.GreeterText]:"#e5e5e5",[b.GreeterBorder]:"#262626",[b.GreeterTopBackground]:"linear-gradient(135deg, #262626 0%, #171717 100%)",[b.GreeterTopText]:"#fafafa",[b.GreeterButtonBackground]:"#3b82f6",[b.GreeterButtonText]:"#ffffff",[b.ButtonBackground]:"#3b82f6",[b.ButtonText]:"#ffffff",[b.InputBackground]:"#171717",[b.InputText]:"#e5e5e5",[b.InputBorder]:"#3f3f3f",[b.CloseButtonBackground]:"#262626",[b.CloseButtonText]:"#a3a3a3",[b.CloseButtonHover]:"#404040",[b.IconColor]:"#a3a3a3",[b.IconBackground]:"transparent",[b.ErrorBackground]:"#450a0a",[b.ErrorText]:"#fca5a5",[b.ErrorBorder]:"#7f1d1d",[b.SuccessBackground]:"#052e16",[b.SuccessText]:"#86efac",[b.SuccessBorder]:"#14532d",[b.WarningBackground]:"#451a03",[b.WarningText]:"#fcd34d",[b.WarningBorder]:"#78350f",[b.LinkColor]:"#3b82f6",[b.LinkHoverColor]:"#60a5fa",[b.DividerColor]:"#262626",[b.ShadowColor]:"rgba(0, 0, 0, 0.4)",[b.StarActiveColor]:"#f59e0b",[b.StarInactiveColor]:"#404040",[b.ModalOverlayColor]:"rgba(0, 0, 0, 0.7)",[b.ChatCloseConfirmText]:"#fca5a5",[b.RatingHeaderBackground]:"#171717",[b.RatingHeaderText]:"#fafafa",[b.RatingSuccessBackground]:"#171717",[b.RatingSuccessText]:"#e5e5e5",[b.RatingRateConversationText]:"#e5e5e5"},kP={[$r.None]:"0px",[$r.Sm]:"var(--radius-sm)",[$r.Md]:"var(--radius-md)",[$r.Lg]:"var(--radius-lg)",[$r.Xl]:"var(--radius-lg)",[$r.Full]:"calc(infinity * 1px)"},SP=e=>{const t={...xP};if(!e||!e.appearance||!e.appearance.design||!e.appearance.design.texts)return t;for(const n in e.appearance.design.texts){const r=n;e.appearance.design.texts[r]&&(t[r]=e.appearance.design.texts[r])}return t};function CP(e,t){const n=e.replace(/^#/,"");if(n.length!==6)return e;const r=Math.max(0,Math.round(Number.parseInt(n.slice(0,2),16)*(1-t))),i=Math.max(0,Math.round(Number.parseInt(n.slice(2,4),16)*(1-t))),s=Math.max(0,Math.round(Number.parseInt(n.slice(4,6),16)*(1-t)));return`#${r.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}`}const zd="#ffffff";function TP(e){const t=CP(e,.2);return{[b.ButtonBackground]:t,[b.ButtonText]:zd,[b.GreeterButtonBackground]:t,[b.GreeterButtonText]:zd,[b.MessageVisitorBackground]:t,[b.MessageVisitorText]:zd}}const _P=(e,t)=>{var i,s;const r={...t==="dark"?bP:wP};if(t==="dark")return r;if((s=(i=e==null?void 0:e.appearance)==null?void 0:i.design)!=null&&s.colors){const o=e.appearance.design.colors,a=o.main_color;if(a){const l=TP(a);for(const c of Object.keys(l))l[c]&&(r[c]=l[c])}for(const l in o){if(l==="main_color"||l==="secondary_color"||l==="accent_color")continue;const c=l;o[l]&&l in r&&(r[c]=o[l])}}return r},tS="lc:theme:mode";function EP(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function jP(){try{const e=localStorage.getItem(tS);if(e==="light"||e==="dark"||e==="system")return e}catch{}return Ne.System}function AP({children:e,widget:t}){const[n,r]=v.useState(jP),[i,s]=v.useState(EP);v.useEffect(()=>{const y=window.matchMedia("(prefers-color-scheme: dark)"),w=x=>{s(x.matches?"dark":"light")};return y.addEventListener("change",w),()=>y.removeEventListener("change",w)},[]);const o=n===Ne.System?i:n,a=v.useCallback(y=>{r(y);try{localStorage.setItem(tS,y)}catch{}},[]),l=_P(t,o),c=SP(t),d=t&&t.appearance&&t.appearance.design&&t.appearance.design.border_radius?t.appearance.design.border_radius:$r.Md,u=y=>l[y],p=y=>c[y],m=()=>kP[d];return f.jsx(eS.Provider,{value:{colors:l,texts:c,getColor:u,getText:p,getRadius:m,mode:n,resolvedMode:o,setMode:a},children:e})}const Se=()=>v.useContext(eS),cs=()=>Se().getText;function Rt({children:e,type:t="button",variant:n="primary",kind:r="solid",size:i="md",disabled:s=!1,rounded:o=!1,className:a,style:l,textKey:c=b.ButtonText,bgKey:d=b.ButtonBackground,animations:u={},withoutTheming:p,...m}){const y=Se();return f.jsx(Pe.button,{type:t,className:ze("flex items-center justify-center focus:outline-none focus:ring-2 focus:ring-offset-0 font-medium transition-opacity",{"rounded-full":o&&i!=="xs","rounded-lg":!o,"opacity-50 cursor-not-allowed":s,"hover:opacity-90 active:opacity-95":!s},a,Yv[n]&&Yv[n][r],$j[i][o?"rounded":"default"]),disabled:s,style:{transition:"all 0.2s ease",...!p&&{color:y.getColor(c),backgroundColor:y.getColor(d),...o?{}:{borderRadius:y.getRadius()}},...l},...u,...m,children:e})}function X(){}X.Home=function(t){return f.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",height:"1em",width:"1em",...t,children:f.jsx("path",{d:"M3 13h1v7c0 1.103.897 2 2 2h12c1.103 0 2-.897 2-2v-7h1a1 1 0 00.707-1.707l-9-9a.999.999 0 00-1.414 0l-9 9A1 1 0 003 13zm7 7v-5h4v5h-4zm2-15.586l6 6V15l.001 5H16v-5c0-1.103-.897-2-2-2h-4c-1.103 0-2 .897-2 2v5H6v-9.586l6-6z"})})};X.Chat=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 8.25h9m-9 3H12m-9.75 1.51c0 1.6 1.123 2.994 2.707 3.227 1.129.166 2.27.293 3.423.379.35.026.67.21.865.501L12 21l2.755-4.133a1.14 1.14 0 0 1 .865-.501 48.172 48.172 0 0 0 3.423-.379c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0 0 12 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018Z"})});X.Menu=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"})});X.MessageTyping=({className:e="size-5",...t})=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,...t,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.625 9.75a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H8.25m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H12m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0h-.375m-13.5 3.01c0 1.6 1.123 2.994 2.707 3.227 1.087.16 2.185.283 3.293.369V21l4.184-4.183a1.14 1.14 0 0 1 .778-.332 48.294 48.294 0 0 0 5.83-.498c1.585-.233 2.708-1.626 2.708-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0 0 12 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018Z"})});X.Check=function(t){return f.jsx("svg",{fill:"currentColor",viewBox:"0 0 16 16",height:"1em",width:"1em",...t,children:f.jsx("path",{d:"M12.736 3.97a.733.733 0 011.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 01-1.065.02L3.217 8.384a.757.757 0 010-1.06.733.733 0 011.047 0l3.052 3.093 5.4-6.425a.247.247 0 01.02-.022z"})})};X.Website=function(t){return f.jsxs("svg",{fill:"none",viewBox:"0 0 24 24",height:"1em",width:"1em",...t,children:[f.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M14 7a1 1 0 00-1 1v8a1 1 0 001 1h4a1 1 0 001-1V8a1 1 0 00-1-1h-4zm3 2h-2v6h2V9z",clipRule:"evenodd"}),f.jsx("path",{fill:"currentColor",d:"M6 7a1 1 0 000 2h4a1 1 0 100-2H6zM6 11a1 1 0 100 2h4a1 1 0 100-2H6zM5 16a1 1 0 011-1h4a1 1 0 110 2H6a1 1 0 01-1-1z"}),f.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M4 3a3 3 0 00-3 3v12a3 3 0 003 3h16a3 3 0 003-3V6a3 3 0 00-3-3H4zm16 2H4a1 1 0 00-1 1v12a1 1 0 001 1h16a1 1 0 001-1V6a1 1 0 00-1-1z",clipRule:"evenodd"})]})};X.ArrowDown=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 13.5 12 21m0 0-7.5-7.5M12 21V3"})});X.ArrowDown2=e=>f.jsxs("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",...e,children:[f.jsx("g",{id:"SVGRepo_bgCarrier",strokeWidth:1.5}),f.jsx("g",{id:"SVGRepo_tracerCarrier",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5}),f.jsx("g",{id:"SVGRepo_iconCarrier",children:f.jsx("path",{d:"M903.232 256l56.768 50.432L512 768 64 306.432 120.768 256 512 659.072z",fill:"currentColor"})})]});X.ArrowLeft=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"})});X.XCircle=({className:e="e-5",...t})=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,...t,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})});X.X=({className:e="e-5",...t})=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,...t,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})});X.PaperAirplane=({className:e="e-5",...t})=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,...t,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 12L3.269 3.126A59.768 59.768 0 0121.485 12 59.77 59.77 0 013.27 20.876L5.999 12zm0 0h7.5"})});X.Spin=function(t){return f.jsx("svg",{"data-name":"Layer 1",viewBox:"0 0 24 24",fill:"currentColor",height:"1em",width:"1em",...t,children:f.jsx("path",{d:"M6.804 15a1 1 0 00-1.366-.366l-1.732 1a1 1 0 001 1.732l1.732-1A1 1 0 006.804 15zM3.706 8.366l1.732 1a1 1 0 101-1.732l-1.732-1a1 1 0 00-1 1.732zM6 12a1 1 0 00-1-1H3a1 1 0 000 2h2a1 1 0 001-1zm11.196-3a1 1 0 001.366.366l1.732-1a1 1 0 10-1-1.732l-1.732 1A1 1 0 0017.196 9zM15 6.804a1 1 0 001.366-.366l1-1.732a1 1 0 10-1.732-1l-1 1.732A1 1 0 0015 6.804zm5.294 8.83l-1.732-1a1 1 0 10-1 1.732l1.732 1a1 1 0 001-1.732zm-3.928 1.928a1 1 0 10-1.732 1l1 1.732a1 1 0 101.732-1zM21 11h-2a1 1 0 000 2h2a1 1 0 000-2zm-9 7a1 1 0 00-1 1v2a1 1 0 002 0v-2a1 1 0 00-1-1zm-3-.804a1 1 0 00-1.366.366l-1 1.732a1 1 0 001.732 1l1-1.732A1 1 0 009 17.196zM12 2a1 1 0 00-1 1v2a1 1 0 002 0V3a1 1 0 00-1-1z"})})};X.ExternalLink=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"})});X.Phone=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 6.75c0 8.284 6.716 15 15 15h2.25a2.25 2.25 0 002.25-2.25v-1.372c0-.516-.351-.966-.852-1.091l-4.423-1.106c-.44-.11-.902.055-1.173.417l-.97 1.293c-.282.376-.769.542-1.21.38a12.035 12.035 0 01-7.143-7.143c-.162-.441.004-.928.38-1.21l1.293-.97c.363-.271.527-.734.417-1.173L6.963 3.102a1.125 1.125 0 00-1.091-.852H4.5A2.25 2.25 0 002.25 4.5v2.25z"})});X.Mail=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.75 6.75v10.5a2.25 2.25 0 01-2.25 2.25h-15a2.25 2.25 0 01-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25m19.5 0v.243a2.25 2.25 0 01-1.07 1.916l-7.5 4.615a2.25 2.25 0 01-2.36 0L3.32 8.91a2.25 2.25 0 01-1.07-1.916V6.75"})});X.Star=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z"})});X.Plus=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"})});X.History=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})});X.Eye=e=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:[f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z"}),f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]});X.Lock=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 10.5V6.75a4.5 4.5 0 119 0v3.75M3.75 21.75h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H3.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z"})});X.User=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z"})});X.Emoji=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.182 15.182a4.5 4.5 0 0 1-6.364 0M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0ZM9.75 9.75c0 .414-.168.75-.375.75S9 10.164 9 9.75 9.168 9 9.375 9s.375.336.375.75Zm-.375 0h.008v.015h-.008V9.75Zm5.625 0c0 .414-.168.75-.375.75s-.375-.336-.375-.75.168-.75.375-.75.375.336.375.75Zm-.375 0h.008v.015h-.008V9.75Z"})});X.Paperclip=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13"})});X.Sparkles=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.455 2.456L21.75 6l-1.036.259a3.375 3.375 0 0 0-2.455 2.456ZM16.894 20.567 16.5 21.75l-.394-1.183a2.25 2.25 0 0 0-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394-1.183.394a2.25 2.25 0 0 0-1.423 1.423Z"})});X.Sun=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75v-2.25m-4.773 4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z"})});X.Moon=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z"})});X.Monitor=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 0 1-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0 1 15 18.257V17.25m6-12V15a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 15V5.25m18 0A2.25 2.25 0 0 0 18.75 3H5.25A2.25 2.25 0 0 0 3 5.25m18 0V12a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 12V5.25"})});X.Volume2=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.114 5.636a9 9 0 0 1 0 12.728M16.463 8.288a5.25 5.25 0 0 1 0 7.424M6.75 8.25l4.72-4.72a.75.75 0 0 1 1.28.53v15.88a.75.75 0 0 1-1.28.53l-4.72-4.72H4.51c-.88 0-1.704-.507-1.938-1.354A9.01 9.01 0 0 1 2.25 12c0-.83.112-1.633.322-2.396C2.806 8.756 3.63 8.25 4.51 8.25H6.75Z"})});X.VolumeX=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.25 9.75 19.5 12m0 0 2.25 2.25M19.5 12l2.25-2.25M19.5 12l-2.25 2.25m-10.5-6 4.72-4.72a.75.75 0 0 1 1.28.53v15.88a.75.75 0 0 1-1.28.53l-4.72-4.72H4.51c-.88 0-1.704-.507-1.938-1.354A9.01 9.01 0 0 1 2.25 12c0-.83.112-1.633.322-2.396C2.806 8.756 3.63 8.25 4.51 8.25H6.75Z"})});X.Bot=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 3v1.5M4.5 8.25H3m18 0h-1.5M4.5 12H3m18 0h-1.5m-15 3.75H3m18 0h-1.5M8.25 19.5V21M12 3v1.5m0 15V21m3.75-18v1.5m0 15V21m-9-1.5h10.5a2.25 2.25 0 0 0 2.25-2.25V6.75a2.25 2.25 0 0 0-2.25-2.25H6.75A2.25 2.25 0 0 0 4.5 6.75v10.5a2.25 2.25 0 0 0 2.25 2.25Zm.75-12h9v9h-9v-9Z"})});function Ip(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var rt=(e=>(e.CustomerToken="lc:customer:token",e.CustomerRefreshToken="lc:customer:refresh_token",e.DeviceId="lc:device:id",e.AIAgentMode="lc:agent:mode",e.AIAgent="lc:agent:data",e.AIAgentSessionId="lc:agent:session",e.HumanNeedRequested="lc:agent:human_need",e))(rt||{});const Ln=(e,t,n)=>{let r=e;["lc:customer:token","lc:customer:refresh_token"].includes(e)&&(r=`${n}:${e}`),localStorage.setItem(r,t)},Xo=(e,t)=>{let n=e;return["lc:customer:token","lc:customer:refresh_token"].includes(e)&&(n=`${t}:${e}`),localStorage.getItem(n)},fa=e=>{localStorage.removeItem(`${e}:lc:customer:token`),localStorage.removeItem(`${e}:lc:customer:refresh_token`),Wm(e)},nS=e=>{localStorage.removeItem(`${e}:lc:customer:token`),localStorage.removeItem(`${e}:lc:customer:refresh_token`)},Ll=(e,t,n,r,i)=>{const s=`${e}:`;t&&(n||i)?(localStorage.setItem(`${s}lc:agent:mode`,"true"),localStorage.setItem(`${s}lc:agent:data`,JSON.stringify(t)),r&&localStorage.setItem(`${s}lc:agent:session`,r),i!==void 0&&(i?localStorage.setItem(`${s}lc:agent:human_need`,"true"):localStorage.removeItem(`${s}lc:agent:human_need`))):Wm(e)},mr=e=>{const t=`${e}:`,n=localStorage.getItem(`${t}lc:agent:mode`)==="true",r=localStorage.getItem(`${t}lc:agent:data`),i=localStorage.getItem(`${t}lc:agent:session`),s=localStorage.getItem(`${t}lc:agent:human_need`)==="true";let o=null;if(r)try{o=JSON.parse(r)}catch{o=null}return{isAgentMode:n,agent:o,sessionId:i,humanNeedRequested:s}},Wm=e=>{const t=`${e}:`;localStorage.removeItem(`${t}lc:agent:mode`),localStorage.removeItem(`${t}lc:agent:data`),localStorage.removeItem(`${t}lc:agent:session`),localStorage.removeItem(`${t}lc:agent:human_need`)},mi=e=>{const t=`${e}:lc:device:id`;let n=localStorage.getItem(t);return n||(n=Ip(),localStorage.setItem(t,n)),n},RP={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},p0=e=>{let t;const n=new Set,r=(d,u)=>{const p=typeof d=="function"?d(t):d;if(!Object.is(p,t)){const m=t;t=u??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(y=>y(t,m))}},i=()=>t,l={setState:r,getState:i,getInitialState:()=>c,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(RP?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},c=t=e(r,i,l);return l},PP=e=>e?p0(e):p0;var rS={exports:{}},iS={},sS={exports:{}},oS={};/**
|
|
70
|
+
`),()=>{document.head.removeChild(h)}},[t]),f.jsx(ej,{isPresent:t,childRef:i,sizeRef:s,children:g.cloneElement(e,{ref:i})})}const nj=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:o,anchorX:a})=>{const l=Eu(rj),c=g.useId();let d=!0,u=g.useMemo(()=>(d=!1,{id:c,initial:t,isPresent:n,custom:i,onExitComplete:p=>{l.set(p,!0);for(const h of l.values())if(!h)return;r&&r()},register:p=>(l.set(p,!1),()=>l.delete(p))}),[n,l,r]);return s&&d&&(u={...u}),g.useMemo(()=>{l.forEach((p,h)=>l.set(h,!1))},[n]),g.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),o==="popLayout"&&(e=f.jsx(tj,{isPresent:n,anchorX:a,children:e})),f.jsx(Au.Provider,{value:u,children:e})};function rj(){return new Map}function zb(e=!0){const t=g.useContext(Au);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,s=g.useId();g.useEffect(()=>{if(e)return i(s)},[e]);const o=g.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,o]:[!0]}const Fl=e=>e.key||"";function ry(e){const t=[];return g.Children.forEach(e,n=>{g.isValidElement(n)&&t.push(n)}),t}const Ar=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:o=!1,anchorX:a="left"})=>{const[l,c]=zb(o),d=g.useMemo(()=>ry(e),[e]),u=o&&!l?[]:d.map(Fl),p=g.useRef(!0),h=g.useRef(d),y=Eu(()=>new Map),[w,b]=g.useState(d),[m,v]=g.useState(d);Bb(()=>{p.current=!1,h.current=d;for(let C=0;C<m.length;C++){const _=Fl(m[C]);u.includes(_)?y.delete(_):y.get(_)!==!0&&y.set(_,!1)}},[m,u.length,u.join("-")]);const x=[];if(d!==w){let C=[...d];for(let _=0;_<m.length;_++){const j=m[_],A=Fl(j);u.includes(A)||(C.splice(_,0,j),x.push(j))}return s==="wait"&&x.length&&(C=x),v(ry(C)),b(d),null}const{forceRender:S}=g.useContext(ym);return f.jsx(f.Fragment,{children:m.map(C=>{const _=Fl(C),j=o&&!l?!1:d===m||u.includes(_),A=()=>{if(y.has(_))y.set(_,!0);else return;let E=!0;y.forEach(D=>{D||(E=!1)}),E&&(S==null||S(),v(h.current),o&&(c==null||c()),r&&r())};return f.jsx(nj,{isPresent:j,initial:!p.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:s,onExitComplete:j?void 0:A,anchorX:a,children:C},_)})})};function bm(e,t){e.indexOf(t)===-1&&e.push(t)}function km(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}let kp=()=>{};const Sp={skipAnimations:!1,useManualTiming:!1};function Sm(e){let t;return()=>(t===void 0&&(t=e()),t)}const Cn=e=>e,Ba=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Cm{constructor(){this.subscriptions=[]}add(t){return bm(this.subscriptions,t),()=>km(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let s=0;s<i;s++){const o=this.subscriptions[s];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const rr=e=>e*1e3,ir=e=>e/1e3;function Vb(e,t){return t?e*(1e3/t):0}const ij=Sm(()=>window.ScrollTimeline!==void 0);class sj{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(i=>{if(ij()&&i.attachTimeline)return i.attachTimeline(t);if(typeof n=="function")return n(i)});return()=>{r.forEach((i,s)=>{i&&i(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class oj extends sj{then(t,n){return this.finished.finally(t).then(()=>{})}}const iy={value:null,addProjectionMetrics:null},_m=e=>Array.isArray(e)&&typeof e[0]=="number",aj={};function lj(e,t){const n=Sm(e);return()=>aj[t]??n()}const za=lj(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ub=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let s=0;s<i;s++)r+=e(s/(i-1))+", ";return`linear(${r.substring(0,r.length-2)})`},ea=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Cp={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ea([0,.65,.55,1]),circOut:ea([.55,0,1,.45]),backIn:ea([.31,.01,.66,-.59]),backOut:ea([.33,1.53,.69,.99])};function Hb(e,t){if(e)return typeof e=="function"&&za()?Ub(e,t):_m(e)?ea(e):Array.isArray(e)?e.map(n=>Hb(n,t)||Cp.easeOut):Cp[e]}function cj(e,t,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a="easeInOut",times:l}={},c=void 0){const d={[t]:n};l&&(d.offset=l);const u=Hb(a,i);return Array.isArray(u)&&(d.easing=u),e.animate(d,{delay:r,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal",pseudoElement:c})}function Tm(e){return typeof e=="function"&&"applyToOptions"in e}function Em(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const qc=2e4;function Am(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<qc;)t+=n,r=e.next(t);return t>=qc?1/0:t}function uj(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(Am(r),qc);return{type:"keyframes",ease:s=>r.next(i*s).value/t,duration:ir(i)}}function Wb(e){return!!(typeof e=="function"&&za()||!e||typeof e=="string"&&(e in Cp||za())||_m(e)||Array.isArray(e)&&e.every(Wb))}function sy(e,t){e.timeline=t,e.onfinish=null}const $l=["read","resolveKeyframes","update","preRender","render","postRender"];function dj(e,t){let n=new Set,r=new Set,i=!1,s=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function c(u){o.has(u)&&(d.schedule(u),e()),l++,u(a)}const d={schedule:(u,p=!1,h=!1)=>{const w=h&&i?n:r;return p&&o.add(u),w.has(u)||w.add(u),u},cancel:u=>{r.delete(u),o.delete(u)},process:u=>{if(a=u,i){s=!0;return}i=!0,[n,r]=[r,n],n.forEach(c),t&&iy.value&&iy.value.frameloop[t].push(l),l=0,n.clear(),i=!1,s&&(s=!1,d.process(u))}};return d}const fj=40;function qb(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=$l.reduce((m,v)=>(m[v]=dj(s,t?v:void 0),m),{}),{read:a,resolveKeyframes:l,update:c,preRender:d,render:u,postRender:p}=o,h=()=>{const m=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(m-i.timestamp,fj),1),i.timestamp=m,i.isProcessing=!0,a.process(i),l.process(i),c.process(i),d.process(i),u.process(i),p.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},y=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:$l.reduce((m,v)=>{const x=o[v];return m[v]=(S,C=!1,_=!1)=>(n||y(),x.schedule(S,C,_)),m},{}),cancel:m=>{for(let v=0;v<$l.length;v++)o[$l[v]].cancel(m)},state:i,steps:o}}const{schedule:jm,cancel:l$}=qb(queueMicrotask,!1),{schedule:Be,cancel:hi,state:wt,steps:Nd}=qb(typeof requestAnimationFrame<"u"?requestAnimationFrame:Cn,!0);let lc;function pj(){lc=void 0}const sr={now:()=>(lc===void 0&&sr.set(wt.isProcessing||Sp.useManualTiming?wt.timestamp:performance.now()),lc),set:e=>{lc=e,queueMicrotask(pj)}},Pn={x:!1,y:!1};function Gb(){return Pn.x||Pn.y}function hj(e){return e==="x"||e==="y"?Pn[e]?null:(Pn[e]=!0,()=>{Pn[e]=!1}):Pn.x||Pn.y?null:(Pn.x=Pn.y=!0,()=>{Pn.x=Pn.y=!1})}function mj(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){const i=document.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}function Yb(e,t){const n=mj(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function oy(e){return!(e.pointerType==="touch"||Gb())}function gj(e,t,n={}){const[r,i,s]=Yb(e,n),o=a=>{if(!oy(a))return;const{target:l}=a,c=t(l,a);if(typeof c!="function"||!l)return;const d=u=>{oy(u)&&(c(u),l.removeEventListener("pointerleave",d))};l.addEventListener("pointerleave",d,i)};return r.forEach(a=>{a.addEventListener("pointerenter",o,i)}),s}const Qb=(e,t)=>t?e===t?!0:Qb(e,t.parentElement):!1,Rm=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,vj=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function yj(e){return vj.has(e.tagName)||e.tabIndex!==-1}const ta=new WeakSet;function ay(e){return t=>{t.key==="Enter"&&e(t)}}function Od(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const xj=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=ay(()=>{if(ta.has(n))return;Od(n,"down");const i=ay(()=>{Od(n,"up")}),s=()=>Od(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function ly(e){return Rm(e)&&!Gb()}function wj(e,t,n={}){const[r,i,s]=Yb(e,n),o=a=>{const l=a.currentTarget;if(!ly(a)||ta.has(l))return;ta.add(l);const c=t(l,a),d=(h,y)=>{window.removeEventListener("pointerup",u),window.removeEventListener("pointercancel",p),!(!ly(h)||!ta.has(l))&&(ta.delete(l),typeof c=="function"&&c(h,{success:y}))},u=h=>{d(h,l===window||l===document||n.useGlobalTarget||Qb(l,h.target))},p=h=>{d(h,!1)};window.addEventListener("pointerup",u,i),window.addEventListener("pointercancel",p,i)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),a instanceof HTMLElement&&(a.addEventListener("focus",c=>xj(c,i)),!yj(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}const cy=30,bj=e=>!isNaN(parseFloat(e));class kj{constructor(t,n={}){this.version="12.7.4",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const s=sr.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=sr.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=bj(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Cm);const r=this.events[t].add(n);return t==="change"?()=>{r(),Be.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=sr.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>cy)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,cy);return Vb(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Va(e,t){return new kj(e,t)}const Kb=g.createContext({strict:!1}),uy={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"]},xo={};for(const e in uy)xo[e]={isEnabled:t=>uy[e].some(n=>!!t[n])};function Sj(e){for(const t in e)xo[t]={...xo[t],...e[t]}}const Cj=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Gc(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Cj.has(e)}let Xb=e=>!Gc(e);function _j(e){e&&(Xb=t=>t.startsWith("on")?!Gc(t):e(t))}try{_j(require("@emotion/is-prop-valid").default)}catch{}function Tj(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(Xb(i)||n===!0&&Gc(i)||!t&&!Gc(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function Ej(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>e(...r);return new Proxy(n,{get:(r,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}const ju=g.createContext({});function Ru(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Ua(e){return typeof e=="string"||Array.isArray(e)}const Pm=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Mm=["initial",...Pm];function Pu(e){return Ru(e.animate)||Mm.some(t=>Ua(e[t]))}function Zb(e){return!!(Pu(e)||e.variants)}function Aj(e,t){if(Pu(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Ua(n)?n:void 0,animate:Ua(r)?r:void 0}}return e.inherit!==!1?t:{}}function jj(e){const{initial:t,animate:n}=Aj(e,g.useContext(ju));return g.useMemo(()=>({initial:t,animate:n}),[dy(t),dy(n)])}function dy(e){return Array.isArray(e)?e.join(" "):e}const Rj=Symbol.for("motionComponentSymbol");function Ds(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Pj(e,t,n){return g.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Ds(n)&&(n.current=r))},[t])}const Nm=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Mj="framerAppearId",Jb="data-"+Nm(Mj),ek=g.createContext({});function Nj(e,t,n,r,i){var w,b;const{visualElement:s}=g.useContext(ju),o=g.useContext(Kb),a=g.useContext(Au),l=g.useContext(wm).reducedMotion,c=g.useRef(null);r=r||o.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:s,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const d=c.current,u=g.useContext(ek);d&&!d.projection&&i&&(d.type==="html"||d.type==="svg")&&Oj(c.current,n,i,u);const p=g.useRef(!1);g.useInsertionEffect(()=>{d&&p.current&&d.update(n,a)});const h=n[Jb],y=g.useRef(!!h&&!((w=window.MotionHandoffIsComplete)!=null&&w.call(window,h))&&((b=window.MotionHasOptimisedAnimation)==null?void 0:b.call(window,h)));return Bb(()=>{d&&(p.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),jm.render(d.render),y.current&&d.animationState&&d.animationState.animateChanges())}),g.useEffect(()=>{d&&(!y.current&&d.animationState&&d.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var m;(m=window.MotionHandoffMarkAsComplete)==null||m.call(window,h)}),y.current=!1))}),d}function Oj(e,t,n,r){const{layoutId:i,layout:s,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:tk(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&Ds(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:l,layoutRoot:c})}function tk(e){if(e)return e.options.allowProjection!==!1?e.projection:tk(e.parent)}function Dj({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&Sj(e);function s(a,l){let c;const d={...g.useContext(wm),...a,layoutId:Ij(a)},{isStatic:u}=d,p=jj(a),h=r(a,u);if(!u&&xm){Lj();const y=Fj(d);c=y.MeasureLayout,p.visualElement=Nj(i,h,d,t,y.ProjectionNode)}return f.jsxs(ju.Provider,{value:p,children:[c&&p.visualElement?f.jsx(c,{visualElement:p.visualElement,...d}):null,n(i,a,Pj(h,p.visualElement,l),h,u,p.visualElement)]})}s.displayName=`motion.${typeof i=="string"?i:`create(${i.displayName??i.name??""})`}`;const o=g.forwardRef(s);return o[Rj]=i,o}function Ij({layoutId:e}){const t=g.useContext(ym).id;return t&&e!==void 0?t+"-"+e:e}function Lj(e,t){g.useContext(Kb).strict}function Fj(e){const{drag:t,layout:n}=xo;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const nk=e=>t=>typeof t=="string"&&t.startsWith(e),Om=nk("--"),$j=nk("var(--"),Dm=e=>$j(e)?Bj.test(e.split("/*")[0].trim()):!1,Bj=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Ha={};function zj(e){for(const t in e)Ha[t]=e[t],Om(t)&&(Ha[t].isCSSVariable=!0)}const Po=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],cs=new Set(Po);function rk(e,{layout:t,layoutId:n}){return cs.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Ha[e]||e==="opacity")}const jt=e=>!!(e&&e.getVelocity),ik=(e,t)=>t&&typeof e=="number"?t.transform(e):e,jr=(e,t,n)=>n>t?t:n<e?e:n,Mo={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Wa={...Mo,transform:e=>jr(0,1,e)},Bl={...Mo,default:1},ll=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Fr=ll("deg"),or=ll("%"),he=ll("px"),Vj=ll("vh"),Uj=ll("vw"),fy={...or,parse:e=>or.parse(e)/100,transform:e=>or.transform(e*100)},Hj={borderWidth:he,borderTopWidth:he,borderRightWidth:he,borderBottomWidth:he,borderLeftWidth:he,borderRadius:he,radius:he,borderTopLeftRadius:he,borderTopRightRadius:he,borderBottomRightRadius:he,borderBottomLeftRadius:he,width:he,maxWidth:he,height:he,maxHeight:he,top:he,right:he,bottom:he,left:he,padding:he,paddingTop:he,paddingRight:he,paddingBottom:he,paddingLeft:he,margin:he,marginTop:he,marginRight:he,marginBottom:he,marginLeft:he,backgroundPositionX:he,backgroundPositionY:he},Wj={rotate:Fr,rotateX:Fr,rotateY:Fr,rotateZ:Fr,scale:Bl,scaleX:Bl,scaleY:Bl,scaleZ:Bl,skew:Fr,skewX:Fr,skewY:Fr,distance:he,translateX:he,translateY:he,translateZ:he,x:he,y:he,z:he,perspective:he,transformPerspective:he,opacity:Wa,originX:fy,originY:fy,originZ:he},py={...Mo,transform:Math.round},Im={...Hj,...Wj,zIndex:py,size:he,fillOpacity:Wa,strokeOpacity:Wa,numOctaves:py},qj={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Gj=Po.length;function Yj(e,t,n){let r="",i=!0;for(let s=0;s<Gj;s++){const o=Po[s],a=e[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=ik(a,Im[o]);if(!l){i=!1;const d=qj[o]||o;r+=`${d}(${c}) `}n&&(t[o]=c)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function Lm(e,t,n){const{style:r,vars:i,transformOrigin:s}=e;let o=!1,a=!1;for(const l in t){const c=t[l];if(cs.has(l)){o=!0;continue}else if(Om(l)){i[l]=c;continue}else{const d=ik(c,Im[l]);l.startsWith("origin")?(a=!0,s[l]=d):r[l]=d}}if(t.transform||(o||n?r.transform=Yj(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:d=0}=s;r.transformOrigin=`${l} ${c} ${d}`}}const Fm=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function sk(e,t,n){for(const r in t)!jt(t[r])&&!rk(r,n)&&(e[r]=t[r])}function Qj({transformTemplate:e},t){return g.useMemo(()=>{const n=Fm();return Lm(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Kj(e,t){const n=e.style||{},r={};return sk(r,n,e),Object.assign(r,Qj(e,t)),r}function Xj(e,t){const n={},r=Kj(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const Zj=["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 $m(e){return typeof e!="string"||e.includes("-")?!1:!!(Zj.indexOf(e)>-1||/[A-Z]/u.test(e))}const Jj={offset:"stroke-dashoffset",array:"stroke-dasharray"},e5={offset:"strokeDashoffset",array:"strokeDasharray"};function t5(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?Jj:e5;e[s.offset]=he.transform(-r);const o=he.transform(t),a=he.transform(n);e[s.array]=`${o} ${a}`}function hy(e,t,n){return typeof e=="string"?e:he.transform(t+n*e)}function n5(e,t,n){const r=hy(t,e.x,e.width),i=hy(n,e.y,e.height);return`${r} ${i}`}function Bm(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...c},d,u){if(Lm(e,c,u),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:p,style:h,dimensions:y}=e;p.transform&&(y&&(h.transform=p.transform),delete p.transform),y&&(i!==void 0||s!==void 0||h.transform)&&(h.transformOrigin=n5(y,i!==void 0?i:.5,s!==void 0?s:.5)),t!==void 0&&(p.x=t),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),o!==void 0&&t5(p,o,a,l,!1)}const ok=()=>({...Fm(),attrs:{}}),zm=e=>typeof e=="string"&&e.toLowerCase()==="svg";function r5(e,t,n,r){const i=g.useMemo(()=>{const s=ok();return Bm(s,t,zm(r),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};sk(s,e.style,e),i.style={...s,...i.style}}return i}function i5(e=!1){return(n,r,i,{latestValues:s},o)=>{const l=($m(n)?r5:Xj)(r,s,o,n),c=Tj(r,typeof n=="string",e),d=n!==g.Fragment?{...c,...l,ref:i}:{},{children:u}=r,p=g.useMemo(()=>jt(u)?u.get():u,[u]);return g.createElement(n,{...d,children:p})}}function my(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Vm(e,t,n,r){if(typeof t=="function"){const[i,s]=my(r);t=t(n!==void 0?n:e.custom,i,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,s]=my(r);t=t(n!==void 0?n:e.custom,i,s)}return t}const _p=e=>Array.isArray(e),s5=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),o5=e=>_p(e)?e[e.length-1]||0:e;function cc(e){const t=jt(e)?e.get():e;return s5(t)?t.toValue():t}function a5({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,i,s){const o={latestValues:l5(r,i,s,e),renderState:t()};return n&&(o.onMount=a=>n({props:r,current:a,...o}),o.onUpdate=a=>n(a)),o}const ak=e=>(t,n)=>{const r=g.useContext(ju),i=g.useContext(Au),s=()=>a5(e,t,r,i);return n?s():Eu(s)};function l5(e,t,n,r){const i={},s=r(e,{});for(const p in s)i[p]=cc(s[p]);let{initial:o,animate:a}=e;const l=Pu(e),c=Zb(e);t&&c&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const u=d?a:o;if(u&&typeof u!="boolean"&&!Ru(u)){const p=Array.isArray(u)?u:[u];for(let h=0;h<p.length;h++){const y=Vm(e,p[h]);if(y){const{transitionEnd:w,transition:b,...m}=y;for(const v in m){let x=m[v];if(Array.isArray(x)){const S=d?x.length-1:0;x=x[S]}x!==null&&(i[v]=x)}for(const v in w)i[v]=w[v]}}}return i}function Um(e,t,n){var s;const{style:r}=e,i={};for(const o in r)(jt(r[o])||t.style&&jt(t.style[o])||rk(o,e)||((s=n==null?void 0:n.getValue(o))==null?void 0:s.liveStyle)!==void 0)&&(i[o]=r[o]);return i}const c5={useVisualState:ak({scrapeMotionValuesFromProps:Um,createRenderState:Fm})};function lk(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}function ck(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const s in n)e.style.setProperty(s,n[s])}const uk=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function dk(e,t,n,r){ck(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(uk.has(i)?i:Nm(i),t.attrs[i])}function fk(e,t,n){const r=Um(e,t,n);for(const i in e)if(jt(e[i])||jt(t[i])){const s=Po.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=e[i]}return r}const gy=["x","y","width","height","cx","cy","r"],u5={useVisualState:ak({scrapeMotionValuesFromProps:fk,createRenderState:ok,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:i})=>{if(!n)return;let s=!!e.drag;if(!s){for(const a in i)if(cs.has(a)){s=!0;break}}if(!s)return;let o=!t;if(t)for(let a=0;a<gy.length;a++){const l=gy[a];e[l]!==t[l]&&(o=!0)}o&&Be.read(()=>{lk(n,r),Be.render(()=>{Bm(r,i,zm(n.tagName),e.transformTemplate),dk(n,r)})})}})};function d5(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...$m(r)?u5:c5,preloadedFeatures:e,useRender:i5(i),createVisualElement:t,Component:r};return Dj(o)}}function qa(e,t,n){const r=e.getProps();return Vm(r,t,n!==void 0?n:r.custom,e)}const pk=new Set(["width","height","top","left","right","bottom",...Po]);function f5(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Va(n))}function p5(e,t){const n=qa(e,t);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const o in s){const a=o5(s[o]);f5(e,o,a)}}function h5(e){return!!(jt(e)&&e.add)}function Tp(e,t){const n=e.getValue("willChange");if(h5(n))return n.add(t);if(!n&&Sp.WillChange){const r=new Sp.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function hk(e){return e.props[Jb]}const mk=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,m5=1e-7,g5=12;function v5(e,t,n,r,i){let s,o,a=0;do o=t+(n-t)/2,s=mk(o,r,i)-e,s>0?n=o:t=o;while(Math.abs(s)>m5&&++a<g5);return o}function cl(e,t,n,r){if(e===t&&n===r)return Cn;const i=s=>v5(s,0,1,e,n);return s=>s===0||s===1?s:mk(i(s),t,r)}const gk=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,vk=e=>t=>1-e(1-t),yk=cl(.33,1.53,.69,.99),Hm=vk(yk),xk=gk(Hm),wk=e=>(e*=2)<1?.5*Hm(e):.5*(2-Math.pow(2,-10*(e-1))),Wm=e=>1-Math.sin(Math.acos(e)),bk=vk(Wm),kk=gk(Wm),Sk=e=>/^0[^.\s]+$/u.test(e);function y5(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Sk(e):!0}const ha=e=>Math.round(e*1e5)/1e5,qm=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function x5(e){return e==null}const w5=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Gm=(e,t)=>n=>!!(typeof n=="string"&&w5.test(n)&&n.startsWith(e)||t&&!x5(n)&&Object.prototype.hasOwnProperty.call(n,t)),Ck=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,s,o,a]=r.match(qm);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},b5=e=>jr(0,255,e),Dd={...Mo,transform:e=>Math.round(b5(e))},Oi={test:Gm("rgb","red"),parse:Ck("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Dd.transform(e)+", "+Dd.transform(t)+", "+Dd.transform(n)+", "+ha(Wa.transform(r))+")"};function k5(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const Ep={test:Gm("#"),parse:k5,transform:Oi.transform},Is={test:Gm("hsl","hue"),parse:Ck("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+or.transform(ha(t))+", "+or.transform(ha(n))+", "+ha(Wa.transform(r))+")"},Et={test:e=>Oi.test(e)||Ep.test(e)||Is.test(e),parse:e=>Oi.test(e)?Oi.parse(e):Is.test(e)?Is.parse(e):Ep.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Oi.transform(e):Is.transform(e)},S5=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function C5(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(qm))==null?void 0:t.length)||0)+(((n=e.match(S5))==null?void 0:n.length)||0)>0}const _k="number",Tk="color",_5="var",T5="var(",vy="${}",E5=/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 Ga(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const a=t.replace(E5,l=>(Et.test(l)?(r.color.push(s),i.push(Tk),n.push(Et.parse(l))):l.startsWith(T5)?(r.var.push(s),i.push(_5),n.push(l)):(r.number.push(s),i.push(_k),n.push(parseFloat(l))),++s,vy)).split(vy);return{values:n,split:a,indexes:r,types:i}}function Ek(e){return Ga(e).values}function Ak(e){const{split:t,types:n}=Ga(e),r=t.length;return i=>{let s="";for(let o=0;o<r;o++)if(s+=t[o],i[o]!==void 0){const a=n[o];a===_k?s+=ha(i[o]):a===Tk?s+=Et.transform(i[o]):s+=i[o]}return s}}const A5=e=>typeof e=="number"?0:e;function j5(e){const t=Ek(e);return Ak(e)(t.map(A5))}const mi={test:C5,parse:Ek,createTransformer:Ak,getAnimatableNone:j5},R5=new Set(["brightness","contrast","saturate","opacity"]);function P5(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(qm)||[];if(!r)return e;const i=n.replace(r,"");let s=R5.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const M5=/\b([a-z-]*)\(.*?\)/gu,Ap={...mi,getAnimatableNone:e=>{const t=e.match(M5);return t?t.map(P5).join(" "):e}},N5={...Im,color:Et,backgroundColor:Et,outlineColor:Et,fill:Et,stroke:Et,borderColor:Et,borderTopColor:Et,borderRightColor:Et,borderBottomColor:Et,borderLeftColor:Et,filter:Ap,WebkitFilter:Ap},jk=e=>N5[e];function Rk(e,t){let n=jk(e);return n!==Ap&&(n=mi),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const O5=new Set(["auto","none","0"]);function D5(e,t,n){let r=0,i;for(;r<e.length&&!i;){const s=e[r];typeof s=="string"&&!O5.has(s)&&Ga(s).values.length&&(i=e[r]),r++}if(i&&n)for(const s of t)e[s]=Rk(n,i)}const Di=e=>e*180/Math.PI,jp=e=>{const t=Di(Math.atan2(e[1],e[0]));return Rp(t)},I5={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:jp,rotateZ:jp,skewX:e=>Di(Math.atan(e[1])),skewY:e=>Di(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Rp=e=>(e=e%360,e<0&&(e+=360),e),yy=jp,xy=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),wy=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),L5={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:xy,scaleY:wy,scale:e=>(xy(e)+wy(e))/2,rotateX:e=>Rp(Di(Math.atan2(e[6],e[5]))),rotateY:e=>Rp(Di(Math.atan2(-e[2],e[0]))),rotateZ:yy,rotate:yy,skewX:e=>Di(Math.atan(e[4])),skewY:e=>Di(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function by(e){return e.includes("scale")?1:0}function Pp(e,t){if(!e||e==="none")return by(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=L5,i=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=I5,i=a}if(!i)return by(t);const s=r[t],o=i[1].split(",").map($5);return typeof s=="function"?s(o):o[s]}const F5=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Pp(n,t)};function $5(e){return parseFloat(e.trim())}const ky=e=>e===Mo||e===he,B5=new Set(["x","y","z"]),z5=Po.filter(e=>!B5.has(e));function V5(e){const t=[];return z5.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const wo={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Pp(t,"x"),y:(e,{transform:t})=>Pp(t,"y")};wo.translateX=wo.x;wo.translateY=wo.y;const Gi=new Set;let Mp=!1,Np=!1;function Pk(){if(Np){const e=Array.from(Gi).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=V5(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,o])=>{var a;(a=r.getValue(s))==null||a.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Np=!1,Mp=!1,Gi.forEach(e=>e.complete()),Gi.clear()}function Mk(){Gi.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Np=!0)})}function U5(){Mk(),Pk()}class Ym{constructor(t,n,r,i,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Gi.add(this),Mp||(Mp=!0,Be.read(Mk),Be.resolveKeyframes(Pk))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;for(let s=0;s<t.length;s++)if(t[s]===null)if(s===0){const o=i==null?void 0:i.get(),a=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const l=r.readValue(n,a);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=a),i&&o===void 0&&i.set(t[0])}else t[s]=t[s-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Gi.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Gi.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Nk=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),H5=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function W5(e){const t=H5.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function Ok(e,t,n=1){const[r,i]=W5(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const o=s.trim();return Nk(o)?parseFloat(o):o}return Dm(i)?Ok(i,t,n+1):i}const Dk=e=>t=>t.test(e),q5={test:e=>e==="auto",parse:e=>e},Ik=[Mo,he,or,Fr,Uj,Vj,q5],Sy=e=>Ik.find(Dk(e));class Lk extends Ym{constructor(t,n,r,i,s){super(t,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),Dm(c))){const d=Ok(c,n.current);d!==void 0&&(t[l]=d),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!pk.has(r)||t.length!==2)return;const[i,s]=t,o=Sy(i),a=Sy(s);if(o!==a)if(ky(o)&&ky(a))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)y5(t[i])&&r.push(i);r.length&&D5(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=wo[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const i=t.getValue(n);i&&i.jump(this.measuredOrigin,!1);const s=r.length-1,o=r[s];r[s]=wo[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([l,c])=>{t.getValue(l).set(c)}),this.resolveNoneKeyframes()}}const Cy=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(mi.test(e)||e==="0")&&!e.startsWith("url("));function G5(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Y5(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],o=Cy(i,t),a=Cy(s,t);return!o||!a?!1:G5(e)||(n==="spring"||Tm(n))&&r}const Q5=e=>e!==null;function Mu(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(Q5),s=t&&n!=="loop"&&t%2===1?0:i.length-1;return!s||r===void 0?i[s]:r}const K5=40;class Fk{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=sr.now(),this.options={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:o,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>K5?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&U5(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=sr.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:s,delay:o,onComplete:a,onUpdate:l,isGenerator:c}=this.options;if(!c&&!Y5(t,r,i,s))if(o)this.options.duration=0;else{l&&l(Mu(t,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const d=this.initPlayback(t,n);d!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...d},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear")}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Ye=(e,t,n)=>e+(t-e)*n;function Id(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function X5({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,s=0,o=0;if(!t)i=s=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;i=Id(l,a,e+1/3),s=Id(l,a,e),o=Id(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}function Yc(e,t){return n=>n>0?t:e}const Ld=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Z5=[Ep,Oi,Is],J5=e=>Z5.find(t=>t.test(e));function _y(e){const t=J5(e);if(!t)return!1;let n=t.parse(e);return t===Is&&(n=X5(n)),n}const Ty=(e,t)=>{const n=_y(e),r=_y(t);if(!n||!r)return Yc(e,t);const i={...n};return s=>(i.red=Ld(n.red,r.red,s),i.green=Ld(n.green,r.green,s),i.blue=Ld(n.blue,r.blue,s),i.alpha=Ye(n.alpha,r.alpha,s),Oi.transform(i))},e3=(e,t)=>n=>t(e(n)),ul=(...e)=>e.reduce(e3),Op=new Set(["none","hidden"]);function t3(e,t){return Op.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function n3(e,t){return n=>Ye(e,t,n)}function Qm(e){return typeof e=="number"?n3:typeof e=="string"?Dm(e)?Yc:Et.test(e)?Ty:s3:Array.isArray(e)?$k:typeof e=="object"?Et.test(e)?Ty:r3:Yc}function $k(e,t){const n=[...e],r=n.length,i=e.map((s,o)=>Qm(s)(s,t[o]));return s=>{for(let o=0;o<r;o++)n[o]=i[o](s);return n}}function r3(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Qm(e[i])(e[i],t[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function i3(e,t){const n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const s=t.types[i],o=e.indexes[s][r[s]],a=e.values[o]??0;n[i]=a,r[s]++}return n}const s3=(e,t)=>{const n=mi.createTransformer(t),r=Ga(e),i=Ga(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Op.has(e)&&!i.values.length||Op.has(t)&&!r.values.length?t3(e,t):ul($k(i3(r,i),i.values),n):Yc(e,t)};function Bk(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Ye(e,t,n):Qm(e)(e,t)}const o3=5;function zk(e,t,n){const r=Math.max(t-o3,0);return Vb(n-e(r),t-r)}const Ze={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},Fd=.001;function a3({duration:e=Ze.duration,bounce:t=Ze.bounce,velocity:n=Ze.velocity,mass:r=Ze.mass}){let i,s,o=1-t;o=jr(Ze.minDamping,Ze.maxDamping,o),e=jr(Ze.minDuration,Ze.maxDuration,ir(e)),o<1?(i=c=>{const d=c*o,u=d*e,p=d-n,h=Dp(c,o),y=Math.exp(-u);return Fd-p/h*y},s=c=>{const u=c*o*e,p=u*n+n,h=Math.pow(o,2)*Math.pow(c,2)*e,y=Math.exp(-u),w=Dp(Math.pow(c,2),o);return(-i(c)+Fd>0?-1:1)*((p-h)*y)/w}):(i=c=>{const d=Math.exp(-c*e),u=(c-n)*e+1;return-Fd+d*u},s=c=>{const d=Math.exp(-c*e),u=(n-c)*(e*e);return d*u});const a=5/e,l=c3(i,s,a);if(e=rr(e),isNaN(l))return{stiffness:Ze.stiffness,damping:Ze.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const l3=12;function c3(e,t,n){let r=n;for(let i=1;i<l3;i++)r=r-e(r)/t(r);return r}function Dp(e,t){return e*Math.sqrt(1-t*t)}const u3=["duration","bounce"],d3=["stiffness","damping","mass"];function Ey(e,t){return t.some(n=>e[n]!==void 0)}function f3(e){let t={velocity:Ze.velocity,stiffness:Ze.stiffness,damping:Ze.damping,mass:Ze.mass,isResolvedFromDuration:!1,...e};if(!Ey(e,d3)&&Ey(e,u3))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*jr(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Ze.mass,stiffness:i,damping:s}}else{const n=a3(e);t={...t,...n,mass:Ze.mass},t.isResolvedFromDuration=!0}return t}function Qc(e=Ze.visualDuration,t=Ze.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:c,mass:d,duration:u,velocity:p,isResolvedFromDuration:h}=f3({...n,velocity:-ir(n.velocity||0)}),y=p||0,w=c/(2*Math.sqrt(l*d)),b=o-s,m=ir(Math.sqrt(l/d)),v=Math.abs(b)<5;r||(r=v?Ze.restSpeed.granular:Ze.restSpeed.default),i||(i=v?Ze.restDelta.granular:Ze.restDelta.default);let x;if(w<1){const C=Dp(m,w);x=_=>{const j=Math.exp(-w*m*_);return o-j*((y+w*m*b)/C*Math.sin(C*_)+b*Math.cos(C*_))}}else if(w===1)x=C=>o-Math.exp(-m*C)*(b+(y+m*b)*C);else{const C=m*Math.sqrt(w*w-1);x=_=>{const j=Math.exp(-w*m*_),A=Math.min(C*_,300);return o-j*((y+w*m*b)*Math.sinh(A)+C*b*Math.cosh(A))/C}}const S={calculatedDuration:h&&u||null,next:C=>{const _=x(C);if(h)a.done=C>=u;else{let j=0;w<1&&(j=C===0?rr(y):zk(x,C,_));const A=Math.abs(j)<=r,E=Math.abs(o-_)<=i;a.done=A&&E}return a.value=a.done?o:_,a},toString:()=>{const C=Math.min(Am(S),qc),_=Ub(j=>S.next(C*j).value,C,30);return C+"ms "+_},toTransition:()=>{}};return S}Qc.applyToOptions=e=>{const t=uj(e,100,Qc);return e.ease=za()?t.ease:"easeOut",e.duration=rr(t.duration),e.type="keyframes",e};function Ay({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:d}){const u=e[0],p={done:!1,value:u},h=A=>a!==void 0&&A<a||l!==void 0&&A>l,y=A=>a===void 0?l:l===void 0||Math.abs(a-A)<Math.abs(l-A)?a:l;let w=n*t;const b=u+w,m=o===void 0?b:o(b);m!==b&&(w=m-u);const v=A=>-w*Math.exp(-A/r),x=A=>m+v(A),S=A=>{const E=v(A),D=x(A);p.done=Math.abs(E)<=c,p.value=p.done?m:D};let C,_;const j=A=>{h(p.value)&&(C=A,_=Qc({keyframes:[p.value,y(p.value)],velocity:zk(x,A,p.value),damping:i,stiffness:s,restDelta:c,restSpeed:d}))};return j(0),{calculatedDuration:null,next:A=>{let E=!1;return!_&&C===void 0&&(E=!0,S(A),j(A)),C!==void 0&&A>=C?_.next(A-C):(!E&&S(A),p)}}}const p3=cl(.42,0,1,1),h3=cl(0,0,.58,1),Vk=cl(.42,0,.58,1),m3=e=>Array.isArray(e)&&typeof e[0]!="number",jy={linear:Cn,easeIn:p3,easeInOut:Vk,easeOut:h3,circIn:Wm,circInOut:kk,circOut:bk,backIn:Hm,backInOut:xk,backOut:yk,anticipate:wk},Ry=e=>{if(_m(e)){kp(e.length===4);const[t,n,r,i]=e;return cl(t,n,r,i)}else if(typeof e=="string")return kp(jy[e]!==void 0),jy[e];return e};function g3(e,t,n){const r=[],i=n||Bk,s=e.length-1;for(let o=0;o<s;o++){let a=i(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||Cn:t;a=ul(l,a)}r.push(a)}return r}function v3(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const s=e.length;if(kp(s===t.length),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=g3(t,r,i),l=a.length,c=d=>{if(o&&d<e[0])return t[0];let u=0;if(l>1)for(;u<e.length-2&&!(d<e[u+1]);u++);const p=Ba(e[u],e[u+1],d);return a[u](p)};return n?d=>c(jr(e[0],e[s-1],d)):c}function y3(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Ba(0,t,r);e.push(Ye(n,1,i))}}function x3(e){const t=[0];return y3(t,e.length-1),t}function w3(e,t){return e.map(n=>n*t)}function b3(e,t){return e.map(()=>t||Vk).splice(0,e.length-1)}function Kc({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=m3(r)?r.map(Ry):Ry(r),s={done:!1,value:t[0]},o=w3(n&&n.length===t.length?n:x3(t),e),a=v3(o,t,{ease:Array.isArray(i)?i:b3(t,i)});return{calculatedDuration:e,next:l=>(s.value=a(l),s.done=l>=e,s)}}const k3=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Be.update(t,!0),stop:()=>hi(t),now:()=>wt.isProcessing?wt.timestamp:sr.now()}},S3={decay:Ay,inertia:Ay,tween:Kc,keyframes:Kc,spring:Qc},C3=e=>e/100;class Km extends Fk{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:i,keyframes:s}=this.options,o=(i==null?void 0:i.KeyframeResolver)||Ym,a=(l,c)=>this.onKeyframesResolved(l,c);this.resolver=new o(s,a,n,r,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=this.options,a=Tm(n)?n:S3[n]||Kc;let l,c;a!==Kc&&typeof t[0]!="number"&&(l=ul(C3,Bk(t[0],t[1])),t=[0,100]);const d=a({...this.options,keyframes:t});s==="mirror"&&(c=a({...this.options,keyframes:[...t].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=Am(d));const{calculatedDuration:u}=d,p=u+i,h=p*(r+1)-i;return{generator:d,mirroredGenerator:c,mapPercentToKeyframes:l,calculatedDuration:u,resolvedDuration:p,totalDuration:h}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:A}=this.options;return{done:!0,value:A[A.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:c,totalDuration:d,resolvedDuration:u}=r;if(this.startTime===null)return s.next(0);const{delay:p,repeat:h,repeatType:y,repeatDelay:w,onUpdate:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const m=this.currentTime-p*(this.speed>=0?1:-1),v=this.speed>=0?m<0:m>d;this.currentTime=Math.max(m,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let x=this.currentTime,S=s;if(h){const A=Math.min(this.currentTime,d)/u;let E=Math.floor(A),D=A%1;!D&&A>=1&&(D=1),D===1&&E--,E=Math.min(E,h+1),!!(E%2)&&(y==="reverse"?(D=1-D,w&&(D-=w/u)):y==="mirror"&&(S=o)),x=jr(0,1,D)*u}const C=v?{done:!1,value:l[0]}:S.next(x);a&&(C.value=a(C.value));let{done:_}=C;!v&&c!==null&&(_=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const j=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&_);return j&&i!==void 0&&(C.value=Mu(l,this.options,i)),b&&b(C.value),j&&this.finish(),C}get duration(){const{resolved:t}=this;return t?ir(t.calculatedDuration):0}get time(){return ir(this.currentTime)}set time(t){t=rr(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=ir(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=k3,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=this.currentTime??0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}get finished(){return this.currentFinishedPromise}}const _3=new Set(["opacity","clipPath","filter","transform"]),T3=Sm(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Xc=10,E3=2e4;function A3(e){return Tm(e.type)||e.type==="spring"||!Wb(e.ease)}function j3(e,t){const n=new Km({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const i=[];let s=0;for(;!r.done&&s<E3;)r=n.sample(s),i.push(r.value),s+=Xc;return{times:void 0,keyframes:i,duration:s-Xc,ease:"linear"}}const Uk={anticipate:wk,backInOut:xk,circInOut:kk};function R3(e){return e in Uk}class Py extends Fk{constructor(t){super(t);const{name:n,motionValue:r,element:i,keyframes:s}=this.options;this.resolver=new Lk(s,(o,a)=>this.onKeyframesResolved(o,a),n,r,i),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:i,ease:s,type:o,motionValue:a,name:l,startTime:c}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof s=="string"&&za()&&R3(s)&&(s=Uk[s]),A3(this.options)){const{onComplete:u,onUpdate:p,motionValue:h,element:y,...w}=this.options,b=j3(t,w);t=b.keyframes,t.length===1&&(t[1]=t[0]),r=b.duration,i=b.times,s=b.ease,o="keyframes"}const d=cj(a.owner.current,l,t,{...this.options,duration:r,times:i,ease:s});return d.startTime=c??this.calcStartTime(),this.pendingTimeline?(sy(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:u}=this.options;a.set(Mu(t,this.options,n)),u&&u(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:r,times:i,type:o,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return ir(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return ir(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=rr(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}get finished(){return this.resolved.animation.finished}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return Cn;const{animation:r}=n;sy(r,t)}return Cn}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:i,type:s,ease:o,times:a}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:d,onComplete:u,element:p,...h}=this.options,y=new Km({...h,keyframes:r,duration:i,type:s,ease:o,times:a,isGenerator:!0}),w=rr(this.time);c.setWithVelocity(y.sample(w-Xc).value,y.sample(w).value,Xc)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:i,repeatType:s,damping:o,type:a}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=n.owner.getProps();return T3()&&r&&_3.has(r)&&(r!=="transform"||!c)&&!l&&!i&&s!=="mirror"&&o!==0&&a!=="inertia"}}const P3={type:"spring",stiffness:500,damping:25,restSpeed:10},M3=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),N3={type:"keyframes",duration:.8},O3={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},D3=(e,{keyframes:t})=>t.length>2?N3:cs.has(e)?e.startsWith("scale")?M3(t[1]):P3:O3;function I3({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:l,elapsed:c,...d}){return!!Object.keys(d).length}const Xm=(e,t,n,r={},i,s)=>o=>{const a=Em(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-rr(l);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:p=>{t.set(p),a.onUpdate&&a.onUpdate(p)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:i};I3(a)||(d={...d,...D3(e,d)}),d.duration&&(d.duration=rr(d.duration)),d.repeatDelay&&(d.repeatDelay=rr(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let u=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(u=!0)),d.allowFlatten=!a.type&&!a.ease,u&&!s&&t.get()!==void 0){const p=Mu(d.keyframes,a);if(p!==void 0)return Be.update(()=>{d.onUpdate(p),d.onComplete()}),new oj([])}return!s&&Py.supports(d)?new Py(d):new Km(d)};function L3({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Hk(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:s=e.getDefaultTransition(),transitionEnd:o,...a}=t;r&&(s=r);const l=[],c=i&&e.animationState&&e.animationState.getState()[i];for(const d in a){const u=e.getValue(d,e.latestValues[d]??null),p=a[d];if(p===void 0||c&&L3(c,d))continue;const h={delay:n,...Em(s||{},d)};let y=!1;if(window.MotionHandoffAnimation){const b=hk(e);if(b){const m=window.MotionHandoffAnimation(b,d,Be);m!==null&&(h.startTime=m,y=!0)}}Tp(e,d),u.start(Xm(d,u,p,e.shouldReduceMotion&&pk.has(d)?{type:!1}:h,e,y));const w=u.animation;w&&l.push(w)}return o&&Promise.all(l).then(()=>{Be.update(()=>{o&&p5(e,o)})}),l}function Ip(e,t,n={}){var l;const r=qa(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const s=r?()=>Promise.all(Hk(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:d=0,staggerChildren:u,staggerDirection:p}=i;return F3(e,t,d+c,u,p,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[c,d]=a==="beforeChildren"?[s,o]:[o,s];return c().then(()=>d())}else return Promise.all([s(),o(n.delay)])}function F3(e,t,n=0,r=0,i=1,s){const o=[],a=(e.variantChildren.size-1)*r,l=i===1?(c=0)=>c*r:(c=0)=>a-c*r;return Array.from(e.variantChildren).sort($3).forEach((c,d)=>{c.notify("AnimationStart",t),o.push(Ip(c,t,{...s,delay:n+l(d)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(o)}function $3(e,t){return e.sortNodePosition(t)}function B3(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>Ip(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=Ip(e,t,n);else{const i=typeof t=="function"?qa(e,t,n.custom):t;r=Promise.all(Hk(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function Wk(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const z3=Mm.length;function qk(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?qk(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<z3;n++){const r=Mm[n],i=e.props[r];(Ua(i)||i===!1)&&(t[r]=i)}return t}const V3=[...Pm].reverse(),U3=Pm.length;function H3(e){return t=>Promise.all(t.map(({animation:n,options:r})=>B3(e,n,r)))}function W3(e){let t=H3(e),n=My(),r=!0;const i=l=>(c,d)=>{var p;const u=qa(e,d,l==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(u){const{transition:h,transitionEnd:y,...w}=u;c={...c,...w,...y}}return c};function s(l){t=l(e)}function o(l){const{props:c}=e,d=qk(e.parent)||{},u=[],p=new Set;let h={},y=1/0;for(let b=0;b<U3;b++){const m=V3[b],v=n[m],x=c[m]!==void 0?c[m]:d[m],S=Ua(x),C=m===l?v.isActive:null;C===!1&&(y=b);let _=x===d[m]&&x!==c[m]&&S;if(_&&r&&e.manuallyAnimateOnMount&&(_=!1),v.protectedKeys={...h},!v.isActive&&C===null||!x&&!v.prevProp||Ru(x)||typeof x=="boolean")continue;const j=q3(v.prevProp,x);let A=j||m===l&&v.isActive&&!_&&S||b>y&&S,E=!1;const D=Array.isArray(x)?x:[x];let L=D.reduce(i(m),{});C===!1&&(L={});const{prevResolvedValues:O={}}=v,q={...O,...L},$=N=>{A=!0,p.has(N)&&(E=!0,p.delete(N)),v.needsAnimating[N]=!0;const R=e.getValue(N);R&&(R.liveStyle=!1)};for(const N in q){const R=L[N],z=O[N];if(h.hasOwnProperty(N))continue;let H=!1;_p(R)&&_p(z)?H=!Wk(R,z):H=R!==z,H?R!=null?$(N):p.add(N):R!==void 0&&p.has(N)?$(N):v.protectedKeys[N]=!0}v.prevProp=x,v.prevResolvedValues=L,v.isActive&&(h={...h,...L}),r&&e.blockInitialAnimation&&(A=!1),A&&(!(_&&j)||E)&&u.push(...D.map(N=>({animation:N,options:{type:m}})))}if(p.size){const b={};if(typeof c.initial!="boolean"){const m=qa(e,Array.isArray(c.initial)?c.initial[0]:c.initial);m&&m.transition&&(b.transition=m.transition)}p.forEach(m=>{const v=e.getBaseTarget(m),x=e.getValue(m);x&&(x.liveStyle=!0),b[m]=v??null}),u.push({animation:b})}let w=!!u.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(w=!1),r=!1,w?t(u):Promise.resolve()}function a(l,c){var u;if(n[l].isActive===c)return Promise.resolve();(u=e.variantChildren)==null||u.forEach(p=>{var h;return(h=p.animationState)==null?void 0:h.setActive(l,c)}),n[l].isActive=c;const d=o(l);for(const p in n)n[p].protectedKeys={};return d}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=My(),r=!0}}}function q3(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Wk(t,e):!1}function Ci(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function My(){return{animate:Ci(!0),whileInView:Ci(),whileHover:Ci(),whileTap:Ci(),whileDrag:Ci(),whileFocus:Ci(),exit:Ci()}}class wi{constructor(t){this.isMounted=!1,this.node=t}update(){}}class G3 extends wi{constructor(t){super(t),t.animationState||(t.animationState=W3(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Ru(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let Y3=0;class Q3 extends wi{constructor(){super(...arguments),this.id=Y3++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const K3={animation:{Feature:G3},exit:{Feature:Q3}};function Ya(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function dl(e){return{point:{x:e.pageX,y:e.pageY}}}const X3=e=>t=>Rm(t)&&e(t,dl(t));function ma(e,t,n,r){return Ya(e,t,X3(n),r)}function Gk({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Z3({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function J3(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}const Yk=1e-4,eR=1-Yk,tR=1+Yk,Qk=.01,nR=0-Qk,rR=0+Qk;function Dt(e){return e.max-e.min}function iR(e,t,n){return Math.abs(e-t)<=n}function Ny(e,t,n,r=.5){e.origin=r,e.originPoint=Ye(t.min,t.max,e.origin),e.scale=Dt(n)/Dt(t),e.translate=Ye(n.min,n.max,e.origin)-e.originPoint,(e.scale>=eR&&e.scale<=tR||isNaN(e.scale))&&(e.scale=1),(e.translate>=nR&&e.translate<=rR||isNaN(e.translate))&&(e.translate=0)}function ga(e,t,n,r){Ny(e.x,t.x,n.x,r?r.originX:void 0),Ny(e.y,t.y,n.y,r?r.originY:void 0)}function Oy(e,t,n){e.min=n.min+t.min,e.max=e.min+Dt(t)}function sR(e,t,n){Oy(e.x,t.x,n.x),Oy(e.y,t.y,n.y)}function Dy(e,t,n){e.min=t.min-n.min,e.max=e.min+Dt(t)}function va(e,t,n){Dy(e.x,t.x,n.x),Dy(e.y,t.y,n.y)}const Iy=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ls=()=>({x:Iy(),y:Iy()}),Ly=()=>({min:0,max:0}),et=()=>({x:Ly(),y:Ly()});function mn(e){return[e("x"),e("y")]}function $d(e){return e===void 0||e===1}function Lp({scale:e,scaleX:t,scaleY:n}){return!$d(e)||!$d(t)||!$d(n)}function Ai(e){return Lp(e)||Kk(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Kk(e){return Fy(e.x)||Fy(e.y)}function Fy(e){return e&&e!=="0%"}function Zc(e,t,n){const r=e-n,i=t*r;return n+i}function $y(e,t,n,r,i){return i!==void 0&&(e=Zc(e,i,r)),Zc(e,n,r)+t}function Fp(e,t=0,n=1,r,i){e.min=$y(e.min,t,n,r,i),e.max=$y(e.max,t,n,r,i)}function Xk(e,{x:t,y:n}){Fp(e.x,t.translate,t.scale,t.originPoint),Fp(e.y,n.translate,n.scale,n.originPoint)}const By=.999999999999,zy=1.0000000000001;function oR(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let s,o;for(let a=0;a<i;a++){s=n[a],o=s.projectionDelta;const{visualElement:l}=s.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&$s(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Xk(e,o)),r&&Ai(s.latestValues)&&$s(e,s.latestValues))}t.x<zy&&t.x>By&&(t.x=1),t.y<zy&&t.y>By&&(t.y=1)}function Fs(e,t){e.min=e.min+t,e.max=e.max+t}function Vy(e,t,n,r,i=.5){const s=Ye(e.min,e.max,i);Fp(e,t,n,s,r)}function $s(e,t){Vy(e.x,t.x,t.scaleX,t.scale,t.originX),Vy(e.y,t.y,t.scaleY,t.scale,t.originY)}function Zk(e,t){return Gk(J3(e.getBoundingClientRect(),t))}function aR(e,t,n){const r=Zk(e,n),{scroll:i}=t;return i&&(Fs(r.x,i.offset.x),Fs(r.y,i.offset.y)),r}const Jk=({current:e})=>e?e.ownerDocument.defaultView:null,Uy=(e,t)=>Math.abs(e-t);function lR(e,t){const n=Uy(e.x,t.x),r=Uy(e.y,t.y);return Math.sqrt(n**2+r**2)}class eS{constructor(t,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=zd(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,h=lR(u.offset,{x:0,y:0})>=3;if(!p&&!h)return;const{point:y}=u,{timestamp:w}=wt;this.history.push({...y,timestamp:w});const{onStart:b,onMove:m}=this.handlers;p||(b&&b(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),m&&m(this.lastMoveEvent,u)},this.handlePointerMove=(u,p)=>{this.lastMoveEvent=u,this.lastMoveEventInfo=Bd(p,this.transformPagePoint),Be.update(this.updatePoint,!0)},this.handlePointerUp=(u,p)=>{this.end();const{onEnd:h,onSessionEnd:y,resumeAnimation:w}=this.handlers;if(this.dragSnapToOrigin&&w&&w(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=zd(u.type==="pointercancel"?this.lastMoveEventInfo:Bd(p,this.transformPagePoint),this.history);this.startEvent&&h&&h(u,b),y&&y(u,b)},!Rm(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const o=dl(t),a=Bd(o,this.transformPagePoint),{point:l}=a,{timestamp:c}=wt;this.history=[{...l,timestamp:c}];const{onSessionStart:d}=n;d&&d(t,zd(a,this.history)),this.removeListeners=ul(ma(this.contextWindow,"pointermove",this.handlePointerMove),ma(this.contextWindow,"pointerup",this.handlePointerUp),ma(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),hi(this.updatePoint)}}function Bd(e,t){return t?{point:t(e.point)}:e}function Hy(e,t){return{x:e.x-t.x,y:e.y-t.y}}function zd({point:e},t){return{point:e,delta:Hy(e,tS(t)),offset:Hy(e,cR(t)),velocity:uR(t,.1)}}function cR(e){return e[0]}function tS(e){return e[e.length-1]}function uR(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=tS(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>rr(t)));)n--;if(!r)return{x:0,y:0};const s=ir(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const o={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function dR(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Ye(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Ye(n,e,r.max):Math.min(e,n)),e}function Wy(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function fR(e,{top:t,left:n,bottom:r,right:i}){return{x:Wy(e.x,n,i),y:Wy(e.y,t,r)}}function qy(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function pR(e,t){return{x:qy(e.x,t.x),y:qy(e.y,t.y)}}function hR(e,t){let n=.5;const r=Dt(e),i=Dt(t);return i>r?n=Ba(t.min,t.max-r,e.min):r>i&&(n=Ba(e.min,e.max-i,t.min)),jr(0,1,n)}function mR(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const $p=.35;function gR(e=$p){return e===!1?e=0:e===!0&&(e=$p),{x:Gy(e,"left","right"),y:Gy(e,"top","bottom")}}function Gy(e,t,n){return{min:Yy(e,t),max:Yy(e,n)}}function Yy(e,t){return typeof e=="number"?e:e[t]||0}const vR=new WeakMap;class yR{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=et(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=d=>{const{dragSnapToOrigin:u}=this.getProps();u?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(dl(d).point)},s=(d,u)=>{const{drag:p,dragPropagation:h,onDragStart:y}=this.getProps();if(p&&!h&&(this.openDragLock&&this.openDragLock(),this.openDragLock=hj(p),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),mn(b=>{let m=this.getAxisMotionValue(b).get()||0;if(or.test(m)){const{projection:v}=this.visualElement;if(v&&v.layout){const x=v.layout.layoutBox[b];x&&(m=Dt(x)*(parseFloat(m)/100))}}this.originPoint[b]=m}),y&&Be.postRender(()=>y(d,u)),Tp(this.visualElement,"transform");const{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},o=(d,u)=>{const{dragPropagation:p,dragDirectionLock:h,onDirectionLock:y,onDrag:w}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:b}=u;if(h&&this.currentDirection===null){this.currentDirection=xR(b),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",u.point,b),this.updateAxis("y",u.point,b),this.visualElement.render(),w&&w(d,u)},a=(d,u)=>this.stop(d,u),l=()=>mn(d=>{var u;return this.getAnimationState(d)==="paused"&&((u=this.getAxisMotionValue(d).animation)==null?void 0:u.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new eS(t,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:Jk(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&Be.postRender(()=>s(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!zl(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=dR(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){var s;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,i=this.constraints;t&&Ds(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=fR(r.layoutBox,t):this.constraints=!1,this.elastic=gR(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&mn(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=mR(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Ds(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=aR(r,i.root,this.visualElement.getTransformPagePoint());let o=pR(i.layout.layoutBox,s);if(n){const a=n(Z3(o));this.hasMutatedConstraints=!!a,a&&(o=Gk(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=mn(d=>{if(!zl(d,n,this.currentDirection))return;let u=l&&l[d]||{};o&&(u={min:0,max:0});const p=i?200:1e6,h=i?40:1e7,y={type:"inertia",velocity:r?t[d]:0,bounceStiffness:p,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...s,...u};return this.startAxisValueAnimation(d,y)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Tp(this.visualElement,t),r.start(Xm(t,r,0,n,this.visualElement,!1))}stopAnimation(){mn(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){mn(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){mn(n=>{const{drag:r}=this.getProps();if(!zl(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n];s.set(t[n]-Ye(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Ds(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};mn(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=hR({min:l,max:l},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),mn(o=>{if(!zl(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(Ye(l,c,i[o]))})}addListeners(){if(!this.visualElement.current)return;vR.set(this.visualElement,this);const t=this.visualElement.current,n=ma(t,"pointerdown",l=>{const{drag:c,dragListener:d=!0}=this.getProps();c&&d&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Ds(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Be.read(r);const o=Ya(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(mn(d=>{const u=this.getAxisMotionValue(d);u&&(this.originPoint[d]+=l[d].translate,u.set(u.get()+l[d].translate))}),this.visualElement.render())});return()=>{o(),n(),s(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=$p,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function zl(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function xR(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class wR extends wi{constructor(t){super(t),this.removeGroupControls=Cn,this.removeListeners=Cn,this.controls=new yR(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Cn}unmount(){this.removeGroupControls(),this.removeListeners()}}const Qy=e=>(t,n)=>{e&&Be.postRender(()=>e(t,n))};class bR extends wi{constructor(){super(...arguments),this.removePointerDownListener=Cn}onPointerDown(t){this.session=new eS(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Jk(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:Qy(t),onStart:Qy(n),onMove:r,onEnd:(s,o)=>{delete this.session,i&&Be.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=ma(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const uc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Ky(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const qo={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(he.test(e))e=parseFloat(e);else return e;const n=Ky(e,t.target.x),r=Ky(e,t.target.y);return`${n}% ${r}%`}},kR={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=mi.parse(e);if(i.length>5)return r;const s=mi.createTransformer(e),o=typeof i[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;i[0+o]/=a,i[1+o]/=l;const c=Ye(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=c),typeof i[3+o]=="number"&&(i[3+o]/=c),s(i)}};class SR extends g.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=t;zj(CR),s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),uc.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,o=r.projection;return o&&(o.isPresent=s,i||t.layoutDependency!==n||n===void 0||t.isPresent!==s?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||Be.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),jm.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function nS(e){const[t,n]=zb(),r=g.useContext(ym);return f.jsx(SR,{...e,layoutGroup:r,switchLayoutGroup:g.useContext(ek),isPresent:t,safeToRemove:n})}const CR={borderRadius:{...qo,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:qo,borderTopRightRadius:qo,borderBottomLeftRadius:qo,borderBottomRightRadius:qo,boxShadow:kR};function _R(e,t,n){const r=jt(e)?e:Va(e);return r.start(Xm("",r,t,n)),r.animation}function TR(e){return e instanceof SVGElement&&e.tagName!=="svg"}const ER=(e,t)=>e.depth-t.depth;class AR{constructor(){this.children=[],this.isDirty=!1}add(t){bm(this.children,t),this.isDirty=!0}remove(t){km(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(ER),this.isDirty=!1,this.children.forEach(t)}}function jR(e,t){const n=sr.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(hi(r),e(s-t))};return Be.read(r,!0),()=>hi(r)}const rS=["TopLeft","TopRight","BottomLeft","BottomRight"],RR=rS.length,Xy=e=>typeof e=="string"?parseFloat(e):e,Zy=e=>typeof e=="number"||he.test(e);function PR(e,t,n,r,i,s){i?(e.opacity=Ye(0,n.opacity??1,MR(r)),e.opacityExit=Ye(t.opacity??1,0,NR(r))):s&&(e.opacity=Ye(t.opacity??1,n.opacity??1,r));for(let o=0;o<RR;o++){const a=`border${rS[o]}Radius`;let l=Jy(t,a),c=Jy(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Zy(l)===Zy(c)?(e[a]=Math.max(Ye(Xy(l),Xy(c),r),0),(or.test(c)||or.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=Ye(t.rotate||0,n.rotate||0,r))}function Jy(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const MR=iS(0,.5,bk),NR=iS(.5,.95,Cn);function iS(e,t,n){return r=>r<e?0:r>t?1:n(Ba(e,t,r))}function e0(e,t){e.min=t.min,e.max=t.max}function pn(e,t){e0(e.x,t.x),e0(e.y,t.y)}function t0(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function n0(e,t,n,r,i){return e-=t,e=Zc(e,1/n,r),i!==void 0&&(e=Zc(e,1/i,r)),e}function OR(e,t=0,n=1,r=.5,i,s=e,o=e){if(or.test(t)&&(t=parseFloat(t),t=Ye(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=Ye(s.min,s.max,r);e===s&&(a-=t),e.min=n0(e.min,t,n,a,i),e.max=n0(e.max,t,n,a,i)}function r0(e,t,[n,r,i],s,o){OR(e,t[n],t[r],t[i],t.scale,s,o)}const DR=["x","scaleX","originX"],IR=["y","scaleY","originY"];function i0(e,t,n,r){r0(e.x,t,DR,n?n.x:void 0,r?r.x:void 0),r0(e.y,t,IR,n?n.y:void 0,r?r.y:void 0)}function s0(e){return e.translate===0&&e.scale===1}function sS(e){return s0(e.x)&&s0(e.y)}function o0(e,t){return e.min===t.min&&e.max===t.max}function LR(e,t){return o0(e.x,t.x)&&o0(e.y,t.y)}function a0(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function oS(e,t){return a0(e.x,t.x)&&a0(e.y,t.y)}function l0(e){return Dt(e.x)/Dt(e.y)}function c0(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class FR{constructor(){this.members=[]}add(t){bm(this.members,t),t.scheduleRender()}remove(t){if(km(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function $R(e,t,n){let r="";const i=e.x.translate/t.x,s=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((i||s||o)&&(r=`translate3d(${i}px, ${s}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:d,rotateX:u,rotateY:p,skewX:h,skewY:y}=n;c&&(r=`perspective(${c}px) ${r}`),d&&(r+=`rotate(${d}deg) `),u&&(r+=`rotateX(${u}deg) `),p&&(r+=`rotateY(${p}deg) `),h&&(r+=`skewX(${h}deg) `),y&&(r+=`skewY(${y}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const Vd=["","X","Y","Z"],BR={visibility:"hidden"},u0=1e3;let zR=0;function Ud(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function aS(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=hk(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Be,!(i||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&aS(r)}function lS({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},a=t==null?void 0:t()){this.id=zR++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(HR),this.nodes.forEach(QR),this.nodes.forEach(KR),this.nodes.forEach(WR)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new AR)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Cm),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=TR(o),this.instance=o;const{layoutId:l,layout:c,visualElement:d}=this.options;if(d&&!d.current&&d.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(c||l)&&(this.isLayoutDirty=!0),e){let u;const p=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,u&&u(),u=jR(p,250),uc.hasAnimatedSinceResize&&(uc.hasAnimatedSinceResize=!1,this.nodes.forEach(f0))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||c)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:p,hasRelativeLayoutChanged:h,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const w=this.options.transition||d.getDefaultTransition()||tP,{onLayoutAnimationStart:b,onLayoutAnimationComplete:m}=d.getProps(),v=!this.targetLayout||!oS(this.targetLayout,y),x=!p&&h;if(this.options.layoutRoot||this.resumeFrom||x||p&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(u,x);const S={...Em(w,"layout"),onPlay:b,onComplete:m};(d.shouldReduceMotion||this.options.layoutRoot)&&(S.delay=0,S.type=!1),this.startAnimation(S)}else p||f0(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,hi(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(XR),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&aS(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const u=this.path[d];u.shouldResetTransform=!0,u.updateScroll("snapshot"),u.options.layoutRoot&&u.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(d0);return}this.isUpdating||this.nodes.forEach(GR),this.isUpdating=!1,this.nodes.forEach(YR),this.nodes.forEach(VR),this.nodes.forEach(UR),this.clearAllSnapshots();const a=sr.now();wt.delta=jr(0,1e3/60,a-wt.timestamp),wt.timestamp=a,wt.isProcessing=!0,Nd.update.process(wt),Nd.preRender.process(wt),Nd.render.process(wt),wt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,jm.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(qR),this.sharedNodes.forEach(ZR)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Be.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Be.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Dt(this.snapshot.measuredBox.x)&&!Dt(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=et(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!sS(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,d=c!==this.prevTransformTemplateValue;o&&(a||Ai(this.latestValues)||d)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),nP(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:o}=this.options;if(!o)return et();const a=o.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(rP))){const{scroll:d}=this.root;d&&(Fs(a.x,d.offset.x),Fs(a.y,d.offset.y))}return a}removeElementScroll(o){var l;const a=et();if(pn(a,o),(l=this.scroll)!=null&&l.wasRoot)return a;for(let c=0;c<this.path.length;c++){const d=this.path[c],{scroll:u,options:p}=d;d!==this.root&&u&&p.layoutScroll&&(u.wasRoot&&pn(a,o),Fs(a.x,u.offset.x),Fs(a.y,u.offset.y))}return a}applyTransform(o,a=!1){const l=et();pn(l,o);for(let c=0;c<this.path.length;c++){const d=this.path[c];!a&&d.options.layoutScroll&&d.scroll&&d!==d.root&&$s(l,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),Ai(d.latestValues)&&$s(l,d.latestValues)}return Ai(this.latestValues)&&$s(l,this.latestValues),l}removeTransform(o){const a=et();pn(a,o);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!Ai(c.latestValues))continue;Lp(c.latestValues)&&c.updateSnapshot();const d=et(),u=c.measurePageBox();pn(d,u),i0(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,d)}return Ai(this.latestValues)&&i0(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.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!==wt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var p;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:u}=this.options;if(!(!this.layout||!(d||u))){if(this.resolvedRelativeTargetAt=wt.timestamp,!this.targetDelta&&!this.relativeTarget){const h=this.getClosestProjectingParent();h&&h.layout&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=et(),this.relativeTargetOrigin=et(),va(this.relativeTargetOrigin,this.layout.layoutBox,h.layout.layoutBox),pn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=et(),this.targetWithTransforms=et()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),sR(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):pn(this.target,this.layout.layoutBox),Xk(this.target,this.targetDelta)):pn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const h=this.getClosestProjectingParent();h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=et(),this.relativeTargetOrigin=et(),va(this.relativeTargetOrigin,this.target,h.target),pn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Lp(this.parent.latestValues)||Kk(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var y;const o=this.getLead(),a=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===wt.timestamp&&(l=!1),l)return;const{layout:c,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||d))return;pn(this.layoutCorrected,this.layout.layoutBox);const u=this.treeScale.x,p=this.treeScale.y;oR(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=et());const{target:h}=o;if(!h){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(t0(this.prevProjectionDelta.x,this.projectionDelta.x),t0(this.prevProjectionDelta.y,this.projectionDelta.y)),ga(this.projectionDelta,this.layoutCorrected,h,this.latestValues),(this.treeScale.x!==u||this.treeScale.y!==p||!c0(this.projectionDelta.x,this.prevProjectionDelta.x)||!c0(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",h))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ls(),this.projectionDelta=Ls(),this.projectionDeltaWithTransform=Ls()}setAnimationOrigin(o,a=!1){const l=this.snapshot,c=l?l.latestValues:{},d={...this.latestValues},u=Ls();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const p=et(),h=l?l.source:void 0,y=this.layout?this.layout.source:void 0,w=h!==y,b=this.getStack(),m=!b||b.members.length<=1,v=!!(w&&!m&&this.options.crossfade===!0&&!this.path.some(eP));this.animationProgress=0;let x;this.mixTargetDelta=S=>{const C=S/1e3;p0(u.x,o.x,C),p0(u.y,o.y,C),this.setTargetDelta(u),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(va(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),JR(this.relativeTarget,this.relativeTargetOrigin,p,C),x&&LR(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=et()),pn(x,this.relativeTarget)),w&&(this.animationValues=d,PR(d,c,this.latestValues,C,v,m)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=C},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(hi(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Be.update(()=>{uc.hasAnimatedSinceResize=!0,this.currentAnimation=_R(0,u0,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(u0),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:d}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&cS(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||et();const u=Dt(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+u;const p=Dt(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+p}pn(a,l),$s(a,d),ga(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new FR),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&Ud("z",o,c,this.animationValues);for(let d=0;d<Vd.length;d++)Ud(`rotate${Vd[d]}`,o,c,this.animationValues),Ud(`skew${Vd[d]}`,o,c,this.animationValues);o.render();for(const d in c)o.setStaticValue(d,c[d]),this.animationValues&&(this.animationValues[d]=c[d]);o.scheduleRender()}getProjectionStyles(o){if(!this.instance||this.isSVG)return;if(!this.isVisible)return BR;const a={visibility:""},l=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,a.opacity="",a.pointerEvents=cc(o==null?void 0:o.pointerEvents)||"",a.transform=l?l(this.latestValues,""):"none",a;const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){const h={};return this.options.layoutId&&(h.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,h.pointerEvents=cc(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Ai(this.latestValues)&&(h.transform=l?l({},""):"none",this.hasProjected=!1),h}const d=c.animationValues||c.latestValues;this.applyTransformsToTarget(),a.transform=$R(this.projectionDeltaWithTransform,this.treeScale,d),l&&(a.transform=l(d,a.transform));const{x:u,y:p}=this.projectionDelta;a.transformOrigin=`${u.origin*100}% ${p.origin*100}% 0`,c.animationValues?a.opacity=c===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:a.opacity=c===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const h in Ha){if(d[h]===void 0)continue;const{correct:y,applyTo:w,isCSSVariable:b}=Ha[h],m=a.transform==="none"?d[h]:y(d[h],c);if(w){const v=w.length;for(let x=0;x<v;x++)a[w[x]]=m}else b?this.options.visualElement.renderState.vars[h]=m:a[h]=m}return this.options.layoutId&&(a.pointerEvents=c===this?cc(o==null?void 0:o.pointerEvents)||"":"none"),a}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(d0),this.root.sharedNodes.clear()}}}function VR(e){e.updateLayout()}function UR(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:s}=e.options,o=t.source!==e.layout.source;s==="size"?mn(u=>{const p=o?t.measuredBox[u]:t.layoutBox[u],h=Dt(p);p.min=r[u].min,p.max=p.min+h}):cS(s,t.layoutBox,r)&&mn(u=>{const p=o?t.measuredBox[u]:t.layoutBox[u],h=Dt(r[u]);p.max=p.min+h,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+h)});const a=Ls();ga(a,r,t.layoutBox);const l=Ls();o?ga(l,e.applyTransform(i,!0),t.measuredBox):ga(l,r,t.layoutBox);const c=!sS(a);let d=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:p,layout:h}=u;if(p&&h){const y=et();va(y,t.layoutBox,p.layoutBox);const w=et();va(w,r,h.layoutBox),oS(y,w)||(d=!0),u.options.layoutRoot&&(e.relativeTarget=w,e.relativeTargetOrigin=y,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function HR(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 WR(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function qR(e){e.clearSnapshot()}function d0(e){e.clearMeasurements()}function GR(e){e.isLayoutDirty=!1}function YR(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function f0(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function QR(e){e.resolveTargetDelta()}function KR(e){e.calcProjection()}function XR(e){e.resetSkewAndRotation()}function ZR(e){e.removeLeadSnapshot()}function p0(e,t,n){e.translate=Ye(t.translate,0,n),e.scale=Ye(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function h0(e,t,n,r){e.min=Ye(t.min,n.min,r),e.max=Ye(t.max,n.max,r)}function JR(e,t,n,r){h0(e.x,t.x,n.x,r),h0(e.y,t.y,n.y,r)}function eP(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const tP={duration:.45,ease:[.4,0,.1,1]},m0=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),g0=m0("applewebkit/")&&!m0("chrome/")?Math.round:Cn;function v0(e){e.min=g0(e.min),e.max=g0(e.max)}function nP(e){v0(e.x),v0(e.y)}function cS(e,t,n){return e==="position"||e==="preserve-aspect"&&!iR(l0(t),l0(n),.2)}function rP(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const iP=lS({attachResizeListener:(e,t)=>Ya(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Hd={current:void 0},uS=lS({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Hd.current){const e=new iP({});e.mount(window),e.setOptions({layoutScroll:!0}),Hd.current=e}return Hd.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),sP={pan:{Feature:bR},drag:{Feature:wR,ProjectionNode:uS,MeasureLayout:nS}};function y0(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&Be.postRender(()=>s(t,dl(t)))}class oP extends wi{mount(){const{current:t}=this.node;t&&(this.unmount=gj(t,(n,r)=>(y0(this.node,r,"Start"),i=>y0(this.node,i,"End"))))}unmount(){}}class aP extends wi{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ul(Ya(this.node.current,"focus",()=>this.onFocus()),Ya(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function x0(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),s=r[i];s&&Be.postRender(()=>s(t,dl(t)))}class lP extends wi{mount(){const{current:t}=this.node;t&&(this.unmount=wj(t,(n,r)=>(x0(this.node,r,"Start"),(i,{success:s})=>x0(this.node,i,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Bp=new WeakMap,Wd=new WeakMap,cP=e=>{const t=Bp.get(e.target);t&&t(e)},uP=e=>{e.forEach(cP)};function dP({root:e,...t}){const n=e||document;Wd.has(n)||Wd.set(n,{});const r=Wd.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(uP,{root:e,...t})),r[i]}function fP(e,t,n){const r=dP(t);return Bp.set(e,n),r.observe(e),()=>{Bp.delete(e),r.unobserve(e)}}const pP={some:0,all:1};class hP extends wi{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:pP[i]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,s&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:d,onViewportLeave:u}=this.node.getProps(),p=c?d:u;p&&p(l)};return fP(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(mP(t,n))&&this.startObserver()}unmount(){}}function mP({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const gP={inView:{Feature:hP},tap:{Feature:lP},focus:{Feature:aP},hover:{Feature:oP}},vP={layout:{ProjectionNode:uS,MeasureLayout:nS}},zp={current:null},dS={current:!1};function yP(){if(dS.current=!0,!!xm)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>zp.current=e.matches;e.addListener(t),t()}else zp.current=!1}const xP=[...Ik,Et,mi],wP=e=>xP.find(Dk(e)),bP=new WeakMap;function kP(e,t,n){for(const r in t){const i=t[r],s=n[r];if(jt(i))e.addValue(r,i);else if(jt(s))e.addValue(r,Va(i,{owner:e}));else if(s!==i)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=e.getStaticValue(r);e.addValue(r,Va(o!==void 0?o:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const w0=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class SP{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Ym,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const h=sr.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,Be.render(this.render,!1,!0))};const{latestValues:l,renderState:c,onUpdate:d}=o;this.onUpdate=d,this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=Pu(n),this.isVariantNode=Zb(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...p}=this.scrapeMotionValuesFromProps(n,{},this);for(const h in p){const y=p[h];l[h]!==void 0&&jt(y)&&y.set(l[h],!1)}}mount(t){this.current=t,bP.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),dS.current||yP(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:zp.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),hi(this.notifyUpdate),hi(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=cs.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&Be.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in xo){const n=xo[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):et()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<w0.length;r++){const i=w0[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,o=t[s];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=kP(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Va(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(Nk(r)||Sk(r))?r=parseFloat(r):!wP(r)&&mi.test(n)&&(r=Rk(t,n)),this.setBaseTarget(t,jt(r)?r.get():r)),jt(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var s;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=Vm(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);o&&(r=o[t])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!jt(i)?i:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Cm),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class fS extends SP{constructor(){super(...arguments),this.KeyframeResolver=Lk}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;jt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function CP(e){return window.getComputedStyle(e)}class _P extends fS{constructor(){super(...arguments),this.type="html",this.renderInstance=ck}readValueFromInstance(t,n){if(cs.has(n))return F5(t,n);{const r=CP(t),i=(Om(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Zk(t,n)}build(t,n,r){Lm(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Um(t,n,r)}}class TP extends fS{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=et,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&lk(this.current,this.renderState)}}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(cs.has(n)){const r=jk(n);return r&&r.default||0}return n=uk.has(n)?n:Nm(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return fk(t,n,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&Be.postRender(this.updateDimensions)}build(t,n,r){Bm(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){dk(t,n,r,i)}mount(t){this.isSVGTag=zm(t.tagName),super.mount(t)}}const EP=(e,t)=>$m(e)?new TP(t):new _P(t,{allowProjection:e!==g.Fragment}),AP=d5({...K3,...gP,...sP,...vP},EP),Re=Ej(AP);class jP{constructor(){this.componentControls=new Set}subscribe(t){return this.componentControls.add(t),()=>this.componentControls.delete(t)}start(t,n){this.componentControls.forEach(r=>{r.start(t.nativeEvent||t,n)})}}const RP=()=>new jP;function PP(){return Eu(RP)}var zr=(e=>(e.None="none",e.Sm="sm",e.Md="md",e.Lg="lg",e.Xl="xl",e.Full="full",e))(zr||{});const pS=g.createContext({}),MP={[ie.TooltipDefault]:"Bizimle sohbet edin!",[ie.TooltipActive]:"Yeni mesajlar var!",[ie.CloseButtonAria]:"Kapat",[ie.MessagePlaceholder]:"Mesajınızı yazın",[ie.FileUploadDisabled]:"Dosya gönderim izniniz olmadığı için yükleyemezsiniz",[ie.NewMessagesNotification]:"Yeni mesajlar var!",[ie.ChatCloseConfirm]:"Sohbeti kapatmak istediğinizden emin misiniz?",[ie.ChatCloseWarning]:"Bu işlem geri alınamaz.",[ie.ChatSettings]:"Sohbet Ayarları",[ie.ChatEndConversation]:"Sohbeti Sonlandır",[ie.CancelAction]:"Vazgeç",[ie.CloseAction]:"Kapat",[ie.QuickActions]:"Hızlı işlemler",[ie.GreetingStartChat]:"Sohbete başla",[ie.RateLimitMessage]:"Çok fazla mesaj gönderdiniz. Lütfen {seconds} saniye bekleyin.",[ie.RatingHeaderEvaluate]:"Görüşmenizi Değerlendirin",[ie.RatingHeaderThanks]:"Teşekkürler!",[ie.RatingDescription]:"Lütfen hizmetimizi değerlendirin. Görüşleriniz bizim için önemli.",[ie.RatingRateConversation]:"Görüşmeyi puanlayın",[ie.RatingComment]:"Yorumunuz (İsteğe bağlı)",[ie.RatingCommentPlaceholder]:"Görüşme hakkında düşüncelerinizi paylaşın...",[ie.RatingSubmit]:"Değerlendirmeyi Gönder",[ie.RatingNewConversation]:"Yeni Görüşme Başlat",[ie.RatingThankYouTitle]:"Değerlendirmeniz için teşekkürler!",[ie.RatingThankYouDescription]:"Geri bildiriminiz bizim için çok değerli.",[ie.RatingCountdown]:"Ekran {seconds} saniye içinde kapanacaktır.",[ie.RatingMinimumError]:"Lütfen en az 1 yıldız seçiniz.",[ie.RatingYourScore]:"Puanınız: {score}",[ie.PoweredBy]:"Powered by",[ie.NotificationSoundOn]:"Bildirim sesi aç",[ie.NotificationSoundOff]:"Bildirim sesi kapat"},NP={[k.Background]:"#ffffff",[k.Border]:"#e2e8f0",[k.TooltipText]:"#1e40af",[k.TooltipBackground]:"#dbeafe",[k.TooltipBorder]:"#3b82f6",[k.HeaderBackground]:"#ffffff",[k.HeaderBorder]:"#e2e8f0",[k.HeaderText]:"#1e293b",[k.FooterBackground]:"#f8fafc",[k.FooterBorder]:"#e2e8f0",[k.FooterText]:"#475569",[k.MessageAdminBackground]:"#f1f5f9",[k.MessageAdminText]:"#334155",[k.MessageVisitorBackground]:"#3b82f6",[k.MessageVisitorText]:"#ffffff",[k.MessageAgentBackground]:"#ede9fe",[k.MessageAgentText]:"#5b21b6",[k.GreeterBackground]:"#ffffff",[k.GreeterText]:"#334155",[k.GreeterBorder]:"#e2e8f0",[k.GreeterTopBackground]:"linear-gradient(135deg, #3b82f6 0%, #2563eb 100%)",[k.GreeterTopText]:"#ffffff",[k.GreeterButtonBackground]:"#3b82f6",[k.GreeterButtonText]:"#ffffff",[k.ButtonBackground]:"#3b82f6",[k.ButtonText]:"#ffffff",[k.InputBackground]:"#f8fafc",[k.InputText]:"#1e293b",[k.InputBorder]:"#e2e8f0",[k.CloseButtonBackground]:"#f1f5f9",[k.CloseButtonText]:"#475569",[k.CloseButtonHover]:"#e2e8f0",[k.IconColor]:"#64748b",[k.IconBackground]:"transparent",[k.ErrorBackground]:"#fef2f2",[k.ErrorText]:"#dc2626",[k.ErrorBorder]:"#fca5a5",[k.SuccessBackground]:"#f0fdf4",[k.SuccessText]:"#16a34a",[k.SuccessBorder]:"#86efac",[k.WarningBackground]:"#fffbeb",[k.WarningText]:"#d97706",[k.WarningBorder]:"#fcd34d",[k.LinkColor]:"#2563eb",[k.LinkHoverColor]:"#1d4ed8",[k.DividerColor]:"#e2e8f0",[k.ShadowColor]:"rgba(0, 0, 0, 0.1)",[k.StarActiveColor]:"#f59e0b",[k.StarInactiveColor]:"#e2e8f0",[k.ModalOverlayColor]:"rgba(0, 0, 0, 0.4)",[k.ChatCloseConfirmText]:"#dc2626",[k.RatingHeaderBackground]:"#3b82f6",[k.RatingHeaderText]:"#ffffff",[k.RatingSuccessBackground]:"#ffffff",[k.RatingSuccessText]:"#334155",[k.RatingRateConversationText]:"#1e293b"},OP={[k.Background]:"#0a0a0a",[k.Border]:"#262626",[k.TooltipText]:"#e5e5e5",[k.TooltipBackground]:"#262626",[k.TooltipBorder]:"#404040",[k.HeaderBackground]:"#171717",[k.HeaderBorder]:"#262626",[k.HeaderText]:"#fafafa",[k.FooterBackground]:"#0a0a0a",[k.FooterBorder]:"#262626",[k.FooterText]:"#a3a3a3",[k.MessageAdminBackground]:"#262626",[k.MessageAdminText]:"#e5e5e5",[k.MessageVisitorBackground]:"#171717",[k.MessageVisitorText]:"#e5e5e5",[k.MessageAgentBackground]:"#5b21b6",[k.MessageAgentText]:"#e9d5ff",[k.GreeterBackground]:"#171717",[k.GreeterText]:"#e5e5e5",[k.GreeterBorder]:"#262626",[k.GreeterTopBackground]:"linear-gradient(135deg, #262626 0%, #171717 100%)",[k.GreeterTopText]:"#fafafa",[k.GreeterButtonBackground]:"#3b82f6",[k.GreeterButtonText]:"#ffffff",[k.ButtonBackground]:"#3b82f6",[k.ButtonText]:"#ffffff",[k.InputBackground]:"#171717",[k.InputText]:"#e5e5e5",[k.InputBorder]:"#3f3f3f",[k.CloseButtonBackground]:"#262626",[k.CloseButtonText]:"#a3a3a3",[k.CloseButtonHover]:"#404040",[k.IconColor]:"#a3a3a3",[k.IconBackground]:"transparent",[k.ErrorBackground]:"#450a0a",[k.ErrorText]:"#fca5a5",[k.ErrorBorder]:"#7f1d1d",[k.SuccessBackground]:"#052e16",[k.SuccessText]:"#86efac",[k.SuccessBorder]:"#14532d",[k.WarningBackground]:"#451a03",[k.WarningText]:"#fcd34d",[k.WarningBorder]:"#78350f",[k.LinkColor]:"#3b82f6",[k.LinkHoverColor]:"#60a5fa",[k.DividerColor]:"#262626",[k.ShadowColor]:"rgba(0, 0, 0, 0.4)",[k.StarActiveColor]:"#f59e0b",[k.StarInactiveColor]:"#404040",[k.ModalOverlayColor]:"rgba(0, 0, 0, 0.7)",[k.ChatCloseConfirmText]:"#fca5a5",[k.RatingHeaderBackground]:"#171717",[k.RatingHeaderText]:"#fafafa",[k.RatingSuccessBackground]:"#171717",[k.RatingSuccessText]:"#e5e5e5",[k.RatingRateConversationText]:"#e5e5e5"},DP={[zr.None]:"0px",[zr.Sm]:"var(--radius-sm)",[zr.Md]:"var(--radius-md)",[zr.Lg]:"var(--radius-lg)",[zr.Xl]:"var(--radius-lg)",[zr.Full]:"calc(infinity * 1px)"},IP=e=>{const t={...MP};if(!e||!e.appearance||!e.appearance.design||!e.appearance.design.texts)return t;for(const n in e.appearance.design.texts){const r=n;e.appearance.design.texts[r]&&(t[r]=e.appearance.design.texts[r])}return t};function LP(e,t){const n=e.replace(/^#/,"");if(n.length!==6)return e;const r=Math.max(0,Math.round(Number.parseInt(n.slice(0,2),16)*(1-t))),i=Math.max(0,Math.round(Number.parseInt(n.slice(2,4),16)*(1-t))),s=Math.max(0,Math.round(Number.parseInt(n.slice(4,6),16)*(1-t)));return`#${r.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}`}const qd="#ffffff";function FP(e){const t=LP(e,.2);return{[k.ButtonBackground]:t,[k.ButtonText]:qd,[k.GreeterButtonBackground]:t,[k.GreeterButtonText]:qd,[k.MessageVisitorBackground]:t,[k.MessageVisitorText]:qd}}const $P=(e,t)=>{var i,s;const r={...t==="dark"?OP:NP};if(t==="dark")return r;if((s=(i=e==null?void 0:e.appearance)==null?void 0:i.design)!=null&&s.colors){const o=e.appearance.design.colors,a=o.main_color;if(a){const l=FP(a);for(const c of Object.keys(l))l[c]&&(r[c]=l[c])}for(const l in o){if(l==="main_color"||l==="secondary_color"||l==="accent_color")continue;const c=l;o[l]&&l in r&&(r[c]=o[l])}}return r},hS="lc:theme:mode";function BP(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function zP(){try{const e=localStorage.getItem(hS);if(e==="light"||e==="dark"||e==="system")return e}catch{}return Le.System}function VP({children:e,widget:t}){const[n,r]=g.useState(zP),[i,s]=g.useState(BP);g.useEffect(()=>{const y=window.matchMedia("(prefers-color-scheme: dark)"),w=b=>{s(b.matches?"dark":"light")};return y.addEventListener("change",w),()=>y.removeEventListener("change",w)},[]);const o=n===Le.System?i:n,a=g.useCallback(y=>{r(y);try{localStorage.setItem(hS,y)}catch{}},[]),l=$P(t,o),c=IP(t),d=t&&t.appearance&&t.appearance.design&&t.appearance.design.border_radius?t.appearance.design.border_radius:zr.Md,u=y=>l[y],p=y=>c[y],h=()=>DP[d];return f.jsx(pS.Provider,{value:{colors:l,texts:c,getColor:u,getText:p,getRadius:h,mode:n,resolvedMode:o,setMode:a},children:e})}const be=()=>g.useContext(pS),us=()=>be().getText;function Rt({children:e,type:t="button",variant:n="primary",kind:r="solid",size:i="md",disabled:s=!1,rounded:o=!1,className:a,style:l,textKey:c=k.ButtonText,bgKey:d=k.ButtonBackground,animations:u={},withoutTheming:p,...h}){const y=be();return f.jsx(Re.button,{type:t,className:Ie("flex items-center justify-center focus:outline-none focus:ring-2 focus:ring-offset-0 font-medium transition-opacity",{"rounded-full":o&&i!=="xs","rounded-lg":!o,"opacity-50 cursor-not-allowed":s,"hover:opacity-90 active:opacity-95":!s},a,ny[n]&&ny[n][r],JA[i][o?"rounded":"default"]),disabled:s,style:{transition:"all 0.2s ease",...!p&&{color:y.getColor(c),backgroundColor:y.getColor(d),...o?{}:{borderRadius:y.getRadius()}},...l},...u,...h,children:e})}function Z(){}Z.Home=function(t){return f.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",height:"1em",width:"1em",...t,children:f.jsx("path",{d:"M3 13h1v7c0 1.103.897 2 2 2h12c1.103 0 2-.897 2-2v-7h1a1 1 0 00.707-1.707l-9-9a.999.999 0 00-1.414 0l-9 9A1 1 0 003 13zm7 7v-5h4v5h-4zm2-15.586l6 6V15l.001 5H16v-5c0-1.103-.897-2-2-2h-4c-1.103 0-2 .897-2 2v5H6v-9.586l6-6z"})})};Z.Chat=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 8.25h9m-9 3H12m-9.75 1.51c0 1.6 1.123 2.994 2.707 3.227 1.129.166 2.27.293 3.423.379.35.026.67.21.865.501L12 21l2.755-4.133a1.14 1.14 0 0 1 .865-.501 48.172 48.172 0 0 0 3.423-.379c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0 0 12 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018Z"})});Z.Menu=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"})});Z.MessageTyping=({className:e="size-5",...t})=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,...t,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.625 9.75a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H8.25m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H12m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0h-.375m-13.5 3.01c0 1.6 1.123 2.994 2.707 3.227 1.087.16 2.185.283 3.293.369V21l4.184-4.183a1.14 1.14 0 0 1 .778-.332 48.294 48.294 0 0 0 5.83-.498c1.585-.233 2.708-1.626 2.708-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0 0 12 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018Z"})});Z.Check=function(t){return f.jsx("svg",{fill:"currentColor",viewBox:"0 0 16 16",height:"1em",width:"1em",...t,children:f.jsx("path",{d:"M12.736 3.97a.733.733 0 011.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 01-1.065.02L3.217 8.384a.757.757 0 010-1.06.733.733 0 011.047 0l3.052 3.093 5.4-6.425a.247.247 0 01.02-.022z"})})};Z.Website=function(t){return f.jsxs("svg",{fill:"none",viewBox:"0 0 24 24",height:"1em",width:"1em",...t,children:[f.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M14 7a1 1 0 00-1 1v8a1 1 0 001 1h4a1 1 0 001-1V8a1 1 0 00-1-1h-4zm3 2h-2v6h2V9z",clipRule:"evenodd"}),f.jsx("path",{fill:"currentColor",d:"M6 7a1 1 0 000 2h4a1 1 0 100-2H6zM6 11a1 1 0 100 2h4a1 1 0 100-2H6zM5 16a1 1 0 011-1h4a1 1 0 110 2H6a1 1 0 01-1-1z"}),f.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M4 3a3 3 0 00-3 3v12a3 3 0 003 3h16a3 3 0 003-3V6a3 3 0 00-3-3H4zm16 2H4a1 1 0 00-1 1v12a1 1 0 001 1h16a1 1 0 001-1V6a1 1 0 00-1-1z",clipRule:"evenodd"})]})};Z.ArrowDown=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 13.5 12 21m0 0-7.5-7.5M12 21V3"})});Z.ArrowDown2=e=>f.jsxs("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",...e,children:[f.jsx("g",{id:"SVGRepo_bgCarrier",strokeWidth:1.5}),f.jsx("g",{id:"SVGRepo_tracerCarrier",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5}),f.jsx("g",{id:"SVGRepo_iconCarrier",children:f.jsx("path",{d:"M903.232 256l56.768 50.432L512 768 64 306.432 120.768 256 512 659.072z",fill:"currentColor"})})]});Z.ArrowLeft=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"})});Z.XCircle=({className:e="e-5",...t})=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,...t,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})});Z.X=({className:e="e-5",...t})=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,...t,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})});Z.PaperAirplane=({className:e="e-5",...t})=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,...t,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 12L3.269 3.126A59.768 59.768 0 0121.485 12 59.77 59.77 0 013.27 20.876L5.999 12zm0 0h7.5"})});Z.Spin=function(t){return f.jsx("svg",{"data-name":"Layer 1",viewBox:"0 0 24 24",fill:"currentColor",height:"1em",width:"1em",...t,children:f.jsx("path",{d:"M6.804 15a1 1 0 00-1.366-.366l-1.732 1a1 1 0 001 1.732l1.732-1A1 1 0 006.804 15zM3.706 8.366l1.732 1a1 1 0 101-1.732l-1.732-1a1 1 0 00-1 1.732zM6 12a1 1 0 00-1-1H3a1 1 0 000 2h2a1 1 0 001-1zm11.196-3a1 1 0 001.366.366l1.732-1a1 1 0 10-1-1.732l-1.732 1A1 1 0 0017.196 9zM15 6.804a1 1 0 001.366-.366l1-1.732a1 1 0 10-1.732-1l-1 1.732A1 1 0 0015 6.804zm5.294 8.83l-1.732-1a1 1 0 10-1 1.732l1.732 1a1 1 0 001-1.732zm-3.928 1.928a1 1 0 10-1.732 1l1 1.732a1 1 0 101.732-1zM21 11h-2a1 1 0 000 2h2a1 1 0 000-2zm-9 7a1 1 0 00-1 1v2a1 1 0 002 0v-2a1 1 0 00-1-1zm-3-.804a1 1 0 00-1.366.366l-1 1.732a1 1 0 001.732 1l1-1.732A1 1 0 009 17.196zM12 2a1 1 0 00-1 1v2a1 1 0 002 0V3a1 1 0 00-1-1z"})})};Z.ExternalLink=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"})});Z.Phone=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 6.75c0 8.284 6.716 15 15 15h2.25a2.25 2.25 0 002.25-2.25v-1.372c0-.516-.351-.966-.852-1.091l-4.423-1.106c-.44-.11-.902.055-1.173.417l-.97 1.293c-.282.376-.769.542-1.21.38a12.035 12.035 0 01-7.143-7.143c-.162-.441.004-.928.38-1.21l1.293-.97c.363-.271.527-.734.417-1.173L6.963 3.102a1.125 1.125 0 00-1.091-.852H4.5A2.25 2.25 0 002.25 4.5v2.25z"})});Z.Mail=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.75 6.75v10.5a2.25 2.25 0 01-2.25 2.25h-15a2.25 2.25 0 01-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25m19.5 0v.243a2.25 2.25 0 01-1.07 1.916l-7.5 4.615a2.25 2.25 0 01-2.36 0L3.32 8.91a2.25 2.25 0 01-1.07-1.916V6.75"})});Z.Star=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z"})});Z.Plus=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"})});Z.History=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})});Z.Eye=e=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:[f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z"}),f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]});Z.Lock=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 10.5V6.75a4.5 4.5 0 119 0v3.75M3.75 21.75h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H3.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z"})});Z.User=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z"})});Z.Emoji=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.182 15.182a4.5 4.5 0 0 1-6.364 0M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0ZM9.75 9.75c0 .414-.168.75-.375.75S9 10.164 9 9.75 9.168 9 9.375 9s.375.336.375.75Zm-.375 0h.008v.015h-.008V9.75Zm5.625 0c0 .414-.168.75-.375.75s-.375-.336-.375-.75.168-.75.375-.75.375.336.375.75Zm-.375 0h.008v.015h-.008V9.75Z"})});Z.Paperclip=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13"})});Z.Sparkles=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.455 2.456L21.75 6l-1.036.259a3.375 3.375 0 0 0-2.455 2.456ZM16.894 20.567 16.5 21.75l-.394-1.183a2.25 2.25 0 0 0-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394-1.183.394a2.25 2.25 0 0 0-1.423 1.423Z"})});Z.Sun=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75v-2.25m-4.773 4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z"})});Z.Moon=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z"})});Z.Monitor=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 0 1-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0 1 15 18.257V17.25m6-12V15a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 15V5.25m18 0A2.25 2.25 0 0 0 18.75 3H5.25A2.25 2.25 0 0 0 3 5.25m18 0V12a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 12V5.25"})});Z.Volume2=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.114 5.636a9 9 0 0 1 0 12.728M16.463 8.288a5.25 5.25 0 0 1 0 7.424M6.75 8.25l4.72-4.72a.75.75 0 0 1 1.28.53v15.88a.75.75 0 0 1-1.28.53l-4.72-4.72H4.51c-.88 0-1.704-.507-1.938-1.354A9.01 9.01 0 0 1 2.25 12c0-.83.112-1.633.322-2.396C2.806 8.756 3.63 8.25 4.51 8.25H6.75Z"})});Z.VolumeX=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.25 9.75 19.5 12m0 0 2.25 2.25M19.5 12l2.25-2.25M19.5 12l-2.25 2.25m-10.5-6 4.72-4.72a.75.75 0 0 1 1.28.53v15.88a.75.75 0 0 1-1.28.53l-4.72-4.72H4.51c-.88 0-1.704-.507-1.938-1.354A9.01 9.01 0 0 1 2.25 12c0-.83.112-1.633.322-2.396C2.806 8.756 3.63 8.25 4.51 8.25H6.75Z"})});Z.Bot=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 3v1.5M4.5 8.25H3m18 0h-1.5M4.5 12H3m18 0h-1.5m-15 3.75H3m18 0h-1.5M8.25 19.5V21M12 3v1.5m0 15V21m3.75-18v1.5m0 15V21m-9-1.5h10.5a2.25 2.25 0 0 0 2.25-2.25V6.75a2.25 2.25 0 0 0-2.25-2.25H6.75A2.25 2.25 0 0 0 4.5 6.75v10.5a2.25 2.25 0 0 0 2.25 2.25Zm.75-12h9v9h-9v-9Z"})});function Vp(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var rt=(e=>(e.CustomerToken="lc:customer:token",e.CustomerRefreshToken="lc:customer:refresh_token",e.DeviceId="lc:device:id",e.AIAgentMode="lc:agent:mode",e.AIAgent="lc:agent:data",e.AIAgentSessionId="lc:agent:session",e.HumanNeedRequested="lc:agent:human_need",e))(rt||{});const Fn=(e,t,n)=>{let r=e;["lc:customer:token","lc:customer:refresh_token"].includes(e)&&(r=`${n}:${e}`),localStorage.setItem(r,t)},na=(e,t)=>{let n=e;return["lc:customer:token","lc:customer:refresh_token"].includes(e)&&(n=`${t}:${e}`),localStorage.getItem(n)},ya=e=>{localStorage.removeItem(`${e}:lc:customer:token`),localStorage.removeItem(`${e}:lc:customer:refresh_token`),Zm(e)},mS=e=>{localStorage.removeItem(`${e}:lc:customer:token`),localStorage.removeItem(`${e}:lc:customer:refresh_token`)},Vl=(e,t,n,r,i)=>{const s=`${e}:`;t&&(n||i)?(localStorage.setItem(`${s}lc:agent:mode`,"true"),localStorage.setItem(`${s}lc:agent:data`,JSON.stringify(t)),r&&localStorage.setItem(`${s}lc:agent:session`,r),i!==void 0&&(i?localStorage.setItem(`${s}lc:agent:human_need`,"true"):localStorage.removeItem(`${s}lc:agent:human_need`))):Zm(e)},mr=e=>{const t=`${e}:`,n=localStorage.getItem(`${t}lc:agent:mode`)==="true",r=localStorage.getItem(`${t}lc:agent:data`),i=localStorage.getItem(`${t}lc:agent:session`),s=localStorage.getItem(`${t}lc:agent:human_need`)==="true";let o=null;if(r)try{o=JSON.parse(r)}catch{o=null}return{isAgentMode:n,agent:o,sessionId:i,humanNeedRequested:s}},Zm=e=>{const t=`${e}:`;localStorage.removeItem(`${t}lc:agent:mode`),localStorage.removeItem(`${t}lc:agent:data`),localStorage.removeItem(`${t}lc:agent:session`),localStorage.removeItem(`${t}lc:agent:human_need`)},Rr=e=>{const t=`${e}:lc:device:id`;let n=localStorage.getItem(t);return n||(n=Vp(),localStorage.setItem(t,n)),n},UP={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},b0=e=>{let t;const n=new Set,r=(d,u)=>{const p=typeof d=="function"?d(t):d;if(!Object.is(p,t)){const h=t;t=u??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(y=>y(t,h))}},i=()=>t,l={setState:r,getState:i,getInitialState:()=>c,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(UP?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},c=t=e(r,i,l);return l},HP=e=>e?b0(e):b0;var gS={exports:{}},vS={},yS={exports:{}},xS={};/**
|
|
71
71
|
* @license React
|
|
72
72
|
* use-sync-external-store-shim.production.min.js
|
|
73
73
|
*
|
|
@@ -75,7 +75,7 @@ Error generating stack: `+s.message+`
|
|
|
75
75
|
*
|
|
76
76
|
* This source code is licensed under the MIT license found in the
|
|
77
77
|
* LICENSE file in the root directory of this source tree.
|
|
78
|
-
*/var
|
|
78
|
+
*/var bo=g;function WP(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var qP=typeof Object.is=="function"?Object.is:WP,GP=bo.useState,YP=bo.useEffect,QP=bo.useLayoutEffect,KP=bo.useDebugValue;function XP(e,t){var n=t(),r=GP({inst:{value:n,getSnapshot:t}}),i=r[0].inst,s=r[1];return QP(function(){i.value=n,i.getSnapshot=t,Gd(i)&&s({inst:i})},[e,n,t]),YP(function(){return Gd(i)&&s({inst:i}),e(function(){Gd(i)&&s({inst:i})})},[e]),KP(n),n}function Gd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!qP(e,n)}catch{return!0}}function ZP(e,t){return t()}var JP=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?ZP:XP;xS.useSyncExternalStore=bo.useSyncExternalStore!==void 0?bo.useSyncExternalStore:JP;yS.exports=xS;var eM=yS.exports;/**
|
|
79
79
|
* @license React
|
|
80
80
|
* use-sync-external-store-shim/with-selector.production.min.js
|
|
81
81
|
*
|
|
@@ -83,49 +83,49 @@ Error generating stack: `+s.message+`
|
|
|
83
83
|
*
|
|
84
84
|
* This source code is licensed under the MIT license found in the
|
|
85
85
|
* LICENSE file in the root directory of this source tree.
|
|
86
|
-
*/var ju=v,VP=zP;function UP(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var HP=typeof Object.is=="function"?Object.is:UP,WP=VP.useSyncExternalStore,qP=ju.useRef,GP=ju.useEffect,YP=ju.useMemo,QP=ju.useDebugValue;iS.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var s=qP(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=YP(function(){function l(m){if(!c){if(c=!0,d=m,m=r(m),i!==void 0&&o.hasValue){var y=o.value;if(i(y,m))return u=y}return u=m}if(y=u,HP(d,m))return y;var w=r(m);return i!==void 0&&i(y,w)?y:(d=m,u=w)}var c=!1,d,u,p=n===void 0?null:n;return[function(){return l(t())},p===null?void 0:function(){return l(p())}]},[t,n,r,i]);var a=WP(e,s[0],s[1]);return GP(function(){o.hasValue=!0,o.value=a},[a]),QP(a),a};rS.exports=iS;var KP=rS.exports;const XP=Rr(KP),aS={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},{useDebugValue:ZP}=J,{useSyncExternalStoreWithSelector:JP}=XP;let h0=!1;const eM=e=>e;function tM(e,t=eM,n){(aS?"production":void 0)!=="production"&&n&&!h0&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),h0=!0);const r=JP(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return ZP(r),r}const m0=e=>{(aS?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?PP(e):e,n=(r,i)=>tM(t,r,i);return Object.assign(n,t),n},nM=e=>e?m0(e):m0,ie=nM(e=>({widget:null,open:localStorage.getItem("lc:widget:isHaveChat")==="true",isInputFocused:!1,isHaveChat:localStorage.getItem("lc:widget:isHaveChat")==="true",defaultValues:{},soundPath:void 0,isTooltipVisible:!0,onTooltipClose:void 0,anyAdmin:!0,showActionButtons:!1,setIsTooltipVisible:t=>e({isTooltipVisible:t}),setOnTooltipClose:t=>e({onTooltipClose:t}),setOpen:t=>{e({open:t})},setAnyAdmin:t=>e({anyAdmin:t}),setWidget:t=>e({widget:t}),setDefaultValues:t=>e({defaultValues:t}),setIsHaveChat:t=>{var n;if(e({isHaveChat:t}),localStorage.setItem("lc:widget:isHaveChat",t.toString()),!t){e({showActionButtons:!1});const r=(n=ie.getState().widget)==null?void 0:n.link_id;r&&localStorage.setItem(`${r}:showActionButtons`,"false")}},setSoundPath:t=>{e({soundPath:t})},onOpen:void 0,onClose:void 0,setOnOpen:t=>e({onOpen:t}),setOnClose:t=>e({onClose:t}),setIsInputFocused:t=>e({isInputFocused:t}),historyChat:null,setHistoryChat:t=>e({historyChat:t}),historyMessages:null,setHistoryMessages:t=>e({historyMessages:t}),showHistoryOnRegistration:!1,setShowHistoryOnRegistration:t=>e({showHistoryOnRegistration:t}),aiAgent:null,setAIAgent:t=>e(n=>{var i;const r=(i=n.widget)==null?void 0:i.link_id;return r&&Ll(r,t,n.isAIAgentMode,n.aiAgentSessionId,n.humanNeedRequested),{aiAgent:t}}),isAIAgentMode:!1,setIsAIAgentMode:t=>e(n=>{var i;const r=(i=n.widget)==null?void 0:i.link_id;return r&&Ll(r,n.aiAgent,t,n.aiAgentSessionId,n.humanNeedRequested),{isAIAgentMode:t}}),aiAgentSessionId:null,setAIAgentSessionId:t=>e(n=>{var i;const r=(i=n.widget)==null?void 0:i.link_id;return r&&Ll(r,n.aiAgent,n.isAIAgentMode,t,n.humanNeedRequested),{aiAgentSessionId:t}}),humanNeedRequested:!1,setHumanNeedRequested:t=>e(n=>{var i;const r=(i=n.widget)==null?void 0:i.link_id;if(r){const s=`${r}:`;t?localStorage.setItem(`${s}${rt.HumanNeedRequested}`,"true"):localStorage.removeItem(`${s}${rt.HumanNeedRequested}`),n.aiAgent&&n.isAIAgentMode&&Ll(r,n.aiAgent,n.isAIAgentMode,n.aiAgentSessionId,t)}return{humanNeedRequested:t}}),aiAgentMessages:[],setAIAgentMessages:t=>e(n=>({aiAgentMessages:typeof t=="function"?t(n.aiAgentMessages):t})),addAIAgentMessage:t=>e(n=>({aiAgentMessages:[...n.aiAgentMessages,t]})),clearAIAgentState:()=>e(t=>{var r;const n=(r=t.widget)==null?void 0:r.link_id;return n&&Wm(n),{aiAgent:null,isAIAgentMode:!1,aiAgentSessionId:null,humanNeedRequested:!1,aiAgentMessages:[],connectingToOperator:!1,showOperatorForm:!1}}),connectingToOperator:!1,setConnectingToOperator:t=>e({connectingToOperator:t}),showOperatorForm:!1,setShowOperatorForm:t=>e({showOperatorForm:t}),setShowActionButtons:t=>e(n=>{var i;const r=(i=n.widget)==null?void 0:i.link_id;return r&&localStorage.setItem(`${r}:showActionButtons`,t.toString()),{showActionButtons:t}})})),rM=e=>({accessToken:localStorage.getItem(`${e}:${rt.CustomerToken}`)||"",refreshToken:localStorage.getItem(`${e}:${rt.CustomerRefreshToken}`)||""}),al=()=>{const{widget:e}=ie();return e?rM(e.link_id):null},Yi=e=>{if(!e)return{};const{accessToken:t,refreshToken:n}=e,r={};return t&&(r["X-Customer-Token"]=t),n&&(r["X-Customer-Refresh-Token"]=n),{...r}};function Lp(e){return e&&typeof e=="object"&&"customer_token"in e&&"customer_refresh_token"in e}const qm=()=>am({mutationFn:e=>Mr(`clients/${e.client_id}/chats`,{method:"POST",body:JSON.stringify({inputs:e.inputs,client_id:void 0,widget_id:e.widget_id,history:e.history,device_id:e.device_id,is_agent_mode:e.is_agent_mode,widget_version:"2026.01.05-1"})})}),iM=(e,t)=>Mr(`clients/${e}/chats`,{headers:t}),oc=(e,t)=>Mr(`clients/${e}/chats`,{method:"DELETE",headers:t}),sM=(e,t,n)=>Mr("review",{method:"POST",body:JSON.stringify({rating:e,comment:t||void 0}),headers:{...n,"X-Device-Id":Xo(rt.DeviceId,"")||""}}),oM=()=>{const e=al();return am({mutationFn:t=>sM(t.rating,t.comment,Yi(e))})},aM=e=>{const t=al();return am({mutationFn:n=>Mr(`clients/${e}/chats/files`,{method:"POST",headers:Yi(t),body:P_({files:n},{arrayWithBracketAndIndex:!1,arrayWithBrackets:!1})})})};function lM(e){return e&&typeof e=="object"&&"file_urls"in e}const cM=e=>{const t=`${tb}/visitors/identify`,n=JSON.stringify(e);try{fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:n,keepalive:!0,credentials:"include"}).catch(()=>{if(navigator.sendBeacon){const r=new Blob([n],{type:"application/json"});navigator.sendBeacon(t,r)}})}catch{if(navigator.sendBeacon){const r=new Blob([n],{type:"application/json"});navigator.sendBeacon(t,r)}}},uM=(e,t)=>gb({queryKey:["visitors","history",e,t],queryFn:()=>Mr(`visitors/history?widget_id=${e}&device_id=${t}`),enabled:!!e&&!!t}),dM=(e,t,n)=>Mr(`visitors/chats/${e}/messages?widget_id=${t}&device_id=${n}`);async function fM(e){const[t,n]=await Mr(`widgets/${e}/agent`);return n===204?[null,n]:[t,n]}function us(e){this._maxSize=e,this.clear()}us.prototype.clear=function(){this._size=0,this._values=Object.create(null)};us.prototype.get=function(e){return this._values[e]};us.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var pM=/[^.^\]^[]+|(?=\[\]|\.\.)/g,lS=/^\d+$/,hM=/^\d/,mM=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,gM=/^\s*(['"]?)(.*?)(\1)\s*$/,Gm=512,g0=new us(Gm),v0=new us(Gm),y0=new us(Gm),Qi={Cache:us,split:Fp,normalizePath:Ud,setter:function(e){var t=Ud(e);return v0.get(e)||v0.set(e,function(r,i){for(var s=0,o=t.length,a=r;s<o-1;){var l=t[s];if(l==="__proto__"||l==="constructor"||l==="prototype")return r;a=a[t[s++]]}a[t[s]]=i})},getter:function(e,t){var n=Ud(e);return y0.get(e)||y0.set(e,function(i){for(var s=0,o=n.length;s<o;)if(i!=null||!t)i=i[n[s++]];else return;return i})},join:function(e){return e.reduce(function(t,n){return t+(Ym(n)||lS.test(n)?"["+n+"]":(t?".":"")+n)},"")},forEach:function(e,t,n){vM(Array.isArray(e)?e:Fp(e),t,n)}};function Ud(e){return g0.get(e)||g0.set(e,Fp(e).map(function(t){return t.replace(gM,"$2")}))}function Fp(e){return e.match(pM)||[""]}function vM(e,t,n){var r=e.length,i,s,o,a;for(s=0;s<r;s++)i=e[s],i&&(wM(i)&&(i='"'+i+'"'),a=Ym(i),o=!a&&/^\d+$/.test(i),t.call(n,i,a,o,s,e))}function Ym(e){return typeof e=="string"&&e&&["'",'"'].indexOf(e.charAt(0))!==-1}function yM(e){return e.match(hM)&&!e.match(lS)}function xM(e){return mM.test(e)}function wM(e){return!Ym(e)&&(yM(e)||xM(e))}const bM=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,Au=e=>e.match(bM)||[],Ru=e=>e[0].toUpperCase()+e.slice(1),Qm=(e,t)=>Au(e).join(t).toLowerCase(),cS=e=>Au(e).reduce((t,n)=>`${t}${t?n[0].toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()}`,""),kM=e=>Ru(cS(e)),SM=e=>Qm(e,"_"),CM=e=>Qm(e,"-"),TM=e=>Ru(Qm(e," ")),_M=e=>Au(e).map(Ru).join(" ");var Hd={words:Au,upperFirst:Ru,camelCase:cS,pascalCase:kM,snakeCase:SM,kebabCase:CM,sentenceCase:TM,titleCase:_M},Km={exports:{}};Km.exports=function(e){return uS(EM(e),e)};Km.exports.array=uS;function uS(e,t){var n=e.length,r=new Array(n),i={},s=n,o=jM(t),a=AM(e);for(t.forEach(function(c){if(!a.has(c[0])||!a.has(c[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});s--;)i[s]||l(e[s],s,new Set);return r;function l(c,d,u){if(u.has(c)){var p;try{p=", node was:"+JSON.stringify(c)}catch{p=""}throw new Error("Cyclic dependency"+p)}if(!a.has(c))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(c));if(!i[d]){i[d]=!0;var m=o.get(c)||new Set;if(m=Array.from(m),d=m.length){u.add(c);do{var y=m[--d];l(y,a.get(y),u)}while(d);u.delete(c)}r[--n]=c}}}function EM(e){for(var t=new Set,n=0,r=e.length;n<r;n++){var i=e[n];t.add(i[0]),t.add(i[1])}return Array.from(t)}function jM(e){for(var t=new Map,n=0,r=e.length;n<r;n++){var i=e[n];t.has(i[0])||t.set(i[0],new Set),t.has(i[1])||t.set(i[1],new Set),t.get(i[0]).add(i[1])}return t}function AM(e){for(var t=new Map,n=0,r=e.length;n<r;n++)t.set(e[n],n);return t}var RM=Km.exports;const PM=Rr(RM),MM=Object.prototype.toString,OM=Error.prototype.toString,NM=RegExp.prototype.toString,DM=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",IM=/^Symbol\((.*)\)(.*)$/;function LM(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function x0(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const n=typeof e;if(n==="number")return LM(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return DM.call(e).replace(IM,"Symbol($1)");const r=MM.call(e).slice(8,-1);return r==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):r==="Error"||e instanceof Error?"["+OM.call(e)+"]":r==="RegExp"?NM.call(e):null}function ci(e,t){let n=x0(e,t);return n!==null?n:JSON.stringify(e,function(r,i){let s=x0(this[r],t);return s!==null?s:i},2)}function dS(e){return e==null?[]:[].concat(e)}let fS,pS,hS,FM=/\$\{\s*(\w+)\s*\}/g;fS=Symbol.toStringTag;class w0{constructor(t,n,r,i){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[fS]="Error",this.name="ValidationError",this.value=n,this.path=r,this.type=i,this.errors=[],this.inner=[],dS(t).forEach(s=>{if(Wt.isError(s)){this.errors.push(...s.errors);const o=s.inner.length?s.inner:[s];this.inner.push(...o)}else this.errors.push(s)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}pS=Symbol.hasInstance;hS=Symbol.toStringTag;class Wt extends Error{static formatError(t,n){const r=n.label||n.path||"this";return n=Object.assign({},n,{path:r,originalPath:n.path}),typeof t=="string"?t.replace(FM,(i,s)=>ci(n[s])):typeof t=="function"?t(n):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,n,r,i,s){const o=new w0(t,n,r,i);if(s)return o;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[hS]="Error",this.name=o.name,this.message=o.message,this.type=o.type,this.value=o.value,this.path=o.path,this.errors=o.errors,this.inner=o.inner,Error.captureStackTrace&&Error.captureStackTrace(this,Wt)}static[pS](t){return w0[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let Yn={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:r})=>{const i=r!=null&&r!==n?` (cast from the value \`${ci(r,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${ci(n,!0)}\``+i:`${e} must match the configured type. The validated value was: \`${ci(n,!0)}\``+i}},$t={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},BM={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},Bp={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},$M={isValue:"${path} field must be ${value}"},ac={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},zM={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},VM={notType:e=>{const{path:t,value:n,spec:r}=e,i=r.types.length;if(Array.isArray(n)){if(n.length<i)return`${t} tuple value has too few items, expected a length of ${i} but got ${n.length} for value: \`${ci(n,!0)}\``;if(n.length>i)return`${t} tuple value has too many items, expected a length of ${i} but got ${n.length} for value: \`${ci(n,!0)}\``}return Wt.formatError(Yn.notType,e)}};Object.assign(Object.create(null),{mixed:Yn,string:$t,number:BM,date:Bp,object:ac,array:zM,boolean:$M,tuple:VM});const Xm=e=>e&&e.__isYupSchema__;class Yc{static fromOptions(t,n){if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:i,otherwise:s}=n,o=typeof r=="function"?r:(...a)=>a.every(l=>l===r);return new Yc(t,(a,l)=>{var c;let d=o(...a)?i:s;return(c=d==null?void 0:d(l))!=null?c:l})}constructor(t,n){this.fn=void 0,this.refs=t,this.refs=t,this.fn=n}resolve(t,n){let r=this.refs.map(s=>s.getValue(n==null?void 0:n.value,n==null?void 0:n.parent,n==null?void 0:n.context)),i=this.fn(r,t,n);if(i===void 0||i===t)return t;if(!Xm(i))throw new TypeError("conditions must return a schema object");return i.resolve(n)}}const Fl={context:"$",value:"."};class ds{constructor(t,n={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===Fl.context,this.isValue=this.key[0]===Fl.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?Fl.context:this.isValue?Fl.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&Qi.getter(this.path,!0),this.map=n.map}getValue(t,n,r){let i=this.isContext?r:this.isValue?t:n;return this.getter&&(i=this.getter(i||{})),this.map&&(i=this.map(i)),i}cast(t,n){return this.getValue(t,n==null?void 0:n.parent,n==null?void 0:n.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}ds.prototype.__isYupRef=!0;const Ii=e=>e==null;function bs(e){function t({value:n,path:r="",options:i,originalValue:s,schema:o},a,l){const{name:c,test:d,params:u,message:p,skipAbsent:m}=e;let{parent:y,context:w,abortEarly:x=o.spec.abortEarly,disableStackTrace:h=o.spec.disableStackTrace}=i;function g(N){return ds.isRef(N)?N.getValue(n,y,w):N}function k(N={}){const D=Object.assign({value:n,originalValue:s,label:o.spec.label,path:N.path||r,spec:o.spec,disableStackTrace:N.disableStackTrace||h},u,N.params);for(const B of Object.keys(D))D[B]=g(D[B]);const G=new Wt(Wt.formatError(N.message||p,D),n,D.path,N.type||c,D.disableStackTrace);return G.params=D,G}const C=x?a:l;let S={path:r,parent:y,type:c,from:i.from,createError:k,resolve:g,options:i,originalValue:s,schema:o};const T=N=>{Wt.isError(N)?C(N):N?l(null):C(k())},j=N=>{Wt.isError(N)?C(N):a(N)};if(m&&Ii(n))return T(!0);let A;try{var I;if(A=d.call(S,n,S),typeof((I=A)==null?void 0:I.then)=="function"){if(i.sync)throw new Error(`Validation test of type: "${S.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(A).then(T,j)}}catch(N){j(N);return}T(A)}return t.OPTIONS=e,t}function UM(e,t,n,r=n){let i,s,o;return t?(Qi.forEach(t,(a,l,c)=>{let d=l?a.slice(1,a.length-1):a;e=e.resolve({context:r,parent:i,value:n});let u=e.type==="tuple",p=c?parseInt(d,10):0;if(e.innerType||u){if(u&&!c)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${o}" must contain an index to the tuple element, e.g. "${o}[0]"`);if(n&&p>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${a}, in the path: ${t}. because there is no value at that index. `);i=n,n=n&&n[p],e=u?e.spec.types[p]:e.innerType}if(!c){if(!e.fields||!e.fields[d])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${o} which is a type: "${e.type}")`);i=n,n=n&&n[d],e=e.fields[d]}s=d,o=l?"["+a+"]":"."+a}),{schema:e,parent:i,parentPath:s}):{parent:i,parentPath:t,schema:e}}class Qc extends Set{describe(){const t=[];for(const n of this.values())t.push(ds.isRef(n)?n.describe():n);return t}resolveAll(t){let n=[];for(const r of this.values())n.push(t(r));return n}clone(){return new Qc(this.values())}merge(t,n){const r=this.clone();return t.forEach(i=>r.add(i)),n.forEach(i=>r.delete(i)),r}}function Bs(e,t=new Map){if(Xm(e)||!e||typeof e!="object")return e;if(t.has(e))return t.get(e);let n;if(e instanceof Date)n=new Date(e.getTime()),t.set(e,n);else if(e instanceof RegExp)n=new RegExp(e),t.set(e,n);else if(Array.isArray(e)){n=new Array(e.length),t.set(e,n);for(let r=0;r<e.length;r++)n[r]=Bs(e[r],t)}else if(e instanceof Map){n=new Map,t.set(e,n);for(const[r,i]of e.entries())n.set(r,Bs(i,t))}else if(e instanceof Set){n=new Set,t.set(e,n);for(const r of e)n.add(Bs(r,t))}else if(e instanceof Object){n={},t.set(e,n);for(const[r,i]of Object.entries(e))n[r]=Bs(i,t)}else throw Error(`Unable to clone ${e}`);return n}class lr{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new Qc,this._blacklist=new Qc,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Yn.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(n=>{n.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeCheck=this._typeCheck,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.internalTests=Object.assign({},this.internalTests),n.exclusiveTests=Object.assign({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=Bs(Object.assign({},this.spec,t)),n}label(t){let n=this.clone();return n.spec.label=t,n}meta(...t){if(t.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},t[0]),n}withMutation(t){let n=this._mutate;this._mutate=!0;let r=t(this);return this._mutate=n,r}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let n=this,r=t.clone();const i=Object.assign({},n.spec,r.spec);return r.spec=i,r.internalTests=Object.assign({},n.internalTests,r.internalTests),r._whitelist=n._whitelist.merge(t._whitelist,t._blacklist),r._blacklist=n._blacklist.merge(t._blacklist,t._whitelist),r.tests=n.tests,r.exclusiveTests=n.exclusiveTests,r.withMutation(s=>{t.tests.forEach(o=>{s.test(o.OPTIONS)})}),r.transforms=[...n.transforms,...r.transforms],r}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let n=this;if(n.conditions.length){let r=n.conditions;n=n.clone(),n.conditions=[],n=r.reduce((i,s)=>s.resolve(i,t),n),n=n.resolve(t)}return n}resolveOptions(t){var n,r,i,s;return Object.assign({},t,{from:t.from||[],strict:(n=t.strict)!=null?n:this.spec.strict,abortEarly:(r=t.abortEarly)!=null?r:this.spec.abortEarly,recursive:(i=t.recursive)!=null?i:this.spec.recursive,disableStackTrace:(s=t.disableStackTrace)!=null?s:this.spec.disableStackTrace})}cast(t,n={}){let r=this.resolve(Object.assign({value:t},n)),i=n.assert==="ignore-optionality",s=r._cast(t,n);if(n.assert!==!1&&!r.isType(s)){if(i&&Ii(s))return s;let o=ci(t),a=ci(s);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}".
|
|
86
|
+
*/var Nu=g,tM=eM;function nM(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var rM=typeof Object.is=="function"?Object.is:nM,iM=tM.useSyncExternalStore,sM=Nu.useRef,oM=Nu.useEffect,aM=Nu.useMemo,lM=Nu.useDebugValue;vS.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var s=sM(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=aM(function(){function l(h){if(!c){if(c=!0,d=h,h=r(h),i!==void 0&&o.hasValue){var y=o.value;if(i(y,h))return u=y}return u=h}if(y=u,rM(d,h))return y;var w=r(h);return i!==void 0&&i(y,w)?y:(d=h,u=w)}var c=!1,d,u,p=n===void 0?null:n;return[function(){return l(t())},p===null?void 0:function(){return l(p())}]},[t,n,r,i]);var a=iM(e,s[0],s[1]);return oM(function(){o.hasValue=!0,o.value=a},[a]),lM(a),a};gS.exports=vS;var cM=gS.exports;const uM=Pr(cM),wS={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},{useDebugValue:dM}=ee,{useSyncExternalStoreWithSelector:fM}=uM;let k0=!1;const pM=e=>e;function hM(e,t=pM,n){(wS?"production":void 0)!=="production"&&n&&!k0&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),k0=!0);const r=fM(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return dM(r),r}const S0=e=>{(wS?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?HP(e):e,n=(r,i)=>hM(t,r,i);return Object.assign(n,t),n},mM=e=>e?S0(e):S0,ne=mM(e=>({widget:null,open:localStorage.getItem("lc:widget:isHaveChat")==="true",isInputFocused:!1,isHaveChat:localStorage.getItem("lc:widget:isHaveChat")==="true",defaultValues:{},soundPath:void 0,isTooltipVisible:!0,onTooltipClose:void 0,anyAdmin:!0,showActionButtons:!1,setIsTooltipVisible:t=>e({isTooltipVisible:t}),setOnTooltipClose:t=>e({onTooltipClose:t}),setOpen:t=>{e({open:t})},setAnyAdmin:t=>e({anyAdmin:t}),setWidget:t=>e({widget:t}),setDefaultValues:t=>e({defaultValues:t}),setIsHaveChat:t=>{var n;if(e({isHaveChat:t}),localStorage.setItem("lc:widget:isHaveChat",t.toString()),!t){e({showActionButtons:!1});const r=(n=ne.getState().widget)==null?void 0:n.link_id;r&&localStorage.setItem(`${r}:showActionButtons`,"false")}},setSoundPath:t=>{e({soundPath:t})},onOpen:void 0,onClose:void 0,setOnOpen:t=>e({onOpen:t}),setOnClose:t=>e({onClose:t}),setIsInputFocused:t=>e({isInputFocused:t}),historyChat:null,setHistoryChat:t=>e({historyChat:t}),historyMessages:null,setHistoryMessages:t=>e({historyMessages:t}),showHistoryOnRegistration:!1,setShowHistoryOnRegistration:t=>e({showHistoryOnRegistration:t}),aiAgent:null,setAIAgent:t=>e(n=>{var i;const r=(i=n.widget)==null?void 0:i.link_id;return r&&Vl(r,t,n.isAIAgentMode,n.aiAgentSessionId,n.humanNeedRequested),{aiAgent:t}}),isAIAgentMode:!1,setIsAIAgentMode:t=>e(n=>{var i;const r=(i=n.widget)==null?void 0:i.link_id;return r&&Vl(r,n.aiAgent,t,n.aiAgentSessionId,n.humanNeedRequested),{isAIAgentMode:t}}),aiAgentSessionId:null,setAIAgentSessionId:t=>e(n=>{var i;const r=(i=n.widget)==null?void 0:i.link_id;return r&&Vl(r,n.aiAgent,n.isAIAgentMode,t,n.humanNeedRequested),{aiAgentSessionId:t}}),humanNeedRequested:!1,setHumanNeedRequested:t=>e(n=>{var i;const r=(i=n.widget)==null?void 0:i.link_id;if(r){const s=`${r}:`;t?localStorage.setItem(`${s}${rt.HumanNeedRequested}`,"true"):localStorage.removeItem(`${s}${rt.HumanNeedRequested}`),n.aiAgent&&n.isAIAgentMode&&Vl(r,n.aiAgent,n.isAIAgentMode,n.aiAgentSessionId,t)}return{humanNeedRequested:t}}),aiAgentMessages:[],setAIAgentMessages:t=>e(n=>({aiAgentMessages:typeof t=="function"?t(n.aiAgentMessages):t})),addAIAgentMessage:t=>e(n=>({aiAgentMessages:[...n.aiAgentMessages,t]})),clearAIAgentState:()=>e(t=>{var r;const n=(r=t.widget)==null?void 0:r.link_id;return n&&Zm(n),{aiAgent:null,isAIAgentMode:!1,aiAgentSessionId:null,humanNeedRequested:!1,aiAgentMessages:[],connectingToOperator:!1,showOperatorForm:!1}}),connectingToOperator:!1,setConnectingToOperator:t=>e({connectingToOperator:t}),showOperatorForm:!1,setShowOperatorForm:t=>e({showOperatorForm:t}),setShowActionButtons:t=>e(n=>{var i;const r=(i=n.widget)==null?void 0:i.link_id;return r&&localStorage.setItem(`${r}:showActionButtons`,t.toString()),{showActionButtons:t}})})),gM=e=>({accessToken:localStorage.getItem(`${e}:${rt.CustomerToken}`)||"",refreshToken:localStorage.getItem(`${e}:${rt.CustomerRefreshToken}`)||""}),fl=()=>{const{widget:e}=ne();return e?gM(e.link_id):null},Yi=e=>{if(!e)return{};const{accessToken:t,refreshToken:n}=e,r={};return t&&(r["X-Customer-Token"]=t),n&&(r["X-Customer-Refresh-Token"]=n),{...r}},Qs=e=>{const t=document.cookie.split(";").find(n=>n.includes(e));return t?t.split("=")[1]:null},vM=e=>na(rt.DeviceId,e)||Qs("device_id")||Rr(e),Qi=(e,t)=>({...e,"X-Device-Id":vM(t)});function Up(e){return e&&typeof e=="object"&&"customer_token"in e&&"customer_refresh_token"in e}const Jm=()=>hm({mutationFn:e=>Nr(`clients/${e.client_id}/chats`,{method:"POST",body:JSON.stringify({inputs:e.inputs,client_id:void 0,widget_id:e.widget_id,history:e.history,device_id:e.device_id,is_agent_mode:e.is_agent_mode,widget_version:"2026.01.05-1"})})}),yM=(e,t)=>Nr(`clients/${e}/chats`,{headers:t}),dc=(e,t)=>Nr(`clients/${e}/chats`,{method:"DELETE",headers:t}),xM=(e,t,n,r)=>Nr("review",{method:"POST",body:JSON.stringify({rating:e,comment:t||void 0}),headers:Qi(n??{},r)}),wM=()=>{const e=fl(),{widget:t}=ne(),n=(t==null?void 0:t.link_id)??"";return hm({mutationFn:r=>xM(r.rating,r.comment,Yi(e),n)})},bM=e=>{const t=fl(),{widget:n}=ne(),r=(n==null?void 0:n.link_id)??"";return hm({mutationFn:i=>Nr(`clients/${e}/chats/files`,{method:"POST",headers:Qi(Yi(t),r),body:HT({files:i},{arrayWithBracketAndIndex:!1,arrayWithBrackets:!1})})})};function kM(e){return e&&typeof e=="object"&&"file_urls"in e}const SM=e=>{const t=`${hb}/visitors/identify`,n=JSON.stringify(e);try{fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:n,keepalive:!0,credentials:"include"}).catch(()=>{if(navigator.sendBeacon){const r=new Blob([n],{type:"application/json"});navigator.sendBeacon(t,r)}})}catch{if(navigator.sendBeacon){const r=new Blob([n],{type:"application/json"});navigator.sendBeacon(t,r)}}},CM=(e,t)=>jb({queryKey:["visitors","history",e,t],queryFn:()=>Nr(`visitors/history?widget_id=${e}&device_id=${t}`),enabled:!!e&&!!t}),_M=(e,t,n)=>Nr(`visitors/chats/${e}/messages?widget_id=${t}&device_id=${n}`);async function TM(e){const[t,n]=await Nr(`widgets/${e}/agent`);return n===204?[null,n]:[t,n]}function ds(e){this._maxSize=e,this.clear()}ds.prototype.clear=function(){this._size=0,this._values=Object.create(null)};ds.prototype.get=function(e){return this._values[e]};ds.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var EM=/[^.^\]^[]+|(?=\[\]|\.\.)/g,bS=/^\d+$/,AM=/^\d/,jM=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,RM=/^\s*(['"]?)(.*?)(\1)\s*$/,eg=512,C0=new ds(eg),_0=new ds(eg),T0=new ds(eg),Ki={Cache:ds,split:Hp,normalizePath:Yd,setter:function(e){var t=Yd(e);return _0.get(e)||_0.set(e,function(r,i){for(var s=0,o=t.length,a=r;s<o-1;){var l=t[s];if(l==="__proto__"||l==="constructor"||l==="prototype")return r;a=a[t[s++]]}a[t[s]]=i})},getter:function(e,t){var n=Yd(e);return T0.get(e)||T0.set(e,function(i){for(var s=0,o=n.length;s<o;)if(i!=null||!t)i=i[n[s++]];else return;return i})},join:function(e){return e.reduce(function(t,n){return t+(tg(n)||bS.test(n)?"["+n+"]":(t?".":"")+n)},"")},forEach:function(e,t,n){PM(Array.isArray(e)?e:Hp(e),t,n)}};function Yd(e){return C0.get(e)||C0.set(e,Hp(e).map(function(t){return t.replace(RM,"$2")}))}function Hp(e){return e.match(EM)||[""]}function PM(e,t,n){var r=e.length,i,s,o,a;for(s=0;s<r;s++)i=e[s],i&&(OM(i)&&(i='"'+i+'"'),a=tg(i),o=!a&&/^\d+$/.test(i),t.call(n,i,a,o,s,e))}function tg(e){return typeof e=="string"&&e&&["'",'"'].indexOf(e.charAt(0))!==-1}function MM(e){return e.match(AM)&&!e.match(bS)}function NM(e){return jM.test(e)}function OM(e){return!tg(e)&&(MM(e)||NM(e))}const DM=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,Ou=e=>e.match(DM)||[],Du=e=>e[0].toUpperCase()+e.slice(1),ng=(e,t)=>Ou(e).join(t).toLowerCase(),kS=e=>Ou(e).reduce((t,n)=>`${t}${t?n[0].toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()}`,""),IM=e=>Du(kS(e)),LM=e=>ng(e,"_"),FM=e=>ng(e,"-"),$M=e=>Du(ng(e," ")),BM=e=>Ou(e).map(Du).join(" ");var Qd={words:Ou,upperFirst:Du,camelCase:kS,pascalCase:IM,snakeCase:LM,kebabCase:FM,sentenceCase:$M,titleCase:BM},rg={exports:{}};rg.exports=function(e){return SS(zM(e),e)};rg.exports.array=SS;function SS(e,t){var n=e.length,r=new Array(n),i={},s=n,o=VM(t),a=UM(e);for(t.forEach(function(c){if(!a.has(c[0])||!a.has(c[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});s--;)i[s]||l(e[s],s,new Set);return r;function l(c,d,u){if(u.has(c)){var p;try{p=", node was:"+JSON.stringify(c)}catch{p=""}throw new Error("Cyclic dependency"+p)}if(!a.has(c))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(c));if(!i[d]){i[d]=!0;var h=o.get(c)||new Set;if(h=Array.from(h),d=h.length){u.add(c);do{var y=h[--d];l(y,a.get(y),u)}while(d);u.delete(c)}r[--n]=c}}}function zM(e){for(var t=new Set,n=0,r=e.length;n<r;n++){var i=e[n];t.add(i[0]),t.add(i[1])}return Array.from(t)}function VM(e){for(var t=new Map,n=0,r=e.length;n<r;n++){var i=e[n];t.has(i[0])||t.set(i[0],new Set),t.has(i[1])||t.set(i[1],new Set),t.get(i[0]).add(i[1])}return t}function UM(e){for(var t=new Map,n=0,r=e.length;n<r;n++)t.set(e[n],n);return t}var HM=rg.exports;const WM=Pr(HM),qM=Object.prototype.toString,GM=Error.prototype.toString,YM=RegExp.prototype.toString,QM=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",KM=/^Symbol\((.*)\)(.*)$/;function XM(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function E0(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const n=typeof e;if(n==="number")return XM(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return QM.call(e).replace(KM,"Symbol($1)");const r=qM.call(e).slice(8,-1);return r==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):r==="Error"||e instanceof Error?"["+GM.call(e)+"]":r==="RegExp"?YM.call(e):null}function ui(e,t){let n=E0(e,t);return n!==null?n:JSON.stringify(e,function(r,i){let s=E0(this[r],t);return s!==null?s:i},2)}function CS(e){return e==null?[]:[].concat(e)}let _S,TS,ES,ZM=/\$\{\s*(\w+)\s*\}/g;_S=Symbol.toStringTag;class A0{constructor(t,n,r,i){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[_S]="Error",this.name="ValidationError",this.value=n,this.path=r,this.type=i,this.errors=[],this.inner=[],CS(t).forEach(s=>{if(Wt.isError(s)){this.errors.push(...s.errors);const o=s.inner.length?s.inner:[s];this.inner.push(...o)}else this.errors.push(s)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}TS=Symbol.hasInstance;ES=Symbol.toStringTag;class Wt extends Error{static formatError(t,n){const r=n.label||n.path||"this";return n=Object.assign({},n,{path:r,originalPath:n.path}),typeof t=="string"?t.replace(ZM,(i,s)=>ui(n[s])):typeof t=="function"?t(n):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,n,r,i,s){const o=new A0(t,n,r,i);if(s)return o;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[ES]="Error",this.name=o.name,this.message=o.message,this.type=o.type,this.value=o.value,this.path=o.path,this.errors=o.errors,this.inner=o.inner,Error.captureStackTrace&&Error.captureStackTrace(this,Wt)}static[TS](t){return A0[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let Qn={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:r})=>{const i=r!=null&&r!==n?` (cast from the value \`${ui(r,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${ui(n,!0)}\``+i:`${e} must match the configured type. The validated value was: \`${ui(n,!0)}\``+i}},Bt={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},JM={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},Wp={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},eN={isValue:"${path} field must be ${value}"},fc={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},tN={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},nN={notType:e=>{const{path:t,value:n,spec:r}=e,i=r.types.length;if(Array.isArray(n)){if(n.length<i)return`${t} tuple value has too few items, expected a length of ${i} but got ${n.length} for value: \`${ui(n,!0)}\``;if(n.length>i)return`${t} tuple value has too many items, expected a length of ${i} but got ${n.length} for value: \`${ui(n,!0)}\``}return Wt.formatError(Qn.notType,e)}};Object.assign(Object.create(null),{mixed:Qn,string:Bt,number:JM,date:Wp,object:fc,array:tN,boolean:eN,tuple:nN});const ig=e=>e&&e.__isYupSchema__;class Jc{static fromOptions(t,n){if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:i,otherwise:s}=n,o=typeof r=="function"?r:(...a)=>a.every(l=>l===r);return new Jc(t,(a,l)=>{var c;let d=o(...a)?i:s;return(c=d==null?void 0:d(l))!=null?c:l})}constructor(t,n){this.fn=void 0,this.refs=t,this.refs=t,this.fn=n}resolve(t,n){let r=this.refs.map(s=>s.getValue(n==null?void 0:n.value,n==null?void 0:n.parent,n==null?void 0:n.context)),i=this.fn(r,t,n);if(i===void 0||i===t)return t;if(!ig(i))throw new TypeError("conditions must return a schema object");return i.resolve(n)}}const Ul={context:"$",value:"."};class fs{constructor(t,n={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===Ul.context,this.isValue=this.key[0]===Ul.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?Ul.context:this.isValue?Ul.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&Ki.getter(this.path,!0),this.map=n.map}getValue(t,n,r){let i=this.isContext?r:this.isValue?t:n;return this.getter&&(i=this.getter(i||{})),this.map&&(i=this.map(i)),i}cast(t,n){return this.getValue(t,n==null?void 0:n.parent,n==null?void 0:n.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}fs.prototype.__isYupRef=!0;const Ii=e=>e==null;function ks(e){function t({value:n,path:r="",options:i,originalValue:s,schema:o},a,l){const{name:c,test:d,params:u,message:p,skipAbsent:h}=e;let{parent:y,context:w,abortEarly:b=o.spec.abortEarly,disableStackTrace:m=o.spec.disableStackTrace}=i;function v(L){return fs.isRef(L)?L.getValue(n,y,w):L}function x(L={}){const O=Object.assign({value:n,originalValue:s,label:o.spec.label,path:L.path||r,spec:o.spec,disableStackTrace:L.disableStackTrace||m},u,L.params);for(const $ of Object.keys(O))O[$]=v(O[$]);const q=new Wt(Wt.formatError(L.message||p,O),n,O.path,L.type||c,O.disableStackTrace);return q.params=O,q}const S=b?a:l;let C={path:r,parent:y,type:c,from:i.from,createError:x,resolve:v,options:i,originalValue:s,schema:o};const _=L=>{Wt.isError(L)?S(L):L?l(null):S(x())},j=L=>{Wt.isError(L)?S(L):a(L)};if(h&&Ii(n))return _(!0);let E;try{var D;if(E=d.call(C,n,C),typeof((D=E)==null?void 0:D.then)=="function"){if(i.sync)throw new Error(`Validation test of type: "${C.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(E).then(_,j)}}catch(L){j(L);return}_(E)}return t.OPTIONS=e,t}function rN(e,t,n,r=n){let i,s,o;return t?(Ki.forEach(t,(a,l,c)=>{let d=l?a.slice(1,a.length-1):a;e=e.resolve({context:r,parent:i,value:n});let u=e.type==="tuple",p=c?parseInt(d,10):0;if(e.innerType||u){if(u&&!c)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${o}" must contain an index to the tuple element, e.g. "${o}[0]"`);if(n&&p>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${a}, in the path: ${t}. because there is no value at that index. `);i=n,n=n&&n[p],e=u?e.spec.types[p]:e.innerType}if(!c){if(!e.fields||!e.fields[d])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${o} which is a type: "${e.type}")`);i=n,n=n&&n[d],e=e.fields[d]}s=d,o=l?"["+a+"]":"."+a}),{schema:e,parent:i,parentPath:s}):{parent:i,parentPath:t,schema:e}}class eu extends Set{describe(){const t=[];for(const n of this.values())t.push(fs.isRef(n)?n.describe():n);return t}resolveAll(t){let n=[];for(const r of this.values())n.push(t(r));return n}clone(){return new eu(this.values())}merge(t,n){const r=this.clone();return t.forEach(i=>r.add(i)),n.forEach(i=>r.delete(i)),r}}function Bs(e,t=new Map){if(ig(e)||!e||typeof e!="object")return e;if(t.has(e))return t.get(e);let n;if(e instanceof Date)n=new Date(e.getTime()),t.set(e,n);else if(e instanceof RegExp)n=new RegExp(e),t.set(e,n);else if(Array.isArray(e)){n=new Array(e.length),t.set(e,n);for(let r=0;r<e.length;r++)n[r]=Bs(e[r],t)}else if(e instanceof Map){n=new Map,t.set(e,n);for(const[r,i]of e.entries())n.set(r,Bs(i,t))}else if(e instanceof Set){n=new Set,t.set(e,n);for(const r of e)n.add(Bs(r,t))}else if(e instanceof Object){n={},t.set(e,n);for(const[r,i]of Object.entries(e))n[r]=Bs(i,t)}else throw Error(`Unable to clone ${e}`);return n}class lr{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new eu,this._blacklist=new eu,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Qn.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(n=>{n.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeCheck=this._typeCheck,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.internalTests=Object.assign({},this.internalTests),n.exclusiveTests=Object.assign({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=Bs(Object.assign({},this.spec,t)),n}label(t){let n=this.clone();return n.spec.label=t,n}meta(...t){if(t.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},t[0]),n}withMutation(t){let n=this._mutate;this._mutate=!0;let r=t(this);return this._mutate=n,r}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let n=this,r=t.clone();const i=Object.assign({},n.spec,r.spec);return r.spec=i,r.internalTests=Object.assign({},n.internalTests,r.internalTests),r._whitelist=n._whitelist.merge(t._whitelist,t._blacklist),r._blacklist=n._blacklist.merge(t._blacklist,t._whitelist),r.tests=n.tests,r.exclusiveTests=n.exclusiveTests,r.withMutation(s=>{t.tests.forEach(o=>{s.test(o.OPTIONS)})}),r.transforms=[...n.transforms,...r.transforms],r}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let n=this;if(n.conditions.length){let r=n.conditions;n=n.clone(),n.conditions=[],n=r.reduce((i,s)=>s.resolve(i,t),n),n=n.resolve(t)}return n}resolveOptions(t){var n,r,i,s;return Object.assign({},t,{from:t.from||[],strict:(n=t.strict)!=null?n:this.spec.strict,abortEarly:(r=t.abortEarly)!=null?r:this.spec.abortEarly,recursive:(i=t.recursive)!=null?i:this.spec.recursive,disableStackTrace:(s=t.disableStackTrace)!=null?s:this.spec.disableStackTrace})}cast(t,n={}){let r=this.resolve(Object.assign({value:t},n)),i=n.assert==="ignore-optionality",s=r._cast(t,n);if(n.assert!==!1&&!r.isType(s)){if(i&&Ii(s))return s;let o=ui(t),a=ui(s);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}".
|
|
87
87
|
|
|
88
88
|
attempted value: ${o}
|
|
89
|
-
`+(a!==o?`result of cast: ${a}`:""))}return s}_cast(t,n){let r=t===void 0?t:this.transforms.reduce((i,s)=>s.call(this,i,t,this),t);return r===void 0&&(r=this.getDefault(n)),r}_validate(t,n={},r,i){let{path:s,originalValue:o=t,strict:a=this.spec.strict}=n,l=t;a||(l=this._cast(l,Object.assign({assert:!1},n)));let c=[];for(let d of Object.values(this.internalTests))d&&c.push(d);this.runTests({path:s,value:l,originalValue:o,options:n,tests:c},r,d=>{if(d.length)return i(d,l);this.runTests({path:s,value:l,originalValue:o,options:n,tests:this.tests},r,i)})}runTests(t,n,r){let i=!1,{tests:s,value:o,originalValue:a,path:l,options:c}=t,d=w=>{i||(i=!0,n(w,o))},u=w=>{i||(i=!0,r(w,o))},p=s.length,m=[];if(!p)return u([]);let y={value:o,originalValue:a,path:l,options:c,schema:this};for(let w=0;w<s.length;w++){const x=s[w];x(y,d,function(g){g&&(Array.isArray(g)?m.push(...g):m.push(g)),--p<=0&&u(m)})}}asNestedTest({key:t,index:n,parent:r,parentPath:i,originalParent:s,options:o}){const a=t??n;if(a==null)throw TypeError("Must include `key` or `index` for nested validations");const l=typeof a=="number";let c=r[a];const d=Object.assign({},o,{strict:!0,parent:r,value:c,originalValue:s[a],key:void 0,[l?"index":"key"]:a,path:l||a.includes(".")?`${i||""}[${l?a:`"${a}"`}]`:(i?`${i}.`:"")+t});return(u,p,m)=>this.resolve(d)._validate(c,d,p,m)}validate(t,n){var r;let i=this.resolve(Object.assign({},n,{value:t})),s=(r=n==null?void 0:n.disableStackTrace)!=null?r:i.spec.disableStackTrace;return new Promise((o,a)=>i._validate(t,n,(l,c)=>{Wt.isError(l)&&(l.value=c),a(l)},(l,c)=>{l.length?a(new Wt(l,c,void 0,void 0,s)):o(c)}))}validateSync(t,n){var r;let i=this.resolve(Object.assign({},n,{value:t})),s,o=(r=n==null?void 0:n.disableStackTrace)!=null?r:i.spec.disableStackTrace;return i._validate(t,Object.assign({},n,{sync:!0}),(a,l)=>{throw Wt.isError(a)&&(a.value=l),a},(a,l)=>{if(a.length)throw new Wt(a,t,void 0,void 0,o);s=l}),s}isValid(t,n){return this.validate(t,n).then(()=>!0,r=>{if(Wt.isError(r))return!1;throw r})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(r){if(Wt.isError(r))return!1;throw r}}_getDefault(t){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,t):Bs(n)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,n){const r=this.clone({nullable:t});return r.internalTests.nullable=bs({message:n,name:"nullable",test(i){return i===null?this.schema.spec.nullable:!0}}),r}optionality(t,n){const r=this.clone({optional:t});return r.internalTests.optionality=bs({message:n,name:"optionality",test(i){return i===void 0?this.schema.spec.optional:!0}}),r}optional(){return this.optionality(!0)}defined(t=Yn.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=Yn.notNull){return this.nullability(!1,t)}required(t=Yn.required){return this.clone().withMutation(n=>n.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let n=this.clone();return n.transforms.push(t),n}test(...t){let n;if(t.length===1?typeof t[0]=="function"?n={test:t[0]}:n=t[0]:t.length===2?n={name:t[0],test:t[1]}:n={name:t[0],message:t[1],test:t[2]},n.message===void 0&&(n.message=Yn.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),i=bs(n),s=n.exclusive||n.name&&r.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(r.exclusiveTests[n.name]=!!n.exclusive),r.tests=r.tests.filter(o=>!(o.OPTIONS.name===n.name&&(s||o.OPTIONS.test===i.OPTIONS.test))),r.tests.push(i),r}when(t,n){!Array.isArray(t)&&typeof t!="string"&&(n=t,t=".");let r=this.clone(),i=dS(t).map(s=>new ds(s));return i.forEach(s=>{s.isSibling&&r.deps.push(s.key)}),r.conditions.push(typeof n=="function"?new Yc(i,n):Yc.fromOptions(i,n)),r}typeError(t){let n=this.clone();return n.internalTests.typeError=bs({message:t,name:"typeError",skipAbsent:!0,test(r){return this.schema._typeCheck(r)?!0:this.createError({params:{type:this.schema.type}})}}),n}oneOf(t,n=Yn.oneOf){let r=this.clone();return t.forEach(i=>{r._whitelist.add(i),r._blacklist.delete(i)}),r.internalTests.whiteList=bs({message:n,name:"oneOf",skipAbsent:!0,test(i){let s=this.schema._whitelist,o=s.resolveAll(this.resolve);return o.includes(i)?!0:this.createError({params:{values:Array.from(s).join(", "),resolved:o}})}}),r}notOneOf(t,n=Yn.notOneOf){let r=this.clone();return t.forEach(i=>{r._blacklist.add(i),r._whitelist.delete(i)}),r.internalTests.blacklist=bs({message:n,name:"notOneOf",test(i){let s=this.schema._blacklist,o=s.resolveAll(this.resolve);return o.includes(i)?this.createError({params:{values:Array.from(s).join(", "),resolved:o}}):!0}}),r}strip(t=!0){let n=this.clone();return n.spec.strip=t,n}describe(t){const n=(t?this.resolve(t):this).clone(),{label:r,meta:i,optional:s,nullable:o}=n.spec;return{meta:i,label:r,optional:s,nullable:o,default:n.getDefault(t),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.map(l=>({name:l.OPTIONS.name,params:l.OPTIONS.params})).filter((l,c,d)=>d.findIndex(u=>u.name===l.name)===c)}}}lr.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])lr.prototype[`${e}At`]=function(t,n,r={}){const{parent:i,parentPath:s,schema:o}=UM(this,t,n,r.context);return o[e](i&&i[s],Object.assign({},r,{parent:i,path:t}))};for(const e of["equals","is"])lr.prototype[e]=lr.prototype.oneOf;for(const e of["not","nope"])lr.prototype[e]=lr.prototype.notOneOf;const HM=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function WM(e){const t=$p(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(t.z===void 0&&t.plusMinus===void 0)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let n=0;return t.z!=="Z"&&t.plusMinus!==void 0&&(n=t.hourOffset*60+t.minuteOffset,t.plusMinus==="+"&&(n=0-n)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+n,t.second,t.millisecond)}function $p(e){var t,n;const r=HM.exec(e);return r?{year:pr(r[1]),month:pr(r[2],1)-1,day:pr(r[3],1),hour:pr(r[4]),minute:pr(r[5]),second:pr(r[6]),millisecond:r[7]?pr(r[7].substring(0,3)):0,precision:(t=(n=r[7])==null?void 0:n.length)!=null?t:void 0,z:r[8]||void 0,plusMinus:r[9]||void 0,hourOffset:pr(r[10]),minuteOffset:pr(r[11])}:null}function pr(e,t=0){return Number(e)||t}let qM=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,GM=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,YM=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,QM="^\\d{4}-\\d{2}-\\d{2}",KM="\\d{2}:\\d{2}:\\d{2}",XM="(([+-]\\d{2}(:?\\d{2})?)|Z)",ZM=new RegExp(`${QM}T${KM}(\\.\\d+)?${XM}$`),JM=e=>Ii(e)||e===e.trim(),eO={}.toString();function Kc(){return new mS}class mS extends lr{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(!r.spec.coerce||r.isType(t)||Array.isArray(t))return t;const i=t!=null&&t.toString?t.toString():t;return i===eO?t:i})})}required(t){return super.required(t).withMutation(n=>n.test({message:t||Yn.required,name:"required",skipAbsent:!0,test:r=>!!r.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(n=>n.OPTIONS.name!=="required"),t))}length(t,n=$t.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(r){return r.length===this.resolve(t)}})}min(t,n=$t.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r.length>=this.resolve(t)}})}max(t,n=$t.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:t},skipAbsent:!0,test(r){return r.length<=this.resolve(t)}})}matches(t,n){let r=!1,i,s;return n&&(typeof n=="object"?{excludeEmptyString:r=!1,message:i,name:s}=n:i=n),this.test({name:s||"matches",message:i||$t.matches,params:{regex:t},skipAbsent:!0,test:o=>o===""&&r||o.search(t)!==-1})}email(t=$t.email){return this.matches(qM,{name:"email",message:t,excludeEmptyString:!0})}url(t=$t.url){return this.matches(GM,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=$t.uuid){return this.matches(YM,{name:"uuid",message:t,excludeEmptyString:!1})}datetime(t){let n="",r,i;return t&&(typeof t=="object"?{message:n="",allowOffset:r=!1,precision:i=void 0}=t:n=t),this.matches(ZM,{name:"datetime",message:n||$t.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||$t.datetime_offset,params:{allowOffset:r},skipAbsent:!0,test:s=>{if(!s||r)return!0;const o=$p(s);return o?!!o.z:!1}}).test({name:"datetime_precision",message:n||$t.datetime_precision,params:{precision:i},skipAbsent:!0,test:s=>{if(!s||i==null)return!0;const o=$p(s);return o?o.precision===i:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=$t.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:JM})}lowercase(t=$t.lowercase){return this.transform(n=>Ii(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Ii(n)||n===n.toLowerCase()})}uppercase(t=$t.uppercase){return this.transform(n=>Ii(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Ii(n)||n===n.toUpperCase()})}}Kc.prototype=mS.prototype;let tO=new Date(""),nO=e=>Object.prototype.toString.call(e)==="[object Date]";class Pu extends lr{constructor(){super({type:"date",check(t){return nO(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,n,r)=>!r.spec.coerce||r.isType(t)||t===null?t:(t=WM(t),isNaN(t)?Pu.INVALID_DATE:new Date(t)))})}prepareParam(t,n){let r;if(ds.isRef(t))r=t;else{let i=this.cast(t);if(!this._typeCheck(i))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);r=i}return r}min(t,n=Bp.min){let r=this.prepareParam(t,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(i){return i>=this.resolve(r)}})}max(t,n=Bp.max){let r=this.prepareParam(t,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(i){return i<=this.resolve(r)}})}}Pu.INVALID_DATE=tO;Pu.prototype;function rO(e,t=[]){let n=[],r=new Set,i=new Set(t.map(([o,a])=>`${o}-${a}`));function s(o,a){let l=Qi.split(o)[0];r.add(l),i.has(`${a}-${l}`)||n.push([a,l])}for(const o of Object.keys(e)){let a=e[o];r.add(o),ds.isRef(a)&&a.isSibling?s(a.path,o):Xm(a)&&"deps"in a&&a.deps.forEach(l=>s(l,o))}return PM.array(Array.from(r),n).reverse()}function b0(e,t){let n=1/0;return e.some((r,i)=>{var s;if((s=t.path)!=null&&s.includes(r))return n=i,!0}),n}function gS(e){return(t,n)=>b0(e,t)-b0(e,n)}const iO=(e,t,n)=>{if(typeof e!="string")return e;let r=e;try{r=JSON.parse(e)}catch{}return n.isType(r)?r:e};function lc(e){if("fields"in e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=lc(r);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=lc(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(lc)}):"optional"in e?e.optional():e}const sO=(e,t)=>{const n=[...Qi.normalizePath(t)];if(n.length===1)return n[0]in e;let r=n.pop(),i=Qi.getter(Qi.join(n),!0)(e);return!!(i&&r in i)};let k0=e=>Object.prototype.toString.call(e)==="[object Object]";function S0(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(r=>n.indexOf(r)===-1)}const oO=gS([]);function Zm(e){return new vS(e)}class vS extends lr{constructor(t){super({type:"object",check(n){return k0(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=oO,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,n={}){var r;let i=super._cast(t,n);if(i===void 0)return this.getDefault(n);if(!this._typeCheck(i))return i;let s=this.fields,o=(r=n.stripUnknown)!=null?r:this.spec.noUnknown,a=[].concat(this._nodes,Object.keys(i).filter(u=>!this._nodes.includes(u))),l={},c=Object.assign({},n,{parent:l,__validating:n.__validating||!1}),d=!1;for(const u of a){let p=s[u],m=u in i;if(p){let y,w=i[u];c.path=(n.path?`${n.path}.`:"")+u,p=p.resolve({value:w,context:n.context,parent:l});let x=p instanceof lr?p.spec:void 0,h=x==null?void 0:x.strict;if(x!=null&&x.strip){d=d||u in i;continue}y=!n.__validating||!h?p.cast(i[u],c):i[u],y!==void 0&&(l[u]=y)}else m&&!o&&(l[u]=i[u]);(m!==u in l||l[u]!==i[u])&&(d=!0)}return d?l:i}_validate(t,n={},r,i){let{from:s=[],originalValue:o=t,recursive:a=this.spec.recursive}=n;n.from=[{schema:this,value:o},...s],n.__validating=!0,n.originalValue=o,super._validate(t,n,r,(l,c)=>{if(!a||!k0(c)){i(l,c);return}o=o||c;let d=[];for(let u of this._nodes){let p=this.fields[u];!p||ds.isRef(p)||d.push(p.asNestedTest({options:n,key:u,parent:c,parentPath:n.path,originalParent:o}))}this.runTests({tests:d,value:c,originalValue:o,options:n},r,u=>{i(u.sort(this._sortErrors).concat(l),c)})})}clone(t){const n=super.clone(t);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(t){let n=super.concat(t),r=n.fields;for(let[i,s]of Object.entries(this.fields)){const o=r[i];r[i]=o===void 0?s:o}return n.withMutation(i=>i.setFields(r,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let n={};return this._nodes.forEach(r=>{var i;const s=this.fields[r];let o=t;(i=o)!=null&&i.value&&(o=Object.assign({},o,{parent:o.value,value:o.value[r]})),n[r]=s&&"getDefault"in s?s.getDefault(o):void 0}),n}setFields(t,n){let r=this.clone();return r.fields=t,r._nodes=rO(t,n),r._sortErrors=gS(Object.keys(t)),n&&(r._excludedEdges=n),r}shape(t,n=[]){return this.clone().withMutation(r=>{let i=r._excludedEdges;return n.length&&(Array.isArray(n[0])||(n=[n]),i=[...r._excludedEdges,...n]),r.setFields(Object.assign(r.fields,t),i)})}partial(){const t={};for(const[n,r]of Object.entries(this.fields))t[n]="optional"in r&&r.optional instanceof Function?r.optional():r;return this.setFields(t)}deepPartial(){return lc(this)}pick(t){const n={};for(const r of t)this.fields[r]&&(n[r]=this.fields[r]);return this.setFields(n,this._excludedEdges.filter(([r,i])=>t.includes(r)&&t.includes(i)))}omit(t){const n=[];for(const r of Object.keys(this.fields))t.includes(r)||n.push(r);return this.pick(n)}from(t,n,r){let i=Qi.getter(t,!0);return this.transform(s=>{if(!s)return s;let o=s;return sO(s,t)&&(o=Object.assign({},s),r||delete o[t],o[n]=i(s)),o})}json(){return this.transform(iO)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||ac.exact,test(n){if(n==null)return!0;const r=S0(this.schema,n);return r.length===0||this.createError({params:{properties:r.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,n=ac.noUnknown){typeof t!="boolean"&&(n=t,t=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:n,test(i){if(i==null)return!0;const s=S0(this.schema,i);return!t||s.length===0||this.createError({params:{unknown:s.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,n=ac.noUnknown){return this.noUnknown(!t,n)}transformKeys(t){return this.transform(n=>{if(!n)return n;const r={};for(const i of Object.keys(n))r[t(i)]=n[i];return r})}camelCase(){return this.transformKeys(Hd.camelCase)}snakeCase(){return this.transformKeys(Hd.snakeCase)}constantCase(){return this.transformKeys(t=>Hd.snakeCase(t).toUpperCase())}describe(t){const n=(t?this.resolve(t):this).clone(),r=super.describe(t);r.fields={};for(const[s,o]of Object.entries(n.fields)){var i;let a=t;(i=a)!=null&&i.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[s]})),r.fields[s]=o.describe(a)}return r}}Zm.prototype=vS.prototype;var aO=function(t){return lO(t)&&!cO(t)};function lO(e){return!!e&&typeof e=="object"}function cO(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||fO(e)}var uO=typeof Symbol=="function"&&Symbol.for,dO=uO?Symbol.for("react.element"):60103;function fO(e){return e.$$typeof===dO}function pO(e){return Array.isArray(e)?[]:{}}function Xc(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Ha(pO(e),e,t):e}function hO(e,t,n){return e.concat(t).map(function(r){return Xc(r,n)})}function mO(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(i){r[i]=Xc(e[i],n)}),Object.keys(t).forEach(function(i){!n.isMergeableObject(t[i])||!e[i]?r[i]=Xc(t[i],n):r[i]=Ha(e[i],t[i],n)}),r}function Ha(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||hO,n.isMergeableObject=n.isMergeableObject||aO;var r=Array.isArray(t),i=Array.isArray(e),s=r===i;return s?r?n.arrayMerge(e,t,n):mO(e,t,n):Xc(t,n)}Ha.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,i){return Ha(r,i,n)},{})};var zp=Ha,yS=typeof global=="object"&&global&&global.Object===Object&&global,gO=typeof self=="object"&&self&&self.Object===Object&&self,ur=yS||gO||Function("return this")(),gi=ur.Symbol,xS=Object.prototype,vO=xS.hasOwnProperty,yO=xS.toString,Vo=gi?gi.toStringTag:void 0;function xO(e){var t=vO.call(e,Vo),n=e[Vo];try{e[Vo]=void 0;var r=!0}catch{}var i=yO.call(e);return r&&(t?e[Vo]=n:delete e[Vo]),i}var wO=Object.prototype,bO=wO.toString;function kO(e){return bO.call(e)}var SO="[object Null]",CO="[object Undefined]",C0=gi?gi.toStringTag:void 0;function fs(e){return e==null?e===void 0?CO:SO:C0&&C0 in Object(e)?xO(e):kO(e)}function wS(e,t){return function(n){return e(t(n))}}var Jm=wS(Object.getPrototypeOf,Object);function ps(e){return e!=null&&typeof e=="object"}var TO="[object Object]",_O=Function.prototype,EO=Object.prototype,bS=_O.toString,jO=EO.hasOwnProperty,AO=bS.call(Object);function T0(e){if(!ps(e)||fs(e)!=TO)return!1;var t=Jm(e);if(t===null)return!0;var n=jO.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&bS.call(n)==AO}function RO(){this.__data__=[],this.size=0}function kS(e,t){return e===t||e!==e&&t!==t}function Mu(e,t){for(var n=e.length;n--;)if(kS(e[n][0],t))return n;return-1}var PO=Array.prototype,MO=PO.splice;function OO(e){var t=this.__data__,n=Mu(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():MO.call(t,n,1),--this.size,!0}function NO(e){var t=this.__data__,n=Mu(t,e);return n<0?void 0:t[n][1]}function DO(e){return Mu(this.__data__,e)>-1}function IO(e,t){var n=this.__data__,r=Mu(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Or(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Or.prototype.clear=RO;Or.prototype.delete=OO;Or.prototype.get=NO;Or.prototype.has=DO;Or.prototype.set=IO;function LO(){this.__data__=new Or,this.size=0}function FO(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function BO(e){return this.__data__.get(e)}function $O(e){return this.__data__.has(e)}function ll(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var zO="[object AsyncFunction]",VO="[object Function]",UO="[object GeneratorFunction]",HO="[object Proxy]";function SS(e){if(!ll(e))return!1;var t=fs(e);return t==VO||t==UO||t==zO||t==HO}var Wd=ur["__core-js_shared__"],_0=function(){var e=/[^.]+$/.exec(Wd&&Wd.keys&&Wd.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function WO(e){return!!_0&&_0 in e}var qO=Function.prototype,GO=qO.toString;function hs(e){if(e!=null){try{return GO.call(e)}catch{}try{return e+""}catch{}}return""}var YO=/[\\^$.*+?()[\]{}|]/g,QO=/^\[object .+?Constructor\]$/,KO=Function.prototype,XO=Object.prototype,ZO=KO.toString,JO=XO.hasOwnProperty,eN=RegExp("^"+ZO.call(JO).replace(YO,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function tN(e){if(!ll(e)||WO(e))return!1;var t=SS(e)?eN:QO;return t.test(hs(e))}function nN(e,t){return e==null?void 0:e[t]}function ms(e,t){var n=nN(e,t);return tN(n)?n:void 0}var Wa=ms(ur,"Map"),qa=ms(Object,"create");function rN(){this.__data__=qa?qa(null):{},this.size=0}function iN(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var sN="__lodash_hash_undefined__",oN=Object.prototype,aN=oN.hasOwnProperty;function lN(e){var t=this.__data__;if(qa){var n=t[e];return n===sN?void 0:n}return aN.call(t,e)?t[e]:void 0}var cN=Object.prototype,uN=cN.hasOwnProperty;function dN(e){var t=this.__data__;return qa?t[e]!==void 0:uN.call(t,e)}var fN="__lodash_hash_undefined__";function pN(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=qa&&t===void 0?fN:t,this}function is(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}is.prototype.clear=rN;is.prototype.delete=iN;is.prototype.get=lN;is.prototype.has=dN;is.prototype.set=pN;function hN(){this.size=0,this.__data__={hash:new is,map:new(Wa||Or),string:new is}}function mN(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Ou(e,t){var n=e.__data__;return mN(t)?n[typeof t=="string"?"string":"hash"]:n.map}function gN(e){var t=Ou(this,e).delete(e);return this.size-=t?1:0,t}function vN(e){return Ou(this,e).get(e)}function yN(e){return Ou(this,e).has(e)}function xN(e,t){var n=Ou(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function bi(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}bi.prototype.clear=hN;bi.prototype.delete=gN;bi.prototype.get=vN;bi.prototype.has=yN;bi.prototype.set=xN;var wN=200;function bN(e,t){var n=this.__data__;if(n instanceof Or){var r=n.__data__;if(!Wa||r.length<wN-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new bi(r)}return n.set(e,t),this.size=n.size,this}function Ao(e){var t=this.__data__=new Or(e);this.size=t.size}Ao.prototype.clear=LO;Ao.prototype.delete=FO;Ao.prototype.get=BO;Ao.prototype.has=$O;Ao.prototype.set=bN;function kN(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var E0=function(){try{var e=ms(Object,"defineProperty");return e({},"",{}),e}catch{}}();function CS(e,t,n){t=="__proto__"&&E0?E0(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var SN=Object.prototype,CN=SN.hasOwnProperty;function TS(e,t,n){var r=e[t];(!(CN.call(e,t)&&kS(r,n))||n===void 0&&!(t in e))&&CS(e,t,n)}function Nu(e,t,n,r){var i=!n;n||(n={});for(var s=-1,o=t.length;++s<o;){var a=t[s],l=void 0;l===void 0&&(l=e[a]),i?CS(n,a,l):TS(n,a,l)}return n}function TN(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var _N="[object Arguments]";function j0(e){return ps(e)&&fs(e)==_N}var _S=Object.prototype,EN=_S.hasOwnProperty,jN=_S.propertyIsEnumerable,AN=j0(function(){return arguments}())?j0:function(e){return ps(e)&&EN.call(e,"callee")&&!jN.call(e,"callee")},cl=Array.isArray;function RN(){return!1}var ES=typeof nn=="object"&&nn&&!nn.nodeType&&nn,A0=ES&&typeof rn=="object"&&rn&&!rn.nodeType&&rn,PN=A0&&A0.exports===ES,R0=PN?ur.Buffer:void 0,MN=R0?R0.isBuffer:void 0,jS=MN||RN,ON=9007199254740991,NN=/^(?:0|[1-9]\d*)$/;function DN(e,t){var n=typeof e;return t=t??ON,!!t&&(n=="number"||n!="symbol"&&NN.test(e))&&e>-1&&e%1==0&&e<t}var IN=9007199254740991;function AS(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=IN}var LN="[object Arguments]",FN="[object Array]",BN="[object Boolean]",$N="[object Date]",zN="[object Error]",VN="[object Function]",UN="[object Map]",HN="[object Number]",WN="[object Object]",qN="[object RegExp]",GN="[object Set]",YN="[object String]",QN="[object WeakMap]",KN="[object ArrayBuffer]",XN="[object DataView]",ZN="[object Float32Array]",JN="[object Float64Array]",e4="[object Int8Array]",t4="[object Int16Array]",n4="[object Int32Array]",r4="[object Uint8Array]",i4="[object Uint8ClampedArray]",s4="[object Uint16Array]",o4="[object Uint32Array]",Be={};Be[ZN]=Be[JN]=Be[e4]=Be[t4]=Be[n4]=Be[r4]=Be[i4]=Be[s4]=Be[o4]=!0;Be[LN]=Be[FN]=Be[KN]=Be[BN]=Be[XN]=Be[$N]=Be[zN]=Be[VN]=Be[UN]=Be[HN]=Be[WN]=Be[qN]=Be[GN]=Be[YN]=Be[QN]=!1;function a4(e){return ps(e)&&AS(e.length)&&!!Be[fs(e)]}function eg(e){return function(t){return e(t)}}var RS=typeof nn=="object"&&nn&&!nn.nodeType&&nn,pa=RS&&typeof rn=="object"&&rn&&!rn.nodeType&&rn,l4=pa&&pa.exports===RS,qd=l4&&yS.process,yo=function(){try{var e=pa&&pa.require&&pa.require("util").types;return e||qd&&qd.binding&&qd.binding("util")}catch{}}(),P0=yo&&yo.isTypedArray,c4=P0?eg(P0):a4,u4=Object.prototype,d4=u4.hasOwnProperty;function PS(e,t){var n=cl(e),r=!n&&AN(e),i=!n&&!r&&jS(e),s=!n&&!r&&!i&&c4(e),o=n||r||i||s,a=o?TN(e.length,String):[],l=a.length;for(var c in e)(t||d4.call(e,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||DN(c,l)))&&a.push(c);return a}var f4=Object.prototype;function tg(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||f4;return e===n}var p4=wS(Object.keys,Object),h4=Object.prototype,m4=h4.hasOwnProperty;function g4(e){if(!tg(e))return p4(e);var t=[];for(var n in Object(e))m4.call(e,n)&&n!="constructor"&&t.push(n);return t}function MS(e){return e!=null&&AS(e.length)&&!SS(e)}function ng(e){return MS(e)?PS(e):g4(e)}function v4(e,t){return e&&Nu(t,ng(t),e)}function y4(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var x4=Object.prototype,w4=x4.hasOwnProperty;function b4(e){if(!ll(e))return y4(e);var t=tg(e),n=[];for(var r in e)r=="constructor"&&(t||!w4.call(e,r))||n.push(r);return n}function rg(e){return MS(e)?PS(e,!0):b4(e)}function k4(e,t){return e&&Nu(t,rg(t),e)}var OS=typeof nn=="object"&&nn&&!nn.nodeType&&nn,M0=OS&&typeof rn=="object"&&rn&&!rn.nodeType&&rn,S4=M0&&M0.exports===OS,O0=S4?ur.Buffer:void 0,N0=O0?O0.allocUnsafe:void 0;function C4(e,t){if(t)return e.slice();var n=e.length,r=N0?N0(n):new e.constructor(n);return e.copy(r),r}function NS(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}function T4(e,t){for(var n=-1,r=e==null?0:e.length,i=0,s=[];++n<r;){var o=e[n];t(o,n,e)&&(s[i++]=o)}return s}function DS(){return[]}var _4=Object.prototype,E4=_4.propertyIsEnumerable,D0=Object.getOwnPropertySymbols,ig=D0?function(e){return e==null?[]:(e=Object(e),T4(D0(e),function(t){return E4.call(e,t)}))}:DS;function j4(e,t){return Nu(e,ig(e),t)}function IS(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var A4=Object.getOwnPropertySymbols,LS=A4?function(e){for(var t=[];e;)IS(t,ig(e)),e=Jm(e);return t}:DS;function R4(e,t){return Nu(e,LS(e),t)}function FS(e,t,n){var r=t(e);return cl(e)?r:IS(r,n(e))}function P4(e){return FS(e,ng,ig)}function M4(e){return FS(e,rg,LS)}var Vp=ms(ur,"DataView"),Up=ms(ur,"Promise"),Hp=ms(ur,"Set"),Wp=ms(ur,"WeakMap"),I0="[object Map]",O4="[object Object]",L0="[object Promise]",F0="[object Set]",B0="[object WeakMap]",$0="[object DataView]",N4=hs(Vp),D4=hs(Wa),I4=hs(Up),L4=hs(Hp),F4=hs(Wp),yr=fs;(Vp&&yr(new Vp(new ArrayBuffer(1)))!=$0||Wa&&yr(new Wa)!=I0||Up&&yr(Up.resolve())!=L0||Hp&&yr(new Hp)!=F0||Wp&&yr(new Wp)!=B0)&&(yr=function(e){var t=fs(e),n=t==O4?e.constructor:void 0,r=n?hs(n):"";if(r)switch(r){case N4:return $0;case D4:return I0;case I4:return L0;case L4:return F0;case F4:return B0}return t});var B4=Object.prototype,$4=B4.hasOwnProperty;function z4(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&$4.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var z0=ur.Uint8Array;function sg(e){var t=new e.constructor(e.byteLength);return new z0(t).set(new z0(e)),t}function V4(e,t){var n=t?sg(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var U4=/\w*$/;function H4(e){var t=new e.constructor(e.source,U4.exec(e));return t.lastIndex=e.lastIndex,t}var V0=gi?gi.prototype:void 0,U0=V0?V0.valueOf:void 0;function W4(e){return U0?Object(U0.call(e)):{}}function q4(e,t){var n=t?sg(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var G4="[object Boolean]",Y4="[object Date]",Q4="[object Map]",K4="[object Number]",X4="[object RegExp]",Z4="[object Set]",J4="[object String]",eD="[object Symbol]",tD="[object ArrayBuffer]",nD="[object DataView]",rD="[object Float32Array]",iD="[object Float64Array]",sD="[object Int8Array]",oD="[object Int16Array]",aD="[object Int32Array]",lD="[object Uint8Array]",cD="[object Uint8ClampedArray]",uD="[object Uint16Array]",dD="[object Uint32Array]";function fD(e,t,n){var r=e.constructor;switch(t){case tD:return sg(e);case G4:case Y4:return new r(+e);case nD:return V4(e,n);case rD:case iD:case sD:case oD:case aD:case lD:case cD:case uD:case dD:return q4(e,n);case Q4:return new r;case K4:case J4:return new r(e);case X4:return H4(e);case Z4:return new r;case eD:return W4(e)}}var H0=Object.create,pD=function(){function e(){}return function(t){if(!ll(t))return{};if(H0)return H0(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function hD(e){return typeof e.constructor=="function"&&!tg(e)?pD(Jm(e)):{}}var mD="[object Map]";function gD(e){return ps(e)&&yr(e)==mD}var W0=yo&&yo.isMap,vD=W0?eg(W0):gD,yD="[object Set]";function xD(e){return ps(e)&&yr(e)==yD}var q0=yo&&yo.isSet,wD=q0?eg(q0):xD,bD=1,kD=2,SD=4,BS="[object Arguments]",CD="[object Array]",TD="[object Boolean]",_D="[object Date]",ED="[object Error]",$S="[object Function]",jD="[object GeneratorFunction]",AD="[object Map]",RD="[object Number]",zS="[object Object]",PD="[object RegExp]",MD="[object Set]",OD="[object String]",ND="[object Symbol]",DD="[object WeakMap]",ID="[object ArrayBuffer]",LD="[object DataView]",FD="[object Float32Array]",BD="[object Float64Array]",$D="[object Int8Array]",zD="[object Int16Array]",VD="[object Int32Array]",UD="[object Uint8Array]",HD="[object Uint8ClampedArray]",WD="[object Uint16Array]",qD="[object Uint32Array]",De={};De[BS]=De[CD]=De[ID]=De[LD]=De[TD]=De[_D]=De[FD]=De[BD]=De[$D]=De[zD]=De[VD]=De[AD]=De[RD]=De[zS]=De[PD]=De[MD]=De[OD]=De[ND]=De[UD]=De[HD]=De[WD]=De[qD]=!0;De[ED]=De[$S]=De[DD]=!1;function ha(e,t,n,r,i,s){var o,a=t&bD,l=t&kD,c=t&SD;if(o!==void 0)return o;if(!ll(e))return e;var d=cl(e);if(d){if(o=z4(e),!a)return NS(e,o)}else{var u=yr(e),p=u==$S||u==jD;if(jS(e))return C4(e,a);if(u==zS||u==BS||p&&!i){if(o=l||p?{}:hD(e),!a)return l?R4(e,k4(o,e)):j4(e,v4(o,e))}else{if(!De[u])return i?e:{};o=fD(e,u,a)}}s||(s=new Ao);var m=s.get(e);if(m)return m;s.set(e,o),wD(e)?e.forEach(function(x){o.add(ha(x,t,n,x,e,s))}):vD(e)&&e.forEach(function(x,h){o.set(h,ha(x,t,n,h,e,s))});var y=c?l?M4:P4:l?rg:ng,w=d?void 0:y(e);return kN(w||e,function(x,h){w&&(h=x,x=e[h]),TS(o,h,ha(x,t,n,h,e,s))}),o}var GD=1,YD=4;function Bl(e){return ha(e,GD|YD)}var G0=Array.isArray,Y0=Object.keys,QD=Object.prototype.hasOwnProperty,KD=typeof Element<"u";function qp(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=G0(e),r=G0(t),i,s,o;if(n&&r){if(s=e.length,s!=t.length)return!1;for(i=s;i--!==0;)if(!qp(e[i],t[i]))return!1;return!0}if(n!=r)return!1;var a=e instanceof Date,l=t instanceof Date;if(a!=l)return!1;if(a&&l)return e.getTime()==t.getTime();var c=e instanceof RegExp,d=t instanceof RegExp;if(c!=d)return!1;if(c&&d)return e.toString()==t.toString();var u=Y0(e);if(s=u.length,s!==Y0(t).length)return!1;for(i=s;i--!==0;)if(!QD.call(t,u[i]))return!1;if(KD&&e instanceof Element&&t instanceof Element)return e===t;for(i=s;i--!==0;)if(o=u[i],!(o==="_owner"&&e.$$typeof)&&!qp(e[o],t[o]))return!1;return!0}return e!==e&&t!==t}var XD=function(t,n){try{return qp(t,n)}catch(r){if(r.message&&r.message.match(/stack|recursion/i)||r.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",r.name,r.message),!1;throw r}};const Ai=Rr(XD);var ZD=4;function Q0(e){return ha(e,ZD)}function VS(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var JD="[object Symbol]";function og(e){return typeof e=="symbol"||ps(e)&&fs(e)==JD}var eI="Expected a function";function ag(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(eI);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var o=e.apply(this,r);return n.cache=s.set(i,o)||s,o};return n.cache=new(ag.Cache||bi),n}ag.Cache=bi;var tI=500;function nI(e){var t=ag(e,function(r){return n.size===tI&&n.clear(),r}),n=t.cache;return t}var rI=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,iI=/\\(\\)?/g,sI=nI(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(rI,function(n,r,i,s){t.push(i?s.replace(iI,"$1"):r||n)}),t}),oI=1/0;function aI(e){if(typeof e=="string"||og(e))return e;var t=e+"";return t=="0"&&1/e==-oI?"-0":t}var lI=1/0,K0=gi?gi.prototype:void 0,X0=K0?K0.toString:void 0;function US(e){if(typeof e=="string")return e;if(cl(e))return VS(e,US)+"";if(og(e))return X0?X0.call(e):"";var t=e+"";return t=="0"&&1/e==-lI?"-0":t}function cI(e){return e==null?"":US(e)}function HS(e){return cl(e)?VS(e,aI):og(e)?[e]:NS(sI(cI(e)))}var WS={exports:{}},Me={};/** @license React v16.13.1
|
|
89
|
+
`+(a!==o?`result of cast: ${a}`:""))}return s}_cast(t,n){let r=t===void 0?t:this.transforms.reduce((i,s)=>s.call(this,i,t,this),t);return r===void 0&&(r=this.getDefault(n)),r}_validate(t,n={},r,i){let{path:s,originalValue:o=t,strict:a=this.spec.strict}=n,l=t;a||(l=this._cast(l,Object.assign({assert:!1},n)));let c=[];for(let d of Object.values(this.internalTests))d&&c.push(d);this.runTests({path:s,value:l,originalValue:o,options:n,tests:c},r,d=>{if(d.length)return i(d,l);this.runTests({path:s,value:l,originalValue:o,options:n,tests:this.tests},r,i)})}runTests(t,n,r){let i=!1,{tests:s,value:o,originalValue:a,path:l,options:c}=t,d=w=>{i||(i=!0,n(w,o))},u=w=>{i||(i=!0,r(w,o))},p=s.length,h=[];if(!p)return u([]);let y={value:o,originalValue:a,path:l,options:c,schema:this};for(let w=0;w<s.length;w++){const b=s[w];b(y,d,function(v){v&&(Array.isArray(v)?h.push(...v):h.push(v)),--p<=0&&u(h)})}}asNestedTest({key:t,index:n,parent:r,parentPath:i,originalParent:s,options:o}){const a=t??n;if(a==null)throw TypeError("Must include `key` or `index` for nested validations");const l=typeof a=="number";let c=r[a];const d=Object.assign({},o,{strict:!0,parent:r,value:c,originalValue:s[a],key:void 0,[l?"index":"key"]:a,path:l||a.includes(".")?`${i||""}[${l?a:`"${a}"`}]`:(i?`${i}.`:"")+t});return(u,p,h)=>this.resolve(d)._validate(c,d,p,h)}validate(t,n){var r;let i=this.resolve(Object.assign({},n,{value:t})),s=(r=n==null?void 0:n.disableStackTrace)!=null?r:i.spec.disableStackTrace;return new Promise((o,a)=>i._validate(t,n,(l,c)=>{Wt.isError(l)&&(l.value=c),a(l)},(l,c)=>{l.length?a(new Wt(l,c,void 0,void 0,s)):o(c)}))}validateSync(t,n){var r;let i=this.resolve(Object.assign({},n,{value:t})),s,o=(r=n==null?void 0:n.disableStackTrace)!=null?r:i.spec.disableStackTrace;return i._validate(t,Object.assign({},n,{sync:!0}),(a,l)=>{throw Wt.isError(a)&&(a.value=l),a},(a,l)=>{if(a.length)throw new Wt(a,t,void 0,void 0,o);s=l}),s}isValid(t,n){return this.validate(t,n).then(()=>!0,r=>{if(Wt.isError(r))return!1;throw r})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(r){if(Wt.isError(r))return!1;throw r}}_getDefault(t){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,t):Bs(n)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,n){const r=this.clone({nullable:t});return r.internalTests.nullable=ks({message:n,name:"nullable",test(i){return i===null?this.schema.spec.nullable:!0}}),r}optionality(t,n){const r=this.clone({optional:t});return r.internalTests.optionality=ks({message:n,name:"optionality",test(i){return i===void 0?this.schema.spec.optional:!0}}),r}optional(){return this.optionality(!0)}defined(t=Qn.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=Qn.notNull){return this.nullability(!1,t)}required(t=Qn.required){return this.clone().withMutation(n=>n.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let n=this.clone();return n.transforms.push(t),n}test(...t){let n;if(t.length===1?typeof t[0]=="function"?n={test:t[0]}:n=t[0]:t.length===2?n={name:t[0],test:t[1]}:n={name:t[0],message:t[1],test:t[2]},n.message===void 0&&(n.message=Qn.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),i=ks(n),s=n.exclusive||n.name&&r.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(r.exclusiveTests[n.name]=!!n.exclusive),r.tests=r.tests.filter(o=>!(o.OPTIONS.name===n.name&&(s||o.OPTIONS.test===i.OPTIONS.test))),r.tests.push(i),r}when(t,n){!Array.isArray(t)&&typeof t!="string"&&(n=t,t=".");let r=this.clone(),i=CS(t).map(s=>new fs(s));return i.forEach(s=>{s.isSibling&&r.deps.push(s.key)}),r.conditions.push(typeof n=="function"?new Jc(i,n):Jc.fromOptions(i,n)),r}typeError(t){let n=this.clone();return n.internalTests.typeError=ks({message:t,name:"typeError",skipAbsent:!0,test(r){return this.schema._typeCheck(r)?!0:this.createError({params:{type:this.schema.type}})}}),n}oneOf(t,n=Qn.oneOf){let r=this.clone();return t.forEach(i=>{r._whitelist.add(i),r._blacklist.delete(i)}),r.internalTests.whiteList=ks({message:n,name:"oneOf",skipAbsent:!0,test(i){let s=this.schema._whitelist,o=s.resolveAll(this.resolve);return o.includes(i)?!0:this.createError({params:{values:Array.from(s).join(", "),resolved:o}})}}),r}notOneOf(t,n=Qn.notOneOf){let r=this.clone();return t.forEach(i=>{r._blacklist.add(i),r._whitelist.delete(i)}),r.internalTests.blacklist=ks({message:n,name:"notOneOf",test(i){let s=this.schema._blacklist,o=s.resolveAll(this.resolve);return o.includes(i)?this.createError({params:{values:Array.from(s).join(", "),resolved:o}}):!0}}),r}strip(t=!0){let n=this.clone();return n.spec.strip=t,n}describe(t){const n=(t?this.resolve(t):this).clone(),{label:r,meta:i,optional:s,nullable:o}=n.spec;return{meta:i,label:r,optional:s,nullable:o,default:n.getDefault(t),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.map(l=>({name:l.OPTIONS.name,params:l.OPTIONS.params})).filter((l,c,d)=>d.findIndex(u=>u.name===l.name)===c)}}}lr.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])lr.prototype[`${e}At`]=function(t,n,r={}){const{parent:i,parentPath:s,schema:o}=rN(this,t,n,r.context);return o[e](i&&i[s],Object.assign({},r,{parent:i,path:t}))};for(const e of["equals","is"])lr.prototype[e]=lr.prototype.oneOf;for(const e of["not","nope"])lr.prototype[e]=lr.prototype.notOneOf;const iN=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function sN(e){const t=qp(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(t.z===void 0&&t.plusMinus===void 0)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let n=0;return t.z!=="Z"&&t.plusMinus!==void 0&&(n=t.hourOffset*60+t.minuteOffset,t.plusMinus==="+"&&(n=0-n)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+n,t.second,t.millisecond)}function qp(e){var t,n;const r=iN.exec(e);return r?{year:pr(r[1]),month:pr(r[2],1)-1,day:pr(r[3],1),hour:pr(r[4]),minute:pr(r[5]),second:pr(r[6]),millisecond:r[7]?pr(r[7].substring(0,3)):0,precision:(t=(n=r[7])==null?void 0:n.length)!=null?t:void 0,z:r[8]||void 0,plusMinus:r[9]||void 0,hourOffset:pr(r[10]),minuteOffset:pr(r[11])}:null}function pr(e,t=0){return Number(e)||t}let oN=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,aN=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,lN=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,cN="^\\d{4}-\\d{2}-\\d{2}",uN="\\d{2}:\\d{2}:\\d{2}",dN="(([+-]\\d{2}(:?\\d{2})?)|Z)",fN=new RegExp(`${cN}T${uN}(\\.\\d+)?${dN}$`),pN=e=>Ii(e)||e===e.trim(),hN={}.toString();function tu(){return new AS}class AS extends lr{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(!r.spec.coerce||r.isType(t)||Array.isArray(t))return t;const i=t!=null&&t.toString?t.toString():t;return i===hN?t:i})})}required(t){return super.required(t).withMutation(n=>n.test({message:t||Qn.required,name:"required",skipAbsent:!0,test:r=>!!r.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(n=>n.OPTIONS.name!=="required"),t))}length(t,n=Bt.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(r){return r.length===this.resolve(t)}})}min(t,n=Bt.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r.length>=this.resolve(t)}})}max(t,n=Bt.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:t},skipAbsent:!0,test(r){return r.length<=this.resolve(t)}})}matches(t,n){let r=!1,i,s;return n&&(typeof n=="object"?{excludeEmptyString:r=!1,message:i,name:s}=n:i=n),this.test({name:s||"matches",message:i||Bt.matches,params:{regex:t},skipAbsent:!0,test:o=>o===""&&r||o.search(t)!==-1})}email(t=Bt.email){return this.matches(oN,{name:"email",message:t,excludeEmptyString:!0})}url(t=Bt.url){return this.matches(aN,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=Bt.uuid){return this.matches(lN,{name:"uuid",message:t,excludeEmptyString:!1})}datetime(t){let n="",r,i;return t&&(typeof t=="object"?{message:n="",allowOffset:r=!1,precision:i=void 0}=t:n=t),this.matches(fN,{name:"datetime",message:n||Bt.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||Bt.datetime_offset,params:{allowOffset:r},skipAbsent:!0,test:s=>{if(!s||r)return!0;const o=qp(s);return o?!!o.z:!1}}).test({name:"datetime_precision",message:n||Bt.datetime_precision,params:{precision:i},skipAbsent:!0,test:s=>{if(!s||i==null)return!0;const o=qp(s);return o?o.precision===i:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=Bt.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:pN})}lowercase(t=Bt.lowercase){return this.transform(n=>Ii(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Ii(n)||n===n.toLowerCase()})}uppercase(t=Bt.uppercase){return this.transform(n=>Ii(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Ii(n)||n===n.toUpperCase()})}}tu.prototype=AS.prototype;let mN=new Date(""),gN=e=>Object.prototype.toString.call(e)==="[object Date]";class Iu extends lr{constructor(){super({type:"date",check(t){return gN(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,n,r)=>!r.spec.coerce||r.isType(t)||t===null?t:(t=sN(t),isNaN(t)?Iu.INVALID_DATE:new Date(t)))})}prepareParam(t,n){let r;if(fs.isRef(t))r=t;else{let i=this.cast(t);if(!this._typeCheck(i))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);r=i}return r}min(t,n=Wp.min){let r=this.prepareParam(t,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(i){return i>=this.resolve(r)}})}max(t,n=Wp.max){let r=this.prepareParam(t,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(i){return i<=this.resolve(r)}})}}Iu.INVALID_DATE=mN;Iu.prototype;function vN(e,t=[]){let n=[],r=new Set,i=new Set(t.map(([o,a])=>`${o}-${a}`));function s(o,a){let l=Ki.split(o)[0];r.add(l),i.has(`${a}-${l}`)||n.push([a,l])}for(const o of Object.keys(e)){let a=e[o];r.add(o),fs.isRef(a)&&a.isSibling?s(a.path,o):ig(a)&&"deps"in a&&a.deps.forEach(l=>s(l,o))}return WM.array(Array.from(r),n).reverse()}function j0(e,t){let n=1/0;return e.some((r,i)=>{var s;if((s=t.path)!=null&&s.includes(r))return n=i,!0}),n}function jS(e){return(t,n)=>j0(e,t)-j0(e,n)}const yN=(e,t,n)=>{if(typeof e!="string")return e;let r=e;try{r=JSON.parse(e)}catch{}return n.isType(r)?r:e};function pc(e){if("fields"in e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=pc(r);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=pc(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(pc)}):"optional"in e?e.optional():e}const xN=(e,t)=>{const n=[...Ki.normalizePath(t)];if(n.length===1)return n[0]in e;let r=n.pop(),i=Ki.getter(Ki.join(n),!0)(e);return!!(i&&r in i)};let R0=e=>Object.prototype.toString.call(e)==="[object Object]";function P0(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(r=>n.indexOf(r)===-1)}const wN=jS([]);function sg(e){return new RS(e)}class RS extends lr{constructor(t){super({type:"object",check(n){return R0(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=wN,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,n={}){var r;let i=super._cast(t,n);if(i===void 0)return this.getDefault(n);if(!this._typeCheck(i))return i;let s=this.fields,o=(r=n.stripUnknown)!=null?r:this.spec.noUnknown,a=[].concat(this._nodes,Object.keys(i).filter(u=>!this._nodes.includes(u))),l={},c=Object.assign({},n,{parent:l,__validating:n.__validating||!1}),d=!1;for(const u of a){let p=s[u],h=u in i;if(p){let y,w=i[u];c.path=(n.path?`${n.path}.`:"")+u,p=p.resolve({value:w,context:n.context,parent:l});let b=p instanceof lr?p.spec:void 0,m=b==null?void 0:b.strict;if(b!=null&&b.strip){d=d||u in i;continue}y=!n.__validating||!m?p.cast(i[u],c):i[u],y!==void 0&&(l[u]=y)}else h&&!o&&(l[u]=i[u]);(h!==u in l||l[u]!==i[u])&&(d=!0)}return d?l:i}_validate(t,n={},r,i){let{from:s=[],originalValue:o=t,recursive:a=this.spec.recursive}=n;n.from=[{schema:this,value:o},...s],n.__validating=!0,n.originalValue=o,super._validate(t,n,r,(l,c)=>{if(!a||!R0(c)){i(l,c);return}o=o||c;let d=[];for(let u of this._nodes){let p=this.fields[u];!p||fs.isRef(p)||d.push(p.asNestedTest({options:n,key:u,parent:c,parentPath:n.path,originalParent:o}))}this.runTests({tests:d,value:c,originalValue:o,options:n},r,u=>{i(u.sort(this._sortErrors).concat(l),c)})})}clone(t){const n=super.clone(t);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(t){let n=super.concat(t),r=n.fields;for(let[i,s]of Object.entries(this.fields)){const o=r[i];r[i]=o===void 0?s:o}return n.withMutation(i=>i.setFields(r,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let n={};return this._nodes.forEach(r=>{var i;const s=this.fields[r];let o=t;(i=o)!=null&&i.value&&(o=Object.assign({},o,{parent:o.value,value:o.value[r]})),n[r]=s&&"getDefault"in s?s.getDefault(o):void 0}),n}setFields(t,n){let r=this.clone();return r.fields=t,r._nodes=vN(t,n),r._sortErrors=jS(Object.keys(t)),n&&(r._excludedEdges=n),r}shape(t,n=[]){return this.clone().withMutation(r=>{let i=r._excludedEdges;return n.length&&(Array.isArray(n[0])||(n=[n]),i=[...r._excludedEdges,...n]),r.setFields(Object.assign(r.fields,t),i)})}partial(){const t={};for(const[n,r]of Object.entries(this.fields))t[n]="optional"in r&&r.optional instanceof Function?r.optional():r;return this.setFields(t)}deepPartial(){return pc(this)}pick(t){const n={};for(const r of t)this.fields[r]&&(n[r]=this.fields[r]);return this.setFields(n,this._excludedEdges.filter(([r,i])=>t.includes(r)&&t.includes(i)))}omit(t){const n=[];for(const r of Object.keys(this.fields))t.includes(r)||n.push(r);return this.pick(n)}from(t,n,r){let i=Ki.getter(t,!0);return this.transform(s=>{if(!s)return s;let o=s;return xN(s,t)&&(o=Object.assign({},s),r||delete o[t],o[n]=i(s)),o})}json(){return this.transform(yN)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||fc.exact,test(n){if(n==null)return!0;const r=P0(this.schema,n);return r.length===0||this.createError({params:{properties:r.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,n=fc.noUnknown){typeof t!="boolean"&&(n=t,t=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:n,test(i){if(i==null)return!0;const s=P0(this.schema,i);return!t||s.length===0||this.createError({params:{unknown:s.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,n=fc.noUnknown){return this.noUnknown(!t,n)}transformKeys(t){return this.transform(n=>{if(!n)return n;const r={};for(const i of Object.keys(n))r[t(i)]=n[i];return r})}camelCase(){return this.transformKeys(Qd.camelCase)}snakeCase(){return this.transformKeys(Qd.snakeCase)}constantCase(){return this.transformKeys(t=>Qd.snakeCase(t).toUpperCase())}describe(t){const n=(t?this.resolve(t):this).clone(),r=super.describe(t);r.fields={};for(const[s,o]of Object.entries(n.fields)){var i;let a=t;(i=a)!=null&&i.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[s]})),r.fields[s]=o.describe(a)}return r}}sg.prototype=RS.prototype;var bN=function(t){return kN(t)&&!SN(t)};function kN(e){return!!e&&typeof e=="object"}function SN(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||TN(e)}var CN=typeof Symbol=="function"&&Symbol.for,_N=CN?Symbol.for("react.element"):60103;function TN(e){return e.$$typeof===_N}function EN(e){return Array.isArray(e)?[]:{}}function nu(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Qa(EN(e),e,t):e}function AN(e,t,n){return e.concat(t).map(function(r){return nu(r,n)})}function jN(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(i){r[i]=nu(e[i],n)}),Object.keys(t).forEach(function(i){!n.isMergeableObject(t[i])||!e[i]?r[i]=nu(t[i],n):r[i]=Qa(e[i],t[i],n)}),r}function Qa(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||AN,n.isMergeableObject=n.isMergeableObject||bN;var r=Array.isArray(t),i=Array.isArray(e),s=r===i;return s?r?n.arrayMerge(e,t,n):jN(e,t,n):nu(t,n)}Qa.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,i){return Qa(r,i,n)},{})};var Gp=Qa,PS=typeof global=="object"&&global&&global.Object===Object&&global,RN=typeof self=="object"&&self&&self.Object===Object&&self,ur=PS||RN||Function("return this")(),gi=ur.Symbol,MS=Object.prototype,PN=MS.hasOwnProperty,MN=MS.toString,Go=gi?gi.toStringTag:void 0;function NN(e){var t=PN.call(e,Go),n=e[Go];try{e[Go]=void 0;var r=!0}catch{}var i=MN.call(e);return r&&(t?e[Go]=n:delete e[Go]),i}var ON=Object.prototype,DN=ON.toString;function IN(e){return DN.call(e)}var LN="[object Null]",FN="[object Undefined]",M0=gi?gi.toStringTag:void 0;function ps(e){return e==null?e===void 0?FN:LN:M0&&M0 in Object(e)?NN(e):IN(e)}function NS(e,t){return function(n){return e(t(n))}}var og=NS(Object.getPrototypeOf,Object);function hs(e){return e!=null&&typeof e=="object"}var $N="[object Object]",BN=Function.prototype,zN=Object.prototype,OS=BN.toString,VN=zN.hasOwnProperty,UN=OS.call(Object);function N0(e){if(!hs(e)||ps(e)!=$N)return!1;var t=og(e);if(t===null)return!0;var n=VN.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&OS.call(n)==UN}function HN(){this.__data__=[],this.size=0}function DS(e,t){return e===t||e!==e&&t!==t}function Lu(e,t){for(var n=e.length;n--;)if(DS(e[n][0],t))return n;return-1}var WN=Array.prototype,qN=WN.splice;function GN(e){var t=this.__data__,n=Lu(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():qN.call(t,n,1),--this.size,!0}function YN(e){var t=this.__data__,n=Lu(t,e);return n<0?void 0:t[n][1]}function QN(e){return Lu(this.__data__,e)>-1}function KN(e,t){var n=this.__data__,r=Lu(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Or(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Or.prototype.clear=HN;Or.prototype.delete=GN;Or.prototype.get=YN;Or.prototype.has=QN;Or.prototype.set=KN;function XN(){this.__data__=new Or,this.size=0}function ZN(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function JN(e){return this.__data__.get(e)}function eO(e){return this.__data__.has(e)}function pl(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var tO="[object AsyncFunction]",nO="[object Function]",rO="[object GeneratorFunction]",iO="[object Proxy]";function IS(e){if(!pl(e))return!1;var t=ps(e);return t==nO||t==rO||t==tO||t==iO}var Kd=ur["__core-js_shared__"],O0=function(){var e=/[^.]+$/.exec(Kd&&Kd.keys&&Kd.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function sO(e){return!!O0&&O0 in e}var oO=Function.prototype,aO=oO.toString;function ms(e){if(e!=null){try{return aO.call(e)}catch{}try{return e+""}catch{}}return""}var lO=/[\\^$.*+?()[\]{}|]/g,cO=/^\[object .+?Constructor\]$/,uO=Function.prototype,dO=Object.prototype,fO=uO.toString,pO=dO.hasOwnProperty,hO=RegExp("^"+fO.call(pO).replace(lO,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function mO(e){if(!pl(e)||sO(e))return!1;var t=IS(e)?hO:cO;return t.test(ms(e))}function gO(e,t){return e==null?void 0:e[t]}function gs(e,t){var n=gO(e,t);return mO(n)?n:void 0}var Ka=gs(ur,"Map"),Xa=gs(Object,"create");function vO(){this.__data__=Xa?Xa(null):{},this.size=0}function yO(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var xO="__lodash_hash_undefined__",wO=Object.prototype,bO=wO.hasOwnProperty;function kO(e){var t=this.__data__;if(Xa){var n=t[e];return n===xO?void 0:n}return bO.call(t,e)?t[e]:void 0}var SO=Object.prototype,CO=SO.hasOwnProperty;function _O(e){var t=this.__data__;return Xa?t[e]!==void 0:CO.call(t,e)}var TO="__lodash_hash_undefined__";function EO(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Xa&&t===void 0?TO:t,this}function ss(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ss.prototype.clear=vO;ss.prototype.delete=yO;ss.prototype.get=kO;ss.prototype.has=_O;ss.prototype.set=EO;function AO(){this.size=0,this.__data__={hash:new ss,map:new(Ka||Or),string:new ss}}function jO(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Fu(e,t){var n=e.__data__;return jO(t)?n[typeof t=="string"?"string":"hash"]:n.map}function RO(e){var t=Fu(this,e).delete(e);return this.size-=t?1:0,t}function PO(e){return Fu(this,e).get(e)}function MO(e){return Fu(this,e).has(e)}function NO(e,t){var n=Fu(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function bi(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}bi.prototype.clear=AO;bi.prototype.delete=RO;bi.prototype.get=PO;bi.prototype.has=MO;bi.prototype.set=NO;var OO=200;function DO(e,t){var n=this.__data__;if(n instanceof Or){var r=n.__data__;if(!Ka||r.length<OO-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new bi(r)}return n.set(e,t),this.size=n.size,this}function No(e){var t=this.__data__=new Or(e);this.size=t.size}No.prototype.clear=XN;No.prototype.delete=ZN;No.prototype.get=JN;No.prototype.has=eO;No.prototype.set=DO;function IO(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var D0=function(){try{var e=gs(Object,"defineProperty");return e({},"",{}),e}catch{}}();function LS(e,t,n){t=="__proto__"&&D0?D0(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var LO=Object.prototype,FO=LO.hasOwnProperty;function FS(e,t,n){var r=e[t];(!(FO.call(e,t)&&DS(r,n))||n===void 0&&!(t in e))&&LS(e,t,n)}function $u(e,t,n,r){var i=!n;n||(n={});for(var s=-1,o=t.length;++s<o;){var a=t[s],l=void 0;l===void 0&&(l=e[a]),i?LS(n,a,l):FS(n,a,l)}return n}function $O(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var BO="[object Arguments]";function I0(e){return hs(e)&&ps(e)==BO}var $S=Object.prototype,zO=$S.hasOwnProperty,VO=$S.propertyIsEnumerable,UO=I0(function(){return arguments}())?I0:function(e){return hs(e)&&zO.call(e,"callee")&&!VO.call(e,"callee")},hl=Array.isArray;function HO(){return!1}var BS=typeof rn=="object"&&rn&&!rn.nodeType&&rn,L0=BS&&typeof sn=="object"&&sn&&!sn.nodeType&&sn,WO=L0&&L0.exports===BS,F0=WO?ur.Buffer:void 0,qO=F0?F0.isBuffer:void 0,zS=qO||HO,GO=9007199254740991,YO=/^(?:0|[1-9]\d*)$/;function QO(e,t){var n=typeof e;return t=t??GO,!!t&&(n=="number"||n!="symbol"&&YO.test(e))&&e>-1&&e%1==0&&e<t}var KO=9007199254740991;function VS(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=KO}var XO="[object Arguments]",ZO="[object Array]",JO="[object Boolean]",e4="[object Date]",t4="[object Error]",n4="[object Function]",r4="[object Map]",i4="[object Number]",s4="[object Object]",o4="[object RegExp]",a4="[object Set]",l4="[object String]",c4="[object WeakMap]",u4="[object ArrayBuffer]",d4="[object DataView]",f4="[object Float32Array]",p4="[object Float64Array]",h4="[object Int8Array]",m4="[object Int16Array]",g4="[object Int32Array]",v4="[object Uint8Array]",y4="[object Uint8ClampedArray]",x4="[object Uint16Array]",w4="[object Uint32Array]",Ve={};Ve[f4]=Ve[p4]=Ve[h4]=Ve[m4]=Ve[g4]=Ve[v4]=Ve[y4]=Ve[x4]=Ve[w4]=!0;Ve[XO]=Ve[ZO]=Ve[u4]=Ve[JO]=Ve[d4]=Ve[e4]=Ve[t4]=Ve[n4]=Ve[r4]=Ve[i4]=Ve[s4]=Ve[o4]=Ve[a4]=Ve[l4]=Ve[c4]=!1;function b4(e){return hs(e)&&VS(e.length)&&!!Ve[ps(e)]}function ag(e){return function(t){return e(t)}}var US=typeof rn=="object"&&rn&&!rn.nodeType&&rn,xa=US&&typeof sn=="object"&&sn&&!sn.nodeType&&sn,k4=xa&&xa.exports===US,Xd=k4&&PS.process,ko=function(){try{var e=xa&&xa.require&&xa.require("util").types;return e||Xd&&Xd.binding&&Xd.binding("util")}catch{}}(),$0=ko&&ko.isTypedArray,S4=$0?ag($0):b4,C4=Object.prototype,_4=C4.hasOwnProperty;function HS(e,t){var n=hl(e),r=!n&&UO(e),i=!n&&!r&&zS(e),s=!n&&!r&&!i&&S4(e),o=n||r||i||s,a=o?$O(e.length,String):[],l=a.length;for(var c in e)(t||_4.call(e,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||QO(c,l)))&&a.push(c);return a}var T4=Object.prototype;function lg(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||T4;return e===n}var E4=NS(Object.keys,Object),A4=Object.prototype,j4=A4.hasOwnProperty;function R4(e){if(!lg(e))return E4(e);var t=[];for(var n in Object(e))j4.call(e,n)&&n!="constructor"&&t.push(n);return t}function WS(e){return e!=null&&VS(e.length)&&!IS(e)}function cg(e){return WS(e)?HS(e):R4(e)}function P4(e,t){return e&&$u(t,cg(t),e)}function M4(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var N4=Object.prototype,O4=N4.hasOwnProperty;function D4(e){if(!pl(e))return M4(e);var t=lg(e),n=[];for(var r in e)r=="constructor"&&(t||!O4.call(e,r))||n.push(r);return n}function ug(e){return WS(e)?HS(e,!0):D4(e)}function I4(e,t){return e&&$u(t,ug(t),e)}var qS=typeof rn=="object"&&rn&&!rn.nodeType&&rn,B0=qS&&typeof sn=="object"&&sn&&!sn.nodeType&&sn,L4=B0&&B0.exports===qS,z0=L4?ur.Buffer:void 0,V0=z0?z0.allocUnsafe:void 0;function F4(e,t){if(t)return e.slice();var n=e.length,r=V0?V0(n):new e.constructor(n);return e.copy(r),r}function GS(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}function $4(e,t){for(var n=-1,r=e==null?0:e.length,i=0,s=[];++n<r;){var o=e[n];t(o,n,e)&&(s[i++]=o)}return s}function YS(){return[]}var B4=Object.prototype,z4=B4.propertyIsEnumerable,U0=Object.getOwnPropertySymbols,dg=U0?function(e){return e==null?[]:(e=Object(e),$4(U0(e),function(t){return z4.call(e,t)}))}:YS;function V4(e,t){return $u(e,dg(e),t)}function QS(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var U4=Object.getOwnPropertySymbols,KS=U4?function(e){for(var t=[];e;)QS(t,dg(e)),e=og(e);return t}:YS;function H4(e,t){return $u(e,KS(e),t)}function XS(e,t,n){var r=t(e);return hl(e)?r:QS(r,n(e))}function W4(e){return XS(e,cg,dg)}function q4(e){return XS(e,ug,KS)}var Yp=gs(ur,"DataView"),Qp=gs(ur,"Promise"),Kp=gs(ur,"Set"),Xp=gs(ur,"WeakMap"),H0="[object Map]",G4="[object Object]",W0="[object Promise]",q0="[object Set]",G0="[object WeakMap]",Y0="[object DataView]",Y4=ms(Yp),Q4=ms(Ka),K4=ms(Qp),X4=ms(Kp),Z4=ms(Xp),yr=ps;(Yp&&yr(new Yp(new ArrayBuffer(1)))!=Y0||Ka&&yr(new Ka)!=H0||Qp&&yr(Qp.resolve())!=W0||Kp&&yr(new Kp)!=q0||Xp&&yr(new Xp)!=G0)&&(yr=function(e){var t=ps(e),n=t==G4?e.constructor:void 0,r=n?ms(n):"";if(r)switch(r){case Y4:return Y0;case Q4:return H0;case K4:return W0;case X4:return q0;case Z4:return G0}return t});var J4=Object.prototype,eD=J4.hasOwnProperty;function tD(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&eD.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var Q0=ur.Uint8Array;function fg(e){var t=new e.constructor(e.byteLength);return new Q0(t).set(new Q0(e)),t}function nD(e,t){var n=t?fg(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var rD=/\w*$/;function iD(e){var t=new e.constructor(e.source,rD.exec(e));return t.lastIndex=e.lastIndex,t}var K0=gi?gi.prototype:void 0,X0=K0?K0.valueOf:void 0;function sD(e){return X0?Object(X0.call(e)):{}}function oD(e,t){var n=t?fg(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var aD="[object Boolean]",lD="[object Date]",cD="[object Map]",uD="[object Number]",dD="[object RegExp]",fD="[object Set]",pD="[object String]",hD="[object Symbol]",mD="[object ArrayBuffer]",gD="[object DataView]",vD="[object Float32Array]",yD="[object Float64Array]",xD="[object Int8Array]",wD="[object Int16Array]",bD="[object Int32Array]",kD="[object Uint8Array]",SD="[object Uint8ClampedArray]",CD="[object Uint16Array]",_D="[object Uint32Array]";function TD(e,t,n){var r=e.constructor;switch(t){case mD:return fg(e);case aD:case lD:return new r(+e);case gD:return nD(e,n);case vD:case yD:case xD:case wD:case bD:case kD:case SD:case CD:case _D:return oD(e,n);case cD:return new r;case uD:case pD:return new r(e);case dD:return iD(e);case fD:return new r;case hD:return sD(e)}}var Z0=Object.create,ED=function(){function e(){}return function(t){if(!pl(t))return{};if(Z0)return Z0(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function AD(e){return typeof e.constructor=="function"&&!lg(e)?ED(og(e)):{}}var jD="[object Map]";function RD(e){return hs(e)&&yr(e)==jD}var J0=ko&&ko.isMap,PD=J0?ag(J0):RD,MD="[object Set]";function ND(e){return hs(e)&&yr(e)==MD}var ex=ko&&ko.isSet,OD=ex?ag(ex):ND,DD=1,ID=2,LD=4,ZS="[object Arguments]",FD="[object Array]",$D="[object Boolean]",BD="[object Date]",zD="[object Error]",JS="[object Function]",VD="[object GeneratorFunction]",UD="[object Map]",HD="[object Number]",eC="[object Object]",WD="[object RegExp]",qD="[object Set]",GD="[object String]",YD="[object Symbol]",QD="[object WeakMap]",KD="[object ArrayBuffer]",XD="[object DataView]",ZD="[object Float32Array]",JD="[object Float64Array]",eI="[object Int8Array]",tI="[object Int16Array]",nI="[object Int32Array]",rI="[object Uint8Array]",iI="[object Uint8ClampedArray]",sI="[object Uint16Array]",oI="[object Uint32Array]",Fe={};Fe[ZS]=Fe[FD]=Fe[KD]=Fe[XD]=Fe[$D]=Fe[BD]=Fe[ZD]=Fe[JD]=Fe[eI]=Fe[tI]=Fe[nI]=Fe[UD]=Fe[HD]=Fe[eC]=Fe[WD]=Fe[qD]=Fe[GD]=Fe[YD]=Fe[rI]=Fe[iI]=Fe[sI]=Fe[oI]=!0;Fe[zD]=Fe[JS]=Fe[QD]=!1;function wa(e,t,n,r,i,s){var o,a=t&DD,l=t&ID,c=t&LD;if(o!==void 0)return o;if(!pl(e))return e;var d=hl(e);if(d){if(o=tD(e),!a)return GS(e,o)}else{var u=yr(e),p=u==JS||u==VD;if(zS(e))return F4(e,a);if(u==eC||u==ZS||p&&!i){if(o=l||p?{}:AD(e),!a)return l?H4(e,I4(o,e)):V4(e,P4(o,e))}else{if(!Fe[u])return i?e:{};o=TD(e,u,a)}}s||(s=new No);var h=s.get(e);if(h)return h;s.set(e,o),OD(e)?e.forEach(function(b){o.add(wa(b,t,n,b,e,s))}):PD(e)&&e.forEach(function(b,m){o.set(m,wa(b,t,n,m,e,s))});var y=c?l?q4:W4:l?ug:cg,w=d?void 0:y(e);return IO(w||e,function(b,m){w&&(m=b,b=e[m]),FS(o,m,wa(b,t,n,m,e,s))}),o}var aI=1,lI=4;function Hl(e){return wa(e,aI|lI)}var tx=Array.isArray,nx=Object.keys,cI=Object.prototype.hasOwnProperty,uI=typeof Element<"u";function Zp(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=tx(e),r=tx(t),i,s,o;if(n&&r){if(s=e.length,s!=t.length)return!1;for(i=s;i--!==0;)if(!Zp(e[i],t[i]))return!1;return!0}if(n!=r)return!1;var a=e instanceof Date,l=t instanceof Date;if(a!=l)return!1;if(a&&l)return e.getTime()==t.getTime();var c=e instanceof RegExp,d=t instanceof RegExp;if(c!=d)return!1;if(c&&d)return e.toString()==t.toString();var u=nx(e);if(s=u.length,s!==nx(t).length)return!1;for(i=s;i--!==0;)if(!cI.call(t,u[i]))return!1;if(uI&&e instanceof Element&&t instanceof Element)return e===t;for(i=s;i--!==0;)if(o=u[i],!(o==="_owner"&&e.$$typeof)&&!Zp(e[o],t[o]))return!1;return!0}return e!==e&&t!==t}var dI=function(t,n){try{return Zp(t,n)}catch(r){if(r.message&&r.message.match(/stack|recursion/i)||r.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",r.name,r.message),!1;throw r}};const ji=Pr(dI);var fI=4;function rx(e){return wa(e,fI)}function tC(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var pI="[object Symbol]";function pg(e){return typeof e=="symbol"||hs(e)&&ps(e)==pI}var hI="Expected a function";function hg(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(hI);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var o=e.apply(this,r);return n.cache=s.set(i,o)||s,o};return n.cache=new(hg.Cache||bi),n}hg.Cache=bi;var mI=500;function gI(e){var t=hg(e,function(r){return n.size===mI&&n.clear(),r}),n=t.cache;return t}var vI=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,yI=/\\(\\)?/g,xI=gI(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(vI,function(n,r,i,s){t.push(i?s.replace(yI,"$1"):r||n)}),t}),wI=1/0;function bI(e){if(typeof e=="string"||pg(e))return e;var t=e+"";return t=="0"&&1/e==-wI?"-0":t}var kI=1/0,ix=gi?gi.prototype:void 0,sx=ix?ix.toString:void 0;function nC(e){if(typeof e=="string")return e;if(hl(e))return tC(e,nC)+"";if(pg(e))return sx?sx.call(e):"";var t=e+"";return t=="0"&&1/e==-kI?"-0":t}function SI(e){return e==null?"":nC(e)}function rC(e){return hl(e)?tC(e,bI):pg(e)?[e]:GS(xI(SI(e)))}var iC={exports:{}},Me={};/** @license React v16.13.1
|
|
90
90
|
* react-is.production.min.js
|
|
91
91
|
*
|
|
92
92
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
93
93
|
*
|
|
94
94
|
* This source code is licensed under the MIT license found in the
|
|
95
95
|
* LICENSE file in the root directory of this source tree.
|
|
96
|
-
*/var gt=typeof Symbol=="function"&&Symbol.for,lg=gt?Symbol.for("react.element"):60103,cg=gt?Symbol.for("react.portal"):60106,Du=gt?Symbol.for("react.fragment"):60107,Iu=gt?Symbol.for("react.strict_mode"):60108,Lu=gt?Symbol.for("react.profiler"):60114,Fu=gt?Symbol.for("react.provider"):60109,Bu=gt?Symbol.for("react.context"):60110,ug=gt?Symbol.for("react.async_mode"):60111,$u=gt?Symbol.for("react.concurrent_mode"):60111,zu=gt?Symbol.for("react.forward_ref"):60112,Vu=gt?Symbol.for("react.suspense"):60113,uI=gt?Symbol.for("react.suspense_list"):60120,Uu=gt?Symbol.for("react.memo"):60115,Hu=gt?Symbol.for("react.lazy"):60116,dI=gt?Symbol.for("react.block"):60121,fI=gt?Symbol.for("react.fundamental"):60117,pI=gt?Symbol.for("react.responder"):60118,hI=gt?Symbol.for("react.scope"):60119;function cn(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case lg:switch(e=e.type,e){case ug:case $u:case Du:case Lu:case Iu:case Vu:return e;default:switch(e=e&&e.$$typeof,e){case Bu:case zu:case Hu:case Uu:case Fu:return e;default:return t}}case cg:return t}}}function qS(e){return cn(e)===$u}Me.AsyncMode=ug;Me.ConcurrentMode=$u;Me.ContextConsumer=Bu;Me.ContextProvider=Fu;Me.Element=lg;Me.ForwardRef=zu;Me.Fragment=Du;Me.Lazy=Hu;Me.Memo=Uu;Me.Portal=cg;Me.Profiler=Lu;Me.StrictMode=Iu;Me.Suspense=Vu;Me.isAsyncMode=function(e){return qS(e)||cn(e)===ug};Me.isConcurrentMode=qS;Me.isContextConsumer=function(e){return cn(e)===Bu};Me.isContextProvider=function(e){return cn(e)===Fu};Me.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===lg};Me.isForwardRef=function(e){return cn(e)===zu};Me.isFragment=function(e){return cn(e)===Du};Me.isLazy=function(e){return cn(e)===Hu};Me.isMemo=function(e){return cn(e)===Uu};Me.isPortal=function(e){return cn(e)===cg};Me.isProfiler=function(e){return cn(e)===Lu};Me.isStrictMode=function(e){return cn(e)===Iu};Me.isSuspense=function(e){return cn(e)===Vu};Me.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Du||e===$u||e===Lu||e===Iu||e===Vu||e===uI||typeof e=="object"&&e!==null&&(e.$$typeof===Hu||e.$$typeof===Uu||e.$$typeof===Fu||e.$$typeof===Bu||e.$$typeof===zu||e.$$typeof===fI||e.$$typeof===pI||e.$$typeof===hI||e.$$typeof===dI)};Me.typeOf=cn;WS.exports=Me;var mI=WS.exports,GS=mI,gI={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},vI={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},YS={};YS[GS.ForwardRef]=gI;YS[GS.Memo]=vI;function ft(){return ft=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ft.apply(this,arguments)}function QS(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var Wu=v.createContext(void 0);Wu.displayName="FormikContext";Wu.Provider;Wu.Consumer;function yI(){var e=v.useContext(Wu);return e}var An=function(t){return typeof t=="function"},qu=function(t){return t!==null&&typeof t=="object"},xI=function(t){return String(Math.floor(Number(t)))===t},Gd=function(t){return Object.prototype.toString.call(t)==="[object String]"},Yd=function(t){return qu(t)&&An(t.then)};function Xt(e,t,n,r){r===void 0&&(r=0);for(var i=HS(t);e&&r<i.length;)e=e[i[r++]];return r!==i.length&&!e||e===void 0?n:e}function Ki(e,t,n){for(var r=Q0(e),i=r,s=0,o=HS(t);s<o.length-1;s++){var a=o[s],l=Xt(e,o.slice(0,s+1));if(l&&(qu(l)||Array.isArray(l)))i=i[a]=Q0(l);else{var c=o[s+1];i=i[a]=xI(c)&&Number(c)>=0?[]:{}}}return(s===0?e:i)[o[s]]===n?e:(n===void 0?delete i[o[s]]:i[o[s]]=n,s===0&&n===void 0&&delete r[o[s]],r)}function KS(e,t,n,r){n===void 0&&(n=new WeakMap),r===void 0&&(r={});for(var i=0,s=Object.keys(e);i<s.length;i++){var o=s[i],a=e[o];qu(a)?n.get(a)||(n.set(a,!0),r[o]=Array.isArray(a)?[]:{},KS(a,t,n,r[o])):r[o]=t}return r}function wI(e,t){switch(t.type){case"SET_VALUES":return ft({},e,{values:t.payload});case"SET_TOUCHED":return ft({},e,{touched:t.payload});case"SET_ERRORS":return Ai(e.errors,t.payload)?e:ft({},e,{errors:t.payload});case"SET_STATUS":return ft({},e,{status:t.payload});case"SET_ISSUBMITTING":return ft({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return ft({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return ft({},e,{values:Ki(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return ft({},e,{touched:Ki(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return ft({},e,{errors:Ki(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return ft({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return ft({},e,{touched:KS(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":return ft({},e,{isSubmitting:!1});case"SUBMIT_SUCCESS":return ft({},e,{isSubmitting:!1});default:return e}}var Ti={},$l={};function bI(e){var t=e.validateOnChange,n=t===void 0?!0:t,r=e.validateOnBlur,i=r===void 0?!0:r,s=e.validateOnMount,o=s===void 0?!1:s,a=e.isInitialValid,l=e.enableReinitialize,c=l===void 0?!1:l,d=e.onSubmit,u=QS(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),p=ft({validateOnChange:n,validateOnBlur:i,validateOnMount:o,onSubmit:d},u),m=v.useRef(p.initialValues),y=v.useRef(p.initialErrors||Ti),w=v.useRef(p.initialTouched||$l),x=v.useRef(p.initialStatus),h=v.useRef(!1),g=v.useRef({});v.useEffect(function(){return h.current=!0,function(){h.current=!1}},[]);var k=v.useState(0),C=k[1],S=v.useRef({values:Bl(p.initialValues),errors:Bl(p.initialErrors)||Ti,touched:Bl(p.initialTouched)||$l,status:Bl(p.initialStatus),isSubmitting:!1,isValidating:!1,submitCount:0}),T=S.current,j=v.useCallback(function(P){var Z=S.current;S.current=wI(Z,P),Z!==S.current&&C(function(L){return L+1})},[]),E=v.useCallback(function(P,Z){return new Promise(function(L,V){var ae=p.validate(P,Z);ae==null?L(Ti):Yd(ae)?ae.then(function(fe){L(fe||Ti)},function(fe){V(fe)}):L(ae)})},[p.validate]),A=v.useCallback(function(P,Z){var L=p.validationSchema,V=An(L)?L(Z):L,ae=Z&&V.validateAt?V.validateAt(Z,P):SI(P,V);return new Promise(function(fe,Ce){ae.then(function(){fe(Ti)},function(at){at.name==="ValidationError"?fe(kI(at)):Ce(at)})})},[p.validationSchema]),I=v.useCallback(function(P,Z){return new Promise(function(L){return L(g.current[P].validate(Z))})},[]),N=v.useCallback(function(P){var Z=Object.keys(g.current).filter(function(V){return An(g.current[V].validate)}),L=Z.length>0?Z.map(function(V){return I(V,Xt(P,V))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(L).then(function(V){return V.reduce(function(ae,fe,Ce){return fe==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||fe&&(ae=Ki(ae,Z[Ce],fe)),ae},{})})},[I]),D=v.useCallback(function(P){return Promise.all([N(P),p.validationSchema?A(P):{},p.validate?E(P):{}]).then(function(Z){var L=Z[0],V=Z[1],ae=Z[2],fe=zp.all([L,V,ae],{arrayMerge:CI});return fe})},[p.validate,p.validationSchema,N,E,A]),G=pn(function(P){return P===void 0&&(P=T.values),j({type:"SET_ISVALIDATING",payload:!0}),D(P).then(function(Z){return h.current&&(j({type:"SET_ISVALIDATING",payload:!1}),j({type:"SET_ERRORS",payload:Z})),Z})});v.useEffect(function(){o&&h.current===!0&&Ai(m.current,p.initialValues)&&G(m.current)},[o,G]);var B=v.useCallback(function(P){var Z=P&&P.values?P.values:m.current,L=P&&P.errors?P.errors:y.current?y.current:p.initialErrors||{},V=P&&P.touched?P.touched:w.current?w.current:p.initialTouched||{},ae=P&&P.status?P.status:x.current?x.current:p.initialStatus;m.current=Z,y.current=L,w.current=V,x.current=ae;var fe=function(){j({type:"RESET_FORM",payload:{isSubmitting:!!P&&!!P.isSubmitting,errors:L,touched:V,status:ae,values:Z,isValidating:!!P&&!!P.isValidating,submitCount:P&&P.submitCount&&typeof P.submitCount=="number"?P.submitCount:0}})};if(p.onReset){var Ce=p.onReset(T.values,K);Yd(Ce)?Ce.then(fe):fe()}else fe()},[p.initialErrors,p.initialStatus,p.initialTouched,p.onReset]);v.useEffect(function(){h.current===!0&&!Ai(m.current,p.initialValues)&&c&&(m.current=p.initialValues,B(),o&&G(m.current))},[c,p.initialValues,B,o,G]),v.useEffect(function(){c&&h.current===!0&&!Ai(y.current,p.initialErrors)&&(y.current=p.initialErrors||Ti,j({type:"SET_ERRORS",payload:p.initialErrors||Ti}))},[c,p.initialErrors]),v.useEffect(function(){c&&h.current===!0&&!Ai(w.current,p.initialTouched)&&(w.current=p.initialTouched||$l,j({type:"SET_TOUCHED",payload:p.initialTouched||$l}))},[c,p.initialTouched]),v.useEffect(function(){c&&h.current===!0&&!Ai(x.current,p.initialStatus)&&(x.current=p.initialStatus,j({type:"SET_STATUS",payload:p.initialStatus}))},[c,p.initialStatus,p.initialTouched]);var F=pn(function(P){if(g.current[P]&&An(g.current[P].validate)){var Z=Xt(T.values,P),L=g.current[P].validate(Z);return Yd(L)?(j({type:"SET_ISVALIDATING",payload:!0}),L.then(function(V){return V}).then(function(V){j({type:"SET_FIELD_ERROR",payload:{field:P,value:V}}),j({type:"SET_ISVALIDATING",payload:!1})})):(j({type:"SET_FIELD_ERROR",payload:{field:P,value:L}}),Promise.resolve(L))}else if(p.validationSchema)return j({type:"SET_ISVALIDATING",payload:!0}),A(T.values,P).then(function(V){return V}).then(function(V){j({type:"SET_FIELD_ERROR",payload:{field:P,value:Xt(V,P)}}),j({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),M=v.useCallback(function(P,Z){var L=Z.validate;g.current[P]={validate:L}},[]),$=v.useCallback(function(P){delete g.current[P]},[]),R=pn(function(P,Z){j({type:"SET_TOUCHED",payload:P});var L=Z===void 0?i:Z;return L?G(T.values):Promise.resolve()}),z=v.useCallback(function(P){j({type:"SET_ERRORS",payload:P})},[]),U=pn(function(P,Z){var L=An(P)?P(T.values):P;j({type:"SET_VALUES",payload:L});var V=Z===void 0?n:Z;return V?G(L):Promise.resolve()}),W=v.useCallback(function(P,Z){j({type:"SET_FIELD_ERROR",payload:{field:P,value:Z}})},[]),q=pn(function(P,Z,L){j({type:"SET_FIELD_VALUE",payload:{field:P,value:Z}});var V=L===void 0?n:L;return V?G(Ki(T.values,P,Z)):Promise.resolve()}),ne=v.useCallback(function(P,Z){var L=Z,V=P,ae;if(!Gd(P)){P.persist&&P.persist();var fe=P.target?P.target:P.currentTarget,Ce=fe.type,at=fe.name,vt=fe.id,Vn=fe.value,un=fe.checked,ys=fe.outerHTML,fr=fe.options,Nr=fe.multiple;L=Z||at||vt,V=/number|range/.test(Ce)?(ae=parseFloat(Vn),isNaN(ae)?"":ae):/checkbox/.test(Ce)?_I(Xt(T.values,L),un,Vn):fr&&Nr?TI(fr):Vn}L&&q(L,V)},[q,T.values]),oe=pn(function(P){if(Gd(P))return function(Z){return ne(Z,P)};ne(P)}),me=pn(function(P,Z,L){Z===void 0&&(Z=!0),j({type:"SET_FIELD_TOUCHED",payload:{field:P,value:Z}});var V=L===void 0?i:L;return V?G(T.values):Promise.resolve()}),ue=v.useCallback(function(P,Z){P.persist&&P.persist();var L=P.target,V=L.name,ae=L.id,fe=L.outerHTML,Ce=Z||V||ae;me(Ce,!0)},[me]),Q=pn(function(P){if(Gd(P))return function(Z){return ue(Z,P)};ue(P)}),de=v.useCallback(function(P){An(P)?j({type:"SET_FORMIK_STATE",payload:P}):j({type:"SET_FORMIK_STATE",payload:function(){return P}})},[]),H=v.useCallback(function(P){j({type:"SET_STATUS",payload:P})},[]),te=v.useCallback(function(P){j({type:"SET_ISSUBMITTING",payload:P})},[]),O=pn(function(){return j({type:"SUBMIT_ATTEMPT"}),G().then(function(P){var Z=P instanceof Error,L=!Z&&Object.keys(P).length===0;if(L){var V;try{if(V=xe(),V===void 0)return}catch(ae){throw ae}return Promise.resolve(V).then(function(ae){return h.current&&j({type:"SUBMIT_SUCCESS"}),ae}).catch(function(ae){if(h.current)throw j({type:"SUBMIT_FAILURE"}),ae})}else if(h.current&&(j({type:"SUBMIT_FAILURE"}),Z))throw P})}),ee=pn(function(P){P&&P.preventDefault&&An(P.preventDefault)&&P.preventDefault(),P&&P.stopPropagation&&An(P.stopPropagation)&&P.stopPropagation(),O().catch(function(Z){console.warn("Warning: An unhandled error was caught from submitForm()",Z)})}),K={resetForm:B,validateForm:G,validateField:F,setErrors:z,setFieldError:W,setFieldTouched:me,setFieldValue:q,setStatus:H,setSubmitting:te,setTouched:R,setValues:U,setFormikState:de,submitForm:O},xe=pn(function(){return d(T.values,K)}),ge=pn(function(P){P&&P.preventDefault&&An(P.preventDefault)&&P.preventDefault(),P&&P.stopPropagation&&An(P.stopPropagation)&&P.stopPropagation(),B()}),He=v.useCallback(function(P){return{value:Xt(T.values,P),error:Xt(T.errors,P),touched:!!Xt(T.touched,P),initialValue:Xt(m.current,P),initialTouched:!!Xt(w.current,P),initialError:Xt(y.current,P)}},[T.errors,T.touched,T.values]),ot=v.useCallback(function(P){return{setValue:function(L,V){return q(P,L,V)},setTouched:function(L,V){return me(P,L,V)},setError:function(L){return W(P,L)}}},[q,me,W]),Bt=v.useCallback(function(P){var Z=qu(P),L=Z?P.name:P,V=Xt(T.values,L),ae={name:L,value:V,onChange:oe,onBlur:Q};if(Z){var fe=P.type,Ce=P.value,at=P.as,vt=P.multiple;fe==="checkbox"?Ce===void 0?ae.checked=!!V:(ae.checked=!!(Array.isArray(V)&&~V.indexOf(Ce)),ae.value=Ce):fe==="radio"?(ae.checked=V===Ce,ae.value=Ce):at==="select"&&vt&&(ae.value=ae.value||[],ae.multiple=!0)}return ae},[Q,oe,T.values]),se=v.useMemo(function(){return!Ai(m.current,T.values)},[m.current,T.values]),ve=v.useMemo(function(){return typeof a<"u"?se?T.errors&&Object.keys(T.errors).length===0:a!==!1&&An(a)?a(p):a:T.errors&&Object.keys(T.errors).length===0},[a,se,T.errors,p]),Je=ft({},T,{initialValues:m.current,initialErrors:y.current,initialTouched:w.current,initialStatus:x.current,handleBlur:Q,handleChange:oe,handleReset:ge,handleSubmit:ee,resetForm:B,setErrors:z,setFormikState:de,setFieldTouched:me,setFieldValue:q,setFieldError:W,setStatus:H,setSubmitting:te,setTouched:R,setValues:U,submitForm:O,validateForm:G,validateField:F,isValid:ve,dirty:se,unregisterField:$,registerField:M,getFieldProps:Bt,getFieldMeta:He,getFieldHelpers:ot,validateOnBlur:i,validateOnChange:n,validateOnMount:o});return Je}function kI(e){var t={};if(e.inner){if(e.inner.length===0)return Ki(t,e.path,e.message);for(var i=e.inner,n=Array.isArray(i),r=0,i=n?i:i[Symbol.iterator]();;){var s;if(n){if(r>=i.length)break;s=i[r++]}else{if(r=i.next(),r.done)break;s=r.value}var o=s;Xt(t,o.path)||(t=Ki(t,o.path,o.message))}}return t}function SI(e,t,n,r){n===void 0&&(n=!1);var i=Gp(e);return t[n?"validateSync":"validate"](i,{abortEarly:!1,context:i})}function Gp(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);Array.isArray(e[r])===!0?t[r]=e[r].map(function(i){return Array.isArray(i)===!0||T0(i)?Gp(i):i!==""?i:void 0}):T0(e[r])?t[r]=Gp(e[r]):t[r]=e[r]!==""?e[r]:void 0}return t}function CI(e,t,n){var r=e.slice();return t.forEach(function(s,o){if(typeof r[o]>"u"){var a=n.clone!==!1,l=a&&n.isMergeableObject(s);r[o]=l?zp(Array.isArray(s)?[]:{},s,n):s}else n.isMergeableObject(s)?r[o]=zp(e[o],s,n):e.indexOf(s)===-1&&r.push(s)}),r}function TI(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function _I(e,t,n){if(typeof e=="boolean")return!!t;var r=[],i=!1,s=-1;if(Array.isArray(e))r=e,s=e.indexOf(n),i=s>=0;else if(!n||n=="true"||n=="false")return!!t;return t&&n&&!i?r.concat(n):i?r.slice(0,s).concat(r.slice(s+1)):r}var EI=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?v.useLayoutEffect:v.useEffect;function pn(e){var t=v.useRef(e);return EI(function(){t.current=e}),v.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current.apply(void 0,r)},[])}var jI=v.forwardRef(function(e,t){var n=e.action,r=QS(e,["action"]),i=n??"#",s=yI(),o=s.handleReset,a=s.handleSubmit;return v.createElement("form",ft({onSubmit:a,ref:t,onReset:o,action:i},r))});jI.displayName="Form";const XS=({init:e,schema:t,action:n,validateOnBlur:r=!1})=>bI({initialValues:e,validationSchema:t,validateOnBlur:r,enableReinitialize:!0,validateOnChange:!1,validateOnMount:!1,onSubmit:i=>{n(i)}});function dg({id:e,text:t,className:n,required:r}){const i=Se();return t?f.jsxs("label",{htmlFor:e,className:ze("mb-1 block text-sm font-medium",n),style:{color:i.getColor(b.InputText)},children:[t,r&&f.jsx("span",{className:"ml-1",style:{color:i.getColor(b.ErrorText)},children:"*"})]}):null}const Qd={sm:"px-3 py-1 text-xs",md:"px-4 py-2 text-sm",lg:"px-5 py-3 text-15"};function AI({id:e,label:t,suffix:n,prefix:r,size:i="md",type:s="text",noMargin:o=!1,required:a=!1,error:l,ariaDescribedBy:c,className:d,ariaInvalid:u,ariaLabel:p,autoFocus:m,...y}){const w=Se(),x=w.getRadius(),h=l?w.getColor(b.ErrorBorder):w.getColor(b.InputBorder),g=w.getColor(b.LinkColor);return f.jsxs("div",{className:ze({"mb-2":!o},d),style:{"--focus-ring":g},children:[f.jsx(dg,{id:e,text:t,required:a}),f.jsxs("div",{className:"flex items-center",children:[r&&f.jsx("span",{className:ze("inline-block border border-solid border-r-0 rounded-l-md",Qd[i]),style:{borderColor:l?w.getColor(b.ErrorBorder):w.getColor(b.InputBorder),backgroundColor:w.getColor(b.InputBackground),borderRadius:x},children:r}),f.jsx("input",{id:e,autoFocus:m,className:ze("border border-solid block w-full outline-none transition-[border-color,box-shadow] duration-200 focus:ring-2 focus:ring-offset-0 rounded-lg",Qd[i],{"rounded-l-none":!!r,"rounded-r-none":!!n}),type:s,required:a,"aria-describedby":c,"aria-invalid":u,"aria-label":p,style:{fontSize:"16px",color:l?w.getColor(b.ErrorText):w.getColor(b.InputText),backgroundColor:w.getColor(b.InputBackground),borderColor:h,borderRadius:x,"--tw-ring-color":g},...y}),n&&f.jsx("span",{className:ze("inline-block border border-solid border-l-0 rounded-r-md",Qd[i]),style:{borderColor:l?w.getColor(b.ErrorBorder):w.getColor(b.InputBorder),backgroundColor:w.getColor(b.InputBackground),borderRadius:x},children:n})]}),!!l&&f.jsx("p",{className:"mt-1 text-xs",style:{color:w.getColor(b.ErrorText)},children:l})]})}const Z0=(e,t)=>{const n=new Date;n.setFullYear(n.getFullYear()+1),document.cookie=`${e}=${t};expires=${n.toUTCString()};path=/`},ZS=v.createContext({}),RI=()=>`${window.location.pathname}_$$_${document.title}`,PI=()=>{const e=localStorage.getItem("page");return!e||e===""?"/":e},MI=()=>{const e=localStorage.getItem("p-history");if(!e||e==="")return[];try{return JSON.parse(e)}catch{return[]}};function OI({children:e}){const[t,n]=v.useState("/"),[r,i]=v.useState(MI());function s(){i([]),localStorage.removeItem("p-history")}const o=a=>{n(a),i(l=>[...new Set([...l,a])]),localStorage.setItem("page",a),localStorage.setItem("p-history",JSON.stringify(r))};return f.jsx(ZS.Provider,{value:{page:t,setPage:o,history:r,clearHistory:s},children:e})}function Gu(){return v.useContext(ZS)}const ma=e=>{const t=document.cookie.split(";").find(n=>n.includes(e));return t?t.split("=")[1]:null};function NI({label:e,id:t,value:n="",className:r,placeholder:i,children:s,required:o,error:a,...l}){const c=Se();return f.jsxs("div",{className:r,children:[e&&f.jsx(dg,{id:t,required:o,text:e}),f.jsxs("select",{id:t,"aria-placeholder":i,value:n,"aria-label":e,className:"block w-full rounded-lg border border-solid px-3 py-2 text-sm outline-none transition-[border-color,box-shadow] duration-200 focus:ring-2 focus:ring-offset-0",style:{backgroundColor:c.getColor(b.InputBackground),color:c.getColor(b.InputText),borderColor:a?c.getColor(b.ErrorBorder):c.getColor(b.InputBorder),borderRadius:c.getRadius(),"--tw-ring-color":c.getColor(b.LinkColor)},onChange:l.onChange,required:o,...l,children:[i&&f.jsx("option",{value:"",disabled:!0,children:i}),s]}),!!a&&f.jsx("p",{className:"mt-1 text-xs",style:{color:c.getColor(b.ErrorText)},children:a})]})}const J0={ring:{label:"",input:"relative before:content[''] before:absolute before:top-2/4 before:left-2/4 before:block before:h-12 before:w-12 before:-translate-y-2/4 before:-translate-x-2/4 before:rounded-full before:bg-blue-gray-500 before:opacity-0 before:transition-opacity hover:before:opacity-10"},hover:{label:"hover:bg-secondary transition-colors duration-200 px-2 py-1 rounded-md",input:""}},DI={sm:"h-4 w-4 lg:h-3 lg:w-3",md:"h-6 w-6 lg:h-5 lg:w-5",lg:"h-8 w-8 lg:h-7 lg:w-7"},II={sm:"h-3 w-3 lg:h-2.5 lg:w-2.5",md:"h-5 w-5 lg:h-4 lg:w-4",lg:"h-7 w-7 lg:h-6 lg:w-6"};function LI({children:e,name:t,required:n,value:r,checked:i,onChange:s,onBlur:o,red:a,id:l=t,size:c="md",effect:d="ring",reversed:u=!1,error:p,...m}){const y=Se(),w=y.getColor(b.InputText),x=y.getColor(b.LinkColor),h=y.getColor(b.InputBorder),g=y.getColor(b.InputBackground),k=y.getColor(b.ErrorText);return f.jsxs("div",{children:[f.jsxs("div",{className:`flex items-center justify-between gap-2 ${u?"flex-row-reverse":""} ${J0[d].label}`,children:[f.jsxs("label",{className:"disable-highlight relative flex cursor-pointer items-center rounded-md",htmlFor:l,children:[f.jsx("input",{id:l,name:t,type:"checkbox",className:`peer cursor-pointer appearance-none rounded-md border-2 border-solid transition-all ${DI[c]} ${J0[d].input}`,style:{borderColor:i?x:h,backgroundColor:i?x:g},required:n,checked:i,value:r,onChange:C=>s==null?void 0:s(C.target.checked),onBlur:C=>o==null?void 0:o(C.target.checked),...m}),f.jsx("div",{className:"pointer-events-none absolute left-2/4 top-2/4 -translate-x-1/2 -translate-y-1/2 text-white opacity-0 transition-opacity peer-checked:opacity-100",children:f.jsx(X.Check,{className:II[c]})})]}),f.jsx("label",{className:"disable-highlight flex grow cursor-pointer select-none items-center text-sm",style:{color:w},htmlFor:l,children:e})]}),(a||p)&&f.jsx("small",{className:"text-xs",style:{color:k},children:p||a})]})}function FI({id:e,value:t,name:n,onChange:r,children:i,disabled:s,className:o}){const a=Se(),l=a.getColor(b.InputText),c=a.getColor(b.LinkColor);return f.jsxs("label",{htmlFor:e,className:ze("relative flex cursor-pointer items-center gap-2 rounded-md focus-within:outline-none",{"opacity-60 cursor-not-allowed":s},o),children:[f.jsx("input",{type:"radio",id:e,name:n,value:e,checked:t,onChange:d=>r==null?void 0:r(d.target.checked),className:"h-4 w-4 min-w-4 cursor-pointer appearance-none border-2 transition-all focus:ring-0 focus:ring-offset-0",style:{borderRadius:"50%",borderColor:t?c:a.getColor(b.InputBorder),backgroundColor:t?c:a.getColor(b.InputBackground),boxShadow:t?`inset 0 0 0 3px ${a.getColor(b.Background)}`:void 0},disabled:s}),f.jsx("span",{className:"text-sm font-medium",style:{color:l},children:i})]})}function BI({id:e,label:t,children:n,required:r,className:i,error:s}){const o=Se(),a=o.getColor(b.InputText),l=o.getColor(b.ErrorText);return f.jsxs("fieldset",{id:e,className:i,children:[t&&f.jsxs("legend",{className:"mb-1.5 block text-sm font-medium",style:{color:a},children:[t,r&&f.jsx("span",{style:{color:l,marginLeft:4},children:"*"})]}),f.jsx("div",{className:"flex flex-col gap-2",children:n}),s&&f.jsx("p",{className:"mt-1 text-xs",style:{color:l},children:s})]})}const ex=Object.assign(FI,{Group:BI});function Yu({id:e,label:t,suffix:n,prefix:r,className:i,noMargin:s,rows:o=3,type:a="text",required:l=!1,error:c,ariaInvalid:d,inputRef:u,autoFocus:p=!1,style:m,borderless:y=!1,...w}){const x=Se();return f.jsxs("div",{className:ze({"mb-2":!s},i),children:[t&&f.jsx(dg,{id:e,text:t,required:l}),f.jsx("textarea",{className:ze("resize-none max-h-36 w-full py-2 px-3 block outline-none transition-[border-color,box-shadow] duration-200 rounded-lg",{"border border-solid focus:ring-2 focus:ring-offset-0":!y,"border-none bg-transparent":y}),id:e,rows:o,"aria-invalid":d,...w,ref:u,autoFocus:p,style:{...m,fontSize:"14px",color:c?x.getColor(b.ErrorText):x.getColor(b.InputText),...!y&&{backgroundColor:x.getColor(b.InputBackground),borderColor:c?x.getColor(b.ErrorBorder):x.getColor(b.InputBorder),borderRadius:x.getRadius(),"--tw-ring-color":x.getColor(b.LinkColor)}}}),!!c&&f.jsx("p",{className:"mt-1 text-xs",style:{color:x.getColor(b.ErrorText)},children:c})]})}function xo({variant:e="block",className:t=""}){const n=Se(),r=n.getText,a=`text-[10px] flex items-center justify-center gap-1 transition-opacity hover:opacity-80 ${e==="block"?"w-full py-1.5 px-3 text-center":""} ${t}`.trim(),l=e==="block"?{color:n.getColor(b.FooterText)}:{color:n.getColor(b.FooterText)};return f.jsxs("a",{href:"https://www.chatier.app",target:"_blank",rel:"noopener noreferrer",className:a,style:l,children:[f.jsx("span",{children:r(re.PoweredBy)}),f.jsx("span",{className:"font-semibold",children:"Chatier"})]})}function $I({onOk:e,clientId:t,widgetId:n,appearance:r,aiAgentMode:i=!1,onAIAgentStart:s,onOperatorConnect:o,isConnectingToOperator:a=!1}){var T,j,E,A,I,N;const l=Se(),{defaultValues:c,widget:d,setIsHaveChat:u}=ie(),[p,m]=v.useState(!1),y=v.useRef(null);v.useEffect(()=>{const D=setTimeout(()=>{var B;const G=(B=y.current)==null?void 0:B.querySelector('input:not([type="hidden"]), select, textarea');G==null||G.focus()},150);return()=>clearTimeout(D)},[]);const w=Gu(),x=qm(),h=!!c&&"username"in c,g=(j=(T=r==null?void 0:r.body)==null?void 0:T.inputs)==null?void 0:j.reduce((D,G)=>{let B=G.remember?ma(G.name):c==null?void 0:c[G.name];return G.options&&B&&!G.options.includes(B)&&(B=void 0),G.name==="username"&&h&&(B=c.username),D[G.name]=B||"",D},{}),k=Zm((A=(E=r==null?void 0:r.body)==null?void 0:E.inputs)==null?void 0:A.reduce((D,G)=>(D[G.name]=G.required?Kc().required(`${G.label} alanı zorunludur`):Kc(),D),{})),C=XS({init:{...g},schema:k,validateOnBlur:!1,action:async D=>{var G,B;if(!(p||a)){m(!0);try{h&&(D.username=c.username),c!=null&&c.secret_data&&(D.secret_data=c.secret_data);for(const $ in D)typeof D[$]=="string"&&(D[$]=D[$].trim());if(o){for(const $ of((G=r==null?void 0:r.body)==null?void 0:G.inputs)||[])$.remember&&Z0($.name,D[$.name]);o(D);return}const[F,M]=await x.mutateAsync({inputs:D,history:w.history,client_id:t,widget_id:n,device_id:mi((d==null?void 0:d.link_id)||""),is_agent_mode:i});if($n(M)){Lp(F)&&(Ln(rt.CustomerToken,F.customer_token,(d==null?void 0:d.link_id)||""),Ln(rt.CustomerRefreshToken,F.customer_refresh_token,(d==null?void 0:d.link_id)||""),Ln(rt.DeviceId,F.device_id,(d==null?void 0:d.link_id)||"")),w.clearHistory();for(const $ of((B=r==null?void 0:r.body)==null?void 0:B.inputs)||[])$.remember&&Z0($.name,D[$.name]);u(!0),i?s==null||s():e==null||e();return}ho(F,{form:C})}catch(F){console.error("Chat creation error:",F)}finally{m(!1)}}}}),S=l.getColor(b.GreeterBackground);return f.jsxs("section",{className:"h-full overflow-y-auto px-5",style:{backgroundColor:S},children:[f.jsxs("form",{ref:y,autoComplete:"off",className:"grid grid-cols-1 gap-4",onSubmit:C.handleSubmit,children:[(N=(I=r==null?void 0:r.body)==null?void 0:I.inputs)==null?void 0:N.map((D,G)=>{var F,M;const B=G===0;if(["text","email","phone"].includes(D.type))return f.jsx(AI,{id:D.name,name:D.name,type:D.type,label:D.label,value:C.values[D.name],onChange:C.handleChange,onBlur:C.handleBlur,disabled:D.name==="username"&&h,readOnly:D.name==="username"&&h,autoComplete:"off",placeholder:D.placeholder,error:C.errors[D.name],ariaInvalid:C.errors.name?!0:void 0,required:D.required,noMargin:!0,autoFocus:B},D.name);if(D.type==="select")return f.jsx(NI,{id:D.name,name:D.name,value:C.values[D.name],onChange:C.handleChange,label:D.label,error:C.errors[D.name],required:D.required,placeholder:D.placeholder,autoFocus:B,children:(F=D.options)==null?void 0:F.map($=>f.jsx("option",{value:$,children:$},$))},D.name);if(D.type==="checkbox")return f.jsx(LI,{id:D.name,name:D.name,value:C.values[D.name],checked:C.values[D.name]==="true",onChange:C.handleChange,required:D.required,error:C.errors[D.name],children:D.label},D.name);if(D.type==="radio")return f.jsx(ex.Group,{id:D.name,label:D.label,required:D.required,error:C.errors[D.name],children:(M=D.options)==null?void 0:M.map($=>f.jsx(ex,{onChange:R=>{R?C.setFieldValue(D.name,$):C.setFieldValue(D.name,"")},id:$,name:D.name,value:$===C.values[D.name],children:$},$))},D.name);if(D.type==="textarea")return f.jsx(Yu,{id:D.name,name:D.name,value:C.values[D.name],onChange:C.handleChange,onBlur:C.handleBlur,placeholder:D.placeholder,error:C.errors[D.name],required:D.required,label:D.label,noMargin:!0,autoFocus:B},D.name)}),f.jsx(Rt,{textKey:b.GreeterButtonText,bgKey:b.GreeterButtonBackground,type:"submit",size:"lg",disabled:p||a,className:"transition-all duration-300 hover:opacity-90 transform hover:translate-y-[-1px] shadow-sm",children:p||a?f.jsxs("div",{className:"flex items-center justify-center",children:[f.jsx("span",{className:"mr-2",children:o?"Bağlanıyor":"Yükleniyor"}),f.jsx("span",{className:"animate-pulse",children:"..."})]}):o?"Canlı Desteğe Bağlan":"Sohbet Oluştur"})]}),f.jsx(xo,{variant:"block",className:"py-2"})]})}var en=(e=>(e.Open="open",e.Closed="closed",e.Pending="pending",e.Deleted="deleted",e.Created="created",e.Agent="agent",e))(en||{}),mn=(e=>(e.AdminJoin="admin_join",e.AdminLeave="admin_leave",e.ChatCreated="chat_created",e.AdminToggleUpload="admin_toggle_upload",e))(mn||{}),we=(e=>(e.Customer="customer",e.User="user",e.Agent="agent",e.System="system",e.Activity="activity",e))(we||{});const gs=e=>{const t=zE(),n=(r,i)=>{var o;const s=((o=MB.find(a=>a.name===r))==null?void 0:o.path)??"/";return typeof i=="object"&&s.includes(":")?Object.entries(i).reduce((a,[l,c])=>a.replace(`:${l}`,c),s):i?`${s}?${i}`:s};return{push:(r,i)=>{t(n(r,i),e)},path:n}};var zI={exports:{}},Kd={exports:{}},tx;function JS(){return tx||(tx=1,function(e,t){(function(n,r){e.exports=r()})(lh,function(){var n=1e3,r=6e4,i=36e5,s="millisecond",o="second",a="minute",l="hour",c="day",d="week",u="month",p="quarter",m="year",y="date",w="Invalid Date",x=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(B){var F=["th","st","nd","rd"],M=B%100;return"["+B+(F[(M-20)%10]||F[M]||F[0])+"]"}},k=function(B,F,M){var $=String(B);return!$||$.length>=F?B:""+Array(F+1-$.length).join(M)+B},C={s:k,z:function(B){var F=-B.utcOffset(),M=Math.abs(F),$=Math.floor(M/60),R=M%60;return(F<=0?"+":"-")+k($,2,"0")+":"+k(R,2,"0")},m:function B(F,M){if(F.date()<M.date())return-B(M,F);var $=12*(M.year()-F.year())+(M.month()-F.month()),R=F.clone().add($,u),z=M-R<0,U=F.clone().add($+(z?-1:1),u);return+(-($+(M-R)/(z?R-U:U-R))||0)},a:function(B){return B<0?Math.ceil(B)||0:Math.floor(B)},p:function(B){return{M:u,y:m,w:d,d:c,D:y,h:l,m:a,s:o,ms:s,Q:p}[B]||String(B||"").toLowerCase().replace(/s$/,"")},u:function(B){return B===void 0}},S="en",T={};T[S]=g;var j="$isDayjsObject",E=function(B){return B instanceof D||!(!B||!B[j])},A=function B(F,M,$){var R;if(!F)return S;if(typeof F=="string"){var z=F.toLowerCase();T[z]&&(R=z),M&&(T[z]=M,R=z);var U=F.split("-");if(!R&&U.length>1)return B(U[0])}else{var W=F.name;T[W]=F,R=W}return!$&&R&&(S=R),R||!$&&S},I=function(B,F){if(E(B))return B.clone();var M=typeof F=="object"?F:{};return M.date=B,M.args=arguments,new D(M)},N=C;N.l=A,N.i=E,N.w=function(B,F){return I(B,{locale:F.$L,utc:F.$u,x:F.$x,$offset:F.$offset})};var D=function(){function B(M){this.$L=A(M.locale,null,!0),this.parse(M),this.$x=this.$x||M.x||{},this[j]=!0}var F=B.prototype;return F.parse=function(M){this.$d=function($){var R=$.date,z=$.utc;if(R===null)return new Date(NaN);if(N.u(R))return new Date;if(R instanceof Date)return new Date(R);if(typeof R=="string"&&!/Z$/i.test(R)){var U=R.match(x);if(U){var W=U[2]-1||0,q=(U[7]||"0").substring(0,3);return z?new Date(Date.UTC(U[1],W,U[3]||1,U[4]||0,U[5]||0,U[6]||0,q)):new Date(U[1],W,U[3]||1,U[4]||0,U[5]||0,U[6]||0,q)}}return new Date(R)}(M),this.init()},F.init=function(){var M=this.$d;this.$y=M.getFullYear(),this.$M=M.getMonth(),this.$D=M.getDate(),this.$W=M.getDay(),this.$H=M.getHours(),this.$m=M.getMinutes(),this.$s=M.getSeconds(),this.$ms=M.getMilliseconds()},F.$utils=function(){return N},F.isValid=function(){return this.$d.toString()!==w},F.isSame=function(M,$){var R=I(M);return this.startOf($)<=R&&R<=this.endOf($)},F.isAfter=function(M,$){return I(M)<this.startOf($)},F.isBefore=function(M,$){return this.endOf($)<I(M)},F.$g=function(M,$,R){return N.u(M)?this[$]:this.set(R,M)},F.unix=function(){return Math.floor(this.valueOf()/1e3)},F.valueOf=function(){return this.$d.getTime()},F.startOf=function(M,$){var R=this,z=!!N.u($)||$,U=N.p(M),W=function(H,te){var O=N.w(R.$u?Date.UTC(R.$y,te,H):new Date(R.$y,te,H),R);return z?O:O.endOf(c)},q=function(H,te){return N.w(R.toDate()[H].apply(R.toDate("s"),(z?[0,0,0,0]:[23,59,59,999]).slice(te)),R)},ne=this.$W,oe=this.$M,me=this.$D,ue="set"+(this.$u?"UTC":"");switch(U){case m:return z?W(1,0):W(31,11);case u:return z?W(1,oe):W(0,oe+1);case d:var Q=this.$locale().weekStart||0,de=(ne<Q?ne+7:ne)-Q;return W(z?me-de:me+(6-de),oe);case c:case y:return q(ue+"Hours",0);case l:return q(ue+"Minutes",1);case a:return q(ue+"Seconds",2);case o:return q(ue+"Milliseconds",3);default:return this.clone()}},F.endOf=function(M){return this.startOf(M,!1)},F.$set=function(M,$){var R,z=N.p(M),U="set"+(this.$u?"UTC":""),W=(R={},R[c]=U+"Date",R[y]=U+"Date",R[u]=U+"Month",R[m]=U+"FullYear",R[l]=U+"Hours",R[a]=U+"Minutes",R[o]=U+"Seconds",R[s]=U+"Milliseconds",R)[z],q=z===c?this.$D+($-this.$W):$;if(z===u||z===m){var ne=this.clone().set(y,1);ne.$d[W](q),ne.init(),this.$d=ne.set(y,Math.min(this.$D,ne.daysInMonth())).$d}else W&&this.$d[W](q);return this.init(),this},F.set=function(M,$){return this.clone().$set(M,$)},F.get=function(M){return this[N.p(M)]()},F.add=function(M,$){var R,z=this;M=Number(M);var U=N.p($),W=function(oe){var me=I(z);return N.w(me.date(me.date()+Math.round(oe*M)),z)};if(U===u)return this.set(u,this.$M+M);if(U===m)return this.set(m,this.$y+M);if(U===c)return W(1);if(U===d)return W(7);var q=(R={},R[a]=r,R[l]=i,R[o]=n,R)[U]||1,ne=this.$d.getTime()+M*q;return N.w(ne,this)},F.subtract=function(M,$){return this.add(-1*M,$)},F.format=function(M){var $=this,R=this.$locale();if(!this.isValid())return R.invalidDate||w;var z=M||"YYYY-MM-DDTHH:mm:ssZ",U=N.z(this),W=this.$H,q=this.$m,ne=this.$M,oe=R.weekdays,me=R.months,ue=R.meridiem,Q=function(te,O,ee,K){return te&&(te[O]||te($,z))||ee[O].slice(0,K)},de=function(te){return N.s(W%12||12,te,"0")},H=ue||function(te,O,ee){var K=te<12?"AM":"PM";return ee?K.toLowerCase():K};return z.replace(h,function(te,O){return O||function(ee){switch(ee){case"YY":return String($.$y).slice(-2);case"YYYY":return N.s($.$y,4,"0");case"M":return ne+1;case"MM":return N.s(ne+1,2,"0");case"MMM":return Q(R.monthsShort,ne,me,3);case"MMMM":return Q(me,ne);case"D":return $.$D;case"DD":return N.s($.$D,2,"0");case"d":return String($.$W);case"dd":return Q(R.weekdaysMin,$.$W,oe,2);case"ddd":return Q(R.weekdaysShort,$.$W,oe,3);case"dddd":return oe[$.$W];case"H":return String(W);case"HH":return N.s(W,2,"0");case"h":return de(1);case"hh":return de(2);case"a":return H(W,q,!0);case"A":return H(W,q,!1);case"m":return String(q);case"mm":return N.s(q,2,"0");case"s":return String($.$s);case"ss":return N.s($.$s,2,"0");case"SSS":return N.s($.$ms,3,"0");case"Z":return U}return null}(te)||U.replace(":","")})},F.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},F.diff=function(M,$,R){var z,U=this,W=N.p($),q=I(M),ne=(q.utcOffset()-this.utcOffset())*r,oe=this-q,me=function(){return N.m(U,q)};switch(W){case m:z=me()/12;break;case u:z=me();break;case p:z=me()/3;break;case d:z=(oe-ne)/6048e5;break;case c:z=(oe-ne)/864e5;break;case l:z=oe/i;break;case a:z=oe/r;break;case o:z=oe/n;break;default:z=oe}return R?z:N.a(z)},F.daysInMonth=function(){return this.endOf(u).$D},F.$locale=function(){return T[this.$L]},F.locale=function(M,$){if(!M)return this.$L;var R=this.clone(),z=A(M,$,!0);return z&&(R.$L=z),R},F.clone=function(){return N.w(this.$d,this)},F.toDate=function(){return new Date(this.valueOf())},F.toJSON=function(){return this.isValid()?this.toISOString():null},F.toISOString=function(){return this.$d.toISOString()},F.toString=function(){return this.$d.toUTCString()},B}(),G=D.prototype;return I.prototype=G,[["$ms",s],["$s",o],["$m",a],["$H",l],["$W",c],["$M",u],["$y",m],["$D",y]].forEach(function(B){G[B[1]]=function(F){return this.$g(F,B[0],B[1])}}),I.extend=function(B,F){return B.$i||(B(F,D,I),B.$i=!0),I},I.locale=A,I.isDayjs=E,I.unix=function(B){return I(1e3*B)},I.en=T[S],I.Ls=T,I.p={},I})}(Kd)),Kd.exports}(function(e,t){(function(n,r){e.exports=r(JS())})(lh,function(n){function r(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}var i=r(n),s={name:"tr",weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekStart:1,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(o){return o+"."}};return i.default.locale(s,null,!0),s})})(zI);var eC={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(lh,function(){return function(n,r,i){n=n||{};var s=r.prototype,o={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function a(c,d,u,p){return s.fromToBase(c,d,u,p)}i.en.relativeTime=o,s.fromToBase=function(c,d,u,p,m){for(var y,w,x,h=u.$locale().relativeTime||o,g=n.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],k=g.length,C=0;C<k;C+=1){var S=g[C];S.d&&(y=p?i(c).diff(u,S.d,!0):u.diff(c,S.d,!0));var T=(n.rounding||Math.round)(Math.abs(y));if(x=y>0,T<=S.r||!S.r){T<=1&&C>0&&(S=g[C-1]);var j=h[S.l];m&&(T=m(""+T)),w=typeof j=="string"?j.replace("%d",T):j(T,d,S.l,x);break}}if(d)return w;var E=x?h.future:h.past;return typeof E=="function"?E(w):E.replace("%s",w)},s.to=function(c,d){return a(c,d,this,!0)},s.from=function(c,d){return a(c,d,this)};var l=function(c){return c.$u?i.utc():i()};s.toNow=function(c){return this.to(l(this),c)},s.fromNow=function(c){return this.from(l(this),c)}}})})(eC);var VI=eC.exports;const UI=Rr(VI);var HI=JS();const Xd=Rr(HI),WI=(e="tr")=>(Xd.extend(UI),Xd.locale(e),Xd);function qI({onHasHistory:e,emptyStateText:t}){const n=ie(g=>g.widget),r=ie(g=>g.setHistoryChat),i=ie(g=>g.setHistoryMessages),s=Se(),o=gs(),[a,l]=v.useState(null),c=WI(),d=v.useRef(!1),u=n!=null&&n.link_id?mi(n.link_id):null,{data:p,isLoading:m}=uM((n==null?void 0:n.link_id)||"",u||"");if(v.useEffect(()=>{if(!m&&p){const[g,k]=p,C=$n(k)&&Array.isArray(g)&&g.length>0;if(C&&!d.current){const S=g[0];if(S.status===en.Open||S.status===en.Pending){console.log("ChatHistoryList: Auto-joining active chat",S._id),d.current=!0,r(S),i(null),o.push("chat");return}}e&&e(C)}},[m,p,e,o,r,i]),!(n!=null&&n.link_id))return null;if(m)return f.jsx("div",{className:"p-4 text-center text-xs opacity-50",children:"Yükleniyor..."});if(!p)return null;const[y,w]=p;if(!$n(w)||!Array.isArray(y))return null;const x=g=>c(g).fromNow(),h=g=>{var k;return g.who_joined_details&&Array.isArray(g.who_joined_details)&&g.who_joined_details.length>0?g.who_joined_details[0].name||"Atanmamış":g.participant_logs&&Array.isArray(g.participant_logs)&&g.participant_logs.length>0?g.participant_logs[0].name||"Atanmamış":(k=g.archive_summary)!=null&&k.admin_name?g.archive_summary.admin_name:"Atanmamış"};return y.length===0?f.jsx("div",{className:"h-full flex items-center justify-center p-6 text-center",children:f.jsxs("div",{className:"max-w-xs",children:[f.jsx("div",{className:"text-sm font-medium opacity-80",children:"Henüz sohbet yok"}),f.jsx("div",{className:"mt-2 text-xs opacity-60",children:t||"Yeni bir sohbet başlatmak için aşağıdaki butonu kullanabilirsiniz."})]})}):f.jsx("div",{className:"flex flex-col h-full",children:f.jsx("div",{className:"flex-1 overflow-y-auto space-y-0 min-h-0",children:y.map(g=>f.jsxs("button",{type:"button",className:"w-full flex justify-between items-center gap-2 p-5 text-left transition-colors",style:{color:s.getColor(b.InputText),backgroundColor:a===g._id?s.getColor(b.MessageAdminBackground):"transparent",cursor:"pointer"},onMouseEnter:()=>l(g._id),onMouseLeave:()=>l(null),onClick:()=>{r(g),i(null),o.push("chat")},children:[f.jsx("span",{className:"font-medium text-sm truncate flex-1 min-w-0",children:h(g)}),f.jsx("span",{className:"text-xs flex-shrink-0 tabular-nums",style:{color:s.getColor(b.FooterText)},children:x(g.created_at)})]},g._id))})})}const Zd=[Ne.Light,Ne.Dark,Ne.System];function GI(e){switch(e){case Ne.Light:return X.Sun;case Ne.Dark:return X.Moon;case Ne.System:return X.Monitor;default:return X.Monitor}}function YI(){const e=Se(),{mode:t,setMode:n}=e,r=()=>{const s=Zd.indexOf(t),o=Zd[(s+1)%Zd.length];n(o)},i=GI(t);return f.jsx("button",{type:"button",onClick:r,className:"flex items-center justify-center p-1.5 rounded-md hover:opacity-80 transition-opacity",style:{backgroundColor:"transparent",color:e.getColor(b.HeaderText)},title:t===Ne.Light?"Açık tema":t===Ne.Dark?"Koyu tema":"Sistem",children:f.jsx(i,{className:"size-5"})})}const cr=Object.create(null);cr.open="0";cr.close="1";cr.ping="2";cr.pong="3";cr.message="4";cr.upgrade="5";cr.noop="6";const cc=Object.create(null);Object.keys(cr).forEach(e=>{cc[cr[e]]=e});const Yp={type:"error",data:"parser error"},tC=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",nC=typeof ArrayBuffer=="function",rC=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,fg=({type:e,data:t},n,r)=>tC&&t instanceof Blob?n?r(t):nx(t,r):nC&&(t instanceof ArrayBuffer||rC(t))?n?r(t):nx(new Blob([t]),r):r(cr[e]+(t||"")),nx=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function rx(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Jd;function QI(e,t){if(tC&&e.data instanceof Blob)return e.data.arrayBuffer().then(rx).then(t);if(nC&&(e.data instanceof ArrayBuffer||rC(e.data)))return t(rx(e.data));fg(e,!1,n=>{Jd||(Jd=new TextEncoder),t(Jd.encode(n))})}const ix="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Zo=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<ix.length;e++)Zo[ix.charCodeAt(e)]=e;const KI=e=>{let t=e.length*.75,n=e.length,r,i=0,s,o,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const c=new ArrayBuffer(t),d=new Uint8Array(c);for(r=0;r<n;r+=4)s=Zo[e.charCodeAt(r)],o=Zo[e.charCodeAt(r+1)],a=Zo[e.charCodeAt(r+2)],l=Zo[e.charCodeAt(r+3)],d[i++]=s<<2|o>>4,d[i++]=(o&15)<<4|a>>2,d[i++]=(a&3)<<6|l&63;return c},XI=typeof ArrayBuffer=="function",pg=(e,t)=>{if(typeof e!="string")return{type:"message",data:iC(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:ZI(e.substring(1),t)}:cc[n]?e.length>1?{type:cc[n],data:e.substring(1)}:{type:cc[n]}:Yp},ZI=(e,t)=>{if(XI){const n=KI(e);return iC(n,t)}else return{base64:!0,data:e}},iC=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},sC="",JI=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((s,o)=>{fg(s,!1,a=>{r[o]=a,++i===n&&t(r.join(sC))})})},eL=(e,t)=>{const n=e.split(sC),r=[];for(let i=0;i<n.length;i++){const s=pg(n[i],t);if(r.push(s),s.type==="error")break}return r};function tL(){return new TransformStream({transform(e,t){QI(e,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const s=new DataView(i.buffer);s.setUint8(0,126),s.setUint16(1,r)}else{i=new Uint8Array(9);const s=new DataView(i.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let ef;function zl(e){return e.reduce((t,n)=>t+n.length,0)}function Vl(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function nL(e,t){ef||(ef=new TextDecoder);const n=[];let r=0,i=-1,s=!1;return new TransformStream({transform(o,a){for(n.push(o);;){if(r===0){if(zl(n)<1)break;const l=Vl(n,1);s=(l[0]&128)===128,i=l[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(zl(n)<2)break;const l=Vl(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(zl(n)<8)break;const l=Vl(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),d=c.getUint32(0);if(d>Math.pow(2,21)-1){a.enqueue(Yp);break}i=d*Math.pow(2,32)+c.getUint32(4),r=3}else{if(zl(n)<i)break;const l=Vl(n,i);a.enqueue(pg(s?l:ef.decode(l),t)),r=0}if(i===0||i>e){a.enqueue(Yp);break}}}})}const oC=4;function st(e){if(e)return rL(e)}function rL(e){for(var t in st.prototype)e[t]=st.prototype[t];return e}st.prototype.on=st.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};st.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};st.prototype.off=st.prototype.removeListener=st.prototype.removeAllListeners=st.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};st.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this};st.prototype.emitReserved=st.prototype.emit;st.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};st.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Qu=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),wn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),iL="arraybuffer";function aC(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const sL=wn.setTimeout,oL=wn.clearTimeout;function Ku(e,t){t.useNativeTimers?(e.setTimeoutFn=sL.bind(wn),e.clearTimeoutFn=oL.bind(wn)):(e.setTimeoutFn=wn.setTimeout.bind(wn),e.clearTimeoutFn=wn.clearTimeout.bind(wn))}const aL=1.33;function lL(e){return typeof e=="string"?cL(e):Math.ceil((e.byteLength||e.size)*aL)}function cL(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function lC(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function uL(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function dL(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let s=n[r].split("=");t[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return t}class fL extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class hg extends st{constructor(t){super(),this.writable=!1,Ku(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new fL(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=pg(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=uL(t);return n.length?"?"+n:""}}class pL extends hg{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};eL(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,JI(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=lC()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let cC=!1;try{cC=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const hL=cC;function mL(){}class gL extends pL{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,s)=>{this.onError("xhr post error",i,s)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class ar extends st{constructor(t,n,r){super(),this.createRequest=t,Ku(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=aC(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=ar.requestsCount++,ar.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=mL,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete ar.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}ar.requestsCount=0;ar.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",sx);else if(typeof addEventListener=="function"){const e="onpagehide"in wn?"pagehide":"unload";addEventListener(e,sx,!1)}}function sx(){for(let e in ar.requests)ar.requests.hasOwnProperty(e)&&ar.requests[e].abort()}const vL=function(){const e=uC({xdomain:!1});return e&&e.responseType!==null}();class yL extends gL{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=vL&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new ar(uC,this.uri(),t)}}function uC(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||hL))return new XMLHttpRequest}catch{}if(!t)try{return new wn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const dC=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class xL extends hg{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=dC?{}:aC(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;fg(r,this.supportsBinary,s=>{try{this.doWrite(r,s)}catch{}i&&Qu(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=lC()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const tf=wn.WebSocket||wn.MozWebSocket;class wL extends xL{createSocket(t,n,r){return dC?new tf(t,n,r):n?new tf(t,n):new tf(t)}doWrite(t,n){this.ws.send(n)}}class bL extends hg{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=nL(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=tL();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const s=()=>{r.read().then(({done:a,value:l})=>{a||(this.onPacket(l),s())}).catch(a=>{})};s();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this._writer.write(r).then(()=>{i&&Qu(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const kL={websocket:wL,webtransport:bL,polling:yL},SL=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,CL=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Qp(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=SL.exec(e||""),s={},o=14;for(;o--;)s[CL[o]]=i[o]||"";return n!=-1&&r!=-1&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=TL(s,s.path),s.queryKey=_L(s,s.query),s}function TL(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function _L(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,s){i&&(n[i]=s)}),n}const Kp=typeof addEventListener=="function"&&typeof removeEventListener=="function",uc=[];Kp&&addEventListener("offline",()=>{uc.forEach(e=>e())},!1);class ui extends st{constructor(t,n){if(super(),this.binaryType=iL,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=Qp(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=Qp(n.host).host);Ku(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=dL(this.opts.query)),Kp&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},uc.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=oC,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&ui.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",ui.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=lL(i)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Qu(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const s={type:t,data:n,options:r};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(ui.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Kp&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=uc.indexOf(this._offlineEventListener);r!==-1&&uc.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}ui.protocol=oC;class EL extends ui{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;ui.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",u=>{if(!r)if(u.type==="pong"&&u.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;ui.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const p=new Error("probe error");p.transport=n.name,this.emitReserved("upgradeError",p)}}))};function s(){r||(r=!0,d(),n.close(),n=null)}const o=u=>{const p=new Error("probe error: "+u);p.transport=n.name,s(),this.emitReserved("upgradeError",p)};function a(){o("transport closed")}function l(){o("socket closed")}function c(u){n&&u.name!==n.name&&s()}const d=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};n.once("open",i),n.once("error",o),n.once("close",a),this.once("close",l),this.once("upgrading",c),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let jL=class extends EL{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(i=>kL[i]).filter(i=>!!i)),super(t,r)}};function AL(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=Qp(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const s=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+s+":"+r.port+t,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}const RL=typeof ArrayBuffer=="function",PL=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,fC=Object.prototype.toString,ML=typeof Blob=="function"||typeof Blob<"u"&&fC.call(Blob)==="[object BlobConstructor]",OL=typeof File=="function"||typeof File<"u"&&fC.call(File)==="[object FileConstructor]";function mg(e){return RL&&(e instanceof ArrayBuffer||PL(e))||ML&&e instanceof Blob||OL&&e instanceof File}function dc(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(dc(e[n]))return!0;return!1}if(mg(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return dc(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&dc(e[n]))return!0;return!1}function NL(e){const t=[],n=e.data,r=e;return r.data=Xp(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Xp(e,t){if(!e)return e;if(mg(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Xp(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Xp(e[r],t));return n}return e}function DL(e,t){return e.data=Zp(e.data,t),delete e.attachments,e}function Zp(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Zp(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Zp(e[n],t));return e}const IL=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],LL=5;var Ee;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(Ee||(Ee={}));class FL{constructor(t){this.replacer=t}encode(t){return(t.type===Ee.EVENT||t.type===Ee.ACK)&&dc(t)?this.encodeAsBinary({type:t.type===Ee.EVENT?Ee.BINARY_EVENT:Ee.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===Ee.BINARY_EVENT||t.type===Ee.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=NL(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function ox(e){return Object.prototype.toString.call(e)==="[object Object]"}class gg extends st{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===Ee.BINARY_EVENT;r||n.type===Ee.BINARY_ACK?(n.type=r?Ee.EVENT:Ee.ACK,this.reconstructor=new BL(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(mg(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(Ee[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Ee.BINARY_EVENT||r.type===Ee.BINARY_ACK){const s=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const o=t.substring(s,n);if(o!=Number(o)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(o)}if(t.charAt(n+1)==="/"){const s=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(s,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const s=n+1;for(;++n;){const o=t.charAt(n);if(o==null||Number(o)!=o){--n;break}if(n===t.length)break}r.id=Number(t.substring(s,n+1))}if(t.charAt(++n)){const s=this.tryParse(t.substr(n));if(gg.isPayloadValid(r.type,s))r.data=s;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case Ee.CONNECT:return ox(n);case Ee.DISCONNECT:return n===void 0;case Ee.CONNECT_ERROR:return typeof n=="string"||ox(n);case Ee.EVENT:case Ee.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&IL.indexOf(n[0])===-1);case Ee.ACK:case Ee.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class BL{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=DL(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const $L=Object.freeze(Object.defineProperty({__proto__:null,Decoder:gg,Encoder:FL,get PacketType(){return Ee},protocol:LL},Symbol.toStringTag,{value:"Module"}));function Nn(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const zL=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class pC extends st{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Nn(t,"open",this.onopen.bind(this)),Nn(t,"packet",this.onpacket.bind(this)),Nn(t,"error",this.onerror.bind(this)),Nn(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,i,s;if(zL.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const o={type:Ee.EVENT,data:n};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const d=this.ids++,u=n.pop();this._registerAckCallback(d,u),o.id=d}const a=(i=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||i===void 0?void 0:i.writable,l=this.connected&&!(!((s=this.io.engine)===null||s===void 0)&&s._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const s=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},i),o=(...a)=>{this.io.clearTimeoutFn(s),n.apply(this,a)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...n){return new Promise((r,i)=>{const s=(o,a)=>o?i(o):r(a);s.withError=!0,n.push(s),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...s)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...s)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Ee.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Ee.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Ee.EVENT:case Ee.BINARY_EVENT:this.onevent(t);break;case Ee.ACK:case Ee.BINARY_ACK:this.onack(t);break;case Ee.DISCONNECT:this.ondisconnect();break;case Ee.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:Ee.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ee.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Ro(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Ro.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};Ro.prototype.reset=function(){this.attempts=0};Ro.prototype.setMin=function(e){this.ms=e};Ro.prototype.setMax=function(e){this.max=e};Ro.prototype.setJitter=function(e){this.jitter=e};class Jp extends st{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Ku(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Ro({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||$L;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new jL(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=Nn(n,"open",function(){r.onopen(),t&&t()}),s=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},o=Nn(n,"error",s);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{i(),s(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Nn(t,"ping",this.onping.bind(this)),Nn(t,"data",this.ondata.bind(this)),Nn(t,"error",this.onerror.bind(this)),Nn(t,"close",this.onclose.bind(this)),Nn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Qu(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new pC(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Uo={};function fc(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=AL(e,t.path||"/socket.io"),r=n.source,i=n.id,s=n.path,o=Uo[i]&&s in Uo[i].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let l;return a?l=new Jp(r,t):(Uo[i]||(Uo[i]=new Jp(r,t)),l=Uo[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(fc,{Manager:Jp,Socket:pC,io:fc,connect:fc});const hC=v.createContext(null),dr=()=>{const e=v.useContext(hC);if(!e)throw new Error("useWebsocket must be used within a WebSocketProvider");return e},VL=({children:e})=>{const{widget:t,isHaveChat:n,isAIAgentMode:r}=ie(),i=v.useRef(null),s=v.useRef(!1),o=v.useRef(!1),a=v.useRef(null),[l,c]=v.useState(!1),[d,u]=v.useState(!1),p=v.useCallback(S=>{var T;console.log("WS: cleanupSocket called",{reason:S,hasSocket:!!i.current,isConnected:(T=i.current)==null?void 0:T.connected,currentLinkId:a.current}),i.current&&(console.log("WS: Cleaning up existing socket.",S||""),i.current.removeAllListeners(),i.current.disconnect(),i.current=null),c(!1),u(!1),o.current=!1,s.current=!1,a.current=null},[]),m=v.useCallback((S,T,j)=>{if(a.current===S&&(o.current||i.current&&i.current.connected)){console.log("WS: Connect called but already connecting or connected for same linkId.");return}if(!T&&!j){console.log("WS: Connect skipped - no active chat or AI agent mode");return}const E=Xo(rt.CustomerToken,S)||ma("customer_token"),A=Xo(rt.CustomerRefreshToken,S)||ma("customer_refresh_token");if(!E||!A){if(console.log("WS: Connect skipped - missing required tokens"),T){console.log("WS: Clearing stale isHaveChat flag due to missing tokens"),localStorage.removeItem("lc:widget:isHaveChat");try{ie.getState().setIsHaveChat(!1)}catch{}}return}if(i.current&&!i.current.connected&&(console.log("WS: Cleaning up disconnected/failed socket before new connection"),i.current.removeAllListeners(),i.current.disconnect(),i.current=null),i.current&&i.current.connected){console.log("WS: Already connected, skipping new connection");return}console.log("WS: Attempting to connect...",{linkId:S,tokenPrefix:`${E==null?void 0:E.substring(0,20)}...`,refreshTokenPrefix:`${A==null?void 0:A.substring(0,20)}...`,deviceId:Xo(rt.DeviceId,S)}),o.current=!0,a.current=S;const I=fc(E_,{transports:["websocket"],forceNew:!0,timeout:1e4,auth:{customer_token:E,device_id:Xo(rt.DeviceId,S)||ma("device_id"),customer_refresh_token:A}});i.current=I,I.on("error",N=>{console.error("WS: Websocket error",N),o.current=!1}),I.on("connect_error",N=>{console.error("WS: Connect error",N),o.current=!1,c(!1),u(!1),i.current===I&&(i.current=null,a.current=null);const D=(N==null?void 0:N.message)||String(N);if(D.toLowerCase().includes("unauthorized")||D.includes("401")){console.log("WS: Unauthorized error, clearing tokens only"),S&&nS(S),localStorage.removeItem("lc:widget:isHaveChat");try{ie.getState().setIsHaveChat(!1)}catch{}}}),I.on("disconnect",N=>{var G;console.log("WS: Disconnected",N),c(!1),u(!1),o.current=!1,s.current=!1,i.current===I&&(i.current=null,a.current=null);const D=ie.getState();N==="io server disconnect"&&((G=D.widget)!=null&&G.link_id)&&(D.isHaveChat||D.isAIAgentMode)&&(console.log("WS: Server disconnect, attempting reconnect..."),setTimeout(()=>{m(D.widget.link_id,D.isHaveChat,D.isAIAgentMode)},500))}),I.on("connect",()=>{console.log("WS: Connected successfully"),c(!0),o.current=!1}),I.on("connection:ready",()=>{console.log("WS: Connection ready received"),s.current=!0,u(!0)})},[]);v.useEffect(()=>{const S=t==null?void 0:t.link_id;return S&&(n||r)?(console.log("WS: Auto-connecting due to linkId and isHaveChat/isAIAgentMode",{isHaveChat:n,isAIAgentMode:r}),m(S,n,r)):!n&&!r&&(console.log("WS: Auto-disconnect due to no isHaveChat and no isAIAgentMode"),p("no active chat flags")),()=>{}},[t==null?void 0:t.link_id,n,r,m,p]),v.useEffect(()=>()=>{console.log("WS: Provider unmounting, cleaning up"),p("provider unmount")},[p]),v.useEffect(()=>{const S=()=>{console.log("WS: Page unloading, disconnecting socket"),i.current&&(i.current.disconnect(),i.current=null)},T=()=>{console.log("WS: Page hidden (pagehide), disconnecting socket"),i.current&&(i.current.disconnect(),i.current=null)};return window.addEventListener("beforeunload",S),window.addEventListener("pagehide",T),()=>{window.removeEventListener("beforeunload",S),window.removeEventListener("pagehide",T)}},[]);const y=v.useCallback(()=>{const S=t==null?void 0:t.link_id;S?m(S,n,r):console.warn("WS: Manual connect failed, no link_id available.")},[t==null?void 0:t.link_id,n,r,m]),w=v.useCallback(()=>{console.log("WS: Reconnecting..."),p("manual reconnect");const S=t==null?void 0:t.link_id;S&&setTimeout(()=>{m(S,n,r)},100)},[t==null?void 0:t.link_id,n,r,m,p]),x=v.useCallback(()=>{console.log("WS: Manual disconnect"),p("manual disconnect")},[p]),h=v.useCallback((S,T)=>{var j;(j=i.current)==null||j.on(S,T)},[]),g=v.useCallback((S,T)=>{var j;(j=i.current)==null||j.off(S,T)},[]),k=v.useCallback((S,T,j)=>{i.current&&i.current.connected?i.current.emit(S,T,j):console.warn(`WS: Cannot emit event '${S}', socket not connected.`)},[]),C=v.useMemo(()=>({connectionReady:d,connected:l,connect:y,reconnect:w,disconnect:x,on:h,off:g,emit:k}),[l,d,y,w,x,h,g,k]);return f.jsx(hC.Provider,{value:C,children:e})},Zc=(e,t,n)=>{const r=typeof window<"u"?window:void 0;v.useEffect(()=>(r.addEventListener(e,t),()=>{r.removeEventListener(e,t,!1)}),[e,t,r])},Po=()=>{let e=!1,t=!1;return typeof window<"u"&&(e=new URLSearchParams(window.location.search).get("fullscreen")==="true",t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(window.navigator.userAgent)),e||t},UL=()=>{let e=!1;return typeof window<"u"&&(e=new URLSearchParams(window.location.search).get("fullscreen")==="true"),e},Xu=()=>v.useMemo(()=>typeof window>"u"||new URLSearchParams(window.location.search).get("fullscreen")==="true"?!1:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(window.navigator.userAgent),[]);var Ve=(e=>(e.ChatView="chat:user:view",e.ChatClose="chat:user:close",e.MessageList="message:list",e.MessageCreate="message:create",e.MessageTyping="message:typing",e.WidgetOpen="widget:open",e.WidgetClose="widget:close",e.PageChange="page-change",e.MessageRead="message:read",e.AgentRequestHuman="agent:request:human",e.AgentMessageCreate="agent:message:create",e.ChatUpdateInputs="chat:update:inputs",e))(Ve||{}),ye=(e=>(e.Connect="connect",e.Disconnect="disconnect",e.ConnectionReady="connection:ready",e.MessageAgentCreate="message:agent:create",e.MessageUserCreate="message:user:create",e.MessageCustomerCreate="message:customer:create",e.MessageAgentTyping="message:agent:typing",e.Banned="banned",e.ChatUserClose="chat:user:close",e.ChatUserAssignee="chat:user:assignee",e.ChatToggleUpload="chat:user:upload:toggle",e.ChatUserShowButton="chat:user:show-button",e.ChatUserLeave="chat:user:leave",e.ChatUserJoin="chat:user:join",e.AgentMessageChunk="agent:message:chunk",e.AgentMessageFinalMetadata="agent:message:final_metadata",e.AgentSpamWarning="agent:spam:warning",e.AgentSpamBanned="agent:spam:banned",e))(ye||{});function HL(){const e=Gu(),t=v.useCallback(()=>{const n=window.location.pathname;n!==e.page&&e.setPage(n)},[e.page]);return Zc("popstate",t),null}function WL(){const e=dr(),t=Gu(),n=v.useCallback(()=>{const r=window.location.pathname;if(r!==t.page){if(e){e.emit(Ve.PageChange,{page:r});return}t.setPage(r)}},[e,t.page]);return Zc("popstate",n),v.useEffect(()=>{if(!e)return;const r=PI(),i=RI();r!==i&&(e.emit(Ve.PageChange,{page:i}),t.setPage(i))},[e]),null}function qL(){return HL(),null}const ax=(e,t)=>{var n;return(n=e.find(r=>r.type===t))==null?void 0:n.content};function GL(){var me,ue,Q,de;const e=Se(),t=ie(H=>H.widget),n=ie(H=>H.setOpen),r=ie(H=>H.setAIAgent),i=ie(H=>H.setIsAIAgentMode),s=ie(H=>H.setIsHaveChat),o=ie(H=>H.isHaveChat),a=ie(H=>H.humanNeedRequested),l=ie(H=>H.setHumanNeedRequested),c=ie(H=>H.aiAgent),d=ie(H=>H.setShowActionButtons),[u,p]=v.useState(!1),[m,y]=v.useState(!1),[w,x]=v.useState(null),h=gs(),g=Po(),k=Xu(),[C,S]=v.useState(!0),[T,j]=v.useState(!1),E=Gu(),A=qm(),I=dr(),[N,D]=v.useState(null),G=v.useRef(!1),B=v.useRef(!1),F=v.useRef(!1),M=al(),$=v.useCallback(async()=>{var te,O,ee;if(!t)return;x(null),ie.getState().setHistoryChat(null),ie.getState().setHistoryMessages(null),ie.getState().clearAIAgentState(),d(!1);const H=(((ee=(O=(te=t.appearance)==null?void 0:te.body)==null?void 0:O.inputs)==null?void 0:ee.length)||0)>0;if(N){if(F.current)return;F.current=!0;try{const[K,xe]=await A.mutateAsync({inputs:{username:"Ziyaretçi",email:`visitor_${Date.now()}@temp.local`},history:E.history,client_id:t.client_id,widget_id:t.link_id,device_id:mi(t.link_id),is_agent_mode:!0});$n(xe)&&Lp(K)?(Ln(rt.CustomerToken,K.customer_token,t.link_id),Ln(rt.CustomerRefreshToken,K.customer_refresh_token,t.link_id),Ln(rt.DeviceId,K.device_id,t.link_id),E.clearHistory(),s(!0),r(N),i(!0),h.push("chat")):(ho(K),(K==null?void 0:K.statusCode)===403&&x((K==null?void 0:K.message)||"Sohbet başlatılamadı."))}catch(K){console.error("Error creating chat for AI agent:",K)}finally{F.current=!1}return}if(!H){if(F.current)return;F.current=!0;try{const[K,xe]=await A.mutateAsync({inputs:{},history:E.history,client_id:t.client_id,widget_id:t.link_id,device_id:mi(t.link_id)});$n(xe)&&Lp(K)?(Ln(rt.CustomerToken,K.customer_token,t.link_id),Ln(rt.CustomerRefreshToken,K.customer_refresh_token,t.link_id),Ln(rt.DeviceId,K.device_id,t.link_id),E.clearHistory(),s(!0),h.push("chat")):(ho(K),(K==null?void 0:K.statusCode)===403&&x((K==null?void 0:K.message)||"Sohbet başlatılamadı."))}catch(K){console.error("Error creating chat:",K)}finally{F.current=!1}return}S(!1)},[t,N,A,E,s,r,i,h,d]),R=v.useCallback(H=>{j(H)},[]);if(!t)return null;const z=()=>{n(!1)};v.useEffect(()=>{var O,ee,K;if(!t||G.current)return;G.current=!0;const H=mr(t.link_id);if(H.isAgentMode&&H.agent&&(M!=null&&M.accessToken)){if(r(H.agent),i(!0),H.sessionId&&ie.getState().setAIAgentSessionId(H.sessionId),H.humanNeedRequested){if(ie.getState().setHumanNeedRequested(!0),!((((K=(ee=(O=t.appearance)==null?void 0:O.body)==null?void 0:ee.inputs)==null?void 0:K.length)||0)>0)){h.push("chat");return}return}D(H.agent),h.push("chat");return}(async()=>{try{const[xe,ge]=await fM(t.link_id);ge===200&&xe&&xe.is_active&&D(xe)}catch(xe){console.error("Failed to check AI agent:",xe)}})()},[t,M==null?void 0:M.accessToken,M==null?void 0:M.refreshToken,h,r,i]),v.useEffect(()=>{if(u||!t||!M||!M.accessToken){B.current=!1;return}if(B.current||a)return;if(o){h.push("chat");return}const H=mr(t.link_id);H.isAgentMode&&H.agent&&!H.humanNeedRequested||(B.current=!0,iM(t.client_id,Yi(M)).then(([te,O])=>{if($n(O))a||h.push("chat");else if(O===403){const ee=mr(t.link_id);if(ee.isAgentMode&&ee.agent){if(ee.humanNeedRequested){r(ee.agent),i(!1),ee.sessionId&&ie.getState().setAIAgentSessionId(ee.sessionId),ie.getState().setHumanNeedRequested(!0);return}r(ee.agent),i(!0),ee.sessionId&&ie.getState().setAIAgentSessionId(ee.sessionId),h.push("chat")}else fa(t.link_id||""),p(!0)}else O===404?(fa(t.link_id||""),p(!0)):O===401?(nS(t.link_id||""),p(!0)):h.push("chat")}).catch(()=>h.push("chat")))},[u,h,r,i,t,M==null?void 0:M.accessToken,M==null?void 0:M.refreshToken,o,a]);const U=ax(((ue=(me=t.appearance)==null?void 0:me.head)==null?void 0:ue.elements)||[],"text"),W=ax(((de=(Q=t.appearance)==null?void 0:Q.head)==null?void 0:de.elements)||[],"title"),q=()=>{if(a&&t){let H=c;if(!H){const te=mr(t.link_id);te.agent&&(H=te.agent,r(te.agent),D(te.agent))}if(H){i(!0),ie.getState().setHistoryChat(null),ie.getState().setHistoryMessages(null),h.push("chat");return}}S(!0)},ne=()=>{N&&(r(N),i(!0),ie.getState().setHistoryChat(null),ie.getState().setHistoryMessages(null),h.push("chat"))},oe=v.useCallback(H=>{if(!I||m)return;y(!0);const te=()=>{I.emit(Ve.AgentRequestHuman,{},O=>{y(!1),O!=null&&O.success&&(ie.getState().setIsHaveChat(!0),d(!1),i(!1),l(!1),ie.getState().clearAIAgentState(),h.push("chat"))})};H&&Object.keys(H).length>0?I.emit(Ve.ChatUpdateInputs,{inputs:H},O=>{O!=null&&O.success?te():y(!1)}):te()},[I,m,i,l,h]);return v.useEffect(()=>{var H,te,O;if(a){if(!c&&t){const ee=mr(t.link_id);ee.agent&&(r(ee.agent),D(ee.agent))}(c||mr((t==null?void 0:t.link_id)||"").agent)&&((((O=(te=(H=t==null?void 0:t.appearance)==null?void 0:H.body)==null?void 0:te.inputs)==null?void 0:O.length)||0)>0?S(!1):oe())}},[a,c,t,oe,r]),f.jsxs("div",{className:"h-full w-full flex flex-col relative overflow-hidden",children:[f.jsxs("header",{className:"flex items-center justify-between px-4 py-3 flex-shrink-0 overflow-visible min-h-[52px]",style:{backgroundColor:e.getColor(b.HeaderBackground),color:e.getColor(b.HeaderText),borderColor:e.getColor(b.HeaderBorder),...g?{}:{borderTopLeftRadius:e.getRadius(),borderTopRightRadius:e.getRadius()}},children:[f.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[!C&&(T||a&&(c||t&&mr(t.link_id).agent))&&f.jsx("button",{type:"button",onClick:q,className:"flex-shrink-0 p-1 hover:opacity-80 transition-opacity",children:f.jsx(X.ArrowLeft,{className:"w-5 h-5"})}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("div",{className:"text-sm font-semibold truncate",children:C?"Geçmiş sohbetler":W||"Müşteri Hizmetleri"}),!C&&U&&f.jsx("div",{className:"text-xs opacity-90 truncate",children:U})]})]}),f.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0 ml-2",children:[f.jsx(YI,{}),k&&f.jsx("button",{type:"button",onClick:z,className:"p-1.5 rounded-md hover:opacity-80 transition-opacity",children:f.jsx(X.X,{className:"w-5 h-5"})})]})]}),f.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-h-0",style:{backgroundColor:e.getColor(b.Background)},children:C?f.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-h-0",children:f.jsx(qI,{onHasHistory:R,emptyStateText:w||void 0})}):f.jsx("div",{className:"flex-1 overflow-y-auto",children:f.jsx($I,{clientId:t.client_id,widgetId:t.link_id,appearance:t.appearance,aiAgentMode:!!N&&!a,onAIAgentStart:ne,onOk:()=>{a&&c||(ie.getState().setHistoryChat(null),ie.getState().setHistoryMessages(null),h.push("chat"))},onOperatorConnect:a&&(c||mr(t.link_id).agent)?oe:void 0,isConnectingToOperator:m})})}),C&&f.jsxs("div",{className:"flex-shrink-0",style:{backgroundColor:e.getColor(b.Background)},children:[f.jsx("div",{className:"px-5 py-2",children:f.jsxs(Rt,{onClick:$,size:"lg",className:"w-full flex items-center justify-center gap-2",children:[f.jsx(X.Plus,{className:"size-4"}),f.jsx("span",{children:"Yeni Sohbet Başlat"})]})}),f.jsx(xo,{variant:"block"})]})]})}function YL(){return f.jsxs(f.Fragment,{children:[f.jsx(GL,{}),f.jsx(qL,{})]})}const QL=[{path:"/",component:YL,name:"registration"}];function tt({className:e="",style:t}){const n=Se();return f.jsx("div",{className:`animate-pulse rounded ${e}`,style:{backgroundColor:n.getColor(b.MessageAdminBackground),opacity:.6,...t}})}function KL(){const e=Se();return f.jsxs("section",{className:"flex flex-col gap-3 w-full grow pt-4 px-4 overflow-y-auto",children:[f.jsx("div",{className:"flex w-full items-center justify-start",children:f.jsx(tt,{className:"h-12 w-3/5",style:{borderRadius:e.getRadius()}})}),f.jsx("div",{className:"flex w-full items-center justify-end",children:f.jsx(tt,{className:"h-10 w-2/5",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(b.MessageVisitorBackground),opacity:.4}})}),f.jsx("div",{className:"flex w-full items-center justify-start",children:f.jsx(tt,{className:"h-16 w-4/5",style:{borderRadius:e.getRadius()}})}),f.jsx("div",{className:"flex w-full items-center justify-end",children:f.jsx(tt,{className:"h-8 w-1/3",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(b.MessageVisitorBackground),opacity:.4}})}),f.jsx("div",{className:"flex w-full items-center justify-start",children:f.jsx(tt,{className:"h-10 w-1/2",style:{borderRadius:e.getRadius()}})})]})}function XL(){const e=Se();return f.jsxs("div",{className:"p-3 flex items-center gap-3",style:{backgroundColor:e.getColor(b.FooterBackground),borderRadius:e.getRadius()},children:[f.jsx("div",{className:"grow",children:f.jsx(tt,{className:"h-12 w-full",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(b.InputBackground)}})}),f.jsx(tt,{className:"h-12 w-12 rounded-full"})]})}function ZL(){const e=Se();return f.jsxs("header",{className:"p-4 flex justify-between items-center z-10",style:{backgroundColor:e.getColor(b.HeaderBackground),borderBottom:`1px solid ${e.getColor(b.HeaderBorder)}`},children:[f.jsx(tt,{className:"h-5 w-36"}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(tt,{className:"h-5 w-5 rounded"}),f.jsx(tt,{className:"h-5 w-5 rounded"})]})]})}function JL(){const e=Se();return f.jsx("section",{className:"h-full overflow-y-auto px-4 py-3",style:{backgroundColor:e.getColor(b.GreeterBackground)},children:f.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[f.jsxs("div",{children:[f.jsx(tt,{className:"h-4 w-20 mb-1"}),f.jsx(tt,{className:"h-11 w-full",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(b.InputBackground)}})]}),f.jsxs("div",{children:[f.jsx(tt,{className:"h-4 w-24 mb-1"}),f.jsx(tt,{className:"h-11 w-full",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(b.InputBackground)}})]}),f.jsxs("div",{children:[f.jsx(tt,{className:"h-4 w-16 mb-1"}),f.jsx(tt,{className:"h-11 w-full",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(b.InputBackground)}})]}),f.jsx(tt,{className:"h-11 w-full mt-2",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(b.GreeterButtonBackground),opacity:.5}})]})})}function eF(){const e=Se();return f.jsxs("div",{className:"relative flex flex-col gap-3 items-center justify-center h-44",style:{backgroundColor:e.getColor(b.GreeterTopBackground)},children:[f.jsx(tt,{className:"h-7 w-40"}),f.jsx(tt,{className:"h-4 w-56"})]})}function mC(){const e=Se();return f.jsxs("div",{className:"h-full w-full flex flex-col overflow-hidden",style:{backgroundColor:e.getColor(b.Background)},children:[f.jsx(ZL,{}),f.jsx(KL,{}),f.jsx(XL,{}),f.jsxs("div",{className:"py-1.5 px-3 flex items-center justify-center gap-1",style:{borderTop:`1px solid ${e.getColor(b.FooterBorder)}`,backgroundColor:e.getColor(b.FooterBackground)},children:[f.jsx(tt,{className:"h-3 w-20"}),f.jsx(tt,{className:"h-3.5 w-3.5 rounded"})]})]})}function eh(){const e=Se(),t=typeof window<"u"&&window.innerWidth<768;return f.jsxs("div",{className:`h-full w-full relative overflow-hidden ${t?"":"rounded-xl"}`,style:{backgroundColor:e.getColor(b.GreeterBackground)},children:[f.jsx(eF,{}),f.jsx("div",{style:{height:t?"calc(var(--app-height,100dvh) - 11rem)":"calc(100% - 11rem)"},children:f.jsx(JL,{})})]})}const tF="/notify.mp3",vg="lc:notification_sound_muted",gC=()=>{try{return sessionStorage.getItem(vg)==="1"}catch{return!1}},vC=e=>{try{sessionStorage.setItem(vg,e?"1":"0")}catch{}},nF=async e=>{try{if(sessionStorage.getItem(vg)==="1")return}catch{}await new Audio(e||tF).play()},nf=[Ne.Light,Ne.Dark,Ne.System];function rF(e){switch(e){case Ne.Light:return X.Sun;case Ne.Dark:return X.Moon;case Ne.System:return X.Monitor;default:return X.Monitor}}function iF({onChatClose:e}){const[t,n]=v.useState(!1),[r,i]=v.useState(!1),[s,o]=v.useState(()=>gC()),a=v.useRef(null),l=v.useRef(null),c=Se(),d=cs(),u=dr(),{setShowActionButtons:p}=ie(),{mode:m,setMode:y}=c,w=()=>{u==null||u.emit(Ve.ChatClose,{}),p(!1),e()},x=()=>{const k=nf.indexOf(m),C=nf[(k+1)%nf.length];y(C)},h=()=>{const k=!s;vC(k),o(k)};v.useEffect(()=>{if(!r)return;const k=C=>{var S,T;(S=l.current)!=null&&S.contains(C.target)||(T=a.current)!=null&&T.contains(C.target)||i(!1)};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[r]);const g=r&&f.jsxs(Pe.div,{ref:l,onMouseDown:k=>k.stopPropagation(),initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:"absolute right-0 top-full z-[9999] mt-1.5 py-1 min-w-[175px] rounded-lg shadow-lg !text-sm",style:{backgroundColor:c.getColor(b.Background),borderColor:c.getColor(b.Border),borderRadius:c.getRadius(),boxShadow:`0 4px 12px ${c.getColor(b.ShadowColor)}`},children:[f.jsxs("button",{type:"button",className:"w-full px-3 py-2 text-left text-sm flex items-center gap-2 rounded-t-lg hover:opacity-80 transition-opacity",style:{color:c.getColor(b.ErrorText)},onClick:()=>{i(!1),n(!0)},children:[f.jsx(X.XCircle,{className:"size-4 flex-shrink-0"}),d(re.ChatEndConversation)]}),f.jsxs("button",{type:"button",className:"w-full px-3 py-2 text-left text-sm flex items-center gap-2 hover:opacity-80 transition-opacity",style:{color:c.getColor(b.InputText)},onClick:h,children:[s?f.jsx(X.VolumeX,{className:"size-4 flex-shrink-0"}):f.jsx(X.Volume2,{className:"size-4 flex-shrink-0"}),d(s?re.NotificationSoundOn:re.NotificationSoundOff)]}),f.jsx("div",{className:"my-1 h-px",style:{backgroundColor:c.getColor(b.DividerColor)}}),f.jsxs("button",{type:"button",className:"w-full px-3 py-2 text-left text-sm flex items-center gap-2 rounded-b-lg hover:opacity-80 transition-opacity",style:{color:c.getColor(b.InputText)},onClick:x,children:[(()=>{const k=rF(m);return f.jsx(k,{className:"size-4 flex-shrink-0"})})(),m===Ne.Light?"Açık tema":m===Ne.Dark?"Koyu tema":"Sistem"]})]});return f.jsxs(f.Fragment,{children:[f.jsx(jr,{children:t&&f.jsx(Pe.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"absolute inset-0 z-50 flex items-center justify-center p-4",style:{backgroundColor:c.getColor(b.ModalOverlayColor)},children:f.jsxs(Pe.div,{initial:{scale:.95,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.95,opacity:0},transition:{duration:.2},className:"p-5 rounded-xl shadow-lg max-w-xs w-full",style:{backgroundColor:c.getColor(b.Background),borderRadius:c.getRadius()},children:[f.jsx("div",{className:"text-base font-semibold mb-2",style:{color:c.getColor(b.ChatCloseConfirmText)},children:d(re.ChatCloseConfirm)}),f.jsx("div",{className:"text-sm mb-4",style:{color:c.getColor(b.FooterText)},children:d(re.ChatCloseWarning)}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-lg transition-opacity hover:opacity-90",style:{backgroundColor:c.getColor(b.GreeterBackground),color:c.getColor(b.GreeterText),borderRadius:c.getRadius()},onClick:()=>n(!1),children:d(re.CancelAction)}),f.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-lg transition-opacity hover:opacity-90",style:{backgroundColor:c.getColor(b.ErrorBackground),color:c.getColor(b.ErrorText),borderRadius:c.getRadius()},onClick:w,children:d(re.CloseAction)})]})]})})}),f.jsxs("div",{className:"relative flex-shrink-0",children:[f.jsx("button",{ref:a,type:"button",onClick:()=>i(k=>!k),className:"flex items-center justify-center p-1.5 rounded-md hover:opacity-80 transition-opacity",style:{backgroundColor:"transparent",color:c.getColor(b.HeaderText)},title:d(re.ChatSettings),"aria-expanded":r,children:f.jsx(X.Menu,{className:"size-5"})}),f.jsx(jr,{children:g})]})]})}function sF(e){let t=e.replace(/<hr\b[^>]*>/gi,""),n;do n=t,t=t.replace(/<p\b[^>]*>(?:\s| | |�*[aA]0;|�*[aA]0;|<br\s*\/?>)*<\/p>/gi,"");while(t!==n);return t}function lx({text:e}){const n=Se().getColor(b.LinkColor),i=(s=>{const o=sF(s),a=/(https?:\/\/(?:[-\w.])+(?:\:[0-9]+)?(?:\/(?:[\w\/_.\-~!$&'()*+,;=:@])*(?:\?(?:[\w&=%.\-~!$'()*+,;=:@/])*)?(?:\#(?:[\w.\-~!$&'()*+,;=:@/])*)?)?|(?:www\.)?(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,}(?:\/(?:[\w\/_.\-~!$&'()*+,;=:@])*(?:\?(?:[\w&=%.\-~!$'()*+,;=:@/])*)?(?:\#(?:[\w.\-~!$&'()*+,;=:@/])*)?)?)/gi,l=o.split(/(<[^>]*>)/g);let c="",d=!1;for(let u=0;u<l.length;u++){const p=l[u];if(p.startsWith("<")&&p.endsWith(">"))if(p.match(/^<a\s/i)){if(p.includes("style="))c+=p;else{const m=p.replace(/^(<a\s[^>]*)(>)$/i,`$1 style="color: ${n}; text-decoration: underline;"$2`);c+=m}d=!0}else p.match(/^<\/a>/i)?(c+=p,d=!1):c+=p;else if(!d&&p.trim()){const m=p.replace(a,y=>{const w=y.replace(/[">]+$/,"");return`<a href="${/^https?:\/\//i.test(w)?w:`https://${w}`}" target="_blank" rel="noopener noreferrer" style="color: ${n}; text-decoration: underline;">${w}</a>`});c+=m}else c+=p}return c})(e);return f.jsx("div",{className:"linkified !text-sm w-full min-w-0",dangerouslySetInnerHTML:{__html:i}})}const cx="opacity-0 group-hover/item:opacity-100 transition-opacity duration-200";function yC({files:e,className:t,onDelete:n,hideName:r}){const i=Po(),[s,o]=v.useState(new Map);v.useEffect(()=>{const y=new Map;for(let w=0;w<e.length;w++){const x=e[w];if(x instanceof File){const h=URL.createObjectURL(x);y.set(w,h)}}return o(y),()=>{for(const w of y.values())URL.revokeObjectURL(w)}},[e]);const a=y=>{var x;return((x=(y instanceof File?y.name:y).split(".").pop())==null?void 0:x.toLowerCase())||""},l=y=>y instanceof File?y.name:y.split("/").pop()||y,c=y=>{const[w,x]=y.split(".");return w.length>10?`${w.slice(0,10)}...${x}`:y},d=y=>{const w=["jpg","jpeg","png","gif","bmp","webp","svg"],x=a(y);return w.includes(x)},u=(y,w)=>{if(y instanceof File){const x=s.get(w);x&&window.open(x,"_blank")}else window.open(y,"_blank")},p=(y,w)=>{y.stopPropagation(),n==null||n(w)},m=(y,w)=>y instanceof File?s.get(w)||"":y;return f.jsx("div",{className:ze("flex gap-2 w-full overflow-x-auto",t),children:e.map((y,w)=>{const x=l(y),h=a(y),g=d(y),k=m(y,w);return f.jsxs("div",{onClick:()=>u(y,w),className:"min-w-20 max-w-20 cursor-pointer group/item border border-gray-200 rounded-lg p-1.5 hover:shadow-md transition-all duration-200 hover:border-gray-300 bg-white relative",children:[n&&f.jsx("button",{onClick:C=>p(C,w),className:ze("absolute top-1 right-1 w-5 h-5 bg-red-500 hover:bg-red-600 text-white rounded-full flex items-center justify-center transition-opacity duration-200 z-10",{"opacity-0 group-hover/item:opacity-100":!i}),children:f.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",children:f.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})}),g?f.jsx("div",{className:"aspect-square w-fit mb-0.5 overflow-hidden rounded",children:f.jsx("img",{src:k,alt:x,className:"w-16 h-16 min-h-16 min-w-16 object-cover group-hover/item:scale-105 transition-transform duration-200"})}):f.jsx("div",{className:"min-w-16 aspect-square w-full mb-0.5 flex items-center justify-center bg-gray-50 rounded group-hover/item:bg-gray-100 transition-colors duration-200",children:f.jsxs("div",{className:"text-center",children:[f.jsx("div",{className:"w-6 h-6 mx-auto mb-0.5 bg-blue-100 rounded flex items-center justify-center",children:f.jsx("svg",{className:"w-3 h-3 text-blue-600",fill:"currentColor",viewBox:"0 0 20 20",children:f.jsx("path",{fillRule:"evenodd",d:"M4 4a2 2 0 012-2h4.586A2 2 0 0112 2.586L15.414 6A2 2 0 0116 7.414V16a2 2 0 01-2 2H6a2 2 0 01-2-2V4zm2 6a1 1 0 011-1h6a1 1 0 110 2H7a1 1 0 01-1-1zm1 3a1 1 0 100 2h6a1 1 0 100-2H7z",clipRule:"evenodd"})})}),f.jsx("div",{className:ze("text-[10px] font-medium text-gray-600 uppercase",{[cx]:r}),children:h||"file"})]})}),f.jsx("div",{className:ze("max-w-16 text-[10px] text-gray-700 font-medium truncate text-ellipsis overflow-hidden",{[cx]:r}),title:x,children:c(x)})]},w)})})}const oF={hidden:{opacity:0,y:8},visible:{opacity:1,y:0}},aF={hidden:{opacity:0,y:8,scale:.95},visible:{opacity:1,y:0,scale:1}};function lF({buttons:e,className:t=""}){const n=Se();if(!e||e.length===0)return null;const r=s=>{s.startsWith("http://")||s.startsWith("https://")?window.open(s,"_blank","noopener,noreferrer"):s.startsWith("tel:")||s.startsWith("mailto:")?window.location.href=s:console.log("Custom action:",s)},i=s=>s.startsWith("http://")||s.startsWith("https://")?f.jsx(X.ExternalLink,{className:"size-4"}):s.startsWith("tel:")?f.jsx(X.Phone,{className:"size-4"}):s.startsWith("mailto:")?f.jsx(X.Mail,{className:"size-4"}):null;return f.jsx(Pe.div,{className:ze(t,"mt-2"),initial:"hidden",animate:"visible",variants:oF,transition:{duration:.3,ease:"easeOut",staggerChildren:.08},children:f.jsx("div",{className:"rounded-lg ",style:{backgroundColor:`${n.getColor(b.Background)}f0`},children:f.jsx("div",{className:"flex flex-wrap gap-2",children:e.map((s,o)=>f.jsxs(Pe.button,{variants:aF,transition:{duration:.25,ease:"easeOut"},whileHover:{scale:1.02,y:-1,transition:{duration:.15}},whileTap:{scale:.98,transition:{duration:.1}},onClick:()=>r(s.url),className:"group inline-flex items-center gap-2 px-4 py-2.5 text-sm font-medium transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 relative overflow-hidden cursor-pointer",style:{backgroundColor:n.getColor(b.GreeterBackground),color:n.getColor(b.GreeterText),borderRadius:n.getRadius(),border:`1px solid ${n.getColor(b.DividerColor)}`,boxShadow:`0 1px 3px ${n.getColor(b.ShadowColor)}30`},onMouseEnter:a=>{a.currentTarget.style.backgroundColor=n.getColor(b.ButtonBackground),a.currentTarget.style.color=n.getColor(b.ButtonText),a.currentTarget.style.borderColor=n.getColor(b.ButtonBackground),a.currentTarget.style.boxShadow=`0 4px 12px ${n.getColor(b.ShadowColor)}40`},onMouseLeave:a=>{a.currentTarget.style.backgroundColor=n.getColor(b.GreeterBackground),a.currentTarget.style.color=n.getColor(b.GreeterText),a.currentTarget.style.borderColor=n.getColor(b.DividerColor),a.currentTarget.style.boxShadow=`0 1px 3px ${n.getColor(b.ShadowColor)}30`},children:[f.jsxs("span",{className:"flex items-center gap-2",children:[i(s.url),f.jsx("span",{className:"font-medium",children:s.label})]}),f.jsx("div",{className:"absolute inset-0 opacity-0 group-hover:opacity-100 transition-opacity duration-300",style:{background:`linear-gradient(45deg, transparent 30%, ${n.getColor(b.ButtonText)}10 50%, transparent 70%)`,borderRadius:n.getRadius()}})]},`${s.label}-${o}`))})})})}const ux=e=>e?(typeof e=="string"&&(e=new Date(e)),e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})):"",dx=["Düşünüyorum...","Araştırıyorum...","Cevapları karşılaştırıyorum...","En iyi cevabı hazırlıyorum...","Bilgileri derliyorum...","Kaynakları tarıyorum...","Analiz ediyorum...","Yanıtı oluşturuyorum..."];function xC({messages:e,isTyping:t,chat:n,streamingContent:r}){var C,S,T,j;const i=v.useRef(null),s=v.useRef(null),[o,a]=v.useState(!0),l=v.useRef(!0),{widget:c,showActionButtons:d}=ie(),u=Se(),p=v.useRef(!0),m=v.useRef(new Set),[y,w]=v.useState(0);v.useEffect(()=>{e.length>0&&p.current&&requestAnimationFrame(()=>{p.current=!1})},[e]),v.useEffect(()=>{e.length===0&&m.current.clear()},[e.length]),v.useEffect(()=>{if(!t||r===void 0||r)return;const E=setInterval(()=>{w(A=>(A+1)%dx.length)},2500);return()=>clearInterval(E)},[t,r]);const x=()=>{const E=s.current;E&&(E.scrollTop=E.scrollHeight)},h=()=>{if(s.current){const{scrollTop:E,scrollHeight:A,clientHeight:I}=s.current,N=A-E<=I+10;l.current=N,a(N)}};v.useEffect(()=>{(l.current||t)&&x()},[e,t,r]);const g=(E,A)=>{if(p.current)return{initial:!1,animate:{}};const I=E.id||"";return m.current.has(I)?A===we.Customer?{initial:!1,animate:{opacity:1,x:0}}:{initial:!1,animate:{}}:(m.current.add(I),A===we.Customer?{initial:{opacity:0,x:30},animate:{opacity:1,x:0}}:{initial:!1,animate:{}})},k=E=>E===we.Customer?"18px 18px 4px 18px":E===we.User||E===we.Agent?"18px 18px 18px 4px":u.getRadius();return f.jsxs("section",{onScroll:h,ref:s,className:"flex flex-col gap-3 w-full grow pt-4 px-4 overflow-y-auto overflow-x-hidden scrollbar",children:[((S=(C=c==null?void 0:c.appearance)==null?void 0:C.design)==null?void 0:S.greeting_message)&&f.jsx("div",{className:"flex w-full items-center justify-start",children:f.jsx("div",{className:"max-w-[80%] whitespace-pre-wrap border-0 px-3 py-2 !text-sm",style:{backgroundColor:u.getColor(b.MessageAdminBackground),color:u.getColor(b.MessageAdminText),borderRadius:"18px 18px 18px 4px"},children:(j=(T=c==null?void 0:c.appearance)==null?void 0:T.design)==null?void 0:j.greeting_message})}),f.jsx(jr,{children:Array.isArray(e)&&e.filter(A=>{var I;return A!=null&&(!!A.content||(((I=A.files)==null?void 0:I.length)??0)>0)&&A.content!==`
|
|
97
|
-
`}).map((
|
|
96
|
+
*/var gt=typeof Symbol=="function"&&Symbol.for,mg=gt?Symbol.for("react.element"):60103,gg=gt?Symbol.for("react.portal"):60106,Bu=gt?Symbol.for("react.fragment"):60107,zu=gt?Symbol.for("react.strict_mode"):60108,Vu=gt?Symbol.for("react.profiler"):60114,Uu=gt?Symbol.for("react.provider"):60109,Hu=gt?Symbol.for("react.context"):60110,vg=gt?Symbol.for("react.async_mode"):60111,Wu=gt?Symbol.for("react.concurrent_mode"):60111,qu=gt?Symbol.for("react.forward_ref"):60112,Gu=gt?Symbol.for("react.suspense"):60113,CI=gt?Symbol.for("react.suspense_list"):60120,Yu=gt?Symbol.for("react.memo"):60115,Qu=gt?Symbol.for("react.lazy"):60116,_I=gt?Symbol.for("react.block"):60121,TI=gt?Symbol.for("react.fundamental"):60117,EI=gt?Symbol.for("react.responder"):60118,AI=gt?Symbol.for("react.scope"):60119;function un(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case mg:switch(e=e.type,e){case vg:case Wu:case Bu:case Vu:case zu:case Gu:return e;default:switch(e=e&&e.$$typeof,e){case Hu:case qu:case Qu:case Yu:case Uu:return e;default:return t}}case gg:return t}}}function sC(e){return un(e)===Wu}Me.AsyncMode=vg;Me.ConcurrentMode=Wu;Me.ContextConsumer=Hu;Me.ContextProvider=Uu;Me.Element=mg;Me.ForwardRef=qu;Me.Fragment=Bu;Me.Lazy=Qu;Me.Memo=Yu;Me.Portal=gg;Me.Profiler=Vu;Me.StrictMode=zu;Me.Suspense=Gu;Me.isAsyncMode=function(e){return sC(e)||un(e)===vg};Me.isConcurrentMode=sC;Me.isContextConsumer=function(e){return un(e)===Hu};Me.isContextProvider=function(e){return un(e)===Uu};Me.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===mg};Me.isForwardRef=function(e){return un(e)===qu};Me.isFragment=function(e){return un(e)===Bu};Me.isLazy=function(e){return un(e)===Qu};Me.isMemo=function(e){return un(e)===Yu};Me.isPortal=function(e){return un(e)===gg};Me.isProfiler=function(e){return un(e)===Vu};Me.isStrictMode=function(e){return un(e)===zu};Me.isSuspense=function(e){return un(e)===Gu};Me.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Bu||e===Wu||e===Vu||e===zu||e===Gu||e===CI||typeof e=="object"&&e!==null&&(e.$$typeof===Qu||e.$$typeof===Yu||e.$$typeof===Uu||e.$$typeof===Hu||e.$$typeof===qu||e.$$typeof===TI||e.$$typeof===EI||e.$$typeof===AI||e.$$typeof===_I)};Me.typeOf=un;iC.exports=Me;var jI=iC.exports,oC=jI,RI={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},PI={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},aC={};aC[oC.ForwardRef]=RI;aC[oC.Memo]=PI;function ft(){return ft=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ft.apply(this,arguments)}function lC(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var Ku=g.createContext(void 0);Ku.displayName="FormikContext";Ku.Provider;Ku.Consumer;function MI(){var e=g.useContext(Ku);return e}var Rn=function(t){return typeof t=="function"},Xu=function(t){return t!==null&&typeof t=="object"},NI=function(t){return String(Math.floor(Number(t)))===t},Zd=function(t){return Object.prototype.toString.call(t)==="[object String]"},Jd=function(t){return Xu(t)&&Rn(t.then)};function Xt(e,t,n,r){r===void 0&&(r=0);for(var i=rC(t);e&&r<i.length;)e=e[i[r++]];return r!==i.length&&!e||e===void 0?n:e}function Xi(e,t,n){for(var r=rx(e),i=r,s=0,o=rC(t);s<o.length-1;s++){var a=o[s],l=Xt(e,o.slice(0,s+1));if(l&&(Xu(l)||Array.isArray(l)))i=i[a]=rx(l);else{var c=o[s+1];i=i[a]=NI(c)&&Number(c)>=0?[]:{}}}return(s===0?e:i)[o[s]]===n?e:(n===void 0?delete i[o[s]]:i[o[s]]=n,s===0&&n===void 0&&delete r[o[s]],r)}function cC(e,t,n,r){n===void 0&&(n=new WeakMap),r===void 0&&(r={});for(var i=0,s=Object.keys(e);i<s.length;i++){var o=s[i],a=e[o];Xu(a)?n.get(a)||(n.set(a,!0),r[o]=Array.isArray(a)?[]:{},cC(a,t,n,r[o])):r[o]=t}return r}function OI(e,t){switch(t.type){case"SET_VALUES":return ft({},e,{values:t.payload});case"SET_TOUCHED":return ft({},e,{touched:t.payload});case"SET_ERRORS":return ji(e.errors,t.payload)?e:ft({},e,{errors:t.payload});case"SET_STATUS":return ft({},e,{status:t.payload});case"SET_ISSUBMITTING":return ft({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return ft({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return ft({},e,{values:Xi(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return ft({},e,{touched:Xi(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return ft({},e,{errors:Xi(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return ft({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return ft({},e,{touched:cC(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":return ft({},e,{isSubmitting:!1});case"SUBMIT_SUCCESS":return ft({},e,{isSubmitting:!1});default:return e}}var _i={},Wl={};function DI(e){var t=e.validateOnChange,n=t===void 0?!0:t,r=e.validateOnBlur,i=r===void 0?!0:r,s=e.validateOnMount,o=s===void 0?!1:s,a=e.isInitialValid,l=e.enableReinitialize,c=l===void 0?!1:l,d=e.onSubmit,u=lC(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),p=ft({validateOnChange:n,validateOnBlur:i,validateOnMount:o,onSubmit:d},u),h=g.useRef(p.initialValues),y=g.useRef(p.initialErrors||_i),w=g.useRef(p.initialTouched||Wl),b=g.useRef(p.initialStatus),m=g.useRef(!1),v=g.useRef({});g.useEffect(function(){return m.current=!0,function(){m.current=!1}},[]);var x=g.useState(0),S=x[1],C=g.useRef({values:Hl(p.initialValues),errors:Hl(p.initialErrors)||_i,touched:Hl(p.initialTouched)||Wl,status:Hl(p.initialStatus),isSubmitting:!1,isValidating:!1,submitCount:0}),_=C.current,j=g.useCallback(function(M){var J=C.current;C.current=OI(J,M),J!==C.current&&S(function(F){return F+1})},[]),A=g.useCallback(function(M,J){return new Promise(function(F,U){var ae=p.validate(M,J);ae==null?F(_i):Jd(ae)?ae.then(function(de){F(de||_i)},function(de){U(de)}):F(ae)})},[p.validate]),E=g.useCallback(function(M,J){var F=p.validationSchema,U=Rn(F)?F(J):F,ae=J&&U.validateAt?U.validateAt(J,M):LI(M,U);return new Promise(function(de,Se){ae.then(function(){de(_i)},function(at){at.name==="ValidationError"?de(II(at)):Se(at)})})},[p.validationSchema]),D=g.useCallback(function(M,J){return new Promise(function(F){return F(v.current[M].validate(J))})},[]),L=g.useCallback(function(M){var J=Object.keys(v.current).filter(function(U){return Rn(v.current[U].validate)}),F=J.length>0?J.map(function(U){return D(U,Xt(M,U))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(F).then(function(U){return U.reduce(function(ae,de,Se){return de==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||de&&(ae=Xi(ae,J[Se],de)),ae},{})})},[D]),O=g.useCallback(function(M){return Promise.all([L(M),p.validationSchema?E(M):{},p.validate?A(M):{}]).then(function(J){var F=J[0],U=J[1],ae=J[2],de=Gp.all([F,U,ae],{arrayMerge:FI});return de})},[p.validate,p.validationSchema,L,A,E]),q=hn(function(M){return M===void 0&&(M=_.values),j({type:"SET_ISVALIDATING",payload:!0}),O(M).then(function(J){return m.current&&(j({type:"SET_ISVALIDATING",payload:!1}),j({type:"SET_ERRORS",payload:J})),J})});g.useEffect(function(){o&&m.current===!0&&ji(h.current,p.initialValues)&&q(h.current)},[o,q]);var $=g.useCallback(function(M){var J=M&&M.values?M.values:h.current,F=M&&M.errors?M.errors:y.current?y.current:p.initialErrors||{},U=M&&M.touched?M.touched:w.current?w.current:p.initialTouched||{},ae=M&&M.status?M.status:b.current?b.current:p.initialStatus;h.current=J,y.current=F,w.current=U,b.current=ae;var de=function(){j({type:"RESET_FORM",payload:{isSubmitting:!!M&&!!M.isSubmitting,errors:F,touched:U,status:ae,values:J,isValidating:!!M&&!!M.isValidating,submitCount:M&&M.submitCount&&typeof M.submitCount=="number"?M.submitCount:0}})};if(p.onReset){var Se=p.onReset(_.values,Y);Jd(Se)?Se.then(de):de()}else de()},[p.initialErrors,p.initialStatus,p.initialTouched,p.onReset]);g.useEffect(function(){m.current===!0&&!ji(h.current,p.initialValues)&&c&&(h.current=p.initialValues,$(),o&&q(h.current))},[c,p.initialValues,$,o,q]),g.useEffect(function(){c&&m.current===!0&&!ji(y.current,p.initialErrors)&&(y.current=p.initialErrors||_i,j({type:"SET_ERRORS",payload:p.initialErrors||_i}))},[c,p.initialErrors]),g.useEffect(function(){c&&m.current===!0&&!ji(w.current,p.initialTouched)&&(w.current=p.initialTouched||Wl,j({type:"SET_TOUCHED",payload:p.initialTouched||Wl}))},[c,p.initialTouched]),g.useEffect(function(){c&&m.current===!0&&!ji(b.current,p.initialStatus)&&(b.current=p.initialStatus,j({type:"SET_STATUS",payload:p.initialStatus}))},[c,p.initialStatus,p.initialTouched]);var B=hn(function(M){if(v.current[M]&&Rn(v.current[M].validate)){var J=Xt(_.values,M),F=v.current[M].validate(J);return Jd(F)?(j({type:"SET_ISVALIDATING",payload:!0}),F.then(function(U){return U}).then(function(U){j({type:"SET_FIELD_ERROR",payload:{field:M,value:U}}),j({type:"SET_ISVALIDATING",payload:!1})})):(j({type:"SET_FIELD_ERROR",payload:{field:M,value:F}}),Promise.resolve(F))}else if(p.validationSchema)return j({type:"SET_ISVALIDATING",payload:!0}),E(_.values,M).then(function(U){return U}).then(function(U){j({type:"SET_FIELD_ERROR",payload:{field:M,value:Xt(U,M)}}),j({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),I=g.useCallback(function(M,J){var F=J.validate;v.current[M]={validate:F}},[]),N=g.useCallback(function(M){delete v.current[M]},[]),R=hn(function(M,J){j({type:"SET_TOUCHED",payload:M});var F=J===void 0?i:J;return F?q(_.values):Promise.resolve()}),z=g.useCallback(function(M){j({type:"SET_ERRORS",payload:M})},[]),H=hn(function(M,J){var F=Rn(M)?M(_.values):M;j({type:"SET_VALUES",payload:F});var U=J===void 0?n:J;return U?q(F):Promise.resolve()}),W=g.useCallback(function(M,J){j({type:"SET_FIELD_ERROR",payload:{field:M,value:J}})},[]),G=hn(function(M,J,F){j({type:"SET_FIELD_VALUE",payload:{field:M,value:J}});var U=F===void 0?n:F;return U?q(Xi(_.values,M,J)):Promise.resolve()}),te=g.useCallback(function(M,J){var F=J,U=M,ae;if(!Zd(M)){M.persist&&M.persist();var de=M.target?M.target:M.currentTarget,Se=de.type,at=de.name,vt=de.id,Un=de.value,dn=de.checked,xs=de.outerHTML,fr=de.options,Dr=de.multiple;F=J||at||vt,U=/number|range/.test(Se)?(ae=parseFloat(Un),isNaN(ae)?"":ae):/checkbox/.test(Se)?BI(Xt(_.values,F),dn,Un):fr&&Dr?$I(fr):Un}F&&G(F,U)},[G,_.values]),se=hn(function(M){if(Zd(M))return function(J){return te(J,M)};te(M)}),pe=hn(function(M,J,F){J===void 0&&(J=!0),j({type:"SET_FIELD_TOUCHED",payload:{field:M,value:J}});var U=F===void 0?i:F;return U?q(_.values):Promise.resolve()}),ue=g.useCallback(function(M,J){M.persist&&M.persist();var F=M.target,U=F.name,ae=F.id,de=F.outerHTML,Se=J||U||ae;pe(Se,!0)},[pe]),ke=hn(function(M){if(Zd(M))return function(J){return ue(J,M)};ue(M)}),Ne=g.useCallback(function(M){Rn(M)?j({type:"SET_FORMIK_STATE",payload:M}):j({type:"SET_FORMIK_STATE",payload:function(){return M}})},[]),Q=g.useCallback(function(M){j({type:"SET_STATUS",payload:M})},[]),V=g.useCallback(function(M){j({type:"SET_ISSUBMITTING",payload:M})},[]),P=hn(function(){return j({type:"SUBMIT_ATTEMPT"}),q().then(function(M){var J=M instanceof Error,F=!J&&Object.keys(M).length===0;if(F){var U;try{if(U=me(),U===void 0)return}catch(ae){throw ae}return Promise.resolve(U).then(function(ae){return m.current&&j({type:"SUBMIT_SUCCESS"}),ae}).catch(function(ae){if(m.current)throw j({type:"SUBMIT_FAILURE"}),ae})}else if(m.current&&(j({type:"SUBMIT_FAILURE"}),J))throw M})}),K=hn(function(M){M&&M.preventDefault&&Rn(M.preventDefault)&&M.preventDefault(),M&&M.stopPropagation&&Rn(M.stopPropagation)&&M.stopPropagation(),P().catch(function(J){console.warn("Warning: An unhandled error was caught from submitForm()",J)})}),Y={resetForm:$,validateForm:q,validateField:B,setErrors:z,setFieldError:W,setFieldTouched:pe,setFieldValue:G,setStatus:Q,setSubmitting:V,setTouched:R,setValues:H,setFormikState:Ne,submitForm:P},me=hn(function(){return d(_.values,Y)}),re=hn(function(M){M&&M.preventDefault&&Rn(M.preventDefault)&&M.preventDefault(),M&&M.stopPropagation&&Rn(M.stopPropagation)&&M.stopPropagation(),$()}),Ee=g.useCallback(function(M){return{value:Xt(_.values,M),error:Xt(_.errors,M),touched:!!Xt(_.touched,M),initialValue:Xt(h.current,M),initialTouched:!!Xt(w.current,M),initialError:Xt(y.current,M)}},[_.errors,_.touched,_.values]),ot=g.useCallback(function(M){return{setValue:function(F,U){return G(M,F,U)},setTouched:function(F,U){return pe(M,F,U)},setError:function(F){return W(M,F)}}},[G,pe,W]),$t=g.useCallback(function(M){var J=Xu(M),F=J?M.name:M,U=Xt(_.values,F),ae={name:F,value:U,onChange:se,onBlur:ke};if(J){var de=M.type,Se=M.value,at=M.as,vt=M.multiple;de==="checkbox"?Se===void 0?ae.checked=!!U:(ae.checked=!!(Array.isArray(U)&&~U.indexOf(Se)),ae.value=Se):de==="radio"?(ae.checked=U===Se,ae.value=Se):at==="select"&&vt&&(ae.value=ae.value||[],ae.multiple=!0)}return ae},[ke,se,_.values]),oe=g.useMemo(function(){return!ji(h.current,_.values)},[h.current,_.values]),ye=g.useMemo(function(){return typeof a<"u"?oe?_.errors&&Object.keys(_.errors).length===0:a!==!1&&Rn(a)?a(p):a:_.errors&&Object.keys(_.errors).length===0},[a,oe,_.errors,p]),Oe=ft({},_,{initialValues:h.current,initialErrors:y.current,initialTouched:w.current,initialStatus:b.current,handleBlur:ke,handleChange:se,handleReset:re,handleSubmit:K,resetForm:$,setErrors:z,setFormikState:Ne,setFieldTouched:pe,setFieldValue:G,setFieldError:W,setStatus:Q,setSubmitting:V,setTouched:R,setValues:H,submitForm:P,validateForm:q,validateField:B,isValid:ye,dirty:oe,unregisterField:N,registerField:I,getFieldProps:$t,getFieldMeta:Ee,getFieldHelpers:ot,validateOnBlur:i,validateOnChange:n,validateOnMount:o});return Oe}function II(e){var t={};if(e.inner){if(e.inner.length===0)return Xi(t,e.path,e.message);for(var i=e.inner,n=Array.isArray(i),r=0,i=n?i:i[Symbol.iterator]();;){var s;if(n){if(r>=i.length)break;s=i[r++]}else{if(r=i.next(),r.done)break;s=r.value}var o=s;Xt(t,o.path)||(t=Xi(t,o.path,o.message))}}return t}function LI(e,t,n,r){n===void 0&&(n=!1);var i=Jp(e);return t[n?"validateSync":"validate"](i,{abortEarly:!1,context:i})}function Jp(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);Array.isArray(e[r])===!0?t[r]=e[r].map(function(i){return Array.isArray(i)===!0||N0(i)?Jp(i):i!==""?i:void 0}):N0(e[r])?t[r]=Jp(e[r]):t[r]=e[r]!==""?e[r]:void 0}return t}function FI(e,t,n){var r=e.slice();return t.forEach(function(s,o){if(typeof r[o]>"u"){var a=n.clone!==!1,l=a&&n.isMergeableObject(s);r[o]=l?Gp(Array.isArray(s)?[]:{},s,n):s}else n.isMergeableObject(s)?r[o]=Gp(e[o],s,n):e.indexOf(s)===-1&&r.push(s)}),r}function $I(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function BI(e,t,n){if(typeof e=="boolean")return!!t;var r=[],i=!1,s=-1;if(Array.isArray(e))r=e,s=e.indexOf(n),i=s>=0;else if(!n||n=="true"||n=="false")return!!t;return t&&n&&!i?r.concat(n):i?r.slice(0,s).concat(r.slice(s+1)):r}var zI=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?g.useLayoutEffect:g.useEffect;function hn(e){var t=g.useRef(e);return zI(function(){t.current=e}),g.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current.apply(void 0,r)},[])}var VI=g.forwardRef(function(e,t){var n=e.action,r=lC(e,["action"]),i=n??"#",s=MI(),o=s.handleReset,a=s.handleSubmit;return g.createElement("form",ft({onSubmit:a,ref:t,onReset:o,action:i},r))});VI.displayName="Form";const uC=({init:e,schema:t,action:n,validateOnBlur:r=!1})=>DI({initialValues:e,validationSchema:t,validateOnBlur:r,enableReinitialize:!0,validateOnChange:!1,validateOnMount:!1,onSubmit:i=>{n(i)}});function yg({id:e,text:t,className:n,required:r}){const i=be();return t?f.jsxs("label",{htmlFor:e,className:Ie("mb-1 block text-sm font-medium",n),style:{color:i.getColor(k.InputText)},children:[t,r&&f.jsx("span",{className:"ml-1",style:{color:i.getColor(k.ErrorText)},children:"*"})]}):null}const ef={sm:"px-3 py-1 text-xs",md:"px-4 py-2 text-sm",lg:"px-5 py-3 text-15"};function UI({id:e,label:t,suffix:n,prefix:r,size:i="md",type:s="text",noMargin:o=!1,required:a=!1,error:l,ariaDescribedBy:c,className:d,ariaInvalid:u,ariaLabel:p,autoFocus:h,...y}){const w=be(),b=w.getRadius(),m=l?w.getColor(k.ErrorBorder):w.getColor(k.InputBorder),v=w.getColor(k.LinkColor);return f.jsxs("div",{className:Ie({"mb-2":!o},d),style:{"--focus-ring":v},children:[f.jsx(yg,{id:e,text:t,required:a}),f.jsxs("div",{className:"flex items-center",children:[r&&f.jsx("span",{className:Ie("inline-block border border-solid border-r-0 rounded-l-md",ef[i]),style:{borderColor:l?w.getColor(k.ErrorBorder):w.getColor(k.InputBorder),backgroundColor:w.getColor(k.InputBackground),borderRadius:b},children:r}),f.jsx("input",{id:e,autoFocus:h,className:Ie("border border-solid block w-full outline-none transition-[border-color,box-shadow] duration-200 focus:ring-2 focus:ring-offset-0 rounded-lg",ef[i],{"rounded-l-none":!!r,"rounded-r-none":!!n}),type:s,required:a,"aria-describedby":c,"aria-invalid":u,"aria-label":p,style:{fontSize:"16px",color:l?w.getColor(k.ErrorText):w.getColor(k.InputText),backgroundColor:w.getColor(k.InputBackground),borderColor:m,borderRadius:b,"--tw-ring-color":v},...y}),n&&f.jsx("span",{className:Ie("inline-block border border-solid border-l-0 rounded-r-md",ef[i]),style:{borderColor:l?w.getColor(k.ErrorBorder):w.getColor(k.InputBorder),backgroundColor:w.getColor(k.InputBackground),borderRadius:b},children:n})]}),!!l&&f.jsx("p",{className:"mt-1 text-xs",style:{color:w.getColor(k.ErrorText)},children:l})]})}const ox=(e,t)=>{const n=new Date;n.setFullYear(n.getFullYear()+1),document.cookie=`${e}=${t};expires=${n.toUTCString()};path=/`},dC=g.createContext({}),HI=()=>`${window.location.pathname}_$$_${document.title}`,WI=()=>{const e=localStorage.getItem("page");return!e||e===""?"/":e},qI=()=>{const e=localStorage.getItem("p-history");if(!e||e==="")return[];try{return JSON.parse(e)}catch{return[]}};function GI({children:e}){const[t,n]=g.useState("/"),[r,i]=g.useState(qI());function s(){i([]),localStorage.removeItem("p-history")}const o=a=>{n(a),i(l=>[...new Set([...l,a])]),localStorage.setItem("page",a),localStorage.setItem("p-history",JSON.stringify(r))};return f.jsx(dC.Provider,{value:{page:t,setPage:o,history:r,clearHistory:s},children:e})}function Zu(){return g.useContext(dC)}function YI({label:e,id:t,value:n="",className:r,placeholder:i,children:s,required:o,error:a,...l}){const c=be();return f.jsxs("div",{className:r,children:[e&&f.jsx(yg,{id:t,required:o,text:e}),f.jsxs("select",{id:t,"aria-placeholder":i,value:n,"aria-label":e,className:"block w-full rounded-lg border border-solid px-3 py-2 text-sm outline-none transition-[border-color,box-shadow] duration-200 focus:ring-2 focus:ring-offset-0",style:{backgroundColor:c.getColor(k.InputBackground),color:c.getColor(k.InputText),borderColor:a?c.getColor(k.ErrorBorder):c.getColor(k.InputBorder),borderRadius:c.getRadius(),"--tw-ring-color":c.getColor(k.LinkColor)},onChange:l.onChange,required:o,...l,children:[i&&f.jsx("option",{value:"",disabled:!0,children:i}),s]}),!!a&&f.jsx("p",{className:"mt-1 text-xs",style:{color:c.getColor(k.ErrorText)},children:a})]})}const ax={ring:{label:"",input:"relative before:content[''] before:absolute before:top-2/4 before:left-2/4 before:block before:h-12 before:w-12 before:-translate-y-2/4 before:-translate-x-2/4 before:rounded-full before:bg-blue-gray-500 before:opacity-0 before:transition-opacity hover:before:opacity-10"},hover:{label:"hover:bg-secondary transition-colors duration-200 px-2 py-1 rounded-md",input:""}},QI={sm:"h-4 w-4 lg:h-3 lg:w-3",md:"h-6 w-6 lg:h-5 lg:w-5",lg:"h-8 w-8 lg:h-7 lg:w-7"},KI={sm:"h-3 w-3 lg:h-2.5 lg:w-2.5",md:"h-5 w-5 lg:h-4 lg:w-4",lg:"h-7 w-7 lg:h-6 lg:w-6"};function XI({children:e,name:t,required:n,value:r,checked:i,onChange:s,onBlur:o,red:a,id:l=t,size:c="md",effect:d="ring",reversed:u=!1,error:p,...h}){const y=be(),w=y.getColor(k.InputText),b=y.getColor(k.LinkColor),m=y.getColor(k.InputBorder),v=y.getColor(k.InputBackground),x=y.getColor(k.ErrorText);return f.jsxs("div",{children:[f.jsxs("div",{className:`flex items-center justify-between gap-2 ${u?"flex-row-reverse":""} ${ax[d].label}`,children:[f.jsxs("label",{className:"disable-highlight relative flex cursor-pointer items-center rounded-md",htmlFor:l,children:[f.jsx("input",{id:l,name:t,type:"checkbox",className:`peer cursor-pointer appearance-none rounded-md border-2 border-solid transition-all ${QI[c]} ${ax[d].input}`,style:{borderColor:i?b:m,backgroundColor:i?b:v},required:n,checked:i,value:r,onChange:S=>s==null?void 0:s(S.target.checked),onBlur:S=>o==null?void 0:o(S.target.checked),...h}),f.jsx("div",{className:"pointer-events-none absolute left-2/4 top-2/4 -translate-x-1/2 -translate-y-1/2 text-white opacity-0 transition-opacity peer-checked:opacity-100",children:f.jsx(Z.Check,{className:KI[c]})})]}),f.jsx("label",{className:"disable-highlight flex grow cursor-pointer select-none items-center text-sm",style:{color:w},htmlFor:l,children:e})]}),(a||p)&&f.jsx("small",{className:"text-xs",style:{color:x},children:p||a})]})}function ZI({id:e,value:t,name:n,onChange:r,children:i,disabled:s,className:o}){const a=be(),l=a.getColor(k.InputText),c=a.getColor(k.LinkColor);return f.jsxs("label",{htmlFor:e,className:Ie("relative flex cursor-pointer items-center gap-2 rounded-md focus-within:outline-none",{"opacity-60 cursor-not-allowed":s},o),children:[f.jsx("input",{type:"radio",id:e,name:n,value:e,checked:t,onChange:d=>r==null?void 0:r(d.target.checked),className:"h-4 w-4 min-w-4 cursor-pointer appearance-none border-2 transition-all focus:ring-0 focus:ring-offset-0",style:{borderRadius:"50%",borderColor:t?c:a.getColor(k.InputBorder),backgroundColor:t?c:a.getColor(k.InputBackground),boxShadow:t?`inset 0 0 0 3px ${a.getColor(k.Background)}`:void 0},disabled:s}),f.jsx("span",{className:"text-sm font-medium",style:{color:l},children:i})]})}function JI({id:e,label:t,children:n,required:r,className:i,error:s}){const o=be(),a=o.getColor(k.InputText),l=o.getColor(k.ErrorText);return f.jsxs("fieldset",{id:e,className:i,children:[t&&f.jsxs("legend",{className:"mb-1.5 block text-sm font-medium",style:{color:a},children:[t,r&&f.jsx("span",{style:{color:l,marginLeft:4},children:"*"})]}),f.jsx("div",{className:"flex flex-col gap-2",children:n}),s&&f.jsx("p",{className:"mt-1 text-xs",style:{color:l},children:s})]})}const lx=Object.assign(ZI,{Group:JI});function Ju({id:e,label:t,suffix:n,prefix:r,className:i,noMargin:s,rows:o=3,type:a="text",required:l=!1,error:c,ariaInvalid:d,inputRef:u,autoFocus:p=!1,style:h,borderless:y=!1,...w}){const b=be();return f.jsxs("div",{className:Ie({"mb-2":!s},i),children:[t&&f.jsx(yg,{id:e,text:t,required:l}),f.jsx("textarea",{className:Ie("resize-none max-h-36 w-full py-2 px-3 block outline-none transition-[border-color,box-shadow] duration-200 rounded-lg",{"border border-solid focus:ring-2 focus:ring-offset-0":!y,"border-none bg-transparent":y}),id:e,rows:o,"aria-invalid":d,...w,ref:u,autoFocus:p,style:{...h,fontSize:"14px",color:c?b.getColor(k.ErrorText):b.getColor(k.InputText),...!y&&{backgroundColor:b.getColor(k.InputBackground),borderColor:c?b.getColor(k.ErrorBorder):b.getColor(k.InputBorder),borderRadius:b.getRadius(),"--tw-ring-color":b.getColor(k.LinkColor)}}}),!!c&&f.jsx("p",{className:"mt-1 text-xs",style:{color:b.getColor(k.ErrorText)},children:c})]})}function So({variant:e="block",className:t=""}){const n=be(),r=n.getText,a=`text-[10px] flex items-center justify-center gap-1 transition-opacity hover:opacity-80 ${e==="block"?"w-full py-1.5 px-3 text-center":""} ${t}`.trim(),l=e==="block"?{color:n.getColor(k.FooterText)}:{color:n.getColor(k.FooterText)};return f.jsxs("a",{href:"https://www.chatier.app",target:"_blank",rel:"noopener noreferrer",className:a,style:l,children:[f.jsx("span",{children:r(ie.PoweredBy)}),f.jsx("span",{className:"font-semibold",children:"Chatier"})]})}function eL({onOk:e,clientId:t,widgetId:n,appearance:r,aiAgentMode:i=!1,onAIAgentStart:s,onOperatorConnect:o,isConnectingToOperator:a=!1}){var _,j,A,E,D,L;const l=be(),{defaultValues:c,widget:d,setIsHaveChat:u}=ne(),[p,h]=g.useState(!1),y=g.useRef(null);g.useEffect(()=>{const O=setTimeout(()=>{var $;const q=($=y.current)==null?void 0:$.querySelector('input:not([type="hidden"]), select, textarea');q==null||q.focus()},150);return()=>clearTimeout(O)},[]);const w=Zu(),b=Jm(),m=!!c&&"username"in c,v=(j=(_=r==null?void 0:r.body)==null?void 0:_.inputs)==null?void 0:j.reduce((O,q)=>{let $=q.remember?Qs(q.name):c==null?void 0:c[q.name];return q.options&&$&&!q.options.includes($)&&($=void 0),q.name==="username"&&m&&($=c.username),O[q.name]=$||"",O},{}),x=sg((E=(A=r==null?void 0:r.body)==null?void 0:A.inputs)==null?void 0:E.reduce((O,q)=>(O[q.name]=q.required?tu().required(`${q.label} alanı zorunludur`):tu(),O),{})),S=uC({init:{...v},schema:x,validateOnBlur:!1,action:async O=>{var q,$;if(!(p||a)){h(!0);try{m&&(O.username=c.username),c!=null&&c.secret_data&&(O.secret_data=c.secret_data);for(const N in O)typeof O[N]=="string"&&(O[N]=O[N].trim());if(o){for(const N of((q=r==null?void 0:r.body)==null?void 0:q.inputs)||[])N.remember&&ox(N.name,O[N.name]);o(O);return}const[B,I]=await b.mutateAsync({inputs:O,history:w.history,client_id:t,widget_id:n,device_id:Rr((d==null?void 0:d.link_id)||""),is_agent_mode:i});if(zn(I)){Up(B)&&(Fn(rt.CustomerToken,B.customer_token,(d==null?void 0:d.link_id)||""),Fn(rt.CustomerRefreshToken,B.customer_refresh_token,(d==null?void 0:d.link_id)||""),Fn(rt.DeviceId,B.device_id,(d==null?void 0:d.link_id)||"")),w.clearHistory();for(const N of(($=r==null?void 0:r.body)==null?void 0:$.inputs)||[])N.remember&&ox(N.name,O[N.name]);u(!0),i?s==null||s():e==null||e();return}yo(B,{form:S})}catch(B){console.error("Chat creation error:",B)}finally{h(!1)}}}}),C=l.getColor(k.GreeterBackground);return f.jsxs("section",{className:"h-full overflow-y-auto px-5",style:{backgroundColor:C},children:[f.jsxs("form",{ref:y,autoComplete:"off",className:"grid grid-cols-1 gap-4",onSubmit:S.handleSubmit,children:[(L=(D=r==null?void 0:r.body)==null?void 0:D.inputs)==null?void 0:L.map((O,q)=>{var B,I;const $=q===0;if(["text","email","phone"].includes(O.type))return f.jsx(UI,{id:O.name,name:O.name,type:O.type,label:O.label,value:S.values[O.name],onChange:S.handleChange,onBlur:S.handleBlur,disabled:O.name==="username"&&m,readOnly:O.name==="username"&&m,autoComplete:"off",placeholder:O.placeholder,error:S.errors[O.name],ariaInvalid:S.errors.name?!0:void 0,required:O.required,noMargin:!0,autoFocus:$},O.name);if(O.type==="select")return f.jsx(YI,{id:O.name,name:O.name,value:S.values[O.name],onChange:S.handleChange,label:O.label,error:S.errors[O.name],required:O.required,placeholder:O.placeholder,autoFocus:$,children:(B=O.options)==null?void 0:B.map(N=>f.jsx("option",{value:N,children:N},N))},O.name);if(O.type==="checkbox")return f.jsx(XI,{id:O.name,name:O.name,value:S.values[O.name],checked:S.values[O.name]==="true",onChange:S.handleChange,required:O.required,error:S.errors[O.name],children:O.label},O.name);if(O.type==="radio")return f.jsx(lx.Group,{id:O.name,label:O.label,required:O.required,error:S.errors[O.name],children:(I=O.options)==null?void 0:I.map(N=>f.jsx(lx,{onChange:R=>{R?S.setFieldValue(O.name,N):S.setFieldValue(O.name,"")},id:N,name:O.name,value:N===S.values[O.name],children:N},N))},O.name);if(O.type==="textarea")return f.jsx(Ju,{id:O.name,name:O.name,value:S.values[O.name],onChange:S.handleChange,onBlur:S.handleBlur,placeholder:O.placeholder,error:S.errors[O.name],required:O.required,label:O.label,noMargin:!0,autoFocus:$},O.name)}),f.jsx(Rt,{textKey:k.GreeterButtonText,bgKey:k.GreeterButtonBackground,type:"submit",size:"lg",disabled:p||a,className:"transition-all duration-300 hover:opacity-90 transform hover:translate-y-[-1px] shadow-sm",children:p||a?f.jsxs("div",{className:"flex items-center justify-center",children:[f.jsx("span",{className:"mr-2",children:o?"Bağlanıyor":"Yükleniyor"}),f.jsx("span",{className:"animate-pulse",children:"..."})]}):o?"Canlı Desteğe Bağlan":"Sohbet Oluştur"})]}),f.jsx(So,{variant:"block",className:"py-2"})]})}var tn=(e=>(e.Open="open",e.Closed="closed",e.Pending="pending",e.Deleted="deleted",e.Created="created",e.Agent="agent",e))(tn||{}),gn=(e=>(e.AdminJoin="admin_join",e.AdminLeave="admin_leave",e.ChatCreated="chat_created",e.AdminToggleUpload="admin_toggle_upload",e))(gn||{}),ve=(e=>(e.Customer="customer",e.User="user",e.Agent="agent",e.System="system",e.Activity="activity",e))(ve||{});const vs=e=>{const t=eA(),n=(r,i)=>{var o;const s=((o=Z6.find(a=>a.name===r))==null?void 0:o.path)??"/";return typeof i=="object"&&s.includes(":")?Object.entries(i).reduce((a,[l,c])=>a.replace(`:${l}`,c),s):i?`${s}?${i}`:s};return{push:(r,i)=>{t(n(r,i),e)},path:n}};var tL={exports:{}},tf={exports:{}},cx;function fC(){return cx||(cx=1,function(e,t){(function(n,r){e.exports=r()})(mh,function(){var n=1e3,r=6e4,i=36e5,s="millisecond",o="second",a="minute",l="hour",c="day",d="week",u="month",p="quarter",h="year",y="date",w="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function($){var B=["th","st","nd","rd"],I=$%100;return"["+$+(B[(I-20)%10]||B[I]||B[0])+"]"}},x=function($,B,I){var N=String($);return!N||N.length>=B?$:""+Array(B+1-N.length).join(I)+$},S={s:x,z:function($){var B=-$.utcOffset(),I=Math.abs(B),N=Math.floor(I/60),R=I%60;return(B<=0?"+":"-")+x(N,2,"0")+":"+x(R,2,"0")},m:function $(B,I){if(B.date()<I.date())return-$(I,B);var N=12*(I.year()-B.year())+(I.month()-B.month()),R=B.clone().add(N,u),z=I-R<0,H=B.clone().add(N+(z?-1:1),u);return+(-(N+(I-R)/(z?R-H:H-R))||0)},a:function($){return $<0?Math.ceil($)||0:Math.floor($)},p:function($){return{M:u,y:h,w:d,d:c,D:y,h:l,m:a,s:o,ms:s,Q:p}[$]||String($||"").toLowerCase().replace(/s$/,"")},u:function($){return $===void 0}},C="en",_={};_[C]=v;var j="$isDayjsObject",A=function($){return $ instanceof O||!(!$||!$[j])},E=function $(B,I,N){var R;if(!B)return C;if(typeof B=="string"){var z=B.toLowerCase();_[z]&&(R=z),I&&(_[z]=I,R=z);var H=B.split("-");if(!R&&H.length>1)return $(H[0])}else{var W=B.name;_[W]=B,R=W}return!N&&R&&(C=R),R||!N&&C},D=function($,B){if(A($))return $.clone();var I=typeof B=="object"?B:{};return I.date=$,I.args=arguments,new O(I)},L=S;L.l=E,L.i=A,L.w=function($,B){return D($,{locale:B.$L,utc:B.$u,x:B.$x,$offset:B.$offset})};var O=function(){function $(I){this.$L=E(I.locale,null,!0),this.parse(I),this.$x=this.$x||I.x||{},this[j]=!0}var B=$.prototype;return B.parse=function(I){this.$d=function(N){var R=N.date,z=N.utc;if(R===null)return new Date(NaN);if(L.u(R))return new Date;if(R instanceof Date)return new Date(R);if(typeof R=="string"&&!/Z$/i.test(R)){var H=R.match(b);if(H){var W=H[2]-1||0,G=(H[7]||"0").substring(0,3);return z?new Date(Date.UTC(H[1],W,H[3]||1,H[4]||0,H[5]||0,H[6]||0,G)):new Date(H[1],W,H[3]||1,H[4]||0,H[5]||0,H[6]||0,G)}}return new Date(R)}(I),this.init()},B.init=function(){var I=this.$d;this.$y=I.getFullYear(),this.$M=I.getMonth(),this.$D=I.getDate(),this.$W=I.getDay(),this.$H=I.getHours(),this.$m=I.getMinutes(),this.$s=I.getSeconds(),this.$ms=I.getMilliseconds()},B.$utils=function(){return L},B.isValid=function(){return this.$d.toString()!==w},B.isSame=function(I,N){var R=D(I);return this.startOf(N)<=R&&R<=this.endOf(N)},B.isAfter=function(I,N){return D(I)<this.startOf(N)},B.isBefore=function(I,N){return this.endOf(N)<D(I)},B.$g=function(I,N,R){return L.u(I)?this[N]:this.set(R,I)},B.unix=function(){return Math.floor(this.valueOf()/1e3)},B.valueOf=function(){return this.$d.getTime()},B.startOf=function(I,N){var R=this,z=!!L.u(N)||N,H=L.p(I),W=function(Q,V){var P=L.w(R.$u?Date.UTC(R.$y,V,Q):new Date(R.$y,V,Q),R);return z?P:P.endOf(c)},G=function(Q,V){return L.w(R.toDate()[Q].apply(R.toDate("s"),(z?[0,0,0,0]:[23,59,59,999]).slice(V)),R)},te=this.$W,se=this.$M,pe=this.$D,ue="set"+(this.$u?"UTC":"");switch(H){case h:return z?W(1,0):W(31,11);case u:return z?W(1,se):W(0,se+1);case d:var ke=this.$locale().weekStart||0,Ne=(te<ke?te+7:te)-ke;return W(z?pe-Ne:pe+(6-Ne),se);case c:case y:return G(ue+"Hours",0);case l:return G(ue+"Minutes",1);case a:return G(ue+"Seconds",2);case o:return G(ue+"Milliseconds",3);default:return this.clone()}},B.endOf=function(I){return this.startOf(I,!1)},B.$set=function(I,N){var R,z=L.p(I),H="set"+(this.$u?"UTC":""),W=(R={},R[c]=H+"Date",R[y]=H+"Date",R[u]=H+"Month",R[h]=H+"FullYear",R[l]=H+"Hours",R[a]=H+"Minutes",R[o]=H+"Seconds",R[s]=H+"Milliseconds",R)[z],G=z===c?this.$D+(N-this.$W):N;if(z===u||z===h){var te=this.clone().set(y,1);te.$d[W](G),te.init(),this.$d=te.set(y,Math.min(this.$D,te.daysInMonth())).$d}else W&&this.$d[W](G);return this.init(),this},B.set=function(I,N){return this.clone().$set(I,N)},B.get=function(I){return this[L.p(I)]()},B.add=function(I,N){var R,z=this;I=Number(I);var H=L.p(N),W=function(se){var pe=D(z);return L.w(pe.date(pe.date()+Math.round(se*I)),z)};if(H===u)return this.set(u,this.$M+I);if(H===h)return this.set(h,this.$y+I);if(H===c)return W(1);if(H===d)return W(7);var G=(R={},R[a]=r,R[l]=i,R[o]=n,R)[H]||1,te=this.$d.getTime()+I*G;return L.w(te,this)},B.subtract=function(I,N){return this.add(-1*I,N)},B.format=function(I){var N=this,R=this.$locale();if(!this.isValid())return R.invalidDate||w;var z=I||"YYYY-MM-DDTHH:mm:ssZ",H=L.z(this),W=this.$H,G=this.$m,te=this.$M,se=R.weekdays,pe=R.months,ue=R.meridiem,ke=function(V,P,K,Y){return V&&(V[P]||V(N,z))||K[P].slice(0,Y)},Ne=function(V){return L.s(W%12||12,V,"0")},Q=ue||function(V,P,K){var Y=V<12?"AM":"PM";return K?Y.toLowerCase():Y};return z.replace(m,function(V,P){return P||function(K){switch(K){case"YY":return String(N.$y).slice(-2);case"YYYY":return L.s(N.$y,4,"0");case"M":return te+1;case"MM":return L.s(te+1,2,"0");case"MMM":return ke(R.monthsShort,te,pe,3);case"MMMM":return ke(pe,te);case"D":return N.$D;case"DD":return L.s(N.$D,2,"0");case"d":return String(N.$W);case"dd":return ke(R.weekdaysMin,N.$W,se,2);case"ddd":return ke(R.weekdaysShort,N.$W,se,3);case"dddd":return se[N.$W];case"H":return String(W);case"HH":return L.s(W,2,"0");case"h":return Ne(1);case"hh":return Ne(2);case"a":return Q(W,G,!0);case"A":return Q(W,G,!1);case"m":return String(G);case"mm":return L.s(G,2,"0");case"s":return String(N.$s);case"ss":return L.s(N.$s,2,"0");case"SSS":return L.s(N.$ms,3,"0");case"Z":return H}return null}(V)||H.replace(":","")})},B.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},B.diff=function(I,N,R){var z,H=this,W=L.p(N),G=D(I),te=(G.utcOffset()-this.utcOffset())*r,se=this-G,pe=function(){return L.m(H,G)};switch(W){case h:z=pe()/12;break;case u:z=pe();break;case p:z=pe()/3;break;case d:z=(se-te)/6048e5;break;case c:z=(se-te)/864e5;break;case l:z=se/i;break;case a:z=se/r;break;case o:z=se/n;break;default:z=se}return R?z:L.a(z)},B.daysInMonth=function(){return this.endOf(u).$D},B.$locale=function(){return _[this.$L]},B.locale=function(I,N){if(!I)return this.$L;var R=this.clone(),z=E(I,N,!0);return z&&(R.$L=z),R},B.clone=function(){return L.w(this.$d,this)},B.toDate=function(){return new Date(this.valueOf())},B.toJSON=function(){return this.isValid()?this.toISOString():null},B.toISOString=function(){return this.$d.toISOString()},B.toString=function(){return this.$d.toUTCString()},$}(),q=O.prototype;return D.prototype=q,[["$ms",s],["$s",o],["$m",a],["$H",l],["$W",c],["$M",u],["$y",h],["$D",y]].forEach(function($){q[$[1]]=function(B){return this.$g(B,$[0],$[1])}}),D.extend=function($,B){return $.$i||($(B,O,D),$.$i=!0),D},D.locale=E,D.isDayjs=A,D.unix=function($){return D(1e3*$)},D.en=_[C],D.Ls=_,D.p={},D})}(tf)),tf.exports}(function(e,t){(function(n,r){e.exports=r(fC())})(mh,function(n){function r(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}var i=r(n),s={name:"tr",weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekStart:1,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(o){return o+"."}};return i.default.locale(s,null,!0),s})})(tL);var pC={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(mh,function(){return function(n,r,i){n=n||{};var s=r.prototype,o={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function a(c,d,u,p){return s.fromToBase(c,d,u,p)}i.en.relativeTime=o,s.fromToBase=function(c,d,u,p,h){for(var y,w,b,m=u.$locale().relativeTime||o,v=n.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],x=v.length,S=0;S<x;S+=1){var C=v[S];C.d&&(y=p?i(c).diff(u,C.d,!0):u.diff(c,C.d,!0));var _=(n.rounding||Math.round)(Math.abs(y));if(b=y>0,_<=C.r||!C.r){_<=1&&S>0&&(C=v[S-1]);var j=m[C.l];h&&(_=h(""+_)),w=typeof j=="string"?j.replace("%d",_):j(_,d,C.l,b);break}}if(d)return w;var A=b?m.future:m.past;return typeof A=="function"?A(w):A.replace("%s",w)},s.to=function(c,d){return a(c,d,this,!0)},s.from=function(c,d){return a(c,d,this)};var l=function(c){return c.$u?i.utc():i()};s.toNow=function(c){return this.to(l(this),c)},s.fromNow=function(c){return this.from(l(this),c)}}})})(pC);var nL=pC.exports;const rL=Pr(nL);var iL=fC();const nf=Pr(iL),sL=(e="tr")=>(nf.extend(rL),nf.locale(e),nf);function oL({onHasHistory:e,emptyStateText:t}){const n=ne(x=>x.widget),r=ne(x=>x.setHistoryChat),i=ne(x=>x.setHistoryMessages),s=be(),o=vs(),[a,l]=g.useState(null),c=sL(),d=g.useRef(!1),u=n!=null&&n.link_id?Rr(n.link_id):null,{data:p,isLoading:h}=CM((n==null?void 0:n.link_id)||"",u||"");if(g.useEffect(()=>{if(!h&&p){const[x,S]=p,C=zn(S)&&Array.isArray(x)&&x.length>0;if(C&&!d.current){const _=x[0];if(_.status===tn.Open||_.status===tn.Pending){console.log("ChatHistoryList: Auto-joining active chat",_._id),d.current=!0,r(_),i(null),o.push("chat");return}}e&&e(C)}},[h,p,e,o,r,i]),!(n!=null&&n.link_id))return null;if(h)return f.jsx("div",{className:"p-4 text-center text-xs opacity-50",children:"Yükleniyor..."});if(!p)return null;const[y,w]=p;if(!zn(w)||!Array.isArray(y))return null;const b=x=>c(x).fromNow(),m=x=>{const S=x.map(_=>typeof _=="string"?_.trim():"").filter(Boolean);if(S.length===0)return"Atanmamış";if(S.length===1)return S[0];if(S.length===2)return`${S[0]} ve ${S[1]}`;if(S.length===3)return`${S[0]}, ${S[1]} ve ${S[2]}`;const C=S.length-2;return`${S[0]}, ${S[1]} ve ${C} kişi daha`},v=x=>{var S;if(x.who_joined_details&&Array.isArray(x.who_joined_details)&&x.who_joined_details.length>0){const C=x.who_joined_details.map(_=>_.name||"");return m(C)}if(x.participant_logs&&Array.isArray(x.participant_logs)&&x.participant_logs.length>0){const C=x.participant_logs.map(_=>_.name||"");return m(C)}return(S=x.archive_summary)!=null&&S.admin_name?x.archive_summary.admin_name:"Atanmamış"};return y.length===0?f.jsx("div",{className:"h-full flex items-center justify-center p-6 text-center",children:f.jsxs("div",{className:"max-w-xs",children:[f.jsx("div",{className:"text-sm font-medium opacity-80",children:"Henüz sohbet yok"}),f.jsx("div",{className:"mt-2 text-xs opacity-60",children:t||"Yeni bir sohbet başlatmak için aşağıdaki butonu kullanabilirsiniz."})]})}):f.jsx("div",{className:"flex flex-col h-full",children:f.jsx("div",{className:"flex-1 overflow-y-auto space-y-0 min-h-0",children:y.map(x=>f.jsxs("button",{type:"button",className:"w-full flex justify-between items-center gap-2 p-5 text-left transition-colors",style:{color:s.getColor(k.InputText),backgroundColor:a===x._id?s.getColor(k.MessageAdminBackground):"transparent",cursor:"pointer"},onMouseEnter:()=>l(x._id),onMouseLeave:()=>l(null),onClick:()=>{r(x),i(null),o.push("chat")},children:[f.jsx("span",{className:"font-medium text-sm truncate flex-1 min-w-0",children:v(x)}),f.jsx("span",{className:"text-xs flex-shrink-0 tabular-nums",style:{color:s.getColor(k.FooterText)},children:b(x.created_at)})]},x._id))})})}const rf=[Le.Light,Le.Dark,Le.System];function aL(e){switch(e){case Le.Light:return Z.Sun;case Le.Dark:return Z.Moon;case Le.System:return Z.Monitor;default:return Z.Monitor}}function lL(){const e=be(),{mode:t,setMode:n}=e,r=()=>{const s=rf.indexOf(t),o=rf[(s+1)%rf.length];n(o)},i=aL(t);return f.jsx("button",{type:"button",onClick:r,className:"flex items-center justify-center p-1.5 rounded-md hover:opacity-80 transition-opacity",style:{backgroundColor:"transparent",color:e.getColor(k.HeaderText)},title:t===Le.Light?"Açık tema":t===Le.Dark?"Koyu tema":"Sistem",children:f.jsx(i,{className:"size-5"})})}const cr=Object.create(null);cr.open="0";cr.close="1";cr.ping="2";cr.pong="3";cr.message="4";cr.upgrade="5";cr.noop="6";const hc=Object.create(null);Object.keys(cr).forEach(e=>{hc[cr[e]]=e});const eh={type:"error",data:"parser error"},hC=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",mC=typeof ArrayBuffer=="function",gC=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,xg=({type:e,data:t},n,r)=>hC&&t instanceof Blob?n?r(t):ux(t,r):mC&&(t instanceof ArrayBuffer||gC(t))?n?r(t):ux(new Blob([t]),r):r(cr[e]+(t||"")),ux=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function dx(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let sf;function cL(e,t){if(hC&&e.data instanceof Blob)return e.data.arrayBuffer().then(dx).then(t);if(mC&&(e.data instanceof ArrayBuffer||gC(e.data)))return t(dx(e.data));xg(e,!1,n=>{sf||(sf=new TextEncoder),t(sf.encode(n))})}const fx="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ra=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<fx.length;e++)ra[fx.charCodeAt(e)]=e;const uL=e=>{let t=e.length*.75,n=e.length,r,i=0,s,o,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const c=new ArrayBuffer(t),d=new Uint8Array(c);for(r=0;r<n;r+=4)s=ra[e.charCodeAt(r)],o=ra[e.charCodeAt(r+1)],a=ra[e.charCodeAt(r+2)],l=ra[e.charCodeAt(r+3)],d[i++]=s<<2|o>>4,d[i++]=(o&15)<<4|a>>2,d[i++]=(a&3)<<6|l&63;return c},dL=typeof ArrayBuffer=="function",wg=(e,t)=>{if(typeof e!="string")return{type:"message",data:vC(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:fL(e.substring(1),t)}:hc[n]?e.length>1?{type:hc[n],data:e.substring(1)}:{type:hc[n]}:eh},fL=(e,t)=>{if(dL){const n=uL(e);return vC(n,t)}else return{base64:!0,data:e}},vC=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},yC="",pL=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((s,o)=>{xg(s,!1,a=>{r[o]=a,++i===n&&t(r.join(yC))})})},hL=(e,t)=>{const n=e.split(yC),r=[];for(let i=0;i<n.length;i++){const s=wg(n[i],t);if(r.push(s),s.type==="error")break}return r};function mL(){return new TransformStream({transform(e,t){cL(e,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const s=new DataView(i.buffer);s.setUint8(0,126),s.setUint16(1,r)}else{i=new Uint8Array(9);const s=new DataView(i.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let of;function ql(e){return e.reduce((t,n)=>t+n.length,0)}function Gl(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function gL(e,t){of||(of=new TextDecoder);const n=[];let r=0,i=-1,s=!1;return new TransformStream({transform(o,a){for(n.push(o);;){if(r===0){if(ql(n)<1)break;const l=Gl(n,1);s=(l[0]&128)===128,i=l[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(ql(n)<2)break;const l=Gl(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(ql(n)<8)break;const l=Gl(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),d=c.getUint32(0);if(d>Math.pow(2,21)-1){a.enqueue(eh);break}i=d*Math.pow(2,32)+c.getUint32(4),r=3}else{if(ql(n)<i)break;const l=Gl(n,i);a.enqueue(wg(s?l:of.decode(l),t)),r=0}if(i===0||i>e){a.enqueue(eh);break}}}})}const xC=4;function st(e){if(e)return vL(e)}function vL(e){for(var t in st.prototype)e[t]=st.prototype[t];return e}st.prototype.on=st.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};st.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};st.prototype.off=st.prototype.removeListener=st.prototype.removeAllListeners=st.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};st.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this};st.prototype.emitReserved=st.prototype.emit;st.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};st.prototype.hasListeners=function(e){return!!this.listeners(e).length};const ed=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),bn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),yL="arraybuffer";function wC(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const xL=bn.setTimeout,wL=bn.clearTimeout;function td(e,t){t.useNativeTimers?(e.setTimeoutFn=xL.bind(bn),e.clearTimeoutFn=wL.bind(bn)):(e.setTimeoutFn=bn.setTimeout.bind(bn),e.clearTimeoutFn=bn.clearTimeout.bind(bn))}const bL=1.33;function kL(e){return typeof e=="string"?SL(e):Math.ceil((e.byteLength||e.size)*bL)}function SL(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function bC(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function CL(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function _L(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let s=n[r].split("=");t[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return t}class TL extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class bg extends st{constructor(t){super(),this.writable=!1,td(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new TL(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=wg(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=CL(t);return n.length?"?"+n:""}}class EL extends bg{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};hL(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,pL(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=bC()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let kC=!1;try{kC=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const AL=kC;function jL(){}class RL extends EL{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,s)=>{this.onError("xhr post error",i,s)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class ar extends st{constructor(t,n,r){super(),this.createRequest=t,td(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=wC(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=ar.requestsCount++,ar.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=jL,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete ar.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}ar.requestsCount=0;ar.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",px);else if(typeof addEventListener=="function"){const e="onpagehide"in bn?"pagehide":"unload";addEventListener(e,px,!1)}}function px(){for(let e in ar.requests)ar.requests.hasOwnProperty(e)&&ar.requests[e].abort()}const PL=function(){const e=SC({xdomain:!1});return e&&e.responseType!==null}();class ML extends RL{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=PL&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new ar(SC,this.uri(),t)}}function SC(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||AL))return new XMLHttpRequest}catch{}if(!t)try{return new bn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const CC=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class NL extends bg{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=CC?{}:wC(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;xg(r,this.supportsBinary,s=>{try{this.doWrite(r,s)}catch{}i&&ed(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=bC()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const af=bn.WebSocket||bn.MozWebSocket;class OL extends NL{createSocket(t,n,r){return CC?new af(t,n,r):n?new af(t,n):new af(t)}doWrite(t,n){this.ws.send(n)}}class DL extends bg{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=gL(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=mL();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const s=()=>{r.read().then(({done:a,value:l})=>{a||(this.onPacket(l),s())}).catch(a=>{})};s();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this._writer.write(r).then(()=>{i&&ed(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const IL={websocket:OL,webtransport:DL,polling:ML},LL=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,FL=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function th(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=LL.exec(e||""),s={},o=14;for(;o--;)s[FL[o]]=i[o]||"";return n!=-1&&r!=-1&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=$L(s,s.path),s.queryKey=BL(s,s.query),s}function $L(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function BL(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,s){i&&(n[i]=s)}),n}const nh=typeof addEventListener=="function"&&typeof removeEventListener=="function",mc=[];nh&&addEventListener("offline",()=>{mc.forEach(e=>e())},!1);class di extends st{constructor(t,n){if(super(),this.binaryType=yL,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=th(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=th(n.host).host);td(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=_L(this.opts.query)),nh&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},mc.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=xC,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&di.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",di.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=kL(i)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,ed(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const s={type:t,data:n,options:r};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(di.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),nh&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=mc.indexOf(this._offlineEventListener);r!==-1&&mc.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}di.protocol=xC;class zL extends di{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;di.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",u=>{if(!r)if(u.type==="pong"&&u.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;di.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const p=new Error("probe error");p.transport=n.name,this.emitReserved("upgradeError",p)}}))};function s(){r||(r=!0,d(),n.close(),n=null)}const o=u=>{const p=new Error("probe error: "+u);p.transport=n.name,s(),this.emitReserved("upgradeError",p)};function a(){o("transport closed")}function l(){o("socket closed")}function c(u){n&&u.name!==n.name&&s()}const d=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};n.once("open",i),n.once("error",o),n.once("close",a),this.once("close",l),this.once("upgrading",c),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let VL=class extends zL{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(i=>IL[i]).filter(i=>!!i)),super(t,r)}};function UL(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=th(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const s=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+s+":"+r.port+t,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}const HL=typeof ArrayBuffer=="function",WL=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,_C=Object.prototype.toString,qL=typeof Blob=="function"||typeof Blob<"u"&&_C.call(Blob)==="[object BlobConstructor]",GL=typeof File=="function"||typeof File<"u"&&_C.call(File)==="[object FileConstructor]";function kg(e){return HL&&(e instanceof ArrayBuffer||WL(e))||qL&&e instanceof Blob||GL&&e instanceof File}function gc(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(gc(e[n]))return!0;return!1}if(kg(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return gc(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&gc(e[n]))return!0;return!1}function YL(e){const t=[],n=e.data,r=e;return r.data=rh(n,t),r.attachments=t.length,{packet:r,buffers:t}}function rh(e,t){if(!e)return e;if(kg(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=rh(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=rh(e[r],t));return n}return e}function QL(e,t){return e.data=ih(e.data,t),delete e.attachments,e}function ih(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=ih(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=ih(e[n],t));return e}const KL=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],XL=5;var Te;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(Te||(Te={}));class ZL{constructor(t){this.replacer=t}encode(t){return(t.type===Te.EVENT||t.type===Te.ACK)&&gc(t)?this.encodeAsBinary({type:t.type===Te.EVENT?Te.BINARY_EVENT:Te.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===Te.BINARY_EVENT||t.type===Te.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=YL(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function hx(e){return Object.prototype.toString.call(e)==="[object Object]"}class Sg extends st{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===Te.BINARY_EVENT;r||n.type===Te.BINARY_ACK?(n.type=r?Te.EVENT:Te.ACK,this.reconstructor=new JL(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(kg(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(Te[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Te.BINARY_EVENT||r.type===Te.BINARY_ACK){const s=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const o=t.substring(s,n);if(o!=Number(o)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(o)}if(t.charAt(n+1)==="/"){const s=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(s,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const s=n+1;for(;++n;){const o=t.charAt(n);if(o==null||Number(o)!=o){--n;break}if(n===t.length)break}r.id=Number(t.substring(s,n+1))}if(t.charAt(++n)){const s=this.tryParse(t.substr(n));if(Sg.isPayloadValid(r.type,s))r.data=s;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case Te.CONNECT:return hx(n);case Te.DISCONNECT:return n===void 0;case Te.CONNECT_ERROR:return typeof n=="string"||hx(n);case Te.EVENT:case Te.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&KL.indexOf(n[0])===-1);case Te.ACK:case Te.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class JL{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=QL(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const eF=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Sg,Encoder:ZL,get PacketType(){return Te},protocol:XL},Symbol.toStringTag,{value:"Module"}));function Dn(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const tF=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class TC extends st{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Dn(t,"open",this.onopen.bind(this)),Dn(t,"packet",this.onpacket.bind(this)),Dn(t,"error",this.onerror.bind(this)),Dn(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,i,s;if(tF.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const o={type:Te.EVENT,data:n};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const d=this.ids++,u=n.pop();this._registerAckCallback(d,u),o.id=d}const a=(i=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||i===void 0?void 0:i.writable,l=this.connected&&!(!((s=this.io.engine)===null||s===void 0)&&s._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const s=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},i),o=(...a)=>{this.io.clearTimeoutFn(s),n.apply(this,a)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...n){return new Promise((r,i)=>{const s=(o,a)=>o?i(o):r(a);s.withError=!0,n.push(s),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...s)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...s)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Te.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Te.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Te.EVENT:case Te.BINARY_EVENT:this.onevent(t);break;case Te.ACK:case Te.BINARY_ACK:this.onack(t);break;case Te.DISCONNECT:this.ondisconnect();break;case Te.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:Te.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Te.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Oo(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Oo.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};Oo.prototype.reset=function(){this.attempts=0};Oo.prototype.setMin=function(e){this.ms=e};Oo.prototype.setMax=function(e){this.max=e};Oo.prototype.setJitter=function(e){this.jitter=e};class sh extends st{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,td(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Oo({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||eF;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new VL(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=Dn(n,"open",function(){r.onopen(),t&&t()}),s=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},o=Dn(n,"error",s);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{i(),s(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Dn(t,"ping",this.onping.bind(this)),Dn(t,"data",this.ondata.bind(this)),Dn(t,"error",this.onerror.bind(this)),Dn(t,"close",this.onclose.bind(this)),Dn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){ed(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new TC(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Yo={};function vc(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=UL(e,t.path||"/socket.io"),r=n.source,i=n.id,s=n.path,o=Yo[i]&&s in Yo[i].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let l;return a?l=new sh(r,t):(Yo[i]||(Yo[i]=new sh(r,t)),l=Yo[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(vc,{Manager:sh,Socket:TC,io:vc,connect:vc});const EC=g.createContext(null),dr=()=>{const e=g.useContext(EC);if(!e)throw new Error("useWebsocket must be used within a WebSocketProvider");return e},nF=({children:e})=>{const{widget:t,isHaveChat:n,isAIAgentMode:r}=ne(),i=g.useRef(null),s=g.useRef(!1),o=g.useRef(!1),a=g.useRef(null),[l,c]=g.useState(!1),[d,u]=g.useState(!1),p=g.useCallback(C=>{var _;console.log("WS: cleanupSocket called",{reason:C,hasSocket:!!i.current,isConnected:(_=i.current)==null?void 0:_.connected,currentLinkId:a.current}),i.current&&(console.log("WS: Cleaning up existing socket.",C||""),i.current.removeAllListeners(),i.current.disconnect(),i.current=null),c(!1),u(!1),o.current=!1,s.current=!1,a.current=null},[]),h=g.useCallback((C,_,j)=>{if(a.current===C&&(o.current||i.current&&i.current.connected)){console.log("WS: Connect called but already connecting or connected for same linkId.");return}if(!_&&!j){console.log("WS: Connect skipped - no active chat or AI agent mode");return}const A=na(rt.CustomerToken,C)||Qs("customer_token"),E=na(rt.CustomerRefreshToken,C)||Qs("customer_refresh_token");if(!A||!E){if(console.log("WS: Connect skipped - missing required tokens"),_){console.log("WS: Clearing stale isHaveChat flag due to missing tokens"),localStorage.removeItem("lc:widget:isHaveChat");try{ne.getState().setIsHaveChat(!1)}catch{}}return}if(i.current&&!i.current.connected&&(console.log("WS: Cleaning up disconnected/failed socket before new connection"),i.current.removeAllListeners(),i.current.disconnect(),i.current=null),i.current&&i.current.connected){console.log("WS: Already connected, skipping new connection");return}console.log("WS: Attempting to connect...",{linkId:C,tokenPrefix:`${A==null?void 0:A.substring(0,20)}...`,refreshTokenPrefix:`${E==null?void 0:E.substring(0,20)}...`,deviceId:na(rt.DeviceId,C)}),o.current=!0,a.current=C;const D=vc(BT,{transports:["websocket"],forceNew:!0,timeout:1e4,auth:{customer_token:A,device_id:na(rt.DeviceId,C)||Qs("device_id"),customer_refresh_token:E}});i.current=D,D.on("error",L=>{console.error("WS: Websocket error",L),o.current=!1}),D.on("connect_error",L=>{console.error("WS: Connect error",L),o.current=!1,c(!1),u(!1),i.current===D&&(i.current=null,a.current=null);const O=(L==null?void 0:L.message)||String(L);if(O.toLowerCase().includes("unauthorized")||O.includes("401")){console.log("WS: Unauthorized error, clearing tokens only"),C&&mS(C),localStorage.removeItem("lc:widget:isHaveChat");try{ne.getState().setIsHaveChat(!1)}catch{}}}),D.on("disconnect",L=>{var q;console.log("WS: Disconnected",L),c(!1),u(!1),o.current=!1,s.current=!1,i.current===D&&(i.current=null,a.current=null);const O=ne.getState();L==="io server disconnect"&&((q=O.widget)!=null&&q.link_id)&&(O.isHaveChat||O.isAIAgentMode)&&(console.log("WS: Server disconnect, attempting reconnect..."),setTimeout(()=>{h(O.widget.link_id,O.isHaveChat,O.isAIAgentMode)},500))}),D.on("connect",()=>{console.log("WS: Connected successfully"),c(!0),o.current=!1}),D.on("connection:ready",()=>{console.log("WS: Connection ready received"),s.current=!0,u(!0)})},[]);g.useEffect(()=>{const C=t==null?void 0:t.link_id;return C&&(n||r)?(console.log("WS: Auto-connecting due to linkId and isHaveChat/isAIAgentMode",{isHaveChat:n,isAIAgentMode:r}),h(C,n,r)):!n&&!r&&(console.log("WS: Auto-disconnect due to no isHaveChat and no isAIAgentMode"),p("no active chat flags")),()=>{}},[t==null?void 0:t.link_id,n,r,h,p]),g.useEffect(()=>()=>{console.log("WS: Provider unmounting, cleaning up"),p("provider unmount")},[p]),g.useEffect(()=>{const C=()=>{console.log("WS: Page unloading, disconnecting socket"),i.current&&(i.current.disconnect(),i.current=null)},_=()=>{console.log("WS: Page hidden (pagehide), disconnecting socket"),i.current&&(i.current.disconnect(),i.current=null)};return window.addEventListener("beforeunload",C),window.addEventListener("pagehide",_),()=>{window.removeEventListener("beforeunload",C),window.removeEventListener("pagehide",_)}},[]);const y=g.useCallback(()=>{const C=t==null?void 0:t.link_id;C?h(C,n,r):console.warn("WS: Manual connect failed, no link_id available.")},[t==null?void 0:t.link_id,n,r,h]),w=g.useCallback(()=>{console.log("WS: Reconnecting..."),p("manual reconnect");const C=t==null?void 0:t.link_id;C&&setTimeout(()=>{h(C,n,r)},100)},[t==null?void 0:t.link_id,n,r,h,p]),b=g.useCallback(()=>{console.log("WS: Manual disconnect"),p("manual disconnect")},[p]),m=g.useCallback((C,_)=>{var j;(j=i.current)==null||j.on(C,_)},[]),v=g.useCallback((C,_)=>{var j;(j=i.current)==null||j.off(C,_)},[]),x=g.useCallback((C,_,j)=>{i.current&&i.current.connected?i.current.emit(C,_,j):console.warn(`WS: Cannot emit event '${C}', socket not connected.`)},[]),S=g.useMemo(()=>({connectionReady:d,connected:l,connect:y,reconnect:w,disconnect:b,on:m,off:v,emit:x}),[l,d,y,w,b,m,v,x]);return f.jsx(EC.Provider,{value:S,children:e})},ru=(e,t,n)=>{const r=typeof window<"u"?window:void 0;g.useEffect(()=>(r.addEventListener(e,t),()=>{r.removeEventListener(e,t,!1)}),[e,t,r])},Do=()=>{let e=!1,t=!1;return typeof window<"u"&&(e=new URLSearchParams(window.location.search).get("fullscreen")==="true",t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(window.navigator.userAgent)),e||t},rF=()=>{let e=!1;return typeof window<"u"&&(e=new URLSearchParams(window.location.search).get("fullscreen")==="true"),e},nd=()=>g.useMemo(()=>typeof window>"u"||new URLSearchParams(window.location.search).get("fullscreen")==="true"?!1:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(window.navigator.userAgent),[]);var He=(e=>(e.ChatView="chat:user:view",e.ChatClose="chat:user:close",e.MessageList="message:list",e.MessageCreate="message:create",e.MessageTyping="message:typing",e.WidgetOpen="widget:open",e.WidgetClose="widget:close",e.PageChange="page-change",e.MessageRead="message:read",e.AgentRequestHuman="agent:request:human",e.AgentMessageCreate="agent:message:create",e.ChatUpdateInputs="chat:update:inputs",e))(He||{}),ge=(e=>(e.Connect="connect",e.Disconnect="disconnect",e.ConnectionReady="connection:ready",e.MessageAgentCreate="message:agent:create",e.MessageUserCreate="message:user:create",e.MessageCustomerCreate="message:customer:create",e.MessageAgentTyping="message:agent:typing",e.Banned="banned",e.ChatUserClose="chat:user:close",e.ChatUserAssignee="chat:user:assignee",e.ChatToggleUpload="chat:user:upload:toggle",e.ChatUserShowButton="chat:user:show-button",e.ChatUserLeave="chat:user:leave",e.ChatUserJoin="chat:user:join",e.AgentMessageChunk="agent:message:chunk",e.AgentMessageFinalMetadata="agent:message:final_metadata",e.AgentSpamWarning="agent:spam:warning",e.AgentSpamBanned="agent:spam:banned",e))(ge||{});function iF(){const e=Zu(),t=g.useCallback(()=>{const n=window.location.pathname;n!==e.page&&e.setPage(n)},[e.page]);return ru("popstate",t),null}function sF(){const e=dr(),t=Zu(),n=g.useCallback(()=>{const r=window.location.pathname;if(r!==t.page){if(e){e.emit(He.PageChange,{page:r});return}t.setPage(r)}},[e,t.page]);return ru("popstate",n),g.useEffect(()=>{if(!e)return;const r=WI(),i=HI();r!==i&&(e.emit(He.PageChange,{page:i}),t.setPage(i))},[e]),null}function oF(){return iF(),null}const mx=(e,t)=>{var n;return(n=e.find(r=>r.type===t))==null?void 0:n.content};function aF(){var ue,ke,Ne,Q;const e=be(),t=ne(V=>V.widget),n=ne(V=>V.setOpen),r=ne(V=>V.setAIAgent),i=ne(V=>V.setIsAIAgentMode),s=ne(V=>V.setIsHaveChat),o=ne(V=>V.isHaveChat),a=ne(V=>V.humanNeedRequested),l=ne(V=>V.setHumanNeedRequested),c=ne(V=>V.aiAgent),d=ne(V=>V.setShowActionButtons),u=ne(V=>V.defaultValues),[p,h]=g.useState(!1),[y,w]=g.useState(!1),[b,m]=g.useState(null),v=vs(),x=Do(),S=nd(),[C,_]=g.useState(!0),[j,A]=g.useState(!1),E=Zu(),D=Jm(),L=dr(),[O,q]=g.useState(null),$=g.useRef(!1),B=g.useRef(!1),I=g.useRef(!1),N=fl(),R=g.useCallback(async()=>{var P,K,Y;if(!t)return;m(null),ne.getState().setHistoryChat(null),ne.getState().setHistoryMessages(null),ne.getState().clearAIAgentState(),d(!1);const V=(((Y=(K=(P=t.appearance)==null?void 0:P.body)==null?void 0:K.inputs)==null?void 0:Y.length)||0)>0;if(O){if(I.current)return;I.current=!0;try{const me={username:(u==null?void 0:u.username)||"Ziyaretçi",email:`visitor_${Date.now()}@temp.local`};u!=null&&u.secret_data&&(me.secret_data=u.secret_data);const[re,Ee]=await D.mutateAsync({inputs:me,history:E.history,client_id:t.client_id,widget_id:t.link_id,device_id:Rr(t.link_id),is_agent_mode:!0});zn(Ee)&&Up(re)?(Fn(rt.CustomerToken,re.customer_token,t.link_id),Fn(rt.CustomerRefreshToken,re.customer_refresh_token,t.link_id),Fn(rt.DeviceId,re.device_id,t.link_id),E.clearHistory(),s(!0),r(O),i(!0),v.push("chat")):(yo(re),(re==null?void 0:re.statusCode)===403&&m((re==null?void 0:re.message)||"Sohbet başlatılamadı."))}catch(me){console.error("Error creating chat for AI agent:",me)}finally{I.current=!1}return}if(!V){if(I.current)return;I.current=!0;try{const me={};u!=null&&u.secret_data&&(me.secret_data=u.secret_data),u!=null&&u.username&&(me.username=u.username);const[re,Ee]=await D.mutateAsync({inputs:me,history:E.history,client_id:t.client_id,widget_id:t.link_id,device_id:Rr(t.link_id)});zn(Ee)&&Up(re)?(Fn(rt.CustomerToken,re.customer_token,t.link_id),Fn(rt.CustomerRefreshToken,re.customer_refresh_token,t.link_id),Fn(rt.DeviceId,re.device_id,t.link_id),E.clearHistory(),s(!0),v.push("chat")):(yo(re),(re==null?void 0:re.statusCode)===403&&m((re==null?void 0:re.message)||"Sohbet başlatılamadı."))}catch(me){console.error("Error creating chat:",me)}finally{I.current=!1}return}_(!1)},[t,O,D,E,u==null?void 0:u.secret_data,u==null?void 0:u.username,s,r,i,v,d]),z=g.useCallback(V=>{A(V)},[]);if(!t)return null;const H=()=>{n(!1)};g.useEffect(()=>{var K,Y,me;if(!t||$.current)return;$.current=!0;const V=mr(t.link_id);if(V.isAgentMode&&V.agent&&(N!=null&&N.accessToken)){if(r(V.agent),i(!0),V.sessionId&&ne.getState().setAIAgentSessionId(V.sessionId),V.humanNeedRequested){if(ne.getState().setHumanNeedRequested(!0),!((((me=(Y=(K=t.appearance)==null?void 0:K.body)==null?void 0:Y.inputs)==null?void 0:me.length)||0)>0)){v.push("chat");return}return}q(V.agent),v.push("chat");return}(async()=>{try{const[re,Ee]=await TM(t.link_id);Ee===200&&re&&re.is_active&&q(re)}catch(re){console.error("Failed to check AI agent:",re)}})()},[t,N==null?void 0:N.accessToken,N==null?void 0:N.refreshToken,v,r,i]),g.useEffect(()=>{if(p||!t||!N||!N.accessToken){B.current=!1;return}if(B.current||a)return;if(o){v.push("chat");return}const V=mr(t.link_id);V.isAgentMode&&V.agent&&!V.humanNeedRequested||(B.current=!0,yM(t.client_id,Qi(Yi(N),t.link_id)).then(([P,K])=>{if(zn(K))a||v.push("chat");else if(K===403){const Y=mr(t.link_id);if(Y.isAgentMode&&Y.agent){if(Y.humanNeedRequested){r(Y.agent),i(!1),Y.sessionId&&ne.getState().setAIAgentSessionId(Y.sessionId),ne.getState().setHumanNeedRequested(!0);return}r(Y.agent),i(!0),Y.sessionId&&ne.getState().setAIAgentSessionId(Y.sessionId),v.push("chat")}else ya(t.link_id||""),h(!0)}else K===404?(ya(t.link_id||""),h(!0)):K===401?(mS(t.link_id||""),h(!0)):v.push("chat")}).catch(()=>v.push("chat")))},[p,v,r,i,t,N==null?void 0:N.accessToken,N==null?void 0:N.refreshToken,o,a]);const W=mx(((ke=(ue=t.appearance)==null?void 0:ue.head)==null?void 0:ke.elements)||[],"text"),G=mx(((Q=(Ne=t.appearance)==null?void 0:Ne.head)==null?void 0:Q.elements)||[],"title"),te=()=>{if(a&&t){let V=c;if(!V){const P=mr(t.link_id);P.agent&&(V=P.agent,r(P.agent),q(P.agent))}if(V){i(!0),ne.getState().setHistoryChat(null),ne.getState().setHistoryMessages(null),v.push("chat");return}}_(!0)},se=()=>{O&&(r(O),i(!0),ne.getState().setHistoryChat(null),ne.getState().setHistoryMessages(null),v.push("chat"))},pe=g.useCallback(V=>{if(!L||y)return;w(!0);const P=()=>{L.emit(He.AgentRequestHuman,{},K=>{w(!1),K!=null&&K.success&&(ne.getState().setIsHaveChat(!0),d(!1),i(!1),l(!1),ne.getState().clearAIAgentState(),v.push("chat"))})};V&&Object.keys(V).length>0?L.emit(He.ChatUpdateInputs,{inputs:V},K=>{K!=null&&K.success?P():w(!1)}):P()},[L,y,i,l,v]);return g.useEffect(()=>{var V,P,K;if(a){if(!c&&t){const Y=mr(t.link_id);Y.agent&&(r(Y.agent),q(Y.agent))}(c||mr((t==null?void 0:t.link_id)||"").agent)&&((((K=(P=(V=t==null?void 0:t.appearance)==null?void 0:V.body)==null?void 0:P.inputs)==null?void 0:K.length)||0)>0?_(!1):pe())}},[a,c,t,pe,r]),f.jsxs("div",{className:"h-full w-full flex flex-col relative overflow-hidden",children:[f.jsxs("header",{className:"flex items-center justify-between px-4 py-3 flex-shrink-0 overflow-visible min-h-[52px]",style:{backgroundColor:e.getColor(k.HeaderBackground),color:e.getColor(k.HeaderText),borderColor:e.getColor(k.HeaderBorder),...x?{}:{borderTopLeftRadius:e.getRadius(),borderTopRightRadius:e.getRadius()}},children:[f.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[!C&&(j||a&&(c||t&&mr(t.link_id).agent))&&f.jsx("button",{type:"button",onClick:te,className:"flex-shrink-0 p-1 hover:opacity-80 transition-opacity",children:f.jsx(Z.ArrowLeft,{className:"w-5 h-5"})}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("div",{className:"text-sm font-semibold truncate",children:C?"Geçmiş sohbetler":G||"Müşteri Hizmetleri"}),!C&&W&&f.jsx("div",{className:"text-xs opacity-90 truncate",children:W})]})]}),f.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0 ml-2",children:[f.jsx(lL,{}),S&&f.jsx("button",{type:"button",onClick:H,className:"p-1.5 rounded-md hover:opacity-80 transition-opacity",children:f.jsx(Z.X,{className:"w-5 h-5"})})]})]}),f.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-h-0",style:{backgroundColor:e.getColor(k.Background)},children:C?f.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-h-0",children:f.jsx(oL,{onHasHistory:z,emptyStateText:b||void 0})}):f.jsx("div",{className:"flex-1 overflow-y-auto",children:f.jsx(eL,{clientId:t.client_id,widgetId:t.link_id,appearance:t.appearance,aiAgentMode:!!O&&!a,onAIAgentStart:se,onOk:()=>{a&&c||(ne.getState().setHistoryChat(null),ne.getState().setHistoryMessages(null),v.push("chat"))},onOperatorConnect:a&&(c||mr(t.link_id).agent)?pe:void 0,isConnectingToOperator:y})})}),C&&f.jsxs("div",{className:"flex-shrink-0",style:{backgroundColor:e.getColor(k.Background)},children:[f.jsx("div",{className:"px-5 py-2",children:f.jsxs(Rt,{onClick:R,size:"lg",className:"w-full flex items-center justify-center gap-2",children:[f.jsx(Z.Plus,{className:"size-4"}),f.jsx("span",{children:"Yeni Sohbet Başlat"})]})}),f.jsx(So,{variant:"block"})]})]})}function lF(){return f.jsxs(f.Fragment,{children:[f.jsx(aF,{}),f.jsx(oF,{})]})}const cF=[{path:"/",component:lF,name:"registration"}];function tt({className:e="",style:t}){const n=be();return f.jsx("div",{className:`animate-pulse rounded ${e}`,style:{backgroundColor:n.getColor(k.MessageAdminBackground),opacity:.6,...t}})}function uF(){const e=be();return f.jsxs("section",{className:"flex flex-col gap-3 w-full grow pt-4 px-4 overflow-y-auto",children:[f.jsx("div",{className:"flex w-full items-center justify-start",children:f.jsx(tt,{className:"h-12 w-3/5",style:{borderRadius:e.getRadius()}})}),f.jsx("div",{className:"flex w-full items-center justify-end",children:f.jsx(tt,{className:"h-10 w-2/5",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(k.MessageVisitorBackground),opacity:.4}})}),f.jsx("div",{className:"flex w-full items-center justify-start",children:f.jsx(tt,{className:"h-16 w-4/5",style:{borderRadius:e.getRadius()}})}),f.jsx("div",{className:"flex w-full items-center justify-end",children:f.jsx(tt,{className:"h-8 w-1/3",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(k.MessageVisitorBackground),opacity:.4}})}),f.jsx("div",{className:"flex w-full items-center justify-start",children:f.jsx(tt,{className:"h-10 w-1/2",style:{borderRadius:e.getRadius()}})})]})}function dF(){const e=be();return f.jsxs("div",{className:"p-3 flex items-center gap-3",style:{backgroundColor:e.getColor(k.FooterBackground),borderRadius:e.getRadius()},children:[f.jsx("div",{className:"grow",children:f.jsx(tt,{className:"h-12 w-full",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(k.InputBackground)}})}),f.jsx(tt,{className:"h-12 w-12 rounded-full"})]})}function fF(){const e=be();return f.jsxs("header",{className:"p-4 flex justify-between items-center z-10",style:{backgroundColor:e.getColor(k.HeaderBackground),borderBottom:`1px solid ${e.getColor(k.HeaderBorder)}`},children:[f.jsx(tt,{className:"h-5 w-36"}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(tt,{className:"h-5 w-5 rounded"}),f.jsx(tt,{className:"h-5 w-5 rounded"})]})]})}function pF(){const e=be();return f.jsx("section",{className:"h-full overflow-y-auto px-4 py-3",style:{backgroundColor:e.getColor(k.GreeterBackground)},children:f.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[f.jsxs("div",{children:[f.jsx(tt,{className:"h-4 w-20 mb-1"}),f.jsx(tt,{className:"h-11 w-full",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(k.InputBackground)}})]}),f.jsxs("div",{children:[f.jsx(tt,{className:"h-4 w-24 mb-1"}),f.jsx(tt,{className:"h-11 w-full",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(k.InputBackground)}})]}),f.jsxs("div",{children:[f.jsx(tt,{className:"h-4 w-16 mb-1"}),f.jsx(tt,{className:"h-11 w-full",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(k.InputBackground)}})]}),f.jsx(tt,{className:"h-11 w-full mt-2",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(k.GreeterButtonBackground),opacity:.5}})]})})}function hF(){const e=be();return f.jsxs("div",{className:"relative flex flex-col gap-3 items-center justify-center h-44",style:{backgroundColor:e.getColor(k.GreeterTopBackground)},children:[f.jsx(tt,{className:"h-7 w-40"}),f.jsx(tt,{className:"h-4 w-56"})]})}function AC(){const e=be();return f.jsxs("div",{className:"h-full w-full flex flex-col overflow-hidden",style:{backgroundColor:e.getColor(k.Background)},children:[f.jsx(fF,{}),f.jsx(uF,{}),f.jsx(dF,{}),f.jsxs("div",{className:"py-1.5 px-3 flex items-center justify-center gap-1",style:{borderTop:`1px solid ${e.getColor(k.FooterBorder)}`,backgroundColor:e.getColor(k.FooterBackground)},children:[f.jsx(tt,{className:"h-3 w-20"}),f.jsx(tt,{className:"h-3.5 w-3.5 rounded"})]})]})}function oh(){const e=be(),t=typeof window<"u"&&window.innerWidth<768;return f.jsxs("div",{className:`h-full w-full relative overflow-hidden ${t?"":"rounded-xl"}`,style:{backgroundColor:e.getColor(k.GreeterBackground)},children:[f.jsx(hF,{}),f.jsx("div",{style:{height:t?"calc(var(--app-height,100dvh) - 11rem)":"calc(100% - 11rem)"},children:f.jsx(pF,{})})]})}const mF=/^admin_([a-f0-9]{24})_(.+)$/i;function Ks(e){return e.profile_id?`id:${e.profile_id}`:`name:${e.name.trim().toLowerCase()}`}function gx(e){const t=e.trim().match(mF);return t?{profile_id:t[1],name:t[2]}:null}function gF(e,t){const n=e?[...e]:[],r=Ks(t),i=n.findIndex(s=>Ks(s)===r);if(i>=0){const s=n[i];return n[i]={...s,...t,name:t.name||s.name,avatar:t.avatar??s.avatar,profile_id:t.profile_id??s.profile_id},n}return[...n,t]}function ah(e,t){return e!=null&&e.length?e.filter(n=>!(t.profile_id&&n.profile_id===t.profile_id||!t.profile_id&&t.name&&n.name===t.name)):[]}function vF(e,t){const n=t.profile_id!=null&&t.profile_id!==""?ah(e,{profile_id:t.profile_id}):ah(e,{name:t.name});return[t,...n]}function ia(e){const t=e[0];return t?{agent_name:t.name,agent_avatar:t.avatar}:{agent_name:void 0,agent_avatar:void 0}}function yF(e){const t=new Map,n=[];for(const r of e)if(r.sender_type===ve.Activity){if(r.activity_type===gn.AdminJoin){let i;const s=typeof r.content=="string"?gx(r.content):null;if(s)i={profile_id:s.profile_id,name:s.name};else if(r.sender_name)i={name:r.sender_name};else continue;const o=Ks(i);t.has(o)||n.push(o);const a=t.get(o);t.set(o,{...a,...i,name:i.name,avatar:i.avatar??(a==null?void 0:a.avatar),profile_id:i.profile_id??(a==null?void 0:a.profile_id)})}else if(r.activity_type===gn.AdminLeave){const i=typeof r.content=="string"?gx(r.content):null;if(i){const s=Ks({profile_id:i.profile_id,name:i.name});t.delete(s);const o=n.indexOf(s);o>=0&&n.splice(o,1)}else if(r.sender_name){const s=Ks({name:r.sender_name});t.delete(s);const o=n.indexOf(s);o>=0&&n.splice(o,1)}}}return n.map(r=>t.get(r)).filter(r=>r!=null)}function Cg(e,t){return e!=null&&e.trim()?[{name:e.trim(),avatar:t}]:[]}function vx(e){const t=e.participants&&e.participants.length>0?e.participants:Cg(e.agent_name,e.agent_avatar),n=ia(t);return{...e,participants:t,agent_name:n.agent_name,agent_avatar:n.agent_avatar}}function xF(e){var s,o;const t=e.who_joined_details;if(t!=null&&t.length)return t.map(a=>({profile_id:a.profile_id,name:a.name,avatar:a.avatar}));const n=e.participant_logs;if(n!=null&&n.length)return n.map(a=>({profile_id:a.user_id,name:a.name}));const r=(s=e.archive_summary)==null?void 0:s.admin_name,i=(o=e.archive_summary)==null?void 0:o.agent_avatar;return r?[{name:r,avatar:i}]:[]}const wF="/notify.mp3",_g="lc:notification_sound_muted",jC=()=>{try{return sessionStorage.getItem(_g)==="1"}catch{return!1}},RC=e=>{try{sessionStorage.setItem(_g,e?"1":"0")}catch{}},bF=async e=>{try{if(sessionStorage.getItem(_g)==="1")return}catch{}await new Audio(e||wF).play()},lf=[Le.Light,Le.Dark,Le.System];function kF(e){switch(e){case Le.Light:return Z.Sun;case Le.Dark:return Z.Moon;case Le.System:return Z.Monitor;default:return Z.Monitor}}function SF({onChatClose:e}){const[t,n]=g.useState(!1),[r,i]=g.useState(!1),[s,o]=g.useState(()=>jC()),a=g.useRef(null),l=g.useRef(null),c=be(),d=us(),u=dr(),{setShowActionButtons:p}=ne(),{mode:h,setMode:y}=c,w=()=>{u==null||u.emit(He.ChatClose,{}),p(!1),e()},b=()=>{const x=lf.indexOf(h),S=lf[(x+1)%lf.length];y(S)},m=()=>{const x=!s;RC(x),o(x)};g.useEffect(()=>{if(!r)return;const x=S=>{var C,_;(C=l.current)!=null&&C.contains(S.target)||(_=a.current)!=null&&_.contains(S.target)||i(!1)};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[r]);const v=r&&f.jsxs(Re.div,{ref:l,onMouseDown:x=>x.stopPropagation(),initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:"absolute right-0 top-full z-[9999] mt-1.5 py-1 min-w-[175px] rounded-lg shadow-lg !text-sm",style:{backgroundColor:c.getColor(k.Background),borderColor:c.getColor(k.Border),borderRadius:c.getRadius(),boxShadow:`0 4px 12px ${c.getColor(k.ShadowColor)}`},children:[f.jsxs("button",{type:"button",className:"w-full px-3 py-2 text-left text-sm flex items-center gap-2 rounded-t-lg hover:opacity-80 transition-opacity",style:{color:c.getColor(k.ErrorText)},onClick:()=>{i(!1),n(!0)},children:[f.jsx(Z.XCircle,{className:"size-4 flex-shrink-0"}),d(ie.ChatEndConversation)]}),f.jsxs("button",{type:"button",className:"w-full px-3 py-2 text-left text-sm flex items-center gap-2 hover:opacity-80 transition-opacity",style:{color:c.getColor(k.InputText)},onClick:m,children:[s?f.jsx(Z.VolumeX,{className:"size-4 flex-shrink-0"}):f.jsx(Z.Volume2,{className:"size-4 flex-shrink-0"}),d(s?ie.NotificationSoundOn:ie.NotificationSoundOff)]}),f.jsx("div",{className:"my-1 h-px",style:{backgroundColor:c.getColor(k.DividerColor)}}),f.jsxs("button",{type:"button",className:"w-full px-3 py-2 text-left text-sm flex items-center gap-2 rounded-b-lg hover:opacity-80 transition-opacity",style:{color:c.getColor(k.InputText)},onClick:b,children:[(()=>{const x=kF(h);return f.jsx(x,{className:"size-4 flex-shrink-0"})})(),h===Le.Light?"Açık tema":h===Le.Dark?"Koyu tema":"Sistem"]})]});return f.jsxs(f.Fragment,{children:[f.jsx(Ar,{children:t&&f.jsx(Re.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"absolute inset-0 z-50 flex items-center justify-center p-4",style:{backgroundColor:c.getColor(k.ModalOverlayColor)},children:f.jsxs(Re.div,{initial:{scale:.95,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.95,opacity:0},transition:{duration:.2},className:"p-5 rounded-xl shadow-lg max-w-xs w-full",style:{backgroundColor:c.getColor(k.Background),borderRadius:c.getRadius()},children:[f.jsx("div",{className:"text-base font-semibold mb-2",style:{color:c.getColor(k.ChatCloseConfirmText)},children:d(ie.ChatCloseConfirm)}),f.jsx("div",{className:"text-sm mb-4",style:{color:c.getColor(k.FooterText)},children:d(ie.ChatCloseWarning)}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-lg transition-opacity hover:opacity-90",style:{backgroundColor:c.getColor(k.GreeterBackground),color:c.getColor(k.GreeterText),borderRadius:c.getRadius()},onClick:()=>n(!1),children:d(ie.CancelAction)}),f.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-lg transition-opacity hover:opacity-90",style:{backgroundColor:c.getColor(k.ErrorBackground),color:c.getColor(k.ErrorText),borderRadius:c.getRadius()},onClick:w,children:d(ie.CloseAction)})]})]})})}),f.jsxs("div",{className:"relative flex-shrink-0",children:[f.jsx("button",{ref:a,type:"button",onClick:()=>i(x=>!x),className:"flex items-center justify-center p-1.5 rounded-md hover:opacity-80 transition-opacity",style:{backgroundColor:"transparent",color:c.getColor(k.HeaderText)},title:d(ie.ChatSettings),"aria-expanded":r,children:f.jsx(Z.Menu,{className:"size-5"})}),f.jsx(Ar,{children:v})]})]})}function CF(e){let t=e.replace(/<hr\b[^>]*>/gi,""),n;do n=t,t=t.replace(/<p\b[^>]*>(?:\s| | |�*[aA]0;|�*[aA]0;|<br\s*\/?>)*<\/p>/gi,"");while(t!==n);return t}function yx({text:e}){const n=be().getColor(k.LinkColor),i=(s=>{const o=CF(s),a=/(https?:\/\/(?:[-\w.])+(?:\:[0-9]+)?(?:\/(?:[\w\/_.\-~!$&'()*+,;=:@])*(?:\?(?:[\w&=%.\-~!$'()*+,;=:@/])*)?(?:\#(?:[\w.\-~!$&'()*+,;=:@/])*)?)?|(?:www\.)?(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,}(?:\/(?:[\w\/_.\-~!$&'()*+,;=:@])*(?:\?(?:[\w&=%.\-~!$'()*+,;=:@/])*)?(?:\#(?:[\w.\-~!$&'()*+,;=:@/])*)?)?)/gi,l=o.split(/(<[^>]*>)/g);let c="",d=!1;for(let u=0;u<l.length;u++){const p=l[u];if(p.startsWith("<")&&p.endsWith(">"))if(p.match(/^<a\s/i)){if(p.includes("style="))c+=p;else{const h=p.replace(/^(<a\s[^>]*)(>)$/i,`$1 style="color: ${n}; text-decoration: underline;"$2`);c+=h}d=!0}else p.match(/^<\/a>/i)?(c+=p,d=!1):c+=p;else if(!d&&p.trim()){const h=p.replace(a,y=>{const w=y.replace(/[">]+$/,"");return`<a href="${/^https?:\/\//i.test(w)?w:`https://${w}`}" target="_blank" rel="noopener noreferrer" style="color: ${n}; text-decoration: underline;">${w}</a>`});c+=h}else c+=p}return c})(e);return f.jsx("div",{className:"linkified !text-sm w-full min-w-0",dangerouslySetInnerHTML:{__html:i}})}const xx="opacity-0 group-hover/item:opacity-100 transition-opacity duration-200";function PC({files:e,className:t,onDelete:n,hideName:r}){const i=Do(),[s,o]=g.useState(new Map);g.useEffect(()=>{const y=new Map;for(let w=0;w<e.length;w++){const b=e[w];if(b instanceof File){const m=URL.createObjectURL(b);y.set(w,m)}}return o(y),()=>{for(const w of y.values())URL.revokeObjectURL(w)}},[e]);const a=y=>{var b;return((b=(y instanceof File?y.name:y).split(".").pop())==null?void 0:b.toLowerCase())||""},l=y=>y instanceof File?y.name:y.split("/").pop()||y,c=y=>{const[w,b]=y.split(".");return w.length>10?`${w.slice(0,10)}...${b}`:y},d=y=>{const w=["jpg","jpeg","png","gif","bmp","webp","svg"],b=a(y);return w.includes(b)},u=(y,w)=>{if(y instanceof File){const b=s.get(w);b&&window.open(b,"_blank")}else window.open(y,"_blank")},p=(y,w)=>{y.stopPropagation(),n==null||n(w)},h=(y,w)=>y instanceof File?s.get(w)||"":y;return f.jsx("div",{className:Ie("flex gap-2 w-full overflow-x-auto",t),children:e.map((y,w)=>{const b=l(y),m=a(y),v=d(y),x=h(y,w);return f.jsxs("div",{onClick:()=>u(y,w),className:"min-w-20 max-w-20 cursor-pointer group/item border border-gray-200 rounded-lg p-1.5 hover:shadow-md transition-all duration-200 hover:border-gray-300 bg-white relative",children:[n&&f.jsx("button",{onClick:S=>p(S,w),className:Ie("absolute top-1 right-1 w-5 h-5 bg-red-500 hover:bg-red-600 text-white rounded-full flex items-center justify-center transition-opacity duration-200 z-10",{"opacity-0 group-hover/item:opacity-100":!i}),children:f.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",children:f.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})}),v?f.jsx("div",{className:"aspect-square w-fit mb-0.5 overflow-hidden rounded",children:f.jsx("img",{src:x,alt:b,className:"w-16 h-16 min-h-16 min-w-16 object-cover group-hover/item:scale-105 transition-transform duration-200"})}):f.jsx("div",{className:"min-w-16 aspect-square w-full mb-0.5 flex items-center justify-center bg-gray-50 rounded group-hover/item:bg-gray-100 transition-colors duration-200",children:f.jsxs("div",{className:"text-center",children:[f.jsx("div",{className:"w-6 h-6 mx-auto mb-0.5 bg-blue-100 rounded flex items-center justify-center",children:f.jsx("svg",{className:"w-3 h-3 text-blue-600",fill:"currentColor",viewBox:"0 0 20 20",children:f.jsx("path",{fillRule:"evenodd",d:"M4 4a2 2 0 012-2h4.586A2 2 0 0112 2.586L15.414 6A2 2 0 0116 7.414V16a2 2 0 01-2 2H6a2 2 0 01-2-2V4zm2 6a1 1 0 011-1h6a1 1 0 110 2H7a1 1 0 01-1-1zm1 3a1 1 0 100 2h6a1 1 0 100-2H7z",clipRule:"evenodd"})})}),f.jsx("div",{className:Ie("text-[10px] font-medium text-gray-600 uppercase",{[xx]:r}),children:m||"file"})]})}),f.jsx("div",{className:Ie("max-w-16 text-[10px] text-gray-700 font-medium truncate text-ellipsis overflow-hidden",{[xx]:r}),title:b,children:c(b)})]},w)})})}const _F={hidden:{opacity:0,y:8},visible:{opacity:1,y:0}},TF={hidden:{opacity:0,y:8,scale:.95},visible:{opacity:1,y:0,scale:1}};function EF({buttons:e,className:t=""}){const n=be();if(!e||e.length===0)return null;const r=s=>{s.startsWith("http://")||s.startsWith("https://")?window.open(s,"_blank","noopener,noreferrer"):s.startsWith("tel:")||s.startsWith("mailto:")?window.location.href=s:console.log("Custom action:",s)},i=s=>s.startsWith("http://")||s.startsWith("https://")?f.jsx(Z.ExternalLink,{className:"size-4"}):s.startsWith("tel:")?f.jsx(Z.Phone,{className:"size-4"}):s.startsWith("mailto:")?f.jsx(Z.Mail,{className:"size-4"}):null;return f.jsx(Re.div,{className:Ie(t,"mt-2"),initial:"hidden",animate:"visible",variants:_F,transition:{duration:.3,ease:"easeOut",staggerChildren:.08},children:f.jsx("div",{className:"rounded-lg ",style:{backgroundColor:`${n.getColor(k.Background)}f0`},children:f.jsx("div",{className:"flex flex-wrap gap-2",children:e.map((s,o)=>f.jsxs(Re.button,{variants:TF,transition:{duration:.25,ease:"easeOut"},whileHover:{scale:1.02,y:-1,transition:{duration:.15}},whileTap:{scale:.98,transition:{duration:.1}},onClick:()=>r(s.url),className:"group inline-flex items-center gap-2 px-4 py-2.5 text-sm font-medium transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 relative overflow-hidden cursor-pointer",style:{backgroundColor:n.getColor(k.GreeterBackground),color:n.getColor(k.GreeterText),borderRadius:n.getRadius(),border:`1px solid ${n.getColor(k.DividerColor)}`,boxShadow:`0 1px 3px ${n.getColor(k.ShadowColor)}30`},onMouseEnter:a=>{a.currentTarget.style.backgroundColor=n.getColor(k.ButtonBackground),a.currentTarget.style.color=n.getColor(k.ButtonText),a.currentTarget.style.borderColor=n.getColor(k.ButtonBackground),a.currentTarget.style.boxShadow=`0 4px 12px ${n.getColor(k.ShadowColor)}40`},onMouseLeave:a=>{a.currentTarget.style.backgroundColor=n.getColor(k.GreeterBackground),a.currentTarget.style.color=n.getColor(k.GreeterText),a.currentTarget.style.borderColor=n.getColor(k.DividerColor),a.currentTarget.style.boxShadow=`0 1px 3px ${n.getColor(k.ShadowColor)}30`},children:[f.jsxs("span",{className:"flex items-center gap-2",children:[i(s.url),f.jsx("span",{className:"font-medium",children:s.label})]}),f.jsx("div",{className:"absolute inset-0 opacity-0 group-hover:opacity-100 transition-opacity duration-300",style:{background:`linear-gradient(45deg, transparent 30%, ${n.getColor(k.ButtonText)}10 50%, transparent 70%)`,borderRadius:n.getRadius()}})]},`${s.label}-${o}`))})})})}const wx=e=>e?(typeof e=="string"&&(e=new Date(e)),e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})):"",bx=["Düşünüyorum...","Araştırıyorum...","Cevapları karşılaştırıyorum...","En iyi cevabı hazırlıyorum...","Bilgileri derliyorum...","Kaynakları tarıyorum...","Analiz ediyorum...","Yanıtı oluşturuyorum..."];function MC({messages:e,isTyping:t,chat:n,streamingContent:r}){var S,C,_,j;const i=g.useRef(null),s=g.useRef(null),[o,a]=g.useState(!0),l=g.useRef(!0),{widget:c,showActionButtons:d}=ne(),u=be(),p=g.useRef(!0),h=g.useRef(new Set),[y,w]=g.useState(0);g.useEffect(()=>{e.length>0&&p.current&&requestAnimationFrame(()=>{p.current=!1})},[e]),g.useEffect(()=>{e.length===0&&h.current.clear()},[e.length]),g.useEffect(()=>{if(!t||r===void 0||r)return;const A=setInterval(()=>{w(E=>(E+1)%bx.length)},2500);return()=>clearInterval(A)},[t,r]);const b=()=>{const A=s.current;A&&(A.scrollTop=A.scrollHeight)},m=()=>{if(s.current){const{scrollTop:A,scrollHeight:E,clientHeight:D}=s.current,L=E-A<=D+10;l.current=L,a(L)}};g.useEffect(()=>{(l.current||t)&&b()},[e,t,r]);const v=(A,E)=>{if(p.current)return{initial:!1,animate:{}};const D=A.id||"";return h.current.has(D)?E===ve.Customer?{initial:!1,animate:{opacity:1,x:0}}:{initial:!1,animate:{}}:(h.current.add(D),E===ve.Customer?{initial:{opacity:0,x:30},animate:{opacity:1,x:0}}:{initial:!1,animate:{}})},x=A=>A===ve.Customer?"18px 18px 4px 18px":A===ve.User||A===ve.Agent?"18px 18px 18px 4px":u.getRadius();return f.jsxs("section",{onScroll:m,ref:s,className:"flex flex-col gap-3 w-full grow pt-4 px-4 overflow-y-auto overflow-x-hidden scrollbar",children:[((C=(S=c==null?void 0:c.appearance)==null?void 0:S.design)==null?void 0:C.greeting_message)&&f.jsx("div",{className:"flex w-full items-center justify-start",children:f.jsx("div",{className:"max-w-[80%] whitespace-pre-wrap border-0 px-3 py-2 !text-sm",style:{backgroundColor:u.getColor(k.MessageAdminBackground),color:u.getColor(k.MessageAdminText),borderRadius:"18px 18px 18px 4px"},children:(j=(_=c==null?void 0:c.appearance)==null?void 0:_.design)==null?void 0:j.greeting_message})}),f.jsx(Ar,{children:Array.isArray(e)&&e.filter(E=>{var D;return E!=null&&(!!E.content||(((D=E.files)==null?void 0:D.length)??0)>0)&&E.content!==`
|
|
97
|
+
`}).map((E,D)=>{var O;const L=v(E,E.sender_type);return f.jsxs(Re.div,{initial:L.initial,animate:L.animate,transition:{duration:.25,ease:"easeOut"},className:Ie("flex flex-col w-full min-w-0 justify-center break-words",{"items-end":E.sender_type===ve.Customer||E.activity_type===gn.ChatCreated,"items-start":E.sender_type===ve.User||E.sender_type===ve.Agent,"items-center":E.sender_type===ve.System||E.sender_type===ve.Activity}),children:[E.sender_type===ve.System&&f.jsx("div",{className:"max-w-full whitespace-pre-wrap break-words overflow-hidden px-3 py-1.5 text-sm",style:{backgroundColor:u.getColor(k.MessageAdminBackground),color:u.getColor(k.MessageAdminText),borderRadius:u.getRadius()},children:E.content}),([ve.Customer,ve.User,ve.Agent].includes(E.sender_type)||E.activity_type===gn.ChatCreated)&&f.jsxs("div",{className:Ie("max-w-[80%] border-0 px-3 py-2",{"whitespace-pre-wrap !text-sm":E.sender_type===ve.Customer||E.activity_type===gn.ChatCreated||E.sender_type===ve.Agent&&!((O=E.content)!=null&&O.includes('id="chaty"'))}),style:{backgroundColor:E.sender_type===ve.User||E.sender_type===ve.Agent?u.getColor(k.MessageAdminBackground):u.getColor(k.MessageVisitorBackground),color:E.sender_type===ve.User||E.sender_type===ve.Agent?u.getColor(k.MessageAdminText):u.getColor(k.MessageVisitorText),borderRadius:x(E.sender_type)},children:[E.files&&E.files.length>0&&f.jsx(PC,{files:E.files,className:"mb-1",hideName:!0}),E.sender_type===ve.User||E.sender_type===ve.Agent?f.jsx(yx,{text:E.content}):E.content,E.created_at&&f.jsx("div",{className:"text-[0.5rem] text-right opacity-70 mt-1",style:{color:E.sender_type===ve.User||E.sender_type===ve.Agent?u.getColor(k.MessageAdminText):u.getColor(k.MessageVisitorText)},children:wx(E.created_at)})]}),([ve.Customer,ve.User,ve.Agent].includes(E.sender_type)||E.activity_type===gn.ChatCreated)&&E.buttons&&E.buttons.length>0&&f.jsx("div",{className:Ie("w-full",{"flex justify-end":E.sender_type===ve.Customer||E.activity_type===gn.ChatCreated,"flex justify-start":E.sender_type===ve.User||E.sender_type===ve.Agent}),children:f.jsx("div",{className:"max-w-[80%]",children:f.jsx(EF,{buttons:E.buttons})})}),E.sender_type===ve.Activity&&E.activity_type!==gn.ChatCreated&&f.jsx("div",{className:"max-w-full border-0 rounded-full px-3 py-1 text-xs shadow-none break-words overflow-hidden",style:{backgroundColor:u.getColor(k.MessageAdminBackground),color:u.getColor(k.MessageAdminText)},children:E.activity_type===gn.AdminLeave?`${E.content.split("_")[2]} odadan ayrıldı`:E.activity_type===gn.AdminJoin?`${E.content.split("_")[2]} odaya katıldı`:E.activity_type===gn.AdminToggleUpload?E.content.includes("is_customer_uploadable:true")?"Dosya gönderim izni açıldı":"Dosya gönderim izni kapatıldı":E.content}),ve.System===E.sender_type&&f.jsx("div",{className:"text-xs",style:{color:u.getColor(k.MessageAdminText)},children:E.created_at&&wx(E.created_at)})]},E.id||D)})}),t&&f.jsx(Re.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.2},className:"flex w-full items-center justify-start mt-1",children:r!==void 0?f.jsx("div",{className:"max-w-[80%] border-0 px-3 py-2 whitespace-pre-wrap min-w-[4rem] !text-sm",style:{backgroundColor:u.getColor(k.MessageAdminBackground),color:u.getColor(k.MessageAdminText),borderRadius:"18px 18px 18px 4px"},children:r?f.jsx(yx,{text:r}):f.jsxs("div",{className:"flex items-center gap-2 py-1",children:[f.jsx(Z.Sparkles,{className:"size-4 flex-shrink-0 sparkle-pulse",style:{color:u.getColor(k.MessageAdminText)}}),f.jsx(Ar,{mode:"wait",children:f.jsx(Re.span,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},transition:{duration:.2},className:"!text-sm",style:{color:u.getColor(k.MessageAdminText)},children:bx[y]},y)})]})}):f.jsx("div",{className:"flex items-center rounded-full px-4 py-2",style:{backgroundColor:u.getColor(k.MessageAdminBackground)},children:f.jsxs("div",{className:"flex space-x-1",children:[f.jsx("div",{className:"size-1.5 rounded-full dot-wave",style:{backgroundColor:u.getColor(k.MessageAdminText),animationDelay:"0ms"}}),f.jsx("div",{className:"size-1.5 rounded-full dot-wave",style:{backgroundColor:u.getColor(k.MessageAdminText),animationDelay:"150ms"}}),f.jsx("div",{className:"size-1.5 rounded-full dot-wave",style:{backgroundColor:u.getColor(k.MessageAdminText),animationDelay:"300ms"}})]})})}),!o&&f.jsx("div",{className:"absolute right-4 z-10 transition-all duration-200",style:{bottom:d?"8rem":"7rem"},children:f.jsx(Rt,{type:"button",variant:"primary",kind:"solid",rounded:!0,className:"size-10 flex items-center justify-center p-0! shadow-md",onClick:()=>{var A,E;(E=s.current)==null||E.scrollTo({top:(A=s.current)==null?void 0:A.scrollHeight,behavior:"smooth"})},children:f.jsx(Z.ArrowDown,{className:"size-4"})})}),f.jsx("div",{ref:i})]})}/**
|
|
98
98
|
* @license lucide-react v0.511.0 - ISC
|
|
99
99
|
*
|
|
100
100
|
* This source code is licensed under the ISC license.
|
|
101
101
|
* See the LICENSE file in the root directory of this source tree.
|
|
102
|
-
*/const
|
|
102
|
+
*/const AF=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),jF=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),kx=e=>{const t=jF(e);return t.charAt(0).toUpperCase()+t.slice(1)},NC=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),RF=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
|
|
103
103
|
* @license lucide-react v0.511.0 - ISC
|
|
104
104
|
*
|
|
105
105
|
* This source code is licensed under the ISC license.
|
|
106
106
|
* See the LICENSE file in the root directory of this source tree.
|
|
107
|
-
*/var
|
|
107
|
+
*/var PF={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"};/**
|
|
108
108
|
* @license lucide-react v0.511.0 - ISC
|
|
109
109
|
*
|
|
110
110
|
* This source code is licensed under the ISC license.
|
|
111
111
|
* See the LICENSE file in the root directory of this source tree.
|
|
112
|
-
*/const
|
|
112
|
+
*/const MF=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:o,...a},l)=>g.createElement("svg",{ref:l,...PF,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:NC("lucide",i),...!s&&!RF(a)&&{"aria-hidden":"true"},...a},[...o.map(([c,d])=>g.createElement(c,d)),...Array.isArray(s)?s:[s]]));/**
|
|
113
113
|
* @license lucide-react v0.511.0 - ISC
|
|
114
114
|
*
|
|
115
115
|
* This source code is licensed under the ISC license.
|
|
116
116
|
* See the LICENSE file in the root directory of this source tree.
|
|
117
|
-
*/const
|
|
117
|
+
*/const OC=(e,t)=>{const n=g.forwardRef(({className:r,...i},s)=>g.createElement(MF,{ref:s,iconNode:t,className:NC(`lucide-${AF(kx(e))}`,`lucide-${e}`,r),...i}));return n.displayName=kx(e),n};/**
|
|
118
118
|
* @license lucide-react v0.511.0 - ISC
|
|
119
119
|
*
|
|
120
120
|
* This source code is licensed under the ISC license.
|
|
121
121
|
* See the LICENSE file in the root directory of this source tree.
|
|
122
|
-
*/const
|
|
122
|
+
*/const NF=[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],OF=OC("cloud-upload",NF);/**
|
|
123
123
|
* @license lucide-react v0.511.0 - ISC
|
|
124
124
|
*
|
|
125
125
|
* This source code is licensed under the ISC license.
|
|
126
126
|
* See the LICENSE file in the root directory of this source tree.
|
|
127
|
-
*/const gF=[["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"}]],vF=bC("paperclip",gF);var kC={exports:{}},yF="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",xF=yF,wF=xF;function SC(){}function CC(){}CC.resetWarningCache=SC;var bF=function(){function e(r,i,s,o,a,l){if(l!==wF){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:CC,resetWarningCache:SC};return n.PropTypes=n,n};kC.exports=bF();var kF=kC.exports;const Oe=Rr(kF);function vs(e,t,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(d){try{c(r.next(d))}catch(u){o(u)}}function l(d){try{c(r.throw(d))}catch(u){o(u)}}function c(d){d.done?s(d.value):i(d.value).then(a,l)}c((r=r.apply(e,t||[])).next())})}const SF=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.macroEnabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroEnabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/xliff+xml"],["xlm","application/vnd.ms-excel"],["xls","application/vnd.ms-excel"],["xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt","application/vnd.ms-excel"],["xltm","application/vnd.ms-excel.template.macroEnabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlw","application/vnd.ms-excel"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function wo(e,t,n){const r=CF(e),{webkitRelativePath:i}=e,s=typeof t=="string"?t:typeof i=="string"&&i.length>0?i:`./${e.name}`;return typeof r.path!="string"&&px(r,"path",s),px(r,"relativePath",s),r}function CF(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),i=SF.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}function px(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}const TF=[".DS_Store","Thumbs.db"];function _F(e){return vs(this,void 0,void 0,function*(){return Jc(e)&&EF(e.dataTransfer)?PF(e.dataTransfer,e.type):jF(e)?AF(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?RF(e):[]})}function EF(e){return Jc(e)}function jF(e){return Jc(e)&&Jc(e.target)}function Jc(e){return typeof e=="object"&&e!==null}function AF(e){return th(e.target.files).map(t=>wo(t))}function RF(e){return vs(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>wo(n))})}function PF(e,t){return vs(this,void 0,void 0,function*(){if(e.items){const n=th(e.items).filter(i=>i.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(MF));return hx(TC(r))}return hx(th(e.files).map(n=>wo(n)))})}function hx(e){return e.filter(t=>TF.indexOf(t.name)===-1)}function th(e){if(e===null)return[];const t=[];for(let n=0;n<e.length;n++){const r=e[n];t.push(r)}return t}function MF(e){if(typeof e.webkitGetAsEntry!="function")return mx(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?_C(t):mx(e,t)}function TC(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?TC(n):[n]],[])}function mx(e,t){return vs(this,void 0,void 0,function*(){var n;if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle=="function"){const s=yield e.getAsFileSystemHandle();if(s===null)throw new Error(`${e} is not a File`);if(s!==void 0){const o=yield s.getFile();return o.handle=s,wo(o)}}const r=e.getAsFile();if(!r)throw new Error(`${e} is not a File`);return wo(r,(n=t==null?void 0:t.fullPath)!==null&&n!==void 0?n:void 0)})}function OF(e){return vs(this,void 0,void 0,function*(){return e.isDirectory?_C(e):NF(e)})}function _C(e){const t=e.createReader();return new Promise((n,r)=>{const i=[];function s(){t.readEntries(o=>vs(this,void 0,void 0,function*(){if(o.length){const a=Promise.all(o.map(OF));i.push(a),s()}else try{const a=yield Promise.all(i);n(a)}catch(a){r(a)}}),o=>{r(o)})}s()})}function NF(e){return vs(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(r=>{const i=wo(r,e.fullPath);t(i)},r=>{n(r)})})})}var rf=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var r=e.name||"",i=(e.type||"").toLowerCase(),s=i.replace(/\/.*$/,"");return n.some(function(o){var a=o.trim().toLowerCase();return a.charAt(0)==="."?r.toLowerCase().endsWith(a):a.endsWith("/*")?s===a.replace(/\/.*$/,""):i===a})}return!0};function gx(e){return LF(e)||IF(e)||jC(e)||DF()}function DF(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
128
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
129
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
130
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
131
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function OC(e,t){if(e){if(typeof e=="string")return rh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rh(e,t)}}function rh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function fB(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,s=!1,o,a;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(r.push(o.value),!(t&&r.length===t));i=!0);}catch(l){s=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(s)throw a}}return r}}function pB(e){if(Array.isArray(e))return e}function kx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function We(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kx(Object(n),!0).forEach(function(r){ih(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kx(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ih(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tu(e,t){if(e==null)return{};var n=hB(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function hB(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var ul=v.forwardRef(function(e,t){var n=e.children,r=tu(e,rB),i=mB(r),s=i.open,o=tu(i,iB);return v.useImperativeHandle(t,function(){return{open:s}},[s]),J.createElement(v.Fragment,null,n(We(We({},o),{},{open:s})))});ul.displayName="Dropzone";var NC={disabled:!1,getFilesFromEvent:_F,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};ul.defaultProps=NC;ul.propTypes={children:Oe.func,accept:Oe.objectOf(Oe.arrayOf(Oe.string)),multiple:Oe.bool,preventDropOnDocument:Oe.bool,noClick:Oe.bool,noKeyboard:Oe.bool,noDrag:Oe.bool,noDragEventsBubbling:Oe.bool,minSize:Oe.number,maxSize:Oe.number,maxFiles:Oe.number,disabled:Oe.bool,getFilesFromEvent:Oe.func,onFileDialogCancel:Oe.func,onFileDialogOpen:Oe.func,useFsAccessApi:Oe.bool,autoFocus:Oe.bool,onDragEnter:Oe.func,onDragLeave:Oe.func,onDragOver:Oe.func,onDrop:Oe.func,onDropAccepted:Oe.func,onDropRejected:Oe.func,onError:Oe.func,validator:Oe.func};var sh={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function mB(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=We(We({},NC),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,s=t.maxSize,o=t.minSize,a=t.multiple,l=t.maxFiles,c=t.onDragEnter,d=t.onDragLeave,u=t.onDragOver,p=t.onDrop,m=t.onDropAccepted,y=t.onDropRejected,w=t.onFileDialogCancel,x=t.onFileDialogOpen,h=t.useFsAccessApi,g=t.autoFocus,k=t.preventDropOnDocument,C=t.noClick,S=t.noKeyboard,T=t.noDrag,j=t.noDragEventsBubbling,E=t.onError,A=t.validator,I=v.useMemo(function(){return eB(n)},[n]),N=v.useMemo(function(){return JF(n)},[n]),D=v.useMemo(function(){return typeof x=="function"?x:Sx},[x]),G=v.useMemo(function(){return typeof w=="function"?w:Sx},[w]),B=v.useRef(null),F=v.useRef(null),M=v.useReducer(gB,sh),$=sf(M,2),R=$[0],z=$[1],U=R.isFocused,W=R.isFileDialogActive,q=v.useRef(typeof window<"u"&&window.isSecureContext&&h&&ZF()),ne=function(){!q.current&&W&&setTimeout(function(){if(F.current){var V=F.current.files;V.length||(z({type:"closeDialog"}),G())}},300)};v.useEffect(function(){return window.addEventListener("focus",ne,!1),function(){window.removeEventListener("focus",ne,!1)}},[F,W,G,q]);var oe=v.useRef([]),me=function(V){B.current&&B.current.contains(V.target)||(V.preventDefault(),oe.current=[])};v.useEffect(function(){return k&&(document.addEventListener("dragover",bx,!1),document.addEventListener("drop",me,!1)),function(){k&&(document.removeEventListener("dragover",bx),document.removeEventListener("drop",me))}},[B,k]),v.useEffect(function(){return!r&&g&&B.current&&B.current.focus(),function(){}},[B,g,r]);var ue=v.useCallback(function(L){E?E(L):console.error(L)},[E]),Q=v.useCallback(function(L){L.preventDefault(),L.persist(),ve(L),oe.current=[].concat(aB(oe.current),[L.target]),Ul(L)&&Promise.resolve(i(L)).then(function(V){if(!(eu(L)&&!j)){var ae=V.length,fe=ae>0&&YF({files:V,accept:I,minSize:o,maxSize:s,multiple:a,maxFiles:l,validator:A}),Ce=ae>0&&!fe;z({isDragAccept:fe,isDragReject:Ce,isDragActive:!0,type:"setDraggedFiles"}),c&&c(L)}}).catch(function(V){return ue(V)})},[i,c,ue,j,I,o,s,a,l,A]),de=v.useCallback(function(L){L.preventDefault(),L.persist(),ve(L);var V=Ul(L);if(V&&L.dataTransfer)try{L.dataTransfer.dropEffect="copy"}catch{}return V&&u&&u(L),!1},[u,j]),H=v.useCallback(function(L){L.preventDefault(),L.persist(),ve(L);var V=oe.current.filter(function(fe){return B.current&&B.current.contains(fe)}),ae=V.indexOf(L.target);ae!==-1&&V.splice(ae,1),oe.current=V,!(V.length>0)&&(z({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Ul(L)&&d&&d(L))},[B,d,j]),te=v.useCallback(function(L,V){var ae=[],fe=[];L.forEach(function(Ce){var at=AC(Ce,I),vt=sf(at,2),Vn=vt[0],un=vt[1],ys=RC(Ce,o,s),fr=sf(ys,2),Nr=fr[0],xs=fr[1],Mo=A?A(Ce):null;if(Vn&&Nr&&!Mo)ae.push(Ce);else{var ki=[un,xs];Mo&&(ki=ki.concat(Mo)),fe.push({file:Ce,errors:ki.filter(function(Un){return Un})})}}),(!a&&ae.length>1||a&&l>=1&&ae.length>l)&&(ae.forEach(function(Ce){fe.push({file:Ce,errors:[GF]})}),ae.splice(0)),z({acceptedFiles:ae,fileRejections:fe,isDragReject:fe.length>0,type:"setFiles"}),p&&p(ae,fe,V),fe.length>0&&y&&y(fe,V),ae.length>0&&m&&m(ae,V)},[z,a,I,o,s,l,p,m,y,A]),O=v.useCallback(function(L){L.preventDefault(),L.persist(),ve(L),oe.current=[],Ul(L)&&Promise.resolve(i(L)).then(function(V){eu(L)&&!j||te(V,L)}).catch(function(V){return ue(V)}),z({type:"reset"})},[i,te,ue,j]),ee=v.useCallback(function(){if(q.current){z({type:"openDialog"}),D();var L={multiple:a,types:N};window.showOpenFilePicker(L).then(function(V){return i(V)}).then(function(V){te(V,null),z({type:"closeDialog"})}).catch(function(V){tB(V)?(G(V),z({type:"closeDialog"})):nB(V)?(q.current=!1,F.current?(F.current.value=null,F.current.click()):ue(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):ue(V)});return}F.current&&(z({type:"openDialog"}),D(),F.current.value=null,F.current.click())},[z,D,G,h,te,ue,N,a]),K=v.useCallback(function(L){!B.current||!B.current.isEqualNode(L.target)||(L.key===" "||L.key==="Enter"||L.keyCode===32||L.keyCode===13)&&(L.preventDefault(),ee())},[B,ee]),xe=v.useCallback(function(){z({type:"focus"})},[]),ge=v.useCallback(function(){z({type:"blur"})},[]),He=v.useCallback(function(){C||(XF()?setTimeout(ee,0):ee())},[C,ee]),ot=function(V){return r?null:V},Bt=function(V){return S?null:ot(V)},se=function(V){return T?null:ot(V)},ve=function(V){j&&V.stopPropagation()},Je=v.useMemo(function(){return function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},V=L.refKey,ae=V===void 0?"ref":V,fe=L.role,Ce=L.onKeyDown,at=L.onFocus,vt=L.onBlur,Vn=L.onClick,un=L.onDragEnter,ys=L.onDragOver,fr=L.onDragLeave,Nr=L.onDrop,xs=tu(L,sB);return We(We(ih({onKeyDown:Bt(qn(Ce,K)),onFocus:Bt(qn(at,xe)),onBlur:Bt(qn(vt,ge)),onClick:ot(qn(Vn,He)),onDragEnter:se(qn(un,Q)),onDragOver:se(qn(ys,de)),onDragLeave:se(qn(fr,H)),onDrop:se(qn(Nr,O)),role:typeof fe=="string"&&fe!==""?fe:"presentation"},ae,B),!r&&!S?{tabIndex:0}:{}),xs)}},[B,K,xe,ge,He,Q,de,H,O,S,T,r]),P=v.useCallback(function(L){L.stopPropagation()},[]),Z=v.useMemo(function(){return function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},V=L.refKey,ae=V===void 0?"ref":V,fe=L.onChange,Ce=L.onClick,at=tu(L,oB),vt=ih({accept:I,multiple:a,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:ot(qn(fe,O)),onClick:ot(qn(Ce,P)),tabIndex:-1},ae,F);return We(We({},vt),at)}},[F,n,a,O,r]);return We(We({},R),{},{isFocused:U&&!r,getRootProps:Je,getInputProps:Z,rootRef:B,inputRef:F,open:ot(ee)})}function gB(e,t){switch(t.type){case"focus":return We(We({},e),{},{isFocused:!0});case"blur":return We(We({},e),{},{isFocused:!1});case"openDialog":return We(We({},sh),{},{isFileDialogActive:!0});case"closeDialog":return We(We({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return We(We({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return We(We({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return We({},sh);default:return e}}function Sx(){}const DC=5*1024*1024,bo={"text/plain":[".txt"],"application/pdf":[".pdf"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[".docx"],"application/msword":[".doc"],"image/png":[".png"],"image/jpeg":[".jpg",".jpeg"],"image/gif":[".gif"],"image/webp":[".webp"],"image/svg+xml":[".svg"]},Cx=Object.values(bo).flat();function vB(e){var r;if(e.size>DC)return{isValid:!1,error:`Dosya boyutu 5MB'dan büyük olamaz. Seçilen dosya: ${(e.size/1024/1024).toFixed(2)}MB`};const t=`.${(r=e.name.split(".").pop())==null?void 0:r.toLowerCase()}`;return Object.keys(bo).includes(e.type)||Cx.includes(t)?{isValid:!0,error:""}:{isValid:!1,error:`Desteklenmeyen dosya tipi. Kabul edilen tipler: ${Cx.join(", ")}`}}function nu(e){for(const t of e){const n=vB(t);if(!n.isValid)return n}return{isValid:!0,error:""}}function IC({onDrop:e}){const t=n=>{const r=nu(n);if(!r.isValid){alert(r.error);return}e(n)};return f.jsx("div",{className:"flex items-center justify-center border rounded-md cursor-pointer bg-slate-100 dropzone border-slate-200 dz-clickable",children:f.jsx(ul,{onDrop:t,accept:Object.keys(bo).reduce((n,r)=>(n[r]=bo[r],n),{}),maxSize:DC,children:({getRootProps:n,getInputProps:r})=>f.jsxs("div",{className:"w-full py-5 text-lg text-center dz-message needsclick",...n(),children:[f.jsx("input",{...r()}),f.jsx("div",{className:"mb-3",children:f.jsx(mF,{className:"block size-12 mx-auto text-slate-500 fill-slate-200"})}),f.jsxs("h5",{className:"mb-0 font-normal text-slate-500 text-15",children:["Yüklemek istediğiniz görseli buraya sürükleyin veya"," ",f.jsx("span",{className:"text-custom-500",children:"seçmek için tıklayın"})]})]})})})}IC.Button=({onDrop:e})=>{const t=Se(),n=r=>{const i=nu(r);if(!i.isValid){er({description:i.error,variant:"error"});return}e(r)};return f.jsx(ul,{onDrop:n,accept:Object.keys(bo).reduce((r,i)=>(r[i]=bo[i],r),{}),children:({getRootProps:r,getInputProps:i})=>f.jsxs("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center text-center dz-message needsclick cursor-pointer",...r(),children:[f.jsx("input",{...i()}),f.jsx(vF,{style:{color:t.getColor(b.IconColor)},className:"size-5"})]})})};const Tx=[{name:"Yüzler",icon:"😊",emojis:["😀","😃","😄","😁","😆","😅","🤣","😂","🙂","😊","😇","🥰","😍","🤩","😘","😗","😚","😙","🥲","😋","😛","😜","🤪","😝","🤑","🤗","🤭","🤫","🤔","🫡","🤐","🤨","😐","😑","😶","🫥","😏","😒","🙄","😬","😮💨","🤥","😌","😔","😪","🤤","😴","😷","🤒","🤕","🤢","🤮","🥴","😵","🤯","🥳","🥸","😎","🤓","🧐","😕","🫤","😟","🙁","😮","😯","😲","😳","🥺","🥹","😦","😧","😨","😰","😥","😢","😭","😱","😖","😣","😞","😓","😩","😫","🥱","😤","😡","😠"]},{name:"El",icon:"👋",emojis:["👋","🤚","🖐️","✋","🖖","🫱","🫲","🫳","🫴","👌","🤌","🤏","✌️","🤞","🫰","🤟","🤘","🤙","👈","👉","👆","🖕","👇","☝️","🫵","👍","👎","✊","👊","🤛","🤜","👏","🙌","🫶","👐","🤲","🤝","🙏","💪","🦾"]},{name:"Kalp",icon:"❤️",emojis:["❤️","🧡","💛","💚","💙","💜","🖤","🤍","🤎","💔","❤️🔥","❤️🩹","❣️","💕","💞","💓","💗","💖","💘","💝","💟","♥️","💋","🫂"]},{name:"Hayvan",icon:"🐱",emojis:["🐶","🐱","🐭","🐹","🐰","🦊","🐻","🐼","🐻❄️","🐨","🐯","🦁","🐮","🐷","🐸","🐵","🐔","🐧","🐦","🐤","🦆","🦅","🦉","🦇","🐺","🐗","🐴","🦄","🐝","🪱","🐛","🦋","🐌","🐞","🐜","🪰","🐢","🐍","🦎","🐙"]},{name:"Yiyecek",icon:"🍕",emojis:["🍎","🍐","🍊","🍋","🍌","🍉","🍇","🍓","🫐","🍈","🍒","🍑","🥭","🍍","🥥","🥝","🍅","🍆","🥑","🫛","🥦","🥬","🌶️","🫑","🍕","🍔","🍟","🌭","🍿","🧀","🥚","🍳","🥞","🧇","🥓","🍖","🍗","🌮","🌯","🥗","☕","🍵","🧃","🥤","🍺","🍷","🥂","🍰"]},{name:"Aktivite",icon:"⚽",emojis:["⚽","🏀","🏈","⚾","🥎","🎾","🏐","🏉","🥏","🎱","🏓","🏸","🥅","⛳","🎯","🏹","🎣","🤿","🥊","🥋","🎿","⛷️","🏂","🪂","🏋️","🤸","🎮","🕹️","🎲","🧩","🎭","🎨","🎬","🎤","🎧","🎼","🎹","🥁","🎷","🎺"]},{name:"Nesne",icon:"💡",emojis:["⌚","📱","💻","⌨️","🖥️","🖨️","🖱️","💾","💿","📷","📹","🎥","📞","📟","📠","📺","🔋","🔌","💡","🔦","🕯️","🧯","💰","💳","💎","🔧","🔨","🪛","🔩","⚙️","🔑","🗝️","📦","📫","📝","✏️","🖊️","📎","📌","✂️"]}];function LC({onSelect:e,isOpen:t,onClose:n}){const r=Se(),[i,s]=v.useState(0),o=v.useRef(null),a=v.useRef(null);return v.useEffect(()=>{if(!t)return;const l=c=>{o.current&&!o.current.contains(c.target)&&n()};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[t,n]),v.useEffect(()=>{a.current&&(a.current.scrollTop=0)},[i]),f.jsx(jr,{children:t&&f.jsxs(Pe.div,{ref:o,onMouseDown:l=>l.stopPropagation(),initial:{opacity:0,y:8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:8,scale:.95},transition:{duration:.15},className:"absolute bottom-full left-0 mb-2 z-50 overflow-hidden",style:{width:"280px",backgroundColor:r.getColor(b.Background),border:`1px solid ${r.getColor(b.Border)}`,borderRadius:r.getRadius(),boxShadow:`0 4px 20px ${r.getColor(b.ShadowColor)}`},children:[f.jsx("div",{className:"flex items-center gap-0.5 px-1.5 py-1.5 overflow-x-auto",style:{borderBottom:`1px solid ${r.getColor(b.DividerColor)}`},children:Tx.map((l,c)=>f.jsx("button",{type:"button",onClick:()=>s(c),className:"flex-shrink-0 w-8 h-8 flex items-center justify-center rounded-md text-base transition-colors",style:{backgroundColor:c===i?r.getColor(b.InputBackground):"transparent"},title:l.name,children:l.icon},l.name))}),f.jsx("div",{ref:a,className:"grid grid-cols-8 gap-0.5 p-1.5 overflow-y-auto",style:{maxHeight:"200px"},children:Tx[i].emojis.map((l,c)=>f.jsx("button",{type:"button",onClick:()=>{e(l),n()},className:"w-8 h-8 flex items-center justify-center rounded-md text-lg hover:scale-110 transition-transform",style:{backgroundColor:"transparent"},onMouseEnter:d=>{d.currentTarget.style.backgroundColor=r.getColor(b.InputBackground)},onMouseLeave:d=>{d.currentTarget.style.backgroundColor="transparent"},children:l},`${l}-${c}`))})]})})}function yB({onNewMessage:e,client_id:t,is_uploadable:n,messages:r,onEvaluateChat:i,onNewChat:s,onSendMessage:o,isHistoryMode:a=!1,historyChat:l}){const c=v.useRef(null),d=dr(),u=aM(t),p=Se(),m=cs(),{setIsInputFocused:y,showActionButtons:w,setShowActionButtons:x}=ie(),[h,g]=v.useState(""),[k,C]=v.useState("3rem"),[S,T]=v.useState(!1),[j,E]=v.useState([]),[A,I]=v.useState(0),[N,D]=v.useState(!1),[G,B]=v.useState(0),[F,M]=v.useState(null),[$,R]=v.useState(!1),z=()=>{if(!a||!l||l.status!==en.Closed||!l.closed_at)return!1;const Q=new Date(l.closed_at);return(new Date().getTime()-Q.getTime())/(1e3*60*60)>2},U=a&&(l==null?void 0:l.status)===en.Closed&&z();v.useEffect(()=>{if(r.length>0){const Q=r[r.length-1];Q.id!==F&&(M(Q.id),Q.sender_type===we.User&&(I(0),D(!1)))}},[r,F]),v.useEffect(()=>{let Q;return N&&G>0&&(Q=window.setTimeout(()=>{B(de=>de<=1?(D(!1),I(0),0):de-1)},1e3)),()=>clearTimeout(Q)},[N,G]),v.useEffect(()=>{const Q=c.current;if(Q){const de=()=>y(!0),H=()=>y(!1);return Q.addEventListener("focus",de),Q.addEventListener("blur",H),()=>{Q.removeEventListener("focus",de),Q.removeEventListener("blur",H)}}},[y]),v.useEffect(()=>{const Q=()=>{x(!0)},de=()=>{x(!1)};return d==null||d.on(ye.ChatUserShowButton,Q),d==null||d.on(ye.MessageUserCreate,de),()=>{d==null||d.off(ye.ChatUserShowButton,Q),d==null||d.off(ye.MessageUserCreate,de)}},[d,x]),v.useEffect(()=>{r.length>0&&r[r.length-1].activity_type==="admin_join"&&x(!1)},[r,x]),Zc("lc:rate-limit",Q=>{const de=Q.detail&&Q.detail.seconds||3;D(!0),B(de),I(0)}),Zc("paste",Q=>{const de=Q.clipboardData.items,H=[];for(const te of de){const O=te.getAsFile();O&&H.push(O)}if(H.length>0&&!n){er({description:m(re.FileUploadDisabled),variant:"error"});return}if(H.length>0){const te=nu(H);if(!te.isValid){er({description:te.error,variant:"error"});return}E([...j,...H])}});const W=async()=>{if(!h.trim()&&(!n||j.length===0))return;if(A>5&&!N){D(!0),B(3);return}if(N||S)return;const Q=h,de=[...j];g(""),E([]),c.current&&(c.current.style.height="3rem",C("3rem")),T(!0);let H;if(n&&de.length>0){const[te,O]=await u.mutateAsync(de);if(!$n(O)){Bj(te,O),T(!1),g(Q),E(de);return}lM(te)&&(H=te.file_urls)}if(o){o(Q,H),T(!1);return}d==null||d.emit(Ve.MessageCreate,{content:Q,files:H},te=>{e(te),T(!1),I(O=>O+1),x(!1)})},q=Q=>{d==null||d.emit(Ve.MessageTyping,{content:Q})},ne=()=>{d==null||d.emit(Ve.ChatClose,{}),x(!1),i==null||i()},oe=()=>{d==null||d.emit(Ve.ChatClose,{}),x(!1),s==null||s()},me=v.useCallback(Q=>{const de=c.current;if(de){const H=de.selectionStart,te=de.selectionEnd,O=h.substring(0,H)+Q+h.substring(te);O.length<=2e3&&(g(O),q(O),setTimeout(()=>{de.selectionStart=de.selectionEnd=H+Q.length,de.focus()},0))}else{const H=h+Q;H.length<=2e3&&(g(H),q(H))}},[h]),ue=a&&(l==null?void 0:l.status)===en.Closed;return U?null:f.jsxs(f.Fragment,{children:[ue&&f.jsxs("div",{className:"px-5 flex flex-col gap-2",children:[f.jsxs("div",{className:"p-3 rounded-lg flex items-center gap-2",style:{backgroundColor:p.getColor(b.InputBackground),borderColor:p.getColor(b.InputBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:p.getRadius()},children:[f.jsx(X.Lock,{className:"w-5 h-5 flex-shrink-0",style:{color:p.getColor(b.FooterText)}}),f.jsx("span",{className:"text-sm",style:{color:p.getColor(b.FooterText)},children:"Bu sohbet kapatılmıştır."})]}),f.jsxs(Rt,{size:"lg",onClick:()=>{s==null||s()},className:"rounded-lg gap-2 transition-all",children:[f.jsx(X.Plus,{className:"size-4"}),f.jsx("span",{children:"Yeni Sohbet Başlat"})]}),f.jsx(xo,{variant:"block"})]}),N&&f.jsxs(Pe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"mb-2 mx-3 rounded-lg z-[100] p-2 flex items-center justify-center",style:{backgroundColor:p.getColor(b.ErrorBackground),borderColor:p.getColor(b.ErrorBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:p.getRadius()},children:[f.jsx(X.XCircle,{className:"size-4 mr-2",style:{color:p.getColor(b.ErrorText)}}),f.jsx("span",{className:"text-sm font-medium",style:{color:p.getColor(b.ErrorText)},children:m(re.RateLimitMessage).replace("{seconds}",G.toString())})]}),w&&f.jsxs(Pe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"mb-2 mx-3 flex gap-2",children:[f.jsxs(Rt,{className:"flex-1 flex items-center justify-center gap-2",size:"md",variant:"primary",kind:"outline",onClick:ne,style:{borderColor:p.getColor(b.ButtonBackground),color:p.getColor(b.ButtonBackground),backgroundColor:"transparent"},children:[f.jsx(X.Star,{className:"size-4"}),f.jsx("span",{children:"Değerlendir"})]}),f.jsxs(Rt,{size:"md",className:"flex-1 flex items-center justify-center gap-2",onClick:oe,children:[f.jsx(X.Plus,{className:"size-4"}),f.jsx("span",{children:"Yeni Sohbet"})]})]}),(!a||a&&(l==null?void 0:l.status)!==en.Closed&&(l==null?void 0:l.status)!==en.Deleted)&&f.jsxs("form",{className:"flex flex-col relative",onSubmit:Q=>{Q.preventDefault(),W()},children:[f.jsx("div",{className:"mx-4 border-t",style:{borderColor:p.getColor(b.DividerColor)}}),n&&j&&j.length>0&&f.jsx("div",{className:"px-3 pt-2 overflow-x-auto",children:f.jsx(yC,{files:j,onDelete:Q=>{E(j.filter((de,H)=>H!==Q))}})}),f.jsxs("div",{className:"flex gap-2 px-3 py-1 w-full",children:[f.jsxs("div",{className:"flex-1 min-w-0 relative",children:[f.jsx(Yu,{id:"message",inputRef:c,className:"grow",noMargin:!0,borderless:!0,autoComplete:"off",disabled:N,style:{height:k,maxHeight:"6rem",opacity:N?.5:1,cursor:N?"not-allowed":"text",boxShadow:"none"},placeholder:N?m(re.RateLimitMessage).replace("{seconds}",G.toString()):m(re.MessagePlaceholder),value:h,maxLength:2e3,onChange:Q=>{if(N)return;const de=Q.target.value;if(de.length<=2e3&&(g(de),q(de)),de.length>0&&Q.currentTarget.scrollHeight>Q.currentTarget.clientHeight){const H=`${Q.currentTarget.scrollHeight}px`;Q.currentTarget.style.height=H,C(H)}else Q.currentTarget.style.height="3rem",C("3rem")},onKeyDown:Q=>{if(N){Q.preventDefault();return}Q.key==="Enter"&&!Q.shiftKey&&(Q.preventDefault(),W())}}),h.length>=500&&f.jsx("div",{className:"absolute bottom-2 right-3 text-xs pointer-events-none",style:{color:h.length>=2e3?p.getColor(b.ErrorText):p.getColor(b.FooterText),fontWeight:h.length>=2e3?"600":"normal"},children:2e3-h.length})]}),f.jsx("div",{className:"flex items-center gap-1 flex-shrink-0 pb-0.5",children:f.jsx(Pe.div,{whileTap:{scale:.9},children:f.jsx(Rt,{className:"!bg-transparent rounded-full w-8 h-8 min-w-8 flex items-center justify-center transition-colors disabled:!opacity-100",type:"submit",size:"xs",disabled:S||!h.trim()&&j.length===0||N,style:{opacity:1,color:h.trim()||j.length>0?p.getColor(b.ButtonBackground):p.getColor(b.FooterText)},children:S?f.jsx(X.Spin,{className:"size-4 animate-spin"}):N?f.jsx("span",{className:"text-[10px] font-bold",children:G}):f.jsx(X.PaperAirplane,{className:"size-5"})})})})]}),f.jsx(LC,{isOpen:$,onClose:()=>R(!1),onSelect:me}),f.jsxs("div",{className:"px-3 pb-1.5 flex items-center justify-between",children:[f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("button",{type:"button",onClick:()=>R(!$),className:"p-1.5 rounded-md transition-colors",style:{color:p.getColor(b.IconColor)},children:f.jsx(X.Emoji,{className:"size-5"})}),n&&f.jsx(IC.Button,{onDrop:Q=>{if(Q.length){const de=nu(Q);if(!de.isValid){er({description:de.error,variant:"error"});return}E([...j,...Q])}}})]}),f.jsx(xo,{variant:"inline"})]})]})]})}const _x=[["#6366f1","#8b5cf6"],["#3b82f6","#06b6d4"],["#10b981","#34d399"],["#f59e0b","#f97316"],["#ef4444","#f472b6"],["#8b5cf6","#ec4899"],["#14b8a6","#22d3ee"],["#f43f5e","#fb923c"]];function oh({name:e,avatar:t,className:n="text-neutral-500",textColor:r,subtitle:i}){const s=v.useMemo(()=>{const o=e.charCodeAt(0)||0,a=_x[o%_x.length];return`linear-gradient(135deg, ${a[0]}, ${a[1]})`},[e]);return f.jsxs(Pe.div,{initial:{opacity:.8},animate:{opacity:1},className:"flex gap-2 items-center",children:[f.jsx("div",{className:"min-w-max",children:f.jsxs("span",{children:[t&&f.jsx("img",{className:"size-10 rounded-full border border-white/20 shadow-sm",src:t,"aria-label":e}),!t&&f.jsx("div",{className:"size-10 rounded-full flex items-center justify-center font-semibold text-white shadow-sm",style:{background:s},children:e.charAt(0).toUpperCase()})]})}),f.jsxs("div",{className:"flex flex-col",children:[f.jsx("span",{className:ze("line-clamp-1 font-medium",n),style:r?{color:r}:void 0,children:e}),i&&f.jsx("span",{className:"text-xs opacity-75 line-clamp-1",style:r?{color:r}:void 0,children:i})]})]})}function xB({chat:e,isTyping:t,shortcutMessages:n,messages:r,onNewMessage:i,onChatClose:s,onEvaluateChat:o,onNewChat:a,onSendMessage:l,isHistoryMode:c=!1,spamWarningMessage:d,onDismissSpamWarning:u}){const{widget:p,setOpen:m,open:y,isHaveChat:w,isInputFocused:x}=ie(),h=ie(G=>G.historyChat),g=Se(),k=Po(),C=Xu(),S=dr(),T=gs(),j=v.useRef(new Set),E=v.useRef(!1),A=()=>{m(!1)},I=v.useCallback(()=>{if(!S||!y||!w||!Array.isArray(r))return;const G=r.filter(B=>B.sender_type===we.User&&!j.current.has(B.id)).map(B=>B.id);G.length!==0&&S.emit(Ve.MessageRead,{message_ids:G},B=>{if(B&&B.success===!0)for(const F of G)j.current.add(F)})},[S,r,y,w]);v.useEffect(()=>{y&&(E.current=!0),y&&w&&(x||E.current)&&(I(),E.current=!1)},[y,w,x,I]);const N=()=>{var B,F,M,$;return(($=(M=(F=(B=p==null?void 0:p.appearance)==null?void 0:B.head)==null?void 0:F.elements)==null?void 0:M.find(R=>R.type==="title"))==null?void 0:$.content)||"Müşteri Hizmetleri"},D=()=>{var F,M,$,R,z,U;if(c&&h)return"Geçmiş sohbet";if(e!=null&&e.agent_name)return e.agent_name;const G=(M=(F=p==null?void 0:p.appearance)==null?void 0:F.design)==null?void 0:M.greeting_header;return G||((U=(z=(R=($=p==null?void 0:p.appearance)==null?void 0:$.head)==null?void 0:R.elements)==null?void 0:z.find(W=>W.type==="text"))==null?void 0:U.content)||"Bizimle Sohbet Edin"};return f.jsxs(f.Fragment,{children:[f.jsxs("header",{className:"px-4 py-3 flex items-center justify-between flex-shrink-0 overflow-visible min-h-[52px]",style:{backgroundColor:g.getColor(b.HeaderBackground),color:g.getColor(b.HeaderText),borderColor:g.getColor(b.HeaderBorder),...k?{}:{borderTopLeftRadius:g.getRadius(),borderTopRightRadius:g.getRadius()}},children:[f.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[c&&f.jsx("button",{type:"button",onClick:()=>{ie.getState().setHistoryChat(null),ie.getState().setHistoryMessages(null),ie.getState().setShowHistoryOnRegistration(!0),T.push("registration")},className:"flex-shrink-0 p-1 hover:opacity-80 transition-opacity",children:f.jsx(X.ArrowLeft,{className:"w-5 h-5"})}),(()=>{var G,B,F,M;if(c&&h){const $=(G=h.who_joined_details)==null?void 0:G[0],R=(B=h.participant_logs)==null?void 0:B[0],z=($==null?void 0:$.name)||(R==null?void 0:R.name)||((F=h.archive_summary)==null?void 0:F.admin_name);if(z){const U=($==null?void 0:$.avatar)||((M=h.archive_summary)==null?void 0:M.agent_avatar)||void 0;return f.jsx(oh,{name:z,avatar:U,textColor:g.getColor(b.HeaderText)})}}return!c&&(e!=null&&e.agent_name)?f.jsx(oh,{name:e.agent_name,avatar:e.agent_avatar,textColor:g.getColor(b.HeaderText)}):f.jsx("div",{className:"flex-1 min-w-0",children:c?f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"font-medium truncate",children:N()}),f.jsx("div",{className:"text-sm opacity-90 truncate",children:D()})]}):f.jsx("div",{className:"font-medium truncate",children:D()})})})()]}),f.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(!c||c&&(e==null?void 0:e.status)!==en.Closed)&&f.jsx(iF,{onChatClose:s}),C&&f.jsx("button",{type:"button",onClick:A,className:"p-1 hover:opacity-80 transition-opacity",children:f.jsx(X.X,{className:"w-5 h-5 cursor-pointer"})})]})]}),f.jsx(xC,{messages:r,isTyping:t||n.length>0,chat:e}),f.jsx(jr,{children:d&&f.jsxs(Pe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},transition:{duration:.2},className:"mx-3 mb-2 p-3 rounded-lg flex items-start gap-2",style:{backgroundColor:g.getColor(b.ErrorBackground),borderColor:g.getColor(b.ErrorBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:g.getRadius()},children:[f.jsx(X.XCircle,{className:"size-4 flex-shrink-0 mt-0.5",style:{color:g.getColor(b.ErrorText)}}),f.jsx("span",{className:"text-sm",style:{color:g.getColor(b.ErrorText)},children:d}),f.jsx("button",{type:"button",className:"ml-auto flex-shrink-0",onClick:u,style:{color:g.getColor(b.ErrorText)},children:f.jsx(X.X,{className:"size-4"})})]})}),f.jsx(yB,{client_id:(p==null?void 0:p.client_id)||"",is_uploadable:e.is_customer_uploadable,messages:r,onNewMessage:G=>{i(G)},onEvaluateChat:o,onNewChat:a,onSendMessage:l,isHistoryMode:c,historyChat:c?ie.getState().historyChat:void 0})]})}function wB({rating:e,onChange:t}){const n=Se();return f.jsx("div",{className:"flex items-center justify-center gap-0.5 my-2",children:[1,2,3,4,5].map(r=>{const i=r<=e,s=!i&&r-.5<=e;return f.jsxs(Pe.div,{className:"relative w-8 h-8 cursor-pointer",whileHover:{scale:1.15},whileTap:{scale:.95},transition:{duration:.15},children:[f.jsx("svg",{className:"w-8 h-8",style:{color:n.getColor(b.StarInactiveColor),fill:n.getColor(b.StarInactiveColor)},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"})}),s&&f.jsx("div",{className:"absolute top-0 left-0 w-4 h-8 overflow-hidden",children:f.jsx("svg",{className:"w-8 h-8",style:{color:n.getColor(b.StarActiveColor),fill:n.getColor(b.StarActiveColor)},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"})})}),i&&f.jsx("svg",{className:"w-8 h-8 absolute top-0 left-0",style:{color:n.getColor(b.StarActiveColor),fill:n.getColor(b.StarActiveColor)},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"})}),f.jsxs("div",{className:"absolute inset-0 flex",children:[f.jsx("button",{type:"button",onClick:()=>t(r-.5),className:"w-1/2 h-full cursor-pointer focus:outline-none","aria-label":`${r-.5} stars`}),f.jsx("button",{type:"button",onClick:()=>t(r),className:"w-1/2 h-full cursor-pointer focus:outline-none","aria-label":`${r} stars`})]})]},r)})})}function bB({onOk:e}){const t=Se(),n=cs(),r=Xu(),[i,s]=v.useState(0),[o,a]=v.useState(!1),[l,c]=v.useState(10),d=oM(),[u,p]=v.useState(!1);v.useEffect(()=>{if(o){const x=setInterval(()=>{c(h=>h<=1?(clearInterval(x),e(!0),0):h-1)},1e3);return()=>clearInterval(x)}},[o]);const m=Zm({comment:Kc()}),y=XS({init:{comment:""},schema:m,action:async x=>{const[h,g]=await d.mutateAsync({rating:i,comment:x.comment});if($n(g)){a(!0);return}ho(h,{form:y})}}),w=()=>{e(!0)};return f.jsxs(Pe.div,{className:"flex flex-col h-full",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:[f.jsxs("header",{className:"min-h-[48px] flex-shrink-0 overflow-visible flex justify-between items-center z-10 px-5 py-2.5",style:{borderColor:t.getColor(b.HeaderBorder),color:t.getColor(b.HeaderText)},children:[f.jsx("div",{className:"font-medium !text-sm",children:n(o?re.RatingHeaderThanks:re.RatingHeaderEvaluate)}),r&&f.jsx("button",{type:"button",onClick:()=>e(!1),className:"p-1.5 rounded-md hover:opacity-70 transition-opacity",style:{color:t.getColor(b.HeaderText)},children:f.jsx(X.X,{className:"size-4"})})]}),f.jsx("div",{className:"flex-1 p-4 overflow-y-auto flex flex-col",children:o?f.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center",children:[f.jsx("div",{className:"mb-3",style:{color:t.getColor(b.SuccessText)},children:f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-12 w-12",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),f.jsx("h2",{className:"text-lg font-semibold mb-1.5",style:{color:t.getColor(b.HeaderText)},children:n(re.RatingThankYouTitle)}),f.jsx("p",{className:"mb-6 text-sm",style:{color:t.getColor(b.FooterText)},children:n(re.RatingThankYouDescription)}),f.jsx("p",{className:"mb-3 text-xs",style:{color:t.getColor(b.FooterText)},children:n(re.RatingCountdown).replace("{seconds}",l.toString())}),f.jsx(Rt,{onClick:w,size:"md",className:"w-full max-w-xs",children:n(re.RatingNewConversation)})]}):f.jsxs("div",{className:"flex flex-col",children:[f.jsx("div",{className:"text-center mb-4",children:f.jsx("p",{className:"text-sm",style:{color:t.getColor(b.FooterText)},children:n(re.RatingDescription)})}),f.jsxs("div",{className:"mb-4",children:[f.jsx("h3",{className:"text-center font-medium mb-1.5 text-base",style:{color:t.getColor(b.RatingRateConversationText)},children:n(re.RatingRateConversation)}),f.jsx(wB,{rating:i,onChange:x=>{s(x),x>=1&&p(!1)}}),i>0&&f.jsx("p",{className:"text-center text-xs mt-1",style:{color:t.getColor(b.FooterText)},children:n(re.RatingYourScore).replace("{score}",Number.isInteger(i)?i.toString():i.toFixed(1))}),i>0&&i<1||u?f.jsx("p",{className:"text-center text-xs mt-1",style:{color:t.getColor(b.ErrorText)},children:n(re.RatingMinimumError)}):null]}),f.jsxs("form",{onSubmit:y.handleSubmit,className:"space-y-4",children:[f.jsxs("div",{children:[f.jsx("label",{htmlFor:"comment",className:"block text-xs font-medium mb-1",style:{color:t.getColor(b.InputText)},children:n(re.RatingComment)}),f.jsx(Yu,{id:"comment",onChange:y.handleChange,onBlur:y.handleBlur,value:y.values.comment,placeholder:n(re.RatingCommentPlaceholder),className:"rounded-lg",error:y.errors.comment})]}),f.jsxs("div",{className:"flex flex-col gap-2 pt-1",children:[f.jsx(Rt,{type:"submit",size:"lg",onClick:x=>{i<1&&(x.preventDefault(),x.stopPropagation(),p(!0))},className:"w-full",children:n(re.RatingSubmit)}),f.jsx(Rt,{onClick:w,size:"lg",variant:"secondary",kind:"subtle",className:"w-full",bgKey:b.GreeterBackground,textKey:b.GreeterText,children:n(re.RatingNewConversation)})]})]})]})}),f.jsx(xo,{variant:"block"})]})}function kB({onSendMessage:e,disabled:t,loading:n=!1}){const r=v.useRef(null),i=Se(),s=cs(),{setIsInputFocused:o}=ie(),[a,l]=v.useState(""),[c,d]=v.useState("3rem"),[u,p]=v.useState(!1),m=v.useRef(n);v.useEffect(()=>{m.current&&!n&&!t&&setTimeout(()=>{var x;(x=r.current)==null||x.focus()},100),m.current=n},[n,t]),v.useEffect(()=>{t&&p(!1)},[t]);const y=()=>{if(!a.trim()||t)return;const x=a;l(""),r.current&&(r.current.style.height="3rem",d("3rem")),e(x)},w=v.useCallback(x=>{if(t)return;const h=r.current;if(h){const g=h.selectionStart,k=h.selectionEnd,C=a.substring(0,g)+x+a.substring(k);C.length<=2e3&&(l(C),setTimeout(()=>{h.selectionStart=h.selectionEnd=g+x.length,h.focus()},0))}else{const g=a+x;g.length<=2e3&&l(g)}},[a,t]);return f.jsxs("form",{className:"flex flex-col relative",onSubmit:x=>{x.preventDefault(),y()},children:[f.jsx("div",{className:"mx-4 border-t",style:{borderColor:i.getColor(b.DividerColor)}}),f.jsxs("div",{className:"flex gap-2 px-3 py-1 w-full",children:[f.jsxs("div",{className:"flex-1 min-w-0 relative",children:[f.jsx(Yu,{id:"ai-message",inputRef:r,className:"grow",noMargin:!0,borderless:!0,autoComplete:"off",disabled:t,style:{height:c,maxHeight:"6rem",opacity:t?.5:1,cursor:t?"not-allowed":"text",boxShadow:"none"},placeholder:s(re.MessagePlaceholder),value:a,maxLength:2e3,onFocus:()=>o(!0),onBlur:()=>o(!1),onChange:x=>{if(t)return;const h=x.target.value;if(h.length<=2e3&&l(h),h.length>0&&x.currentTarget.scrollHeight>x.currentTarget.clientHeight){const g=`${x.currentTarget.scrollHeight}px`;x.currentTarget.style.height=g,d(g)}else x.currentTarget.style.height="3rem",d("3rem")},onKeyDown:x=>{if(t){x.preventDefault();return}x.key==="Enter"&&!x.shiftKey&&(x.preventDefault(),y())}}),a.length>=500&&f.jsx("div",{className:"absolute bottom-2 right-3 text-xs pointer-events-none",style:{color:a.length>=2e3?i.getColor(b.ErrorText):i.getColor(b.FooterText),fontWeight:a.length>=2e3?"600":"normal"},children:2e3-a.length})]}),f.jsx("div",{className:"flex items-center gap-1 flex-shrink-0 pb-0.5",children:f.jsx(Pe.div,{whileTap:{scale:.9},children:f.jsx(Rt,{className:"!bg-transparent rounded-full w-8 h-8 min-w-8 flex items-center justify-center transition-colors disabled:!opacity-100",type:"submit",size:"xs",withoutTheming:!0,disabled:t||!a.trim(),style:{opacity:1,backgroundColor:"transparent",color:a.trim()?i.getColor(b.ButtonBackground):i.getColor(b.FooterText)},children:n?f.jsx(X.Spin,{className:"size-4 animate-spin"}):f.jsx(X.PaperAirplane,{className:"size-5"})})})})]}),f.jsx(LC,{isOpen:u,onClose:()=>p(!1),onSelect:w}),f.jsxs("div",{className:"px-3 pb-1.5 flex items-center justify-between",children:[f.jsx("div",{className:"flex items-center gap-1",children:f.jsx("button",{type:"button",disabled:t,onClick:()=>!t&&p(!u),className:"p-1.5 rounded-md transition-colors disabled:opacity-50 disabled:cursor-not-allowed",style:{color:i.getColor(b.IconColor)},children:f.jsx(X.Emoji,{className:"size-5"})})}),f.jsx(xo,{variant:"inline"})]})]})}const of=[Ne.Light,Ne.Dark,Ne.System];function SB(e){switch(e){case Ne.Light:return X.Sun;case Ne.Dark:return X.Moon;case Ne.System:return X.Monitor;default:return X.Monitor}}function CB({onChatClose:e}){const[t,n]=v.useState(!1),[r,i]=v.useState(!1),[s,o]=v.useState(()=>gC()),a=v.useRef(null),l=v.useRef(null),c=Se(),d=cs(),{mode:u,setMode:p}=c,m=()=>e(),y=()=>{const h=of.indexOf(u),g=of[(h+1)%of.length];p(g)},w=()=>{const h=!s;vC(h),o(h)};v.useEffect(()=>{if(!r)return;const h=g=>{var k,C;(k=l.current)!=null&&k.contains(g.target)||(C=a.current)!=null&&C.contains(g.target)||i(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[r]);const x=r&&f.jsxs(Pe.div,{ref:l,onMouseDown:h=>h.stopPropagation(),initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:"absolute right-0 top-full z-[9999] mt-1.5 py-1 min-w-[175px] rounded-lg shadow-lg !text-sm",style:{backgroundColor:c.getColor(b.Background),borderColor:c.getColor(b.Border),borderRadius:c.getRadius(),boxShadow:`0 4px 12px ${c.getColor(b.ShadowColor)}`},children:[f.jsxs("button",{type:"button",className:"w-full px-3 py-2 text-left text-sm flex items-center gap-2 rounded-t-lg hover:opacity-80 transition-opacity",style:{color:c.getColor(b.ErrorText)},onClick:()=>{i(!1),n(!0)},children:[f.jsx(X.XCircle,{className:"size-4 flex-shrink-0"}),d(re.ChatEndConversation)]}),f.jsxs("button",{type:"button",className:"w-full px-3 py-2 text-left text-sm flex items-center gap-2 hover:opacity-80 transition-opacity",style:{color:c.getColor(b.InputText)},onClick:w,children:[s?f.jsx(X.VolumeX,{className:"size-4 flex-shrink-0"}):f.jsx(X.Volume2,{className:"size-4 flex-shrink-0"}),d(s?re.NotificationSoundOn:re.NotificationSoundOff)]}),f.jsx("div",{className:"my-1 h-px",style:{backgroundColor:c.getColor(b.DividerColor)}}),f.jsxs("button",{type:"button",className:"w-full px-3 py-2 text-left text-sm flex items-center gap-2 rounded-b-lg hover:opacity-80 transition-opacity",style:{color:c.getColor(b.InputText)},onClick:y,children:[(()=>{const h=SB(u);return f.jsx(h,{className:"size-4 flex-shrink-0"})})(),u===Ne.Light?"Açık tema":u===Ne.Dark?"Koyu tema":"Sistem"]})]});return f.jsxs(f.Fragment,{children:[f.jsx(jr,{children:t&&f.jsx(Pe.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"absolute inset-0 z-50 flex items-center justify-center p-4",style:{backgroundColor:c.getColor(b.ModalOverlayColor)},children:f.jsxs(Pe.div,{initial:{scale:.95,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.95,opacity:0},transition:{duration:.2},className:"p-5 rounded-xl shadow-lg max-w-xs w-full",style:{backgroundColor:c.getColor(b.Background),borderRadius:c.getRadius()},children:[f.jsx("div",{className:"text-base font-semibold mb-2",style:{color:c.getColor(b.ChatCloseConfirmText)},children:d(re.ChatCloseConfirm)}),f.jsx("div",{className:"text-sm mb-4",style:{color:c.getColor(b.FooterText)},children:d(re.ChatCloseWarning)}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-lg transition-opacity hover:opacity-90",style:{backgroundColor:c.getColor(b.GreeterBackground),color:c.getColor(b.GreeterText),borderRadius:c.getRadius()},onClick:()=>n(!1),children:d(re.CancelAction)}),f.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-lg transition-opacity hover:opacity-90",style:{backgroundColor:c.getColor(b.ErrorBackground),color:c.getColor(b.ErrorText),borderRadius:c.getRadius()},onClick:m,children:d(re.CloseAction)})]})]})})}),f.jsxs("div",{className:"relative flex-shrink-0",children:[f.jsx("button",{ref:a,type:"button",onClick:()=>i(h=>!h),className:"flex items-center justify-center p-1.5 rounded-md hover:opacity-80 transition-opacity",style:{backgroundColor:"transparent",color:c.getColor(b.HeaderText)},title:d(re.ChatSettings),"aria-expanded":r,children:f.jsx(X.Menu,{className:"size-5"})}),f.jsx(jr,{children:x})]})]})}function TB({onOperatorConnected:e,onChatClose:t}){var ue,Q,de;const{widget:n,setOpen:r,aiAgent:i,aiAgentMessages:s,addAIAgentMessage:o,setAIAgentMessages:a,aiAgentSessionId:l,setAIAgentSessionId:c,humanNeedRequested:d,setHumanNeedRequested:u,setIsAIAgentMode:p}=ie(),m=Se(),y=Po(),w=Xu(),x=dr(),h=gs(),[g,k]=v.useState(!1),[C,S]=v.useState(!1),[T,j]=v.useState(!1),[E,A]=v.useState(!1),[I,N]=v.useState(""),[D,G]=v.useState(!1),[B,F]=v.useState(0),[M,$]=v.useState(null),R=()=>{r(!1)},z=()=>{u(!1),t()},U=(((de=(Q=(ue=n==null?void 0:n.appearance)==null?void 0:ue.body)==null?void 0:Q.inputs)==null?void 0:de.length)||0)>0,W=v.useRef(!1),q=v.useRef(!1);v.useEffect(()=>{if(!i||W.current)return;if(s.length>0){W.current=!0;return}if(!x||!x.connected){const O=setInterval(()=>{x&&x.connected&&(clearInterval(O),H())},100),ee=setTimeout(()=>{clearInterval(O),W.current||te()},3e3);return()=>{clearInterval(O),clearTimeout(ee)}}H();function H(){W.current||!x||(W.current=!0,x.emit(Ve.MessageList,{},O=>{Array.isArray(O)&&O.length>0?a(O):te()}))}function te(){if(!i)return;const O={id:Ip(),content:`Merhaba! Ben ${i.name}. Size nasıl yardımcı olabilirim?`,created_at:new Date,files:[],sender_type:we.User};o(O)}},[x,i,s.length,a,o]),v.useEffect(()=>{if(g)if(I)S(!0);else{const H=setTimeout(()=>S(!0),1e3);return()=>clearTimeout(H)}else S(!1)},[g,I]),v.useEffect(()=>{if(B>0){const H=requestAnimationFrame(()=>F(0));return()=>cancelAnimationFrame(H)}},[B]),v.useEffect(()=>{if(!x)return;const H=({token:K})=>{N(xe=>xe+K)},te=K=>{K!=null&&K.human_need&&u(!0)},O=K=>{K.repeat_count===3&&$(K.message)},ee=()=>{t()};return x.on(ye.AgentMessageChunk,H),x.on(ye.AgentMessageFinalMetadata,te),x.on(ye.AgentSpamWarning,O),x.on(ye.AgentSpamBanned,ee),()=>{x.off(ye.AgentMessageChunk,H),x.off(ye.AgentMessageFinalMetadata,te),x.off(ye.AgentSpamWarning,O),x.off(ye.AgentSpamBanned,ee)}},[x,u,t]);const ne=v.useCallback(H=>{if(!n||!i||!x||d||T||q.current)return;q.current=!0;const te=`temp-${Date.now()}`,O={id:te,content:H,created_at:new Date,files:[],sender_type:we.Customer};o(O),N(""),G(!0),k(!0),j(!0);const ee=l||mi(n.link_id);x.emit(Ve.AgentMessageCreate,{question:H,agent_id:i.id,session_id:ee},K=>{if(q.current=!1,G(!1),N(""),k(!1),j(!1),!K){const xe={id:Ip(),content:"Üzgünüm, bir hata oluştu. Lütfen tekrar deneyin veya canlı destek personelimıze bağlanın.",created_at:new Date,files:[],sender_type:we.System};a(ge=>ge.filter(He=>He.id!==te).concat([xe])),u(!0);return}K.session_id&&c(K.session_id),o(K.agent_message),K.human_need&&u(!0)})},[n,i,d,T,x,l,o,a,c,u]),oe=v.useCallback(H=>{if(!x||E)return;A(!0);const te=()=>{x.emit(Ve.AgentRequestHuman,{},O=>{A(!1),O!=null&&O.success?(ie.getState().setIsHaveChat(!0),p(!1),u(!1),ie.getState().clearAIAgentState(),e()):console.error("Failed to request human operator")})};H&&Object.keys(H).length>0?x.emit(Ve.ChatUpdateInputs,{inputs:H},O=>{O!=null&&O.success?te():(console.error("Failed to update chat inputs"),A(!1))}):te()},[x,E,p,u,e]),me=()=>{U?h.push("registration"):oe()};return i?f.jsxs("div",{className:"flex flex-col h-full min-h-0 flex-1 w-full",children:[f.jsxs("header",{className:"px-4 py-3 flex items-center justify-between flex-shrink-0 overflow-visible min-h-[52px]",style:{backgroundColor:m.getColor(b.HeaderBackground),color:m.getColor(b.HeaderText),borderColor:m.getColor(b.HeaderBorder),...y?{}:{borderTopLeftRadius:m.getRadius(),borderTopRightRadius:m.getRadius()}},children:[f.jsx("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:f.jsx(oh,{name:i.name,avatar:i.avatar,textColor:m.getColor(b.HeaderText),subtitle:"AI Asistan"})}),f.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[f.jsx(CB,{onChatClose:z}),w&&f.jsx("button",{type:"button",onClick:R,className:"p-1 hover:opacity-80 transition-opacity",children:f.jsx(X.X,{className:"w-5 h-5 cursor-pointer"})})]})]}),f.jsxs("div",{className:"flex flex-col flex-1 min-h-0 w-full overflow-hidden",children:[f.jsx(xC,{messages:s,isTyping:C||g&&!!I,streamingContent:D?I:void 0,skipAnimationForLastN:B}),f.jsx(jr,{children:M&&f.jsxs(Pe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},transition:{duration:.2},className:"mx-3 mb-2 p-3 rounded-lg flex items-start gap-2 flex-shrink-0",style:{backgroundColor:m.getColor(b.ErrorBackground),borderColor:m.getColor(b.ErrorBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:m.getRadius()},children:[f.jsx(X.XCircle,{className:"size-4 flex-shrink-0 mt-0.5",style:{color:m.getColor(b.ErrorText)}}),f.jsx("span",{className:"text-sm",style:{color:m.getColor(b.ErrorText)},children:M}),f.jsx("button",{type:"button",className:"ml-auto flex-shrink-0",onClick:()=>$(null),style:{color:m.getColor(b.ErrorText)},children:f.jsx(X.X,{className:"size-4"})})]})}),d?f.jsx(Pe.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},className:"flex-shrink-0 w-full flex flex-col items-stretch justify-center px-4 pt-8 pb-10",style:{backgroundColor:m.getColor(b.Background)},children:f.jsx(Pe.div,{className:"relative w-full max-w-lg mx-auto overflow-hidden",style:{borderRadius:m.getRadius()},animate:{filter:["brightness(1)","brightness(1.1)","brightness(1)"]},transition:{duration:2.5,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"},children:f.jsx(Rt,{onClick:me,disabled:E,size:"lg",className:"w-full flex items-center justify-center gap-2",children:E?f.jsx("span",{className:"animate-pulse",children:"Bağlanıyor..."}):f.jsxs(f.Fragment,{children:[f.jsx(X.User,{className:"w-5 h-5"}),f.jsx("span",{children:"Canlı Desteğe Bağlan"})]})})})}):f.jsx(kB,{onSendMessage:ne,disabled:T,loading:T})]})]}):null}function _B({children:e}){const{widget:t}=ie();return t?f.jsx("section",{className:"h-full w-full relative",children:e}):null}function EB({children:e}){const t=dr(),n=gs(),{historyChat:r,isAIAgentMode:i,aiAgent:s}=ie(),[o,a]=v.useState(!0),[l,c]=v.useState(!1),d=v.useRef(!1);return v.useEffect(()=>{if(r){a(!1);return}if(!t){a(!1);return}const u=()=>{a(!1),c(!1),d.current=!0},p=()=>{i&&s||(c(!0),n.push("registration"))};return t.on(ye.Connect,u),t.on(ye.Disconnect,p),t.connected?(a(!1),d.current=!0):t.connect(),()=>{t.off(ye.Connect,u),t.off(ye.Disconnect,p)}},[t,r,i,s,n]),i&&s||r?e:!t||l?(t||n.push("registration"),f.jsx(eh,{})):d.current&&!t.connected?f.jsx(eh,{}):o||!t.connected?f.jsx(mC,{}):e}function Ex(e,t){const n=new Map;for(const r of t)r!=null&&r.id&&n.set(r.id,r);for(const r of e)r!=null&&r.id&&!n.has(r.id)&&n.set(r.id,r);return Array.from(n.values()).sort((r,i)=>new Date(r.created_at).getTime()-new Date(i.created_at).getTime())}function jB(){const{widget:e,setOpen:t,setIsHaveChat:n,historyChat:r,setHistoryChat:i,historyMessages:s,setHistoryMessages:o,aiAgent:a,isAIAgentMode:l,clearAIAgentState:c}=ie(),d=Se(),u=dr(),{connected:p,connectionReady:m}=u,y=al(),w=gs(),x=Po(),[h,g]=v.useState(null),[k,C]=v.useState([]),[S,T]=v.useState(!1),[j,E]=v.useState([]),[A,I]=v.useState([]),[N,D]=v.useState(!1),G=qm(),B=v.useRef(!1),F=v.useRef(null),M=v.useRef(!1),[$,R]=v.useState(!1),[z,U]=v.useState(null);v.useEffect(()=>{console.log("WS: ChatDetailView socket state:",{connected:p,connectionReady:m,hasChat:!!h,chatViewEmitted:B.current})},[p,m,h]),v.useEffect(()=>{if(h||r||l){R(!1);return}const O=setTimeout(()=>{!h&&!r&&!l&&(console.warn("WS: Connection timeout reached in ChatDetailView"),R(!0))},1e4);return()=>clearTimeout(O)},[h,r,l]),v.useEffect(()=>{if(!r||!e)return;if(g({status:r.status,is_customer_uploadable:!1}),s){C(s);return}const O=mi(e.link_id);dM(r._id,e.link_id,O).then(([ee,K])=>{if($n(K)&&Array.isArray(ee)){const xe=ee.map(ge=>({id:ge._id,content:ge.content,created_at:ge.created_at,files:ge.files,sender_type:ge.sender_type,activity_type:ge.activity_type,answers:ge.answers,reply_id:ge.reply_id,buttons:ge.buttons}));C(xe),o(xe)}}).catch(ee=>{console.error("Failed to load history messages",ee)})},[r,e,s,o]),v.useEffect(()=>{if(!e||l||r)return;const O=mr(e.link_id);O.isAgentMode&&O.agent&&(console.log("ChatDetailView: Recovering AI Agent state from localStorage"),ie.getState().setAIAgent(O.agent),ie.getState().setIsAIAgentMode(!0),O.sessionId&&ie.getState().setAIAgentSessionId(O.sessionId),O.humanNeedRequested&&ie.getState().setHumanNeedRequested(!0))},[e,l,r]);const W=async(O,ee)=>{var Bt;if(!e)return;if(!r){const se=`temp-${Date.now()}`,ve={id:se,content:O,created_at:new Date,files:ee||[],sender_type:we.Customer,answers:[],reply_id:void 0,buttons:[]};C(Je=>[...Je,ve]),u==null||u.emit(Ve.MessageCreate,{content:O,files:ee},Je=>{const P=Array.isArray(Je)?Je[0]:Je;if(P&&P.isError){C(L=>L.filter(V=>V.id!==se));const Z=(P==null?void 0:P.error)||(P==null?void 0:P.message);(!Z||!/too\s+many/i.test(Z))&&ho(P),typeof window<"u"&&window.dispatchEvent(new CustomEvent("lc:rate-limit",{detail:{seconds:3}}));return}C(Z=>Z.map(L=>L.id===se?P:L))});return}const K={},xe=e.appearance;if((Bt=xe==null?void 0:xe.body)!=null&&Bt.inputs){for(const se of xe.body.inputs)if(se.required||se.remember){const ve=ma(se.name);ve&&(K[se.name]=ve)}}const ge=ie.getState().defaultValues;if(ge){ge.username&&(K.username=ge.username),ge.secret_data&&(K.secret_data=ge.secret_data);for(const se in ge)K[se]||(K[se]=ge[se])}const[He,ot]=await G.mutateAsync({inputs:K,history:[],client_id:e.client_id,widget_id:e.link_id,device_id:mi(e.link_id)});if($n(ot)){i(null),n(!0),He&&typeof He=="object"&&"customer_token"in He&&(Ln(rt.CustomerToken,He.customer_token,e.link_id),Ln(rt.CustomerRefreshToken,He.customer_refresh_token,e.link_id));let se=0;const ve=20,Je=`temp-${Date.now()}`,P={id:Je,content:O,created_at:new Date,files:ee||[],sender_type:we.Customer,answers:[],reply_id:void 0,buttons:[]};C(L=>[...L,P]);const Z=setInterval(()=>{se+=1,u!=null&&u.connected?(u.emit(Ve.MessageCreate,{content:O,files:ee},L=>{const V=Array.isArray(L)?L[0]:L;if(V&&V.isError){C(fe=>fe.filter(Ce=>Ce.id!==Je));const ae=(V==null?void 0:V.error)||(V==null?void 0:V.message);(!ae||!/too\s+many/i.test(ae))&&ho(V),typeof window<"u"&&window.dispatchEvent(new CustomEvent("lc:rate-limit",{detail:{seconds:3}}));return}C(ae=>ae.map(fe=>fe.id===Je?V:fe))}),clearInterval(Z)):se>=ve&&clearInterval(Z)},200)}},q=O=>{!O&&!x&&t(!1),D(!0),fa((e==null?void 0:e.link_id)||""),n(!1),g(null),C([]),E([]),i(null),ie.getState().setHistoryMessages(null),ie.getState().setShowHistoryOnRegistration(!1),c(),oc(e.client_id,Yi(y)).then(()=>{u==null||u.disconnect(),w.push("registration")})},ne=()=>{h?(localStorage.setItem("showActionButtons","false"),g({...h,status:en.Closed})):q(!1)};v.useEffect(()=>{if(u&&!(l&&a)){if(r){B.current=!1,M.current=!1;return}if(!p||!m){p||(M.current=!1,B.current=!1,F.current=null);return}M.current=!0,!(!e||B.current)&&(B.current=!0,console.log("ChatView: Emitting chat:view request"),u.emit(Ve.ChatView,{},O=>{if(console.log("ChatView: Received response",{chatReceived:O!==null,chatStatus:O==null?void 0:O.status,hasAgentName:!!(O!=null&&O.agent_name),hasError:O&&"error"in O}),ie.getState().historyChat){B.current=!1;return}if(O===null||O&&"error"in O||!(O!=null&&O.status)){console.log("ChatView returned invalid chat (null, error, or missing status), cleaning up and redirecting to registration",{chat:O}),t(!1),n(!1),oc(e.client_id,Yi(y)),C([]),E([]),i(null),ie.getState().setHistoryMessages(null),c(),fa((e==null?void 0:e.link_id)||""),u.disconnect(),w.push("registration"),B.current=!1;return}console.log("ChatView: Setting chat state",{status:O.status}),g(O),n(!0)}))}},[r,u,e,p,m,y,w,t,n,i,l,a,c]);const oe=()=>{ne()},me=()=>{q(!0)},[ue,Q]=v.useState(!1),de=v.useCallback(()=>{console.log("handleOperatorConnected: Starting operator connection flow"),B.current=!1,F.current=null,M.current=!1;const O=ie.getState().aiAgentMessages;O.length>0&&C(O),Q(!0)},[]);v.useEffect(()=>{if(ue){if(!u||!p||!m){console.log("handleOperatorConnected: Waiting for socket connection...",{connected:p,connectionReady:m});return}if(console.log("handleOperatorConnected: Socket ready, fetching chat view"),B.current){Q(!1);return}B.current=!0,u.emit(Ve.ChatView,{},O=>{console.log("handleOperatorConnected: ChatView result",O),O&&!("error"in O)&&O.status?(g(O),n(!0),u.emit(Ve.MessageList,{},K=>{console.log("handleOperatorConnected: MessageList result",K),Array.isArray(K)&&C(xe=>Ex(xe,K))})):(console.log("handleOperatorConnected: Invalid chat result, clearing state",O),n(!1)),Q(!1)})}},[ue,u,p,m,n]);const H=()=>{c(),x||t(!1),D(!0),fa((e==null?void 0:e.link_id)||""),n(!1),g(null),C([]),E([]),i(null),ie.getState().setHistoryMessages(null),ie.getState().setShowHistoryOnRegistration(!1),oc(e.client_id,Yi(y)).then(()=>{u==null||u.disconnect(),w.push("registration")})},te=v.useCallback(O=>{if(l&&a&&!r){const{aiAgentMessages:ee,addAIAgentMessage:K}=ie.getState();if(ee.some(xe=>xe.id===O.id))return;K(O);return}h&&![en.Closed,en.Deleted].includes(h.status)&&C(ee=>{const K=ee.filter(ge=>{var He;return!((He=ge.id)!=null&&He.startsWith("temp-")&&ge.content===O.content)});return K.some(ge=>ge.id===O.id)?K:[...K,O]})},[h,l,a,r]);return v.useEffect(()=>{if(!u)return;const O=se=>{const ve={content:se.content,created_at:se.created_at,files:se.files,id:se._id,sender_type:se.sender_type,answers:se.answers,reply_id:se.reply_id,buttons:se.buttons};if(j.length>0){E(Je=>[...Je,ve]);return}se.is_shortcut?E([ve]):te(ve),T(!1)},ee=se=>{const ve={content:se.content,created_at:se.created_at,files:se.files,id:se._id,sender_type:se.sender_type,activity_type:se.activity_type,sender_name:se.sender_name,answers:se.answers,reply_id:se.reply_id,buttons:se.buttons};te(ve)},K=se=>{!se||!se.name?g(ve=>ve?{...ve,agent_name:void 0,agent_avatar:void 0}:null):(g(ve=>ve?{...ve,agent_name:se.name,agent_avatar:se.avatar}:null),I(ve=>ve.includes(se.name)?ve:[...ve,se.name]))},xe=()=>{T(!0)},ge=()=>{ne()},He=({is_customer_uploadable:se})=>{g(ve=>ve?{...ve,is_customer_uploadable:se}:null)},ot=se=>{I(ve=>{const Je=ve.filter(P=>P!==se.name);return se.hasOtherAdmins?Je.length>0&&g(P=>P?{...P,agent_name:Je[0],agent_avatar:void 0}:null):g(P=>P?{...P,agent_name:void 0,agent_avatar:void 0}:null),Je})},Bt=se=>{I(ve=>ve.includes(se.name)?ve:[...ve,se.name]),g(ve=>ve?ve.agent_name?ve:{...ve,agent_name:se.name,agent_avatar:void 0}:null)};return u.on(ye.MessageAgentCreate,O),u.on(ye.MessageUserCreate,ee),u.on(ye.MessageCustomerCreate,ee),u.on(ye.ChatUserAssignee,K),u.on(ye.MessageAgentTyping,xe),u.on(ye.ChatUserClose,ge),u.on(ye.ChatToggleUpload,He),u.on(ye.ChatUserLeave,ot),u.on(ye.ChatUserJoin,Bt),()=>{u.off(ye.MessageAgentCreate,O),u.off(ye.MessageUserCreate,ee),u.off(ye.MessageCustomerCreate,ee),u.off(ye.ChatUserAssignee,K),u.off(ye.MessageAgentTyping,xe),u.off(ye.ChatUserClose,ge),u.off(ye.ChatToggleUpload,He),u.off(ye.ChatUserLeave,ot),u.off(ye.ChatUserJoin,Bt)}},[te,A]),v.useEffect(()=>{if(!u)return;const O=K=>{K.repeat_count===3&&U(K.message)},ee=()=>{u.emit(Ve.ChatClose,{}),ie.getState().setShowActionButtons(!1),ne()};return u.on(ye.AgentSpamWarning,O),u.on(ye.AgentSpamBanned,ee),()=>{u.off(ye.AgentSpamWarning,O),u.off(ye.AgentSpamBanned,ee)}},[u,ne]),v.useEffect(()=>{if(!u||!h||r){F.current=null;return}const O=`${h.status}-${h.agent_name||"no-agent"}`;F.current!==O&&(F.current=O,u.emit(Ve.MessageList,{},ee=>{if(!Array.isArray(ee)){console.warn("MessageList response is not an array:",ee),F.current=null;return}C(ge=>Ex(ge,ee));const K=new Map;for(const ge of ee)ge.sender_type===we.Activity&&(ge.activity_type===mn.AdminJoin&&ge.sender_name?K.set(ge.sender_name,!0):ge.activity_type===mn.AdminLeave&&ge.sender_name&&K.set(ge.sender_name,!1));const xe=Array.from(K.entries()).filter(([ge,He])=>He).map(([ge])=>ge);I(xe)}))},[u,h,r]),v.useEffect(()=>{const O=setTimeout(()=>{T(!1)},2e3);return()=>clearTimeout(O)},[S]),v.useEffect(()=>{if(!e||j.length===0)return;let O=0;e.writing_timeout&&(O=[...j[0].content].length/e.writing_timeout,O<0&&(O=0));const ee=setTimeout(()=>{te(j[0]),E(j.slice(1))},O*1e3);return()=>clearTimeout(ee)},[j,e]),N?f.jsx(eh,{}):l&&a&&!r?f.jsxs(f.Fragment,{children:[f.jsx("div",{id:"chat-alert-portal"}),f.jsx("div",{className:`h-full w-full ${x?"":"rounded-xl"} shadow-sm flex flex-col overflow-hidden`,style:{height:x?"100%":"",minHeight:x?"var(--app-height, 100dvh)":"",maxHeight:x?"var(--app-height, 100dvh)":"",backgroundColor:d.getColor(b.Background)},children:f.jsx(TB,{onOperatorConnected:de,onChatClose:H})})]}):f.jsxs(f.Fragment,{children:[f.jsx("div",{id:"chat-alert-portal"}),f.jsx("div",{className:`h-full w-full ${x?"":"rounded-xl"} shadow-sm flex flex-col overflow-hidden`,style:{height:x?"100%":"",minHeight:x?"var(--app-height, 100dvh)":"",maxHeight:x?"var(--app-height, 100dvh)":"",backgroundColor:d.getColor(b.Background)},children:h?h.status===en.Closed&&!r?f.jsx(bB,{onOk:q}):f.jsx(xB,{chat:h,isTyping:S,messages:k,shortcutMessages:j,onNewMessage:te,onChatClose:ne,onEvaluateChat:oe,onNewChat:me,onSendMessage:W,isHistoryMode:!!r,spamWarningMessage:z,onDismissSpamWarning:()=>U(null)}):$?f.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-6 text-center",children:[f.jsx("div",{className:"w-12 h-12 rounded-full flex items-center justify-center mb-4",style:{backgroundColor:d.getColor(b.InputBorder)},children:f.jsx(X.XCircle,{className:"w-6 h-6 opacity-50"})}),f.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Bağlantı Kurulamadı"}),f.jsx("p",{className:"text-sm opacity-60 mb-6",children:"Sunucuyla bağlantı sağlanırken bir sorun oluştu. Lütfen tekrar deneyin."}),f.jsx("button",{type:"button",onClick:()=>q(!0),className:"px-6 py-2 rounded-lg font-medium transition-all",style:{backgroundColor:d.getColor(b.ButtonBackground),color:d.getColor(b.ButtonText),borderRadius:d.getRadius()},children:"Tekrar Dene"})]}):f.jsx(mC,{})})]})}function AB(){return WL(),null}function RB(){return f.jsxs(EB,{children:[f.jsx(_B,{children:f.jsx(jB,{})}),f.jsx(AB,{})]})}const PB=[{path:"/chat",component:RB,name:"chat"}],FC=[...PB],BC=[...QL],MB=[...FC,...BC];function ah({text:e}){var c,d,u,p;const{widget:t,isHaveChat:n,isTooltipVisible:r,setIsTooltipVisible:i,onTooltipClose:s}=ie(),o=Se(),a=cs(),l=()=>{i(!1),s&&s()};return r?f.jsxs(Pe.div,{initial:{opacity:0,scale:.8,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.8,y:10},transition:{type:"spring",damping:20,stiffness:300},className:ze("absolute bottom-full mb-3 p-3 shadow-lg whitespace-nowrap","w-auto right-0"),style:{borderRadius:o.getRadius(),backgroundColor:o.getColor(b.TooltipBackground),color:o.getColor(b.TooltipText)},children:[f.jsx("button",{onClick:l,className:"absolute top-2 right-2 p-1 rounded-full hover:bg-black/10 transition-colors","aria-label":a(re.CloseButtonAria),children:f.jsx(X.X,{className:"size-3"})}),f.jsx(Pe.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.1,duration:.3},className:"text-sm font-medium pr-5",style:{color:o.getColor(b.TooltipText)},children:e||(n?(d=(c=t==null?void 0:t.appearance)==null?void 0:c.design)==null?void 0:d.tooltip_message_active:(p=(u=t==null?void 0:t.appearance)==null?void 0:u.design)==null?void 0:p.tooltip_message)||a(n?re.TooltipActive:re.TooltipDefault)}),f.jsx("div",{className:"absolute bottom-0 right-4 w-3 h-3 transform rotate-45 translate-y-1.5",style:{backgroundColor:o.getColor(b.TooltipBackground)}})]},"widget-tooltip"):null}function jx({fallback:e,fallbackOpen:t}){const[n]=v.useState(window.document.title),r=dr(),{isHaveChat:i,open:s,soundPath:o}=ie(),[a,l]=v.useState(!0),[c,d]=v.useState(0),[u,p]=v.useState(null),m=cs(),y=()=>{nF(o)},w=(x,h)=>{if(u&&clearInterval(u),x||!i||h===0||Number.isNaN(h)){window.document.title=n,p(null);return}const g=setInterval(()=>{if(x||!i||h===0||Number.isNaN(h)){window.document.title=n,clearInterval(g),p(null);return}const k=`${h} ${m(re.NewMessagesNotification)} - ${n}`;window.document.title!==k?window.document.title=k:window.document.title=n},1e3);return p(g),()=>{clearInterval(g),p(null)}};return v.useEffect(()=>w(s&&a,c),[c,s,a]),v.useEffect(()=>{const x=()=>{l(document.visibilityState==="visible")};return document.addEventListener("visibilitychange",x,!1),()=>{document.removeEventListener("visibilitychange",x)}},[]),v.useEffect(()=>{if(i&&s&&a&&d(0),!r||!i||s&&a)return;const x=()=>{!i||s&&a||(d(h=>h+1),y())};return r.on(ye.MessageAgentCreate,x),r.on(ye.ChatUserAssignee,y),()=>{r.off(ye.MessageAgentCreate,x),r.off(ye.ChatUserAssignee,y)}},[r,i,s,a]),s?null:i&&c>0?f.jsx(ah,{text:m(re.NewMessagesNotification)}):!i&&t?e:null}function OB({children:e,border:t}){var $,R,z,U;const n=dr(),{open:r,setOpen:i,setIsHaveChat:s,isHaveChat:o,widget:a,onOpen:l,onClose:c,humanNeedRequested:d}=ie(),[u]=v.useState(!0),p=gs(),m=al(),y=um(),w=Se(),{resolvedMode:x}=w,h=Po(),g=UL(),[k,C]=v.useState({x:0,y:0}),S=yP(),T=v.useRef(null),j=v.useRef(null),[E,A]=v.useState(!1),[I,N]=v.useState(!1);v.useEffect(()=>((()=>{A("ontouchstart"in window||navigator.maxTouchPoints>0)})(),window.addEventListener("touchstart",()=>{A(!0)},{once:!0}),()=>{window.removeEventListener("touchstart",()=>{A(!0)})}),[]),v.useEffect(()=>{o&&y.pathname==="/"&&m&&m.accessToken&&!d&&p.push("chat")},[o,y.pathname,m,p,d]),v.useEffect(()=>{r?requestAnimationFrame(()=>{N(!0)}):N(!1)},[r]);const D=W=>{if(!T.current||!j.current)return W;const q=T.current.getBoundingClientRect(),ne={width:window.innerWidth,height:window.innerHeight},oe={top:20,right:20,bottom:40,left:20};let me=W.x,ue=W.y;return q.right+me-k.x>ne.width-oe.right&&(me=ne.width-oe.right-q.width-(q.left-k.x)),q.left+me-k.x<oe.left&&(me=oe.left-(q.left-k.x)),q.bottom+ue-k.y>ne.height-oe.bottom&&(ue=ne.height-oe.bottom-q.height-(q.top-k.y)),q.top+ue-k.y<oe.top&&(ue=oe.top-(q.top-k.y)),{x:me,y:ue}},G=()=>{i(!0),n&&(n.emit(Ve.WidgetOpen,{}),l&&l())},B=()=>{i(!1),n&&(n.emit(Ve.WidgetClose,{}),c&&c())},F=()=>{i(!1),s(!1),oc(a.client_id,Yi(m)),p.push("registration")};v.useEffect(()=>{if(h&&(o||g)&&G(),!(!n||!a))return n.on(ye.Banned,F),()=>{n.off(ye.Banned,F)}},[]);function M(W){E&&S.start(W)}return f.jsxs("section",{className:"relative w-full h-full",ref:j,"data-theme":x,children:[r&&f.jsx("div",{className:ze("fixed z-300 overflow-hidden transition-all duration-300 ease-out",{"":t&&!h,"bottom-24 right-8 rounded-xl":!h,"!bottom-0 !right-0":h,"opacity-100 scale-100 translate-y-0":I,"opacity-0 scale-95 translate-y-2":!I}),style:{width:h?"100%":((R=($=a==null?void 0:a.appearance)==null?void 0:$.design)==null?void 0:R.width)||"21rem",height:h?"var(--app-height, 100dvh)":((U=(z=a==null?void 0:a.appearance)==null?void 0:z.design)==null?void 0:U.height)||"30rem",left:h?"0":"",right:h?"0px !important":"",maxHeight:h?"var(--app-height, 100dvh)":"",boxShadow:h?"":`0 10px 25px -5px ${w.getColor(b.ShadowColor)}, 0 8px 10px -6px ${w.getColor(b.ShadowColor)}`,backgroundColor:w.getColor(b.Background)},children:e}),!E&&f.jsxs("div",{className:"fixed bottom-[40px] right-[20px] z-400",children:[f.jsx(jx,{fallback:f.jsx(ah,{}),fallbackOpen:u}),!r&&f.jsxs(Rt,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"lg",rounded:!0,className:"relative",onClick:G,children:[f.jsx(Pe.span,{initial:{scale:.8,opacity:0},animate:{scale:[1,1.2,1],opacity:[.7,0,.7]},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,repeatType:"loop"},className:ze("absolute -z-10 w-full h-full rounded-full opacity-30"),style:{backgroundColor:w.getColor(b.ButtonBackground)}}),f.jsx(X.Chat,{className:"size-6"})]},"desktop-open-button"),r&&!h&&f.jsx(Rt,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"lg",rounded:!0,onClick:B,children:f.jsx(X.ArrowDown2,{className:"size-6"})},"desktop-close-button")]}),E&&f.jsxs(Pe.div,{ref:T,className:"fixed z-400 bottom-24 right-5",initial:{bottom:"96px",right:"20px"},animate:{x:k.x,y:k.y},drag:E,dragControls:S,dragMomentum:!1,dragElastic:0,onDragEnd:(W,q)=>{const ne={x:k.x+q.offset.x,y:k.y+q.offset.y},oe=D(ne);C(oe)},children:[f.jsx(jx,{fallback:f.jsx(ah,{}),fallbackOpen:u}),!r&&f.jsx("div",{className:"cursor-move",onPointerDown:M,children:f.jsxs(Rt,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"lg",rounded:!0,className:"relative",onClick:G,children:[f.jsx(Pe.span,{initial:{scale:.8,opacity:0},animate:{scale:[1,1.2,1],opacity:[.7,0,.7]},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,repeatType:"loop"},className:ze("absolute -z-10 w-full h-full rounded-full opacity-30"),style:{backgroundColor:w.getColor(b.ButtonBackground)}}),f.jsx(X.Chat,{className:"size-6"})]})},"chat-button"),r&&!h&&f.jsx(Rt,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"lg",rounded:!0,onClick:B,children:f.jsx(X.ArrowDown2,{className:"size-6"})},"desktop-close-button")]})]})}function NB(e){const{widget:t}=ie();return f.jsx(AP,{widget:t,children:f.jsx(OB,{...e})})}function DB(){const{isHaveChat:e,isAIAgentMode:t}=ie();return f.jsx(ij,{initialEntries:[e||t?"/chat":"/"],future:{v7_startTransition:!0},children:f.jsx(NB,{border:!0,children:f.jsxs(oj,{children:[FC.map((n,r)=>f.jsx(pp,{path:n.path,element:f.jsx(n.component,{})},r)),BC.map((n,r)=>f.jsx(pp,{path:n.path,element:f.jsx(n.component,{})},r))]})})})}const IB=v.forwardRef((e,t)=>{const n=localStorage.getItem("lc:device:id"),{data:r,isLoading:i,error:s}=cE(e.link_id,n||void 0),{widget:o,setWidget:a,setSoundPath:l,setDefaultValues:c,setOpen:d,setOnTooltipClose:u,setIsTooltipVisible:p,setOnOpen:m,setOnClose:y,onOpen:w,onClose:x}=ie();return v.useImperativeHandle(t,()=>({open:()=>{d(!0),w&&w()},close:()=>{d(!1),x&&x()}})),v.useEffect(()=>{r&&dE(r)&&a(r),e.soundPath&&l(e.soundPath),e.defaultValues&&c(e.defaultValues),e.onTooltipClose&&u(e.onTooltipClose),e.showTooltip===!1&&p(!1),e.onOpen&&m(e.onOpen),e.onClose&&y(e.onClose)},[r,e.soundPath,e.defaultValues,e.onTooltipClose,e.showTooltip,e.onOpen,e.onClose]),i?f.jsx("div",{children:"Loading..."}):s||!r||!o?null:f.jsx(OI,{children:f.jsx(VL,{children:f.jsx(DB,{})})})}),LB=new q_;let Ax=null;function FB(e){if(!e.container)return;const t=J.createRef();return Ax=Jw(e.container),Ax.render(f.jsxs(X_,{client:LB,children:[f.jsx(IB,{...e,ref:t}),f.jsx(Nj,{richColors:!0,style:{zIndex:999999,position:"fixed",bottom:"20px",right:"20px"},position:"bottom-right"})]})),{open:()=>{var n;return(n=t.current)==null?void 0:n.open()},close:()=>{var n;return(n=t.current)==null?void 0:n.close()},identify:n=>{if(!e.link_id)return;const r=mi(e.link_id);cM({widget_id:e.link_id,device_id:r,decrypted_data:n})}}}window.widget=FB});export default BB();
|
|
127
|
+
*/const DF=[["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"}]],IF=OC("paperclip",DF);var DC={exports:{}},LF="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",FF=LF,$F=FF;function IC(){}function LC(){}LC.resetWarningCache=IC;var BF=function(){function e(r,i,s,o,a,l){if(l!==$F){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:LC,resetWarningCache:IC};return n.PropTypes=n,n};DC.exports=BF();var zF=DC.exports;const De=Pr(zF);function ys(e,t,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(d){try{c(r.next(d))}catch(u){o(u)}}function l(d){try{c(r.throw(d))}catch(u){o(u)}}function c(d){d.done?s(d.value):i(d.value).then(a,l)}c((r=r.apply(e,t||[])).next())})}const VF=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.macroEnabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroEnabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/xliff+xml"],["xlm","application/vnd.ms-excel"],["xls","application/vnd.ms-excel"],["xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt","application/vnd.ms-excel"],["xltm","application/vnd.ms-excel.template.macroEnabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlw","application/vnd.ms-excel"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function Co(e,t,n){const r=UF(e),{webkitRelativePath:i}=e,s=typeof t=="string"?t:typeof i=="string"&&i.length>0?i:`./${e.name}`;return typeof r.path!="string"&&Sx(r,"path",s),Sx(r,"relativePath",s),r}function UF(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),i=VF.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}function Sx(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}const HF=[".DS_Store","Thumbs.db"];function WF(e){return ys(this,void 0,void 0,function*(){return iu(e)&&qF(e.dataTransfer)?KF(e.dataTransfer,e.type):GF(e)?YF(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?QF(e):[]})}function qF(e){return iu(e)}function GF(e){return iu(e)&&iu(e.target)}function iu(e){return typeof e=="object"&&e!==null}function YF(e){return lh(e.target.files).map(t=>Co(t))}function QF(e){return ys(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>Co(n))})}function KF(e,t){return ys(this,void 0,void 0,function*(){if(e.items){const n=lh(e.items).filter(i=>i.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(XF));return Cx(FC(r))}return Cx(lh(e.files).map(n=>Co(n)))})}function Cx(e){return e.filter(t=>HF.indexOf(t.name)===-1)}function lh(e){if(e===null)return[];const t=[];for(let n=0;n<e.length;n++){const r=e[n];t.push(r)}return t}function XF(e){if(typeof e.webkitGetAsEntry!="function")return _x(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?$C(t):_x(e,t)}function FC(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?FC(n):[n]],[])}function _x(e,t){return ys(this,void 0,void 0,function*(){var n;if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle=="function"){const s=yield e.getAsFileSystemHandle();if(s===null)throw new Error(`${e} is not a File`);if(s!==void 0){const o=yield s.getFile();return o.handle=s,Co(o)}}const r=e.getAsFile();if(!r)throw new Error(`${e} is not a File`);return Co(r,(n=t==null?void 0:t.fullPath)!==null&&n!==void 0?n:void 0)})}function ZF(e){return ys(this,void 0,void 0,function*(){return e.isDirectory?$C(e):JF(e)})}function $C(e){const t=e.createReader();return new Promise((n,r)=>{const i=[];function s(){t.readEntries(o=>ys(this,void 0,void 0,function*(){if(o.length){const a=Promise.all(o.map(ZF));i.push(a),s()}else try{const a=yield Promise.all(i);n(a)}catch(a){r(a)}}),o=>{r(o)})}s()})}function JF(e){return ys(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(r=>{const i=Co(r,e.fullPath);t(i)},r=>{n(r)})})})}var cf=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var r=e.name||"",i=(e.type||"").toLowerCase(),s=i.replace(/\/.*$/,"");return n.some(function(o){var a=o.trim().toLowerCase();return a.charAt(0)==="."?r.toLowerCase().endsWith(a):a.endsWith("/*")?s===a.replace(/\/.*$/,""):i===a})}return!0};function Tx(e){return n6(e)||t6(e)||zC(e)||e6()}function e6(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
128
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function t6(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function n6(e){if(Array.isArray(e))return ch(e)}function Ex(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ax(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ex(Object(n),!0).forEach(function(r){BC(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ex(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function BC(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Za(e,t){return s6(e)||i6(e,t)||zC(e,t)||r6()}function r6(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
129
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zC(e,t){if(e){if(typeof e=="string")return ch(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ch(e,t)}}function ch(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function i6(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,s=!1,o,a;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(r.push(o.value),!(t&&r.length===t));i=!0);}catch(l){s=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(s)throw a}}return r}}function s6(e){if(Array.isArray(e))return e}var o6=typeof cf=="function"?cf:cf.default,a6="file-invalid-type",l6="file-too-large",c6="file-too-small",u6="too-many-files",d6=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=t.split(","),r=n.length>1?"one of ".concat(n.join(", ")):n[0];return{code:a6,message:"File type must be ".concat(r)}},jx=function(t){return{code:l6,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},Rx=function(t){return{code:c6,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},f6={code:u6,message:"Too many files"};function VC(e,t){var n=e.type==="application/x-moz-file"||o6(e,t);return[n,n?null:d6(t)]}function UC(e,t,n){if(Ri(e.size))if(Ri(t)&&Ri(n)){if(e.size>n)return[!1,jx(n)];if(e.size<t)return[!1,Rx(t)]}else{if(Ri(t)&&e.size<t)return[!1,Rx(t)];if(Ri(n)&&e.size>n)return[!1,jx(n)]}return[!0,null]}function Ri(e){return e!=null}function p6(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,s=e.multiple,o=e.maxFiles,a=e.validator;return!s&&t.length>1||s&&o>=1&&t.length>o?!1:t.every(function(l){var c=VC(l,n),d=Za(c,1),u=d[0],p=UC(l,r,i),h=Za(p,1),y=h[0],w=a?a(l):null;return u&&y&&!w})}function su(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Yl(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function Px(e){e.preventDefault()}function h6(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function m6(e){return e.indexOf("Edge/")!==-1}function g6(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return h6(e)||m6(e)}function Gn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];return t.some(function(a){return!su(r)&&a&&a.apply(void 0,[r].concat(s)),su(r)})}}function v6(){return"showOpenFilePicker"in window}function y6(e){if(Ri(e)){var t=Object.entries(e).filter(function(n){var r=Za(n,2),i=r[0],s=r[1],o=!0;return HC(i)||(console.warn('Skipped "'.concat(i,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),o=!1),(!Array.isArray(s)||!s.every(WC))&&(console.warn('Skipped "'.concat(i,'" because an invalid file extension was provided.')),o=!1),o}).reduce(function(n,r){var i=Za(r,2),s=i[0],o=i[1];return Ax(Ax({},n),{},BC({},s,o))},{});return[{description:"Files",accept:t}]}return e}function x6(e){if(Ri(e))return Object.entries(e).reduce(function(t,n){var r=Za(n,2),i=r[0],s=r[1];return[].concat(Tx(t),[i],Tx(s))},[]).filter(function(t){return HC(t)||WC(t)}).join(",")}function w6(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function b6(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function HC(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function WC(e){return/^.*\.[\w]+$/.test(e)}var k6=["children"],S6=["open"],C6=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],_6=["refKey","onChange","onClick"];function T6(e){return j6(e)||A6(e)||qC(e)||E6()}function E6(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
130
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function A6(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function j6(e){if(Array.isArray(e))return uh(e)}function uf(e,t){return M6(e)||P6(e,t)||qC(e,t)||R6()}function R6(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
131
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qC(e,t){if(e){if(typeof e=="string")return uh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return uh(e,t)}}function uh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function P6(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,s=!1,o,a;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(r.push(o.value),!(t&&r.length===t));i=!0);}catch(l){s=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(s)throw a}}return r}}function M6(e){if(Array.isArray(e))return e}function Mx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function qe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Mx(Object(n),!0).forEach(function(r){dh(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mx(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ou(e,t){if(e==null)return{};var n=N6(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function N6(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var ml=g.forwardRef(function(e,t){var n=e.children,r=ou(e,k6),i=O6(r),s=i.open,o=ou(i,S6);return g.useImperativeHandle(t,function(){return{open:s}},[s]),ee.createElement(g.Fragment,null,n(qe(qe({},o),{},{open:s})))});ml.displayName="Dropzone";var GC={disabled:!1,getFilesFromEvent:WF,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};ml.defaultProps=GC;ml.propTypes={children:De.func,accept:De.objectOf(De.arrayOf(De.string)),multiple:De.bool,preventDropOnDocument:De.bool,noClick:De.bool,noKeyboard:De.bool,noDrag:De.bool,noDragEventsBubbling:De.bool,minSize:De.number,maxSize:De.number,maxFiles:De.number,disabled:De.bool,getFilesFromEvent:De.func,onFileDialogCancel:De.func,onFileDialogOpen:De.func,useFsAccessApi:De.bool,autoFocus:De.bool,onDragEnter:De.func,onDragLeave:De.func,onDragOver:De.func,onDrop:De.func,onDropAccepted:De.func,onDropRejected:De.func,onError:De.func,validator:De.func};var fh={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function O6(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=qe(qe({},GC),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,s=t.maxSize,o=t.minSize,a=t.multiple,l=t.maxFiles,c=t.onDragEnter,d=t.onDragLeave,u=t.onDragOver,p=t.onDrop,h=t.onDropAccepted,y=t.onDropRejected,w=t.onFileDialogCancel,b=t.onFileDialogOpen,m=t.useFsAccessApi,v=t.autoFocus,x=t.preventDropOnDocument,S=t.noClick,C=t.noKeyboard,_=t.noDrag,j=t.noDragEventsBubbling,A=t.onError,E=t.validator,D=g.useMemo(function(){return x6(n)},[n]),L=g.useMemo(function(){return y6(n)},[n]),O=g.useMemo(function(){return typeof b=="function"?b:Nx},[b]),q=g.useMemo(function(){return typeof w=="function"?w:Nx},[w]),$=g.useRef(null),B=g.useRef(null),I=g.useReducer(D6,fh),N=uf(I,2),R=N[0],z=N[1],H=R.isFocused,W=R.isFileDialogActive,G=g.useRef(typeof window<"u"&&window.isSecureContext&&m&&v6()),te=function(){!G.current&&W&&setTimeout(function(){if(B.current){var U=B.current.files;U.length||(z({type:"closeDialog"}),q())}},300)};g.useEffect(function(){return window.addEventListener("focus",te,!1),function(){window.removeEventListener("focus",te,!1)}},[B,W,q,G]);var se=g.useRef([]),pe=function(U){$.current&&$.current.contains(U.target)||(U.preventDefault(),se.current=[])};g.useEffect(function(){return x&&(document.addEventListener("dragover",Px,!1),document.addEventListener("drop",pe,!1)),function(){x&&(document.removeEventListener("dragover",Px),document.removeEventListener("drop",pe))}},[$,x]),g.useEffect(function(){return!r&&v&&$.current&&$.current.focus(),function(){}},[$,v,r]);var ue=g.useCallback(function(F){A?A(F):console.error(F)},[A]),ke=g.useCallback(function(F){F.preventDefault(),F.persist(),ye(F),se.current=[].concat(T6(se.current),[F.target]),Yl(F)&&Promise.resolve(i(F)).then(function(U){if(!(su(F)&&!j)){var ae=U.length,de=ae>0&&p6({files:U,accept:D,minSize:o,maxSize:s,multiple:a,maxFiles:l,validator:E}),Se=ae>0&&!de;z({isDragAccept:de,isDragReject:Se,isDragActive:!0,type:"setDraggedFiles"}),c&&c(F)}}).catch(function(U){return ue(U)})},[i,c,ue,j,D,o,s,a,l,E]),Ne=g.useCallback(function(F){F.preventDefault(),F.persist(),ye(F);var U=Yl(F);if(U&&F.dataTransfer)try{F.dataTransfer.dropEffect="copy"}catch{}return U&&u&&u(F),!1},[u,j]),Q=g.useCallback(function(F){F.preventDefault(),F.persist(),ye(F);var U=se.current.filter(function(de){return $.current&&$.current.contains(de)}),ae=U.indexOf(F.target);ae!==-1&&U.splice(ae,1),se.current=U,!(U.length>0)&&(z({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Yl(F)&&d&&d(F))},[$,d,j]),V=g.useCallback(function(F,U){var ae=[],de=[];F.forEach(function(Se){var at=VC(Se,D),vt=uf(at,2),Un=vt[0],dn=vt[1],xs=UC(Se,o,s),fr=uf(xs,2),Dr=fr[0],ws=fr[1],Io=E?E(Se):null;if(Un&&Dr&&!Io)ae.push(Se);else{var ki=[dn,ws];Io&&(ki=ki.concat(Io)),de.push({file:Se,errors:ki.filter(function(Hn){return Hn})})}}),(!a&&ae.length>1||a&&l>=1&&ae.length>l)&&(ae.forEach(function(Se){de.push({file:Se,errors:[f6]})}),ae.splice(0)),z({acceptedFiles:ae,fileRejections:de,isDragReject:de.length>0,type:"setFiles"}),p&&p(ae,de,U),de.length>0&&y&&y(de,U),ae.length>0&&h&&h(ae,U)},[z,a,D,o,s,l,p,h,y,E]),P=g.useCallback(function(F){F.preventDefault(),F.persist(),ye(F),se.current=[],Yl(F)&&Promise.resolve(i(F)).then(function(U){su(F)&&!j||V(U,F)}).catch(function(U){return ue(U)}),z({type:"reset"})},[i,V,ue,j]),K=g.useCallback(function(){if(G.current){z({type:"openDialog"}),O();var F={multiple:a,types:L};window.showOpenFilePicker(F).then(function(U){return i(U)}).then(function(U){V(U,null),z({type:"closeDialog"})}).catch(function(U){w6(U)?(q(U),z({type:"closeDialog"})):b6(U)?(G.current=!1,B.current?(B.current.value=null,B.current.click()):ue(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):ue(U)});return}B.current&&(z({type:"openDialog"}),O(),B.current.value=null,B.current.click())},[z,O,q,m,V,ue,L,a]),Y=g.useCallback(function(F){!$.current||!$.current.isEqualNode(F.target)||(F.key===" "||F.key==="Enter"||F.keyCode===32||F.keyCode===13)&&(F.preventDefault(),K())},[$,K]),me=g.useCallback(function(){z({type:"focus"})},[]),re=g.useCallback(function(){z({type:"blur"})},[]),Ee=g.useCallback(function(){S||(g6()?setTimeout(K,0):K())},[S,K]),ot=function(U){return r?null:U},$t=function(U){return C?null:ot(U)},oe=function(U){return _?null:ot(U)},ye=function(U){j&&U.stopPropagation()},Oe=g.useMemo(function(){return function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},U=F.refKey,ae=U===void 0?"ref":U,de=F.role,Se=F.onKeyDown,at=F.onFocus,vt=F.onBlur,Un=F.onClick,dn=F.onDragEnter,xs=F.onDragOver,fr=F.onDragLeave,Dr=F.onDrop,ws=ou(F,C6);return qe(qe(dh({onKeyDown:$t(Gn(Se,Y)),onFocus:$t(Gn(at,me)),onBlur:$t(Gn(vt,re)),onClick:ot(Gn(Un,Ee)),onDragEnter:oe(Gn(dn,ke)),onDragOver:oe(Gn(xs,Ne)),onDragLeave:oe(Gn(fr,Q)),onDrop:oe(Gn(Dr,P)),role:typeof de=="string"&&de!==""?de:"presentation"},ae,$),!r&&!C?{tabIndex:0}:{}),ws)}},[$,Y,me,re,Ee,ke,Ne,Q,P,C,_,r]),M=g.useCallback(function(F){F.stopPropagation()},[]),J=g.useMemo(function(){return function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},U=F.refKey,ae=U===void 0?"ref":U,de=F.onChange,Se=F.onClick,at=ou(F,_6),vt=dh({accept:D,multiple:a,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:ot(Gn(de,P)),onClick:ot(Gn(Se,M)),tabIndex:-1},ae,B);return qe(qe({},vt),at)}},[B,n,a,P,r]);return qe(qe({},R),{},{isFocused:H&&!r,getRootProps:Oe,getInputProps:J,rootRef:$,inputRef:B,open:ot(K)})}function D6(e,t){switch(t.type){case"focus":return qe(qe({},e),{},{isFocused:!0});case"blur":return qe(qe({},e),{},{isFocused:!1});case"openDialog":return qe(qe({},fh),{},{isFileDialogActive:!0});case"closeDialog":return qe(qe({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return qe(qe({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return qe(qe({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return qe({},fh);default:return e}}function Nx(){}const YC=5*1024*1024,_o={"text/plain":[".txt"],"application/pdf":[".pdf"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[".docx"],"application/msword":[".doc"],"image/png":[".png"],"image/jpeg":[".jpg",".jpeg"],"image/gif":[".gif"],"image/webp":[".webp"],"image/svg+xml":[".svg"]},Ox=Object.values(_o).flat();function I6(e){var r;if(e.size>YC)return{isValid:!1,error:`Dosya boyutu 5MB'dan büyük olamaz. Seçilen dosya: ${(e.size/1024/1024).toFixed(2)}MB`};const t=`.${(r=e.name.split(".").pop())==null?void 0:r.toLowerCase()}`;return Object.keys(_o).includes(e.type)||Ox.includes(t)?{isValid:!0,error:""}:{isValid:!1,error:`Desteklenmeyen dosya tipi. Kabul edilen tipler: ${Ox.join(", ")}`}}function au(e){for(const t of e){const n=I6(t);if(!n.isValid)return n}return{isValid:!0,error:""}}function QC({onDrop:e}){const t=n=>{const r=au(n);if(!r.isValid){alert(r.error);return}e(n)};return f.jsx("div",{className:"flex items-center justify-center border rounded-md cursor-pointer bg-slate-100 dropzone border-slate-200 dz-clickable",children:f.jsx(ml,{onDrop:t,accept:Object.keys(_o).reduce((n,r)=>(n[r]=_o[r],n),{}),maxSize:YC,children:({getRootProps:n,getInputProps:r})=>f.jsxs("div",{className:"w-full py-5 text-lg text-center dz-message needsclick",...n(),children:[f.jsx("input",{...r()}),f.jsx("div",{className:"mb-3",children:f.jsx(OF,{className:"block size-12 mx-auto text-slate-500 fill-slate-200"})}),f.jsxs("h5",{className:"mb-0 font-normal text-slate-500 text-15",children:["Yüklemek istediğiniz görseli buraya sürükleyin veya"," ",f.jsx("span",{className:"text-custom-500",children:"seçmek için tıklayın"})]})]})})})}QC.Button=({onDrop:e})=>{const t=be(),n=r=>{const i=au(r);if(!i.isValid){en({description:i.error,variant:"error"});return}e(r)};return f.jsx(ml,{onDrop:n,accept:Object.keys(_o).reduce((r,i)=>(r[i]=_o[i],r),{}),children:({getRootProps:r,getInputProps:i})=>f.jsxs("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center text-center dz-message needsclick cursor-pointer",...r(),children:[f.jsx("input",{...i()}),f.jsx(IF,{style:{color:t.getColor(k.IconColor)},className:"size-5"})]})})};const Dx=[{name:"Yüzler",icon:"😊",emojis:["😀","😃","😄","😁","😆","😅","🤣","😂","🙂","😊","😇","🥰","😍","🤩","😘","😗","😚","😙","🥲","😋","😛","😜","🤪","😝","🤑","🤗","🤭","🤫","🤔","🫡","🤐","🤨","😐","😑","😶","🫥","😏","😒","🙄","😬","😮💨","🤥","😌","😔","😪","🤤","😴","😷","🤒","🤕","🤢","🤮","🥴","😵","🤯","🥳","🥸","😎","🤓","🧐","😕","🫤","😟","🙁","😮","😯","😲","😳","🥺","🥹","😦","😧","😨","😰","😥","😢","😭","😱","😖","😣","😞","😓","😩","😫","🥱","😤","😡","😠"]},{name:"El",icon:"👋",emojis:["👋","🤚","🖐️","✋","🖖","🫱","🫲","🫳","🫴","👌","🤌","🤏","✌️","🤞","🫰","🤟","🤘","🤙","👈","👉","👆","🖕","👇","☝️","🫵","👍","👎","✊","👊","🤛","🤜","👏","🙌","🫶","👐","🤲","🤝","🙏","💪","🦾"]},{name:"Kalp",icon:"❤️",emojis:["❤️","🧡","💛","💚","💙","💜","🖤","🤍","🤎","💔","❤️🔥","❤️🩹","❣️","💕","💞","💓","💗","💖","💘","💝","💟","♥️","💋","🫂"]},{name:"Hayvan",icon:"🐱",emojis:["🐶","🐱","🐭","🐹","🐰","🦊","🐻","🐼","🐻❄️","🐨","🐯","🦁","🐮","🐷","🐸","🐵","🐔","🐧","🐦","🐤","🦆","🦅","🦉","🦇","🐺","🐗","🐴","🦄","🐝","🪱","🐛","🦋","🐌","🐞","🐜","🪰","🐢","🐍","🦎","🐙"]},{name:"Yiyecek",icon:"🍕",emojis:["🍎","🍐","🍊","🍋","🍌","🍉","🍇","🍓","🫐","🍈","🍒","🍑","🥭","🍍","🥥","🥝","🍅","🍆","🥑","🫛","🥦","🥬","🌶️","🫑","🍕","🍔","🍟","🌭","🍿","🧀","🥚","🍳","🥞","🧇","🥓","🍖","🍗","🌮","🌯","🥗","☕","🍵","🧃","🥤","🍺","🍷","🥂","🍰"]},{name:"Aktivite",icon:"⚽",emojis:["⚽","🏀","🏈","⚾","🥎","🎾","🏐","🏉","🥏","🎱","🏓","🏸","🥅","⛳","🎯","🏹","🎣","🤿","🥊","🥋","🎿","⛷️","🏂","🪂","🏋️","🤸","🎮","🕹️","🎲","🧩","🎭","🎨","🎬","🎤","🎧","🎼","🎹","🥁","🎷","🎺"]},{name:"Nesne",icon:"💡",emojis:["⌚","📱","💻","⌨️","🖥️","🖨️","🖱️","💾","💿","📷","📹","🎥","📞","📟","📠","📺","🔋","🔌","💡","🔦","🕯️","🧯","💰","💳","💎","🔧","🔨","🪛","🔩","⚙️","🔑","🗝️","📦","📫","📝","✏️","🖊️","📎","📌","✂️"]}];function KC({onSelect:e,isOpen:t,onClose:n}){const r=be(),[i,s]=g.useState(0),o=g.useRef(null),a=g.useRef(null);return g.useEffect(()=>{if(!t)return;const l=c=>{o.current&&!o.current.contains(c.target)&&n()};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[t,n]),g.useEffect(()=>{a.current&&(a.current.scrollTop=0)},[i]),f.jsx(Ar,{children:t&&f.jsxs(Re.div,{ref:o,onMouseDown:l=>l.stopPropagation(),initial:{opacity:0,y:8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:8,scale:.95},transition:{duration:.15},className:"absolute bottom-full left-0 mb-2 z-50 overflow-hidden",style:{width:"280px",backgroundColor:r.getColor(k.Background),border:`1px solid ${r.getColor(k.Border)}`,borderRadius:r.getRadius(),boxShadow:`0 4px 20px ${r.getColor(k.ShadowColor)}`},children:[f.jsx("div",{className:"flex items-center gap-0.5 px-1.5 py-1.5 overflow-x-auto",style:{borderBottom:`1px solid ${r.getColor(k.DividerColor)}`},children:Dx.map((l,c)=>f.jsx("button",{type:"button",onClick:()=>s(c),className:"flex-shrink-0 w-8 h-8 flex items-center justify-center rounded-md text-base transition-colors",style:{backgroundColor:c===i?r.getColor(k.InputBackground):"transparent"},title:l.name,children:l.icon},l.name))}),f.jsx("div",{ref:a,className:"grid grid-cols-8 gap-0.5 p-1.5 overflow-y-auto",style:{maxHeight:"200px"},children:Dx[i].emojis.map((l,c)=>f.jsx("button",{type:"button",onClick:()=>{e(l),n()},className:"w-8 h-8 flex items-center justify-center rounded-md text-lg hover:scale-110 transition-transform",style:{backgroundColor:"transparent"},onMouseEnter:d=>{d.currentTarget.style.backgroundColor=r.getColor(k.InputBackground)},onMouseLeave:d=>{d.currentTarget.style.backgroundColor="transparent"},children:l},`${l}-${c}`))})]})})}const Ix=2;function L6({onNewMessage:e,client_id:t,is_uploadable:n,messages:r,onEvaluateChat:i,onNewChat:s,onSendMessage:o,isHistoryMode:a=!1,historyChat:l}){const c=g.useRef(null),d=dr(),u=bM(t),p=be(),h=us(),{setIsInputFocused:y,showActionButtons:w,setShowActionButtons:b}=ne(),[m,v]=g.useState(""),[x,S]=g.useState("3rem"),[C,_]=g.useState(!1),[j,A]=g.useState([]),[E,D]=g.useState(0),[L,O]=g.useState(!1),[q,$]=g.useState(0),[B,I]=g.useState(null),[N,R]=g.useState(!1),z=()=>{if(!a||!l||l.status!==tn.Closed||!l.closed_at)return!1;const Q=new Date(l.closed_at);return(new Date().getTime()-Q.getTime())/(1e3*60*60)>2},H=a&&(l==null?void 0:l.status)===tn.Closed&&z();g.useEffect(()=>{if(r.length>0){const Q=r[r.length-1];Q.id!==B&&(I(Q.id),Q.sender_type===ve.User&&(D(0),O(!1)))}},[r,B]),g.useEffect(()=>{let Q;return L&&q>0&&(Q=window.setTimeout(()=>{$(V=>V<=1?(O(!1),D(0),0):V-1)},1e3)),()=>clearTimeout(Q)},[L,q]),g.useEffect(()=>{const Q=c.current;if(Q){const V=()=>y(!0),P=()=>y(!1);return Q.addEventListener("focus",V),Q.addEventListener("blur",P),()=>{Q.removeEventListener("focus",V),Q.removeEventListener("blur",P)}}},[y]),g.useEffect(()=>{const Q=()=>{b(!0)},V=()=>{b(!1)};return d==null||d.on(ge.ChatUserShowButton,Q),d==null||d.on(ge.MessageUserCreate,V),()=>{d==null||d.off(ge.ChatUserShowButton,Q),d==null||d.off(ge.MessageUserCreate,V)}},[d,b]),g.useEffect(()=>{r.length>0&&r[r.length-1].activity_type==="admin_join"&&b(!1)},[r,b]),ru("lc:rate-limit",Q=>{const V=Q.detail&&Q.detail.seconds||3;O(!0),$(V),D(0)}),ru("paste",Q=>{const V=Q.clipboardData.items,P=[];for(const K of V){const Y=K.getAsFile();Y&&P.push(Y)}if(P.length>0&&!n){en({description:h(ie.FileUploadDisabled),variant:"error"});return}if(P.length>0){const K=au(P);if(!K.isValid){en({description:K.error,variant:"error"});return}A([...j,...P])}});const W=async()=>{const Q=m.trim(),V=!!n&&j.length>0,P=Q.length>0&&Q.length<Ix;if(!Q&&!V||P)return;if(E>5&&!L){O(!0),$(3);return}if(L||C)return;const K=m,Y=[...j];v(""),A([]),c.current&&(c.current.style.height="3rem",S("3rem")),_(!0);let me;if(n&&Y.length>0){const[re,Ee]=await u.mutateAsync(Y);if(!zn(Ee)){ZA(re,Ee),_(!1),v(K),A(Y);return}kM(re)&&(me=re.file_urls)}if(o){o(K,me),_(!1);return}d==null||d.emit(He.MessageCreate,{content:K,files:me},re=>{e(re),_(!1),D(Ee=>Ee+1),b(!1)})},te=(m.trim().length>=Ix||j.length>0)&&!C&&!L,se=Q=>{d==null||d.emit(He.MessageTyping,{content:Q})},pe=()=>{d==null||d.emit(He.ChatClose,{}),b(!1),i==null||i()},ue=()=>{d==null||d.emit(He.ChatClose,{}),b(!1),s==null||s()},ke=g.useCallback(Q=>{const V=c.current;if(V){const P=V.selectionStart,K=V.selectionEnd,Y=m.substring(0,P)+Q+m.substring(K);Y.length<=2e3&&(v(Y),se(Y),setTimeout(()=>{V.selectionStart=V.selectionEnd=P+Q.length,V.focus()},0))}else{const P=m+Q;P.length<=2e3&&(v(P),se(P))}},[m]),Ne=a&&(l==null?void 0:l.status)===tn.Closed;return H?null:f.jsxs(f.Fragment,{children:[Ne&&f.jsxs("div",{className:"px-5 flex flex-col gap-2",children:[f.jsxs("div",{className:"p-3 rounded-lg flex items-center gap-2",style:{backgroundColor:p.getColor(k.InputBackground),borderColor:p.getColor(k.InputBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:p.getRadius()},children:[f.jsx(Z.Lock,{className:"w-5 h-5 flex-shrink-0",style:{color:p.getColor(k.FooterText)}}),f.jsx("span",{className:"text-sm",style:{color:p.getColor(k.FooterText)},children:"Bu sohbet kapatılmıştır."})]}),f.jsxs(Rt,{size:"lg",onClick:()=>{s==null||s()},className:"rounded-lg gap-2 transition-all",children:[f.jsx(Z.Plus,{className:"size-4"}),f.jsx("span",{children:"Yeni Sohbet Başlat"})]}),f.jsx(So,{variant:"block"})]}),L&&f.jsxs(Re.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"mb-2 mx-3 rounded-lg z-[100] p-2 flex items-center justify-center",style:{backgroundColor:p.getColor(k.ErrorBackground),borderColor:p.getColor(k.ErrorBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:p.getRadius()},children:[f.jsx(Z.XCircle,{className:"size-4 mr-2",style:{color:p.getColor(k.ErrorText)}}),f.jsx("span",{className:"text-sm font-medium",style:{color:p.getColor(k.ErrorText)},children:h(ie.RateLimitMessage).replace("{seconds}",q.toString())})]}),w&&f.jsxs(Re.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"mb-2 mx-3 flex gap-2",children:[f.jsxs(Rt,{className:"flex-1 flex items-center justify-center gap-2",size:"md",variant:"primary",kind:"outline",onClick:pe,style:{borderColor:p.getColor(k.ButtonBackground),color:p.getColor(k.ButtonBackground),backgroundColor:"transparent"},children:[f.jsx(Z.Star,{className:"size-4"}),f.jsx("span",{children:"Değerlendir"})]}),f.jsxs(Rt,{size:"md",className:"flex-1 flex items-center justify-center gap-2",onClick:ue,children:[f.jsx(Z.Plus,{className:"size-4"}),f.jsx("span",{children:"Yeni Sohbet"})]})]}),(!a||a&&(l==null?void 0:l.status)!==tn.Closed&&(l==null?void 0:l.status)!==tn.Deleted)&&f.jsxs("form",{className:"flex flex-col relative",onSubmit:Q=>{Q.preventDefault(),W()},children:[f.jsx("div",{className:"mx-4 border-t",style:{borderColor:p.getColor(k.DividerColor)}}),n&&j&&j.length>0&&f.jsx("div",{className:"px-3 pt-2 overflow-x-auto",children:f.jsx(PC,{files:j,onDelete:Q=>{A(j.filter((V,P)=>P!==Q))}})}),f.jsxs("div",{className:"flex gap-2 px-3 py-1 w-full",children:[f.jsxs("div",{className:"flex-1 min-w-0 relative",children:[f.jsx(Ju,{id:"message",inputRef:c,className:"grow",noMargin:!0,borderless:!0,autoComplete:"off",disabled:L,style:{height:x,maxHeight:"6rem",opacity:L?.5:1,cursor:L?"not-allowed":"text",boxShadow:"none"},placeholder:L?h(ie.RateLimitMessage).replace("{seconds}",q.toString()):h(ie.MessagePlaceholder),value:m,maxLength:2e3,onChange:Q=>{if(L)return;const V=Q.target.value;if(V.length<=2e3&&(v(V),se(V)),V.length>0&&Q.currentTarget.scrollHeight>Q.currentTarget.clientHeight){const P=`${Q.currentTarget.scrollHeight}px`;Q.currentTarget.style.height=P,S(P)}else Q.currentTarget.style.height="3rem",S("3rem")},onKeyDown:Q=>{if(L){Q.preventDefault();return}Q.key==="Enter"&&!Q.shiftKey&&(Q.preventDefault(),W())}}),m.length>=500&&f.jsx("div",{className:"absolute bottom-2 right-3 text-xs pointer-events-none",style:{color:m.length>=2e3?p.getColor(k.ErrorText):p.getColor(k.FooterText),fontWeight:m.length>=2e3?"600":"normal"},children:2e3-m.length})]}),f.jsx("div",{className:"flex items-center gap-1 flex-shrink-0 pb-0.5",children:f.jsx(Re.div,{whileTap:{scale:.9},children:f.jsx(Rt,{className:"!bg-transparent rounded-full w-8 h-8 min-w-8 flex items-center justify-center transition-colors disabled:!opacity-100",type:"submit",size:"xs",disabled:!te,style:{opacity:1,color:te?p.getColor(k.ButtonBackground):p.getColor(k.FooterText)},children:C?f.jsx(Z.Spin,{className:"size-4 animate-spin"}):L?f.jsx("span",{className:"text-[10px] font-bold",children:q}):f.jsx(Z.PaperAirplane,{className:"size-5"})})})})]}),f.jsx(KC,{isOpen:N,onClose:()=>R(!1),onSelect:ke}),f.jsxs("div",{className:"px-3 pb-1.5 flex items-center justify-between",children:[f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("button",{type:"button",onClick:()=>R(!N),className:"p-1.5 rounded-md transition-colors",style:{color:p.getColor(k.IconColor)},children:f.jsx(Z.Emoji,{className:"size-5"})}),n&&f.jsx(QC.Button,{onDrop:Q=>{if(Q.length){const V=au(Q);if(!V.isValid){en({description:V.error,variant:"error"});return}A([...j,...Q])}}})]}),f.jsx(So,{variant:"inline"})]})]})]})}const Lx=[["#6366f1","#8b5cf6"],["#3b82f6","#06b6d4"],["#10b981","#34d399"],["#f59e0b","#f97316"],["#ef4444","#f472b6"],["#8b5cf6","#ec4899"],["#14b8a6","#22d3ee"],["#f43f5e","#fb923c"]];function ph({name:e,avatar:t,className:n="text-neutral-500",textColor:r,subtitle:i}){const s=g.useMemo(()=>{const o=e.charCodeAt(0)||0,a=Lx[o%Lx.length];return`linear-gradient(135deg, ${a[0]}, ${a[1]})`},[e]);return f.jsxs(Re.div,{initial:{opacity:.8},animate:{opacity:1},className:"flex gap-2 items-center",children:[f.jsx("div",{className:"min-w-max",children:f.jsxs("span",{children:[t&&f.jsx("img",{className:"size-10 rounded-full border border-white/20 shadow-sm",src:t,"aria-label":e}),!t&&f.jsx("div",{className:"size-10 rounded-full flex items-center justify-center font-semibold text-white shadow-sm",style:{background:s},children:e.charAt(0).toUpperCase()})]})}),f.jsxs("div",{className:"flex flex-col",children:[f.jsx("span",{className:Ie("line-clamp-1 font-medium",n),style:r?{color:r}:void 0,children:e}),i&&f.jsx("span",{className:"text-xs opacity-75 line-clamp-1",style:r?{color:r}:void 0,children:i})]})]})}const Fx=[["#6366f1","#8b5cf6"],["#3b82f6","#06b6d4"],["#10b981","#34d399"],["#f59e0b","#f97316"],["#ef4444","#f472b6"],["#8b5cf6","#ec4899"],["#14b8a6","#22d3ee"],["#f43f5e","#fb923c"]],zs=32;function F6({participant:e,className:t}){const n=g.useMemo(()=>{const r=e.name.charCodeAt(0)||0,i=Fx[r%Fx.length];return`linear-gradient(135deg, ${i[0]}, ${i[1]})`},[e.name]);return f.jsx("span",{title:e.name,className:Ie("block rounded-full border border-white/25 shadow-sm overflow-hidden",t),children:e.avatar?f.jsx("img",{className:"rounded-full object-cover",style:{width:zs,height:zs},src:e.avatar,alt:"",title:e.name}):f.jsx("div",{className:"flex items-center justify-center font-semibold text-white text-xs",style:{width:zs,height:zs,background:n},children:e.name.charAt(0).toUpperCase()})})}const df=3;function $x({participants:e,textColor:t,className:n}){const r=g.useMemo(()=>e.map(l=>l.name).join(", "),[e]);if(e.length===0)return null;const i=e.length>df,s=i?e.slice(0,df-1):e,o=i?e.length-(df-1):0,a=e[0];return f.jsxs("div",{className:Ie("group/participant relative inline-flex max-w-full",n),children:[f.jsxs(Re.div,{initial:{opacity:.8},animate:{opacity:1},className:"flex gap-2 items-center min-w-0 cursor-default",children:[f.jsx("div",{className:"flex items-center flex-shrink-0",children:f.jsxs("div",{className:"flex flex-row items-center -space-x-2",children:[s.map((l,c)=>f.jsx("div",{className:"relative",style:{zIndex:s.length-c},title:l.name,children:f.jsx(F6,{participant:l})},`${Ks(l)}-${c}`)),i?f.jsxs("div",{title:r,className:"relative flex items-center justify-center rounded-full border border-white/25 bg-black/25 text-xs font-semibold shadow-sm",style:{width:zs,height:zs,zIndex:0},children:["+",o]}):null]})}),f.jsx("div",{className:"flex flex-col min-w-0",children:f.jsx("span",{className:"line-clamp-1 font-medium text-neutral-500",style:t?{color:t}:void 0,title:a.name,children:a.name})})]}),f.jsx("div",{role:"tooltip",className:"pointer-events-none absolute left-0 top-full z-[100] mt-1 max-w-[min(280px,calc(100vw-2rem))] rounded-md px-2 py-1.5 text-xs font-normal leading-snug shadow-lg opacity-0 transition-opacity duration-150 group-hover/participant:opacity-100 bg-neutral-900 text-white border border-white/10",children:r})]})}function $6({chat:e,isTyping:t,shortcutMessages:n,messages:r,onNewMessage:i,onChatClose:s,onEvaluateChat:o,onNewChat:a,onSendMessage:l,isHistoryMode:c=!1,spamWarningMessage:d,onDismissSpamWarning:u}){const{widget:p,setOpen:h,open:y,isHaveChat:w,isInputFocused:b}=ne(),m=ne(q=>q.historyChat),v=be(),x=Do(),S=nd(),C=dr(),_=vs(),j=g.useRef(new Set),A=g.useRef(!1),E=()=>{h(!1)},D=g.useCallback(()=>{if(!C||!y||!w||!Array.isArray(r))return;const q=r.filter($=>$.sender_type===ve.User&&!j.current.has($.id)).map($=>$.id);q.length!==0&&C.emit(He.MessageRead,{message_ids:q},$=>{if($&&$.success===!0)for(const B of q)j.current.add(B)})},[C,r,y,w]);g.useEffect(()=>{y&&(A.current=!0),y&&w&&(b||A.current)&&(D(),A.current=!1)},[y,w,b,D]);const L=()=>{var $,B,I,N;return((N=(I=(B=($=p==null?void 0:p.appearance)==null?void 0:$.head)==null?void 0:B.elements)==null?void 0:I.find(R=>R.type==="title"))==null?void 0:N.content)||"Müşteri Hizmetleri"},O=()=>{var I,N,R,z,H,W,G,te;if(c&&m)return"Geçmiş sohbet";const q=((N=(I=e==null?void 0:e.participants)==null?void 0:I[0])==null?void 0:N.name)||(e==null?void 0:e.agent_name);if(q)return q;const $=(z=(R=p==null?void 0:p.appearance)==null?void 0:R.design)==null?void 0:z.greeting_header;return $||((te=(G=(W=(H=p==null?void 0:p.appearance)==null?void 0:H.head)==null?void 0:W.elements)==null?void 0:G.find(se=>se.type==="text"))==null?void 0:te.content)||"Bizimle Sohbet Edin"};return f.jsxs(f.Fragment,{children:[f.jsxs("header",{className:"px-4 py-3 flex items-center justify-between flex-shrink-0 overflow-visible min-h-[52px]",style:{backgroundColor:v.getColor(k.HeaderBackground),color:v.getColor(k.HeaderText),borderColor:v.getColor(k.HeaderBorder),...x?{}:{borderTopLeftRadius:v.getRadius(),borderTopRightRadius:v.getRadius()}},children:[f.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[c&&f.jsx("button",{type:"button",onClick:()=>{ne.getState().setHistoryChat(null),ne.getState().setHistoryMessages(null),ne.getState().setShowHistoryOnRegistration(!0),_.push("registration")},className:"flex-shrink-0 p-1 hover:opacity-80 transition-opacity",children:f.jsx(Z.ArrowLeft,{className:"w-5 h-5"})}),(()=>{if(c&&m){const q=xF(m);if(q.length>1)return f.jsx($x,{participants:q,textColor:v.getColor(k.HeaderText)});if(q.length===1)return f.jsx(ph,{name:q[0].name,avatar:q[0].avatar,textColor:v.getColor(k.HeaderText)})}if(!c&&e){const q=e.participants&&e.participants.length>0?e.participants:Cg(e.agent_name,e.agent_avatar);if(q.length>1)return f.jsx($x,{participants:q,textColor:v.getColor(k.HeaderText)});if(q.length===1)return f.jsx(ph,{name:q[0].name,avatar:q[0].avatar,textColor:v.getColor(k.HeaderText)})}return f.jsx("div",{className:"flex-1 min-w-0",children:c?f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"font-medium truncate",children:L()}),f.jsx("div",{className:"text-sm opacity-90 truncate",children:O()})]}):f.jsx("div",{className:"font-medium truncate",children:O()})})})()]}),f.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(!c||c&&(e==null?void 0:e.status)!==tn.Closed)&&f.jsx(SF,{onChatClose:s}),S&&f.jsx("button",{type:"button",onClick:E,className:"p-1 hover:opacity-80 transition-opacity",children:f.jsx(Z.X,{className:"w-5 h-5 cursor-pointer"})})]})]}),f.jsx(MC,{messages:r,isTyping:t||n.length>0,chat:e}),f.jsx(Ar,{children:d&&f.jsxs(Re.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},transition:{duration:.2},className:"mx-3 mb-2 p-3 rounded-lg flex items-start gap-2",style:{backgroundColor:v.getColor(k.ErrorBackground),borderColor:v.getColor(k.ErrorBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:v.getRadius()},children:[f.jsx(Z.XCircle,{className:"size-4 flex-shrink-0 mt-0.5",style:{color:v.getColor(k.ErrorText)}}),f.jsx("span",{className:"text-sm",style:{color:v.getColor(k.ErrorText)},children:d}),f.jsx("button",{type:"button",className:"ml-auto flex-shrink-0",onClick:u,style:{color:v.getColor(k.ErrorText)},children:f.jsx(Z.X,{className:"size-4"})})]})}),f.jsx(L6,{client_id:(p==null?void 0:p.client_id)||"",is_uploadable:e.is_customer_uploadable,messages:r,onNewMessage:q=>{i(q)},onEvaluateChat:o,onNewChat:a,onSendMessage:l,isHistoryMode:c,historyChat:c?ne.getState().historyChat:void 0})]})}function B6({rating:e,onChange:t}){const n=be();return f.jsx("div",{className:"flex items-center justify-center gap-0.5 my-2",children:[1,2,3,4,5].map(r=>{const i=r<=e,s=!i&&r-.5<=e;return f.jsxs(Re.div,{className:"relative w-8 h-8 cursor-pointer",whileHover:{scale:1.15},whileTap:{scale:.95},transition:{duration:.15},children:[f.jsx("svg",{className:"w-8 h-8",style:{color:n.getColor(k.StarInactiveColor),fill:n.getColor(k.StarInactiveColor)},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"})}),s&&f.jsx("div",{className:"absolute top-0 left-0 w-4 h-8 overflow-hidden",children:f.jsx("svg",{className:"w-8 h-8",style:{color:n.getColor(k.StarActiveColor),fill:n.getColor(k.StarActiveColor)},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"})})}),i&&f.jsx("svg",{className:"w-8 h-8 absolute top-0 left-0",style:{color:n.getColor(k.StarActiveColor),fill:n.getColor(k.StarActiveColor)},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"})}),f.jsxs("div",{className:"absolute inset-0 flex",children:[f.jsx("button",{type:"button",onClick:()=>t(r-.5),className:"w-1/2 h-full cursor-pointer focus:outline-none","aria-label":`${r-.5} stars`}),f.jsx("button",{type:"button",onClick:()=>t(r),className:"w-1/2 h-full cursor-pointer focus:outline-none","aria-label":`${r} stars`})]})]},r)})})}function z6({onOk:e}){const t=be(),n=us(),r=nd(),[i,s]=g.useState(0),[o,a]=g.useState(!1),[l,c]=g.useState(10),d=wM(),[u,p]=g.useState(!1);g.useEffect(()=>{if(o){const b=setInterval(()=>{c(m=>m<=1?(clearInterval(b),e(!0),0):m-1)},1e3);return()=>clearInterval(b)}},[o]);const h=sg({comment:tu()}),y=uC({init:{comment:""},schema:h,action:async b=>{const[m,v]=await d.mutateAsync({rating:i,comment:b.comment});if(zn(v)){a(!0);return}yo(m,{form:y})}}),w=()=>{e(!0)};return f.jsxs(Re.div,{className:"flex flex-col h-full",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:[f.jsxs("header",{className:"min-h-[48px] flex-shrink-0 overflow-visible flex justify-between items-center z-10 px-5 py-2.5",style:{borderColor:t.getColor(k.HeaderBorder),color:t.getColor(k.HeaderText)},children:[f.jsx("div",{className:"font-medium !text-sm",children:n(o?ie.RatingHeaderThanks:ie.RatingHeaderEvaluate)}),r&&f.jsx("button",{type:"button",onClick:()=>e(!1),className:"p-1.5 rounded-md hover:opacity-70 transition-opacity",style:{color:t.getColor(k.HeaderText)},children:f.jsx(Z.X,{className:"size-4"})})]}),f.jsx("div",{className:"flex-1 p-4 overflow-y-auto flex flex-col",children:o?f.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center",children:[f.jsx("div",{className:"mb-3",style:{color:t.getColor(k.SuccessText)},children:f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-12 w-12",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),f.jsx("h2",{className:"text-lg font-semibold mb-1.5",style:{color:t.getColor(k.HeaderText)},children:n(ie.RatingThankYouTitle)}),f.jsx("p",{className:"mb-6 text-sm",style:{color:t.getColor(k.FooterText)},children:n(ie.RatingThankYouDescription)}),f.jsx("p",{className:"mb-3 text-xs",style:{color:t.getColor(k.FooterText)},children:n(ie.RatingCountdown).replace("{seconds}",l.toString())}),f.jsx(Rt,{onClick:w,size:"md",className:"w-full max-w-xs",children:n(ie.RatingNewConversation)})]}):f.jsxs("div",{className:"flex flex-col",children:[f.jsx("div",{className:"text-center mb-4",children:f.jsx("p",{className:"text-sm",style:{color:t.getColor(k.FooterText)},children:n(ie.RatingDescription)})}),f.jsxs("div",{className:"mb-4",children:[f.jsx("h3",{className:"text-center font-medium mb-1.5 text-base",style:{color:t.getColor(k.RatingRateConversationText)},children:n(ie.RatingRateConversation)}),f.jsx(B6,{rating:i,onChange:b=>{s(b),b>=1&&p(!1)}}),i>0&&f.jsx("p",{className:"text-center text-xs mt-1",style:{color:t.getColor(k.FooterText)},children:n(ie.RatingYourScore).replace("{score}",Number.isInteger(i)?i.toString():i.toFixed(1))}),i>0&&i<1||u?f.jsx("p",{className:"text-center text-xs mt-1",style:{color:t.getColor(k.ErrorText)},children:n(ie.RatingMinimumError)}):null]}),f.jsxs("form",{onSubmit:y.handleSubmit,className:"space-y-4",children:[f.jsxs("div",{children:[f.jsx("label",{htmlFor:"comment",className:"block text-xs font-medium mb-1",style:{color:t.getColor(k.InputText)},children:n(ie.RatingComment)}),f.jsx(Ju,{id:"comment",onChange:y.handleChange,onBlur:y.handleBlur,value:y.values.comment,placeholder:n(ie.RatingCommentPlaceholder),className:"rounded-lg",error:y.errors.comment})]}),f.jsxs("div",{className:"flex flex-col gap-2 pt-1",children:[f.jsx(Rt,{type:"submit",size:"lg",onClick:b=>{i<1&&(b.preventDefault(),b.stopPropagation(),p(!0))},className:"w-full",children:n(ie.RatingSubmit)}),f.jsx(Rt,{onClick:w,size:"lg",variant:"secondary",kind:"subtle",className:"w-full",bgKey:k.GreeterBackground,textKey:k.GreeterText,children:n(ie.RatingNewConversation)})]})]})]})}),f.jsx(So,{variant:"block"})]})}function V6({onSendMessage:e,disabled:t,loading:n=!1}){const r=g.useRef(null),i=be(),s=us(),{setIsInputFocused:o}=ne(),[a,l]=g.useState(""),[c,d]=g.useState("3rem"),[u,p]=g.useState(!1),h=g.useRef(n);g.useEffect(()=>{h.current&&!n&&!t&&setTimeout(()=>{var b;(b=r.current)==null||b.focus()},100),h.current=n},[n,t]),g.useEffect(()=>{t&&p(!1)},[t]);const y=()=>{if(!a.trim()||t)return;const b=a;l(""),r.current&&(r.current.style.height="3rem",d("3rem")),e(b)},w=g.useCallback(b=>{if(t)return;const m=r.current;if(m){const v=m.selectionStart,x=m.selectionEnd,S=a.substring(0,v)+b+a.substring(x);S.length<=2e3&&(l(S),setTimeout(()=>{m.selectionStart=m.selectionEnd=v+b.length,m.focus()},0))}else{const v=a+b;v.length<=2e3&&l(v)}},[a,t]);return f.jsxs("form",{className:"flex flex-col relative",onSubmit:b=>{b.preventDefault(),y()},children:[f.jsx("div",{className:"mx-4 border-t",style:{borderColor:i.getColor(k.DividerColor)}}),f.jsxs("div",{className:"flex gap-2 px-3 py-1 w-full",children:[f.jsxs("div",{className:"flex-1 min-w-0 relative",children:[f.jsx(Ju,{id:"ai-message",inputRef:r,className:"grow",noMargin:!0,borderless:!0,autoComplete:"off",disabled:t,style:{height:c,maxHeight:"6rem",opacity:t?.5:1,cursor:t?"not-allowed":"text",boxShadow:"none"},placeholder:s(ie.MessagePlaceholder),value:a,maxLength:2e3,onFocus:()=>o(!0),onBlur:()=>o(!1),onChange:b=>{if(t)return;const m=b.target.value;if(m.length<=2e3&&l(m),m.length>0&&b.currentTarget.scrollHeight>b.currentTarget.clientHeight){const v=`${b.currentTarget.scrollHeight}px`;b.currentTarget.style.height=v,d(v)}else b.currentTarget.style.height="3rem",d("3rem")},onKeyDown:b=>{if(t){b.preventDefault();return}b.key==="Enter"&&!b.shiftKey&&(b.preventDefault(),y())}}),a.length>=500&&f.jsx("div",{className:"absolute bottom-2 right-3 text-xs pointer-events-none",style:{color:a.length>=2e3?i.getColor(k.ErrorText):i.getColor(k.FooterText),fontWeight:a.length>=2e3?"600":"normal"},children:2e3-a.length})]}),f.jsx("div",{className:"flex items-center gap-1 flex-shrink-0 pb-0.5",children:f.jsx(Re.div,{whileTap:{scale:.9},children:f.jsx(Rt,{className:"!bg-transparent rounded-full w-8 h-8 min-w-8 flex items-center justify-center transition-colors disabled:!opacity-100",type:"submit",size:"xs",withoutTheming:!0,disabled:t||!a.trim(),style:{opacity:1,backgroundColor:"transparent",color:a.trim()?i.getColor(k.ButtonBackground):i.getColor(k.FooterText)},children:n?f.jsx(Z.Spin,{className:"size-4 animate-spin"}):f.jsx(Z.PaperAirplane,{className:"size-5"})})})})]}),f.jsx(KC,{isOpen:u,onClose:()=>p(!1),onSelect:w}),f.jsxs("div",{className:"px-3 pb-1.5 flex items-center justify-between",children:[f.jsx("div",{className:"flex items-center gap-1",children:f.jsx("button",{type:"button",disabled:t,onClick:()=>!t&&p(!u),className:"p-1.5 rounded-md transition-colors disabled:opacity-50 disabled:cursor-not-allowed",style:{color:i.getColor(k.IconColor)},children:f.jsx(Z.Emoji,{className:"size-5"})})}),f.jsx(So,{variant:"inline"})]})]})}const ff=[Le.Light,Le.Dark,Le.System];function U6(e){switch(e){case Le.Light:return Z.Sun;case Le.Dark:return Z.Moon;case Le.System:return Z.Monitor;default:return Z.Monitor}}function H6({onChatClose:e}){const[t,n]=g.useState(!1),[r,i]=g.useState(!1),[s,o]=g.useState(()=>jC()),a=g.useRef(null),l=g.useRef(null),c=be(),d=us(),{mode:u,setMode:p}=c,h=()=>e(),y=()=>{const m=ff.indexOf(u),v=ff[(m+1)%ff.length];p(v)},w=()=>{const m=!s;RC(m),o(m)};g.useEffect(()=>{if(!r)return;const m=v=>{var x,S;(x=l.current)!=null&&x.contains(v.target)||(S=a.current)!=null&&S.contains(v.target)||i(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[r]);const b=r&&f.jsxs(Re.div,{ref:l,onMouseDown:m=>m.stopPropagation(),initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:"absolute right-0 top-full z-[9999] mt-1.5 py-1 min-w-[175px] rounded-lg shadow-lg !text-sm",style:{backgroundColor:c.getColor(k.Background),borderColor:c.getColor(k.Border),borderRadius:c.getRadius(),boxShadow:`0 4px 12px ${c.getColor(k.ShadowColor)}`},children:[f.jsxs("button",{type:"button",className:"w-full px-3 py-2 text-left text-sm flex items-center gap-2 rounded-t-lg hover:opacity-80 transition-opacity",style:{color:c.getColor(k.ErrorText)},onClick:()=>{i(!1),n(!0)},children:[f.jsx(Z.XCircle,{className:"size-4 flex-shrink-0"}),d(ie.ChatEndConversation)]}),f.jsxs("button",{type:"button",className:"w-full px-3 py-2 text-left text-sm flex items-center gap-2 hover:opacity-80 transition-opacity",style:{color:c.getColor(k.InputText)},onClick:w,children:[s?f.jsx(Z.VolumeX,{className:"size-4 flex-shrink-0"}):f.jsx(Z.Volume2,{className:"size-4 flex-shrink-0"}),d(s?ie.NotificationSoundOn:ie.NotificationSoundOff)]}),f.jsx("div",{className:"my-1 h-px",style:{backgroundColor:c.getColor(k.DividerColor)}}),f.jsxs("button",{type:"button",className:"w-full px-3 py-2 text-left text-sm flex items-center gap-2 rounded-b-lg hover:opacity-80 transition-opacity",style:{color:c.getColor(k.InputText)},onClick:y,children:[(()=>{const m=U6(u);return f.jsx(m,{className:"size-4 flex-shrink-0"})})(),u===Le.Light?"Açık tema":u===Le.Dark?"Koyu tema":"Sistem"]})]});return f.jsxs(f.Fragment,{children:[f.jsx(Ar,{children:t&&f.jsx(Re.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"absolute inset-0 z-50 flex items-center justify-center p-4",style:{backgroundColor:c.getColor(k.ModalOverlayColor)},children:f.jsxs(Re.div,{initial:{scale:.95,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.95,opacity:0},transition:{duration:.2},className:"p-5 rounded-xl shadow-lg max-w-xs w-full",style:{backgroundColor:c.getColor(k.Background),borderRadius:c.getRadius()},children:[f.jsx("div",{className:"text-base font-semibold mb-2",style:{color:c.getColor(k.ChatCloseConfirmText)},children:d(ie.ChatCloseConfirm)}),f.jsx("div",{className:"text-sm mb-4",style:{color:c.getColor(k.FooterText)},children:d(ie.ChatCloseWarning)}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-lg transition-opacity hover:opacity-90",style:{backgroundColor:c.getColor(k.GreeterBackground),color:c.getColor(k.GreeterText),borderRadius:c.getRadius()},onClick:()=>n(!1),children:d(ie.CancelAction)}),f.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-lg transition-opacity hover:opacity-90",style:{backgroundColor:c.getColor(k.ErrorBackground),color:c.getColor(k.ErrorText),borderRadius:c.getRadius()},onClick:h,children:d(ie.CloseAction)})]})]})})}),f.jsxs("div",{className:"relative flex-shrink-0",children:[f.jsx("button",{ref:a,type:"button",onClick:()=>i(m=>!m),className:"flex items-center justify-center p-1.5 rounded-md hover:opacity-80 transition-opacity",style:{backgroundColor:"transparent",color:c.getColor(k.HeaderText)},title:d(ie.ChatSettings),"aria-expanded":r,children:f.jsx(Z.Menu,{className:"size-5"})}),f.jsx(Ar,{children:b})]})]})}function W6({onOperatorConnected:e,onChatClose:t}){var ue,ke,Ne;const{widget:n,setOpen:r,aiAgent:i,aiAgentMessages:s,addAIAgentMessage:o,setAIAgentMessages:a,aiAgentSessionId:l,setAIAgentSessionId:c,humanNeedRequested:d,setHumanNeedRequested:u,setIsAIAgentMode:p}=ne(),h=be(),y=Do(),w=nd(),b=dr(),m=vs(),[v,x]=g.useState(!1),[S,C]=g.useState(!1),[_,j]=g.useState(!1),[A,E]=g.useState(!1),[D,L]=g.useState(""),[O,q]=g.useState(!1),[$,B]=g.useState(0),[I,N]=g.useState(null),R=()=>{r(!1)},z=()=>{u(!1),t()},H=(((Ne=(ke=(ue=n==null?void 0:n.appearance)==null?void 0:ue.body)==null?void 0:ke.inputs)==null?void 0:Ne.length)||0)>0,W=g.useRef(!1),G=g.useRef(!1);g.useEffect(()=>{if(!i||W.current)return;if(s.length>0){W.current=!0;return}if(!b||!b.connected){const P=setInterval(()=>{b&&b.connected&&(clearInterval(P),Q())},100),K=setTimeout(()=>{clearInterval(P),W.current||V()},3e3);return()=>{clearInterval(P),clearTimeout(K)}}Q();function Q(){W.current||!b||(W.current=!0,b.emit(He.MessageList,{},P=>{Array.isArray(P)&&P.length>0?a(P):V()}))}function V(){if(!i)return;const P={id:Vp(),content:`Merhaba! Ben ${i.name}. Size nasıl yardımcı olabilirim?`,created_at:new Date,files:[],sender_type:ve.User};o(P)}},[b,i,s.length,a,o]),g.useEffect(()=>{if(v)if(D)C(!0);else{const Q=setTimeout(()=>C(!0),1e3);return()=>clearTimeout(Q)}else C(!1)},[v,D]),g.useEffect(()=>{if($>0){const Q=requestAnimationFrame(()=>B(0));return()=>cancelAnimationFrame(Q)}},[$]),g.useEffect(()=>{if(!b)return;const Q=({token:Y})=>{L(me=>me+Y)},V=Y=>{Y!=null&&Y.human_need&&u(!0)},P=Y=>{Y.repeat_count===3&&N(Y.message)},K=()=>{t()};return b.on(ge.AgentMessageChunk,Q),b.on(ge.AgentMessageFinalMetadata,V),b.on(ge.AgentSpamWarning,P),b.on(ge.AgentSpamBanned,K),()=>{b.off(ge.AgentMessageChunk,Q),b.off(ge.AgentMessageFinalMetadata,V),b.off(ge.AgentSpamWarning,P),b.off(ge.AgentSpamBanned,K)}},[b,u,t]);const te=g.useCallback(Q=>{if(!n||!i||!b||d||_||G.current)return;G.current=!0;const V=`temp-${Date.now()}`,P={id:V,content:Q,created_at:new Date,files:[],sender_type:ve.Customer};o(P),L(""),q(!0),x(!0),j(!0);const K=l||Rr(n.link_id);b.emit(He.AgentMessageCreate,{question:Q,agent_id:i.id,session_id:K},Y=>{if(G.current=!1,q(!1),L(""),x(!1),j(!1),!Y){const me={id:Vp(),content:"Üzgünüm, bir hata oluştu. Lütfen tekrar deneyin veya canlı destek personelimıze bağlanın.",created_at:new Date,files:[],sender_type:ve.System};a(re=>re.filter(Ee=>Ee.id!==V).concat([me])),u(!0);return}Y.session_id&&c(Y.session_id),o(Y.agent_message),Y.human_need&&u(!0)})},[n,i,d,_,b,l,o,a,c,u]),se=g.useCallback(Q=>{if(!b||A)return;E(!0);const V=()=>{b.emit(He.AgentRequestHuman,{},P=>{E(!1),P!=null&&P.success?(ne.getState().setIsHaveChat(!0),p(!1),u(!1),ne.getState().clearAIAgentState(),e()):console.error("Failed to request human operator")})};Q&&Object.keys(Q).length>0?b.emit(He.ChatUpdateInputs,{inputs:Q},P=>{P!=null&&P.success?V():(console.error("Failed to update chat inputs"),E(!1))}):V()},[b,A,p,u,e]),pe=()=>{H?m.push("registration"):se()};return i?f.jsxs("div",{className:"flex flex-col h-full min-h-0 flex-1 w-full",children:[f.jsxs("header",{className:"px-4 py-3 flex items-center justify-between flex-shrink-0 overflow-visible min-h-[52px]",style:{backgroundColor:h.getColor(k.HeaderBackground),color:h.getColor(k.HeaderText),borderColor:h.getColor(k.HeaderBorder),...y?{}:{borderTopLeftRadius:h.getRadius(),borderTopRightRadius:h.getRadius()}},children:[f.jsx("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:f.jsx(ph,{name:i.name,avatar:i.avatar,textColor:h.getColor(k.HeaderText),subtitle:"AI Asistan"})}),f.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[f.jsx(H6,{onChatClose:z}),w&&f.jsx("button",{type:"button",onClick:R,className:"p-1 hover:opacity-80 transition-opacity",children:f.jsx(Z.X,{className:"w-5 h-5 cursor-pointer"})})]})]}),f.jsxs("div",{className:"flex flex-col flex-1 min-h-0 w-full overflow-hidden",children:[f.jsx(MC,{messages:s,isTyping:S||v&&!!D,streamingContent:O?D:void 0,skipAnimationForLastN:$}),f.jsx(Ar,{children:I&&f.jsxs(Re.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},transition:{duration:.2},className:"mx-3 mb-2 p-3 rounded-lg flex items-start gap-2 flex-shrink-0",style:{backgroundColor:h.getColor(k.ErrorBackground),borderColor:h.getColor(k.ErrorBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:h.getRadius()},children:[f.jsx(Z.XCircle,{className:"size-4 flex-shrink-0 mt-0.5",style:{color:h.getColor(k.ErrorText)}}),f.jsx("span",{className:"text-sm",style:{color:h.getColor(k.ErrorText)},children:I}),f.jsx("button",{type:"button",className:"ml-auto flex-shrink-0",onClick:()=>N(null),style:{color:h.getColor(k.ErrorText)},children:f.jsx(Z.X,{className:"size-4"})})]})}),d?f.jsx(Re.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},className:"flex-shrink-0 w-full flex flex-col items-stretch justify-center px-4 pt-8 pb-10",style:{backgroundColor:h.getColor(k.Background)},children:f.jsx(Re.div,{className:"relative w-full max-w-lg mx-auto overflow-hidden",style:{borderRadius:h.getRadius()},animate:{filter:["brightness(1)","brightness(1.1)","brightness(1)"]},transition:{duration:2.5,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"},children:f.jsx(Rt,{onClick:pe,disabled:A,size:"lg",className:"w-full flex items-center justify-center gap-2",children:A?f.jsx("span",{className:"animate-pulse",children:"Bağlanıyor..."}):f.jsxs(f.Fragment,{children:[f.jsx(Z.User,{className:"w-5 h-5"}),f.jsx("span",{children:"Canlı Desteğe Bağlan"})]})})})}):f.jsx(V6,{onSendMessage:te,disabled:_,loading:_})]})]}):null}function q6({children:e}){const{widget:t}=ne();return t?f.jsx("section",{className:"h-full w-full relative",children:e}):null}function G6({children:e}){const t=dr(),n=vs(),{historyChat:r,isAIAgentMode:i,aiAgent:s}=ne(),[o,a]=g.useState(!0),[l,c]=g.useState(!1),d=g.useRef(!1);return g.useEffect(()=>{if(r){a(!1);return}if(!t){a(!1);return}const u=()=>{a(!1),c(!1),d.current=!0},p=()=>{i&&s||(c(!0),n.push("registration"))};return t.on(ge.Connect,u),t.on(ge.Disconnect,p),t.connected?(a(!1),d.current=!0):t.connect(),()=>{t.off(ge.Connect,u),t.off(ge.Disconnect,p)}},[t,r,i,s,n]),i&&s||r?e:!t||l?(t||n.push("registration"),f.jsx(oh,{})):d.current&&!t.connected?f.jsx(oh,{}):o||!t.connected?f.jsx(AC,{}):e}function Bx(e,t){const n=new Map;for(const r of t)r!=null&&r.id&&n.set(r.id,r);for(const r of e)r!=null&&r.id&&!n.has(r.id)&&n.set(r.id,r);return Array.from(n.values()).sort((r,i)=>new Date(r.created_at).getTime()-new Date(i.created_at).getTime())}function Y6(){const e=P=>{if(!P||typeof P!="object")return!1;const K=String((P==null?void 0:P.error)||(P==null?void 0:P.message)||"").toLowerCase(),Y=Number((P==null?void 0:P.status)||(P==null?void 0:P.statusCode)||0);return(P==null?void 0:P.retryAfter)!==void 0||Y===429||/too\s+many|rate\s*limit|çok\s+fazla/.test(K)},t=P=>{const K=Number((P==null?void 0:P.retryAfter)??(P==null?void 0:P.seconds));return Number.isFinite(K)&&K>0?K:3},{widget:n,setOpen:r,setIsHaveChat:i,historyChat:s,setHistoryChat:o,historyMessages:a,setHistoryMessages:l,aiAgent:c,isAIAgentMode:d,clearAIAgentState:u}=ne(),p=be(),h=dr(),{connected:y,connectionReady:w}=h,b=fl(),m=vs(),v=Do(),[x,S]=g.useState(null),[C,_]=g.useState([]),[j,A]=g.useState(!1),[E,D]=g.useState([]),[L,O]=g.useState(!1),q=Jm(),$=g.useRef(!1),B=g.useRef(null),I=g.useRef(!1),[N,R]=g.useState(!1),[z,H]=g.useState(null);g.useEffect(()=>{console.log("WS: ChatDetailView socket state:",{connected:y,connectionReady:w,hasChat:!!x,chatViewEmitted:$.current})},[y,w,x]),g.useEffect(()=>{if(x||s||d){R(!1);return}const P=setTimeout(()=>{!x&&!s&&!d&&(console.warn("WS: Connection timeout reached in ChatDetailView"),R(!0))},1e4);return()=>clearTimeout(P)},[x,s,d]),g.useEffect(()=>{if(!s||!n)return;if(S({status:s.status,is_customer_uploadable:!1}),a){_(a);return}const P=Rr(n.link_id);_M(s._id,n.link_id,P).then(([K,Y])=>{if(zn(Y)&&Array.isArray(K)){const me=K.map(re=>({id:re._id,content:re.content,created_at:re.created_at,files:re.files,sender_type:re.sender_type,activity_type:re.activity_type,answers:re.answers,reply_id:re.reply_id,buttons:re.buttons}));_(me),l(me)}}).catch(K=>{console.error("Failed to load history messages",K)})},[s,n,a,l]),g.useEffect(()=>{if(!n||d||s)return;const P=mr(n.link_id);P.isAgentMode&&P.agent&&(console.log("ChatDetailView: Recovering AI Agent state from localStorage"),ne.getState().setAIAgent(P.agent),ne.getState().setIsAIAgentMode(!0),P.sessionId&&ne.getState().setAIAgentSessionId(P.sessionId),P.humanNeedRequested&&ne.getState().setHumanNeedRequested(!0))},[n,d,s]);const W=async(P,K)=>{var $t;if(!n)return;if(!s){const oe=`temp-${Date.now()}`,ye={id:oe,content:P,created_at:new Date,files:K||[],sender_type:ve.Customer,answers:[],reply_id:void 0,buttons:[]};_(Oe=>[...Oe,ye]),h==null||h.emit(He.MessageCreate,{content:P,files:K},Oe=>{const M=Array.isArray(Oe)?Oe[0]:Oe;if(M&&M.isError){_(F=>F.filter(U=>U.id!==oe));const J=e(M);J||yo(M),J&&typeof window<"u"&&window.dispatchEvent(new CustomEvent("lc:rate-limit",{detail:{seconds:t(M)}}));return}_(J=>J.map(F=>F.id===oe?M:F))});return}const Y={},me=n.appearance;if(($t=me==null?void 0:me.body)!=null&&$t.inputs){for(const oe of me.body.inputs)if(oe.required||oe.remember){const ye=Qs(oe.name);ye&&(Y[oe.name]=ye)}}const re=ne.getState().defaultValues;if(re){re.username&&(Y.username=re.username),re.secret_data&&(Y.secret_data=re.secret_data);for(const oe in re)Y[oe]||(Y[oe]=re[oe])}const[Ee,ot]=await q.mutateAsync({inputs:Y,history:[],client_id:n.client_id,widget_id:n.link_id,device_id:Rr(n.link_id)});if(zn(ot)){o(null),i(!0),Ee&&typeof Ee=="object"&&"customer_token"in Ee&&(Fn(rt.CustomerToken,Ee.customer_token,n.link_id),Fn(rt.CustomerRefreshToken,Ee.customer_refresh_token,n.link_id));let oe=0;const ye=20,Oe=`temp-${Date.now()}`,M={id:Oe,content:P,created_at:new Date,files:K||[],sender_type:ve.Customer,answers:[],reply_id:void 0,buttons:[]};_(F=>[...F,M]);const J=setInterval(()=>{oe+=1,h!=null&&h.connected?(h.emit(He.MessageCreate,{content:P,files:K},F=>{const U=Array.isArray(F)?F[0]:F;if(U&&U.isError){_(de=>de.filter(Se=>Se.id!==Oe));const ae=e(U);ae||yo(U),ae&&typeof window<"u"&&window.dispatchEvent(new CustomEvent("lc:rate-limit",{detail:{seconds:t(U)}}));return}_(ae=>ae.map(de=>de.id===Oe?U:de))}),clearInterval(J)):oe>=ye&&clearInterval(J)},200)}},G=P=>{!P&&!v&&r(!1),O(!0),ya((n==null?void 0:n.link_id)||""),i(!1),S(null),_([]),D([]),o(null),ne.getState().setHistoryMessages(null),ne.getState().setShowHistoryOnRegistration(!1),u(),dc(n.client_id,Qi(Yi(b),n.link_id)).then(()=>{h==null||h.disconnect(),m.push("registration")})},te=()=>{x?(localStorage.setItem("showActionButtons","false"),S({...x,status:tn.Closed})):G(!1)};g.useEffect(()=>{if(h&&!(d&&c)){if(s){$.current=!1,I.current=!1;return}if(!y||!w){y||(I.current=!1,$.current=!1,B.current=null);return}I.current=!0,!(!n||$.current)&&($.current=!0,console.log("ChatView: Emitting chat:view request"),h.emit(He.ChatView,{},P=>{if(console.log("ChatView: Received response",{chatReceived:P!==null,chatStatus:P==null?void 0:P.status,hasAgentName:!!(P!=null&&P.agent_name),hasError:P&&"error"in P}),ne.getState().historyChat){$.current=!1;return}if(P===null||P&&"error"in P||!(P!=null&&P.status)){console.log("ChatView returned invalid chat (null, error, or missing status), cleaning up and redirecting to registration",{chat:P}),r(!1),i(!1),dc(n.client_id,Qi(Yi(b),n.link_id)),_([]),D([]),o(null),ne.getState().setHistoryMessages(null),u(),ya((n==null?void 0:n.link_id)||""),h.disconnect(),m.push("registration"),$.current=!1;return}console.log("ChatView: Setting chat state",{status:P.status}),S(vx(P)),i(!0)}))}},[s,h,n,y,w,b,m,r,i,o,d,c,u]);const se=()=>{te()},pe=()=>{G(!0)},[ue,ke]=g.useState(!1),Ne=g.useCallback(()=>{console.log("handleOperatorConnected: Starting operator connection flow"),$.current=!1,B.current=null,I.current=!1;const P=ne.getState().aiAgentMessages;P.length>0&&_(P),ke(!0)},[]);g.useEffect(()=>{if(ue){if(!h||!y||!w){console.log("handleOperatorConnected: Waiting for socket connection...",{connected:y,connectionReady:w});return}if(console.log("handleOperatorConnected: Socket ready, fetching chat view"),$.current){ke(!1);return}$.current=!0,h.emit(He.ChatView,{},P=>{console.log("handleOperatorConnected: ChatView result",P),P&&!("error"in P)&&P.status?(S(vx(P)),i(!0),h.emit(He.MessageList,{},Y=>{console.log("handleOperatorConnected: MessageList result",Y),Array.isArray(Y)&&_(me=>Bx(me,Y))})):(console.log("handleOperatorConnected: Invalid chat result, clearing state",P),i(!1)),ke(!1)})}},[ue,h,y,w,i]);const Q=()=>{u(),v||r(!1),O(!0),ya((n==null?void 0:n.link_id)||""),i(!1),S(null),_([]),D([]),o(null),ne.getState().setHistoryMessages(null),ne.getState().setShowHistoryOnRegistration(!1),dc(n.client_id,Qi(Yi(b),n.link_id)).then(()=>{h==null||h.disconnect(),m.push("registration")})},V=g.useCallback(P=>{if(d&&c&&!s){const{aiAgentMessages:K,addAIAgentMessage:Y}=ne.getState();if(K.some(me=>me.id===P.id))return;Y(P);return}x&&![tn.Closed,tn.Deleted].includes(x.status)&&_(K=>{const Y=K.filter(re=>{var Ee;return!((Ee=re.id)!=null&&Ee.startsWith("temp-")&&re.content===P.content)});return Y.some(re=>re.id===P.id)?Y:[...Y,P]})},[x,d,c,s]);return g.useEffect(()=>{if(!h)return;const P=oe=>{const ye={content:oe.content,created_at:oe.created_at,files:oe.files,id:oe._id,sender_type:oe.sender_type,answers:oe.answers,reply_id:oe.reply_id,buttons:oe.buttons};if(E.length>0){D(Oe=>[...Oe,ye]);return}oe.is_shortcut?D([ye]):V(ye),A(!1)},K=oe=>{const ye={content:oe.content,created_at:oe.created_at,files:oe.files,id:oe._id,sender_type:oe.sender_type,activity_type:oe.activity_type,sender_name:oe.sender_name,answers:oe.answers,reply_id:oe.reply_id,buttons:oe.buttons};V(ye)},Y=oe=>{!oe||!oe.name?S(ye=>ye?{...ye,agent_name:void 0,agent_avatar:void 0,participants:[]}:null):S(ye=>{if(!ye)return null;const Oe=vF(ye.participants,{profile_id:oe.id,name:oe.name,avatar:oe.avatar}),M=ia(Oe);return{...ye,participants:Oe,...M}})},me=()=>{A(!0)},re=()=>{te()},Ee=({is_customer_uploadable:oe})=>{S(ye=>ye?{...ye,is_customer_uploadable:oe}:null)},ot=oe=>{S(ye=>{if(!ye)return null;const Oe=ah(ye.participants,{profile_id:oe.profile_id});if(!oe.hasOtherAdmins||Oe.length===0)return{...ye,participants:[],agent_name:void 0,agent_avatar:void 0};const M=ia(Oe);return{...ye,participants:Oe,...M}})},$t=oe=>{S(ye=>{if(!ye)return null;const Oe=gF(ye.participants,{profile_id:oe.profile_id,name:oe.name,avatar:oe.avatar}),M=ia(Oe);return{...ye,participants:Oe,...M}})};return h.on(ge.MessageAgentCreate,P),h.on(ge.MessageUserCreate,K),h.on(ge.MessageCustomerCreate,K),h.on(ge.ChatUserAssignee,Y),h.on(ge.MessageAgentTyping,me),h.on(ge.ChatUserClose,re),h.on(ge.ChatToggleUpload,Ee),h.on(ge.ChatUserLeave,ot),h.on(ge.ChatUserJoin,$t),()=>{h.off(ge.MessageAgentCreate,P),h.off(ge.MessageUserCreate,K),h.off(ge.MessageCustomerCreate,K),h.off(ge.ChatUserAssignee,Y),h.off(ge.MessageAgentTyping,me),h.off(ge.ChatUserClose,re),h.off(ge.ChatToggleUpload,Ee),h.off(ge.ChatUserLeave,ot),h.off(ge.ChatUserJoin,$t)}},[V,E]),g.useEffect(()=>{if(!h)return;const P=Y=>{Y.repeat_count===3&&H(Y.message)},K=()=>{h.emit(He.ChatClose,{}),ne.getState().setShowActionButtons(!1),te()};return h.on(ge.AgentSpamWarning,P),h.on(ge.AgentSpamBanned,K),()=>{h.off(ge.AgentSpamWarning,P),h.off(ge.AgentSpamBanned,K)}},[h,te]),g.useEffect(()=>{if(!h||!x||s){B.current=null;return}const P=`${x.status}-${x.agent_name||"no-agent"}`;B.current!==P&&(B.current=P,h.emit(He.MessageList,{},K=>{if(!Array.isArray(K)){console.warn("MessageList response is not an array:",K),B.current=null;return}_(Y=>Bx(Y,K)),S(Y=>{if(!Y)return null;const me=yF(K),re=me.length>0?me:Y.participants&&Y.participants.length>0?Y.participants:Cg(Y.agent_name,Y.agent_avatar),Ee=ia(re);return{...Y,participants:re,...Ee}})}))},[h,x,s]),g.useEffect(()=>{const P=setTimeout(()=>{A(!1)},2e3);return()=>clearTimeout(P)},[j]),g.useEffect(()=>{if(!n||E.length===0)return;let P=0;n.writing_timeout&&(P=[...E[0].content].length/n.writing_timeout,P<0&&(P=0));const K=setTimeout(()=>{V(E[0]),D(E.slice(1))},P*1e3);return()=>clearTimeout(K)},[E,n]),L?f.jsx(oh,{}):d&&c&&!s?f.jsxs(f.Fragment,{children:[f.jsx("div",{id:"chat-alert-portal"}),f.jsx("div",{className:`h-full w-full ${v?"":"rounded-xl"} shadow-sm flex flex-col overflow-hidden`,style:{height:v?"100%":"",minHeight:v?"var(--app-height, 100dvh)":"",maxHeight:v?"var(--app-height, 100dvh)":"",backgroundColor:p.getColor(k.Background)},children:f.jsx(W6,{onOperatorConnected:Ne,onChatClose:Q})})]}):f.jsxs(f.Fragment,{children:[f.jsx("div",{id:"chat-alert-portal"}),f.jsx("div",{className:`h-full w-full ${v?"":"rounded-xl"} shadow-sm flex flex-col overflow-hidden`,style:{height:v?"100%":"",minHeight:v?"var(--app-height, 100dvh)":"",maxHeight:v?"var(--app-height, 100dvh)":"",backgroundColor:p.getColor(k.Background)},children:x?x.status===tn.Closed&&!s?f.jsx(z6,{onOk:G}):f.jsx($6,{chat:x,isTyping:j,messages:C,shortcutMessages:E,onNewMessage:V,onChatClose:te,onEvaluateChat:se,onNewChat:pe,onSendMessage:W,isHistoryMode:!!s,spamWarningMessage:z,onDismissSpamWarning:()=>H(null)}):N?f.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-6 text-center",children:[f.jsx("div",{className:"w-12 h-12 rounded-full flex items-center justify-center mb-4",style:{backgroundColor:p.getColor(k.InputBorder)},children:f.jsx(Z.XCircle,{className:"w-6 h-6 opacity-50"})}),f.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Bağlantı Kurulamadı"}),f.jsx("p",{className:"text-sm opacity-60 mb-6",children:"Sunucuyla bağlantı sağlanırken bir sorun oluştu. Lütfen tekrar deneyin."}),f.jsx("button",{type:"button",onClick:()=>G(!0),className:"px-6 py-2 rounded-lg font-medium transition-all",style:{backgroundColor:p.getColor(k.ButtonBackground),color:p.getColor(k.ButtonText),borderRadius:p.getRadius()},children:"Tekrar Dene"})]}):f.jsx(AC,{})})]})}function Q6(){return sF(),null}function K6(){return f.jsxs(G6,{children:[f.jsx(q6,{children:f.jsx(Y6,{})}),f.jsx(Q6,{})]})}const X6=[{path:"/chat",component:K6,name:"chat"}],XC=[...X6],ZC=[...cF],Z6=[...XC,...ZC];function hh({text:e}){var c,d,u,p;const{widget:t,isHaveChat:n,isTooltipVisible:r,setIsTooltipVisible:i,onTooltipClose:s}=ne(),o=be(),a=us(),l=()=>{i(!1),s&&s()};return r?f.jsxs(Re.div,{initial:{opacity:0,scale:.8,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.8,y:10},transition:{type:"spring",damping:20,stiffness:300},className:Ie("absolute bottom-full mb-3 p-3 shadow-lg whitespace-nowrap","w-auto right-0"),style:{borderRadius:o.getRadius(),backgroundColor:o.getColor(k.TooltipBackground),color:o.getColor(k.TooltipText)},children:[f.jsx("button",{onClick:l,className:"absolute top-2 right-2 p-1 rounded-full hover:bg-black/10 transition-colors","aria-label":a(ie.CloseButtonAria),children:f.jsx(Z.X,{className:"size-3"})}),f.jsx(Re.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.1,duration:.3},className:"text-sm font-medium pr-5",style:{color:o.getColor(k.TooltipText)},children:e||(n?(d=(c=t==null?void 0:t.appearance)==null?void 0:c.design)==null?void 0:d.tooltip_message_active:(p=(u=t==null?void 0:t.appearance)==null?void 0:u.design)==null?void 0:p.tooltip_message)||a(n?ie.TooltipActive:ie.TooltipDefault)}),f.jsx("div",{className:"absolute bottom-0 right-4 w-3 h-3 transform rotate-45 translate-y-1.5",style:{backgroundColor:o.getColor(k.TooltipBackground)}})]},"widget-tooltip"):null}function zx({fallback:e,fallbackOpen:t}){const[n]=g.useState(window.document.title),r=dr(),{isHaveChat:i,open:s,soundPath:o}=ne(),[a,l]=g.useState(!0),[c,d]=g.useState(0),[u,p]=g.useState(null),h=us(),y=()=>{bF(o)},w=(b,m)=>{if(u&&clearInterval(u),b||!i||m===0||Number.isNaN(m)){window.document.title=n,p(null);return}const v=setInterval(()=>{if(b||!i||m===0||Number.isNaN(m)){window.document.title=n,clearInterval(v),p(null);return}const x=`${m} ${h(ie.NewMessagesNotification)} - ${n}`;window.document.title!==x?window.document.title=x:window.document.title=n},1e3);return p(v),()=>{clearInterval(v),p(null)}};return g.useEffect(()=>w(s&&a,c),[c,s,a]),g.useEffect(()=>{const b=()=>{l(document.visibilityState==="visible")};return document.addEventListener("visibilitychange",b,!1),()=>{document.removeEventListener("visibilitychange",b)}},[]),g.useEffect(()=>{if(i&&s&&a&&d(0),!r||!i||s&&a)return;const b=()=>{!i||s&&a||(d(m=>m+1),y())};return r.on(ge.MessageAgentCreate,b),r.on(ge.ChatUserAssignee,y),()=>{r.off(ge.MessageAgentCreate,b),r.off(ge.ChatUserAssignee,y)}},[r,i,s,a]),s?null:i&&c>0?f.jsx(hh,{text:h(ie.NewMessagesNotification)}):!i&&t?e:null}function J6({children:e,border:t}){var N,R,z,H;const n=dr(),{open:r,setOpen:i,setIsHaveChat:s,isHaveChat:o,widget:a,onOpen:l,onClose:c,humanNeedRequested:d}=ne(),[u]=g.useState(!0),p=vs(),h=fl(),y=vm(),w=be(),{resolvedMode:b}=w,m=Do(),v=rF(),[x,S]=g.useState({x:0,y:0}),C=PP(),_=g.useRef(null),j=g.useRef(null),[A,E]=g.useState(!1),[D,L]=g.useState(!1);g.useEffect(()=>((()=>{E("ontouchstart"in window||navigator.maxTouchPoints>0)})(),window.addEventListener("touchstart",()=>{E(!0)},{once:!0}),()=>{window.removeEventListener("touchstart",()=>{E(!0)})}),[]),g.useEffect(()=>{o&&y.pathname==="/"&&h&&h.accessToken&&!d&&p.push("chat")},[o,y.pathname,h,p,d]),g.useEffect(()=>{r?requestAnimationFrame(()=>{L(!0)}):L(!1)},[r]);const O=W=>{if(!_.current||!j.current)return W;const G=_.current.getBoundingClientRect(),te={width:window.innerWidth,height:window.innerHeight},se={top:20,right:20,bottom:40,left:20};let pe=W.x,ue=W.y;return G.right+pe-x.x>te.width-se.right&&(pe=te.width-se.right-G.width-(G.left-x.x)),G.left+pe-x.x<se.left&&(pe=se.left-(G.left-x.x)),G.bottom+ue-x.y>te.height-se.bottom&&(ue=te.height-se.bottom-G.height-(G.top-x.y)),G.top+ue-x.y<se.top&&(ue=se.top-(G.top-x.y)),{x:pe,y:ue}},q=()=>{i(!0),n&&(n.emit(He.WidgetOpen,{}),l&&l())},$=()=>{i(!1),n&&(n.emit(He.WidgetClose,{}),c&&c())},B=()=>{i(!1),s(!1),dc(a.client_id,Qi(Yi(h),a.link_id)),p.push("registration")};g.useEffect(()=>{if(m&&(o||v)&&q(),!(!n||!a))return n.on(ge.Banned,B),()=>{n.off(ge.Banned,B)}},[]);function I(W){A&&C.start(W)}return f.jsxs("section",{className:"relative w-full h-full",ref:j,"data-theme":b,children:[r&&f.jsx("div",{className:Ie("fixed z-300 overflow-hidden transition-all duration-300 ease-out",{"":t&&!m,"bottom-24 right-8 rounded-xl":!m,"!bottom-0 !right-0":m,"opacity-100 scale-100 translate-y-0":D,"opacity-0 scale-95 translate-y-2":!D}),style:{width:m?"100%":((R=(N=a==null?void 0:a.appearance)==null?void 0:N.design)==null?void 0:R.width)||"21rem",height:m?"var(--app-height, 100dvh)":((H=(z=a==null?void 0:a.appearance)==null?void 0:z.design)==null?void 0:H.height)||"30rem",left:m?"0":"",right:m?"0px !important":"",maxHeight:m?"var(--app-height, 100dvh)":"",boxShadow:m?"":`0 10px 25px -5px ${w.getColor(k.ShadowColor)}, 0 8px 10px -6px ${w.getColor(k.ShadowColor)}`,backgroundColor:w.getColor(k.Background)},children:e}),!A&&f.jsxs("div",{className:"fixed bottom-[40px] right-[20px] z-400",children:[f.jsx(zx,{fallback:f.jsx(hh,{}),fallbackOpen:u}),!r&&f.jsxs(Rt,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"lg",rounded:!0,className:"relative",onClick:q,children:[f.jsx(Re.span,{initial:{scale:.8,opacity:0},animate:{scale:[1,1.2,1],opacity:[.7,0,.7]},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,repeatType:"loop"},className:Ie("absolute -z-10 w-full h-full rounded-full opacity-30"),style:{backgroundColor:w.getColor(k.ButtonBackground)}}),f.jsx(Z.Chat,{className:"size-6"})]},"desktop-open-button"),r&&!m&&f.jsx(Rt,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"lg",rounded:!0,onClick:$,children:f.jsx(Z.ArrowDown2,{className:"size-6"})},"desktop-close-button")]}),A&&f.jsxs(Re.div,{ref:_,className:"fixed z-400 bottom-24 right-5",initial:{bottom:"96px",right:"20px"},animate:{x:x.x,y:x.y},drag:A,dragControls:C,dragMomentum:!1,dragElastic:0,onDragEnd:(W,G)=>{const te={x:x.x+G.offset.x,y:x.y+G.offset.y},se=O(te);S(se)},children:[f.jsx(zx,{fallback:f.jsx(hh,{}),fallbackOpen:u}),!r&&f.jsx("div",{className:"cursor-move",onPointerDown:I,children:f.jsxs(Rt,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"lg",rounded:!0,className:"relative",onClick:q,children:[f.jsx(Re.span,{initial:{scale:.8,opacity:0},animate:{scale:[1,1.2,1],opacity:[.7,0,.7]},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,repeatType:"loop"},className:Ie("absolute -z-10 w-full h-full rounded-full opacity-30"),style:{backgroundColor:w.getColor(k.ButtonBackground)}}),f.jsx(Z.Chat,{className:"size-6"})]})},"chat-button"),r&&!m&&f.jsx(Rt,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"lg",rounded:!0,onClick:$,children:f.jsx(Z.ArrowDown2,{className:"size-6"})},"desktop-close-button")]})]})}function e$(e){const{widget:t}=ne();return f.jsx(VP,{widget:t,children:f.jsx(J6,{...e})})}function t$(){const{isHaveChat:e,isAIAgentMode:t}=ne();return f.jsx(vA,{initialEntries:[e||t?"/chat":"/"],future:{v7_startTransition:!0},children:f.jsx(e$,{border:!0,children:f.jsxs(xA,{children:[XC.map((n,r)=>f.jsx(xp,{path:n.path,element:f.jsx(n.component,{})},r)),ZC.map((n,r)=>f.jsx(xp,{path:n.path,element:f.jsx(n.component,{})},r))]})})})}const n$=g.forwardRef((e,t)=>{const n=localStorage.getItem("lc:device:id"),{data:r,isLoading:i,error:s}=kE(e.link_id,n||void 0),{widget:o,setWidget:a,setSoundPath:l,setDefaultValues:c,setOpen:d,setOnTooltipClose:u,setIsTooltipVisible:p,setOnOpen:h,setOnClose:y,onOpen:w,onClose:b}=ne();return g.useImperativeHandle(t,()=>({open:()=>{d(!0),w&&w()},close:()=>{d(!1),b&&b()}})),g.useEffect(()=>{r&&CE(r)&&a(r),e.soundPath&&l(e.soundPath),e.defaultValues&&c(e.defaultValues),e.onTooltipClose&&u(e.onTooltipClose),e.showTooltip===!1&&p(!1),e.onOpen&&h(e.onOpen),e.onClose&&y(e.onClose)},[r,e.soundPath,e.defaultValues,e.onTooltipClose,e.showTooltip,e.onOpen,e.onClose]),i?f.jsx("div",{children:"Loading..."}):s||!r||!o?null:f.jsx(GI,{children:f.jsx(nF,{children:f.jsx(t$,{})})})}),r$=new sE;let Vx=null;function i$(e){if(!e.container)return;const t=ee.createRef();return Vx=fb(e.container),Vx.render(f.jsxs(uE,{client:r$,children:[f.jsx(n$,{...e,ref:t}),f.jsx(GA,{richColors:!0,style:{zIndex:999999,position:"fixed",bottom:"20px",right:"20px"},position:"bottom-right"})]})),{open:()=>{var n;return(n=t.current)==null?void 0:n.open()},close:()=>{var n;return(n=t.current)==null?void 0:n.close()},identify:n=>{if(!e.link_id)return;const r=Rr(e.link_id);SM({widget_id:e.link_id,device_id:r,decrypted_data:n})}}}window.widget=i$});export default s$();
|