@alfatech/livechat 2026.5.1-8.1 → 2026.6.0-9.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/ChatierHeaderMark.js +44 -0
- package/dist/main.css +1 -1
- package/dist/main.js +27 -70
- package/dist/preview.html +14 -0
- package/dist/preview.js +1 -0
- package/package.json +1 -1
- package/public/widget-manifest.json +16 -2
package/dist/main.js
CHANGED
|
@@ -1,43 +1,4 @@
|
|
|
1
|
-
var Bg=e=>{throw TypeError(e)};var w2=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var ud=(e,t,n)=>t.has(e)||Bg("Cannot "+n);var A=(e,t,n)=>(ud(e,t,"read from private field"),n?n.call(e):t.get(e)),we=(e,t,n)=>t.has(e)?Bg("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),le=(e,t,n,r)=>(ud(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Ee=(e,t,n)=>(ud(e,t,"access private method"),n);var Cl=(e,t,n,r)=>({set _(i){le(e,t,i,n)},get _(){return A(e,t,r)}});var W8=w2((cn,un)=>{function b2(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 Sh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var f1={exports:{}},hu={},p1={exports:{}},je={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var ll=Symbol.for("react.element"),C2=Symbol.for("react.portal"),S2=Symbol.for("react.fragment"),k2=Symbol.for("react.strict_mode"),_2=Symbol.for("react.profiler"),T2=Symbol.for("react.provider"),E2=Symbol.for("react.context"),A2=Symbol.for("react.forward_ref"),j2=Symbol.for("react.suspense"),R2=Symbol.for("react.memo"),M2=Symbol.for("react.lazy"),$g=Symbol.iterator;function P2(e){return e===null||typeof e!="object"?null:(e=$g&&e[$g]||e["@@iterator"],typeof e=="function"?e:null)}var h1={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m1=Object.assign,g1={};function Ro(e,t,n){this.props=e,this.context=t,this.refs=g1,this.updater=n||h1}Ro.prototype.isReactComponent={};Ro.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")};Ro.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function v1(){}v1.prototype=Ro.prototype;function kh(e,t,n){this.props=e,this.context=t,this.refs=g1,this.updater=n||h1}var _h=kh.prototype=new v1;_h.constructor=kh;m1(_h,Ro.prototype);_h.isPureReactComponent=!0;var zg=Array.isArray,y1=Object.prototype.hasOwnProperty,Th={current:null},x1={key:!0,ref:!0,__self:!0,__source:!0};function w1(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)y1.call(t,r)&&!x1.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:ll,type:e,key:s,ref:o,props:i,_owner:Th.current}}function N2(e,t){return{$$typeof:ll,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Eh(e){return typeof e=="object"&&e!==null&&e.$$typeof===ll}function O2(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Vg=/\/+/g;function dd(e,t){return typeof e=="object"&&e!==null&&e.key!=null?O2(""+e.key):t.toString(36)}function ec(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 ll:case C2:o=!0}}if(o)return o=e,i=i(o),e=r===""?"."+dd(o,0):r,zg(i)?(n="",e!=null&&(n=e.replace(Vg,"$&/")+"/"),ec(i,t,n,"",function(c){return c})):i!=null&&(Eh(i)&&(i=N2(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(Vg,"$&/")+"/")+e)),t.push(i)),1;if(o=0,r=r===""?".":r+":",zg(e))for(var a=0;a<e.length;a++){s=e[a];var l=r+dd(s,a);o+=ec(s,t,n,l,i)}else if(l=P2(e),typeof l=="function")for(e=l.call(e),a=0;!(s=e.next()).done;)s=s.value,l=r+dd(s,a++),o+=ec(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 Sl(e,t,n){if(e==null)return e;var r=[],i=0;return ec(e,r,"","",function(s){return t.call(n,s,i++)}),r}function D2(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 Ut={current:null},tc={transition:null},I2={ReactCurrentDispatcher:Ut,ReactCurrentBatchConfig:tc,ReactCurrentOwner:Th};function b1(){throw Error("act(...) is not supported in production builds of React.")}je.Children={map:Sl,forEach:function(e,t,n){Sl(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Sl(e,function(){t++}),t},toArray:function(e){return Sl(e,function(t){return t})||[]},only:function(e){if(!Eh(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};je.Component=Ro;je.Fragment=S2;je.Profiler=_2;je.PureComponent=kh;je.StrictMode=k2;je.Suspense=j2;je.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=I2;je.act=b1;je.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=m1({},e.props),i=e.key,s=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,o=Th.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)y1.call(t,l)&&!x1.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:ll,type:e.type,key:i,ref:s,props:r,_owner:o}};je.createContext=function(e){return e={$$typeof:E2,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:T2,_context:e},e.Consumer=e};je.createElement=w1;je.createFactory=function(e){var t=w1.bind(null,e);return t.type=e,t};je.createRef=function(){return{current:null}};je.forwardRef=function(e){return{$$typeof:A2,render:e}};je.isValidElement=Eh;je.lazy=function(e){return{$$typeof:M2,_payload:{_status:-1,_result:e},_init:D2}};je.memo=function(e,t){return{$$typeof:R2,type:e,compare:t===void 0?null:t}};je.startTransition=function(e){var t=tc.transition;tc.transition={};try{e()}finally{tc.transition=t}};je.unstable_act=b1;je.useCallback=function(e,t){return Ut.current.useCallback(e,t)};je.useContext=function(e){return Ut.current.useContext(e)};je.useDebugValue=function(){};je.useDeferredValue=function(e){return Ut.current.useDeferredValue(e)};je.useEffect=function(e,t){return Ut.current.useEffect(e,t)};je.useId=function(){return Ut.current.useId()};je.useImperativeHandle=function(e,t,n){return Ut.current.useImperativeHandle(e,t,n)};je.useInsertionEffect=function(e,t){return Ut.current.useInsertionEffect(e,t)};je.useLayoutEffect=function(e,t){return Ut.current.useLayoutEffect(e,t)};je.useMemo=function(e,t){return Ut.current.useMemo(e,t)};je.useReducer=function(e,t,n){return Ut.current.useReducer(e,t,n)};je.useRef=function(e){return Ut.current.useRef(e)};je.useState=function(e){return Ut.current.useState(e)};je.useSyncExternalStore=function(e,t,n){return Ut.current.useSyncExternalStore(e,t,n)};je.useTransition=function(){return Ut.current.useTransition()};je.version="18.3.1";p1.exports=je;var v=p1.exports;const ie=Fr(v),L2=b2({__proto__:null,default:ie},[v]);/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.production.min.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var F2=v,B2=Symbol.for("react.element"),$2=Symbol.for("react.fragment"),z2=Object.prototype.hasOwnProperty,V2=F2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,U2={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)z2.call(t,r)&&!U2.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:B2,type:e,key:s,ref:o,props:i,_owner:V2.current}}hu.Fragment=$2;hu.jsx=C1;hu.jsxs=C1;f1.exports=hu;var f=f1.exports,S1={exports:{}},pn={},k1={exports:{}},_1={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.min.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/(function(e){function t(_,B){var V=_.length;_.push(B);e:for(;0<V;){var G=V-1>>>1,W=_[G];if(0<i(W,B))_[G]=B,_[V]=W,V=G;else break e}}function n(_){return _.length===0?null:_[0]}function r(_){if(_.length===0)return null;var B=_[0],V=_.pop();if(V!==B){_[0]=V;e:for(var G=0,W=_.length,ee=W>>>1;G<ee;){var ue=2*(G+1)-1,me=_[ue],pe=ue+1,Se=_[pe];if(0>i(me,V))pe<W&&0>i(Se,me)?(_[G]=Se,_[pe]=V,G=pe):(_[G]=me,_[ue]=V,G=ue);else if(pe<W&&0>i(Se,V))_[G]=Se,_[pe]=V,G=pe;else break e}}return B}function i(_,B){var V=_.sortIndex-B.sortIndex;return V!==0?V:_.id-B.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,b=!1,C=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(_){for(var B=n(c);B!==null;){if(B.callback===null)r(c);else if(B.startTime<=_)r(c),B.sortIndex=B.expirationTime,t(l,B);else break;B=n(c)}}function S(_){if(b=!1,w(_),!y)if(n(l)!==null)y=!0,I(T);else{var B=n(c);B!==null&&F(S,B.startTime-_)}}function T(_,B){y=!1,b&&(b=!1,g(M),M=-1),h=!0;var V=p;try{for(w(B),u=n(l);u!==null&&(!(u.expirationTime>B)||_&&!N());){var G=u.callback;if(typeof G=="function"){u.callback=null,p=u.priorityLevel;var W=G(u.expirationTime<=B);B=e.unstable_now(),typeof W=="function"?u.callback=W:u===n(l)&&r(l),w(B)}else r(l);u=n(l)}if(u!==null)var ee=!0;else{var ue=n(c);ue!==null&&F(S,ue.startTime-B),ee=!1}return ee}finally{u=null,p=V,h=!1}}var k=!1,E=null,M=-1,U=5,j=-1;function N(){return!(e.unstable_now()-j<U)}function O(){if(E!==null){var _=e.unstable_now();j=_;var B=!0;try{B=E(!0,_)}finally{B?z():(k=!1,E=null)}}else k=!1}var z;if(typeof m=="function")z=function(){m(O)};else if(typeof MessageChannel<"u"){var L=new MessageChannel,D=L.port2;L.port1.onmessage=O,z=function(){D.postMessage(null)}}else z=function(){C(O,0)};function I(_){E=_,k||(k=!0,z())}function F(_,B){M=C(function(){_(e.unstable_now())},B)}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(_){_.callback=null},e.unstable_continueExecution=function(){y||h||(y=!0,I(T))},e.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(_){switch(p){case 1:case 2:case 3:var B=3;break;default:B=p}var V=p;p=B;try{return _()}finally{p=V}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(_,B){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var V=p;p=_;try{return B()}finally{p=V}},e.unstable_scheduleCallback=function(_,B,V){var G=e.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?G+V:G):V=G,_){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=V+W,_={id:d++,callback:B,priorityLevel:_,startTime:V,expirationTime:W,sortIndex:-1},V>G?(_.sortIndex=V,t(c,_),n(l)===null&&_===n(c)&&(b?(g(M),M=-1):b=!0,F(S,V-G))):(_.sortIndex=W,t(l,_),y||h||(y=!0,I(T))),_},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(_){var B=p;return function(){var V=p;p=B;try{return _.apply(this,arguments)}finally{p=V}}}})(_1);k1.exports=_1;var H2=k1.exports;/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.min.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var W2=v,fn=H2;function K(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 T1=new Set,Ta={};function ps(e,t){mo(e,t),mo(e+"Capture",t)}function mo(e,t){for(Ta[e]=t,e=0;e<t.length;e++)T1.add(t[e])}var Mr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),bf=Object.prototype.hasOwnProperty,q2=/^[: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]*$/,Ug={},Hg={};function G2(e){return bf.call(Hg,e)?!0:bf.call(Ug,e)?!1:q2.test(e)?Hg[e]=!0:(Ug[e]=!0,!1)}function Y2(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 Q2(e,t,n,r){if(t===null||typeof t>"u"||Y2(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 Ht(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 Et={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Et[e]=new Ht(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Et[t]=new Ht(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Et[e]=new Ht(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Et[e]=new Ht(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){Et[e]=new Ht(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Et[e]=new Ht(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Et[e]=new Ht(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Et[e]=new Ht(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Et[e]=new Ht(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ah=/[\-:]([a-z])/g;function jh(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(Ah,jh);Et[t]=new Ht(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(Ah,jh);Et[t]=new Ht(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(Ah,jh);Et[t]=new Ht(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Et[e]=new Ht(e,1,!1,e.toLowerCase(),null,!1,!1)});Et.xlinkHref=new Ht("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Et[e]=new Ht(e,1,!1,e.toLowerCase(),null,!0,!0)});function Rh(e,t,n,r){var i=Et.hasOwnProperty(t)?Et[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Q2(t,n,i,r)&&(n=null),r||i===null?G2(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 Br=W2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,kl=Symbol.for("react.element"),As=Symbol.for("react.portal"),js=Symbol.for("react.fragment"),Mh=Symbol.for("react.strict_mode"),Cf=Symbol.for("react.profiler"),E1=Symbol.for("react.provider"),A1=Symbol.for("react.context"),Ph=Symbol.for("react.forward_ref"),Sf=Symbol.for("react.suspense"),kf=Symbol.for("react.suspense_list"),Nh=Symbol.for("react.memo"),Wr=Symbol.for("react.lazy"),j1=Symbol.for("react.offscreen"),Wg=Symbol.iterator;function zo(e){return e===null||typeof e!="object"?null:(e=Wg&&e[Wg]||e["@@iterator"],typeof e=="function"?e:null)}var nt=Object.assign,fd;function Jo(e){if(fd===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);fd=t&&t[1]||""}return`
|
|
34
|
-
`+fd+e}var pd=!1;function hd(e,t){if(!e||pd)return"";pd=!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
|
-
`),s=r.stack.split(`
|
|
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{pd=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Jo(e):""}function K2(e){switch(e.tag){case 5:return Jo(e.type);case 16:return Jo("Lazy");case 13:return Jo("Suspense");case 19:return Jo("SuspenseList");case 0:case 2:case 15:return e=hd(e.type,!1),e;case 11:return e=hd(e.type.render,!1),e;case 1:return e=hd(e.type,!0),e;default:return""}}function _f(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 js:return"Fragment";case As:return"Portal";case Cf:return"Profiler";case Mh:return"StrictMode";case Sf:return"Suspense";case kf:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case A1:return(e.displayName||"Context")+".Consumer";case E1:return(e._context.displayName||"Context")+".Provider";case Ph:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Nh:return t=e.displayName||null,t!==null?t:_f(e.type)||"Memo";case Wr:t=e._payload,e=e._init;try{return _f(e(t))}catch{}}return null}function X2(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 _f(t);case 8:return t===Mh?"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 xi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function R1(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Z2(e){var t=R1(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 _l(e){e._valueTracker||(e._valueTracker=Z2(e))}function M1(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=R1(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function kc(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 Tf(e,t){var n=t.checked;return nt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function qg(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=xi(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 P1(e,t){t=t.checked,t!=null&&Rh(e,"checked",t,!1)}function Ef(e,t){P1(e,t);var n=xi(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")?Af(e,t.type,n):t.hasOwnProperty("defaultValue")&&Af(e,t.type,xi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Gg(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 Af(e,t,n){(t!=="number"||kc(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var ea=Array.isArray;function Gs(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=""+xi(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 jf(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(K(91));return nt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Yg(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(K(92));if(ea(n)){if(1<n.length)throw Error(K(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:xi(n)}}function N1(e,t){var n=xi(t.value),r=xi(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 Qg(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function O1(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 Rf(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?O1(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Tl,D1=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(Tl=Tl||document.createElement("div"),Tl.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Tl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ea(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ua={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},J2=["Webkit","ms","Moz","O"];Object.keys(ua).forEach(function(e){J2.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ua[t]=ua[e]})});function I1(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ua.hasOwnProperty(e)&&ua[e]?(""+t).trim():t+"px"}function L1(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=I1(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var e_=nt({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 Mf(e,t){if(t){if(e_[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(K(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(K(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(K(61))}if(t.style!=null&&typeof t.style!="object")throw Error(K(62))}}function Pf(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 Nf=null;function Oh(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Of=null,Ys=null,Qs=null;function Kg(e){if(e=dl(e)){if(typeof Of!="function")throw Error(K(280));var t=e.stateNode;t&&(t=xu(t),Of(e.stateNode,e.type,t))}}function F1(e){Ys?Qs?Qs.push(e):Qs=[e]:Ys=e}function B1(){if(Ys){var e=Ys,t=Qs;if(Qs=Ys=null,Kg(e),t)for(e=0;e<t.length;e++)Kg(t[e])}}function $1(e,t){return e(t)}function z1(){}var md=!1;function V1(e,t,n){if(md)return e(t,n);md=!0;try{return $1(e,t,n)}finally{md=!1,(Ys!==null||Qs!==null)&&(z1(),B1())}}function Aa(e,t){var n=e.stateNode;if(n===null)return null;var r=xu(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(K(231,t,typeof n));return n}var Df=!1;if(Mr)try{var Vo={};Object.defineProperty(Vo,"passive",{get:function(){Df=!0}}),window.addEventListener("test",Vo,Vo),window.removeEventListener("test",Vo,Vo)}catch{Df=!1}function t_(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 da=!1,_c=null,Tc=!1,If=null,n_={onError:function(e){da=!0,_c=e}};function r_(e,t,n,r,i,s,o,a,l){da=!1,_c=null,t_.apply(n_,arguments)}function i_(e,t,n,r,i,s,o,a,l){if(r_.apply(this,arguments),da){if(da){var c=_c;da=!1,_c=null}else throw Error(K(198));Tc||(Tc=!0,If=c)}}function hs(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 U1(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 Xg(e){if(hs(e)!==e)throw Error(K(188))}function s_(e){var t=e.alternate;if(!t){if(t=hs(e),t===null)throw Error(K(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 Xg(i),e;if(s===r)return Xg(i),t;s=s.sibling}throw Error(K(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(K(189))}}if(n.alternate!==r)throw Error(K(190))}if(n.tag!==3)throw Error(K(188));return n.stateNode.current===n?e:t}function H1(e){return e=s_(e),e!==null?W1(e):null}function W1(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=W1(e);if(t!==null)return t;e=e.sibling}return null}var q1=fn.unstable_scheduleCallback,Zg=fn.unstable_cancelCallback,o_=fn.unstable_shouldYield,a_=fn.unstable_requestPaint,ut=fn.unstable_now,l_=fn.unstable_getCurrentPriorityLevel,Dh=fn.unstable_ImmediatePriority,G1=fn.unstable_UserBlockingPriority,Ec=fn.unstable_NormalPriority,c_=fn.unstable_LowPriority,Y1=fn.unstable_IdlePriority,mu=null,lr=null;function u_(e){if(lr&&typeof lr.onCommitFiberRoot=="function")try{lr.onCommitFiberRoot(mu,e,void 0,(e.current.flags&128)===128)}catch{}}var qn=Math.clz32?Math.clz32:p_,d_=Math.log,f_=Math.LN2;function p_(e){return e>>>=0,e===0?32:31-(d_(e)/f_|0)|0}var El=64,Al=4194304;function ta(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 Ac(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=ta(a):(s&=o,s!==0&&(r=ta(s)))}else o=n&~i,o!==0?r=ta(o):s!==0&&(r=ta(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-qn(t),i=1<<n,r|=e[n],t&=~i;return r}function h_(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 m_(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var o=31-qn(s),a=1<<o,l=i[o];l===-1?(!(a&n)||a&r)&&(i[o]=h_(a,t)):l<=t&&(e.expiredLanes|=a),s&=~a}}function Lf(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Q1(){var e=El;return El<<=1,!(El&4194240)&&(El=64),e}function gd(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function cl(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-qn(t),e[t]=n}function g_(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-qn(n),s=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~s}}function Ih(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-qn(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Le=0;function K1(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var X1,Lh,Z1,J1,ew,Ff=!1,jl=[],ci=null,ui=null,di=null,ja=new Map,Ra=new Map,Yr=[],v_="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 Jg(e,t){switch(e){case"focusin":case"focusout":ci=null;break;case"dragenter":case"dragleave":ui=null;break;case"mouseover":case"mouseout":di=null;break;case"pointerover":case"pointerout":ja.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ra.delete(t.pointerId)}}function Uo(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=dl(t),t!==null&&Lh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function y_(e,t,n,r,i){switch(t){case"focusin":return ci=Uo(ci,e,t,n,r,i),!0;case"dragenter":return ui=Uo(ui,e,t,n,r,i),!0;case"mouseover":return di=Uo(di,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return ja.set(s,Uo(ja.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,Ra.set(s,Uo(Ra.get(s)||null,e,t,n,r,i)),!0}return!1}function tw(e){var t=Fi(e.target);if(t!==null){var n=hs(t);if(n!==null){if(t=n.tag,t===13){if(t=U1(n),t!==null){e.blockedOn=t,ew(e.priority,function(){Z1(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 nc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Bf(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Nf=r,n.target.dispatchEvent(r),Nf=null}else return t=dl(n),t!==null&&Lh(t),e.blockedOn=n,!1;t.shift()}return!0}function e0(e,t,n){nc(e)&&n.delete(t)}function x_(){Ff=!1,ci!==null&&nc(ci)&&(ci=null),ui!==null&&nc(ui)&&(ui=null),di!==null&&nc(di)&&(di=null),ja.forEach(e0),Ra.forEach(e0)}function Ho(e,t){e.blockedOn===t&&(e.blockedOn=null,Ff||(Ff=!0,fn.unstable_scheduleCallback(fn.unstable_NormalPriority,x_)))}function Ma(e){function t(i){return Ho(i,e)}if(0<jl.length){Ho(jl[0],e);for(var n=1;n<jl.length;n++){var r=jl[n];r.blockedOn===e&&(r.blockedOn=null)}}for(ci!==null&&Ho(ci,e),ui!==null&&Ho(ui,e),di!==null&&Ho(di,e),ja.forEach(t),Ra.forEach(t),n=0;n<Yr.length;n++)r=Yr[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Yr.length&&(n=Yr[0],n.blockedOn===null);)tw(n),n.blockedOn===null&&Yr.shift()}var Ks=Br.ReactCurrentBatchConfig,jc=!0;function w_(e,t,n,r){var i=Le,s=Ks.transition;Ks.transition=null;try{Le=1,Fh(e,t,n,r)}finally{Le=i,Ks.transition=s}}function b_(e,t,n,r){var i=Le,s=Ks.transition;Ks.transition=null;try{Le=4,Fh(e,t,n,r)}finally{Le=i,Ks.transition=s}}function Fh(e,t,n,r){if(jc){var i=Bf(e,t,n,r);if(i===null)Td(e,t,r,Rc,n),Jg(e,r);else if(y_(i,e,t,n,r))r.stopPropagation();else if(Jg(e,r),t&4&&-1<v_.indexOf(e)){for(;i!==null;){var s=dl(i);if(s!==null&&X1(s),s=Bf(e,t,n,r),s===null&&Td(e,t,r,Rc,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else Td(e,t,r,null,n)}}var Rc=null;function Bf(e,t,n,r){if(Rc=null,e=Oh(r),e=Fi(e),e!==null)if(t=hs(e),t===null)e=null;else if(n=t.tag,n===13){if(e=U1(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 Rc=e,null}function nw(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(l_()){case Dh:return 1;case G1:return 4;case Ec:case c_:return 16;case Y1:return 536870912;default:return 16}default:return 16}}var oi=null,Bh=null,rc=null;function rw(){if(rc)return rc;var e,t=Bh,n=t.length,r,i="value"in oi?oi.value:oi.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 rc=i.slice(e,1<r?1-r:void 0)}function ic(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 Rl(){return!0}function t0(){return!1}function hn(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)?Rl:t0,this.isPropagationStopped=t0,this}return nt(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=Rl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Rl)},persist:function(){},isPersistent:Rl}),t}var Mo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$h=hn(Mo),ul=nt({},Mo,{view:0,detail:0}),C_=hn(ul),vd,yd,Wo,gu=nt({},ul,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zh,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!==Wo&&(Wo&&e.type==="mousemove"?(vd=e.screenX-Wo.screenX,yd=e.screenY-Wo.screenY):yd=vd=0,Wo=e),vd)},movementY:function(e){return"movementY"in e?e.movementY:yd}}),n0=hn(gu),S_=nt({},gu,{dataTransfer:0}),k_=hn(S_),__=nt({},ul,{relatedTarget:0}),xd=hn(__),T_=nt({},Mo,{animationName:0,elapsedTime:0,pseudoElement:0}),E_=hn(T_),A_=nt({},Mo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),j_=hn(A_),R_=nt({},Mo,{data:0}),r0=hn(R_),M_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},P_={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"},N_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function O_(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=N_[e])?!!t[e]:!1}function zh(){return O_}var D_=nt({},ul,{key:function(e){if(e.key){var t=M_[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ic(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?P_[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zh,charCode:function(e){return e.type==="keypress"?ic(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ic(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),I_=hn(D_),L_=nt({},gu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),i0=hn(L_),F_=nt({},ul,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zh}),B_=hn(F_),$_=nt({},Mo,{propertyName:0,elapsedTime:0,pseudoElement:0}),z_=hn($_),V_=nt({},gu,{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}),U_=hn(V_),H_=[9,13,27,32],Vh=Mr&&"CompositionEvent"in window,fa=null;Mr&&"documentMode"in document&&(fa=document.documentMode);var W_=Mr&&"TextEvent"in window&&!fa,iw=Mr&&(!Vh||fa&&8<fa&&11>=fa),s0=" ",o0=!1;function sw(e,t){switch(e){case"keyup":return H_.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ow(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Rs=!1;function q_(e,t){switch(e){case"compositionend":return ow(t);case"keypress":return t.which!==32?null:(o0=!0,s0);case"textInput":return e=t.data,e===s0&&o0?null:e;default:return null}}function G_(e,t){if(Rs)return e==="compositionend"||!Vh&&sw(e,t)?(e=rw(),rc=Bh=oi=null,Rs=!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 iw&&t.locale!=="ko"?null:t.data;default:return null}}var Y_={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 a0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Y_[e.type]:t==="textarea"}function aw(e,t,n,r){F1(r),t=Mc(t,"onChange"),0<t.length&&(n=new $h("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var pa=null,Pa=null;function Q_(e){yw(e,0)}function vu(e){var t=Ns(e);if(M1(t))return e}function K_(e,t){if(e==="change")return t}var lw=!1;if(Mr){var wd;if(Mr){var bd="oninput"in document;if(!bd){var l0=document.createElement("div");l0.setAttribute("oninput","return;"),bd=typeof l0.oninput=="function"}wd=bd}else wd=!1;lw=wd&&(!document.documentMode||9<document.documentMode)}function c0(){pa&&(pa.detachEvent("onpropertychange",cw),Pa=pa=null)}function cw(e){if(e.propertyName==="value"&&vu(Pa)){var t=[];aw(t,Pa,e,Oh(e)),V1(Q_,t)}}function X_(e,t,n){e==="focusin"?(c0(),pa=t,Pa=n,pa.attachEvent("onpropertychange",cw)):e==="focusout"&&c0()}function Z_(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return vu(Pa)}function J_(e,t){if(e==="click")return vu(t)}function eT(e,t){if(e==="input"||e==="change")return vu(t)}function tT(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Qn=typeof Object.is=="function"?Object.is:tT;function Na(e,t){if(Qn(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(!bf.call(t,i)||!Qn(e[i],t[i]))return!1}return!0}function u0(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function d0(e,t){var n=u0(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=u0(n)}}function uw(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?uw(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function dw(){for(var e=window,t=kc();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=kc(e.document)}return t}function Uh(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 nT(e){var t=dw(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&uw(n.ownerDocument.documentElement,n)){if(r!==null&&Uh(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=d0(n,s);var o=d0(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 rT=Mr&&"documentMode"in document&&11>=document.documentMode,Ms=null,$f=null,ha=null,zf=!1;function f0(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;zf||Ms==null||Ms!==kc(r)||(r=Ms,"selectionStart"in r&&Uh(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}),ha&&Na(ha,r)||(ha=r,r=Mc($f,"onSelect"),0<r.length&&(t=new $h("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Ms)))}function Ml(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ps={animationend:Ml("Animation","AnimationEnd"),animationiteration:Ml("Animation","AnimationIteration"),animationstart:Ml("Animation","AnimationStart"),transitionend:Ml("Transition","TransitionEnd")},Cd={},fw={};Mr&&(fw=document.createElement("div").style,"AnimationEvent"in window||(delete Ps.animationend.animation,delete Ps.animationiteration.animation,delete Ps.animationstart.animation),"TransitionEvent"in window||delete Ps.transitionend.transition);function yu(e){if(Cd[e])return Cd[e];if(!Ps[e])return e;var t=Ps[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in fw)return Cd[e]=t[n];return e}var pw=yu("animationend"),hw=yu("animationiteration"),mw=yu("animationstart"),gw=yu("transitionend"),vw=new Map,p0="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 ki(e,t){vw.set(e,t),ps(t,[e])}for(var Sd=0;Sd<p0.length;Sd++){var kd=p0[Sd],iT=kd.toLowerCase(),sT=kd[0].toUpperCase()+kd.slice(1);ki(iT,"on"+sT)}ki(pw,"onAnimationEnd");ki(hw,"onAnimationIteration");ki(mw,"onAnimationStart");ki("dblclick","onDoubleClick");ki("focusin","onFocus");ki("focusout","onBlur");ki(gw,"onTransitionEnd");mo("onMouseEnter",["mouseout","mouseover"]);mo("onMouseLeave",["mouseout","mouseover"]);mo("onPointerEnter",["pointerout","pointerover"]);mo("onPointerLeave",["pointerout","pointerover"]);ps("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ps("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ps("onBeforeInput",["compositionend","keypress","textInput","paste"]);ps("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ps("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ps("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var na="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(" "),oT=new Set("cancel close invalid load scroll toggle".split(" ").concat(na));function h0(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,i_(r,t,void 0,e),e.currentTarget=null}function yw(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;h0(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;h0(i,a,c),s=l}}}if(Tc)throw e=If,Tc=!1,If=null,e}function We(e,t){var n=t[qf];n===void 0&&(n=t[qf]=new Set);var r=e+"__bubble";n.has(r)||(xw(t,e,2,!1),n.add(r))}function _d(e,t,n){var r=0;t&&(r|=4),xw(n,e,r,t)}var Pl="_reactListening"+Math.random().toString(36).slice(2);function Oa(e){if(!e[Pl]){e[Pl]=!0,T1.forEach(function(n){n!=="selectionchange"&&(oT.has(n)||_d(n,!1,e),_d(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Pl]||(t[Pl]=!0,_d("selectionchange",!1,t))}}function xw(e,t,n,r){switch(nw(t)){case 1:var i=w_;break;case 4:i=b_;break;default:i=Fh}n=i.bind(null,t,n,e),i=void 0,!Df||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 Td(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=Fi(a),o===null)return;if(l=o.tag,l===5||l===6){r=s=o;continue e}a=a.parentNode}}r=r.return}V1(function(){var c=s,d=Oh(n),u=[];e:{var p=vw.get(e);if(p!==void 0){var h=$h,y=e;switch(e){case"keypress":if(ic(n)===0)break e;case"keydown":case"keyup":h=I_;break;case"focusin":y="focus",h=xd;break;case"focusout":y="blur",h=xd;break;case"beforeblur":case"afterblur":h=xd;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=n0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=k_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=B_;break;case pw:case hw:case mw:h=E_;break;case gw:h=z_;break;case"scroll":h=C_;break;case"wheel":h=U_;break;case"copy":case"cut":case"paste":h=j_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=i0}var b=(t&4)!==0,C=!b&&e==="scroll",g=b?p!==null?p+"Capture":null:p;b=[];for(var m=c,w;m!==null;){w=m;var S=w.stateNode;if(w.tag===5&&S!==null&&(w=S,g!==null&&(S=Aa(m,g),S!=null&&b.push(Da(m,S,w)))),C)break;m=m.return}0<b.length&&(p=new h(p,y,null,n,d),u.push({event:p,listeners:b}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",p&&n!==Nf&&(y=n.relatedTarget||n.fromElement)&&(Fi(y)||y[Pr]))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?Fi(y):null,y!==null&&(C=hs(y),y!==C||y.tag!==5&&y.tag!==6)&&(y=null)):(h=null,y=c),h!==y)){if(b=n0,S="onMouseLeave",g="onMouseEnter",m="mouse",(e==="pointerout"||e==="pointerover")&&(b=i0,S="onPointerLeave",g="onPointerEnter",m="pointer"),C=h==null?p:Ns(h),w=y==null?p:Ns(y),p=new b(S,m+"leave",h,n,d),p.target=C,p.relatedTarget=w,S=null,Fi(d)===c&&(b=new b(g,m+"enter",y,n,d),b.target=w,b.relatedTarget=C,S=b),C=S,h&&y)t:{for(b=h,g=y,m=0,w=b;w;w=Ts(w))m++;for(w=0,S=g;S;S=Ts(S))w++;for(;0<m-w;)b=Ts(b),m--;for(;0<w-m;)g=Ts(g),w--;for(;m--;){if(b===g||g!==null&&b===g.alternate)break t;b=Ts(b),g=Ts(g)}b=null}else b=null;h!==null&&m0(u,p,h,b,!1),y!==null&&C!==null&&m0(u,C,y,b,!0)}}e:{if(p=c?Ns(c):window,h=p.nodeName&&p.nodeName.toLowerCase(),h==="select"||h==="input"&&p.type==="file")var T=K_;else if(a0(p))if(lw)T=eT;else{T=Z_;var k=X_}else(h=p.nodeName)&&h.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(T=J_);if(T&&(T=T(e,c))){aw(u,T,n,d);break e}k&&k(e,p,c),e==="focusout"&&(k=p._wrapperState)&&k.controlled&&p.type==="number"&&Af(p,"number",p.value)}switch(k=c?Ns(c):window,e){case"focusin":(a0(k)||k.contentEditable==="true")&&(Ms=k,$f=c,ha=null);break;case"focusout":ha=$f=Ms=null;break;case"mousedown":zf=!0;break;case"contextmenu":case"mouseup":case"dragend":zf=!1,f0(u,n,d);break;case"selectionchange":if(rT)break;case"keydown":case"keyup":f0(u,n,d)}var E;if(Vh)e:{switch(e){case"compositionstart":var M="onCompositionStart";break e;case"compositionend":M="onCompositionEnd";break e;case"compositionupdate":M="onCompositionUpdate";break e}M=void 0}else Rs?sw(e,n)&&(M="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(M="onCompositionStart");M&&(iw&&n.locale!=="ko"&&(Rs||M!=="onCompositionStart"?M==="onCompositionEnd"&&Rs&&(E=rw()):(oi=d,Bh="value"in oi?oi.value:oi.textContent,Rs=!0)),k=Mc(c,M),0<k.length&&(M=new r0(M,e,null,n,d),u.push({event:M,listeners:k}),E?M.data=E:(E=ow(n),E!==null&&(M.data=E)))),(E=W_?q_(e,n):G_(e,n))&&(c=Mc(c,"onBeforeInput"),0<c.length&&(d=new r0("onBeforeInput","beforeinput",null,n,d),u.push({event:d,listeners:c}),d.data=E))}yw(u,t)})}function Da(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Mc(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=Aa(e,n),s!=null&&r.unshift(Da(e,s,i)),s=Aa(e,t),s!=null&&r.push(Da(e,s,i))),e=e.return}return r}function Ts(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function m0(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=Aa(n,s),l!=null&&o.unshift(Da(n,l,a))):i||(l=Aa(n,s),l!=null&&o.push(Da(n,l,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var aT=/\r\n?/g,lT=/\u0000|\uFFFD/g;function g0(e){return(typeof e=="string"?e:""+e).replace(aT,`
|
|
38
|
-
`).replace(lT,"")}function Nl(e,t,n){if(t=g0(t),g0(e)!==t&&n)throw Error(K(425))}function Pc(){}var Vf=null,Uf=null;function Hf(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 Wf=typeof setTimeout=="function"?setTimeout:void 0,cT=typeof clearTimeout=="function"?clearTimeout:void 0,v0=typeof Promise=="function"?Promise:void 0,uT=typeof queueMicrotask=="function"?queueMicrotask:typeof v0<"u"?function(e){return v0.resolve(null).then(e).catch(dT)}:Wf;function dT(e){setTimeout(function(){throw e})}function Ed(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),Ma(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Ma(t)}function fi(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 y0(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 Po=Math.random().toString(36).slice(2),ar="__reactFiber$"+Po,Ia="__reactProps$"+Po,Pr="__reactContainer$"+Po,qf="__reactEvents$"+Po,fT="__reactListeners$"+Po,pT="__reactHandles$"+Po;function Fi(e){var t=e[ar];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Pr]||n[ar]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=y0(e);e!==null;){if(n=e[ar])return n;e=y0(e)}return t}e=n,n=e.parentNode}return null}function dl(e){return e=e[ar]||e[Pr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ns(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(K(33))}function xu(e){return e[Ia]||null}var Gf=[],Os=-1;function _i(e){return{current:e}}function Ge(e){0>Os||(e.current=Gf[Os],Gf[Os]=null,Os--)}function Ve(e,t){Os++,Gf[Os]=e.current,e.current=t}var wi={},Lt=_i(wi),Zt=_i(!1),ss=wi;function go(e,t){var n=e.type.contextTypes;if(!n)return wi;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 Jt(e){return e=e.childContextTypes,e!=null}function Nc(){Ge(Zt),Ge(Lt)}function x0(e,t,n){if(Lt.current!==wi)throw Error(K(168));Ve(Lt,t),Ve(Zt,n)}function ww(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(K(108,X2(e)||"Unknown",i));return nt({},n,r)}function Oc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||wi,ss=Lt.current,Ve(Lt,e),Ve(Zt,Zt.current),!0}function w0(e,t,n){var r=e.stateNode;if(!r)throw Error(K(169));n?(e=ww(e,t,ss),r.__reactInternalMemoizedMergedChildContext=e,Ge(Zt),Ge(Lt),Ve(Lt,e)):Ge(Zt),Ve(Zt,n)}var kr=null,wu=!1,Ad=!1;function bw(e){kr===null?kr=[e]:kr.push(e)}function hT(e){wu=!0,bw(e)}function Ti(){if(!Ad&&kr!==null){Ad=!0;var e=0,t=Le;try{var n=kr;for(Le=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}kr=null,wu=!1}catch(i){throw kr!==null&&(kr=kr.slice(e+1)),q1(Dh,Ti),i}finally{Le=t,Ad=!1}}return null}var Ds=[],Is=0,Dc=null,Ic=0,Sn=[],kn=0,os=null,Er=1,Ar="";function Ni(e,t){Ds[Is++]=Ic,Ds[Is++]=Dc,Dc=e,Ic=t}function Cw(e,t,n){Sn[kn++]=Er,Sn[kn++]=Ar,Sn[kn++]=os,os=e;var r=Er;e=Ar;var i=32-qn(r)-1;r&=~(1<<i),n+=1;var s=32-qn(t)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Er=1<<32-qn(t)+i|n<<i|r,Ar=s+e}else Er=1<<s|n<<i|r,Ar=e}function Hh(e){e.return!==null&&(Ni(e,1),Cw(e,1,0))}function Wh(e){for(;e===Dc;)Dc=Ds[--Is],Ds[Is]=null,Ic=Ds[--Is],Ds[Is]=null;for(;e===os;)os=Sn[--kn],Sn[kn]=null,Ar=Sn[--kn],Sn[kn]=null,Er=Sn[--kn],Sn[kn]=null}var dn=null,ln=null,Ye=!1,Hn=null;function Sw(e,t){var n=Tn(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 b0(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,dn=e,ln=fi(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,dn=e,ln=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=os!==null?{id:Er,overflow:Ar}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Tn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,dn=e,ln=null,!0):!1;default:return!1}}function Yf(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Qf(e){if(Ye){var t=ln;if(t){var n=t;if(!b0(e,t)){if(Yf(e))throw Error(K(418));t=fi(n.nextSibling);var r=dn;t&&b0(e,t)?Sw(r,n):(e.flags=e.flags&-4097|2,Ye=!1,dn=e)}}else{if(Yf(e))throw Error(K(418));e.flags=e.flags&-4097|2,Ye=!1,dn=e}}}function C0(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;dn=e}function Ol(e){if(e!==dn)return!1;if(!Ye)return C0(e),Ye=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Hf(e.type,e.memoizedProps)),t&&(t=ln)){if(Yf(e))throw kw(),Error(K(418));for(;t;)Sw(e,t),t=fi(t.nextSibling)}if(C0(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(K(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){ln=fi(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ln=null}}else ln=dn?fi(e.stateNode.nextSibling):null;return!0}function kw(){for(var e=ln;e;)e=fi(e.nextSibling)}function vo(){ln=dn=null,Ye=!1}function qh(e){Hn===null?Hn=[e]:Hn.push(e)}var mT=Br.ReactCurrentBatchConfig;function qo(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(K(309));var r=n.stateNode}if(!r)throw Error(K(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(K(284));if(!n._owner)throw Error(K(290,e))}return e}function Dl(e,t){throw e=Object.prototype.toString.call(t),Error(K(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function S0(e){var t=e._init;return t(e._payload)}function _w(e){function t(g,m){if(e){var w=g.deletions;w===null?(g.deletions=[m],g.flags|=16):w.push(m)}}function n(g,m){if(!e)return null;for(;m!==null;)t(g,m),m=m.sibling;return null}function r(g,m){for(g=new Map;m!==null;)m.key!==null?g.set(m.key,m):g.set(m.index,m),m=m.sibling;return g}function i(g,m){return g=gi(g,m),g.index=0,g.sibling=null,g}function s(g,m,w){return g.index=w,e?(w=g.alternate,w!==null?(w=w.index,w<m?(g.flags|=2,m):w):(g.flags|=2,m)):(g.flags|=1048576,m)}function o(g){return e&&g.alternate===null&&(g.flags|=2),g}function a(g,m,w,S){return m===null||m.tag!==6?(m=Dd(w,g.mode,S),m.return=g,m):(m=i(m,w),m.return=g,m)}function l(g,m,w,S){var T=w.type;return T===js?d(g,m,w.props.children,S,w.key):m!==null&&(m.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===Wr&&S0(T)===m.type)?(S=i(m,w.props),S.ref=qo(g,m,w),S.return=g,S):(S=dc(w.type,w.key,w.props,null,g.mode,S),S.ref=qo(g,m,w),S.return=g,S)}function c(g,m,w,S){return m===null||m.tag!==4||m.stateNode.containerInfo!==w.containerInfo||m.stateNode.implementation!==w.implementation?(m=Id(w,g.mode,S),m.return=g,m):(m=i(m,w.children||[]),m.return=g,m)}function d(g,m,w,S,T){return m===null||m.tag!==7?(m=Zi(w,g.mode,S,T),m.return=g,m):(m=i(m,w),m.return=g,m)}function u(g,m,w){if(typeof m=="string"&&m!==""||typeof m=="number")return m=Dd(""+m,g.mode,w),m.return=g,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case kl:return w=dc(m.type,m.key,m.props,null,g.mode,w),w.ref=qo(g,null,m),w.return=g,w;case As:return m=Id(m,g.mode,w),m.return=g,m;case Wr:var S=m._init;return u(g,S(m._payload),w)}if(ea(m)||zo(m))return m=Zi(m,g.mode,w,null),m.return=g,m;Dl(g,m)}return null}function p(g,m,w,S){var T=m!==null?m.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return T!==null?null:a(g,m,""+w,S);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case kl:return w.key===T?l(g,m,w,S):null;case As:return w.key===T?c(g,m,w,S):null;case Wr:return T=w._init,p(g,m,T(w._payload),S)}if(ea(w)||zo(w))return T!==null?null:d(g,m,w,S,null);Dl(g,w)}return null}function h(g,m,w,S,T){if(typeof S=="string"&&S!==""||typeof S=="number")return g=g.get(w)||null,a(m,g,""+S,T);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case kl:return g=g.get(S.key===null?w:S.key)||null,l(m,g,S,T);case As:return g=g.get(S.key===null?w:S.key)||null,c(m,g,S,T);case Wr:var k=S._init;return h(g,m,w,k(S._payload),T)}if(ea(S)||zo(S))return g=g.get(w)||null,d(m,g,S,T,null);Dl(m,S)}return null}function y(g,m,w,S){for(var T=null,k=null,E=m,M=m=0,U=null;E!==null&&M<w.length;M++){E.index>M?(U=E,E=null):U=E.sibling;var j=p(g,E,w[M],S);if(j===null){E===null&&(E=U);break}e&&E&&j.alternate===null&&t(g,E),m=s(j,m,M),k===null?T=j:k.sibling=j,k=j,E=U}if(M===w.length)return n(g,E),Ye&&Ni(g,M),T;if(E===null){for(;M<w.length;M++)E=u(g,w[M],S),E!==null&&(m=s(E,m,M),k===null?T=E:k.sibling=E,k=E);return Ye&&Ni(g,M),T}for(E=r(g,E);M<w.length;M++)U=h(E,g,M,w[M],S),U!==null&&(e&&U.alternate!==null&&E.delete(U.key===null?M:U.key),m=s(U,m,M),k===null?T=U:k.sibling=U,k=U);return e&&E.forEach(function(N){return t(g,N)}),Ye&&Ni(g,M),T}function b(g,m,w,S){var T=zo(w);if(typeof T!="function")throw Error(K(150));if(w=T.call(w),w==null)throw Error(K(151));for(var k=T=null,E=m,M=m=0,U=null,j=w.next();E!==null&&!j.done;M++,j=w.next()){E.index>M?(U=E,E=null):U=E.sibling;var N=p(g,E,j.value,S);if(N===null){E===null&&(E=U);break}e&&E&&N.alternate===null&&t(g,E),m=s(N,m,M),k===null?T=N:k.sibling=N,k=N,E=U}if(j.done)return n(g,E),Ye&&Ni(g,M),T;if(E===null){for(;!j.done;M++,j=w.next())j=u(g,j.value,S),j!==null&&(m=s(j,m,M),k===null?T=j:k.sibling=j,k=j);return Ye&&Ni(g,M),T}for(E=r(g,E);!j.done;M++,j=w.next())j=h(E,g,M,j.value,S),j!==null&&(e&&j.alternate!==null&&E.delete(j.key===null?M:j.key),m=s(j,m,M),k===null?T=j:k.sibling=j,k=j);return e&&E.forEach(function(O){return t(g,O)}),Ye&&Ni(g,M),T}function C(g,m,w,S){if(typeof w=="object"&&w!==null&&w.type===js&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case kl:e:{for(var T=w.key,k=m;k!==null;){if(k.key===T){if(T=w.type,T===js){if(k.tag===7){n(g,k.sibling),m=i(k,w.props.children),m.return=g,g=m;break e}}else if(k.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===Wr&&S0(T)===k.type){n(g,k.sibling),m=i(k,w.props),m.ref=qo(g,k,w),m.return=g,g=m;break e}n(g,k);break}else t(g,k);k=k.sibling}w.type===js?(m=Zi(w.props.children,g.mode,S,w.key),m.return=g,g=m):(S=dc(w.type,w.key,w.props,null,g.mode,S),S.ref=qo(g,m,w),S.return=g,g=S)}return o(g);case As:e:{for(k=w.key;m!==null;){if(m.key===k)if(m.tag===4&&m.stateNode.containerInfo===w.containerInfo&&m.stateNode.implementation===w.implementation){n(g,m.sibling),m=i(m,w.children||[]),m.return=g,g=m;break e}else{n(g,m);break}else t(g,m);m=m.sibling}m=Id(w,g.mode,S),m.return=g,g=m}return o(g);case Wr:return k=w._init,C(g,m,k(w._payload),S)}if(ea(w))return y(g,m,w,S);if(zo(w))return b(g,m,w,S);Dl(g,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,m!==null&&m.tag===6?(n(g,m.sibling),m=i(m,w),m.return=g,g=m):(n(g,m),m=Dd(w,g.mode,S),m.return=g,g=m),o(g)):n(g,m)}return C}var yo=_w(!0),Tw=_w(!1),Lc=_i(null),Fc=null,Ls=null,Gh=null;function Yh(){Gh=Ls=Fc=null}function Qh(e){var t=Lc.current;Ge(Lc),e._currentValue=t}function Kf(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 Xs(e,t){Fc=e,Gh=Ls=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Xt=!0),e.firstContext=null)}function Rn(e){var t=e._currentValue;if(Gh!==e)if(e={context:e,memoizedValue:t,next:null},Ls===null){if(Fc===null)throw Error(K(308));Ls=e,Fc.dependencies={lanes:0,firstContext:e}}else Ls=Ls.next=e;return t}var Bi=null;function Kh(e){Bi===null?Bi=[e]:Bi.push(e)}function Ew(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Kh(t)):(n.next=i.next,i.next=n),t.interleaved=n,Nr(e,r)}function Nr(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 qr=!1;function Xh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Aw(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 jr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function pi(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ne&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Nr(e,n)}return i=r.interleaved,i===null?(t.next=t,Kh(r)):(t.next=i.next,i.next=t),r.interleaved=t,Nr(e,n)}function sc(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,Ih(e,n)}}function k0(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 Bc(e,t,n,r){var i=e.updateQueue;qr=!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,b=a;switch(p=t,h=n,b.tag){case 1:if(y=b.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=b.payload,p=typeof y=="function"?y.call(h,u,p):y,p==null)break e;u=nt({},u,p);break e;case 2:qr=!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);ls|=o,e.lanes=o,e.memoizedState=u}}function _0(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(K(191,i));i.call(r)}}}var fl={},cr=_i(fl),La=_i(fl),Fa=_i(fl);function $i(e){if(e===fl)throw Error(K(174));return e}function Zh(e,t){switch(Ve(Fa,t),Ve(La,e),Ve(cr,fl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Rf(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Rf(t,e)}Ge(cr),Ve(cr,t)}function xo(){Ge(cr),Ge(La),Ge(Fa)}function jw(e){$i(Fa.current);var t=$i(cr.current),n=Rf(t,e.type);t!==n&&(Ve(La,e),Ve(cr,n))}function Jh(e){La.current===e&&(Ge(cr),Ge(La))}var Xe=_i(0);function $c(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 jd=[];function em(){for(var e=0;e<jd.length;e++)jd[e]._workInProgressVersionPrimary=null;jd.length=0}var oc=Br.ReactCurrentDispatcher,Rd=Br.ReactCurrentBatchConfig,as=0,tt=null,mt=null,wt=null,zc=!1,ma=!1,Ba=0,gT=0;function Mt(){throw Error(K(321))}function tm(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Qn(e[n],t[n]))return!1;return!0}function nm(e,t,n,r,i,s){if(as=s,tt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,oc.current=e===null||e.memoizedState===null?wT:bT,e=n(r,i),ma){s=0;do{if(ma=!1,Ba=0,25<=s)throw Error(K(301));s+=1,wt=mt=null,t.updateQueue=null,oc.current=CT,e=n(r,i)}while(ma)}if(oc.current=Vc,t=mt!==null&&mt.next!==null,as=0,wt=mt=tt=null,zc=!1,t)throw Error(K(300));return e}function rm(){var e=Ba!==0;return Ba=0,e}function tr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wt===null?tt.memoizedState=wt=e:wt=wt.next=e,wt}function Mn(){if(mt===null){var e=tt.alternate;e=e!==null?e.memoizedState:null}else e=mt.next;var t=wt===null?tt.memoizedState:wt.next;if(t!==null)wt=t,mt=e;else{if(e===null)throw Error(K(310));mt=e,e={memoizedState:mt.memoizedState,baseState:mt.baseState,baseQueue:mt.baseQueue,queue:mt.queue,next:null},wt===null?tt.memoizedState=wt=e:wt=wt.next=e}return wt}function $a(e,t){return typeof t=="function"?t(e):t}function Md(e){var t=Mn(),n=t.queue;if(n===null)throw Error(K(311));n.lastRenderedReducer=e;var r=mt,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((as&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,tt.lanes|=d,ls|=d}c=c.next}while(c!==null&&c!==s);l===null?o=r:l.next=a,Qn(r,t.memoizedState)||(Xt=!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,tt.lanes|=s,ls|=s,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Pd(e){var t=Mn(),n=t.queue;if(n===null)throw Error(K(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);Qn(s,t.memoizedState)||(Xt=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function Rw(){}function Mw(e,t){var n=tt,r=Mn(),i=t(),s=!Qn(r.memoizedState,i);if(s&&(r.memoizedState=i,Xt=!0),r=r.queue,im(Ow.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||wt!==null&&wt.memoizedState.tag&1){if(n.flags|=2048,za(9,Nw.bind(null,n,r,i,t),void 0,null),bt===null)throw Error(K(349));as&30||Pw(n,t,i)}return i}function Pw(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=tt.updateQueue,t===null?(t={lastEffect:null,stores:null},tt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Nw(e,t,n,r){t.value=n,t.getSnapshot=r,Dw(t)&&Iw(e)}function Ow(e,t,n){return n(function(){Dw(t)&&Iw(e)})}function Dw(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Qn(e,n)}catch{return!0}}function Iw(e){var t=Nr(e,1);t!==null&&Gn(t,e,1,-1)}function T0(e){var t=tr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:$a,lastRenderedState:e},t.queue=e,e=e.dispatch=xT.bind(null,tt,e),[t.memoizedState,e]}function za(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=tt.updateQueue,t===null?(t={lastEffect:null,stores:null},tt.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 Lw(){return Mn().memoizedState}function ac(e,t,n,r){var i=tr();tt.flags|=e,i.memoizedState=za(1|t,n,void 0,r===void 0?null:r)}function bu(e,t,n,r){var i=Mn();r=r===void 0?null:r;var s=void 0;if(mt!==null){var o=mt.memoizedState;if(s=o.destroy,r!==null&&tm(r,o.deps)){i.memoizedState=za(t,n,s,r);return}}tt.flags|=e,i.memoizedState=za(1|t,n,s,r)}function E0(e,t){return ac(8390656,8,e,t)}function im(e,t){return bu(2048,8,e,t)}function Fw(e,t){return bu(4,2,e,t)}function Bw(e,t){return bu(4,4,e,t)}function $w(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 zw(e,t,n){return n=n!=null?n.concat([e]):null,bu(4,4,$w.bind(null,t,e),n)}function sm(){}function Vw(e,t){var n=Mn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&tm(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Uw(e,t){var n=Mn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&tm(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Hw(e,t,n){return as&21?(Qn(n,t)||(n=Q1(),tt.lanes|=n,ls|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Xt=!0),e.memoizedState=n)}function vT(e,t){var n=Le;Le=n!==0&&4>n?n:4,e(!0);var r=Rd.transition;Rd.transition={};try{e(!1),t()}finally{Le=n,Rd.transition=r}}function Ww(){return Mn().memoizedState}function yT(e,t,n){var r=mi(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},qw(e))Gw(t,n);else if(n=Ew(e,t,n,r),n!==null){var i=Vt();Gn(n,e,r,i),Yw(n,t,r)}}function xT(e,t,n){var r=mi(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(qw(e))Gw(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,Qn(a,o)){var l=t.interleaved;l===null?(i.next=i,Kh(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=Ew(e,t,i,r),n!==null&&(i=Vt(),Gn(n,e,r,i),Yw(n,t,r))}}function qw(e){var t=e.alternate;return e===tt||t!==null&&t===tt}function Gw(e,t){ma=zc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Yw(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ih(e,n)}}var Vc={readContext:Rn,useCallback:Mt,useContext:Mt,useEffect:Mt,useImperativeHandle:Mt,useInsertionEffect:Mt,useLayoutEffect:Mt,useMemo:Mt,useReducer:Mt,useRef:Mt,useState:Mt,useDebugValue:Mt,useDeferredValue:Mt,useTransition:Mt,useMutableSource:Mt,useSyncExternalStore:Mt,useId:Mt,unstable_isNewReconciler:!1},wT={readContext:Rn,useCallback:function(e,t){return tr().memoizedState=[e,t===void 0?null:t],e},useContext:Rn,useEffect:E0,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ac(4194308,4,$w.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ac(4194308,4,e,t)},useInsertionEffect:function(e,t){return ac(4,2,e,t)},useMemo:function(e,t){var n=tr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=tr();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=yT.bind(null,tt,e),[r.memoizedState,e]},useRef:function(e){var t=tr();return e={current:e},t.memoizedState=e},useState:T0,useDebugValue:sm,useDeferredValue:function(e){return tr().memoizedState=e},useTransition:function(){var e=T0(!1),t=e[0];return e=vT.bind(null,e[1]),tr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=tt,i=tr();if(Ye){if(n===void 0)throw Error(K(407));n=n()}else{if(n=t(),bt===null)throw Error(K(349));as&30||Pw(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,E0(Ow.bind(null,r,s,e),[e]),r.flags|=2048,za(9,Nw.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=tr(),t=bt.identifierPrefix;if(Ye){var n=Ar,r=Er;n=(r&~(1<<32-qn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ba++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=gT++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},bT={readContext:Rn,useCallback:Vw,useContext:Rn,useEffect:im,useImperativeHandle:zw,useInsertionEffect:Fw,useLayoutEffect:Bw,useMemo:Uw,useReducer:Md,useRef:Lw,useState:function(){return Md($a)},useDebugValue:sm,useDeferredValue:function(e){var t=Mn();return Hw(t,mt.memoizedState,e)},useTransition:function(){var e=Md($a)[0],t=Mn().memoizedState;return[e,t]},useMutableSource:Rw,useSyncExternalStore:Mw,useId:Ww,unstable_isNewReconciler:!1},CT={readContext:Rn,useCallback:Vw,useContext:Rn,useEffect:im,useImperativeHandle:zw,useInsertionEffect:Fw,useLayoutEffect:Bw,useMemo:Uw,useReducer:Pd,useRef:Lw,useState:function(){return Pd($a)},useDebugValue:sm,useDeferredValue:function(e){var t=Mn();return mt===null?t.memoizedState=e:Hw(t,mt.memoizedState,e)},useTransition:function(){var e=Pd($a)[0],t=Mn().memoizedState;return[e,t]},useMutableSource:Rw,useSyncExternalStore:Mw,useId:Ww,unstable_isNewReconciler:!1};function Bn(e,t){if(e&&e.defaultProps){t=nt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Xf(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:nt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Cu={isMounted:function(e){return(e=e._reactInternals)?hs(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Vt(),i=mi(e),s=jr(r,i);s.payload=t,n!=null&&(s.callback=n),t=pi(e,s,i),t!==null&&(Gn(t,e,i,r),sc(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Vt(),i=mi(e),s=jr(r,i);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=pi(e,s,i),t!==null&&(Gn(t,e,i,r),sc(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Vt(),r=mi(e),i=jr(n,r);i.tag=2,t!=null&&(i.callback=t),t=pi(e,i,r),t!==null&&(Gn(t,e,r,n),sc(t,e,r))}};function A0(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?!Na(n,r)||!Na(i,s):!0}function Qw(e,t,n){var r=!1,i=wi,s=t.contextType;return typeof s=="object"&&s!==null?s=Rn(s):(i=Jt(t)?ss:Lt.current,r=t.contextTypes,s=(r=r!=null)?go(e,i):wi),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Cu,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function j0(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&&Cu.enqueueReplaceState(t,t.state,null)}function Zf(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Xh(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=Rn(s):(s=Jt(t)?ss:Lt.current,i.context=go(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(Xf(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&&Cu.enqueueReplaceState(i,i.state,null),Bc(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function wo(e,t){try{var n="",r=t;do n+=K2(r),r=r.return;while(r);var i=n}catch(s){i=`
|
|
39
|
-
Error generating stack: `+s.message+`
|
|
40
|
-
`+s.stack}return{value:e,source:t,stack:i,digest:null}}function Nd(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Jf(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var ST=typeof WeakMap=="function"?WeakMap:Map;function Kw(e,t,n){n=jr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Hc||(Hc=!0,cp=r),Jf(e,t)},n}function Xw(e,t,n){n=jr(-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(){Jf(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Jf(e,t),typeof r!="function"&&(hi===null?hi=new Set([this]):hi.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function R0(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new ST;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=LT.bind(null,e,t,n),t.then(e,e))}function M0(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 P0(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=jr(-1,1),t.tag=2,pi(n,t,1))),n.lanes|=1),e)}var kT=Br.ReactCurrentOwner,Xt=!1;function $t(e,t,n,r){t.child=e===null?Tw(t,null,n,r):yo(t,e.child,n,r)}function N0(e,t,n,r,i){n=n.render;var s=t.ref;return Xs(t,i),r=nm(e,t,n,r,s,i),n=rm(),e!==null&&!Xt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Or(e,t,i)):(Ye&&n&&Hh(t),t.flags|=1,$t(e,t,r,i),t.child)}function O0(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!pm(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,Zw(e,t,s,r,i)):(e=dc(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:Na,n(o,r)&&e.ref===t.ref)return Or(e,t,i)}return t.flags|=1,e=gi(s,r),e.ref=t.ref,e.return=t,t.child=e}function Zw(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(Na(s,r)&&e.ref===t.ref)if(Xt=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(Xt=!0);else return t.lanes=e.lanes,Or(e,t,i)}return ep(e,t,n,r,i)}function Jw(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},Ve(Bs,on),on|=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,Ve(Bs,on),on|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,Ve(Bs,on),on|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,Ve(Bs,on),on|=r;return $t(e,t,i,n),t.child}function eb(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ep(e,t,n,r,i){var s=Jt(n)?ss:Lt.current;return s=go(t,s),Xs(t,i),n=nm(e,t,n,r,s,i),r=rm(),e!==null&&!Xt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Or(e,t,i)):(Ye&&r&&Hh(t),t.flags|=1,$t(e,t,n,i),t.child)}function D0(e,t,n,r,i){if(Jt(n)){var s=!0;Oc(t)}else s=!1;if(Xs(t,i),t.stateNode===null)lc(e,t),Qw(t,n,r),Zf(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=Rn(c):(c=Jt(n)?ss:Lt.current,c=go(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)&&j0(t,o,r,c),qr=!1;var p=t.memoizedState;o.state=p,Bc(t,r,o,i),l=t.memoizedState,a!==r||p!==l||Zt.current||qr?(typeof d=="function"&&(Xf(t,n,d,r),l=t.memoizedState),(a=qr||A0(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,Aw(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:Bn(t.type,a),o.props=c,u=t.pendingProps,p=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=Rn(l):(l=Jt(n)?ss:Lt.current,l=go(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)&&j0(t,o,r,l),qr=!1,p=t.memoizedState,o.state=p,Bc(t,r,o,i);var y=t.memoizedState;a!==u||p!==y||Zt.current||qr?(typeof h=="function"&&(Xf(t,n,h,r),y=t.memoizedState),(c=qr||A0(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 tp(e,t,n,r,s,i)}function tp(e,t,n,r,i,s){eb(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&w0(t,n,!1),Or(e,t,s);r=t.stateNode,kT.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=yo(t,e.child,null,s),t.child=yo(t,null,a,s)):$t(e,t,a,s),t.memoizedState=r.state,i&&w0(t,n,!0),t.child}function tb(e){var t=e.stateNode;t.pendingContext?x0(e,t.pendingContext,t.pendingContext!==t.context):t.context&&x0(e,t.context,!1),Zh(e,t.containerInfo)}function I0(e,t,n,r,i){return vo(),qh(i),t.flags|=256,$t(e,t,n,r),t.child}var np={dehydrated:null,treeContext:null,retryLane:0};function rp(e){return{baseLanes:e,cachePool:null,transitions:null}}function nb(e,t,n){var r=t.pendingProps,i=Xe.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),Ve(Xe,i&1),e===null)return Qf(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=_u(o,r,0,null),e=Zi(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=rp(n),t.memoizedState=np,e):om(t,o));if(i=e.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return _T(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=gi(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=gi(a,s):(s=Zi(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?rp(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~n,t.memoizedState=np,r}return s=e.child,e=s.sibling,r=gi(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 om(e,t){return t=_u({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Il(e,t,n,r){return r!==null&&qh(r),yo(t,e.child,null,n),e=om(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function _T(e,t,n,r,i,s,o){if(n)return t.flags&256?(t.flags&=-257,r=Nd(Error(K(422))),Il(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=_u({mode:"visible",children:r.children},i,0,null),s=Zi(s,i,o,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&yo(t,e.child,null,o),t.child.memoizedState=rp(o),t.memoizedState=np,s);if(!(t.mode&1))return Il(e,t,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(K(419)),r=Nd(s,r,void 0),Il(e,t,o,r)}if(a=(o&e.childLanes)!==0,Xt||a){if(r=bt,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,Nr(e,i),Gn(r,e,i,-1))}return fm(),r=Nd(Error(K(421))),Il(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=FT.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,ln=fi(i.nextSibling),dn=t,Ye=!0,Hn=null,e!==null&&(Sn[kn++]=Er,Sn[kn++]=Ar,Sn[kn++]=os,Er=e.id,Ar=e.overflow,os=t),t=om(t,r.children),t.flags|=4096,t)}function L0(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Kf(e.return,t,n)}function Od(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 rb(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if($t(e,t,r.children,n),r=Xe.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&&L0(e,n,t);else if(e.tag===19)L0(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(Ve(Xe,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&&$c(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Od(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&&$c(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Od(t,!0,n,null,s);break;case"together":Od(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function lc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Or(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ls|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(K(153));if(t.child!==null){for(e=t.child,n=gi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=gi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function TT(e,t,n){switch(t.tag){case 3:tb(t),vo();break;case 5:jw(t);break;case 1:Jt(t.type)&&Oc(t);break;case 4:Zh(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Ve(Lc,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Ve(Xe,Xe.current&1),t.flags|=128,null):n&t.child.childLanes?nb(e,t,n):(Ve(Xe,Xe.current&1),e=Or(e,t,n),e!==null?e.sibling:null);Ve(Xe,Xe.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return rb(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ve(Xe,Xe.current),r)break;return null;case 22:case 23:return t.lanes=0,Jw(e,t,n)}return Or(e,t,n)}var ib,ip,sb,ob;ib=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}};ip=function(){};sb=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,$i(cr.current);var s=null;switch(n){case"input":i=Tf(e,i),r=Tf(e,r),s=[];break;case"select":i=nt({},i,{value:void 0}),r=nt({},r,{value:void 0}),s=[];break;case"textarea":i=jf(e,i),r=jf(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Pc)}Mf(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"&&(Ta.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"&&(Ta.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&We("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)}};ob=function(e,t,n,r){n!==r&&(t.flags|=4)};function Go(e,t){if(!Ye)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 Pt(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 ET(e,t,n){var r=t.pendingProps;switch(Wh(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pt(t),null;case 1:return Jt(t.type)&&Nc(),Pt(t),null;case 3:return r=t.stateNode,xo(),Ge(Zt),Ge(Lt),em(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ol(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Hn!==null&&(fp(Hn),Hn=null))),ip(e,t),Pt(t),null;case 5:Jh(t);var i=$i(Fa.current);if(n=t.type,e!==null&&t.stateNode!=null)sb(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(K(166));return Pt(t),null}if(e=$i(cr.current),Ol(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[ar]=t,r[Ia]=s,e=(t.mode&1)!==0,n){case"dialog":We("cancel",r),We("close",r);break;case"iframe":case"object":case"embed":We("load",r);break;case"video":case"audio":for(i=0;i<na.length;i++)We(na[i],r);break;case"source":We("error",r);break;case"img":case"image":case"link":We("error",r),We("load",r);break;case"details":We("toggle",r);break;case"input":qg(r,s),We("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},We("invalid",r);break;case"textarea":Yg(r,s),We("invalid",r)}Mf(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&&Nl(r.textContent,a,e),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&Nl(r.textContent,a,e),i=["children",""+a]):Ta.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&We("scroll",r)}switch(n){case"input":_l(r),Gg(r,s,!0);break;case"textarea":_l(r),Qg(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=Pc)}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=O1(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[ar]=t,e[Ia]=r,ib(e,t,!1,!1),t.stateNode=e;e:{switch(o=Pf(n,r),n){case"dialog":We("cancel",e),We("close",e),i=r;break;case"iframe":case"object":case"embed":We("load",e),i=r;break;case"video":case"audio":for(i=0;i<na.length;i++)We(na[i],e);i=r;break;case"source":We("error",e),i=r;break;case"img":case"image":case"link":We("error",e),We("load",e),i=r;break;case"details":We("toggle",e),i=r;break;case"input":qg(e,r),i=Tf(e,r),We("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=nt({},r,{value:void 0}),We("invalid",e);break;case"textarea":Yg(e,r),i=jf(e,r),We("invalid",e);break;default:i=r}Mf(n,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?L1(e,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&D1(e,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Ea(e,l):typeof l=="number"&&Ea(e,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Ta.hasOwnProperty(s)?l!=null&&s==="onScroll"&&We("scroll",e):l!=null&&Rh(e,s,l,o))}switch(n){case"input":_l(e),Gg(e,r,!1);break;case"textarea":_l(e),Qg(e);break;case"option":r.value!=null&&e.setAttribute("value",""+xi(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?Gs(e,!!r.multiple,s,!1):r.defaultValue!=null&&Gs(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Pc)}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 Pt(t),null;case 6:if(e&&t.stateNode!=null)ob(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(K(166));if(n=$i(Fa.current),$i(cr.current),Ol(t)){if(r=t.stateNode,n=t.memoizedProps,r[ar]=t,(s=r.nodeValue!==n)&&(e=dn,e!==null))switch(e.tag){case 3:Nl(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Nl(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[ar]=t,t.stateNode=r}return Pt(t),null;case 13:if(Ge(Xe),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ye&&ln!==null&&t.mode&1&&!(t.flags&128))kw(),vo(),t.flags|=98560,s=!1;else if(s=Ol(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(K(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(K(317));s[ar]=t}else vo(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pt(t),s=!1}else Hn!==null&&(fp(Hn),Hn=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||Xe.current&1?vt===0&&(vt=3):fm())),t.updateQueue!==null&&(t.flags|=4),Pt(t),null);case 4:return xo(),ip(e,t),e===null&&Oa(t.stateNode.containerInfo),Pt(t),null;case 10:return Qh(t.type._context),Pt(t),null;case 17:return Jt(t.type)&&Nc(),Pt(t),null;case 19:if(Ge(Xe),s=t.memoizedState,s===null)return Pt(t),null;if(r=(t.flags&128)!==0,o=s.rendering,o===null)if(r)Go(s,!1);else{if(vt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=$c(e),o!==null){for(t.flags|=128,Go(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 Ve(Xe,Xe.current&1|2),t.child}e=e.sibling}s.tail!==null&&ut()>bo&&(t.flags|=128,r=!0,Go(s,!1),t.lanes=4194304)}else{if(!r)if(e=$c(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Go(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Ye)return Pt(t),null}else 2*ut()-s.renderingStartTime>bo&&n!==1073741824&&(t.flags|=128,r=!0,Go(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=ut(),t.sibling=null,n=Xe.current,Ve(Xe,r?n&1|2:n&1),t):(Pt(t),null);case 22:case 23:return dm(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?on&1073741824&&(Pt(t),t.subtreeFlags&6&&(t.flags|=8192)):Pt(t),null;case 24:return null;case 25:return null}throw Error(K(156,t.tag))}function AT(e,t){switch(Wh(t),t.tag){case 1:return Jt(t.type)&&Nc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xo(),Ge(Zt),Ge(Lt),em(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Jh(t),null;case 13:if(Ge(Xe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(K(340));vo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ge(Xe),null;case 4:return xo(),null;case 10:return Qh(t.type._context),null;case 22:case 23:return dm(),null;case 24:return null;default:return null}}var Ll=!1,Dt=!1,jT=typeof WeakSet=="function"?WeakSet:Set,de=null;function Fs(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){at(e,t,r)}else n.current=null}function sp(e,t,n){try{n()}catch(r){at(e,t,r)}}var F0=!1;function RT(e,t){if(Vf=jc,e=dw(),Uh(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(Uf={focusedElem:e,selectionRange:n},jc=!1,de=t;de!==null;)if(t=de,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,de=e;else for(;de!==null;){t=de;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 b=y.memoizedProps,C=y.memoizedState,g=t.stateNode,m=g.getSnapshotBeforeUpdate(t.elementType===t.type?b:Bn(t.type,b),C);g.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(K(163))}}catch(S){at(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,de=e;break}de=t.return}return y=F0,F0=!1,y}function ga(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&&sp(t,n,s)}i=i.next}while(i!==r)}}function Su(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 op(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 ab(e){var t=e.alternate;t!==null&&(e.alternate=null,ab(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ar],delete t[Ia],delete t[qf],delete t[fT],delete t[pT])),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 lb(e){return e.tag===5||e.tag===3||e.tag===4}function B0(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||lb(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 ap(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=Pc));else if(r!==4&&(e=e.child,e!==null))for(ap(e,t,n),e=e.sibling;e!==null;)ap(e,t,n),e=e.sibling}function lp(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(lp(e,t,n),e=e.sibling;e!==null;)lp(e,t,n),e=e.sibling}var kt=null,zn=!1;function Vr(e,t,n){for(n=n.child;n!==null;)cb(e,t,n),n=n.sibling}function cb(e,t,n){if(lr&&typeof lr.onCommitFiberUnmount=="function")try{lr.onCommitFiberUnmount(mu,n)}catch{}switch(n.tag){case 5:Dt||Fs(n,t);case 6:var r=kt,i=zn;kt=null,Vr(e,t,n),kt=r,zn=i,kt!==null&&(zn?(e=kt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):kt.removeChild(n.stateNode));break;case 18:kt!==null&&(zn?(e=kt,n=n.stateNode,e.nodeType===8?Ed(e.parentNode,n):e.nodeType===1&&Ed(e,n),Ma(e)):Ed(kt,n.stateNode));break;case 4:r=kt,i=zn,kt=n.stateNode.containerInfo,zn=!0,Vr(e,t,n),kt=r,zn=i;break;case 0:case 11:case 14:case 15:if(!Dt&&(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)&&sp(n,t,o),i=i.next}while(i!==r)}Vr(e,t,n);break;case 1:if(!Dt&&(Fs(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){at(n,t,a)}Vr(e,t,n);break;case 21:Vr(e,t,n);break;case 22:n.mode&1?(Dt=(r=Dt)||n.memoizedState!==null,Vr(e,t,n),Dt=r):Vr(e,t,n);break;default:Vr(e,t,n)}}function $0(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new jT),t.forEach(function(r){var i=BT.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function In(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:kt=a.stateNode,zn=!1;break e;case 3:kt=a.stateNode.containerInfo,zn=!0;break e;case 4:kt=a.stateNode.containerInfo,zn=!0;break e}a=a.return}if(kt===null)throw Error(K(160));cb(s,o,i),kt=null,zn=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(c){at(i,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)ub(t,e),t=t.sibling}function ub(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(In(t,e),Xn(e),r&4){try{ga(3,e,e.return),Su(3,e)}catch(b){at(e,e.return,b)}try{ga(5,e,e.return)}catch(b){at(e,e.return,b)}}break;case 1:In(t,e),Xn(e),r&512&&n!==null&&Fs(n,n.return);break;case 5:if(In(t,e),Xn(e),r&512&&n!==null&&Fs(n,n.return),e.flags&32){var i=e.stateNode;try{Ea(i,"")}catch(b){at(e,e.return,b)}}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&&P1(i,s),Pf(a,o);var c=Pf(a,s);for(o=0;o<l.length;o+=2){var d=l[o],u=l[o+1];d==="style"?L1(i,u):d==="dangerouslySetInnerHTML"?D1(i,u):d==="children"?Ea(i,u):Rh(i,d,u,c)}switch(a){case"input":Ef(i,s);break;case"textarea":N1(i,s);break;case"select":var p=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var h=s.value;h!=null?Gs(i,!!s.multiple,h,!1):p!==!!s.multiple&&(s.defaultValue!=null?Gs(i,!!s.multiple,s.defaultValue,!0):Gs(i,!!s.multiple,s.multiple?[]:"",!1))}i[Ia]=s}catch(b){at(e,e.return,b)}}break;case 6:if(In(t,e),Xn(e),r&4){if(e.stateNode===null)throw Error(K(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(b){at(e,e.return,b)}}break;case 3:if(In(t,e),Xn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ma(t.containerInfo)}catch(b){at(e,e.return,b)}break;case 4:In(t,e),Xn(e);break;case 13:In(t,e),Xn(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(cm=ut())),r&4&&$0(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(Dt=(c=Dt)||d,In(t,e),Dt=c):In(t,e),Xn(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!d&&e.mode&1)for(de=e,d=e.child;d!==null;){for(u=de=d;de!==null;){switch(p=de,h=p.child,p.tag){case 0:case 11:case 14:case 15:ga(4,p,p.return);break;case 1:Fs(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(b){at(r,n,b)}}break;case 5:Fs(p,p.return);break;case 22:if(p.memoizedState!==null){V0(u);continue}}h!==null?(h.return=p,de=h):V0(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=I1("display",o))}catch(b){at(e,e.return,b)}}}else if(u.tag===6){if(d===null)try{u.stateNode.nodeValue=c?"":u.memoizedProps}catch(b){at(e,e.return,b)}}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:In(t,e),Xn(e),r&4&&$0(e);break;case 21:break;default:In(t,e),Xn(e)}}function Xn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(lb(n)){var r=n;break e}n=n.return}throw Error(K(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Ea(i,""),r.flags&=-33);var s=B0(e);lp(e,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,a=B0(e);ap(e,a,o);break;default:throw Error(K(161))}}catch(l){at(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function MT(e,t,n){de=e,db(e)}function db(e,t,n){for(var r=(e.mode&1)!==0;de!==null;){var i=de,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||Ll;if(!o){var a=i.alternate,l=a!==null&&a.memoizedState!==null||Dt;a=Ll;var c=Dt;if(Ll=o,(Dt=l)&&!c)for(de=i;de!==null;)o=de,l=o.child,o.tag===22&&o.memoizedState!==null?U0(i):l!==null?(l.return=o,de=l):U0(i);for(;s!==null;)de=s,db(s),s=s.sibling;de=i,Ll=a,Dt=c}z0(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,de=s):z0(e)}}function z0(e){for(;de!==null;){var t=de;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Dt||Su(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Dt)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Bn(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&_0(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}_0(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&&Ma(u)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(K(163))}Dt||t.flags&512&&op(t)}catch(p){at(t,t.return,p)}}if(t===e){de=null;break}if(n=t.sibling,n!==null){n.return=t.return,de=n;break}de=t.return}}function V0(e){for(;de!==null;){var t=de;if(t===e){de=null;break}var n=t.sibling;if(n!==null){n.return=t.return,de=n;break}de=t.return}}function U0(e){for(;de!==null;){var t=de;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Su(4,t)}catch(l){at(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){at(t,i,l)}}var s=t.return;try{op(t)}catch(l){at(t,s,l)}break;case 5:var o=t.return;try{op(t)}catch(l){at(t,o,l)}}}catch(l){at(t,t.return,l)}if(t===e){de=null;break}var a=t.sibling;if(a!==null){a.return=t.return,de=a;break}de=t.return}}var PT=Math.ceil,Uc=Br.ReactCurrentDispatcher,am=Br.ReactCurrentOwner,An=Br.ReactCurrentBatchConfig,Ne=0,bt=null,ft=null,Tt=0,on=0,Bs=_i(0),vt=0,Va=null,ls=0,ku=0,lm=0,va=null,Qt=null,cm=0,bo=1/0,Sr=null,Hc=!1,cp=null,hi=null,Fl=!1,ai=null,Wc=0,ya=0,up=null,cc=-1,uc=0;function Vt(){return Ne&6?ut():cc!==-1?cc:cc=ut()}function mi(e){return e.mode&1?Ne&2&&Tt!==0?Tt&-Tt:mT.transition!==null?(uc===0&&(uc=Q1()),uc):(e=Le,e!==0||(e=window.event,e=e===void 0?16:nw(e.type)),e):1}function Gn(e,t,n,r){if(50<ya)throw ya=0,up=null,Error(K(185));cl(e,n,r),(!(Ne&2)||e!==bt)&&(e===bt&&(!(Ne&2)&&(ku|=n),vt===4&&Qr(e,Tt)),en(e,r),n===1&&Ne===0&&!(t.mode&1)&&(bo=ut()+500,wu&&Ti()))}function en(e,t){var n=e.callbackNode;m_(e,t);var r=Ac(e,e===bt?Tt:0);if(r===0)n!==null&&Zg(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Zg(n),t===1)e.tag===0?hT(H0.bind(null,e)):bw(H0.bind(null,e)),uT(function(){!(Ne&6)&&Ti()}),n=null;else{switch(K1(r)){case 1:n=Dh;break;case 4:n=G1;break;case 16:n=Ec;break;case 536870912:n=Y1;break;default:n=Ec}n=xb(n,fb.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function fb(e,t){if(cc=-1,uc=0,Ne&6)throw Error(K(327));var n=e.callbackNode;if(Zs()&&e.callbackNode!==n)return null;var r=Ac(e,e===bt?Tt:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=qc(e,r);else{t=r;var i=Ne;Ne|=2;var s=hb();(bt!==e||Tt!==t)&&(Sr=null,bo=ut()+500,Xi(e,t));do try{DT();break}catch(a){pb(e,a)}while(!0);Yh(),Uc.current=s,Ne=i,ft!==null?t=0:(bt=null,Tt=0,t=vt)}if(t!==0){if(t===2&&(i=Lf(e),i!==0&&(r=i,t=dp(e,i))),t===1)throw n=Va,Xi(e,0),Qr(e,r),en(e,ut()),n;if(t===6)Qr(e,r);else{if(i=e.current.alternate,!(r&30)&&!NT(i)&&(t=qc(e,r),t===2&&(s=Lf(e),s!==0&&(r=s,t=dp(e,s))),t===1))throw n=Va,Xi(e,0),Qr(e,r),en(e,ut()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(K(345));case 2:Oi(e,Qt,Sr);break;case 3:if(Qr(e,r),(r&130023424)===r&&(t=cm+500-ut(),10<t)){if(Ac(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){Vt(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Wf(Oi.bind(null,e,Qt,Sr),t);break}Oi(e,Qt,Sr);break;case 4:if(Qr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-qn(r);s=1<<o,o=t[o],o>i&&(i=o),r&=~s}if(r=i,r=ut()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*PT(r/1960))-r,10<r){e.timeoutHandle=Wf(Oi.bind(null,e,Qt,Sr),r);break}Oi(e,Qt,Sr);break;case 5:Oi(e,Qt,Sr);break;default:throw Error(K(329))}}}return en(e,ut()),e.callbackNode===n?fb.bind(null,e):null}function dp(e,t){var n=va;return e.current.memoizedState.isDehydrated&&(Xi(e,t).flags|=256),e=qc(e,t),e!==2&&(t=Qt,Qt=n,t!==null&&fp(t)),e}function fp(e){Qt===null?Qt=e:Qt.push.apply(Qt,e)}function NT(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(!Qn(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 Qr(e,t){for(t&=~lm,t&=~ku,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-qn(t),r=1<<n;e[n]=-1,t&=~r}}function H0(e){if(Ne&6)throw Error(K(327));Zs();var t=Ac(e,0);if(!(t&1))return en(e,ut()),null;var n=qc(e,t);if(e.tag!==0&&n===2){var r=Lf(e);r!==0&&(t=r,n=dp(e,r))}if(n===1)throw n=Va,Xi(e,0),Qr(e,t),en(e,ut()),n;if(n===6)throw Error(K(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Oi(e,Qt,Sr),en(e,ut()),null}function um(e,t){var n=Ne;Ne|=1;try{return e(t)}finally{Ne=n,Ne===0&&(bo=ut()+500,wu&&Ti())}}function cs(e){ai!==null&&ai.tag===0&&!(Ne&6)&&Zs();var t=Ne;Ne|=1;var n=An.transition,r=Le;try{if(An.transition=null,Le=1,e)return e()}finally{Le=r,An.transition=n,Ne=t,!(Ne&6)&&Ti()}}function dm(){on=Bs.current,Ge(Bs)}function Xi(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,cT(n)),ft!==null)for(n=ft.return;n!==null;){var r=n;switch(Wh(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Nc();break;case 3:xo(),Ge(Zt),Ge(Lt),em();break;case 5:Jh(r);break;case 4:xo();break;case 13:Ge(Xe);break;case 19:Ge(Xe);break;case 10:Qh(r.type._context);break;case 22:case 23:dm()}n=n.return}if(bt=e,ft=e=gi(e.current,null),Tt=on=t,vt=0,Va=null,lm=ku=ls=0,Qt=va=null,Bi!==null){for(t=0;t<Bi.length;t++)if(n=Bi[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}Bi=null}return e}function pb(e,t){do{var n=ft;try{if(Yh(),oc.current=Vc,zc){for(var r=tt.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}zc=!1}if(as=0,wt=mt=tt=null,ma=!1,Ba=0,am.current=null,n===null||n.return===null){vt=1,Va=t,ft=null;break}e:{var s=e,o=n.return,a=n,l=t;if(t=Tt,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=M0(o);if(h!==null){h.flags&=-257,P0(h,o,a,s,t),h.mode&1&&R0(s,c,t),t=h,l=c;var y=t.updateQueue;if(y===null){var b=new Set;b.add(l),t.updateQueue=b}else y.add(l);break e}else{if(!(t&1)){R0(s,c,t),fm();break e}l=Error(K(426))}}else if(Ye&&a.mode&1){var C=M0(o);if(C!==null){!(C.flags&65536)&&(C.flags|=256),P0(C,o,a,s,t),qh(wo(l,a));break e}}s=l=wo(l,a),vt!==4&&(vt=2),va===null?va=[s]:va.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var g=Kw(s,l,t);k0(s,g);break e;case 1:a=l;var m=s.type,w=s.stateNode;if(!(s.flags&128)&&(typeof m.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(hi===null||!hi.has(w)))){s.flags|=65536,t&=-t,s.lanes|=t;var S=Xw(s,a,t);k0(s,S);break e}}s=s.return}while(s!==null)}gb(n)}catch(T){t=T,ft===n&&n!==null&&(ft=n=n.return);continue}break}while(!0)}function hb(){var e=Uc.current;return Uc.current=Vc,e===null?Vc:e}function fm(){(vt===0||vt===3||vt===2)&&(vt=4),bt===null||!(ls&268435455)&&!(ku&268435455)||Qr(bt,Tt)}function qc(e,t){var n=Ne;Ne|=2;var r=hb();(bt!==e||Tt!==t)&&(Sr=null,Xi(e,t));do try{OT();break}catch(i){pb(e,i)}while(!0);if(Yh(),Ne=n,Uc.current=r,ft!==null)throw Error(K(261));return bt=null,Tt=0,vt}function OT(){for(;ft!==null;)mb(ft)}function DT(){for(;ft!==null&&!o_();)mb(ft)}function mb(e){var t=yb(e.alternate,e,on);e.memoizedProps=e.pendingProps,t===null?gb(e):ft=t,am.current=null}function gb(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=AT(n,t),n!==null){n.flags&=32767,ft=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{vt=6,ft=null;return}}else if(n=ET(n,t,on),n!==null){ft=n;return}if(t=t.sibling,t!==null){ft=t;return}ft=t=e}while(t!==null);vt===0&&(vt=5)}function Oi(e,t,n){var r=Le,i=An.transition;try{An.transition=null,Le=1,IT(e,t,n,r)}finally{An.transition=i,Le=r}return null}function IT(e,t,n,r){do Zs();while(ai!==null);if(Ne&6)throw Error(K(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(K(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(g_(e,s),e===bt&&(ft=bt=null,Tt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Fl||(Fl=!0,xb(Ec,function(){return Zs(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=An.transition,An.transition=null;var o=Le;Le=1;var a=Ne;Ne|=4,am.current=null,RT(e,n),ub(n,e),nT(Uf),jc=!!Vf,Uf=Vf=null,e.current=n,MT(n),a_(),Ne=a,Le=o,An.transition=s}else e.current=n;if(Fl&&(Fl=!1,ai=e,Wc=i),s=e.pendingLanes,s===0&&(hi=null),u_(n.stateNode),en(e,ut()),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(Hc)throw Hc=!1,e=cp,cp=null,e;return Wc&1&&e.tag!==0&&Zs(),s=e.pendingLanes,s&1?e===up?ya++:(ya=0,up=e):ya=0,Ti(),null}function Zs(){if(ai!==null){var e=K1(Wc),t=An.transition,n=Le;try{if(An.transition=null,Le=16>e?16:e,ai===null)var r=!1;else{if(e=ai,ai=null,Wc=0,Ne&6)throw Error(K(331));var i=Ne;for(Ne|=4,de=e.current;de!==null;){var s=de,o=s.child;if(de.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(de=c;de!==null;){var d=de;switch(d.tag){case 0:case 11:case 15:ga(8,d,s)}var u=d.child;if(u!==null)u.return=d,de=u;else for(;de!==null;){d=de;var p=d.sibling,h=d.return;if(ab(d),d===c){de=null;break}if(p!==null){p.return=h,de=p;break}de=h}}}var y=s.alternate;if(y!==null){var b=y.child;if(b!==null){y.child=null;do{var C=b.sibling;b.sibling=null,b=C}while(b!==null)}}de=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,de=o;else e:for(;de!==null;){if(s=de,s.flags&2048)switch(s.tag){case 0:case 11:case 15:ga(9,s,s.return)}var g=s.sibling;if(g!==null){g.return=s.return,de=g;break e}de=s.return}}var m=e.current;for(de=m;de!==null;){o=de;var w=o.child;if(o.subtreeFlags&2064&&w!==null)w.return=o,de=w;else e:for(o=m;de!==null;){if(a=de,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Su(9,a)}}catch(T){at(a,a.return,T)}if(a===o){de=null;break e}var S=a.sibling;if(S!==null){S.return=a.return,de=S;break e}de=a.return}}if(Ne=i,Ti(),lr&&typeof lr.onPostCommitFiberRoot=="function")try{lr.onPostCommitFiberRoot(mu,e)}catch{}r=!0}return r}finally{Le=n,An.transition=t}}return!1}function W0(e,t,n){t=wo(n,t),t=Kw(e,t,1),e=pi(e,t,1),t=Vt(),e!==null&&(cl(e,1,t),en(e,t))}function at(e,t,n){if(e.tag===3)W0(e,e,n);else for(;t!==null;){if(t.tag===3){W0(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(hi===null||!hi.has(r))){e=wo(n,e),e=Xw(t,e,1),t=pi(t,e,1),e=Vt(),t!==null&&(cl(t,1,e),en(t,e));break}}t=t.return}}function LT(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Vt(),e.pingedLanes|=e.suspendedLanes&n,bt===e&&(Tt&n)===n&&(vt===4||vt===3&&(Tt&130023424)===Tt&&500>ut()-cm?Xi(e,0):lm|=n),en(e,t)}function vb(e,t){t===0&&(e.mode&1?(t=Al,Al<<=1,!(Al&130023424)&&(Al=4194304)):t=1);var n=Vt();e=Nr(e,t),e!==null&&(cl(e,t,n),en(e,n))}function FT(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),vb(e,n)}function BT(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(K(314))}r!==null&&r.delete(t),vb(e,n)}var yb;yb=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Zt.current)Xt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Xt=!1,TT(e,t,n);Xt=!!(e.flags&131072)}else Xt=!1,Ye&&t.flags&1048576&&Cw(t,Ic,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;lc(e,t),e=t.pendingProps;var i=go(t,Lt.current);Xs(t,n),i=nm(null,t,r,e,i,n);var s=rm();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,Jt(r)?(s=!0,Oc(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Xh(t),i.updater=Cu,t.stateNode=i,i._reactInternals=t,Zf(t,r,e,n),t=tp(null,t,r,!0,s,n)):(t.tag=0,Ye&&s&&Hh(t),$t(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(lc(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=zT(r),e=Bn(r,e),i){case 0:t=ep(null,t,r,e,n);break e;case 1:t=D0(null,t,r,e,n);break e;case 11:t=N0(null,t,r,e,n);break e;case 14:t=O0(null,t,r,Bn(r.type,e),n);break e}throw Error(K(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Bn(r,i),ep(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Bn(r,i),D0(e,t,r,i,n);case 3:e:{if(tb(t),e===null)throw Error(K(387));r=t.pendingProps,s=t.memoizedState,i=s.element,Aw(e,t),Bc(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=wo(Error(K(423)),t),t=I0(e,t,r,n,i);break e}else if(r!==i){i=wo(Error(K(424)),t),t=I0(e,t,r,n,i);break e}else for(ln=fi(t.stateNode.containerInfo.firstChild),dn=t,Ye=!0,Hn=null,n=Tw(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(vo(),r===i){t=Or(e,t,n);break e}$t(e,t,r,n)}t=t.child}return t;case 5:return jw(t),e===null&&Qf(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,Hf(r,i)?o=null:s!==null&&Hf(r,s)&&(t.flags|=32),eb(e,t),$t(e,t,o,n),t.child;case 6:return e===null&&Qf(t),null;case 13:return nb(e,t,n);case 4:return Zh(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=yo(t,null,r,n):$t(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Bn(r,i),N0(e,t,r,i,n);case 7:return $t(e,t,t.pendingProps,n),t.child;case 8:return $t(e,t,t.pendingProps.children,n),t.child;case 12:return $t(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,Ve(Lc,r._currentValue),r._currentValue=o,s!==null)if(Qn(s.value,o)){if(s.children===i.children&&!Zt.current){t=Or(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=jr(-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),Kf(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(K(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Kf(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}$t(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Xs(t,n),i=Rn(i),r=r(i),t.flags|=1,$t(e,t,r,n),t.child;case 14:return r=t.type,i=Bn(r,t.pendingProps),i=Bn(r.type,i),O0(e,t,r,i,n);case 15:return Zw(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Bn(r,i),lc(e,t),t.tag=1,Jt(r)?(e=!0,Oc(t)):e=!1,Xs(t,n),Qw(t,r,i),Zf(t,r,i,n),tp(null,t,r,!0,e,n);case 19:return rb(e,t,n);case 22:return Jw(e,t,n)}throw Error(K(156,t.tag))};function xb(e,t){return q1(e,t)}function $T(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 Tn(e,t,n,r){return new $T(e,t,n,r)}function pm(e){return e=e.prototype,!(!e||!e.isReactComponent)}function zT(e){if(typeof e=="function")return pm(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ph)return 11;if(e===Nh)return 14}return 2}function gi(e,t){var n=e.alternate;return n===null?(n=Tn(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 dc(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")pm(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case js:return Zi(n.children,i,s,t);case Mh:o=8,i|=8;break;case Cf:return e=Tn(12,n,t,i|2),e.elementType=Cf,e.lanes=s,e;case Sf:return e=Tn(13,n,t,i),e.elementType=Sf,e.lanes=s,e;case kf:return e=Tn(19,n,t,i),e.elementType=kf,e.lanes=s,e;case j1:return _u(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case E1:o=10;break e;case A1:o=9;break e;case Ph:o=11;break e;case Nh:o=14;break e;case Wr:o=16,r=null;break e}throw Error(K(130,e==null?e:typeof e,""))}return t=Tn(o,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function Zi(e,t,n,r){return e=Tn(7,e,r,t),e.lanes=n,e}function _u(e,t,n,r){return e=Tn(22,e,r,t),e.elementType=j1,e.lanes=n,e.stateNode={isHidden:!1},e}function Dd(e,t,n){return e=Tn(6,e,null,t),e.lanes=n,e}function Id(e,t,n){return t=Tn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function VT(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=gd(0),this.expirationTimes=gd(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gd(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function hm(e,t,n,r,i,s,o,a,l){return e=new VT(e,t,n,a,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Tn(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Xh(s),e}function UT(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:As,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function wb(e){if(!e)return wi;e=e._reactInternals;e:{if(hs(e)!==e||e.tag!==1)throw Error(K(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Jt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(K(171))}if(e.tag===1){var n=e.type;if(Jt(n))return ww(e,n,t)}return t}function bb(e,t,n,r,i,s,o,a,l){return e=hm(n,r,!0,e,i,s,o,a,l),e.context=wb(null),n=e.current,r=Vt(),i=mi(n),s=jr(r,i),s.callback=t??null,pi(n,s,i),e.current.lanes=i,cl(e,i,r),en(e,r),e}function Tu(e,t,n,r){var i=t.current,s=Vt(),o=mi(i);return n=wb(n),t.context===null?t.context=n:t.pendingContext=n,t=jr(s,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=pi(i,t,o),e!==null&&(Gn(e,i,o,s),sc(e,i,o)),o}function Gc(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 q0(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function mm(e,t){q0(e,t),(e=e.alternate)&&q0(e,t)}function HT(){return null}var Cb=typeof reportError=="function"?reportError:function(e){console.error(e)};function gm(e){this._internalRoot=e}Eu.prototype.render=gm.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(K(409));Tu(e,t,null,null)};Eu.prototype.unmount=gm.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;cs(function(){Tu(null,e,null,null)}),t[Pr]=null}};function Eu(e){this._internalRoot=e}Eu.prototype.unstable_scheduleHydration=function(e){if(e){var t=J1();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Yr.length&&t!==0&&t<Yr[n].priority;n++);Yr.splice(n,0,e),n===0&&tw(e)}};function vm(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Au(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function G0(){}function WT(e,t,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var c=Gc(o);s.call(c)}}var o=bb(t,r,e,0,null,!1,!1,"",G0);return e._reactRootContainer=o,e[Pr]=o.current,Oa(e.nodeType===8?e.parentNode:e),cs(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var c=Gc(l);a.call(c)}}var l=hm(e,0,!1,null,null,!1,!1,"",G0);return e._reactRootContainer=l,e[Pr]=l.current,Oa(e.nodeType===8?e.parentNode:e),cs(function(){Tu(t,l,n,r)}),l}function ju(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=Gc(o);a.call(l)}}Tu(t,o,e,i)}else o=WT(n,t,e,i,r);return Gc(o)}X1=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=ta(t.pendingLanes);n!==0&&(Ih(t,n|1),en(t,ut()),!(Ne&6)&&(bo=ut()+500,Ti()))}break;case 13:cs(function(){var r=Nr(e,1);if(r!==null){var i=Vt();Gn(r,e,1,i)}}),mm(e,1)}};Lh=function(e){if(e.tag===13){var t=Nr(e,134217728);if(t!==null){var n=Vt();Gn(t,e,134217728,n)}mm(e,134217728)}};Z1=function(e){if(e.tag===13){var t=mi(e),n=Nr(e,t);if(n!==null){var r=Vt();Gn(n,e,t,r)}mm(e,t)}};J1=function(){return Le};ew=function(e,t){var n=Le;try{return Le=e,t()}finally{Le=n}};Of=function(e,t,n){switch(t){case"input":if(Ef(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=xu(r);if(!i)throw Error(K(90));M1(r),Ef(r,i)}}}break;case"textarea":N1(e,n);break;case"select":t=n.value,t!=null&&Gs(e,!!n.multiple,t,!1)}};$1=um;z1=cs;var qT={usingClientEntryPoint:!1,Events:[dl,Ns,xu,F1,B1,um]},Yo={findFiberByHostInstance:Fi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},GT={bundleType:Yo.bundleType,version:Yo.version,rendererPackageName:Yo.rendererPackageName,rendererConfig:Yo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Br.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=H1(e),e===null?null:e.stateNode},findFiberByHostInstance:Yo.findFiberByHostInstance||HT,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 Bl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Bl.isDisabled&&Bl.supportsFiber)try{mu=Bl.inject(GT),lr=Bl}catch{}}pn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=qT;pn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!vm(t))throw Error(K(200));return UT(e,t,null,n)};pn.createRoot=function(e,t){if(!vm(e))throw Error(K(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=hm(e,1,!1,null,null,n,!1,r,i),e[Pr]=t.current,Oa(e.nodeType===8?e.parentNode:e),new gm(t)};pn.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(K(188)):(e=Object.keys(e).join(","),Error(K(268,e)));return e=H1(t),e=e===null?null:e.stateNode,e};pn.flushSync=function(e){return cs(e)};pn.hydrate=function(e,t,n){if(!Au(t))throw Error(K(200));return ju(null,e,t,!0,n)};pn.hydrateRoot=function(e,t,n){if(!vm(e))throw Error(K(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=bb(t,null,e,1,n??null,i,!1,s,o),e[Pr]=t.current,Oa(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 Eu(t)};pn.render=function(e,t,n){if(!Au(t))throw Error(K(200));return ju(null,e,t,!1,n)};pn.unmountComponentAtNode=function(e){if(!Au(e))throw Error(K(40));return e._reactRootContainer?(cs(function(){ju(null,null,e,!1,function(){e._reactRootContainer=null,e[Pr]=null})}),!0):!1};pn.unstable_batchedUpdates=um;pn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Au(n))throw Error(K(200));if(e==null||e._reactInternals===void 0)throw Error(K(38));return ju(e,t,n,!1,r)};pn.version="18.3.1-next-f1338f8080-20240426";function Sb(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Sb)}catch(e){console.error(e)}}Sb(),S1.exports=pn;var kb=S1.exports;const YT=Fr(kb);var _b,Y0=kb;_b=Y0.createRoot,Y0.hydrateRoot;const QT="@alfatech/livechat",KT="2026.05.18.1",XT="module",ZT="https://api.chatier.app",JT="wss://api.chatier.app",eE=["dist","public/widget-manifest.json","README.md","component/chatier.js"],tE="dist/widget.js",nE={name:"Uygar Öztürk Ceylan",email:"uygaroztcyln@gmail.com"},rE={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"},iE={"@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"},sE={"@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"},Tb={name:QT,private:!1,version:KT,type:XT,apiURL:ZT,wsURL:JT,files:eE,main:tE,author:nE,scripts:rE,dependencies:iE,devDependencies:sE,"lint-staged":{"./**/*.{js,ts,tsx,json}":["npm run format"]}},Eb=Tb.apiURL,oE=Tb.wsURL,aE=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],lE=(e,t)=>[{message:"message"in t?t.message:"Not Found"},404],cE={429:aE,404:lE};async function mr(e,t={}){const n={};!(t.body instanceof FormData)&&t.body&&(n["Content-Type"]="application/json");const r=await fetch(`${Eb}/${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=cE[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 Yn=e=>[200,201,204].includes(e),uE=(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 No=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(){}},us=typeof window>"u"||"Deno"in globalThis;function Cn(){}function dE(e,t){return typeof e=="function"?e(t):e}function pp(e){return typeof e=="number"&&e>=0&&e!==1/0}function Ab(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Js(e,t){return typeof e=="function"?e(t):e}function Wn(e,t){return typeof e=="function"?e(t):e}function Q0(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:a}=e;if(o){if(r){if(t.queryHash!==ym(o,t.options))return!1}else if(!Ua(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 K0(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(ds(t.options.mutationKey)!==ds(s))return!1}else if(!Ua(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function ym(e,t){return((t==null?void 0:t.queryKeyHashFn)||ds)(e)}function ds(e){return JSON.stringify(e,(t,n)=>hp(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Ua(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Ua(e[n],t[n])):!1}function jb(e,t){if(e===t)return e;const n=X0(e)&&X0(t);if(n||hp(e)&&hp(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]=jb(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&l++)}return i===o&&l===i?e:a}return t}function Yc(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 X0(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function hp(e){if(!Z0(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Z0(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Z0(e){return Object.prototype.toString.call(e)==="[object Object]"}function fE(e){return new Promise(t=>{setTimeout(t,e)})}function mp(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?jb(e,t):t}function pE(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function hE(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var xm=Symbol();function Rb(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===xm?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Hi,Xr,to,n1,mE=(n1=class extends No{constructor(){super();we(this,Hi);we(this,Xr);we(this,to);le(this,to,t=>{if(!us&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){A(this,Xr)||this.setEventListener(A(this,to))}onUnsubscribe(){var t;this.hasListeners()||((t=A(this,Xr))==null||t.call(this),le(this,Xr,void 0))}setEventListener(t){var n;le(this,to,t),(n=A(this,Xr))==null||n.call(this),le(this,Xr,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){A(this,Hi)!==t&&(le(this,Hi,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof A(this,Hi)=="boolean"?A(this,Hi):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Hi=new WeakMap,Xr=new WeakMap,to=new WeakMap,n1),wm=new mE,no,Zr,ro,r1,gE=(r1=class extends No{constructor(){super();we(this,no,!0);we(this,Zr);we(this,ro);le(this,ro,t=>{if(!us&&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(){A(this,Zr)||this.setEventListener(A(this,ro))}onUnsubscribe(){var t;this.hasListeners()||((t=A(this,Zr))==null||t.call(this),le(this,Zr,void 0))}setEventListener(t){var n;le(this,ro,t),(n=A(this,Zr))==null||n.call(this),le(this,Zr,t(this.setOnline.bind(this)))}setOnline(t){A(this,no)!==t&&(le(this,no,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return A(this,no)}},no=new WeakMap,Zr=new WeakMap,ro=new WeakMap,r1),Qc=new gE;function gp(){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 vE(e){return Math.min(1e3*2**e,3e4)}function Mb(e){return(e??"online")==="online"?Qc.isOnline():!0}var Pb=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Ld(e){return e instanceof Pb}function Nb(e){let t=!1,n=0,r=!1,i;const s=gp(),o=b=>{var C;r||(p(new Pb(b)),(C=e.abort)==null||C.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>wm.isFocused()&&(e.networkMode==="always"||Qc.isOnline())&&e.canRun(),d=()=>Mb(e.networkMode)&&e.canRun(),u=b=>{var C;r||(r=!0,(C=e.onSuccess)==null||C.call(e,b),i==null||i(),s.resolve(b))},p=b=>{var C;r||(r=!0,(C=e.onError)==null||C.call(e,b),i==null||i(),s.reject(b))},h=()=>new Promise(b=>{var C;i=g=>{(r||c())&&b(g)},(C=e.onPause)==null||C.call(e)}).then(()=>{var b;i=void 0,r||(b=e.onContinue)==null||b.call(e)}),y=()=>{if(r)return;let b;const C=n===0?e.initialPromise:void 0;try{b=C??e.fn()}catch(g){b=Promise.reject(g)}Promise.resolve(b).then(u).catch(g=>{var k;if(r)return;const m=e.retry??(us?0:3),w=e.retryDelay??vE,S=typeof w=="function"?w(n,g):w,T=m===!0||typeof m=="number"&&n<m||typeof m=="function"&&m(n,g);if(t||!T){p(g);return}n++,(k=e.onFail)==null||k.call(e,n,g),fE(S).then(()=>c()?void 0:h()).then(()=>{t?p(g):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 yE(){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 gt=yE(),Wi,i1,Ob=(i1=class{constructor(){we(this,Wi)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),pp(this.gcTime)&&le(this,Wi,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(us?1/0:5*60*1e3))}clearGcTimeout(){A(this,Wi)&&(clearTimeout(A(this,Wi)),le(this,Wi,void 0))}},Wi=new WeakMap,i1),io,so,bn,Nt,il,qi,$n,Cr,s1,xE=(s1=class extends Ob{constructor(t){super();we(this,$n);we(this,io);we(this,so);we(this,bn);we(this,Nt);we(this,il);we(this,qi);le(this,qi,!1),le(this,il,t.defaultOptions),this.setOptions(t.options),this.observers=[],le(this,bn,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,le(this,io,wE(this.options)),this.state=t.state??A(this,io),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=A(this,Nt))==null?void 0:t.promise}setOptions(t){this.options={...A(this,il),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&A(this,bn).remove(this)}setData(t,n){const r=mp(this.state.data,t,this.options);return Ee(this,$n,Cr).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Ee(this,$n,Cr).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=A(this,Nt))==null?void 0:r.promise;return(i=A(this,Nt))==null||i.cancel(t),n?n.then(Cn).catch(Cn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(A(this,io))}isActive(){return this.observers.some(t=>Wn(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===xm||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||!Ab(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=A(this,Nt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=A(this,Nt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),A(this,bn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(A(this,Nt)&&(A(this,qi)?A(this,Nt).cancel({revert:!0}):A(this,Nt).cancelRetry()),this.scheduleGc()),A(this,bn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ee(this,$n,Cr).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(A(this,Nt))return A(this,Nt).continueRetry(),A(this,Nt).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,qi,!0),r.signal)})},s=()=>{const u=Rb(this.options,n),p={queryKey:this.queryKey,meta:this.meta};return i(p),le(this,qi,!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,so,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=o.fetchOptions)==null?void 0:c.meta))&&Ee(this,$n,Cr).call(this,{type:"fetch",meta:(d=o.fetchOptions)==null?void 0:d.meta});const a=u=>{var p,h,y,b;Ld(u)&&u.silent||Ee(this,$n,Cr).call(this,{type:"error",error:u}),Ld(u)||((h=(p=A(this,bn).config).onError)==null||h.call(p,u,this),(b=(y=A(this,bn).config).onSettled)==null||b.call(y,this.state.data,u,this)),this.scheduleGc()};return le(this,Nt,Nb({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:u=>{var p,h,y,b;if(u===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(u)}catch(C){a(C);return}(h=(p=A(this,bn).config).onSuccess)==null||h.call(p,u,this),(b=(y=A(this,bn).config).onSettled)==null||b.call(y,u,this.state.error,this),this.scheduleGc()},onError:a,onFail:(u,p)=>{Ee(this,$n,Cr).call(this,{type:"failed",failureCount:u,error:p})},onPause:()=>{Ee(this,$n,Cr).call(this,{type:"pause"})},onContinue:()=>{Ee(this,$n,Cr).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),A(this,Nt).start()}},io=new WeakMap,so=new WeakMap,bn=new WeakMap,Nt=new WeakMap,il=new WeakMap,qi=new WeakMap,$n=new WeakSet,Cr=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,...Db(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 Ld(i)&&i.revert&&A(this,so)?{...A(this,so),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),gt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),A(this,bn).notify({query:this,type:"updated",action:t})})},s1);function Db(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Mb(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function wE(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 rr,o1,bE=(o1=class extends No{constructor(t={}){super();we(this,rr);this.config=t,le(this,rr,new Map)}build(t,n,r){const i=n.queryKey,s=n.queryHash??ym(i,n);let o=this.get(s);return o||(o=new xE({cache:this,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){A(this,rr).has(t.queryHash)||(A(this,rr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=A(this,rr).get(t.queryHash);n&&(t.destroy(),n===t&&A(this,rr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){gt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return A(this,rr).get(t)}getAll(){return[...A(this,rr).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Q0(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Q0(t,r)):n}notify(t){gt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){gt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){gt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},rr=new WeakMap,o1),ir,Ft,Gi,sr,Ur,a1,CE=(a1=class extends Ob{constructor(t){super();we(this,sr);we(this,ir);we(this,Ft);we(this,Gi);this.mutationId=t.mutationId,le(this,Ft,t.mutationCache),le(this,ir,[]),this.state=t.state||Ib(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){A(this,ir).includes(t)||(A(this,ir).push(t),this.clearGcTimeout(),A(this,Ft).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){le(this,ir,A(this,ir).filter(n=>n!==t)),this.scheduleGc(),A(this,Ft).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){A(this,ir).length||(this.state.status==="pending"?this.scheduleGc():A(this,Ft).remove(this))}continue(){var t;return((t=A(this,Gi))==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,b,C,g,m,w,S,T,k,E;le(this,Gi,Nb({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(M,U)=>{Ee(this,sr,Ur).call(this,{type:"failed",failureCount:M,error:U})},onPause:()=>{Ee(this,sr,Ur).call(this,{type:"pause"})},onContinue:()=>{Ee(this,sr,Ur).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>A(this,Ft).canRun(this)}));const n=this.state.status==="pending",r=!A(this,Gi).canStart();try{if(!n){Ee(this,sr,Ur).call(this,{type:"pending",variables:t,isPaused:r}),await((s=(i=A(this,Ft).config).onMutate)==null?void 0:s.call(i,t,this));const U=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,t));U!==this.state.context&&Ee(this,sr,Ur).call(this,{type:"pending",context:U,variables:t,isPaused:r})}const M=await A(this,Gi).start();return await((c=(l=A(this,Ft).config).onSuccess)==null?void 0:c.call(l,M,t,this.state.context,this)),await((u=(d=this.options).onSuccess)==null?void 0:u.call(d,M,t,this.state.context)),await((h=(p=A(this,Ft).config).onSettled)==null?void 0:h.call(p,M,null,this.state.variables,this.state.context,this)),await((b=(y=this.options).onSettled)==null?void 0:b.call(y,M,null,t,this.state.context)),Ee(this,sr,Ur).call(this,{type:"success",data:M}),M}catch(M){try{throw await((g=(C=A(this,Ft).config).onError)==null?void 0:g.call(C,M,t,this.state.context,this)),await((w=(m=this.options).onError)==null?void 0:w.call(m,M,t,this.state.context)),await((T=(S=A(this,Ft).config).onSettled)==null?void 0:T.call(S,void 0,M,this.state.variables,this.state.context,this)),await((E=(k=this.options).onSettled)==null?void 0:E.call(k,void 0,M,t,this.state.context)),M}finally{Ee(this,sr,Ur).call(this,{type:"error",error:M})}}finally{A(this,Ft).runNext(this)}}},ir=new WeakMap,Ft=new WeakMap,Gi=new WeakMap,sr=new WeakSet,Ur=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),gt.batch(()=>{A(this,ir).forEach(r=>{r.onMutationUpdate(t)}),A(this,Ft).notify({mutation:this,type:"updated",action:t})})},a1);function Ib(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var rn,sl,l1,SE=(l1=class extends No{constructor(t={}){super();we(this,rn);we(this,sl);this.config=t,le(this,rn,new Map),le(this,sl,Date.now())}build(t,n,r){const i=new CE({mutationCache:this,mutationId:++Cl(this,sl)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){const n=$l(t),r=A(this,rn).get(n)??[];r.push(t),A(this,rn).set(n,r),this.notify({type:"added",mutation:t})}remove(t){var r;const n=$l(t);if(A(this,rn).has(n)){const i=(r=A(this,rn).get(n))==null?void 0:r.filter(s=>s!==t);i&&(i.length===0?A(this,rn).delete(n):A(this,rn).set(n,i))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=(r=A(this,rn).get($l(t)))==null?void 0:r.find(i=>i.state.status==="pending");return!n||n===t}runNext(t){var r;const n=(r=A(this,rn).get($l(t)))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){gt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...A(this,rn).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(r=>K0(n,r))}findAll(t={}){return this.getAll().filter(n=>K0(t,n))}notify(t){gt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return gt.batch(()=>Promise.all(t.map(n=>n.continue().catch(Cn))))}},rn=new WeakMap,sl=new WeakMap,l1);function $l(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function J0(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 b=!1;const C=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?b=!0:t.signal.addEventListener("abort",()=>{b=!0}),t.signal)})},g=Rb(t.options,t.fetchOptions),m=async(w,S,T)=>{if(b)return Promise.reject();if(S==null&&w.pages.length)return Promise.resolve(w);const k={queryKey:t.queryKey,pageParam:S,direction:T?"backward":"forward",meta:t.options.meta};C(k);const E=await g(k),{maxPages:M}=t.options,U=T?hE:pE;return{pages:U(w.pages,E,M),pageParams:U(w.pageParams,S,M)}};if(i&&s.length){const w=i==="backward",S=w?kE:ev,T={pages:s,pageParams:o},k=S(r,T);a=await m(T,k,w)}else{const w=e??s.length;do{const S=l===0?o[0]??r.initialPageParam:ev(r,a);if(l>0&&S==null)break;a=await m(a,S),l++}while(l<w)}return a};t.options.persister?t.fetchFn=()=>{var b,C;return(C=(b=t.options).persister)==null?void 0:C.call(b,c,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function ev(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 kE(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 st,Jr,ei,oo,ao,ti,lo,co,c1,_E=(c1=class{constructor(e={}){we(this,st);we(this,Jr);we(this,ei);we(this,oo);we(this,ao);we(this,ti);we(this,lo);we(this,co);le(this,st,e.queryCache||new bE),le(this,Jr,e.mutationCache||new SE),le(this,ei,e.defaultOptions||{}),le(this,oo,new Map),le(this,ao,new Map),le(this,ti,0)}mount(){Cl(this,ti)._++,A(this,ti)===1&&(le(this,lo,wm.subscribe(async e=>{e&&(await this.resumePausedMutations(),A(this,st).onFocus())})),le(this,co,Qc.subscribe(async e=>{e&&(await this.resumePausedMutations(),A(this,st).onOnline())})))}unmount(){var e,t;Cl(this,ti)._--,A(this,ti)===0&&((e=A(this,lo))==null||e.call(this),le(this,lo,void 0),(t=A(this,co))==null||t.call(this),le(this,co,void 0))}isFetching(e){return A(this,st).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return A(this,Jr).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=A(this,st).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=A(this,st).build(this,n);return e.revalidateIfStale&&r.isStaleByTime(Js(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return A(this,st).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=A(this,st).get(r.queryHash),s=i==null?void 0:i.state.data,o=dE(t,s);if(o!==void 0)return A(this,st).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return gt.batch(()=>A(this,st).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=A(this,st).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=A(this,st);gt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=A(this,st),r={type:"active",...e};return gt.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=gt.batch(()=>A(this,st).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Cn).catch(Cn)}invalidateQueries(e,t={}){return gt.batch(()=>{if(A(this,st).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=gt.batch(()=>A(this,st).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(Cn)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Cn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=A(this,st).build(this,t);return n.isStaleByTime(Js(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Cn).catch(Cn)}fetchInfiniteQuery(e){return e.behavior=J0(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Cn).catch(Cn)}ensureInfiniteQueryData(e){return e.behavior=J0(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Qc.isOnline()?A(this,Jr).resumePausedMutations():Promise.resolve()}getQueryCache(){return A(this,st)}getMutationCache(){return A(this,Jr)}getDefaultOptions(){return A(this,ei)}setDefaultOptions(e){le(this,ei,e)}setQueryDefaults(e,t){A(this,oo).set(ds(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...A(this,oo).values()],n={};return t.forEach(r=>{Ua(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){A(this,ao).set(ds(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...A(this,ao).values()];let n={};return t.forEach(r=>{Ua(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...A(this,ei).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=ym(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===xm&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...A(this,ei).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){A(this,st).clear(),A(this,Jr).clear()}},st=new WeakMap,Jr=new WeakMap,ei=new WeakMap,oo=new WeakMap,ao=new WeakMap,ti=new WeakMap,lo=new WeakMap,co=new WeakMap,c1),qt,Re,ol,Bt,Yi,uo,ni,or,al,fo,po,Qi,Ki,ri,ho,Ie,ra,vp,yp,xp,wp,bp,Cp,Sp,Lb,u1,TE=(u1=class extends No{constructor(t,n){super();we(this,Ie);we(this,qt);we(this,Re);we(this,ol);we(this,Bt);we(this,Yi);we(this,uo);we(this,ni);we(this,or);we(this,al);we(this,fo);we(this,po);we(this,Qi);we(this,Ki);we(this,ri);we(this,ho,new Set);this.options=n,le(this,qt,t),le(this,or,null),le(this,ni,gp()),this.options.experimental_prefetchInRender||A(this,ni).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&&(A(this,Re).addObserver(this),tv(A(this,Re),this.options)?Ee(this,Ie,ra).call(this):this.updateResult(),Ee(this,Ie,wp).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return kp(A(this,Re),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return kp(A(this,Re),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ee(this,Ie,bp).call(this),Ee(this,Ie,Cp).call(this),A(this,Re).removeObserver(this)}setOptions(t,n){const r=this.options,i=A(this,Re);if(this.options=A(this,qt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Wn(this.options.enabled,A(this,Re))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ee(this,Ie,Sp).call(this),A(this,Re).setOptions(this.options),r._defaulted&&!Yc(this.options,r)&&A(this,qt).getQueryCache().notify({type:"observerOptionsUpdated",query:A(this,Re),observer:this});const s=this.hasListeners();s&&nv(A(this,Re),i,this.options,r)&&Ee(this,Ie,ra).call(this),this.updateResult(n),s&&(A(this,Re)!==i||Wn(this.options.enabled,A(this,Re))!==Wn(r.enabled,A(this,Re))||Js(this.options.staleTime,A(this,Re))!==Js(r.staleTime,A(this,Re)))&&Ee(this,Ie,vp).call(this);const o=Ee(this,Ie,yp).call(this);s&&(A(this,Re)!==i||Wn(this.options.enabled,A(this,Re))!==Wn(r.enabled,A(this,Re))||o!==A(this,ri))&&Ee(this,Ie,xp).call(this,o)}getOptimisticResult(t){const n=A(this,qt).getQueryCache().build(A(this,qt),t),r=this.createResult(n,t);return AE(this,r)&&(le(this,Bt,r),le(this,uo,this.options),le(this,Yi,A(this,Re).state)),r}getCurrentResult(){return A(this,Bt)}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){A(this,ho).add(t)}getCurrentQuery(){return A(this,Re)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=A(this,qt).defaultQueryOptions(t),r=A(this,qt).getQueryCache().build(A(this,qt),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Ee(this,Ie,ra).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),A(this,Bt)))}createResult(t,n){var M;const r=A(this,Re),i=this.options,s=A(this,Bt),o=A(this,Yi),a=A(this,uo),c=t!==r?t.state:A(this,ol),{state:d}=t;let u={...d},p=!1,h;if(n._optimisticResults){const U=this.hasListeners(),j=!U&&tv(t,n),N=U&&nv(t,r,n,i);(j||N)&&(u={...u,...Db(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:y,errorUpdatedAt:b,status:C}=u;if(n.select&&u.data!==void 0)if(s&&u.data===(o==null?void 0:o.data)&&n.select===A(this,al))h=A(this,fo);else try{le(this,al,n.select),h=n.select(u.data),h=mp(s==null?void 0:s.data,h,n),le(this,fo,h),le(this,or,null)}catch(U){le(this,or,U)}else h=u.data;if(n.placeholderData!==void 0&&h===void 0&&C==="pending"){let U;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))U=s.data;else if(U=typeof n.placeholderData=="function"?n.placeholderData((M=A(this,po))==null?void 0:M.state.data,A(this,po)):n.placeholderData,n.select&&U!==void 0)try{U=n.select(U),le(this,or,null)}catch(j){le(this,or,j)}U!==void 0&&(C="success",h=mp(s==null?void 0:s.data,U,n),p=!0)}A(this,or)&&(y=A(this,or),h=A(this,fo),b=Date.now(),C="error");const g=u.fetchStatus==="fetching",m=C==="pending",w=C==="error",S=m&&g,T=h!==void 0,E={status:C,fetchStatus:u.fetchStatus,isPending:m,isSuccess:C==="success",isError:w,isInitialLoading:S,isLoading:S,data:h,dataUpdatedAt:u.dataUpdatedAt,error:y,errorUpdatedAt:b,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:g,isRefetching:g&&!m,isLoadingError:w&&!T,isPaused:u.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:w&&T,isStale:bm(t,n),refetch:this.refetch,promise:A(this,ni)};if(this.options.experimental_prefetchInRender){const U=O=>{E.status==="error"?O.reject(E.error):E.data!==void 0&&O.resolve(E.data)},j=()=>{const O=le(this,ni,E.promise=gp());U(O)},N=A(this,ni);switch(N.status){case"pending":t.queryHash===r.queryHash&&U(N);break;case"fulfilled":(E.status==="error"||E.data!==N.value)&&j();break;case"rejected":(E.status!=="error"||E.error!==N.reason)&&j();break}}return E}updateResult(t){const n=A(this,Bt),r=this.createResult(A(this,Re),this.options);if(le(this,Yi,A(this,Re).state),le(this,uo,this.options),A(this,Yi).data!==void 0&&le(this,po,A(this,Re)),Yc(r,n))return;le(this,Bt,r);const i={},s=()=>{if(!n)return!0;const{notifyOnChangeProps:o}=this.options,a=typeof o=="function"?o():o;if(a==="all"||!a&&!A(this,ho).size)return!0;const l=new Set(a??A(this,ho));return this.options.throwOnError&&l.add("error"),Object.keys(A(this,Bt)).some(c=>{const d=c;return A(this,Bt)[d]!==n[d]&&l.has(d)})};(t==null?void 0:t.listeners)!==!1&&s()&&(i.listeners=!0),Ee(this,Ie,Lb).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ee(this,Ie,wp).call(this)}},qt=new WeakMap,Re=new WeakMap,ol=new WeakMap,Bt=new WeakMap,Yi=new WeakMap,uo=new WeakMap,ni=new WeakMap,or=new WeakMap,al=new WeakMap,fo=new WeakMap,po=new WeakMap,Qi=new WeakMap,Ki=new WeakMap,ri=new WeakMap,ho=new WeakMap,Ie=new WeakSet,ra=function(t){Ee(this,Ie,Sp).call(this);let n=A(this,Re).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Cn)),n},vp=function(){Ee(this,Ie,bp).call(this);const t=Js(this.options.staleTime,A(this,Re));if(us||A(this,Bt).isStale||!pp(t))return;const r=Ab(A(this,Bt).dataUpdatedAt,t)+1;le(this,Qi,setTimeout(()=>{A(this,Bt).isStale||this.updateResult()},r))},yp=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(A(this,Re)):this.options.refetchInterval)??!1},xp=function(t){Ee(this,Ie,Cp).call(this),le(this,ri,t),!(us||Wn(this.options.enabled,A(this,Re))===!1||!pp(A(this,ri))||A(this,ri)===0)&&le(this,Ki,setInterval(()=>{(this.options.refetchIntervalInBackground||wm.isFocused())&&Ee(this,Ie,ra).call(this)},A(this,ri)))},wp=function(){Ee(this,Ie,vp).call(this),Ee(this,Ie,xp).call(this,Ee(this,Ie,yp).call(this))},bp=function(){A(this,Qi)&&(clearTimeout(A(this,Qi)),le(this,Qi,void 0))},Cp=function(){A(this,Ki)&&(clearInterval(A(this,Ki)),le(this,Ki,void 0))},Sp=function(){const t=A(this,qt).getQueryCache().build(A(this,qt),this.options);if(t===A(this,Re))return;const n=A(this,Re);le(this,Re,t),le(this,ol,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Lb=function(t){gt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(A(this,Bt))}),A(this,qt).getQueryCache().notify({query:A(this,Re),type:"observerResultsUpdated"})})},u1);function EE(e,t){return Wn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function tv(e,t){return EE(e,t)||e.state.data!==void 0&&kp(e,t,t.refetchOnMount)}function kp(e,t,n){if(Wn(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&bm(e,t)}return!1}function nv(e,t,n,r){return(e!==t||Wn(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&bm(e,n)}function bm(e,t){return Wn(t.enabled,e)!==!1&&e.isStaleByTime(Js(t.staleTime,e))}function AE(e,t){return!Yc(e.getCurrentResult(),t)}var ii,si,Gt,Tr,Rr,fc,_p,d1,jE=(d1=class extends No{constructor(t,n){super();we(this,Rr);we(this,ii);we(this,si);we(this,Gt);we(this,Tr);le(this,ii,t),this.setOptions(n),this.bindMethods(),Ee(this,Rr,fc).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=A(this,ii).defaultMutationOptions(t),Yc(this.options,n)||A(this,ii).getMutationCache().notify({type:"observerOptionsUpdated",mutation:A(this,Gt),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&ds(n.mutationKey)!==ds(this.options.mutationKey)?this.reset():((r=A(this,Gt))==null?void 0:r.state.status)==="pending"&&A(this,Gt).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=A(this,Gt))==null||t.removeObserver(this)}onMutationUpdate(t){Ee(this,Rr,fc).call(this),Ee(this,Rr,_p).call(this,t)}getCurrentResult(){return A(this,si)}reset(){var t;(t=A(this,Gt))==null||t.removeObserver(this),le(this,Gt,void 0),Ee(this,Rr,fc).call(this),Ee(this,Rr,_p).call(this)}mutate(t,n){var r;return le(this,Tr,n),(r=A(this,Gt))==null||r.removeObserver(this),le(this,Gt,A(this,ii).getMutationCache().build(A(this,ii),this.options)),A(this,Gt).addObserver(this),A(this,Gt).execute(t)}},ii=new WeakMap,si=new WeakMap,Gt=new WeakMap,Tr=new WeakMap,Rr=new WeakSet,fc=function(){var n;const t=((n=A(this,Gt))==null?void 0:n.state)??Ib();le(this,si,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},_p=function(t){gt.batch(()=>{var n,r,i,s,o,a,l,c;if(A(this,Tr)&&this.hasListeners()){const d=A(this,si).variables,u=A(this,si).context;(t==null?void 0:t.type)==="success"?((r=(n=A(this,Tr)).onSuccess)==null||r.call(n,t.data,d,u),(s=(i=A(this,Tr)).onSettled)==null||s.call(i,t.data,null,d,u)):(t==null?void 0:t.type)==="error"&&((a=(o=A(this,Tr)).onError)==null||a.call(o,t.error,d,u),(c=(l=A(this,Tr)).onSettled)==null||c.call(l,void 0,t.error,d,u))}this.listeners.forEach(d=>{d(A(this,si))})})},d1),Fb=v.createContext(void 0),Ru=e=>{const t=v.useContext(Fb);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},RE=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),f.jsx(Fb.Provider,{value:e,children:t})),Bb=v.createContext(!1),ME=()=>v.useContext(Bb);Bb.Provider;function PE(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var NE=v.createContext(PE()),OE=()=>v.useContext(NE);function $b(e,t){return typeof e=="function"?e(...t):!!e}function Tp(){}var DE=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},IE=e=>{v.useEffect(()=>{e.clearReset()},[e])},LE=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&$b(n,[e.error,r]),FE=e=>{e.suspense&&(e.staleTime===void 0&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},BE=(e,t)=>e.isLoading&&e.isFetching&&!t,$E=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,rv=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function zE(e,t,n){var d,u,p,h,y;const r=Ru(),i=ME(),s=OE(),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",FE(o),DE(o,s),IE(s);const a=!r.getQueryCache().get(o.queryHash),[l]=v.useState(()=>new t(r,o)),c=l.getOptimisticResult(o);if(v.useSyncExternalStore(v.useCallback(b=>{const C=i?Tp:l.subscribe(gt.batchCalls(b));return l.updateResult(),C},[l,i]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),v.useEffect(()=>{l.setOptions(o,{listeners:!1})},[o,l]),$E(o,c))throw rv(o,l,s);if(LE({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&&!us&&BE(c,i)){const b=a?rv(o,l,s):(y=r.getQueryCache().get(o.queryHash))==null?void 0:y.promise;b==null||b.catch(Tp).finally(()=>{l.updateResult()})}return o.notifyOnChangeProps?c:l.trackResult(c)}function Cm(e,t){return zE(e,TE)}function Sm(e,t){const n=Ru(),[r]=v.useState(()=>new jE(n,e));v.useEffect(()=>{r.setOptions(e)},[r,e]);const i=v.useSyncExternalStore(v.useCallback(o=>r.subscribe(gt.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=v.useCallback((o,a)=>{r.mutate(o,a).catch(Tp)},[r]);if(i.error&&$b(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}const VE=(e,t)=>Cm({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 x=(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))(x||{}),se=(e=>(e.TooltipDefault="tooltip_default",e.TooltipActive="tooltip_active",e.TooltipBalloonTitle="tooltip_balloon_title",e.TooltipBalloonSub="tooltip_balloon_sub",e.TooltipBalloonGreeting="tooltip_balloon_greeting",e.CloseButtonAria="close_button_aria",e.MessagePlaceholder="message_placeholder",e.FileUploadDisabled="file_upload_disabled",e.NewMessagesNotification="new_messages_notification",e.MinimizedUnreadMessage="minimized_unread_message",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))(se||{}),Be=(e=>(e.Light="light",e.Dark="dark",e.System="system",e))(Be||{});function HE(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"}/**
|
|
1
|
+
var Uo=t=>{throw TypeError(t)};var fp=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Ss=(t,e,n)=>e.has(t)||Uo("Cannot "+n);var x=(t,e,n)=>(Ss(t,e,"read from private field"),n?n.call(t):e.get(t)),me=(t,e,n)=>e.has(t)?Uo("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),re=(t,e,n,r)=>(Ss(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),ke=(t,e,n)=>(Ss(t,e,"access private method"),n);var fi=(t,e,n,r)=>({set _(i){re(t,e,i,n)},get _(){return x(t,e,r)}});import{r as p,j as o,R as hp,a as J,b as mp,c as Ie,g as Ir,u as Ee,W as g,M as gp,d as Pa,P as yp,e as vp,f as xp,L as bp,m as $e,I as fe,h as Er,i as Ba,k as wp,T as Cp,l as hi,n as qo,N as Wo,H as Vo,Q as _p,o as dt,p as Mr,q as _e,s as Ko,C as Qc,t as kp,v as Sp,w as Yo,x as jp,y as Ep}from"./ChatierHeaderMark.js";var V1=fp((Ot,Nt)=>{const Tp="@alfatech/livechat",Ap="2026.06.09.1",Rp="module",Op="https://api.chatier.app",Np="wss://api.chatier.app",Ip=["dist","public/widget-manifest.json","README.md","component/chatier.js"],Mp="dist/widget.js",$p={name:"Uygar Öztürk Ceylan",email:"uygaroztcyln@gmail.com"},Dp={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"},Fp={"@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"},Pp={"@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"},Xc={name:Tp,private:!1,version:Ap,type:Rp,apiURL:Op,wsURL:Np,files:Ip,main:Mp,author:$p,scripts:Dp,dependencies:Fp,devDependencies:Pp,"lint-staged":{"./**/*.{js,ts,tsx,json}":["npm run format"]}},Jc=Xc.apiURL,Bp=Xc.wsURL,Lp=t=>[{limit:Number.parseInt(t.headers.get("X-Ratelimit-Limit")||"0"),remaining:Number.parseInt(t.headers.get("X-Ratelimit-Remaining")||"0"),reset:Number.parseInt(t.headers.get("X-Ratelimit-Reset")||"0"),retryAfter:Number.parseInt(t.headers.get("Retry-After")||"0")},429],zp=(t,e)=>[{message:"message"in e?e.message:"Not Found"},404],Hp={429:Lp,404:zp};async function _t(t,e={}){const n={};!(e.body instanceof FormData)&&e.body&&(n["Content-Type"]="application/json");const r=await fetch(`${Jc}/${t}`,{...e,credentials:"include",headers:{...e.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 a=Hp[r.status];return a?a(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 gt=t=>[200,201,204].includes(t),Up=(t,{arrayWithBrackets:e=!1,arrayWithBracketAndIndex:n=!0}={})=>{const r=new FormData;for(const[i,s]of Object.entries(t)){if(Array.isArray(s)){for(const a in s)e?r.append(`${i}[]`,s[a]):n?r.append(`${i}[${a}]`,s[a]):r.append(i,s[a]);continue}typeof s<"u"&&s!==null&&r.append(i,s)}return r};var $r=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Gn=typeof window>"u"||"Deno"in globalThis;function Pt(){}function qp(t,e){return typeof t=="function"?t(e):t}function Ys(t){return typeof t=="number"&&t>=0&&t!==1/0}function Zc(t,e){return Math.max(t+(e||0)-Date.now(),0)}function pr(t,e){return typeof t=="function"?t(e):t}function Wt(t,e){return typeof t=="function"?t(e):t}function Go(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:a,stale:l}=t;if(a){if(r){if(e.queryHash!==La(a,e.options))return!1}else if(!Jr(e.queryKey,a))return!1}if(n!=="all"){const c=e.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof l=="boolean"&&e.isStale()!==l||i&&i!==e.state.fetchStatus||s&&!s(e))}function Qo(t,e){const{exact:n,status:r,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(n){if(Qn(e.options.mutationKey)!==Qn(s))return!1}else if(!Jr(e.options.mutationKey,s))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function La(t,e){return((e==null?void 0:e.queryKeyHashFn)||Qn)(t)}function Qn(t){return JSON.stringify(t,(e,n)=>Gs(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Jr(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(n=>!Jr(t[n],e[n])):!1}function eu(t,e){if(t===e)return t;const n=Xo(t)&&Xo(e);if(n||Gs(t)&&Gs(e)){const r=n?t:Object.keys(t),i=r.length,s=n?e:Object.keys(e),a=s.length,l=n?[]:{};let c=0;for(let d=0;d<a;d++){const f=n?d:s[d];(!n&&r.includes(f)||n)&&t[f]===void 0&&e[f]===void 0?(l[f]=void 0,c++):(l[f]=eu(t[f],e[f]),l[f]===t[f]&&t[f]!==void 0&&c++)}return i===a&&c===i?t:l}return e}function $i(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function Xo(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Gs(t){if(!Jo(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!Jo(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function Jo(t){return Object.prototype.toString.call(t)==="[object Object]"}function Wp(t){return new Promise(e=>{setTimeout(e,t)})}function Qs(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?eu(t,e):e}function Vp(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function Kp(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var za=Symbol();function tu(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===za?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var Fn,xn,hr,Lc,Yp=(Lc=class extends $r{constructor(){super();me(this,Fn);me(this,xn);me(this,hr);re(this,hr,e=>{if(!Gn&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){x(this,xn)||this.setEventListener(x(this,hr))}onUnsubscribe(){var e;this.hasListeners()||((e=x(this,xn))==null||e.call(this),re(this,xn,void 0))}setEventListener(e){var n;re(this,hr,e),(n=x(this,xn))==null||n.call(this),re(this,xn,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){x(this,Fn)!==e&&(re(this,Fn,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof x(this,Fn)=="boolean"?x(this,Fn):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Fn=new WeakMap,xn=new WeakMap,hr=new WeakMap,Lc),Ha=new Yp,mr,bn,gr,zc,Gp=(zc=class extends $r{constructor(){super();me(this,mr,!0);me(this,bn);me(this,gr);re(this,gr,e=>{if(!Gn&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){x(this,bn)||this.setEventListener(x(this,gr))}onUnsubscribe(){var e;this.hasListeners()||((e=x(this,bn))==null||e.call(this),re(this,bn,void 0))}setEventListener(e){var n;re(this,gr,e),(n=x(this,bn))==null||n.call(this),re(this,bn,e(this.setOnline.bind(this)))}setOnline(e){x(this,mr)!==e&&(re(this,mr,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return x(this,mr)}},mr=new WeakMap,bn=new WeakMap,gr=new WeakMap,zc),Di=new Gp;function Xs(){let t,e;const n=new Promise((i,s)=>{t=i,e=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}),t(i)},n.reject=i=>{r({status:"rejected",reason:i}),e(i)},n}function Qp(t){return Math.min(1e3*2**t,3e4)}function nu(t){return(t??"online")==="online"?Di.isOnline():!0}var ru=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function js(t){return t instanceof ru}function iu(t){let e=!1,n=0,r=!1,i;const s=Xs(),a=C=>{var y;r||(m(new ru(C)),(y=t.abort)==null||y.call(t))},l=()=>{e=!0},c=()=>{e=!1},d=()=>Ha.isFocused()&&(t.networkMode==="always"||Di.isOnline())&&t.canRun(),f=()=>nu(t.networkMode)&&t.canRun(),u=C=>{var y;r||(r=!0,(y=t.onSuccess)==null||y.call(t,C),i==null||i(),s.resolve(C))},m=C=>{var y;r||(r=!0,(y=t.onError)==null||y.call(t,C),i==null||i(),s.reject(C))},h=()=>new Promise(C=>{var y;i=v=>{(r||d())&&C(v)},(y=t.onPause)==null||y.call(t)}).then(()=>{var C;i=void 0,r||(C=t.onContinue)==null||C.call(t)}),b=()=>{if(r)return;let C;const y=n===0?t.initialPromise:void 0;try{C=y??t.fn()}catch(v){C=Promise.reject(v)}Promise.resolve(C).then(u).catch(v=>{var w;if(r)return;const E=t.retry??(Gn?0:3),I=t.retryDelay??Qp,_=typeof I=="function"?I(n,v):I,L=E===!0||typeof E=="number"&&n<E||typeof E=="function"&&E(n,v);if(e||!L){m(v);return}n++,(w=t.onFail)==null||w.call(t,n,v),Wp(_).then(()=>d()?void 0:h()).then(()=>{e?m(v):b()})})};return{promise:s,cancel:a,continue:()=>(i==null||i(),s),cancelRetry:l,continueRetry:c,canStart:f,start:()=>(f()?b():h().then(b),s)}}function Xp(){let t=[],e=0,n=l=>{l()},r=l=>{l()},i=l=>setTimeout(l,0);const s=l=>{e?t.push(l):i(()=>{n(l)})},a=()=>{const l=t;t=[],l.length&&i(()=>{r(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;e++;try{c=l()}finally{e--,e||a()}return c},batchCalls:l=>(...c)=>{s(()=>{l(...c)})},schedule:s,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{i=l}}}var nt=Xp(),Pn,Hc,su=(Hc=class{constructor(){me(this,Pn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ys(this.gcTime)&&re(this,Pn,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Gn?1/0:5*60*1e3))}clearGcTimeout(){x(this,Pn)&&(clearTimeout(x(this,Pn)),re(this,Pn,void 0))}},Pn=new WeakMap,Hc),yr,vr,Ft,ut,ii,Bn,Ht,dn,Uc,Jp=(Uc=class extends su{constructor(e){super();me(this,Ht);me(this,yr);me(this,vr);me(this,Ft);me(this,ut);me(this,ii);me(this,Bn);re(this,Bn,!1),re(this,ii,e.defaultOptions),this.setOptions(e.options),this.observers=[],re(this,Ft,e.cache),this.queryKey=e.queryKey,this.queryHash=e.queryHash,re(this,yr,Zp(this.options)),this.state=e.state??x(this,yr),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=x(this,ut))==null?void 0:e.promise}setOptions(e){this.options={...x(this,ii),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&x(this,Ft).remove(this)}setData(e,n){const r=Qs(this.state.data,e,this.options);return ke(this,Ht,dn).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){ke(this,Ht,dn).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,i;const n=(r=x(this,ut))==null?void 0:r.promise;return(i=x(this,ut))==null||i.cancel(e),n?n.then(Pt).catch(Pt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(x(this,yr))}isActive(){return this.observers.some(e=>Wt(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===za||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!Zc(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=x(this,ut))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=x(this,ut))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),x(this,Ft).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(x(this,ut)&&(x(this,Bn)?x(this,ut).cancel({revert:!0}):x(this,ut).cancelRetry()),this.scheduleGc()),x(this,Ft).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ke(this,Ht,dn).call(this,{type:"invalidate"})}fetch(e,n){var c,d,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(x(this,ut))return x(this,ut).continueRetry(),x(this,ut).promise}if(e&&this.setOptions(e),!this.options.queryFn){const u=this.observers.find(m=>m.options.queryFn);u&&this.setOptions(u.options)}const r=new AbortController,i=u=>{Object.defineProperty(u,"signal",{enumerable:!0,get:()=>(re(this,Bn,!0),r.signal)})},s=()=>{const u=tu(this.options,n),m={queryKey:this.queryKey,meta:this.meta};return i(m),re(this,Bn,!1),this.options.persister?this.options.persister(u,m,this):u(m)},a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(a),(c=this.options.behavior)==null||c.onFetch(a,this),re(this,vr,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=a.fetchOptions)==null?void 0:d.meta))&&ke(this,Ht,dn).call(this,{type:"fetch",meta:(f=a.fetchOptions)==null?void 0:f.meta});const l=u=>{var m,h,b,C;js(u)&&u.silent||ke(this,Ht,dn).call(this,{type:"error",error:u}),js(u)||((h=(m=x(this,Ft).config).onError)==null||h.call(m,u,this),(C=(b=x(this,Ft).config).onSettled)==null||C.call(b,this.state.data,u,this)),this.scheduleGc()};return re(this,ut,iu({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:u=>{var m,h,b,C;if(u===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(u)}catch(y){l(y);return}(h=(m=x(this,Ft).config).onSuccess)==null||h.call(m,u,this),(C=(b=x(this,Ft).config).onSettled)==null||C.call(b,u,this.state.error,this),this.scheduleGc()},onError:l,onFail:(u,m)=>{ke(this,Ht,dn).call(this,{type:"failed",failureCount:u,error:m})},onPause:()=>{ke(this,Ht,dn).call(this,{type:"pause"})},onContinue:()=>{ke(this,Ht,dn).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),x(this,ut).start()}},yr=new WeakMap,vr=new WeakMap,Ft=new WeakMap,ut=new WeakMap,ii=new WeakMap,Bn=new WeakMap,Ht=new WeakSet,dn=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...au(r.data,this.options),fetchMeta:e.meta??null};case"success":return{...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=e.error;return js(i)&&i.revert&&x(this,vr)?{...x(this,vr),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,...e.state}}};this.state=n(this.state),nt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),x(this,Ft).notify({query:this,type:"updated",action:e})})},Uc);function au(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:nu(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function Zp(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,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 Jt,qc,ef=(qc=class extends $r{constructor(e={}){super();me(this,Jt);this.config=e,re(this,Jt,new Map)}build(e,n,r){const i=n.queryKey,s=n.queryHash??La(i,n);let a=this.get(s);return a||(a=new Jp({cache:this,queryKey:i,queryHash:s,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(a)),a}add(e){x(this,Jt).has(e.queryHash)||(x(this,Jt).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=x(this,Jt).get(e.queryHash);n&&(e.destroy(),n===e&&x(this,Jt).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){nt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return x(this,Jt).get(e)}getAll(){return[...x(this,Jt).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>Go(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>Go(e,r)):n}notify(e){nt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){nt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){nt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Jt=new WeakMap,qc),Zt,ht,Ln,en,vn,Wc,tf=(Wc=class extends su{constructor(e){super();me(this,en);me(this,Zt);me(this,ht);me(this,Ln);this.mutationId=e.mutationId,re(this,ht,e.mutationCache),re(this,Zt,[]),this.state=e.state||ou(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){x(this,Zt).includes(e)||(x(this,Zt).push(e),this.clearGcTimeout(),x(this,ht).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){re(this,Zt,x(this,Zt).filter(n=>n!==e)),this.scheduleGc(),x(this,ht).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){x(this,Zt).length||(this.state.status==="pending"?this.scheduleGc():x(this,ht).remove(this))}continue(){var e;return((e=x(this,Ln))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var i,s,a,l,c,d,f,u,m,h,b,C,y,v,E,I,_,L,w,$;re(this,Ln,iu({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(H,q)=>{ke(this,en,vn).call(this,{type:"failed",failureCount:H,error:q})},onPause:()=>{ke(this,en,vn).call(this,{type:"pause"})},onContinue:()=>{ke(this,en,vn).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>x(this,ht).canRun(this)}));const n=this.state.status==="pending",r=!x(this,Ln).canStart();try{if(!n){ke(this,en,vn).call(this,{type:"pending",variables:e,isPaused:r}),await((s=(i=x(this,ht).config).onMutate)==null?void 0:s.call(i,e,this));const q=await((l=(a=this.options).onMutate)==null?void 0:l.call(a,e));q!==this.state.context&&ke(this,en,vn).call(this,{type:"pending",context:q,variables:e,isPaused:r})}const H=await x(this,Ln).start();return await((d=(c=x(this,ht).config).onSuccess)==null?void 0:d.call(c,H,e,this.state.context,this)),await((u=(f=this.options).onSuccess)==null?void 0:u.call(f,H,e,this.state.context)),await((h=(m=x(this,ht).config).onSettled)==null?void 0:h.call(m,H,null,this.state.variables,this.state.context,this)),await((C=(b=this.options).onSettled)==null?void 0:C.call(b,H,null,e,this.state.context)),ke(this,en,vn).call(this,{type:"success",data:H}),H}catch(H){try{throw await((v=(y=x(this,ht).config).onError)==null?void 0:v.call(y,H,e,this.state.context,this)),await((I=(E=this.options).onError)==null?void 0:I.call(E,H,e,this.state.context)),await((L=(_=x(this,ht).config).onSettled)==null?void 0:L.call(_,void 0,H,this.state.variables,this.state.context,this)),await(($=(w=this.options).onSettled)==null?void 0:$.call(w,void 0,H,e,this.state.context)),H}finally{ke(this,en,vn).call(this,{type:"error",error:H})}}finally{x(this,ht).runNext(this)}}},Zt=new WeakMap,ht=new WeakMap,Ln=new WeakMap,en=new WeakSet,vn=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),nt.batch(()=>{x(this,Zt).forEach(r=>{r.onMutationUpdate(e)}),x(this,ht).notify({mutation:this,type:"updated",action:e})})},Wc);function ou(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Tt,si,Vc,nf=(Vc=class extends $r{constructor(e={}){super();me(this,Tt);me(this,si);this.config=e,re(this,Tt,new Map),re(this,si,Date.now())}build(e,n,r){const i=new tf({mutationCache:this,mutationId:++fi(this,si)._,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){const n=mi(e),r=x(this,Tt).get(n)??[];r.push(e),x(this,Tt).set(n,r),this.notify({type:"added",mutation:e})}remove(e){var r;const n=mi(e);if(x(this,Tt).has(n)){const i=(r=x(this,Tt).get(n))==null?void 0:r.filter(s=>s!==e);i&&(i.length===0?x(this,Tt).delete(n):x(this,Tt).set(n,i))}this.notify({type:"removed",mutation:e})}canRun(e){var r;const n=(r=x(this,Tt).get(mi(e)))==null?void 0:r.find(i=>i.state.status==="pending");return!n||n===e}runNext(e){var r;const n=(r=x(this,Tt).get(mi(e)))==null?void 0:r.find(i=>i!==e&&i.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){nt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}getAll(){return[...x(this,Tt).values()].flat()}find(e){const n={exact:!0,...e};return this.getAll().find(r=>Qo(n,r))}findAll(e={}){return this.getAll().filter(n=>Qo(e,n))}notify(e){nt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return nt.batch(()=>Promise.all(e.map(n=>n.continue().catch(Pt))))}},Tt=new WeakMap,si=new WeakMap,Vc);function mi(t){var e;return((e=t.options.scope)==null?void 0:e.id)??String(t.mutationId)}function Zo(t){return{onFetch:(e,n)=>{var f,u,m,h,b;const r=e.options,i=(m=(u=(f=e.fetchOptions)==null?void 0:f.meta)==null?void 0:u.fetchMore)==null?void 0:m.direction,s=((h=e.state.data)==null?void 0:h.pages)||[],a=((b=e.state.data)==null?void 0:b.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const d=async()=>{let C=!1;const y=I=>{Object.defineProperty(I,"signal",{enumerable:!0,get:()=>(e.signal.aborted?C=!0:e.signal.addEventListener("abort",()=>{C=!0}),e.signal)})},v=tu(e.options,e.fetchOptions),E=async(I,_,L)=>{if(C)return Promise.reject();if(_==null&&I.pages.length)return Promise.resolve(I);const w={queryKey:e.queryKey,pageParam:_,direction:L?"backward":"forward",meta:e.options.meta};y(w);const $=await v(w),{maxPages:H}=e.options,q=L?Kp:Vp;return{pages:q(I.pages,$,H),pageParams:q(I.pageParams,_,H)}};if(i&&s.length){const I=i==="backward",_=I?rf:el,L={pages:s,pageParams:a},w=_(r,L);l=await E(L,w,I)}else{const I=t??s.length;do{const _=c===0?a[0]??r.initialPageParam:el(r,l);if(c>0&&_==null)break;l=await E(l,_),c++}while(c<I)}return l};e.options.persister?e.fetchFn=()=>{var C,y;return(y=(C=e.options).persister)==null?void 0:y.call(C,d,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=d}}}function el(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function rf(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var Xe,wn,Cn,xr,br,_n,wr,Cr,Kc,sf=(Kc=class{constructor(t={}){me(this,Xe);me(this,wn);me(this,Cn);me(this,xr);me(this,br);me(this,_n);me(this,wr);me(this,Cr);re(this,Xe,t.queryCache||new ef),re(this,wn,t.mutationCache||new nf),re(this,Cn,t.defaultOptions||{}),re(this,xr,new Map),re(this,br,new Map),re(this,_n,0)}mount(){fi(this,_n)._++,x(this,_n)===1&&(re(this,wr,Ha.subscribe(async t=>{t&&(await this.resumePausedMutations(),x(this,Xe).onFocus())})),re(this,Cr,Di.subscribe(async t=>{t&&(await this.resumePausedMutations(),x(this,Xe).onOnline())})))}unmount(){var t,e;fi(this,_n)._--,x(this,_n)===0&&((t=x(this,wr))==null||t.call(this),re(this,wr,void 0),(e=x(this,Cr))==null||e.call(this),re(this,Cr,void 0))}isFetching(t){return x(this,Xe).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return x(this,wn).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=x(this,Xe).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.getQueryData(t.queryKey);if(e===void 0)return this.fetchQuery(t);{const n=this.defaultQueryOptions(t),r=x(this,Xe).build(this,n);return t.revalidateIfStale&&r.isStaleByTime(pr(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(e)}}getQueriesData(t){return x(this,Xe).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),i=x(this,Xe).get(r.queryHash),s=i==null?void 0:i.state.data,a=qp(e,s);if(a!==void 0)return x(this,Xe).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(t,e,n){return nt.batch(()=>x(this,Xe).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=x(this,Xe).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=x(this,Xe);nt.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=x(this,Xe),r={type:"active",...t};return nt.batch(()=>(n.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries(r,e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=nt.batch(()=>x(this,Xe).findAll(t).map(i=>i.cancel(n)));return Promise.all(r).then(Pt).catch(Pt)}invalidateQueries(t,e={}){return nt.batch(()=>{if(x(this,Xe).findAll(t).forEach(r=>{r.invalidate()}),(t==null?void 0:t.refetchType)==="none")return Promise.resolve();const n={...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"};return this.refetchQueries(n,e)})}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=nt.batch(()=>x(this,Xe).findAll(t).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(Pt)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Pt)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=x(this,Xe).build(this,e);return n.isStaleByTime(pr(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Pt).catch(Pt)}fetchInfiniteQuery(t){return t.behavior=Zo(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Pt).catch(Pt)}ensureInfiniteQueryData(t){return t.behavior=Zo(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Di.isOnline()?x(this,wn).resumePausedMutations():Promise.resolve()}getQueryCache(){return x(this,Xe)}getMutationCache(){return x(this,wn)}getDefaultOptions(){return x(this,Cn)}setDefaultOptions(t){re(this,Cn,t)}setQueryDefaults(t,e){x(this,xr).set(Qn(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...x(this,xr).values()],n={};return e.forEach(r=>{Jr(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){x(this,br).set(Qn(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...x(this,br).values()];let n={};return e.forEach(r=>{Jr(t,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...x(this,Cn).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=La(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.enabled!==!0&&e.queryFn===za&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...x(this,Cn).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){x(this,Xe).clear(),x(this,wn).clear()}},Xe=new WeakMap,wn=new WeakMap,Cn=new WeakMap,xr=new WeakMap,br=new WeakMap,_n=new WeakMap,wr=new WeakMap,Cr=new WeakMap,Kc),xt,Ae,ai,mt,zn,_r,kn,tn,oi,kr,Sr,Hn,Un,Sn,jr,Me,qr,Js,Zs,ea,ta,na,ra,ia,lu,Yc,af=(Yc=class extends $r{constructor(e,n){super();me(this,Me);me(this,xt);me(this,Ae);me(this,ai);me(this,mt);me(this,zn);me(this,_r);me(this,kn);me(this,tn);me(this,oi);me(this,kr);me(this,Sr);me(this,Hn);me(this,Un);me(this,Sn);me(this,jr,new Set);this.options=n,re(this,xt,e),re(this,tn,null),re(this,kn,Xs()),this.options.experimental_prefetchInRender||x(this,kn).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&&(x(this,Ae).addObserver(this),tl(x(this,Ae),this.options)?ke(this,Me,qr).call(this):this.updateResult(),ke(this,Me,ta).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return sa(x(this,Ae),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return sa(x(this,Ae),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ke(this,Me,na).call(this),ke(this,Me,ra).call(this),x(this,Ae).removeObserver(this)}setOptions(e,n){const r=this.options,i=x(this,Ae);if(this.options=x(this,xt).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Wt(this.options.enabled,x(this,Ae))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ke(this,Me,ia).call(this),x(this,Ae).setOptions(this.options),r._defaulted&&!$i(this.options,r)&&x(this,xt).getQueryCache().notify({type:"observerOptionsUpdated",query:x(this,Ae),observer:this});const s=this.hasListeners();s&&nl(x(this,Ae),i,this.options,r)&&ke(this,Me,qr).call(this),this.updateResult(n),s&&(x(this,Ae)!==i||Wt(this.options.enabled,x(this,Ae))!==Wt(r.enabled,x(this,Ae))||pr(this.options.staleTime,x(this,Ae))!==pr(r.staleTime,x(this,Ae)))&&ke(this,Me,Js).call(this);const a=ke(this,Me,Zs).call(this);s&&(x(this,Ae)!==i||Wt(this.options.enabled,x(this,Ae))!==Wt(r.enabled,x(this,Ae))||a!==x(this,Sn))&&ke(this,Me,ea).call(this,a)}getOptimisticResult(e){const n=x(this,xt).getQueryCache().build(x(this,xt),e),r=this.createResult(n,e);return lf(this,r)&&(re(this,mt,r),re(this,_r,this.options),re(this,zn,x(this,Ae).state)),r}getCurrentResult(){return x(this,mt)}trackResult(e,n){const r={};return Object.keys(e).forEach(i=>{Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),n==null||n(i),e[i])})}),r}trackProp(e){x(this,jr).add(e)}getCurrentQuery(){return x(this,Ae)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=x(this,xt).defaultQueryOptions(e),r=x(this,xt).getQueryCache().build(x(this,xt),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return ke(this,Me,qr).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),x(this,mt)))}createResult(e,n){var H;const r=x(this,Ae),i=this.options,s=x(this,mt),a=x(this,zn),l=x(this,_r),d=e!==r?e.state:x(this,ai),{state:f}=e;let u={...f},m=!1,h;if(n._optimisticResults){const q=this.hasListeners(),F=!q&&tl(e,n),T=q&&nl(e,r,n,i);(F||T)&&(u={...u,...au(f.data,e.options)}),n._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:b,errorUpdatedAt:C,status:y}=u;if(n.select&&u.data!==void 0)if(s&&u.data===(a==null?void 0:a.data)&&n.select===x(this,oi))h=x(this,kr);else try{re(this,oi,n.select),h=n.select(u.data),h=Qs(s==null?void 0:s.data,h,n),re(this,kr,h),re(this,tn,null)}catch(q){re(this,tn,q)}else h=u.data;if(n.placeholderData!==void 0&&h===void 0&&y==="pending"){let q;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData))q=s.data;else if(q=typeof n.placeholderData=="function"?n.placeholderData((H=x(this,Sr))==null?void 0:H.state.data,x(this,Sr)):n.placeholderData,n.select&&q!==void 0)try{q=n.select(q),re(this,tn,null)}catch(F){re(this,tn,F)}q!==void 0&&(y="success",h=Qs(s==null?void 0:s.data,q,n),m=!0)}x(this,tn)&&(b=x(this,tn),h=x(this,kr),C=Date.now(),y="error");const v=u.fetchStatus==="fetching",E=y==="pending",I=y==="error",_=E&&v,L=h!==void 0,$={status:y,fetchStatus:u.fetchStatus,isPending:E,isSuccess:y==="success",isError:I,isInitialLoading:_,isLoading:_,data:h,dataUpdatedAt:u.dataUpdatedAt,error:b,errorUpdatedAt:C,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>d.dataUpdateCount||u.errorUpdateCount>d.errorUpdateCount,isFetching:v,isRefetching:v&&!E,isLoadingError:I&&!L,isPaused:u.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:I&&L,isStale:Ua(e,n),refetch:this.refetch,promise:x(this,kn)};if(this.options.experimental_prefetchInRender){const q=A=>{$.status==="error"?A.reject($.error):$.data!==void 0&&A.resolve($.data)},F=()=>{const A=re(this,kn,$.promise=Xs());q(A)},T=x(this,kn);switch(T.status){case"pending":e.queryHash===r.queryHash&&q(T);break;case"fulfilled":($.status==="error"||$.data!==T.value)&&F();break;case"rejected":($.status!=="error"||$.error!==T.reason)&&F();break}}return $}updateResult(e){const n=x(this,mt),r=this.createResult(x(this,Ae),this.options);if(re(this,zn,x(this,Ae).state),re(this,_r,this.options),x(this,zn).data!==void 0&&re(this,Sr,x(this,Ae)),$i(r,n))return;re(this,mt,r);const i={},s=()=>{if(!n)return!0;const{notifyOnChangeProps:a}=this.options,l=typeof a=="function"?a():a;if(l==="all"||!l&&!x(this,jr).size)return!0;const c=new Set(l??x(this,jr));return this.options.throwOnError&&c.add("error"),Object.keys(x(this,mt)).some(d=>{const f=d;return x(this,mt)[f]!==n[f]&&c.has(f)})};(e==null?void 0:e.listeners)!==!1&&s()&&(i.listeners=!0),ke(this,Me,lu).call(this,{...i,...e})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ke(this,Me,ta).call(this)}},xt=new WeakMap,Ae=new WeakMap,ai=new WeakMap,mt=new WeakMap,zn=new WeakMap,_r=new WeakMap,kn=new WeakMap,tn=new WeakMap,oi=new WeakMap,kr=new WeakMap,Sr=new WeakMap,Hn=new WeakMap,Un=new WeakMap,Sn=new WeakMap,jr=new WeakMap,Me=new WeakSet,qr=function(e){ke(this,Me,ia).call(this);let n=x(this,Ae).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(Pt)),n},Js=function(){ke(this,Me,na).call(this);const e=pr(this.options.staleTime,x(this,Ae));if(Gn||x(this,mt).isStale||!Ys(e))return;const r=Zc(x(this,mt).dataUpdatedAt,e)+1;re(this,Hn,setTimeout(()=>{x(this,mt).isStale||this.updateResult()},r))},Zs=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(x(this,Ae)):this.options.refetchInterval)??!1},ea=function(e){ke(this,Me,ra).call(this),re(this,Sn,e),!(Gn||Wt(this.options.enabled,x(this,Ae))===!1||!Ys(x(this,Sn))||x(this,Sn)===0)&&re(this,Un,setInterval(()=>{(this.options.refetchIntervalInBackground||Ha.isFocused())&&ke(this,Me,qr).call(this)},x(this,Sn)))},ta=function(){ke(this,Me,Js).call(this),ke(this,Me,ea).call(this,ke(this,Me,Zs).call(this))},na=function(){x(this,Hn)&&(clearTimeout(x(this,Hn)),re(this,Hn,void 0))},ra=function(){x(this,Un)&&(clearInterval(x(this,Un)),re(this,Un,void 0))},ia=function(){const e=x(this,xt).getQueryCache().build(x(this,xt),this.options);if(e===x(this,Ae))return;const n=x(this,Ae);re(this,Ae,e),re(this,ai,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},lu=function(e){nt.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(x(this,mt))}),x(this,xt).getQueryCache().notify({query:x(this,Ae),type:"observerResultsUpdated"})})},Yc);function of(t,e){return Wt(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function tl(t,e){return of(t,e)||t.state.data!==void 0&&sa(t,e,e.refetchOnMount)}function sa(t,e,n){if(Wt(e.enabled,t)!==!1){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&Ua(t,e)}return!1}function nl(t,e,n,r){return(t!==e||Wt(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&Ua(t,n)}function Ua(t,e){return Wt(e.enabled,t)!==!1&&t.isStaleByTime(pr(e.staleTime,t))}function lf(t,e){return!$i(t.getCurrentResult(),e)}var jn,En,bt,fn,hn,ji,aa,Gc,cf=(Gc=class extends $r{constructor(e,n){super();me(this,hn);me(this,jn);me(this,En);me(this,bt);me(this,fn);re(this,jn,e),this.setOptions(n),this.bindMethods(),ke(this,hn,ji).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){var r;const n=this.options;this.options=x(this,jn).defaultMutationOptions(e),$i(this.options,n)||x(this,jn).getMutationCache().notify({type:"observerOptionsUpdated",mutation:x(this,bt),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&Qn(n.mutationKey)!==Qn(this.options.mutationKey)?this.reset():((r=x(this,bt))==null?void 0:r.state.status)==="pending"&&x(this,bt).setOptions(this.options)}onUnsubscribe(){var e;this.hasListeners()||(e=x(this,bt))==null||e.removeObserver(this)}onMutationUpdate(e){ke(this,hn,ji).call(this),ke(this,hn,aa).call(this,e)}getCurrentResult(){return x(this,En)}reset(){var e;(e=x(this,bt))==null||e.removeObserver(this),re(this,bt,void 0),ke(this,hn,ji).call(this),ke(this,hn,aa).call(this)}mutate(e,n){var r;return re(this,fn,n),(r=x(this,bt))==null||r.removeObserver(this),re(this,bt,x(this,jn).getMutationCache().build(x(this,jn),this.options)),x(this,bt).addObserver(this),x(this,bt).execute(e)}},jn=new WeakMap,En=new WeakMap,bt=new WeakMap,fn=new WeakMap,hn=new WeakSet,ji=function(){var n;const e=((n=x(this,bt))==null?void 0:n.state)??ou();re(this,En,{...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset})},aa=function(e){nt.batch(()=>{var n,r,i,s,a,l,c,d;if(x(this,fn)&&this.hasListeners()){const f=x(this,En).variables,u=x(this,En).context;(e==null?void 0:e.type)==="success"?((r=(n=x(this,fn)).onSuccess)==null||r.call(n,e.data,f,u),(s=(i=x(this,fn)).onSettled)==null||s.call(i,e.data,null,f,u)):(e==null?void 0:e.type)==="error"&&((l=(a=x(this,fn)).onError)==null||l.call(a,e.error,f,u),(d=(c=x(this,fn)).onSettled)==null||d.call(c,void 0,e.error,f,u))}this.listeners.forEach(f=>{f(x(this,En))})})},Gc),cu=p.createContext(void 0),Yi=t=>{const e=p.useContext(cu);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},uf=({client:t,children:e})=>(p.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),o.jsx(cu.Provider,{value:t,children:e})),uu=p.createContext(!1),df=()=>p.useContext(uu);uu.Provider;function pf(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var ff=p.createContext(pf()),hf=()=>p.useContext(ff);function du(t,e){return typeof t=="function"?t(...e):!!t}function oa(){}var mf=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},gf=t=>{p.useEffect(()=>{t.clearReset()},[t])},yf=({result:t,errorResetBoundary:e,throwOnError:n,query:r})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&du(n,[t.error,r]),vf=t=>{t.suspense&&(t.staleTime===void 0&&(t.staleTime=1e3),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3)))},xf=(t,e)=>t.isLoading&&t.isFetching&&!e,bf=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,rl=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function wf(t,e,n){var f,u,m,h,b;const r=Yi(),i=df(),s=hf(),a=r.defaultQueryOptions(t);(u=(f=r.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||u.call(f,a),a._optimisticResults=i?"isRestoring":"optimistic",vf(a),mf(a,s),gf(s);const l=!r.getQueryCache().get(a.queryHash),[c]=p.useState(()=>new e(r,a)),d=c.getOptimisticResult(a);if(p.useSyncExternalStore(p.useCallback(C=>{const y=i?oa:c.subscribe(nt.batchCalls(C));return c.updateResult(),y},[c,i]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),p.useEffect(()=>{c.setOptions(a,{listeners:!1})},[a,c]),bf(a,d))throw rl(a,c,s);if(yf({result:d,errorResetBoundary:s,throwOnError:a.throwOnError,query:r.getQueryCache().get(a.queryHash)}))throw d.error;if((h=(m=r.getDefaultOptions().queries)==null?void 0:m._experimental_afterQuery)==null||h.call(m,a,d),a.experimental_prefetchInRender&&!Gn&&xf(d,i)){const C=l?rl(a,c,s):(b=r.getQueryCache().get(a.queryHash))==null?void 0:b.promise;C==null||C.catch(oa).finally(()=>{c.updateResult()})}return a.notifyOnChangeProps?d:c.trackResult(d)}function Jn(t,e){return wf(t,af)}function qa(t,e){const n=Yi(),[r]=p.useState(()=>new cf(n,t));p.useEffect(()=>{r.setOptions(t)},[r,t]);const i=p.useSyncExternalStore(p.useCallback(a=>r.subscribe(nt.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=p.useCallback((a,l)=>{r.mutate(a,l).catch(oa)},[r]);if(i.error&&du(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}const Cf=(t,e)=>Jn({queryKey:["widgets",t,e],queryFn:()=>_f(t,e),retry:!1,throwOnError:!1}),_f=async(t,e)=>{const n=`widgets/with-link/${t}${e?`?device_id=${e}`:""}`,[r,i]=await _t(n);if(i===204)throw new Error("User is banned");return r};/**
|
|
41
2
|
* @remix-run/router v1.21.0
|
|
42
3
|
*
|
|
43
4
|
* Copyright (c) Remix Software Inc.
|
|
@@ -46,7 +7,7 @@ Error generating stack: `+s.message+`
|
|
|
46
7
|
* LICENSE.md file in the root directory of this source tree.
|
|
47
8
|
*
|
|
48
9
|
* @license MIT
|
|
49
|
-
*/function
|
|
10
|
+
*/function Fi(){return Fi=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Fi.apply(this,arguments)}var Tn;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(Tn||(Tn={}));function kf(t){t===void 0&&(t={});let{initialEntries:e=["/"],initialIndex:n,v5Compat:r=!1}=t,i;i=e.map((h,b)=>f(h,typeof h=="string"?null:h.state,b===0?"default":void 0));let s=c(n??i.length-1),a=Tn.Pop,l=null;function c(h){return Math.min(Math.max(h,0),i.length-1)}function d(){return i[s]}function f(h,b,C){b===void 0&&(b=null);let y=jf(i?d().pathname:"/",h,b,C);return Wa(y.pathname.charAt(0)==="/","relative pathnames are not supported in memory history: "+JSON.stringify(h)),y}function u(h){return typeof h=="string"?h:Ef(h)}return{get index(){return s},get action(){return a},get location(){return d()},createHref:u,createURL(h){return new URL(u(h),"http://localhost")},encodeLocation(h){let b=typeof h=="string"?Zn(h):h;return{pathname:b.pathname||"",search:b.search||"",hash:b.hash||""}},push(h,b){a=Tn.Push;let C=f(h,b);s+=1,i.splice(s,i.length,C),r&&l&&l({action:a,location:C,delta:1})},replace(h,b){a=Tn.Replace;let C=f(h,b);i[s]=C,r&&l&&l({action:a,location:C,delta:0})},go(h){a=Tn.Pop;let b=c(s+h),C=i[b];s=b,l&&l({action:a,location:C,delta:h})},listen(h){return l=h,()=>{l=null}}}}function ot(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function Wa(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function Sf(){return Math.random().toString(36).substr(2,8)}function jf(t,e,n,r){return n===void 0&&(n=null),Fi({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Zn(e):e,{state:n,key:e&&e.key||r||Sf()})}function Ef(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Zn(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}var il;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(il||(il={}));function Tf(t,e,n){return n===void 0&&(n="/"),Af(t,e,n,!1)}function Af(t,e,n,r){let i=typeof e=="string"?Zn(e):e,s=hu(i.pathname||"/",n);if(s==null)return null;let a=pu(t);Rf(a);let l=null;for(let c=0;l==null&&c<a.length;++c){let d=zf(s);l=Bf(a[c],d,r)}return l}function pu(t,e,n,r){e===void 0&&(e=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(s,a,l)=>{let c={relativePath:l===void 0?s.path||"":l,caseSensitive:s.caseSensitive===!0,childrenIndex:a,route:s};c.relativePath.startsWith("/")&&(ot(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let d=qn([r,c.relativePath]),f=n.concat(c);s.children&&s.children.length>0&&(ot(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),pu(s.children,e,f,d)),!(s.path==null&&!s.index)&&e.push({path:d,score:Ff(d,s.index),routesMeta:f})};return t.forEach((s,a)=>{var l;if(s.path===""||!((l=s.path)!=null&&l.includes("?")))i(s,a);else for(let c of fu(s.path))i(s,a,c)}),e}function fu(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let a=fu(r.join("/")),l=[];return l.push(...a.map(c=>c===""?s:[s,c].join("/"))),i&&l.push(...a),l.map(c=>t.startsWith("/")&&c===""?"/":c)}function Rf(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:Pf(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Of=/^:[\w-]+$/,Nf=3,If=2,Mf=1,$f=10,Df=-2,sl=t=>t==="*";function Ff(t,e){let n=t.split("/"),r=n.length;return n.some(sl)&&(r+=Df),e&&(r+=If),n.filter(i=>!sl(i)).reduce((i,s)=>i+(Of.test(s)?Nf:s===""?Mf:$f),r)}function Pf(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function Bf(t,e,n){let{routesMeta:r}=t,i={},s="/",a=[];for(let l=0;l<r.length;++l){let c=r[l],d=l===r.length-1,f=s==="/"?e:e.slice(s.length)||"/",u=al({path:c.relativePath,caseSensitive:c.caseSensitive,end:d},f),m=c.route;if(!u&&d&&n&&!r[r.length-1].route.index&&(u=al({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},f)),!u)return null;Object.assign(i,u.params),a.push({params:i,pathname:qn([s,u.pathname]),pathnameBase:Kf(qn([s,u.pathnameBase])),route:m}),u.pathnameBase!=="/"&&(s=qn([s,u.pathnameBase]))}return a}function al(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=Lf(t.path,t.caseSensitive,t.end),i=e.match(n);if(!i)return null;let s=i[0],a=s.replace(/(.)\/+$/,"$1"),l=i.slice(1);return{params:r.reduce((d,f,u)=>{let{paramName:m,isOptional:h}=f;if(m==="*"){let C=l[u]||"";a=s.slice(0,s.length-C.length).replace(/(.)\/+$/,"$1")}const b=l[u];return h&&!b?d[m]=void 0:d[m]=(b||"").replace(/%2F/g,"/"),d},{}),pathname:s,pathnameBase:a,pattern:t}}function Lf(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),Wa(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function zf(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Wa(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function hu(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function Hf(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?Zn(t):t;return{pathname:n?n.startsWith("/")?n:Uf(n,e):e,search:Yf(r),hash:Gf(i)}}function Uf(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Es(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` 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 qf(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function Wf(t,e){let n=qf(t);return e?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Vf(t,e,n,r){r===void 0&&(r=!1);let i;typeof t=="string"?i=Zn(t):(i=Fi({},t),ot(!i.pathname||!i.pathname.includes("?"),Es("?","pathname","search",i)),ot(!i.pathname||!i.pathname.includes("#"),Es("#","pathname","hash",i)),ot(!i.search||!i.search.includes("#"),Es("#","search","hash",i)));let s=t===""||i.pathname==="",a=s?"/":i.pathname,l;if(a==null)l=n;else{let u=e.length-1;if(!r&&a.startsWith("..")){let m=a.split("/");for(;m[0]==="..";)m.shift(),u-=1;i.pathname=m.join("/")}l=u>=0?e[u]:"/"}let c=Hf(i,l),d=a&&a!=="/"&&a.endsWith("/"),f=(s||a===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(d||f)&&(c.pathname+="/"),c}const qn=t=>t.join("/").replace(/\/\/+/g,"/"),Kf=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),Yf=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,Gf=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function Qf(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const mu=["post","put","patch","delete"];new Set(mu);const Xf=["get",...mu];new Set(Xf);/**
|
|
50
11
|
* React Router v6.28.0
|
|
51
12
|
*
|
|
52
13
|
* Copyright (c) Remix Software Inc.
|
|
@@ -55,19 +16,7 @@ Error generating stack: `+s.message+`
|
|
|
55
16
|
* LICENSE.md file in the root directory of this source tree.
|
|
56
17
|
*
|
|
57
18
|
* @license MIT
|
|
58
|
-
*/function Ha(){return Ha=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},Ha.apply(this,arguments)}const _m=v.createContext(null),xA=v.createContext(null),Mu=v.createContext(null),Pu=v.createContext(null),Oo=v.createContext({outlet:null,matches:[],isDataRoute:!1}),Wb=v.createContext(null);function Nu(){return v.useContext(Pu)!=null}function Tm(){return Nu()||Ct(!1),v.useContext(Pu).location}function qb(e){v.useContext(Mu).static||v.useLayoutEffect(e)}function wA(){let{isDataRoute:e}=v.useContext(Oo);return e?NA():bA()}function bA(){Nu()||Ct(!1);let e=v.useContext(_m),{basename:t,future:n,navigator:r}=v.useContext(Mu),{matches:i}=v.useContext(Oo),{pathname:s}=Tm(),o=JSON.stringify(fA(i,n.v7_relativeSplatPath)),a=v.useRef(!1);return qb(()=>{a.current=!0}),v.useCallback(function(c,d){if(d===void 0&&(d={}),!a.current)return;if(typeof c=="number"){r.go(c);return}let u=pA(c,JSON.parse(o),s,d.relative==="path");e==null&&t!=="/"&&(u.pathname=u.pathname==="/"?t:Ji([t,u.pathname])),(d.replace?r.replace:r.push)(u,d.state,d)},[t,r,o,s,e])}function CA(e,t){return SA(e,t)}function SA(e,t,n,r){Nu()||Ct(!1);let{navigator:i}=v.useContext(Mu),{matches:s}=v.useContext(Oo),o=s[s.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let c=Tm(),d;if(t){var u;let C=typeof t=="string"?ms(t):t;l==="/"||(u=C.pathname)!=null&&u.startsWith(l)||Ct(!1),d=C}else d=c;let p=d.pathname||"/",h=p;if(l!=="/"){let C=l.replace(/^\//,"").split("/");h="/"+p.replace(/^\//,"").split("/").slice(C.length).join("/")}let y=QE(e,{pathname:h}),b=AA(y&&y.map(C=>Object.assign({},C,{params:Object.assign({},a,C.params),pathname:Ji([l,i.encodeLocation?i.encodeLocation(C.pathname).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?l:Ji([l,i.encodeLocation?i.encodeLocation(C.pathnameBase).pathname:C.pathnameBase])})),s,n,r);return t&&b?v.createElement(Pu.Provider,{value:{location:Ha({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:li.Pop}},b):b}function kA(){let e=PA(),t=vA(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 v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:i},n):null,null)}const _A=v.createElement(kA,null);class TA extends v.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?v.createElement(Oo.Provider,{value:this.props.routeContext},v.createElement(Wb.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function EA(e){let{routeContext:t,match:n,children:r}=e,i=v.useContext(_m);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),v.createElement(Oo.Provider,{value:t},r)}function AA(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||Ct(!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,b=null,C=null;n&&(h=a&&u.route.id?a[u.route.id]:void 0,b=u.route.errorElement||_A,l&&(c<0&&p===0?(y=!0,C=null):c===p&&(y=!0,C=u.route.hydrateFallbackElement||null)));let g=t.concat(o.slice(0,p+1)),m=()=>{let w;return h?w=b:y?w=C:u.route.Component?w=v.createElement(u.route.Component,null):u.route.element?w=u.route.element:w=d,v.createElement(EA,{match:u,routeContext:{outlet:d,matches:g,isDataRoute:n!=null},children:w})};return n&&(u.route.ErrorBoundary||u.route.errorElement||p===0)?v.createElement(TA,{location:n.location,revalidation:n.revalidation,component:b,error:h,children:m(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):m()},null)}var Gb=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Gb||{}),Xc=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}(Xc||{});function jA(e){let t=v.useContext(_m);return t||Ct(!1),t}function RA(e){let t=v.useContext(xA);return t||Ct(!1),t}function MA(e){let t=v.useContext(Oo);return t||Ct(!1),t}function Yb(e){let t=MA(),n=t.matches[t.matches.length-1];return n.route.id||Ct(!1),n.route.id}function PA(){var e;let t=v.useContext(Wb),n=RA(Xc.UseRouteError),r=Yb(Xc.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function NA(){let{router:e}=jA(Gb.UseNavigateStable),t=Yb(Xc.UseNavigateStable),n=v.useRef(!1);return qb(()=>{n.current=!0}),v.useCallback(function(i,s){s===void 0&&(s={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Ha({fromRouteId:t},s)))},[e,t])}const av={};function OA(e,t){av[t]||(av[t]=!0,console.warn(t))}const lv=(e,t,n)=>OA(e,"⚠️ React Router Future Flag Warning: "+t+". "+("You can use the `"+e+"` future flag to opt-in early. ")+("For more information, see "+n+"."));function DA(e,t){e!=null&&e.v7_startTransition||lv("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&&lv("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath")}const IA="startTransition",cv=L2[IA];function LA(e){let{basename:t,children:n,initialEntries:r,initialIndex:i,future:s}=e,o=v.useRef();o.current==null&&(o.current=WE({initialEntries:r,initialIndex:i,v5Compat:!0}));let a=o.current,[l,c]=v.useState({action:a.action,location:a.location}),{v7_startTransition:d}=s||{},u=v.useCallback(p=>{d&&cv?cv(()=>c(p)):c(p)},[c,d]);return v.useLayoutEffect(()=>a.listen(u),[a,u]),v.useEffect(()=>DA(s),[s]),v.createElement(FA,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:a,future:s})}function Ep(e){Ct(!1)}function FA(e){let{basename:t="/",children:n=null,location:r,navigationType:i=li.Pop,navigator:s,static:o=!1,future:a}=e;Nu()&&Ct(!1);let l=t.replace(/^\/*/,"/"),c=v.useMemo(()=>({basename:l,navigator:s,static:o,future:Ha({v7_relativeSplatPath:!1},a)}),[l,a,s,o]);typeof r=="string"&&(r=ms(r));let{pathname:d="/",search:u="",hash:p="",state:h=null,key:y="default"}=r,b=v.useMemo(()=>{let C=Ub(d,l);return C==null?null:{location:{pathname:C,search:u,hash:p,state:h,key:y},navigationType:i}},[l,d,u,p,h,y,i]);return b==null?null:v.createElement(Mu.Provider,{value:c},v.createElement(Pu.Provider,{children:n,value:b}))}function BA(e){let{children:t,location:n}=e;return CA(Ap(t),n)}new Promise(()=>{});function Ap(e,t){t===void 0&&(t=[]);let n=[];return v.Children.forEach(e,(r,i)=>{if(!v.isValidElement(r))return;let s=[...t,i];if(r.type===v.Fragment){n.push.apply(n,Ap(r.props.children,s));return}r.type!==Ep&&Ct(!1),!r.props.index||!r.props.children||Ct(!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=Ap(r.props.children,s)),n.push(o)}),n}var Qb={exports:{}};/*!
|
|
59
|
-
Copyright (c) 2018 Jed Watson.
|
|
60
|
-
Licensed under the MIT License (MIT), see
|
|
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})()})(Qb);var $A=Qb.exports;const Oe=Fr($A);function zA(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 VA=e=>{switch(e){case"success":return WA;case"info":return GA;case"warning":return qA;case"error":return YA;default:return null}},UA=Array(12).fill(0),HA=({visible:e,className:t})=>ie.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ie.createElement("div",{className:"sonner-spinner"},UA.map((n,r)=>ie.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),WA=ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ie.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"})),qA=ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ie.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"})),GA=ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ie.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"})),YA=ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ie.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"})),QA=ie.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"},ie.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ie.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),KA=()=>{const[e,t]=ie.useState(document.hidden);return ie.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let jp=1;class XA{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:jp++,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],ie.isValidElement(c))s=!1,this.create({id:r,type:"default",message:c});else if(JA(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)||jp++;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 Yt=new XA,ZA=(e,t)=>{const n=(t==null?void 0:t.id)||jp++;return Yt.addToast({title:e,...t,id:n}),n},JA=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",ej=ZA,tj=()=>Yt.toasts,nj=()=>Yt.getActiveToasts(),Kb=Object.assign(ej,{success:Yt.success,info:Yt.info,warning:Yt.warning,error:Yt.error,custom:Yt.custom,message:Yt.message,promise:Yt.promise,dismiss:Yt.dismiss,loading:Yt.loading},{getHistory:tj,getToasts:nj});zA("[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 zl(e){return e.label!==void 0}const rj=3,ij="24px",sj="16px",uv=4e3,oj=356,aj=14,lj=45,cj=200;function Zn(...e){return e.filter(Boolean).join(" ")}function uj(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const dj=e=>{var t,n,r,i,s,o,a,l,c;const{invert:d,toast:u,unstyled:p,interacting:h,setHeights:y,visibleToasts:b,heights:C,index:g,toasts:m,expanded:w,removeToast:S,defaultRichColors:T,closeButton:k,style:E,cancelButtonStyle:M,actionButtonStyle:U,className:j="",descriptionClassName:N="",duration:O,position:z,gap:L,expandByDefault:D,classNames:I,icons:F,closeButtonAriaLabel:_="Close toast"}=e,[B,V]=ie.useState(null),[G,W]=ie.useState(null),[ee,ue]=ie.useState(!1),[me,pe]=ie.useState(!1),[Se,ke]=ie.useState(!1),[ye,xe]=ie.useState(!1),[be,P]=ie.useState(!1),[Y,te]=ie.useState(0),[Q,ae]=ie.useState(0),re=ie.useRef(u.duration||O||uv),ce=ie.useRef(null),fe=ie.useRef(null),X=g===0,Z=g+1<=b,R=u.type,q=u.dismissible!==!1,$=u.className||"",H=u.descriptionClassName||"",oe=ie.useMemo(()=>C.findIndex(_e=>_e.toastId===u.id)||0,[C,u.id]),he=ie.useMemo(()=>{var _e;return(_e=u.closeButton)!=null?_e:k},[u.closeButton,k]),Te=ie.useMemo(()=>u.duration||O||uv,[u.duration,O]),Qe=ie.useRef(0),rt=ie.useRef(0),tn=ie.useRef(0),At=ie.useRef(null),[gn,vn]=z.split("-"),Pn=ie.useMemo(()=>C.reduce((_e,lt,it)=>it>=oe?_e:_e+lt.height,0),[C,oe]),wr=KA(),He=u.invert||d,yt=R==="loading";rt.current=ie.useMemo(()=>oe*L+Pn,[oe,Pn]),ie.useEffect(()=>{re.current=Te},[Te]),ie.useEffect(()=>{ue(!0)},[]),ie.useEffect(()=>{const _e=fe.current;if(_e){const lt=_e.getBoundingClientRect().height;return ae(lt),y(it=>[{toastId:u.id,height:lt,position:u.position},...it]),()=>y(it=>it.filter(jt=>jt.toastId!==u.id))}},[y,u.id]),ie.useLayoutEffect(()=>{if(!ee)return;const _e=fe.current,lt=_e.style.height;_e.style.height="auto";const it=_e.getBoundingClientRect().height;_e.style.height=lt,ae(it),y(jt=>jt.find(ht=>ht.toastId===u.id)?jt.map(ht=>ht.toastId===u.id?{...ht,height:it}:ht):[{toastId:u.id,height:it,position:u.position},...jt])},[ee,u.title,u.description,y,u.id]);const Nn=ie.useCallback(()=>{pe(!0),te(rt.current),y(_e=>_e.filter(lt=>lt.toastId!==u.id)),setTimeout(()=>{S(u)},cj)},[u,S,y,rt]);ie.useEffect(()=>{if(u.promise&&R==="loading"||u.duration===1/0||u.type==="loading")return;let _e;return w||h||wr?(()=>{if(tn.current<Qe.current){const jt=new Date().getTime()-Qe.current;re.current=re.current-jt}tn.current=new Date().getTime()})():(()=>{re.current!==1/0&&(Qe.current=new Date().getTime(),_e=setTimeout(()=>{u.onAutoClose==null||u.onAutoClose.call(u,u),Nn()},re.current))})(),()=>clearTimeout(_e)},[w,h,u,R,wr,Nn]),ie.useEffect(()=>{u.delete&&Nn()},[Nn,u.delete]);function Kn(){var _e;if(F!=null&&F.loading){var lt;return ie.createElement("div",{className:Zn(I==null?void 0:I.loader,u==null||(lt=u.classNames)==null?void 0:lt.loader,"sonner-loader"),"data-visible":R==="loading"},F.loading)}return ie.createElement(HA,{className:Zn(I==null?void 0:I.loader,u==null||(_e=u.classNames)==null?void 0:_e.loader),visible:R==="loading"})}var bl,_s;return ie.createElement("li",{tabIndex:0,ref:fe,className:Zn(j,$,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[R],u==null||(n=u.classNames)==null?void 0:n[R]),"data-sonner-toast":"","data-rich-colors":(bl=u.richColors)!=null?bl:T,"data-styled":!(u.jsx||u.unstyled||p),"data-mounted":ee,"data-promise":!!u.promise,"data-swiped":be,"data-removed":me,"data-visible":Z,"data-y-position":gn,"data-x-position":vn,"data-index":g,"data-front":X,"data-swiping":Se,"data-dismissible":q,"data-type":R,"data-invert":He,"data-swipe-out":ye,"data-swipe-direction":G,"data-expanded":!!(w||D&&ee),style:{"--index":g,"--toasts-before":g,"--z-index":m.length-g,"--offset":`${me?Y:rt.current}px`,"--initial-height":D?"auto":`${Q}px`,...E,...u.style},onDragEnd:()=>{ke(!1),V(null),At.current=null},onPointerDown:_e=>{yt||!q||(ce.current=new Date,te(rt.current),_e.target.setPointerCapture(_e.pointerId),_e.target.tagName!=="BUTTON"&&(ke(!0),At.current={x:_e.clientX,y:_e.clientY}))},onPointerUp:()=>{var _e,lt,it;if(ye||!q)return;At.current=null;const jt=Number(((_e=fe.current)==null?void 0:_e.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ji=Number(((lt=fe.current)==null?void 0:lt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ht=new Date().getTime()-((it=ce.current)==null?void 0:it.getTime()),Rt=B==="x"?jt:ji,zr=Math.abs(Rt)/ht;if(Math.abs(Rt)>=lj||zr>.11){te(rt.current),u.onDismiss==null||u.onDismiss.call(u,u),W(B==="x"?jt>0?"right":"left":ji>0?"down":"up"),Nn(),xe(!0);return}else{var On,Dn;(On=fe.current)==null||On.style.setProperty("--swipe-amount-x","0px"),(Dn=fe.current)==null||Dn.style.setProperty("--swipe-amount-y","0px")}P(!1),ke(!1),V(null)},onPointerMove:_e=>{var lt,it,jt;if(!At.current||!q||((lt=window.getSelection())==null?void 0:lt.toString().length)>0)return;const ht=_e.clientY-At.current.y,Rt=_e.clientX-At.current.x;var zr;const On=(zr=e.swipeDirections)!=null?zr:uj(z);!B&&(Math.abs(Rt)>1||Math.abs(ht)>1)&&V(Math.abs(Rt)>Math.abs(ht)?"x":"y");let Dn={x:0,y:0};const Fg=Ri=>1/(1.5+Math.abs(Ri)/20);if(B==="y"){if(On.includes("top")||On.includes("bottom"))if(On.includes("top")&&ht<0||On.includes("bottom")&&ht>0)Dn.y=ht;else{const Ri=ht*Fg(ht);Dn.y=Math.abs(Ri)<Math.abs(ht)?Ri:ht}}else if(B==="x"&&(On.includes("left")||On.includes("right")))if(On.includes("left")&&Rt<0||On.includes("right")&&Rt>0)Dn.x=Rt;else{const Ri=Rt*Fg(Rt);Dn.x=Math.abs(Ri)<Math.abs(Rt)?Ri:Rt}(Math.abs(Dn.x)>0||Math.abs(Dn.y)>0)&&P(!0),(it=fe.current)==null||it.style.setProperty("--swipe-amount-x",`${Dn.x}px`),(jt=fe.current)==null||jt.style.setProperty("--swipe-amount-y",`${Dn.y}px`)}},he&&!u.jsx&&R!=="loading"?ie.createElement("button",{"aria-label":_,"data-disabled":yt,"data-close-button":!0,onClick:yt||!q?()=>{}:()=>{Nn(),u.onDismiss==null||u.onDismiss.call(u,u)},className:Zn(I==null?void 0:I.closeButton,u==null||(r=u.classNames)==null?void 0:r.closeButton)},(_s=F==null?void 0:F.close)!=null?_s:QA):null,R||u.icon||u.promise?ie.createElement("div",{"data-icon":"",className:Zn(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||Kn():null,u.type!=="loading"?u.icon||(F==null?void 0:F[R])||VA(R):null):null,ie.createElement("div",{"data-content":"",className:Zn(I==null?void 0:I.content,u==null||(s=u.classNames)==null?void 0:s.content)},ie.createElement("div",{"data-title":"",className:Zn(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?ie.createElement("div",{"data-description":"",className:Zn(N,H,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),ie.isValidElement(u.cancel)?u.cancel:u.cancel&&zl(u.cancel)?ie.createElement("button",{"data-button":!0,"data-cancel":!0,style:u.cancelButtonStyle||M,onClick:_e=>{zl(u.cancel)&&q&&(u.cancel.onClick==null||u.cancel.onClick.call(u.cancel,_e),Nn())},className:Zn(I==null?void 0:I.cancelButton,u==null||(l=u.classNames)==null?void 0:l.cancelButton)},u.cancel.label):null,ie.isValidElement(u.action)?u.action:u.action&&zl(u.action)?ie.createElement("button",{"data-button":!0,"data-action":!0,style:u.actionButtonStyle||U,onClick:_e=>{zl(u.action)&&(u.action.onClick==null||u.action.onClick.call(u.action,_e),!_e.defaultPrevented&&Nn())},className:Zn(I==null?void 0:I.actionButton,u==null||(c=u.classNames)==null?void 0:c.actionButton)},u.action.label):null)};function dv(){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 fj(e,t){const n={};return[e,t].forEach((r,i)=>{const s=i===1,o=s?"--mobile-offset":"--offset",a=s?sj:ij;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 pj=ie.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:b=rj,toastOptions:C,dir:g=dv(),gap:m=aj,icons:w,containerAriaLabel:S="Notifications"}=t,[T,k]=ie.useState([]),E=ie.useMemo(()=>Array.from(new Set([i].concat(T.filter(G=>G.position).map(G=>G.position)))),[T,i]),[M,U]=ie.useState([]),[j,N]=ie.useState(!1),[O,z]=ie.useState(!1),[L,D]=ie.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),I=ie.useRef(null),F=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),_=ie.useRef(null),B=ie.useRef(!1),V=ie.useCallback(G=>{k(W=>{var ee;return(ee=W.find(ue=>ue.id===G.id))!=null&&ee.delete||Yt.dismiss(G.id),W.filter(({id:ue})=>ue!==G.id)})},[]);return ie.useEffect(()=>Yt.subscribe(G=>{if(G.dismiss){const W=T.map(ee=>ee.id===G.id?{...ee,delete:!0}:ee);requestAnimationFrame(()=>{k(W)});return}setTimeout(()=>{YT.flushSync(()=>{k(W=>{const ee=W.findIndex(ue=>ue.id===G.id);return ee!==-1?[...W.slice(0,ee),{...W[ee],...G},...W.slice(ee+1)]:[G,...W]})})})}),[T]),ie.useEffect(()=>{if(u!=="system"){D(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?D("dark"):D("light")),typeof window>"u")return;const G=window.matchMedia("(prefers-color-scheme: dark)");try{G.addEventListener("change",({matches:W})=>{D(W?"dark":"light")})}catch{G.addListener(({matches:ee})=>{try{D(ee?"dark":"light")}catch(ue){console.error(ue)}})}},[u]),ie.useEffect(()=>{T.length<=1&&N(!1)},[T]),ie.useEffect(()=>{const G=W=>{var ee;if(s.every(pe=>W[pe]||W.code===pe)){var me;N(!0),(me=I.current)==null||me.focus()}W.code==="Escape"&&(document.activeElement===I.current||(ee=I.current)!=null&&ee.contains(document.activeElement))&&N(!1)};return document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G)},[s]),ie.useEffect(()=>{if(I.current)return()=>{_.current&&(_.current.focus({preventScroll:!0}),_.current=null,B.current=!1)}},[I.current]),ie.createElement("section",{ref:n,"aria-label":`${S} ${F}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},E.map((G,W)=>{var ee;const[ue,me]=G.split("-");return T.length?ie.createElement("ol",{key:G,dir:g==="auto"?dv():g,tabIndex:-1,ref:I,className:l,"data-sonner-toaster":!0,"data-sonner-theme":L,"data-y-position":ue,"data-lifted":j&&T.length>1&&!o,"data-x-position":me,style:{"--front-toast-height":`${((ee=M[0])==null?void 0:ee.height)||0}px`,"--width":`${oj}px`,"--gap":`${m}px`,...y,...fj(c,d)},onBlur:pe=>{B.current&&!pe.currentTarget.contains(pe.relatedTarget)&&(B.current=!1,_.current&&(_.current.focus({preventScroll:!0}),_.current=null))},onFocus:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||B.current||(B.current=!0,_.current=pe.relatedTarget)},onMouseEnter:()=>N(!0),onMouseMove:()=>N(!0),onMouseLeave:()=>{O||N(!1)},onDragEnd:()=>N(!1),onPointerDown:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||z(!0)},onPointerUp:()=>z(!1)},T.filter(pe=>!pe.position&&W===0||pe.position===G).map((pe,Se)=>{var ke,ye;return ie.createElement(dj,{key:pe.id,icons:w,index:Se,toast:pe,defaultRichColors:p,duration:(ke=C==null?void 0:C.duration)!=null?ke:h,className:C==null?void 0:C.className,descriptionClassName:C==null?void 0:C.descriptionClassName,invert:r,visibleToasts:b,closeButton:(ye=C==null?void 0:C.closeButton)!=null?ye:a,interacting:O,position:G,style:C==null?void 0:C.style,unstyled:C==null?void 0:C.unstyled,classNames:C==null?void 0:C.classNames,cancelButtonStyle:C==null?void 0:C.cancelButtonStyle,actionButtonStyle:C==null?void 0:C.actionButtonStyle,closeButtonAriaLabel:C==null?void 0:C.closeButtonAriaLabel,removeToast:V,toasts:T.filter(xe=>xe.position==pe.position),heights:M.filter(xe=>xe.position==pe.position),setHeights:U,expandByDefault:o,gap:m,expanded:j,swipeDirections:t.swipeDirections})})):null}))}),Em=3e3;function Vn(e){const{duration:t,...n}=e;return Kb.custom(r=>f.jsx(hj,{id:r,title:n.title,description:n.description,variant:n.variant,button:n.button}),{duration:t??Em})}const Bd={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 hj(e){const{title:t,description:n,button:r,id:i,variant:s}=e;return f.jsxs("div",{className:Oe("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",Bd[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:Oe("text-sm font-medium",Bd[s||"info"].text),children:t}),f.jsx("p",{className:Oe("text-sm",Bd[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(),Kb.dismiss(i)},children:r.label})})]})}function mj(e){return Array.isArray(e)&&e[0].field!==void 0}const Co=(e,t)=>{var n;if(mj(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||Vn({description:e.message,variant:"error"});return}if(e&&e.error){t!=null&&t.noToast||Vn({description:e.error,variant:"error"});return}},gj=[{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ı"}],vj=[{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ı"}],Qo=(e,t)=>t?`${e} (Kod: ${t})`:e,yj=(e,t)=>{if(Yn(t))return!1;if(e===null)return Vn({description:"Bir hata oluştu",variant:"error"}),!0;if(typeof e=="object"&&e){const r=e.code;if(r){const i=vj.find(s=>s.code===r);if(i)return Vn({description:Qo(i.text,r),variant:"error"}),!0}if(t===401){if(e.tokenNotPresent)return Vn({description:Qo("Oturum bilgisi bulunamadı. Lütfen sohbeti yeniden başlatın","AUTH_TOKEN_NOT_PRESENT"),variant:"error"}),!0;if(e.tokenNotValid)return Vn({description:Qo("Oturum süreniz dolmuş olabilir. Lütfen sohbeti yeniden başlatın","AUTH_TOKEN_NOT_VALID"),variant:"error"}),!0;if(e.verifyRequired)return Vn({description:Qo("Hesap doğrulaması gerekiyor. Lütfen doğrulama adımını tamamlayın","AUTH_VERIFY_REQUIRED"),variant:"error"}),!0}if(e.message)return Vn({description:Qo(e.message,r),variant:"error"}),!0}const n=gj.find(r=>r.code===t);return Vn({description:n?n.text:"Bir hata oluştu",variant:"error"}),!0},xj={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"}},fv={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"}},Am=v.createContext({});function Ou(e){const t=v.useRef(null);return t.current===null&&(t.current=e()),t.current}const jm=typeof window<"u",Xb=jm?v.useLayoutEffect:v.useEffect,Du=v.createContext(null),Rm=v.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class wj 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 bj({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(Rm);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 h=document.createElement("style");return o&&(h.nonce=o),document.head.appendChild(h),h.sheet&&h.sheet.insertRule(`
|
|
63
|
-
[data-motion-pop-id="${r}"] {
|
|
64
|
-
position: absolute !important;
|
|
65
|
-
width: ${a}px !important;
|
|
66
|
-
height: ${l}px !important;
|
|
67
|
-
${p}px !important;
|
|
68
|
-
top: ${c}px !important;
|
|
69
|
-
}
|
|
70
|
-
`),()=>{document.head.removeChild(h)}},[t]),f.jsx(wj,{isPresent:t,childRef:i,sizeRef:s,children:v.cloneElement(e,{ref:i})})}const Cj=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:o,anchorX:a})=>{const l=Ou(Sj),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 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}),v.useMemo(()=>{l.forEach((p,h)=>l.set(h,!1))},[n]),v.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),o==="popLayout"&&(e=f.jsx(bj,{isPresent:n,anchorX:a,children:e})),f.jsx(Du.Provider,{value:u,children:e})};function Sj(){return new Map}function Zb(e=!0){const t=v.useContext(Du);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 Vl=e=>e.key||"";function pv(e){const t=[];return v.Children.forEach(e,n=>{v.isValidElement(n)&&t.push(n)}),t}const Dr=({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=v.useMemo(()=>pv(e),[e]),u=o&&!l?[]:d.map(Vl),p=v.useRef(!0),h=v.useRef(d),y=Ou(()=>new Map),[b,C]=v.useState(d),[g,m]=v.useState(d);Xb(()=>{p.current=!1,h.current=d;for(let T=0;T<g.length;T++){const k=Vl(g[T]);u.includes(k)?y.delete(k):y.get(k)!==!0&&y.set(k,!1)}},[g,u.length,u.join("-")]);const w=[];if(d!==b){let T=[...d];for(let k=0;k<g.length;k++){const E=g[k],M=Vl(E);u.includes(M)||(T.splice(k,0,E),w.push(E))}return s==="wait"&&w.length&&(T=w),m(pv(T)),C(d),null}const{forceRender:S}=v.useContext(Am);return f.jsx(f.Fragment,{children:g.map(T=>{const k=Vl(T),E=o&&!l?!1:d===g||u.includes(k),M=()=>{if(y.has(k))y.set(k,!0);else return;let U=!0;y.forEach(j=>{j||(U=!1)}),U&&(S==null||S(),m(h.current),o&&(c==null||c()),r&&r())};return f.jsx(Cj,{isPresent:E,initial:!p.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:s,onExitComplete:E?void 0:M,anchorX:a,children:T},k)})})};function Mm(e,t){e.indexOf(t)===-1&&e.push(t)}function Pm(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}let Rp=()=>{};const Mp={skipAnimations:!1,useManualTiming:!1};function Nm(e){let t;return()=>(t===void 0&&(t=e()),t)}const jn=e=>e,Wa=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Om{constructor(){this.subscriptions=[]}add(t){return Mm(this.subscriptions,t),()=>Pm(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 ur=e=>e*1e3,dr=e=>e/1e3;function Jb(e,t){return t?e*(1e3/t):0}const kj=Nm(()=>window.ScrollTimeline!==void 0);class _j{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(kj()&&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 Tj extends _j{then(t,n){return this.finished.finally(t).then(()=>{})}}const hv={value:null,addProjectionMetrics:null},Dm=e=>Array.isArray(e)&&typeof e[0]=="number",Ej={};function Aj(e,t){const n=Nm(e);return()=>Ej[t]??n()}const qa=Aj(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),eC=(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)})`},ia=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Pp={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ia([0,.65,.55,1]),circOut:ia([.55,0,1,.45]),backIn:ia([.31,.01,.66,-.59]),backOut:ia([.33,1.53,.69,.99])};function tC(e,t){if(e)return typeof e=="function"&&qa()?eC(e,t):Dm(e)?ia(e):Array.isArray(e)?e.map(n=>tC(n,t)||Pp.easeOut):Pp[e]}function jj(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=tC(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 Im(e){return typeof e=="function"&&"applyToOptions"in e}function Lm(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const Zc=2e4;function Fm(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 Rj(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(Fm(r),Zc);return{type:"keyframes",ease:s=>r.next(i*s).value/t,duration:dr(i)}}function nC(e){return!!(typeof e=="function"&&qa()||!e||typeof e=="string"&&(e in Pp||qa())||Dm(e)||Array.isArray(e)&&e.every(nC))}function mv(e,t){e.timeline=t,e.onfinish=null}const Ul=["read","resolveKeyframes","update","preRender","render","postRender"];function Mj(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 b=h&&i?n:r;return p&&o.add(u),b.has(u)||b.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&&hv.value&&hv.value.frameloop[t].push(l),l=0,n.clear(),i=!1,s&&(s=!1,d.process(u))}};return d}const Pj=40;function rC(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=Ul.reduce((g,m)=>(g[m]=Mj(s,t?m:void 0),g),{}),{read:a,resolveKeyframes:l,update:c,preRender:d,render:u,postRender:p}=o,h=()=>{const g=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(g-i.timestamp,Pj),1),i.timestamp=g,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:Ul.reduce((g,m)=>{const w=o[m];return g[m]=(S,T=!1,k=!1)=>(n||y(),w.schedule(S,T,k)),g},{}),cancel:g=>{for(let m=0;m<Ul.length;m++)o[Ul[m]].cancel(g)},state:i,steps:o}}const{schedule:Bm,cancel:Y8}=rC(queueMicrotask,!1),{schedule:Ue,cancel:bi,state:_t,steps:$d}=rC(typeof requestAnimationFrame<"u"?requestAnimationFrame:jn,!0);let pc;function Nj(){pc=void 0}const fr={now:()=>(pc===void 0&&fr.set(_t.isProcessing||Mp.useManualTiming?_t.timestamp:performance.now()),pc),set:e=>{pc=e,queueMicrotask(Nj)}},Fn={x:!1,y:!1};function iC(){return Fn.x||Fn.y}function Oj(e){return e==="x"||e==="y"?Fn[e]?null:(Fn[e]=!0,()=>{Fn[e]=!1}):Fn.x||Fn.y?null:(Fn.x=Fn.y=!0,()=>{Fn.x=Fn.y=!1})}function Dj(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 sC(e,t){const n=Dj(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function gv(e){return!(e.pointerType==="touch"||iC())}function Ij(e,t,n={}){const[r,i,s]=sC(e,n),o=a=>{if(!gv(a))return;const{target:l}=a,c=t(l,a);if(typeof c!="function"||!l)return;const d=u=>{gv(u)&&(c(u),l.removeEventListener("pointerleave",d))};l.addEventListener("pointerleave",d,i)};return r.forEach(a=>{a.addEventListener("pointerenter",o,i)}),s}const oC=(e,t)=>t?e===t?!0:oC(e,t.parentElement):!1,$m=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Lj=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Fj(e){return Lj.has(e.tagName)||e.tabIndex!==-1}const sa=new WeakSet;function vv(e){return t=>{t.key==="Enter"&&e(t)}}function zd(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Bj=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=vv(()=>{if(sa.has(n))return;zd(n,"down");const i=vv(()=>{zd(n,"up")}),s=()=>zd(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 yv(e){return $m(e)&&!iC()}function $j(e,t,n={}){const[r,i,s]=sC(e,n),o=a=>{const l=a.currentTarget;if(!yv(a)||sa.has(l))return;sa.add(l);const c=t(l,a),d=(h,y)=>{window.removeEventListener("pointerup",u),window.removeEventListener("pointercancel",p),!(!yv(h)||!sa.has(l))&&(sa.delete(l),typeof c=="function"&&c(h,{success:y}))},u=h=>{d(h,l===window||l===document||n.useGlobalTarget||oC(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=>Bj(c,i)),!Fj(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}const xv=30,zj=e=>!isNaN(parseFloat(e));class Vj{constructor(t,n={}){this.version="12.7.4",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const s=fr.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=fr.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=zj(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 Om);const r=this.events[t].add(n);return t==="change"?()=>{r(),Ue.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=fr.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>xv)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,xv);return Jb(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 Ga(e,t){return new Vj(e,t)}const aC=v.createContext({strict:!1}),wv={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"]},So={};for(const e in wv)So[e]={isEnabled:t=>wv[e].some(n=>!!t[n])};function Uj(e){for(const t in e)So[t]={...So[t],...e[t]}}const Hj=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 Jc(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Hj.has(e)}let lC=e=>!Jc(e);function Wj(e){e&&(lC=t=>t.startsWith("on")?!Jc(t):e(t))}try{Wj(require("@emotion/is-prop-valid").default)}catch{}function qj(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(lC(i)||n===!0&&Jc(i)||!t&&!Jc(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function Gj(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 Iu=v.createContext({});function Lu(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Ya(e){return typeof e=="string"||Array.isArray(e)}const zm=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Vm=["initial",...zm];function Fu(e){return Lu(e.animate)||Vm.some(t=>Ya(e[t]))}function cC(e){return!!(Fu(e)||e.variants)}function Yj(e,t){if(Fu(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Ya(n)?n:void 0,animate:Ya(r)?r:void 0}}return e.inherit!==!1?t:{}}function Qj(e){const{initial:t,animate:n}=Yj(e,v.useContext(Iu));return v.useMemo(()=>({initial:t,animate:n}),[bv(t),bv(n)])}function bv(e){return Array.isArray(e)?e.join(" "):e}const Kj=Symbol.for("motionComponentSymbol");function $s(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Xj(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):$s(n)&&(n.current=r))},[t])}const Um=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Zj="framerAppearId",uC="data-"+Um(Zj),dC=v.createContext({});function Jj(e,t,n,r,i){var b,C;const{visualElement:s}=v.useContext(Iu),o=v.useContext(aC),a=v.useContext(Du),l=v.useContext(Rm).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(dC);d&&!d.projection&&i&&(d.type==="html"||d.type==="svg")&&e5(c.current,n,i,u);const p=v.useRef(!1);v.useInsertionEffect(()=>{d&&p.current&&d.update(n,a)});const h=n[uC],y=v.useRef(!!h&&!((b=window.MotionHandoffIsComplete)!=null&&b.call(window,h))&&((C=window.MotionHasOptimisedAnimation)==null?void 0:C.call(window,h)));return Xb(()=>{d&&(p.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),Bm.render(d.render),y.current&&d.animationState&&d.animationState.animateChanges())}),v.useEffect(()=>{d&&(!y.current&&d.animationState&&d.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var g;(g=window.MotionHandoffMarkAsComplete)==null||g.call(window,h)}),y.current=!1))}),d}function e5(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:fC(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&$s(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:l,layoutRoot:c})}function fC(e){if(e)return e.options.allowProjection!==!1?e.projection:fC(e.parent)}function t5({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&Uj(e);function s(a,l){let c;const d={...v.useContext(Rm),...a,layoutId:n5(a)},{isStatic:u}=d,p=Qj(a),h=r(a,u);if(!u&&jm){r5();const y=i5(d);c=y.MeasureLayout,p.visualElement=Jj(i,h,d,t,y.ProjectionNode)}return f.jsxs(Iu.Provider,{value:p,children:[c&&p.visualElement?f.jsx(c,{visualElement:p.visualElement,...d}):null,n(i,a,Xj(h,p.visualElement,l),h,u,p.visualElement)]})}s.displayName=`motion.${typeof i=="string"?i:`create(${i.displayName??i.name??""})`}`;const o=v.forwardRef(s);return o[Kj]=i,o}function n5({layoutId:e}){const t=v.useContext(Am).id;return t&&e!==void 0?t+"-"+e:e}function r5(e,t){v.useContext(aC).strict}function i5(e){const{drag:t,layout:n}=So;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 pC=e=>t=>typeof t=="string"&&t.startsWith(e),Hm=pC("--"),s5=pC("var(--"),Wm=e=>s5(e)?o5.test(e.split("/*")[0].trim()):!1,o5=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Qa={};function a5(e){for(const t in e)Qa[t]=e[t],Hm(t)&&(Qa[t].isCSSVariable=!0)}const Do=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],gs=new Set(Do);function hC(e,{layout:t,layoutId:n}){return gs.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Qa[e]||e==="opacity")}const It=e=>!!(e&&e.getVelocity),mC=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Ir=(e,t,n)=>n>t?t:n<e?e:n,Io={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Ka={...Io,transform:e=>Ir(0,1,e)},Hl={...Io,default:1},pl=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Hr=pl("deg"),pr=pl("%"),Ce=pl("px"),l5=pl("vh"),c5=pl("vw"),Cv={...pr,parse:e=>pr.parse(e)/100,transform:e=>pr.transform(e*100)},u5={borderWidth:Ce,borderTopWidth:Ce,borderRightWidth:Ce,borderBottomWidth:Ce,borderLeftWidth:Ce,borderRadius:Ce,radius:Ce,borderTopLeftRadius:Ce,borderTopRightRadius:Ce,borderBottomRightRadius:Ce,borderBottomLeftRadius:Ce,width:Ce,maxWidth:Ce,height:Ce,maxHeight:Ce,top:Ce,right:Ce,bottom:Ce,left:Ce,padding:Ce,paddingTop:Ce,paddingRight:Ce,paddingBottom:Ce,paddingLeft:Ce,margin:Ce,marginTop:Ce,marginRight:Ce,marginBottom:Ce,marginLeft:Ce,backgroundPositionX:Ce,backgroundPositionY:Ce},d5={rotate:Hr,rotateX:Hr,rotateY:Hr,rotateZ:Hr,scale:Hl,scaleX:Hl,scaleY:Hl,scaleZ:Hl,skew:Hr,skewX:Hr,skewY:Hr,distance:Ce,translateX:Ce,translateY:Ce,translateZ:Ce,x:Ce,y:Ce,z:Ce,perspective:Ce,transformPerspective:Ce,opacity:Ka,originX:Cv,originY:Cv,originZ:Ce},Sv={...Io,transform:Math.round},qm={...u5,...d5,zIndex:Sv,size:Ce,fillOpacity:Ka,strokeOpacity:Ka,numOctaves:Sv},f5={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},p5=Do.length;function h5(e,t,n){let r="",i=!0;for(let s=0;s<p5;s++){const o=Do[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=mC(a,qm[o]);if(!l){i=!1;const d=f5[o]||o;r+=`${d}(${c}) `}n&&(t[o]=c)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function Gm(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(gs.has(l)){o=!0;continue}else if(Hm(l)){i[l]=c;continue}else{const d=mC(c,qm[l]);l.startsWith("origin")?(a=!0,s[l]=d):r[l]=d}}if(t.transform||(o||n?r.transform=h5(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 Ym=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function gC(e,t,n){for(const r in t)!It(t[r])&&!hC(r,n)&&(e[r]=t[r])}function m5({transformTemplate:e},t){return v.useMemo(()=>{const n=Ym();return Gm(n,t,e),Object.assign({},n.vars,n.style)},[t])}function g5(e,t){const n=e.style||{},r={};return gC(r,n,e),Object.assign(r,m5(e,t)),r}function v5(e,t){const n={},r=g5(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 y5=["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 Qm(e){return typeof e!="string"||e.includes("-")?!1:!!(y5.indexOf(e)>-1||/[A-Z]/u.test(e))}const x5={offset:"stroke-dashoffset",array:"stroke-dasharray"},w5={offset:"strokeDashoffset",array:"strokeDasharray"};function b5(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?x5:w5;e[s.offset]=Ce.transform(-r);const o=Ce.transform(t),a=Ce.transform(n);e[s.array]=`${o} ${a}`}function kv(e,t,n){return typeof e=="string"?e:Ce.transform(t+n*e)}function C5(e,t,n){const r=kv(t,e.x,e.width),i=kv(n,e.y,e.height);return`${r} ${i}`}function Km(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...c},d,u){if(Gm(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=C5(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&&b5(p,o,a,l,!1)}const vC=()=>({...Ym(),attrs:{}}),Xm=e=>typeof e=="string"&&e.toLowerCase()==="svg";function S5(e,t,n,r){const i=v.useMemo(()=>{const s=vC();return Km(s,t,Xm(r),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};gC(s,e.style,e),i.style={...s,...i.style}}return i}function k5(e=!1){return(n,r,i,{latestValues:s},o)=>{const l=(Qm(n)?S5:v5)(r,s,o,n),c=qj(r,typeof n=="string",e),d=n!==v.Fragment?{...c,...l,ref:i}:{},{children:u}=r,p=v.useMemo(()=>It(u)?u.get():u,[u]);return v.createElement(n,{...d,children:p})}}function _v(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Zm(e,t,n,r){if(typeof t=="function"){const[i,s]=_v(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]=_v(r);t=t(n!==void 0?n:e.custom,i,s)}return t}const Np=e=>Array.isArray(e),_5=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),T5=e=>Np(e)?e[e.length-1]||0:e;function hc(e){const t=It(e)?e.get():e;return _5(t)?t.toValue():t}function E5({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,i,s){const o={latestValues:A5(r,i,s,e),renderState:t()};return n&&(o.onMount=a=>n({props:r,current:a,...o}),o.onUpdate=a=>n(a)),o}const yC=e=>(t,n)=>{const r=v.useContext(Iu),i=v.useContext(Du),s=()=>E5(e,t,r,i);return n?s():Ou(s)};function A5(e,t,n,r){const i={},s=r(e,{});for(const p in s)i[p]=hc(s[p]);let{initial:o,animate:a}=e;const l=Fu(e),c=cC(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"&&!Lu(u)){const p=Array.isArray(u)?u:[u];for(let h=0;h<p.length;h++){const y=Zm(e,p[h]);if(y){const{transitionEnd:b,transition:C,...g}=y;for(const m in g){let w=g[m];if(Array.isArray(w)){const S=d?w.length-1:0;w=w[S]}w!==null&&(i[m]=w)}for(const m in b)i[m]=b[m]}}}return i}function Jm(e,t,n){var s;const{style:r}=e,i={};for(const o in r)(It(r[o])||t.style&&It(t.style[o])||hC(o,e)||((s=n==null?void 0:n.getValue(o))==null?void 0:s.liveStyle)!==void 0)&&(i[o]=r[o]);return i}const j5={useVisualState:yC({scrapeMotionValuesFromProps:Jm,createRenderState:Ym})};function xC(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 wC(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 bC=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 CC(e,t,n,r){wC(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(bC.has(i)?i:Um(i),t.attrs[i])}function SC(e,t,n){const r=Jm(e,t,n);for(const i in e)if(It(e[i])||It(t[i])){const s=Do.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=e[i]}return r}const Tv=["x","y","width","height","cx","cy","r"],R5={useVisualState:yC({scrapeMotionValuesFromProps:SC,createRenderState:vC,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(gs.has(a)){s=!0;break}}if(!s)return;let o=!t;if(t)for(let a=0;a<Tv.length;a++){const l=Tv[a];e[l]!==t[l]&&(o=!0)}o&&Ue.read(()=>{xC(n,r),Ue.render(()=>{Km(r,i,Xm(n.tagName),e.transformTemplate),CC(n,r)})})}})};function M5(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...Qm(r)?R5:j5,preloadedFeatures:e,useRender:k5(i),createVisualElement:t,Component:r};return t5(o)}}function Xa(e,t,n){const r=e.getProps();return Zm(r,t,n!==void 0?n:r.custom,e)}const kC=new Set(["width","height","top","left","right","bottom",...Do]);function P5(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ga(n))}function N5(e,t){const n=Xa(e,t);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const o in s){const a=T5(s[o]);P5(e,o,a)}}function O5(e){return!!(It(e)&&e.add)}function Op(e,t){const n=e.getValue("willChange");if(O5(n))return n.add(t);if(!n&&Mp.WillChange){const r=new Mp.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function _C(e){return e.props[uC]}const TC=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,D5=1e-7,I5=12;function L5(e,t,n,r,i){let s,o,a=0;do o=t+(n-t)/2,s=TC(o,r,i)-e,s>0?n=o:t=o;while(Math.abs(s)>D5&&++a<I5);return o}function hl(e,t,n,r){if(e===t&&n===r)return jn;const i=s=>L5(s,0,1,e,n);return s=>s===0||s===1?s:TC(i(s),t,r)}const EC=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,AC=e=>t=>1-e(1-t),jC=hl(.33,1.53,.69,.99),eg=AC(jC),RC=EC(eg),MC=e=>(e*=2)<1?.5*eg(e):.5*(2-Math.pow(2,-10*(e-1))),tg=e=>1-Math.sin(Math.acos(e)),PC=AC(tg),NC=EC(tg),OC=e=>/^0[^.\s]+$/u.test(e);function F5(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||OC(e):!0}const xa=e=>Math.round(e*1e5)/1e5,ng=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function B5(e){return e==null}const $5=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,rg=(e,t)=>n=>!!(typeof n=="string"&&$5.test(n)&&n.startsWith(e)||t&&!B5(n)&&Object.prototype.hasOwnProperty.call(n,t)),DC=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,s,o,a]=r.match(ng);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},z5=e=>Ir(0,255,e),Vd={...Io,transform:e=>Math.round(z5(e))},zi={test:rg("rgb","red"),parse:DC("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Vd.transform(e)+", "+Vd.transform(t)+", "+Vd.transform(n)+", "+xa(Ka.transform(r))+")"};function V5(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 Dp={test:rg("#"),parse:V5,transform:zi.transform},zs={test:rg("hsl","hue"),parse:DC("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+pr.transform(xa(t))+", "+pr.transform(xa(n))+", "+xa(Ka.transform(r))+")"},Ot={test:e=>zi.test(e)||Dp.test(e)||zs.test(e),parse:e=>zi.test(e)?zi.parse(e):zs.test(e)?zs.parse(e):Dp.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?zi.transform(e):zs.transform(e)},U5=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function H5(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(ng))==null?void 0:t.length)||0)+(((n=e.match(U5))==null?void 0:n.length)||0)>0}const IC="number",LC="color",W5="var",q5="var(",Ev="${}",G5=/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 Za(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const a=t.replace(G5,l=>(Ot.test(l)?(r.color.push(s),i.push(LC),n.push(Ot.parse(l))):l.startsWith(q5)?(r.var.push(s),i.push(W5),n.push(l)):(r.number.push(s),i.push(IC),n.push(parseFloat(l))),++s,Ev)).split(Ev);return{values:n,split:a,indexes:r,types:i}}function FC(e){return Za(e).values}function BC(e){const{split:t,types:n}=Za(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===IC?s+=xa(i[o]):a===LC?s+=Ot.transform(i[o]):s+=i[o]}return s}}const Y5=e=>typeof e=="number"?0:e;function Q5(e){const t=FC(e);return BC(e)(t.map(Y5))}const Ci={test:H5,parse:FC,createTransformer:BC,getAnimatableNone:Q5},K5=new Set(["brightness","contrast","saturate","opacity"]);function X5(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(ng)||[];if(!r)return e;const i=n.replace(r,"");let s=K5.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const Z5=/\b([a-z-]*)\(.*?\)/gu,Ip={...Ci,getAnimatableNone:e=>{const t=e.match(Z5);return t?t.map(X5).join(" "):e}},J5={...qm,color:Ot,backgroundColor:Ot,outlineColor:Ot,fill:Ot,stroke:Ot,borderColor:Ot,borderTopColor:Ot,borderRightColor:Ot,borderBottomColor:Ot,borderLeftColor:Ot,filter:Ip,WebkitFilter:Ip},$C=e=>J5[e];function zC(e,t){let n=$C(e);return n!==Ip&&(n=Ci),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const e3=new Set(["auto","none","0"]);function t3(e,t,n){let r=0,i;for(;r<e.length&&!i;){const s=e[r];typeof s=="string"&&!e3.has(s)&&Za(s).values.length&&(i=e[r]),r++}if(i&&n)for(const s of t)e[s]=zC(n,i)}const Vi=e=>e*180/Math.PI,Lp=e=>{const t=Vi(Math.atan2(e[1],e[0]));return Fp(t)},n3={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Lp,rotateZ:Lp,skewX:e=>Vi(Math.atan(e[1])),skewY:e=>Vi(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Fp=e=>(e=e%360,e<0&&(e+=360),e),Av=Lp,jv=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Rv=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),r3={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:jv,scaleY:Rv,scale:e=>(jv(e)+Rv(e))/2,rotateX:e=>Fp(Vi(Math.atan2(e[6],e[5]))),rotateY:e=>Fp(Vi(Math.atan2(-e[2],e[0]))),rotateZ:Av,rotate:Av,skewX:e=>Vi(Math.atan(e[4])),skewY:e=>Vi(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Mv(e){return e.includes("scale")?1:0}function Bp(e,t){if(!e||e==="none")return Mv(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=r3,i=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=n3,i=a}if(!i)return Mv(t);const s=r[t],o=i[1].split(",").map(s3);return typeof s=="function"?s(o):o[s]}const i3=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Bp(n,t)};function s3(e){return parseFloat(e.trim())}const Pv=e=>e===Io||e===Ce,o3=new Set(["x","y","z"]),a3=Do.filter(e=>!o3.has(e));function l3(e){const t=[];return a3.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const ko={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})=>Bp(t,"x"),y:(e,{transform:t})=>Bp(t,"y")};ko.translateX=ko.x;ko.translateY=ko.y;const es=new Set;let $p=!1,zp=!1;function VC(){if(zp){const e=Array.from(es).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=l3(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)})}zp=!1,$p=!1,es.forEach(e=>e.complete()),es.clear()}function UC(){es.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(zp=!0)})}function c3(){UC(),VC()}class ig{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?(es.add(this),$p||($p=!0,Ue.read(UC),Ue.resolveKeyframes(VC))):(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),es.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,es.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const HC=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),u3=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function d3(e){const t=u3.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function WC(e,t,n=1){const[r,i]=d3(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const o=s.trim();return HC(o)?parseFloat(o):o}return Wm(i)?WC(i,t,n+1):i}const qC=e=>t=>t.test(e),f3={test:e=>e==="auto",parse:e=>e},GC=[Io,Ce,pr,Hr,c5,l5,f3],Nv=e=>GC.find(qC(e));class YC extends ig{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(),Wm(c))){const d=WC(c,n.current);d!==void 0&&(t[l]=d),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!kC.has(r)||t.length!==2)return;const[i,s]=t,o=Nv(i),a=Nv(s);if(o!==a)if(Pv(o)&&Pv(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++)F5(t[i])&&r.push(i);r.length&&t3(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=ko[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]=ko[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 Ov=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ci.test(e)||e==="0")&&!e.startsWith("url("));function p3(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 h3(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=Ov(i,t),a=Ov(s,t);return!o||!a?!1:p3(e)||(n==="spring"||Im(n))&&r}const m3=e=>e!==null;function Bu(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(m3),s=t&&n!=="loop"&&t%2===1?0:i.length-1;return!s||r===void 0?i[s]:r}const g3=40;class QC{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=fr.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>g3?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&c3(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=fr.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:s,delay:o,onComplete:a,onUpdate:l,isGenerator:c}=this.options;if(!c&&!h3(t,r,i,s))if(o)this.options.duration=0;else{l&&l(Bu(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 et=(e,t,n)=>e+(t-e)*n;function Ud(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 v3({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=Ud(l,a,e+1/3),s=Ud(l,a,e),o=Ud(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}function eu(e,t){return n=>n>0?t:e}const Hd=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},y3=[Dp,zi,zs],x3=e=>y3.find(t=>t.test(e));function Dv(e){const t=x3(e);if(!t)return!1;let n=t.parse(e);return t===zs&&(n=v3(n)),n}const Iv=(e,t)=>{const n=Dv(e),r=Dv(t);if(!n||!r)return eu(e,t);const i={...n};return s=>(i.red=Hd(n.red,r.red,s),i.green=Hd(n.green,r.green,s),i.blue=Hd(n.blue,r.blue,s),i.alpha=et(n.alpha,r.alpha,s),zi.transform(i))},w3=(e,t)=>n=>t(e(n)),ml=(...e)=>e.reduce(w3),Vp=new Set(["none","hidden"]);function b3(e,t){return Vp.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function C3(e,t){return n=>et(e,t,n)}function sg(e){return typeof e=="number"?C3:typeof e=="string"?Wm(e)?eu:Ot.test(e)?Iv:_3:Array.isArray(e)?KC:typeof e=="object"?Ot.test(e)?Iv:S3:eu}function KC(e,t){const n=[...e],r=n.length,i=e.map((s,o)=>sg(s)(s,t[o]));return s=>{for(let o=0;o<r;o++)n[o]=i[o](s);return n}}function S3(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=sg(e[i])(e[i],t[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function k3(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 _3=(e,t)=>{const n=Ci.createTransformer(t),r=Za(e),i=Za(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?Vp.has(e)&&!i.values.length||Vp.has(t)&&!r.values.length?b3(e,t):ml(KC(k3(r,i),i.values),n):eu(e,t)};function XC(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?et(e,t,n):sg(e)(e,t)}const T3=5;function ZC(e,t,n){const r=Math.max(t-T3,0);return Jb(n-e(r),t-r)}const ot={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},Wd=.001;function E3({duration:e=ot.duration,bounce:t=ot.bounce,velocity:n=ot.velocity,mass:r=ot.mass}){let i,s,o=1-t;o=Ir(ot.minDamping,ot.maxDamping,o),e=Ir(ot.minDuration,ot.maxDuration,dr(e)),o<1?(i=c=>{const d=c*o,u=d*e,p=d-n,h=Up(c,o),y=Math.exp(-u);return Wd-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),b=Up(Math.pow(c,2),o);return(-i(c)+Wd>0?-1:1)*((p-h)*y)/b}):(i=c=>{const d=Math.exp(-c*e),u=(c-n)*e+1;return-Wd+d*u},s=c=>{const d=Math.exp(-c*e),u=(n-c)*(e*e);return d*u});const a=5/e,l=j3(i,s,a);if(e=ur(e),isNaN(l))return{stiffness:ot.stiffness,damping:ot.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const A3=12;function j3(e,t,n){let r=n;for(let i=1;i<A3;i++)r=r-e(r)/t(r);return r}function Up(e,t){return e*Math.sqrt(1-t*t)}const R3=["duration","bounce"],M3=["stiffness","damping","mass"];function Lv(e,t){return t.some(n=>e[n]!==void 0)}function P3(e){let t={velocity:ot.velocity,stiffness:ot.stiffness,damping:ot.damping,mass:ot.mass,isResolvedFromDuration:!1,...e};if(!Lv(e,M3)&&Lv(e,R3))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*Ir(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:ot.mass,stiffness:i,damping:s}}else{const n=E3(e);t={...t,...n,mass:ot.mass},t.isResolvedFromDuration=!0}return t}function tu(e=ot.visualDuration,t=ot.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}=P3({...n,velocity:-dr(n.velocity||0)}),y=p||0,b=c/(2*Math.sqrt(l*d)),C=o-s,g=dr(Math.sqrt(l/d)),m=Math.abs(C)<5;r||(r=m?ot.restSpeed.granular:ot.restSpeed.default),i||(i=m?ot.restDelta.granular:ot.restDelta.default);let w;if(b<1){const T=Up(g,b);w=k=>{const E=Math.exp(-b*g*k);return o-E*((y+b*g*C)/T*Math.sin(T*k)+C*Math.cos(T*k))}}else if(b===1)w=T=>o-Math.exp(-g*T)*(C+(y+g*C)*T);else{const T=g*Math.sqrt(b*b-1);w=k=>{const E=Math.exp(-b*g*k),M=Math.min(T*k,300);return o-E*((y+b*g*C)*Math.sinh(M)+T*C*Math.cosh(M))/T}}const S={calculatedDuration:h&&u||null,next:T=>{const k=w(T);if(h)a.done=T>=u;else{let E=0;b<1&&(E=T===0?ur(y):ZC(w,T,k));const M=Math.abs(E)<=r,U=Math.abs(o-k)<=i;a.done=M&&U}return a.value=a.done?o:k,a},toString:()=>{const T=Math.min(Fm(S),Zc),k=eC(E=>S.next(T*E).value,T,30);return T+"ms "+k},toTransition:()=>{}};return S}tu.applyToOptions=e=>{const t=Rj(e,100,tu);return e.ease=qa()?t.ease:"easeOut",e.duration=ur(t.duration),e.type="keyframes",e};function Fv({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=M=>a!==void 0&&M<a||l!==void 0&&M>l,y=M=>a===void 0?l:l===void 0||Math.abs(a-M)<Math.abs(l-M)?a:l;let b=n*t;const C=u+b,g=o===void 0?C:o(C);g!==C&&(b=g-u);const m=M=>-b*Math.exp(-M/r),w=M=>g+m(M),S=M=>{const U=m(M),j=w(M);p.done=Math.abs(U)<=c,p.value=p.done?g:j};let T,k;const E=M=>{h(p.value)&&(T=M,k=tu({keyframes:[p.value,y(p.value)],velocity:ZC(w,M,p.value),damping:i,stiffness:s,restDelta:c,restSpeed:d}))};return E(0),{calculatedDuration:null,next:M=>{let U=!1;return!k&&T===void 0&&(U=!0,S(M),E(M)),T!==void 0&&M>=T?k.next(M-T):(!U&&S(M),p)}}}const N3=hl(.42,0,1,1),O3=hl(0,0,.58,1),JC=hl(.42,0,.58,1),D3=e=>Array.isArray(e)&&typeof e[0]!="number",Bv={linear:jn,easeIn:N3,easeInOut:JC,easeOut:O3,circIn:tg,circInOut:NC,circOut:PC,backIn:eg,backInOut:RC,backOut:jC,anticipate:MC},$v=e=>{if(Dm(e)){Rp(e.length===4);const[t,n,r,i]=e;return hl(t,n,r,i)}else if(typeof e=="string")return Rp(Bv[e]!==void 0),Bv[e];return e};function I3(e,t,n){const r=[],i=n||XC,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]||jn:t;a=ml(l,a)}r.push(a)}return r}function L3(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const s=e.length;if(Rp(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=I3(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=Wa(e[u],e[u+1],d);return a[u](p)};return n?d=>c(Ir(e[0],e[s-1],d)):c}function F3(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Wa(0,t,r);e.push(et(n,1,i))}}function B3(e){const t=[0];return F3(t,e.length-1),t}function $3(e,t){return e.map(n=>n*t)}function z3(e,t){return e.map(()=>t||JC).splice(0,e.length-1)}function nu({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=D3(r)?r.map($v):$v(r),s={done:!1,value:t[0]},o=$3(n&&n.length===t.length?n:B3(t),e),a=L3(o,t,{ease:Array.isArray(i)?i:z3(t,i)});return{calculatedDuration:e,next:l=>(s.value=a(l),s.done=l>=e,s)}}const V3=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Ue.update(t,!0),stop:()=>bi(t),now:()=>_t.isProcessing?_t.timestamp:fr.now()}},U3={decay:Fv,inertia:Fv,tween:nu,keyframes:nu,spring:tu},H3=e=>e/100;class og extends QC{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)||ig,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=Im(n)?n:U3[n]||nu;let l,c;a!==nu&&typeof t[0]!="number"&&(l=ml(H3,XC(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=Fm(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:M}=this.options;return{done:!0,value:M[M.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:b,onUpdate:C}=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 g=this.currentTime-p*(this.speed>=0?1:-1),m=this.speed>=0?g<0:g>d;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let w=this.currentTime,S=s;if(h){const M=Math.min(this.currentTime,d)/u;let U=Math.floor(M),j=M%1;!j&&M>=1&&(j=1),j===1&&U--,U=Math.min(U,h+1),!!(U%2)&&(y==="reverse"?(j=1-j,b&&(j-=b/u)):y==="mirror"&&(S=o)),w=Ir(0,1,j)*u}const T=m?{done:!1,value:l[0]}:S.next(w);a&&(T.value=a(T.value));let{done:k}=T;!m&&c!==null&&(k=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const E=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&k);return E&&i!==void 0&&(T.value=Bu(l,this.options,i)),C&&C(T.value),E&&this.finish(),T}get duration(){const{resolved:t}=this;return t?dr(t.calculatedDuration):0}get time(){return dr(this.currentTime)}set time(t){t=ur(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=dr(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=V3,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 W3=new Set(["opacity","clipPath","filter","transform"]),q3=Nm(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),ru=10,G3=2e4;function Y3(e){return Im(e.type)||e.type==="spring"||!nC(e.ease)}function Q3(e,t){const n=new og({...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<G3;)r=n.sample(s),i.push(r.value),s+=ru;return{times:void 0,keyframes:i,duration:s-ru,ease:"linear"}}const eS={anticipate:MC,backInOut:RC,circInOut:NC};function K3(e){return e in eS}class zv extends QC{constructor(t){super(t);const{name:n,motionValue:r,element:i,keyframes:s}=this.options;this.resolver=new YC(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"&&qa()&&K3(s)&&(s=eS[s]),Y3(this.options)){const{onComplete:u,onUpdate:p,motionValue:h,element:y,...b}=this.options,C=Q3(t,b);t=C.keyframes,t.length===1&&(t[1]=t[0]),r=C.duration,i=C.times,s=C.ease,o="keyframes"}const d=jj(a.owner.current,l,t,{...this.options,duration:r,times:i,ease:s});return d.startTime=c??this.calcStartTime(),this.pendingTimeline?(mv(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:u}=this.options;a.set(Bu(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 dr(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return dr(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=ur(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 jn;const{animation:r}=n;mv(r,t)}return jn}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 og({...h,keyframes:r,duration:i,type:s,ease:o,times:a,isGenerator:!0}),b=ur(this.time);c.setWithVelocity(y.sample(b-ru).value,y.sample(b).value,ru)}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 q3()&&r&&W3.has(r)&&(r!=="transform"||!c)&&!l&&!i&&s!=="mirror"&&o!==0&&a!=="inertia"}}const X3={type:"spring",stiffness:500,damping:25,restSpeed:10},Z3=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),J3={type:"keyframes",duration:.8},eR={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},tR=(e,{keyframes:t})=>t.length>2?J3:gs.has(e)?e.startsWith("scale")?Z3(t[1]):X3:eR;function nR({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 ag=(e,t,n,r={},i,s)=>o=>{const a=Lm(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-ur(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};nR(a)||(d={...d,...tR(e,d)}),d.duration&&(d.duration=ur(d.duration)),d.repeatDelay&&(d.repeatDelay=ur(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=Bu(d.keyframes,a);if(p!==void 0)return Ue.update(()=>{d.onUpdate(p),d.onComplete()}),new Tj([])}return!s&&zv.supports(d)?new zv(d):new og(d)};function rR({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function tS(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&&rR(c,d))continue;const h={delay:n,...Lm(s||{},d)};let y=!1;if(window.MotionHandoffAnimation){const C=_C(e);if(C){const g=window.MotionHandoffAnimation(C,d,Ue);g!==null&&(h.startTime=g,y=!0)}}Op(e,d),u.start(ag(d,u,p,e.shouldReduceMotion&&kC.has(d)?{type:!1}:h,e,y));const b=u.animation;b&&l.push(b)}return o&&Promise.all(l).then(()=>{Ue.update(()=>{o&&N5(e,o)})}),l}function Hp(e,t,n={}){var l;const r=Xa(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(tS(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:d=0,staggerChildren:u,staggerDirection:p}=i;return iR(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 iR(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(sR).forEach((c,d)=>{c.notify("AnimationStart",t),o.push(Hp(c,t,{...s,delay:n+l(d)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(o)}function sR(e,t){return e.sortNodePosition(t)}function oR(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>Hp(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=Hp(e,t,n);else{const i=typeof t=="function"?Xa(e,t,n.custom):t;r=Promise.all(tS(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function nS(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 aR=Vm.length;function rS(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?rS(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<aR;n++){const r=Vm[n],i=e.props[r];(Ya(i)||i===!1)&&(t[r]=i)}return t}const lR=[...zm].reverse(),cR=zm.length;function uR(e){return t=>Promise.all(t.map(({animation:n,options:r})=>oR(e,n,r)))}function dR(e){let t=uR(e),n=Vv(),r=!0;const i=l=>(c,d)=>{var p;const u=Xa(e,d,l==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(u){const{transition:h,transitionEnd:y,...b}=u;c={...c,...b,...y}}return c};function s(l){t=l(e)}function o(l){const{props:c}=e,d=rS(e.parent)||{},u=[],p=new Set;let h={},y=1/0;for(let C=0;C<cR;C++){const g=lR[C],m=n[g],w=c[g]!==void 0?c[g]:d[g],S=Ya(w),T=g===l?m.isActive:null;T===!1&&(y=C);let k=w===d[g]&&w!==c[g]&&S;if(k&&r&&e.manuallyAnimateOnMount&&(k=!1),m.protectedKeys={...h},!m.isActive&&T===null||!w&&!m.prevProp||Lu(w)||typeof w=="boolean")continue;const E=fR(m.prevProp,w);let M=E||g===l&&m.isActive&&!k&&S||C>y&&S,U=!1;const j=Array.isArray(w)?w:[w];let N=j.reduce(i(g),{});T===!1&&(N={});const{prevResolvedValues:O={}}=m,z={...O,...N},L=F=>{M=!0,p.has(F)&&(U=!0,p.delete(F)),m.needsAnimating[F]=!0;const _=e.getValue(F);_&&(_.liveStyle=!1)};for(const F in z){const _=N[F],B=O[F];if(h.hasOwnProperty(F))continue;let V=!1;Np(_)&&Np(B)?V=!nS(_,B):V=_!==B,V?_!=null?L(F):p.add(F):_!==void 0&&p.has(F)?L(F):m.protectedKeys[F]=!0}m.prevProp=w,m.prevResolvedValues=N,m.isActive&&(h={...h,...N}),r&&e.blockInitialAnimation&&(M=!1),M&&(!(k&&E)||U)&&u.push(...j.map(F=>({animation:F,options:{type:g}})))}if(p.size){const C={};if(typeof c.initial!="boolean"){const g=Xa(e,Array.isArray(c.initial)?c.initial[0]:c.initial);g&&g.transition&&(C.transition=g.transition)}p.forEach(g=>{const m=e.getBaseTarget(g),w=e.getValue(g);w&&(w.liveStyle=!0),C[g]=m??null}),u.push({animation:C})}let b=!!u.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(b=!1),r=!1,b?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=Vv(),r=!0}}}function fR(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!nS(t,e):!1}function Mi(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Vv(){return{animate:Mi(!0),whileInView:Mi(),whileHover:Mi(),whileTap:Mi(),whileDrag:Mi(),whileFocus:Mi(),exit:Mi()}}class Ei{constructor(t){this.isMounted=!1,this.node=t}update(){}}class pR extends Ei{constructor(t){super(t),t.animationState||(t.animationState=dR(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Lu(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 hR=0;class mR extends Ei{constructor(){super(...arguments),this.id=hR++}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 gR={animation:{Feature:pR},exit:{Feature:mR}};function Ja(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function gl(e){return{point:{x:e.pageX,y:e.pageY}}}const vR=e=>t=>$m(t)&&e(t,gl(t));function wa(e,t,n,r){return Ja(e,t,vR(n),r)}function iS({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function yR({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function xR(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 sS=1e-4,wR=1-sS,bR=1+sS,oS=.01,CR=0-oS,SR=0+oS;function zt(e){return e.max-e.min}function kR(e,t,n){return Math.abs(e-t)<=n}function Uv(e,t,n,r=.5){e.origin=r,e.originPoint=et(t.min,t.max,e.origin),e.scale=zt(n)/zt(t),e.translate=et(n.min,n.max,e.origin)-e.originPoint,(e.scale>=wR&&e.scale<=bR||isNaN(e.scale))&&(e.scale=1),(e.translate>=CR&&e.translate<=SR||isNaN(e.translate))&&(e.translate=0)}function ba(e,t,n,r){Uv(e.x,t.x,n.x,r?r.originX:void 0),Uv(e.y,t.y,n.y,r?r.originY:void 0)}function Hv(e,t,n){e.min=n.min+t.min,e.max=e.min+zt(t)}function _R(e,t,n){Hv(e.x,t.x,n.x),Hv(e.y,t.y,n.y)}function Wv(e,t,n){e.min=t.min-n.min,e.max=e.min+zt(t)}function Ca(e,t,n){Wv(e.x,t.x,n.x),Wv(e.y,t.y,n.y)}const qv=()=>({translate:0,scale:1,origin:0,originPoint:0}),Vs=()=>({x:qv(),y:qv()}),Gv=()=>({min:0,max:0}),ct=()=>({x:Gv(),y:Gv()});function wn(e){return[e("x"),e("y")]}function qd(e){return e===void 0||e===1}function Wp({scale:e,scaleX:t,scaleY:n}){return!qd(e)||!qd(t)||!qd(n)}function Di(e){return Wp(e)||aS(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function aS(e){return Yv(e.x)||Yv(e.y)}function Yv(e){return e&&e!=="0%"}function iu(e,t,n){const r=e-n,i=t*r;return n+i}function Qv(e,t,n,r,i){return i!==void 0&&(e=iu(e,i,r)),iu(e,n,r)+t}function qp(e,t=0,n=1,r,i){e.min=Qv(e.min,t,n,r,i),e.max=Qv(e.max,t,n,r,i)}function lS(e,{x:t,y:n}){qp(e.x,t.translate,t.scale,t.originPoint),qp(e.y,n.translate,n.scale,n.originPoint)}const Kv=.999999999999,Xv=1.0000000000001;function TR(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&&Hs(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,lS(e,o)),r&&Di(s.latestValues)&&Hs(e,s.latestValues))}t.x<Xv&&t.x>Kv&&(t.x=1),t.y<Xv&&t.y>Kv&&(t.y=1)}function Us(e,t){e.min=e.min+t,e.max=e.max+t}function Zv(e,t,n,r,i=.5){const s=et(e.min,e.max,i);qp(e,t,n,s,r)}function Hs(e,t){Zv(e.x,t.x,t.scaleX,t.scale,t.originX),Zv(e.y,t.y,t.scaleY,t.scale,t.originY)}function cS(e,t){return iS(xR(e.getBoundingClientRect(),t))}function ER(e,t,n){const r=cS(e,n),{scroll:i}=t;return i&&(Us(r.x,i.offset.x),Us(r.y,i.offset.y)),r}const uS=({current:e})=>e?e.ownerDocument.defaultView:null,Jv=(e,t)=>Math.abs(e-t);function AR(e,t){const n=Jv(e.x,t.x),r=Jv(e.y,t.y);return Math.sqrt(n**2+r**2)}class dS{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=Yd(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,h=AR(u.offset,{x:0,y:0})>=3;if(!p&&!h)return;const{point:y}=u,{timestamp:b}=_t;this.history.push({...y,timestamp:b});const{onStart:C,onMove:g}=this.handlers;p||(C&&C(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,u)},this.handlePointerMove=(u,p)=>{this.lastMoveEvent=u,this.lastMoveEventInfo=Gd(p,this.transformPagePoint),Ue.update(this.updatePoint,!0)},this.handlePointerUp=(u,p)=>{this.end();const{onEnd:h,onSessionEnd:y,resumeAnimation:b}=this.handlers;if(this.dragSnapToOrigin&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const C=Yd(u.type==="pointercancel"?this.lastMoveEventInfo:Gd(p,this.transformPagePoint),this.history);this.startEvent&&h&&h(u,C),y&&y(u,C)},!$m(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const o=gl(t),a=Gd(o,this.transformPagePoint),{point:l}=a,{timestamp:c}=_t;this.history=[{...l,timestamp:c}];const{onSessionStart:d}=n;d&&d(t,Yd(a,this.history)),this.removeListeners=ml(wa(this.contextWindow,"pointermove",this.handlePointerMove),wa(this.contextWindow,"pointerup",this.handlePointerUp),wa(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),bi(this.updatePoint)}}function Gd(e,t){return t?{point:t(e.point)}:e}function ey(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Yd({point:e},t){return{point:e,delta:ey(e,fS(t)),offset:ey(e,jR(t)),velocity:RR(t,.1)}}function jR(e){return e[0]}function fS(e){return e[e.length-1]}function RR(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=fS(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>ur(t)));)n--;if(!r)return{x:0,y:0};const s=dr(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 MR(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?et(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?et(n,e,r.max):Math.min(e,n)),e}function ty(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 PR(e,{top:t,left:n,bottom:r,right:i}){return{x:ty(e.x,n,i),y:ty(e.y,t,r)}}function ny(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 NR(e,t){return{x:ny(e.x,t.x),y:ny(e.y,t.y)}}function OR(e,t){let n=.5;const r=zt(e),i=zt(t);return i>r?n=Wa(t.min,t.max-r,e.min):r>i&&(n=Wa(e.min,e.max-i,t.min)),Ir(0,1,n)}function DR(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 Gp=.35;function IR(e=Gp){return e===!1?e=0:e===!0&&(e=Gp),{x:ry(e,"left","right"),y:ry(e,"top","bottom")}}function ry(e,t,n){return{min:iy(e,t),max:iy(e,n)}}function iy(e,t){return typeof e=="number"?e:e[t]||0}const LR=new WeakMap;class FR{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=ct(),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(gl(d).point)},s=(d,u)=>{const{drag:p,dragPropagation:h,onDragStart:y}=this.getProps();if(p&&!h&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Oj(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),wn(C=>{let g=this.getAxisMotionValue(C).get()||0;if(pr.test(g)){const{projection:m}=this.visualElement;if(m&&m.layout){const w=m.layout.layoutBox[C];w&&(g=zt(w)*(parseFloat(g)/100))}}this.originPoint[C]=g}),y&&Ue.postRender(()=>y(d,u)),Op(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},o=(d,u)=>{const{dragPropagation:p,dragDirectionLock:h,onDirectionLock:y,onDrag:b}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:C}=u;if(h&&this.currentDirection===null){this.currentDirection=BR(C),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",u.point,C),this.updateAxis("y",u.point,C),this.visualElement.render(),b&&b(d,u)},a=(d,u)=>this.stop(d,u),l=()=>wn(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 dS(t,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:uS(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&&Ue.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||!Wl(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=MR(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&&$s(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=PR(r.layoutBox,t):this.constraints=!1,this.elastic=IR(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&wn(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=DR(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!$s(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=ER(r,i.root,this.visualElement.getTransformPagePoint());let o=NR(i.layout.layoutBox,s);if(n){const a=n(yR(o));this.hasMutatedConstraints=!!a,a&&(o=iS(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=wn(d=>{if(!Wl(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 Op(this.visualElement,t),r.start(ag(t,r,0,n,this.visualElement,!1))}stopAnimation(){wn(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){wn(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){wn(n=>{const{drag:r}=this.getProps();if(!Wl(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]-et(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!$s(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};wn(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=OR({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(),wn(o=>{if(!Wl(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(et(l,c,i[o]))})}addListeners(){if(!this.visualElement.current)return;LR.set(this.visualElement,this);const t=this.visualElement.current,n=wa(t,"pointerdown",l=>{const{drag:c,dragListener:d=!0}=this.getProps();c&&d&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();$s(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()),Ue.read(r);const o=Ja(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(wn(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=Gp,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function Wl(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function BR(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class $R extends Ei{constructor(t){super(t),this.removeGroupControls=jn,this.removeListeners=jn,this.controls=new FR(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||jn}unmount(){this.removeGroupControls(),this.removeListeners()}}const sy=e=>(t,n)=>{e&&Ue.postRender(()=>e(t,n))};class zR extends Ei{constructor(){super(...arguments),this.removePointerDownListener=jn}onPointerDown(t){this.session=new dS(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:uS(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:sy(t),onStart:sy(n),onMove:r,onEnd:(s,o)=>{delete this.session,i&&Ue.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=wa(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 mc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function oy(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Ko={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Ce.test(e))e=parseFloat(e);else return e;const n=oy(e,t.target.x),r=oy(e,t.target.y);return`${n}% ${r}%`}},VR={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=Ci.parse(e);if(i.length>5)return r;const s=Ci.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=et(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;a5(HR),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()})),mc.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()||Ue.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Bm.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 pS(e){const[t,n]=Zb(),r=v.useContext(Am);return f.jsx(UR,{...e,layoutGroup:r,switchLayoutGroup:v.useContext(dC),isPresent:t,safeToRemove:n})}const HR={borderRadius:{...Ko,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ko,borderTopRightRadius:Ko,borderBottomLeftRadius:Ko,borderBottomRightRadius:Ko,boxShadow:VR};function WR(e,t,n){const r=It(e)?e:Ga(e);return r.start(ag("",r,t,n)),r.animation}function qR(e){return e instanceof SVGElement&&e.tagName!=="svg"}const GR=(e,t)=>e.depth-t.depth;class YR{constructor(){this.children=[],this.isDirty=!1}add(t){Mm(this.children,t),this.isDirty=!0}remove(t){Pm(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(GR),this.isDirty=!1,this.children.forEach(t)}}function QR(e,t){const n=fr.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(bi(r),e(s-t))};return Ue.read(r,!0),()=>bi(r)}const hS=["TopLeft","TopRight","BottomLeft","BottomRight"],KR=hS.length,ay=e=>typeof e=="string"?parseFloat(e):e,ly=e=>typeof e=="number"||Ce.test(e);function XR(e,t,n,r,i,s){i?(e.opacity=et(0,n.opacity??1,ZR(r)),e.opacityExit=et(t.opacity??1,0,JR(r))):s&&(e.opacity=et(t.opacity??1,n.opacity??1,r));for(let o=0;o<KR;o++){const a=`border${hS[o]}Radius`;let l=cy(t,a),c=cy(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||ly(l)===ly(c)?(e[a]=Math.max(et(ay(l),ay(c),r),0),(pr.test(c)||pr.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=et(t.rotate||0,n.rotate||0,r))}function cy(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const ZR=mS(0,.5,PC),JR=mS(.5,.95,jn);function mS(e,t,n){return r=>r<e?0:r>t?1:n(Wa(e,t,r))}function uy(e,t){e.min=t.min,e.max=t.max}function yn(e,t){uy(e.x,t.x),uy(e.y,t.y)}function dy(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function fy(e,t,n,r,i){return e-=t,e=iu(e,1/n,r),i!==void 0&&(e=iu(e,1/i,r)),e}function eM(e,t=0,n=1,r=.5,i,s=e,o=e){if(pr.test(t)&&(t=parseFloat(t),t=et(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=et(s.min,s.max,r);e===s&&(a-=t),e.min=fy(e.min,t,n,a,i),e.max=fy(e.max,t,n,a,i)}function py(e,t,[n,r,i],s,o){eM(e,t[n],t[r],t[i],t.scale,s,o)}const tM=["x","scaleX","originX"],nM=["y","scaleY","originY"];function hy(e,t,n,r){py(e.x,t,tM,n?n.x:void 0,r?r.x:void 0),py(e.y,t,nM,n?n.y:void 0,r?r.y:void 0)}function my(e){return e.translate===0&&e.scale===1}function gS(e){return my(e.x)&&my(e.y)}function gy(e,t){return e.min===t.min&&e.max===t.max}function rM(e,t){return gy(e.x,t.x)&&gy(e.y,t.y)}function vy(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function vS(e,t){return vy(e.x,t.x)&&vy(e.y,t.y)}function yy(e){return zt(e.x)/zt(e.y)}function xy(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class iM{constructor(){this.members=[]}add(t){Mm(this.members,t),t.scheduleRender()}remove(t){if(Pm(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 sM(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 Qd=["","X","Y","Z"],oM={visibility:"hidden"},wy=1e3;let aM=0;function Kd(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function yS(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=_C(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Ue,!(i||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&yS(r)}function xS({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},a=t==null?void 0:t()){this.id=aM++,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(uM),this.nodes.forEach(mM),this.nodes.forEach(gM),this.nodes.forEach(dM)},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 YR)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Om),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=qR(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=QR(p,250),mc.hasAnimatedSinceResize&&(mc.hasAnimatedSinceResize=!1,this.nodes.forEach(Cy))})}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 b=this.options.transition||d.getDefaultTransition()||bM,{onLayoutAnimationStart:C,onLayoutAnimationComplete:g}=d.getProps(),m=!this.targetLayout||!vS(this.targetLayout,y),w=!p&&h;if(this.options.layoutRoot||this.resumeFrom||w||p&&(m||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(u,w);const S={...Lm(b,"layout"),onPlay:C,onComplete:g};(d.shouldReduceMotion||this.options.layoutRoot)&&(S.delay=0,S.type=!1),this.startAnimation(S)}else p||Cy(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,bi(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(vM),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&&yS(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(by);return}this.isUpdating||this.nodes.forEach(pM),this.isUpdating=!1,this.nodes.forEach(hM),this.nodes.forEach(lM),this.nodes.forEach(cM),this.clearAllSnapshots();const a=fr.now();_t.delta=Ir(0,1e3/60,a-_t.timestamp),_t.timestamp=a,_t.isProcessing=!0,$d.update.process(_t),$d.preRender.process(_t),$d.render.process(_t),_t.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Bm.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(fM),this.sharedNodes.forEach(yM)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Ue.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Ue.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!zt(this.snapshot.measuredBox.x)&&!zt(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=ct(),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&&!gS(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,d=c!==this.prevTransformTemplateValue;o&&(a||Di(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)),CM(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:o}=this.options;if(!o)return ct();const a=o.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(SM))){const{scroll:d}=this.root;d&&(Us(a.x,d.offset.x),Us(a.y,d.offset.y))}return a}removeElementScroll(o){var l;const a=ct();if(yn(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&&yn(a,o),Us(a.x,u.offset.x),Us(a.y,u.offset.y))}return a}applyTransform(o,a=!1){const l=ct();yn(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&&Hs(l,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),Di(d.latestValues)&&Hs(l,d.latestValues)}return Di(this.latestValues)&&Hs(l,this.latestValues),l}removeTransform(o){const a=ct();yn(a,o);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!Di(c.latestValues))continue;Wp(c.latestValues)&&c.updateSnapshot();const d=ct(),u=c.measurePageBox();yn(d,u),hy(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,d)}return Di(this.latestValues)&&hy(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!==_t.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=_t.timestamp,!this.targetDelta&&!this.relativeTarget){const h=this.getClosestProjectingParent();h&&h.layout&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ct(),this.relativeTargetOrigin=ct(),Ca(this.relativeTargetOrigin,this.layout.layoutBox,h.layout.layoutBox),yn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=ct(),this.targetWithTransforms=ct()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),_R(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):yn(this.target,this.layout.layoutBox),lS(this.target,this.targetDelta)):yn(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=ct(),this.relativeTargetOrigin=ct(),Ca(this.relativeTargetOrigin,this.target,h.target),yn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Wp(this.parent.latestValues)||aS(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===_t.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;yn(this.layoutCorrected,this.layout.layoutBox);const u=this.treeScale.x,p=this.treeScale.y;TR(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=ct());const{target:h}=o;if(!h){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(dy(this.prevProjectionDelta.x,this.projectionDelta.x),dy(this.prevProjectionDelta.y,this.projectionDelta.y)),ba(this.projectionDelta,this.layoutCorrected,h,this.latestValues),(this.treeScale.x!==u||this.treeScale.y!==p||!xy(this.projectionDelta.x,this.prevProjectionDelta.x)||!xy(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=Vs(),this.projectionDelta=Vs(),this.projectionDeltaWithTransform=Vs()}setAnimationOrigin(o,a=!1){const l=this.snapshot,c=l?l.latestValues:{},d={...this.latestValues},u=Vs();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const p=ct(),h=l?l.source:void 0,y=this.layout?this.layout.source:void 0,b=h!==y,C=this.getStack(),g=!C||C.members.length<=1,m=!!(b&&!g&&this.options.crossfade===!0&&!this.path.some(wM));this.animationProgress=0;let w;this.mixTargetDelta=S=>{const T=S/1e3;Sy(u.x,o.x,T),Sy(u.y,o.y,T),this.setTargetDelta(u),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ca(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),xM(this.relativeTarget,this.relativeTargetOrigin,p,T),w&&rM(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=ct()),yn(w,this.relativeTarget)),b&&(this.animationValues=d,XR(d,c,this.latestValues,T,m,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=T},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&&(bi(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ue.update(()=>{mc.hasAnimatedSinceResize=!0,this.currentAnimation=WR(0,wy,{...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(wy),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&&wS(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||ct();const u=zt(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+u;const p=zt(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+p}yn(a,l),Hs(a,d),ba(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new iM),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&&Kd("z",o,c,this.animationValues);for(let d=0;d<Qd.length;d++)Kd(`rotate${Qd[d]}`,o,c,this.animationValues),Kd(`skew${Qd[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 oM;const a={visibility:""},l=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,a.opacity="",a.pointerEvents=hc(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=hc(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Di(this.latestValues)&&(h.transform=l?l({},""):"none",this.hasProjected=!1),h}const d=c.animationValues||c.latestValues;this.applyTransformsToTarget(),a.transform=sM(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 Qa){if(d[h]===void 0)continue;const{correct:y,applyTo:b,isCSSVariable:C}=Qa[h],g=a.transform==="none"?d[h]:y(d[h],c);if(b){const m=b.length;for(let w=0;w<m;w++)a[b[w]]=g}else C?this.options.visualElement.renderState.vars[h]=g:a[h]=g}return this.options.layoutId&&(a.pointerEvents=c===this?hc(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(by),this.root.sharedNodes.clear()}}}function lM(e){e.updateLayout()}function cM(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"?wn(u=>{const p=o?t.measuredBox[u]:t.layoutBox[u],h=zt(p);p.min=r[u].min,p.max=p.min+h}):wS(s,t.layoutBox,r)&&wn(u=>{const p=o?t.measuredBox[u]:t.layoutBox[u],h=zt(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=Vs();ba(a,r,t.layoutBox);const l=Vs();o?ba(l,e.applyTransform(i,!0),t.measuredBox):ba(l,r,t.layoutBox);const c=!gS(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=ct();Ca(y,t.layoutBox,p.layoutBox);const b=ct();Ca(b,r,h.layoutBox),vS(y,b)||(d=!0),u.options.layoutRoot&&(e.relativeTarget=b,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 uM(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 dM(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function fM(e){e.clearSnapshot()}function by(e){e.clearMeasurements()}function pM(e){e.isLayoutDirty=!1}function hM(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Cy(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function mM(e){e.resolveTargetDelta()}function gM(e){e.calcProjection()}function vM(e){e.resetSkewAndRotation()}function yM(e){e.removeLeadSnapshot()}function Sy(e,t,n){e.translate=et(t.translate,0,n),e.scale=et(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function ky(e,t,n,r){e.min=et(t.min,n.min,r),e.max=et(t.max,n.max,r)}function xM(e,t,n,r){ky(e.x,t.x,n.x,r),ky(e.y,t.y,n.y,r)}function wM(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const bM={duration:.45,ease:[.4,0,.1,1]},_y=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Ty=_y("applewebkit/")&&!_y("chrome/")?Math.round:jn;function Ey(e){e.min=Ty(e.min),e.max=Ty(e.max)}function CM(e){Ey(e.x),Ey(e.y)}function wS(e,t,n){return e==="position"||e==="preserve-aspect"&&!kR(yy(t),yy(n),.2)}function SM(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const kM=xS({attachResizeListener:(e,t)=>Ja(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Xd={current:void 0},bS=xS({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Xd.current){const e=new kM({});e.mount(window),e.setOptions({layoutScroll:!0}),Xd.current=e}return Xd.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),_M={pan:{Feature:zR},drag:{Feature:$R,ProjectionNode:bS,MeasureLayout:pS}};function Ay(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&&Ue.postRender(()=>s(t,gl(t)))}class TM extends Ei{mount(){const{current:t}=this.node;t&&(this.unmount=Ij(t,(n,r)=>(Ay(this.node,r,"Start"),i=>Ay(this.node,i,"End"))))}unmount(){}}class EM extends Ei{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=ml(Ja(this.node.current,"focus",()=>this.onFocus()),Ja(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function jy(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&&Ue.postRender(()=>s(t,gl(t)))}class AM extends Ei{mount(){const{current:t}=this.node;t&&(this.unmount=$j(t,(n,r)=>(jy(this.node,r,"Start"),(i,{success:s})=>jy(this.node,i,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Yp=new WeakMap,Zd=new WeakMap,jM=e=>{const t=Yp.get(e.target);t&&t(e)},RM=e=>{e.forEach(jM)};function MM({root:e,...t}){const n=e||document;Zd.has(n)||Zd.set(n,{});const r=Zd.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(RM,{root:e,...t})),r[i]}function PM(e,t,n){const r=MM(t);return Yp.set(e,n),r.observe(e),()=>{Yp.delete(e),r.unobserve(e)}}const NM={some:0,all:1};class OM extends Ei{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:NM[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 PM(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(DM(t,n))&&this.startObserver()}unmount(){}}function DM({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const IM={inView:{Feature:OM},tap:{Feature:AM},focus:{Feature:EM},hover:{Feature:TM}},LM={layout:{ProjectionNode:bS,MeasureLayout:pS}},Qp={current:null},CS={current:!1};function FM(){if(CS.current=!0,!!jm)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Qp.current=e.matches;e.addListener(t),t()}else Qp.current=!1}const BM=[...GC,Ot,Ci],$M=e=>BM.find(qC(e)),zM=new WeakMap;function VM(e,t,n){for(const r in t){const i=t[r],s=n[r];if(It(i))e.addValue(r,i);else if(It(s))e.addValue(r,Ga(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,Ga(o!==void 0?o:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Ry=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class UM{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=ig,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=fr.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,Ue.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=Fu(n),this.isVariantNode=cC(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&&It(y)&&y.set(l[h],!1)}}mount(t){this.current=t,zM.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)),CS.current||FM(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Qp.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),bi(this.notifyUpdate),bi(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=gs.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&Ue.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 So){const n=So[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):ct()}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<Ry.length;r++){const i=Ry[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=VM(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=Ga(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"&&(HC(r)||OC(r))?r=parseFloat(r):!$M(r)&&Ci.test(n)&&(r=zC(t,n)),this.setBaseTarget(t,It(r)?r.get():r)),It(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=Zm(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&&!It(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 Om),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class SS extends UM{constructor(){super(...arguments),this.KeyframeResolver=YC}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;It(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function HM(e){return window.getComputedStyle(e)}class WM extends SS{constructor(){super(...arguments),this.type="html",this.renderInstance=wC}readValueFromInstance(t,n){if(gs.has(n))return i3(t,n);{const r=HM(t),i=(Hm(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return cS(t,n)}build(t,n,r){Gm(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Jm(t,n,r)}}class qM extends SS{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ct,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&xC(this.current,this.renderState)}}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(gs.has(n)){const r=$C(n);return r&&r.default||0}return n=bC.has(n)?n:Um(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return SC(t,n,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&Ue.postRender(this.updateDimensions)}build(t,n,r){Km(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){CC(t,n,r,i)}mount(t){this.isSVGTag=Xm(t.tagName),super.mount(t)}}const GM=(e,t)=>Qm(e)?new qM(t):new WM(t,{allowProjection:e!==v.Fragment}),YM=M5({...gR,...IM,..._M,...LM},GM),De=Gj(YM);class QM{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 KM=()=>new QM;function XM(){return Ou(KM)}var Gr=(e=>(e.None="none",e.Sm="sm",e.Md="md",e.Lg="lg",e.Xl="xl",e.Full="full",e))(Gr||{});const kS=v.createContext({}),ZM={[se.TooltipDefault]:"Bizimle sohbet edin!",[se.TooltipActive]:"Yeni mesajlar var!",[se.TooltipBalloonTitle]:"Canlı Destek",[se.TooltipBalloonSub]:"Size nasıl yardımcı olabilirim?",[se.TooltipBalloonGreeting]:"Merhaba, ben {name} 👋",[se.CloseButtonAria]:"Kapat",[se.MessagePlaceholder]:"Mesajınızı yazın",[se.FileUploadDisabled]:"Dosya gönderim izniniz olmadığı için yükleyemezsiniz",[se.NewMessagesNotification]:"Yeni mesajlar var!",[se.MinimizedUnreadMessage]:"{count} Yeni Mesaj",[se.ChatCloseConfirm]:"Sohbeti kapatmak istediğinizden emin misiniz?",[se.ChatCloseWarning]:"Bu işlem geri alınamaz.",[se.ChatSettings]:"Sohbet Ayarları",[se.ChatEndConversation]:"Sohbeti Sonlandır",[se.CancelAction]:"Vazgeç",[se.CloseAction]:"Kapat",[se.QuickActions]:"Hızlı işlemler",[se.GreetingStartChat]:"Sohbete başla",[se.RateLimitMessage]:"Çok fazla mesaj gönderdiniz. Lütfen {seconds} saniye bekleyin.",[se.RatingHeaderEvaluate]:"Görüşmenizi Değerlendirin",[se.RatingHeaderThanks]:"Teşekkürler!",[se.RatingDescription]:"Lütfen hizmetimizi değerlendirin. Görüşleriniz bizim için önemli.",[se.RatingRateConversation]:"Görüşmeyi puanlayın",[se.RatingComment]:"Yorumunuz (İsteğe bağlı)",[se.RatingCommentPlaceholder]:"Görüşme hakkında düşüncelerinizi paylaşın...",[se.RatingSubmit]:"Değerlendirmeyi Gönder",[se.RatingNewConversation]:"Yeni Görüşme Başlat",[se.RatingThankYouTitle]:"Değerlendirmeniz için teşekkürler!",[se.RatingThankYouDescription]:"Geri bildiriminiz bizim için çok değerli.",[se.RatingCountdown]:"Ekran {seconds} saniye içinde kapanacaktır.",[se.RatingMinimumError]:"Lütfen en az 1 yıldız seçiniz.",[se.RatingYourScore]:"Puanınız: {score}",[se.PoweredBy]:"Powered by",[se.NotificationSoundOn]:"Bildirim sesi aç",[se.NotificationSoundOff]:"Bildirim sesi kapat"},JM={[x.Background]:"#ffffff",[x.Border]:"#e2e8f0",[x.TooltipText]:"#1e40af",[x.TooltipBackground]:"#dbeafe",[x.TooltipBorder]:"#3b82f6",[x.HeaderBackground]:"#ffffff",[x.HeaderBorder]:"#e2e8f0",[x.HeaderText]:"#1e293b",[x.FooterBackground]:"#f8fafc",[x.FooterBorder]:"#e2e8f0",[x.FooterText]:"#475569",[x.MessageAdminBackground]:"#f1f5f9",[x.MessageAdminText]:"#334155",[x.MessageVisitorBackground]:"#3b82f6",[x.MessageVisitorText]:"#ffffff",[x.MessageAgentBackground]:"#ede9fe",[x.MessageAgentText]:"#5b21b6",[x.GreeterBackground]:"#ffffff",[x.GreeterText]:"#334155",[x.GreeterBorder]:"#e2e8f0",[x.GreeterTopBackground]:"linear-gradient(135deg, #3b82f6 0%, #2563eb 100%)",[x.GreeterTopText]:"#ffffff",[x.GreeterButtonBackground]:"#3b82f6",[x.GreeterButtonText]:"#ffffff",[x.ButtonBackground]:"#3b82f6",[x.ButtonText]:"#ffffff",[x.InputBackground]:"#f8fafc",[x.InputText]:"#1e293b",[x.InputBorder]:"#e2e8f0",[x.CloseButtonBackground]:"#f1f5f9",[x.CloseButtonText]:"#475569",[x.CloseButtonHover]:"#e2e8f0",[x.IconColor]:"#64748b",[x.IconBackground]:"transparent",[x.ErrorBackground]:"#fef2f2",[x.ErrorText]:"#dc2626",[x.ErrorBorder]:"#fca5a5",[x.SuccessBackground]:"#f0fdf4",[x.SuccessText]:"#16a34a",[x.SuccessBorder]:"#86efac",[x.WarningBackground]:"#fffbeb",[x.WarningText]:"#d97706",[x.WarningBorder]:"#fcd34d",[x.LinkColor]:"#2563eb",[x.LinkHoverColor]:"#1d4ed8",[x.DividerColor]:"#e2e8f0",[x.ShadowColor]:"rgba(0, 0, 0, 0.1)",[x.StarActiveColor]:"#f59e0b",[x.StarInactiveColor]:"#e2e8f0",[x.ModalOverlayColor]:"rgba(0, 0, 0, 0.4)",[x.ChatCloseConfirmText]:"#dc2626",[x.RatingHeaderBackground]:"#3b82f6",[x.RatingHeaderText]:"#ffffff",[x.RatingSuccessBackground]:"#ffffff",[x.RatingSuccessText]:"#334155",[x.RatingRateConversationText]:"#1e293b"},eP={[x.Background]:"#0a0a0a",[x.Border]:"#262626",[x.TooltipText]:"#e5e5e5",[x.TooltipBackground]:"#262626",[x.TooltipBorder]:"#404040",[x.HeaderBackground]:"#171717",[x.HeaderBorder]:"#262626",[x.HeaderText]:"#fafafa",[x.FooterBackground]:"#0a0a0a",[x.FooterBorder]:"#262626",[x.FooterText]:"#a3a3a3",[x.MessageAdminBackground]:"#262626",[x.MessageAdminText]:"#e5e5e5",[x.MessageVisitorBackground]:"#171717",[x.MessageVisitorText]:"#e5e5e5",[x.MessageAgentBackground]:"#5b21b6",[x.MessageAgentText]:"#e9d5ff",[x.GreeterBackground]:"#171717",[x.GreeterText]:"#e5e5e5",[x.GreeterBorder]:"#262626",[x.GreeterTopBackground]:"linear-gradient(135deg, #262626 0%, #171717 100%)",[x.GreeterTopText]:"#fafafa",[x.GreeterButtonBackground]:"#3b82f6",[x.GreeterButtonText]:"#ffffff",[x.ButtonBackground]:"#3b82f6",[x.ButtonText]:"#ffffff",[x.InputBackground]:"#171717",[x.InputText]:"#e5e5e5",[x.InputBorder]:"#3f3f3f",[x.CloseButtonBackground]:"#262626",[x.CloseButtonText]:"#a3a3a3",[x.CloseButtonHover]:"#404040",[x.IconColor]:"#a3a3a3",[x.IconBackground]:"transparent",[x.ErrorBackground]:"#450a0a",[x.ErrorText]:"#fca5a5",[x.ErrorBorder]:"#7f1d1d",[x.SuccessBackground]:"#052e16",[x.SuccessText]:"#86efac",[x.SuccessBorder]:"#14532d",[x.WarningBackground]:"#451a03",[x.WarningText]:"#fcd34d",[x.WarningBorder]:"#78350f",[x.LinkColor]:"#3b82f6",[x.LinkHoverColor]:"#60a5fa",[x.DividerColor]:"#262626",[x.ShadowColor]:"rgba(0, 0, 0, 0.4)",[x.StarActiveColor]:"#f59e0b",[x.StarInactiveColor]:"#404040",[x.ModalOverlayColor]:"rgba(0, 0, 0, 0.7)",[x.ChatCloseConfirmText]:"#fca5a5",[x.RatingHeaderBackground]:"#171717",[x.RatingHeaderText]:"#fafafa",[x.RatingSuccessBackground]:"#171717",[x.RatingSuccessText]:"#e5e5e5",[x.RatingRateConversationText]:"#e5e5e5"},tP={[Gr.None]:"0px",[Gr.Sm]:"var(--radius-sm)",[Gr.Md]:"var(--radius-md)",[Gr.Lg]:"var(--radius-lg)",[Gr.Xl]:"var(--radius-lg)",[Gr.Full]:"calc(infinity * 1px)"},nP=e=>{const t={...ZM};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 rP(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 Jd="#ffffff";function iP(e){const t=rP(e,.2);return{[x.ButtonBackground]:t,[x.ButtonText]:Jd,[x.GreeterButtonBackground]:t,[x.GreeterButtonText]:Jd,[x.MessageVisitorBackground]:t,[x.MessageVisitorText]:Jd}}const sP=(e,t)=>{var i,s;const r={...t==="dark"?eP:JM};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=iP(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},_S="lc:theme:mode";function TS(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function ES(){try{const e=localStorage.getItem(_S);if(e==="light"||e==="dark"||e==="system")return e}catch{}return Be.System}function My(){const e=ES(),t=TS();return e===Be.System?t:e}function oP({children:e,widget:t}){const[n,r]=v.useState(ES),[i,s]=v.useState(TS);v.useEffect(()=>{const y=window.matchMedia("(prefers-color-scheme: dark)"),b=C=>{s(C.matches?"dark":"light")};return y.addEventListener("change",b),()=>y.removeEventListener("change",b)},[]);const o=n===Be.System?i:n,a=v.useCallback(y=>{r(y);try{localStorage.setItem(_S,y)}catch{}},[]),l=sP(t,o),c=nP(t),d=t&&t.appearance&&t.appearance.design&&t.appearance.design.border_radius?t.appearance.design.border_radius:Gr.Md,u=y=>l[y],p=y=>c[y],h=()=>tP[d];return f.jsx(kS.Provider,{value:{colors:l,texts:c,getColor:u,getText:p,getRadius:h,mode:n,resolvedMode:o,setMode:a},children:e})}const Ae=()=>v.useContext(kS),Lo=()=>Ae().getText;function En({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=x.ButtonText,bgKey:d=x.ButtonBackground,animations:u={},withoutTheming:p,...h}){const y=Ae();return f.jsx(De.button,{type:t,className:Oe("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,fv[n]&&fv[n][r],xj[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 J(){}J.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"})})};J.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"})});J.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"})});J.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"})});J.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"})})};J.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"})]})};J.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"})});J.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"})})]});J.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"})});J.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"})});J.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"})});J.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"})});J.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"})})};J.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"})});J.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"})});J.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"})});J.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"})});J.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"})});J.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"})});J.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"})]});J.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"})});J.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"})});J.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"})});J.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"})});J.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"})});J.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"})});J.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"})});J.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"})});J.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"})});J.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"})});J.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 gc(){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 Je=(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))(Je||{});const an=(e,t,n)=>{let r=e;["lc:customer:token","lc:customer:refresh_token"].includes(e)&&(r=`${n}:${e}`),localStorage.setItem(r,t)},oa=(e,t)=>{let n=e;return["lc:customer:token","lc:customer:refresh_token"].includes(e)&&(n=`${t}:${e}`),localStorage.getItem(n)},Sa=e=>{localStorage.removeItem(`${e}:lc:customer:token`),localStorage.removeItem(`${e}:lc:customer:refresh_token`),lg(e)},AS=e=>{localStorage.removeItem(`${e}:lc:customer:token`),localStorage.removeItem(`${e}:lc:customer:refresh_token`)},ql=(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`))):lg(e)},er=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}},lg=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`)},Lr=e=>{const t=`${e}:lc:device:id`;let n=localStorage.getItem(t);return n||(n=gc(),localStorage.setItem(t,n)),n},aP={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},Py=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:()=>{(aP?"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},lP=e=>e?Py(e):Py;var jS={exports:{}},RS={},MS={exports:{}},PS={};/**
|
|
19
|
+
*/function Zr(){return Zr=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Zr.apply(this,arguments)}const Va=p.createContext(null),Jf=p.createContext(null),Gi=p.createContext(null),Qi=p.createContext(null),Dr=p.createContext({outlet:null,matches:[],isDataRoute:!1}),gu=p.createContext(null);function Xi(){return p.useContext(Qi)!=null}function Ka(){return Xi()||ot(!1),p.useContext(Qi).location}function yu(t){p.useContext(Gi).static||p.useLayoutEffect(t)}function Zf(){let{isDataRoute:t}=p.useContext(Dr);return t?ph():eh()}function eh(){Xi()||ot(!1);let t=p.useContext(Va),{basename:e,future:n,navigator:r}=p.useContext(Gi),{matches:i}=p.useContext(Dr),{pathname:s}=Ka(),a=JSON.stringify(Wf(i,n.v7_relativeSplatPath)),l=p.useRef(!1);return yu(()=>{l.current=!0}),p.useCallback(function(d,f){if(f===void 0&&(f={}),!l.current)return;if(typeof d=="number"){r.go(d);return}let u=Vf(d,JSON.parse(a),s,f.relative==="path");t==null&&e!=="/"&&(u.pathname=u.pathname==="/"?e:qn([e,u.pathname])),(f.replace?r.replace:r.push)(u,f.state,f)},[e,r,a,s,t])}function th(t,e){return nh(t,e)}function nh(t,e,n,r){Xi()||ot(!1);let{navigator:i}=p.useContext(Gi),{matches:s}=p.useContext(Dr),a=s[s.length-1],l=a?a.params:{};a&&a.pathname;let c=a?a.pathnameBase:"/";a&&a.route;let d=Ka(),f;if(e){var u;let y=typeof e=="string"?Zn(e):e;c==="/"||(u=y.pathname)!=null&&u.startsWith(c)||ot(!1),f=y}else f=d;let m=f.pathname||"/",h=m;if(c!=="/"){let y=c.replace(/^\//,"").split("/");h="/"+m.replace(/^\//,"").split("/").slice(y.length).join("/")}let b=Tf(t,{pathname:h}),C=oh(b&&b.map(y=>Object.assign({},y,{params:Object.assign({},l,y.params),pathname:qn([c,i.encodeLocation?i.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?c:qn([c,i.encodeLocation?i.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),s,n,r);return e&&C?p.createElement(Qi.Provider,{value:{location:Zr({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:Tn.Pop}},C):C}function rh(){let t=dh(),e=Qf(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},e),n?p.createElement("pre",{style:i},n):null,null)}const ih=p.createElement(rh,null);class sh extends p.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?p.createElement(Dr.Provider,{value:this.props.routeContext},p.createElement(gu.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ah(t){let{routeContext:e,match:n,children:r}=t,i=p.useContext(Va);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),p.createElement(Dr.Provider,{value:e},r)}function oh(t,e,n,r){var i;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var s;if(!n)return null;if(n.errors)t=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let a=t,l=(i=n)==null?void 0:i.errors;if(l!=null){let f=a.findIndex(u=>u.route.id&&(l==null?void 0:l[u.route.id])!==void 0);f>=0||ot(!1),a=a.slice(0,Math.min(a.length,f+1))}let c=!1,d=-1;if(n&&r&&r.v7_partialHydration)for(let f=0;f<a.length;f++){let u=a[f];if((u.route.HydrateFallback||u.route.hydrateFallbackElement)&&(d=f),u.route.id){let{loaderData:m,errors:h}=n,b=u.route.loader&&m[u.route.id]===void 0&&(!h||h[u.route.id]===void 0);if(u.route.lazy||b){c=!0,d>=0?a=a.slice(0,d+1):a=[a[0]];break}}}return a.reduceRight((f,u,m)=>{let h,b=!1,C=null,y=null;n&&(h=l&&u.route.id?l[u.route.id]:void 0,C=u.route.errorElement||ih,c&&(d<0&&m===0?(b=!0,y=null):d===m&&(b=!0,y=u.route.hydrateFallbackElement||null)));let v=e.concat(a.slice(0,m+1)),E=()=>{let I;return h?I=C:b?I=y:u.route.Component?I=p.createElement(u.route.Component,null):u.route.element?I=u.route.element:I=f,p.createElement(ah,{match:u,routeContext:{outlet:f,matches:v,isDataRoute:n!=null},children:I})};return n&&(u.route.ErrorBoundary||u.route.errorElement||m===0)?p.createElement(sh,{location:n.location,revalidation:n.revalidation,component:C,error:h,children:E(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):E()},null)}var vu=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(vu||{}),Pi=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(Pi||{});function lh(t){let e=p.useContext(Va);return e||ot(!1),e}function ch(t){let e=p.useContext(Jf);return e||ot(!1),e}function uh(t){let e=p.useContext(Dr);return e||ot(!1),e}function xu(t){let e=uh(),n=e.matches[e.matches.length-1];return n.route.id||ot(!1),n.route.id}function dh(){var t;let e=p.useContext(gu),n=ch(Pi.UseRouteError),r=xu(Pi.UseRouteError);return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function ph(){let{router:t}=lh(vu.UseNavigateStable),e=xu(Pi.UseNavigateStable),n=p.useRef(!1);return yu(()=>{n.current=!0}),p.useCallback(function(i,s){s===void 0&&(s={}),n.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,Zr({fromRouteId:e},s)))},[t,e])}const ol={};function fh(t,e){ol[e]||(ol[e]=!0,console.warn(e))}const ll=(t,e,n)=>fh(t,"⚠️ React Router Future Flag Warning: "+e+". "+("You can use the `"+t+"` future flag to opt-in early. ")+("For more information, see "+n+"."));function hh(t,e){t!=null&&t.v7_startTransition||ll("v7_startTransition","React Router will begin wrapping state updates in `React.startTransition` in v7","https://reactrouter.com/v6/upgrading/future#v7_starttransition"),!(t!=null&&t.v7_relativeSplatPath)&&!e&&ll("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath")}const mh="startTransition",cl=hp[mh];function gh(t){let{basename:e,children:n,initialEntries:r,initialIndex:i,future:s}=t,a=p.useRef();a.current==null&&(a.current=kf({initialEntries:r,initialIndex:i,v5Compat:!0}));let l=a.current,[c,d]=p.useState({action:l.action,location:l.location}),{v7_startTransition:f}=s||{},u=p.useCallback(m=>{f&&cl?cl(()=>d(m)):d(m)},[d,f]);return p.useLayoutEffect(()=>l.listen(u),[l,u]),p.useEffect(()=>hh(s),[s]),p.createElement(yh,{basename:e,children:n,location:c.location,navigationType:c.action,navigator:l,future:s})}function la(t){ot(!1)}function yh(t){let{basename:e="/",children:n=null,location:r,navigationType:i=Tn.Pop,navigator:s,static:a=!1,future:l}=t;Xi()&&ot(!1);let c=e.replace(/^\/*/,"/"),d=p.useMemo(()=>({basename:c,navigator:s,static:a,future:Zr({v7_relativeSplatPath:!1},l)}),[c,l,s,a]);typeof r=="string"&&(r=Zn(r));let{pathname:f="/",search:u="",hash:m="",state:h=null,key:b="default"}=r,C=p.useMemo(()=>{let y=hu(f,c);return y==null?null:{location:{pathname:y,search:u,hash:m,state:h,key:b},navigationType:i}},[c,f,u,m,h,b,i]);return C==null?null:p.createElement(Gi.Provider,{value:d},p.createElement(Qi.Provider,{children:n,value:C}))}function vh(t){let{children:e,location:n}=t;return th(ca(e),n)}new Promise(()=>{});function ca(t,e){e===void 0&&(e=[]);let n=[];return p.Children.forEach(t,(r,i)=>{if(!p.isValidElement(r))return;let s=[...e,i];if(r.type===p.Fragment){n.push.apply(n,ca(r.props.children,s));return}r.type!==la&&ot(!1),!r.props.index||!r.props.children||ot(!1);let a={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&&(a.children=ca(r.props.children,s)),n.push(a)}),n}function xh(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}const bh=t=>{switch(t){case"success":return _h;case"info":return Sh;case"warning":return kh;case"error":return jh;default:return null}},wh=Array(12).fill(0),Ch=({visible:t,className:e})=>J.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},J.createElement("div",{className:"sonner-spinner"},wh.map((n,r)=>J.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),_h=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"})),kh=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"})),Sh=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"})),jh=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"})),Eh=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"})),Th=()=>{const[t,e]=J.useState(document.hidden);return J.useEffect(()=>{const n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t};let ua=1;class Ah{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const n=this.subscribers.indexOf(e);this.subscribers.splice(n,1)}),this.publish=e=>{this.subscribers.forEach(n=>n(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var n;const{message:r,...i}=e,s=typeof(e==null?void 0:e.id)=="number"||((n=e.id)==null?void 0:n.length)>0?e.id:ua++,a=this.toasts.find(c=>c.id===s),l=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),a?this.toasts=this.toasts.map(c=>c.id===s?(this.publish({...c,...e,id:s,title:r}),{...c,...e,id:s,dismissible:l,title:r}):c):this.addToast({title:r,...i,dismissible:l,id:s}),s},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:e,dismiss:!0}))),e),this.message=(e,n)=>this.create({...n,message:e}),this.error=(e,n)=>this.create({...n,message:e,type:"error"}),this.success=(e,n)=>this.create({...n,type:"success",message:e}),this.info=(e,n)=>this.create({...n,type:"info",message:e}),this.warning=(e,n)=>this.create({...n,type:"warning",message:e}),this.loading=(e,n)=>this.create({...n,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:e,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const i=Promise.resolve(e instanceof Function?e():e);let s=r!==void 0,a;const l=i.then(async d=>{if(a=["resolve",d],J.isValidElement(d))s=!1,this.create({id:r,type:"default",message:d});else if(Oh(d)&&!d.ok){s=!1;const u=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,m=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,h=typeof u=="object"?u:{message:u};this.create({id:r,type:"error",description:m,...h})}else if(d instanceof Error){s=!1;const u=typeof n.error=="function"?await n.error(d):n.error,m=typeof n.description=="function"?await n.description(d):n.description,h=typeof u=="object"?u:{message:u};this.create({id:r,type:"error",description:m,...h})}else if(n.success!==void 0){s=!1;const u=typeof n.success=="function"?await n.success(d):n.success,m=typeof n.description=="function"?await n.description(d):n.description,h=typeof u=="object"?u:{message:u};this.create({id:r,type:"success",description:m,...h})}}).catch(async d=>{if(a=["reject",d],n.error!==void 0){s=!1;const f=typeof n.error=="function"?await n.error(d):n.error,u=typeof n.description=="function"?await n.description(d):n.description,m=typeof f=="object"?f:{message:f};this.create({id:r,type:"error",description:u,...m})}}).finally(()=>{s&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((d,f)=>l.then(()=>a[0]==="reject"?f(a[1]):d(a[1])).catch(f));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(e,n)=>{const r=(n==null?void 0:n.id)||ua++;return this.create({jsx:e(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const wt=new Ah,Rh=(t,e)=>{const n=(e==null?void 0:e.id)||ua++;return wt.addToast({title:t,...e,id:n}),n},Oh=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",Nh=Rh,Ih=()=>wt.toasts,Mh=()=>wt.getActiveToasts(),bu=Object.assign(Nh,{success:wt.success,info:wt.info,warning:wt.warning,error:wt.error,custom:wt.custom,message:wt.message,promise:wt.promise,dismiss:wt.dismiss,loading:wt.loading},{getHistory:Ih,getToasts:Mh});xh("[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 gi(t){return t.label!==void 0}const $h=3,Dh="24px",Fh="16px",ul=4e3,Ph=356,Bh=14,Lh=45,zh=200;function Yt(...t){return t.filter(Boolean).join(" ")}function Hh(t){const[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}const Uh=t=>{var e,n,r,i,s,a,l,c,d;const{invert:f,toast:u,unstyled:m,interacting:h,setHeights:b,visibleToasts:C,heights:y,index:v,toasts:E,expanded:I,removeToast:_,defaultRichColors:L,closeButton:w,style:$,cancelButtonStyle:H,actionButtonStyle:q,className:F="",descriptionClassName:T="",duration:A,position:B,gap:D,expandByDefault:M,classNames:R,icons:P,closeButtonAriaLabel:j="Close toast"}=t,[U,Y]=J.useState(null),[Q,Z]=J.useState(null),[ee,se]=J.useState(!1),[ce,ue]=J.useState(!1),[je,Te]=J.useState(!1),[Se,ve]=J.useState(!1),[ge,S]=J.useState(!1),[W,K]=J.useState(0),[he,ae]=J.useState(0),be=J.useRef(u.duration||A||ul),Pe=J.useRef(null),oe=J.useRef(null),V=v===0,te=v+1<=C,k=u.type,z=u.dismissible!==!1,O=u.className||"",N=u.descriptionClassName||"",X=J.useMemo(()=>y.findIndex(we=>we.toastId===u.id)||0,[y,u.id]),ie=J.useMemo(()=>{var we;return(we=u.closeButton)!=null?we:w},[u.closeButton,w]),xe=J.useMemo(()=>u.duration||A||ul,[u.duration,A]),Ne=J.useRef(0),Ge=J.useRef(0),pt=J.useRef(0),et=J.useRef(null),[Lt,ft]=B.split("-"),rt=J.useMemo(()=>y.reduce((we,He,Qe)=>Qe>=X?we:we+He.height,0),[y,X]),kt=Th(),Mt=u.invert||f,St=k==="loading";Ge.current=J.useMemo(()=>X*D+rt,[X,rt]),J.useEffect(()=>{be.current=xe},[xe]),J.useEffect(()=>{se(!0)},[]),J.useEffect(()=>{const we=oe.current;if(we){const He=we.getBoundingClientRect().height;return ae(He),b(Qe=>[{toastId:u.id,height:He,position:u.position},...Qe]),()=>b(Qe=>Qe.filter(Ce=>Ce.toastId!==u.id))}},[b,u.id]),J.useLayoutEffect(()=>{if(!ee)return;const we=oe.current,He=we.style.height;we.style.height="auto";const Qe=we.getBoundingClientRect().height;we.style.height=He,ae(Qe),b(Ce=>Ce.find(Le=>Le.toastId===u.id)?Ce.map(Le=>Le.toastId===u.id?{...Le,height:Qe}:Le):[{toastId:u.id,height:Qe,position:u.position},...Ce])},[ee,u.title,u.description,b,u.id]);const ye=J.useCallback(()=>{ue(!0),K(Ge.current),b(we=>we.filter(He=>He.toastId!==u.id)),setTimeout(()=>{_(u)},zh)},[u,_,b,Ge]);J.useEffect(()=>{if(u.promise&&k==="loading"||u.duration===1/0||u.type==="loading")return;let we;return I||h||kt?(()=>{if(pt.current<Ne.current){const Ce=new Date().getTime()-Ne.current;be.current=be.current-Ce}pt.current=new Date().getTime()})():(()=>{be.current!==1/0&&(Ne.current=new Date().getTime(),we=setTimeout(()=>{u.onAutoClose==null||u.onAutoClose.call(u,u),ye()},be.current))})(),()=>clearTimeout(we)},[I,h,u,k,kt,ye]),J.useEffect(()=>{u.delete&&ye()},[ye,u.delete]);function yt(){var we;if(P!=null&&P.loading){var He;return J.createElement("div",{className:Yt(R==null?void 0:R.loader,u==null||(He=u.classNames)==null?void 0:He.loader,"sonner-loader"),"data-visible":k==="loading"},P.loading)}return J.createElement(Ch,{className:Yt(R==null?void 0:R.loader,u==null||(we=u.classNames)==null?void 0:we.loader),visible:k==="loading"})}var Lr,jt;return J.createElement("li",{tabIndex:0,ref:oe,className:Yt(F,O,R==null?void 0:R.toast,u==null||(e=u.classNames)==null?void 0:e.toast,R==null?void 0:R.default,R==null?void 0:R[k],u==null||(n=u.classNames)==null?void 0:n[k]),"data-sonner-toast":"","data-rich-colors":(Lr=u.richColors)!=null?Lr:L,"data-styled":!(u.jsx||u.unstyled||m),"data-mounted":ee,"data-promise":!!u.promise,"data-swiped":ge,"data-removed":ce,"data-visible":te,"data-y-position":Lt,"data-x-position":ft,"data-index":v,"data-front":V,"data-swiping":je,"data-dismissible":z,"data-type":k,"data-invert":Mt,"data-swipe-out":Se,"data-swipe-direction":Q,"data-expanded":!!(I||M&&ee),style:{"--index":v,"--toasts-before":v,"--z-index":E.length-v,"--offset":`${ce?W:Ge.current}px`,"--initial-height":M?"auto":`${he}px`,...$,...u.style},onDragEnd:()=>{Te(!1),Y(null),et.current=null},onPointerDown:we=>{St||!z||(Pe.current=new Date,K(Ge.current),we.target.setPointerCapture(we.pointerId),we.target.tagName!=="BUTTON"&&(Te(!0),et.current={x:we.clientX,y:we.clientY}))},onPointerUp:()=>{var we,He,Qe;if(Se||!z)return;et.current=null;const Ce=Number(((we=oe.current)==null?void 0:we.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ue=Number(((He=oe.current)==null?void 0:He.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Le=new Date().getTime()-((Qe=Pe.current)==null?void 0:Qe.getTime()),it=U==="x"?Ce:Ue,cn=Math.abs(it)/Le;if(Math.abs(it)>=Lh||cn>.11){K(Ge.current),u.onDismiss==null||u.onDismiss.call(u,u),Z(U==="x"?Ce>0?"right":"left":Ue>0?"down":"up"),ye(),ve(!0);return}else{var st,ct;(st=oe.current)==null||st.style.setProperty("--swipe-amount-x","0px"),(ct=oe.current)==null||ct.style.setProperty("--swipe-amount-y","0px")}S(!1),Te(!1),Y(null)},onPointerMove:we=>{var He,Qe,Ce;if(!et.current||!z||((He=window.getSelection())==null?void 0:He.toString().length)>0)return;const Le=we.clientY-et.current.y,it=we.clientX-et.current.x;var cn;const st=(cn=t.swipeDirections)!=null?cn:Hh(B);!U&&(Math.abs(it)>1||Math.abs(Le)>1)&&Y(Math.abs(it)>Math.abs(Le)?"x":"y");let ct={x:0,y:0};const pi=Kt=>1/(1.5+Math.abs(Kt)/20);if(U==="y"){if(st.includes("top")||st.includes("bottom"))if(st.includes("top")&&Le<0||st.includes("bottom")&&Le>0)ct.y=Le;else{const Kt=Le*pi(Le);ct.y=Math.abs(Kt)<Math.abs(Le)?Kt:Le}}else if(U==="x"&&(st.includes("left")||st.includes("right")))if(st.includes("left")&&it<0||st.includes("right")&&it>0)ct.x=it;else{const Kt=it*pi(it);ct.x=Math.abs(Kt)<Math.abs(it)?Kt:it}(Math.abs(ct.x)>0||Math.abs(ct.y)>0)&&S(!0),(Qe=oe.current)==null||Qe.style.setProperty("--swipe-amount-x",`${ct.x}px`),(Ce=oe.current)==null||Ce.style.setProperty("--swipe-amount-y",`${ct.y}px`)}},ie&&!u.jsx&&k!=="loading"?J.createElement("button",{"aria-label":j,"data-disabled":St,"data-close-button":!0,onClick:St||!z?()=>{}:()=>{ye(),u.onDismiss==null||u.onDismiss.call(u,u)},className:Yt(R==null?void 0:R.closeButton,u==null||(r=u.classNames)==null?void 0:r.closeButton)},(jt=P==null?void 0:P.close)!=null?jt:Eh):null,k||u.icon||u.promise?J.createElement("div",{"data-icon":"",className:Yt(R==null?void 0:R.icon,u==null||(i=u.classNames)==null?void 0:i.icon)},u.promise||u.type==="loading"&&!u.icon?u.icon||yt():null,u.type!=="loading"?u.icon||(P==null?void 0:P[k])||bh(k):null):null,J.createElement("div",{"data-content":"",className:Yt(R==null?void 0:R.content,u==null||(s=u.classNames)==null?void 0:s.content)},J.createElement("div",{"data-title":"",className:Yt(R==null?void 0:R.title,u==null||(a=u.classNames)==null?void 0:a.title)},u.jsx?u.jsx:typeof u.title=="function"?u.title():u.title),u.description?J.createElement("div",{"data-description":"",className:Yt(T,N,R==null?void 0:R.description,u==null||(l=u.classNames)==null?void 0:l.description)},typeof u.description=="function"?u.description():u.description):null),J.isValidElement(u.cancel)?u.cancel:u.cancel&&gi(u.cancel)?J.createElement("button",{"data-button":!0,"data-cancel":!0,style:u.cancelButtonStyle||H,onClick:we=>{gi(u.cancel)&&z&&(u.cancel.onClick==null||u.cancel.onClick.call(u.cancel,we),ye())},className:Yt(R==null?void 0:R.cancelButton,u==null||(c=u.classNames)==null?void 0:c.cancelButton)},u.cancel.label):null,J.isValidElement(u.action)?u.action:u.action&&gi(u.action)?J.createElement("button",{"data-button":!0,"data-action":!0,style:u.actionButtonStyle||q,onClick:we=>{gi(u.action)&&(u.action.onClick==null||u.action.onClick.call(u.action,we),!we.defaultPrevented&&ye())},className:Yt(R==null?void 0:R.actionButton,u==null||(d=u.classNames)==null?void 0:d.actionButton)},u.action.label):null)};function dl(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function qh(t,e){const n={};return[t,e].forEach((r,i)=>{const s=i===1,a=s?"--mobile-offset":"--offset",l=s?Fh:Dh;function c(d){["top","right","bottom","left"].forEach(f=>{n[`${a}-${f}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${a}-${d}`]=l:n[`${a}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):c(l)}),n}const Wh=J.forwardRef(function(e,n){const{invert:r,position:i="bottom-right",hotkey:s=["altKey","KeyT"],expand:a,closeButton:l,className:c,offset:d,mobileOffset:f,theme:u="light",richColors:m,duration:h,style:b,visibleToasts:C=$h,toastOptions:y,dir:v=dl(),gap:E=Bh,icons:I,containerAriaLabel:_="Notifications"}=e,[L,w]=J.useState([]),$=J.useMemo(()=>Array.from(new Set([i].concat(L.filter(Q=>Q.position).map(Q=>Q.position)))),[L,i]),[H,q]=J.useState([]),[F,T]=J.useState(!1),[A,B]=J.useState(!1),[D,M]=J.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),R=J.useRef(null),P=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=J.useRef(null),U=J.useRef(!1),Y=J.useCallback(Q=>{w(Z=>{var ee;return(ee=Z.find(se=>se.id===Q.id))!=null&&ee.delete||wt.dismiss(Q.id),Z.filter(({id:se})=>se!==Q.id)})},[]);return J.useEffect(()=>wt.subscribe(Q=>{if(Q.dismiss){const Z=L.map(ee=>ee.id===Q.id?{...ee,delete:!0}:ee);requestAnimationFrame(()=>{w(Z)});return}setTimeout(()=>{mp.flushSync(()=>{w(Z=>{const ee=Z.findIndex(se=>se.id===Q.id);return ee!==-1?[...Z.slice(0,ee),{...Z[ee],...Q},...Z.slice(ee+1)]:[Q,...Z]})})})}),[L]),J.useEffect(()=>{if(u!=="system"){M(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?M("dark"):M("light")),typeof window>"u")return;const Q=window.matchMedia("(prefers-color-scheme: dark)");try{Q.addEventListener("change",({matches:Z})=>{M(Z?"dark":"light")})}catch{Q.addListener(({matches:ee})=>{try{M(ee?"dark":"light")}catch(se){console.error(se)}})}},[u]),J.useEffect(()=>{L.length<=1&&T(!1)},[L]),J.useEffect(()=>{const Q=Z=>{var ee;if(s.every(ue=>Z[ue]||Z.code===ue)){var ce;T(!0),(ce=R.current)==null||ce.focus()}Z.code==="Escape"&&(document.activeElement===R.current||(ee=R.current)!=null&&ee.contains(document.activeElement))&&T(!1)};return document.addEventListener("keydown",Q),()=>document.removeEventListener("keydown",Q)},[s]),J.useEffect(()=>{if(R.current)return()=>{j.current&&(j.current.focus({preventScroll:!0}),j.current=null,U.current=!1)}},[R.current]),J.createElement("section",{ref:n,"aria-label":`${_} ${P}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},$.map((Q,Z)=>{var ee;const[se,ce]=Q.split("-");return L.length?J.createElement("ol",{key:Q,dir:v==="auto"?dl():v,tabIndex:-1,ref:R,className:c,"data-sonner-toaster":!0,"data-sonner-theme":D,"data-y-position":se,"data-lifted":F&&L.length>1&&!a,"data-x-position":ce,style:{"--front-toast-height":`${((ee=H[0])==null?void 0:ee.height)||0}px`,"--width":`${Ph}px`,"--gap":`${E}px`,...b,...qh(d,f)},onBlur:ue=>{U.current&&!ue.currentTarget.contains(ue.relatedTarget)&&(U.current=!1,j.current&&(j.current.focus({preventScroll:!0}),j.current=null))},onFocus:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||U.current||(U.current=!0,j.current=ue.relatedTarget)},onMouseEnter:()=>T(!0),onMouseMove:()=>T(!0),onMouseLeave:()=>{A||T(!1)},onDragEnd:()=>T(!1),onPointerDown:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||B(!0)},onPointerUp:()=>B(!1)},L.filter(ue=>!ue.position&&Z===0||ue.position===Q).map((ue,je)=>{var Te,Se;return J.createElement(Uh,{key:ue.id,icons:I,index:je,toast:ue,defaultRichColors:m,duration:(Te=y==null?void 0:y.duration)!=null?Te:h,className:y==null?void 0:y.className,descriptionClassName:y==null?void 0:y.descriptionClassName,invert:r,visibleToasts:C,closeButton:(Se=y==null?void 0:y.closeButton)!=null?Se:l,interacting:A,position:Q,style:y==null?void 0:y.style,unstyled:y==null?void 0:y.unstyled,classNames:y==null?void 0:y.classNames,cancelButtonStyle:y==null?void 0:y.cancelButtonStyle,actionButtonStyle:y==null?void 0:y.actionButtonStyle,closeButtonAriaLabel:y==null?void 0:y.closeButtonAriaLabel,removeToast:Y,toasts:L.filter(ve=>ve.position==ue.position),heights:H.filter(ve=>ve.position==ue.position),setHeights:q,expandByDefault:a,gap:E,expanded:F,swipeDirections:e.swipeDirections})})):null}))}),Ya=3e3;function Ut(t){const{duration:e,...n}=t;return bu.custom(r=>o.jsx(Vh,{id:r,title:n.title,description:n.description,variant:n.variant,button:n.button}),{duration:e??Ya})}const Ts={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 Vh(t){const{title:e,description:n,button:r,id:i,variant:s}=t;return o.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",Ts[s||"info"].bg),children:[o.jsx("div",{className:"flex flex-1 items-center",children:o.jsxs("div",{className:"w-full",children:[e&&o.jsx("p",{className:Ie("text-sm font-medium",Ts[s||"info"].text),children:e}),o.jsx("p",{className:Ie("text-sm",Ts[s||"info"].text,{"mt-1":!!e}),children:n})]})}),r&&o.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:o.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(),bu.dismiss(i)},children:r.label})})]})}function Kh(t){return Array.isArray(t)&&t[0].field!==void 0}const Tr=(t,e)=>{var n;if(Kh(t)){for(const r of t)(n=e==null?void 0:e.form)==null||n.setFieldError(r.field,r.message);return}if(t&&t.message){e!=null&&e.noToast||Ut({description:t.message,variant:"error"});return}if(t&&t.error){e!=null&&e.noToast||Ut({description:t.error,variant:"error"});return}},Yh=[{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ı"}],Gh=[{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ı"}],zr=(t,e)=>e?`${t} (Kod: ${e})`:t,Qh=(t,e)=>{if(gt(e))return!1;if(t===null)return Ut({description:"Bir hata oluştu",variant:"error"}),!0;if(typeof t=="object"&&t){const r=t.code;if(r){const i=Gh.find(s=>s.code===r);if(i)return Ut({description:zr(i.text,r),variant:"error"}),!0}if(e===401){if(t.tokenNotPresent)return Ut({description:zr("Oturum bilgisi bulunamadı. Lütfen sohbeti yeniden başlatın","AUTH_TOKEN_NOT_PRESENT"),variant:"error"}),!0;if(t.tokenNotValid)return Ut({description:zr("Oturum süreniz dolmuş olabilir. Lütfen sohbeti yeniden başlatın","AUTH_TOKEN_NOT_VALID"),variant:"error"}),!0;if(t.verifyRequired)return Ut({description:zr("Hesap doğrulaması gerekiyor. Lütfen doğrulama adımını tamamlayın","AUTH_VERIFY_REQUIRED"),variant:"error"}),!0}if(t.message)return Ut({description:zr(t.message,r),variant:"error"}),!0}const n=Yh.find(r=>r.code===e);return Ut({description:n?n.text:"Bir hata oluştu",variant:"error"}),!0};function Ei(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}var Ye=(t=>(t.CustomerToken="lc:customer:token",t.CustomerRefreshToken="lc:customer:refresh_token",t.DeviceId="lc:device:id",t.AIAgentMode="lc:agent:mode",t.AIAgent="lc:agent:data",t.AIAgentSessionId="lc:agent:session",t.HumanNeedRequested="lc:agent:human_need",t))(Ye||{});const Rt=(t,e,n)=>{let r=t;["lc:customer:token","lc:customer:refresh_token"].includes(t)&&(r=`${n}:${t}`),localStorage.setItem(r,e)},Wr=(t,e)=>{let n=t;return["lc:customer:token","lc:customer:refresh_token"].includes(t)&&(n=`${e}:${t}`),localStorage.getItem(n)},Gr=t=>{localStorage.removeItem(`${t}:lc:customer:token`),localStorage.removeItem(`${t}:lc:customer:refresh_token`),Ga(t)},wu=t=>{localStorage.removeItem(`${t}:lc:customer:token`),localStorage.removeItem(`${t}:lc:customer:refresh_token`)},yi=(t,e,n,r,i)=>{const s=`${t}:`;e&&(n||i)?(localStorage.setItem(`${s}lc:agent:mode`,"true"),localStorage.setItem(`${s}lc:agent:data`,JSON.stringify(e)),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`))):Ga(t)},Qt=t=>{const e=`${t}:`,n=localStorage.getItem(`${e}lc:agent:mode`)==="true",r=localStorage.getItem(`${e}lc:agent:data`),i=localStorage.getItem(`${e}lc:agent:session`),s=localStorage.getItem(`${e}lc:agent:human_need`)==="true";let a=null;if(r)try{a=JSON.parse(r)}catch{a=null}return{isAgentMode:n,agent:a,sessionId:i,humanNeedRequested:s}},Ga=t=>{const e=`${t}:`;localStorage.removeItem(`${e}lc:agent:mode`),localStorage.removeItem(`${e}lc:agent:data`),localStorage.removeItem(`${e}lc:agent:session`),localStorage.removeItem(`${e}lc:agent:human_need`)},mn=t=>{const e=`${t}:lc:device:id`;let n=localStorage.getItem(e);return n||(n=Ei(),localStorage.setItem(e,n)),n},Xh={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},pl=t=>{let e;const n=new Set,r=(f,u)=>{const m=typeof f=="function"?f(e):f;if(!Object.is(m,e)){const h=e;e=u??(typeof m!="object"||m===null)?m:Object.assign({},e,m),n.forEach(b=>b(e,h))}},i=()=>e,c={setState:r,getState:i,getInitialState:()=>d,subscribe:f=>(n.add(f),()=>n.delete(f)),destroy:()=>{(Xh?"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()}},d=e=t(r,i,c);return c},Jh=t=>t?pl(t):pl;var Cu={exports:{}},_u={},ku={exports:{}},Su={};/**
|
|
71
20
|
* @license React
|
|
72
21
|
* use-sync-external-store-shim.production.min.js
|
|
73
22
|
*
|
|
@@ -75,7 +24,7 @@ Error generating stack: `+s.message+`
|
|
|
75
24
|
*
|
|
76
25
|
* This source code is licensed under the MIT license found in the
|
|
77
26
|
* LICENSE file in the root directory of this source tree.
|
|
78
|
-
*/var
|
|
27
|
+
*/var Ar=p;function Zh(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var em=typeof Object.is=="function"?Object.is:Zh,tm=Ar.useState,nm=Ar.useEffect,rm=Ar.useLayoutEffect,im=Ar.useDebugValue;function sm(t,e){var n=e(),r=tm({inst:{value:n,getSnapshot:e}}),i=r[0].inst,s=r[1];return rm(function(){i.value=n,i.getSnapshot=e,As(i)&&s({inst:i})},[t,n,e]),nm(function(){return As(i)&&s({inst:i}),t(function(){As(i)&&s({inst:i})})},[t]),im(n),n}function As(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!em(t,n)}catch{return!0}}function am(t,e){return e()}var om=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?am:sm;Su.useSyncExternalStore=Ar.useSyncExternalStore!==void 0?Ar.useSyncExternalStore:om;ku.exports=Su;var lm=ku.exports;/**
|
|
79
28
|
* @license React
|
|
80
29
|
* use-sync-external-store-shim/with-selector.production.min.js
|
|
81
30
|
*
|
|
@@ -83,49 +32,57 @@ Error generating stack: `+s.message+`
|
|
|
83
32
|
*
|
|
84
33
|
* This source code is licensed under the MIT license found in the
|
|
85
34
|
* LICENSE file in the root directory of this source tree.
|
|
86
|
-
*/var $u=v,xP=yP;function wP(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var bP=typeof Object.is=="function"?Object.is:wP,CP=xP.useSyncExternalStore,SP=$u.useRef,kP=$u.useEffect,_P=$u.useMemo,TP=$u.useDebugValue;RS.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var s=SP(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=_P(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,bP(d,h))return y;var b=r(h);return i!==void 0&&i(y,b)?y:(d=h,u=b)}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=CP(e,s[0],s[1]);return kP(function(){o.hasValue=!0,o.value=a},[a]),TP(a),a};jS.exports=RS;var EP=jS.exports;const AP=Fr(EP),NS={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},{useDebugValue:jP}=ie,{useSyncExternalStoreWithSelector:RP}=AP;let Ny=!1;const MP=e=>e;function PP(e,t=MP,n){(NS?"production":void 0)!=="production"&&n&&!Ny&&(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"),Ny=!0);const r=RP(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return jP(r),r}const Oy=e=>{(NS?"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"?lP(e):e,n=(r,i)=>PP(t,r,i);return Object.assign(n,t),n},NP=e=>e?Oy(e):Oy,ne=NP(e=>({widget:null,open:localStorage.getItem("lc:widget:isHaveChat")==="true",isInputFocused:!1,isHaveChat:localStorage.getItem("lc:widget:isHaveChat")==="true",minimizedAssigneeName:null,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,minimizedAssigneeName:null});const r=(n=ne.getState().widget)==null?void 0:n.link_id;r&&localStorage.setItem(`${r}:showActionButtons`,"false")}},setMinimizedAssigneeName:t=>e({minimizedAssigneeName:t}),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&&ql(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&&ql(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&&ql(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}${Je.HumanNeedRequested}`,"true"):localStorage.removeItem(`${s}${Je.HumanNeedRequested}`),n.aiAgent&&n.isAIAgentMode&&ql(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&&lg(n),{aiAgent:null,isAIAgentMode:!1,aiAgentSessionId:null,humanNeedRequested:!1,aiAgentMessages:[],connectingToOperator:!1,showOperatorForm:!1,aiAgentRequestInFlight:!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}}),aiAgentRequestInFlight:!1,setAIAgentRequestInFlight:t=>e({aiAgentRequestInFlight:t})})),OP=e=>({accessToken:localStorage.getItem(`${e}:${Je.CustomerToken}`)||"",refreshToken:localStorage.getItem(`${e}:${Je.CustomerRefreshToken}`)||""}),vl=()=>{const{widget:e}=ne();return e?OP(e.link_id):null},ts=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}},eo=e=>{const t=document.cookie.split(";").find(n=>n.includes(e));return t?t.split("=")[1]:null},DP=e=>oa(Je.DeviceId,e)||eo("device_id")||Lr(e),ns=(e,t)=>({...e,"X-Device-Id":DP(t)});function Kp(e){return e&&typeof e=="object"&&"customer_token"in e&&"customer_refresh_token"in e}const cg=()=>{const e=Ru();return Sm({mutationFn:t=>mr(`clients/${t.client_id}/chats`,{method:"POST",body:JSON.stringify({inputs:t.inputs,client_id:void 0,widget_id:t.widget_id,history:t.history,device_id:t.device_id,is_agent_mode:t.is_agent_mode,widget_version:"2026.01.05-1"})}),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:["visitors","history",n.widget_id,n.device_id]})}})},IP=(e,t)=>mr(`clients/${e}/chats`,{headers:t}),vc=(e,t)=>mr(`clients/${e}/chats`,{method:"DELETE",headers:t}),LP=(e,t,n,r)=>mr("review",{method:"POST",body:JSON.stringify({rating:e,comment:t||void 0}),headers:ns(n??{},r)}),FP=()=>{const e=vl(),{widget:t}=ne(),n=(t==null?void 0:t.link_id)??"";return Sm({mutationFn:r=>LP(r.rating,r.comment,ts(e),n)})},BP=e=>{const t=vl(),{widget:n}=ne(),r=(n==null?void 0:n.link_id)??"";return Sm({mutationFn:i=>mr(`clients/${e}/chats/files`,{method:"POST",headers:ns(ts(t),r),body:uE({files:i},{arrayWithBracketAndIndex:!1,arrayWithBrackets:!1})})})};function $P(e){return e&&typeof e=="object"&&"file_urls"in e}const zP=e=>{const t=`${Eb}/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)}}},VP=(e,t,n)=>Cm({queryKey:["visitors","history",e,t],queryFn:async()=>{const r=`visitors/history?widget_id=${e}&device_id=${t}`,i=4;let s=await mr(r);for(let o=0;o<i-1;o++){const[,a]=s;if(a!==429)break;await new Promise(l=>setTimeout(l,Math.min(1e3*2**o,8e3))),s=await mr(r)}return s},enabled:!!e&&!!t&&((n==null?void 0:n.enabled)??!0)}),UP=(e,t,n)=>mr(`visitors/chats/${e}/messages?widget_id=${t}&device_id=${n}`),OS=e=>["widgetAgent",e];async function ug(e){const[t,n]=await HP(e);if(n===204)return null;if(n===200&&t&&typeof t=="object"&&"id"in t&&"is_active"in t&&t.is_active)return t;throw new Error(`getWidgetAgent: ${n}`)}function DS(e){return Cm({queryKey:OS(e??""),queryFn:()=>ug(e),enabled:!!e,retry:(t,n)=>(n instanceof Error?n.message:"").includes("429")?t<4:t<2,retryDelay:t=>Math.min(1e3*2**t,8e3),staleTime:5*60*1e3})}async function HP(e){const[t,n]=await mr(`widgets/${e}/agent`);return n===204?[null,n]:[t,n]}function vs(e){this._maxSize=e,this.clear()}vs.prototype.clear=function(){this._size=0,this._values=Object.create(null)};vs.prototype.get=function(e){return this._values[e]};vs.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var WP=/[^.^\]^[]+|(?=\[\]|\.\.)/g,IS=/^\d+$/,qP=/^\d/,GP=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,YP=/^\s*(['"]?)(.*?)(\1)\s*$/,dg=512,Dy=new vs(dg),Iy=new vs(dg),Ly=new vs(dg),rs={Cache:vs,split:Xp,normalizePath:tf,setter:function(e){var t=tf(e);return Iy.get(e)||Iy.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=tf(e);return Ly.get(e)||Ly.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+(fg(n)||IS.test(n)?"["+n+"]":(t?".":"")+n)},"")},forEach:function(e,t,n){QP(Array.isArray(e)?e:Xp(e),t,n)}};function tf(e){return Dy.get(e)||Dy.set(e,Xp(e).map(function(t){return t.replace(YP,"$2")}))}function Xp(e){return e.match(WP)||[""]}function QP(e,t,n){var r=e.length,i,s,o,a;for(s=0;s<r;s++)i=e[s],i&&(ZP(i)&&(i='"'+i+'"'),a=fg(i),o=!a&&/^\d+$/.test(i),t.call(n,i,a,o,s,e))}function fg(e){return typeof e=="string"&&e&&["'",'"'].indexOf(e.charAt(0))!==-1}function KP(e){return e.match(qP)&&!e.match(IS)}function XP(e){return GP.test(e)}function ZP(e){return!fg(e)&&(KP(e)||XP(e))}const JP=/[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,zu=e=>e.match(JP)||[],Vu=e=>e[0].toUpperCase()+e.slice(1),pg=(e,t)=>zu(e).join(t).toLowerCase(),LS=e=>zu(e).reduce((t,n)=>`${t}${t?n[0].toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()}`,""),e4=e=>Vu(LS(e)),t4=e=>pg(e,"_"),n4=e=>pg(e,"-"),r4=e=>Vu(pg(e," ")),i4=e=>zu(e).map(Vu).join(" ");var nf={words:zu,upperFirst:Vu,camelCase:LS,pascalCase:e4,snakeCase:t4,kebabCase:n4,sentenceCase:r4,titleCase:i4},hg={exports:{}};hg.exports=function(e){return FS(s4(e),e)};hg.exports.array=FS;function FS(e,t){var n=e.length,r=new Array(n),i={},s=n,o=o4(t),a=a4(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 s4(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 o4(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 a4(e){for(var t=new Map,n=0,r=e.length;n<r;n++)t.set(e[n],n);return t}var l4=hg.exports;const c4=Fr(l4),u4=Object.prototype.toString,d4=Error.prototype.toString,f4=RegExp.prototype.toString,p4=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",h4=/^Symbol\((.*)\)(.*)$/;function m4(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function Fy(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const n=typeof e;if(n==="number")return m4(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return p4.call(e).replace(h4,"Symbol($1)");const r=u4.call(e).slice(8,-1);return r==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):r==="Error"||e instanceof Error?"["+d4.call(e)+"]":r==="RegExp"?f4.call(e):null}function vi(e,t){let n=Fy(e,t);return n!==null?n:JSON.stringify(e,function(r,i){let s=Fy(this[r],t);return s!==null?s:i},2)}function BS(e){return e==null?[]:[].concat(e)}let $S,zS,VS,g4=/\$\{\s*(\w+)\s*\}/g;$S=Symbol.toStringTag;class By{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=[],BS(t).forEach(s=>{if(Kt.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]}}zS=Symbol.hasInstance;VS=Symbol.toStringTag;class Kt 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(g4,(i,s)=>vi(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 By(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[VS]="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,Kt)}static[zS](t){return By[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let nr={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 \`${vi(r,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${vi(n,!0)}\``+i:`${e} must match the configured type. The validated value was: \`${vi(n,!0)}\``+i}},Wt={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"},v4={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"},Zp={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},y4={isValue:"${path} field must be ${value}"},yc={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},x4={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"},w4={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: \`${vi(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: \`${vi(n,!0)}\``}return Kt.formatError(nr.notType,e)}};Object.assign(Object.create(null),{mixed:nr,string:Wt,number:v4,date:Zp,object:yc,array:x4,boolean:y4,tuple:w4});const mg=e=>e&&e.__isYupSchema__;class su{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 su(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(!mg(i))throw new TypeError("conditions must return a schema object");return i.resolve(n)}}const Gl={context:"$",value:"."};class ys{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]===Gl.context,this.isValue=this.key[0]===Gl.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?Gl.context:this.isValue?Gl.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&rs.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}}ys.prototype.__isYupRef=!0;const Ui=e=>e==null;function Es(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:b,abortEarly:C=o.spec.abortEarly,disableStackTrace:g=o.spec.disableStackTrace}=i;function m(N){return ys.isRef(N)?N.getValue(n,y,b):N}function w(N={}){const O=Object.assign({value:n,originalValue:s,label:o.spec.label,path:N.path||r,spec:o.spec,disableStackTrace:N.disableStackTrace||g},u,N.params);for(const L of Object.keys(O))O[L]=m(O[L]);const z=new Kt(Kt.formatError(N.message||p,O),n,O.path,N.type||c,O.disableStackTrace);return z.params=O,z}const S=C?a:l;let T={path:r,parent:y,type:c,from:i.from,createError:w,resolve:m,options:i,originalValue:s,schema:o};const k=N=>{Kt.isError(N)?S(N):N?l(null):S(w())},E=N=>{Kt.isError(N)?S(N):a(N)};if(h&&Ui(n))return k(!0);let U;try{var j;if(U=d.call(T,n,T),typeof((j=U)==null?void 0:j.then)=="function"){if(i.sync)throw new Error(`Validation test of type: "${T.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(U).then(k,E)}}catch(N){E(N);return}k(U)}return t.OPTIONS=e,t}function b4(e,t,n,r=n){let i,s,o;return t?(rs.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 ou extends Set{describe(){const t=[];for(const n of this.values())t.push(ys.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 ou(this.values())}merge(t,n){const r=this.clone();return t.forEach(i=>r.add(i)),n.forEach(i=>r.delete(i)),r}}function Ws(e,t=new Map){if(mg(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]=Ws(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,Ws(i,t))}else if(e instanceof Set){n=new Set,t.set(e,n);for(const r of e)n.add(Ws(r,t))}else if(e instanceof Object){n={},t.set(e,n);for(const[r,i]of Object.entries(e))n[r]=Ws(i,t)}else throw Error(`Unable to clone ${e}`);return n}class gr{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 ou,this._blacklist=new ou,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(nr.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=Ws(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&&Ui(s))return s;let o=vi(t),a=vi(s);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}".
|
|
35
|
+
*/var Ji=p,cm=lm;function um(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var dm=typeof Object.is=="function"?Object.is:um,pm=cm.useSyncExternalStore,fm=Ji.useRef,hm=Ji.useEffect,mm=Ji.useMemo,gm=Ji.useDebugValue;_u.useSyncExternalStoreWithSelector=function(t,e,n,r,i){var s=fm(null);if(s.current===null){var a={hasValue:!1,value:null};s.current=a}else a=s.current;s=mm(function(){function c(h){if(!d){if(d=!0,f=h,h=r(h),i!==void 0&&a.hasValue){var b=a.value;if(i(b,h))return u=b}return u=h}if(b=u,dm(f,h))return b;var C=r(h);return i!==void 0&&i(b,C)?b:(f=h,u=C)}var d=!1,f,u,m=n===void 0?null:n;return[function(){return c(e())},m===null?void 0:function(){return c(m())}]},[e,n,r,i]);var l=pm(t,s[0],s[1]);return hm(function(){a.hasValue=!0,a.value=l},[l]),gm(l),l};Cu.exports=_u;var ym=Cu.exports;const vm=Ir(ym),ju={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},{useDebugValue:xm}=J,{useSyncExternalStoreWithSelector:bm}=vm;let fl=!1;const wm=t=>t;function Cm(t,e=wm,n){(ju?"production":void 0)!=="production"&&n&&!fl&&(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"),fl=!0);const r=bm(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return xm(r),r}const hl=t=>{(ju?"production":void 0)!=="production"&&typeof t!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e=typeof t=="function"?Jh(t):t,n=(r,i)=>Cm(e,r,i);return Object.assign(n,e),n},_m=t=>t?hl(t):hl,G=_m(t=>({widget:null,open:localStorage.getItem("lc:widget:isHaveChat")==="true",isInputFocused:!1,isHaveChat:localStorage.getItem("lc:widget:isHaveChat")==="true",minimizedAssigneeName:null,defaultValues:{},soundPath:void 0,isTooltipVisible:!0,onTooltipClose:void 0,anyAdmin:!0,showActionButtons:!1,portalDetailOpen:!1,pendingInitialAgentMessage:null,setIsTooltipVisible:e=>t({isTooltipVisible:e}),setOnTooltipClose:e=>t({onTooltipClose:e}),setOpen:e=>{t({open:e})},setAnyAdmin:e=>t({anyAdmin:e}),setWidget:e=>t({widget:e}),setDefaultValues:e=>t({defaultValues:e}),setIsHaveChat:e=>{var n;if(t({isHaveChat:e}),localStorage.setItem("lc:widget:isHaveChat",e.toString()),!e){t({showActionButtons:!1,minimizedAssigneeName:null});const r=(n=G.getState().widget)==null?void 0:n.link_id;r&&localStorage.setItem(`${r}:showActionButtons`,"false")}},setMinimizedAssigneeName:e=>t({minimizedAssigneeName:e}),setSoundPath:e=>{t({soundPath:e})},onOpen:void 0,onClose:void 0,setOnOpen:e=>t({onOpen:e}),setOnClose:e=>t({onClose:e}),setIsInputFocused:e=>t({isInputFocused:e}),historyChat:null,setHistoryChat:e=>t({historyChat:e}),historyMessages:null,setHistoryMessages:e=>t({historyMessages:e}),showHistoryOnRegistration:!1,setShowHistoryOnRegistration:e=>t({showHistoryOnRegistration:e}),aiAgent:null,setAIAgent:e=>t(n=>{var i;const r=(i=n.widget)==null?void 0:i.link_id;return r&&yi(r,e,n.isAIAgentMode,n.aiAgentSessionId,n.humanNeedRequested),{aiAgent:e}}),isAIAgentMode:!1,setIsAIAgentMode:e=>t(n=>{var i;const r=(i=n.widget)==null?void 0:i.link_id;return r&&yi(r,n.aiAgent,e,n.aiAgentSessionId,n.humanNeedRequested),{isAIAgentMode:e}}),aiAgentSessionId:null,setAIAgentSessionId:e=>t(n=>{var i;const r=(i=n.widget)==null?void 0:i.link_id;return r&&yi(r,n.aiAgent,n.isAIAgentMode,e,n.humanNeedRequested),{aiAgentSessionId:e}}),humanNeedRequested:!1,setHumanNeedRequested:e=>t(n=>{var i;const r=(i=n.widget)==null?void 0:i.link_id;if(r){const s=`${r}:`;e?localStorage.setItem(`${s}${Ye.HumanNeedRequested}`,"true"):localStorage.removeItem(`${s}${Ye.HumanNeedRequested}`),n.aiAgent&&n.isAIAgentMode&&yi(r,n.aiAgent,n.isAIAgentMode,n.aiAgentSessionId,e)}return{humanNeedRequested:e}}),aiAgentMessages:[],setAIAgentMessages:e=>t(n=>({aiAgentMessages:typeof e=="function"?e(n.aiAgentMessages):e})),addAIAgentMessage:e=>t(n=>({aiAgentMessages:[...n.aiAgentMessages,e]})),clearAIAgentState:()=>t(e=>{var r;const n=(r=e.widget)==null?void 0:r.link_id;return n&&Ga(n),{aiAgent:null,isAIAgentMode:!1,aiAgentSessionId:null,humanNeedRequested:!1,aiAgentMessages:[],connectingToOperator:!1,showOperatorForm:!1,aiAgentRequestInFlight:!1}}),connectingToOperator:!1,setConnectingToOperator:e=>t({connectingToOperator:e}),showOperatorForm:!1,setShowOperatorForm:e=>t({showOperatorForm:e}),setShowActionButtons:e=>t(n=>{var i;const r=(i=n.widget)==null?void 0:i.link_id;return r&&localStorage.setItem(`${r}:showActionButtons`,e.toString()),{showActionButtons:e}}),aiAgentRequestInFlight:!1,setAIAgentRequestInFlight:e=>t({aiAgentRequestInFlight:e}),setPortalDetailOpen:e=>t({portalDetailOpen:e}),setPendingInitialAgentMessage:e=>t({pendingInitialAgentMessage:e})})),km=t=>({accessToken:localStorage.getItem(`${t}:${Ye.CustomerToken}`)||"",refreshToken:localStorage.getItem(`${t}:${Ye.CustomerRefreshToken}`)||""}),li=()=>{const{widget:t}=G();return t?km(t.link_id):null},Wn=t=>{if(!t)return{};const{accessToken:e,refreshToken:n}=t,r={};return e&&(r["X-Customer-Token"]=e),n&&(r["X-Customer-Refresh-Token"]=n),{...r}},fr=t=>{const e=document.cookie.split(";").find(n=>n.includes(t));return e?e.split("=")[1]:null},Sm=t=>Wr(Ye.DeviceId,t)||fr("device_id")||mn(t),Vn=(t,e)=>({...t,"X-Device-Id":Sm(e)});function da(t){return t&&typeof t=="object"&&"customer_token"in t&&"customer_refresh_token"in t}const Qa=()=>{const t=Yi();return qa({mutationFn:e=>_t(`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"})}),onSuccess:(e,n)=>{t.invalidateQueries({queryKey:["visitors","history",n.widget_id,n.device_id]})}})},jm=(t,e)=>_t(`clients/${t}/chats`,{headers:e}),Ti=(t,e)=>_t(`clients/${t}/chats`,{method:"DELETE",headers:e}),Em=(t,e,n,r)=>_t("review",{method:"POST",body:JSON.stringify({rating:t,comment:e||void 0}),headers:Vn(n??{},r)}),Tm=()=>{const t=li(),{widget:e}=G(),n=(e==null?void 0:e.link_id)??"";return qa({mutationFn:r=>Em(r.rating,r.comment,Wn(t),n)})},Am=t=>{const e=li(),{widget:n}=G(),r=(n==null?void 0:n.link_id)??"";return qa({mutationFn:i=>_t(`clients/${t}/chats/files`,{method:"POST",headers:Vn(Wn(e),r),body:Up({files:i},{arrayWithBracketAndIndex:!1,arrayWithBrackets:!1})})})};function Rm(t){return t&&typeof t=="object"&&"file_urls"in t}const Om=t=>{const e=`${Jc}/visitors/identify`,n=JSON.stringify(t);try{fetch(e,{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(e,r)}})}catch{if(navigator.sendBeacon){const r=new Blob([n],{type:"application/json"});navigator.sendBeacon(e,r)}}},Nm=(t,e,n)=>Jn({queryKey:["visitors","history",t,e],queryFn:async()=>{const r=`visitors/history?widget_id=${t}&device_id=${e}`,i=4;let s=await _t(r);for(let a=0;a<i-1;a++){const[,l]=s;if(l!==429)break;await new Promise(c=>setTimeout(c,Math.min(1e3*2**a,8e3))),s=await _t(r)}return s},enabled:!!t&&!!e&&((n==null?void 0:n.enabled)??!0)}),Im=(t,e,n)=>_t(`visitors/chats/${t}/messages?widget_id=${e}&device_id=${n}`),Eu=t=>["widgetAgent",t];async function Xa(t){const[e,n]=await Mm(t);if(n===204)return null;if(n===200&&e&&typeof e=="object"&&"id"in e&&"is_active"in e&&e.is_active)return e;throw new Error(`getWidgetAgent: ${n}`)}function Tu(t){return Jn({queryKey:Eu(t??""),queryFn:()=>Xa(t),enabled:!!t,retry:(e,n)=>(n instanceof Error?n.message:"").includes("429")?e<4:e<2,retryDelay:e=>Math.min(1e3*2**e,8e3),staleTime:5*60*1e3})}async function Mm(t){const[e,n]=await _t(`widgets/${t}/agent`);return n===204?[null,n]:[e,n]}function er(t){this._maxSize=t,this.clear()}er.prototype.clear=function(){this._size=0,this._values=Object.create(null)};er.prototype.get=function(t){return this._values[t]};er.prototype.set=function(t,e){return this._size>=this._maxSize&&this.clear(),t in this._values||this._size++,this._values[t]=e};var $m=/[^.^\]^[]+|(?=\[\]|\.\.)/g,Au=/^\d+$/,Dm=/^\d/,Fm=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,Pm=/^\s*(['"]?)(.*?)(\1)\s*$/,Ja=512,ml=new er(Ja),gl=new er(Ja),yl=new er(Ja),Kn={Cache:er,split:pa,normalizePath:Rs,setter:function(t){var e=Rs(t);return gl.get(t)||gl.set(t,function(r,i){for(var s=0,a=e.length,l=r;s<a-1;){var c=e[s];if(c==="__proto__"||c==="constructor"||c==="prototype")return r;l=l[e[s++]]}l[e[s]]=i})},getter:function(t,e){var n=Rs(t);return yl.get(t)||yl.set(t,function(i){for(var s=0,a=n.length;s<a;)if(i!=null||!e)i=i[n[s++]];else return;return i})},join:function(t){return t.reduce(function(e,n){return e+(Za(n)||Au.test(n)?"["+n+"]":(e?".":"")+n)},"")},forEach:function(t,e,n){Bm(Array.isArray(t)?t:pa(t),e,n)}};function Rs(t){return ml.get(t)||ml.set(t,pa(t).map(function(e){return e.replace(Pm,"$2")}))}function pa(t){return t.match($m)||[""]}function Bm(t,e,n){var r=t.length,i,s,a,l;for(s=0;s<r;s++)i=t[s],i&&(Hm(i)&&(i='"'+i+'"'),l=Za(i),a=!l&&/^\d+$/.test(i),e.call(n,i,l,a,s,t))}function Za(t){return typeof t=="string"&&t&&["'",'"'].indexOf(t.charAt(0))!==-1}function Lm(t){return t.match(Dm)&&!t.match(Au)}function zm(t){return Fm.test(t)}function Hm(t){return!Za(t)&&(Lm(t)||zm(t))}const Um=/[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,Zi=t=>t.match(Um)||[],es=t=>t[0].toUpperCase()+t.slice(1),eo=(t,e)=>Zi(t).join(e).toLowerCase(),Ru=t=>Zi(t).reduce((e,n)=>`${e}${e?n[0].toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()}`,""),qm=t=>es(Ru(t)),Wm=t=>eo(t,"_"),Vm=t=>eo(t,"-"),Km=t=>es(eo(t," ")),Ym=t=>Zi(t).map(es).join(" ");var Os={words:Zi,upperFirst:es,camelCase:Ru,pascalCase:qm,snakeCase:Wm,kebabCase:Vm,sentenceCase:Km,titleCase:Ym},to={exports:{}};to.exports=function(t){return Ou(Gm(t),t)};to.exports.array=Ou;function Ou(t,e){var n=t.length,r=new Array(n),i={},s=n,a=Qm(e),l=Xm(t);for(e.forEach(function(d){if(!l.has(d[0])||!l.has(d[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});s--;)i[s]||c(t[s],s,new Set);return r;function c(d,f,u){if(u.has(d)){var m;try{m=", node was:"+JSON.stringify(d)}catch{m=""}throw new Error("Cyclic dependency"+m)}if(!l.has(d))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(d));if(!i[f]){i[f]=!0;var h=a.get(d)||new Set;if(h=Array.from(h),f=h.length){u.add(d);do{var b=h[--f];c(b,l.get(b),u)}while(f);u.delete(d)}r[--n]=d}}}function Gm(t){for(var e=new Set,n=0,r=t.length;n<r;n++){var i=t[n];e.add(i[0]),e.add(i[1])}return Array.from(e)}function Qm(t){for(var e=new Map,n=0,r=t.length;n<r;n++){var i=t[n];e.has(i[0])||e.set(i[0],new Set),e.has(i[1])||e.set(i[1],new Set),e.get(i[0]).add(i[1])}return e}function Xm(t){for(var e=new Map,n=0,r=t.length;n<r;n++)e.set(t[n],n);return e}var Jm=to.exports;const Zm=Ir(Jm),eg=Object.prototype.toString,tg=Error.prototype.toString,ng=RegExp.prototype.toString,rg=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",ig=/^Symbol\((.*)\)(.*)$/;function sg(t){return t!=+t?"NaN":t===0&&1/t<0?"-0":""+t}function vl(t,e=!1){if(t==null||t===!0||t===!1)return""+t;const n=typeof t;if(n==="number")return sg(t);if(n==="string")return e?`"${t}"`:t;if(n==="function")return"[Function "+(t.name||"anonymous")+"]";if(n==="symbol")return rg.call(t).replace(ig,"Symbol($1)");const r=eg.call(t).slice(8,-1);return r==="Date"?isNaN(t.getTime())?""+t:t.toISOString(t):r==="Error"||t instanceof Error?"["+tg.call(t)+"]":r==="RegExp"?ng.call(t):null}function An(t,e){let n=vl(t,e);return n!==null?n:JSON.stringify(t,function(r,i){let s=vl(this[r],e);return s!==null?s:i},2)}function Nu(t){return t==null?[]:[].concat(t)}let Iu,Mu,$u,ag=/\$\{\s*(\w+)\s*\}/g;Iu=Symbol.toStringTag;class xl{constructor(e,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[Iu]="Error",this.name="ValidationError",this.value=n,this.path=r,this.type=i,this.errors=[],this.inner=[],Nu(e).forEach(s=>{if(Ct.isError(s)){this.errors.push(...s.errors);const a=s.inner.length?s.inner:[s];this.inner.push(...a)}else this.errors.push(s)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}Mu=Symbol.hasInstance;$u=Symbol.toStringTag;class Ct extends Error{static formatError(e,n){const r=n.label||n.path||"this";return n=Object.assign({},n,{path:r,originalPath:n.path}),typeof e=="string"?e.replace(ag,(i,s)=>An(n[s])):typeof e=="function"?e(n):e}static isError(e){return e&&e.name==="ValidationError"}constructor(e,n,r,i,s){const a=new xl(e,n,r,i);if(s)return a;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[$u]="Error",this.name=a.name,this.message=a.message,this.type=a.type,this.value=a.value,this.path=a.path,this.errors=a.errors,this.inner=a.inner,Error.captureStackTrace&&Error.captureStackTrace(this,Ct)}static[Mu](e){return xl[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}}let Xt={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:t,type:e,value:n,originalValue:r})=>{const i=r!=null&&r!==n?` (cast from the value \`${An(r,!0)}\`).`:".";return e!=="mixed"?`${t} must be a \`${e}\` type, but the final value was: \`${An(n,!0)}\``+i:`${t} must match the configured type. The validated value was: \`${An(n,!0)}\``+i}},vt={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"},og={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"},fa={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},lg={isValue:"${path} field must be ${value}"},Ai={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},cg={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"},ug={notType:t=>{const{path:e,value:n,spec:r}=t,i=r.types.length;if(Array.isArray(n)){if(n.length<i)return`${e} tuple value has too few items, expected a length of ${i} but got ${n.length} for value: \`${An(n,!0)}\``;if(n.length>i)return`${e} tuple value has too many items, expected a length of ${i} but got ${n.length} for value: \`${An(n,!0)}\``}return Ct.formatError(Xt.notType,t)}};Object.assign(Object.create(null),{mixed:Xt,string:vt,number:og,date:fa,object:Ai,array:cg,boolean:lg,tuple:ug});const no=t=>t&&t.__isYupSchema__;class Bi{static fromOptions(e,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,a=typeof r=="function"?r:(...l)=>l.every(c=>c===r);return new Bi(e,(l,c)=>{var d;let f=a(...l)?i:s;return(d=f==null?void 0:f(c))!=null?d:c})}constructor(e,n){this.fn=void 0,this.refs=e,this.refs=e,this.fn=n}resolve(e,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,e,n);if(i===void 0||i===e)return e;if(!no(i))throw new TypeError("conditions must return a schema object");return i.resolve(n)}}const vi={context:"$",value:"."};class tr{constructor(e,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 e!="string")throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),e==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===vi.context,this.isValue=this.key[0]===vi.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?vi.context:this.isValue?vi.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&Kn.getter(this.path,!0),this.map=n.map}getValue(e,n,r){let i=this.isContext?r:this.isValue?e:n;return this.getter&&(i=this.getter(i||{})),this.map&&(i=this.map(i)),i}cast(e,n){return this.getValue(e,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(e){return e&&e.__isYupRef}}tr.prototype.__isYupRef=!0;const Dn=t=>t==null;function cr(t){function e({value:n,path:r="",options:i,originalValue:s,schema:a},l,c){const{name:d,test:f,params:u,message:m,skipAbsent:h}=t;let{parent:b,context:C,abortEarly:y=a.spec.abortEarly,disableStackTrace:v=a.spec.disableStackTrace}=i;function E(T){return tr.isRef(T)?T.getValue(n,b,C):T}function I(T={}){const A=Object.assign({value:n,originalValue:s,label:a.spec.label,path:T.path||r,spec:a.spec,disableStackTrace:T.disableStackTrace||v},u,T.params);for(const D of Object.keys(A))A[D]=E(A[D]);const B=new Ct(Ct.formatError(T.message||m,A),n,A.path,T.type||d,A.disableStackTrace);return B.params=A,B}const _=y?l:c;let L={path:r,parent:b,type:d,from:i.from,createError:I,resolve:E,options:i,originalValue:s,schema:a};const w=T=>{Ct.isError(T)?_(T):T?c(null):_(I())},$=T=>{Ct.isError(T)?_(T):l(T)};if(h&&Dn(n))return w(!0);let q;try{var F;if(q=f.call(L,n,L),typeof((F=q)==null?void 0:F.then)=="function"){if(i.sync)throw new Error(`Validation test of type: "${L.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(q).then(w,$)}}catch(T){$(T);return}w(q)}return e.OPTIONS=t,e}function dg(t,e,n,r=n){let i,s,a;return e?(Kn.forEach(e,(l,c,d)=>{let f=c?l.slice(1,l.length-1):l;t=t.resolve({context:r,parent:i,value:n});let u=t.type==="tuple",m=d?parseInt(f,10):0;if(t.innerType||u){if(u&&!d)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${a}" must contain an index to the tuple element, e.g. "${a}[0]"`);if(n&&m>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${l}, in the path: ${e}. because there is no value at that index. `);i=n,n=n&&n[m],t=u?t.spec.types[m]:t.innerType}if(!d){if(!t.fields||!t.fields[f])throw new Error(`The schema does not contain the path: ${e}. (failed at: ${a} which is a type: "${t.type}")`);i=n,n=n&&n[f],t=t.fields[f]}s=f,a=c?"["+l+"]":"."+l}),{schema:t,parent:i,parentPath:s}):{parent:i,parentPath:e,schema:t}}class Li extends Set{describe(){const e=[];for(const n of this.values())e.push(tr.isRef(n)?n.describe():n);return e}resolveAll(e){let n=[];for(const r of this.values())n.push(e(r));return n}clone(){return new Li(this.values())}merge(e,n){const r=this.clone();return e.forEach(i=>r.add(i)),n.forEach(i=>r.delete(i)),r}}function ur(t,e=new Map){if(no(t)||!t||typeof t!="object")return t;if(e.has(t))return e.get(t);let n;if(t instanceof Date)n=new Date(t.getTime()),e.set(t,n);else if(t instanceof RegExp)n=new RegExp(t),e.set(t,n);else if(Array.isArray(t)){n=new Array(t.length),e.set(t,n);for(let r=0;r<t.length;r++)n[r]=ur(t[r],e)}else if(t instanceof Map){n=new Map,e.set(t,n);for(const[r,i]of t.entries())n.set(r,ur(i,e))}else if(t instanceof Set){n=new Set,e.set(t,n);for(const r of t)n.add(ur(r,e))}else if(t instanceof Object){n={},e.set(t,n);for(const[r,i]of Object.entries(t))n[r]=ur(i,e)}else throw Error(`Unable to clone ${t}`);return n}class sn{constructor(e){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 Li,this._blacklist=new Li,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Xt.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},e==null?void 0:e.spec),this.withMutation(n=>{n.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),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=ur(Object.assign({},this.spec,e)),n}label(e){let n=this.clone();return n.spec.label=e,n}meta(...e){if(e.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},e[0]),n}withMutation(e){let n=this._mutate;this._mutate=!0;let r=e(this);return this._mutate=n,r}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let n=this,r=e.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(e._whitelist,e._blacklist),r._blacklist=n._blacklist.merge(e._blacklist,e._whitelist),r.tests=n.tests,r.exclusiveTests=n.exclusiveTests,r.withMutation(s=>{e.tests.forEach(a=>{s.test(a.OPTIONS)})}),r.transforms=[...n.transforms,...r.transforms],r}isType(e){return e==null?!!(this.spec.nullable&&e===null||this.spec.optional&&e===void 0):this._typeCheck(e)}resolve(e){let n=this;if(n.conditions.length){let r=n.conditions;n=n.clone(),n.conditions=[],n=r.reduce((i,s)=>s.resolve(i,e),n),n=n.resolve(e)}return n}resolveOptions(e){var n,r,i,s;return Object.assign({},e,{from:e.from||[],strict:(n=e.strict)!=null?n:this.spec.strict,abortEarly:(r=e.abortEarly)!=null?r:this.spec.abortEarly,recursive:(i=e.recursive)!=null?i:this.spec.recursive,disableStackTrace:(s=e.disableStackTrace)!=null?s:this.spec.disableStackTrace})}cast(e,n={}){let r=this.resolve(Object.assign({value:e},n)),i=n.assert==="ignore-optionality",s=r._cast(e,n);if(n.assert!==!1&&!r.isType(s)){if(i&&Dn(s))return s;let a=An(e),l=An(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
36
|
|
|
88
|
-
attempted value: ${
|
|
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=b=>{i||(i=!0,n(b,o))},u=b=>{i||(i=!0,r(b,o))},p=s.length,h=[];if(!p)return u([]);let y={value:o,originalValue:a,path:l,options:c,schema:this};for(let b=0;b<s.length;b++){const C=s[b];C(y,d,function(m){m&&(Array.isArray(m)?h.push(...m):h.push(m)),--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)=>{Kt.isError(l)&&(l.value=c),a(l)},(l,c)=>{l.length?a(new Kt(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 Kt.isError(a)&&(a.value=l),a},(a,l)=>{if(a.length)throw new Kt(a,t,void 0,void 0,o);s=l}),s}isValid(t,n){return this.validate(t,n).then(()=>!0,r=>{if(Kt.isError(r))return!1;throw r})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(r){if(Kt.isError(r))return!1;throw r}}_getDefault(t){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,t):Ws(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=Es({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=Es({message:n,name:"optionality",test(i){return i===void 0?this.schema.spec.optional:!0}}),r}optional(){return this.optionality(!0)}defined(t=nr.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=nr.notNull){return this.nullability(!1,t)}required(t=nr.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=nr.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),i=Es(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=BS(t).map(s=>new ys(s));return i.forEach(s=>{s.isSibling&&r.deps.push(s.key)}),r.conditions.push(typeof n=="function"?new su(i,n):su.fromOptions(i,n)),r}typeError(t){let n=this.clone();return n.internalTests.typeError=Es({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=nr.oneOf){let r=this.clone();return t.forEach(i=>{r._whitelist.add(i),r._blacklist.delete(i)}),r.internalTests.whiteList=Es({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=nr.notOneOf){let r=this.clone();return t.forEach(i=>{r._blacklist.add(i),r._whitelist.delete(i)}),r.internalTests.blacklist=Es({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)}}}gr.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])gr.prototype[`${e}At`]=function(t,n,r={}){const{parent:i,parentPath:s,schema:o}=b4(this,t,n,r.context);return o[e](i&&i[s],Object.assign({},r,{parent:i,path:t}))};for(const e of["equals","is"])gr.prototype[e]=gr.prototype.oneOf;for(const e of["not","nope"])gr.prototype[e]=gr.prototype.notOneOf;const C4=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function S4(e){const t=Jp(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 Jp(e){var t,n;const r=C4.exec(e);return r?{year:br(r[1]),month:br(r[2],1)-1,day:br(r[3],1),hour:br(r[4]),minute:br(r[5]),second:br(r[6]),millisecond:r[7]?br(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:br(r[10]),minuteOffset:br(r[11])}:null}function br(e,t=0){return Number(e)||t}let k4=/^[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])?)*$/,_4=/^((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,T4=/^(?:[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,E4="^\\d{4}-\\d{2}-\\d{2}",A4="\\d{2}:\\d{2}:\\d{2}",j4="(([+-]\\d{2}(:?\\d{2})?)|Z)",R4=new RegExp(`${E4}T${A4}(\\.\\d+)?${j4}$`),M4=e=>Ui(e)||e===e.trim(),P4={}.toString();function au(){return new US}class US extends gr{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===P4?t:i})})}required(t){return super.required(t).withMutation(n=>n.test({message:t||nr.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=Wt.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=Wt.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=Wt.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||Wt.matches,params:{regex:t},skipAbsent:!0,test:o=>o===""&&r||o.search(t)!==-1})}email(t=Wt.email){return this.matches(k4,{name:"email",message:t,excludeEmptyString:!0})}url(t=Wt.url){return this.matches(_4,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=Wt.uuid){return this.matches(T4,{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(R4,{name:"datetime",message:n||Wt.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||Wt.datetime_offset,params:{allowOffset:r},skipAbsent:!0,test:s=>{if(!s||r)return!0;const o=Jp(s);return o?!!o.z:!1}}).test({name:"datetime_precision",message:n||Wt.datetime_precision,params:{precision:i},skipAbsent:!0,test:s=>{if(!s||i==null)return!0;const o=Jp(s);return o?o.precision===i:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=Wt.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:M4})}lowercase(t=Wt.lowercase){return this.transform(n=>Ui(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Ui(n)||n===n.toLowerCase()})}uppercase(t=Wt.uppercase){return this.transform(n=>Ui(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Ui(n)||n===n.toUpperCase()})}}au.prototype=US.prototype;let N4=new Date(""),O4=e=>Object.prototype.toString.call(e)==="[object Date]";class Uu extends gr{constructor(){super({type:"date",check(t){return O4(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,n,r)=>!r.spec.coerce||r.isType(t)||t===null?t:(t=S4(t),isNaN(t)?Uu.INVALID_DATE:new Date(t)))})}prepareParam(t,n){let r;if(ys.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=Zp.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=Zp.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)}})}}Uu.INVALID_DATE=N4;Uu.prototype;function D4(e,t=[]){let n=[],r=new Set,i=new Set(t.map(([o,a])=>`${o}-${a}`));function s(o,a){let l=rs.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),ys.isRef(a)&&a.isSibling?s(a.path,o):mg(a)&&"deps"in a&&a.deps.forEach(l=>s(l,o))}return c4.array(Array.from(r),n).reverse()}function $y(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 HS(e){return(t,n)=>$y(e,t)-$y(e,n)}const I4=(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 xc(e){if("fields"in e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=xc(r);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=xc(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(xc)}):"optional"in e?e.optional():e}const L4=(e,t)=>{const n=[...rs.normalizePath(t)];if(n.length===1)return n[0]in e;let r=n.pop(),i=rs.getter(rs.join(n),!0)(e);return!!(i&&r in i)};let zy=e=>Object.prototype.toString.call(e)==="[object Object]";function Vy(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(r=>n.indexOf(r)===-1)}const F4=HS([]);function gg(e){return new WS(e)}class WS extends gr{constructor(t){super({type:"object",check(n){return zy(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=F4,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,b=i[u];c.path=(n.path?`${n.path}.`:"")+u,p=p.resolve({value:b,context:n.context,parent:l});let C=p instanceof gr?p.spec:void 0,g=C==null?void 0:C.strict;if(C!=null&&C.strip){d=d||u in i;continue}y=!n.__validating||!g?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||!zy(c)){i(l,c);return}o=o||c;let d=[];for(let u of this._nodes){let p=this.fields[u];!p||ys.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=D4(t,n),r._sortErrors=HS(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 xc(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=rs.getter(t,!0);return this.transform(s=>{if(!s)return s;let o=s;return L4(s,t)&&(o=Object.assign({},s),r||delete o[t],o[n]=i(s)),o})}json(){return this.transform(I4)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||yc.exact,test(n){if(n==null)return!0;const r=Vy(this.schema,n);return r.length===0||this.createError({params:{properties:r.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,n=yc.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=Vy(this.schema,i);return!t||s.length===0||this.createError({params:{unknown:s.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,n=yc.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(nf.camelCase)}snakeCase(){return this.transformKeys(nf.snakeCase)}constantCase(){return this.transformKeys(t=>nf.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}}gg.prototype=WS.prototype;var B4=function(t){return $4(t)&&!z4(t)};function $4(e){return!!e&&typeof e=="object"}function z4(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||H4(e)}var V4=typeof Symbol=="function"&&Symbol.for,U4=V4?Symbol.for("react.element"):60103;function H4(e){return e.$$typeof===U4}function W4(e){return Array.isArray(e)?[]:{}}function lu(e,t){return t.clone!==!1&&t.isMergeableObject(e)?el(W4(e),e,t):e}function q4(e,t,n){return e.concat(t).map(function(r){return lu(r,n)})}function G4(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(i){r[i]=lu(e[i],n)}),Object.keys(t).forEach(function(i){!n.isMergeableObject(t[i])||!e[i]?r[i]=lu(t[i],n):r[i]=el(e[i],t[i],n)}),r}function el(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||q4,n.isMergeableObject=n.isMergeableObject||B4;var r=Array.isArray(t),i=Array.isArray(e),s=r===i;return s?r?n.arrayMerge(e,t,n):G4(e,t,n):lu(t,n)}el.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,i){return el(r,i,n)},{})};var eh=el,qS=typeof global=="object"&&global&&global.Object===Object&&global,Y4=typeof self=="object"&&self&&self.Object===Object&&self,yr=qS||Y4||Function("return this")(),Si=yr.Symbol,GS=Object.prototype,Q4=GS.hasOwnProperty,K4=GS.toString,Xo=Si?Si.toStringTag:void 0;function X4(e){var t=Q4.call(e,Xo),n=e[Xo];try{e[Xo]=void 0;var r=!0}catch{}var i=K4.call(e);return r&&(t?e[Xo]=n:delete e[Xo]),i}var Z4=Object.prototype,J4=Z4.toString;function eN(e){return J4.call(e)}var tN="[object Null]",nN="[object Undefined]",Uy=Si?Si.toStringTag:void 0;function xs(e){return e==null?e===void 0?nN:tN:Uy&&Uy in Object(e)?X4(e):eN(e)}function YS(e,t){return function(n){return e(t(n))}}var vg=YS(Object.getPrototypeOf,Object);function ws(e){return e!=null&&typeof e=="object"}var rN="[object Object]",iN=Function.prototype,sN=Object.prototype,QS=iN.toString,oN=sN.hasOwnProperty,aN=QS.call(Object);function Hy(e){if(!ws(e)||xs(e)!=rN)return!1;var t=vg(e);if(t===null)return!0;var n=oN.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&QS.call(n)==aN}function lN(){this.__data__=[],this.size=0}function KS(e,t){return e===t||e!==e&&t!==t}function Hu(e,t){for(var n=e.length;n--;)if(KS(e[n][0],t))return n;return-1}var cN=Array.prototype,uN=cN.splice;function dN(e){var t=this.__data__,n=Hu(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():uN.call(t,n,1),--this.size,!0}function fN(e){var t=this.__data__,n=Hu(t,e);return n<0?void 0:t[n][1]}function pN(e){return Hu(this.__data__,e)>-1}function hN(e,t){var n=this.__data__,r=Hu(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function $r(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])}}$r.prototype.clear=lN;$r.prototype.delete=dN;$r.prototype.get=fN;$r.prototype.has=pN;$r.prototype.set=hN;function mN(){this.__data__=new $r,this.size=0}function gN(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function vN(e){return this.__data__.get(e)}function yN(e){return this.__data__.has(e)}function yl(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var xN="[object AsyncFunction]",wN="[object Function]",bN="[object GeneratorFunction]",CN="[object Proxy]";function XS(e){if(!yl(e))return!1;var t=xs(e);return t==wN||t==bN||t==xN||t==CN}var rf=yr["__core-js_shared__"],Wy=function(){var e=/[^.]+$/.exec(rf&&rf.keys&&rf.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function SN(e){return!!Wy&&Wy in e}var kN=Function.prototype,_N=kN.toString;function bs(e){if(e!=null){try{return _N.call(e)}catch{}try{return e+""}catch{}}return""}var TN=/[\\^$.*+?()[\]{}|]/g,EN=/^\[object .+?Constructor\]$/,AN=Function.prototype,jN=Object.prototype,RN=AN.toString,MN=jN.hasOwnProperty,PN=RegExp("^"+RN.call(MN).replace(TN,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function NN(e){if(!yl(e)||SN(e))return!1;var t=XS(e)?PN:EN;return t.test(bs(e))}function ON(e,t){return e==null?void 0:e[t]}function Cs(e,t){var n=ON(e,t);return NN(n)?n:void 0}var tl=Cs(yr,"Map"),nl=Cs(Object,"create");function DN(){this.__data__=nl?nl(null):{},this.size=0}function IN(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var LN="__lodash_hash_undefined__",FN=Object.prototype,BN=FN.hasOwnProperty;function $N(e){var t=this.__data__;if(nl){var n=t[e];return n===LN?void 0:n}return BN.call(t,e)?t[e]:void 0}var zN=Object.prototype,VN=zN.hasOwnProperty;function UN(e){var t=this.__data__;return nl?t[e]!==void 0:VN.call(t,e)}var HN="__lodash_hash_undefined__";function WN(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=nl&&t===void 0?HN:t,this}function fs(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])}}fs.prototype.clear=DN;fs.prototype.delete=IN;fs.prototype.get=$N;fs.prototype.has=UN;fs.prototype.set=WN;function qN(){this.size=0,this.__data__={hash:new fs,map:new(tl||$r),string:new fs}}function GN(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Wu(e,t){var n=e.__data__;return GN(t)?n[typeof t=="string"?"string":"hash"]:n.map}function YN(e){var t=Wu(this,e).delete(e);return this.size-=t?1:0,t}function QN(e){return Wu(this,e).get(e)}function KN(e){return Wu(this,e).has(e)}function XN(e,t){var n=Wu(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Ai(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])}}Ai.prototype.clear=qN;Ai.prototype.delete=YN;Ai.prototype.get=QN;Ai.prototype.has=KN;Ai.prototype.set=XN;var ZN=200;function JN(e,t){var n=this.__data__;if(n instanceof $r){var r=n.__data__;if(!tl||r.length<ZN-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ai(r)}return n.set(e,t),this.size=n.size,this}function Fo(e){var t=this.__data__=new $r(e);this.size=t.size}Fo.prototype.clear=mN;Fo.prototype.delete=gN;Fo.prototype.get=vN;Fo.prototype.has=yN;Fo.prototype.set=JN;function eO(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var qy=function(){try{var e=Cs(Object,"defineProperty");return e({},"",{}),e}catch{}}();function ZS(e,t,n){t=="__proto__"&&qy?qy(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var tO=Object.prototype,nO=tO.hasOwnProperty;function JS(e,t,n){var r=e[t];(!(nO.call(e,t)&&KS(r,n))||n===void 0&&!(t in e))&&ZS(e,t,n)}function qu(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?ZS(n,a,l):JS(n,a,l)}return n}function rO(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var iO="[object Arguments]";function Gy(e){return ws(e)&&xs(e)==iO}var ek=Object.prototype,sO=ek.hasOwnProperty,oO=ek.propertyIsEnumerable,aO=Gy(function(){return arguments}())?Gy:function(e){return ws(e)&&sO.call(e,"callee")&&!oO.call(e,"callee")},xl=Array.isArray;function lO(){return!1}var tk=typeof cn=="object"&&cn&&!cn.nodeType&&cn,Yy=tk&&typeof un=="object"&&un&&!un.nodeType&&un,cO=Yy&&Yy.exports===tk,Qy=cO?yr.Buffer:void 0,uO=Qy?Qy.isBuffer:void 0,nk=uO||lO,dO=9007199254740991,fO=/^(?:0|[1-9]\d*)$/;function pO(e,t){var n=typeof e;return t=t??dO,!!t&&(n=="number"||n!="symbol"&&fO.test(e))&&e>-1&&e%1==0&&e<t}var hO=9007199254740991;function rk(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=hO}var mO="[object Arguments]",gO="[object Array]",vO="[object Boolean]",yO="[object Date]",xO="[object Error]",wO="[object Function]",bO="[object Map]",CO="[object Number]",SO="[object Object]",kO="[object RegExp]",_O="[object Set]",TO="[object String]",EO="[object WeakMap]",AO="[object ArrayBuffer]",jO="[object DataView]",RO="[object Float32Array]",MO="[object Float64Array]",PO="[object Int8Array]",NO="[object Int16Array]",OO="[object Int32Array]",DO="[object Uint8Array]",IO="[object Uint8ClampedArray]",LO="[object Uint16Array]",FO="[object Uint32Array]",qe={};qe[RO]=qe[MO]=qe[PO]=qe[NO]=qe[OO]=qe[DO]=qe[IO]=qe[LO]=qe[FO]=!0;qe[mO]=qe[gO]=qe[AO]=qe[vO]=qe[jO]=qe[yO]=qe[xO]=qe[wO]=qe[bO]=qe[CO]=qe[SO]=qe[kO]=qe[_O]=qe[TO]=qe[EO]=!1;function BO(e){return ws(e)&&rk(e.length)&&!!qe[xs(e)]}function yg(e){return function(t){return e(t)}}var ik=typeof cn=="object"&&cn&&!cn.nodeType&&cn,ka=ik&&typeof un=="object"&&un&&!un.nodeType&&un,$O=ka&&ka.exports===ik,sf=$O&&qS.process,To=function(){try{var e=ka&&ka.require&&ka.require("util").types;return e||sf&&sf.binding&&sf.binding("util")}catch{}}(),Ky=To&&To.isTypedArray,zO=Ky?yg(Ky):BO,VO=Object.prototype,UO=VO.hasOwnProperty;function sk(e,t){var n=xl(e),r=!n&&aO(e),i=!n&&!r&&nk(e),s=!n&&!r&&!i&&zO(e),o=n||r||i||s,a=o?rO(e.length,String):[],l=a.length;for(var c in e)(t||UO.call(e,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||pO(c,l)))&&a.push(c);return a}var HO=Object.prototype;function xg(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||HO;return e===n}var WO=YS(Object.keys,Object),qO=Object.prototype,GO=qO.hasOwnProperty;function YO(e){if(!xg(e))return WO(e);var t=[];for(var n in Object(e))GO.call(e,n)&&n!="constructor"&&t.push(n);return t}function ok(e){return e!=null&&rk(e.length)&&!XS(e)}function wg(e){return ok(e)?sk(e):YO(e)}function QO(e,t){return e&&qu(t,wg(t),e)}function KO(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var XO=Object.prototype,ZO=XO.hasOwnProperty;function JO(e){if(!yl(e))return KO(e);var t=xg(e),n=[];for(var r in e)r=="constructor"&&(t||!ZO.call(e,r))||n.push(r);return n}function bg(e){return ok(e)?sk(e,!0):JO(e)}function eD(e,t){return e&&qu(t,bg(t),e)}var ak=typeof cn=="object"&&cn&&!cn.nodeType&&cn,Xy=ak&&typeof un=="object"&&un&&!un.nodeType&&un,tD=Xy&&Xy.exports===ak,Zy=tD?yr.Buffer:void 0,Jy=Zy?Zy.allocUnsafe:void 0;function nD(e,t){if(t)return e.slice();var n=e.length,r=Jy?Jy(n):new e.constructor(n);return e.copy(r),r}function lk(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}function rD(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 ck(){return[]}var iD=Object.prototype,sD=iD.propertyIsEnumerable,ex=Object.getOwnPropertySymbols,Cg=ex?function(e){return e==null?[]:(e=Object(e),rD(ex(e),function(t){return sD.call(e,t)}))}:ck;function oD(e,t){return qu(e,Cg(e),t)}function uk(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var aD=Object.getOwnPropertySymbols,dk=aD?function(e){for(var t=[];e;)uk(t,Cg(e)),e=vg(e);return t}:ck;function lD(e,t){return qu(e,dk(e),t)}function fk(e,t,n){var r=t(e);return xl(e)?r:uk(r,n(e))}function cD(e){return fk(e,wg,Cg)}function uD(e){return fk(e,bg,dk)}var th=Cs(yr,"DataView"),nh=Cs(yr,"Promise"),rh=Cs(yr,"Set"),ih=Cs(yr,"WeakMap"),tx="[object Map]",dD="[object Object]",nx="[object Promise]",rx="[object Set]",ix="[object WeakMap]",sx="[object DataView]",fD=bs(th),pD=bs(tl),hD=bs(nh),mD=bs(rh),gD=bs(ih),_r=xs;(th&&_r(new th(new ArrayBuffer(1)))!=sx||tl&&_r(new tl)!=tx||nh&&_r(nh.resolve())!=nx||rh&&_r(new rh)!=rx||ih&&_r(new ih)!=ix)&&(_r=function(e){var t=xs(e),n=t==dD?e.constructor:void 0,r=n?bs(n):"";if(r)switch(r){case fD:return sx;case pD:return tx;case hD:return nx;case mD:return rx;case gD:return ix}return t});var vD=Object.prototype,yD=vD.hasOwnProperty;function xD(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&yD.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var ox=yr.Uint8Array;function Sg(e){var t=new e.constructor(e.byteLength);return new ox(t).set(new ox(e)),t}function wD(e,t){var n=t?Sg(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var bD=/\w*$/;function CD(e){var t=new e.constructor(e.source,bD.exec(e));return t.lastIndex=e.lastIndex,t}var ax=Si?Si.prototype:void 0,lx=ax?ax.valueOf:void 0;function SD(e){return lx?Object(lx.call(e)):{}}function kD(e,t){var n=t?Sg(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var _D="[object Boolean]",TD="[object Date]",ED="[object Map]",AD="[object Number]",jD="[object RegExp]",RD="[object Set]",MD="[object String]",PD="[object Symbol]",ND="[object ArrayBuffer]",OD="[object DataView]",DD="[object Float32Array]",ID="[object Float64Array]",LD="[object Int8Array]",FD="[object Int16Array]",BD="[object Int32Array]",$D="[object Uint8Array]",zD="[object Uint8ClampedArray]",VD="[object Uint16Array]",UD="[object Uint32Array]";function HD(e,t,n){var r=e.constructor;switch(t){case ND:return Sg(e);case _D:case TD:return new r(+e);case OD:return wD(e,n);case DD:case ID:case LD:case FD:case BD:case $D:case zD:case VD:case UD:return kD(e,n);case ED:return new r;case AD:case MD:return new r(e);case jD:return CD(e);case RD:return new r;case PD:return SD(e)}}var cx=Object.create,WD=function(){function e(){}return function(t){if(!yl(t))return{};if(cx)return cx(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function qD(e){return typeof e.constructor=="function"&&!xg(e)?WD(vg(e)):{}}var GD="[object Map]";function YD(e){return ws(e)&&_r(e)==GD}var ux=To&&To.isMap,QD=ux?yg(ux):YD,KD="[object Set]";function XD(e){return ws(e)&&_r(e)==KD}var dx=To&&To.isSet,ZD=dx?yg(dx):XD,JD=1,eI=2,tI=4,pk="[object Arguments]",nI="[object Array]",rI="[object Boolean]",iI="[object Date]",sI="[object Error]",hk="[object Function]",oI="[object GeneratorFunction]",aI="[object Map]",lI="[object Number]",mk="[object Object]",cI="[object RegExp]",uI="[object Set]",dI="[object String]",fI="[object Symbol]",pI="[object WeakMap]",hI="[object ArrayBuffer]",mI="[object DataView]",gI="[object Float32Array]",vI="[object Float64Array]",yI="[object Int8Array]",xI="[object Int16Array]",wI="[object Int32Array]",bI="[object Uint8Array]",CI="[object Uint8ClampedArray]",SI="[object Uint16Array]",kI="[object Uint32Array]",ze={};ze[pk]=ze[nI]=ze[hI]=ze[mI]=ze[rI]=ze[iI]=ze[gI]=ze[vI]=ze[yI]=ze[xI]=ze[wI]=ze[aI]=ze[lI]=ze[mk]=ze[cI]=ze[uI]=ze[dI]=ze[fI]=ze[bI]=ze[CI]=ze[SI]=ze[kI]=!0;ze[sI]=ze[hk]=ze[pI]=!1;function _a(e,t,n,r,i,s){var o,a=t&JD,l=t&eI,c=t&tI;if(o!==void 0)return o;if(!yl(e))return e;var d=xl(e);if(d){if(o=xD(e),!a)return lk(e,o)}else{var u=_r(e),p=u==hk||u==oI;if(nk(e))return nD(e,a);if(u==mk||u==pk||p&&!i){if(o=l||p?{}:qD(e),!a)return l?lD(e,eD(o,e)):oD(e,QO(o,e))}else{if(!ze[u])return i?e:{};o=HD(e,u,a)}}s||(s=new Fo);var h=s.get(e);if(h)return h;s.set(e,o),ZD(e)?e.forEach(function(C){o.add(_a(C,t,n,C,e,s))}):QD(e)&&e.forEach(function(C,g){o.set(g,_a(C,t,n,g,e,s))});var y=c?l?uD:cD:l?bg:wg,b=d?void 0:y(e);return eO(b||e,function(C,g){b&&(g=C,C=e[g]),JS(o,g,_a(C,t,n,g,e,s))}),o}var _I=1,TI=4;function Yl(e){return _a(e,_I|TI)}var fx=Array.isArray,px=Object.keys,EI=Object.prototype.hasOwnProperty,AI=typeof Element<"u";function sh(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=fx(e),r=fx(t),i,s,o;if(n&&r){if(s=e.length,s!=t.length)return!1;for(i=s;i--!==0;)if(!sh(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=px(e);if(s=u.length,s!==px(t).length)return!1;for(i=s;i--!==0;)if(!EI.call(t,u[i]))return!1;if(AI&&e instanceof Element&&t instanceof Element)return e===t;for(i=s;i--!==0;)if(o=u[i],!(o==="_owner"&&e.$$typeof)&&!sh(e[o],t[o]))return!1;return!0}return e!==e&&t!==t}var jI=function(t,n){try{return sh(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 Ii=Fr(jI);var RI=4;function hx(e){return _a(e,RI)}function gk(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 MI="[object Symbol]";function kg(e){return typeof e=="symbol"||ws(e)&&xs(e)==MI}var PI="Expected a function";function _g(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(PI);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(_g.Cache||Ai),n}_g.Cache=Ai;var NI=500;function OI(e){var t=_g(e,function(r){return n.size===NI&&n.clear(),r}),n=t.cache;return t}var DI=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,II=/\\(\\)?/g,LI=OI(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(DI,function(n,r,i,s){t.push(i?s.replace(II,"$1"):r||n)}),t}),FI=1/0;function BI(e){if(typeof e=="string"||kg(e))return e;var t=e+"";return t=="0"&&1/e==-FI?"-0":t}var $I=1/0,mx=Si?Si.prototype:void 0,gx=mx?mx.toString:void 0;function vk(e){if(typeof e=="string")return e;if(xl(e))return gk(e,vk)+"";if(kg(e))return gx?gx.call(e):"";var t=e+"";return t=="0"&&1/e==-$I?"-0":t}function zI(e){return e==null?"":vk(e)}function yk(e){return xl(e)?gk(e,BI):kg(e)?[e]:lk(LI(zI(e)))}var xk={exports:{}},Fe={};/** @license React v16.13.1
|
|
37
|
+
attempted value: ${a}
|
|
38
|
+
`+(l!==a?`result of cast: ${l}`:""))}return s}_cast(e,n){let r=e===void 0?e:this.transforms.reduce((i,s)=>s.call(this,i,e,this),e);return r===void 0&&(r=this.getDefault(n)),r}_validate(e,n={},r,i){let{path:s,originalValue:a=e,strict:l=this.spec.strict}=n,c=e;l||(c=this._cast(c,Object.assign({assert:!1},n)));let d=[];for(let f of Object.values(this.internalTests))f&&d.push(f);this.runTests({path:s,value:c,originalValue:a,options:n,tests:d},r,f=>{if(f.length)return i(f,c);this.runTests({path:s,value:c,originalValue:a,options:n,tests:this.tests},r,i)})}runTests(e,n,r){let i=!1,{tests:s,value:a,originalValue:l,path:c,options:d}=e,f=C=>{i||(i=!0,n(C,a))},u=C=>{i||(i=!0,r(C,a))},m=s.length,h=[];if(!m)return u([]);let b={value:a,originalValue:l,path:c,options:d,schema:this};for(let C=0;C<s.length;C++){const y=s[C];y(b,f,function(E){E&&(Array.isArray(E)?h.push(...E):h.push(E)),--m<=0&&u(h)})}}asNestedTest({key:e,index:n,parent:r,parentPath:i,originalParent:s,options:a}){const l=e??n;if(l==null)throw TypeError("Must include `key` or `index` for nested validations");const c=typeof l=="number";let d=r[l];const f=Object.assign({},a,{strict:!0,parent:r,value:d,originalValue:s[l],key:void 0,[c?"index":"key"]:l,path:c||l.includes(".")?`${i||""}[${c?l:`"${l}"`}]`:(i?`${i}.`:"")+e});return(u,m,h)=>this.resolve(f)._validate(d,f,m,h)}validate(e,n){var r;let i=this.resolve(Object.assign({},n,{value:e})),s=(r=n==null?void 0:n.disableStackTrace)!=null?r:i.spec.disableStackTrace;return new Promise((a,l)=>i._validate(e,n,(c,d)=>{Ct.isError(c)&&(c.value=d),l(c)},(c,d)=>{c.length?l(new Ct(c,d,void 0,void 0,s)):a(d)}))}validateSync(e,n){var r;let i=this.resolve(Object.assign({},n,{value:e})),s,a=(r=n==null?void 0:n.disableStackTrace)!=null?r:i.spec.disableStackTrace;return i._validate(e,Object.assign({},n,{sync:!0}),(l,c)=>{throw Ct.isError(l)&&(l.value=c),l},(l,c)=>{if(l.length)throw new Ct(l,e,void 0,void 0,a);s=c}),s}isValid(e,n){return this.validate(e,n).then(()=>!0,r=>{if(Ct.isError(r))return!1;throw r})}isValidSync(e,n){try{return this.validateSync(e,n),!0}catch(r){if(Ct.isError(r))return!1;throw r}}_getDefault(e){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,e):ur(n)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){return arguments.length===0?this._getDefault():this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,n){const r=this.clone({nullable:e});return r.internalTests.nullable=cr({message:n,name:"nullable",test(i){return i===null?this.schema.spec.nullable:!0}}),r}optionality(e,n){const r=this.clone({optional:e});return r.internalTests.optionality=cr({message:n,name:"optionality",test(i){return i===void 0?this.schema.spec.optional:!0}}),r}optional(){return this.optionality(!0)}defined(e=Xt.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=Xt.notNull){return this.nullability(!1,e)}required(e=Xt.required){return this.clone().withMutation(n=>n.nonNullable(e).defined(e))}notRequired(){return this.clone().withMutation(e=>e.nullable().optional())}transform(e){let n=this.clone();return n.transforms.push(e),n}test(...e){let n;if(e.length===1?typeof e[0]=="function"?n={test:e[0]}:n=e[0]:e.length===2?n={name:e[0],test:e[1]}:n={name:e[0],message:e[1],test:e[2]},n.message===void 0&&(n.message=Xt.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),i=cr(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(a=>!(a.OPTIONS.name===n.name&&(s||a.OPTIONS.test===i.OPTIONS.test))),r.tests.push(i),r}when(e,n){!Array.isArray(e)&&typeof e!="string"&&(n=e,e=".");let r=this.clone(),i=Nu(e).map(s=>new tr(s));return i.forEach(s=>{s.isSibling&&r.deps.push(s.key)}),r.conditions.push(typeof n=="function"?new Bi(i,n):Bi.fromOptions(i,n)),r}typeError(e){let n=this.clone();return n.internalTests.typeError=cr({message:e,name:"typeError",skipAbsent:!0,test(r){return this.schema._typeCheck(r)?!0:this.createError({params:{type:this.schema.type}})}}),n}oneOf(e,n=Xt.oneOf){let r=this.clone();return e.forEach(i=>{r._whitelist.add(i),r._blacklist.delete(i)}),r.internalTests.whiteList=cr({message:n,name:"oneOf",skipAbsent:!0,test(i){let s=this.schema._whitelist,a=s.resolveAll(this.resolve);return a.includes(i)?!0:this.createError({params:{values:Array.from(s).join(", "),resolved:a}})}}),r}notOneOf(e,n=Xt.notOneOf){let r=this.clone();return e.forEach(i=>{r._blacklist.add(i),r._whitelist.delete(i)}),r.internalTests.blacklist=cr({message:n,name:"notOneOf",test(i){let s=this.schema._blacklist,a=s.resolveAll(this.resolve);return a.includes(i)?this.createError({params:{values:Array.from(s).join(", "),resolved:a}}):!0}}),r}strip(e=!0){let n=this.clone();return n.spec.strip=e,n}describe(e){const n=(e?this.resolve(e):this).clone(),{label:r,meta:i,optional:s,nullable:a}=n.spec;return{meta:i,label:r,optional:s,nullable:a,default:n.getDefault(e),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.map(c=>({name:c.OPTIONS.name,params:c.OPTIONS.params})).filter((c,d,f)=>f.findIndex(u=>u.name===c.name)===d)}}}sn.prototype.__isYupSchema__=!0;for(const t of["validate","validateSync"])sn.prototype[`${t}At`]=function(e,n,r={}){const{parent:i,parentPath:s,schema:a}=dg(this,e,n,r.context);return a[t](i&&i[s],Object.assign({},r,{parent:i,path:e}))};for(const t of["equals","is"])sn.prototype[t]=sn.prototype.oneOf;for(const t of["not","nope"])sn.prototype[t]=sn.prototype.notOneOf;const pg=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function fg(t){const e=ha(t);if(!e)return Date.parse?Date.parse(t):Number.NaN;if(e.z===void 0&&e.plusMinus===void 0)return new Date(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond).valueOf();let n=0;return e.z!=="Z"&&e.plusMinus!==void 0&&(n=e.hourOffset*60+e.minuteOffset,e.plusMinus==="+"&&(n=0-n)),Date.UTC(e.year,e.month,e.day,e.hour,e.minute+n,e.second,e.millisecond)}function ha(t){var e,n;const r=pg.exec(t);return r?{year:un(r[1]),month:un(r[2],1)-1,day:un(r[3],1),hour:un(r[4]),minute:un(r[5]),second:un(r[6]),millisecond:r[7]?un(r[7].substring(0,3)):0,precision:(e=(n=r[7])==null?void 0:n.length)!=null?e:void 0,z:r[8]||void 0,plusMinus:r[9]||void 0,hourOffset:un(r[10]),minuteOffset:un(r[11])}:null}function un(t,e=0){return Number(t)||e}let hg=/^[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])?)*$/,mg=/^((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,gg=/^(?:[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,yg="^\\d{4}-\\d{2}-\\d{2}",vg="\\d{2}:\\d{2}:\\d{2}",xg="(([+-]\\d{2}(:?\\d{2})?)|Z)",bg=new RegExp(`${yg}T${vg}(\\.\\d+)?${xg}$`),wg=t=>Dn(t)||t===t.trim(),Cg={}.toString();function zi(){return new Du}class Du extends sn{constructor(){super({type:"string",check(e){return e instanceof String&&(e=e.valueOf()),typeof e=="string"}}),this.withMutation(()=>{this.transform((e,n,r)=>{if(!r.spec.coerce||r.isType(e)||Array.isArray(e))return e;const i=e!=null&&e.toString?e.toString():e;return i===Cg?e:i})})}required(e){return super.required(e).withMutation(n=>n.test({message:e||Xt.required,name:"required",skipAbsent:!0,test:r=>!!r.length}))}notRequired(){return super.notRequired().withMutation(e=>(e.tests=e.tests.filter(n=>n.OPTIONS.name!=="required"),e))}length(e,n=vt.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(r){return r.length===this.resolve(e)}})}min(e,n=vt.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(r){return r.length>=this.resolve(e)}})}max(e,n=vt.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:e},skipAbsent:!0,test(r){return r.length<=this.resolve(e)}})}matches(e,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||vt.matches,params:{regex:e},skipAbsent:!0,test:a=>a===""&&r||a.search(e)!==-1})}email(e=vt.email){return this.matches(hg,{name:"email",message:e,excludeEmptyString:!0})}url(e=vt.url){return this.matches(mg,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=vt.uuid){return this.matches(gg,{name:"uuid",message:e,excludeEmptyString:!1})}datetime(e){let n="",r,i;return e&&(typeof e=="object"?{message:n="",allowOffset:r=!1,precision:i=void 0}=e:n=e),this.matches(bg,{name:"datetime",message:n||vt.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||vt.datetime_offset,params:{allowOffset:r},skipAbsent:!0,test:s=>{if(!s||r)return!0;const a=ha(s);return a?!!a.z:!1}}).test({name:"datetime_precision",message:n||vt.datetime_precision,params:{precision:i},skipAbsent:!0,test:s=>{if(!s||i==null)return!0;const a=ha(s);return a?a.precision===i:!1}})}ensure(){return this.default("").transform(e=>e===null?"":e)}trim(e=vt.trim){return this.transform(n=>n!=null?n.trim():n).test({message:e,name:"trim",test:wg})}lowercase(e=vt.lowercase){return this.transform(n=>Dn(n)?n:n.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Dn(n)||n===n.toLowerCase()})}uppercase(e=vt.uppercase){return this.transform(n=>Dn(n)?n:n.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Dn(n)||n===n.toUpperCase()})}}zi.prototype=Du.prototype;let _g=new Date(""),kg=t=>Object.prototype.toString.call(t)==="[object Date]";class ts extends sn{constructor(){super({type:"date",check(e){return kg(e)&&!isNaN(e.getTime())}}),this.withMutation(()=>{this.transform((e,n,r)=>!r.spec.coerce||r.isType(e)||e===null?e:(e=fg(e),isNaN(e)?ts.INVALID_DATE:new Date(e)))})}prepareParam(e,n){let r;if(tr.isRef(e))r=e;else{let i=this.cast(e);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(e,n=fa.min){let r=this.prepareParam(e,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(i){return i>=this.resolve(r)}})}max(e,n=fa.max){let r=this.prepareParam(e,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(i){return i<=this.resolve(r)}})}}ts.INVALID_DATE=_g;ts.prototype;function Sg(t,e=[]){let n=[],r=new Set,i=new Set(e.map(([a,l])=>`${a}-${l}`));function s(a,l){let c=Kn.split(a)[0];r.add(c),i.has(`${l}-${c}`)||n.push([l,c])}for(const a of Object.keys(t)){let l=t[a];r.add(a),tr.isRef(l)&&l.isSibling?s(l.path,a):no(l)&&"deps"in l&&l.deps.forEach(c=>s(c,a))}return Zm.array(Array.from(r),n).reverse()}function bl(t,e){let n=1/0;return t.some((r,i)=>{var s;if((s=e.path)!=null&&s.includes(r))return n=i,!0}),n}function Fu(t){return(e,n)=>bl(t,e)-bl(t,n)}const jg=(t,e,n)=>{if(typeof t!="string")return t;let r=t;try{r=JSON.parse(t)}catch{}return n.isType(r)?r:t};function Ri(t){if("fields"in t){const e={};for(const[n,r]of Object.entries(t.fields))e[n]=Ri(r);return t.setFields(e)}if(t.type==="array"){const e=t.optional();return e.innerType&&(e.innerType=Ri(e.innerType)),e}return t.type==="tuple"?t.optional().clone({types:t.spec.types.map(Ri)}):"optional"in t?t.optional():t}const Eg=(t,e)=>{const n=[...Kn.normalizePath(e)];if(n.length===1)return n[0]in t;let r=n.pop(),i=Kn.getter(Kn.join(n),!0)(t);return!!(i&&r in i)};let wl=t=>Object.prototype.toString.call(t)==="[object Object]";function Cl(t,e){let n=Object.keys(t.fields);return Object.keys(e).filter(r=>n.indexOf(r)===-1)}const Tg=Fu([]);function ro(t){return new Pu(t)}class Pu extends sn{constructor(e){super({type:"object",check(n){return wl(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=Tg,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{e&&this.shape(e)})}_cast(e,n={}){var r;let i=super._cast(e,n);if(i===void 0)return this.getDefault(n);if(!this._typeCheck(i))return i;let s=this.fields,a=(r=n.stripUnknown)!=null?r:this.spec.noUnknown,l=[].concat(this._nodes,Object.keys(i).filter(u=>!this._nodes.includes(u))),c={},d=Object.assign({},n,{parent:c,__validating:n.__validating||!1}),f=!1;for(const u of l){let m=s[u],h=u in i;if(m){let b,C=i[u];d.path=(n.path?`${n.path}.`:"")+u,m=m.resolve({value:C,context:n.context,parent:c});let y=m instanceof sn?m.spec:void 0,v=y==null?void 0:y.strict;if(y!=null&&y.strip){f=f||u in i;continue}b=!n.__validating||!v?m.cast(i[u],d):i[u],b!==void 0&&(c[u]=b)}else h&&!a&&(c[u]=i[u]);(h!==u in c||c[u]!==i[u])&&(f=!0)}return f?c:i}_validate(e,n={},r,i){let{from:s=[],originalValue:a=e,recursive:l=this.spec.recursive}=n;n.from=[{schema:this,value:a},...s],n.__validating=!0,n.originalValue=a,super._validate(e,n,r,(c,d)=>{if(!l||!wl(d)){i(c,d);return}a=a||d;let f=[];for(let u of this._nodes){let m=this.fields[u];!m||tr.isRef(m)||f.push(m.asNestedTest({options:n,key:u,parent:d,parentPath:n.path,originalParent:a}))}this.runTests({tests:f,value:d,originalValue:a,options:n},r,u=>{i(u.sort(this._sortErrors).concat(c),d)})})}clone(e){const n=super.clone(e);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(e){let n=super.concat(e),r=n.fields;for(let[i,s]of Object.entries(this.fields)){const a=r[i];r[i]=a===void 0?s:a}return n.withMutation(i=>i.setFields(r,[...this._excludedEdges,...e._excludedEdges]))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let n={};return this._nodes.forEach(r=>{var i;const s=this.fields[r];let a=e;(i=a)!=null&&i.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[r]})),n[r]=s&&"getDefault"in s?s.getDefault(a):void 0}),n}setFields(e,n){let r=this.clone();return r.fields=e,r._nodes=Sg(e,n),r._sortErrors=Fu(Object.keys(e)),n&&(r._excludedEdges=n),r}shape(e,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,e),i)})}partial(){const e={};for(const[n,r]of Object.entries(this.fields))e[n]="optional"in r&&r.optional instanceof Function?r.optional():r;return this.setFields(e)}deepPartial(){return Ri(this)}pick(e){const n={};for(const r of e)this.fields[r]&&(n[r]=this.fields[r]);return this.setFields(n,this._excludedEdges.filter(([r,i])=>e.includes(r)&&e.includes(i)))}omit(e){const n=[];for(const r of Object.keys(this.fields))e.includes(r)||n.push(r);return this.pick(n)}from(e,n,r){let i=Kn.getter(e,!0);return this.transform(s=>{if(!s)return s;let a=s;return Eg(s,e)&&(a=Object.assign({},s),r||delete a[e],a[n]=i(s)),a})}json(){return this.transform(jg)}exact(e){return this.test({name:"exact",exclusive:!0,message:e||Ai.exact,test(n){if(n==null)return!0;const r=Cl(this.schema,n);return r.length===0||this.createError({params:{properties:r.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(e=!0,n=Ai.noUnknown){typeof e!="boolean"&&(n=e,e=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:n,test(i){if(i==null)return!0;const s=Cl(this.schema,i);return!e||s.length===0||this.createError({params:{unknown:s.join(", ")}})}});return r.spec.noUnknown=e,r}unknown(e=!0,n=Ai.noUnknown){return this.noUnknown(!e,n)}transformKeys(e){return this.transform(n=>{if(!n)return n;const r={};for(const i of Object.keys(n))r[e(i)]=n[i];return r})}camelCase(){return this.transformKeys(Os.camelCase)}snakeCase(){return this.transformKeys(Os.snakeCase)}constantCase(){return this.transformKeys(e=>Os.snakeCase(e).toUpperCase())}describe(e){const n=(e?this.resolve(e):this).clone(),r=super.describe(e);r.fields={};for(const[s,a]of Object.entries(n.fields)){var i;let l=e;(i=l)!=null&&i.value&&(l=Object.assign({},l,{parent:l.value,value:l.value[s]})),r.fields[s]=a.describe(l)}return r}}ro.prototype=Pu.prototype;var Ag=function(e){return Rg(e)&&!Og(e)};function Rg(t){return!!t&&typeof t=="object"}function Og(t){var e=Object.prototype.toString.call(t);return e==="[object RegExp]"||e==="[object Date]"||Mg(t)}var Ng=typeof Symbol=="function"&&Symbol.for,Ig=Ng?Symbol.for("react.element"):60103;function Mg(t){return t.$$typeof===Ig}function $g(t){return Array.isArray(t)?[]:{}}function Hi(t,e){return e.clone!==!1&&e.isMergeableObject(t)?ei($g(t),t,e):t}function Dg(t,e,n){return t.concat(e).map(function(r){return Hi(r,n)})}function Fg(t,e,n){var r={};return n.isMergeableObject(t)&&Object.keys(t).forEach(function(i){r[i]=Hi(t[i],n)}),Object.keys(e).forEach(function(i){!n.isMergeableObject(e[i])||!t[i]?r[i]=Hi(e[i],n):r[i]=ei(t[i],e[i],n)}),r}function ei(t,e,n){n=n||{},n.arrayMerge=n.arrayMerge||Dg,n.isMergeableObject=n.isMergeableObject||Ag;var r=Array.isArray(e),i=Array.isArray(t),s=r===i;return s?r?n.arrayMerge(t,e,n):Fg(t,e,n):Hi(e,n)}ei.all=function(e,n){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(r,i){return ei(r,i,n)},{})};var ma=ei,Bu=typeof global=="object"&&global&&global.Object===Object&&global,Pg=typeof self=="object"&&self&&self.Object===Object&&self,on=Bu||Pg||Function("return this")(),On=on.Symbol,Lu=Object.prototype,Bg=Lu.hasOwnProperty,Lg=Lu.toString,Hr=On?On.toStringTag:void 0;function zg(t){var e=Bg.call(t,Hr),n=t[Hr];try{t[Hr]=void 0;var r=!0}catch{}var i=Lg.call(t);return r&&(e?t[Hr]=n:delete t[Hr]),i}var Hg=Object.prototype,Ug=Hg.toString;function qg(t){return Ug.call(t)}var Wg="[object Null]",Vg="[object Undefined]",_l=On?On.toStringTag:void 0;function nr(t){return t==null?t===void 0?Vg:Wg:_l&&_l in Object(t)?zg(t):qg(t)}function zu(t,e){return function(n){return t(e(n))}}var io=zu(Object.getPrototypeOf,Object);function rr(t){return t!=null&&typeof t=="object"}var Kg="[object Object]",Yg=Function.prototype,Gg=Object.prototype,Hu=Yg.toString,Qg=Gg.hasOwnProperty,Xg=Hu.call(Object);function kl(t){if(!rr(t)||nr(t)!=Kg)return!1;var e=io(t);if(e===null)return!0;var n=Qg.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Hu.call(n)==Xg}function Jg(){this.__data__=[],this.size=0}function Uu(t,e){return t===e||t!==t&&e!==e}function ns(t,e){for(var n=t.length;n--;)if(Uu(t[n][0],e))return n;return-1}var Zg=Array.prototype,ey=Zg.splice;function ty(t){var e=this.__data__,n=ns(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():ey.call(e,n,1),--this.size,!0}function ny(t){var e=this.__data__,n=ns(e,t);return n<0?void 0:e[n][1]}function ry(t){return ns(this.__data__,t)>-1}function iy(t,e){var n=this.__data__,r=ns(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function yn(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}yn.prototype.clear=Jg;yn.prototype.delete=ty;yn.prototype.get=ny;yn.prototype.has=ry;yn.prototype.set=iy;function sy(){this.__data__=new yn,this.size=0}function ay(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function oy(t){return this.__data__.get(t)}function ly(t){return this.__data__.has(t)}function ci(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var cy="[object AsyncFunction]",uy="[object Function]",dy="[object GeneratorFunction]",py="[object Proxy]";function qu(t){if(!ci(t))return!1;var e=nr(t);return e==uy||e==dy||e==cy||e==py}var Ns=on["__core-js_shared__"],Sl=function(){var t=/[^.]+$/.exec(Ns&&Ns.keys&&Ns.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function fy(t){return!!Sl&&Sl in t}var hy=Function.prototype,my=hy.toString;function ir(t){if(t!=null){try{return my.call(t)}catch{}try{return t+""}catch{}}return""}var gy=/[\\^$.*+?()[\]{}|]/g,yy=/^\[object .+?Constructor\]$/,vy=Function.prototype,xy=Object.prototype,by=vy.toString,wy=xy.hasOwnProperty,Cy=RegExp("^"+by.call(wy).replace(gy,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function _y(t){if(!ci(t)||fy(t))return!1;var e=qu(t)?Cy:yy;return e.test(ir(t))}function ky(t,e){return t==null?void 0:t[e]}function sr(t,e){var n=ky(t,e);return _y(n)?n:void 0}var ti=sr(on,"Map"),ni=sr(Object,"create");function Sy(){this.__data__=ni?ni(null):{},this.size=0}function jy(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Ey="__lodash_hash_undefined__",Ty=Object.prototype,Ay=Ty.hasOwnProperty;function Ry(t){var e=this.__data__;if(ni){var n=e[t];return n===Ey?void 0:n}return Ay.call(e,t)?e[t]:void 0}var Oy=Object.prototype,Ny=Oy.hasOwnProperty;function Iy(t){var e=this.__data__;return ni?e[t]!==void 0:Ny.call(e,t)}var My="__lodash_hash_undefined__";function $y(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=ni&&e===void 0?My:e,this}function Xn(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Xn.prototype.clear=Sy;Xn.prototype.delete=jy;Xn.prototype.get=Ry;Xn.prototype.has=Iy;Xn.prototype.set=$y;function Dy(){this.size=0,this.__data__={hash:new Xn,map:new(ti||yn),string:new Xn}}function Fy(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function rs(t,e){var n=t.__data__;return Fy(e)?n[typeof e=="string"?"string":"hash"]:n.map}function Py(t){var e=rs(this,t).delete(t);return this.size-=e?1:0,e}function By(t){return rs(this,t).get(t)}function Ly(t){return rs(this,t).has(t)}function zy(t,e){var n=rs(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function Nn(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Nn.prototype.clear=Dy;Nn.prototype.delete=Py;Nn.prototype.get=By;Nn.prototype.has=Ly;Nn.prototype.set=zy;var Hy=200;function Uy(t,e){var n=this.__data__;if(n instanceof yn){var r=n.__data__;if(!ti||r.length<Hy-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Nn(r)}return n.set(t,e),this.size=n.size,this}function Fr(t){var e=this.__data__=new yn(t);this.size=e.size}Fr.prototype.clear=sy;Fr.prototype.delete=ay;Fr.prototype.get=oy;Fr.prototype.has=ly;Fr.prototype.set=Uy;function qy(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}var jl=function(){try{var t=sr(Object,"defineProperty");return t({},"",{}),t}catch{}}();function Wu(t,e,n){e=="__proto__"&&jl?jl(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var Wy=Object.prototype,Vy=Wy.hasOwnProperty;function Vu(t,e,n){var r=t[e];(!(Vy.call(t,e)&&Uu(r,n))||n===void 0&&!(e in t))&&Wu(t,e,n)}function is(t,e,n,r){var i=!n;n||(n={});for(var s=-1,a=e.length;++s<a;){var l=e[s],c=void 0;c===void 0&&(c=t[l]),i?Wu(n,l,c):Vu(n,l,c)}return n}function Ky(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var Yy="[object Arguments]";function El(t){return rr(t)&&nr(t)==Yy}var Ku=Object.prototype,Gy=Ku.hasOwnProperty,Qy=Ku.propertyIsEnumerable,Xy=El(function(){return arguments}())?El:function(t){return rr(t)&&Gy.call(t,"callee")&&!Qy.call(t,"callee")},ui=Array.isArray;function Jy(){return!1}var Yu=typeof Ot=="object"&&Ot&&!Ot.nodeType&&Ot,Tl=Yu&&typeof Nt=="object"&&Nt&&!Nt.nodeType&&Nt,Zy=Tl&&Tl.exports===Yu,Al=Zy?on.Buffer:void 0,ev=Al?Al.isBuffer:void 0,Gu=ev||Jy,tv=9007199254740991,nv=/^(?:0|[1-9]\d*)$/;function rv(t,e){var n=typeof t;return e=e??tv,!!e&&(n=="number"||n!="symbol"&&nv.test(t))&&t>-1&&t%1==0&&t<e}var iv=9007199254740991;function Qu(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=iv}var sv="[object Arguments]",av="[object Array]",ov="[object Boolean]",lv="[object Date]",cv="[object Error]",uv="[object Function]",dv="[object Map]",pv="[object Number]",fv="[object Object]",hv="[object RegExp]",mv="[object Set]",gv="[object String]",yv="[object WeakMap]",vv="[object ArrayBuffer]",xv="[object DataView]",bv="[object Float32Array]",wv="[object Float64Array]",Cv="[object Int8Array]",_v="[object Int16Array]",kv="[object Int32Array]",Sv="[object Uint8Array]",jv="[object Uint8ClampedArray]",Ev="[object Uint16Array]",Tv="[object Uint32Array]",ze={};ze[bv]=ze[wv]=ze[Cv]=ze[_v]=ze[kv]=ze[Sv]=ze[jv]=ze[Ev]=ze[Tv]=!0;ze[sv]=ze[av]=ze[vv]=ze[ov]=ze[xv]=ze[lv]=ze[cv]=ze[uv]=ze[dv]=ze[pv]=ze[fv]=ze[hv]=ze[mv]=ze[gv]=ze[yv]=!1;function Av(t){return rr(t)&&Qu(t.length)&&!!ze[nr(t)]}function so(t){return function(e){return t(e)}}var Xu=typeof Ot=="object"&&Ot&&!Ot.nodeType&&Ot,Qr=Xu&&typeof Nt=="object"&&Nt&&!Nt.nodeType&&Nt,Rv=Qr&&Qr.exports===Xu,Is=Rv&&Bu.process,Rr=function(){try{var t=Qr&&Qr.require&&Qr.require("util").types;return t||Is&&Is.binding&&Is.binding("util")}catch{}}(),Rl=Rr&&Rr.isTypedArray,Ov=Rl?so(Rl):Av,Nv=Object.prototype,Iv=Nv.hasOwnProperty;function Ju(t,e){var n=ui(t),r=!n&&Xy(t),i=!n&&!r&&Gu(t),s=!n&&!r&&!i&&Ov(t),a=n||r||i||s,l=a?Ky(t.length,String):[],c=l.length;for(var d in t)(e||Iv.call(t,d))&&!(a&&(d=="length"||i&&(d=="offset"||d=="parent")||s&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||rv(d,c)))&&l.push(d);return l}var Mv=Object.prototype;function ao(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||Mv;return t===n}var $v=zu(Object.keys,Object),Dv=Object.prototype,Fv=Dv.hasOwnProperty;function Pv(t){if(!ao(t))return $v(t);var e=[];for(var n in Object(t))Fv.call(t,n)&&n!="constructor"&&e.push(n);return e}function Zu(t){return t!=null&&Qu(t.length)&&!qu(t)}function oo(t){return Zu(t)?Ju(t):Pv(t)}function Bv(t,e){return t&&is(e,oo(e),t)}function Lv(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var zv=Object.prototype,Hv=zv.hasOwnProperty;function Uv(t){if(!ci(t))return Lv(t);var e=ao(t),n=[];for(var r in t)r=="constructor"&&(e||!Hv.call(t,r))||n.push(r);return n}function lo(t){return Zu(t)?Ju(t,!0):Uv(t)}function qv(t,e){return t&&is(e,lo(e),t)}var ed=typeof Ot=="object"&&Ot&&!Ot.nodeType&&Ot,Ol=ed&&typeof Nt=="object"&&Nt&&!Nt.nodeType&&Nt,Wv=Ol&&Ol.exports===ed,Nl=Wv?on.Buffer:void 0,Il=Nl?Nl.allocUnsafe:void 0;function Vv(t,e){if(e)return t.slice();var n=t.length,r=Il?Il(n):new t.constructor(n);return t.copy(r),r}function td(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}function Kv(t,e){for(var n=-1,r=t==null?0:t.length,i=0,s=[];++n<r;){var a=t[n];e(a,n,t)&&(s[i++]=a)}return s}function nd(){return[]}var Yv=Object.prototype,Gv=Yv.propertyIsEnumerable,Ml=Object.getOwnPropertySymbols,co=Ml?function(t){return t==null?[]:(t=Object(t),Kv(Ml(t),function(e){return Gv.call(t,e)}))}:nd;function Qv(t,e){return is(t,co(t),e)}function rd(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var Xv=Object.getOwnPropertySymbols,id=Xv?function(t){for(var e=[];t;)rd(e,co(t)),t=io(t);return e}:nd;function Jv(t,e){return is(t,id(t),e)}function sd(t,e,n){var r=e(t);return ui(t)?r:rd(r,n(t))}function Zv(t){return sd(t,oo,co)}function ex(t){return sd(t,lo,id)}var ga=sr(on,"DataView"),ya=sr(on,"Promise"),va=sr(on,"Set"),xa=sr(on,"WeakMap"),$l="[object Map]",tx="[object Object]",Dl="[object Promise]",Fl="[object Set]",Pl="[object WeakMap]",Bl="[object DataView]",nx=ir(ga),rx=ir(ti),ix=ir(ya),sx=ir(va),ax=ir(xa),pn=nr;(ga&&pn(new ga(new ArrayBuffer(1)))!=Bl||ti&&pn(new ti)!=$l||ya&&pn(ya.resolve())!=Dl||va&&pn(new va)!=Fl||xa&&pn(new xa)!=Pl)&&(pn=function(t){var e=nr(t),n=e==tx?t.constructor:void 0,r=n?ir(n):"";if(r)switch(r){case nx:return Bl;case rx:return $l;case ix:return Dl;case sx:return Fl;case ax:return Pl}return e});var ox=Object.prototype,lx=ox.hasOwnProperty;function cx(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&lx.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var Ll=on.Uint8Array;function uo(t){var e=new t.constructor(t.byteLength);return new Ll(e).set(new Ll(t)),e}function ux(t,e){var n=e?uo(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}var dx=/\w*$/;function px(t){var e=new t.constructor(t.source,dx.exec(t));return e.lastIndex=t.lastIndex,e}var zl=On?On.prototype:void 0,Hl=zl?zl.valueOf:void 0;function fx(t){return Hl?Object(Hl.call(t)):{}}function hx(t,e){var n=e?uo(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var mx="[object Boolean]",gx="[object Date]",yx="[object Map]",vx="[object Number]",xx="[object RegExp]",bx="[object Set]",wx="[object String]",Cx="[object Symbol]",_x="[object ArrayBuffer]",kx="[object DataView]",Sx="[object Float32Array]",jx="[object Float64Array]",Ex="[object Int8Array]",Tx="[object Int16Array]",Ax="[object Int32Array]",Rx="[object Uint8Array]",Ox="[object Uint8ClampedArray]",Nx="[object Uint16Array]",Ix="[object Uint32Array]";function Mx(t,e,n){var r=t.constructor;switch(e){case _x:return uo(t);case mx:case gx:return new r(+t);case kx:return ux(t,n);case Sx:case jx:case Ex:case Tx:case Ax:case Rx:case Ox:case Nx:case Ix:return hx(t,n);case yx:return new r;case vx:case wx:return new r(t);case xx:return px(t);case bx:return new r;case Cx:return fx(t)}}var Ul=Object.create,$x=function(){function t(){}return function(e){if(!ci(e))return{};if(Ul)return Ul(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function Dx(t){return typeof t.constructor=="function"&&!ao(t)?$x(io(t)):{}}var Fx="[object Map]";function Px(t){return rr(t)&&pn(t)==Fx}var ql=Rr&&Rr.isMap,Bx=ql?so(ql):Px,Lx="[object Set]";function zx(t){return rr(t)&&pn(t)==Lx}var Wl=Rr&&Rr.isSet,Hx=Wl?so(Wl):zx,Ux=1,qx=2,Wx=4,ad="[object Arguments]",Vx="[object Array]",Kx="[object Boolean]",Yx="[object Date]",Gx="[object Error]",od="[object Function]",Qx="[object GeneratorFunction]",Xx="[object Map]",Jx="[object Number]",ld="[object Object]",Zx="[object RegExp]",eb="[object Set]",tb="[object String]",nb="[object Symbol]",rb="[object WeakMap]",ib="[object ArrayBuffer]",sb="[object DataView]",ab="[object Float32Array]",ob="[object Float64Array]",lb="[object Int8Array]",cb="[object Int16Array]",ub="[object Int32Array]",db="[object Uint8Array]",pb="[object Uint8ClampedArray]",fb="[object Uint16Array]",hb="[object Uint32Array]",Be={};Be[ad]=Be[Vx]=Be[ib]=Be[sb]=Be[Kx]=Be[Yx]=Be[ab]=Be[ob]=Be[lb]=Be[cb]=Be[ub]=Be[Xx]=Be[Jx]=Be[ld]=Be[Zx]=Be[eb]=Be[tb]=Be[nb]=Be[db]=Be[pb]=Be[fb]=Be[hb]=!0;Be[Gx]=Be[od]=Be[rb]=!1;function Xr(t,e,n,r,i,s){var a,l=e&Ux,c=e&qx,d=e&Wx;if(a!==void 0)return a;if(!ci(t))return t;var f=ui(t);if(f){if(a=cx(t),!l)return td(t,a)}else{var u=pn(t),m=u==od||u==Qx;if(Gu(t))return Vv(t,l);if(u==ld||u==ad||m&&!i){if(a=c||m?{}:Dx(t),!l)return c?Jv(t,qv(a,t)):Qv(t,Bv(a,t))}else{if(!Be[u])return i?t:{};a=Mx(t,u,l)}}s||(s=new Fr);var h=s.get(t);if(h)return h;s.set(t,a),Hx(t)?t.forEach(function(y){a.add(Xr(y,e,n,y,t,s))}):Bx(t)&&t.forEach(function(y,v){a.set(v,Xr(y,e,n,v,t,s))});var b=d?c?ex:Zv:c?lo:oo,C=f?void 0:b(t);return qy(C||t,function(y,v){C&&(v=y,y=t[v]),Vu(a,v,Xr(y,e,n,v,t,s))}),a}var mb=1,gb=4;function xi(t){return Xr(t,mb|gb)}var Vl=Array.isArray,Kl=Object.keys,yb=Object.prototype.hasOwnProperty,vb=typeof Element<"u";function ba(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){var n=Vl(t),r=Vl(e),i,s,a;if(n&&r){if(s=t.length,s!=e.length)return!1;for(i=s;i--!==0;)if(!ba(t[i],e[i]))return!1;return!0}if(n!=r)return!1;var l=t instanceof Date,c=e instanceof Date;if(l!=c)return!1;if(l&&c)return t.getTime()==e.getTime();var d=t instanceof RegExp,f=e instanceof RegExp;if(d!=f)return!1;if(d&&f)return t.toString()==e.toString();var u=Kl(t);if(s=u.length,s!==Kl(e).length)return!1;for(i=s;i--!==0;)if(!yb.call(e,u[i]))return!1;if(vb&&t instanceof Element&&e instanceof Element)return t===e;for(i=s;i--!==0;)if(a=u[i],!(a==="_owner"&&t.$$typeof)&&!ba(t[a],e[a]))return!1;return!0}return t!==t&&e!==e}var xb=function(e,n){try{return ba(e,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 Mn=Ir(xb);var bb=4;function Yl(t){return Xr(t,bb)}function cd(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var wb="[object Symbol]";function po(t){return typeof t=="symbol"||rr(t)&&nr(t)==wb}var Cb="Expected a function";function fo(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Cb);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var a=t.apply(this,r);return n.cache=s.set(i,a)||s,a};return n.cache=new(fo.Cache||Nn),n}fo.Cache=Nn;var _b=500;function kb(t){var e=fo(t,function(r){return n.size===_b&&n.clear(),r}),n=e.cache;return e}var Sb=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,jb=/\\(\\)?/g,Eb=kb(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Sb,function(n,r,i,s){e.push(i?s.replace(jb,"$1"):r||n)}),e}),Tb=1/0;function Ab(t){if(typeof t=="string"||po(t))return t;var e=t+"";return e=="0"&&1/t==-Tb?"-0":e}var Rb=1/0,Gl=On?On.prototype:void 0,Ql=Gl?Gl.toString:void 0;function ud(t){if(typeof t=="string")return t;if(ui(t))return cd(t,ud)+"";if(po(t))return Ql?Ql.call(t):"";var e=t+"";return e=="0"&&1/t==-Rb?"-0":e}function Ob(t){return t==null?"":ud(t)}function dd(t){return ui(t)?cd(t,Ab):po(t)?[t]:td(Eb(Ob(t)))}var pd={exports:{}},De={};/** @license React v16.13.1
|
|
90
39
|
* react-is.production.min.js
|
|
91
40
|
*
|
|
92
41
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
93
42
|
*
|
|
94
43
|
* This source code is licensed under the MIT license found in the
|
|
95
44
|
* LICENSE file in the root directory of this source tree.
|
|
96
|
-
*/var St=typeof Symbol=="function"&&Symbol.for,Tg=St?Symbol.for("react.element"):60103,Eg=St?Symbol.for("react.portal"):60106,Gu=St?Symbol.for("react.fragment"):60107,Yu=St?Symbol.for("react.strict_mode"):60108,Qu=St?Symbol.for("react.profiler"):60114,Ku=St?Symbol.for("react.provider"):60109,Xu=St?Symbol.for("react.context"):60110,Ag=St?Symbol.for("react.async_mode"):60111,Zu=St?Symbol.for("react.concurrent_mode"):60111,Ju=St?Symbol.for("react.forward_ref"):60112,ed=St?Symbol.for("react.suspense"):60113,VI=St?Symbol.for("react.suspense_list"):60120,td=St?Symbol.for("react.memo"):60115,nd=St?Symbol.for("react.lazy"):60116,UI=St?Symbol.for("react.block"):60121,HI=St?Symbol.for("react.fundamental"):60117,WI=St?Symbol.for("react.responder"):60118,qI=St?Symbol.for("react.scope"):60119;function mn(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Tg:switch(e=e.type,e){case Ag:case Zu:case Gu:case Qu:case Yu:case ed:return e;default:switch(e=e&&e.$$typeof,e){case Xu:case Ju:case nd:case td:case Ku:return e;default:return t}}case Eg:return t}}}function wk(e){return mn(e)===Zu}Fe.AsyncMode=Ag;Fe.ConcurrentMode=Zu;Fe.ContextConsumer=Xu;Fe.ContextProvider=Ku;Fe.Element=Tg;Fe.ForwardRef=Ju;Fe.Fragment=Gu;Fe.Lazy=nd;Fe.Memo=td;Fe.Portal=Eg;Fe.Profiler=Qu;Fe.StrictMode=Yu;Fe.Suspense=ed;Fe.isAsyncMode=function(e){return wk(e)||mn(e)===Ag};Fe.isConcurrentMode=wk;Fe.isContextConsumer=function(e){return mn(e)===Xu};Fe.isContextProvider=function(e){return mn(e)===Ku};Fe.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Tg};Fe.isForwardRef=function(e){return mn(e)===Ju};Fe.isFragment=function(e){return mn(e)===Gu};Fe.isLazy=function(e){return mn(e)===nd};Fe.isMemo=function(e){return mn(e)===td};Fe.isPortal=function(e){return mn(e)===Eg};Fe.isProfiler=function(e){return mn(e)===Qu};Fe.isStrictMode=function(e){return mn(e)===Yu};Fe.isSuspense=function(e){return mn(e)===ed};Fe.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Gu||e===Zu||e===Qu||e===Yu||e===ed||e===VI||typeof e=="object"&&e!==null&&(e.$$typeof===nd||e.$$typeof===td||e.$$typeof===Ku||e.$$typeof===Xu||e.$$typeof===Ju||e.$$typeof===HI||e.$$typeof===WI||e.$$typeof===qI||e.$$typeof===UI)};Fe.typeOf=mn;xk.exports=Fe;var GI=xk.exports,bk=GI,YI={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},QI={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Ck={};Ck[bk.ForwardRef]=YI;Ck[bk.Memo]=QI;function xt(){return xt=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},xt.apply(this,arguments)}function Sk(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 rd=v.createContext(void 0);rd.displayName="FormikContext";rd.Provider;rd.Consumer;function KI(){var e=v.useContext(rd);return e}var Ln=function(t){return typeof t=="function"},id=function(t){return t!==null&&typeof t=="object"},XI=function(t){return String(Math.floor(Number(t)))===t},of=function(t){return Object.prototype.toString.call(t)==="[object String]"},af=function(t){return id(t)&&Ln(t.then)};function nn(e,t,n,r){r===void 0&&(r=0);for(var i=yk(t);e&&r<i.length;)e=e[i[r++]];return r!==i.length&&!e||e===void 0?n:e}function is(e,t,n){for(var r=hx(e),i=r,s=0,o=yk(t);s<o.length-1;s++){var a=o[s],l=nn(e,o.slice(0,s+1));if(l&&(id(l)||Array.isArray(l)))i=i[a]=hx(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 kk(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];id(a)?n.get(a)||(n.set(a,!0),r[o]=Array.isArray(a)?[]:{},kk(a,t,n,r[o])):r[o]=t}return r}function ZI(e,t){switch(t.type){case"SET_VALUES":return xt({},e,{values:t.payload});case"SET_TOUCHED":return xt({},e,{touched:t.payload});case"SET_ERRORS":return Ii(e.errors,t.payload)?e:xt({},e,{errors:t.payload});case"SET_STATUS":return xt({},e,{status:t.payload});case"SET_ISSUBMITTING":return xt({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return xt({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return xt({},e,{values:is(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return xt({},e,{touched:is(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return xt({},e,{errors:is(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return xt({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return xt({},e,{touched:kk(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":return xt({},e,{isSubmitting:!1});case"SUBMIT_SUCCESS":return xt({},e,{isSubmitting:!1});default:return e}}var Pi={},Ql={};function JI(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=Sk(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),p=xt({validateOnChange:n,validateOnBlur:i,validateOnMount:o,onSubmit:d},u),h=v.useRef(p.initialValues),y=v.useRef(p.initialErrors||Pi),b=v.useRef(p.initialTouched||Ql),C=v.useRef(p.initialStatus),g=v.useRef(!1),m=v.useRef({});v.useEffect(function(){return g.current=!0,function(){g.current=!1}},[]);var w=v.useState(0),S=w[1],T=v.useRef({values:Yl(p.initialValues),errors:Yl(p.initialErrors)||Pi,touched:Yl(p.initialTouched)||Ql,status:Yl(p.initialStatus),isSubmitting:!1,isValidating:!1,submitCount:0}),k=T.current,E=v.useCallback(function(R){var q=T.current;T.current=ZI(q,R),q!==T.current&&S(function($){return $+1})},[]),M=v.useCallback(function(R,q){return new Promise(function($,H){var oe=p.validate(R,q);oe==null?$(Pi):af(oe)?oe.then(function(he){$(he||Pi)},function(he){H(he)}):$(oe)})},[p.validate]),U=v.useCallback(function(R,q){var $=p.validationSchema,H=Ln($)?$(q):$,oe=q&&H.validateAt?H.validateAt(q,R):tL(R,H);return new Promise(function(he,Te){oe.then(function(){he(Pi)},function(Qe){Qe.name==="ValidationError"?he(eL(Qe)):Te(Qe)})})},[p.validationSchema]),j=v.useCallback(function(R,q){return new Promise(function($){return $(m.current[R].validate(q))})},[]),N=v.useCallback(function(R){var q=Object.keys(m.current).filter(function(H){return Ln(m.current[H].validate)}),$=q.length>0?q.map(function(H){return j(H,nn(R,H))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all($).then(function(H){return H.reduce(function(oe,he,Te){return he==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||he&&(oe=is(oe,q[Te],he)),oe},{})})},[j]),O=v.useCallback(function(R){return Promise.all([N(R),p.validationSchema?U(R):{},p.validate?M(R):{}]).then(function(q){var $=q[0],H=q[1],oe=q[2],he=eh.all([$,H,oe],{arrayMerge:nL});return he})},[p.validate,p.validationSchema,N,M,U]),z=xn(function(R){return R===void 0&&(R=k.values),E({type:"SET_ISVALIDATING",payload:!0}),O(R).then(function(q){return g.current&&(E({type:"SET_ISVALIDATING",payload:!1}),E({type:"SET_ERRORS",payload:q})),q})});v.useEffect(function(){o&&g.current===!0&&Ii(h.current,p.initialValues)&&z(h.current)},[o,z]);var L=v.useCallback(function(R){var q=R&&R.values?R.values:h.current,$=R&&R.errors?R.errors:y.current?y.current:p.initialErrors||{},H=R&&R.touched?R.touched:b.current?b.current:p.initialTouched||{},oe=R&&R.status?R.status:C.current?C.current:p.initialStatus;h.current=q,y.current=$,b.current=H,C.current=oe;var he=function(){E({type:"RESET_FORM",payload:{isSubmitting:!!R&&!!R.isSubmitting,errors:$,touched:H,status:oe,values:q,isValidating:!!R&&!!R.isValidating,submitCount:R&&R.submitCount&&typeof R.submitCount=="number"?R.submitCount:0}})};if(p.onReset){var Te=p.onReset(k.values,Y);af(Te)?Te.then(he):he()}else he()},[p.initialErrors,p.initialStatus,p.initialTouched,p.onReset]);v.useEffect(function(){g.current===!0&&!Ii(h.current,p.initialValues)&&c&&(h.current=p.initialValues,L(),o&&z(h.current))},[c,p.initialValues,L,o,z]),v.useEffect(function(){c&&g.current===!0&&!Ii(y.current,p.initialErrors)&&(y.current=p.initialErrors||Pi,E({type:"SET_ERRORS",payload:p.initialErrors||Pi}))},[c,p.initialErrors]),v.useEffect(function(){c&&g.current===!0&&!Ii(b.current,p.initialTouched)&&(b.current=p.initialTouched||Ql,E({type:"SET_TOUCHED",payload:p.initialTouched||Ql}))},[c,p.initialTouched]),v.useEffect(function(){c&&g.current===!0&&!Ii(C.current,p.initialStatus)&&(C.current=p.initialStatus,E({type:"SET_STATUS",payload:p.initialStatus}))},[c,p.initialStatus,p.initialTouched]);var D=xn(function(R){if(m.current[R]&&Ln(m.current[R].validate)){var q=nn(k.values,R),$=m.current[R].validate(q);return af($)?(E({type:"SET_ISVALIDATING",payload:!0}),$.then(function(H){return H}).then(function(H){E({type:"SET_FIELD_ERROR",payload:{field:R,value:H}}),E({type:"SET_ISVALIDATING",payload:!1})})):(E({type:"SET_FIELD_ERROR",payload:{field:R,value:$}}),Promise.resolve($))}else if(p.validationSchema)return E({type:"SET_ISVALIDATING",payload:!0}),U(k.values,R).then(function(H){return H}).then(function(H){E({type:"SET_FIELD_ERROR",payload:{field:R,value:nn(H,R)}}),E({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),I=v.useCallback(function(R,q){var $=q.validate;m.current[R]={validate:$}},[]),F=v.useCallback(function(R){delete m.current[R]},[]),_=xn(function(R,q){E({type:"SET_TOUCHED",payload:R});var $=q===void 0?i:q;return $?z(k.values):Promise.resolve()}),B=v.useCallback(function(R){E({type:"SET_ERRORS",payload:R})},[]),V=xn(function(R,q){var $=Ln(R)?R(k.values):R;E({type:"SET_VALUES",payload:$});var H=q===void 0?n:q;return H?z($):Promise.resolve()}),G=v.useCallback(function(R,q){E({type:"SET_FIELD_ERROR",payload:{field:R,value:q}})},[]),W=xn(function(R,q,$){E({type:"SET_FIELD_VALUE",payload:{field:R,value:q}});var H=$===void 0?n:$;return H?z(is(k.values,R,q)):Promise.resolve()}),ee=v.useCallback(function(R,q){var $=q,H=R,oe;if(!of(R)){R.persist&&R.persist();var he=R.target?R.target:R.currentTarget,Te=he.type,Qe=he.name,rt=he.id,tn=he.value,At=he.checked,gn=he.outerHTML,vn=he.options,Pn=he.multiple;$=q||Qe||rt,H=/number|range/.test(Te)?(oe=parseFloat(tn),isNaN(oe)?"":oe):/checkbox/.test(Te)?iL(nn(k.values,$),At,tn):vn&&Pn?rL(vn):tn}$&&W($,H)},[W,k.values]),ue=xn(function(R){if(of(R))return function(q){return ee(q,R)};ee(R)}),me=xn(function(R,q,$){q===void 0&&(q=!0),E({type:"SET_FIELD_TOUCHED",payload:{field:R,value:q}});var H=$===void 0?i:$;return H?z(k.values):Promise.resolve()}),pe=v.useCallback(function(R,q){R.persist&&R.persist();var $=R.target,H=$.name,oe=$.id,he=$.outerHTML,Te=q||H||oe;me(Te,!0)},[me]),Se=xn(function(R){if(of(R))return function(q){return pe(q,R)};pe(R)}),ke=v.useCallback(function(R){Ln(R)?E({type:"SET_FORMIK_STATE",payload:R}):E({type:"SET_FORMIK_STATE",payload:function(){return R}})},[]),ye=v.useCallback(function(R){E({type:"SET_STATUS",payload:R})},[]),xe=v.useCallback(function(R){E({type:"SET_ISSUBMITTING",payload:R})},[]),be=xn(function(){return E({type:"SUBMIT_ATTEMPT"}),z().then(function(R){var q=R instanceof Error,$=!q&&Object.keys(R).length===0;if($){var H;try{if(H=te(),H===void 0)return}catch(oe){throw oe}return Promise.resolve(H).then(function(oe){return g.current&&E({type:"SUBMIT_SUCCESS"}),oe}).catch(function(oe){if(g.current)throw E({type:"SUBMIT_FAILURE"}),oe})}else if(g.current&&(E({type:"SUBMIT_FAILURE"}),q))throw R})}),P=xn(function(R){R&&R.preventDefault&&Ln(R.preventDefault)&&R.preventDefault(),R&&R.stopPropagation&&Ln(R.stopPropagation)&&R.stopPropagation(),be().catch(function(q){console.warn("Warning: An unhandled error was caught from submitForm()",q)})}),Y={resetForm:L,validateForm:z,validateField:D,setErrors:B,setFieldError:G,setFieldTouched:me,setFieldValue:W,setStatus:ye,setSubmitting:xe,setTouched:_,setValues:V,setFormikState:ke,submitForm:be},te=xn(function(){return d(k.values,Y)}),Q=xn(function(R){R&&R.preventDefault&&Ln(R.preventDefault)&&R.preventDefault(),R&&R.stopPropagation&&Ln(R.stopPropagation)&&R.stopPropagation(),L()}),ae=v.useCallback(function(R){return{value:nn(k.values,R),error:nn(k.errors,R),touched:!!nn(k.touched,R),initialValue:nn(h.current,R),initialTouched:!!nn(b.current,R),initialError:nn(y.current,R)}},[k.errors,k.touched,k.values]),re=v.useCallback(function(R){return{setValue:function($,H){return W(R,$,H)},setTouched:function($,H){return me(R,$,H)},setError:function($){return G(R,$)}}},[W,me,G]),ce=v.useCallback(function(R){var q=id(R),$=q?R.name:R,H=nn(k.values,$),oe={name:$,value:H,onChange:ue,onBlur:Se};if(q){var he=R.type,Te=R.value,Qe=R.as,rt=R.multiple;he==="checkbox"?Te===void 0?oe.checked=!!H:(oe.checked=!!(Array.isArray(H)&&~H.indexOf(Te)),oe.value=Te):he==="radio"?(oe.checked=H===Te,oe.value=Te):Qe==="select"&&rt&&(oe.value=oe.value||[],oe.multiple=!0)}return oe},[Se,ue,k.values]),fe=v.useMemo(function(){return!Ii(h.current,k.values)},[h.current,k.values]),X=v.useMemo(function(){return typeof a<"u"?fe?k.errors&&Object.keys(k.errors).length===0:a!==!1&&Ln(a)?a(p):a:k.errors&&Object.keys(k.errors).length===0},[a,fe,k.errors,p]),Z=xt({},k,{initialValues:h.current,initialErrors:y.current,initialTouched:b.current,initialStatus:C.current,handleBlur:Se,handleChange:ue,handleReset:Q,handleSubmit:P,resetForm:L,setErrors:B,setFormikState:ke,setFieldTouched:me,setFieldValue:W,setFieldError:G,setStatus:ye,setSubmitting:xe,setTouched:_,setValues:V,submitForm:be,validateForm:z,validateField:D,isValid:X,dirty:fe,unregisterField:F,registerField:I,getFieldProps:ce,getFieldMeta:ae,getFieldHelpers:re,validateOnBlur:i,validateOnChange:n,validateOnMount:o});return Z}function eL(e){var t={};if(e.inner){if(e.inner.length===0)return is(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;nn(t,o.path)||(t=is(t,o.path,o.message))}}return t}function tL(e,t,n,r){n===void 0&&(n=!1);var i=oh(e);return t[n?"validateSync":"validate"](i,{abortEarly:!1,context:i})}function oh(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||Hy(i)?oh(i):i!==""?i:void 0}):Hy(e[r])?t[r]=oh(e[r]):t[r]=e[r]!==""?e[r]:void 0}return t}function nL(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?eh(Array.isArray(s)?[]:{},s,n):s}else n.isMergeableObject(s)?r[o]=eh(e[o],s,n):e.indexOf(s)===-1&&r.push(s)}),r}function rL(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function iL(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 sL=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?v.useLayoutEffect:v.useEffect;function xn(e){var t=v.useRef(e);return sL(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 oL=v.forwardRef(function(e,t){var n=e.action,r=Sk(e,["action"]),i=n??"#",s=KI(),o=s.handleReset,a=s.handleSubmit;return v.createElement("form",xt({onSubmit:a,ref:t,onReset:o,action:i},r))});oL.displayName="Form";const _k=({init:e,schema:t,action:n,validateOnBlur:r=!1})=>JI({initialValues:e,validationSchema:t,validateOnBlur:r,enableReinitialize:!0,validateOnChange:!1,validateOnMount:!1,onSubmit:i=>{n(i)}});function jg({id:e,text:t,className:n,required:r}){const i=Ae();return t?f.jsxs("label",{htmlFor:e,className:Oe("mb-1 block text-sm font-medium",n),style:{color:i.getColor(x.InputText)},children:[t,r&&f.jsx("span",{className:"ml-1",style:{color:i.getColor(x.ErrorText)},children:"*"})]}):null}const lf={sm:"px-3 py-1 text-xs",md:"px-4 py-2 text-sm",lg:"px-5 py-3 text-15"};function aL({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 b=Ae(),C=b.getRadius(),g=l?b.getColor(x.ErrorBorder):b.getColor(x.InputBorder),m=b.getColor(x.LinkColor);return f.jsxs("div",{className:Oe({"mb-2":!o},d),style:{"--focus-ring":m},children:[f.jsx(jg,{id:e,text:t,required:a}),f.jsxs("div",{className:"flex items-center",children:[r&&f.jsx("span",{className:Oe("inline-block border border-solid border-r-0 rounded-l-md",lf[i]),style:{borderColor:l?b.getColor(x.ErrorBorder):b.getColor(x.InputBorder),backgroundColor:b.getColor(x.InputBackground),borderRadius:C},children:r}),f.jsx("input",{id:e,autoFocus:h,className:Oe("border border-solid block w-full outline-none transition-[border-color,box-shadow] duration-200 focus:ring-2 focus:ring-offset-0 rounded-lg",lf[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?b.getColor(x.ErrorText):b.getColor(x.InputText),backgroundColor:b.getColor(x.InputBackground),borderColor:g,borderRadius:C,"--tw-ring-color":m},...y}),n&&f.jsx("span",{className:Oe("inline-block border border-solid border-l-0 rounded-r-md",lf[i]),style:{borderColor:l?b.getColor(x.ErrorBorder):b.getColor(x.InputBorder),backgroundColor:b.getColor(x.InputBackground),borderRadius:C},children:n})]}),!!l&&f.jsx("p",{className:"mt-1 text-xs",style:{color:b.getColor(x.ErrorText)},children:l})]})}const vx=(e,t)=>{const n=new Date;n.setFullYear(n.getFullYear()+1),document.cookie=`${e}=${t};expires=${n.toUTCString()};path=/`},Tk=v.createContext({}),lL=()=>`${window.location.pathname}_$$_${document.title}`,cL=()=>{const e=localStorage.getItem("page");return!e||e===""?"/":e},uL=()=>{const e=localStorage.getItem("p-history");if(!e||e==="")return[];try{return JSON.parse(e)}catch{return[]}};function dL({children:e}){const[t,n]=v.useState("/"),[r,i]=v.useState(uL());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(Tk.Provider,{value:{page:t,setPage:o,history:r,clearHistory:s},children:e})}function sd(){return v.useContext(Tk)}function fL({label:e,id:t,value:n="",className:r,placeholder:i,children:s,required:o,error:a,...l}){const c=Ae();return f.jsxs("div",{className:r,children:[e&&f.jsx(jg,{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(x.InputBackground),color:c.getColor(x.InputText),borderColor:a?c.getColor(x.ErrorBorder):c.getColor(x.InputBorder),borderRadius:c.getRadius(),"--tw-ring-color":c.getColor(x.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(x.ErrorText)},children:a})]})}const yx={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:""}},pL={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"},hL={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 mL({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=Ae(),b=y.getColor(x.InputText),C=y.getColor(x.LinkColor),g=y.getColor(x.InputBorder),m=y.getColor(x.InputBackground),w=y.getColor(x.ErrorText);return f.jsxs("div",{children:[f.jsxs("div",{className:`flex items-center justify-between gap-2 ${u?"flex-row-reverse":""} ${yx[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 ${pL[c]} ${yx[d].input}`,style:{borderColor:i?C:g,backgroundColor:i?C:m},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(J.Check,{className:hL[c]})})]}),f.jsx("label",{className:"disable-highlight flex grow cursor-pointer select-none items-center text-sm",style:{color:b},htmlFor:l,children:e})]}),(a||p)&&f.jsx("small",{className:"text-xs",style:{color:w},children:p||a})]})}function gL({id:e,value:t,name:n,onChange:r,children:i,disabled:s,className:o}){const a=Ae(),l=a.getColor(x.InputText),c=a.getColor(x.LinkColor);return f.jsxs("label",{htmlFor:e,className:Oe("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(x.InputBorder),backgroundColor:t?c:a.getColor(x.InputBackground),boxShadow:t?`inset 0 0 0 3px ${a.getColor(x.Background)}`:void 0},disabled:s}),f.jsx("span",{className:"text-sm font-medium",style:{color:l},children:i})]})}function vL({id:e,label:t,children:n,required:r,className:i,error:s}){const o=Ae(),a=o.getColor(x.InputText),l=o.getColor(x.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 xx=Object.assign(gL,{Group:vL});function od({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,...b}){const C=Ae();return f.jsxs("div",{className:Oe({"mb-2":!s},i),children:[t&&f.jsx(jg,{id:e,text:t,required:l}),f.jsx("textarea",{className:Oe("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,...b,ref:u,autoFocus:p,style:{...h,fontSize:"14px",color:c?C.getColor(x.ErrorText):C.getColor(x.InputText),...!y&&{backgroundColor:C.getColor(x.InputBackground),borderColor:c?C.getColor(x.ErrorBorder):C.getColor(x.InputBorder),borderRadius:C.getRadius(),"--tw-ring-color":C.getColor(x.LinkColor)}}}),!!c&&f.jsx("p",{className:"mt-1 text-xs",style:{color:C.getColor(x.ErrorText)},children:c})]})}function Eo({variant:e="block",className:t=""}){const n=Ae(),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(x.FooterText)}:{color:n.getColor(x.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(se.PoweredBy)}),f.jsx("span",{className:"font-semibold",children:"Chatier"})]})}function yL({onOk:e,clientId:t,widgetId:n,appearance:r,aiAgentMode:i=!1,onAIAgentStart:s,onOperatorConnect:o,isConnectingToOperator:a=!1}){var k,E,M,U,j,N;const l=Ae(),{defaultValues:c,widget:d,setIsHaveChat:u}=ne(),[p,h]=v.useState(!1),y=v.useRef(null);v.useEffect(()=>{const O=setTimeout(()=>{var L;const z=(L=y.current)==null?void 0:L.querySelector('input:not([type="hidden"]), select, textarea');z==null||z.focus()},150);return()=>clearTimeout(O)},[]);const b=sd(),C=cg(),g=!!c&&"username"in c,m=(E=(k=r==null?void 0:r.body)==null?void 0:k.inputs)==null?void 0:E.reduce((O,z)=>{let L=z.remember?eo(z.name):c==null?void 0:c[z.name];return z.options&&L&&!z.options.includes(L)&&(L=void 0),z.name==="username"&&g&&(L=c.username),O[z.name]=L||"",O},{}),w=gg((U=(M=r==null?void 0:r.body)==null?void 0:M.inputs)==null?void 0:U.reduce((O,z)=>(O[z.name]=z.required?au().required(`${z.label} alanı zorunludur`):au(),O),{})),S=_k({init:{...m},schema:w,validateOnBlur:!1,action:async O=>{var z,L;if(!(p||a)){h(!0);try{g&&(O.username=c.username),c!=null&&c.secret_data&&(O.secret_data=c.secret_data);for(const F in O)typeof O[F]=="string"&&(O[F]=O[F].trim());if(o){for(const F of((z=r==null?void 0:r.body)==null?void 0:z.inputs)||[])F.remember&&vx(F.name,O[F.name]);o(O);return}const[D,I]=await C.mutateAsync({inputs:O,history:b.history,client_id:t,widget_id:n,device_id:Lr((d==null?void 0:d.link_id)||""),is_agent_mode:i});if(Yn(I)){Kp(D)&&(an(Je.CustomerToken,D.customer_token,(d==null?void 0:d.link_id)||""),an(Je.CustomerRefreshToken,D.customer_refresh_token,(d==null?void 0:d.link_id)||""),an(Je.DeviceId,D.device_id,(d==null?void 0:d.link_id)||"")),b.clearHistory();for(const F of((L=r==null?void 0:r.body)==null?void 0:L.inputs)||[])F.remember&&vx(F.name,O[F.name]);u(!0),i?s==null||s():e==null||e();return}Co(D,{form:S})}catch(D){console.error("Chat creation error:",D)}finally{h(!1)}}}}),T=l.getColor(x.GreeterBackground);return f.jsxs("section",{className:"h-full overflow-y-auto px-5",style:{backgroundColor:T},children:[f.jsxs("form",{ref:y,autoComplete:"off",className:"grid grid-cols-1 gap-4",onSubmit:S.handleSubmit,children:[(N=(j=r==null?void 0:r.body)==null?void 0:j.inputs)==null?void 0:N.map((O,z)=>{var D,I;const L=z===0;if(["text","email","phone"].includes(O.type))return f.jsx(aL,{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"&&g,readOnly:O.name==="username"&&g,autoComplete:"off",placeholder:O.placeholder,error:S.errors[O.name],ariaInvalid:S.errors.name?!0:void 0,required:O.required,noMargin:!0,autoFocus:L},O.name);if(O.type==="select")return f.jsx(fL,{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:L,children:(D=O.options)==null?void 0:D.map(F=>f.jsx("option",{value:F,children:F},F))},O.name);if(O.type==="checkbox")return f.jsx(mL,{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(xx.Group,{id:O.name,label:O.label,required:O.required,error:S.errors[O.name],children:(I=O.options)==null?void 0:I.map(F=>f.jsx(xx,{onChange:_=>{_?S.setFieldValue(O.name,F):S.setFieldValue(O.name,"")},id:F,name:O.name,value:F===S.values[O.name],children:F},F))},O.name);if(O.type==="textarea")return f.jsx(od,{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:L},O.name)}),f.jsx(En,{textKey:x.GreeterButtonText,bgKey:x.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(Eo,{variant:"block",className:"py-2"})]})}var dt=(e=>(e.Open="open",e.Closed="closed",e.Pending="pending",e.Deleted="deleted",e.Created="created",e.Agent="agent",e))(dt||{}),sn=(e=>(e.AdminJoin="admin_join",e.AdminLeave="admin_leave",e.ChatCreated="chat_created",e.AdminToggleUpload="admin_toggle_upload",e.ChatTransferred="chat_transferred",e))(sn||{}),ve=(e=>(e.Customer="customer",e.User="user",e.Agent="agent",e.System="system",e.Activity="activity",e))(ve||{});const Ss=e=>{const t=wA(),n=(r,i)=>{var o;const s=((o=C8.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 xL={exports:{}},cf={exports:{}},wx;function Ek(){return wx||(wx=1,function(e,t){(function(n,r){e.exports=r()})(Sh,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",b="Invalid Date",C=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|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,m={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(L){var D=["th","st","nd","rd"],I=L%100;return"["+L+(D[(I-20)%10]||D[I]||D[0])+"]"}},w=function(L,D,I){var F=String(L);return!F||F.length>=D?L:""+Array(D+1-F.length).join(I)+L},S={s:w,z:function(L){var D=-L.utcOffset(),I=Math.abs(D),F=Math.floor(I/60),_=I%60;return(D<=0?"+":"-")+w(F,2,"0")+":"+w(_,2,"0")},m:function L(D,I){if(D.date()<I.date())return-L(I,D);var F=12*(I.year()-D.year())+(I.month()-D.month()),_=D.clone().add(F,u),B=I-_<0,V=D.clone().add(F+(B?-1:1),u);return+(-(F+(I-_)/(B?_-V:V-_))||0)},a:function(L){return L<0?Math.ceil(L)||0:Math.floor(L)},p:function(L){return{M:u,y:h,w:d,d:c,D:y,h:l,m:a,s:o,ms:s,Q:p}[L]||String(L||"").toLowerCase().replace(/s$/,"")},u:function(L){return L===void 0}},T="en",k={};k[T]=m;var E="$isDayjsObject",M=function(L){return L instanceof O||!(!L||!L[E])},U=function L(D,I,F){var _;if(!D)return T;if(typeof D=="string"){var B=D.toLowerCase();k[B]&&(_=B),I&&(k[B]=I,_=B);var V=D.split("-");if(!_&&V.length>1)return L(V[0])}else{var G=D.name;k[G]=D,_=G}return!F&&_&&(T=_),_||!F&&T},j=function(L,D){if(M(L))return L.clone();var I=typeof D=="object"?D:{};return I.date=L,I.args=arguments,new O(I)},N=S;N.l=U,N.i=M,N.w=function(L,D){return j(L,{locale:D.$L,utc:D.$u,x:D.$x,$offset:D.$offset})};var O=function(){function L(I){this.$L=U(I.locale,null,!0),this.parse(I),this.$x=this.$x||I.x||{},this[E]=!0}var D=L.prototype;return D.parse=function(I){this.$d=function(F){var _=F.date,B=F.utc;if(_===null)return new Date(NaN);if(N.u(_))return new Date;if(_ instanceof Date)return new Date(_);if(typeof _=="string"&&!/Z$/i.test(_)){var V=_.match(C);if(V){var G=V[2]-1||0,W=(V[7]||"0").substring(0,3);return B?new Date(Date.UTC(V[1],G,V[3]||1,V[4]||0,V[5]||0,V[6]||0,W)):new Date(V[1],G,V[3]||1,V[4]||0,V[5]||0,V[6]||0,W)}}return new Date(_)}(I),this.init()},D.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()},D.$utils=function(){return N},D.isValid=function(){return this.$d.toString()!==b},D.isSame=function(I,F){var _=j(I);return this.startOf(F)<=_&&_<=this.endOf(F)},D.isAfter=function(I,F){return j(I)<this.startOf(F)},D.isBefore=function(I,F){return this.endOf(F)<j(I)},D.$g=function(I,F,_){return N.u(I)?this[F]:this.set(_,I)},D.unix=function(){return Math.floor(this.valueOf()/1e3)},D.valueOf=function(){return this.$d.getTime()},D.startOf=function(I,F){var _=this,B=!!N.u(F)||F,V=N.p(I),G=function(ye,xe){var be=N.w(_.$u?Date.UTC(_.$y,xe,ye):new Date(_.$y,xe,ye),_);return B?be:be.endOf(c)},W=function(ye,xe){return N.w(_.toDate()[ye].apply(_.toDate("s"),(B?[0,0,0,0]:[23,59,59,999]).slice(xe)),_)},ee=this.$W,ue=this.$M,me=this.$D,pe="set"+(this.$u?"UTC":"");switch(V){case h:return B?G(1,0):G(31,11);case u:return B?G(1,ue):G(0,ue+1);case d:var Se=this.$locale().weekStart||0,ke=(ee<Se?ee+7:ee)-Se;return G(B?me-ke:me+(6-ke),ue);case c:case y:return W(pe+"Hours",0);case l:return W(pe+"Minutes",1);case a:return W(pe+"Seconds",2);case o:return W(pe+"Milliseconds",3);default:return this.clone()}},D.endOf=function(I){return this.startOf(I,!1)},D.$set=function(I,F){var _,B=N.p(I),V="set"+(this.$u?"UTC":""),G=(_={},_[c]=V+"Date",_[y]=V+"Date",_[u]=V+"Month",_[h]=V+"FullYear",_[l]=V+"Hours",_[a]=V+"Minutes",_[o]=V+"Seconds",_[s]=V+"Milliseconds",_)[B],W=B===c?this.$D+(F-this.$W):F;if(B===u||B===h){var ee=this.clone().set(y,1);ee.$d[G](W),ee.init(),this.$d=ee.set(y,Math.min(this.$D,ee.daysInMonth())).$d}else G&&this.$d[G](W);return this.init(),this},D.set=function(I,F){return this.clone().$set(I,F)},D.get=function(I){return this[N.p(I)]()},D.add=function(I,F){var _,B=this;I=Number(I);var V=N.p(F),G=function(ue){var me=j(B);return N.w(me.date(me.date()+Math.round(ue*I)),B)};if(V===u)return this.set(u,this.$M+I);if(V===h)return this.set(h,this.$y+I);if(V===c)return G(1);if(V===d)return G(7);var W=(_={},_[a]=r,_[l]=i,_[o]=n,_)[V]||1,ee=this.$d.getTime()+I*W;return N.w(ee,this)},D.subtract=function(I,F){return this.add(-1*I,F)},D.format=function(I){var F=this,_=this.$locale();if(!this.isValid())return _.invalidDate||b;var B=I||"YYYY-MM-DDTHH:mm:ssZ",V=N.z(this),G=this.$H,W=this.$m,ee=this.$M,ue=_.weekdays,me=_.months,pe=_.meridiem,Se=function(xe,be,P,Y){return xe&&(xe[be]||xe(F,B))||P[be].slice(0,Y)},ke=function(xe){return N.s(G%12||12,xe,"0")},ye=pe||function(xe,be,P){var Y=xe<12?"AM":"PM";return P?Y.toLowerCase():Y};return B.replace(g,function(xe,be){return be||function(P){switch(P){case"YY":return String(F.$y).slice(-2);case"YYYY":return N.s(F.$y,4,"0");case"M":return ee+1;case"MM":return N.s(ee+1,2,"0");case"MMM":return Se(_.monthsShort,ee,me,3);case"MMMM":return Se(me,ee);case"D":return F.$D;case"DD":return N.s(F.$D,2,"0");case"d":return String(F.$W);case"dd":return Se(_.weekdaysMin,F.$W,ue,2);case"ddd":return Se(_.weekdaysShort,F.$W,ue,3);case"dddd":return ue[F.$W];case"H":return String(G);case"HH":return N.s(G,2,"0");case"h":return ke(1);case"hh":return ke(2);case"a":return ye(G,W,!0);case"A":return ye(G,W,!1);case"m":return String(W);case"mm":return N.s(W,2,"0");case"s":return String(F.$s);case"ss":return N.s(F.$s,2,"0");case"SSS":return N.s(F.$ms,3,"0");case"Z":return V}return null}(xe)||V.replace(":","")})},D.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},D.diff=function(I,F,_){var B,V=this,G=N.p(F),W=j(I),ee=(W.utcOffset()-this.utcOffset())*r,ue=this-W,me=function(){return N.m(V,W)};switch(G){case h:B=me()/12;break;case u:B=me();break;case p:B=me()/3;break;case d:B=(ue-ee)/6048e5;break;case c:B=(ue-ee)/864e5;break;case l:B=ue/i;break;case a:B=ue/r;break;case o:B=ue/n;break;default:B=ue}return _?B:N.a(B)},D.daysInMonth=function(){return this.endOf(u).$D},D.$locale=function(){return k[this.$L]},D.locale=function(I,F){if(!I)return this.$L;var _=this.clone(),B=U(I,F,!0);return B&&(_.$L=B),_},D.clone=function(){return N.w(this.$d,this)},D.toDate=function(){return new Date(this.valueOf())},D.toJSON=function(){return this.isValid()?this.toISOString():null},D.toISOString=function(){return this.$d.toISOString()},D.toString=function(){return this.$d.toUTCString()},L}(),z=O.prototype;return j.prototype=z,[["$ms",s],["$s",o],["$m",a],["$H",l],["$W",c],["$M",u],["$y",h],["$D",y]].forEach(function(L){z[L[1]]=function(D){return this.$g(D,L[0],L[1])}}),j.extend=function(L,D){return L.$i||(L(D,O,j),L.$i=!0),j},j.locale=U,j.isDayjs=M,j.unix=function(L){return j(1e3*L)},j.en=k[T],j.Ls=k,j.p={},j})}(cf)),cf.exports}(function(e,t){(function(n,r){e.exports=r(Ek())})(Sh,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})})(xL);var Ak={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Sh,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,b,C,g=u.$locale().relativeTime||o,m=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"}],w=m.length,S=0;S<w;S+=1){var T=m[S];T.d&&(y=p?i(c).diff(u,T.d,!0):u.diff(c,T.d,!0));var k=(n.rounding||Math.round)(Math.abs(y));if(C=y>0,k<=T.r||!T.r){k<=1&&S>0&&(T=m[S-1]);var E=g[T.l];h&&(k=h(""+k)),b=typeof E=="string"?E.replace("%d",k):E(k,d,T.l,C);break}}if(d)return b;var M=C?g.future:g.past;return typeof M=="function"?M(b):M.replace("%s",b)},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)}}})})(Ak);var wL=Ak.exports;const bL=Fr(wL);var CL=Ek();const uf=Fr(CL),SL=(e="tr")=>(uf.extend(bL),uf.locale(e),uf);function Ze({className:e="",style:t}){const n=Ae();return f.jsx("div",{className:`animate-pulse rounded ${e}`,style:{backgroundColor:n.getColor(x.MessageAdminBackground),opacity:.6,...t}})}function kL(){const e=Ae();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(Ze,{className:"h-12 w-3/5",style:{borderRadius:e.getRadius()}})}),f.jsx("div",{className:"flex w-full items-center justify-end",children:f.jsx(Ze,{className:"h-10 w-2/5",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(x.MessageVisitorBackground),opacity:.4}})}),f.jsx("div",{className:"flex w-full items-center justify-start",children:f.jsx(Ze,{className:"h-16 w-4/5",style:{borderRadius:e.getRadius()}})}),f.jsx("div",{className:"flex w-full items-center justify-end",children:f.jsx(Ze,{className:"h-8 w-1/3",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(x.MessageVisitorBackground),opacity:.4}})}),f.jsx("div",{className:"flex w-full items-center justify-start",children:f.jsx(Ze,{className:"h-10 w-1/2",style:{borderRadius:e.getRadius()}})})]})}function _L(){const e=Ae();return f.jsxs("div",{className:"p-3 flex items-center gap-3",style:{backgroundColor:e.getColor(x.FooterBackground),borderRadius:e.getRadius()},children:[f.jsx("div",{className:"grow",children:f.jsx(Ze,{className:"h-12 w-full",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(x.InputBackground)}})}),f.jsx(Ze,{className:"h-12 w-12 rounded-full"})]})}function TL(){const e=Ae();return f.jsxs("header",{className:"p-4 flex justify-between items-center z-10",style:{backgroundColor:e.getColor(x.HeaderBackground),borderBottom:`1px solid ${e.getColor(x.HeaderBorder)}`},children:[f.jsx(Ze,{className:"h-5 w-36"}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Ze,{className:"h-5 w-5 rounded"}),f.jsx(Ze,{className:"h-5 w-5 rounded"})]})]})}function EL(){const e=Ae();return f.jsx("section",{className:"h-full overflow-y-auto px-4 py-3",style:{backgroundColor:e.getColor(x.GreeterBackground)},children:f.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[f.jsxs("div",{children:[f.jsx(Ze,{className:"h-4 w-20 mb-1"}),f.jsx(Ze,{className:"h-11 w-full",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(x.InputBackground)}})]}),f.jsxs("div",{children:[f.jsx(Ze,{className:"h-4 w-24 mb-1"}),f.jsx(Ze,{className:"h-11 w-full",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(x.InputBackground)}})]}),f.jsxs("div",{children:[f.jsx(Ze,{className:"h-4 w-16 mb-1"}),f.jsx(Ze,{className:"h-11 w-full",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(x.InputBackground)}})]}),f.jsx(Ze,{className:"h-11 w-full mt-2",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(x.GreeterButtonBackground),opacity:.5}})]})})}function AL(){const e=Ae();return f.jsxs("div",{className:"relative flex flex-col gap-3 items-center justify-center h-44",style:{backgroundColor:e.getColor(x.GreeterTopBackground)},children:[f.jsx(Ze,{className:"h-7 w-40"}),f.jsx(Ze,{className:"h-4 w-56"})]})}function jL(){return f.jsx("div",{className:"flex flex-col h-full flex-1 min-h-0 overflow-hidden",children:f.jsx("div",{className:"flex-1 overflow-y-auto space-y-0 min-h-0",children:Array.from({length:6}).map((e,t)=>f.jsxs("div",{className:"w-full flex justify-between items-center gap-2 p-5",children:[f.jsx(Ze,{className:"h-4 flex-1 max-w-[70%]"}),f.jsx(Ze,{className:"h-3 w-14 flex-shrink-0"})]},t))})})}function jk(){const e=Ae();return f.jsxs("div",{className:"h-full w-full flex flex-col overflow-hidden",style:{backgroundColor:e.getColor(x.Background)},children:[f.jsx(TL,{}),f.jsx(kL,{}),f.jsx(_L,{}),f.jsxs("div",{className:"py-1.5 px-3 flex items-center justify-center gap-1",style:{borderTop:`1px solid ${e.getColor(x.FooterBorder)}`,backgroundColor:e.getColor(x.FooterBackground)},children:[f.jsx(Ze,{className:"h-3 w-20"}),f.jsx(Ze,{className:"h-3.5 w-3.5 rounded"})]})]})}function ah(){const e=Ae(),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(x.GreeterBackground)},children:[f.jsx(AL,{}),f.jsx("div",{style:{height:t?"calc(var(--app-height,100dvh) - 11rem)":"calc(100% - 11rem)"},children:f.jsx(EL,{})})]})}function RL({onHasHistory:e,emptyStateText:t}){const n=ne(S=>S.widget),r=ne(S=>S.open),i=ne(S=>S.setHistoryChat),s=ne(S=>S.setHistoryMessages),o=Ae(),a=Ss(),[l,c]=v.useState(null),d=SL(),u=v.useRef(!1),p=n!=null&&n.link_id?Lr(n.link_id):null,{data:h,isLoading:y}=VP((n==null?void 0:n.link_id)||"",p||"",{enabled:r});if(v.useEffect(()=>{if(!y&&h){const[S,T]=h,k=Yn(T)&&Array.isArray(S)&&S.length>0;if(k&&!u.current){const E=S[0];if(E.status===dt.Open||E.status===dt.Pending){console.log("ChatHistoryList: Auto-joining active chat",E._id),u.current=!0,i(E),s(null),a.push("chat");return}}e&&e(k)}},[y,h,e,a,i,s]),!(n!=null&&n.link_id))return null;if(y)return f.jsx(jL,{});if(!h)return null;const[b,C]=h;if(!Yn(C)||!Array.isArray(b))return C===429?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:"Geçmiş şu an yüklenemedi"}),f.jsx("div",{className:"mt-2 text-xs opacity-60",children:"Yeni bir sohbet başlatabilir veya daha sonra tekrar deneyebilirsiniz."})]})}):null;const g=S=>d(S).fromNow(),m=S=>{const T=S.map(E=>typeof E=="string"?E.trim():"").filter(Boolean);if(T.length===0)return"Atanmamış";if(T.length===1)return T[0];if(T.length===2)return`${T[0]} ve ${T[1]}`;if(T.length===3)return`${T[0]}, ${T[1]} ve ${T[2]}`;const k=T.length-2;return`${T[0]}, ${T[1]} ve ${k} kişi daha`},w=S=>{var T;if(S.who_joined_details&&Array.isArray(S.who_joined_details)&&S.who_joined_details.length>0){const k=S.who_joined_details.map(E=>E.name||"");return m(k)}if(S.participant_logs&&Array.isArray(S.participant_logs)&&S.participant_logs.length>0){const k=S.participant_logs.map(E=>E.name||"");return m(k)}return(T=S.archive_summary)!=null&&T.admin_name?S.archive_summary.admin_name:"Atanmamış"};return b.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:b.map(S=>f.jsxs("button",{type:"button",className:"w-full flex justify-between items-center gap-2 p-5 text-left transition-colors",style:{color:o.getColor(x.InputText),backgroundColor:l===S._id?o.getColor(x.MessageAdminBackground):"transparent",cursor:"pointer"},onMouseEnter:()=>c(S._id),onMouseLeave:()=>c(null),onClick:()=>{i(S),s(null),a.push("chat")},children:[f.jsx("span",{className:"font-medium text-sm truncate flex-1 min-w-0",children:w(S)}),f.jsx("span",{className:"text-xs flex-shrink-0 tabular-nums",style:{color:o.getColor(x.FooterText)},children:g(S.created_at)})]},S._id))})})}const df=[Be.Light,Be.Dark,Be.System];function ML(e){switch(e){case Be.Light:return J.Sun;case Be.Dark:return J.Moon;case Be.System:return J.Monitor;default:return J.Monitor}}function PL(){const e=Ae(),{mode:t,setMode:n}=e,r=()=>{const s=df.indexOf(t),o=df[(s+1)%df.length];n(o)},i=ML(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(x.HeaderText)},title:t===Be.Light?"Açık tema":t===Be.Dark?"Koyu tema":"Sistem",children:f.jsx(i,{className:"size-5"})})}const vr=Object.create(null);vr.open="0";vr.close="1";vr.ping="2";vr.pong="3";vr.message="4";vr.upgrade="5";vr.noop="6";const wc=Object.create(null);Object.keys(vr).forEach(e=>{wc[vr[e]]=e});const lh={type:"error",data:"parser error"},Rk=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Mk=typeof ArrayBuffer=="function",Pk=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Rg=({type:e,data:t},n,r)=>Rk&&t instanceof Blob?n?r(t):bx(t,r):Mk&&(t instanceof ArrayBuffer||Pk(t))?n?r(t):bx(new Blob([t]),r):r(vr[e]+(t||"")),bx=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function Cx(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let ff;function NL(e,t){if(Rk&&e.data instanceof Blob)return e.data.arrayBuffer().then(Cx).then(t);if(Mk&&(e.data instanceof ArrayBuffer||Pk(e.data)))return t(Cx(e.data));Rg(e,!1,n=>{ff||(ff=new TextEncoder),t(ff.encode(n))})}const Sx="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",aa=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<Sx.length;e++)aa[Sx.charCodeAt(e)]=e;const OL=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=aa[e.charCodeAt(r)],o=aa[e.charCodeAt(r+1)],a=aa[e.charCodeAt(r+2)],l=aa[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",Mg=(e,t)=>{if(typeof e!="string")return{type:"message",data:Nk(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:IL(e.substring(1),t)}:wc[n]?e.length>1?{type:wc[n],data:e.substring(1)}:{type:wc[n]}:lh},IL=(e,t)=>{if(DL){const n=OL(e);return Nk(n,t)}else return{base64:!0,data:e}},Nk=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Ok="",LL=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((s,o)=>{Rg(s,!1,a=>{r[o]=a,++i===n&&t(r.join(Ok))})})},FL=(e,t)=>{const n=e.split(Ok),r=[];for(let i=0;i<n.length;i++){const s=Mg(n[i],t);if(r.push(s),s.type==="error")break}return r};function BL(){return new TransformStream({transform(e,t){NL(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 pf;function Kl(e){return e.reduce((t,n)=>t+n.length,0)}function Xl(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 $L(e,t){pf||(pf=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(Kl(n)<1)break;const l=Xl(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(Kl(n)<2)break;const l=Xl(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(Kl(n)<8)break;const l=Xl(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),d=c.getUint32(0);if(d>Math.pow(2,21)-1){a.enqueue(lh);break}i=d*Math.pow(2,32)+c.getUint32(4),r=3}else{if(Kl(n)<i)break;const l=Xl(n,i);a.enqueue(Mg(s?l:pf.decode(l),t)),r=0}if(i===0||i>e){a.enqueue(lh);break}}}})}const Dk=4;function pt(e){if(e)return zL(e)}function zL(e){for(var t in pt.prototype)e[t]=pt.prototype[t];return e}pt.prototype.on=pt.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};pt.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};pt.prototype.off=pt.prototype.removeListener=pt.prototype.removeAllListeners=pt.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};pt.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};pt.prototype.emitReserved=pt.prototype.emit;pt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};pt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const ad=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),_n=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),VL="arraybuffer";function Ik(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const UL=_n.setTimeout,HL=_n.clearTimeout;function ld(e,t){t.useNativeTimers?(e.setTimeoutFn=UL.bind(_n),e.clearTimeoutFn=HL.bind(_n)):(e.setTimeoutFn=_n.setTimeout.bind(_n),e.clearTimeoutFn=_n.clearTimeout.bind(_n))}const WL=1.33;function qL(e){return typeof e=="string"?GL(e):Math.ceil((e.byteLength||e.size)*WL)}function GL(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 Lk(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function YL(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function QL(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 KL extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Pg extends pt{constructor(t){super(),this.writable=!1,ld(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 KL(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=Mg(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=YL(t);return n.length?"?"+n:""}}class XL extends Pg{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)};FL(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,LL(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]=Lk()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let Fk=!1;try{Fk=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const ZL=Fk;function JL(){}class e6 extends XL{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 hr extends pt{constructor(t,n,r){super(),this.createRequest=t,ld(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=Ik(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=hr.requestsCount++,hr.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 hr.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()}}hr.requestsCount=0;hr.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",kx);else if(typeof addEventListener=="function"){const e="onpagehide"in _n?"pagehide":"unload";addEventListener(e,kx,!1)}}function kx(){for(let e in hr.requests)hr.requests.hasOwnProperty(e)&&hr.requests[e].abort()}const t6=function(){const e=Bk({xdomain:!1});return e&&e.responseType!==null}();class n6 extends e6{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=t6&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new hr(Bk,this.uri(),t)}}function Bk(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||ZL))return new XMLHttpRequest}catch{}if(!t)try{return new _n[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const $k=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class r6 extends Pg{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=$k?{}:Ik(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;Rg(r,this.supportsBinary,s=>{try{this.doWrite(r,s)}catch{}i&&ad(()=>{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]=Lk()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const hf=_n.WebSocket||_n.MozWebSocket;class i6 extends r6{createSocket(t,n,r){return $k?new hf(t,n,r):n?new hf(t,n):new hf(t)}doWrite(t,n){this.ws.send(n)}}class s6 extends Pg{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=$L(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=BL();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&&ad(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const o6={websocket:i6,webtransport:s6,polling:n6},a6=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,l6=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function ch(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=a6.exec(e||""),s={},o=14;for(;o--;)s[l6[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=c6(s,s.path),s.queryKey=u6(s,s.query),s}function c6(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 u6(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,s){i&&(n[i]=s)}),n}const uh=typeof addEventListener=="function"&&typeof removeEventListener=="function",bc=[];uh&&addEventListener("offline",()=>{bc.forEach(e=>e())},!1);class yi extends pt{constructor(t,n){if(super(),this.binaryType=VL,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=ch(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=ch(n.host).host);ld(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=QL(this.opts.query)),uh&&(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"})},bc.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=Dk,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&&yi.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",yi.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+=qL(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,ad(()=>{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(yi.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(),uh&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=bc.indexOf(this._offlineEventListener);r!==-1&&bc.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}yi.protocol=Dk;class d6 extends yi{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;yi.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;yi.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 f6=class extends d6{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=>o6[i]).filter(i=>!!i)),super(t,r)}};function p6(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=ch(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 h6=typeof ArrayBuffer=="function",m6=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,zk=Object.prototype.toString,g6=typeof Blob=="function"||typeof Blob<"u"&&zk.call(Blob)==="[object BlobConstructor]",v6=typeof File=="function"||typeof File<"u"&&zk.call(File)==="[object FileConstructor]";function Ng(e){return h6&&(e instanceof ArrayBuffer||m6(e))||g6&&e instanceof Blob||v6&&e instanceof File}function Cc(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Cc(e[n]))return!0;return!1}if(Ng(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Cc(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Cc(e[n]))return!0;return!1}function y6(e){const t=[],n=e.data,r=e;return r.data=dh(n,t),r.attachments=t.length,{packet:r,buffers:t}}function dh(e,t){if(!e)return e;if(Ng(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]=dh(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]=dh(e[r],t));return n}return e}function x6(e,t){return e.data=fh(e.data,t),delete e.attachments,e}function fh(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]=fh(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=fh(e[n],t));return e}const w6=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],b6=5;var Me;(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"})(Me||(Me={}));class C6{constructor(t){this.replacer=t}encode(t){return(t.type===Me.EVENT||t.type===Me.ACK)&&Cc(t)?this.encodeAsBinary({type:t.type===Me.EVENT?Me.BINARY_EVENT:Me.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===Me.BINARY_EVENT||t.type===Me.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=y6(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function _x(e){return Object.prototype.toString.call(e)==="[object Object]"}class Og extends pt{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===Me.BINARY_EVENT;r||n.type===Me.BINARY_ACK?(n.type=r?Me.EVENT:Me.ACK,this.reconstructor=new S6(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Ng(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(Me[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Me.BINARY_EVENT||r.type===Me.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(Og.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 Me.CONNECT:return _x(n);case Me.DISCONNECT:return n===void 0;case Me.CONNECT_ERROR:return typeof n=="string"||_x(n);case Me.EVENT:case Me.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&w6.indexOf(n[0])===-1);case Me.ACK:case Me.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class S6{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=x6(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const k6=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Og,Encoder:C6,get PacketType(){return Me},protocol:b6},Symbol.toStringTag,{value:"Module"}));function Un(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const _6=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Vk extends pt{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=[Un(t,"open",this.onopen.bind(this)),Un(t,"packet",this.onpacket.bind(this)),Un(t,"error",this.onerror.bind(this)),Un(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(_6.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:Me.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:Me.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 Me.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 Me.EVENT:case Me.BINARY_EVENT:this.onevent(t);break;case Me.ACK:case Me.BINARY_ACK:this.onack(t);break;case Me.DISCONNECT:this.ondisconnect();break;case Me.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:Me.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:Me.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 Bo(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}Bo.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};Bo.prototype.reset=function(){this.attempts=0};Bo.prototype.setMin=function(e){this.ms=e};Bo.prototype.setMax=function(e){this.max=e};Bo.prototype.setJitter=function(e){this.jitter=e};class ph extends pt{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,ld(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 Bo({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||k6;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 f6(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=Un(n,"open",function(){r.onopen(),t&&t()}),s=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},o=Un(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(Un(t,"ping",this.onping.bind(this)),Un(t,"data",this.ondata.bind(this)),Un(t,"error",this.onerror.bind(this)),Un(t,"close",this.onclose.bind(this)),Un(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){ad(()=>{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 Vk(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 Zo={};function Sc(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=p6(e,t.path||"/socket.io"),r=n.source,i=n.id,s=n.path,o=Zo[i]&&s in Zo[i].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let l;return a?l=new ph(r,t):(Zo[i]||(Zo[i]=new ph(r,t)),l=Zo[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(Sc,{Manager:ph,Socket:Vk,io:Sc,connect:Sc});var Pe=(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))(Pe||{}),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.CustomerSessionRenewed="customer:session:renewed",e.AgentMessageChunk="agent:message:chunk",e.AgentMessageStreamStatus="agent:message:stream_status",e.AgentMessageFinalMetadata="agent:message:final_metadata",e.AgentSpamWarning="agent:spam:warning",e.AgentSpamBanned="agent:spam:banned",e))(ge||{});const Uk=v.createContext(null),xr=()=>{const e=v.useContext(Uk);if(!e)throw new Error("useWebsocket must be used within a WebSocketProvider");return e},T6=({children:e})=>{const{widget:t,isHaveChat:n,isAIAgentMode:r}=ne(),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,h]=v.useState(!1),y=v.useRef(!1),b=v.useRef(new Map),C=v.useCallback(j=>{var N;console.log("WS: cleanupSocket called",{reason:j,hasSocket:!!i.current,isConnected:(N=i.current)==null?void 0:N.connected,currentLinkId:a.current}),i.current&&(console.log("WS: Cleaning up existing socket.",j||""),i.current.removeAllListeners(),i.current.disconnect(),i.current=null),c(!1),u(!1),o.current=!1,s.current=!1,a.current=null},[]),g=v.useCallback((j,N,O)=>{if(a.current===j&&(o.current||i.current&&i.current.connected)){console.log("WS: Connect called but already connecting or connected for same linkId.");return}if(!N&&!O){console.log("WS: Connect skipped - no active chat or AI agent mode");return}const z=oa(Je.CustomerToken,j)||eo("customer_token"),L=oa(Je.CustomerRefreshToken,j)||eo("customer_refresh_token");if(!z||!L){if(console.log("WS: Connect skipped - missing required tokens"),N){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:j,tokenPrefix:`${z==null?void 0:z.substring(0,20)}...`,refreshTokenPrefix:`${L==null?void 0:L.substring(0,20)}...`,deviceId:oa(Je.DeviceId,j)}),o.current=!0,a.current=j,y.current=!1,h(!1),b.current.clear();const D=Sc(oE,{transports:["websocket"],forceNew:!0,timeout:1e4,auth:{customer_token:z,device_id:oa(Je.DeviceId,j)||eo("device_id"),customer_refresh_token:L}});i.current=D,D.on(ge.CustomerSessionRenewed,I=>{j&&(an(Je.CustomerToken,I.customer_token,j),an(Je.CustomerRefreshToken,I.customer_refresh_token,j))}),D.on("error",I=>{console.error("WS: Websocket error",I),o.current=!1}),D.on("connect_error",I=>{console.error("WS: Connect error",I),o.current=!1,c(!1),u(!1),i.current===D&&(i.current=null,a.current=null);const F=(I==null?void 0:I.message)||String(I);if(F.toLowerCase().includes("unauthorized")||F.includes("401")){console.log("WS: Unauthorized error, clearing tokens only"),j&&AS(j),localStorage.removeItem("lc:widget:isHaveChat");try{ne.getState().setIsHaveChat(!1)}catch{}}}),D.on("disconnect",I=>{var _;console.log("WS: Disconnected",I),c(!1),u(!1),o.current=!1,s.current=!1,i.current===D&&(i.current=null,a.current=null);const F=ne.getState();I==="io server disconnect"&&((_=F.widget)!=null&&_.link_id)&&(F.isHaveChat||F.isAIAgentMode)&&(console.log("WS: Server disconnect, attempting reconnect..."),setTimeout(()=>{g(F.widget.link_id,F.isHaveChat,F.isAIAgentMode)},500))}),D.on("connect",()=>{console.log("WS: Connected successfully"),c(!0),o.current=!1}),D.on(ge.ChatUserClose,()=>{y.current||(y.current=!0,h(!0))}),D.on("connection:ready",()=>{console.log("WS: Connection ready received"),s.current=!0,u(!0)})},[]);v.useEffect(()=>{const j=t==null?void 0:t.link_id;return j&&(n||r)?(console.log("WS: Auto-connecting due to linkId and isHaveChat/isAIAgentMode",{isHaveChat:n,isAIAgentMode:r}),g(j,n,r)):!n&&!r&&(console.log("WS: Auto-disconnect due to no isHaveChat and no isAIAgentMode"),C("no active chat flags")),()=>{}},[t==null?void 0:t.link_id,n,r,g,C]),v.useEffect(()=>()=>{console.log("WS: Provider unmounting, cleaning up"),C("provider unmount")},[C]),v.useEffect(()=>{const j=()=>{console.log("WS: Page unloading, disconnecting socket"),i.current&&(i.current.disconnect(),i.current=null)},N=()=>{console.log("WS: Page hidden (pagehide), disconnecting socket"),i.current&&(i.current.disconnect(),i.current=null)};return window.addEventListener("beforeunload",j),window.addEventListener("pagehide",N),()=>{window.removeEventListener("beforeunload",j),window.removeEventListener("pagehide",N)}},[]);const m=v.useCallback(()=>{const j=t==null?void 0:t.link_id;j?g(j,n,r):console.warn("WS: Manual connect failed, no link_id available.")},[t==null?void 0:t.link_id,n,r,g]),w=v.useCallback(()=>{console.log("WS: Reconnecting..."),C("manual reconnect");const j=t==null?void 0:t.link_id;j&&setTimeout(()=>{g(j,n,r)},100)},[t==null?void 0:t.link_id,n,r,g,C]),S=v.useCallback(()=>{console.log("WS: Manual disconnect"),C("manual disconnect")},[C]),T=v.useCallback((j,N)=>{var O;(O=i.current)==null||O.on(j,N)},[]),k=v.useCallback((j,N)=>{var O;(O=i.current)==null||O.off(j,N)},[]),E=v.useCallback(()=>{y.current||(y.current=!0,h(!0))},[]),M=v.useCallback((j,N,O)=>{const z=new Set([Pe.AgentMessageCreate,Pe.AgentRequestHuman,Pe.MessageCreate,Pe.MessageTyping]);if(y.current&&z.has(j)){console.warn(`WS: Dropping '${j}' — chat marked as ended locally.`);return}if(new Set([Pe.AgentMessageCreate,Pe.AgentRequestHuman,Pe.MessageCreate,Pe.ChatClose]).has(j)){const D=Date.now(),I=b.current.get(j)??0;if(D-I<800){console.warn(`WS: Dropping '${j}' — duplicate within 800ms.`);return}b.current.set(j,D)}i.current&&i.current.connected?i.current.emit(j,N,O):console.warn(`WS: Cannot emit event '${j}', socket not connected.`)},[]),U=v.useMemo(()=>({connectionReady:d,connected:l,connect:m,reconnect:w,disconnect:S,on:T,off:k,emit:M,markChatEnded:E,chatEnded:p}),[l,d,m,w,S,T,k,M,E,p]);return f.jsx(Uk.Provider,{value:U,children:e})},cu=(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])},$o=()=>{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},Hk=()=>{let e=!1;return typeof window<"u"&&(e=new URLSearchParams(window.location.search).get("fullscreen")==="true"),e},cd=()=>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),[]);function E6(){const e=sd(),t=v.useCallback(()=>{const n=window.location.pathname;n!==e.page&&e.setPage(n)},[e.page]);return cu("popstate",t),null}function A6(){const e=xr(),t=sd(),n=v.useCallback(()=>{const r=window.location.pathname;if(r!==t.page){if(e){e.emit(Pe.PageChange,{page:r});return}t.setPage(r)}},[e,t.page]);return cu("popstate",n),v.useEffect(()=>{if(!e)return;const r=cL(),i=lL();r!==i&&(e.emit(Pe.PageChange,{page:i}),t.setPage(i))},[e]),null}function j6(){return E6(),null}const Tx=(e,t)=>{var n;return(n=e.find(r=>r.type===t))==null?void 0:n.content};function R6(){var be,P,Y,te;const e=Ae(),t=ne(Q=>Q.widget),n=ne(Q=>Q.setOpen),r=ne(Q=>Q.setAIAgent),i=ne(Q=>Q.setIsAIAgentMode),s=ne(Q=>Q.setIsHaveChat),o=ne(Q=>Q.isHaveChat),a=ne(Q=>Q.humanNeedRequested),l=ne(Q=>Q.setHumanNeedRequested),c=ne(Q=>Q.aiAgent),d=ne(Q=>Q.setShowActionButtons),u=ne(Q=>Q.defaultValues),[p,h]=v.useState(!1),[y,b]=v.useState(!1),[C,g]=v.useState(null),m=Ss(),w=$o(),S=cd(),[T,k]=v.useState(!0),[E,M]=v.useState(!1),U=sd(),j=cg(),N=xr(),O=Ru(),{data:z}=DS(t==null?void 0:t.link_id),[L,D]=v.useState(null),I=v.useRef(!1),F=v.useRef(!1),_=v.useRef(!1),B=v.useRef(!1),[V,G]=v.useState(!1),W=vl(),ee=v.useCallback(async()=>{var Q,ae,re;if(!(!t||B.current)){B.current=!0,G(!0),g(null),ne.getState().setHistoryChat(null),ne.getState().setHistoryMessages(null),ne.getState().clearAIAgentState(),d(!1);try{let ce=null;try{ce=await ug(t.link_id)}catch(X){console.error("Failed to resolve widget agent for new chat:",X),ce=null}O.setQueryData(OS(t.link_id),ce);const fe=(((re=(ae=(Q=t.appearance)==null?void 0:Q.body)==null?void 0:ae.inputs)==null?void 0:re.length)||0)>0;if(ce){if(D(ce),_.current)return;_.current=!0;try{const X={username:(u==null?void 0:u.username)||"Ziyaretçi",email:`visitor_${Date.now()}@temp.local`};u!=null&&u.secret_data&&(X.secret_data=u.secret_data);const[Z,R]=await j.mutateAsync({inputs:X,history:U.history,client_id:t.client_id,widget_id:t.link_id,device_id:Lr(t.link_id),is_agent_mode:!0});Yn(R)&&Kp(Z)?(an(Je.CustomerToken,Z.customer_token,t.link_id),an(Je.CustomerRefreshToken,Z.customer_refresh_token,t.link_id),an(Je.DeviceId,Z.device_id,t.link_id),U.clearHistory(),s(!0),r(ce),i(!0),m.push("chat")):(Co(Z),(Z==null?void 0:Z.statusCode)===403&&g((Z==null?void 0:Z.message)||"Sohbet başlatılamadı."))}catch(X){console.error("Error creating chat for AI agent:",X)}finally{_.current=!1}return}if(!fe){if(_.current)return;_.current=!0;try{const X={};u!=null&&u.secret_data&&(X.secret_data=u.secret_data),u!=null&&u.username&&(X.username=u.username);const[Z,R]=await j.mutateAsync({inputs:X,history:U.history,client_id:t.client_id,widget_id:t.link_id,device_id:Lr(t.link_id)});Yn(R)&&Kp(Z)?(an(Je.CustomerToken,Z.customer_token,t.link_id),an(Je.CustomerRefreshToken,Z.customer_refresh_token,t.link_id),an(Je.DeviceId,Z.device_id,t.link_id),U.clearHistory(),s(!0),m.push("chat")):(Co(Z),(Z==null?void 0:Z.statusCode)===403&&g((Z==null?void 0:Z.message)||"Sohbet başlatılamadı."))}catch(X){console.error("Error creating chat:",X)}finally{_.current=!1}return}D(null),k(!1)}finally{B.current=!1,G(!1)}}},[t,O,j,U,u==null?void 0:u.secret_data,u==null?void 0:u.username,s,r,i,m,d]),ue=v.useCallback(Q=>{M(Q)},[]);if(!t)return null;const me=()=>{n(!1)};v.useEffect(()=>{I.current=!1},[t==null?void 0:t.link_id]),v.useEffect(()=>{var ae,re,ce;if(!t)return;const Q=er(t.link_id);if(Q.isAgentMode&&Q.agent&&(W!=null&&W.accessToken)&&!I.current){if(I.current=!0,r(Q.agent),Q.sessionId&&ne.getState().setAIAgentSessionId(Q.sessionId),Q.humanNeedRequested){if(ne.getState().setHumanNeedRequested(!0),!((((ce=(re=(ae=t.appearance)==null?void 0:ae.body)==null?void 0:re.inputs)==null?void 0:ce.length)||0)>0)){m.push("chat");return}return}D(Q.agent),m.push("chat")}},[t,W==null?void 0:W.accessToken,W==null?void 0:W.refreshToken,m,r,i]),v.useEffect(()=>{if(!t)return;const Q=er(t.link_id);Q.isAgentMode&&Q.agent&&(W!=null&&W.accessToken)||z!==void 0&&D(z)},[t,z,W==null?void 0:W.accessToken]),v.useEffect(()=>{if(p||!t||!W||!W.accessToken){F.current=!1;return}if(F.current||a)return;if(o){m.push("chat");return}const Q=er(t.link_id);Q.isAgentMode&&Q.agent&&!Q.humanNeedRequested||(F.current=!0,IP(t.client_id,ns(ts(W),t.link_id)).then(([ae,re])=>{if(Yn(re))a||m.push("chat");else if(re===403){const ce=er(t.link_id);if(ce.isAgentMode&&ce.agent){if(ce.humanNeedRequested){r(ce.agent),i(!1),ce.sessionId&&ne.getState().setAIAgentSessionId(ce.sessionId),ne.getState().setHumanNeedRequested(!0);return}r(ce.agent),ce.sessionId&&ne.getState().setAIAgentSessionId(ce.sessionId),m.push("chat")}else Sa(t.link_id||""),h(!0)}else re===404?(Sa(t.link_id||""),h(!0)):re===401?(AS(t.link_id||""),h(!0)):m.push("chat")}).catch(()=>m.push("chat")))},[p,m,r,i,t,W==null?void 0:W.accessToken,W==null?void 0:W.refreshToken,o,a]);const pe=Tx(((P=(be=t.appearance)==null?void 0:be.head)==null?void 0:P.elements)||[],"text"),Se=Tx(((te=(Y=t.appearance)==null?void 0:Y.head)==null?void 0:te.elements)||[],"title"),ke=()=>{if(a&&t){let Q=c;if(!Q){const ae=er(t.link_id);ae.agent&&(Q=ae.agent,r(ae.agent),D(ae.agent))}if(Q){i(!0),ne.getState().setHistoryChat(null),ne.getState().setHistoryMessages(null),m.push("chat");return}}k(!0)},ye=()=>{L&&(r(L),i(!0),ne.getState().setHistoryChat(null),ne.getState().setHistoryMessages(null),m.push("chat"))},xe=v.useCallback(Q=>{if(!N||y)return;b(!0);const ae=()=>{N.emit(Pe.AgentRequestHuman,{},re=>{b(!1),re!=null&&re.success&&(ne.getState().setIsHaveChat(!0),d(!1),i(!1),l(!1),ne.getState().clearAIAgentState(),m.push("chat"))})};Q&&Object.keys(Q).length>0?N.emit(Pe.ChatUpdateInputs,{inputs:Q},re=>{re!=null&&re.success?ae():b(!1)}):ae()},[N,y,i,l,m]);return v.useEffect(()=>{var Q,ae,re;if(a){if(!c&&t){const ce=er(t.link_id);ce.agent&&(r(ce.agent),D(ce.agent))}(c||er((t==null?void 0:t.link_id)||"").agent)&&((((re=(ae=(Q=t==null?void 0:t.appearance)==null?void 0:Q.body)==null?void 0:ae.inputs)==null?void 0:re.length)||0)>0?k(!1):xe())}},[a,c,t,xe,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(x.HeaderBackground),color:e.getColor(x.HeaderText),borderColor:e.getColor(x.HeaderBorder),...w?{}:{borderTopLeftRadius:e.getRadius(),borderTopRightRadius:e.getRadius()}},children:[f.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[!T&&(E||a&&(c||t&&er(t.link_id).agent))&&f.jsx("button",{type:"button",onClick:ke,className:"flex-shrink-0 p-1 hover:opacity-80 transition-opacity",children:f.jsx(J.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:T?"Geçmiş sohbetler":Se||"Müşteri Hizmetleri"}),!T&&pe&&f.jsx("div",{className:"text-xs opacity-90 truncate",children:pe})]})]}),f.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0 ml-2",children:[f.jsx(PL,{}),S&&f.jsx("button",{type:"button",onClick:me,className:"p-1.5 rounded-md hover:opacity-80 transition-opacity",children:f.jsx(J.X,{className:"w-5 h-5"})})]})]}),f.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-h-0",style:{backgroundColor:e.getColor(x.Background)},children:T?f.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-h-0",children:f.jsx(RL,{onHasHistory:ue,emptyStateText:C||void 0})}):f.jsx("div",{className:"flex-1 overflow-y-auto",children:f.jsx(yL,{clientId:t.client_id,widgetId:t.link_id,appearance:t.appearance,aiAgentMode:!!L&&!a,onAIAgentStart:ye,onOk:()=>{a&&c||(ne.getState().setHistoryChat(null),ne.getState().setHistoryMessages(null),m.push("chat"))},onOperatorConnect:a&&(c||er(t.link_id).agent)?xe:void 0,isConnectingToOperator:y})})}),T&&f.jsxs("div",{className:"flex-shrink-0",style:{backgroundColor:e.getColor(x.Background)},children:[f.jsx("div",{className:"px-5 py-2",children:f.jsxs(En,{onClick:ee,disabled:V,size:"lg",className:"w-full flex items-center justify-center gap-2",children:[f.jsx(J.Plus,{className:"size-4"}),f.jsx("span",{children:V?"Hazırlanıyor…":"Yeni Sohbet Başlat"})]})}),f.jsx(Eo,{variant:"block"})]})]})}function M6(){return f.jsxs(f.Fragment,{children:[f.jsx(R6,{}),f.jsx(j6,{})]})}const P6=[{path:"/",component:M6,name:"registration"}],N6=/^admin_([a-f0-9]{24})_(.+)$/i;function Kr(e){return e.profile_id?`id:${e.profile_id}`:`name:${e.name.trim().toLowerCase()}`}function Ex(e){const t=e.trim().match(N6);return t?{profile_id:t[1],name:t[2]}:null}function O6(e,t){const n=e?[...e]:[],r=Kr(t),i=n.findIndex(s=>Kr(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 hh(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 D6(e,t){const n=t.profile_id!=null&&t.profile_id!==""?hh(e,{profile_id:t.profile_id}):hh(e,{name:t.name});return[t,...n]}function la(e){const t=e[0];return t?{agent_name:t.name,agent_avatar:t.avatar}:{agent_name:void 0,agent_avatar:void 0}}function I6(e){const t=new Map,n=[];for(const r of e)if(r.sender_type===ve.Activity){if(r.activity_type===sn.AdminJoin){let i;const s=typeof r.content=="string"?Ex(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=Kr(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===sn.AdminLeave){const i=typeof r.content=="string"?Ex(r.content):null;if(i){const s=Kr({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=Kr({name:r.sender_name});t.delete(s);const o=n.indexOf(s);o>=0&&n.splice(o,1)}}else if(r.activity_type===sn.ChatTransferred){if(r.sender_id){const i=Kr({profile_id:r.sender_id,name:""});t.delete(i);const s=n.indexOf(i);s>=0&&n.splice(s,1)}else if(r.sender_name){const i=Kr({name:r.sender_name});t.delete(i);const s=n.indexOf(i);s>=0&&n.splice(s,1)}}}return n.map(r=>t.get(r)).filter(r=>r!=null)}function Dg(e,t){return e!=null&&e.trim()?[{name:e.trim(),avatar:t}]:[]}function Ax(e){const t=e.participants&&e.participants.length>0?e.participants:Dg(e.agent_name,e.agent_avatar),n=la(t);return{...e,participants:t,agent_name:n.agent_name,agent_avatar:n.agent_avatar}}function L6(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 F6="/notify.mp3",Ig="lc:notification_sound_muted",Wk=()=>{try{return sessionStorage.getItem(Ig)==="1"}catch{return!1}},qk=e=>{try{sessionStorage.setItem(Ig,e?"1":"0")}catch{}},B6=async e=>{try{if(sessionStorage.getItem(Ig)==="1")return}catch{}await new Audio(e||F6).play()},mf=[Be.Light,Be.Dark,Be.System];function $6(e){switch(e){case Be.Light:return J.Sun;case Be.Dark:return J.Moon;case Be.System:return J.Monitor;default:return J.Monitor}}function z6({onChatClose:e}){const[t,n]=v.useState(!1),[r,i]=v.useState(!1),[s,o]=v.useState(()=>Wk()),a=v.useRef(null),l=v.useRef(null),c=Ae(),d=Lo(),u=xr(),{setShowActionButtons:p}=ne(),{mode:h,setMode:y}=c,b=()=>{u==null||u.emit(Pe.ChatClose,{}),p(!1),e()},C=()=>{const w=mf.indexOf(h),S=mf[(w+1)%mf.length];y(S)},g=()=>{const w=!s;qk(w),o(w)};v.useEffect(()=>{if(!r)return;const w=S=>{var T,k;(T=l.current)!=null&&T.contains(S.target)||(k=a.current)!=null&&k.contains(S.target)||i(!1)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[r]);const m=r&&f.jsxs(De.div,{ref:l,onMouseDown:w=>w.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(x.Background),borderColor:c.getColor(x.Border),borderRadius:c.getRadius(),boxShadow:`0 4px 12px ${c.getColor(x.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(x.ErrorText)},onClick:()=>{i(!1),n(!0)},children:[f.jsx(J.XCircle,{className:"size-4 flex-shrink-0"}),d(se.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(x.InputText)},onClick:g,children:[s?f.jsx(J.VolumeX,{className:"size-4 flex-shrink-0"}):f.jsx(J.Volume2,{className:"size-4 flex-shrink-0"}),d(s?se.NotificationSoundOn:se.NotificationSoundOff)]}),f.jsx("div",{className:"my-1 h-px",style:{backgroundColor:c.getColor(x.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(x.InputText)},onClick:C,children:[(()=>{const w=$6(h);return f.jsx(w,{className:"size-4 flex-shrink-0"})})(),h===Be.Light?"Açık tema":h===Be.Dark?"Koyu tema":"Sistem"]})]});return f.jsxs(f.Fragment,{children:[f.jsx(Dr,{children:t&&f.jsx(De.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(x.ModalOverlayColor)},children:f.jsxs(De.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(x.Background),borderRadius:c.getRadius()},children:[f.jsx("div",{className:"text-base font-semibold mb-2",style:{color:c.getColor(x.ChatCloseConfirmText)},children:d(se.ChatCloseConfirm)}),f.jsx("div",{className:"text-sm mb-4",style:{color:c.getColor(x.FooterText)},children:d(se.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(x.GreeterBackground),color:c.getColor(x.GreeterText),borderRadius:c.getRadius()},onClick:()=>n(!1),children:d(se.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(x.ErrorBackground),color:c.getColor(x.ErrorText),borderRadius:c.getRadius()},onClick:b,children:d(se.CloseAction)})]})]})})}),f.jsxs("div",{className:"relative flex-shrink-0",children:[f.jsx("button",{ref:a,type:"button",onClick:()=>i(w=>!w),className:"flex items-center justify-center p-1.5 rounded-md hover:opacity-80 transition-opacity",style:{backgroundColor:"transparent",color:c.getColor(x.HeaderText)},title:d(se.ChatSettings),"aria-expanded":r,children:f.jsx(J.Menu,{className:"size-5"})}),f.jsx(Dr,{children:m})]})]})}function V6(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 mh({text:e}){const n=Ae().getColor(x.LinkColor),i=(s=>{const o=V6(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 b=y.replace(/[">]+$/,"");return`<a href="${/^https?:\/\//i.test(b)?b:`https://${b}`}" target="_blank" rel="noopener noreferrer" style="color: ${n}; text-decoration: underline;">${b}</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 jx="opacity-0 group-hover/item:opacity-100 transition-opacity duration-200";function Gk({files:e,className:t,onDelete:n,hideName:r}){const i=$o(),{getColor:s}=Ae(),[o,a]=v.useState(new Map),[l,c]=v.useState(null);v.useEffect(()=>{const g=new Map;for(let m=0;m<e.length;m++){const w=e[m];if(w instanceof File){const S=URL.createObjectURL(w);g.set(m,S)}}return a(g),()=>{for(const m of g.values())URL.revokeObjectURL(m)}},[e]);const d=g=>{var w;return((w=(g instanceof File?g.name:g).split(".").pop())==null?void 0:w.toLowerCase())||""},u=g=>g instanceof File?g.name:g.split("/").pop()||g,p=g=>{const[m,w]=g.split(".");return m.length>10?`${m.slice(0,10)}...${w}`:g},h=g=>{const m=["jpg","jpeg","png","gif","bmp","webp","svg"],w=d(g);return m.includes(w)},y=(g,m)=>{if(g instanceof File){const w=o.get(m);w&&window.open(w,"_blank")}else window.open(g,"_blank")},b=(g,m)=>{g.stopPropagation(),n==null||n(m)},C=(g,m)=>g instanceof File?o.get(m)||"":g;return f.jsx("div",{className:Oe("flex gap-2 w-full overflow-x-auto",t),children:e.map((g,m)=>{const w=u(g),S=d(g),T=h(g),k=C(g,m);return f.jsxs("div",{onClick:()=>y(g,m),onMouseEnter:()=>c(m),onMouseLeave:()=>c(null),className:"min-w-20 max-w-20 cursor-pointer group/item border rounded-lg p-1.5 transition-all duration-200 relative",style:{backgroundColor:s(x.Background),borderColor:s(l===m?x.InputBorder:x.Border),boxShadow:l===m?`0 4px 6px -1px ${s(x.ShadowColor)}`:void 0},children:[n&&f.jsx("button",{onClick:E=>b(E,m),className:Oe("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"})})}),T?f.jsx("div",{className:"aspect-square w-fit mb-0.5 overflow-hidden rounded",children:f.jsx("img",{src:k,alt:w,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 rounded transition-colors duration-200",style:{backgroundColor:s(l===m?x.CloseButtonHover:x.InputBackground)},children:f.jsxs("div",{className:"text-center",children:[f.jsx("div",{className:"w-6 h-6 mx-auto mb-0.5 rounded flex items-center justify-center",style:{backgroundColor:`color-mix(in srgb, ${s(x.ButtonBackground)} 20%, transparent)`},children:f.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",style:{color:s(x.ButtonBackground)},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:Oe("text-[10px] font-medium uppercase",{[jx]:r}),style:{color:s(x.FooterText)},children:S||"file"})]})}),f.jsx("div",{className:Oe("max-w-16 text-[10px] font-medium truncate text-ellipsis overflow-hidden",{[jx]:r}),style:{color:s(x.InputText)},title:w,children:p(w)})]},m)})})}const Lg="livechat:send:";function Rx(e){const t=(e==null?void 0:e.trim())??"";if(!t)return{text:"",suggestedQuestions:[]};let n=null;try{n=JSON.parse(t)}catch{const l=t.indexOf("{"),c=t.lastIndexOf("}");if(l!==-1&&c>l)try{n=JSON.parse(t.slice(l,c+1))}catch{n=null}}if(!n||typeof n!="object"||Array.isArray(n))return{text:e,suggestedQuestions:[]};const r=n,i=r.generation;let s;typeof i=="string"&&i.trim()?s=i.trim():i!=null&&(typeof i=="number"||typeof i=="boolean")?s=String(i):s=e;const o=r.suggested_questions,a=[];if(Array.isArray(o))for(const l of o){if(typeof l=="string"){const c=l.trim();c&&a.push(c)}if(a.length>=10)break}return{text:s,suggestedQuestions:a}}function U6(e){return`${Lg}${encodeURIComponent(e)}`}function ca(e){return e.startsWith(Lg)}function H6(e){if(!ca(e))return null;try{return decodeURIComponent(e.slice(Lg.length))}catch{return null}}function W6(e){const t=e.id&&String(e.id).trim()||"";if(t)return`id:${t}`;const n=e._id;if(n!=null&&String(n).trim())return`id:${String(n)}`;const r=typeof e.created_at=="string"?e.created_at:e.created_at instanceof Date?e.created_at.toISOString():"",i=(e.content||"").slice(0,40);return`fall:${r}:${i}`}function Mx(e){if(e.sender_type!==ve.Agent)return{content:e.content,buttons:e.buttons};if(e.buttons&&e.buttons.length>0)return{content:e.content,buttons:e.buttons};if(Array.isArray(e.buttons)&&e.buttons.length===0){const{text:r}=Rx(e.content);return{content:r,buttons:void 0}}const{text:t,suggestedQuestions:n}=Rx(e.content);return n.length===0?{content:t,buttons:void 0}:{content:t,buttons:n.map(r=>({label:r,url:U6(r)}))}}const q6={hidden:{opacity:0,y:8},visible:{opacity:1,y:0}},G6={hidden:{opacity:0,y:8,scale:.95},visible:{opacity:1,y:0,scale:1}};function Yk({buttons:e,className:t="",onLivechatSend:n,suggestGroupSpent:r=!1}){const i=Ae();if(!e||e.length===0)return null;const s=e.some(l=>ca(l.url)),o=(l,c)=>{if(ca(l)){if(r)return;const d=H6(l);d&&n&&n(d),c.currentTarget.blur();return}l.startsWith("http://")||l.startsWith("https://")?window.open(l,"_blank","noopener,noreferrer"):l.startsWith("tel:")||l.startsWith("mailto:")?window.location.href=l:console.log("Custom action:",l)},a=l=>ca(l)?null:l.startsWith("http://")||l.startsWith("https://")?f.jsx(J.ExternalLink,{className:"size-4"}):l.startsWith("tel:")?f.jsx(J.Phone,{className:"size-4"}):l.startsWith("mailto:")?f.jsx(J.Mail,{className:"size-4"}):null;return f.jsx(De.div,{className:Oe(t,"mt-2",r&&s&&"opacity-50"),initial:"hidden",animate:"visible",variants:q6,transition:{duration:.3,ease:"easeOut",staggerChildren:.08},children:f.jsx("div",{className:"rounded-lg ",style:{backgroundColor:`${i.getColor(x.Background)}f0`},children:f.jsx("div",{className:Oe("flex flex-wrap",s?"gap-1.5":"gap-2"),children:e.map((l,c)=>{const d=ca(l.url),u=d&&r;return f.jsxs(De.button,{type:"button",disabled:u,"aria-disabled":u||void 0,variants:G6,transition:{duration:.25,ease:"easeOut"},whileHover:u?void 0:{scale:1.02,y:-1,transition:{duration:.15}},whileTap:u?void 0:{scale:.98,transition:{duration:.1}},onClick:p=>o(l.url,p),className:Oe("group inline-flex items-center font-medium transition-all duration-200 relative overflow-hidden",u?"cursor-not-allowed":"cursor-pointer","outline-none focus:outline-none focus-visible:outline-none","[-webkit-tap-highlight-color:transparent]",d?"gap-1.5 px-2.5 py-1.5 text-xs rounded-md max-w-[100%] text-left":"gap-2 px-4 py-2.5 text-sm"),style:{backgroundColor:i.getColor(x.GreeterBackground),color:i.getColor(x.GreeterText),borderRadius:i.getRadius(),border:`1px solid ${i.getColor(x.DividerColor)}`,boxShadow:`0 1px 3px ${i.getColor(x.ShadowColor)}30`},onMouseEnter:p=>{u||(p.currentTarget.style.backgroundColor=i.getColor(x.ButtonBackground),p.currentTarget.style.color=i.getColor(x.ButtonText),p.currentTarget.style.borderColor=i.getColor(x.ButtonBackground),p.currentTarget.style.boxShadow=`0 4px 12px ${i.getColor(x.ShadowColor)}40`)},onMouseLeave:p=>{p.currentTarget.style.backgroundColor=i.getColor(x.GreeterBackground),p.currentTarget.style.color=i.getColor(x.GreeterText),p.currentTarget.style.borderColor=i.getColor(x.DividerColor),p.currentTarget.style.boxShadow=`0 1px 3px ${i.getColor(x.ShadowColor)}30`},children:[f.jsxs("span",{className:Oe("flex items-center min-w-0",d?"gap-1.5":"gap-2"),children:[a(l.url),f.jsx("span",{className:Oe(d?"font-normal leading-snug":"font-medium"),children:l.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%, ${i.getColor(x.ButtonText)}10 50%, transparent 70%)`,borderRadius:i.getRadius()}})]},`${l.label}-${c}`)})})})})}const gh=700,Y6=700;function Q6({msgId:e,skipStagger:t,isCustomerSide:n,hasButtons:r,buttons:i,suggestGroupSpent:s,suggestKey:o,onLivechatSendSuggested:a,setSpentSuggestMsgIds:l}){const[c,d]=v.useState(t&&r);return v.useEffect(()=>{if(t){d(r);return}let u;return d(!1),r&&(u=setTimeout(()=>d(!0),gh)),()=>{u!==void 0&&clearTimeout(u)}},[e,t,r]),r?f.jsx("div",{className:Oe("w-full",{"flex justify-end":n,"flex justify-start":!n}),children:f.jsx("div",{className:"max-w-[80%]",children:c&&f.jsx(Yk,{buttons:i,suggestGroupSpent:s,onLivechatSend:u=>{l(p=>{const h=new Set(p);return h.add(o),h}),a==null||a(u,!0)}})})}):null}function K6({msgId:e,text:t,delayMs:n,getBubbleRadius:r}){const i=Ae(),[s,o]=v.useState(n<=0);return v.useEffect(()=>{if(n<=0){o(!0);return}o(!1);const a=setTimeout(()=>o(!0),n);return()=>clearTimeout(a)},[e,n]),s?f.jsx("div",{className:"flex w-full min-w-0 justify-start mt-2",children:f.jsx("div",{className:"max-w-[80%] border-0 px-3 py-2 whitespace-pre-wrap !text-sm",style:{backgroundColor:i.getColor(x.MessageAdminBackground),color:i.getColor(x.MessageAdminText),borderRadius:r(ve.Agent)},children:f.jsx(mh,{text:t})})}):null}const Px=e=>e?(typeof e=="string"&&(e=new Date(e)),e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})):"";function Qk({messages:e,isTyping:t,chat:n,streamingContent:r,streamingStatusText:i,onLivechatSendSuggested:s}){var E,M,U,j;const o=v.useRef(null),a=v.useRef(null),[l,c]=v.useState(!0),d=v.useRef(!0),{widget:u,showActionButtons:p}=ne(),h=Ae(),y=v.useRef(!0),b=v.useRef(new Set),[C,g]=v.useState(()=>new Set),m=v.useRef(null);v.useEffect(()=>{m.current===null&&e.length!==0&&(m.current=new Set(e.map(N=>String(N.id??"")).filter(Boolean)))},[e]),v.useEffect(()=>{e.length>0&&y.current&&requestAnimationFrame(()=>{y.current=!1})},[e]),v.useEffect(()=>{e.length===0&&(b.current.clear(),g(new Set),m.current=null)},[e.length]);const w=()=>{const N=a.current;N&&(N.scrollTop=N.scrollHeight)},S=()=>{if(a.current){const{scrollTop:N,scrollHeight:O,clientHeight:z}=a.current,L=O-N<=z+10;d.current=L,c(L)}};v.useEffect(()=>{(d.current||t)&&w()},[e,t,r,i]);const T=(N,O)=>{if(y.current)return{initial:!1,animate:{}};const z=N.id||"";return b.current.has(z)?O===ve.Customer?{initial:!1,animate:{opacity:1,x:0}}:{initial:!1,animate:{}}:(b.current.add(z),O===ve.Customer?{initial:{opacity:0,x:30},animate:{opacity:1,x:0}}:{initial:!1,animate:{}})},k=N=>N===ve.Customer?"18px 18px 4px 18px":N===ve.User||N===ve.Agent?"18px 18px 18px 4px":h.getRadius();return f.jsxs("section",{onScroll:S,ref:a,className:"flex flex-col gap-3 w-full grow pt-4 px-4 overflow-y-auto overflow-x-hidden scrollbar",children:[((M=(E=u==null?void 0:u.appearance)==null?void 0:E.design)==null?void 0:M.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:h.getColor(x.MessageAdminBackground),color:h.getColor(x.MessageAdminText),borderRadius:"18px 18px 18px 4px"},children:(j=(U=u==null?void 0:u.appearance)==null?void 0:U.design)==null?void 0:j.greeting_message})}),f.jsx(Dr,{children:Array.isArray(e)&&(()=>{const N=e.filter(_=>{var B;return _!=null&&(!!_.content||(((B=_.files)==null?void 0:B.length)??0)>0)&&_.content!==`
|
|
97
|
-
|
|
45
|
+
*/var lt=typeof Symbol=="function"&&Symbol.for,ho=lt?Symbol.for("react.element"):60103,mo=lt?Symbol.for("react.portal"):60106,ss=lt?Symbol.for("react.fragment"):60107,as=lt?Symbol.for("react.strict_mode"):60108,os=lt?Symbol.for("react.profiler"):60114,ls=lt?Symbol.for("react.provider"):60109,cs=lt?Symbol.for("react.context"):60110,go=lt?Symbol.for("react.async_mode"):60111,us=lt?Symbol.for("react.concurrent_mode"):60111,ds=lt?Symbol.for("react.forward_ref"):60112,ps=lt?Symbol.for("react.suspense"):60113,Nb=lt?Symbol.for("react.suspense_list"):60120,fs=lt?Symbol.for("react.memo"):60115,hs=lt?Symbol.for("react.lazy"):60116,Ib=lt?Symbol.for("react.block"):60121,Mb=lt?Symbol.for("react.fundamental"):60117,$b=lt?Symbol.for("react.responder"):60118,Db=lt?Symbol.for("react.scope"):60119;function It(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case ho:switch(t=t.type,t){case go:case us:case ss:case os:case as:case ps:return t;default:switch(t=t&&t.$$typeof,t){case cs:case ds:case hs:case fs:case ls:return t;default:return e}}case mo:return e}}}function fd(t){return It(t)===us}De.AsyncMode=go;De.ConcurrentMode=us;De.ContextConsumer=cs;De.ContextProvider=ls;De.Element=ho;De.ForwardRef=ds;De.Fragment=ss;De.Lazy=hs;De.Memo=fs;De.Portal=mo;De.Profiler=os;De.StrictMode=as;De.Suspense=ps;De.isAsyncMode=function(t){return fd(t)||It(t)===go};De.isConcurrentMode=fd;De.isContextConsumer=function(t){return It(t)===cs};De.isContextProvider=function(t){return It(t)===ls};De.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===ho};De.isForwardRef=function(t){return It(t)===ds};De.isFragment=function(t){return It(t)===ss};De.isLazy=function(t){return It(t)===hs};De.isMemo=function(t){return It(t)===fs};De.isPortal=function(t){return It(t)===mo};De.isProfiler=function(t){return It(t)===os};De.isStrictMode=function(t){return It(t)===as};De.isSuspense=function(t){return It(t)===ps};De.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===ss||t===us||t===os||t===as||t===ps||t===Nb||typeof t=="object"&&t!==null&&(t.$$typeof===hs||t.$$typeof===fs||t.$$typeof===ls||t.$$typeof===cs||t.$$typeof===ds||t.$$typeof===Mb||t.$$typeof===$b||t.$$typeof===Db||t.$$typeof===Ib)};De.typeOf=It;pd.exports=De;var Fb=pd.exports,hd=Fb,Pb={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Bb={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},md={};md[hd.ForwardRef]=Pb;md[hd.Memo]=Bb;function at(){return at=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},at.apply(this,arguments)}function gd(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,s;for(s=0;s<r.length;s++)i=r[s],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}var ms=p.createContext(void 0);ms.displayName="FormikContext";ms.Provider;ms.Consumer;function Lb(){var t=p.useContext(ms);return t}var zt=function(e){return typeof e=="function"},gs=function(e){return e!==null&&typeof e=="object"},zb=function(e){return String(Math.floor(Number(e)))===e},Ms=function(e){return Object.prototype.toString.call(e)==="[object String]"},$s=function(e){return gs(e)&&zt(e.then)};function Et(t,e,n,r){r===void 0&&(r=0);for(var i=dd(e);t&&r<i.length;)t=t[i[r++]];return r!==i.length&&!t||t===void 0?n:t}function Yn(t,e,n){for(var r=Yl(t),i=r,s=0,a=dd(e);s<a.length-1;s++){var l=a[s],c=Et(t,a.slice(0,s+1));if(c&&(gs(c)||Array.isArray(c)))i=i[l]=Yl(c);else{var d=a[s+1];i=i[l]=zb(d)&&Number(d)>=0?[]:{}}}return(s===0?t:i)[a[s]]===n?t:(n===void 0?delete i[a[s]]:i[a[s]]=n,s===0&&n===void 0&&delete r[a[s]],r)}function yd(t,e,n,r){n===void 0&&(n=new WeakMap),r===void 0&&(r={});for(var i=0,s=Object.keys(t);i<s.length;i++){var a=s[i],l=t[a];gs(l)?n.get(l)||(n.set(l,!0),r[a]=Array.isArray(l)?[]:{},yd(l,e,n,r[a])):r[a]=e}return r}function Hb(t,e){switch(e.type){case"SET_VALUES":return at({},t,{values:e.payload});case"SET_TOUCHED":return at({},t,{touched:e.payload});case"SET_ERRORS":return Mn(t.errors,e.payload)?t:at({},t,{errors:e.payload});case"SET_STATUS":return at({},t,{status:e.payload});case"SET_ISSUBMITTING":return at({},t,{isSubmitting:e.payload});case"SET_ISVALIDATING":return at({},t,{isValidating:e.payload});case"SET_FIELD_VALUE":return at({},t,{values:Yn(t.values,e.payload.field,e.payload.value)});case"SET_FIELD_TOUCHED":return at({},t,{touched:Yn(t.touched,e.payload.field,e.payload.value)});case"SET_FIELD_ERROR":return at({},t,{errors:Yn(t.errors,e.payload.field,e.payload.value)});case"RESET_FORM":return at({},t,e.payload);case"SET_FORMIK_STATE":return e.payload(t);case"SUBMIT_ATTEMPT":return at({},t,{touched:yd(t.values,!0),isSubmitting:!0,submitCount:t.submitCount+1});case"SUBMIT_FAILURE":return at({},t,{isSubmitting:!1});case"SUBMIT_SUCCESS":return at({},t,{isSubmitting:!1});default:return t}}var In={},bi={};function Ub(t){var e=t.validateOnChange,n=e===void 0?!0:e,r=t.validateOnBlur,i=r===void 0?!0:r,s=t.validateOnMount,a=s===void 0?!1:s,l=t.isInitialValid,c=t.enableReinitialize,d=c===void 0?!1:c,f=t.onSubmit,u=gd(t,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),m=at({validateOnChange:n,validateOnBlur:i,validateOnMount:a,onSubmit:f},u),h=p.useRef(m.initialValues),b=p.useRef(m.initialErrors||In),C=p.useRef(m.initialTouched||bi),y=p.useRef(m.initialStatus),v=p.useRef(!1),E=p.useRef({});p.useEffect(function(){return v.current=!0,function(){v.current=!1}},[]);var I=p.useState(0),_=I[1],L=p.useRef({values:xi(m.initialValues),errors:xi(m.initialErrors)||In,touched:xi(m.initialTouched)||bi,status:xi(m.initialStatus),isSubmitting:!1,isValidating:!1,submitCount:0}),w=L.current,$=p.useCallback(function(k){var z=L.current;L.current=Hb(z,k),z!==L.current&&_(function(O){return O+1})},[]),H=p.useCallback(function(k,z){return new Promise(function(O,N){var X=m.validate(k,z);X==null?O(In):$s(X)?X.then(function(ie){O(ie||In)},function(ie){N(ie)}):O(X)})},[m.validate]),q=p.useCallback(function(k,z){var O=m.validationSchema,N=zt(O)?O(z):O,X=z&&N.validateAt?N.validateAt(z,k):Wb(k,N);return new Promise(function(ie,xe){X.then(function(){ie(In)},function(Ne){Ne.name==="ValidationError"?ie(qb(Ne)):xe(Ne)})})},[m.validationSchema]),F=p.useCallback(function(k,z){return new Promise(function(O){return O(E.current[k].validate(z))})},[]),T=p.useCallback(function(k){var z=Object.keys(E.current).filter(function(N){return zt(E.current[N].validate)}),O=z.length>0?z.map(function(N){return F(N,Et(k,N))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(O).then(function(N){return N.reduce(function(X,ie,xe){return ie==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||ie&&(X=Yn(X,z[xe],ie)),X},{})})},[F]),A=p.useCallback(function(k){return Promise.all([T(k),m.validationSchema?q(k):{},m.validate?H(k):{}]).then(function(z){var O=z[0],N=z[1],X=z[2],ie=ma.all([O,N,X],{arrayMerge:Vb});return ie})},[m.validate,m.validationSchema,T,H,q]),B=Dt(function(k){return k===void 0&&(k=w.values),$({type:"SET_ISVALIDATING",payload:!0}),A(k).then(function(z){return v.current&&($({type:"SET_ISVALIDATING",payload:!1}),$({type:"SET_ERRORS",payload:z})),z})});p.useEffect(function(){a&&v.current===!0&&Mn(h.current,m.initialValues)&&B(h.current)},[a,B]);var D=p.useCallback(function(k){var z=k&&k.values?k.values:h.current,O=k&&k.errors?k.errors:b.current?b.current:m.initialErrors||{},N=k&&k.touched?k.touched:C.current?C.current:m.initialTouched||{},X=k&&k.status?k.status:y.current?y.current:m.initialStatus;h.current=z,b.current=O,C.current=N,y.current=X;var ie=function(){$({type:"RESET_FORM",payload:{isSubmitting:!!k&&!!k.isSubmitting,errors:O,touched:N,status:X,values:z,isValidating:!!k&&!!k.isValidating,submitCount:k&&k.submitCount&&typeof k.submitCount=="number"?k.submitCount:0}})};if(m.onReset){var xe=m.onReset(w.values,W);$s(xe)?xe.then(ie):ie()}else ie()},[m.initialErrors,m.initialStatus,m.initialTouched,m.onReset]);p.useEffect(function(){v.current===!0&&!Mn(h.current,m.initialValues)&&d&&(h.current=m.initialValues,D(),a&&B(h.current))},[d,m.initialValues,D,a,B]),p.useEffect(function(){d&&v.current===!0&&!Mn(b.current,m.initialErrors)&&(b.current=m.initialErrors||In,$({type:"SET_ERRORS",payload:m.initialErrors||In}))},[d,m.initialErrors]),p.useEffect(function(){d&&v.current===!0&&!Mn(C.current,m.initialTouched)&&(C.current=m.initialTouched||bi,$({type:"SET_TOUCHED",payload:m.initialTouched||bi}))},[d,m.initialTouched]),p.useEffect(function(){d&&v.current===!0&&!Mn(y.current,m.initialStatus)&&(y.current=m.initialStatus,$({type:"SET_STATUS",payload:m.initialStatus}))},[d,m.initialStatus,m.initialTouched]);var M=Dt(function(k){if(E.current[k]&&zt(E.current[k].validate)){var z=Et(w.values,k),O=E.current[k].validate(z);return $s(O)?($({type:"SET_ISVALIDATING",payload:!0}),O.then(function(N){return N}).then(function(N){$({type:"SET_FIELD_ERROR",payload:{field:k,value:N}}),$({type:"SET_ISVALIDATING",payload:!1})})):($({type:"SET_FIELD_ERROR",payload:{field:k,value:O}}),Promise.resolve(O))}else if(m.validationSchema)return $({type:"SET_ISVALIDATING",payload:!0}),q(w.values,k).then(function(N){return N}).then(function(N){$({type:"SET_FIELD_ERROR",payload:{field:k,value:Et(N,k)}}),$({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),R=p.useCallback(function(k,z){var O=z.validate;E.current[k]={validate:O}},[]),P=p.useCallback(function(k){delete E.current[k]},[]),j=Dt(function(k,z){$({type:"SET_TOUCHED",payload:k});var O=z===void 0?i:z;return O?B(w.values):Promise.resolve()}),U=p.useCallback(function(k){$({type:"SET_ERRORS",payload:k})},[]),Y=Dt(function(k,z){var O=zt(k)?k(w.values):k;$({type:"SET_VALUES",payload:O});var N=z===void 0?n:z;return N?B(O):Promise.resolve()}),Q=p.useCallback(function(k,z){$({type:"SET_FIELD_ERROR",payload:{field:k,value:z}})},[]),Z=Dt(function(k,z,O){$({type:"SET_FIELD_VALUE",payload:{field:k,value:z}});var N=O===void 0?n:O;return N?B(Yn(w.values,k,z)):Promise.resolve()}),ee=p.useCallback(function(k,z){var O=z,N=k,X;if(!Ms(k)){k.persist&&k.persist();var ie=k.target?k.target:k.currentTarget,xe=ie.type,Ne=ie.name,Ge=ie.id,pt=ie.value,et=ie.checked,Lt=ie.outerHTML,ft=ie.options,rt=ie.multiple;O=z||Ne||Ge,N=/number|range/.test(xe)?(X=parseFloat(pt),isNaN(X)?"":X):/checkbox/.test(xe)?Yb(Et(w.values,O),et,pt):ft&&rt?Kb(ft):pt}O&&Z(O,N)},[Z,w.values]),se=Dt(function(k){if(Ms(k))return function(z){return ee(z,k)};ee(k)}),ce=Dt(function(k,z,O){z===void 0&&(z=!0),$({type:"SET_FIELD_TOUCHED",payload:{field:k,value:z}});var N=O===void 0?i:O;return N?B(w.values):Promise.resolve()}),ue=p.useCallback(function(k,z){k.persist&&k.persist();var O=k.target,N=O.name,X=O.id,ie=O.outerHTML,xe=z||N||X;ce(xe,!0)},[ce]),je=Dt(function(k){if(Ms(k))return function(z){return ue(z,k)};ue(k)}),Te=p.useCallback(function(k){zt(k)?$({type:"SET_FORMIK_STATE",payload:k}):$({type:"SET_FORMIK_STATE",payload:function(){return k}})},[]),Se=p.useCallback(function(k){$({type:"SET_STATUS",payload:k})},[]),ve=p.useCallback(function(k){$({type:"SET_ISSUBMITTING",payload:k})},[]),ge=Dt(function(){return $({type:"SUBMIT_ATTEMPT"}),B().then(function(k){var z=k instanceof Error,O=!z&&Object.keys(k).length===0;if(O){var N;try{if(N=K(),N===void 0)return}catch(X){throw X}return Promise.resolve(N).then(function(X){return v.current&&$({type:"SUBMIT_SUCCESS"}),X}).catch(function(X){if(v.current)throw $({type:"SUBMIT_FAILURE"}),X})}else if(v.current&&($({type:"SUBMIT_FAILURE"}),z))throw k})}),S=Dt(function(k){k&&k.preventDefault&&zt(k.preventDefault)&&k.preventDefault(),k&&k.stopPropagation&&zt(k.stopPropagation)&&k.stopPropagation(),ge().catch(function(z){console.warn("Warning: An unhandled error was caught from submitForm()",z)})}),W={resetForm:D,validateForm:B,validateField:M,setErrors:U,setFieldError:Q,setFieldTouched:ce,setFieldValue:Z,setStatus:Se,setSubmitting:ve,setTouched:j,setValues:Y,setFormikState:Te,submitForm:ge},K=Dt(function(){return f(w.values,W)}),he=Dt(function(k){k&&k.preventDefault&&zt(k.preventDefault)&&k.preventDefault(),k&&k.stopPropagation&&zt(k.stopPropagation)&&k.stopPropagation(),D()}),ae=p.useCallback(function(k){return{value:Et(w.values,k),error:Et(w.errors,k),touched:!!Et(w.touched,k),initialValue:Et(h.current,k),initialTouched:!!Et(C.current,k),initialError:Et(b.current,k)}},[w.errors,w.touched,w.values]),be=p.useCallback(function(k){return{setValue:function(O,N){return Z(k,O,N)},setTouched:function(O,N){return ce(k,O,N)},setError:function(O){return Q(k,O)}}},[Z,ce,Q]),Pe=p.useCallback(function(k){var z=gs(k),O=z?k.name:k,N=Et(w.values,O),X={name:O,value:N,onChange:se,onBlur:je};if(z){var ie=k.type,xe=k.value,Ne=k.as,Ge=k.multiple;ie==="checkbox"?xe===void 0?X.checked=!!N:(X.checked=!!(Array.isArray(N)&&~N.indexOf(xe)),X.value=xe):ie==="radio"?(X.checked=N===xe,X.value=xe):Ne==="select"&&Ge&&(X.value=X.value||[],X.multiple=!0)}return X},[je,se,w.values]),oe=p.useMemo(function(){return!Mn(h.current,w.values)},[h.current,w.values]),V=p.useMemo(function(){return typeof l<"u"?oe?w.errors&&Object.keys(w.errors).length===0:l!==!1&&zt(l)?l(m):l:w.errors&&Object.keys(w.errors).length===0},[l,oe,w.errors,m]),te=at({},w,{initialValues:h.current,initialErrors:b.current,initialTouched:C.current,initialStatus:y.current,handleBlur:je,handleChange:se,handleReset:he,handleSubmit:S,resetForm:D,setErrors:U,setFormikState:Te,setFieldTouched:ce,setFieldValue:Z,setFieldError:Q,setStatus:Se,setSubmitting:ve,setTouched:j,setValues:Y,submitForm:ge,validateForm:B,validateField:M,isValid:V,dirty:oe,unregisterField:P,registerField:R,getFieldProps:Pe,getFieldMeta:ae,getFieldHelpers:be,validateOnBlur:i,validateOnChange:n,validateOnMount:a});return te}function qb(t){var e={};if(t.inner){if(t.inner.length===0)return Yn(e,t.path,t.message);for(var i=t.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 a=s;Et(e,a.path)||(e=Yn(e,a.path,a.message))}}return e}function Wb(t,e,n,r){n===void 0&&(n=!1);var i=wa(t);return e[n?"validateSync":"validate"](i,{abortEarly:!1,context:i})}function wa(t){var e=Array.isArray(t)?[]:{};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var r=String(n);Array.isArray(t[r])===!0?e[r]=t[r].map(function(i){return Array.isArray(i)===!0||kl(i)?wa(i):i!==""?i:void 0}):kl(t[r])?e[r]=wa(t[r]):e[r]=t[r]!==""?t[r]:void 0}return e}function Vb(t,e,n){var r=t.slice();return e.forEach(function(s,a){if(typeof r[a]>"u"){var l=n.clone!==!1,c=l&&n.isMergeableObject(s);r[a]=c?ma(Array.isArray(s)?[]:{},s,n):s}else n.isMergeableObject(s)?r[a]=ma(t[a],s,n):t.indexOf(s)===-1&&r.push(s)}),r}function Kb(t){return Array.from(t).filter(function(e){return e.selected}).map(function(e){return e.value})}function Yb(t,e,n){if(typeof t=="boolean")return!!e;var r=[],i=!1,s=-1;if(Array.isArray(t))r=t,s=t.indexOf(n),i=s>=0;else if(!n||n=="true"||n=="false")return!!e;return e&&n&&!i?r.concat(n):i?r.slice(0,s).concat(r.slice(s+1)):r}var Gb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?p.useLayoutEffect:p.useEffect;function Dt(t){var e=p.useRef(t);return Gb(function(){e.current=t}),p.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.current.apply(void 0,r)},[])}var Qb=p.forwardRef(function(t,e){var n=t.action,r=gd(t,["action"]),i=n??"#",s=Lb(),a=s.handleReset,l=s.handleSubmit;return p.createElement("form",at({onSubmit:l,ref:e,onReset:a,action:i},r))});Qb.displayName="Form";const vd=({init:t,schema:e,action:n,validateOnBlur:r=!1})=>Ub({initialValues:t,validationSchema:e,validateOnBlur:r,enableReinitialize:!0,validateOnChange:!1,validateOnMount:!1,onSubmit:i=>{n(i)}});function yo({id:t,text:e,className:n,required:r}){const i=Ee();return e?o.jsxs("label",{htmlFor:t,className:Ie("mb-1 block text-sm font-medium",n),style:{color:i.getColor(g.InputText)},children:[e,r&&o.jsx("span",{className:"ml-1",style:{color:i.getColor(g.ErrorText)},children:"*"})]}):null}const Ds={sm:"px-3 py-1 text-xs",md:"px-4 py-2 text-sm",lg:"px-5 py-3 text-15"};function Xb({id:t,label:e,suffix:n,prefix:r,size:i="md",type:s="text",noMargin:a=!1,required:l=!1,error:c,ariaDescribedBy:d,className:f,ariaInvalid:u,ariaLabel:m,autoFocus:h,...b}){const C=Ee(),y=C.getRadius(),v=c?C.getColor(g.ErrorBorder):C.getColor(g.InputBorder),E=C.getColor(g.LinkColor);return o.jsxs("div",{className:Ie({"mb-2":!a},f),style:{"--focus-ring":E},children:[o.jsx(yo,{id:t,text:e,required:l}),o.jsxs("div",{className:"flex items-center",children:[r&&o.jsx("span",{className:Ie("inline-block border border-solid border-r-0 rounded-l-md",Ds[i]),style:{borderColor:c?C.getColor(g.ErrorBorder):C.getColor(g.InputBorder),backgroundColor:C.getColor(g.InputBackground),borderRadius:y},children:r}),o.jsx("input",{id:t,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",Ds[i],{"rounded-l-none":!!r,"rounded-r-none":!!n}),type:s,required:l,"aria-describedby":d,"aria-invalid":u,"aria-label":m,style:{fontSize:"16px",color:c?C.getColor(g.ErrorText):C.getColor(g.InputText),backgroundColor:C.getColor(g.InputBackground),borderColor:v,borderRadius:y,"--tw-ring-color":E},...b}),n&&o.jsx("span",{className:Ie("inline-block border border-solid border-l-0 rounded-r-md",Ds[i]),style:{borderColor:c?C.getColor(g.ErrorBorder):C.getColor(g.InputBorder),backgroundColor:C.getColor(g.InputBackground),borderRadius:y},children:n})]}),!!c&&o.jsx("p",{className:"mt-1 text-xs",style:{color:C.getColor(g.ErrorText)},children:c})]})}const Jb={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"}},Xl={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"}};class Zb extends p.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.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 e0({children:t,isPresent:e,anchorX:n}){const r=p.useId(),i=p.useRef(null),s=p.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:a}=p.useContext(gp);return p.useInsertionEffect(()=>{const{width:l,height:c,top:d,left:f,right:u}=s.current;if(e||!i.current||!l||!c)return;const m=n==="left"?`left: ${f}`:`right: ${u}`;i.current.dataset.motionPopId=r;const h=document.createElement("style");return a&&(h.nonce=a),document.head.appendChild(h),h.sheet&&h.sheet.insertRule(`
|
|
46
|
+
[data-motion-pop-id="${r}"] {
|
|
47
|
+
position: absolute !important;
|
|
48
|
+
width: ${l}px !important;
|
|
49
|
+
height: ${c}px !important;
|
|
50
|
+
${m}px !important;
|
|
51
|
+
top: ${d}px !important;
|
|
52
|
+
}
|
|
53
|
+
`),()=>{document.head.removeChild(h)}},[e]),o.jsx(Zb,{isPresent:e,childRef:i,sizeRef:s,children:p.cloneElement(t,{ref:i})})}const t0=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:a,anchorX:l})=>{const c=Pa(n0),d=p.useId();let f=!0,u=p.useMemo(()=>(f=!1,{id:d,initial:e,isPresent:n,custom:i,onExitComplete:m=>{c.set(m,!0);for(const h of c.values())if(!h)return;r&&r()},register:m=>(c.set(m,!1),()=>c.delete(m))}),[n,c,r]);return s&&f&&(u={...u}),p.useMemo(()=>{c.forEach((m,h)=>c.set(h,!1))},[n]),p.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),a==="popLayout"&&(t=o.jsx(e0,{isPresent:n,anchorX:l,children:t})),o.jsx(yp.Provider,{value:u,children:t})};function n0(){return new Map}const wi=t=>t.key||"";function Jl(t){const e=[];return p.Children.forEach(t,n=>{p.isValidElement(n)&&e.push(n)}),e}const gn=({children:t,custom:e,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:a=!1,anchorX:l="left"})=>{const[c,d]=vp(a),f=p.useMemo(()=>Jl(t),[t]),u=a&&!c?[]:f.map(wi),m=p.useRef(!0),h=p.useRef(f),b=Pa(()=>new Map),[C,y]=p.useState(f),[v,E]=p.useState(f);xp(()=>{m.current=!1,h.current=f;for(let L=0;L<v.length;L++){const w=wi(v[L]);u.includes(w)?b.delete(w):b.get(w)!==!0&&b.set(w,!1)}},[v,u.length,u.join("-")]);const I=[];if(f!==C){let L=[...f];for(let w=0;w<v.length;w++){const $=v[w],H=wi($);u.includes(H)||(L.splice(w,0,$),I.push($))}return s==="wait"&&I.length&&(L=I),E(Jl(L)),y(f),null}const{forceRender:_}=p.useContext(bp);return o.jsx(o.Fragment,{children:v.map(L=>{const w=wi(L),$=a&&!c?!1:f===v||u.includes(w),H=()=>{if(b.has(w))b.set(w,!0);else return;let q=!0;b.forEach(F=>{F||(q=!1)}),q&&(_==null||_(),E(h.current),a&&(d==null||d()),r&&r())};return o.jsx(t0,{isPresent:$,initial:!m.current||n?void 0:!1,custom:e,presenceAffectsLayout:i,mode:s,onExitComplete:$?void 0:H,anchorX:l,children:L},w)})})};class r0{constructor(){this.componentControls=new Set}subscribe(e){return this.componentControls.add(e),()=>this.componentControls.delete(e)}start(e,n){this.componentControls.forEach(r=>{r.start(e.nativeEvent||e,n)})}}const i0=()=>new r0;function s0(){return Pa(i0)}function Vt({children:t,type:e="button",variant:n="primary",kind:r="solid",size:i="md",disabled:s=!1,rounded:a=!1,className:l,style:c,textKey:d=g.ButtonText,bgKey:f=g.ButtonBackground,animations:u={},withoutTheming:m,...h}){const b=Ee();return o.jsx($e.button,{type:e,className:Ie("flex items-center justify-center focus:outline-none focus:ring-2 focus:ring-offset-0 font-medium transition-opacity",{"rounded-full":a&&i!=="xs","rounded-lg":!a,"opacity-50 cursor-not-allowed":s,"hover:opacity-90 active:opacity-95":!s},l,Xl[n]&&Xl[n][r],Jb[i][a?"rounded":"default"]),disabled:s,style:{transition:"all 0.2s ease",...!m&&{color:b.getColor(d),backgroundColor:b.getColor(f),...a?{}:{borderRadius:b.getRadius()}},...c},...u,...h,children:t})}const Zl=(t,e)=>{const n=new Date;n.setFullYear(n.getFullYear()+1),document.cookie=`${t}=${e};expires=${n.toUTCString()};path=/`},xd=p.createContext({}),a0=()=>`${window.location.pathname}_$$_${document.title}`,o0=()=>{const t=localStorage.getItem("page");return!t||t===""?"/":t},l0=()=>{const t=localStorage.getItem("p-history");if(!t||t==="")return[];try{return JSON.parse(t)}catch{return[]}};function c0({children:t}){const[e,n]=p.useState("/"),[r,i]=p.useState(l0());function s(){i([]),localStorage.removeItem("p-history")}const a=l=>{n(l),i(c=>[...new Set([...c,l])]),localStorage.setItem("page",l),localStorage.setItem("p-history",JSON.stringify(r))};return o.jsx(xd.Provider,{value:{page:e,setPage:a,history:r,clearHistory:s},children:t})}function ys(){return p.useContext(xd)}function u0({label:t,id:e,value:n="",className:r,placeholder:i,children:s,required:a,error:l,...c}){const d=Ee();return o.jsxs("div",{className:r,children:[t&&o.jsx(yo,{id:e,required:a,text:t}),o.jsxs("select",{id:e,"aria-placeholder":i,value:n,"aria-label":t,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:d.getColor(g.InputBackground),color:d.getColor(g.InputText),borderColor:l?d.getColor(g.ErrorBorder):d.getColor(g.InputBorder),borderRadius:d.getRadius(),"--tw-ring-color":d.getColor(g.LinkColor)},onChange:c.onChange,required:a,...c,children:[i&&o.jsx("option",{value:"",disabled:!0,children:i}),s]}),!!l&&o.jsx("p",{className:"mt-1 text-xs",style:{color:d.getColor(g.ErrorText)},children:l})]})}const ec={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:""}},d0={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"},p0={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 f0({children:t,name:e,required:n,value:r,checked:i,onChange:s,onBlur:a,red:l,id:c=e,size:d="md",effect:f="ring",reversed:u=!1,error:m,...h}){const b=Ee(),C=b.getColor(g.InputText),y=b.getColor(g.LinkColor),v=b.getColor(g.InputBorder),E=b.getColor(g.InputBackground),I=b.getColor(g.ErrorText);return o.jsxs("div",{children:[o.jsxs("div",{className:`flex items-center justify-between gap-2 ${u?"flex-row-reverse":""} ${ec[f].label}`,children:[o.jsxs("label",{className:"disable-highlight relative flex cursor-pointer items-center rounded-md",htmlFor:c,children:[o.jsx("input",{id:c,name:e,type:"checkbox",className:`peer cursor-pointer appearance-none rounded-md border-2 border-solid transition-all ${d0[d]} ${ec[f].input}`,style:{borderColor:i?y:v,backgroundColor:i?y:E},required:n,checked:i,value:r,onChange:_=>s==null?void 0:s(_.target.checked),onBlur:_=>a==null?void 0:a(_.target.checked),...h}),o.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:o.jsx(fe.Check,{className:p0[d]})})]}),o.jsx("label",{className:"disable-highlight flex grow cursor-pointer select-none items-center text-sm",style:{color:C},htmlFor:c,children:t})]}),(l||m)&&o.jsx("small",{className:"text-xs",style:{color:I},children:m||l})]})}function h0({id:t,value:e,name:n,onChange:r,children:i,disabled:s,className:a}){const l=Ee(),c=l.getColor(g.InputText),d=l.getColor(g.LinkColor);return o.jsxs("label",{htmlFor:t,className:Ie("relative flex cursor-pointer items-center gap-2 rounded-md focus-within:outline-none",{"opacity-60 cursor-not-allowed":s},a),children:[o.jsx("input",{type:"radio",id:t,name:n,value:t,checked:e,onChange:f=>r==null?void 0:r(f.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:e?d:l.getColor(g.InputBorder),backgroundColor:e?d:l.getColor(g.InputBackground),boxShadow:e?`inset 0 0 0 3px ${l.getColor(g.Background)}`:void 0},disabled:s}),o.jsx("span",{className:"text-sm font-medium",style:{color:c},children:i})]})}function m0({id:t,label:e,children:n,required:r,className:i,error:s}){const a=Ee(),l=a.getColor(g.InputText),c=a.getColor(g.ErrorText);return o.jsxs("fieldset",{id:t,className:i,children:[e&&o.jsxs("legend",{className:"mb-1.5 block text-sm font-medium",style:{color:l},children:[e,r&&o.jsx("span",{style:{color:c,marginLeft:4},children:"*"})]}),o.jsx("div",{className:"flex flex-col gap-2",children:n}),s&&o.jsx("p",{className:"mt-1 text-xs",style:{color:c},children:s})]})}const tc=Object.assign(h0,{Group:m0});function vs({id:t,label:e,suffix:n,prefix:r,className:i,noMargin:s,rows:a=3,type:l="text",required:c=!1,error:d,ariaInvalid:f,inputRef:u,autoFocus:m=!1,style:h,borderless:b=!1,...C}){const y=Ee();return o.jsxs("div",{className:Ie({"mb-2":!s},i),children:[e&&o.jsx(yo,{id:t,text:e,required:c}),o.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":!b,"border-none bg-transparent":b}),id:t,rows:a,"aria-invalid":f,...C,ref:u,autoFocus:m,style:{...h,fontSize:"14px",color:d?y.getColor(g.ErrorText):y.getColor(g.InputText),...!b&&{backgroundColor:y.getColor(g.InputBackground),borderColor:d?y.getColor(g.ErrorBorder):y.getColor(g.InputBorder),borderRadius:y.getRadius(),"--tw-ring-color":y.getColor(g.LinkColor)}}}),!!d&&o.jsx("p",{className:"mt-1 text-xs",style:{color:y.getColor(g.ErrorText)},children:d})]})}function g0({onOk:t,clientId:e,widgetId:n,appearance:r,aiAgentMode:i=!1,onAIAgentStart:s,onOperatorConnect:a,isConnectingToOperator:l=!1}){var w,$,H,q,F,T;const c=Ee(),{defaultValues:d,widget:f,setIsHaveChat:u}=G(),[m,h]=p.useState(!1),b=p.useRef(null);p.useEffect(()=>{const A=setTimeout(()=>{var D;const B=(D=b.current)==null?void 0:D.querySelector('input:not([type="hidden"]), select, textarea');B==null||B.focus()},150);return()=>clearTimeout(A)},[]);const C=ys(),y=Qa(),v=!!d&&"username"in d,E=($=(w=r==null?void 0:r.body)==null?void 0:w.inputs)==null?void 0:$.reduce((A,B)=>{let D=B.remember?fr(B.name):d==null?void 0:d[B.name];return B.options&&D&&!B.options.includes(D)&&(D=void 0),B.name==="username"&&v&&(D=d.username),A[B.name]=D||"",A},{}),I=ro((q=(H=r==null?void 0:r.body)==null?void 0:H.inputs)==null?void 0:q.reduce((A,B)=>(A[B.name]=B.required?zi().required(`${B.label} alanı zorunludur`):zi(),A),{})),_=vd({init:{...E},schema:I,validateOnBlur:!1,action:async A=>{var B,D;if(!(m||l)){h(!0);try{v&&(A.username=d.username),d!=null&&d.secret_data&&(A.secret_data=d.secret_data);for(const P in A)typeof A[P]=="string"&&(A[P]=A[P].trim());if(a){for(const P of((B=r==null?void 0:r.body)==null?void 0:B.inputs)||[])P.remember&&Zl(P.name,A[P.name]);a(A);return}const[M,R]=await y.mutateAsync({inputs:A,history:C.history,client_id:e,widget_id:n,device_id:mn((f==null?void 0:f.link_id)||""),is_agent_mode:i});if(gt(R)){da(M)&&(Rt(Ye.CustomerToken,M.customer_token,(f==null?void 0:f.link_id)||""),Rt(Ye.CustomerRefreshToken,M.customer_refresh_token,(f==null?void 0:f.link_id)||""),Rt(Ye.DeviceId,M.device_id,(f==null?void 0:f.link_id)||"")),C.clearHistory();for(const P of((D=r==null?void 0:r.body)==null?void 0:D.inputs)||[])P.remember&&Zl(P.name,A[P.name]);u(!0),i?s==null||s():t==null||t();return}Tr(M,{form:_})}catch(M){console.error("Chat creation error:",M)}finally{h(!1)}}}}),L=c.getColor(g.GreeterBackground);return o.jsxs("section",{className:"h-full overflow-y-auto px-5 flex flex-col justify-between",style:{backgroundColor:L},children:[o.jsxs("form",{ref:b,autoComplete:"off",className:"grid grid-cols-1 gap-4",onSubmit:_.handleSubmit,children:[(T=(F=r==null?void 0:r.body)==null?void 0:F.inputs)==null?void 0:T.map((A,B)=>{var M,R;const D=B===0;if(["text","email","phone"].includes(A.type))return o.jsx(Xb,{id:A.name,name:A.name,type:A.type,label:A.label,value:_.values[A.name],onChange:_.handleChange,onBlur:_.handleBlur,disabled:A.name==="username"&&v,readOnly:A.name==="username"&&v,autoComplete:"off",placeholder:A.placeholder,error:_.errors[A.name],ariaInvalid:_.errors.name?!0:void 0,required:A.required,noMargin:!0,autoFocus:D},A.name);if(A.type==="select")return o.jsx(u0,{id:A.name,name:A.name,value:_.values[A.name],onChange:_.handleChange,label:A.label,error:_.errors[A.name],required:A.required,placeholder:A.placeholder,autoFocus:D,children:(M=A.options)==null?void 0:M.map(P=>o.jsx("option",{value:P,children:P},P))},A.name);if(A.type==="checkbox")return o.jsx(f0,{id:A.name,name:A.name,value:_.values[A.name],checked:_.values[A.name]==="true",onChange:_.handleChange,required:A.required,error:_.errors[A.name],children:A.label},A.name);if(A.type==="radio")return o.jsx(tc.Group,{id:A.name,label:A.label,required:A.required,error:_.errors[A.name],children:(R=A.options)==null?void 0:R.map(P=>o.jsx(tc,{onChange:j=>{j?_.setFieldValue(A.name,P):_.setFieldValue(A.name,"")},id:P,name:A.name,value:P===_.values[A.name],children:P},P))},A.name);if(A.type==="textarea")return o.jsx(vs,{id:A.name,name:A.name,value:_.values[A.name],onChange:_.handleChange,onBlur:_.handleBlur,placeholder:A.placeholder,error:_.errors[A.name],required:A.required,label:A.label,noMargin:!0,autoFocus:D},A.name)}),o.jsx(Vt,{textKey:g.GreeterButtonText,bgKey:g.GreeterButtonBackground,type:"submit",size:"lg",disabled:m||l,className:"transition-all duration-300 hover:opacity-90 transform hover:translate-y-[-1px] shadow-sm",children:m||l?o.jsxs("div",{className:"flex items-center justify-center",children:[o.jsx("span",{className:"mr-2",children:a?"Bağlanıyor":"Yükleniyor"}),o.jsx("span",{className:"animate-pulse",children:"..."})]}):a?"Canlı Desteğe Bağlan":"Sohbet Oluştur"})]}),o.jsx(Er,{variant:"block",className:"py-2"})]})}var Ve=(t=>(t.Open="open",t.Closed="closed",t.Pending="pending",t.Deleted="deleted",t.Created="created",t.Agent="agent",t))(Ve||{}),At=(t=>(t.AdminJoin="admin_join",t.AdminLeave="admin_leave",t.ChatCreated="chat_created",t.AdminToggleUpload="admin_toggle_upload",t.ChatTransferred="chat_transferred",t))(At||{}),pe=(t=>(t.Customer="customer",t.User="user",t.Agent="agent",t.System="system",t.Activity="activity",t))(pe||{});const ar=t=>{const e=Zf(),n=(r,i)=>{var a;const s=((a=_1.find(l=>l.name===r))==null?void 0:a.path)??"/";return typeof i=="object"&&s.includes(":")?Object.entries(i).reduce((l,[c,d])=>l.replace(`:${c}`,d),s):i?`${s}?${i}`:s};return{push:(r,i)=>{e(n(r,i),t)},path:n}};var y0={exports:{}},Fs={exports:{}},nc;function bd(){return nc||(nc=1,function(t,e){(function(n,r){t.exports=r()})(Ba,function(){var n=1e3,r=6e4,i=36e5,s="millisecond",a="second",l="minute",c="hour",d="day",f="week",u="month",m="quarter",h="year",b="date",C="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|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,E={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(D){var M=["th","st","nd","rd"],R=D%100;return"["+D+(M[(R-20)%10]||M[R]||M[0])+"]"}},I=function(D,M,R){var P=String(D);return!P||P.length>=M?D:""+Array(M+1-P.length).join(R)+D},_={s:I,z:function(D){var M=-D.utcOffset(),R=Math.abs(M),P=Math.floor(R/60),j=R%60;return(M<=0?"+":"-")+I(P,2,"0")+":"+I(j,2,"0")},m:function D(M,R){if(M.date()<R.date())return-D(R,M);var P=12*(R.year()-M.year())+(R.month()-M.month()),j=M.clone().add(P,u),U=R-j<0,Y=M.clone().add(P+(U?-1:1),u);return+(-(P+(R-j)/(U?j-Y:Y-j))||0)},a:function(D){return D<0?Math.ceil(D)||0:Math.floor(D)},p:function(D){return{M:u,y:h,w:f,d,D:b,h:c,m:l,s:a,ms:s,Q:m}[D]||String(D||"").toLowerCase().replace(/s$/,"")},u:function(D){return D===void 0}},L="en",w={};w[L]=E;var $="$isDayjsObject",H=function(D){return D instanceof A||!(!D||!D[$])},q=function D(M,R,P){var j;if(!M)return L;if(typeof M=="string"){var U=M.toLowerCase();w[U]&&(j=U),R&&(w[U]=R,j=U);var Y=M.split("-");if(!j&&Y.length>1)return D(Y[0])}else{var Q=M.name;w[Q]=M,j=Q}return!P&&j&&(L=j),j||!P&&L},F=function(D,M){if(H(D))return D.clone();var R=typeof M=="object"?M:{};return R.date=D,R.args=arguments,new A(R)},T=_;T.l=q,T.i=H,T.w=function(D,M){return F(D,{locale:M.$L,utc:M.$u,x:M.$x,$offset:M.$offset})};var A=function(){function D(R){this.$L=q(R.locale,null,!0),this.parse(R),this.$x=this.$x||R.x||{},this[$]=!0}var M=D.prototype;return M.parse=function(R){this.$d=function(P){var j=P.date,U=P.utc;if(j===null)return new Date(NaN);if(T.u(j))return new Date;if(j instanceof Date)return new Date(j);if(typeof j=="string"&&!/Z$/i.test(j)){var Y=j.match(y);if(Y){var Q=Y[2]-1||0,Z=(Y[7]||"0").substring(0,3);return U?new Date(Date.UTC(Y[1],Q,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,Z)):new Date(Y[1],Q,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,Z)}}return new Date(j)}(R),this.init()},M.init=function(){var R=this.$d;this.$y=R.getFullYear(),this.$M=R.getMonth(),this.$D=R.getDate(),this.$W=R.getDay(),this.$H=R.getHours(),this.$m=R.getMinutes(),this.$s=R.getSeconds(),this.$ms=R.getMilliseconds()},M.$utils=function(){return T},M.isValid=function(){return this.$d.toString()!==C},M.isSame=function(R,P){var j=F(R);return this.startOf(P)<=j&&j<=this.endOf(P)},M.isAfter=function(R,P){return F(R)<this.startOf(P)},M.isBefore=function(R,P){return this.endOf(P)<F(R)},M.$g=function(R,P,j){return T.u(R)?this[P]:this.set(j,R)},M.unix=function(){return Math.floor(this.valueOf()/1e3)},M.valueOf=function(){return this.$d.getTime()},M.startOf=function(R,P){var j=this,U=!!T.u(P)||P,Y=T.p(R),Q=function(Se,ve){var ge=T.w(j.$u?Date.UTC(j.$y,ve,Se):new Date(j.$y,ve,Se),j);return U?ge:ge.endOf(d)},Z=function(Se,ve){return T.w(j.toDate()[Se].apply(j.toDate("s"),(U?[0,0,0,0]:[23,59,59,999]).slice(ve)),j)},ee=this.$W,se=this.$M,ce=this.$D,ue="set"+(this.$u?"UTC":"");switch(Y){case h:return U?Q(1,0):Q(31,11);case u:return U?Q(1,se):Q(0,se+1);case f:var je=this.$locale().weekStart||0,Te=(ee<je?ee+7:ee)-je;return Q(U?ce-Te:ce+(6-Te),se);case d:case b:return Z(ue+"Hours",0);case c:return Z(ue+"Minutes",1);case l:return Z(ue+"Seconds",2);case a:return Z(ue+"Milliseconds",3);default:return this.clone()}},M.endOf=function(R){return this.startOf(R,!1)},M.$set=function(R,P){var j,U=T.p(R),Y="set"+(this.$u?"UTC":""),Q=(j={},j[d]=Y+"Date",j[b]=Y+"Date",j[u]=Y+"Month",j[h]=Y+"FullYear",j[c]=Y+"Hours",j[l]=Y+"Minutes",j[a]=Y+"Seconds",j[s]=Y+"Milliseconds",j)[U],Z=U===d?this.$D+(P-this.$W):P;if(U===u||U===h){var ee=this.clone().set(b,1);ee.$d[Q](Z),ee.init(),this.$d=ee.set(b,Math.min(this.$D,ee.daysInMonth())).$d}else Q&&this.$d[Q](Z);return this.init(),this},M.set=function(R,P){return this.clone().$set(R,P)},M.get=function(R){return this[T.p(R)]()},M.add=function(R,P){var j,U=this;R=Number(R);var Y=T.p(P),Q=function(se){var ce=F(U);return T.w(ce.date(ce.date()+Math.round(se*R)),U)};if(Y===u)return this.set(u,this.$M+R);if(Y===h)return this.set(h,this.$y+R);if(Y===d)return Q(1);if(Y===f)return Q(7);var Z=(j={},j[l]=r,j[c]=i,j[a]=n,j)[Y]||1,ee=this.$d.getTime()+R*Z;return T.w(ee,this)},M.subtract=function(R,P){return this.add(-1*R,P)},M.format=function(R){var P=this,j=this.$locale();if(!this.isValid())return j.invalidDate||C;var U=R||"YYYY-MM-DDTHH:mm:ssZ",Y=T.z(this),Q=this.$H,Z=this.$m,ee=this.$M,se=j.weekdays,ce=j.months,ue=j.meridiem,je=function(ve,ge,S,W){return ve&&(ve[ge]||ve(P,U))||S[ge].slice(0,W)},Te=function(ve){return T.s(Q%12||12,ve,"0")},Se=ue||function(ve,ge,S){var W=ve<12?"AM":"PM";return S?W.toLowerCase():W};return U.replace(v,function(ve,ge){return ge||function(S){switch(S){case"YY":return String(P.$y).slice(-2);case"YYYY":return T.s(P.$y,4,"0");case"M":return ee+1;case"MM":return T.s(ee+1,2,"0");case"MMM":return je(j.monthsShort,ee,ce,3);case"MMMM":return je(ce,ee);case"D":return P.$D;case"DD":return T.s(P.$D,2,"0");case"d":return String(P.$W);case"dd":return je(j.weekdaysMin,P.$W,se,2);case"ddd":return je(j.weekdaysShort,P.$W,se,3);case"dddd":return se[P.$W];case"H":return String(Q);case"HH":return T.s(Q,2,"0");case"h":return Te(1);case"hh":return Te(2);case"a":return Se(Q,Z,!0);case"A":return Se(Q,Z,!1);case"m":return String(Z);case"mm":return T.s(Z,2,"0");case"s":return String(P.$s);case"ss":return T.s(P.$s,2,"0");case"SSS":return T.s(P.$ms,3,"0");case"Z":return Y}return null}(ve)||Y.replace(":","")})},M.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},M.diff=function(R,P,j){var U,Y=this,Q=T.p(P),Z=F(R),ee=(Z.utcOffset()-this.utcOffset())*r,se=this-Z,ce=function(){return T.m(Y,Z)};switch(Q){case h:U=ce()/12;break;case u:U=ce();break;case m:U=ce()/3;break;case f:U=(se-ee)/6048e5;break;case d:U=(se-ee)/864e5;break;case c:U=se/i;break;case l:U=se/r;break;case a:U=se/n;break;default:U=se}return j?U:T.a(U)},M.daysInMonth=function(){return this.endOf(u).$D},M.$locale=function(){return w[this.$L]},M.locale=function(R,P){if(!R)return this.$L;var j=this.clone(),U=q(R,P,!0);return U&&(j.$L=U),j},M.clone=function(){return T.w(this.$d,this)},M.toDate=function(){return new Date(this.valueOf())},M.toJSON=function(){return this.isValid()?this.toISOString():null},M.toISOString=function(){return this.$d.toISOString()},M.toString=function(){return this.$d.toUTCString()},D}(),B=A.prototype;return F.prototype=B,[["$ms",s],["$s",a],["$m",l],["$H",c],["$W",d],["$M",u],["$y",h],["$D",b]].forEach(function(D){B[D[1]]=function(M){return this.$g(M,D[0],D[1])}}),F.extend=function(D,M){return D.$i||(D(M,A,F),D.$i=!0),F},F.locale=q,F.isDayjs=H,F.unix=function(D){return F(1e3*D)},F.en=w[L],F.Ls=w,F.p={},F})}(Fs)),Fs.exports}(function(t,e){(function(n,r){t.exports=r(bd())})(Ba,function(n){function r(a){return a&&typeof a=="object"&&"default"in a?a:{default:a}}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(a){return a+"."}};return i.default.locale(s,null,!0),s})})(y0);var wd={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(Ba,function(){return function(n,r,i){n=n||{};var s=r.prototype,a={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 l(d,f,u,m){return s.fromToBase(d,f,u,m)}i.en.relativeTime=a,s.fromToBase=function(d,f,u,m,h){for(var b,C,y,v=u.$locale().relativeTime||a,E=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"}],I=E.length,_=0;_<I;_+=1){var L=E[_];L.d&&(b=m?i(d).diff(u,L.d,!0):u.diff(d,L.d,!0));var w=(n.rounding||Math.round)(Math.abs(b));if(y=b>0,w<=L.r||!L.r){w<=1&&_>0&&(L=E[_-1]);var $=v[L.l];h&&(w=h(""+w)),C=typeof $=="string"?$.replace("%d",w):$(w,f,L.l,y);break}}if(f)return C;var H=y?v.future:v.past;return typeof H=="function"?H(C):H.replace("%s",C)},s.to=function(d,f){return l(d,f,this,!0)},s.from=function(d,f){return l(d,f,this)};var c=function(d){return d.$u?i.utc():i()};s.toNow=function(d){return this.to(c(this),d)},s.fromNow=function(d){return this.from(c(this),d)}}})})(wd);var v0=wd.exports;const x0=Ir(v0);var b0=bd();const Ps=Ir(b0),w0=(t="tr")=>(Ps.extend(x0),Ps.locale(t),Ps);function Ke({className:t="",style:e}){const n=Ee();return o.jsx("div",{className:`animate-pulse rounded ${t}`,style:{backgroundColor:n.getColor(g.MessageAdminBackground),opacity:.6,...e}})}function C0(){const t=Ee();return o.jsxs("section",{className:"flex flex-col gap-3 w-full grow pt-4 px-4 overflow-y-auto",children:[o.jsx("div",{className:"flex w-full items-center justify-start",children:o.jsx(Ke,{className:"h-12 w-3/5",style:{borderRadius:t.getRadius()}})}),o.jsx("div",{className:"flex w-full items-center justify-end",children:o.jsx(Ke,{className:"h-10 w-2/5",style:{borderRadius:t.getRadius(),backgroundColor:t.getColor(g.MessageVisitorBackground),opacity:.4}})}),o.jsx("div",{className:"flex w-full items-center justify-start",children:o.jsx(Ke,{className:"h-16 w-4/5",style:{borderRadius:t.getRadius()}})}),o.jsx("div",{className:"flex w-full items-center justify-end",children:o.jsx(Ke,{className:"h-8 w-1/3",style:{borderRadius:t.getRadius(),backgroundColor:t.getColor(g.MessageVisitorBackground),opacity:.4}})}),o.jsx("div",{className:"flex w-full items-center justify-start",children:o.jsx(Ke,{className:"h-10 w-1/2",style:{borderRadius:t.getRadius()}})})]})}function _0(){const t=Ee();return o.jsxs("div",{className:"p-3 flex items-center gap-3",style:{backgroundColor:t.getColor(g.FooterBackground),borderRadius:t.getRadius()},children:[o.jsx("div",{className:"grow",children:o.jsx(Ke,{className:"h-12 w-full",style:{borderRadius:t.getRadius(),backgroundColor:t.getColor(g.InputBackground)}})}),o.jsx(Ke,{className:"h-12 w-12 rounded-full"})]})}function k0(){const t=Ee();return o.jsxs("header",{className:"p-4 flex justify-between items-center z-10",style:{backgroundColor:t.getColor(g.HeaderBackground),borderBottom:`1px solid ${t.getColor(g.HeaderBorder)}`},children:[o.jsx(Ke,{className:"h-5 w-36"}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Ke,{className:"h-5 w-5 rounded"}),o.jsx(Ke,{className:"h-5 w-5 rounded"})]})]})}function S0(){const t=Ee();return o.jsx("section",{className:"h-full overflow-y-auto px-4 py-3",style:{backgroundColor:t.getColor(g.GreeterBackground)},children:o.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[o.jsxs("div",{children:[o.jsx(Ke,{className:"h-4 w-20 mb-1"}),o.jsx(Ke,{className:"h-11 w-full",style:{borderRadius:t.getRadius(),backgroundColor:t.getColor(g.InputBackground)}})]}),o.jsxs("div",{children:[o.jsx(Ke,{className:"h-4 w-24 mb-1"}),o.jsx(Ke,{className:"h-11 w-full",style:{borderRadius:t.getRadius(),backgroundColor:t.getColor(g.InputBackground)}})]}),o.jsxs("div",{children:[o.jsx(Ke,{className:"h-4 w-16 mb-1"}),o.jsx(Ke,{className:"h-11 w-full",style:{borderRadius:t.getRadius(),backgroundColor:t.getColor(g.InputBackground)}})]}),o.jsx(Ke,{className:"h-11 w-full mt-2",style:{borderRadius:t.getRadius(),backgroundColor:t.getColor(g.GreeterButtonBackground),opacity:.5}})]})})}function j0(){const t=Ee();return o.jsxs("div",{className:"relative flex flex-col gap-3 items-center justify-center h-44",style:{backgroundColor:t.getColor(g.GreeterTopBackground)},children:[o.jsx(Ke,{className:"h-7 w-40"}),o.jsx(Ke,{className:"h-4 w-56"})]})}function E0(){return o.jsx("div",{className:"flex flex-col h-full flex-1 min-h-0 overflow-hidden",children:o.jsx("div",{className:"flex-1 overflow-y-auto space-y-0 min-h-0",children:Array.from({length:6}).map((t,e)=>o.jsxs("div",{className:"w-full flex justify-between items-center gap-2 p-5",children:[o.jsx(Ke,{className:"h-4 flex-1 max-w-[70%]"}),o.jsx(Ke,{className:"h-3 w-14 flex-shrink-0"})]},e))})})}function Cd(){const t=Ee();return o.jsxs("div",{className:"h-full w-full flex flex-col overflow-hidden",style:{backgroundColor:t.getColor(g.Background)},children:[o.jsx(k0,{}),o.jsx(C0,{}),o.jsx(_0,{}),o.jsxs("div",{className:"py-1.5 px-3 flex items-center justify-center gap-1",style:{borderTop:`1px solid ${t.getColor(g.FooterBorder)}`,backgroundColor:t.getColor(g.FooterBackground)},children:[o.jsx(Ke,{className:"h-3 w-20"}),o.jsx(Ke,{className:"h-3.5 w-3.5 rounded"})]})]})}function Ca(){const t=Ee(),e=typeof window<"u"&&window.innerWidth<768;return o.jsxs("div",{className:`h-full w-full relative overflow-hidden ${e?"":"rounded-xl"}`,style:{backgroundColor:t.getColor(g.GreeterBackground)},children:[o.jsx(j0,{}),o.jsx("div",{style:{height:e?"calc(var(--app-height,100dvh) - 11rem)":"calc(100% - 11rem)"},children:o.jsx(S0,{})})]})}const T0=/^admin_([a-f0-9]{24})_(.+)$/i;function nn(t){return t.profile_id?`id:${t.profile_id}`:`name:${t.name.trim().toLowerCase()}`}function rc(t){const e=t.trim().match(T0);return e?{profile_id:e[1],name:e[2]}:null}function A0(t,e){const n=t?[...t]:[],r=nn(e),i=n.findIndex(s=>nn(s)===r);if(i>=0){const s=n[i];return n[i]={...s,...e,name:e.name||s.name,avatar:e.avatar??s.avatar,profile_id:e.profile_id??s.profile_id},n}return[...n,e]}function _a(t,e){return t!=null&&t.length?t.filter(n=>!(e.profile_id&&n.profile_id===e.profile_id||!e.profile_id&&e.name&&n.name===e.name)):[]}function ic(t,e){const n=e.profile_id!=null&&e.profile_id!==""?_a(t,{profile_id:e.profile_id}):_a(t,{name:e.name});return[e,...n]}function R0(t,e){return e!=null&&e.length?t.map(n=>{const r=e.find(i=>nn(i)===nn(n))??e.find(i=>i.name.trim().toLocaleLowerCase("tr-TR")===n.name.trim().toLocaleLowerCase("tr-TR"));return r?{...r,...n,name:n.name||r.name,avatar:n.avatar??r.avatar,profile_id:n.profile_id??r.profile_id}:n}):t}function Vr(t){const e=t[0];return e?{agent_name:e.name,agent_avatar:e.avatar}:{agent_name:void 0,agent_avatar:void 0}}function O0(t){const e=new Map,n=[];for(const r of t)if(r.sender_type===pe.Activity){if(r.activity_type===At.AdminJoin){let i;const s=typeof r.content=="string"?rc(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 a=nn(i);e.has(a)||n.push(a);const l=e.get(a);e.set(a,{...l,...i,name:i.name,avatar:i.avatar??(l==null?void 0:l.avatar),profile_id:i.profile_id??(l==null?void 0:l.profile_id)})}else if(r.activity_type===At.AdminLeave){const i=typeof r.content=="string"?rc(r.content):null;if(i){const s=nn({profile_id:i.profile_id,name:i.name});e.delete(s);const a=n.indexOf(s);a>=0&&n.splice(a,1)}else if(r.sender_name){const s=nn({name:r.sender_name});e.delete(s);const a=n.indexOf(s);a>=0&&n.splice(a,1)}}else if(r.activity_type===At.ChatTransferred){if(r.sender_id){const i=nn({profile_id:r.sender_id,name:""});e.delete(i);const s=n.indexOf(i);s>=0&&n.splice(s,1)}else if(r.sender_name){const i=nn({name:r.sender_name});e.delete(i);const s=n.indexOf(i);s>=0&&n.splice(s,1)}}}return n.map(r=>e.get(r)).filter(r=>r!=null)}function vo(t,e){return t!=null&&t.trim()?[{name:t.trim(),avatar:e}]:[]}function sc(t){const e=t.participants&&t.participants.length>0?t.participants:vo(t.agent_name,t.agent_avatar),n=Vr(e);return{...t,participants:e,agent_name:n.agent_name,agent_avatar:n.agent_avatar}}function _d(t){var s,a;const e=t.who_joined_details;if(e!=null&&e.length)return e.map(l=>({profile_id:l.profile_id,name:l.name,avatar:l.avatar}));const n=t.participant_logs;if(n!=null&&n.length)return n.map(l=>({profile_id:l.user_id,name:l.name}));const r=(s=t.archive_summary)==null?void 0:s.admin_name,i=(a=t.archive_summary)==null?void 0:a.agent_avatar;return r?[{name:r,avatar:i}]:[]}const ac=t=>{if(typeof document>"u")return t;const e=document.createElement("textarea");return e.innerHTML=t,e.value},oc=t=>{if(!t)return"";const n=ac(t).replace(/<[^>]*>/g," ");return ac(n).replace(/\s+/g," ").trim()};function N0({onHasHistory:t,emptyStateText:e}){const n=G(w=>w.widget),r=G(w=>w.open),i=G(w=>w.setHistoryChat),s=G(w=>w.setHistoryMessages),a=Ee(),l=ar(),[c,d]=p.useState(null),f=w0(),u=p.useRef(!1),m=n!=null&&n.link_id?mn(n.link_id):null,{data:h,isLoading:b}=Nm((n==null?void 0:n.link_id)||"",m||"",{enabled:r});if(p.useEffect(()=>{if(!b&&h){const[w,$]=h,H=gt($)&&Array.isArray(w)&&w.length>0;if(H&&!u.current){const q=w[0];if(q.status===Ve.Open||q.status===Ve.Pending){console.log("ChatHistoryList: Auto-joining active chat",q._id),u.current=!0,i(q),s(null),l.push("chat");return}}t&&t(H)}},[b,h,t,l,i,s]),!(n!=null&&n.link_id))return null;if(b)return o.jsx(E0,{});if(!h)return null;const[C,y]=h;if(!gt(y)||!Array.isArray(C))return y===429?o.jsx("div",{className:"h-full flex items-center justify-center p-6 text-center",children:o.jsxs("div",{className:"max-w-xs",children:[o.jsx("div",{className:"text-sm font-medium opacity-80",children:"Geçmiş şu an yüklenemedi"}),o.jsx("div",{className:"mt-2 text-xs opacity-60",children:"Yeni bir sohbet başlatabilir veya daha sonra tekrar deneyebilirsiniz."})]})}):null;const v=w=>f(w).fromNow(),E=w=>{const $=w.map(q=>typeof q=="string"?q.trim():"").filter(Boolean);if($.length===0)return"Atanmamış";if($.length===1)return $[0];if($.length===2)return`${$[0]} ve ${$[1]}`;if($.length===3)return`${$[0]}, ${$[1]} ve ${$[2]}`;const H=$.length-2;return`${$[0]}, ${$[1]} ve ${H} kişi daha`},I=w=>{var $;if(w.who_joined_details&&Array.isArray(w.who_joined_details)&&w.who_joined_details.length>0){const H=w.who_joined_details.map(q=>q.name||"");return E(H)}if(w.participant_logs&&Array.isArray(w.participant_logs)&&w.participant_logs.length>0){const H=w.participant_logs.map(q=>q.name||"");return E(H)}return($=w.archive_summary)!=null&&$.admin_name?w.archive_summary.admin_name:"Atanmamış"},_=w=>{var q;const $=(q=w.archive_summary)==null?void 0:q.last_message,H=oc($);if(H)return H;if(typeof w.last_message=="string"&&w.last_message.trim()){const F=oc(w.last_message);if(F)return F}return w.status===Ve.Closed?"Görüşme tamamlandı":"Görüşme"},L=w=>{const H=_d(w)[0];if(H!=null&&H.avatar)return o.jsx("img",{src:H.avatar,alt:"",className:"size-10 shrink-0 rounded-full object-cover"});const q=((H==null?void 0:H.name)||I(w)||"?").trim().charAt(0).toLocaleUpperCase("tr-TR");return o.jsx("span",{className:"flex size-10 shrink-0 items-center justify-center rounded-full text-sm font-bold",style:{backgroundColor:a.getColor(g.MessageAdminBackground),color:a.getColor(g.MessageAdminText)},children:q||"?"})};return C.length===0?o.jsx("div",{className:"h-full flex items-center justify-center p-6 text-center",children:o.jsxs("div",{className:"max-w-xs",children:[o.jsx("div",{className:"text-sm font-medium opacity-80",children:"Henüz sohbet yok"}),o.jsx("div",{className:"mt-2 text-xs opacity-60",children:e||"Yeni bir sohbet başlatmak için aşağıdaki butonu kullanabilirsiniz."})]})}):o.jsx("div",{className:"flex flex-col h-full",children:o.jsx("div",{className:"flex-1 overflow-y-auto space-y-3 min-h-0 p-1",children:C.map(w=>o.jsxs("button",{type:"button",className:"w-full flex items-center gap-3 rounded-2xl border px-4 py-3 text-left transition-colors",style:{color:a.getColor(g.InputText),borderColor:a.getColor(g.GreeterBorder),backgroundColor:c===w._id?a.getColor(g.MessageAdminBackground):a.getColor(g.GreeterBackground),cursor:"pointer"},onMouseEnter:()=>d(w._id),onMouseLeave:()=>d(null),onClick:()=>{i(w),s(null),l.push("chat")},children:[L(w),o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsxs("span",{className:"flex items-center justify-between gap-2",children:[o.jsx("span",{className:"block min-w-0 truncate text-sm font-bold",children:I(w)}),o.jsx("span",{className:"shrink-0 text-xs tabular-nums",style:{color:a.getColor(g.FooterText)},children:v(w.created_at)})]}),o.jsx("span",{className:"mt-1 block truncate text-sm",style:{color:a.getColor(g.FooterText)},children:_(w)})]})]},w._id))})})}const an=Object.create(null);an.open="0";an.close="1";an.ping="2";an.pong="3";an.message="4";an.upgrade="5";an.noop="6";const Oi=Object.create(null);Object.keys(an).forEach(t=>{Oi[an[t]]=t});const ka={type:"error",data:"parser error"},kd=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Sd=typeof ArrayBuffer=="function",jd=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,xo=({type:t,data:e},n,r)=>kd&&e instanceof Blob?n?r(e):lc(e,r):Sd&&(e instanceof ArrayBuffer||jd(e))?n?r(e):lc(new Blob([e]),r):r(an[t]+(e||"")),lc=(t,e)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];e("b"+(r||""))},n.readAsDataURL(t)};function cc(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let Bs;function I0(t,e){if(kd&&t.data instanceof Blob)return t.data.arrayBuffer().then(cc).then(e);if(Sd&&(t.data instanceof ArrayBuffer||jd(t.data)))return e(cc(t.data));xo(t,!1,n=>{Bs||(Bs=new TextEncoder),e(Bs.encode(n))})}const uc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Kr=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t<uc.length;t++)Kr[uc.charCodeAt(t)]=t;const M0=t=>{let e=t.length*.75,n=t.length,r,i=0,s,a,l,c;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);const d=new ArrayBuffer(e),f=new Uint8Array(d);for(r=0;r<n;r+=4)s=Kr[t.charCodeAt(r)],a=Kr[t.charCodeAt(r+1)],l=Kr[t.charCodeAt(r+2)],c=Kr[t.charCodeAt(r+3)],f[i++]=s<<2|a>>4,f[i++]=(a&15)<<4|l>>2,f[i++]=(l&3)<<6|c&63;return d},$0=typeof ArrayBuffer=="function",bo=(t,e)=>{if(typeof t!="string")return{type:"message",data:Ed(t,e)};const n=t.charAt(0);return n==="b"?{type:"message",data:D0(t.substring(1),e)}:Oi[n]?t.length>1?{type:Oi[n],data:t.substring(1)}:{type:Oi[n]}:ka},D0=(t,e)=>{if($0){const n=M0(t);return Ed(n,e)}else return{base64:!0,data:t}},Ed=(t,e)=>{switch(e){case"blob":return t instanceof Blob?t:new Blob([t]);case"arraybuffer":default:return t instanceof ArrayBuffer?t:t.buffer}},Td="",F0=(t,e)=>{const n=t.length,r=new Array(n);let i=0;t.forEach((s,a)=>{xo(s,!1,l=>{r[a]=l,++i===n&&e(r.join(Td))})})},P0=(t,e)=>{const n=t.split(Td),r=[];for(let i=0;i<n.length;i++){const s=bo(n[i],e);if(r.push(s),s.type==="error")break}return r};function B0(){return new TransformStream({transform(t,e){I0(t,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))}t.data&&typeof t.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(n)})}})}let Ls;function Ci(t){return t.reduce((e,n)=>e+n.length,0)}function _i(t,e){if(t[0].length===e)return t.shift();const n=new Uint8Array(e);let r=0;for(let i=0;i<e;i++)n[i]=t[0][r++],r===t[0].length&&(t.shift(),r=0);return t.length&&r<t[0].length&&(t[0]=t[0].slice(r)),n}function L0(t,e){Ls||(Ls=new TextDecoder);const n=[];let r=0,i=-1,s=!1;return new TransformStream({transform(a,l){for(n.push(a);;){if(r===0){if(Ci(n)<1)break;const c=_i(n,1);s=(c[0]&128)===128,i=c[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(Ci(n)<2)break;const c=_i(n,2);i=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),r=3}else if(r===2){if(Ci(n)<8)break;const c=_i(n,8),d=new DataView(c.buffer,c.byteOffset,c.length),f=d.getUint32(0);if(f>Math.pow(2,21)-1){l.enqueue(ka);break}i=f*Math.pow(2,32)+d.getUint32(4),r=3}else{if(Ci(n)<i)break;const c=_i(n,i);l.enqueue(bo(s?c:Ls.decode(c),e)),r=0}if(i===0||i>t){l.enqueue(ka);break}}}})}const Ad=4;function Ze(t){if(t)return z0(t)}function z0(t){for(var e in Ze.prototype)t[e]=Ze.prototype[e];return t}Ze.prototype.on=Ze.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this};Ze.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this};Ze.prototype.off=Ze.prototype.removeListener=Ze.prototype.removeAllListeners=Ze.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+t];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===e||r.fn===e){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+t],this};Ze.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),n=this._callbacks["$"+t],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,e)}return this};Ze.prototype.emitReserved=Ze.prototype.emit;Ze.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]};Ze.prototype.hasListeners=function(t){return!!this.listeners(t).length};const xs=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,n)=>n(e,0),Bt=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),H0="arraybuffer";function Rd(t,...e){return e.reduce((n,r)=>(t.hasOwnProperty(r)&&(n[r]=t[r]),n),{})}const U0=Bt.setTimeout,q0=Bt.clearTimeout;function bs(t,e){e.useNativeTimers?(t.setTimeoutFn=U0.bind(Bt),t.clearTimeoutFn=q0.bind(Bt)):(t.setTimeoutFn=Bt.setTimeout.bind(Bt),t.clearTimeoutFn=Bt.clearTimeout.bind(Bt))}const W0=1.33;function V0(t){return typeof t=="string"?K0(t):Math.ceil((t.byteLength||t.size)*W0)}function K0(t){let e=0,n=0;for(let r=0,i=t.length;r<i;r++)e=t.charCodeAt(r),e<128?n+=1:e<2048?n+=2:e<55296||e>=57344?n+=3:(r++,n+=4);return n}function Od(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Y0(t){let e="";for(let n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e}function G0(t){let e={},n=t.split("&");for(let r=0,i=n.length;r<i;r++){let s=n[r].split("=");e[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return e}class Q0 extends Error{constructor(e,n,r){super(e),this.description=n,this.context=r,this.type="TransportError"}}class wo extends Ze{constructor(e){super(),this.writable=!1,bs(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,n,r){return super.emitReserved("error",new Q0(e,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(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const n=bo(e,this.socket.binaryType);this.onPacket(n)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,n={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const n=Y0(e);return n.length?"?"+n:""}}class X0 extends wo{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const n=()=>{this.readyState="paused",e()};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(e){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)};P0(e,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,F0(e,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=Od()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(e,n)}}let Nd=!1;try{Nd=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const J0=Nd;function Z0(){}class ew extends X0{constructor(e){if(super(e),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||r!==e.port}}doWrite(e,n){const r=this.request({method:"POST",data:e});r.on("success",n),r.on("error",(i,s)=>{this.onError("xhr post error",i,s)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=e}}class rn extends Ze{constructor(e,n,r){super(),this.createRequest=e,bs(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 e;const n=Rd(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{}(e=this._opts.cookieJar)===null||e===void 0||e.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=rn.requestsCount++,rn.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Z0,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete rn.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}rn.requestsCount=0;rn.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",dc);else if(typeof addEventListener=="function"){const t="onpagehide"in Bt?"pagehide":"unload";addEventListener(t,dc,!1)}}function dc(){for(let t in rn.requests)rn.requests.hasOwnProperty(t)&&rn.requests[t].abort()}const tw=function(){const t=Id({xdomain:!1});return t&&t.responseType!==null}();class nw extends ew{constructor(e){super(e);const n=e&&e.forceBase64;this.supportsBinary=tw&&!n}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new rn(Id,this.uri(),e)}}function Id(t){const e=t.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||J0))return new XMLHttpRequest}catch{}if(!e)try{return new Bt[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Md=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class rw extends wo{get name(){return"websocket"}doOpen(){const e=this.uri(),n=this.opts.protocols,r=Md?{}:Rd(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(e,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=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let n=0;n<e.length;n++){const r=e[n],i=n===e.length-1;xo(r,this.supportsBinary,s=>{try{this.doWrite(r,s)}catch{}i&&xs(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=Od()),this.supportsBinary||(n.b64=1),this.createUri(e,n)}}const zs=Bt.WebSocket||Bt.MozWebSocket;class iw extends rw{createSocket(e,n,r){return Md?new zs(e,n,r):n?new zs(e,n):new zs(e)}doWrite(e,n){this.ws.send(n)}}class sw extends wo{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const n=L0(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=e.readable.pipeThrough(n).getReader(),i=B0();i.readable.pipeTo(e.writable),this._writer=i.writable.getWriter();const s=()=>{r.read().then(({done:l,value:c})=>{l||(this.onPacket(c),s())}).catch(l=>{})};s();const a={type:"open"};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this._writer.write(a).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let n=0;n<e.length;n++){const r=e[n],i=n===e.length-1;this._writer.write(r).then(()=>{i&&xs(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const aw={websocket:iw,webtransport:sw,polling:nw},ow=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,lw=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Sa(t){if(t.length>8e3)throw"URI too long";const e=t,n=t.indexOf("["),r=t.indexOf("]");n!=-1&&r!=-1&&(t=t.substring(0,n)+t.substring(n,r).replace(/:/g,";")+t.substring(r,t.length));let i=ow.exec(t||""),s={},a=14;for(;a--;)s[lw[a]]=i[a]||"";return n!=-1&&r!=-1&&(s.source=e,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=cw(s,s.path),s.queryKey=uw(s,s.query),s}function cw(t,e){const n=/\/{2,9}/g,r=e.replace(n,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&r.splice(0,1),e.slice(-1)=="/"&&r.splice(r.length-1,1),r}function uw(t,e){const n={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,s){i&&(n[i]=s)}),n}const ja=typeof addEventListener=="function"&&typeof removeEventListener=="function",Ni=[];ja&&addEventListener("offline",()=>{Ni.forEach(t=>t())},!1);class Rn extends Ze{constructor(e,n){if(super(),this.binaryType=H0,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(n=e,e=null),e){const r=Sa(e);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=Sa(n.host).host);bs(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=G0(this.opts.query)),ja&&(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"})},Ni.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const n=Object.assign({},this.opts.query);n.EIO=Ad,n.transport=e,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[e]);return new this._transportsByName[e](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&Rn.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(e);n.open(),this.setTransport(n)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.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",Rn.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.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=e.data,this._onError(n);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),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 e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.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+=V0(i)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,xs(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,n,r){return this._sendPacket("message",e,n,r),this}send(e,n,r){return this._sendPacket("message",e,n,r),this}_sendPacket(e,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:e,data:n,options:r};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),i&&this.once("flush",i),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),e()},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():e()}):this.upgrading?r():e()),this}_onError(e){if(Rn.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,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(),ja&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Ni.indexOf(this._offlineEventListener);r!==-1&&Ni.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,n),this.writeBuffer=[],this._prevBufferLen=0}}}Rn.protocol=Ad;class dw extends Rn{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let n=this.createTransport(e),r=!1;Rn.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;Rn.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(f(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const m=new Error("probe error");m.transport=n.name,this.emitReserved("upgradeError",m)}}))};function s(){r||(r=!0,f(),n.close(),n=null)}const a=u=>{const m=new Error("probe error: "+u);m.transport=n.name,s(),this.emitReserved("upgradeError",m)};function l(){a("transport closed")}function c(){a("socket closed")}function d(u){n&&u.name!==n.name&&s()}const f=()=>{n.removeListener("open",i),n.removeListener("error",a),n.removeListener("close",l),this.off("close",c),this.off("upgrading",d)};n.once("open",i),n.once("error",a),n.once("close",l),this.once("close",c),this.once("upgrading",d),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const n=[];for(let r=0;r<e.length;r++)~this.transports.indexOf(e[r])&&n.push(e[r]);return n}}let pw=class extends dw{constructor(e,n={}){const r=typeof e=="object"?e:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(i=>aw[i]).filter(i=>!!i)),super(e,r)}};function fw(t,e="",n){let r=t;n=n||typeof location<"u"&&location,t==null&&(t=n.protocol+"//"+n.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=n.protocol+t:t=n.host+t),/^(https?|wss?):\/\//.test(t)||(typeof n<"u"?t=n.protocol+"//"+t:t="https://"+t),r=Sa(t)),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+e,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}const hw=typeof ArrayBuffer=="function",mw=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,$d=Object.prototype.toString,gw=typeof Blob=="function"||typeof Blob<"u"&&$d.call(Blob)==="[object BlobConstructor]",yw=typeof File=="function"||typeof File<"u"&&$d.call(File)==="[object FileConstructor]";function Co(t){return hw&&(t instanceof ArrayBuffer||mw(t))||gw&&t instanceof Blob||yw&&t instanceof File}function Ii(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let n=0,r=t.length;n<r;n++)if(Ii(t[n]))return!0;return!1}if(Co(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return Ii(t.toJSON(),!0);for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&Ii(t[n]))return!0;return!1}function vw(t){const e=[],n=t.data,r=t;return r.data=Ea(n,e),r.attachments=e.length,{packet:r,buffers:e}}function Ea(t,e){if(!t)return t;if(Co(t)){const n={_placeholder:!0,num:e.length};return e.push(t),n}else if(Array.isArray(t)){const n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=Ea(t[r],e);return n}else if(typeof t=="object"&&!(t instanceof Date)){const n={};for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=Ea(t[r],e));return n}return t}function xw(t,e){return t.data=Ta(t.data,e),delete t.attachments,t}function Ta(t,e){if(!t)return t;if(t&&t._placeholder===!0){if(typeof t.num=="number"&&t.num>=0&&t.num<e.length)return e[t.num];throw new Error("illegal attachments")}else if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n]=Ta(t[n],e);else if(typeof t=="object")for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]=Ta(t[n],e));return t}const bw=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],ww=5;var Re;(function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"})(Re||(Re={}));class Cw{constructor(e){this.replacer=e}encode(e){return(e.type===Re.EVENT||e.type===Re.ACK)&&Ii(e)?this.encodeAsBinary({type:e.type===Re.EVENT?Re.BINARY_EVENT:Re.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let n=""+e.type;return(e.type===Re.BINARY_EVENT||e.type===Re.BINARY_ACK)&&(n+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(n+=e.nsp+","),e.id!=null&&(n+=e.id),e.data!=null&&(n+=JSON.stringify(e.data,this.replacer)),n}encodeAsBinary(e){const n=vw(e),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function pc(t){return Object.prototype.toString.call(t)==="[object Object]"}class _o extends Ze{constructor(e){super(),this.reviver=e}add(e){let n;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(e);const r=n.type===Re.BINARY_EVENT;r||n.type===Re.BINARY_ACK?(n.type=r?Re.EVENT:Re.ACK,this.reconstructor=new _w(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Co(e)||e.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(e),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: "+e)}decodeString(e){let n=0;const r={type:Number(e.charAt(0))};if(Re[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Re.BINARY_EVENT||r.type===Re.BINARY_ACK){const s=n+1;for(;e.charAt(++n)!=="-"&&n!=e.length;);const a=e.substring(s,n);if(a!=Number(a)||e.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(a)}if(e.charAt(n+1)==="/"){const s=n+1;for(;++n&&!(e.charAt(n)===","||n===e.length););r.nsp=e.substring(s,n)}else r.nsp="/";const i=e.charAt(n+1);if(i!==""&&Number(i)==i){const s=n+1;for(;++n;){const a=e.charAt(n);if(a==null||Number(a)!=a){--n;break}if(n===e.length)break}r.id=Number(e.substring(s,n+1))}if(e.charAt(++n)){const s=this.tryParse(e.substr(n));if(_o.isPayloadValid(r.type,s))r.data=s;else throw new Error("invalid payload")}return r}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,n){switch(e){case Re.CONNECT:return pc(n);case Re.DISCONNECT:return n===void 0;case Re.CONNECT_ERROR:return typeof n=="string"||pc(n);case Re.EVENT:case Re.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&bw.indexOf(n[0])===-1);case Re.ACK:case Re.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class _w{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const n=xw(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const kw=Object.freeze(Object.defineProperty({__proto__:null,Decoder:_o,Encoder:Cw,get PacketType(){return Re},protocol:ww},Symbol.toStringTag,{value:"Module"}));function qt(t,e,n){return t.on(e,n),function(){t.off(e,n)}}const Sw=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Dd extends Ze{constructor(e,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=e,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 e=this.io;this.subs=[qt(e,"open",this.onopen.bind(this)),qt(e,"packet",this.onpacket.bind(this)),qt(e,"error",this.onerror.bind(this)),qt(e,"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(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...n){var r,i,s;if(Sw.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(n.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const a={type:Re.EVENT,data:n};if(a.options={},a.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const f=this.ids++,u=n.pop();this._registerAckCallback(f,u),a.id=f}const l=(i=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||i===void 0?void 0:i.writable,c=this.connected&&!(!((s=this.io.engine)===null||s===void 0)&&s._hasPingExpired());return this.flags.volatile&&!l||(c?(this.notifyOutgoingListeners(a),this.packet(a)):this.sendBuffer.push(a)),this.flags={},this}_registerAckCallback(e,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[e]=n;return}const s=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let l=0;l<this.sendBuffer.length;l++)this.sendBuffer[l].id===e&&this.sendBuffer.splice(l,1);n.call(this,new Error("operation has timed out"))},i),a=(...l)=>{this.io.clearTimeoutFn(s),n.apply(this,l)};a.withError=!0,this.acks[e]=a}emitWithAck(e,...n){return new Promise((r,i)=>{const s=(a,l)=>a?i(a):r(l);s.withError=!0,n.push(s),this.emit(e,...n)})}_addToQueue(e){let n;typeof e[e.length-1]=="function"&&(n=e.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.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(e=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!e||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:Re.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(r=>String(r.id)===e)){const r=this.acks[e];delete this.acks[e],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case Re.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.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 Re.EVENT:case Re.BINARY_EVENT:this.onevent(e);break;case Re.ACK:case Re.BINARY_ACK:this.onack(e);break;case Re.DISCONNECT:this.ondisconnect();break;case Re.CONNECT_ERROR:this.destroy();const r=new Error(e.data.message);r.data=e.data.data,this.emitReserved("connect_error",r);break}}onevent(e){const n=e.data||[];e.id!=null&&n.push(this.ack(e.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:Re.ACK,id:e,data:i}))}}onack(e){const n=this.acks[e.id];typeof n=="function"&&(delete this.acks[e.id],n.withError&&e.data.unshift(null),n.apply(this,e.data))}onconnect(e,n){this.id=e,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Re.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(e===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(e===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,e.data)}}}function Pr(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}Pr.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=Math.floor(e*10)&1?t+n:t-n}return Math.min(t,this.max)|0};Pr.prototype.reset=function(){this.attempts=0};Pr.prototype.setMin=function(t){this.ms=t};Pr.prototype.setMax=function(t){this.max=t};Pr.prototype.setJitter=function(t){this.jitter=t};class Aa extends Ze{constructor(e,n){var r;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(n=e,e=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,bs(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 Pr({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=e;const i=n.parser||kw;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var n;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(n=this.backoff)===null||n===void 0||n.setMin(e),this)}randomizationFactor(e){var n;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(n=this.backoff)===null||n===void 0||n.setJitter(e),this)}reconnectionDelayMax(e){var n;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(n=this.backoff)===null||n===void 0||n.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new pw(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=qt(n,"open",function(){r.onopen(),e&&e()}),s=l=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",l),e?e(l):this.maybeReconnectOnOpen()},a=qt(n,"error",s);if(this._timeout!==!1){const l=this._timeout,c=this.setTimeoutFn(()=>{i(),s(new Error("timeout")),n.close()},l);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(i),this.subs.push(a),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(qt(e,"ping",this.onping.bind(this)),qt(e,"data",this.ondata.bind(this)),qt(e,"error",this.onerror.bind(this)),qt(e,"close",this.onclose.bind(this)),qt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(n){this.onclose("parse error",n)}}ondecoded(e){xs(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,n){let r=this.nsps[e];return r?this._autoConnect&&!r.active&&r.connect():(r=new Dd(this,e,n),this.nsps[e]=r),r}_destroy(e){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(e){const n=this.encoder.encode(e);for(let r=0;r<n.length;r++)this.engine.write(n[r],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=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(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const Ur={};function Mi(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const n=fw(t,e.path||"/socket.io"),r=n.source,i=n.id,s=n.path,a=Ur[i]&&s in Ur[i].nsps,l=e.forceNew||e["force new connection"]||e.multiplex===!1||a;let c;return l?c=new Aa(r,e):(Ur[i]||(Ur[i]=new Aa(r,e)),c=Ur[i]),n.query&&!e.query&&(e.query=n.queryKey),c.socket(n.path,e)}Object.assign(Mi,{Manager:Aa,Socket:Dd,io:Mi,connect:Mi});var Oe=(t=>(t.ChatView="chat:user:view",t.ChatClose="chat:user:close",t.MessageList="message:list",t.MessageCreate="message:create",t.MessageTyping="message:typing",t.WidgetOpen="widget:open",t.WidgetClose="widget:close",t.PageChange="page-change",t.MessageRead="message:read",t.AgentRequestHuman="agent:request:human",t.AgentMessageCreate="agent:message:create",t.ChatUpdateInputs="chat:update:inputs",t))(Oe||{}),de=(t=>(t.Connect="connect",t.Disconnect="disconnect",t.ConnectionReady="connection:ready",t.MessageAgentCreate="message:agent:create",t.MessageUserCreate="message:user:create",t.MessageCustomerCreate="message:customer:create",t.MessageAgentTyping="message:agent:typing",t.Banned="banned",t.ChatUserClose="chat:user:close",t.ChatUserAssignee="chat:user:assignee",t.ChatToggleUpload="chat:user:upload:toggle",t.ChatUserShowButton="chat:user:show-button",t.ChatUserLeave="chat:user:leave",t.ChatUserJoin="chat:user:join",t.CustomerSessionRenewed="customer:session:renewed",t.AgentMessageChunk="agent:message:chunk",t.AgentMessageStreamStatus="agent:message:stream_status",t.AgentMessageFinalMetadata="agent:message:final_metadata",t.AgentSpamWarning="agent:spam:warning",t.AgentSpamBanned="agent:spam:banned",t))(de||{});const Fd=p.createContext(null),ln=()=>{const t=p.useContext(Fd);if(!t)throw new Error("useWebsocket must be used within a WebSocketProvider");return t},jw=({children:t})=>{const{widget:e,isHaveChat:n,isAIAgentMode:r}=G(),i=p.useRef(null),s=p.useRef(!1),a=p.useRef(!1),l=p.useRef(null),[c,d]=p.useState(!1),[f,u]=p.useState(!1),[m,h]=p.useState(!1),b=p.useRef(!1),C=p.useRef(new Map),y=p.useCallback(F=>{var T;console.log("WS: cleanupSocket called",{reason:F,hasSocket:!!i.current,isConnected:(T=i.current)==null?void 0:T.connected,currentLinkId:l.current}),i.current&&(console.log("WS: Cleaning up existing socket.",F||""),i.current.removeAllListeners(),i.current.disconnect(),i.current=null),d(!1),u(!1),a.current=!1,s.current=!1,l.current=null},[]),v=p.useCallback((F,T,A)=>{if(l.current===F&&(a.current||i.current&&i.current.connected)){console.log("WS: Connect called but already connecting or connected for same linkId.");return}if(!T&&!A){console.log("WS: Connect skipped - no active chat or AI agent mode");return}const B=Wr(Ye.CustomerToken,F)||fr("customer_token"),D=Wr(Ye.CustomerRefreshToken,F)||fr("customer_refresh_token");if(!B||!D){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{G.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:F,tokenPrefix:`${B==null?void 0:B.substring(0,20)}...`,refreshTokenPrefix:`${D==null?void 0:D.substring(0,20)}...`,deviceId:Wr(Ye.DeviceId,F)}),a.current=!0,l.current=F,b.current=!1,h(!1),C.current.clear();const M=Mi(Bp,{transports:["websocket"],forceNew:!0,timeout:1e4,auth:{customer_token:B,device_id:Wr(Ye.DeviceId,F)||fr("device_id"),customer_refresh_token:D}});i.current=M,M.on(de.CustomerSessionRenewed,R=>{F&&(Rt(Ye.CustomerToken,R.customer_token,F),Rt(Ye.CustomerRefreshToken,R.customer_refresh_token,F))}),M.on("error",R=>{console.error("WS: Websocket error",R),a.current=!1}),M.on("connect_error",R=>{console.error("WS: Connect error",R),a.current=!1,d(!1),u(!1),i.current===M&&(i.current=null,l.current=null);const P=(R==null?void 0:R.message)||String(R);if(P.toLowerCase().includes("unauthorized")||P.includes("401")){console.log("WS: Unauthorized error, clearing tokens only"),F&&wu(F),localStorage.removeItem("lc:widget:isHaveChat");try{G.getState().setIsHaveChat(!1)}catch{}}}),M.on("disconnect",R=>{var j;console.log("WS: Disconnected",R),d(!1),u(!1),a.current=!1,s.current=!1,i.current===M&&(i.current=null,l.current=null);const P=G.getState();R==="io server disconnect"&&((j=P.widget)!=null&&j.link_id)&&(P.isHaveChat||P.isAIAgentMode)&&(console.log("WS: Server disconnect, attempting reconnect..."),setTimeout(()=>{v(P.widget.link_id,P.isHaveChat,P.isAIAgentMode)},500))}),M.on("connect",()=>{console.log("WS: Connected successfully"),d(!0),a.current=!1}),M.on(de.ChatUserClose,()=>{b.current||(b.current=!0,h(!0))}),M.on("connection:ready",()=>{console.log("WS: Connection ready received"),s.current=!0,u(!0)})},[]);p.useEffect(()=>{const F=e==null?void 0:e.link_id;return F&&(n||r)?(console.log("WS: Auto-connecting due to linkId and isHaveChat/isAIAgentMode",{isHaveChat:n,isAIAgentMode:r}),v(F,n,r)):!n&&!r&&(console.log("WS: Auto-disconnect due to no isHaveChat and no isAIAgentMode"),y("no active chat flags")),()=>{}},[e==null?void 0:e.link_id,n,r,v,y]),p.useEffect(()=>()=>{console.log("WS: Provider unmounting, cleaning up"),y("provider unmount")},[y]),p.useEffect(()=>{const F=()=>{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",F),window.addEventListener("pagehide",T),()=>{window.removeEventListener("beforeunload",F),window.removeEventListener("pagehide",T)}},[]);const E=p.useCallback(()=>{const F=e==null?void 0:e.link_id;F?v(F,n,r):console.warn("WS: Manual connect failed, no link_id available.")},[e==null?void 0:e.link_id,n,r,v]),I=p.useCallback(()=>{console.log("WS: Reconnecting..."),y("manual reconnect");const F=e==null?void 0:e.link_id;F&&setTimeout(()=>{v(F,n,r)},100)},[e==null?void 0:e.link_id,n,r,v,y]),_=p.useCallback(()=>{console.log("WS: Manual disconnect"),y("manual disconnect")},[y]),L=p.useCallback((F,T)=>{var A;(A=i.current)==null||A.on(F,T)},[]),w=p.useCallback((F,T)=>{var A;(A=i.current)==null||A.off(F,T)},[]),$=p.useCallback(()=>{b.current||(b.current=!0,h(!0))},[]),H=p.useCallback((F,T,A)=>{const B=new Set([Oe.AgentMessageCreate,Oe.AgentRequestHuman,Oe.MessageCreate,Oe.MessageTyping]);if(b.current&&B.has(F)){console.warn(`WS: Dropping '${F}' — chat marked as ended locally.`);return}if(new Set([Oe.AgentMessageCreate,Oe.AgentRequestHuman,Oe.MessageCreate,Oe.ChatClose]).has(F)){const M=Date.now(),R=C.current.get(F)??0;if(M-R<800){console.warn(`WS: Dropping '${F}' — duplicate within 800ms.`);return}C.current.set(F,M)}i.current&&i.current.connected?i.current.emit(F,T,A):console.warn(`WS: Cannot emit event '${F}', socket not connected.`)},[]),q=p.useMemo(()=>({connectionReady:f,connected:c,connect:E,reconnect:I,disconnect:_,on:L,off:w,emit:H,markChatEnded:$,chatEnded:m}),[c,f,E,I,_,L,w,H,$,m]);return o.jsx(Fd.Provider,{value:q,children:t})},Ui=(t,e,n)=>{const r=typeof window<"u"?window:void 0;p.useEffect(()=>(r.addEventListener(t,e),()=>{r.removeEventListener(t,e,!1)}),[t,e,r])},Br=()=>{let t=!1,e=!1;return typeof window<"u"&&(t=new URLSearchParams(window.location.search).get("fullscreen")==="true",e=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(window.navigator.userAgent)),t||e},Pd=()=>{let t=!1;return typeof window<"u"&&(t=new URLSearchParams(window.location.search).get("fullscreen")==="true"),t},ws=()=>p.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),[]);function Ew(){const t=ys(),e=p.useCallback(()=>{const n=window.location.pathname;n!==t.page&&t.setPage(n)},[t.page]);return Ui("popstate",e),null}function Tw(){const t=ln(),e=ys(),n=p.useCallback(()=>{const r=window.location.pathname;if(r!==e.page){if(t){t.emit(Oe.PageChange,{page:r});return}e.setPage(r)}},[t,e.page]);return Ui("popstate",n),p.useEffect(()=>{if(!t)return;const r=o0(),i=a0();r!==i&&(t.emit(Oe.PageChange,{page:i}),e.setPage(i))},[t]),null}const Aw=t=>{const e=new URLSearchParams;for(const[r,i]of Object.entries(t))typeof i>"u"||i===""||e.set(r,String(i));const n=e.toString();return n?`?${n}`:""},Rw=(t,e={})=>Jn({queryKey:["widget-news",t,e.page??1,e.limit??10,e.q??""],queryFn:async()=>{const[n,r]=await _t(`widgets/${t}/news${Aw({page:e.page??1,limit:e.limit??10,q:e.q})}`);return gt(r)&&n&&typeof n=="object"&&"list"in n?n:{page:e.page??1,limit:e.limit??10,list:[]}},enabled:!!t}),Ow=(t,e)=>Jn({queryKey:["widget-news-detail",t,e??""],queryFn:async()=>{const[n,r]=await _t(`widgets/${t}/news/${e}`);return gt(r)&&n&&typeof n=="object"?n:null},enabled:!!t&&!!e}),Nw=t=>Jn({queryKey:["widget-help-categories",t],queryFn:async()=>{const[e,n]=await _t(`widgets/${t}/help-center/categories`);return gt(n)&&Array.isArray(e)?e:[]},enabled:!!t}),Iw=(t,e)=>Jn({queryKey:["widget-help-detail",t,e??""],queryFn:async()=>{const[n,r]=await _t(`widgets/${t}/help-center/${e}`);return gt(r)&&n&&typeof n=="object"?n:null},enabled:!!t&&!!e});function Mw(){return Ew(),null}const fc=(t,e)=>{var n;return(n=t.find(r=>r.type===e))==null?void 0:n.content},hc=t=>(t??"").replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim(),$w=t=>{if(!t)return"";try{return new Intl.DateTimeFormat("tr-TR",{day:"2-digit",month:"short"}).format(new Date(t))}catch{return""}};function Dw(){var Kt,Cs,jo,Eo,To,Ao,Ro,Oo,No,Io,Mo,$o,Do,Fo,Po,Bo,Lo,zo,Ho;const t=Ee(),e=G(ne=>ne.widget),n=G(ne=>ne.setOpen),r=G(ne=>ne.setAIAgent),i=G(ne=>ne.setIsAIAgentMode),s=G(ne=>ne.setIsHaveChat),a=G(ne=>ne.isHaveChat),l=G(ne=>ne.humanNeedRequested),c=G(ne=>ne.setHumanNeedRequested),d=G(ne=>ne.aiAgent),f=G(ne=>ne.setShowActionButtons),u=G(ne=>ne.showHistoryOnRegistration),m=G(ne=>ne.setShowHistoryOnRegistration),h=G(ne=>ne.defaultValues),[b,C]=p.useState(!1),[y,v]=p.useState(!1),[E,I]=p.useState(null),_=ar(),L=Br(),w=ws(),[$,H]=p.useState(!0),[q,F]=p.useState(!1),[T,A]=p.useState(!1),B=ys(),D=Qa(),M=ln(),R=Yi(),{data:P}=Tu(e==null?void 0:e.link_id),[j,U]=p.useState(null),Y=p.useRef(!1),Q=p.useRef(!1),Z=p.useRef(!1),ee=p.useRef(!1),[se,ce]=p.useState(!1),[ue,je]=p.useState("home"),[Te,Se]=p.useState(""),[ve,ge]=p.useState(""),[S,W]=p.useState(""),[K,he]=p.useState([]),[ae,be]=p.useState(null),[Pe,oe]=p.useState(null),V=(e==null?void 0:e.link_id)||"",te=Rw(V,{page:1,limit:8}),k=Nw(V),z=Ow(V,ae),O=Iw(V,Pe),N=li(),X=p.useCallback(async ne=>{var le,Je,_s;if(!e||ee.current)return;const tt=(ne==null?void 0:ne.trim())||"";ee.current=!0,ce(!0),I(null),G.getState().setHistoryChat(null),G.getState().setHistoryMessages(null),G.getState().clearAIAgentState(),f(!1);try{let lr=null;try{lr=await Xa(e.link_id)}catch($t){console.error("Failed to resolve widget agent for new chat:",$t),lr=null}R.setQueryData(Eu(e.link_id),lr);const pp=(((_s=(Je=(le=e.appearance)==null?void 0:le.body)==null?void 0:Je.inputs)==null?void 0:_s.length)||0)>0;if(lr){if(U(lr),Z.current)return;Z.current=!0;try{const $t={username:(h==null?void 0:h.username)||"Ziyaretçi",email:`visitor_${Date.now()}@temp.local`};h!=null&&h.secret_data&&($t.secret_data=h.secret_data);const[qe,ks]=await D.mutateAsync({inputs:$t,history:B.history,client_id:e.client_id,widget_id:e.link_id,device_id:mn(e.link_id),is_agent_mode:!0});gt(ks)&&da(qe)?(Rt(Ye.CustomerToken,qe.customer_token,e.link_id),Rt(Ye.CustomerRefreshToken,qe.customer_refresh_token,e.link_id),Rt(Ye.DeviceId,qe.device_id,e.link_id),B.clearHistory(),s(!0),tt&&G.getState().setPendingInitialAgentMessage(tt),r(lr),i(!0),_.push("chat")):(Tr(qe),(qe==null?void 0:qe.statusCode)===403&&I((qe==null?void 0:qe.message)||"Sohbet başlatılamadı."))}catch($t){console.error("Error creating chat for AI agent:",$t)}finally{Z.current=!1}return}if(!pp){if(Z.current)return;Z.current=!0;try{const $t={};h!=null&&h.secret_data&&($t.secret_data=h.secret_data),h!=null&&h.username&&($t.username=h.username);const[qe,ks]=await D.mutateAsync({inputs:$t,history:B.history,client_id:e.client_id,widget_id:e.link_id,device_id:mn(e.link_id)});gt(ks)&&da(qe)?(Rt(Ye.CustomerToken,qe.customer_token,e.link_id),Rt(Ye.CustomerRefreshToken,qe.customer_refresh_token,e.link_id),Rt(Ye.DeviceId,qe.device_id,e.link_id),B.clearHistory(),s(!0),_.push("chat")):(Tr(qe),(qe==null?void 0:qe.statusCode)===403&&I((qe==null?void 0:qe.message)||"Sohbet başlatılamadı."))}catch($t){console.error("Error creating chat:",$t)}finally{Z.current=!1}return}U(null),A(!0),H(!1)}finally{ee.current=!1,ce(!1)}},[e,R,D,B,h==null?void 0:h.secret_data,h==null?void 0:h.username,s,r,i,_,f]),ie=p.useCallback(ne=>{F(ne)},[]),xe=!!ae||!!Pe;p.useEffect(()=>(G.getState().setPortalDetailOpen(xe),()=>{G.getState().setPortalDetailOpen(!1)}),[xe]),p.useEffect(()=>{u&&(H(!0),je("messages"),be(null),oe(null),A(!1),m(!1))},[u,m]);const Ne=ne=>{je(ne),be(null),oe(null),G.getState().setPortalDetailOpen(!1)};if(!e)return null;const Ge=()=>{n(!1)};p.useEffect(()=>{Y.current=!1},[e==null?void 0:e.link_id]),p.useEffect(()=>{var tt,le,Je;if(!e)return;const ne=Qt(e.link_id);if(ne.isAgentMode&&ne.agent&&(N!=null&&N.accessToken)&&!Y.current){if(Y.current=!0,r(ne.agent),ne.sessionId&&G.getState().setAIAgentSessionId(ne.sessionId),ne.humanNeedRequested){if(G.getState().setHumanNeedRequested(!0),!((((Je=(le=(tt=e.appearance)==null?void 0:tt.body)==null?void 0:le.inputs)==null?void 0:Je.length)||0)>0)){_.push("chat");return}return}U(ne.agent),_.push("chat")}},[e,N==null?void 0:N.accessToken,N==null?void 0:N.refreshToken,_,r,i]),p.useEffect(()=>{if(!e)return;const ne=Qt(e.link_id);ne.isAgentMode&&ne.agent&&(N!=null&&N.accessToken)||P!==void 0&&U(P)},[e,P,N==null?void 0:N.accessToken]),p.useEffect(()=>{if(b||!e||!N||!N.accessToken){Q.current=!1;return}if(Q.current||l)return;if(a){_.push("chat");return}const ne=Qt(e.link_id);ne.isAgentMode&&ne.agent&&!ne.humanNeedRequested||(Q.current=!0,jm(e.client_id,Vn(Wn(N),e.link_id)).then(([tt,le])=>{if(gt(le))l||_.push("chat");else if(le===403){const Je=Qt(e.link_id);if(Je.isAgentMode&&Je.agent){if(Je.humanNeedRequested){r(Je.agent),i(!1),Je.sessionId&&G.getState().setAIAgentSessionId(Je.sessionId),G.getState().setHumanNeedRequested(!0);return}r(Je.agent),Je.sessionId&&G.getState().setAIAgentSessionId(Je.sessionId),_.push("chat")}else Gr(e.link_id||""),C(!0)}else le===404?(Gr(e.link_id||""),C(!0)):le===401?(wu(e.link_id||""),C(!0)):_.push("chat")}).catch(()=>_.push("chat")))},[b,_,r,i,e,N==null?void 0:N.accessToken,N==null?void 0:N.refreshToken,a,l]);const pt=fc(((Cs=(Kt=e.appearance)==null?void 0:Kt.head)==null?void 0:Cs.elements)||[],"text"),et=((Eo=(jo=e.appearance)==null?void 0:jo.design)==null?void 0:Eo.greeting_header)||fc(((Ao=(To=e.appearance)==null?void 0:To.head)==null?void 0:Ao.elements)||[],"title"),Lt=()=>{if(l&&e){let ne=d;if(!ne){const tt=Qt(e.link_id);tt.agent&&(ne=tt.agent,r(tt.agent),U(tt.agent))}if(ne){i(!0),G.getState().setHistoryChat(null),G.getState().setHistoryMessages(null),_.push("chat");return}}A(!1),H(!0)},ft=()=>{j&&(r(j),i(!0),G.getState().setHistoryChat(null),G.getState().setHistoryMessages(null),_.push("chat"))},rt=p.useCallback(ne=>{if(!M||y)return;v(!0);const tt=()=>{M.emit(Oe.AgentRequestHuman,{},le=>{v(!1),le!=null&&le.success&&(G.getState().setIsHaveChat(!0),f(!1),i(!1),c(!1),G.getState().clearAIAgentState(),_.push("chat"))})};ne&&Object.keys(ne).length>0?M.emit(Oe.ChatUpdateInputs,{inputs:ne},le=>{le!=null&&le.success?tt():v(!1)}):tt()},[M,y,i,c,_]);p.useEffect(()=>{var ne,tt,le;if(l){if(!d&&e){const Je=Qt(e.link_id);Je.agent&&(r(Je.agent),U(Je.agent))}(d||Qt((e==null?void 0:e.link_id)||"").agent)&&((((le=(tt=(ne=e==null?void 0:e.appearance)==null?void 0:ne.body)==null?void 0:tt.inputs)==null?void 0:le.length)||0)>0?H(!1):rt())}},[l,d,e,rt,r]);const kt=((Ro=te.data)==null?void 0:Ro.list)??[],Mt=kt[0],St=k.data??[],ye=(No=(Oo=e==null?void 0:e.appearance)==null?void 0:Oo.design)==null?void 0:No.texts,yt=(ye==null?void 0:ye.portal_home_title)||"Merhaba",Lr=(ye==null?void 0:ye.portal_messages_title)||"Mesajlarınız",jt=(ye==null?void 0:ye.portal_news_title)||"Haberler",we=(ye==null?void 0:ye.portal_help_title)||"Yardım Merkezi",He=(ye==null?void 0:ye.portal_home_help_placeholder)||"Yardım ara...",Qe=(ye==null?void 0:ye.portal_help_search_placeholder)||"Makale ara...",Ce=(Mo=(Io=e.appearance)==null?void 0:Io.design)==null?void 0:Mo.portal,Ue={bottomBar:(Ce==null?void 0:Ce.bottom_bar)!==!1,tabs:{messages:(($o=Ce==null?void 0:Ce.tabs)==null?void 0:$o.messages)!==!1,news:((Do=Ce==null?void 0:Ce.tabs)==null?void 0:Do.news)!==!1,help:((Fo=Ce==null?void 0:Ce.tabs)==null?void 0:Fo.help)!==!1},home:{showNews:((Po=Ce==null?void 0:Ce.home)==null?void 0:Po.show_news)!==!1,showHelp:((Bo=Ce==null?void 0:Ce.home)==null?void 0:Bo.show_help)!==!1,entry:((Lo=Ce==null?void 0:Ce.home)==null?void 0:Lo.entry)||"auto",order:((zo=Ce==null?void 0:Ce.home)==null?void 0:zo.order)||["entry","news","help"]},messages:{showHistory:((Ho=Ce==null?void 0:Ce.messages)==null?void 0:Ho.show_history)!==!1}},Le=["home",...Ue.tabs.messages?["messages"]:[],...Ue.tabs.news?["news"]:[],...Ue.tabs.help?["help"]:[]],it=ne=>{ne._id&&(be(ne._id),oe(null))},cn=ne=>{ne._id&&(oe(ne._id),be(null))},st=()=>{be(null),oe(null)},ct=()=>{const ne=Te.trim();ne&&(Se(""),X(ne))};p.useEffect(()=>{Le.includes(ue)||Ne("home")},[ue,Le.join("|")]);const pi=()=>{if(ae){const le=z.data;return o.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[o.jsxs("div",{className:"flex shrink-0 items-center justify-between px-5 py-4",children:[o.jsxs("button",{type:"button",onClick:st,className:"flex items-center gap-2 text-sm font-bold",style:{color:t.getColor(g.FooterText)},children:[o.jsx(fe.ArrowLeft,{className:"size-5"}),"Haberlere dön"]}),o.jsx("button",{type:"button",onClick:Ge,className:"p-2",style:{color:t.getColor(g.CloseButtonText)},children:o.jsx(fe.X,{className:"size-6"})})]}),o.jsxs("article",{className:"min-h-0 flex-1 overflow-y-auto px-5 pb-6",children:[(le==null?void 0:le.cover_image_url)&&o.jsx("img",{src:le.cover_image_url,alt:"",className:"mb-5 h-56 w-full rounded-2xl object-cover"}),o.jsx("div",{className:"mb-3 text-xs font-bold uppercase",style:{color:t.getColor(g.LinkColor)},children:$w((le==null?void 0:le.published_at)||(le==null?void 0:le.updated_at))}),o.jsx("h1",{className:"text-2xl font-black leading-tight",style:{color:t.getColor(g.HeaderText)},children:(le==null?void 0:le.title)||"Haber yükleniyor"}),o.jsx("div",{className:"prose prose-sm mt-5 max-w-none prose-p:leading-7",style:{color:t.getColor(g.GreeterText)},dangerouslySetInnerHTML:{__html:(le==null?void 0:le.content_html)||hc(le==null?void 0:le.content_text)||"<p>İçerik yükleniyor.</p>"}})]})]})}if(Pe){const le=O.data;return o.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[o.jsxs("div",{className:"flex shrink-0 items-center justify-between px-5 py-4",children:[o.jsxs("button",{type:"button",onClick:st,className:"flex items-center gap-2 text-sm font-bold",style:{color:t.getColor(g.FooterText)},children:[o.jsx(fe.ArrowLeft,{className:"size-5"}),"Yardıma dön"]}),o.jsx("button",{type:"button",onClick:Ge,className:"p-2",style:{color:t.getColor(g.CloseButtonText)},children:o.jsx(fe.X,{className:"size-6"})})]}),o.jsxs("article",{className:"min-h-0 flex-1 overflow-y-auto px-5 pb-6",children:[o.jsx("h1",{className:"text-2xl font-black leading-tight",style:{color:t.getColor(g.HeaderText)},children:(le==null?void 0:le.title)||"İçerik yükleniyor"}),o.jsx("div",{className:"prose prose-sm mt-5 max-w-none prose-p:leading-7",style:{color:t.getColor(g.GreeterText)},dangerouslySetInnerHTML:{__html:(le==null?void 0:le.content_html)||hc(le==null?void 0:le.content_text)||"<p>İçerik yükleniyor.</p>"}})]})]})}if(ue==="messages"&&Ue.tabs.messages)return o.jsxs(o.Fragment,{children:[o.jsx(hi,{title:Lr}),o.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto px-5 pb-3",children:[o.jsx(qo,{onClick:()=>void X(),loading:se}),Ue.messages.showHistory&&o.jsxs(o.Fragment,{children:[o.jsx("h2",{className:"mt-4 px-1 !text-xs font-black uppercase tracking-widest",style:{color:t.getColor(g.FooterText)},children:"Geçmiş Görüşmeler"}),o.jsx("div",{className:"mt-2 h-[300px] overflow-hidden",children:o.jsx(N0,{onHasHistory:ie,emptyStateText:E||void 0})})]})]})]});if(ue==="news"&&Ue.tabs.news)return o.jsxs(o.Fragment,{children:[o.jsx(hi,{title:jt}),o.jsx("div",{className:"min-h-0 flex-1 space-y-4 overflow-y-auto px-5 pb-3",children:kt.length===0?o.jsx("div",{className:"rounded-2xl border p-6 text-center text-sm font-medium",style:{backgroundColor:t.getColor(g.GreeterBackground),borderColor:t.getColor(g.GreeterBorder),color:t.getColor(g.FooterText)},children:"Henüz yayınlanmış haber yok."}):kt.map(le=>o.jsx(Wo,{article:le,onClick:()=>it(le)},le._id))})]});if(ue==="help"&&Ue.tabs.help)return o.jsxs(o.Fragment,{children:[o.jsx(hi,{title:we}),o.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto px-5 pb-3",children:[o.jsxs("div",{className:"relative mb-5",children:[o.jsx(fe.Search,{className:"absolute left-4 top-1/2 size-5 -translate-y-1/2",style:{color:t.getColor(g.IconColor)}}),o.jsx("input",{value:S,onChange:le=>W(le.target.value),placeholder:Qe,className:"h-11 w-full rounded-full border pl-11 pr-4 text-sm font-semibold shadow-sm outline-none placeholder:opacity-60",style:{backgroundColor:t.getColor(g.InputBackground),borderColor:t.getColor(g.InputBorder),color:t.getColor(g.InputText)}})]}),o.jsx(Vo,{categories:St,query:S,onOpen:cn,path:K,onPathChange:he})]})]});const tt={entry:Ue.home.entry==="input"||Ue.home.entry==="auto"&&!!j?o.jsx(_p,{value:Te,onChange:Se,onSubmit:ct,loading:se},"entry"):o.jsx(qo,{onClick:()=>void X(),loading:se},"entry"),news:Ue.home.showNews&&Mt?o.jsx(Wo,{article:Mt,onClick:()=>it(Mt),compact:!0},"news"):null,help:Ue.home.showHelp?o.jsxs("div",{className:"space-y-5",children:[o.jsxs("div",{className:"relative",children:[o.jsx(fe.Search,{className:"absolute left-4 top-1/2 size-4 -translate-y-1/2",style:{color:t.getColor(g.IconColor)}}),o.jsx("input",{value:ve,onChange:le=>ge(le.target.value),placeholder:He,className:"h-11 w-full rounded-xl border pl-10 pr-4 text-sm font-semibold shadow-sm outline-none placeholder:opacity-60",style:{backgroundColor:t.getColor(g.InputBackground),borderColor:t.getColor(g.InputBorder),color:t.getColor(g.InputText)}})]}),o.jsx(Vo,{categories:St,query:ve,onOpen:cn,limit:2})]},"help"):null};return o.jsxs(o.Fragment,{children:[o.jsx(hi,{title:yt}),o.jsx("div",{className:"min-h-0 flex-1 space-y-5 overflow-y-auto px-5 pb-3",children:Ue.home.order.map(le=>tt[le])})]})};return o.jsx("div",{className:"h-full w-full flex flex-col relative overflow-hidden",children:$?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",style:{backgroundColor:t.getColor(g.Background)},children:pi()}),!xe&&o.jsxs(o.Fragment,{children:[o.jsx(Er,{variant:"block",className:"shrink-0 py-1"}),Ue.bottomBar&&Le.length>1&&o.jsx(wp,{activeTab:ue,onChange:Ne,visibleTabs:Le})]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("header",{className:"flex items-center justify-between px-4 py-3 flex-shrink-0 overflow-visible min-h-[52px]",style:{backgroundColor:t.getColor(g.HeaderBackground),color:t.getColor(g.HeaderText),borderColor:t.getColor(g.HeaderBorder),...L?{}:{borderTopLeftRadius:t.getRadius(),borderTopRightRadius:t.getRadius()}},children:[o.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[(T||q||l&&(d||e&&Qt(e.link_id).agent))&&o.jsx("button",{type:"button",onClick:Lt,className:"flex-shrink-0 p-1 hover:opacity-80 transition-opacity",children:o.jsx(fe.ArrowLeft,{className:"w-5 h-5"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("div",{className:"text-sm font-semibold truncate",children:et||"Müşteri Hizmetleri"}),pt&&o.jsx("div",{className:"text-xs opacity-90 truncate",children:pt})]})]}),o.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0 ml-2",children:[o.jsx(Cp,{}),w&&o.jsx("button",{type:"button",onClick:Ge,className:"p-1.5 rounded-md hover:opacity-80 transition-opacity",children:o.jsx(fe.X,{className:"w-5 h-5"})})]})]}),o.jsx("div",{className:"flex-1 overflow-y-auto",style:{backgroundColor:t.getColor(g.Background)},children:o.jsx(g0,{clientId:e.client_id,widgetId:e.link_id,appearance:e.appearance,aiAgentMode:!!j&&!l,onAIAgentStart:ft,onOk:()=>{l&&d||(G.getState().setHistoryChat(null),G.getState().setHistoryMessages(null),_.push("chat"))},onOperatorConnect:l&&(d||Qt(e.link_id).agent)?rt:void 0,isConnectingToOperator:y})})]})})}function Fw(){return o.jsxs(o.Fragment,{children:[o.jsx(Dw,{}),o.jsx(Mw,{})]})}const Pw=[{path:"/",component:Fw,name:"registration"}],Bw="/notify.mp3",ko="lc:notification_sound_muted",Bd=()=>{try{return sessionStorage.getItem(ko)==="1"}catch{return!1}},Ld=t=>{try{sessionStorage.setItem(ko,t?"1":"0")}catch{}},Lw=async t=>{try{if(sessionStorage.getItem(ko)==="1")return}catch{}await new Audio(t||Bw).play()},Hs=[dt.Light,dt.Dark,dt.System];function zw(t){switch(t){case dt.Light:return fe.Sun;case dt.Dark:return fe.Moon;case dt.System:return fe.Monitor;default:return fe.Monitor}}function Hw({onChatClose:t}){const[e,n]=p.useState(!1),[r,i]=p.useState(!1),[s,a]=p.useState(()=>Bd()),l=p.useRef(null),c=p.useRef(null),d=Ee(),f=Mr(),u=ln(),{setShowActionButtons:m}=G(),{mode:h,setMode:b}=d,C=()=>{u==null||u.emit(Oe.ChatClose,{}),m(!1),t()},y=()=>{const I=Hs.indexOf(h),_=Hs[(I+1)%Hs.length];b(_)},v=()=>{const I=!s;Ld(I),a(I)};p.useEffect(()=>{if(!r)return;const I=_=>{var L,w;(L=c.current)!=null&&L.contains(_.target)||(w=l.current)!=null&&w.contains(_.target)||i(!1)};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[r]);const E=r&&o.jsxs($e.div,{ref:c,onMouseDown:I=>I.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:d.getColor(g.Background),borderColor:d.getColor(g.Border),borderRadius:d.getRadius(),boxShadow:`0 4px 12px ${d.getColor(g.ShadowColor)}`},children:[o.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:d.getColor(g.ErrorText)},onClick:()=>{i(!1),n(!0)},children:[o.jsx(fe.XCircle,{className:"size-4 flex-shrink-0"}),f(_e.ChatEndConversation)]}),o.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:d.getColor(g.InputText)},onClick:v,children:[s?o.jsx(fe.VolumeX,{className:"size-4 flex-shrink-0"}):o.jsx(fe.Volume2,{className:"size-4 flex-shrink-0"}),f(s?_e.NotificationSoundOn:_e.NotificationSoundOff)]}),o.jsx("div",{className:"my-1 h-px",style:{backgroundColor:d.getColor(g.DividerColor)}}),o.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:d.getColor(g.InputText)},onClick:y,children:[(()=>{const I=zw(h);return o.jsx(I,{className:"size-4 flex-shrink-0"})})(),h===dt.Light?"Açık tema":h===dt.Dark?"Koyu tema":"Sistem"]})]});return o.jsxs(o.Fragment,{children:[o.jsx(gn,{children:e&&o.jsx($e.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:d.getColor(g.ModalOverlayColor)},children:o.jsxs($e.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:d.getColor(g.Background),borderRadius:d.getRadius()},children:[o.jsx("div",{className:"text-base font-semibold mb-2",style:{color:d.getColor(g.ChatCloseConfirmText)},children:f(_e.ChatCloseConfirm)}),o.jsx("div",{className:"text-sm mb-4",style:{color:d.getColor(g.FooterText)},children:f(_e.ChatCloseWarning)}),o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-lg transition-opacity hover:opacity-90",style:{backgroundColor:d.getColor(g.GreeterBackground),color:d.getColor(g.GreeterText),borderRadius:d.getRadius()},onClick:()=>n(!1),children:f(_e.CancelAction)}),o.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-lg transition-opacity hover:opacity-90",style:{backgroundColor:d.getColor(g.ErrorBackground),color:d.getColor(g.ErrorText),borderRadius:d.getRadius()},onClick:C,children:f(_e.CloseAction)})]})]})})}),o.jsxs("div",{className:"relative flex-shrink-0",children:[o.jsx("button",{ref:l,type:"button",onClick:()=>i(I=>!I),className:"flex items-center justify-center p-1.5 rounded-md hover:opacity-80 transition-opacity",style:{backgroundColor:"transparent",color:d.getColor(g.HeaderText)},title:f(_e.ChatSettings),"aria-expanded":r,children:o.jsx(fe.Menu,{className:"size-5"})}),o.jsx(gn,{children:E})]})]})}function Uw(t){let e=t.replace(/<hr\b[^>]*>/gi,""),n;do n=e,e=e.replace(/<p\b[^>]*>(?:\s| | |�*[aA]0;|�*[aA]0;|<br\s*\/?>)*<\/p>/gi,"");while(e!==n);return e}function Ra({text:t}){const n=Ee().getColor(g.LinkColor),i=(s=>{const a=Uw(s),l=/(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,c=a.split(/(<[^>]*>)/g);let d="",f=!1;for(let u=0;u<c.length;u++){const m=c[u];if(m.startsWith("<")&&m.endsWith(">"))if(m.match(/^<a\s/i)){if(m.includes("style="))d+=m;else{const h=m.replace(/^(<a\s[^>]*)(>)$/i,`$1 style="color: ${n}; text-decoration: underline;"$2`);d+=h}f=!0}else m.match(/^<\/a>/i)?(d+=m,f=!1):d+=m;else if(!f&&m.trim()){const h=m.replace(l,b=>{const C=b.replace(/[">]+$/,"");return`<a href="${/^https?:\/\//i.test(C)?C:`https://${C}`}" target="_blank" rel="noopener noreferrer" style="color: ${n}; text-decoration: underline;">${C}</a>`});d+=h}else d+=m}return d})(t);return o.jsx("div",{className:"linkified !text-sm w-full min-w-0",dangerouslySetInnerHTML:{__html:i}})}const mc="opacity-0 group-hover/item:opacity-100 transition-opacity duration-200";function zd({files:t,className:e,onDelete:n,hideName:r}){const i=Br(),{getColor:s}=Ee(),[a,l]=p.useState(new Map),[c,d]=p.useState(null);p.useEffect(()=>{const v=new Map;for(let E=0;E<t.length;E++){const I=t[E];if(I instanceof File){const _=URL.createObjectURL(I);v.set(E,_)}}return l(v),()=>{for(const E of v.values())URL.revokeObjectURL(E)}},[t]);const f=v=>{var I;return((I=(v instanceof File?v.name:v).split(".").pop())==null?void 0:I.toLowerCase())||""},u=v=>v instanceof File?v.name:v.split("/").pop()||v,m=v=>{const[E,I]=v.split(".");return E.length>10?`${E.slice(0,10)}...${I}`:v},h=v=>{const E=["jpg","jpeg","png","gif","bmp","webp","svg"],I=f(v);return E.includes(I)},b=(v,E)=>{if(v instanceof File){const I=a.get(E);I&&window.open(I,"_blank")}else window.open(v,"_blank")},C=(v,E)=>{v.stopPropagation(),n==null||n(E)},y=(v,E)=>v instanceof File?a.get(E)||"":v;return o.jsx("div",{className:Ie("flex gap-2 w-full overflow-x-auto",e),children:t.map((v,E)=>{const I=u(v),_=f(v),L=h(v),w=y(v,E);return o.jsxs("div",{onClick:()=>b(v,E),onMouseEnter:()=>d(E),onMouseLeave:()=>d(null),className:"min-w-20 max-w-20 cursor-pointer group/item border rounded-lg p-1.5 transition-all duration-200 relative",style:{backgroundColor:s(g.Background),borderColor:s(c===E?g.InputBorder:g.Border),boxShadow:c===E?`0 4px 6px -1px ${s(g.ShadowColor)}`:void 0},children:[n&&o.jsx("button",{onClick:$=>C($,E),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:o.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",children:o.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"})})}),L?o.jsx("div",{className:"aspect-square w-fit mb-0.5 overflow-hidden rounded",children:o.jsx("img",{src:w,alt:I,className:"w-16 h-16 min-h-16 min-w-16 object-cover group-hover/item:scale-105 transition-transform duration-200"})}):o.jsx("div",{className:"min-w-16 aspect-square w-full mb-0.5 flex items-center justify-center rounded transition-colors duration-200",style:{backgroundColor:s(c===E?g.CloseButtonHover:g.InputBackground)},children:o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"w-6 h-6 mx-auto mb-0.5 rounded flex items-center justify-center",style:{backgroundColor:`color-mix(in srgb, ${s(g.ButtonBackground)} 20%, transparent)`},children:o.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",style:{color:s(g.ButtonBackground)},children:o.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"})})}),o.jsx("div",{className:Ie("text-[10px] font-medium uppercase",{[mc]:r}),style:{color:s(g.FooterText)},children:_||"file"})]})}),o.jsx("div",{className:Ie("max-w-16 text-[10px] font-medium truncate text-ellipsis overflow-hidden",{[mc]:r}),style:{color:s(g.InputText)},title:I,children:m(I)})]},E)})})}const So="livechat:send:";function gc(t){const e=(t==null?void 0:t.trim())??"";if(!e)return{text:"",suggestedQuestions:[]};let n=null;try{n=JSON.parse(e)}catch{const c=e.indexOf("{"),d=e.lastIndexOf("}");if(c!==-1&&d>c)try{n=JSON.parse(e.slice(c,d+1))}catch{n=null}}if(!n||typeof n!="object"||Array.isArray(n))return{text:t,suggestedQuestions:[]};const r=n,i=r.generation;let s;typeof i=="string"&&i.trim()?s=i.trim():i!=null&&(typeof i=="number"||typeof i=="boolean")?s=String(i):s=t;const a=r.suggested_questions,l=[];if(Array.isArray(a))for(const c of a){if(typeof c=="string"){const d=c.trim();d&&l.push(d)}if(l.length>=10)break}return{text:s,suggestedQuestions:l}}function qw(t){return`${So}${encodeURIComponent(t)}`}function Yr(t){return t.startsWith(So)}function Ww(t){if(!Yr(t))return null;try{return decodeURIComponent(t.slice(So.length))}catch{return null}}function Vw(t){const e=t.id&&String(t.id).trim()||"";if(e)return`id:${e}`;const n=t._id;if(n!=null&&String(n).trim())return`id:${String(n)}`;const r=typeof t.created_at=="string"?t.created_at:t.created_at instanceof Date?t.created_at.toISOString():"",i=(t.content||"").slice(0,40);return`fall:${r}:${i}`}function yc(t){if(t.sender_type!==pe.Agent)return{content:t.content,buttons:t.buttons};if(t.buttons&&t.buttons.length>0)return{content:t.content,buttons:t.buttons};if(Array.isArray(t.buttons)&&t.buttons.length===0){const{text:r}=gc(t.content);return{content:r,buttons:void 0}}const{text:e,suggestedQuestions:n}=gc(t.content);return n.length===0?{content:e,buttons:void 0}:{content:e,buttons:n.map(r=>({label:r,url:qw(r)}))}}const Kw={hidden:{opacity:0,y:8},visible:{opacity:1,y:0}},Yw={hidden:{opacity:0,y:8,scale:.95},visible:{opacity:1,y:0,scale:1}};function Hd({buttons:t,className:e="",onLivechatSend:n,suggestGroupSpent:r=!1}){const i=Ee();if(!t||t.length===0)return null;const s=t.some(c=>Yr(c.url)),a=(c,d)=>{if(Yr(c)){if(r)return;const f=Ww(c);f&&n&&n(f),d.currentTarget.blur();return}c.startsWith("http://")||c.startsWith("https://")?window.open(c,"_blank","noopener,noreferrer"):c.startsWith("tel:")||c.startsWith("mailto:")?window.location.href=c:console.log("Custom action:",c)},l=c=>Yr(c)?null:c.startsWith("http://")||c.startsWith("https://")?o.jsx(fe.ExternalLink,{className:"size-4"}):c.startsWith("tel:")?o.jsx(fe.Phone,{className:"size-4"}):c.startsWith("mailto:")?o.jsx(fe.Mail,{className:"size-4"}):null;return o.jsx($e.div,{className:Ie(e,"mt-2",r&&s&&"opacity-50"),initial:"hidden",animate:"visible",variants:Kw,transition:{duration:.3,ease:"easeOut",staggerChildren:.08},children:o.jsx("div",{className:"rounded-lg ",style:{backgroundColor:`${i.getColor(g.Background)}f0`},children:o.jsx("div",{className:Ie("flex flex-wrap",s?"gap-1.5":"gap-2"),children:t.map((c,d)=>{const f=Yr(c.url),u=f&&r;return o.jsxs($e.button,{type:"button",disabled:u,"aria-disabled":u||void 0,variants:Yw,transition:{duration:.25,ease:"easeOut"},whileHover:u?void 0:{scale:1.02,y:-1,transition:{duration:.15}},whileTap:u?void 0:{scale:.98,transition:{duration:.1}},onClick:m=>a(c.url,m),className:Ie("group inline-flex items-center font-medium transition-all duration-200 relative overflow-hidden",u?"cursor-not-allowed":"cursor-pointer","outline-none focus:outline-none focus-visible:outline-none","[-webkit-tap-highlight-color:transparent]",f?"gap-1.5 px-2.5 py-1.5 text-xs rounded-md max-w-[100%] text-left":"gap-2 px-4 py-2.5 text-sm"),style:{backgroundColor:i.getColor(g.GreeterBackground),color:i.getColor(g.GreeterText),borderRadius:i.getRadius(),border:`1px solid ${i.getColor(g.DividerColor)}`,boxShadow:`0 1px 3px ${i.getColor(g.ShadowColor)}30`},onMouseEnter:m=>{u||(m.currentTarget.style.backgroundColor=i.getColor(g.ButtonBackground),m.currentTarget.style.color=i.getColor(g.ButtonText),m.currentTarget.style.borderColor=i.getColor(g.ButtonBackground),m.currentTarget.style.boxShadow=`0 4px 12px ${i.getColor(g.ShadowColor)}40`)},onMouseLeave:m=>{m.currentTarget.style.backgroundColor=i.getColor(g.GreeterBackground),m.currentTarget.style.color=i.getColor(g.GreeterText),m.currentTarget.style.borderColor=i.getColor(g.DividerColor),m.currentTarget.style.boxShadow=`0 1px 3px ${i.getColor(g.ShadowColor)}30`},children:[o.jsxs("span",{className:Ie("flex items-center min-w-0",f?"gap-1.5":"gap-2"),children:[l(c.url),o.jsx("span",{className:Ie(f?"font-normal leading-snug":"font-medium"),children:c.label})]}),o.jsx("div",{className:"absolute inset-0 opacity-0 group-hover:opacity-100 transition-opacity duration-300",style:{background:`linear-gradient(45deg, transparent 30%, ${i.getColor(g.ButtonText)}10 50%, transparent 70%)`,borderRadius:i.getRadius()}})]},`${c.label}-${d}`)})})})})}const Oa=700,Gw=700;function Qw({msgId:t,skipStagger:e,isCustomerSide:n,hasButtons:r,buttons:i,suggestGroupSpent:s,suggestKey:a,onLivechatSendSuggested:l,setSpentSuggestMsgIds:c}){const[d,f]=p.useState(e&&r);return p.useEffect(()=>{if(e){f(r);return}let u;return f(!1),r&&(u=setTimeout(()=>f(!0),Oa)),()=>{u!==void 0&&clearTimeout(u)}},[t,e,r]),r?o.jsx("div",{className:Ie("w-full",{"flex justify-end":n,"flex justify-start":!n}),children:o.jsx("div",{className:"max-w-[80%]",children:d&&o.jsx(Hd,{buttons:i,suggestGroupSpent:s,onLivechatSend:u=>{c(m=>{const h=new Set(m);return h.add(a),h}),l==null||l(u,!0)}})})}):null}function Xw({msgId:t,text:e,delayMs:n,getBubbleRadius:r}){const i=Ee(),[s,a]=p.useState(n<=0);return p.useEffect(()=>{if(n<=0){a(!0);return}a(!1);const l=setTimeout(()=>a(!0),n);return()=>clearTimeout(l)},[t,n]),s?o.jsx("div",{className:"flex w-full min-w-0 justify-start mt-2",children:o.jsx("div",{className:"max-w-[80%] border-0 px-3 py-2 whitespace-pre-wrap !text-sm",style:{backgroundColor:i.getColor(g.MessageAdminBackground),color:i.getColor(g.MessageAdminText),borderRadius:r(pe.Agent)},children:o.jsx(Ra,{text:e})})}):null}const vc=t=>t?(typeof t=="string"&&(t=new Date(t)),t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})):"";function Ud({messages:t,isTyping:e,chat:n,streamingContent:r,streamingStatusText:i,onLivechatSendSuggested:s}){var $,H,q,F;const a=p.useRef(null),l=p.useRef(null),[c,d]=p.useState(!0),f=p.useRef(!0),{widget:u,showActionButtons:m}=G(),h=Ee(),b=p.useRef(!0),C=p.useRef(new Set),[y,v]=p.useState(()=>new Set),E=p.useRef(null);p.useEffect(()=>{E.current===null&&t.length!==0&&(E.current=new Set(t.map(T=>String(T.id??"")).filter(Boolean)))},[t]),p.useEffect(()=>{t.length>0&&b.current&&requestAnimationFrame(()=>{b.current=!1})},[t]),p.useEffect(()=>{t.length===0&&(C.current.clear(),v(new Set),E.current=null)},[t.length]);const I=()=>{const T=l.current;T&&(T.scrollTop=T.scrollHeight)},_=()=>{if(l.current){const{scrollTop:T,scrollHeight:A,clientHeight:B}=l.current,D=A-T<=B+10;f.current=D,d(D)}};p.useEffect(()=>{(f.current||e)&&I()},[t,e,r,i]);const L=(T,A)=>{if(b.current)return{initial:!1,animate:{}};const B=T.id||"";return C.current.has(B)?A===pe.Customer?{initial:!1,animate:{opacity:1,x:0}}:{initial:!1,animate:{}}:(C.current.add(B),A===pe.Customer?{initial:{opacity:0,x:30},animate:{opacity:1,x:0}}:{initial:!1,animate:{}})},w=T=>T===pe.Customer?"18px 18px 4px 18px":T===pe.User||T===pe.Agent?"18px 18px 18px 4px":h.getRadius();return o.jsxs("section",{onScroll:_,ref:l,className:"flex flex-col gap-3 w-full grow pt-4 px-4 overflow-y-auto overflow-x-hidden scrollbar",children:[((H=($=u==null?void 0:u.appearance)==null?void 0:$.design)==null?void 0:H.greeting_message)&&o.jsx("div",{className:"flex w-full items-center justify-start",children:o.jsx("div",{className:"max-w-[80%] whitespace-pre-wrap border-0 px-3 py-2 !text-sm",style:{backgroundColor:h.getColor(g.MessageAdminBackground),color:h.getColor(g.MessageAdminText),borderRadius:"18px 18px 18px 4px"},children:(F=(q=u==null?void 0:u.appearance)==null?void 0:q.design)==null?void 0:F.greeting_message})}),o.jsx(gn,{children:Array.isArray(t)&&(()=>{const T=t.filter(j=>{var U;return j!=null&&(!!j.content||(((U=j.files)==null?void 0:U.length)??0)>0)&&j.content!==`
|
|
54
|
+
`}),A=T.length-1,B=A>=0?T[A]:null,D=(B==null?void 0:B.sender_type)===pe.Customer,M=(B==null?void 0:B.sender_type)===pe.Agent?yc(B):null,R=(B==null?void 0:B.sender_type)===pe.Agent&&!!(M!=null&&M.buttons&&M.buttons.length>0),P=!D&&R;return T.map((j,U)=>{var Se,ve,ge;const Y=yc(j),Q=Vw(j),Z=T.slice(U+1).some(S=>S.sender_type===pe.Customer),ee=y.has(Q)||Z,se=((Se=E.current)==null?void 0:Se.has(String(j.id)))??!1,ce=(ve=j.post_followup)==null?void 0:ve.trim(),ue=j.sender_type===pe.Agent&&U===A&&(B==null?void 0:B.sender_type)===pe.Agent,je=j.sender_type===pe.Agent&&ce?se?0:ue?Y.buttons&&Y.buttons.length>0?Oa+Gw:Oa:0:0,Te=L(j,j.sender_type);return o.jsxs($e.div,{initial:Te.initial,animate:Te.animate,transition:{duration:.25,ease:"easeOut"},className:Ie("flex flex-col w-full min-w-0 justify-center break-words",{"items-end":j.sender_type===pe.Customer||j.activity_type===At.ChatCreated,"items-start":j.sender_type===pe.User||j.sender_type===pe.Agent,"items-center":j.sender_type===pe.System||j.sender_type===pe.Activity}),children:[j.sender_type===pe.System&&o.jsx("div",{className:"max-w-full whitespace-pre-wrap break-words overflow-hidden px-3 py-1.5 text-sm",style:{backgroundColor:h.getColor(g.MessageAdminBackground),color:h.getColor(g.MessageAdminText),borderRadius:h.getRadius()},children:j.content}),([pe.Customer,pe.User,pe.Agent].includes(j.sender_type)||j.activity_type===At.ChatCreated)&&o.jsxs("div",{className:Ie("max-w-[80%] border-0 px-3 py-2",{"whitespace-pre-wrap !text-sm":j.sender_type===pe.Customer||j.activity_type===At.ChatCreated||j.sender_type===pe.Agent&&!((ge=Y.content)!=null&&ge.includes('id="chaty"'))}),style:{backgroundColor:j.sender_type===pe.User||j.sender_type===pe.Agent?h.getColor(g.MessageAdminBackground):h.getColor(g.MessageVisitorBackground),color:j.sender_type===pe.User||j.sender_type===pe.Agent?h.getColor(g.MessageAdminText):h.getColor(g.MessageVisitorText),borderRadius:w(j.sender_type)},children:[j.files&&j.files.length>0&&o.jsx(zd,{files:j.files,className:"mb-1",hideName:!0}),j.sender_type===pe.User||j.sender_type===pe.Agent?o.jsx(Ra,{text:Y.content}):j.content,j.created_at&&o.jsx("div",{className:"text-[0.5rem] text-right opacity-70 mt-1",style:{color:j.sender_type===pe.User||j.sender_type===pe.Agent?h.getColor(g.MessageAdminText):h.getColor(g.MessageVisitorText)},children:vc(j.created_at)})]}),j.sender_type===pe.Agent&&Y.buttons&&Y.buttons.length>0&&P&&U===A&&o.jsx(Qw,{msgId:String(j.id),skipStagger:se,isCustomerSide:!1,hasButtons:!0,buttons:Y.buttons,suggestGroupSpent:ee,suggestKey:Q,onLivechatSendSuggested:s,setSpentSuggestMsgIds:v}),j.sender_type===pe.Agent&&ce&&o.jsx(Xw,{msgId:String(j.id),text:ce,delayMs:je,getBubbleRadius:w}),([pe.Customer,pe.User].includes(j.sender_type)||j.activity_type===At.ChatCreated)&&Y.buttons&&Y.buttons.length>0&&o.jsx("div",{className:Ie("w-full",{"flex justify-end":j.sender_type===pe.Customer||j.activity_type===At.ChatCreated,"flex justify-start":j.sender_type===pe.User}),children:o.jsx("div",{className:"max-w-[80%]",children:o.jsx(Hd,{buttons:Y.buttons,suggestGroupSpent:ee,onLivechatSend:S=>{v(W=>{const K=new Set(W);return K.add(Q),K}),s==null||s(S,!0)}})})}),j.sender_type===pe.Activity&&j.activity_type!==At.ChatCreated&&o.jsx("div",{className:"max-w-full border-0 rounded-full px-3 py-1 text-xs shadow-none break-words overflow-hidden",style:{backgroundColor:h.getColor(g.MessageAdminBackground),color:h.getColor(g.MessageAdminText)},children:j.activity_type===At.AdminLeave?`${j.content.split("_")[2]} odadan ayrıldı`:j.activity_type===At.AdminJoin?`${j.content.split("_")[2]} odaya katıldı`:j.activity_type===At.AdminToggleUpload?j.content.includes("is_customer_uploadable:true")?"Dosya gönderim izni açıldı":"Dosya gönderim izni kapatıldı":j.content}),pe.System===j.sender_type&&o.jsx("div",{className:"text-xs",style:{color:h.getColor(g.MessageAdminText)},children:j.created_at&&vc(j.created_at)})]},j.id||U)})})()}),e&&o.jsx($e.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?o.jsx("div",{className:"max-w-[80%] border-0 px-3 py-2 whitespace-pre-wrap min-w-[4rem] !text-sm",style:{backgroundColor:h.getColor(g.MessageAdminBackground),color:h.getColor(g.MessageAdminText),borderRadius:"18px 18px 18px 4px"},children:r?o.jsx(Ra,{text:r}):o.jsxs("div",{className:"flex items-center gap-2 py-1",children:[o.jsx(fe.Sparkles,{className:"size-4 flex-shrink-0 sparkle-pulse",style:{color:h.getColor(g.MessageAdminText)}}),o.jsx(gn,{mode:"wait",children:i?o.jsx($e.span,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},transition:{duration:.2},className:"!text-sm",style:{color:h.getColor(g.MessageAdminText)},children:i},`srv:${i}`):null})]})}):o.jsx("div",{className:"flex items-center rounded-full px-4 py-2",style:{backgroundColor:h.getColor(g.MessageAdminBackground)},children:o.jsxs("div",{className:"flex space-x-1",children:[o.jsx("div",{className:"size-1.5 rounded-full dot-wave",style:{backgroundColor:h.getColor(g.MessageAdminText),animationDelay:"0ms"}}),o.jsx("div",{className:"size-1.5 rounded-full dot-wave",style:{backgroundColor:h.getColor(g.MessageAdminText),animationDelay:"150ms"}}),o.jsx("div",{className:"size-1.5 rounded-full dot-wave",style:{backgroundColor:h.getColor(g.MessageAdminText),animationDelay:"300ms"}})]})})}),!c&&o.jsx("div",{className:"absolute right-4 z-10 transition-all duration-200",style:{bottom:m?"8rem":"7rem"},children:o.jsx(Vt,{type:"button",variant:"primary",kind:"solid",rounded:!0,className:"size-10 flex items-center justify-center p-0! shadow-md",onClick:()=>{var T,A;(A=l.current)==null||A.scrollTo({top:(T=l.current)==null?void 0:T.scrollHeight,behavior:"smooth"})},children:o.jsx(fe.ArrowDown,{className:"size-4"})})}),o.jsx("div",{ref:a})]})}/**
|
|
98
55
|
* @license lucide-react v0.511.0 - ISC
|
|
99
56
|
*
|
|
100
57
|
* This source code is licensed under the ISC license.
|
|
101
58
|
* See the LICENSE file in the root directory of this source tree.
|
|
102
|
-
*/const
|
|
59
|
+
*/const Jw=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Zw=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase()),xc=t=>{const e=Zw(t);return e.charAt(0).toUpperCase()+e.slice(1)},qd=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim(),eC=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};/**
|
|
103
60
|
* @license lucide-react v0.511.0 - ISC
|
|
104
61
|
*
|
|
105
62
|
* This source code is licensed under the ISC license.
|
|
106
63
|
* See the LICENSE file in the root directory of this source tree.
|
|
107
|
-
*/var
|
|
64
|
+
*/var tC={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
65
|
* @license lucide-react v0.511.0 - ISC
|
|
109
66
|
*
|
|
110
67
|
* This source code is licensed under the ISC license.
|
|
111
68
|
* See the LICENSE file in the root directory of this source tree.
|
|
112
|
-
*/const
|
|
69
|
+
*/const nC=p.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:a,...l},c)=>p.createElement("svg",{ref:c,...tC,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:qd("lucide",i),...!s&&!eC(l)&&{"aria-hidden":"true"},...l},[...a.map(([d,f])=>p.createElement(d,f)),...Array.isArray(s)?s:[s]]));/**
|
|
113
70
|
* @license lucide-react v0.511.0 - ISC
|
|
114
71
|
*
|
|
115
72
|
* This source code is licensed under the ISC license.
|
|
116
73
|
* See the LICENSE file in the root directory of this source tree.
|
|
117
|
-
*/const
|
|
74
|
+
*/const Wd=(t,e)=>{const n=p.forwardRef(({className:r,...i},s)=>p.createElement(nC,{ref:s,iconNode:e,className:qd(`lucide-${Jw(xc(t))}`,`lucide-${t}`,r),...i}));return n.displayName=xc(t),n};/**
|
|
118
75
|
* @license lucide-react v0.511.0 - ISC
|
|
119
76
|
*
|
|
120
77
|
* This source code is licensed under the ISC license.
|
|
121
78
|
* See the LICENSE file in the root directory of this source tree.
|
|
122
|
-
*/const
|
|
79
|
+
*/const rC=[["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"}]],iC=Wd("cloud-upload",rC);/**
|
|
123
80
|
* @license lucide-react v0.511.0 - ISC
|
|
124
81
|
*
|
|
125
82
|
* This source code is licensed under the ISC license.
|
|
126
83
|
* See the LICENSE file in the root directory of this source tree.
|
|
127
|
-
*/const iF=[["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"}]],sF=Xk("paperclip",iF);var Zk={exports:{}},oF="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",aF=oF,lF=aF;function Jk(){}function e2(){}e2.resetWarningCache=Jk;var cF=function(){function e(r,i,s,o,a,l){if(l!==lF){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:e2,resetWarningCache:Jk};return n.PropTypes=n,n};Zk.exports=cF();var uF=Zk.exports;const $e=Fr(uF);function ks(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 dF=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 Ao(e,t,n){const r=fF(e),{webkitRelativePath:i}=e,s=typeof t=="string"?t:typeof i=="string"&&i.length>0?i:`./${e.name}`;return typeof r.path!="string"&&Ox(r,"path",s),Ox(r,"relativePath",s),r}function fF(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),i=dF.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}function Ox(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}const pF=[".DS_Store","Thumbs.db"];function hF(e){return ks(this,void 0,void 0,function*(){return uu(e)&&mF(e.dataTransfer)?xF(e.dataTransfer,e.type):gF(e)?vF(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?yF(e):[]})}function mF(e){return uu(e)}function gF(e){return uu(e)&&uu(e.target)}function uu(e){return typeof e=="object"&&e!==null}function vF(e){return vh(e.target.files).map(t=>Ao(t))}function yF(e){return ks(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>Ao(n))})}function xF(e,t){return ks(this,void 0,void 0,function*(){if(e.items){const n=vh(e.items).filter(i=>i.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(wF));return Dx(t2(r))}return Dx(vh(e.files).map(n=>Ao(n)))})}function Dx(e){return e.filter(t=>pF.indexOf(t.name)===-1)}function vh(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 wF(e){if(typeof e.webkitGetAsEntry!="function")return Ix(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?n2(t):Ix(e,t)}function t2(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?t2(n):[n]],[])}function Ix(e,t){return ks(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,Ao(o)}}const r=e.getAsFile();if(!r)throw new Error(`${e} is not a File`);return Ao(r,(n=t==null?void 0:t.fullPath)!==null&&n!==void 0?n:void 0)})}function bF(e){return ks(this,void 0,void 0,function*(){return e.isDirectory?n2(e):CF(e)})}function n2(e){const t=e.createReader();return new Promise((n,r)=>{const i=[];function s(){t.readEntries(o=>ks(this,void 0,void 0,function*(){if(o.length){const a=Promise.all(o.map(bF));i.push(a),s()}else try{const a=yield Promise.all(i);n(a)}catch(a){r(a)}}),o=>{r(o)})}s()})}function CF(e){return ks(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(r=>{const i=Ao(r,e.fullPath);t(i)},r=>{n(r)})})})}var gf=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 Lx(e){return _F(e)||kF(e)||i2(e)||SF()}function SF(){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 c2(e,t){if(e){if(typeof e=="string")return xh(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 xh(e,t)}}function xh(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 e8(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 t8(e){if(Array.isArray(e))return e}function Ux(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 Ke(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ux(Object(n),!0).forEach(function(r){wh(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ux(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fu(e,t){if(e==null)return{};var n=n8(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 n8(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 wl=v.forwardRef(function(e,t){var n=e.children,r=fu(e,WF),i=r8(r),s=i.open,o=fu(i,qF);return v.useImperativeHandle(t,function(){return{open:s}},[s]),ie.createElement(v.Fragment,null,n(Ke(Ke({},o),{},{open:s})))});wl.displayName="Dropzone";var u2={disabled:!1,getFilesFromEvent:hF,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};wl.defaultProps=u2;wl.propTypes={children:$e.func,accept:$e.objectOf($e.arrayOf($e.string)),multiple:$e.bool,preventDropOnDocument:$e.bool,noClick:$e.bool,noKeyboard:$e.bool,noDrag:$e.bool,noDragEventsBubbling:$e.bool,minSize:$e.number,maxSize:$e.number,maxFiles:$e.number,disabled:$e.bool,getFilesFromEvent:$e.func,onFileDialogCancel:$e.func,onFileDialogOpen:$e.func,useFsAccessApi:$e.bool,autoFocus:$e.bool,onDragEnter:$e.func,onDragLeave:$e.func,onDragOver:$e.func,onDrop:$e.func,onDropAccepted:$e.func,onDropRejected:$e.func,onError:$e.func,validator:$e.func};var bh={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function r8(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Ke(Ke({},u2),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,b=t.onFileDialogCancel,C=t.onFileDialogOpen,g=t.useFsAccessApi,m=t.autoFocus,w=t.preventDropOnDocument,S=t.noClick,T=t.noKeyboard,k=t.noDrag,E=t.noDragEventsBubbling,M=t.onError,U=t.validator,j=v.useMemo(function(){return VF(n)},[n]),N=v.useMemo(function(){return zF(n)},[n]),O=v.useMemo(function(){return typeof C=="function"?C:Hx},[C]),z=v.useMemo(function(){return typeof b=="function"?b:Hx},[b]),L=v.useRef(null),D=v.useRef(null),I=v.useReducer(i8,bh),F=vf(I,2),_=F[0],B=F[1],V=_.isFocused,G=_.isFileDialogActive,W=v.useRef(typeof window<"u"&&window.isSecureContext&&g&&$F()),ee=function(){!W.current&&G&&setTimeout(function(){if(D.current){var H=D.current.files;H.length||(B({type:"closeDialog"}),z())}},300)};v.useEffect(function(){return window.addEventListener("focus",ee,!1),function(){window.removeEventListener("focus",ee,!1)}},[D,G,z,W]);var ue=v.useRef([]),me=function(H){L.current&&L.current.contains(H.target)||(H.preventDefault(),ue.current=[])};v.useEffect(function(){return w&&(document.addEventListener("dragover",Vx,!1),document.addEventListener("drop",me,!1)),function(){w&&(document.removeEventListener("dragover",Vx),document.removeEventListener("drop",me))}},[L,w]),v.useEffect(function(){return!r&&m&&L.current&&L.current.focus(),function(){}},[L,m,r]);var pe=v.useCallback(function($){M?M($):console.error($)},[M]),Se=v.useCallback(function($){$.preventDefault(),$.persist(),X($),ue.current=[].concat(QF(ue.current),[$.target]),Zl($)&&Promise.resolve(i($)).then(function(H){if(!(du($)&&!E)){var oe=H.length,he=oe>0&&IF({files:H,accept:j,minSize:o,maxSize:s,multiple:a,maxFiles:l,validator:U}),Te=oe>0&&!he;B({isDragAccept:he,isDragReject:Te,isDragActive:!0,type:"setDraggedFiles"}),c&&c($)}}).catch(function(H){return pe(H)})},[i,c,pe,E,j,o,s,a,l,U]),ke=v.useCallback(function($){$.preventDefault(),$.persist(),X($);var H=Zl($);if(H&&$.dataTransfer)try{$.dataTransfer.dropEffect="copy"}catch{}return H&&u&&u($),!1},[u,E]),ye=v.useCallback(function($){$.preventDefault(),$.persist(),X($);var H=ue.current.filter(function(he){return L.current&&L.current.contains(he)}),oe=H.indexOf($.target);oe!==-1&&H.splice(oe,1),ue.current=H,!(H.length>0)&&(B({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Zl($)&&d&&d($))},[L,d,E]),xe=v.useCallback(function($,H){var oe=[],he=[];$.forEach(function(Te){var Qe=s2(Te,j),rt=vf(Qe,2),tn=rt[0],At=rt[1],gn=o2(Te,o,s),vn=vf(gn,2),Pn=vn[0],wr=vn[1],He=U?U(Te):null;if(tn&&Pn&&!He)oe.push(Te);else{var yt=[At,wr];He&&(yt=yt.concat(He)),he.push({file:Te,errors:yt.filter(function(Nn){return Nn})})}}),(!a&&oe.length>1||a&&l>=1&&oe.length>l)&&(oe.forEach(function(Te){he.push({file:Te,errors:[DF]})}),oe.splice(0)),B({acceptedFiles:oe,fileRejections:he,isDragReject:he.length>0,type:"setFiles"}),p&&p(oe,he,H),he.length>0&&y&&y(he,H),oe.length>0&&h&&h(oe,H)},[B,a,j,o,s,l,p,h,y,U]),be=v.useCallback(function($){$.preventDefault(),$.persist(),X($),ue.current=[],Zl($)&&Promise.resolve(i($)).then(function(H){du($)&&!E||xe(H,$)}).catch(function(H){return pe(H)}),B({type:"reset"})},[i,xe,pe,E]),P=v.useCallback(function(){if(W.current){B({type:"openDialog"}),O();var $={multiple:a,types:N};window.showOpenFilePicker($).then(function(H){return i(H)}).then(function(H){xe(H,null),B({type:"closeDialog"})}).catch(function(H){UF(H)?(z(H),B({type:"closeDialog"})):HF(H)?(W.current=!1,D.current?(D.current.value=null,D.current.click()):pe(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."))):pe(H)});return}D.current&&(B({type:"openDialog"}),O(),D.current.value=null,D.current.click())},[B,O,z,g,xe,pe,N,a]),Y=v.useCallback(function($){!L.current||!L.current.isEqualNode($.target)||($.key===" "||$.key==="Enter"||$.keyCode===32||$.keyCode===13)&&($.preventDefault(),P())},[L,P]),te=v.useCallback(function(){B({type:"focus"})},[]),Q=v.useCallback(function(){B({type:"blur"})},[]),ae=v.useCallback(function(){S||(BF()?setTimeout(P,0):P())},[S,P]),re=function(H){return r?null:H},ce=function(H){return T?null:re(H)},fe=function(H){return k?null:re(H)},X=function(H){E&&H.stopPropagation()},Z=v.useMemo(function(){return function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},H=$.refKey,oe=H===void 0?"ref":H,he=$.role,Te=$.onKeyDown,Qe=$.onFocus,rt=$.onBlur,tn=$.onClick,At=$.onDragEnter,gn=$.onDragOver,vn=$.onDragLeave,Pn=$.onDrop,wr=fu($,GF);return Ke(Ke(wh({onKeyDown:ce(Jn(Te,Y)),onFocus:ce(Jn(Qe,te)),onBlur:ce(Jn(rt,Q)),onClick:re(Jn(tn,ae)),onDragEnter:fe(Jn(At,Se)),onDragOver:fe(Jn(gn,ke)),onDragLeave:fe(Jn(vn,ye)),onDrop:fe(Jn(Pn,be)),role:typeof he=="string"&&he!==""?he:"presentation"},oe,L),!r&&!T?{tabIndex:0}:{}),wr)}},[L,Y,te,Q,ae,Se,ke,ye,be,T,k,r]),R=v.useCallback(function($){$.stopPropagation()},[]),q=v.useMemo(function(){return function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},H=$.refKey,oe=H===void 0?"ref":H,he=$.onChange,Te=$.onClick,Qe=fu($,YF),rt=wh({accept:j,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:re(Jn(he,be)),onClick:re(Jn(Te,R)),tabIndex:-1},oe,D);return Ke(Ke({},rt),Qe)}},[D,n,a,be,r]);return Ke(Ke({},_),{},{isFocused:V&&!r,getRootProps:Z,getInputProps:q,rootRef:L,inputRef:D,open:re(P)})}function i8(e,t){switch(t.type){case"focus":return Ke(Ke({},e),{},{isFocused:!0});case"blur":return Ke(Ke({},e),{},{isFocused:!1});case"openDialog":return Ke(Ke({},bh),{},{isFileDialogActive:!0});case"closeDialog":return Ke(Ke({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Ke(Ke({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Ke(Ke({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return Ke({},bh);default:return e}}function Hx(){}const d2=5*1024*1024,jo={"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"]},Wx=Object.values(jo).flat();function s8(e){var r;if(e.size>d2)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(jo).includes(e.type)||Wx.includes(t)?{isValid:!0,error:""}:{isValid:!1,error:`Desteklenmeyen dosya tipi. Kabul edilen tipler: ${Wx.join(", ")}`}}function pu(e){for(const t of e){const n=s8(t);if(!n.isValid)return n}return{isValid:!0,error:""}}function f2({onDrop:e}){const t=n=>{const r=pu(n);if(!r.isValid){Vn({description:r.error,variant:"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(wl,{onDrop:t,accept:Object.keys(jo).reduce((n,r)=>(n[r]=jo[r],n),{}),maxSize:d2,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(rF,{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"})]})]})})})}f2.Button=({onDrop:e})=>{const t=Ae(),n=r=>{const i=pu(r);if(!i.isValid){Vn({description:i.error,variant:"error"});return}e(r)};return f.jsx(wl,{onDrop:n,accept:Object.keys(jo).reduce((r,i)=>(r[i]=jo[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(sF,{style:{color:t.getColor(x.IconColor)},className:"size-5"})]})})};function p2(e){const t=Number.parseFloat(globalThis.getComputedStyle(document.documentElement).fontSize)||16,n=t*3,r=t*6;return e.style.height="auto",`${Math.min(Math.max(e.scrollHeight,n),r)}px`}const qx=[{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 h2({onSelect:e,isOpen:t,onClose:n}){const r=Ae(),[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(Dr,{children:t&&f.jsxs(De.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(x.Background),border:`1px solid ${r.getColor(x.Border)}`,borderRadius:r.getRadius(),boxShadow:`0 4px 20px ${r.getColor(x.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(x.DividerColor)}`},children:qx.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(x.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:qx[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(x.InputBackground)},onMouseLeave:d=>{d.currentTarget.style.backgroundColor="transparent"},children:l},`${l}-${c}`))})]})})}const Gx=2;function o8({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=xr(),u=BP(t),p=Ae(),h=Lo(),{setIsInputFocused:y,showActionButtons:b,setShowActionButtons:C}=ne(),[g,m]=v.useState(""),[w,S]=v.useState("3rem"),[T,k]=v.useState(!1),[E,M]=v.useState([]),[U,j]=v.useState(0),[N,O]=v.useState(!1),[z,L]=v.useState(0),[D,I]=v.useState(null),[F,_]=v.useState(!1),[B,V]=v.useState(null),G=()=>{if(!a||!l||l.status!==dt.Closed||!l.closed_at)return!1;const P=new Date(l.closed_at);return(new Date().getTime()-P.getTime())/(1e3*60*60)>2},W=a&&(l==null?void 0:l.status)===dt.Closed&&G();v.useEffect(()=>{if(r.length>0){const P=r[r.length-1];P.id!==D&&(I(P.id),P.sender_type===ve.User&&(j(0),O(!1)))}},[r,D]),v.useEffect(()=>{let P;return N&&z>0&&(P=window.setTimeout(()=>{L(Y=>Y<=1?(O(!1),j(0),0):Y-1)},1e3)),()=>clearTimeout(P)},[N,z]),v.useEffect(()=>{if(!B)return;const P=window.setTimeout(()=>V(null),Em);return()=>window.clearTimeout(P)},[B]),v.useEffect(()=>{const P=c.current;if(P){const Y=()=>y(!0),te=()=>y(!1);return P.addEventListener("focus",Y),P.addEventListener("blur",te),()=>{P.removeEventListener("focus",Y),P.removeEventListener("blur",te)}}},[y]),v.useEffect(()=>{const P=()=>{C(!0)},Y=()=>{C(!1)};return d==null||d.on(ge.ChatUserShowButton,P),d==null||d.on(ge.MessageUserCreate,Y),()=>{d==null||d.off(ge.ChatUserShowButton,P),d==null||d.off(ge.MessageUserCreate,Y)}},[d,C]),v.useEffect(()=>{r.length>0&&r[r.length-1].activity_type==="admin_join"&&C(!1)},[r,C]),cu("lc:rate-limit",P=>{const Y=P.detail&&P.detail.seconds||3;O(!0),L(Y),j(0)}),cu("paste",P=>{const Y=P.clipboardData.items,te=[];for(const Q of Y){const ae=Q.getAsFile();ae&&te.push(ae)}if(te.length>0&&!n){V(h(se.FileUploadDisabled));return}if(te.length>0){const Q=pu(te);if(!Q.isValid){V(Q.error);return}M([...E,...te])}});const ee=async()=>{const P=g.trim(),Y=!!n&&E.length>0,te=P.length>0&&P.length<Gx;if(!P&&!Y||te)return;if(d!=null&&d.chatEnded){V("Bu sohbet sona ermiştir. Lütfen yeni bir sohbet başlatın.");return}if(U>5&&!N){O(!0),L(3);return}if(N||T)return;V(null);const Q=g,ae=[...E];m(""),M([]),c.current&&(c.current.style.height="3rem",S("3rem")),k(!0);let re;if(n&&ae.length>0){const[ce,fe]=await u.mutateAsync(ae);if(!Yn(fe)){yj(ce,fe),k(!1),m(Q),M(ae);return}if($P(ce)&&(re=ce.file_urls.filter(X=>typeof X=="string"&&X.trim().length>0)),!(re!=null&&re.length)){V("Dosyalar yüklenemedi. Lütfen tekrar deneyin."),k(!1),m(Q),M(ae);return}}if(o){o(Q,re),k(!1);return}d==null||d.emit(Pe.MessageCreate,{content:Q,files:re},ce=>{e(ce),k(!1),j(fe=>fe+1),C(!1)})},ue=g.trim(),me=(d==null?void 0:d.chatEnded)===!0,pe=(ue.length>=Gx||E.length>0)&&!T&&!N&&!me,Se=P=>{d==null||d.emit(Pe.MessageTyping,{content:P})},ke=()=>{d==null||d.emit(Pe.ChatClose,{}),C(!1),i==null||i()},ye=()=>{d==null||d.emit(Pe.ChatClose,{}),C(!1),s==null||s()},xe=v.useCallback(P=>{const Y=c.current;if(Y){const te=Y.selectionStart,Q=Y.selectionEnd,ae=g.substring(0,te)+P+g.substring(Q);ae.length<=2e3&&(m(ae),Se(ae),setTimeout(()=>{Y.selectionStart=Y.selectionEnd=te+P.length,Y.focus()},0))}else{const te=g+P;te.length<=2e3&&(m(te),Se(te))}},[g]),be=a&&(l==null?void 0:l.status)===dt.Closed;return W?null:f.jsxs(f.Fragment,{children:[be&&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(x.InputBackground),borderColor:p.getColor(x.InputBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:p.getRadius()},children:[f.jsx(J.Lock,{className:"w-5 h-5 flex-shrink-0",style:{color:p.getColor(x.FooterText)}}),f.jsx("span",{className:"text-sm",style:{color:p.getColor(x.FooterText)},children:"Bu sohbet kapatılmıştır."})]}),f.jsxs(En,{size:"lg",onClick:()=>{s==null||s()},className:"rounded-lg gap-2 transition-all",children:[f.jsx(J.Plus,{className:"size-4"}),f.jsx("span",{children:"Yeni Sohbet Başlat"})]}),f.jsx(Eo,{variant:"block"})]}),N&&f.jsxs(De.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(x.ErrorBackground),borderColor:p.getColor(x.ErrorBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:p.getRadius()},children:[f.jsx(J.XCircle,{className:"size-4 mr-2",style:{color:p.getColor(x.ErrorText)}}),f.jsx("span",{className:"text-sm font-medium",style:{color:p.getColor(x.ErrorText)},children:h(se.RateLimitMessage).replace("{seconds}",z.toString())})]}),b&&f.jsxs(De.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"mb-2 mx-3 flex gap-2",children:[f.jsxs(En,{className:"flex-1 flex items-center justify-center gap-2",size:"md",variant:"primary",kind:"outline",onClick:ke,style:{borderColor:p.getColor(x.ButtonBackground),color:p.getColor(x.ButtonBackground),backgroundColor:"transparent"},children:[f.jsx(J.Star,{className:"size-4"}),f.jsx("span",{children:"Değerlendir"})]}),f.jsxs(En,{size:"md",className:"flex-1 flex items-center justify-center gap-2",onClick:ye,children:[f.jsx(J.Plus,{className:"size-4"}),f.jsx("span",{children:"Yeni Sohbet"})]})]}),(!a||a&&(l==null?void 0:l.status)!==dt.Closed&&(l==null?void 0:l.status)!==dt.Deleted)&&f.jsxs("form",{className:"flex flex-col relative",onSubmit:P=>{P.preventDefault(),ee()},children:[B?f.jsxs("div",{role:"alert",className:"mx-3 mb-2 flex items-start gap-2 rounded-lg border px-3 py-2 text-sm",style:{borderColor:p.getColor(x.ErrorBorder),backgroundColor:p.getColor(x.ErrorBackground),color:p.getColor(x.ErrorText)},children:[f.jsx("span",{className:"min-w-0 flex-1 leading-snug",children:B}),f.jsx("button",{type:"button",onClick:()=>V(null),className:"shrink-0 rounded-md p-0.5 opacity-70 transition-opacity hover:opacity-100 focus:outline-hidden focus-visible:ring-2",style:{color:p.getColor(x.ErrorText)},"aria-label":"Kapat",children:f.jsx(J.X,{className:"size-4"})})]}):null,f.jsx("div",{className:"mx-4 border-t",style:{borderColor:p.getColor(x.DividerColor)}}),n&&E&&E.length>0&&f.jsx("div",{className:"px-3 pt-2 overflow-x-auto",children:f.jsx(Gk,{files:E,onDelete:P=>{M(E.filter((Y,te)=>te!==P))}})}),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(od,{id:"message",inputRef:c,className:"grow",noMargin:!0,borderless:!0,rows:1,autoComplete:"off",disabled:N||me,style:{height:w,maxHeight:"6rem",opacity:N||me?.5:1,cursor:N||me?"not-allowed":"text",boxShadow:"none"},placeholder:me?"Sohbet sona erdi":N?h(se.RateLimitMessage).replace("{seconds}",z.toString()):h(se.MessagePlaceholder),value:g,maxLength:2e3,onChange:P=>{if(N||me)return;const Y=P.currentTarget.value,te=P.currentTarget;if(B&&V(null),Y.length<=2e3&&(m(Y),Se(Y)),Y.length===0){te.style.height="3rem",S("3rem");return}const Q=p2(te);te.style.height=Q,S(Q)},onKeyDown:P=>{if(N||me){P.preventDefault();return}P.key==="Enter"&&!P.shiftKey&&(P.preventDefault(),ee())}}),g.length>=500&&f.jsx("div",{className:"absolute bottom-2 right-3 text-xs pointer-events-none",style:{color:g.length>=2e3?p.getColor(x.ErrorText):p.getColor(x.FooterText),fontWeight:g.length>=2e3?"600":"normal"},children:2e3-g.length})]}),f.jsx("div",{className:"flex items-center gap-1 flex-shrink-0 pb-0.5",children:f.jsx(De.div,{whileTap:{scale:.9},children:f.jsx(En,{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:!pe,style:{opacity:1,color:pe?p.getColor(x.ButtonBackground):p.getColor(x.FooterText)},children:T?f.jsx(J.Spin,{className:"size-4 animate-spin"}):N?f.jsx("span",{className:"text-[10px] font-bold",children:z}):f.jsx(J.PaperAirplane,{className:"size-5"})})})})]}),f.jsx(h2,{isOpen:F,onClose:()=>_(!1),onSelect:xe}),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:()=>_(!F),className:"p-1.5 rounded-md transition-colors",style:{color:p.getColor(x.IconColor)},children:f.jsx(J.Emoji,{className:"size-5"})}),n&&f.jsx(f2.Button,{onDrop:P=>{if(P.length){const Y=pu(P);if(!Y.isValid){V(Y.error);return}M([...E,...P])}}})]}),f.jsx(Eo,{variant:"inline"})]})]})]})}const Yx=[["#6366f1","#8b5cf6"],["#3b82f6","#06b6d4"],["#10b981","#34d399"],["#f59e0b","#f97316"],["#ef4444","#f472b6"],["#8b5cf6","#ec4899"],["#14b8a6","#22d3ee"],["#f43f5e","#fb923c"]];function Qx({name:e,avatar:t,className:n="text-neutral-500",textColor:r,subtitle:i}){const s=v.useMemo(()=>{const o=e.charCodeAt(0)||0,a=Yx[o%Yx.length];return`linear-gradient(135deg, ${a[0]}, ${a[1]})`},[e]);return f.jsxs(De.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:Oe("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 Kx=[["#6366f1","#8b5cf6"],["#3b82f6","#06b6d4"],["#10b981","#34d399"],["#f59e0b","#f97316"],["#ef4444","#f472b6"],["#8b5cf6","#ec4899"],["#14b8a6","#22d3ee"],["#f43f5e","#fb923c"]],qs=32;function a8({participant:e,className:t}){const n=v.useMemo(()=>{const r=e.name.charCodeAt(0)||0,i=Kx[r%Kx.length];return`linear-gradient(135deg, ${i[0]}, ${i[1]})`},[e.name]);return f.jsx("span",{title:e.name,className:Oe("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:qs,height:qs},src:e.avatar,alt:"",title:e.name}):f.jsx("div",{className:"flex items-center justify-center font-semibold text-white text-xs",style:{width:qs,height:qs,background:n},children:e.name.charAt(0).toUpperCase()})})}const yf=3;function Xx({participants:e,textColor:t,className:n}){const r=v.useMemo(()=>e.map(l=>l.name).join(", "),[e]);if(e.length===0)return null;const i=e.length>yf,s=i?e.slice(0,yf-1):e,o=i?e.length-(yf-1):0,a=e[0];return f.jsxs("div",{className:Oe("group/participant relative inline-flex max-w-full",n),children:[f.jsxs(De.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(a8,{participant:l})},`${Kr(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:qs,height:qs,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 m2({className:e,sizePx:t=36,"aria-hidden":n=!0}){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1389 1350",width:t,height:t,className:Oe("shrink-0",e),"aria-hidden":n,focusable:"false",children:f.jsx("g",{transform:"translate(0,1350) scale(0.1,-0.1)",fill:"currentColor",stroke:"none",children:f.jsx("path",{d:"M6395 13484 c-630 -49 -1143 -142 -1678 -303 -589 -178 -1181 -458 -1687 -798 -786 -527 -1550 -1309 -2022 -2068 -697 -1122 -1053 -2468 -998 -3774 29 -689 123 -1222 336 -1905 204 -650 363 -1007 660 -1479 258 -410 531 -746 928 -1143 434 -433 838 -759 1271 -1025 906 -558 1911 -872 3100 -971 223 -18 798 -15 1030 6 1408 126 2688 653 3748 1541 440 368 859 810 1162 1223 33 45 63 81 68 82 4 0 296 -145 649 -321 354 -177 653 -322 666 -322 32 0 62 31 62 63 0 38 -1715 2749 -1750 2767 -33 17 -3703 19 -3747 2 -15 -5 -31 -16 -35 -22 -14 -22 -8 -74 10 -89 9 -9 329 -172 710 -362 380 -190 692 -350 692 -354 0 -18 -321 -322 -440 -417 -542 -433 -1157 -699 -1839 -795 -610 -87 -1281 -13 -1841 202 -58 22 -129 49 -159 59 -29 11 -99 43 -154 70 -87 44 -106 50 -140 45 -22 -4 -177 -65 -346 -137 -168 -72 -508 -216 -756 -319 -247 -104 -475 -200 -505 -214 -66 -31 -94 -32 -120 -6 -24 24 -26 67 -4 118 9 20 108 305 220 632 112 327 231 672 264 766 33 93 60 175 60 181 0 5 -22 39 -49 75 -28 36 -88 123 -134 194 -313 477 -507 1007 -584 1591 -26 198 -26 740 0 933 112 830 463 1561 1032 2148 613 633 1363 1009 2251 1129 189 25 735 25 924 0 812 -110 1495 -428 2097 -976 312 -284 621 -692 804 -1063 53 -107 67 -113 178 -73 185 67 2538 1039 2575 1063 39 26 41 31 40 75 0 39 -18 82 -98 245 -301 607 -678 1135 -1181 1650 -1165 1196 -2582 1886 -4225 2058 -147 15 -909 28 -1045 18z"})})})}function g2({color:e,borderColor:t,backgroundColor:n,sizePx:r=28}){return f.jsx("div",{className:"flex size-[46px] shrink-0 items-center justify-center overflow-hidden rounded-[14px] border border-solid",style:{borderColor:t,backgroundColor:n,color:e},"aria-hidden":!0,children:f.jsx(m2,{sizePx:r})})}function l8({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:b,isInputFocused:C}=ne(),g=ne(z=>z.historyChat),m=Ae(),w=$o(),S=cd(),T=xr(),k=Ss(),E=v.useRef(new Set),M=v.useRef(!1),U=()=>{h(!1)},j=v.useCallback(()=>{if(!T||!y||!b||!Array.isArray(r))return;const z=r.filter(L=>L.sender_type===ve.User&&!E.current.has(L.id)).map(L=>L.id);z.length!==0&&T.emit(Pe.MessageRead,{message_ids:z},L=>{if(L&&L.success===!0)for(const D of z)E.current.add(D)})},[T,r,y,b]);v.useEffect(()=>{y&&(M.current=!0),y&&b&&(C||M.current)&&(j(),M.current=!1)},[y,b,C,j]);const N=()=>{var L,D,I,F;return((F=(I=(D=(L=p==null?void 0:p.appearance)==null?void 0:L.head)==null?void 0:D.elements)==null?void 0:I.find(_=>_.type==="title"))==null?void 0:F.content)||"Müşteri Hizmetleri"},O=()=>{var I,F,_,B,V,G,W,ee;if(c&&g)return"Geçmiş sohbet";const z=((F=(I=e==null?void 0:e.participants)==null?void 0:I[0])==null?void 0:F.name)||(e==null?void 0:e.agent_name);if(z)return z;const L=(B=(_=p==null?void 0:p.appearance)==null?void 0:_.design)==null?void 0:B.greeting_header;return L||((ee=(W=(G=(V=p==null?void 0:p.appearance)==null?void 0:V.head)==null?void 0:G.elements)==null?void 0:W.find(ue=>ue.type==="text"))==null?void 0:ee.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:m.getColor(x.HeaderBackground),color:m.getColor(x.HeaderText),borderColor:m.getColor(x.HeaderBorder),...w?{}:{borderTopLeftRadius:m.getRadius(),borderTopRightRadius:m.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),k.push("registration")},className:"flex-shrink-0 p-1 hover:opacity-80 transition-opacity",children:f.jsx(J.ArrowLeft,{className:"w-5 h-5"})}),(()=>{if(c&&g){const z=L6(g);if(z.length>1)return f.jsx(Xx,{participants:z,textColor:m.getColor(x.HeaderText)});if(z.length===1)return f.jsx(Qx,{name:z[0].name,avatar:z[0].avatar,textColor:m.getColor(x.HeaderText)})}if(!c&&e){const z=e.participants&&e.participants.length>0?e.participants:Dg(e.agent_name,e.agent_avatar);if(z.length>1)return f.jsx(Xx,{participants:z,textColor:m.getColor(x.HeaderText)});if(z.length===1)return f.jsx(Qx,{name:z[0].name,avatar:z[0].avatar,textColor:m.getColor(x.HeaderText)})}return f.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[f.jsx(g2,{color:m.getColor(x.HeaderText),borderColor:m.getColor(x.HeaderBorder),backgroundColor:m.getColor(x.MessageAdminBackground)}),f.jsx("div",{className:"min-w-0 flex-1",children:c?f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"truncate font-medium",children:N()}),f.jsx("div",{className:"truncate text-sm opacity-90",children:O()})]}):f.jsx("div",{className:"truncate font-medium",children:O()})})]})})()]}),f.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(!c||c&&(e==null?void 0:e.status)!==dt.Closed)&&f.jsx(z6,{onChatClose:s}),S&&f.jsx("button",{type:"button",onClick:U,className:"p-1 hover:opacity-80 transition-opacity",children:f.jsx(J.X,{className:"w-5 h-5 cursor-pointer"})})]})]}),f.jsx(Qk,{messages:r,isTyping:t||n.length>0,chat:e,onLivechatSendSuggested:l?z=>l(z):void 0}),f.jsx(Dr,{children:d&&f.jsxs(De.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:m.getColor(x.ErrorBackground),borderColor:m.getColor(x.ErrorBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:m.getRadius()},children:[f.jsx(J.XCircle,{className:"size-4 flex-shrink-0 mt-0.5",style:{color:m.getColor(x.ErrorText)}}),f.jsx("span",{className:"text-sm",style:{color:m.getColor(x.ErrorText)},children:d}),f.jsx("button",{type:"button",className:"ml-auto flex-shrink-0",onClick:u,style:{color:m.getColor(x.ErrorText)},children:f.jsx(J.X,{className:"size-4"})})]})}),f.jsx(o8,{client_id:(p==null?void 0:p.client_id)||"",is_uploadable:e.is_customer_uploadable,messages:r,onNewMessage:z=>{i(z)},onEvaluateChat:o,onNewChat:a,onSendMessage:l,isHistoryMode:c,historyChat:c?ne.getState().historyChat:void 0})]})}function c8({rating:e,onChange:t}){const n=Ae();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(De.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(x.StarInactiveColor),fill:n.getColor(x.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(x.StarActiveColor),fill:n.getColor(x.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(x.StarActiveColor),fill:n.getColor(x.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 u8({onOk:e}){const t=Ae(),n=Lo(),r=cd(),[i,s]=v.useState(0),[o,a]=v.useState(!1),[l,c]=v.useState(10),d=FP(),[u,p]=v.useState(!1);v.useEffect(()=>{if(o){const C=setInterval(()=>{c(g=>g<=1?(clearInterval(C),e(!0),0):g-1)},1e3);return()=>clearInterval(C)}},[o]);const h=gg({comment:au()}),y=_k({init:{comment:""},schema:h,action:async C=>{const[g,m]=await d.mutateAsync({rating:i,comment:C.comment});if(Yn(m)){a(!0);return}Co(g,{form:y})}}),b=()=>{e(!0)};return f.jsxs(De.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(x.HeaderBorder),color:t.getColor(x.HeaderText)},children:[f.jsx("div",{className:"font-medium !text-sm",children:n(o?se.RatingHeaderThanks:se.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(x.HeaderText)},children:f.jsx(J.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(x.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(x.HeaderText)},children:n(se.RatingThankYouTitle)}),f.jsx("p",{className:"mb-6 text-sm",style:{color:t.getColor(x.FooterText)},children:n(se.RatingThankYouDescription)}),f.jsx("p",{className:"mb-3 text-xs",style:{color:t.getColor(x.FooterText)},children:n(se.RatingCountdown).replace("{seconds}",l.toString())}),f.jsx(En,{onClick:b,size:"md",className:"w-full max-w-xs",children:n(se.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(x.FooterText)},children:n(se.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(x.RatingRateConversationText)},children:n(se.RatingRateConversation)}),f.jsx(c8,{rating:i,onChange:C=>{s(C),C>=1&&p(!1)}}),i>0&&f.jsx("p",{className:"text-center text-xs mt-1",style:{color:t.getColor(x.FooterText)},children:n(se.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(x.ErrorText)},children:n(se.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(x.InputText)},children:n(se.RatingComment)}),f.jsx(od,{id:"comment",onChange:y.handleChange,onBlur:y.handleBlur,value:y.values.comment,placeholder:n(se.RatingCommentPlaceholder),className:"rounded-lg",error:y.errors.comment})]}),f.jsxs("div",{className:"flex flex-col gap-2 pt-1",children:[f.jsx(En,{type:"submit",size:"lg",onClick:C=>{i<1&&(C.preventDefault(),C.stopPropagation(),p(!0))},className:"w-full",children:n(se.RatingSubmit)}),f.jsx(En,{onClick:b,size:"lg",variant:"secondary",kind:"subtle",className:"w-full",bgKey:x.GreeterBackground,textKey:x.GreeterText,children:n(se.RatingNewConversation)})]})]})]})}),f.jsx(Eo,{variant:"block"})]})}function d8({onSendMessage:e,disabled:t,loading:n=!1}){const r=v.useRef(null),i=Ae(),s=Lo(),{setIsInputFocused:o}=ne(),[a,l]=v.useState(""),[c,d]=v.useState("3rem"),[u,p]=v.useState(!1),h=v.useRef(n);v.useEffect(()=>{h.current&&!n&&!t&&setTimeout(()=>{var C;(C=r.current)==null||C.focus()},100),h.current=n},[n,t]),v.useEffect(()=>{t&&p(!1)},[t]);const y=()=>{if(!a.trim()||t)return;const C=a;l(""),r.current&&(r.current.style.height="3rem",d("3rem")),e(C)},b=v.useCallback(C=>{if(t)return;const g=r.current;if(g){const m=g.selectionStart,w=g.selectionEnd,S=a.substring(0,m)+C+a.substring(w);S.length<=2e3&&(l(S),setTimeout(()=>{g.selectionStart=g.selectionEnd=m+C.length,g.focus()},0))}else{const m=a+C;m.length<=2e3&&l(m)}},[a,t]);return f.jsxs("form",{className:"flex flex-col relative",onSubmit:C=>{C.preventDefault(),y()},children:[f.jsx("div",{className:"mx-4 border-t",style:{borderColor:i.getColor(x.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(od,{id:"ai-message",inputRef:r,className:"grow",noMargin:!0,borderless:!0,rows:1,autoComplete:"off",disabled:t,style:{height:c,maxHeight:"6rem",opacity:t?.5:1,cursor:t?"not-allowed":"text",boxShadow:"none"},placeholder:s(se.MessagePlaceholder),value:a,maxLength:2e3,onFocus:()=>o(!0),onBlur:()=>o(!1),onChange:C=>{if(t)return;const g=C.target.value,m=C.currentTarget;if(g.length<=2e3&&l(g),g.length===0){m.style.height="3rem",d("3rem");return}const w=p2(m);m.style.height=w,d(w)},onKeyDown:C=>{if(t){C.preventDefault();return}C.key==="Enter"&&!C.shiftKey&&(C.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(x.ErrorText):i.getColor(x.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(De.div,{whileTap:{scale:.9},children:f.jsx(En,{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(x.ButtonBackground):i.getColor(x.FooterText)},children:n?f.jsx(J.Spin,{className:"size-4 animate-spin"}):f.jsx(J.PaperAirplane,{className:"size-5"})})})})]}),f.jsx(h2,{isOpen:u,onClose:()=>p(!1),onSelect:b}),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(x.IconColor)},children:f.jsx(J.Emoji,{className:"size-5"})})}),f.jsx(Eo,{variant:"inline"})]})]})}const xf=[Be.Light,Be.Dark,Be.System];function f8(e){switch(e){case Be.Light:return J.Sun;case Be.Dark:return J.Moon;case Be.System:return J.Monitor;default:return J.Monitor}}function p8({onChatClose:e}){const[t,n]=v.useState(!1),[r,i]=v.useState(!1),[s,o]=v.useState(()=>Wk()),a=v.useRef(null),l=v.useRef(null),c=Ae(),d=Lo(),{mode:u,setMode:p}=c,h=()=>e(),y=()=>{const g=xf.indexOf(u),m=xf[(g+1)%xf.length];p(m)},b=()=>{const g=!s;qk(g),o(g)};v.useEffect(()=>{if(!r)return;const g=m=>{var w,S;(w=l.current)!=null&&w.contains(m.target)||(S=a.current)!=null&&S.contains(m.target)||i(!1)};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[r]);const C=r&&f.jsxs(De.div,{ref:l,onMouseDown:g=>g.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(x.Background),borderColor:c.getColor(x.Border),borderRadius:c.getRadius(),boxShadow:`0 4px 12px ${c.getColor(x.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(x.ErrorText)},onClick:()=>{i(!1),n(!0)},children:[f.jsx(J.XCircle,{className:"size-4 flex-shrink-0"}),d(se.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(x.InputText)},onClick:b,children:[s?f.jsx(J.VolumeX,{className:"size-4 flex-shrink-0"}):f.jsx(J.Volume2,{className:"size-4 flex-shrink-0"}),d(s?se.NotificationSoundOn:se.NotificationSoundOff)]}),f.jsx("div",{className:"my-1 h-px",style:{backgroundColor:c.getColor(x.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(x.InputText)},onClick:y,children:[(()=>{const g=f8(u);return f.jsx(g,{className:"size-4 flex-shrink-0"})})(),u===Be.Light?"Açık tema":u===Be.Dark?"Koyu tema":"Sistem"]})]});return f.jsxs(f.Fragment,{children:[f.jsx(Dr,{children:t&&f.jsx(De.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(x.ModalOverlayColor)},children:f.jsxs(De.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(x.Background),borderRadius:c.getRadius()},children:[f.jsx("div",{className:"text-base font-semibold mb-2",style:{color:c.getColor(x.ChatCloseConfirmText)},children:d(se.ChatCloseConfirm)}),f.jsx("div",{className:"text-sm mb-4",style:{color:c.getColor(x.FooterText)},children:d(se.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(x.GreeterBackground),color:c.getColor(x.GreeterText),borderRadius:c.getRadius()},onClick:()=>n(!1),children:d(se.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(x.ErrorBackground),color:c.getColor(x.ErrorText),borderRadius:c.getRadius()},onClick:h,children:d(se.CloseAction)})]})]})})}),f.jsxs("div",{className:"relative flex-shrink-0",children:[f.jsx("button",{ref:a,type:"button",onClick:()=>i(g=>!g),className:"flex items-center justify-center p-1.5 rounded-md hover:opacity-80 transition-opacity",style:{backgroundColor:"transparent",color:c.getColor(x.HeaderText)},title:d(se.ChatSettings),"aria-expanded":r,children:f.jsx(J.Menu,{className:"size-5"})}),f.jsx(Dr,{children:C})]})]})}async function h8(e,t,n,r){let i=Math.max(0,Math.min(t,e.length));n(e.slice(0,i));const s=e.length-i;if(s<=0)return;const l=Math.min(14e3,Math.max(900,s*18)),c=16,d=Math.max(1,Math.ceil(s*c/l));await new Promise((u,p)=>{const h=window.setInterval(()=>{if(r.aborted){window.clearInterval(h),p(new DOMException("aborted","AbortError"));return}i=Math.min(e.length,i+d),n(e.slice(0,i)),i>=e.length&&(window.clearInterval(h),u())},c)})}function m8({onOperatorConnected:e,onChatClose:t,onRemoteChatEnded:n}){var Y,te,Q,ae;const{widget:r,setOpen:i,aiAgent:s,aiAgentMessages:o,addAIAgentMessage:a,setAIAgentMessages:l,aiAgentSessionId:c,setAIAgentSessionId:d,humanNeedRequested:u,setHumanNeedRequested:p,setIsAIAgentMode:h,setAIAgentRequestInFlight:y}=ne(),b=Ae(),C=$o(),g=cd(),m=xr(),w=Ss(),[S,T]=v.useState(!1),[k,E]=v.useState(!1),[M,U]=v.useState(!1),[j,N]=v.useState(!1),[O,z]=v.useState(""),[L,D]=v.useState(null),[I,F]=v.useState(!1),[_,B]=v.useState(0),[V,G]=v.useState(null),W=v.useRef(""),ee=v.useRef(null),ue=()=>{i(!1)},me=()=>{p(!1),t()},pe=(((Q=(te=(Y=r==null?void 0:r.appearance)==null?void 0:Y.body)==null?void 0:te.inputs)==null?void 0:Q.length)||0)>0,Se=v.useRef(!1),ke=v.useRef(!1),ye=v.useRef(!1);v.useEffect(()=>{if(!s||Se.current)return;if(o.length>0){Se.current=!0;return}if(!m||!m.connected){const fe=setInterval(()=>{m&&m.connected&&(clearInterval(fe),re())},100),X=setTimeout(()=>{clearInterval(fe),Se.current||ce()},3e3);return()=>{clearInterval(fe),clearTimeout(X)}}re();function re(){Se.current||!m||(Se.current=!0,m.emit(Pe.MessageList,{},fe=>{Array.isArray(fe)&&fe.length>0?l(fe):ce()}))}function ce(){if(!s)return;const fe={id:gc(),content:`Merhaba! Ben ${s.name}. Size nasıl yardımcı olabilirim?`,created_at:new Date,files:[],sender_type:ve.User};a(fe)}},[m,s,o.length,l,a]),v.useEffect(()=>{if(S)if(O||L)E(!0);else{const re=setTimeout(()=>E(!0),1e3);return()=>clearTimeout(re)}else E(!1)},[S,O,L]),v.useEffect(()=>{if(_>0){const re=requestAnimationFrame(()=>B(0));return()=>cancelAnimationFrame(re)}},[_]),v.useEffect(()=>{if(!m)return;const re=({token:Z})=>{D(null),z(R=>{const q=R+Z;return W.current=q,q})},ce=Z=>{Z.message?D(Z.message):Z.status&&D(Z.status)},fe=Z=>{Z.repeat_count===3&&G(Z.message)},X=()=>{t()};return m.on(ge.AgentMessageChunk,re),m.on(ge.AgentMessageStreamStatus,ce),m.on(ge.AgentSpamWarning,fe),m.on(ge.AgentSpamBanned,X),()=>{m.off(ge.AgentMessageChunk,re),m.off(ge.AgentMessageStreamStatus,ce),m.off(ge.AgentSpamWarning,fe),m.off(ge.AgentSpamBanned,X)}},[m,t]),v.useEffect(()=>{if(!m)return;const re=()=>{ye.current||(ye.current=!0,m.markChatEnded(),n())};return m.on(ge.ChatUserClose,re),()=>{m.off(ge.ChatUserClose,re)}},[m,n]),v.useEffect(()=>{if(!m)return;const re=ce=>{const fe=String(ce._id??"");if(!fe)return;const X=typeof ce.content=="string"?ce.content.trim():"";D(Z=>Z&&X&&Z.trim()===X?null:Z),l(Z=>{if(Z.some(q=>q.id===fe))return Z;const R={id:fe,content:ce.content,created_at:ce.created_at?new Date(ce.created_at):new Date,files:ce.files??[],sender_type:ce.sender_type,answers:ce.answers,reply_id:ce.reply_id,buttons:ce.buttons,post_followup:ce.post_followup};return[...Z,R]})};return m.on(ge.MessageAgentCreate,re),()=>{m.off(ge.MessageAgentCreate,re)}},[m,l]);const xe=v.useCallback((re,ce)=>{var R;if(!r||!s||!m||ye.current||u||M||ke.current)return;(R=ee.current)==null||R.abort(),ke.current=!0,y(!0);const fe=`temp-${Date.now()}`,X={id:fe,content:re,created_at:new Date,files:[],sender_type:ve.Customer};a(X),z(""),W.current="",D(null),F(!0),T(!0),U(!0);const Z=c||Lr(r.link_id);m.emit(Pe.AgentMessageCreate,{question:re,agent_id:s.id,session_id:Z,...ce===!0?{skip_to_generation:!0}:{}},q=>{var Pn,wr;if(!q||typeof q=="object"&&"isError"in q&&q.isError===!0){ke.current=!1,y(!1),(Pn=ee.current)==null||Pn.abort(),F(!1),z(""),W.current="",D(null),T(!1),U(!1);const He=q,yt=He&&typeof He.error=="string"?He.error:null,Kn=(He&&"errorCode"in He&&typeof He.errorCode=="string"&&He.errorCode.trim()?He.errorCode.trim():null)??"ERR_WS_UNKNOWN",bl=Kn==="ERR_WS_TIMEOUT"||yt==="Event handler timeout",_s=Kn==="ERR_CHAT_NOT_AGENT_MODE",_e=Kn==="ERR_CHAT_CLOSED",lt=Kn==="ERR_CHAT_NOT_FOUND",it=_s&&typeof yt=="string"&&/status\s*=\s*(closed|deleted)/i.test(yt),jt=Kn==="ERR_AI_SERVICE_HTTP"||Kn==="ERR_AI_SERVICE_STREAM",ji=yt&&yt.trim().length>0?yt.trim():null,ht={id:gc(),content:_s&&!it?"Sohbet artık yapay zeka asistanı modunda değil (örneğin canlı desteğe aktarıldı). Canlı destek görünümüne geçiriliyorsunuz.":bl?`Yanıt çok uzun sürdü; sohbet güncellenmiş olabilir. Sayfayı yenileyin veya tekrar deneyin. Hata kodu: ${Kn}`:_e||lt||it?ji??(_e||it?"Bu sohbet sona ermiş. Gerekirse yeni bir sohbet başlatın.":"Sohbet bulunamadı. Sayfayı yenileyip tekrar deneyin."):jt?"Yapay zeka servisine şu an ulaşılamıyor. Lütfen kısa bir süre sonra tekrar deneyin.":ji??`Üzgünüm, bir hata oluştu. Hata kodu: ${Kn}. Bu kodu destek personeli ile paylaşabilirsiniz.`,created_at:new Date,files:[],sender_type:ve.System};if(l(Rt=>Rt.filter(zr=>zr.id!==fe).concat([ht])),_s&&!it){m.markChatEnded(),ne.getState().setIsHaveChat(!0),e(),ne.getState().clearAIAgentState();return}if(_e||lt||it){m.markChatEnded(),ye.current=!0,l(Rt=>Rt.filter(zr=>zr.id!==fe)),n();return}if(jt)return;p(!0);return}const H=q;H.session_id&&d(H.session_id);const oe=H.generation??"",he=H.agent_message,Qe=(typeof he.post_followup=="string"&&he.post_followup.trim()||void 0)??(typeof H.post_message=="string"&&H.post_message.trim()||void 0),rt={...he,id:String(he._id??he.id??gc()),created_at:he.created_at?new Date(he.created_at):new Date,post_followup:Qe},tn=W.current;let At=0;oe.startsWith(tn)&&(At=tn.length),(wr=ee.current)==null||wr.abort();const gn=new AbortController;ee.current=gn;const vn=()=>{ee.current===gn&&(ee.current=null),ke.current=!1,y(!1),F(!1),z(""),W.current="",D(null),T(!1),U(!1),l(He=>He.some(yt=>yt.id===rt.id)?He:[...He,rt]),H.human_need&&p(!0)};if(At>=oe.length){vn();return}(async()=>{try{await h8(oe,At,He=>{W.current=He,z(He)},gn.signal),vn()}catch{gn.signal.aborted&&(ke.current=!1,y(!1),F(!1),z(""),W.current="",D(null),ee.current===gn&&(ee.current=null),l(He=>He.some(yt=>yt.id===rt.id)?He:[...He,rt]),H.human_need&&p(!0))}})()})},[r,s,u,M,m,c,a,l,d,p,e,n,y]),be=v.useCallback(re=>{if(!m||j||ye.current)return;N(!0);const ce=()=>{m.emit(Pe.AgentRequestHuman,{},fe=>{if(N(!1),fe&&typeof fe=="object"&&"isError"in fe&&fe.isError===!0){const R=fe,q=typeof R.errorCode=="string"&&R.errorCode.trim()?R.errorCode.trim():"",$=typeof R.error=="string"?R.error.trim():"";(q==="ERR_CHAT_CLOSED"||q==="ERR_CHAT_NOT_FOUND"||q==="ERR_CHAT_NOT_AGENT_MODE"&&/status\s*=\s*(closed|deleted)/i.test($))&&(m.markChatEnded(),ye.current=!0,n());return}const Z=fe;Z!=null&&Z.success?(ne.getState().setIsHaveChat(!0),h(!1),p(!1),ne.getState().clearAIAgentState(),e()):console.error("Failed to request human operator")})};re&&Object.keys(re).length>0?m.emit(Pe.ChatUpdateInputs,{inputs:re},fe=>{fe!=null&&fe.success?ce():(console.error("Failed to update chat inputs"),N(!1))}):ce()},[m,j,h,p,e,n]),P=()=>{pe?w.push("registration"):be()};return s?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:b.getColor(x.HeaderBackground),color:b.getColor(x.HeaderText),borderColor:b.getColor(x.HeaderBorder),...C?{}:{borderTopLeftRadius:b.getRadius(),borderTopRightRadius:b.getRadius()}},children:[f.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[(ae=s.avatar)!=null&&ae.trim()?f.jsx("div",{className:"flex size-[46px] shrink-0 items-center justify-center overflow-hidden rounded-[14px] border border-solid",style:{borderColor:b.getColor(x.HeaderBorder),backgroundColor:b.getColor(x.MessageAdminBackground)},children:f.jsx("img",{src:s.avatar.trim(),alt:"",className:"size-full object-cover"})}):f.jsx(g2,{color:b.getColor(x.HeaderText),borderColor:b.getColor(x.HeaderBorder),backgroundColor:b.getColor(x.MessageAdminBackground)}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("div",{className:"truncate font-medium",style:{color:b.getColor(x.HeaderText)},children:s.name}),f.jsx("div",{className:"line-clamp-1 text-xs opacity-75",style:{color:b.getColor(x.HeaderText)},children:"AI Asistan"})]})]}),f.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[f.jsx(p8,{onChatClose:me}),g&&f.jsx("button",{type:"button",onClick:ue,className:"p-1 hover:opacity-80 transition-opacity",children:f.jsx(J.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(Qk,{messages:o,isTyping:k||S&&(!!O||!!L),streamingContent:I?O:void 0,streamingStatusText:I?L:void 0,onLivechatSendSuggested:xe,skipAnimationForLastN:_}),f.jsx(Dr,{children:V&&f.jsxs(De.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:b.getColor(x.ErrorBackground),borderColor:b.getColor(x.ErrorBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:b.getRadius()},children:[f.jsx(J.XCircle,{className:"size-4 flex-shrink-0 mt-0.5",style:{color:b.getColor(x.ErrorText)}}),f.jsx("span",{className:"text-sm",style:{color:b.getColor(x.ErrorText)},children:V}),f.jsx("button",{type:"button",className:"ml-auto flex-shrink-0",onClick:()=>G(null),style:{color:b.getColor(x.ErrorText)},children:f.jsx(J.X,{className:"size-4"})})]})}),u?f.jsx(De.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:b.getColor(x.Background)},children:f.jsx(De.div,{className:"relative w-full max-w-lg mx-auto overflow-hidden",style:{borderRadius:b.getRadius()},animate:{filter:["brightness(1)","brightness(1.1)","brightness(1)"]},transition:{duration:2.5,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"},children:f.jsx(En,{onClick:P,disabled:j,size:"lg",className:"w-full flex items-center justify-center gap-2",children:j?f.jsx("span",{className:"animate-pulse",children:"Bağlanıyor..."}):f.jsxs(f.Fragment,{children:[f.jsx(J.User,{className:"w-5 h-5"}),f.jsx("span",{children:"Canlı Desteğe Bağlan"})]})})})}):f.jsx(d8,{onSendMessage:xe,disabled:M||(m==null?void 0:m.chatEnded)===!0,loading:M})]})]}):null}function g8({children:e}){const{widget:t}=ne();return t?f.jsx("section",{className:"h-full w-full relative",children:e}):null}function v8({children:e}){const t=xr(),n=Ss(),{historyChat:r,isAIAgentMode:i,aiAgent:s}=ne(),[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(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(ah,{})):d.current&&!t.connected?f.jsx(ah,{}):o||!t.connected?f.jsx(jk,{}):e}function wf(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())}async function Zx(e,t){if(!e||!(t!=null&&t.status))return;const n=ne.getState(),r=er(e);if(t.status===dt.Closed||t.status===dt.Deleted){n.clearAIAgentState();return}if(t.status===dt.Agent){let i=r.agent??n.aiAgent;if(!i)try{i=await ug(e)}catch{i=null}if(!i){n.setIsAIAgentMode(!1);return}n.setAIAgent(i),r.sessionId&&n.setAIAgentSessionId(r.sessionId),r.humanNeedRequested&&n.setHumanNeedRequested(!0),n.setIsAIAgentMode(!0);return}(t.status===dt.Open||t.status===dt.Pending||t.status===dt.Created)&&(n.isAIAgentMode||r.isAgentMode||n.aiAgent||r.agent)&&n.clearAIAgentState()}function y8(){const e=P=>{if(!P||typeof P!="object")return!1;const Y=String((P==null?void 0:P.error)||(P==null?void 0:P.message)||"").toLowerCase(),te=Number((P==null?void 0:P.status)||(P==null?void 0:P.statusCode)||0);return(P==null?void 0:P.retryAfter)!==void 0||te===429||/too\s+many|rate\s*limit|çok\s+fazla/.test(Y)},t=P=>{const Y=Number((P==null?void 0:P.retryAfter)??(P==null?void 0:P.seconds));return Number.isFinite(Y)&&Y>0?Y:3},{widget:n,setOpen:r,setIsHaveChat:i,historyChat:s,setHistoryChat:o,historyMessages:a,setHistoryMessages:l,aiAgent:c,isAIAgentMode:d,clearAIAgentState:u}=ne(),p=Ae(),h=xr(),{connected:y,connectionReady:b}=h,C=vl(),g=Ss(),m=$o(),[w,S]=v.useState(null),[T,k]=v.useState([]),[E,M]=v.useState(!1),[U,j]=v.useState([]),[N,O]=v.useState(!1),z=cg(),L=v.useRef(!1),D=v.useRef(null),I=v.useRef(!1),F=v.useRef([]),[_,B]=v.useState(!1),[V,G]=v.useState(null);v.useEffect(()=>{console.log("WS: ChatDetailView socket state:",{connected:y,connectionReady:b,hasChat:!!w,chatViewEmitted:L.current})},[y,b,w]),v.useEffect(()=>{if(w||s||d){B(!1);return}const P=setTimeout(()=>{!w&&!s&&!d&&(console.warn("WS: Connection timeout reached in ChatDetailView"),B(!0))},1e4);return()=>clearTimeout(P)},[w,s,d]),v.useEffect(()=>{if(!s||!n)return;if(S({status:s.status,is_customer_uploadable:!1}),a){k(a);return}const P=Lr(n.link_id);UP(s._id,n.link_id,P).then(([Y,te])=>{if(Yn(te)&&Array.isArray(Y)){const Q=Y.map(ae=>({id:ae._id,content:ae.content,created_at:ae.created_at,files:ae.files,sender_type:ae.sender_type,activity_type:ae.activity_type,answers:ae.answers,reply_id:ae.reply_id,buttons:ae.buttons}));k(Q),l(Q)}}).catch(Y=>{console.error("Failed to load history messages",Y)})},[s,n,a,l]);const W=async(P,Y)=>{var fe;if(!n)return;if(!s){const X=`temp-${Date.now()}`,Z={id:X,content:P,created_at:new Date,files:Y||[],sender_type:ve.Customer,answers:[],reply_id:void 0,buttons:[]};k(R=>[...R,Z]),h==null||h.emit(Pe.MessageCreate,{content:P,files:Y},R=>{const q=Array.isArray(R)?R[0]:R;if(q&&q.isError){k(H=>H.filter(oe=>oe.id!==X));const $=e(q);$||Co(q),$&&typeof window<"u"&&window.dispatchEvent(new CustomEvent("lc:rate-limit",{detail:{seconds:t(q)}}));return}k($=>$.map(H=>H.id===X?q:H))});return}const te={},Q=n.appearance;if((fe=Q==null?void 0:Q.body)!=null&&fe.inputs){for(const X of Q.body.inputs)if(X.required||X.remember){const Z=eo(X.name);Z&&(te[X.name]=Z)}}const ae=ne.getState().defaultValues;if(ae){ae.username&&(te.username=ae.username),ae.secret_data&&(te.secret_data=ae.secret_data);for(const X in ae)te[X]||(te[X]=ae[X])}const[re,ce]=await z.mutateAsync({inputs:te,history:[],client_id:n.client_id,widget_id:n.link_id,device_id:Lr(n.link_id)});if(Yn(ce)){o(null),i(!0),re&&typeof re=="object"&&"customer_token"in re&&(an(Je.CustomerToken,re.customer_token,n.link_id),an(Je.CustomerRefreshToken,re.customer_refresh_token,n.link_id));let X=0;const Z=20,R=`temp-${Date.now()}`,q={id:R,content:P,created_at:new Date,files:Y||[],sender_type:ve.Customer,answers:[],reply_id:void 0,buttons:[]};k(H=>[...H,q]);const $=setInterval(()=>{X+=1,h!=null&&h.connected?(h.emit(Pe.MessageCreate,{content:P,files:Y},H=>{const oe=Array.isArray(H)?H[0]:H;if(oe&&oe.isError){k(Te=>Te.filter(Qe=>Qe.id!==R));const he=e(oe);he||Co(oe),he&&typeof window<"u"&&window.dispatchEvent(new CustomEvent("lc:rate-limit",{detail:{seconds:t(oe)}}));return}k(he=>he.map(Te=>Te.id===R?oe:Te))}),clearInterval($)):X>=Z&&clearInterval($)},200)}},ee=P=>{!P&&!m&&r(!1),O(!0),Sa((n==null?void 0:n.link_id)||""),i(!1),S(null),F.current=[],k([]),j([]),o(null),ne.getState().setHistoryMessages(null),ne.getState().setShowHistoryOnRegistration(!1),u(),vc(n.client_id,ns(ts(C),n.link_id)).then(()=>{h==null||h.disconnect(),g.push("registration")})},ue=()=>{ne.getState().setMinimizedAssigneeName(null),w?(localStorage.setItem("showActionButtons","false"),S({...w,status:dt.Closed})):ee(!1)};v.useEffect(()=>{if(h){if(s){L.current=!1,I.current=!1;return}if(!y||!b){y||(I.current=!1,L.current=!1,D.current=null);return}I.current=!0,!(!n||L.current)&&(L.current=!0,console.log("ChatView: Emitting chat:view request"),h.emit(Pe.ChatView,{},async 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){L.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),F.current=[],vc(n.client_id,ns(ts(C),n.link_id)),k([]),j([]),o(null),ne.getState().setHistoryMessages(null),u(),Sa((n==null?void 0:n.link_id)||""),h.disconnect(),g.push("registration"),L.current=!1;return}console.log("ChatView: Setting chat state",{status:P.status});const te=Ax(P);S(te),i(!0),await Zx(n==null?void 0:n.link_id,te)}))}},[s,h,n,y,b,C,g,r,i,o,u]);const me=()=>{ue()},pe=()=>{ee(!0)},[Se,ke]=v.useState(!1),ye=v.useCallback(()=>{console.log("handleOperatorConnected: Starting operator connection flow"),L.current=!1,D.current=null,I.current=!1;const P=ne.getState().aiAgentMessages;P.length>0&&k(P),ke(!0)},[]);v.useEffect(()=>{if(Se){if(!h||!y||!b){console.log("handleOperatorConnected: Waiting for socket connection...",{connected:y,connectionReady:b});return}if(console.log("handleOperatorConnected: Socket ready, fetching chat view"),L.current){ke(!1);return}L.current=!0,h.emit(Pe.ChatView,{},async P=>{if(console.log("handleOperatorConnected: ChatView result",P),P&&!("error"in P)&&P.status){const te=Ax(P);S(te),i(!0),await Zx(n==null?void 0:n.link_id,te),h.emit(Pe.MessageList,{},Q=>{console.log("handleOperatorConnected: MessageList result",Q),Array.isArray(Q)&&k(ae=>wf(ae,Q))})}else console.log("handleOperatorConnected: Invalid chat result, clearing state",P),i(!1);ke(!1)})}},[Se,h,y,b,i]);const xe=()=>{u(),m||r(!1),O(!0),Sa((n==null?void 0:n.link_id)||""),i(!1),S(null),k([]),j([]),o(null),ne.getState().setHistoryMessages(null),ne.getState().setShowHistoryOnRegistration(!1),vc(n.client_id,ns(ts(C),n.link_id)).then(()=>{h==null||h.disconnect(),g.push("registration")})},be=v.useCallback(P=>{if(d&&c&&!s){const{aiAgentMessages:Y,addAIAgentMessage:te}=ne.getState();if(Y.some(Q=>Q.id===P.id))return;te(P);return}if(!(w&&[dt.Closed,dt.Deleted].includes(w.status))){if(!w){const Y=F.current;if(!P.id||Y.some(te=>te.id===P.id))return;Y.push(P);return}k(Y=>{const te=Y.filter(ae=>{var re;return!((re=ae.id)!=null&&re.startsWith("temp-")&&ae.content===P.content)});return te.some(ae=>ae.id===P.id)?te:[...te,P]})}},[w,d,c,s]);return v.useEffect(()=>{if(!w||[dt.Closed,dt.Deleted].includes(w.status))return;const P=F.current;P.length!==0&&(F.current=[],k(Y=>wf(Y,P)))},[w]),v.useEffect(()=>{if(!h)return;const P=X=>{const Z={content:X.content,created_at:X.created_at,files:X.files,id:X._id,sender_type:X.sender_type,answers:X.answers,reply_id:X.reply_id,buttons:X.buttons,post_followup:X.post_followup};if(U.length>0){j(R=>[...R,Z]);return}X.is_shortcut?j([Z]):be(Z),M(!1)},Y=X=>{const Z={content:X.content,created_at:X.created_at,files:X.files,id:X._id,sender_id:X.sender_id,sender_type:X.sender_type,activity_type:X.activity_type,sender_name:X.sender_name,answers:X.answers,reply_id:X.reply_id,buttons:X.buttons};be(Z)},te=X=>{!X||!X.name?S(Z=>Z?{...Z,agent_name:void 0,agent_avatar:void 0,participants:[]}:null):S(Z=>{if(!Z)return null;const R=D6(Z.participants,{profile_id:X.id,name:X.name,avatar:X.avatar}),q=la(R);return{...Z,participants:R,...q}})},Q=()=>{M(!0)},ae=()=>{h.markChatEnded(),ee(!0)},re=({is_customer_uploadable:X})=>{S(Z=>Z?{...Z,is_customer_uploadable:X}:null)},ce=X=>{S(Z=>{if(!Z)return null;const R=hh(Z.participants,{profile_id:X.profile_id});if(!X.hasOtherAdmins||R.length===0)return{...Z,participants:[],agent_name:void 0,agent_avatar:void 0};const q=la(R);return{...Z,participants:R,...q}})},fe=X=>{S(Z=>{if(!Z)return null;const R=O6(Z.participants,{profile_id:X.profile_id,name:X.name,avatar:X.avatar}),q=la(R);return{...Z,participants:R,...q}})};return h.on(ge.MessageAgentCreate,P),h.on(ge.MessageUserCreate,Y),h.on(ge.MessageCustomerCreate,Y),h.on(ge.ChatUserAssignee,te),h.on(ge.MessageAgentTyping,Q),h.on(ge.ChatUserClose,ae),h.on(ge.ChatToggleUpload,re),h.on(ge.ChatUserLeave,ce),h.on(ge.ChatUserJoin,fe),()=>{h.off(ge.MessageAgentCreate,P),h.off(ge.MessageUserCreate,Y),h.off(ge.MessageCustomerCreate,Y),h.off(ge.ChatUserAssignee,te),h.off(ge.MessageAgentTyping,Q),h.off(ge.ChatUserClose,ae),h.off(ge.ChatToggleUpload,re),h.off(ge.ChatUserLeave,ce),h.off(ge.ChatUserJoin,fe)}},[be,U]),v.useEffect(()=>{if(!h)return;const P=te=>{te.repeat_count===3&&G(te.message)},Y=()=>{h.emit(Pe.ChatClose,{}),ne.getState().setShowActionButtons(!1),ue()};return h.on(ge.AgentSpamWarning,P),h.on(ge.AgentSpamBanned,Y),()=>{h.off(ge.AgentSpamWarning,P),h.off(ge.AgentSpamBanned,Y)}},[h,ue]),v.useEffect(()=>{if(!h||!w||s){D.current=null;return}const P=`${w.status}-${w.agent_name||"no-agent"}`;D.current!==P&&(D.current=P,h.emit(Pe.MessageList,{},Y=>{if(!Array.isArray(Y)){console.warn("MessageList response is not an array:",Y),D.current=null;return}k(te=>wf(te,Y)),S(te=>{if(!te)return null;const Q=I6(Y),ae=Q.length>0?Q:te.participants&&te.participants.length>0?te.participants:Dg(te.agent_name,te.agent_avatar),re=la(ae);return{...te,participants:ae,...re}})}))},[h,w,s]),v.useEffect(()=>{const P=setTimeout(()=>{M(!1)},2e3);return()=>clearTimeout(P)},[E]),v.useEffect(()=>{if(!n||U.length===0)return;let P=0;n.writing_timeout&&(P=[...U[0].content].length/n.writing_timeout,P<0&&(P=0));const Y=setTimeout(()=>{be(U[0]),j(U.slice(1))},P*1e3);return()=>clearTimeout(Y)},[U,n]),N?f.jsx(ah,{}):d&&c&&!s?f.jsxs(f.Fragment,{children:[f.jsx("div",{id:"chat-alert-portal"}),f.jsx("div",{className:`h-full w-full ${m?"":"rounded-xl"} shadow-sm flex flex-col overflow-hidden`,style:{height:m?"100%":"",minHeight:m?"var(--app-height, 100dvh)":"",maxHeight:m?"var(--app-height, 100dvh)":"",backgroundColor:p.getColor(x.Background)},children:f.jsx(m8,{onOperatorConnected:ye,onChatClose:xe,onRemoteChatEnded:()=>ee(!0)})})]}):f.jsxs(f.Fragment,{children:[f.jsx("div",{id:"chat-alert-portal"}),f.jsx("div",{className:`h-full w-full ${m?"":"rounded-xl"} shadow-sm flex flex-col overflow-hidden`,style:{height:m?"100%":"",minHeight:m?"var(--app-height, 100dvh)":"",maxHeight:m?"var(--app-height, 100dvh)":"",backgroundColor:p.getColor(x.Background)},children:w?w.status===dt.Closed&&!s?f.jsx(u8,{onOk:ee}):f.jsx(l8,{chat:w,isTyping:E,messages:T,shortcutMessages:U,onNewMessage:be,onChatClose:ue,onEvaluateChat:me,onNewChat:pe,onSendMessage:W,isHistoryMode:!!s,spamWarningMessage:V,onDismissSpamWarning:()=>G(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:p.getColor(x.InputBorder)},children:f.jsx(J.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:()=>ee(!0),className:"px-6 py-2 rounded-lg font-medium transition-all",style:{backgroundColor:p.getColor(x.ButtonBackground),color:p.getColor(x.ButtonText),borderRadius:p.getRadius()},children:"Tekrar Dene"})]}):f.jsx(jk,{})})]})}function x8(){return A6(),null}function w8(){return f.jsxs(v8,{children:[f.jsx(g8,{children:f.jsx(y8,{})}),f.jsx(x8,{})]})}const b8=[{path:"/chat",component:w8,name:"chat"}],v2=[...b8],y2=[...P6],C8=[...v2,...y2],S8=["Göktuğ","Rüzgar","Altan","Hamza","Caner"],k8="lc:tooltip:operator";function _8(){const e=new Date,t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return`${t}-${n}-${r}`}function x2(){const e=S8;return e[Math.floor(Math.random()*e.length)]}function T8(e){const t=_8(),n=`${k8}:${e}`;try{const i=localStorage.getItem(n);if(i){const s=JSON.parse(i);if(s&&s.day===t&&typeof s.name=="string"&&s.name.length>0)return s.name}}catch{}const r=x2();try{localStorage.setItem(n,JSON.stringify({name:r,day:t}))}catch{}return r}function E8(e){return e==="light"?{balloon:"#ffffff",greeting:"#111111",sub:"#666666",close:"#bbbbbb",closeHoverBg:"rgba(0, 0, 0, 0.06)",title:"#4a3ff5",shadow:"0 6px 26px rgba(0, 0, 0, 0.2), 0 1px 5px rgba(0, 0, 0, 0.09)"}:{balloon:"#1e1e2e",greeting:"#f4f4f5",sub:"#a1a1aa",close:"#71717a",closeHoverBg:"rgba(255, 255, 255, 0.08)",title:"#4a3ff5",shadow:"0 6px 26px rgba(0, 0, 0, 0.4), 0 1px 5px rgba(0, 0, 0, 0.26)"}}function Ch({text:e,assigneeName:t}){var g,m,w,S;const{widget:n,isHaveChat:r,isTooltipVisible:i,setIsTooltipVisible:s,onTooltipClose:o}=ne(),{texts:a,resolvedMode:l}=Ae(),c=v.useMemo(()=>E8(l),[l]),d=v.useMemo(()=>n!=null&&n.link_id?T8(n.link_id):x2(),[n==null?void 0:n.link_id]),{data:u,isSuccess:p,isError:h}=DS(n==null?void 0:n.link_id),y=()=>{s(!1),o&&o()},{greetingLine:b,showSub:C}=v.useMemo(()=>{var U,j,N,O;if(e)return{greetingLine:e,showSub:!1};const T=t==null?void 0:t.trim();if(T)return{greetingLine:a[se.TooltipBalloonGreeting].replace(/\{name\}/g,T),showSub:!0};const k=(r?(j=(U=n==null?void 0:n.appearance)==null?void 0:U.design)==null?void 0:j.tooltip_message_active:(O=(N=n==null?void 0:n.appearance)==null?void 0:N.design)==null?void 0:O.tooltip_message)||"";if(h&&k)return{greetingLine:k,showSub:!0};const E=a[se.TooltipBalloonGreeting];let M="Chaty";return p&&u?M="Chaty":p&&u===null&&(M=d),{greetingLine:E.replace(/\{name\}/g,M),showSub:!0}},[e,t,a,r,(m=(g=n==null?void 0:n.appearance)==null?void 0:g.design)==null?void 0:m.tooltip_message,(S=(w=n==null?void 0:n.appearance)==null?void 0:w.design)==null?void 0:S.tooltip_message_active,h,p,u,d]);return i?f.jsxs(De.div,{initial:{opacity:0,y:12,scale:.97},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:12,scale:.97},transition:{duration:.3,ease:"easeOut"},className:Oe("absolute bottom-full right-0 z-10 mb-2.5 w-[212px]","px-[14px] pb-[14px] pt-3"),style:{borderRadius:"15px 15px 3px 15px",backgroundColor:c.balloon,boxShadow:c.shadow},children:[f.jsxs("div",{className:"mb-2 flex items-start justify-between gap-1.5",children:[f.jsx("button",{type:"button",onClick:y,className:"shrink-0 rounded p-0.5 text-[12px] leading-none transition-colors",style:{color:c.close},onMouseEnter:T=>{T.currentTarget.style.color=l==="light"?"#555555":"#d4d4d8",T.currentTarget.style.backgroundColor=c.closeHoverBg},onMouseLeave:T=>{T.currentTarget.style.color=c.close,T.currentTarget.style.backgroundColor="transparent"},"aria-label":a[se.CloseButtonAria],children:f.jsx(J.X,{className:"size-3","aria-hidden":!0})}),f.jsx("span",{className:"text-right text-[9px] font-bold uppercase tracking-[0.11em]",style:{color:c.title},children:a[se.TooltipBalloonTitle]})]}),f.jsx(De.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.05,duration:.25},className:"mb-0.5 text-[13px] font-bold leading-snug",style:{color:c.greeting},children:b}),C&&f.jsx("p",{className:"text-[12px] leading-normal",style:{color:c.sub},children:a[se.TooltipBalloonSub]}),f.jsx("div",{className:"pointer-events-none absolute h-2 w-[15px]",style:{bottom:"-7px",right:"31px",backgroundColor:c.balloon,clipPath:"polygon(0 0, 100% 0, 100% 100%)"},"aria-hidden":!0})]},"widget-tooltip"):null}function A8({label:e,onActivate:t}){return f.jsx("button",{type:"button",className:"chatier-minimized-unread-bubble",onClick:t,"aria-live":"polite",children:e})}function j8(e){return e.sender_type===ve.Activity||e.sender_type===ve.System?!1:e.sender_type===ve.Agent||e.sender_type===ve.User}function Jx({fallback:e,fallbackOpen:t,onOpenWidget:n}){const[r]=v.useState(window.document.title),i=xr(),{isHaveChat:s,open:o,soundPath:a,isTooltipVisible:l}=ne(),c=ne(k=>k.minimizedAssigneeName),d=ne(k=>k.setMinimizedAssigneeName),[u,p]=v.useState(!0),[h,y]=v.useState(0),[b,C]=v.useState(null),g=Lo(),m=v.useRef(new Set),w=()=>{B6(a)},S=(k,E)=>{if(b&&clearInterval(b),k||!s||E===0||Number.isNaN(E)){window.document.title=r,C(null);return}const M=setInterval(()=>{if(k||!s||E===0||Number.isNaN(E)){window.document.title=r,clearInterval(M),C(null);return}const j=`${g(se.MinimizedUnreadMessage).replace(/\{count\}/g,String(E))} - ${r}`;window.document.title!==j?window.document.title=j:window.document.title=r},1e3);return C(M),()=>{clearInterval(M),C(null)}};if(v.useEffect(()=>S(o&&u,h),[h,o,u]),v.useEffect(()=>{const k=()=>{p(document.visibilityState==="visible")};return document.addEventListener("visibilitychange",k,!1),()=>{document.removeEventListener("visibilitychange",k)}},[]),v.useEffect(()=>{o&&(y(0),m.current.clear())},[o]),v.useEffect(()=>{s||d(null)},[s,d]),v.useEffect(()=>{if(!i||!s)return;const k=j=>{o||j8(j)&&(m.current.has(j._id)||(m.current.add(j._id),y(N=>N+1),w()))},E=j=>{var O;const N=(O=j.name)==null?void 0:O.trim();N&&d(N),w()},M=j=>{var L;if(!j.was_assigned)return;const N=ne.getState().minimizedAssigneeName;if(!j.hasOtherAdmins){d(null);return}const O=(L=j.name)==null?void 0:L.trim(),z=N==null?void 0:N.trim();O&&z&&O===z&&d(null)},U=()=>{d(null)};return i.on(ge.MessageAgentCreate,k),i.on(ge.ChatUserAssignee,E),i.on(ge.ChatUserLeave,M),i.on(ge.ChatUserClose,U),()=>{i.off(ge.MessageAgentCreate,k),i.off(ge.ChatUserAssignee,E),i.off(ge.ChatUserLeave,M),i.off(ge.ChatUserClose,U)}},[i,s,o,d]),o)return null;const T=h>0?g(se.MinimizedUnreadMessage).replace(/\{count\}/g,String(h)):"";if(s&&h>0)return f.jsx(A8,{label:T,onActivate:n});if(s&&l){const k=c==null?void 0:c.trim();return f.jsx(Ch,{...k?{assigneeName:k}:{}})}return!s&&t?e:null}function Jl({onClick:e,buttonBackground:t,buttonText:n,haloBackground:r,glow:i,glow2:s,haloIdle:o,showClose:a,className:l,"aria-label":c}){const d=r??`color-mix(in srgb, ${t} 30%, transparent)`;return f.jsxs("button",{type:"button",className:Oe("chatier-blob-wrap relative flex size-[55px] shrink-0 cursor-pointer items-center justify-center rounded-full border-0 bg-transparent p-0 outline-none transition-transform duration-200 hover:scale-[1.06] active:scale-[0.95] focus-visible:ring-2 focus-visible:ring-offset-2",l),style:{"--chatier-blob":t,"--chatier-glow":i??"rgba(74, 63, 245, 0.55)","--chatier-glow2":s??"rgba(74, 63, 245, 0.22)","--chatier-halo-idle":o??"none",color:n},onClick:e,"aria-label":c??(a?"Sohbeti küçült":"Sohbeti aç"),children:[f.jsx("div",{className:"chatier-blob-halo chatier-blob-morph-rev pointer-events-none absolute -inset-[8px] rounded-full transition-shadow duration-300",style:{backgroundColor:d},"aria-hidden":!0}),f.jsx("div",{className:"chatier-blob-bg chatier-blob-morph pointer-events-none absolute inset-0 transition-shadow duration-300",style:{backgroundColor:t},"aria-hidden":!0}),f.jsxs("div",{className:"relative z-10 flex size-full items-center justify-center",children:[f.jsx(De.div,{className:"absolute flex items-center justify-center",initial:!1,animate:{opacity:a?0:1,scale:a?.5:1,rotate:a?90:0},transition:{duration:.22,ease:"easeOut"},children:f.jsx(m2,{sizePx:29,className:"text-current"})}),f.jsx(De.div,{className:"absolute flex items-center justify-center",initial:!1,animate:{opacity:a?1:0,scale:a?1:.5,rotate:a?0:-90},transition:{duration:.22,ease:"easeOut"},children:f.jsx(J.X,{className:"size-6 text-current","aria-hidden":!0})})]})]})}const R8=["top-left","top-right","top-center","bottom-left","bottom-right","bottom-center"],M8=new Set(R8);function e1(e){const t=e==null?void 0:e.trim();if(!(!t||!M8.has(t)))return t}function P8(e,t,n="bottom-center"){var r,i;return e1(t==null?void 0:t.toast_position)??e1((i=(r=e==null?void 0:e.appearance)==null?void 0:r.design)==null?void 0:i.toast_position)??n}function N8(e){return e.startsWith("top")}function O8(e){return e==="light"?{background:"#ffffff",halo:"rgba(255, 255, 255, 0.22)",foreground:"#4a3ff5",glow:"rgba(255, 255, 255, 0.5)",glow2:"rgba(255, 255, 255, 0.2)",haloIdle:"0 0 28px rgba(255, 255, 255, 0.38), 0 0 12px rgba(255, 255, 255, 0.2)"}:{background:"#4a3ff5",halo:"rgba(74, 63, 245, 0.3)",foreground:"#ffffff",glow:"rgba(74, 63, 245, 0.55)",glow2:"rgba(74, 63, 245, 0.22)",haloIdle:"0 0 24px rgba(74, 63, 245, 0.42), 0 0 10px rgba(74, 63, 245, 0.22)"}}function D8({children:e,border:t}){var ue,me,pe,Se;const n=xr(),{open:r,setOpen:i,setIsHaveChat:s,isHaveChat:o,widget:a,onOpen:l,onClose:c,humanNeedRequested:d,defaultValues:u}=ne(),[p]=v.useState(!0),h=Ss(),y=vl(),b=Tm(),C=Ae(),{resolvedMode:g}=C,m=v.useMemo(()=>O8(g),[g]),w=v.useMemo(()=>({buttonBackground:m.background,haloBackground:m.halo,buttonText:m.foreground,glow:m.glow,glow2:m.glow2,haloIdle:m.haloIdle}),[m]),S=$o(),T=Hk(),k=v.useMemo(()=>P8(a,u),[a,u]),E=N8(k)?"top":"bottom",M=E==="top"?{top:20}:20,U=E==="top"?{top:"max(20px, calc(14px + env(safe-area-inset-top, 0px)))"}:{bottom:"max(14px, calc(14px + env(safe-area-inset-bottom, 0px)))"},[j,N]=v.useState({x:0,y:0}),O=XM(),z=v.useRef(null),L=v.useRef(null),[D,I]=v.useState(!1),[F,_]=v.useState(()=>r?"visible":"hidden");v.useEffect(()=>((()=>{I("ontouchstart"in window||navigator.maxTouchPoints>0)})(),window.addEventListener("touchstart",()=>{I(!0)},{once:!0}),()=>{window.removeEventListener("touchstart",()=>{I(!0)})}),[]),v.useEffect(()=>{o&&b.pathname==="/"&&y&&y.accessToken&&!d&&h.push("chat")},[o,b.pathname,y,h,d]),v.useEffect(()=>{r&&_("visible")},[r]);const B=ke=>{if(!z.current||!L.current)return ke;const ye=z.current.getBoundingClientRect(),xe={width:window.innerWidth,height:window.innerHeight},be={top:20,right:20,bottom:40,left:20};let P=ke.x,Y=ke.y;return ye.right+P-j.x>xe.width-be.right&&(P=xe.width-be.right-ye.width-(ye.left-j.x)),ye.left+P-j.x<be.left&&(P=be.left-(ye.left-j.x)),ye.bottom+Y-j.y>xe.height-be.bottom&&(Y=xe.height-be.bottom-ye.height-(ye.top-j.y)),ye.top+Y-j.y<be.top&&(Y=be.top-(ye.top-j.y)),{x:P,y:Y}},V=()=>{if(i(!0),!n)return;n.emit(Pe.WidgetOpen,{});const{isAIAgentMode:ke,aiAgentRequestInFlight:ye,setAIAgentMessages:xe}=ne.getState();ke&&ye&&n.emit(Pe.MessageList,{},be=>{Array.isArray(be)&&be.length>0&&xe(be)}),l&&l()},G=()=>{i(!1),n&&(n.emit(Pe.WidgetClose,{}),c&&c())},W=()=>{i(!1),s(!1),vc(a.client_id,ns(ts(y),a.link_id)),h.push("registration")};v.useEffect(()=>{if(S&&(o||T)&&V(),!(!n||!a))return n.on(ge.Banned,W),()=>{n.off(ge.Banned,W)}},[]);function ee(ke){D&&O.start(ke)}return f.jsxs("section",{className:"relative w-full h-full",ref:L,"data-theme":g,children:[f.jsxs(De.div,{initial:!1,animate:{opacity:r?1:0,scale:r?1:.7,y:r?0:12},transition:r?{duration:.32,ease:[.34,1.56,.64,1]}:{duration:.22,ease:[.4,0,.2,1]},onAnimationComplete:()=>{ne.getState().open||_("hidden")},className:Oe("fixed z-300 overflow-hidden isolate min-h-0",{"":t&&!S,"bottom-28 right-8 rounded-xl":!S,"!bottom-0 !right-0":S}),style:{width:S?"100%":((me=(ue=a==null?void 0:a.appearance)==null?void 0:ue.design)==null?void 0:me.width)||"21rem",height:S?"var(--app-height, 100dvh)":((Se=(pe=a==null?void 0:a.appearance)==null?void 0:pe.design)==null?void 0:Se.height)||"30rem",left:S?"0":"",right:S?"0px !important":"",maxHeight:S?"var(--app-height, 100dvh)":"",boxShadow:S?"":`0 10px 25px -5px ${C.getColor(x.ShadowColor)}, 0 8px 10px -6px ${C.getColor(x.ShadowColor)}`,backgroundColor:C.getColor(x.Background),visibility:r?"visible":F,transformOrigin:S?"bottom center":"bottom right",pointerEvents:r?"auto":"none"},"aria-hidden":!r,children:[e,f.jsx("div",{className:"widget-toast-scope pointer-events-none absolute inset-0 z-[520] min-h-0 [&_[data-sonner-toaster]]:pointer-events-auto","data-toast-anchor":E,"aria-live":"polite",children:f.jsx(pj,{richColors:!0,theme:g,position:k,gap:8,duration:Em,offset:M,mobileOffset:U})})]}),!D&&f.jsxs("div",{className:"fixed bottom-[40px] right-[20px] z-400",children:[f.jsx(Jx,{fallback:f.jsx(Ch,{}),fallbackOpen:p,onOpenWidget:V}),!r&&f.jsx(Jl,{...w,onClick:V,showClose:!1},"desktop-open-blob"),r&&!S&&f.jsx(Jl,{...w,onClick:G,showClose:!0},"desktop-close-blob")]}),D&&f.jsxs(De.div,{ref:z,className:"fixed z-400 bottom-24 right-5",initial:{bottom:"96px",right:"20px"},animate:{x:j.x,y:j.y},drag:D,dragControls:O,dragMomentum:!1,dragElastic:0,onDragEnd:(ke,ye)=>{const xe={x:j.x+ye.offset.x,y:j.y+ye.offset.y},be=B(xe);N(be)},children:[f.jsx(Jx,{fallback:f.jsx(Ch,{}),fallbackOpen:p,onOpenWidget:V}),!r&&f.jsx("div",{className:"cursor-move",onPointerDown:ee,children:f.jsx(Jl,{...w,onClick:V,showClose:!1})},"chat-button"),r&&!S&&f.jsx(Jl,{...w,onClick:G,showClose:!0},"touch-close-blob")]})]})}function I8(e){const{widget:t}=ne();return f.jsx(oP,{widget:t,children:f.jsx(D8,{...e})})}function L8(){const{isHaveChat:e,isAIAgentMode:t}=ne();return f.jsx(LA,{initialEntries:[e||t?"/chat":"/"],future:{v7_startTransition:!0},children:f.jsx(I8,{border:!0,children:f.jsxs(BA,{children:[v2.map((n,r)=>f.jsx(Ep,{path:n.path,element:f.jsx(n.component,{})},r)),y2.map((n,r)=>f.jsx(Ep,{path:n.path,element:f.jsx(n.component,{})},r))]})})})}const F8="#4a3ff5";function B8(){const[e,t]=v.useState(()=>typeof window<"u"?My():"light");return v.useEffect(()=>{const n=()=>t(My()),r=window.matchMedia("(prefers-color-scheme: dark)");return r.addEventListener("change",n),window.addEventListener("storage",n),()=>{r.removeEventListener("change",n),window.removeEventListener("storage",n)}},[]),e}function $8(){const t=B8()==="dark",n=t?F8:"#ffffff",r=t?"rgba(74,63,245,0.55)":"rgba(255,255,255,0.4)",i=t?"rgba(74,63,245,0.4)":"rgba(255,255,255,0.3)";return f.jsxs("output",{className:"pointer-events-none fixed bottom-[40px] right-[20px] z-400 block","aria-live":"polite","aria-busy":"true",children:[f.jsx("span",{className:"sr-only",children:"Yükleniyor"}),f.jsxs("div",{className:"relative flex size-[55px] items-center justify-center",children:[f.jsx("div",{className:"chatier-loader-halo absolute size-[45px] rounded-full",style:{backgroundColor:i},"aria-hidden":!0}),f.jsx("div",{className:"chatier-loader-square size-[26px]",style:{backgroundColor:n,boxShadow:`0 0 16px ${r}`},"aria-hidden":!0})]})]})}const z8=2e3,V8=v.forwardRef((e,t)=>{var M;const n=typeof document<"u"&&((M=document.documentElement)==null?void 0:M.dataset.chatierStandaloneApp)==="true",r=Hk(),i=n||r,s=localStorage.getItem("lc:device:id"),{data:o,isLoading:a,error:l}=VE(e.link_id,s||void 0),{widget:c,setWidget:d,setSoundPath:u,setDefaultValues:p,setOpen:h,setOnTooltipClose:y,setIsTooltipVisible:b,setOnOpen:C,setOnClose:g,onOpen:m,onClose:w}=ne(),S=v.useRef(null),[T,k]=v.useState(!0);return v.useEffect(()=>{if(i){if(a){S.current=null,k(!0);return}S.current=null,k(!0);return}if(a){S.current=Date.now(),k(!1);return}const U=S.current;if(U===null){k(!0);return}const j=Date.now()-U,N=Math.max(0,z8-j);if(N===0){S.current=null,k(!0);return}const O=window.setTimeout(()=>{S.current=null,k(!0)},N);return()=>window.clearTimeout(O)},[a,i]),v.useImperativeHandle(t,()=>({open:()=>{h(!0),m&&m()},close:()=>{h(!1),w&&w()}})),v.useEffect(()=>{o&&HE(o)&&d(o),e.soundPath&&u(e.soundPath),e.defaultValues&&p(e.defaultValues),e.onTooltipClose&&y(e.onTooltipClose),e.showTooltip===!1&&b(!1),e.onOpen&&C(e.onOpen),e.onClose&&g(e.onClose)},[o,e.soundPath,e.defaultValues,e.onTooltipClose,e.showTooltip,e.onOpen,e.onClose]),!i&&(a||!T)?f.jsx($8,{}):l||!o||!c?null:f.jsx(dL,{children:f.jsx(T6,{children:f.jsx(L8,{})})})}),U8=new _E;let t1=null;function H8(e){if(!e.container)return;const t=ie.createRef();return t1=_b(e.container),t1.render(f.jsx(RE,{client:U8,children:f.jsx(V8,{...e,ref:t})})),{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=Lr(e.link_id);zP({widget_id:e.link_id,device_id:r,decrypted_data:n})}}}window.widget=H8});export default W8();
|
|
84
|
+
*/const sC=[["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"}]],aC=Wd("paperclip",sC);var Vd={exports:{}},oC="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",lC=oC,cC=lC;function Kd(){}function Yd(){}Yd.resetWarningCache=Kd;var uC=function(){function t(r,i,s,a,l,c){if(c!==cC){var d=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 d.name="Invariant Violation",d}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:Yd,resetWarningCache:Kd};return n.PropTypes=n,n};Vd.exports=uC();var dC=Vd.exports;const Fe=Ir(dC);function or(t,e,n,r){function i(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function l(f){try{d(r.next(f))}catch(u){a(u)}}function c(f){try{d(r.throw(f))}catch(u){a(u)}}function d(f){f.done?s(f.value):i(f.value).then(l,c)}d((r=r.apply(t,e||[])).next())})}const pC=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 Or(t,e,n){const r=fC(t),{webkitRelativePath:i}=t,s=typeof e=="string"?e:typeof i=="string"&&i.length>0?i:`./${t.name}`;return typeof r.path!="string"&&bc(r,"path",s),bc(r,"relativePath",s),r}function fC(t){const{name:e}=t;if(e&&e.lastIndexOf(".")!==-1&&!t.type){const r=e.split(".").pop().toLowerCase(),i=pC.get(r);i&&Object.defineProperty(t,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return t}function bc(t,e,n){Object.defineProperty(t,e,{value:n,writable:!1,configurable:!1,enumerable:!0})}const hC=[".DS_Store","Thumbs.db"];function mC(t){return or(this,void 0,void 0,function*(){return qi(t)&&gC(t.dataTransfer)?bC(t.dataTransfer,t.type):yC(t)?vC(t):Array.isArray(t)&&t.every(e=>"getFile"in e&&typeof e.getFile=="function")?xC(t):[]})}function gC(t){return qi(t)}function yC(t){return qi(t)&&qi(t.target)}function qi(t){return typeof t=="object"&&t!==null}function vC(t){return Na(t.target.files).map(e=>Or(e))}function xC(t){return or(this,void 0,void 0,function*(){return(yield Promise.all(t.map(n=>n.getFile()))).map(n=>Or(n))})}function bC(t,e){return or(this,void 0,void 0,function*(){if(t.items){const n=Na(t.items).filter(i=>i.kind==="file");if(e!=="drop")return n;const r=yield Promise.all(n.map(wC));return wc(Gd(r))}return wc(Na(t.files).map(n=>Or(n)))})}function wc(t){return t.filter(e=>hC.indexOf(e.name)===-1)}function Na(t){if(t===null)return[];const e=[];for(let n=0;n<t.length;n++){const r=t[n];e.push(r)}return e}function wC(t){if(typeof t.webkitGetAsEntry!="function")return Cc(t);const e=t.webkitGetAsEntry();return e&&e.isDirectory?Qd(e):Cc(t,e)}function Gd(t){return t.reduce((e,n)=>[...e,...Array.isArray(n)?Gd(n):[n]],[])}function Cc(t,e){return or(this,void 0,void 0,function*(){var n;if(globalThis.isSecureContext&&typeof t.getAsFileSystemHandle=="function"){const s=yield t.getAsFileSystemHandle();if(s===null)throw new Error(`${t} is not a File`);if(s!==void 0){const a=yield s.getFile();return a.handle=s,Or(a)}}const r=t.getAsFile();if(!r)throw new Error(`${t} is not a File`);return Or(r,(n=e==null?void 0:e.fullPath)!==null&&n!==void 0?n:void 0)})}function CC(t){return or(this,void 0,void 0,function*(){return t.isDirectory?Qd(t):_C(t)})}function Qd(t){const e=t.createReader();return new Promise((n,r)=>{const i=[];function s(){e.readEntries(a=>or(this,void 0,void 0,function*(){if(a.length){const l=Promise.all(a.map(CC));i.push(l),s()}else try{const l=yield Promise.all(i);n(l)}catch(l){r(l)}}),a=>{r(a)})}s()})}function _C(t){return or(this,void 0,void 0,function*(){return new Promise((e,n)=>{t.file(r=>{const i=Or(r,t.fullPath);e(i)},r=>{n(r)})})})}var Us=function(t,e){if(t&&e){var n=Array.isArray(e)?e:e.split(",");if(n.length===0)return!0;var r=t.name||"",i=(t.type||"").toLowerCase(),s=i.replace(/\/.*$/,"");return n.some(function(a){var l=a.trim().toLowerCase();return l.charAt(0)==="."?r.toLowerCase().endsWith(l):l.endsWith("/*")?s===l.replace(/\/.*$/,""):i===l})}return!0};function _c(t){return jC(t)||SC(t)||Jd(t)||kC()}function kC(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
85
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function SC(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function jC(t){if(Array.isArray(t))return Ia(t)}function kc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Sc(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?kc(Object(n),!0).forEach(function(r){Xd(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):kc(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Xd(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ri(t,e){return AC(t)||TC(t,e)||Jd(t,e)||EC()}function EC(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
86
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Jd(t,e){if(t){if(typeof t=="string")return Ia(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ia(t,e)}}function Ia(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function TC(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],i=!0,s=!1,a,l;try{for(n=n.call(t);!(i=(a=n.next()).done)&&(r.push(a.value),!(e&&r.length===e));i=!0);}catch(c){s=!0,l=c}finally{try{!i&&n.return!=null&&n.return()}finally{if(s)throw l}}return r}}function AC(t){if(Array.isArray(t))return t}var RC=typeof Us=="function"?Us:Us.default,OC="file-invalid-type",NC="file-too-large",IC="file-too-small",MC="too-many-files",$C=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=e.split(","),r=n.length>1?"one of ".concat(n.join(", ")):n[0];return{code:OC,message:"File type must be ".concat(r)}},jc=function(e){return{code:NC,message:"File is larger than ".concat(e," ").concat(e===1?"byte":"bytes")}},Ec=function(e){return{code:IC,message:"File is smaller than ".concat(e," ").concat(e===1?"byte":"bytes")}},DC={code:MC,message:"Too many files"};function Zd(t,e){var n=t.type==="application/x-moz-file"||RC(t,e);return[n,n?null:$C(e)]}function ep(t,e,n){if($n(t.size))if($n(e)&&$n(n)){if(t.size>n)return[!1,jc(n)];if(t.size<e)return[!1,Ec(e)]}else{if($n(e)&&t.size<e)return[!1,Ec(e)];if($n(n)&&t.size>n)return[!1,jc(n)]}return[!0,null]}function $n(t){return t!=null}function FC(t){var e=t.files,n=t.accept,r=t.minSize,i=t.maxSize,s=t.multiple,a=t.maxFiles,l=t.validator;return!s&&e.length>1||s&&a>=1&&e.length>a?!1:e.every(function(c){var d=Zd(c,n),f=ri(d,1),u=f[0],m=ep(c,r,i),h=ri(m,1),b=h[0],C=l?l(c):null;return u&&b&&!C})}function Wi(t){return typeof t.isPropagationStopped=="function"?t.isPropagationStopped():typeof t.cancelBubble<"u"?t.cancelBubble:!1}function ki(t){return t.dataTransfer?Array.prototype.some.call(t.dataTransfer.types,function(e){return e==="Files"||e==="application/x-moz-file"}):!!t.target&&!!t.target.files}function Tc(t){t.preventDefault()}function PC(t){return t.indexOf("MSIE")!==-1||t.indexOf("Trident/")!==-1}function BC(t){return t.indexOf("Edge/")!==-1}function LC(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return PC(t)||BC(t)}function Gt(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(r){for(var i=arguments.length,s=new Array(i>1?i-1:0),a=1;a<i;a++)s[a-1]=arguments[a];return e.some(function(l){return!Wi(r)&&l&&l.apply(void 0,[r].concat(s)),Wi(r)})}}function zC(){return"showOpenFilePicker"in window}function HC(t){if($n(t)){var e=Object.entries(t).filter(function(n){var r=ri(n,2),i=r[0],s=r[1],a=!0;return tp(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.')),a=!1),(!Array.isArray(s)||!s.every(np))&&(console.warn('Skipped "'.concat(i,'" because an invalid file extension was provided.')),a=!1),a}).reduce(function(n,r){var i=ri(r,2),s=i[0],a=i[1];return Sc(Sc({},n),{},Xd({},s,a))},{});return[{description:"Files",accept:e}]}return t}function UC(t){if($n(t))return Object.entries(t).reduce(function(e,n){var r=ri(n,2),i=r[0],s=r[1];return[].concat(_c(e),[i],_c(s))},[]).filter(function(e){return tp(e)||np(e)}).join(",")}function qC(t){return t instanceof DOMException&&(t.name==="AbortError"||t.code===t.ABORT_ERR)}function WC(t){return t instanceof DOMException&&(t.name==="SecurityError"||t.code===t.SECURITY_ERR)}function tp(t){return t==="audio/*"||t==="video/*"||t==="image/*"||t==="text/*"||t==="application/*"||/\w+\/[-+.\w]+/g.test(t)}function np(t){return/^.*\.[\w]+$/.test(t)}var VC=["children"],KC=["open"],YC=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],GC=["refKey","onChange","onClick"];function QC(t){return ZC(t)||JC(t)||rp(t)||XC()}function XC(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
87
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JC(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ZC(t){if(Array.isArray(t))return Ma(t)}function qs(t,e){return n1(t)||t1(t,e)||rp(t,e)||e1()}function e1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
88
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rp(t,e){if(t){if(typeof t=="string")return Ma(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ma(t,e)}}function Ma(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function t1(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],i=!0,s=!1,a,l;try{for(n=n.call(t);!(i=(a=n.next()).done)&&(r.push(a.value),!(e&&r.length===e));i=!0);}catch(c){s=!0,l=c}finally{try{!i&&n.return!=null&&n.return()}finally{if(s)throw l}}return r}}function n1(t){if(Array.isArray(t))return t}function Ac(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function We(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Ac(Object(n),!0).forEach(function(r){$a(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ac(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function $a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Vi(t,e){if(t==null)return{};var n=r1(t,e),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)r=s[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function r1(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,s;for(s=0;s<r.length;s++)i=r[s],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}var di=p.forwardRef(function(t,e){var n=t.children,r=Vi(t,VC),i=i1(r),s=i.open,a=Vi(i,KC);return p.useImperativeHandle(e,function(){return{open:s}},[s]),J.createElement(p.Fragment,null,n(We(We({},a),{},{open:s})))});di.displayName="Dropzone";var ip={disabled:!1,getFilesFromEvent:mC,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};di.defaultProps=ip;di.propTypes={children:Fe.func,accept:Fe.objectOf(Fe.arrayOf(Fe.string)),multiple:Fe.bool,preventDropOnDocument:Fe.bool,noClick:Fe.bool,noKeyboard:Fe.bool,noDrag:Fe.bool,noDragEventsBubbling:Fe.bool,minSize:Fe.number,maxSize:Fe.number,maxFiles:Fe.number,disabled:Fe.bool,getFilesFromEvent:Fe.func,onFileDialogCancel:Fe.func,onFileDialogOpen:Fe.func,useFsAccessApi:Fe.bool,autoFocus:Fe.bool,onDragEnter:Fe.func,onDragLeave:Fe.func,onDragOver:Fe.func,onDrop:Fe.func,onDropAccepted:Fe.func,onDropRejected:Fe.func,onError:Fe.func,validator:Fe.func};var Da={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function i1(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=We(We({},ip),t),n=e.accept,r=e.disabled,i=e.getFilesFromEvent,s=e.maxSize,a=e.minSize,l=e.multiple,c=e.maxFiles,d=e.onDragEnter,f=e.onDragLeave,u=e.onDragOver,m=e.onDrop,h=e.onDropAccepted,b=e.onDropRejected,C=e.onFileDialogCancel,y=e.onFileDialogOpen,v=e.useFsAccessApi,E=e.autoFocus,I=e.preventDropOnDocument,_=e.noClick,L=e.noKeyboard,w=e.noDrag,$=e.noDragEventsBubbling,H=e.onError,q=e.validator,F=p.useMemo(function(){return UC(n)},[n]),T=p.useMemo(function(){return HC(n)},[n]),A=p.useMemo(function(){return typeof y=="function"?y:Rc},[y]),B=p.useMemo(function(){return typeof C=="function"?C:Rc},[C]),D=p.useRef(null),M=p.useRef(null),R=p.useReducer(s1,Da),P=qs(R,2),j=P[0],U=P[1],Y=j.isFocused,Q=j.isFileDialogActive,Z=p.useRef(typeof window<"u"&&window.isSecureContext&&v&&zC()),ee=function(){!Z.current&&Q&&setTimeout(function(){if(M.current){var N=M.current.files;N.length||(U({type:"closeDialog"}),B())}},300)};p.useEffect(function(){return window.addEventListener("focus",ee,!1),function(){window.removeEventListener("focus",ee,!1)}},[M,Q,B,Z]);var se=p.useRef([]),ce=function(N){D.current&&D.current.contains(N.target)||(N.preventDefault(),se.current=[])};p.useEffect(function(){return I&&(document.addEventListener("dragover",Tc,!1),document.addEventListener("drop",ce,!1)),function(){I&&(document.removeEventListener("dragover",Tc),document.removeEventListener("drop",ce))}},[D,I]),p.useEffect(function(){return!r&&E&&D.current&&D.current.focus(),function(){}},[D,E,r]);var ue=p.useCallback(function(O){H?H(O):console.error(O)},[H]),je=p.useCallback(function(O){O.preventDefault(),O.persist(),V(O),se.current=[].concat(QC(se.current),[O.target]),ki(O)&&Promise.resolve(i(O)).then(function(N){if(!(Wi(O)&&!$)){var X=N.length,ie=X>0&&FC({files:N,accept:F,minSize:a,maxSize:s,multiple:l,maxFiles:c,validator:q}),xe=X>0&&!ie;U({isDragAccept:ie,isDragReject:xe,isDragActive:!0,type:"setDraggedFiles"}),d&&d(O)}}).catch(function(N){return ue(N)})},[i,d,ue,$,F,a,s,l,c,q]),Te=p.useCallback(function(O){O.preventDefault(),O.persist(),V(O);var N=ki(O);if(N&&O.dataTransfer)try{O.dataTransfer.dropEffect="copy"}catch{}return N&&u&&u(O),!1},[u,$]),Se=p.useCallback(function(O){O.preventDefault(),O.persist(),V(O);var N=se.current.filter(function(ie){return D.current&&D.current.contains(ie)}),X=N.indexOf(O.target);X!==-1&&N.splice(X,1),se.current=N,!(N.length>0)&&(U({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),ki(O)&&f&&f(O))},[D,f,$]),ve=p.useCallback(function(O,N){var X=[],ie=[];O.forEach(function(xe){var Ne=Zd(xe,F),Ge=qs(Ne,2),pt=Ge[0],et=Ge[1],Lt=ep(xe,a,s),ft=qs(Lt,2),rt=ft[0],kt=ft[1],Mt=q?q(xe):null;if(pt&&rt&&!Mt)X.push(xe);else{var St=[et,kt];Mt&&(St=St.concat(Mt)),ie.push({file:xe,errors:St.filter(function(ye){return ye})})}}),(!l&&X.length>1||l&&c>=1&&X.length>c)&&(X.forEach(function(xe){ie.push({file:xe,errors:[DC]})}),X.splice(0)),U({acceptedFiles:X,fileRejections:ie,isDragReject:ie.length>0,type:"setFiles"}),m&&m(X,ie,N),ie.length>0&&b&&b(ie,N),X.length>0&&h&&h(X,N)},[U,l,F,a,s,c,m,h,b,q]),ge=p.useCallback(function(O){O.preventDefault(),O.persist(),V(O),se.current=[],ki(O)&&Promise.resolve(i(O)).then(function(N){Wi(O)&&!$||ve(N,O)}).catch(function(N){return ue(N)}),U({type:"reset"})},[i,ve,ue,$]),S=p.useCallback(function(){if(Z.current){U({type:"openDialog"}),A();var O={multiple:l,types:T};window.showOpenFilePicker(O).then(function(N){return i(N)}).then(function(N){ve(N,null),U({type:"closeDialog"})}).catch(function(N){qC(N)?(B(N),U({type:"closeDialog"})):WC(N)?(Z.current=!1,M.current?(M.current.value=null,M.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(N)});return}M.current&&(U({type:"openDialog"}),A(),M.current.value=null,M.current.click())},[U,A,B,v,ve,ue,T,l]),W=p.useCallback(function(O){!D.current||!D.current.isEqualNode(O.target)||(O.key===" "||O.key==="Enter"||O.keyCode===32||O.keyCode===13)&&(O.preventDefault(),S())},[D,S]),K=p.useCallback(function(){U({type:"focus"})},[]),he=p.useCallback(function(){U({type:"blur"})},[]),ae=p.useCallback(function(){_||(LC()?setTimeout(S,0):S())},[_,S]),be=function(N){return r?null:N},Pe=function(N){return L?null:be(N)},oe=function(N){return w?null:be(N)},V=function(N){$&&N.stopPropagation()},te=p.useMemo(function(){return function(){var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},N=O.refKey,X=N===void 0?"ref":N,ie=O.role,xe=O.onKeyDown,Ne=O.onFocus,Ge=O.onBlur,pt=O.onClick,et=O.onDragEnter,Lt=O.onDragOver,ft=O.onDragLeave,rt=O.onDrop,kt=Vi(O,YC);return We(We($a({onKeyDown:Pe(Gt(xe,W)),onFocus:Pe(Gt(Ne,K)),onBlur:Pe(Gt(Ge,he)),onClick:be(Gt(pt,ae)),onDragEnter:oe(Gt(et,je)),onDragOver:oe(Gt(Lt,Te)),onDragLeave:oe(Gt(ft,Se)),onDrop:oe(Gt(rt,ge)),role:typeof ie=="string"&&ie!==""?ie:"presentation"},X,D),!r&&!L?{tabIndex:0}:{}),kt)}},[D,W,K,he,ae,je,Te,Se,ge,L,w,r]),k=p.useCallback(function(O){O.stopPropagation()},[]),z=p.useMemo(function(){return function(){var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},N=O.refKey,X=N===void 0?"ref":N,ie=O.onChange,xe=O.onClick,Ne=Vi(O,GC),Ge=$a({accept:F,multiple:l,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:be(Gt(ie,ge)),onClick:be(Gt(xe,k)),tabIndex:-1},X,M);return We(We({},Ge),Ne)}},[M,n,l,ge,r]);return We(We({},j),{},{isFocused:Y&&!r,getRootProps:te,getInputProps:z,rootRef:D,inputRef:M,open:be(S)})}function s1(t,e){switch(e.type){case"focus":return We(We({},t),{},{isFocused:!0});case"blur":return We(We({},t),{},{isFocused:!1});case"openDialog":return We(We({},Da),{},{isFileDialogActive:!0});case"closeDialog":return We(We({},t),{},{isFileDialogActive:!1});case"setDraggedFiles":return We(We({},t),{},{isDragActive:e.isDragActive,isDragAccept:e.isDragAccept,isDragReject:e.isDragReject});case"setFiles":return We(We({},t),{},{acceptedFiles:e.acceptedFiles,fileRejections:e.fileRejections,isDragReject:e.isDragReject});case"reset":return We({},Da);default:return t}}function Rc(){}const sp=5*1024*1024,Nr={"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"]},Oc=Object.values(Nr).flat();function a1(t){var r;if(t.size>sp)return{isValid:!1,error:`Dosya boyutu 5MB'dan büyük olamaz. Seçilen dosya: ${(t.size/1024/1024).toFixed(2)}MB`};const e=`.${(r=t.name.split(".").pop())==null?void 0:r.toLowerCase()}`;return Object.keys(Nr).includes(t.type)||Oc.includes(e)?{isValid:!0,error:""}:{isValid:!1,error:`Desteklenmeyen dosya tipi. Kabul edilen tipler: ${Oc.join(", ")}`}}function Ki(t){for(const e of t){const n=a1(e);if(!n.isValid)return n}return{isValid:!0,error:""}}function ap({onDrop:t}){const e=n=>{const r=Ki(n);if(!r.isValid){Ut({description:r.error,variant:"error"});return}t(n)};return o.jsx("div",{className:"flex items-center justify-center border rounded-md cursor-pointer bg-slate-100 dropzone border-slate-200 dz-clickable",children:o.jsx(di,{onDrop:e,accept:Object.keys(Nr).reduce((n,r)=>(n[r]=Nr[r],n),{}),maxSize:sp,children:({getRootProps:n,getInputProps:r})=>o.jsxs("div",{className:"w-full py-5 text-lg text-center dz-message needsclick",...n(),children:[o.jsx("input",{...r()}),o.jsx("div",{className:"mb-3",children:o.jsx(iC,{className:"block size-12 mx-auto text-slate-500 fill-slate-200"})}),o.jsxs("h5",{className:"mb-0 font-normal text-slate-500 text-15",children:["Yüklemek istediğiniz görseli buraya sürükleyin veya"," ",o.jsx("span",{className:"text-custom-500",children:"seçmek için tıklayın"})]})]})})})}ap.Button=({onDrop:t})=>{const e=Ee(),n=r=>{const i=Ki(r);if(!i.isValid){Ut({description:i.error,variant:"error"});return}t(r)};return o.jsx(di,{onDrop:n,accept:Object.keys(Nr).reduce((r,i)=>(r[i]=Nr[i],r),{}),children:({getRootProps:r,getInputProps:i})=>o.jsxs("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center text-center dz-message needsclick cursor-pointer",...r(),children:[o.jsx("input",{...i()}),o.jsx(aC,{style:{color:e.getColor(g.IconColor)},className:"size-5"})]})})};function op(t){const e=Number.parseFloat(globalThis.getComputedStyle(document.documentElement).fontSize)||16,n=e*3,r=e*6;return t.style.height="auto",`${Math.min(Math.max(t.scrollHeight,n),r)}px`}const Nc=[{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 lp({onSelect:t,isOpen:e,onClose:n}){const r=Ee(),[i,s]=p.useState(0),a=p.useRef(null),l=p.useRef(null);return p.useEffect(()=>{if(!e)return;const c=d=>{a.current&&!a.current.contains(d.target)&&n()};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[e,n]),p.useEffect(()=>{l.current&&(l.current.scrollTop=0)},[i]),o.jsx(gn,{children:e&&o.jsxs($e.div,{ref:a,onMouseDown:c=>c.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(g.Background),border:`1px solid ${r.getColor(g.Border)}`,borderRadius:r.getRadius(),boxShadow:`0 4px 20px ${r.getColor(g.ShadowColor)}`},children:[o.jsx("div",{className:"flex items-center gap-0.5 px-1.5 py-1.5 overflow-x-auto",style:{borderBottom:`1px solid ${r.getColor(g.DividerColor)}`},children:Nc.map((c,d)=>o.jsx("button",{type:"button",onClick:()=>s(d),className:"flex-shrink-0 w-8 h-8 flex items-center justify-center rounded-md text-base transition-colors",style:{backgroundColor:d===i?r.getColor(g.InputBackground):"transparent"},title:c.name,children:c.icon},c.name))}),o.jsx("div",{ref:l,className:"grid grid-cols-8 gap-0.5 p-1.5 overflow-y-auto",style:{maxHeight:"200px"},children:Nc[i].emojis.map((c,d)=>o.jsx("button",{type:"button",onClick:()=>{t(c),n()},className:"w-8 h-8 flex items-center justify-center rounded-md text-lg hover:scale-110 transition-transform",style:{backgroundColor:"transparent"},onMouseEnter:f=>{f.currentTarget.style.backgroundColor=r.getColor(g.InputBackground)},onMouseLeave:f=>{f.currentTarget.style.backgroundColor="transparent"},children:c},`${c}-${d}`))})]})})}const Ic=2;function o1({onNewMessage:t,client_id:e,is_uploadable:n,messages:r,onEvaluateChat:i,onNewChat:s,onSendMessage:a,isHistoryMode:l=!1,historyChat:c}){const d=p.useRef(null),f=ln(),u=Am(e),m=Ee(),h=Mr(),{setIsInputFocused:b,showActionButtons:C,setShowActionButtons:y}=G(),[v,E]=p.useState(""),[I,_]=p.useState("3rem"),[L,w]=p.useState(!1),[$,H]=p.useState([]),[q,F]=p.useState(0),[T,A]=p.useState(!1),[B,D]=p.useState(0),[M,R]=p.useState(null),[P,j]=p.useState(!1),[U,Y]=p.useState(null),Q=()=>{if(!l||!c||c.status!==Ve.Closed||!c.closed_at)return!1;const S=new Date(c.closed_at);return(new Date().getTime()-S.getTime())/(1e3*60*60)>2},Z=l&&(c==null?void 0:c.status)===Ve.Closed&&Q();p.useEffect(()=>{if(r.length>0){const S=r[r.length-1];S.id!==M&&(R(S.id),S.sender_type===pe.User&&(F(0),A(!1)))}},[r,M]),p.useEffect(()=>{let S;return T&&B>0&&(S=window.setTimeout(()=>{D(W=>W<=1?(A(!1),F(0),0):W-1)},1e3)),()=>clearTimeout(S)},[T,B]),p.useEffect(()=>{if(!U)return;const S=window.setTimeout(()=>Y(null),Ya);return()=>window.clearTimeout(S)},[U]),p.useEffect(()=>{const S=d.current;if(S){const W=()=>b(!0),K=()=>b(!1);return S.addEventListener("focus",W),S.addEventListener("blur",K),()=>{S.removeEventListener("focus",W),S.removeEventListener("blur",K)}}},[b]),p.useEffect(()=>{const S=()=>{y(!0)},W=()=>{y(!1)};return f==null||f.on(de.ChatUserShowButton,S),f==null||f.on(de.MessageUserCreate,W),()=>{f==null||f.off(de.ChatUserShowButton,S),f==null||f.off(de.MessageUserCreate,W)}},[f,y]),p.useEffect(()=>{r.length>0&&r[r.length-1].activity_type==="admin_join"&&y(!1)},[r,y]),Ui("lc:rate-limit",S=>{const W=S.detail&&S.detail.seconds||3;A(!0),D(W),F(0)}),Ui("paste",S=>{const W=S.clipboardData.items,K=[];for(const he of W){const ae=he.getAsFile();ae&&K.push(ae)}if(K.length>0&&!n){Y(h(_e.FileUploadDisabled));return}if(K.length>0){const he=Ki(K);if(!he.isValid){Y(he.error);return}H([...$,...K])}});const ee=async()=>{const S=v.trim(),W=!!n&&$.length>0,K=S.length>0&&S.length<Ic;if(!S&&!W||K)return;if(f!=null&&f.chatEnded){Y("Bu sohbet sona ermiştir. Lütfen yeni bir sohbet başlatın.");return}if(q>5&&!T){A(!0),D(3);return}if(T||L)return;Y(null);const he=v,ae=[...$];E(""),H([]),d.current&&(d.current.style.height="3rem",_("3rem")),w(!0);let be;if(n&&ae.length>0){const[Pe,oe]=await u.mutateAsync(ae);if(!gt(oe)){Qh(Pe,oe),w(!1),E(he),H(ae);return}if(Rm(Pe)&&(be=Pe.file_urls.filter(V=>typeof V=="string"&&V.trim().length>0)),!(be!=null&&be.length)){Y("Dosyalar yüklenemedi. Lütfen tekrar deneyin."),w(!1),E(he),H(ae);return}}if(a){a(he,be),w(!1);return}f==null||f.emit(Oe.MessageCreate,{content:he,files:be},Pe=>{t(Pe),w(!1),F(oe=>oe+1),y(!1)})},se=v.trim(),ce=(f==null?void 0:f.chatEnded)===!0,ue=(se.length>=Ic||$.length>0)&&!L&&!T&&!ce,je=S=>{f==null||f.emit(Oe.MessageTyping,{content:S})},Te=()=>{f==null||f.emit(Oe.ChatClose,{}),y(!1),i==null||i()},Se=()=>{f==null||f.emit(Oe.ChatClose,{}),y(!1),s==null||s()},ve=p.useCallback(S=>{const W=d.current;if(W){const K=W.selectionStart,he=W.selectionEnd,ae=v.substring(0,K)+S+v.substring(he);ae.length<=2e3&&(E(ae),je(ae),setTimeout(()=>{W.selectionStart=W.selectionEnd=K+S.length,W.focus()},0))}else{const K=v+S;K.length<=2e3&&(E(K),je(K))}},[v]),ge=l&&(c==null?void 0:c.status)===Ve.Closed;return Z?null:o.jsxs(o.Fragment,{children:[ge&&o.jsxs("div",{className:"px-5 flex flex-col gap-2",children:[o.jsxs("div",{className:"p-3 rounded-lg flex items-center gap-2",style:{backgroundColor:m.getColor(g.InputBackground),borderColor:m.getColor(g.InputBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:m.getRadius()},children:[o.jsx(fe.Lock,{className:"w-5 h-5 flex-shrink-0",style:{color:m.getColor(g.FooterText)}}),o.jsx("span",{className:"text-sm",style:{color:m.getColor(g.FooterText)},children:"Bu sohbet kapatılmıştır."})]}),o.jsxs(Vt,{size:"lg",onClick:()=>{s==null||s()},className:"rounded-lg gap-2 transition-all",children:[o.jsx(fe.Plus,{className:"size-4"}),o.jsx("span",{children:"Yeni Sohbet Başlat"})]}),o.jsx(Er,{variant:"block"})]}),T&&o.jsxs($e.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:m.getColor(g.ErrorBackground),borderColor:m.getColor(g.ErrorBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:m.getRadius()},children:[o.jsx(fe.XCircle,{className:"size-4 mr-2",style:{color:m.getColor(g.ErrorText)}}),o.jsx("span",{className:"text-sm font-medium",style:{color:m.getColor(g.ErrorText)},children:h(_e.RateLimitMessage).replace("{seconds}",B.toString())})]}),C&&o.jsxs($e.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"mb-2 mx-3 flex gap-2",children:[o.jsxs(Vt,{className:"flex-1 flex items-center justify-center gap-2",size:"md",variant:"primary",kind:"outline",onClick:Te,style:{borderColor:m.getColor(g.ButtonBackground),color:m.getColor(g.ButtonBackground),backgroundColor:"transparent"},children:[o.jsx(fe.Star,{className:"size-4"}),o.jsx("span",{children:"Değerlendir"})]}),o.jsxs(Vt,{size:"md",className:"flex-1 flex items-center justify-center gap-2",onClick:Se,children:[o.jsx(fe.Plus,{className:"size-4"}),o.jsx("span",{children:"Yeni Sohbet"})]})]}),(!l||l&&(c==null?void 0:c.status)!==Ve.Closed&&(c==null?void 0:c.status)!==Ve.Deleted)&&o.jsxs("form",{className:"flex flex-col relative",onSubmit:S=>{S.preventDefault(),ee()},children:[U?o.jsxs("div",{role:"alert",className:"mx-3 mb-2 flex items-start gap-2 rounded-lg border px-3 py-2 text-sm",style:{borderColor:m.getColor(g.ErrorBorder),backgroundColor:m.getColor(g.ErrorBackground),color:m.getColor(g.ErrorText)},children:[o.jsx("span",{className:"min-w-0 flex-1 leading-snug",children:U}),o.jsx("button",{type:"button",onClick:()=>Y(null),className:"shrink-0 rounded-md p-0.5 opacity-70 transition-opacity hover:opacity-100 focus:outline-hidden focus-visible:ring-2",style:{color:m.getColor(g.ErrorText)},"aria-label":"Kapat",children:o.jsx(fe.X,{className:"size-4"})})]}):null,o.jsx("div",{className:"mx-4 border-t",style:{borderColor:m.getColor(g.DividerColor)}}),n&&$&&$.length>0&&o.jsx("div",{className:"px-3 pt-2 overflow-x-auto",children:o.jsx(zd,{files:$,onDelete:S=>{H($.filter((W,K)=>K!==S))}})}),o.jsxs("div",{className:"flex gap-2 px-3 py-1 w-full",children:[o.jsxs("div",{className:"flex-1 min-w-0 relative",children:[o.jsx(vs,{id:"message",inputRef:d,className:"grow",noMargin:!0,borderless:!0,rows:1,autoComplete:"off",disabled:T||ce,style:{height:I,maxHeight:"6rem",opacity:T||ce?.5:1,cursor:T||ce?"not-allowed":"text",boxShadow:"none"},placeholder:ce?"Sohbet sona erdi":T?h(_e.RateLimitMessage).replace("{seconds}",B.toString()):h(_e.MessagePlaceholder),value:v,maxLength:2e3,onChange:S=>{if(T||ce)return;const W=S.currentTarget.value,K=S.currentTarget;if(U&&Y(null),W.length<=2e3&&(E(W),je(W)),W.length===0){K.style.height="3rem",_("3rem");return}const he=op(K);K.style.height=he,_(he)},onKeyDown:S=>{if(T||ce){S.preventDefault();return}S.key==="Enter"&&!S.shiftKey&&(S.preventDefault(),ee())}}),v.length>=500&&o.jsx("div",{className:"absolute bottom-2 right-3 text-xs pointer-events-none",style:{color:v.length>=2e3?m.getColor(g.ErrorText):m.getColor(g.FooterText),fontWeight:v.length>=2e3?"600":"normal"},children:2e3-v.length})]}),o.jsx("div",{className:"flex items-center gap-1 flex-shrink-0 pb-0.5",children:o.jsx($e.div,{whileTap:{scale:.9},children:o.jsx(Vt,{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:!ue,style:{opacity:1,color:ue?m.getColor(g.ButtonBackground):m.getColor(g.FooterText)},children:L?o.jsx(fe.Spin,{className:"size-4 animate-spin"}):T?o.jsx("span",{className:"text-[10px] font-bold",children:B}):o.jsx(fe.PaperAirplane,{className:"size-5"})})})})]}),o.jsx(lp,{isOpen:P,onClose:()=>j(!1),onSelect:ve}),o.jsxs("div",{className:"px-3 pb-1.5 flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("button",{type:"button",onClick:()=>j(!P),className:"p-1.5 rounded-md transition-colors",style:{color:m.getColor(g.IconColor)},children:o.jsx(fe.Emoji,{className:"size-5"})}),n&&o.jsx(ap.Button,{onDrop:S=>{if(S.length){const W=Ki(S);if(!W.isValid){Y(W.error);return}H([...$,...S])}}})]}),o.jsx(Er,{variant:"inline"})]})]})]})}const Mc=[["#6366f1","#8b5cf6"],["#3b82f6","#06b6d4"],["#10b981","#34d399"],["#f59e0b","#f97316"],["#ef4444","#f472b6"],["#8b5cf6","#ec4899"],["#14b8a6","#22d3ee"],["#f43f5e","#fb923c"]],dr=32;function l1({participant:t,className:e}){const n=p.useMemo(()=>{const r=t.name.charCodeAt(0)||0,i=Mc[r%Mc.length];return`linear-gradient(135deg, ${i[0]}, ${i[1]})`},[t.name]);return o.jsx("span",{title:t.name,className:Ie("block rounded-full border border-white/25 shadow-sm overflow-hidden",e),children:t.avatar?o.jsx("img",{className:"rounded-full object-cover",style:{width:dr,height:dr},src:t.avatar,alt:"",title:t.name}):o.jsx("div",{className:"flex items-center justify-center font-semibold text-white text-xs",style:{width:dr,height:dr,background:n},children:t.name.charAt(0).toUpperCase()})})}const Ws=3;function $c({participants:t,textColor:e,className:n}){const r=p.useMemo(()=>t.map(c=>c.name).join(", "),[t]);if(t.length===0)return null;const i=t.length>Ws,s=i?t.slice(0,Ws-1):t,a=i?t.length-(Ws-1):0,l=t[0];return o.jsxs("div",{className:Ie("group/participant relative inline-flex max-w-full",n),children:[o.jsxs($e.div,{initial:{opacity:.8},animate:{opacity:1},className:"flex gap-2 items-center min-w-0 cursor-default",children:[o.jsx("div",{className:"flex items-center flex-shrink-0",children:o.jsxs("div",{className:"flex flex-row items-center -space-x-2",children:[s.map((c,d)=>o.jsx("div",{className:"relative",style:{zIndex:s.length-d},title:c.name,children:o.jsx(l1,{participant:c})},`${nn(c)}-${d}`)),i?o.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:dr,height:dr,zIndex:0},children:["+",a]}):null]})}),o.jsx("div",{className:"flex flex-col min-w-0",children:o.jsx("span",{className:"line-clamp-1 font-medium text-neutral-500",style:e?{color:e}:void 0,title:l.name,children:l.name})})]}),o.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 c1({chat:t,isTyping:e,shortcutMessages:n,messages:r,onNewMessage:i,onChatClose:s,onEvaluateChat:a,onNewChat:l,onSendMessage:c,isHistoryMode:d=!1,spamWarningMessage:f,onDismissSpamWarning:u}){const{widget:m,setOpen:h,open:b,isHaveChat:C,isInputFocused:y}=G(),v=G(B=>B.historyChat),E=Ee(),I=Br(),_=ws(),L=ln(),w=ar(),$=p.useRef(new Set),H=p.useRef(!1),q=()=>{h(!1)},F=p.useCallback(()=>{if(!L||!b||!C||!Array.isArray(r))return;const B=r.filter(D=>D.sender_type===pe.User&&!$.current.has(D.id)).map(D=>D.id);B.length!==0&&L.emit(Oe.MessageRead,{message_ids:B},D=>{if(D&&D.success===!0)for(const M of B)$.current.add(M)})},[L,r,b,C]);p.useEffect(()=>{b&&(H.current=!0),b&&C&&(y||H.current)&&(F(),H.current=!1)},[b,C,y,F]);const T=()=>{var M,R,P,j,U,Y;const B=(R=(M=m==null?void 0:m.appearance)==null?void 0:M.design)==null?void 0:R.greeting_header;return B||((Y=(U=(j=(P=m==null?void 0:m.appearance)==null?void 0:P.head)==null?void 0:j.elements)==null?void 0:U.find(Q=>Q.type==="title"))==null?void 0:Y.content)||"Müşteri Hizmetleri"},A=()=>{var R,P,j,U,Y,Q,Z,ee;if(d&&v)return"Geçmiş sohbet";const B=((P=(R=t==null?void 0:t.participants)==null?void 0:R[0])==null?void 0:P.name)||(t==null?void 0:t.agent_name);if(B)return B;const D=(U=(j=m==null?void 0:m.appearance)==null?void 0:j.design)==null?void 0:U.greeting_header;return D||((ee=(Z=(Q=(Y=m==null?void 0:m.appearance)==null?void 0:Y.head)==null?void 0:Q.elements)==null?void 0:Z.find(se=>se.type==="text"))==null?void 0:ee.content)||"Bizimle Sohbet Edin"};return o.jsxs(o.Fragment,{children:[o.jsxs("header",{className:"px-4 py-3 flex items-center justify-between flex-shrink-0 overflow-visible min-h-[52px]",style:{backgroundColor:E.getColor(g.HeaderBackground),color:E.getColor(g.HeaderText),borderColor:E.getColor(g.HeaderBorder),...I?{}:{borderTopLeftRadius:E.getRadius(),borderTopRightRadius:E.getRadius()}},children:[o.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[d&&o.jsx("button",{type:"button",onClick:()=>{G.getState().setHistoryChat(null),G.getState().setHistoryMessages(null),G.getState().setShowHistoryOnRegistration(!0),w.push("registration")},className:"flex-shrink-0 p-1 hover:opacity-80 transition-opacity",children:o.jsx(fe.ArrowLeft,{className:"w-5 h-5"})}),(()=>{if(d&&v){const B=_d(v);if(B.length>1)return o.jsx($c,{participants:B,textColor:E.getColor(g.HeaderText)});if(B.length===1)return o.jsx(Ko,{name:B[0].name,avatar:B[0].avatar,textColor:E.getColor(g.HeaderText)})}if(!d&&t){const B=t.participants&&t.participants.length>0?t.participants:vo(t.agent_name,t.agent_avatar);if(B.length>1)return o.jsx($c,{participants:B,textColor:E.getColor(g.HeaderText)});if(B.length===1)return o.jsx(Ko,{name:B[0].name,avatar:B[0].avatar,textColor:E.getColor(g.HeaderText)})}return o.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[o.jsx(Qc,{color:E.getColor(g.HeaderText),borderColor:E.getColor(g.HeaderBorder),backgroundColor:E.getColor(g.MessageAdminBackground)}),o.jsx("div",{className:"min-w-0 flex-1",children:d?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"truncate font-medium",children:T()}),o.jsx("div",{className:"truncate text-sm opacity-90",children:A()})]}):o.jsx("div",{className:"truncate font-medium",children:A()})})]})})()]}),o.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(!d||d&&(t==null?void 0:t.status)!==Ve.Closed)&&o.jsx(Hw,{onChatClose:s}),_&&o.jsx("button",{type:"button",onClick:q,className:"p-1 hover:opacity-80 transition-opacity",children:o.jsx(fe.X,{className:"w-5 h-5 cursor-pointer"})})]})]}),o.jsx(Ud,{messages:r,isTyping:e||n.length>0,chat:t,onLivechatSendSuggested:c?B=>c(B):void 0}),o.jsx(gn,{children:f&&o.jsxs($e.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:E.getColor(g.ErrorBackground),borderColor:E.getColor(g.ErrorBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:E.getRadius()},children:[o.jsx(fe.XCircle,{className:"size-4 flex-shrink-0 mt-0.5",style:{color:E.getColor(g.ErrorText)}}),o.jsx("span",{className:"text-sm",style:{color:E.getColor(g.ErrorText)},children:f}),o.jsx("button",{type:"button",className:"ml-auto flex-shrink-0",onClick:u,style:{color:E.getColor(g.ErrorText)},children:o.jsx(fe.X,{className:"size-4"})})]})}),o.jsx(o1,{client_id:(m==null?void 0:m.client_id)||"",is_uploadable:t.is_customer_uploadable,messages:r,onNewMessage:B=>{i(B)},onEvaluateChat:a,onNewChat:l,onSendMessage:c,isHistoryMode:d,historyChat:d?G.getState().historyChat:void 0})]})}function u1({rating:t,onChange:e}){const n=Ee();return o.jsx("div",{className:"flex items-center justify-center gap-0.5 my-2",children:[1,2,3,4,5].map(r=>{const i=r<=t,s=!i&&r-.5<=t;return o.jsxs($e.div,{className:"relative w-8 h-8 cursor-pointer",whileHover:{scale:1.15},whileTap:{scale:.95},transition:{duration:.15},children:[o.jsx("svg",{className:"w-8 h-8",style:{color:n.getColor(g.StarInactiveColor),fill:n.getColor(g.StarInactiveColor)},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1",children:o.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&&o.jsx("div",{className:"absolute top-0 left-0 w-4 h-8 overflow-hidden",children:o.jsx("svg",{className:"w-8 h-8",style:{color:n.getColor(g.StarActiveColor),fill:n.getColor(g.StarActiveColor)},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1",children:o.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&&o.jsx("svg",{className:"w-8 h-8 absolute top-0 left-0",style:{color:n.getColor(g.StarActiveColor),fill:n.getColor(g.StarActiveColor)},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1",children:o.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"})}),o.jsxs("div",{className:"absolute inset-0 flex",children:[o.jsx("button",{type:"button",onClick:()=>e(r-.5),className:"w-1/2 h-full cursor-pointer focus:outline-none","aria-label":`${r-.5} stars`}),o.jsx("button",{type:"button",onClick:()=>e(r),className:"w-1/2 h-full cursor-pointer focus:outline-none","aria-label":`${r} stars`})]})]},r)})})}function d1({onOk:t}){const e=Ee(),n=Mr(),r=ws(),[i,s]=p.useState(0),[a,l]=p.useState(!1),[c,d]=p.useState(10),f=Tm(),[u,m]=p.useState(!1);p.useEffect(()=>{if(a){const y=setInterval(()=>{d(v=>v<=1?(clearInterval(y),t(!0),0):v-1)},1e3);return()=>clearInterval(y)}},[a]);const h=ro({comment:zi()}),b=vd({init:{comment:""},schema:h,action:async y=>{const[v,E]=await f.mutateAsync({rating:i,comment:y.comment});if(gt(E)){l(!0);return}Tr(v,{form:b})}}),C=()=>{t(!0)};return o.jsxs($e.div,{className:"flex flex-col h-full",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:[o.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:e.getColor(g.HeaderBorder),color:e.getColor(g.HeaderText)},children:[o.jsx("div",{className:"font-medium !text-sm",children:n(a?_e.RatingHeaderThanks:_e.RatingHeaderEvaluate)}),r&&o.jsx("button",{type:"button",onClick:()=>t(!1),className:"p-1.5 rounded-md hover:opacity-70 transition-opacity",style:{color:e.getColor(g.HeaderText)},children:o.jsx(fe.X,{className:"size-4"})})]}),o.jsx("div",{className:"flex-1 p-4 overflow-y-auto flex flex-col",children:a?o.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center",children:[o.jsx("div",{className:"mb-3",style:{color:e.getColor(g.SuccessText)},children:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-12 w-12",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),o.jsx("h2",{className:"text-lg font-semibold mb-1.5",style:{color:e.getColor(g.HeaderText)},children:n(_e.RatingThankYouTitle)}),o.jsx("p",{className:"mb-6 text-sm",style:{color:e.getColor(g.FooterText)},children:n(_e.RatingThankYouDescription)}),o.jsx("p",{className:"mb-3 text-xs",style:{color:e.getColor(g.FooterText)},children:n(_e.RatingCountdown).replace("{seconds}",c.toString())}),o.jsx(Vt,{onClick:C,size:"md",className:"w-full max-w-xs",children:n(_e.RatingNewConversation)})]}):o.jsxs("div",{className:"flex flex-col",children:[o.jsx("div",{className:"text-center mb-4",children:o.jsx("p",{className:"text-sm",style:{color:e.getColor(g.FooterText)},children:n(_e.RatingDescription)})}),o.jsxs("div",{className:"mb-4",children:[o.jsx("h3",{className:"text-center font-medium mb-1.5 text-base",style:{color:e.getColor(g.RatingRateConversationText)},children:n(_e.RatingRateConversation)}),o.jsx(u1,{rating:i,onChange:y=>{s(y),y>=1&&m(!1)}}),i>0&&o.jsx("p",{className:"text-center text-xs mt-1",style:{color:e.getColor(g.FooterText)},children:n(_e.RatingYourScore).replace("{score}",Number.isInteger(i)?i.toString():i.toFixed(1))}),i>0&&i<1||u?o.jsx("p",{className:"text-center text-xs mt-1",style:{color:e.getColor(g.ErrorText)},children:n(_e.RatingMinimumError)}):null]}),o.jsxs("form",{onSubmit:b.handleSubmit,className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx("label",{htmlFor:"comment",className:"block text-xs font-medium mb-1",style:{color:e.getColor(g.InputText)},children:n(_e.RatingComment)}),o.jsx(vs,{id:"comment",onChange:b.handleChange,onBlur:b.handleBlur,value:b.values.comment,placeholder:n(_e.RatingCommentPlaceholder),className:"rounded-lg",error:b.errors.comment})]}),o.jsxs("div",{className:"flex flex-col gap-2 pt-1",children:[o.jsx(Vt,{type:"submit",size:"lg",onClick:y=>{i<1&&(y.preventDefault(),y.stopPropagation(),m(!0))},className:"w-full",children:n(_e.RatingSubmit)}),o.jsx(Vt,{onClick:C,size:"lg",variant:"secondary",kind:"subtle",className:"w-full",bgKey:g.GreeterBackground,textKey:g.GreeterText,children:n(_e.RatingNewConversation)})]})]})]})}),o.jsx(Er,{variant:"block"})]})}function p1({onSendMessage:t,disabled:e,loading:n=!1}){const r=p.useRef(null),i=Ee(),s=Mr(),{setIsInputFocused:a}=G(),[l,c]=p.useState(""),[d,f]=p.useState("3rem"),[u,m]=p.useState(!1),h=p.useRef(n);p.useEffect(()=>{h.current&&!n&&!e&&setTimeout(()=>{var y;(y=r.current)==null||y.focus()},100),h.current=n},[n,e]),p.useEffect(()=>{e&&m(!1)},[e]);const b=()=>{if(!l.trim()||e)return;const y=l;c(""),r.current&&(r.current.style.height="3rem",f("3rem")),t(y)},C=p.useCallback(y=>{if(e)return;const v=r.current;if(v){const E=v.selectionStart,I=v.selectionEnd,_=l.substring(0,E)+y+l.substring(I);_.length<=2e3&&(c(_),setTimeout(()=>{v.selectionStart=v.selectionEnd=E+y.length,v.focus()},0))}else{const E=l+y;E.length<=2e3&&c(E)}},[l,e]);return o.jsxs("form",{className:"flex flex-col relative",onSubmit:y=>{y.preventDefault(),b()},children:[o.jsx("div",{className:"mx-4 border-t",style:{borderColor:i.getColor(g.DividerColor)}}),o.jsxs("div",{className:"flex gap-2 px-3 py-1 w-full",children:[o.jsxs("div",{className:"flex-1 min-w-0 relative",children:[o.jsx(vs,{id:"ai-message",inputRef:r,className:"grow",noMargin:!0,borderless:!0,rows:1,autoComplete:"off",disabled:e,style:{height:d,maxHeight:"6rem",opacity:e?.5:1,cursor:e?"not-allowed":"text",boxShadow:"none"},placeholder:s(_e.MessagePlaceholder),value:l,maxLength:2e3,onFocus:()=>a(!0),onBlur:()=>a(!1),onChange:y=>{if(e)return;const v=y.target.value,E=y.currentTarget;if(v.length<=2e3&&c(v),v.length===0){E.style.height="3rem",f("3rem");return}const I=op(E);E.style.height=I,f(I)},onKeyDown:y=>{if(e){y.preventDefault();return}y.key==="Enter"&&!y.shiftKey&&(y.preventDefault(),b())}}),l.length>=500&&o.jsx("div",{className:"absolute bottom-2 right-3 text-xs pointer-events-none",style:{color:l.length>=2e3?i.getColor(g.ErrorText):i.getColor(g.FooterText),fontWeight:l.length>=2e3?"600":"normal"},children:2e3-l.length})]}),o.jsx("div",{className:"flex items-center gap-1 flex-shrink-0 pb-0.5",children:o.jsx($e.div,{whileTap:{scale:.9},children:o.jsx(Vt,{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:e||!l.trim(),style:{opacity:1,backgroundColor:"transparent",color:l.trim()?i.getColor(g.ButtonBackground):i.getColor(g.FooterText)},children:n?o.jsx(fe.Spin,{className:"size-4 animate-spin"}):o.jsx(fe.PaperAirplane,{className:"size-5"})})})})]}),o.jsx(lp,{isOpen:u,onClose:()=>m(!1),onSelect:C}),o.jsxs("div",{className:"px-3 pb-1.5 flex items-center justify-between",children:[o.jsx("div",{className:"flex items-center gap-1",children:o.jsx("button",{type:"button",disabled:e,onClick:()=>!e&&m(!u),className:"p-1.5 rounded-md transition-colors disabled:opacity-50 disabled:cursor-not-allowed",style:{color:i.getColor(g.IconColor)},children:o.jsx(fe.Emoji,{className:"size-5"})})}),o.jsx(Er,{variant:"inline"})]})]})}const Vs=[dt.Light,dt.Dark,dt.System];function f1(t){switch(t){case dt.Light:return fe.Sun;case dt.Dark:return fe.Moon;case dt.System:return fe.Monitor;default:return fe.Monitor}}function h1({onChatClose:t}){const[e,n]=p.useState(!1),[r,i]=p.useState(!1),[s,a]=p.useState(()=>Bd()),l=p.useRef(null),c=p.useRef(null),d=Ee(),f=Mr(),{mode:u,setMode:m}=d,h=()=>t(),b=()=>{const v=Vs.indexOf(u),E=Vs[(v+1)%Vs.length];m(E)},C=()=>{const v=!s;Ld(v),a(v)};p.useEffect(()=>{if(!r)return;const v=E=>{var I,_;(I=c.current)!=null&&I.contains(E.target)||(_=l.current)!=null&&_.contains(E.target)||i(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[r]);const y=r&&o.jsxs($e.div,{ref:c,onMouseDown:v=>v.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:d.getColor(g.Background),borderColor:d.getColor(g.Border),borderRadius:d.getRadius(),boxShadow:`0 4px 12px ${d.getColor(g.ShadowColor)}`},children:[o.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:d.getColor(g.ErrorText)},onClick:()=>{i(!1),n(!0)},children:[o.jsx(fe.XCircle,{className:"size-4 flex-shrink-0"}),f(_e.ChatEndConversation)]}),o.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:d.getColor(g.InputText)},onClick:C,children:[s?o.jsx(fe.VolumeX,{className:"size-4 flex-shrink-0"}):o.jsx(fe.Volume2,{className:"size-4 flex-shrink-0"}),f(s?_e.NotificationSoundOn:_e.NotificationSoundOff)]}),o.jsx("div",{className:"my-1 h-px",style:{backgroundColor:d.getColor(g.DividerColor)}}),o.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:d.getColor(g.InputText)},onClick:b,children:[(()=>{const v=f1(u);return o.jsx(v,{className:"size-4 flex-shrink-0"})})(),u===dt.Light?"Açık tema":u===dt.Dark?"Koyu tema":"Sistem"]})]});return o.jsxs(o.Fragment,{children:[o.jsx(gn,{children:e&&o.jsx($e.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:d.getColor(g.ModalOverlayColor)},children:o.jsxs($e.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:d.getColor(g.Background),borderRadius:d.getRadius()},children:[o.jsx("div",{className:"text-base font-semibold mb-2",style:{color:d.getColor(g.ChatCloseConfirmText)},children:f(_e.ChatCloseConfirm)}),o.jsx("div",{className:"text-sm mb-4",style:{color:d.getColor(g.FooterText)},children:f(_e.ChatCloseWarning)}),o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-lg transition-opacity hover:opacity-90",style:{backgroundColor:d.getColor(g.GreeterBackground),color:d.getColor(g.GreeterText),borderRadius:d.getRadius()},onClick:()=>n(!1),children:f(_e.CancelAction)}),o.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-lg transition-opacity hover:opacity-90",style:{backgroundColor:d.getColor(g.ErrorBackground),color:d.getColor(g.ErrorText),borderRadius:d.getRadius()},onClick:h,children:f(_e.CloseAction)})]})]})})}),o.jsxs("div",{className:"relative flex-shrink-0",children:[o.jsx("button",{ref:l,type:"button",onClick:()=>i(v=>!v),className:"flex items-center justify-center p-1.5 rounded-md hover:opacity-80 transition-opacity",style:{backgroundColor:"transparent",color:d.getColor(g.HeaderText)},title:f(_e.ChatSettings),"aria-expanded":r,children:o.jsx(fe.Menu,{className:"size-5"})}),o.jsx(gn,{children:y})]})]})}async function m1(t,e,n,r){let i=Math.max(0,Math.min(e,t.length));n(t.slice(0,i));const s=t.length-i;if(s<=0)return;const c=Math.min(14e3,Math.max(900,s*18)),d=16,f=Math.max(1,Math.ceil(s*d/c));await new Promise((u,m)=>{const h=window.setInterval(()=>{if(r.aborted){window.clearInterval(h),m(new DOMException("aborted","AbortError"));return}i=Math.min(t.length,i+f),n(t.slice(0,i)),i>=t.length&&(window.clearInterval(h),u())},d)})}function g1({onOperatorConnected:t,onChatClose:e,onRemoteChatEnded:n}){var he,ae,be,Pe;const{widget:r,setOpen:i,aiAgent:s,aiAgentMessages:a,addAIAgentMessage:l,setAIAgentMessages:c,aiAgentSessionId:d,setAIAgentSessionId:f,humanNeedRequested:u,setHumanNeedRequested:m,setIsAIAgentMode:h,setAIAgentRequestInFlight:b,pendingInitialAgentMessage:C,setPendingInitialAgentMessage:y}=G(),v=Ee(),E=Br(),I=ws(),_=ln(),L=ar(),[w,$]=p.useState(!1),[H,q]=p.useState(!1),[F,T]=p.useState(!1),[A,B]=p.useState(!1),[D,M]=p.useState(""),[R,P]=p.useState(null),[j,U]=p.useState(!1),[Y,Q]=p.useState(0),[Z,ee]=p.useState(null),se=p.useRef(""),ce=p.useRef(null),ue=()=>{i(!1)},je=()=>{m(!1),e()},Te=(((be=(ae=(he=r==null?void 0:r.appearance)==null?void 0:he.body)==null?void 0:ae.inputs)==null?void 0:be.length)||0)>0,Se=p.useRef(!1),ve=p.useRef(!1),ge=p.useRef(!1);p.useEffect(()=>{if(!s||Se.current)return;if(a.length>0){Se.current=!0;return}if(!_||!_.connected){const te=setInterval(()=>{_&&_.connected&&(clearInterval(te),oe())},100),k=setTimeout(()=>{clearInterval(te),Se.current||V()},3e3);return()=>{clearInterval(te),clearTimeout(k)}}oe();function oe(){Se.current||!_||(Se.current=!0,_.emit(Oe.MessageList,{},te=>{Array.isArray(te)&&te.length>0?c(te):V()}))}function V(){if(!s)return;const te={id:Ei(),content:`Merhaba! Ben ${s.name}. Size nasıl yardımcı olabilirim?`,created_at:new Date,files:[],sender_type:pe.User};l(te)}},[_,s,a.length,c,l]),p.useEffect(()=>{if(w)if(D||R)q(!0);else{const oe=setTimeout(()=>q(!0),1e3);return()=>clearTimeout(oe)}else q(!1)},[w,D,R]),p.useEffect(()=>{if(Y>0){const oe=requestAnimationFrame(()=>Q(0));return()=>cancelAnimationFrame(oe)}},[Y]),p.useEffect(()=>{if(!_)return;const oe=({token:z})=>{P(null),M(O=>{const N=O+z;return se.current=N,N})},V=z=>{z.message?P(z.message):z.status&&P(z.status)},te=z=>{z.repeat_count===3&&ee(z.message)},k=()=>{e()};return _.on(de.AgentMessageChunk,oe),_.on(de.AgentMessageStreamStatus,V),_.on(de.AgentSpamWarning,te),_.on(de.AgentSpamBanned,k),()=>{_.off(de.AgentMessageChunk,oe),_.off(de.AgentMessageStreamStatus,V),_.off(de.AgentSpamWarning,te),_.off(de.AgentSpamBanned,k)}},[_,e]),p.useEffect(()=>{if(!_)return;const oe=()=>{ge.current||(ge.current=!0,_.markChatEnded(),n())};return _.on(de.ChatUserClose,oe),()=>{_.off(de.ChatUserClose,oe)}},[_,n]),p.useEffect(()=>{if(!_)return;const oe=V=>{const te=String(V._id??"");if(!te)return;const k=typeof V.content=="string"?V.content.trim():"";P(z=>z&&k&&z.trim()===k?null:z),c(z=>{if(z.some(N=>N.id===te))return z;const O={id:te,content:V.content,created_at:V.created_at?new Date(V.created_at):new Date,files:V.files??[],sender_type:V.sender_type,answers:V.answers,reply_id:V.reply_id,buttons:V.buttons,post_followup:V.post_followup};return[...z,O]})};return _.on(de.MessageAgentCreate,oe),()=>{_.off(de.MessageAgentCreate,oe)}},[_,c]);const S=p.useCallback((oe,V)=>{var O;if(!r||!s||!_||ge.current||u||F||ve.current)return;(O=ce.current)==null||O.abort(),ve.current=!0,b(!0);const te=`temp-${Date.now()}`,k={id:te,content:oe,created_at:new Date,files:[],sender_type:pe.Customer};l(k),M(""),se.current="",P(null),U(!0),$(!0),T(!0);const z=d||mn(r.link_id);_.emit(Oe.AgentMessageCreate,{question:oe,agent_id:s.id,session_id:z,...V===!0?{skip_to_generation:!0}:{}},N=>{var Mt,St;if(!N||typeof N=="object"&&"isError"in N&&N.isError===!0){ve.current=!1,b(!1),(Mt=ce.current)==null||Mt.abort(),U(!1),M(""),se.current="",P(null),$(!1),T(!1);const ye=N,yt=ye&&typeof ye.error=="string"?ye.error:null,jt=(ye&&"errorCode"in ye&&typeof ye.errorCode=="string"&&ye.errorCode.trim()?ye.errorCode.trim():null)??"ERR_WS_UNKNOWN",we=jt==="ERR_WS_TIMEOUT"||yt==="Event handler timeout",He=jt==="ERR_CHAT_NOT_AGENT_MODE",Qe=jt==="ERR_CHAT_CLOSED",Ce=jt==="ERR_CHAT_NOT_FOUND",Ue=He&&typeof yt=="string"&&/status\s*=\s*(closed|deleted)/i.test(yt),Le=jt==="ERR_AI_SERVICE_HTTP"||jt==="ERR_AI_SERVICE_STREAM",it=yt&&yt.trim().length>0?yt.trim():null,cn={id:Ei(),content:He&&!Ue?"Sohbet artık yapay zeka asistanı modunda değil (örneğin canlı desteğe aktarıldı). Canlı destek görünümüne geçiriliyorsunuz.":we?`Yanıt çok uzun sürdü; sohbet güncellenmiş olabilir. Sayfayı yenileyin veya tekrar deneyin. Hata kodu: ${jt}`:Qe||Ce||Ue?it??(Qe||Ue?"Bu sohbet sona ermiş. Gerekirse yeni bir sohbet başlatın.":"Sohbet bulunamadı. Sayfayı yenileyip tekrar deneyin."):Le?"Yapay zeka servisine şu an ulaşılamıyor. Lütfen kısa bir süre sonra tekrar deneyin.":it??`Üzgünüm, bir hata oluştu. Hata kodu: ${jt}. Bu kodu destek personeli ile paylaşabilirsiniz.`,created_at:new Date,files:[],sender_type:pe.System};if(c(st=>st.filter(ct=>ct.id!==te).concat([cn])),He&&!Ue){_.markChatEnded(),G.getState().setIsHaveChat(!0),t(),G.getState().clearAIAgentState();return}if(Qe||Ce||Ue){_.markChatEnded(),ge.current=!0,c(st=>st.filter(ct=>ct.id!==te)),n();return}if(Le)return;m(!0);return}const ie=N;ie.session_id&&f(ie.session_id);const xe=ie.generation??"",Ne=ie.agent_message,pt=(typeof Ne.post_followup=="string"&&Ne.post_followup.trim()||void 0)??(typeof ie.post_message=="string"&&ie.post_message.trim()||void 0),et={...Ne,id:String(Ne._id??Ne.id??Ei()),created_at:Ne.created_at?new Date(Ne.created_at):new Date,post_followup:pt},Lt=se.current;let ft=0;xe.startsWith(Lt)&&(ft=Lt.length),(St=ce.current)==null||St.abort();const rt=new AbortController;ce.current=rt;const kt=()=>{ce.current===rt&&(ce.current=null),ve.current=!1,b(!1),U(!1),M(""),se.current="",P(null),$(!1),T(!1),c(ye=>ye.some(yt=>yt.id===et.id)?ye:[...ye,et]),ie.human_need&&m(!0)};if(ft>=xe.length){kt();return}(async()=>{try{await m1(xe,ft,ye=>{se.current=ye,M(ye)},rt.signal),kt()}catch{rt.signal.aborted&&(ve.current=!1,b(!1),U(!1),M(""),se.current="",P(null),ce.current===rt&&(ce.current=null),c(ye=>ye.some(yt=>yt.id===et.id)?ye:[...ye,et]),ie.human_need&&m(!0))}})()})},[r,s,u,F,_,d,l,c,f,m,t,n,b]);p.useEffect(()=>{const oe=C==null?void 0:C.trim();!oe||!_||!s||!r||!_.connected||!_.connectionReady||F||ve.current||u||(y(null),S(oe))},[C,_,_.connected,_.connectionReady,s,r,F,u,S,y]);const W=p.useCallback(oe=>{if(!_||A||ge.current)return;B(!0);const V=()=>{_.emit(Oe.AgentRequestHuman,{},te=>{if(B(!1),te&&typeof te=="object"&&"isError"in te&&te.isError===!0){const O=te,N=typeof O.errorCode=="string"&&O.errorCode.trim()?O.errorCode.trim():"",X=typeof O.error=="string"?O.error.trim():"";(N==="ERR_CHAT_CLOSED"||N==="ERR_CHAT_NOT_FOUND"||N==="ERR_CHAT_NOT_AGENT_MODE"&&/status\s*=\s*(closed|deleted)/i.test(X))&&(_.markChatEnded(),ge.current=!0,n());return}const z=te;z!=null&&z.success?(G.getState().setIsHaveChat(!0),h(!1),m(!1),G.getState().clearAIAgentState(),t()):console.error("Failed to request human operator")})};oe&&Object.keys(oe).length>0?_.emit(Oe.ChatUpdateInputs,{inputs:oe},te=>{te!=null&&te.success?V():(console.error("Failed to update chat inputs"),B(!1))}):V()},[_,A,h,m,t,n]),K=()=>{Te?L.push("registration"):W()};return s?o.jsxs("div",{className:"flex flex-col h-full min-h-0 flex-1 w-full",children:[o.jsxs("header",{className:"px-4 py-3 flex items-center justify-between flex-shrink-0 overflow-visible min-h-[52px]",style:{backgroundColor:v.getColor(g.HeaderBackground),color:v.getColor(g.HeaderText),borderColor:v.getColor(g.HeaderBorder),...E?{}:{borderTopLeftRadius:v.getRadius(),borderTopRightRadius:v.getRadius()}},children:[o.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[(Pe=s.avatar)!=null&&Pe.trim()?o.jsx("div",{className:"flex size-[46px] shrink-0 items-center justify-center overflow-hidden rounded-[14px] border border-solid",style:{borderColor:v.getColor(g.HeaderBorder),backgroundColor:v.getColor(g.MessageAdminBackground)},children:o.jsx("img",{src:s.avatar.trim(),alt:"",className:"size-full object-cover"})}):o.jsx(Qc,{color:v.getColor(g.HeaderText),borderColor:v.getColor(g.HeaderBorder),backgroundColor:v.getColor(g.MessageAdminBackground)}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("div",{className:"truncate font-medium",style:{color:v.getColor(g.HeaderText)},children:s.name}),o.jsx("div",{className:"line-clamp-1 text-xs opacity-75",style:{color:v.getColor(g.HeaderText)},children:"AI Asistan"})]})]}),o.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[o.jsx(h1,{onChatClose:je}),I&&o.jsx("button",{type:"button",onClick:ue,className:"p-1 hover:opacity-80 transition-opacity",children:o.jsx(fe.X,{className:"w-5 h-5 cursor-pointer"})})]})]}),o.jsxs("div",{className:"flex flex-col flex-1 min-h-0 w-full overflow-hidden",children:[o.jsx(Ud,{messages:a,isTyping:H||w&&(!!D||!!R),streamingContent:j?D:void 0,streamingStatusText:j?R:void 0,onLivechatSendSuggested:S,skipAnimationForLastN:Y}),o.jsx(gn,{children:Z&&o.jsxs($e.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:v.getColor(g.ErrorBackground),borderColor:v.getColor(g.ErrorBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:v.getRadius()},children:[o.jsx(fe.XCircle,{className:"size-4 flex-shrink-0 mt-0.5",style:{color:v.getColor(g.ErrorText)}}),o.jsx("span",{className:"text-sm",style:{color:v.getColor(g.ErrorText)},children:Z}),o.jsx("button",{type:"button",className:"ml-auto flex-shrink-0",onClick:()=>ee(null),style:{color:v.getColor(g.ErrorText)},children:o.jsx(fe.X,{className:"size-4"})})]})}),u?o.jsx($e.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:v.getColor(g.Background)},children:o.jsx($e.div,{className:"relative w-full max-w-lg mx-auto overflow-hidden",style:{borderRadius:v.getRadius()},animate:{filter:["brightness(1)","brightness(1.1)","brightness(1)"]},transition:{duration:2.5,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"},children:o.jsx(Vt,{onClick:K,disabled:A,size:"lg",className:"w-full flex items-center justify-center gap-2",children:A?o.jsx("span",{className:"animate-pulse",children:"Bağlanıyor..."}):o.jsxs(o.Fragment,{children:[o.jsx(fe.User,{className:"w-5 h-5"}),o.jsx("span",{children:"Canlı Desteğe Bağlan"})]})})})}):o.jsx(p1,{onSendMessage:S,disabled:F||(_==null?void 0:_.chatEnded)===!0,loading:F})]})]}):null}function y1({children:t}){const{widget:e}=G();return e?o.jsx("section",{className:"h-full w-full relative",children:t}):null}function v1({children:t}){const e=ln(),n=ar(),{historyChat:r,isAIAgentMode:i,aiAgent:s}=G(),[a,l]=p.useState(!0),[c,d]=p.useState(!1),f=p.useRef(!1);return p.useEffect(()=>{if(r){l(!1);return}if(!e){l(!1);return}const u=()=>{l(!1),d(!1),f.current=!0},m=()=>{i&&s||(d(!0),n.push("registration"))};return e.on(de.Connect,u),e.on(de.Disconnect,m),e.connected?(l(!1),f.current=!0):e.connect(),()=>{e.off(de.Connect,u),e.off(de.Disconnect,m)}},[e,r,i,s,n]),i&&s||r?t:!e||c?(e||n.push("registration"),o.jsx(Ca,{})):f.current&&!e.connected?o.jsx(Ca,{}):a||!e.connected?o.jsx(Cd,{}):t}function Ks(t,e){const n=new Map;for(const r of e)r!=null&&r.id&&n.set(r.id,r);for(const r of t)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())}async function Dc(t,e){if(!t||!(e!=null&&e.status))return;const n=G.getState(),r=Qt(t);if(e.status===Ve.Closed||e.status===Ve.Deleted){n.clearAIAgentState();return}if(e.status===Ve.Agent){let i=r.agent??n.aiAgent;if(!i)try{i=await Xa(t)}catch{i=null}if(!i){n.setIsAIAgentMode(!1);return}n.setAIAgent(i),r.sessionId&&n.setAIAgentSessionId(r.sessionId),r.humanNeedRequested&&n.setHumanNeedRequested(!0),n.setIsAIAgentMode(!0);return}(e.status===Ve.Open||e.status===Ve.Pending||e.status===Ve.Created)&&(n.isAIAgentMode||r.isAgentMode||n.aiAgent||r.agent)&&n.clearAIAgentState()}function x1(){const t=S=>{if(!S||typeof S!="object")return!1;const W=String((S==null?void 0:S.error)||(S==null?void 0:S.message)||"").toLowerCase(),K=Number((S==null?void 0:S.status)||(S==null?void 0:S.statusCode)||0);return(S==null?void 0:S.retryAfter)!==void 0||K===429||/too\s+many|rate\s*limit|çok\s+fazla/.test(W)},e=S=>{const W=Number((S==null?void 0:S.retryAfter)??(S==null?void 0:S.seconds));return Number.isFinite(W)&&W>0?W:3},{widget:n,setOpen:r,setIsHaveChat:i,historyChat:s,setHistoryChat:a,historyMessages:l,setHistoryMessages:c,aiAgent:d,isAIAgentMode:f,clearAIAgentState:u}=G(),m=Ee(),h=ln(),{connected:b,connectionReady:C}=h,y=li(),v=ar(),E=Br(),[I,_]=p.useState(null),[L,w]=p.useState([]),[$,H]=p.useState(!1),[q,F]=p.useState([]),[T,A]=p.useState(!1),B=Qa(),D=p.useRef(!1),M=p.useRef(null),R=p.useRef(!1),P=p.useRef([]),[j,U]=p.useState(!1),[Y,Q]=p.useState(null);p.useEffect(()=>{if(I||s||f){U(!1);return}const S=setTimeout(()=>{!I&&!s&&!f&&U(!0)},1e4);return()=>clearTimeout(S)},[I,s,f]),p.useEffect(()=>{if(!s||!n)return;if(_({status:s.status,is_customer_uploadable:!1}),l){w(l);return}const S=mn(n.link_id);Im(s._id,n.link_id,S).then(([W,K])=>{if(gt(K)&&Array.isArray(W)){const he=W.map(ae=>({id:ae._id,content:ae.content,created_at:ae.created_at,files:ae.files,sender_type:ae.sender_type,activity_type:ae.activity_type,answers:ae.answers,reply_id:ae.reply_id,buttons:ae.buttons}));w(he),c(he)}}).catch(W=>{console.error("Failed to load history messages",W)})},[s,n,l,c]);const Z=async(S,W)=>{var oe;if(!n)return;if(!s){const V=`temp-${Date.now()}`,te={id:V,content:S,created_at:new Date,files:W||[],sender_type:pe.Customer,answers:[],reply_id:void 0,buttons:[]};w(k=>[...k,te]),h==null||h.emit(Oe.MessageCreate,{content:S,files:W},k=>{const z=Array.isArray(k)?k[0]:k;if(z&&z.isError){w(N=>N.filter(X=>X.id!==V));const O=t(z);O||Tr(z),O&&typeof window<"u"&&window.dispatchEvent(new CustomEvent("lc:rate-limit",{detail:{seconds:e(z)}}));return}w(O=>O.map(N=>N.id===V?z:N))});return}const K={},he=n.appearance;if((oe=he==null?void 0:he.body)!=null&&oe.inputs){for(const V of he.body.inputs)if(V.required||V.remember){const te=fr(V.name);te&&(K[V.name]=te)}}const ae=G.getState().defaultValues;if(ae){ae.username&&(K.username=ae.username),ae.secret_data&&(K.secret_data=ae.secret_data);for(const V in ae)K[V]||(K[V]=ae[V])}const[be,Pe]=await B.mutateAsync({inputs:K,history:[],client_id:n.client_id,widget_id:n.link_id,device_id:mn(n.link_id)});if(gt(Pe)){a(null),i(!0),be&&typeof be=="object"&&"customer_token"in be&&(Rt(Ye.CustomerToken,be.customer_token,n.link_id),Rt(Ye.CustomerRefreshToken,be.customer_refresh_token,n.link_id));let V=0;const te=20,k=`temp-${Date.now()}`,z={id:k,content:S,created_at:new Date,files:W||[],sender_type:pe.Customer,answers:[],reply_id:void 0,buttons:[]};w(N=>[...N,z]);const O=setInterval(()=>{V+=1,h!=null&&h.connected?(h.emit(Oe.MessageCreate,{content:S,files:W},N=>{const X=Array.isArray(N)?N[0]:N;if(X&&X.isError){w(xe=>xe.filter(Ne=>Ne.id!==k));const ie=t(X);ie||Tr(X),ie&&typeof window<"u"&&window.dispatchEvent(new CustomEvent("lc:rate-limit",{detail:{seconds:e(X)}}));return}w(ie=>ie.map(xe=>xe.id===k?X:xe))}),clearInterval(O)):V>=te&&clearInterval(O)},200)}},ee=S=>{!S&&!E&&r(!1),A(!0),Gr((n==null?void 0:n.link_id)||""),i(!1),_(null),P.current=[],w([]),F([]),a(null),G.getState().setHistoryMessages(null),G.getState().setShowHistoryOnRegistration(!1),u(),Ti(n.client_id,Vn(Wn(y),n.link_id)).then(()=>{h==null||h.disconnect(),v.push("registration")})},se=()=>{G.getState().setMinimizedAssigneeName(null),I?(localStorage.setItem("showActionButtons","false"),_({...I,status:Ve.Closed})):ee(!1)};p.useEffect(()=>{if(h){if(s){D.current=!1,R.current=!1;return}if(!b||!C){b||(R.current=!1,D.current=!1,M.current=null);return}R.current=!0,!(!n||D.current)&&(D.current=!0,h.emit(Oe.ChatView,{},async S=>{if(G.getState().historyChat){D.current=!1;return}if(S===null||S&&"error"in S||!(S!=null&&S.status)){r(!1),i(!1),P.current=[],Ti(n.client_id,Vn(Wn(y),n.link_id)),w([]),F([]),a(null),G.getState().setHistoryMessages(null),u(),Gr((n==null?void 0:n.link_id)||""),h.disconnect(),v.push("registration"),D.current=!1;return}const K=sc(S);_(K),i(!0),await Dc(n==null?void 0:n.link_id,K)}))}},[s,h,n,b,C,y,v,r,i,a,u]);const ce=()=>{se()},ue=()=>{ee(!0)},[je,Te]=p.useState(!1),Se=p.useCallback(()=>{D.current=!1,M.current=null,R.current=!1;const S=G.getState().aiAgentMessages;S.length>0&&w(S),Te(!0)},[]);p.useEffect(()=>{if(je&&!(!h||!b||!C)){if(D.current){Te(!1);return}D.current=!0,h.emit(Oe.ChatView,{},async S=>{if(S&&!("error"in S)&&S.status){const K=sc(S);_(K),i(!0),await Dc(n==null?void 0:n.link_id,K),h.emit(Oe.MessageList,{},he=>{Array.isArray(he)&&w(ae=>Ks(ae,he))})}else i(!1);Te(!1)})}},[je,h,b,C,i]);const ve=()=>{u(),E||r(!1),A(!0),Gr((n==null?void 0:n.link_id)||""),i(!1),_(null),w([]),F([]),a(null),G.getState().setHistoryMessages(null),G.getState().setShowHistoryOnRegistration(!1),Ti(n.client_id,Vn(Wn(y),n.link_id)).then(()=>{h==null||h.disconnect(),v.push("registration")})},ge=p.useCallback(S=>{if(f&&d&&!s){const{aiAgentMessages:W,addAIAgentMessage:K}=G.getState();if(W.some(he=>he.id===S.id))return;K(S);return}if(!(I&&[Ve.Closed,Ve.Deleted].includes(I.status))){if(!I){const W=P.current;if(!S.id||W.some(K=>K.id===S.id))return;W.push(S);return}w(W=>{const K=W.filter(ae=>{var be;return!((be=ae.id)!=null&&be.startsWith("temp-")&&ae.content===S.content)});return K.some(ae=>ae.id===S.id)?K:[...K,S]})}},[I,f,d,s]);return p.useEffect(()=>{if(!I||[Ve.Closed,Ve.Deleted].includes(I.status))return;const S=P.current;S.length!==0&&(P.current=[],w(W=>Ks(W,S)))},[I]),p.useEffect(()=>{if(!h)return;const S=V=>{const te={content:V.content,created_at:V.created_at,files:V.files,id:V._id,sender_type:V.sender_type,answers:V.answers,reply_id:V.reply_id,buttons:V.buttons,post_followup:V.post_followup};if(q.length>0){F(k=>[...k,te]);return}V.is_shortcut?F([te]):ge(te),H(!1)},W=V=>{const te={content:V.content,created_at:V.created_at,files:V.files,id:V._id,sender_id:V.sender_id,sender_type:V.sender_type,activity_type:V.activity_type,sender_name:V.sender_name,answers:V.answers,reply_id:V.reply_id,buttons:V.buttons};ge(te)},K=V=>{!V||!V.name?_(te=>te?{...te,agent_name:void 0,agent_avatar:void 0,participants:[]}:null):_(te=>{if(!te)return null;const k=ic(te.participants,{profile_id:V.id,name:V.name,avatar:V.avatar}),z=Vr(k);return{...te,participants:k,...z}})},he=()=>{H(!0)},ae=()=>{h.markChatEnded(),G.getState().setMinimizedAssigneeName(null),_(V=>V?{...V,status:Ve.Closed}:(ee(!0),null))},be=({is_customer_uploadable:V})=>{_(te=>te?{...te,is_customer_uploadable:V}:null)},Pe=V=>{_(te=>{if(!te)return null;const k=_a(te.participants,{profile_id:V.profile_id});if(!V.hasOtherAdmins||k.length===0)return{...te,participants:[],agent_name:void 0,agent_avatar:void 0};const z=Vr(k);return{...te,participants:k,...z}})},oe=V=>{_(te=>{if(!te)return null;const k={profile_id:V.profile_id,name:V.name,avatar:V.avatar},z=V.is_assigned?ic(te.participants,k):A0(te.participants,k),O=Vr(z);return{...te,participants:z,...O}})};return h.on(de.MessageAgentCreate,S),h.on(de.MessageUserCreate,W),h.on(de.MessageCustomerCreate,W),h.on(de.ChatUserAssignee,K),h.on(de.MessageAgentTyping,he),h.on(de.ChatUserClose,ae),h.on(de.ChatToggleUpload,be),h.on(de.ChatUserLeave,Pe),h.on(de.ChatUserJoin,oe),()=>{h.off(de.MessageAgentCreate,S),h.off(de.MessageUserCreate,W),h.off(de.MessageCustomerCreate,W),h.off(de.ChatUserAssignee,K),h.off(de.MessageAgentTyping,he),h.off(de.ChatUserClose,ae),h.off(de.ChatToggleUpload,be),h.off(de.ChatUserLeave,Pe),h.off(de.ChatUserJoin,oe)}},[ge,q]),p.useEffect(()=>{if(!h)return;const S=K=>{K.repeat_count===3&&Q(K.message)},W=()=>{h.emit(Oe.ChatClose,{}),G.getState().setShowActionButtons(!1),se()};return h.on(de.AgentSpamWarning,S),h.on(de.AgentSpamBanned,W),()=>{h.off(de.AgentSpamWarning,S),h.off(de.AgentSpamBanned,W)}},[h,se]),p.useEffect(()=>{if(!h||!I||s){M.current=null;return}const S=`${I.status}-${I.agent_name||"no-agent"}`;M.current!==S&&(M.current=S,h.emit(Oe.MessageList,{},W=>{if(!Array.isArray(W)){M.current=null;return}w(K=>Ks(K,W)),_(K=>{if(!K)return null;const he=O0(W),ae=he.length>0?R0(he,K.participants):K.participants&&K.participants.length>0?K.participants:vo(K.agent_name,K.agent_avatar),be=Vr(ae);return{...K,participants:ae,...be}})}))},[h,I,s]),p.useEffect(()=>{const S=setTimeout(()=>{H(!1)},2e3);return()=>clearTimeout(S)},[$]),p.useEffect(()=>{if(!n||q.length===0)return;let S=0;n.writing_timeout&&(S=[...q[0].content].length/n.writing_timeout,S<0&&(S=0));const W=setTimeout(()=>{ge(q[0]),F(q.slice(1))},S*1e3);return()=>clearTimeout(W)},[q,n]),T?o.jsx(Ca,{}):f&&d&&!s?o.jsxs(o.Fragment,{children:[o.jsx("div",{id:"chat-alert-portal"}),o.jsx("div",{className:`h-full w-full ${E?"":"rounded-xl"} shadow-sm flex flex-col overflow-hidden`,style:{height:E?"100%":"",minHeight:E?"var(--app-height, 100dvh)":"",maxHeight:E?"var(--app-height, 100dvh)":"",backgroundColor:m.getColor(g.Background)},children:o.jsx(g1,{onOperatorConnected:Se,onChatClose:ve,onRemoteChatEnded:()=>ee(!0)})})]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{id:"chat-alert-portal"}),o.jsx("div",{className:`h-full w-full ${E?"":"rounded-xl"} shadow-sm flex flex-col overflow-hidden`,style:{height:E?"100%":"",minHeight:E?"var(--app-height, 100dvh)":"",maxHeight:E?"var(--app-height, 100dvh)":"",backgroundColor:m.getColor(g.Background)},children:I?I.status===Ve.Closed&&!s?o.jsx(d1,{onOk:ee}):o.jsx(c1,{chat:I,isTyping:$,messages:L,shortcutMessages:q,onNewMessage:ge,onChatClose:se,onEvaluateChat:ce,onNewChat:ue,onSendMessage:Z,isHistoryMode:!!s,spamWarningMessage:Y,onDismissSpamWarning:()=>Q(null)}):j?o.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-6 text-center",children:[o.jsx("div",{className:"w-12 h-12 rounded-full flex items-center justify-center mb-4",style:{backgroundColor:m.getColor(g.InputBorder)},children:o.jsx(fe.XCircle,{className:"w-6 h-6 opacity-50"})}),o.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Bağlantı Kurulamadı"}),o.jsx("p",{className:"text-sm opacity-60 mb-6",children:"Sunucuyla bağlantı sağlanırken bir sorun oluştu. Lütfen tekrar deneyin."}),o.jsx("button",{type:"button",onClick:()=>ee(!0),className:"px-6 py-2 rounded-lg font-medium transition-all",style:{backgroundColor:m.getColor(g.ButtonBackground),color:m.getColor(g.ButtonText),borderRadius:m.getRadius()},children:"Tekrar Dene"})]}):o.jsx(Cd,{})})]})}function b1(){return Tw(),null}function w1(){return o.jsxs(v1,{children:[o.jsx(y1,{children:o.jsx(x1,{})}),o.jsx(b1,{})]})}const C1=[{path:"/chat",component:w1,name:"chat"}],cp=[...C1],up=[...Pw],_1=[...cp,...up],k1=["Göktuğ","Rüzgar","Altan","Hamza","Caner"],S1="lc:tooltip:operator";function j1(){const t=new Date,e=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return`${e}-${n}-${r}`}function dp(){const t=k1;return t[Math.floor(Math.random()*t.length)]}function E1(t){const e=j1(),n=`${S1}:${t}`;try{const i=localStorage.getItem(n);if(i){const s=JSON.parse(i);if(s&&s.day===e&&typeof s.name=="string"&&s.name.length>0)return s.name}}catch{}const r=dp();try{localStorage.setItem(n,JSON.stringify({name:r,day:e}))}catch{}return r}function T1(t){return t==="light"?{balloon:"#ffffff",greeting:"#111111",sub:"#666666",close:"#bbbbbb",closeHoverBg:"rgba(0, 0, 0, 0.06)",title:"#4a3ff5",shadow:"0 6px 26px rgba(0, 0, 0, 0.2), 0 1px 5px rgba(0, 0, 0, 0.09)"}:{balloon:"#1e1e2e",greeting:"#f4f4f5",sub:"#a1a1aa",close:"#71717a",closeHoverBg:"rgba(255, 255, 255, 0.08)",title:"#4a3ff5",shadow:"0 6px 26px rgba(0, 0, 0, 0.4), 0 1px 5px rgba(0, 0, 0, 0.26)"}}function Fa({text:t,assigneeName:e}){var v,E,I,_;const{widget:n,isHaveChat:r,isTooltipVisible:i,setIsTooltipVisible:s,onTooltipClose:a}=G(),{texts:l,resolvedMode:c}=Ee(),d=p.useMemo(()=>T1(c),[c]),f=p.useMemo(()=>n!=null&&n.link_id?E1(n.link_id):dp(),[n==null?void 0:n.link_id]),{data:u,isSuccess:m,isError:h}=Tu(n==null?void 0:n.link_id),b=()=>{s(!1),a&&a()},{greetingLine:C,showSub:y}=p.useMemo(()=>{var q,F,T,A;if(t)return{greetingLine:t,showSub:!1};const L=e==null?void 0:e.trim();if(L)return{greetingLine:l[_e.TooltipBalloonGreeting].replace(/\{name\}/g,L),showSub:!0};const w=(r?(F=(q=n==null?void 0:n.appearance)==null?void 0:q.design)==null?void 0:F.tooltip_message_active:(A=(T=n==null?void 0:n.appearance)==null?void 0:T.design)==null?void 0:A.tooltip_message)||"";if(h&&w)return{greetingLine:w,showSub:!0};const $=l[_e.TooltipBalloonGreeting];let H="Chaty";return m&&u?H="Chaty":m&&u===null&&(H=f),{greetingLine:$.replace(/\{name\}/g,H),showSub:!0}},[t,e,l,r,(E=(v=n==null?void 0:n.appearance)==null?void 0:v.design)==null?void 0:E.tooltip_message,(_=(I=n==null?void 0:n.appearance)==null?void 0:I.design)==null?void 0:_.tooltip_message_active,h,m,u,f]);return i?o.jsxs($e.div,{initial:{opacity:0,y:12,scale:.97},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:12,scale:.97},transition:{duration:.3,ease:"easeOut"},className:Ie("absolute bottom-full right-0 z-10 mb-2.5 w-[212px]","px-[14px] pb-[14px] pt-3"),style:{borderRadius:"15px 15px 3px 15px",backgroundColor:d.balloon,boxShadow:d.shadow},children:[o.jsxs("div",{className:"mb-2 flex items-start justify-between gap-1.5",children:[o.jsx("button",{type:"button",onClick:b,className:"shrink-0 rounded p-0.5 text-[12px] leading-none transition-colors",style:{color:d.close},onMouseEnter:L=>{L.currentTarget.style.color=c==="light"?"#555555":"#d4d4d8",L.currentTarget.style.backgroundColor=d.closeHoverBg},onMouseLeave:L=>{L.currentTarget.style.color=d.close,L.currentTarget.style.backgroundColor="transparent"},"aria-label":l[_e.CloseButtonAria],children:o.jsx(fe.X,{className:"size-3","aria-hidden":!0})}),o.jsx("span",{className:"text-right text-[9px] font-bold uppercase tracking-[0.11em]",style:{color:d.title},children:l[_e.TooltipBalloonTitle]})]}),o.jsx($e.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.05,duration:.25},className:"mb-0.5 text-[13px] font-bold leading-snug",style:{color:d.greeting},children:C}),y&&o.jsx("p",{className:"text-[12px] leading-normal",style:{color:d.sub},children:l[_e.TooltipBalloonSub]}),o.jsx("div",{className:"pointer-events-none absolute h-2 w-[15px]",style:{bottom:"-7px",right:"31px",backgroundColor:d.balloon,clipPath:"polygon(0 0, 100% 0, 100% 100%)"},"aria-hidden":!0})]},"widget-tooltip"):null}function A1({label:t,onActivate:e}){return o.jsx("button",{type:"button",className:"chatier-minimized-unread-bubble",onClick:e,"aria-live":"polite",children:t})}function R1(t){return t.sender_type===pe.Activity||t.sender_type===pe.System?!1:t.sender_type===pe.Agent||t.sender_type===pe.User}function Fc({fallback:t,fallbackOpen:e,onOpenWidget:n}){const[r]=p.useState(window.document.title),i=ln(),{isHaveChat:s,open:a,soundPath:l,isTooltipVisible:c}=G(),d=G(w=>w.minimizedAssigneeName),f=G(w=>w.setMinimizedAssigneeName),[u,m]=p.useState(!0),[h,b]=p.useState(0),[C,y]=p.useState(null),v=Mr(),E=p.useRef(new Set),I=()=>{Lw(l)},_=(w,$)=>{if(C&&clearInterval(C),w||!s||$===0||Number.isNaN($)){window.document.title=r,y(null);return}const H=setInterval(()=>{if(w||!s||$===0||Number.isNaN($)){window.document.title=r,clearInterval(H),y(null);return}const F=`${v(_e.MinimizedUnreadMessage).replace(/\{count\}/g,String($))} - ${r}`;window.document.title!==F?window.document.title=F:window.document.title=r},1e3);return y(H),()=>{clearInterval(H),y(null)}};if(p.useEffect(()=>_(a&&u,h),[h,a,u]),p.useEffect(()=>{const w=()=>{m(document.visibilityState==="visible")};return document.addEventListener("visibilitychange",w,!1),()=>{document.removeEventListener("visibilitychange",w)}},[]),p.useEffect(()=>{a&&(b(0),E.current.clear())},[a]),p.useEffect(()=>{s||f(null)},[s,f]),p.useEffect(()=>{if(!i||!s)return;const w=F=>{a||R1(F)&&(E.current.has(F._id)||(E.current.add(F._id),b(T=>T+1),I()))},$=F=>{var A;const T=(A=F.name)==null?void 0:A.trim();T&&f(T),I()},H=F=>{var D;if(!F.was_assigned)return;const T=G.getState().minimizedAssigneeName;if(!F.hasOtherAdmins){f(null);return}const A=(D=F.name)==null?void 0:D.trim(),B=T==null?void 0:T.trim();A&&B&&A===B&&f(null)},q=()=>{f(null)};return i.on(de.MessageAgentCreate,w),i.on(de.ChatUserAssignee,$),i.on(de.ChatUserLeave,H),i.on(de.ChatUserClose,q),()=>{i.off(de.MessageAgentCreate,w),i.off(de.ChatUserAssignee,$),i.off(de.ChatUserLeave,H),i.off(de.ChatUserClose,q)}},[i,s,a,f]),a)return null;const L=h>0?v(_e.MinimizedUnreadMessage).replace(/\{count\}/g,String(h)):"";if(s&&h>0)return o.jsx(A1,{label:L,onActivate:n});if(s&&c){const w=d==null?void 0:d.trim();return o.jsx(Fa,{...w?{assigneeName:w}:{}})}return!s&&e?t:null}function Si({onClick:t,buttonBackground:e,buttonText:n,haloBackground:r,glow:i,glow2:s,haloIdle:a,showClose:l,className:c,"aria-label":d}){const f=r??`color-mix(in srgb, ${e} 30%, transparent)`;return o.jsxs("button",{type:"button",className:Ie("chatier-blob-wrap relative flex size-[55px] shrink-0 cursor-pointer items-center justify-center rounded-full border-0 bg-transparent p-0 outline-none transition-transform duration-200 hover:scale-[1.06] active:scale-[0.95] focus-visible:ring-2 focus-visible:ring-offset-2",c),style:{"--chatier-blob":e,"--chatier-glow":i??"rgba(74, 63, 245, 0.55)","--chatier-glow2":s??"rgba(74, 63, 245, 0.22)","--chatier-halo-idle":a??"none",color:n},onClick:t,"aria-label":d??(l?"Sohbeti küçült":"Sohbeti aç"),children:[o.jsx("div",{className:"chatier-blob-halo chatier-blob-morph-rev pointer-events-none absolute -inset-[8px] rounded-full transition-shadow duration-300",style:{backgroundColor:f},"aria-hidden":!0}),o.jsx("div",{className:"chatier-blob-bg chatier-blob-morph pointer-events-none absolute inset-0 transition-shadow duration-300",style:{backgroundColor:e},"aria-hidden":!0}),o.jsxs("div",{className:"relative z-10 flex size-full items-center justify-center",children:[o.jsx($e.div,{className:"absolute flex items-center justify-center",initial:!1,animate:{opacity:l?0:1,scale:l?.5:1,rotate:l?90:0},transition:{duration:.22,ease:"easeOut"},children:o.jsx(kp,{sizePx:29,className:"text-current"})}),o.jsx($e.div,{className:"absolute flex items-center justify-center",initial:!1,animate:{opacity:l?1:0,scale:l?1:.5,rotate:l?0:-90},transition:{duration:.22,ease:"easeOut"},children:o.jsx(fe.X,{className:"size-6 text-current","aria-hidden":!0})})]})]})}const O1=["top-left","top-right","top-center","bottom-left","bottom-right","bottom-center"],N1=new Set(O1);function Pc(t){const e=t==null?void 0:t.trim();if(!(!e||!N1.has(e)))return e}function I1(t,e,n="bottom-center"){var r,i;return Pc(e==null?void 0:e.toast_position)??Pc((i=(r=t==null?void 0:t.appearance)==null?void 0:r.design)==null?void 0:i.toast_position)??n}function M1(t){return t.startsWith("top")}function $1(t){return t==="light"?{background:"#ffffff",halo:"rgba(255, 255, 255, 0.22)",foreground:"#4a3ff5",glow:"rgba(255, 255, 255, 0.5)",glow2:"rgba(255, 255, 255, 0.2)",haloIdle:"0 0 28px rgba(255, 255, 255, 0.38), 0 0 12px rgba(255, 255, 255, 0.2)"}:{background:"#4a3ff5",halo:"rgba(74, 63, 245, 0.3)",foreground:"#ffffff",glow:"rgba(74, 63, 245, 0.55)",glow2:"rgba(74, 63, 245, 0.22)",haloIdle:"0 0 24px rgba(74, 63, 245, 0.42), 0 0 10px rgba(74, 63, 245, 0.22)"}}function D1({children:t,border:e}){var je,Te,Se,ve;const n=ln(),{open:r,setOpen:i,setIsHaveChat:s,isHaveChat:a,widget:l,onOpen:c,onClose:d,humanNeedRequested:f,defaultValues:u,portalDetailOpen:m}=G(),[h]=p.useState(!0),b=ar(),C=li(),y=Ka(),v=Ee(),{resolvedMode:E}=v,I=p.useMemo(()=>$1(E),[E]),_=p.useMemo(()=>({buttonBackground:I.background,haloBackground:I.halo,buttonText:I.foreground,glow:I.glow,glow2:I.glow2,haloIdle:I.haloIdle}),[I]),L=Br(),w=Pd(),$=p.useMemo(()=>I1(l,u),[l,u]),H=M1($)?"top":"bottom",q=H==="top"?{top:20}:20,F=H==="top"?{top:"max(20px, calc(14px + env(safe-area-inset-top, 0px)))"}:{bottom:"max(14px, calc(14px + env(safe-area-inset-bottom, 0px)))"},[T,A]=p.useState({x:0,y:0}),B=s0(),D=p.useRef(null),M=p.useRef(null),[R,P]=p.useState(!1),[j,U]=p.useState(()=>r?"visible":"hidden");p.useEffect(()=>((()=>{P("ontouchstart"in window||navigator.maxTouchPoints>0)})(),window.addEventListener("touchstart",()=>{P(!0)},{once:!0}),()=>{window.removeEventListener("touchstart",()=>{P(!0)})}),[]),p.useEffect(()=>{a&&y.pathname==="/"&&C&&C.accessToken&&!f&&b.push("chat")},[a,y.pathname,C,b,f]),p.useEffect(()=>{r&&U("visible")},[r]);const Y=ge=>{if(!D.current||!M.current)return ge;const S=D.current.getBoundingClientRect(),W={width:window.innerWidth,height:window.innerHeight},K={top:20,right:20,bottom:40,left:20};let he=ge.x,ae=ge.y;return S.right+he-T.x>W.width-K.right&&(he=W.width-K.right-S.width-(S.left-T.x)),S.left+he-T.x<K.left&&(he=K.left-(S.left-T.x)),S.bottom+ae-T.y>W.height-K.bottom&&(ae=W.height-K.bottom-S.height-(S.top-T.y)),S.top+ae-T.y<K.top&&(ae=K.top-(S.top-T.y)),{x:he,y:ae}},Q=()=>{if(i(!0),!n)return;n.emit(Oe.WidgetOpen,{});const{isAIAgentMode:ge,aiAgentRequestInFlight:S,setAIAgentMessages:W}=G.getState();ge&&S&&n.emit(Oe.MessageList,{},K=>{Array.isArray(K)&&K.length>0&&W(K)}),c&&c()},Z=()=>{i(!1),n&&(n.emit(Oe.WidgetClose,{}),d&&d())},ee=()=>{i(!1),s(!1),Ti(l.client_id,Vn(Wn(C),l.link_id)),b.push("registration")};p.useEffect(()=>{if(L&&(a||w)&&Q(),!(!n||!l))return n.on(de.Banned,ee),()=>{n.off(de.Banned,ee)}},[]);function se(ge){R&&B.start(ge)}const ce=L?"100%":m?"38rem":((Te=(je=l==null?void 0:l.appearance)==null?void 0:je.design)==null?void 0:Te.width)||"21rem",ue=L?"var(--app-height, 100dvh)":((ve=(Se=l==null?void 0:l.appearance)==null?void 0:Se.design)==null?void 0:ve.height)||"30rem";return o.jsxs("section",{className:"relative w-full h-full",ref:M,"data-theme":E,children:[o.jsxs($e.div,{initial:!1,animate:{opacity:r?1:0,scale:r?1:.7,y:r?0:12,width:ce,height:ue},transition:r?{duration:.32,ease:[.34,1.56,.64,1],width:{duration:.34,ease:[.22,1,.36,1]},height:{duration:.28,ease:[.22,1,.36,1]}}:{duration:.22,ease:[.4,0,.2,1]},onAnimationComplete:()=>{G.getState().open||U("hidden")},className:Ie("fixed z-300 overflow-hidden isolate min-h-0",{"":e&&!L,"bottom-28 right-8 rounded-xl":!L,"!bottom-0 !right-0":L}),style:{left:L?"0":"",right:L?"0px !important":"",maxHeight:L?"var(--app-height, 100dvh)":"",boxShadow:L?"":`0 10px 25px -5px ${v.getColor(g.ShadowColor)}, 0 8px 10px -6px ${v.getColor(g.ShadowColor)}`,backgroundColor:v.getColor(g.Background),visibility:r?"visible":j,transformOrigin:L?"bottom center":"bottom right",pointerEvents:r?"auto":"none"},"aria-hidden":!r,children:[t,o.jsx("div",{className:"widget-toast-scope pointer-events-none absolute inset-0 z-[520] min-h-0 [&_[data-sonner-toaster]]:pointer-events-auto","data-toast-anchor":H,"aria-live":"polite",children:o.jsx(Wh,{richColors:!0,theme:E,position:$,gap:8,duration:Ya,offset:q,mobileOffset:F})})]}),!R&&o.jsxs("div",{className:"fixed bottom-[40px] right-[20px] z-400",children:[o.jsx(Fc,{fallback:o.jsx(Fa,{}),fallbackOpen:h,onOpenWidget:Q}),!r&&o.jsx(Si,{..._,onClick:Q,showClose:!1},"desktop-open-blob"),r&&!L&&o.jsx(Si,{..._,onClick:Z,showClose:!0},"desktop-close-blob")]}),R&&o.jsxs($e.div,{ref:D,className:"fixed z-400 bottom-24 right-5",initial:{bottom:"96px",right:"20px"},animate:{x:T.x,y:T.y},drag:R,dragControls:B,dragMomentum:!1,dragElastic:0,onDragEnd:(ge,S)=>{const W={x:T.x+S.offset.x,y:T.y+S.offset.y},K=Y(W);A(K)},children:[o.jsx(Fc,{fallback:o.jsx(Fa,{}),fallbackOpen:h,onOpenWidget:Q}),!r&&o.jsx("div",{className:"cursor-move",onPointerDown:se,children:o.jsx(Si,{..._,onClick:Q,showClose:!1})},"chat-button"),r&&!L&&o.jsx(Si,{..._,onClick:Z,showClose:!0},"touch-close-blob")]})]})}function F1(t){const{widget:e}=G();return o.jsx(Sp,{widget:e,children:o.jsx(D1,{...t})})}function P1(){const{isHaveChat:t,isAIAgentMode:e}=G();return o.jsx(gh,{initialEntries:[t||e?"/chat":"/"],future:{v7_startTransition:!0},children:o.jsx(F1,{border:!0,children:o.jsxs(vh,{children:[cp.map((n,r)=>o.jsx(la,{path:n.path,element:o.jsx(n.component,{})},r)),up.map((n,r)=>o.jsx(la,{path:n.path,element:o.jsx(n.component,{})},r))]})})})}const B1="#4a3ff5";function L1(){const[t,e]=p.useState(()=>typeof window<"u"?Yo():"light");return p.useEffect(()=>{const n=()=>e(Yo()),r=window.matchMedia("(prefers-color-scheme: dark)");return r.addEventListener("change",n),window.addEventListener("storage",n),()=>{r.removeEventListener("change",n),window.removeEventListener("storage",n)}},[]),t}function z1(){const e=L1()==="dark",n=e?B1:"#ffffff",r=e?"rgba(74,63,245,0.55)":"rgba(255,255,255,0.4)",i=e?"rgba(74,63,245,0.4)":"rgba(255,255,255,0.3)";return o.jsxs("output",{className:"pointer-events-none fixed bottom-[40px] right-[20px] z-400 block","aria-live":"polite","aria-busy":"true",children:[o.jsx("span",{className:"sr-only",children:"Yükleniyor"}),o.jsxs("div",{className:"relative flex size-[55px] items-center justify-center",children:[o.jsx("div",{className:"chatier-loader-halo absolute size-[45px] rounded-full",style:{backgroundColor:i},"aria-hidden":!0}),o.jsx("div",{className:"chatier-loader-square size-[26px]",style:{backgroundColor:n,boxShadow:`0 0 16px ${r}`},"aria-hidden":!0})]})]})}const H1=2e3,U1=p.forwardRef((t,e)=>{var H;const n=typeof document<"u"&&((H=document.documentElement)==null?void 0:H.dataset.chatierStandaloneApp)==="true",r=Pd(),i=n||r,s=localStorage.getItem("lc:device:id"),{data:a,isLoading:l,error:c}=Cf(t.link_id,s||void 0),{widget:d,setWidget:f,setSoundPath:u,setDefaultValues:m,setOpen:h,setOnTooltipClose:b,setIsTooltipVisible:C,setOnOpen:y,setOnClose:v,onOpen:E,onClose:I}=G(),_=p.useRef(null),[L,w]=p.useState(!0);return p.useEffect(()=>{if(i){if(l){_.current=null,w(!0);return}_.current=null,w(!0);return}if(l){_.current=Date.now(),w(!1);return}const q=_.current;if(q===null){w(!0);return}const F=Date.now()-q,T=Math.max(0,H1-F);if(T===0){_.current=null,w(!0);return}const A=window.setTimeout(()=>{_.current=null,w(!0)},T);return()=>window.clearTimeout(A)},[l,i]),p.useImperativeHandle(e,()=>({open:()=>{h(!0),E&&E()},close:()=>{h(!1),I&&I()}})),p.useEffect(()=>{a&&jp(a)&&f(a),t.soundPath&&u(t.soundPath),t.defaultValues&&m(t.defaultValues),t.onTooltipClose&&b(t.onTooltipClose),t.showTooltip===!1&&C(!1),t.onOpen&&y(t.onOpen),t.onClose&&v(t.onClose)},[a,t.soundPath,t.defaultValues,t.onTooltipClose,t.showTooltip,t.onOpen,t.onClose]),!i&&(l||!L)?o.jsx(z1,{}):c||!a||!d?null:o.jsx(c0,{children:o.jsx(jw,{children:o.jsx(P1,{})})})}),q1=new sf;let Bc=null;function W1(t){if(!t.container)return;const e=J.createRef();return Bc=Ep(t.container),Bc.render(o.jsx(uf,{client:q1,children:o.jsx(U1,{...t,ref:e})})),{open:()=>{var n;return(n=e.current)==null?void 0:n.open()},close:()=>{var n;return(n=e.current)==null?void 0:n.close()},identify:n=>{if(!t.link_id)return;const r=mn(t.link_id);Om({widget_id:t.link_id,device_id:r,decrypted_data:n})}}}window.widget=W1});export default V1();
|