@alfatech/livechat 2025.10.2-3.2 → 2025.10.2-3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +3 -3
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -37,7 +37,7 @@ var Tg=e=>{throw TypeError(e)};var QC=(e,t)=>()=>(t||e((t={exports:{}}).exports,
|
|
|
37
37
|
`+i[o].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{td=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Bo(e):""}function kT(e){switch(e.tag){case 5:return Bo(e.type);case 16:return Bo("Lazy");case 13:return Bo("Suspense");case 19:return Bo("SuspenseList");case 0:case 2:case 15:return e=nd(e.type,!1),e;case 11:return e=nd(e.type.render,!1),e;case 1:return e=nd(e.type,!0),e;default:return""}}function cf(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 ws:return"Fragment";case xs:return"Portal";case af:return"Profiler";case gh:return"StrictMode";case lf:return"Suspense";case uf:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case n1:return(e.displayName||"Context")+".Consumer";case t1:return(e._context.displayName||"Context")+".Provider";case vh:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case yh:return t=e.displayName||null,t!==null?t:cf(e.type)||"Memo";case Cr:t=e._payload,e=e._init;try{return cf(e(t))}catch{}}return null}function CT(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 cf(t);case 8:return t===gh?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ti(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function i1(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function TT(e){var t=i1(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function hl(e){e._valueTracker||(e._valueTracker=TT(e))}function s1(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=i1(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function pu(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 df(e,t){var n=t.checked;return Ae({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Og(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ti(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function o1(e,t){t=t.checked,t!=null&&mh(e,"checked",t,!1)}function ff(e,t){o1(e,t);var n=ti(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")?pf(e,t.type,n):t.hasOwnProperty("defaultValue")&&pf(e,t.type,ti(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Dg(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 pf(e,t,n){(t!=="number"||pu(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var zo=Array.isArray;function Ls(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=""+ti(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 hf(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(I(91));return Ae({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Fg(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(I(92));if(zo(n)){if(1<n.length)throw Error(I(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:ti(n)}}function a1(e,t){var n=ti(t.value),r=ti(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 Mg(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function l1(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function mf(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?l1(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ml,u1=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(ml=ml||document.createElement("div"),ml.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ml.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function da(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Qo={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},ET=["Webkit","ms","Moz","O"];Object.keys(Qo).forEach(function(e){ET.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Qo[t]=Qo[e]})});function c1(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Qo.hasOwnProperty(e)&&Qo[e]?(""+t).trim():t+"px"}function d1(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=c1(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var _T=Ae({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 gf(e,t){if(t){if(_T[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(I(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(I(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(I(61))}if(t.style!=null&&typeof t.style!="object")throw Error(I(62))}}function vf(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 yf=null;function xh(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var xf=null,Is=null,$s=null;function Ng(e){if(e=Ya(e)){if(typeof xf!="function")throw Error(I(280));var t=e.stateNode;t&&(t=ac(t),xf(e.stateNode,e.type,t))}}function f1(e){Is?$s?$s.push(e):$s=[e]:Is=e}function p1(){if(Is){var e=Is,t=$s;if($s=Is=null,Ng(e),t)for(e=0;e<t.length;e++)Ng(t[e])}}function h1(e,t){return e(t)}function m1(){}var rd=!1;function g1(e,t,n){if(rd)return e(t,n);rd=!0;try{return h1(e,t,n)}finally{rd=!1,(Is!==null||$s!==null)&&(m1(),p1())}}function fa(e,t){var n=e.stateNode;if(n===null)return null;var r=ac(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(I(231,t,typeof n));return n}var wf=!1;if(cr)try{var Ro={};Object.defineProperty(Ro,"passive",{get:function(){wf=!0}}),window.addEventListener("test",Ro,Ro),window.removeEventListener("test",Ro,Ro)}catch{wf=!1}function PT(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 Yo=!1,hu=null,mu=!1,bf=null,jT={onError:function(e){Yo=!0,hu=e}};function RT(e,t,n,r,i,s,o,a,l){Yo=!1,hu=null,PT.apply(jT,arguments)}function AT(e,t,n,r,i,s,o,a,l){if(RT.apply(this,arguments),Yo){if(Yo){var c=hu;Yo=!1,hu=null}else throw Error(I(198));mu||(mu=!0,bf=c)}}function es(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function v1(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Lg(e){if(es(e)!==e)throw Error(I(188))}function OT(e){var t=e.alternate;if(!t){if(t=es(e),t===null)throw Error(I(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 Lg(i),e;if(s===r)return Lg(i),t;s=s.sibling}throw Error(I(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(I(189))}}if(n.alternate!==r)throw Error(I(190))}if(n.tag!==3)throw Error(I(188));return n.stateNode.current===n?e:t}function y1(e){return e=OT(e),e!==null?x1(e):null}function x1(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=x1(e);if(t!==null)return t;e=e.sibling}return null}var w1=Ht.unstable_scheduleCallback,Ig=Ht.unstable_cancelCallback,DT=Ht.unstable_shouldYield,FT=Ht.unstable_requestPaint,$e=Ht.unstable_now,MT=Ht.unstable_getCurrentPriorityLevel,wh=Ht.unstable_ImmediatePriority,b1=Ht.unstable_UserBlockingPriority,gu=Ht.unstable_NormalPriority,NT=Ht.unstable_LowPriority,S1=Ht.unstable_IdlePriority,rc=null,zn=null;function LT(e){if(zn&&typeof zn.onCommitFiberRoot=="function")try{zn.onCommitFiberRoot(rc,e,void 0,(e.current.flags&128)===128)}catch{}}var kn=Math.clz32?Math.clz32:BT,IT=Math.log,$T=Math.LN2;function BT(e){return e>>>=0,e===0?32:31-(IT(e)/$T|0)|0}var gl=64,vl=4194304;function Vo(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 vu(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=Vo(a):(s&=o,s!==0&&(r=Vo(s)))}else o=n&~i,o!==0?r=Vo(o):s!==0&&(r=Vo(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-kn(t),i=1<<n,r|=e[n],t&=~i;return r}function zT(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 VT(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var o=31-kn(s),a=1<<o,l=i[o];l===-1?(!(a&n)||a&r)&&(i[o]=zT(a,t)):l<=t&&(e.expiredLanes|=a),s&=~a}}function Sf(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function k1(){var e=gl;return gl<<=1,!(gl&4194240)&&(gl=64),e}function id(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ga(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-kn(t),e[t]=n}function UT(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-kn(n),s=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~s}}function bh(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-kn(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var he=0;function C1(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var T1,Sh,E1,_1,P1,kf=!1,yl=[],Vr=null,Ur=null,Hr=null,pa=new Map,ha=new Map,_r=[],HT="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 $g(e,t){switch(e){case"focusin":case"focusout":Vr=null;break;case"dragenter":case"dragleave":Ur=null;break;case"mouseover":case"mouseout":Hr=null;break;case"pointerover":case"pointerout":pa.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ha.delete(t.pointerId)}}function Ao(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=Ya(t),t!==null&&Sh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function WT(e,t,n,r,i){switch(t){case"focusin":return Vr=Ao(Vr,e,t,n,r,i),!0;case"dragenter":return Ur=Ao(Ur,e,t,n,r,i),!0;case"mouseover":return Hr=Ao(Hr,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return pa.set(s,Ao(pa.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,ha.set(s,Ao(ha.get(s)||null,e,t,n,r,i)),!0}return!1}function j1(e){var t=Ti(e.target);if(t!==null){var n=es(t);if(n!==null){if(t=n.tag,t===13){if(t=v1(n),t!==null){e.blockedOn=t,P1(e.priority,function(){E1(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 Hl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Cf(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);yf=r,n.target.dispatchEvent(r),yf=null}else return t=Ya(n),t!==null&&Sh(t),e.blockedOn=n,!1;t.shift()}return!0}function Bg(e,t,n){Hl(e)&&n.delete(t)}function qT(){kf=!1,Vr!==null&&Hl(Vr)&&(Vr=null),Ur!==null&&Hl(Ur)&&(Ur=null),Hr!==null&&Hl(Hr)&&(Hr=null),pa.forEach(Bg),ha.forEach(Bg)}function Oo(e,t){e.blockedOn===t&&(e.blockedOn=null,kf||(kf=!0,Ht.unstable_scheduleCallback(Ht.unstable_NormalPriority,qT)))}function ma(e){function t(i){return Oo(i,e)}if(0<yl.length){Oo(yl[0],e);for(var n=1;n<yl.length;n++){var r=yl[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Vr!==null&&Oo(Vr,e),Ur!==null&&Oo(Ur,e),Hr!==null&&Oo(Hr,e),pa.forEach(t),ha.forEach(t),n=0;n<_r.length;n++)r=_r[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<_r.length&&(n=_r[0],n.blockedOn===null);)j1(n),n.blockedOn===null&&_r.shift()}var Bs=mr.ReactCurrentBatchConfig,yu=!0;function GT(e,t,n,r){var i=he,s=Bs.transition;Bs.transition=null;try{he=1,kh(e,t,n,r)}finally{he=i,Bs.transition=s}}function QT(e,t,n,r){var i=he,s=Bs.transition;Bs.transition=null;try{he=4,kh(e,t,n,r)}finally{he=i,Bs.transition=s}}function kh(e,t,n,r){if(yu){var i=Cf(e,t,n,r);if(i===null)hd(e,t,r,xu,n),$g(e,r);else if(WT(i,e,t,n,r))r.stopPropagation();else if($g(e,r),t&4&&-1<HT.indexOf(e)){for(;i!==null;){var s=Ya(i);if(s!==null&&T1(s),s=Cf(e,t,n,r),s===null&&hd(e,t,r,xu,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else hd(e,t,r,null,n)}}var xu=null;function Cf(e,t,n,r){if(xu=null,e=xh(r),e=Ti(e),e!==null)if(t=es(e),t===null)e=null;else if(n=t.tag,n===13){if(e=v1(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return xu=e,null}function R1(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(MT()){case wh:return 1;case b1:return 4;case gu:case NT:return 16;case S1:return 536870912;default:return 16}default:return 16}}var Ir=null,Ch=null,Wl=null;function A1(){if(Wl)return Wl;var e,t=Ch,n=t.length,r,i="value"in Ir?Ir.value:Ir.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 Wl=i.slice(e,1<r?1-r:void 0)}function ql(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 xl(){return!0}function zg(){return!1}function qt(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)?xl:zg,this.isPropagationStopped=zg,this}return Ae(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=xl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=xl)},persist:function(){},isPersistent:xl}),t}var xo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Th=qt(xo),Qa=Ae({},xo,{view:0,detail:0}),YT=qt(Qa),sd,od,Do,ic=Ae({},Qa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Eh,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!==Do&&(Do&&e.type==="mousemove"?(sd=e.screenX-Do.screenX,od=e.screenY-Do.screenY):od=sd=0,Do=e),sd)},movementY:function(e){return"movementY"in e?e.movementY:od}}),Vg=qt(ic),KT=Ae({},ic,{dataTransfer:0}),XT=qt(KT),ZT=Ae({},Qa,{relatedTarget:0}),ad=qt(ZT),JT=Ae({},xo,{animationName:0,elapsedTime:0,pseudoElement:0}),eE=qt(JT),tE=Ae({},xo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),nE=qt(tE),rE=Ae({},xo,{data:0}),Ug=qt(rE),iE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},sE={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"},oE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function aE(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=oE[e])?!!t[e]:!1}function Eh(){return aE}var lE=Ae({},Qa,{key:function(e){if(e.key){var t=iE[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ql(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?sE[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Eh,charCode:function(e){return e.type==="keypress"?ql(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ql(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),uE=qt(lE),cE=Ae({},ic,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Hg=qt(cE),dE=Ae({},Qa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Eh}),fE=qt(dE),pE=Ae({},xo,{propertyName:0,elapsedTime:0,pseudoElement:0}),hE=qt(pE),mE=Ae({},ic,{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}),gE=qt(mE),vE=[9,13,27,32],_h=cr&&"CompositionEvent"in window,Ko=null;cr&&"documentMode"in document&&(Ko=document.documentMode);var yE=cr&&"TextEvent"in window&&!Ko,O1=cr&&(!_h||Ko&&8<Ko&&11>=Ko),Wg=" ",qg=!1;function D1(e,t){switch(e){case"keyup":return vE.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function F1(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var bs=!1;function xE(e,t){switch(e){case"compositionend":return F1(t);case"keypress":return t.which!==32?null:(qg=!0,Wg);case"textInput":return e=t.data,e===Wg&&qg?null:e;default:return null}}function wE(e,t){if(bs)return e==="compositionend"||!_h&&D1(e,t)?(e=A1(),Wl=Ch=Ir=null,bs=!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 O1&&t.locale!=="ko"?null:t.data;default:return null}}var bE={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 Gg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!bE[e.type]:t==="textarea"}function M1(e,t,n,r){f1(r),t=wu(t,"onChange"),0<t.length&&(n=new Th("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Xo=null,ga=null;function SE(e){q1(e,0)}function sc(e){var t=Cs(e);if(s1(t))return e}function kE(e,t){if(e==="change")return t}var N1=!1;if(cr){var ld;if(cr){var ud="oninput"in document;if(!ud){var Qg=document.createElement("div");Qg.setAttribute("oninput","return;"),ud=typeof Qg.oninput=="function"}ld=ud}else ld=!1;N1=ld&&(!document.documentMode||9<document.documentMode)}function Yg(){Xo&&(Xo.detachEvent("onpropertychange",L1),ga=Xo=null)}function L1(e){if(e.propertyName==="value"&&sc(ga)){var t=[];M1(t,ga,e,xh(e)),g1(SE,t)}}function CE(e,t,n){e==="focusin"?(Yg(),Xo=t,ga=n,Xo.attachEvent("onpropertychange",L1)):e==="focusout"&&Yg()}function TE(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return sc(ga)}function EE(e,t){if(e==="click")return sc(t)}function _E(e,t){if(e==="input"||e==="change")return sc(t)}function PE(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Tn=typeof Object.is=="function"?Object.is:PE;function va(e,t){if(Tn(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(!of.call(t,i)||!Tn(e[i],t[i]))return!1}return!0}function Kg(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Xg(e,t){var n=Kg(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=Kg(n)}}function I1(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?I1(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function $1(){for(var e=window,t=pu();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=pu(e.document)}return t}function Ph(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 jE(e){var t=$1(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&I1(n.ownerDocument.documentElement,n)){if(r!==null&&Ph(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=Xg(n,s);var o=Xg(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 RE=cr&&"documentMode"in document&&11>=document.documentMode,Ss=null,Tf=null,Zo=null,Ef=!1;function Zg(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ef||Ss==null||Ss!==pu(r)||(r=Ss,"selectionStart"in r&&Ph(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}),Zo&&va(Zo,r)||(Zo=r,r=wu(Tf,"onSelect"),0<r.length&&(t=new Th("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Ss)))}function wl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ks={animationend:wl("Animation","AnimationEnd"),animationiteration:wl("Animation","AnimationIteration"),animationstart:wl("Animation","AnimationStart"),transitionend:wl("Transition","TransitionEnd")},cd={},B1={};cr&&(B1=document.createElement("div").style,"AnimationEvent"in window||(delete ks.animationend.animation,delete ks.animationiteration.animation,delete ks.animationstart.animation),"TransitionEvent"in window||delete ks.transitionend.transition);function oc(e){if(cd[e])return cd[e];if(!ks[e])return e;var t=ks[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in B1)return cd[e]=t[n];return e}var z1=oc("animationend"),V1=oc("animationiteration"),U1=oc("animationstart"),H1=oc("transitionend"),W1=new Map,Jg="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 oi(e,t){W1.set(e,t),Ji(t,[e])}for(var dd=0;dd<Jg.length;dd++){var fd=Jg[dd],AE=fd.toLowerCase(),OE=fd[0].toUpperCase()+fd.slice(1);oi(AE,"on"+OE)}oi(z1,"onAnimationEnd");oi(V1,"onAnimationIteration");oi(U1,"onAnimationStart");oi("dblclick","onDoubleClick");oi("focusin","onFocus");oi("focusout","onBlur");oi(H1,"onTransitionEnd");ro("onMouseEnter",["mouseout","mouseover"]);ro("onMouseLeave",["mouseout","mouseover"]);ro("onPointerEnter",["pointerout","pointerover"]);ro("onPointerLeave",["pointerout","pointerover"]);Ji("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ji("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ji("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ji("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ji("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ji("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Uo="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(" "),DE=new Set("cancel close invalid load scroll toggle".split(" ").concat(Uo));function ev(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,AT(r,t,void 0,e),e.currentTarget=null}function q1(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==s&&i.isPropagationStopped())break e;ev(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;ev(i,a,c),s=l}}}if(mu)throw e=bf,mu=!1,bf=null,e}function ke(e,t){var n=t[Af];n===void 0&&(n=t[Af]=new Set);var r=e+"__bubble";n.has(r)||(G1(t,e,2,!1),n.add(r))}function pd(e,t,n){var r=0;t&&(r|=4),G1(n,e,r,t)}var bl="_reactListening"+Math.random().toString(36).slice(2);function ya(e){if(!e[bl]){e[bl]=!0,e1.forEach(function(n){n!=="selectionchange"&&(DE.has(n)||pd(n,!1,e),pd(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[bl]||(t[bl]=!0,pd("selectionchange",!1,t))}}function G1(e,t,n,r){switch(R1(t)){case 1:var i=GT;break;case 4:i=QT;break;default:i=kh}n=i.bind(null,t,n,e),i=void 0,!wf||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function hd(e,t,n,r,i){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;o=o.return}for(;a!==null;){if(o=Ti(a),o===null)return;if(l=o.tag,l===5||l===6){r=s=o;continue e}a=a.parentNode}}r=r.return}g1(function(){var c=s,d=xh(n),u=[];e:{var f=W1.get(e);if(f!==void 0){var p=Th,h=e;switch(e){case"keypress":if(ql(n)===0)break e;case"keydown":case"keyup":p=uE;break;case"focusin":h="focus",p=ad;break;case"focusout":h="blur",p=ad;break;case"beforeblur":case"afterblur":p=ad;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=Vg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=XT;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=fE;break;case z1:case V1:case U1:p=eE;break;case H1:p=hE;break;case"scroll":p=YT;break;case"wheel":p=gE;break;case"copy":case"cut":case"paste":p=nE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=Hg}var m=(t&4)!==0,x=!m&&e==="scroll",g=m?f!==null?f+"Capture":null:f;m=[];for(var w=c,b;w!==null;){b=w;var k=b.stateNode;if(b.tag===5&&k!==null&&(b=k,g!==null&&(k=fa(w,g),k!=null&&m.push(xa(w,k,b)))),x)break;w=w.return}0<m.length&&(f=new p(f,h,null,n,d),u.push({event:f,listeners:m}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",f&&n!==yf&&(h=n.relatedTarget||n.fromElement)&&(Ti(h)||h[dr]))break e;if((p||f)&&(f=d.window===d?d:(f=d.ownerDocument)?f.defaultView||f.parentWindow:window,p?(h=n.relatedTarget||n.toElement,p=c,h=h?Ti(h):null,h!==null&&(x=es(h),h!==x||h.tag!==5&&h.tag!==6)&&(h=null)):(p=null,h=c),p!==h)){if(m=Vg,k="onMouseLeave",g="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(m=Hg,k="onPointerLeave",g="onPointerEnter",w="pointer"),x=p==null?f:Cs(p),b=h==null?f:Cs(h),f=new m(k,w+"leave",p,n,d),f.target=x,f.relatedTarget=b,k=null,Ti(d)===c&&(m=new m(g,w+"enter",h,n,d),m.target=b,m.relatedTarget=x,k=m),x=k,p&&h)t:{for(m=p,g=h,w=0,b=m;b;b=gs(b))w++;for(b=0,k=g;k;k=gs(k))b++;for(;0<w-b;)m=gs(m),w--;for(;0<b-w;)g=gs(g),b--;for(;w--;){if(m===g||g!==null&&m===g.alternate)break t;m=gs(m),g=gs(g)}m=null}else m=null;p!==null&&tv(u,f,p,m,!1),h!==null&&x!==null&&tv(u,x,h,m,!0)}}e:{if(f=c?Cs(c):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var T=kE;else if(Gg(f))if(N1)T=_E;else{T=TE;var E=CE}else(p=f.nodeName)&&p.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(T=EE);if(T&&(T=T(e,c))){M1(u,T,n,d);break e}E&&E(e,f,c),e==="focusout"&&(E=f._wrapperState)&&E.controlled&&f.type==="number"&&pf(f,"number",f.value)}switch(E=c?Cs(c):window,e){case"focusin":(Gg(E)||E.contentEditable==="true")&&(Ss=E,Tf=c,Zo=null);break;case"focusout":Zo=Tf=Ss=null;break;case"mousedown":Ef=!0;break;case"contextmenu":case"mouseup":case"dragend":Ef=!1,Zg(u,n,d);break;case"selectionchange":if(RE)break;case"keydown":case"keyup":Zg(u,n,d)}var _;if(_h)e:{switch(e){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else bs?D1(e,n)&&(P="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(P="onCompositionStart");P&&(O1&&n.locale!=="ko"&&(bs||P!=="onCompositionStart"?P==="onCompositionEnd"&&bs&&(_=A1()):(Ir=d,Ch="value"in Ir?Ir.value:Ir.textContent,bs=!0)),E=wu(c,P),0<E.length&&(P=new Ug(P,e,null,n,d),u.push({event:P,listeners:E}),_?P.data=_:(_=F1(n),_!==null&&(P.data=_)))),(_=yE?xE(e,n):wE(e,n))&&(c=wu(c,"onBeforeInput"),0<c.length&&(d=new Ug("onBeforeInput","beforeinput",null,n,d),u.push({event:d,listeners:c}),d.data=_))}q1(u,t)})}function xa(e,t,n){return{instance:e,listener:t,currentTarget:n}}function wu(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=fa(e,n),s!=null&&r.unshift(xa(e,s,i)),s=fa(e,t),s!=null&&r.push(xa(e,s,i))),e=e.return}return r}function gs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function tv(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=fa(n,s),l!=null&&o.unshift(xa(n,l,a))):i||(l=fa(n,s),l!=null&&o.push(xa(n,l,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var FE=/\r\n?/g,ME=/\u0000|\uFFFD/g;function nv(e){return(typeof e=="string"?e:""+e).replace(FE,`
|
|
38
38
|
`).replace(ME,"")}function Sl(e,t,n){if(t=nv(t),nv(e)!==t&&n)throw Error(I(425))}function bu(){}var _f=null,Pf=null;function jf(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 Rf=typeof setTimeout=="function"?setTimeout:void 0,NE=typeof clearTimeout=="function"?clearTimeout:void 0,rv=typeof Promise=="function"?Promise:void 0,LE=typeof queueMicrotask=="function"?queueMicrotask:typeof rv<"u"?function(e){return rv.resolve(null).then(e).catch(IE)}:Rf;function IE(e){setTimeout(function(){throw e})}function md(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),ma(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);ma(t)}function Wr(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function iv(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var wo=Math.random().toString(36).slice(2),$n="__reactFiber$"+wo,wa="__reactProps$"+wo,dr="__reactContainer$"+wo,Af="__reactEvents$"+wo,$E="__reactListeners$"+wo,BE="__reactHandles$"+wo;function Ti(e){var t=e[$n];if(t)return t;for(var n=e.parentNode;n;){if(t=n[dr]||n[$n]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=iv(e);e!==null;){if(n=e[$n])return n;e=iv(e)}return t}e=n,n=e.parentNode}return null}function Ya(e){return e=e[$n]||e[dr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Cs(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(I(33))}function ac(e){return e[wa]||null}var Of=[],Ts=-1;function ai(e){return{current:e}}function Te(e){0>Ts||(e.current=Of[Ts],Of[Ts]=null,Ts--)}function be(e,t){Ts++,Of[Ts]=e.current,e.current=t}var ni={},mt=ai(ni),Ot=ai(!1),Hi=ni;function io(e,t){var n=e.type.contextTypes;if(!n)return ni;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 Dt(e){return e=e.childContextTypes,e!=null}function Su(){Te(Ot),Te(mt)}function sv(e,t,n){if(mt.current!==ni)throw Error(I(168));be(mt,t),be(Ot,n)}function Q1(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(I(108,CT(e)||"Unknown",i));return Ae({},n,r)}function ku(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ni,Hi=mt.current,be(mt,e),be(Ot,Ot.current),!0}function ov(e,t,n){var r=e.stateNode;if(!r)throw Error(I(169));n?(e=Q1(e,t,Hi),r.__reactInternalMemoizedMergedChildContext=e,Te(Ot),Te(mt),be(mt,e)):Te(Ot),be(Ot,n)}var nr=null,lc=!1,gd=!1;function Y1(e){nr===null?nr=[e]:nr.push(e)}function zE(e){lc=!0,Y1(e)}function li(){if(!gd&&nr!==null){gd=!0;var e=0,t=he;try{var n=nr;for(he=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}nr=null,lc=!1}catch(i){throw nr!==null&&(nr=nr.slice(e+1)),w1(wh,li),i}finally{he=t,gd=!1}}return null}var Es=[],_s=0,Cu=null,Tu=0,tn=[],nn=0,Wi=null,sr=1,or="";function yi(e,t){Es[_s++]=Tu,Es[_s++]=Cu,Cu=e,Tu=t}function K1(e,t,n){tn[nn++]=sr,tn[nn++]=or,tn[nn++]=Wi,Wi=e;var r=sr;e=or;var i=32-kn(r)-1;r&=~(1<<i),n+=1;var s=32-kn(t)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,sr=1<<32-kn(t)+i|n<<i|r,or=s+e}else sr=1<<s|n<<i|r,or=e}function jh(e){e.return!==null&&(yi(e,1),K1(e,1,0))}function Rh(e){for(;e===Cu;)Cu=Es[--_s],Es[_s]=null,Tu=Es[--_s],Es[_s]=null;for(;e===Wi;)Wi=tn[--nn],tn[nn]=null,or=tn[--nn],tn[nn]=null,sr=tn[--nn],tn[nn]=null}var Ut=null,Bt=null,Ee=!1,bn=null;function X1(e,t){var n=sn(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 av(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,Ut=e,Bt=Wr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Ut=e,Bt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Wi!==null?{id:sr,overflow:or}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=sn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Ut=e,Bt=null,!0):!1;default:return!1}}function Df(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ff(e){if(Ee){var t=Bt;if(t){var n=t;if(!av(e,t)){if(Df(e))throw Error(I(418));t=Wr(n.nextSibling);var r=Ut;t&&av(e,t)?X1(r,n):(e.flags=e.flags&-4097|2,Ee=!1,Ut=e)}}else{if(Df(e))throw Error(I(418));e.flags=e.flags&-4097|2,Ee=!1,Ut=e}}}function lv(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ut=e}function kl(e){if(e!==Ut)return!1;if(!Ee)return lv(e),Ee=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!jf(e.type,e.memoizedProps)),t&&(t=Bt)){if(Df(e))throw Z1(),Error(I(418));for(;t;)X1(e,t),t=Wr(t.nextSibling)}if(lv(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(I(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Bt=Wr(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Bt=null}}else Bt=Ut?Wr(e.stateNode.nextSibling):null;return!0}function Z1(){for(var e=Bt;e;)e=Wr(e.nextSibling)}function so(){Bt=Ut=null,Ee=!1}function Ah(e){bn===null?bn=[e]:bn.push(e)}var VE=mr.ReactCurrentBatchConfig;function Fo(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(I(309));var r=n.stateNode}if(!r)throw Error(I(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(I(284));if(!n._owner)throw Error(I(290,e))}return e}function Cl(e,t){throw e=Object.prototype.toString.call(t),Error(I(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function uv(e){var t=e._init;return t(e._payload)}function J1(e){function t(g,w){if(e){var b=g.deletions;b===null?(g.deletions=[w],g.flags|=16):b.push(w)}}function n(g,w){if(!e)return null;for(;w!==null;)t(g,w),w=w.sibling;return null}function r(g,w){for(g=new Map;w!==null;)w.key!==null?g.set(w.key,w):g.set(w.index,w),w=w.sibling;return g}function i(g,w){return g=Yr(g,w),g.index=0,g.sibling=null,g}function s(g,w,b){return g.index=b,e?(b=g.alternate,b!==null?(b=b.index,b<w?(g.flags|=2,w):b):(g.flags|=2,w)):(g.flags|=1048576,w)}function o(g){return e&&g.alternate===null&&(g.flags|=2),g}function a(g,w,b,k){return w===null||w.tag!==6?(w=kd(b,g.mode,k),w.return=g,w):(w=i(w,b),w.return=g,w)}function l(g,w,b,k){var T=b.type;return T===ws?d(g,w,b.props.children,k,b.key):w!==null&&(w.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===Cr&&uv(T)===w.type)?(k=i(w,b.props),k.ref=Fo(g,w,b),k.return=g,k):(k=Jl(b.type,b.key,b.props,null,g.mode,k),k.ref=Fo(g,w,b),k.return=g,k)}function c(g,w,b,k){return w===null||w.tag!==4||w.stateNode.containerInfo!==b.containerInfo||w.stateNode.implementation!==b.implementation?(w=Cd(b,g.mode,k),w.return=g,w):(w=i(w,b.children||[]),w.return=g,w)}function d(g,w,b,k,T){return w===null||w.tag!==7?(w=Bi(b,g.mode,k,T),w.return=g,w):(w=i(w,b),w.return=g,w)}function u(g,w,b){if(typeof w=="string"&&w!==""||typeof w=="number")return w=kd(""+w,g.mode,b),w.return=g,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case pl:return b=Jl(w.type,w.key,w.props,null,g.mode,b),b.ref=Fo(g,null,w),b.return=g,b;case xs:return w=Cd(w,g.mode,b),w.return=g,w;case Cr:var k=w._init;return u(g,k(w._payload),b)}if(zo(w)||jo(w))return w=Bi(w,g.mode,b,null),w.return=g,w;Cl(g,w)}return null}function f(g,w,b,k){var T=w!==null?w.key:null;if(typeof b=="string"&&b!==""||typeof b=="number")return T!==null?null:a(g,w,""+b,k);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case pl:return b.key===T?l(g,w,b,k):null;case xs:return b.key===T?c(g,w,b,k):null;case Cr:return T=b._init,f(g,w,T(b._payload),k)}if(zo(b)||jo(b))return T!==null?null:d(g,w,b,k,null);Cl(g,b)}return null}function p(g,w,b,k,T){if(typeof k=="string"&&k!==""||typeof k=="number")return g=g.get(b)||null,a(w,g,""+k,T);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case pl:return g=g.get(k.key===null?b:k.key)||null,l(w,g,k,T);case xs:return g=g.get(k.key===null?b:k.key)||null,c(w,g,k,T);case Cr:var E=k._init;return p(g,w,b,E(k._payload),T)}if(zo(k)||jo(k))return g=g.get(b)||null,d(w,g,k,T,null);Cl(w,k)}return null}function h(g,w,b,k){for(var T=null,E=null,_=w,P=w=0,M=null;_!==null&&P<b.length;P++){_.index>P?(M=_,_=null):M=_.sibling;var N=f(g,_,b[P],k);if(N===null){_===null&&(_=M);break}e&&_&&N.alternate===null&&t(g,_),w=s(N,w,P),E===null?T=N:E.sibling=N,E=N,_=M}if(P===b.length)return n(g,_),Ee&&yi(g,P),T;if(_===null){for(;P<b.length;P++)_=u(g,b[P],k),_!==null&&(w=s(_,w,P),E===null?T=_:E.sibling=_,E=_);return Ee&&yi(g,P),T}for(_=r(g,_);P<b.length;P++)M=p(_,g,P,b[P],k),M!==null&&(e&&M.alternate!==null&&_.delete(M.key===null?P:M.key),w=s(M,w,P),E===null?T=M:E.sibling=M,E=M);return e&&_.forEach(function(R){return t(g,R)}),Ee&&yi(g,P),T}function m(g,w,b,k){var T=jo(b);if(typeof T!="function")throw Error(I(150));if(b=T.call(b),b==null)throw Error(I(151));for(var E=T=null,_=w,P=w=0,M=null,N=b.next();_!==null&&!N.done;P++,N=b.next()){_.index>P?(M=_,_=null):M=_.sibling;var R=f(g,_,N.value,k);if(R===null){_===null&&(_=M);break}e&&_&&R.alternate===null&&t(g,_),w=s(R,w,P),E===null?T=R:E.sibling=R,E=R,_=M}if(N.done)return n(g,_),Ee&&yi(g,P),T;if(_===null){for(;!N.done;P++,N=b.next())N=u(g,N.value,k),N!==null&&(w=s(N,w,P),E===null?T=N:E.sibling=N,E=N);return Ee&&yi(g,P),T}for(_=r(g,_);!N.done;P++,N=b.next())N=p(_,g,P,N.value,k),N!==null&&(e&&N.alternate!==null&&_.delete(N.key===null?P:N.key),w=s(N,w,P),E===null?T=N:E.sibling=N,E=N);return e&&_.forEach(function(F){return t(g,F)}),Ee&&yi(g,P),T}function x(g,w,b,k){if(typeof b=="object"&&b!==null&&b.type===ws&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case pl:e:{for(var T=b.key,E=w;E!==null;){if(E.key===T){if(T=b.type,T===ws){if(E.tag===7){n(g,E.sibling),w=i(E,b.props.children),w.return=g,g=w;break e}}else if(E.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===Cr&&uv(T)===E.type){n(g,E.sibling),w=i(E,b.props),w.ref=Fo(g,E,b),w.return=g,g=w;break e}n(g,E);break}else t(g,E);E=E.sibling}b.type===ws?(w=Bi(b.props.children,g.mode,k,b.key),w.return=g,g=w):(k=Jl(b.type,b.key,b.props,null,g.mode,k),k.ref=Fo(g,w,b),k.return=g,g=k)}return o(g);case xs:e:{for(E=b.key;w!==null;){if(w.key===E)if(w.tag===4&&w.stateNode.containerInfo===b.containerInfo&&w.stateNode.implementation===b.implementation){n(g,w.sibling),w=i(w,b.children||[]),w.return=g,g=w;break e}else{n(g,w);break}else t(g,w);w=w.sibling}w=Cd(b,g.mode,k),w.return=g,g=w}return o(g);case Cr:return E=b._init,x(g,w,E(b._payload),k)}if(zo(b))return h(g,w,b,k);if(jo(b))return m(g,w,b,k);Cl(g,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,w!==null&&w.tag===6?(n(g,w.sibling),w=i(w,b),w.return=g,g=w):(n(g,w),w=kd(b,g.mode,k),w.return=g,g=w),o(g)):n(g,w)}return x}var oo=J1(!0),ew=J1(!1),Eu=ai(null),_u=null,Ps=null,Oh=null;function Dh(){Oh=Ps=_u=null}function Fh(e){var t=Eu.current;Te(Eu),e._currentValue=t}function Mf(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 zs(e,t){_u=e,Oh=Ps=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(At=!0),e.firstContext=null)}function un(e){var t=e._currentValue;if(Oh!==e)if(e={context:e,memoizedValue:t,next:null},Ps===null){if(_u===null)throw Error(I(308));Ps=e,_u.dependencies={lanes:0,firstContext:e}}else Ps=Ps.next=e;return t}var Ei=null;function Mh(e){Ei===null?Ei=[e]:Ei.push(e)}function tw(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Mh(t)):(n.next=i.next,i.next=n),t.interleaved=n,fr(e,r)}function fr(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 Tr=!1;function Nh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function nw(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function lr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function qr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,de&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,fr(e,n)}return i=r.interleaved,i===null?(t.next=t,Mh(r)):(t.next=i.next,i.next=t),r.interleaved=t,fr(e,n)}function Gl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,bh(e,n)}}function cv(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 Pu(e,t,n,r){var i=e.updateQueue;Tr=!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 f=a.lane,p=a.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var h=e,m=a;switch(f=t,p=n,m.tag){case 1:if(h=m.payload,typeof h=="function"){u=h.call(p,u,f);break e}u=h;break e;case 3:h.flags=h.flags&-65537|128;case 0:if(h=m.payload,f=typeof h=="function"?h.call(p,u,f):h,f==null)break e;u=Ae({},u,f);break e;case 2:Tr=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[a]:f.push(a))}else p={eventTime:p,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(c=d=p,l=u):d=d.next=p,o|=f;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;f=a,a=f.next,f.next=null,i.lastBaseUpdate=f,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);Gi|=o,e.lanes=o,e.memoizedState=u}}function dv(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(I(191,i));i.call(r)}}}var Ka={},Vn=ai(Ka),ba=ai(Ka),Sa=ai(Ka);function _i(e){if(e===Ka)throw Error(I(174));return e}function Lh(e,t){switch(be(Sa,t),be(ba,e),be(Vn,Ka),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:mf(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=mf(t,e)}Te(Vn),be(Vn,t)}function ao(){Te(Vn),Te(ba),Te(Sa)}function rw(e){_i(Sa.current);var t=_i(Vn.current),n=mf(t,e.type);t!==n&&(be(ba,e),be(Vn,n))}function Ih(e){ba.current===e&&(Te(Vn),Te(ba))}var Pe=ai(0);function ju(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var vd=[];function $h(){for(var e=0;e<vd.length;e++)vd[e]._workInProgressVersionPrimary=null;vd.length=0}var Ql=mr.ReactCurrentDispatcher,yd=mr.ReactCurrentBatchConfig,qi=0,Re=null,Ue=null,Ke=null,Ru=!1,Jo=!1,ka=0,UE=0;function ut(){throw Error(I(321))}function Bh(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Tn(e[n],t[n]))return!1;return!0}function zh(e,t,n,r,i,s){if(qi=s,Re=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ql.current=e===null||e.memoizedState===null?GE:QE,e=n(r,i),Jo){s=0;do{if(Jo=!1,ka=0,25<=s)throw Error(I(301));s+=1,Ke=Ue=null,t.updateQueue=null,Ql.current=YE,e=n(r,i)}while(Jo)}if(Ql.current=Au,t=Ue!==null&&Ue.next!==null,qi=0,Ke=Ue=Re=null,Ru=!1,t)throw Error(I(300));return e}function Vh(){var e=ka!==0;return ka=0,e}function Dn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ke===null?Re.memoizedState=Ke=e:Ke=Ke.next=e,Ke}function cn(){if(Ue===null){var e=Re.alternate;e=e!==null?e.memoizedState:null}else e=Ue.next;var t=Ke===null?Re.memoizedState:Ke.next;if(t!==null)Ke=t,Ue=e;else{if(e===null)throw Error(I(310));Ue=e,e={memoizedState:Ue.memoizedState,baseState:Ue.baseState,baseQueue:Ue.baseQueue,queue:Ue.queue,next:null},Ke===null?Re.memoizedState=Ke=e:Ke=Ke.next=e}return Ke}function Ca(e,t){return typeof t=="function"?t(e):t}function xd(e){var t=cn(),n=t.queue;if(n===null)throw Error(I(311));n.lastRenderedReducer=e;var r=Ue,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((qi&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,Re.lanes|=d,Gi|=d}c=c.next}while(c!==null&&c!==s);l===null?o=r:l.next=a,Tn(r,t.memoizedState)||(At=!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,Re.lanes|=s,Gi|=s,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function wd(e){var t=cn(),n=t.queue;if(n===null)throw Error(I(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);Tn(s,t.memoizedState)||(At=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function iw(){}function sw(e,t){var n=Re,r=cn(),i=t(),s=!Tn(r.memoizedState,i);if(s&&(r.memoizedState=i,At=!0),r=r.queue,Uh(lw.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||Ke!==null&&Ke.memoizedState.tag&1){if(n.flags|=2048,Ta(9,aw.bind(null,n,r,i,t),void 0,null),Xe===null)throw Error(I(349));qi&30||ow(n,t,i)}return i}function ow(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Re.updateQueue,t===null?(t={lastEffect:null,stores:null},Re.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function aw(e,t,n,r){t.value=n,t.getSnapshot=r,uw(t)&&cw(e)}function lw(e,t,n){return n(function(){uw(t)&&cw(e)})}function uw(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Tn(e,n)}catch{return!0}}function cw(e){var t=fr(e,1);t!==null&&Cn(t,e,1,-1)}function fv(e){var t=Dn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ca,lastRenderedState:e},t.queue=e,e=e.dispatch=qE.bind(null,Re,e),[t.memoizedState,e]}function Ta(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Re.updateQueue,t===null?(t={lastEffect:null,stores:null},Re.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function dw(){return cn().memoizedState}function Yl(e,t,n,r){var i=Dn();Re.flags|=e,i.memoizedState=Ta(1|t,n,void 0,r===void 0?null:r)}function uc(e,t,n,r){var i=cn();r=r===void 0?null:r;var s=void 0;if(Ue!==null){var o=Ue.memoizedState;if(s=o.destroy,r!==null&&Bh(r,o.deps)){i.memoizedState=Ta(t,n,s,r);return}}Re.flags|=e,i.memoizedState=Ta(1|t,n,s,r)}function pv(e,t){return Yl(8390656,8,e,t)}function Uh(e,t){return uc(2048,8,e,t)}function fw(e,t){return uc(4,2,e,t)}function pw(e,t){return uc(4,4,e,t)}function hw(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function mw(e,t,n){return n=n!=null?n.concat([e]):null,uc(4,4,hw.bind(null,t,e),n)}function Hh(){}function gw(e,t){var n=cn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Bh(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function vw(e,t){var n=cn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Bh(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function yw(e,t,n){return qi&21?(Tn(n,t)||(n=k1(),Re.lanes|=n,Gi|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,At=!0),e.memoizedState=n)}function HE(e,t){var n=he;he=n!==0&&4>n?n:4,e(!0);var r=yd.transition;yd.transition={};try{e(!1),t()}finally{he=n,yd.transition=r}}function xw(){return cn().memoizedState}function WE(e,t,n){var r=Qr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ww(e))bw(t,n);else if(n=tw(e,t,n,r),n!==null){var i=wt();Cn(n,e,r,i),Sw(n,t,r)}}function qE(e,t,n){var r=Qr(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ww(e))bw(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,Tn(a,o)){var l=t.interleaved;l===null?(i.next=i,Mh(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=tw(e,t,i,r),n!==null&&(i=wt(),Cn(n,e,r,i),Sw(n,t,r))}}function ww(e){var t=e.alternate;return e===Re||t!==null&&t===Re}function bw(e,t){Jo=Ru=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Sw(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,bh(e,n)}}var Au={readContext:un,useCallback:ut,useContext:ut,useEffect:ut,useImperativeHandle:ut,useInsertionEffect:ut,useLayoutEffect:ut,useMemo:ut,useReducer:ut,useRef:ut,useState:ut,useDebugValue:ut,useDeferredValue:ut,useTransition:ut,useMutableSource:ut,useSyncExternalStore:ut,useId:ut,unstable_isNewReconciler:!1},GE={readContext:un,useCallback:function(e,t){return Dn().memoizedState=[e,t===void 0?null:t],e},useContext:un,useEffect:pv,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Yl(4194308,4,hw.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Yl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Yl(4,2,e,t)},useMemo:function(e,t){var n=Dn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Dn();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=WE.bind(null,Re,e),[r.memoizedState,e]},useRef:function(e){var t=Dn();return e={current:e},t.memoizedState=e},useState:fv,useDebugValue:Hh,useDeferredValue:function(e){return Dn().memoizedState=e},useTransition:function(){var e=fv(!1),t=e[0];return e=HE.bind(null,e[1]),Dn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Re,i=Dn();if(Ee){if(n===void 0)throw Error(I(407));n=n()}else{if(n=t(),Xe===null)throw Error(I(349));qi&30||ow(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,pv(lw.bind(null,r,s,e),[e]),r.flags|=2048,Ta(9,aw.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Dn(),t=Xe.identifierPrefix;if(Ee){var n=or,r=sr;n=(r&~(1<<32-kn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ka++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=UE++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},QE={readContext:un,useCallback:gw,useContext:un,useEffect:Uh,useImperativeHandle:mw,useInsertionEffect:fw,useLayoutEffect:pw,useMemo:vw,useReducer:xd,useRef:dw,useState:function(){return xd(Ca)},useDebugValue:Hh,useDeferredValue:function(e){var t=cn();return yw(t,Ue.memoizedState,e)},useTransition:function(){var e=xd(Ca)[0],t=cn().memoizedState;return[e,t]},useMutableSource:iw,useSyncExternalStore:sw,useId:xw,unstable_isNewReconciler:!1},YE={readContext:un,useCallback:gw,useContext:un,useEffect:Uh,useImperativeHandle:mw,useInsertionEffect:fw,useLayoutEffect:pw,useMemo:vw,useReducer:wd,useRef:dw,useState:function(){return wd(Ca)},useDebugValue:Hh,useDeferredValue:function(e){var t=cn();return Ue===null?t.memoizedState=e:yw(t,Ue.memoizedState,e)},useTransition:function(){var e=wd(Ca)[0],t=cn().memoizedState;return[e,t]},useMutableSource:iw,useSyncExternalStore:sw,useId:xw,unstable_isNewReconciler:!1};function vn(e,t){if(e&&e.defaultProps){t=Ae({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Nf(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Ae({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var cc={isMounted:function(e){return(e=e._reactInternals)?es(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=wt(),i=Qr(e),s=lr(r,i);s.payload=t,n!=null&&(s.callback=n),t=qr(e,s,i),t!==null&&(Cn(t,e,i,r),Gl(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=wt(),i=Qr(e),s=lr(r,i);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=qr(e,s,i),t!==null&&(Cn(t,e,i,r),Gl(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=wt(),r=Qr(e),i=lr(n,r);i.tag=2,t!=null&&(i.callback=t),t=qr(e,i,r),t!==null&&(Cn(t,e,r,n),Gl(t,e,r))}};function hv(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?!va(n,r)||!va(i,s):!0}function kw(e,t,n){var r=!1,i=ni,s=t.contextType;return typeof s=="object"&&s!==null?s=un(s):(i=Dt(t)?Hi:mt.current,r=t.contextTypes,s=(r=r!=null)?io(e,i):ni),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=cc,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function mv(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&&cc.enqueueReplaceState(t,t.state,null)}function Lf(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Nh(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=un(s):(s=Dt(t)?Hi:mt.current,i.context=io(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(Nf(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&&cc.enqueueReplaceState(i,i.state,null),Pu(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function lo(e,t){try{var n="",r=t;do n+=kT(r),r=r.return;while(r);var i=n}catch(s){i=`
|
|
39
39
|
Error generating stack: `+s.message+`
|
|
40
|
-
`+s.stack}return{value:e,source:t,stack:i,digest:null}}function bd(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function If(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var KE=typeof WeakMap=="function"?WeakMap:Map;function Cw(e,t,n){n=lr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Du||(Du=!0,Qf=r),If(e,t)},n}function Tw(e,t,n){n=lr(-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(){If(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){If(e,t),typeof r!="function"&&(Gr===null?Gr=new Set([this]):Gr.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function gv(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new KE;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=c_.bind(null,e,t,n),t.then(e,e))}function vv(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 yv(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=lr(-1,1),t.tag=2,qr(n,t,1))),n.lanes|=1),e)}var XE=mr.ReactCurrentOwner,At=!1;function yt(e,t,n,r){t.child=e===null?ew(t,null,n,r):oo(t,e.child,n,r)}function xv(e,t,n,r,i){n=n.render;var s=t.ref;return zs(t,i),r=zh(e,t,n,r,s,i),n=Vh(),e!==null&&!At?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,pr(e,t,i)):(Ee&&n&&jh(t),t.flags|=1,yt(e,t,r,i),t.child)}function wv(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!Zh(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,Ew(e,t,s,r,i)):(e=Jl(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:va,n(o,r)&&e.ref===t.ref)return pr(e,t,i)}return t.flags|=1,e=Yr(s,r),e.ref=t.ref,e.return=t,t.child=e}function Ew(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(va(s,r)&&e.ref===t.ref)if(At=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(At=!0);else return t.lanes=e.lanes,pr(e,t,i)}return $f(e,t,n,r,i)}function _w(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},be(Rs,$t),$t|=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,be(Rs,$t),$t|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,be(Rs,$t),$t|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,be(Rs,$t),$t|=r;return yt(e,t,i,n),t.child}function Pw(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function $f(e,t,n,r,i){var s=Dt(n)?Hi:mt.current;return s=io(t,s),zs(t,i),n=zh(e,t,n,r,s,i),r=Vh(),e!==null&&!At?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,pr(e,t,i)):(Ee&&r&&jh(t),t.flags|=1,yt(e,t,n,i),t.child)}function bv(e,t,n,r,i){if(Dt(n)){var s=!0;ku(t)}else s=!1;if(zs(t,i),t.stateNode===null)Kl(e,t),kw(t,n,r),Lf(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=un(c):(c=Dt(n)?Hi:mt.current,c=io(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)&&mv(t,o,r,c),Tr=!1;var f=t.memoizedState;o.state=f,Pu(t,r,o,i),l=t.memoizedState,a!==r||f!==l||Ot.current||Tr?(typeof d=="function"&&(Nf(t,n,d,r),l=t.memoizedState),(a=Tr||hv(t,n,a,r,f,l,c))?(u||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=c,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,nw(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:vn(t.type,a),o.props=c,u=t.pendingProps,f=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=un(l):(l=Dt(n)?Hi:mt.current,l=io(t,l));var p=n.getDerivedStateFromProps;(d=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==u||f!==l)&&mv(t,o,r,l),Tr=!1,f=t.memoizedState,o.state=f,Pu(t,r,o,i);var h=t.memoizedState;a!==u||f!==h||Ot.current||Tr?(typeof p=="function"&&(Nf(t,n,p,r),h=t.memoizedState),(c=Tr||hv(t,n,c,r,f,h,l)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,h,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,h,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=h),o.props=r,o.state=h,o.context=l,r=c):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Bf(e,t,n,r,s,i)}function Bf(e,t,n,r,i,s){Pw(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&ov(t,n,!1),pr(e,t,s);r=t.stateNode,XE.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=oo(t,e.child,null,s),t.child=oo(t,null,a,s)):yt(e,t,a,s),t.memoizedState=r.state,i&&ov(t,n,!0),t.child}function jw(e){var t=e.stateNode;t.pendingContext?sv(e,t.pendingContext,t.pendingContext!==t.context):t.context&&sv(e,t.context,!1),Lh(e,t.containerInfo)}function Sv(e,t,n,r,i){return so(),Ah(i),t.flags|=256,yt(e,t,n,r),t.child}var zf={dehydrated:null,treeContext:null,retryLane:0};function Vf(e){return{baseLanes:e,cachePool:null,transitions:null}}function Rw(e,t,n){var r=t.pendingProps,i=Pe.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),be(Pe,i&1),e===null)return Ff(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=pc(o,r,0,null),e=Bi(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Vf(n),t.memoizedState=zf,e):Wh(t,o));if(i=e.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return ZE(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=Yr(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=Yr(a,s):(s=Bi(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?Vf(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~n,t.memoizedState=zf,r}return s=e.child,e=s.sibling,r=Yr(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Wh(e,t){return t=pc({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Tl(e,t,n,r){return r!==null&&Ah(r),oo(t,e.child,null,n),e=Wh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function ZE(e,t,n,r,i,s,o){if(n)return t.flags&256?(t.flags&=-257,r=bd(Error(I(422))),Tl(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=pc({mode:"visible",children:r.children},i,0,null),s=Bi(s,i,o,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&oo(t,e.child,null,o),t.child.memoizedState=Vf(o),t.memoizedState=zf,s);if(!(t.mode&1))return Tl(e,t,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(I(419)),r=bd(s,r,void 0),Tl(e,t,o,r)}if(a=(o&e.childLanes)!==0,At||a){if(r=Xe,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,fr(e,i),Cn(r,e,i,-1))}return Xh(),r=bd(Error(I(421))),Tl(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=d_.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,Bt=Wr(i.nextSibling),Ut=t,Ee=!0,bn=null,e!==null&&(tn[nn++]=sr,tn[nn++]=or,tn[nn++]=Wi,sr=e.id,or=e.overflow,Wi=t),t=Wh(t,r.children),t.flags|=4096,t)}function kv(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Mf(e.return,t,n)}function Sd(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 Aw(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(yt(e,t,r.children,n),r=Pe.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&&kv(e,n,t);else if(e.tag===19)kv(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(be(Pe,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&&ju(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Sd(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&&ju(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Sd(t,!0,n,null,s);break;case"together":Sd(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Kl(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function pr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Gi|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(I(153));if(t.child!==null){for(e=t.child,n=Yr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Yr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function JE(e,t,n){switch(t.tag){case 3:jw(t),so();break;case 5:rw(t);break;case 1:Dt(t.type)&&ku(t);break;case 4:Lh(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;be(Eu,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(be(Pe,Pe.current&1),t.flags|=128,null):n&t.child.childLanes?Rw(e,t,n):(be(Pe,Pe.current&1),e=pr(e,t,n),e!==null?e.sibling:null);be(Pe,Pe.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Aw(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),be(Pe,Pe.current),r)break;return null;case 22:case 23:return t.lanes=0,_w(e,t,n)}return pr(e,t,n)}var Ow,Uf,Dw,Fw;Ow=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}};Uf=function(){};Dw=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,_i(Vn.current);var s=null;switch(n){case"input":i=df(e,i),r=df(e,r),s=[];break;case"select":i=Ae({},i,{value:void 0}),r=Ae({},r,{value:void 0}),s=[];break;case"textarea":i=hf(e,i),r=hf(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=bu)}gf(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"&&(ca.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"&&(ca.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&ke("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)}};Fw=function(e,t,n,r){n!==r&&(t.flags|=4)};function Mo(e,t){if(!Ee)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 ct(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 e_(e,t,n){var r=t.pendingProps;switch(Rh(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ct(t),null;case 1:return Dt(t.type)&&Su(),ct(t),null;case 3:return r=t.stateNode,ao(),Te(Ot),Te(mt),$h(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(kl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,bn!==null&&(Xf(bn),bn=null))),Uf(e,t),ct(t),null;case 5:Ih(t);var i=_i(Sa.current);if(n=t.type,e!==null&&t.stateNode!=null)Dw(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(I(166));return ct(t),null}if(e=_i(Vn.current),kl(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[$n]=t,r[wa]=s,e=(t.mode&1)!==0,n){case"dialog":ke("cancel",r),ke("close",r);break;case"iframe":case"object":case"embed":ke("load",r);break;case"video":case"audio":for(i=0;i<Uo.length;i++)ke(Uo[i],r);break;case"source":ke("error",r);break;case"img":case"image":case"link":ke("error",r),ke("load",r);break;case"details":ke("toggle",r);break;case"input":Og(r,s),ke("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},ke("invalid",r);break;case"textarea":Fg(r,s),ke("invalid",r)}gf(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&&Sl(r.textContent,a,e),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&Sl(r.textContent,a,e),i=["children",""+a]):ca.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&ke("scroll",r)}switch(n){case"input":hl(r),Dg(r,s,!0);break;case"textarea":hl(r),Mg(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=bu)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=l1(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[$n]=t,e[wa]=r,Ow(e,t,!1,!1),t.stateNode=e;e:{switch(o=vf(n,r),n){case"dialog":ke("cancel",e),ke("close",e),i=r;break;case"iframe":case"object":case"embed":ke("load",e),i=r;break;case"video":case"audio":for(i=0;i<Uo.length;i++)ke(Uo[i],e);i=r;break;case"source":ke("error",e),i=r;break;case"img":case"image":case"link":ke("error",e),ke("load",e),i=r;break;case"details":ke("toggle",e),i=r;break;case"input":Og(e,r),i=df(e,r),ke("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Ae({},r,{value:void 0}),ke("invalid",e);break;case"textarea":Fg(e,r),i=hf(e,r),ke("invalid",e);break;default:i=r}gf(n,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?d1(e,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&u1(e,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&da(e,l):typeof l=="number"&&da(e,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(ca.hasOwnProperty(s)?l!=null&&s==="onScroll"&&ke("scroll",e):l!=null&&mh(e,s,l,o))}switch(n){case"input":hl(e),Dg(e,r,!1);break;case"textarea":hl(e),Mg(e);break;case"option":r.value!=null&&e.setAttribute("value",""+ti(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?Ls(e,!!r.multiple,s,!1):r.defaultValue!=null&&Ls(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=bu)}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 ct(t),null;case 6:if(e&&t.stateNode!=null)Fw(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(I(166));if(n=_i(Sa.current),_i(Vn.current),kl(t)){if(r=t.stateNode,n=t.memoizedProps,r[$n]=t,(s=r.nodeValue!==n)&&(e=Ut,e!==null))switch(e.tag){case 3:Sl(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Sl(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[$n]=t,t.stateNode=r}return ct(t),null;case 13:if(Te(Pe),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ee&&Bt!==null&&t.mode&1&&!(t.flags&128))Z1(),so(),t.flags|=98560,s=!1;else if(s=kl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(I(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(I(317));s[$n]=t}else so(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ct(t),s=!1}else bn!==null&&(Xf(bn),bn=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||Pe.current&1?We===0&&(We=3):Xh())),t.updateQueue!==null&&(t.flags|=4),ct(t),null);case 4:return ao(),Uf(e,t),e===null&&ya(t.stateNode.containerInfo),ct(t),null;case 10:return Fh(t.type._context),ct(t),null;case 17:return Dt(t.type)&&Su(),ct(t),null;case 19:if(Te(Pe),s=t.memoizedState,s===null)return ct(t),null;if(r=(t.flags&128)!==0,o=s.rendering,o===null)if(r)Mo(s,!1);else{if(We!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ju(e),o!==null){for(t.flags|=128,Mo(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 be(Pe,Pe.current&1|2),t.child}e=e.sibling}s.tail!==null&&$e()>uo&&(t.flags|=128,r=!0,Mo(s,!1),t.lanes=4194304)}else{if(!r)if(e=ju(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Mo(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Ee)return ct(t),null}else 2*$e()-s.renderingStartTime>uo&&n!==1073741824&&(t.flags|=128,r=!0,Mo(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=$e(),t.sibling=null,n=Pe.current,be(Pe,r?n&1|2:n&1),t):(ct(t),null);case 22:case 23:return Kh(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?$t&1073741824&&(ct(t),t.subtreeFlags&6&&(t.flags|=8192)):ct(t),null;case 24:return null;case 25:return null}throw Error(I(156,t.tag))}function t_(e,t){switch(Rh(t),t.tag){case 1:return Dt(t.type)&&Su(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ao(),Te(Ot),Te(mt),$h(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ih(t),null;case 13:if(Te(Pe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(I(340));so()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Te(Pe),null;case 4:return ao(),null;case 10:return Fh(t.type._context),null;case 22:case 23:return Kh(),null;case 24:return null;default:return null}}var El=!1,pt=!1,n_=typeof WeakSet=="function"?WeakSet:Set,W=null;function js(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Me(e,t,r)}else n.current=null}function Hf(e,t,n){try{n()}catch(r){Me(e,t,r)}}var Cv=!1;function r_(e,t){if(_f=yu,e=$1(),Ph(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,f=null;t:for(;;){for(var p;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),(p=u.firstChild)!==null;)f=u,u=p;for(;;){if(u===e)break t;if(f===n&&++c===i&&(a=o),f===s&&++d===r&&(l=o),(p=u.nextSibling)!==null)break;u=f,f=u.parentNode}u=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Pf={focusedElem:e,selectionRange:n},yu=!1,W=t;W!==null;)if(t=W,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,W=e;else for(;W!==null;){t=W;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var m=h.memoizedProps,x=h.memoizedState,g=t.stateNode,w=g.getSnapshotBeforeUpdate(t.elementType===t.type?m:vn(t.type,m),x);g.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(I(163))}}catch(k){Me(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,W=e;break}W=t.return}return h=Cv,Cv=!1,h}function ea(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&&Hf(t,n,s)}i=i.next}while(i!==r)}}function dc(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 Wf(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 Mw(e){var t=e.alternate;t!==null&&(e.alternate=null,Mw(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[$n],delete t[wa],delete t[Af],delete t[$E],delete t[BE])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Nw(e){return e.tag===5||e.tag===3||e.tag===4}function Tv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Nw(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function qf(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=bu));else if(r!==4&&(e=e.child,e!==null))for(qf(e,t,n),e=e.sibling;e!==null;)qf(e,t,n),e=e.sibling}function Gf(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(Gf(e,t,n),e=e.sibling;e!==null;)Gf(e,t,n),e=e.sibling}var rt=null,xn=!1;function br(e,t,n){for(n=n.child;n!==null;)Lw(e,t,n),n=n.sibling}function Lw(e,t,n){if(zn&&typeof zn.onCommitFiberUnmount=="function")try{zn.onCommitFiberUnmount(rc,n)}catch{}switch(n.tag){case 5:pt||js(n,t);case 6:var r=rt,i=xn;rt=null,br(e,t,n),rt=r,xn=i,rt!==null&&(xn?(e=rt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):rt.removeChild(n.stateNode));break;case 18:rt!==null&&(xn?(e=rt,n=n.stateNode,e.nodeType===8?md(e.parentNode,n):e.nodeType===1&&md(e,n),ma(e)):md(rt,n.stateNode));break;case 4:r=rt,i=xn,rt=n.stateNode.containerInfo,xn=!0,br(e,t,n),rt=r,xn=i;break;case 0:case 11:case 14:case 15:if(!pt&&(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)&&Hf(n,t,o),i=i.next}while(i!==r)}br(e,t,n);break;case 1:if(!pt&&(js(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Me(n,t,a)}br(e,t,n);break;case 21:br(e,t,n);break;case 22:n.mode&1?(pt=(r=pt)||n.memoizedState!==null,br(e,t,n),pt=r):br(e,t,n);break;default:br(e,t,n)}}function Ev(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new n_),t.forEach(function(r){var i=f_.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function hn(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:rt=a.stateNode,xn=!1;break e;case 3:rt=a.stateNode.containerInfo,xn=!0;break e;case 4:rt=a.stateNode.containerInfo,xn=!0;break e}a=a.return}if(rt===null)throw Error(I(160));Lw(s,o,i),rt=null,xn=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(c){Me(i,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Iw(t,e),t=t.sibling}function Iw(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(hn(t,e),Rn(e),r&4){try{ea(3,e,e.return),dc(3,e)}catch(m){Me(e,e.return,m)}try{ea(5,e,e.return)}catch(m){Me(e,e.return,m)}}break;case 1:hn(t,e),Rn(e),r&512&&n!==null&&js(n,n.return);break;case 5:if(hn(t,e),Rn(e),r&512&&n!==null&&js(n,n.return),e.flags&32){var i=e.stateNode;try{da(i,"")}catch(m){Me(e,e.return,m)}}if(r&4&&(i=e.stateNode,i!=null)){var s=e.memoizedProps,o=n!==null?n.memoizedProps:s,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&o1(i,s),vf(a,o);var c=vf(a,s);for(o=0;o<l.length;o+=2){var d=l[o],u=l[o+1];d==="style"?d1(i,u):d==="dangerouslySetInnerHTML"?u1(i,u):d==="children"?da(i,u):mh(i,d,u,c)}switch(a){case"input":ff(i,s);break;case"textarea":a1(i,s);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var p=s.value;p!=null?Ls(i,!!s.multiple,p,!1):f!==!!s.multiple&&(s.defaultValue!=null?Ls(i,!!s.multiple,s.defaultValue,!0):Ls(i,!!s.multiple,s.multiple?[]:"",!1))}i[wa]=s}catch(m){Me(e,e.return,m)}}break;case 6:if(hn(t,e),Rn(e),r&4){if(e.stateNode===null)throw Error(I(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(m){Me(e,e.return,m)}}break;case 3:if(hn(t,e),Rn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ma(t.containerInfo)}catch(m){Me(e,e.return,m)}break;case 4:hn(t,e),Rn(e);break;case 13:hn(t,e),Rn(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(Qh=$e())),r&4&&Ev(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(pt=(c=pt)||d,hn(t,e),pt=c):hn(t,e),Rn(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!d&&e.mode&1)for(W=e,d=e.child;d!==null;){for(u=W=d;W!==null;){switch(f=W,p=f.child,f.tag){case 0:case 11:case 14:case 15:ea(4,f,f.return);break;case 1:js(f,f.return);var h=f.stateNode;if(typeof h.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,h.props=t.memoizedProps,h.state=t.memoizedState,h.componentWillUnmount()}catch(m){Me(r,n,m)}}break;case 5:js(f,f.return);break;case 22:if(f.memoizedState!==null){Pv(u);continue}}p!==null?(p.return=f,W=p):Pv(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=c1("display",o))}catch(m){Me(e,e.return,m)}}}else if(u.tag===6){if(d===null)try{u.stateNode.nodeValue=c?"":u.memoizedProps}catch(m){Me(e,e.return,m)}}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:hn(t,e),Rn(e),r&4&&Ev(e);break;case 21:break;default:hn(t,e),Rn(e)}}function Rn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Nw(n)){var r=n;break e}n=n.return}throw Error(I(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(da(i,""),r.flags&=-33);var s=Tv(e);Gf(e,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,a=Tv(e);qf(e,a,o);break;default:throw Error(I(161))}}catch(l){Me(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function i_(e,t,n){W=e,$w(e)}function $w(e,t,n){for(var r=(e.mode&1)!==0;W!==null;){var i=W,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||El;if(!o){var a=i.alternate,l=a!==null&&a.memoizedState!==null||pt;a=El;var c=pt;if(El=o,(pt=l)&&!c)for(W=i;W!==null;)o=W,l=o.child,o.tag===22&&o.memoizedState!==null?jv(i):l!==null?(l.return=o,W=l):jv(i);for(;s!==null;)W=s,$w(s),s=s.sibling;W=i,El=a,pt=c}_v(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,W=s):_v(e)}}function _v(e){for(;W!==null;){var t=W;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:pt||dc(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!pt)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:vn(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&dv(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}dv(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(I(163))}pt||t.flags&512&&Wf(t)}catch(f){Me(t,t.return,f)}}if(t===e){W=null;break}if(n=t.sibling,n!==null){n.return=t.return,W=n;break}W=t.return}}function Pv(e){for(;W!==null;){var t=W;if(t===e){W=null;break}var n=t.sibling;if(n!==null){n.return=t.return,W=n;break}W=t.return}}function jv(e){for(;W!==null;){var t=W;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{dc(4,t)}catch(l){Me(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){Me(t,i,l)}}var s=t.return;try{Wf(t)}catch(l){Me(t,s,l)}break;case 5:var o=t.return;try{Wf(t)}catch(l){Me(t,o,l)}}}catch(l){Me(t,t.return,l)}if(t===e){W=null;break}var a=t.sibling;if(a!==null){a.return=t.return,W=a;break}W=t.return}}var s_=Math.ceil,Ou=mr.ReactCurrentDispatcher,qh=mr.ReactCurrentOwner,an=mr.ReactCurrentBatchConfig,de=0,Xe=null,Be=null,ot=0,$t=0,Rs=ai(0),We=0,Ea=null,Gi=0,fc=0,Gh=0,ta=null,jt=null,Qh=0,uo=1/0,tr=null,Du=!1,Qf=null,Gr=null,_l=!1,$r=null,Fu=0,na=0,Yf=null,Xl=-1,Zl=0;function wt(){return de&6?$e():Xl!==-1?Xl:Xl=$e()}function Qr(e){return e.mode&1?de&2&&ot!==0?ot&-ot:VE.transition!==null?(Zl===0&&(Zl=k1()),Zl):(e=he,e!==0||(e=window.event,e=e===void 0?16:R1(e.type)),e):1}function Cn(e,t,n,r){if(50<na)throw na=0,Yf=null,Error(I(185));Ga(e,n,r),(!(de&2)||e!==Xe)&&(e===Xe&&(!(de&2)&&(fc|=n),We===4&&Pr(e,ot)),Ft(e,r),n===1&&de===0&&!(t.mode&1)&&(uo=$e()+500,lc&&li()))}function Ft(e,t){var n=e.callbackNode;VT(e,t);var r=vu(e,e===Xe?ot:0);if(r===0)n!==null&&Ig(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Ig(n),t===1)e.tag===0?zE(Rv.bind(null,e)):Y1(Rv.bind(null,e)),LE(function(){!(de&6)&&li()}),n=null;else{switch(C1(r)){case 1:n=wh;break;case 4:n=b1;break;case 16:n=gu;break;case 536870912:n=S1;break;default:n=gu}n=Gw(n,Bw.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Bw(e,t){if(Xl=-1,Zl=0,de&6)throw Error(I(327));var n=e.callbackNode;if(Vs()&&e.callbackNode!==n)return null;var r=vu(e,e===Xe?ot:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Mu(e,r);else{t=r;var i=de;de|=2;var s=Vw();(Xe!==e||ot!==t)&&(tr=null,uo=$e()+500,$i(e,t));do try{l_();break}catch(a){zw(e,a)}while(!0);Dh(),Ou.current=s,de=i,Be!==null?t=0:(Xe=null,ot=0,t=We)}if(t!==0){if(t===2&&(i=Sf(e),i!==0&&(r=i,t=Kf(e,i))),t===1)throw n=Ea,$i(e,0),Pr(e,r),Ft(e,$e()),n;if(t===6)Pr(e,r);else{if(i=e.current.alternate,!(r&30)&&!o_(i)&&(t=Mu(e,r),t===2&&(s=Sf(e),s!==0&&(r=s,t=Kf(e,s))),t===1))throw n=Ea,$i(e,0),Pr(e,r),Ft(e,$e()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(I(345));case 2:xi(e,jt,tr);break;case 3:if(Pr(e,r),(r&130023424)===r&&(t=Qh+500-$e(),10<t)){if(vu(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){wt(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Rf(xi.bind(null,e,jt,tr),t);break}xi(e,jt,tr);break;case 4:if(Pr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-kn(r);s=1<<o,o=t[o],o>i&&(i=o),r&=~s}if(r=i,r=$e()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*s_(r/1960))-r,10<r){e.timeoutHandle=Rf(xi.bind(null,e,jt,tr),r);break}xi(e,jt,tr);break;case 5:xi(e,jt,tr);break;default:throw Error(I(329))}}}return Ft(e,$e()),e.callbackNode===n?Bw.bind(null,e):null}function Kf(e,t){var n=ta;return e.current.memoizedState.isDehydrated&&($i(e,t).flags|=256),e=Mu(e,t),e!==2&&(t=jt,jt=n,t!==null&&Xf(t)),e}function Xf(e){jt===null?jt=e:jt.push.apply(jt,e)}function o_(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(!Tn(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 Pr(e,t){for(t&=~Gh,t&=~fc,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-kn(t),r=1<<n;e[n]=-1,t&=~r}}function Rv(e){if(de&6)throw Error(I(327));Vs();var t=vu(e,0);if(!(t&1))return Ft(e,$e()),null;var n=Mu(e,t);if(e.tag!==0&&n===2){var r=Sf(e);r!==0&&(t=r,n=Kf(e,r))}if(n===1)throw n=Ea,$i(e,0),Pr(e,t),Ft(e,$e()),n;if(n===6)throw Error(I(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,xi(e,jt,tr),Ft(e,$e()),null}function Yh(e,t){var n=de;de|=1;try{return e(t)}finally{de=n,de===0&&(uo=$e()+500,lc&&li())}}function Qi(e){$r!==null&&$r.tag===0&&!(de&6)&&Vs();var t=de;de|=1;var n=an.transition,r=he;try{if(an.transition=null,he=1,e)return e()}finally{he=r,an.transition=n,de=t,!(de&6)&&li()}}function Kh(){$t=Rs.current,Te(Rs)}function $i(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,NE(n)),Be!==null)for(n=Be.return;n!==null;){var r=n;switch(Rh(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Su();break;case 3:ao(),Te(Ot),Te(mt),$h();break;case 5:Ih(r);break;case 4:ao();break;case 13:Te(Pe);break;case 19:Te(Pe);break;case 10:Fh(r.type._context);break;case 22:case 23:Kh()}n=n.return}if(Xe=e,Be=e=Yr(e.current,null),ot=$t=t,We=0,Ea=null,Gh=fc=Gi=0,jt=ta=null,Ei!==null){for(t=0;t<Ei.length;t++)if(n=Ei[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}Ei=null}return e}function zw(e,t){do{var n=Be;try{if(Dh(),Ql.current=Au,Ru){for(var r=Re.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Ru=!1}if(qi=0,Ke=Ue=Re=null,Jo=!1,ka=0,qh.current=null,n===null||n.return===null){We=1,Ea=t,Be=null;break}e:{var s=e,o=n.return,a=n,l=t;if(t=ot,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 f=d.alternate;f?(d.updateQueue=f.updateQueue,d.memoizedState=f.memoizedState,d.lanes=f.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=vv(o);if(p!==null){p.flags&=-257,yv(p,o,a,s,t),p.mode&1&&gv(s,c,t),t=p,l=c;var h=t.updateQueue;if(h===null){var m=new Set;m.add(l),t.updateQueue=m}else h.add(l);break e}else{if(!(t&1)){gv(s,c,t),Xh();break e}l=Error(I(426))}}else if(Ee&&a.mode&1){var x=vv(o);if(x!==null){!(x.flags&65536)&&(x.flags|=256),yv(x,o,a,s,t),Ah(lo(l,a));break e}}s=l=lo(l,a),We!==4&&(We=2),ta===null?ta=[s]:ta.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var g=Cw(s,l,t);cv(s,g);break e;case 1:a=l;var w=s.type,b=s.stateNode;if(!(s.flags&128)&&(typeof w.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Gr===null||!Gr.has(b)))){s.flags|=65536,t&=-t,s.lanes|=t;var k=Tw(s,a,t);cv(s,k);break e}}s=s.return}while(s!==null)}Hw(n)}catch(T){t=T,Be===n&&n!==null&&(Be=n=n.return);continue}break}while(!0)}function Vw(){var e=Ou.current;return Ou.current=Au,e===null?Au:e}function Xh(){(We===0||We===3||We===2)&&(We=4),Xe===null||!(Gi&268435455)&&!(fc&268435455)||Pr(Xe,ot)}function Mu(e,t){var n=de;de|=2;var r=Vw();(Xe!==e||ot!==t)&&(tr=null,$i(e,t));do try{a_();break}catch(i){zw(e,i)}while(!0);if(Dh(),de=n,Ou.current=r,Be!==null)throw Error(I(261));return Xe=null,ot=0,We}function a_(){for(;Be!==null;)Uw(Be)}function l_(){for(;Be!==null&&!DT();)Uw(Be)}function Uw(e){var t=qw(e.alternate,e,$t);e.memoizedProps=e.pendingProps,t===null?Hw(e):Be=t,qh.current=null}function Hw(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=t_(n,t),n!==null){n.flags&=32767,Be=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{We=6,Be=null;return}}else if(n=e_(n,t,$t),n!==null){Be=n;return}if(t=t.sibling,t!==null){Be=t;return}Be=t=e}while(t!==null);We===0&&(We=5)}function xi(e,t,n){var r=he,i=an.transition;try{an.transition=null,he=1,u_(e,t,n,r)}finally{an.transition=i,he=r}return null}function u_(e,t,n,r){do Vs();while($r!==null);if(de&6)throw Error(I(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(I(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(UT(e,s),e===Xe&&(Be=Xe=null,ot=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||_l||(_l=!0,Gw(gu,function(){return Vs(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=an.transition,an.transition=null;var o=he;he=1;var a=de;de|=4,qh.current=null,r_(e,n),Iw(n,e),jE(Pf),yu=!!_f,Pf=_f=null,e.current=n,i_(n),FT(),de=a,he=o,an.transition=s}else e.current=n;if(_l&&(_l=!1,$r=e,Fu=i),s=e.pendingLanes,s===0&&(Gr=null),LT(n.stateNode),Ft(e,$e()),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(Du)throw Du=!1,e=Qf,Qf=null,e;return Fu&1&&e.tag!==0&&Vs(),s=e.pendingLanes,s&1?e===Yf?na++:(na=0,Yf=e):na=0,li(),null}function Vs(){if($r!==null){var e=C1(Fu),t=an.transition,n=he;try{if(an.transition=null,he=16>e?16:e,$r===null)var r=!1;else{if(e=$r,$r=null,Fu=0,de&6)throw Error(I(331));var i=de;for(de|=4,W=e.current;W!==null;){var s=W,o=s.child;if(W.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(W=c;W!==null;){var d=W;switch(d.tag){case 0:case 11:case 15:ea(8,d,s)}var u=d.child;if(u!==null)u.return=d,W=u;else for(;W!==null;){d=W;var f=d.sibling,p=d.return;if(Mw(d),d===c){W=null;break}if(f!==null){f.return=p,W=f;break}W=p}}}var h=s.alternate;if(h!==null){var m=h.child;if(m!==null){h.child=null;do{var x=m.sibling;m.sibling=null,m=x}while(m!==null)}}W=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,W=o;else e:for(;W!==null;){if(s=W,s.flags&2048)switch(s.tag){case 0:case 11:case 15:ea(9,s,s.return)}var g=s.sibling;if(g!==null){g.return=s.return,W=g;break e}W=s.return}}var w=e.current;for(W=w;W!==null;){o=W;var b=o.child;if(o.subtreeFlags&2064&&b!==null)b.return=o,W=b;else e:for(o=w;W!==null;){if(a=W,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:dc(9,a)}}catch(T){Me(a,a.return,T)}if(a===o){W=null;break e}var k=a.sibling;if(k!==null){k.return=a.return,W=k;break e}W=a.return}}if(de=i,li(),zn&&typeof zn.onPostCommitFiberRoot=="function")try{zn.onPostCommitFiberRoot(rc,e)}catch{}r=!0}return r}finally{he=n,an.transition=t}}return!1}function Av(e,t,n){t=lo(n,t),t=Cw(e,t,1),e=qr(e,t,1),t=wt(),e!==null&&(Ga(e,1,t),Ft(e,t))}function Me(e,t,n){if(e.tag===3)Av(e,e,n);else for(;t!==null;){if(t.tag===3){Av(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Gr===null||!Gr.has(r))){e=lo(n,e),e=Tw(t,e,1),t=qr(t,e,1),e=wt(),t!==null&&(Ga(t,1,e),Ft(t,e));break}}t=t.return}}function c_(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=wt(),e.pingedLanes|=e.suspendedLanes&n,Xe===e&&(ot&n)===n&&(We===4||We===3&&(ot&130023424)===ot&&500>$e()-Qh?$i(e,0):Gh|=n),Ft(e,t)}function Ww(e,t){t===0&&(e.mode&1?(t=vl,vl<<=1,!(vl&130023424)&&(vl=4194304)):t=1);var n=wt();e=fr(e,t),e!==null&&(Ga(e,t,n),Ft(e,n))}function d_(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ww(e,n)}function f_(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(I(314))}r!==null&&r.delete(t),Ww(e,n)}var qw;qw=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ot.current)At=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return At=!1,JE(e,t,n);At=!!(e.flags&131072)}else At=!1,Ee&&t.flags&1048576&&K1(t,Tu,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Kl(e,t),e=t.pendingProps;var i=io(t,mt.current);zs(t,n),i=zh(null,t,r,e,i,n);var s=Vh();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Dt(r)?(s=!0,ku(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Nh(t),i.updater=cc,t.stateNode=i,i._reactInternals=t,Lf(t,r,e,n),t=Bf(null,t,r,!0,s,n)):(t.tag=0,Ee&&s&&jh(t),yt(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Kl(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=h_(r),e=vn(r,e),i){case 0:t=$f(null,t,r,e,n);break e;case 1:t=bv(null,t,r,e,n);break e;case 11:t=xv(null,t,r,e,n);break e;case 14:t=wv(null,t,r,vn(r.type,e),n);break e}throw Error(I(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:vn(r,i),$f(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:vn(r,i),bv(e,t,r,i,n);case 3:e:{if(jw(t),e===null)throw Error(I(387));r=t.pendingProps,s=t.memoizedState,i=s.element,nw(e,t),Pu(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=lo(Error(I(423)),t),t=Sv(e,t,r,n,i);break e}else if(r!==i){i=lo(Error(I(424)),t),t=Sv(e,t,r,n,i);break e}else for(Bt=Wr(t.stateNode.containerInfo.firstChild),Ut=t,Ee=!0,bn=null,n=ew(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(so(),r===i){t=pr(e,t,n);break e}yt(e,t,r,n)}t=t.child}return t;case 5:return rw(t),e===null&&Ff(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,jf(r,i)?o=null:s!==null&&jf(r,s)&&(t.flags|=32),Pw(e,t),yt(e,t,o,n),t.child;case 6:return e===null&&Ff(t),null;case 13:return Rw(e,t,n);case 4:return Lh(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=oo(t,null,r,n):yt(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:vn(r,i),xv(e,t,r,i,n);case 7:return yt(e,t,t.pendingProps,n),t.child;case 8:return yt(e,t,t.pendingProps.children,n),t.child;case 12:return yt(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,be(Eu,r._currentValue),r._currentValue=o,s!==null)if(Tn(s.value,o)){if(s.children===i.children&&!Ot.current){t=pr(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=lr(-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),Mf(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(I(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Mf(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}yt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,zs(t,n),i=un(i),r=r(i),t.flags|=1,yt(e,t,r,n),t.child;case 14:return r=t.type,i=vn(r,t.pendingProps),i=vn(r.type,i),wv(e,t,r,i,n);case 15:return Ew(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:vn(r,i),Kl(e,t),t.tag=1,Dt(r)?(e=!0,ku(t)):e=!1,zs(t,n),kw(t,r,i),Lf(t,r,i,n),Bf(null,t,r,!0,e,n);case 19:return Aw(e,t,n);case 22:return _w(e,t,n)}throw Error(I(156,t.tag))};function Gw(e,t){return w1(e,t)}function p_(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 sn(e,t,n,r){return new p_(e,t,n,r)}function Zh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function h_(e){if(typeof e=="function")return Zh(e)?1:0;if(e!=null){if(e=e.$$typeof,e===vh)return 11;if(e===yh)return 14}return 2}function Yr(e,t){var n=e.alternate;return n===null?(n=sn(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 Jl(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")Zh(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case ws:return Bi(n.children,i,s,t);case gh:o=8,i|=8;break;case af:return e=sn(12,n,t,i|2),e.elementType=af,e.lanes=s,e;case lf:return e=sn(13,n,t,i),e.elementType=lf,e.lanes=s,e;case uf:return e=sn(19,n,t,i),e.elementType=uf,e.lanes=s,e;case r1:return pc(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case t1:o=10;break e;case n1:o=9;break e;case vh:o=11;break e;case yh:o=14;break e;case Cr:o=16,r=null;break e}throw Error(I(130,e==null?e:typeof e,""))}return t=sn(o,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function Bi(e,t,n,r){return e=sn(7,e,r,t),e.lanes=n,e}function pc(e,t,n,r){return e=sn(22,e,r,t),e.elementType=r1,e.lanes=n,e.stateNode={isHidden:!1},e}function kd(e,t,n){return e=sn(6,e,null,t),e.lanes=n,e}function Cd(e,t,n){return t=sn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function m_(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=id(0),this.expirationTimes=id(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=id(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Jh(e,t,n,r,i,s,o,a,l){return e=new m_(e,t,n,a,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=sn(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Nh(s),e}function g_(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:xs,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Qw(e){if(!e)return ni;e=e._reactInternals;e:{if(es(e)!==e||e.tag!==1)throw Error(I(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Dt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(I(171))}if(e.tag===1){var n=e.type;if(Dt(n))return Q1(e,n,t)}return t}function Yw(e,t,n,r,i,s,o,a,l){return e=Jh(n,r,!0,e,i,s,o,a,l),e.context=Qw(null),n=e.current,r=wt(),i=Qr(n),s=lr(r,i),s.callback=t??null,qr(n,s,i),e.current.lanes=i,Ga(e,i,r),Ft(e,r),e}function hc(e,t,n,r){var i=t.current,s=wt(),o=Qr(i);return n=Qw(n),t.context===null?t.context=n:t.pendingContext=n,t=lr(s,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=qr(i,t,o),e!==null&&(Cn(e,i,o,s),Gl(e,i,o)),o}function Nu(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 Ov(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function em(e,t){Ov(e,t),(e=e.alternate)&&Ov(e,t)}function v_(){return null}var Kw=typeof reportError=="function"?reportError:function(e){console.error(e)};function tm(e){this._internalRoot=e}mc.prototype.render=tm.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(I(409));hc(e,t,null,null)};mc.prototype.unmount=tm.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Qi(function(){hc(null,e,null,null)}),t[dr]=null}};function mc(e){this._internalRoot=e}mc.prototype.unstable_scheduleHydration=function(e){if(e){var t=_1();e={blockedOn:null,target:e,priority:t};for(var n=0;n<_r.length&&t!==0&&t<_r[n].priority;n++);_r.splice(n,0,e),n===0&&j1(e)}};function nm(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function gc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Dv(){}function y_(e,t,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var c=Nu(o);s.call(c)}}var o=Yw(t,r,e,0,null,!1,!1,"",Dv);return e._reactRootContainer=o,e[dr]=o.current,ya(e.nodeType===8?e.parentNode:e),Qi(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var c=Nu(l);a.call(c)}}var l=Jh(e,0,!1,null,null,!1,!1,"",Dv);return e._reactRootContainer=l,e[dr]=l.current,ya(e.nodeType===8?e.parentNode:e),Qi(function(){hc(t,l,n,r)}),l}function vc(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=Nu(o);a.call(l)}}hc(t,o,e,i)}else o=y_(n,t,e,i,r);return Nu(o)}T1=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Vo(t.pendingLanes);n!==0&&(bh(t,n|1),Ft(t,$e()),!(de&6)&&(uo=$e()+500,li()))}break;case 13:Qi(function(){var r=fr(e,1);if(r!==null){var i=wt();Cn(r,e,1,i)}}),em(e,1)}};Sh=function(e){if(e.tag===13){var t=fr(e,134217728);if(t!==null){var n=wt();Cn(t,e,134217728,n)}em(e,134217728)}};E1=function(e){if(e.tag===13){var t=Qr(e),n=fr(e,t);if(n!==null){var r=wt();Cn(n,e,t,r)}em(e,t)}};_1=function(){return he};P1=function(e,t){var n=he;try{return he=e,t()}finally{he=n}};xf=function(e,t,n){switch(t){case"input":if(ff(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=ac(r);if(!i)throw Error(I(90));s1(r),ff(r,i)}}}break;case"textarea":a1(e,n);break;case"select":t=n.value,t!=null&&Ls(e,!!n.multiple,t,!1)}};h1=Yh;m1=Qi;var x_={usingClientEntryPoint:!1,Events:[Ya,Cs,ac,f1,p1,Yh]},No={findFiberByHostInstance:Ti,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},w_={bundleType:No.bundleType,version:No.version,rendererPackageName:No.rendererPackageName,rendererConfig:No.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:mr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=y1(e),e===null?null:e.stateNode},findFiberByHostInstance:No.findFiberByHostInstance||v_,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 Pl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Pl.isDisabled&&Pl.supportsFiber)try{rc=Pl.inject(w_),zn=Pl}catch{}}Wt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=x_;Wt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!nm(t))throw Error(I(200));return g_(e,t,null,n)};Wt.createRoot=function(e,t){if(!nm(e))throw Error(I(299));var n=!1,r="",i=Kw;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=Jh(e,1,!1,null,null,n,!1,r,i),e[dr]=t.current,ya(e.nodeType===8?e.parentNode:e),new tm(t)};Wt.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(I(188)):(e=Object.keys(e).join(","),Error(I(268,e)));return e=y1(t),e=e===null?null:e.stateNode,e};Wt.flushSync=function(e){return Qi(e)};Wt.hydrate=function(e,t,n){if(!gc(t))throw Error(I(200));return vc(null,e,t,!0,n)};Wt.hydrateRoot=function(e,t,n){if(!nm(e))throw Error(I(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",o=Kw;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=Yw(t,null,e,1,n??null,i,!1,s,o),e[dr]=t.current,ya(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 mc(t)};Wt.render=function(e,t,n){if(!gc(t))throw Error(I(200));return vc(null,e,t,!1,n)};Wt.unmountComponentAtNode=function(e){if(!gc(e))throw Error(I(40));return e._reactRootContainer?(Qi(function(){vc(null,null,e,!1,function(){e._reactRootContainer=null,e[dr]=null})}),!0):!1};Wt.unstable_batchedUpdates=Yh;Wt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!gc(n))throw Error(I(200));if(e==null||e._reactInternals===void 0)throw Error(I(38));return vc(e,t,n,!1,r)};Wt.version="18.3.1-next-f1338f8080-20240426";function Xw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Xw)}catch(e){console.error(e)}}Xw(),Xx.exports=Wt;var Zw=Xx.exports;const b_=Zi(Zw);var Jw,Fv=Zw;Jw=Fv.createRoot,Fv.hydrateRoot;const S_="@alfatech/livechat",k_="v2025.10.23.2",C_="module",T_="https://api-live.alfatek.dev",E_="wss://api-live.alfatek.dev",__=["dist","README.md","component/chatier.js"],P_="dist/widget.js",j_={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"},R_={"@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"},A_={"@biomejs/biome":"^1.8.3","@types/node":"^22.5.4","@types/react":"^18.3.3","@types/react-dom":"^18.3.0","@vitejs/plugin-react-swc":"^3.5.0",globals:"^15.9.0",husky:"^9.1.5",tailwindcss:"^4.1.4",typescript:"^5.5.3",vite:"^5.4.1"},eb={name:S_,private:!1,version:k_,type:C_,apiURL:T_,wsURL:E_,files:__,main:P_,scripts:j_,dependencies:R_,devDependencies:A_,"lint-staged":{"./**/*.{js,ts,tsx,json}":["npm run format"]}},O_=eb.apiURL,D_=eb.wsURL,F_=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],M_=(e,t)=>[{message:"message"in t?t.message:"Not Found"},404],N_={429:F_,404:M_};async function bo(e,t={}){const n={};!(t.body instanceof FormData)&&t.body&&(n["Content-Type"]="application/json");const r=await fetch(`${O_}/${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=N_[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 Xa=e=>[200,201,204].includes(e),L_=(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 So=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(){}},Yi=typeof window>"u"||"Deno"in globalThis;function en(){}function I_(e,t){return typeof e=="function"?e(t):e}function Zf(e){return typeof e=="number"&&e>=0&&e!==1/0}function tb(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Us(e,t){return typeof e=="function"?e(t):e}function Sn(e,t){return typeof e=="function"?e(t):e}function Mv(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:a}=e;if(o){if(r){if(t.queryHash!==rm(o,t.options))return!1}else if(!_a(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 Nv(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Ki(t.options.mutationKey)!==Ki(s))return!1}else if(!_a(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function rm(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ki)(e)}function Ki(e){return JSON.stringify(e,(t,n)=>Jf(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function _a(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!_a(e[n],t[n])):!1}function nb(e,t){if(e===t)return e;const n=Lv(e)&&Lv(t);if(n||Jf(e)&&Jf(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]=nb(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&l++)}return i===o&&l===i?e:a}return t}function Lu(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 Lv(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Jf(e){if(!Iv(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Iv(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Iv(e){return Object.prototype.toString.call(e)==="[object Object]"}function $_(e){return new Promise(t=>{setTimeout(t,e)})}function ep(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?nb(e,t):t}function B_(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function z_(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var im=Symbol();function rb(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===im?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Oi,jr,Hs,Rx,V_=(Rx=class extends So{constructor(){super();X(this,Oi);X(this,jr);X(this,Hs);U(this,Hs,t=>{if(!Yi&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){S(this,jr)||this.setEventListener(S(this,Hs))}onUnsubscribe(){var t;this.hasListeners()||((t=S(this,jr))==null||t.call(this),U(this,jr,void 0))}setEventListener(t){var n;U(this,Hs,t),(n=S(this,jr))==null||n.call(this),U(this,jr,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){S(this,Oi)!==t&&(U(this,Oi,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof S(this,Oi)=="boolean"?S(this,Oi):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Oi=new WeakMap,jr=new WeakMap,Hs=new WeakMap,Rx),sm=new V_,Ws,Rr,qs,Ax,U_=(Ax=class extends So{constructor(){super();X(this,Ws,!0);X(this,Rr);X(this,qs);U(this,qs,t=>{if(!Yi&&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(){S(this,Rr)||this.setEventListener(S(this,qs))}onUnsubscribe(){var t;this.hasListeners()||((t=S(this,Rr))==null||t.call(this),U(this,Rr,void 0))}setEventListener(t){var n;U(this,qs,t),(n=S(this,Rr))==null||n.call(this),U(this,Rr,t(this.setOnline.bind(this)))}setOnline(t){S(this,Ws)!==t&&(U(this,Ws,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return S(this,Ws)}},Ws=new WeakMap,Rr=new WeakMap,qs=new WeakMap,Ax),Iu=new U_;function tp(){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 H_(e){return Math.min(1e3*2**e,3e4)}function ib(e){return(e??"online")==="online"?Iu.isOnline():!0}var sb=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Td(e){return e instanceof sb}function ob(e){let t=!1,n=0,r=!1,i;const s=tp(),o=m=>{var x;r||(f(new sb(m)),(x=e.abort)==null||x.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>sm.isFocused()&&(e.networkMode==="always"||Iu.isOnline())&&e.canRun(),d=()=>ib(e.networkMode)&&e.canRun(),u=m=>{var x;r||(r=!0,(x=e.onSuccess)==null||x.call(e,m),i==null||i(),s.resolve(m))},f=m=>{var x;r||(r=!0,(x=e.onError)==null||x.call(e,m),i==null||i(),s.reject(m))},p=()=>new Promise(m=>{var x;i=g=>{(r||c())&&m(g)},(x=e.onPause)==null||x.call(e)}).then(()=>{var m;i=void 0,r||(m=e.onContinue)==null||m.call(e)}),h=()=>{if(r)return;let m;const x=n===0?e.initialPromise:void 0;try{m=x??e.fn()}catch(g){m=Promise.reject(g)}Promise.resolve(m).then(u).catch(g=>{var E;if(r)return;const w=e.retry??(Yi?0:3),b=e.retryDelay??H_,k=typeof b=="function"?b(n,g):b,T=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,g);if(t||!T){f(g);return}n++,(E=e.onFail)==null||E.call(e,n,g),$_(k).then(()=>c()?void 0:p()).then(()=>{t?f(g):h()})})};return{promise:s,cancel:o,continue:()=>(i==null||i(),s),cancelRetry:a,continueRetry:l,canStart:d,start:()=>(d()?h():p().then(h),s)}}function W_(){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 He=W_(),Di,Ox,ab=(Ox=class{constructor(){X(this,Di)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Zf(this.gcTime)&&U(this,Di,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Yi?1/0:5*60*1e3))}clearGcTimeout(){S(this,Di)&&(clearTimeout(S(this,Di)),U(this,Di,void 0))}},Di=new WeakMap,Ox),Gs,Qs,Jt,dt,Va,Fi,yn,er,Dx,q_=(Dx=class extends ab{constructor(t){super();X(this,yn);X(this,Gs);X(this,Qs);X(this,Jt);X(this,dt);X(this,Va);X(this,Fi);U(this,Fi,!1),U(this,Va,t.defaultOptions),this.setOptions(t.options),this.observers=[],U(this,Jt,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,U(this,Gs,G_(this.options)),this.state=t.state??S(this,Gs),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=S(this,dt))==null?void 0:t.promise}setOptions(t){this.options={...S(this,Va),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&S(this,Jt).remove(this)}setData(t,n){const r=ep(this.state.data,t,this.options);return se(this,yn,er).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){se(this,yn,er).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=S(this,dt))==null?void 0:r.promise;return(i=S(this,dt))==null||i.cancel(t),n?n.then(en).catch(en):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(S(this,Gs))}isActive(){return this.observers.some(t=>Sn(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===im||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!tb(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=S(this,dt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=S(this,dt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),S(this,Jt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(S(this,dt)&&(S(this,Fi)?S(this,dt).cancel({revert:!0}):S(this,dt).cancelRetry()),this.scheduleGc()),S(this,Jt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||se(this,yn,er).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(S(this,dt))return S(this,dt).continueRetry(),S(this,dt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const u=this.observers.find(f=>f.options.queryFn);u&&this.setOptions(u.options)}const r=new AbortController,i=u=>{Object.defineProperty(u,"signal",{enumerable:!0,get:()=>(U(this,Fi,!0),r.signal)})},s=()=>{const u=rb(this.options,n),f={queryKey:this.queryKey,meta:this.meta};return i(f),U(this,Fi,!1),this.options.persister?this.options.persister(u,f,this):u(f)},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),U(this,Qs,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=o.fetchOptions)==null?void 0:c.meta))&&se(this,yn,er).call(this,{type:"fetch",meta:(d=o.fetchOptions)==null?void 0:d.meta});const a=u=>{var f,p,h,m;Td(u)&&u.silent||se(this,yn,er).call(this,{type:"error",error:u}),Td(u)||((p=(f=S(this,Jt).config).onError)==null||p.call(f,u,this),(m=(h=S(this,Jt).config).onSettled)==null||m.call(h,this.state.data,u,this)),this.scheduleGc()};return U(this,dt,ob({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:u=>{var f,p,h,m;if(u===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(u)}catch(x){a(x);return}(p=(f=S(this,Jt).config).onSuccess)==null||p.call(f,u,this),(m=(h=S(this,Jt).config).onSettled)==null||m.call(h,u,this.state.error,this),this.scheduleGc()},onError:a,onFail:(u,f)=>{se(this,yn,er).call(this,{type:"failed",failureCount:u,error:f})},onPause:()=>{se(this,yn,er).call(this,{type:"pause"})},onContinue:()=>{se(this,yn,er).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),S(this,dt).start()}},Gs=new WeakMap,Qs=new WeakMap,Jt=new WeakMap,dt=new WeakMap,Va=new WeakMap,Fi=new WeakMap,yn=new WeakSet,er=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,...lb(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return Td(i)&&i.revert&&S(this,Qs)?{...S(this,Qs),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),He.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),S(this,Jt).notify({query:this,type:"updated",action:t})})},Dx);function lb(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ib(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function G_(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 Mn,Fx,Q_=(Fx=class extends So{constructor(t={}){super();X(this,Mn);this.config=t,U(this,Mn,new Map)}build(t,n,r){const i=n.queryKey,s=n.queryHash??rm(i,n);let o=this.get(s);return o||(o=new q_({cache:this,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){S(this,Mn).has(t.queryHash)||(S(this,Mn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=S(this,Mn).get(t.queryHash);n&&(t.destroy(),n===t&&S(this,Mn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){He.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return S(this,Mn).get(t)}getAll(){return[...S(this,Mn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Mv(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Mv(t,r)):n}notify(t){He.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){He.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){He.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Mn=new WeakMap,Fx),Nn,gt,Mi,Ln,Sr,Mx,Y_=(Mx=class extends ab{constructor(t){super();X(this,Ln);X(this,Nn);X(this,gt);X(this,Mi);this.mutationId=t.mutationId,U(this,gt,t.mutationCache),U(this,Nn,[]),this.state=t.state||ub(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){S(this,Nn).includes(t)||(S(this,Nn).push(t),this.clearGcTimeout(),S(this,gt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){U(this,Nn,S(this,Nn).filter(n=>n!==t)),this.scheduleGc(),S(this,gt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){S(this,Nn).length||(this.state.status==="pending"?this.scheduleGc():S(this,gt).remove(this))}continue(){var t;return((t=S(this,Mi))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,s,o,a,l,c,d,u,f,p,h,m,x,g,w,b,k,T,E,_;U(this,Mi,ob({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(P,M)=>{se(this,Ln,Sr).call(this,{type:"failed",failureCount:P,error:M})},onPause:()=>{se(this,Ln,Sr).call(this,{type:"pause"})},onContinue:()=>{se(this,Ln,Sr).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>S(this,gt).canRun(this)}));const n=this.state.status==="pending",r=!S(this,Mi).canStart();try{if(!n){se(this,Ln,Sr).call(this,{type:"pending",variables:t,isPaused:r}),await((s=(i=S(this,gt).config).onMutate)==null?void 0:s.call(i,t,this));const M=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,t));M!==this.state.context&&se(this,Ln,Sr).call(this,{type:"pending",context:M,variables:t,isPaused:r})}const P=await S(this,Mi).start();return await((c=(l=S(this,gt).config).onSuccess)==null?void 0:c.call(l,P,t,this.state.context,this)),await((u=(d=this.options).onSuccess)==null?void 0:u.call(d,P,t,this.state.context)),await((p=(f=S(this,gt).config).onSettled)==null?void 0:p.call(f,P,null,this.state.variables,this.state.context,this)),await((m=(h=this.options).onSettled)==null?void 0:m.call(h,P,null,t,this.state.context)),se(this,Ln,Sr).call(this,{type:"success",data:P}),P}catch(P){try{throw await((g=(x=S(this,gt).config).onError)==null?void 0:g.call(x,P,t,this.state.context,this)),await((b=(w=this.options).onError)==null?void 0:b.call(w,P,t,this.state.context)),await((T=(k=S(this,gt).config).onSettled)==null?void 0:T.call(k,void 0,P,this.state.variables,this.state.context,this)),await((_=(E=this.options).onSettled)==null?void 0:_.call(E,void 0,P,t,this.state.context)),P}finally{se(this,Ln,Sr).call(this,{type:"error",error:P})}}finally{S(this,gt).runNext(this)}}},Nn=new WeakMap,gt=new WeakMap,Mi=new WeakMap,Ln=new WeakSet,Sr=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),He.batch(()=>{S(this,Nn).forEach(r=>{r.onMutationUpdate(t)}),S(this,gt).notify({mutation:this,type:"updated",action:t})})},Mx);function ub(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var It,Ua,Nx,K_=(Nx=class extends So{constructor(t={}){super();X(this,It);X(this,Ua);this.config=t,U(this,It,new Map),U(this,Ua,Date.now())}build(t,n,r){const i=new Y_({mutationCache:this,mutationId:++dl(this,Ua)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){const n=jl(t),r=S(this,It).get(n)??[];r.push(t),S(this,It).set(n,r),this.notify({type:"added",mutation:t})}remove(t){var r;const n=jl(t);if(S(this,It).has(n)){const i=(r=S(this,It).get(n))==null?void 0:r.filter(s=>s!==t);i&&(i.length===0?S(this,It).delete(n):S(this,It).set(n,i))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=(r=S(this,It).get(jl(t)))==null?void 0:r.find(i=>i.state.status==="pending");return!n||n===t}runNext(t){var r;const n=(r=S(this,It).get(jl(t)))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){He.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...S(this,It).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Nv(n,r))}findAll(t={}){return this.getAll().filter(n=>Nv(t,n))}notify(t){He.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return He.batch(()=>Promise.all(t.map(n=>n.continue().catch(en))))}},It=new WeakMap,Ua=new WeakMap,Nx);function jl(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function $v(e){return{onFetch:(t,n)=>{var d,u,f,p,h;const r=t.options,i=(f=(u=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:u.fetchMore)==null?void 0:f.direction,s=((p=t.state.data)==null?void 0:p.pages)||[],o=((h=t.state.data)==null?void 0:h.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let m=!1;const x=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(t.signal.aborted?m=!0:t.signal.addEventListener("abort",()=>{m=!0}),t.signal)})},g=rb(t.options,t.fetchOptions),w=async(b,k,T)=>{if(m)return Promise.reject();if(k==null&&b.pages.length)return Promise.resolve(b);const E={queryKey:t.queryKey,pageParam:k,direction:T?"backward":"forward",meta:t.options.meta};x(E);const _=await g(E),{maxPages:P}=t.options,M=T?z_:B_;return{pages:M(b.pages,_,P),pageParams:M(b.pageParams,k,P)}};if(i&&s.length){const b=i==="backward",k=b?X_:Bv,T={pages:s,pageParams:o},E=k(r,T);a=await w(T,E,b)}else{const b=e??s.length;do{const k=l===0?o[0]??r.initialPageParam:Bv(r,a);if(l>0&&k==null)break;a=await w(a,k),l++}while(l<b)}return a};t.options.persister?t.fetchFn=()=>{var m,x;return(x=(m=t.options).persister)==null?void 0:x.call(m,c,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function Bv(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 X_(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 De,Ar,Or,Ys,Ks,Dr,Xs,Zs,Lx,Z_=(Lx=class{constructor(e={}){X(this,De);X(this,Ar);X(this,Or);X(this,Ys);X(this,Ks);X(this,Dr);X(this,Xs);X(this,Zs);U(this,De,e.queryCache||new Q_),U(this,Ar,e.mutationCache||new K_),U(this,Or,e.defaultOptions||{}),U(this,Ys,new Map),U(this,Ks,new Map),U(this,Dr,0)}mount(){dl(this,Dr)._++,S(this,Dr)===1&&(U(this,Xs,sm.subscribe(async e=>{e&&(await this.resumePausedMutations(),S(this,De).onFocus())})),U(this,Zs,Iu.subscribe(async e=>{e&&(await this.resumePausedMutations(),S(this,De).onOnline())})))}unmount(){var e,t;dl(this,Dr)._--,S(this,Dr)===0&&((e=S(this,Xs))==null||e.call(this),U(this,Xs,void 0),(t=S(this,Zs))==null||t.call(this),U(this,Zs,void 0))}isFetching(e){return S(this,De).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return S(this,Ar).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=S(this,De).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=S(this,De).build(this,n);return e.revalidateIfStale&&r.isStaleByTime(Us(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return S(this,De).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=S(this,De).get(r.queryHash),s=i==null?void 0:i.state.data,o=I_(t,s);if(o!==void 0)return S(this,De).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return He.batch(()=>S(this,De).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=S(this,De).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=S(this,De);He.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=S(this,De),r={type:"active",...e};return He.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=He.batch(()=>S(this,De).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(en).catch(en)}invalidateQueries(e,t={}){return He.batch(()=>{if(S(this,De).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=He.batch(()=>S(this,De).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(en)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(en)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=S(this,De).build(this,t);return n.isStaleByTime(Us(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(en).catch(en)}fetchInfiniteQuery(e){return e.behavior=$v(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(en).catch(en)}ensureInfiniteQueryData(e){return e.behavior=$v(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Iu.isOnline()?S(this,Ar).resumePausedMutations():Promise.resolve()}getQueryCache(){return S(this,De)}getMutationCache(){return S(this,Ar)}getDefaultOptions(){return S(this,Or)}setDefaultOptions(e){U(this,Or,e)}setQueryDefaults(e,t){S(this,Ys).set(Ki(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...S(this,Ys).values()],n={};return t.forEach(r=>{_a(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){S(this,Ks).set(Ki(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...S(this,Ks).values()];let n={};return t.forEach(r=>{_a(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...S(this,Or).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=rm(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.enabled!==!0&&t.queryFn===im&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...S(this,Or).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){S(this,De).clear(),S(this,Ar).clear()}},De=new WeakMap,Ar=new WeakMap,Or=new WeakMap,Ys=new WeakMap,Ks=new WeakMap,Dr=new WeakMap,Xs=new WeakMap,Zs=new WeakMap,Lx),Et,le,Ha,vt,Ni,Js,Fr,In,Wa,eo,to,Li,Ii,Mr,no,pe,Ho,np,rp,ip,sp,op,ap,lp,cb,Ix,J_=(Ix=class extends So{constructor(t,n){super();X(this,pe);X(this,Et);X(this,le);X(this,Ha);X(this,vt);X(this,Ni);X(this,Js);X(this,Fr);X(this,In);X(this,Wa);X(this,eo);X(this,to);X(this,Li);X(this,Ii);X(this,Mr);X(this,no,new Set);this.options=n,U(this,Et,t),U(this,In,null),U(this,Fr,tp()),this.options.experimental_prefetchInRender||S(this,Fr).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&&(S(this,le).addObserver(this),zv(S(this,le),this.options)?se(this,pe,Ho).call(this):this.updateResult(),se(this,pe,sp).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return up(S(this,le),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return up(S(this,le),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,se(this,pe,op).call(this),se(this,pe,ap).call(this),S(this,le).removeObserver(this)}setOptions(t,n){const r=this.options,i=S(this,le);if(this.options=S(this,Et).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Sn(this.options.enabled,S(this,le))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");se(this,pe,lp).call(this),S(this,le).setOptions(this.options),r._defaulted&&!Lu(this.options,r)&&S(this,Et).getQueryCache().notify({type:"observerOptionsUpdated",query:S(this,le),observer:this});const s=this.hasListeners();s&&Vv(S(this,le),i,this.options,r)&&se(this,pe,Ho).call(this),this.updateResult(n),s&&(S(this,le)!==i||Sn(this.options.enabled,S(this,le))!==Sn(r.enabled,S(this,le))||Us(this.options.staleTime,S(this,le))!==Us(r.staleTime,S(this,le)))&&se(this,pe,np).call(this);const o=se(this,pe,rp).call(this);s&&(S(this,le)!==i||Sn(this.options.enabled,S(this,le))!==Sn(r.enabled,S(this,le))||o!==S(this,Mr))&&se(this,pe,ip).call(this,o)}getOptimisticResult(t){const n=S(this,Et).getQueryCache().build(S(this,Et),t),r=this.createResult(n,t);return t2(this,r)&&(U(this,vt,r),U(this,Js,this.options),U(this,Ni,S(this,le).state)),r}getCurrentResult(){return S(this,vt)}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){S(this,no).add(t)}getCurrentQuery(){return S(this,le)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=S(this,Et).defaultQueryOptions(t),r=S(this,Et).getQueryCache().build(S(this,Et),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return se(this,pe,Ho).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),S(this,vt)))}createResult(t,n){var P;const r=S(this,le),i=this.options,s=S(this,vt),o=S(this,Ni),a=S(this,Js),c=t!==r?t.state:S(this,Ha),{state:d}=t;let u={...d},f=!1,p;if(n._optimisticResults){const M=this.hasListeners(),N=!M&&zv(t,n),R=M&&Vv(t,r,n,i);(N||R)&&(u={...u,...lb(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:h,errorUpdatedAt:m,status:x}=u;if(n.select&&u.data!==void 0)if(s&&u.data===(o==null?void 0:o.data)&&n.select===S(this,Wa))p=S(this,eo);else try{U(this,Wa,n.select),p=n.select(u.data),p=ep(s==null?void 0:s.data,p,n),U(this,eo,p),U(this,In,null)}catch(M){U(this,In,M)}else p=u.data;if(n.placeholderData!==void 0&&p===void 0&&x==="pending"){let M;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))M=s.data;else if(M=typeof n.placeholderData=="function"?n.placeholderData((P=S(this,to))==null?void 0:P.state.data,S(this,to)):n.placeholderData,n.select&&M!==void 0)try{M=n.select(M),U(this,In,null)}catch(N){U(this,In,N)}M!==void 0&&(x="success",p=ep(s==null?void 0:s.data,M,n),f=!0)}S(this,In)&&(h=S(this,In),p=S(this,eo),m=Date.now(),x="error");const g=u.fetchStatus==="fetching",w=x==="pending",b=x==="error",k=w&&g,T=p!==void 0,_={status:x,fetchStatus:u.fetchStatus,isPending:w,isSuccess:x==="success",isError:b,isInitialLoading:k,isLoading:k,data:p,dataUpdatedAt:u.dataUpdatedAt,error:h,errorUpdatedAt:m,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&&!w,isLoadingError:b&&!T,isPaused:u.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:b&&T,isStale:om(t,n),refetch:this.refetch,promise:S(this,Fr)};if(this.options.experimental_prefetchInRender){const M=F=>{_.status==="error"?F.reject(_.error):_.data!==void 0&&F.resolve(_.data)},N=()=>{const F=U(this,Fr,_.promise=tp());M(F)},R=S(this,Fr);switch(R.status){case"pending":t.queryHash===r.queryHash&&M(R);break;case"fulfilled":(_.status==="error"||_.data!==R.value)&&N();break;case"rejected":(_.status!=="error"||_.error!==R.reason)&&N();break}}return _}updateResult(t){const n=S(this,vt),r=this.createResult(S(this,le),this.options);if(U(this,Ni,S(this,le).state),U(this,Js,this.options),S(this,Ni).data!==void 0&&U(this,to,S(this,le)),Lu(r,n))return;U(this,vt,r);const i={},s=()=>{if(!n)return!0;const{notifyOnChangeProps:o}=this.options,a=typeof o=="function"?o():o;if(a==="all"||!a&&!S(this,no).size)return!0;const l=new Set(a??S(this,no));return this.options.throwOnError&&l.add("error"),Object.keys(S(this,vt)).some(c=>{const d=c;return S(this,vt)[d]!==n[d]&&l.has(d)})};(t==null?void 0:t.listeners)!==!1&&s()&&(i.listeners=!0),se(this,pe,cb).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&se(this,pe,sp).call(this)}},Et=new WeakMap,le=new WeakMap,Ha=new WeakMap,vt=new WeakMap,Ni=new WeakMap,Js=new WeakMap,Fr=new WeakMap,In=new WeakMap,Wa=new WeakMap,eo=new WeakMap,to=new WeakMap,Li=new WeakMap,Ii=new WeakMap,Mr=new WeakMap,no=new WeakMap,pe=new WeakSet,Ho=function(t){se(this,pe,lp).call(this);let n=S(this,le).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(en)),n},np=function(){se(this,pe,op).call(this);const t=Us(this.options.staleTime,S(this,le));if(Yi||S(this,vt).isStale||!Zf(t))return;const r=tb(S(this,vt).dataUpdatedAt,t)+1;U(this,Li,setTimeout(()=>{S(this,vt).isStale||this.updateResult()},r))},rp=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(S(this,le)):this.options.refetchInterval)??!1},ip=function(t){se(this,pe,ap).call(this),U(this,Mr,t),!(Yi||Sn(this.options.enabled,S(this,le))===!1||!Zf(S(this,Mr))||S(this,Mr)===0)&&U(this,Ii,setInterval(()=>{(this.options.refetchIntervalInBackground||sm.isFocused())&&se(this,pe,Ho).call(this)},S(this,Mr)))},sp=function(){se(this,pe,np).call(this),se(this,pe,ip).call(this,se(this,pe,rp).call(this))},op=function(){S(this,Li)&&(clearTimeout(S(this,Li)),U(this,Li,void 0))},ap=function(){S(this,Ii)&&(clearInterval(S(this,Ii)),U(this,Ii,void 0))},lp=function(){const t=S(this,Et).getQueryCache().build(S(this,Et),this.options);if(t===S(this,le))return;const n=S(this,le);U(this,le,t),U(this,Ha,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},cb=function(t){He.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(S(this,vt))}),S(this,Et).getQueryCache().notify({query:S(this,le),type:"observerResultsUpdated"})})},Ix);function e2(e,t){return Sn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function zv(e,t){return e2(e,t)||e.state.data!==void 0&&up(e,t,t.refetchOnMount)}function up(e,t,n){if(Sn(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&om(e,t)}return!1}function Vv(e,t,n,r){return(e!==t||Sn(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&om(e,n)}function om(e,t){return Sn(t.enabled,e)!==!1&&e.isStaleByTime(Us(t.staleTime,e))}function t2(e,t){return!Lu(e.getCurrentResult(),t)}var Nr,Lr,_t,ir,ur,eu,cp,$x,n2=($x=class extends So{constructor(t,n){super();X(this,ur);X(this,Nr);X(this,Lr);X(this,_t);X(this,ir);U(this,Nr,t),this.setOptions(n),this.bindMethods(),se(this,ur,eu).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=S(this,Nr).defaultMutationOptions(t),Lu(this.options,n)||S(this,Nr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:S(this,_t),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&Ki(n.mutationKey)!==Ki(this.options.mutationKey)?this.reset():((r=S(this,_t))==null?void 0:r.state.status)==="pending"&&S(this,_t).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=S(this,_t))==null||t.removeObserver(this)}onMutationUpdate(t){se(this,ur,eu).call(this),se(this,ur,cp).call(this,t)}getCurrentResult(){return S(this,Lr)}reset(){var t;(t=S(this,_t))==null||t.removeObserver(this),U(this,_t,void 0),se(this,ur,eu).call(this),se(this,ur,cp).call(this)}mutate(t,n){var r;return U(this,ir,n),(r=S(this,_t))==null||r.removeObserver(this),U(this,_t,S(this,Nr).getMutationCache().build(S(this,Nr),this.options)),S(this,_t).addObserver(this),S(this,_t).execute(t)}},Nr=new WeakMap,Lr=new WeakMap,_t=new WeakMap,ir=new WeakMap,ur=new WeakSet,eu=function(){var n;const t=((n=S(this,_t))==null?void 0:n.state)??ub();U(this,Lr,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},cp=function(t){He.batch(()=>{var n,r,i,s,o,a,l,c;if(S(this,ir)&&this.hasListeners()){const d=S(this,Lr).variables,u=S(this,Lr).context;(t==null?void 0:t.type)==="success"?((r=(n=S(this,ir)).onSuccess)==null||r.call(n,t.data,d,u),(s=(i=S(this,ir)).onSettled)==null||s.call(i,t.data,null,d,u)):(t==null?void 0:t.type)==="error"&&((a=(o=S(this,ir)).onError)==null||a.call(o,t.error,d,u),(c=(l=S(this,ir)).onSettled)==null||c.call(l,void 0,t.error,d,u))}this.listeners.forEach(d=>{d(S(this,Lr))})})},$x),db=v.createContext(void 0),fb=e=>{const t=v.useContext(db);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},r2=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),y.jsx(db.Provider,{value:e,children:t})),pb=v.createContext(!1),i2=()=>v.useContext(pb);pb.Provider;function s2(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var o2=v.createContext(s2()),a2=()=>v.useContext(o2);function hb(e,t){return typeof e=="function"?e(...t):!!e}function dp(){}var l2=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},u2=e=>{v.useEffect(()=>{e.clearReset()},[e])},c2=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&hb(n,[e.error,r]),d2=e=>{e.suspense&&(e.staleTime===void 0&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},f2=(e,t)=>e.isLoading&&e.isFetching&&!t,p2=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Uv=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function h2(e,t,n){var d,u,f,p,h;const r=fb(),i=i2(),s=a2(),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",d2(o),l2(o,s),u2(s);const a=!r.getQueryCache().get(o.queryHash),[l]=v.useState(()=>new t(r,o)),c=l.getOptimisticResult(o);if(v.useSyncExternalStore(v.useCallback(m=>{const x=i?dp:l.subscribe(He.batchCalls(m));return l.updateResult(),x},[l,i]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),v.useEffect(()=>{l.setOptions(o,{listeners:!1})},[o,l]),p2(o,c))throw Uv(o,l,s);if(c2({result:c,errorResetBoundary:s,throwOnError:o.throwOnError,query:r.getQueryCache().get(o.queryHash)}))throw c.error;if((p=(f=r.getDefaultOptions().queries)==null?void 0:f._experimental_afterQuery)==null||p.call(f,o,c),o.experimental_prefetchInRender&&!Yi&&f2(c,i)){const m=a?Uv(o,l,s):(h=r.getQueryCache().get(o.queryHash))==null?void 0:h.promise;m==null||m.catch(dp).finally(()=>{l.updateResult()})}return o.notifyOnChangeProps?c:l.trackResult(c)}function m2(e,t){return h2(e,J_)}function am(e,t){const n=fb(),[r]=v.useState(()=>new n2(n,e));v.useEffect(()=>{r.setOptions(e)},[r,e]);const i=v.useSyncExternalStore(v.useCallback(o=>r.subscribe(He.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=v.useCallback((o,a)=>{r.mutate(o,a).catch(dp)},[r]);if(i.error&&hb(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}const g2=e=>m2({queryKey:["widgets",e],queryFn:()=>v2(e)}),v2=e=>bo(`widgets/with-link/${e}`);var C=(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.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))(C||{}),Y=(e=>(e.TooltipDefault="tooltip_default",e.TooltipActive="tooltip_active",e.CloseButtonAria="close_button_aria",e.MessagePlaceholder="message_placeholder",e.FileUploadDisabled="file_upload_disabled",e.NewMessagesNotification="new_messages_notification",e.ChatCloseConfirm="chat_close_confirm",e.ChatCloseWarning="chat_close_warning",e.ChatSettings="chat_settings",e.ChatEndConversation="chat_end_conversation",e.CancelAction="cancel_action",e.CloseAction="close_action",e.QuickActions="quick_actions",e.GreetingStartChat="greeting_start_chat",e.RateLimitMessage="rate_limit_message",e.RatingHeaderEvaluate="rating_header_evaluate",e.RatingHeaderThanks="rating_header_thanks",e.RatingDescription="rating_description",e.RatingRateConversation="rating_rate_conversation",e.RatingComment="rating_comment",e.RatingCommentPlaceholder="rating_comment_placeholder",e.RatingSubmit="rating_submit",e.RatingNewConversation="rating_new_conversation",e.RatingThankYouTitle="rating_thank_you_title",e.RatingThankYouDescription="rating_thank_you_description",e.RatingCountdown="rating_countdown",e.RatingMinimumError="rating_minimum_error",e.RatingYourScore="rating_your_score",e.PoweredBy="powered_by",e))(Y||{});function y2(e){return!!e&&typeof e.public_id=="string"&&typeof e.link_id=="string"&&typeof e.name=="string"&&typeof e.is_browser_notification_enabled=="boolean"&&typeof e.is_hidden_on_offline=="boolean"&&typeof e.is_upload_disabled=="boolean"}/**
|
|
40
|
+
`+s.stack}return{value:e,source:t,stack:i,digest:null}}function bd(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function If(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var KE=typeof WeakMap=="function"?WeakMap:Map;function Cw(e,t,n){n=lr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Du||(Du=!0,Qf=r),If(e,t)},n}function Tw(e,t,n){n=lr(-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(){If(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){If(e,t),typeof r!="function"&&(Gr===null?Gr=new Set([this]):Gr.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function gv(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new KE;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=c_.bind(null,e,t,n),t.then(e,e))}function vv(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 yv(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=lr(-1,1),t.tag=2,qr(n,t,1))),n.lanes|=1),e)}var XE=mr.ReactCurrentOwner,At=!1;function yt(e,t,n,r){t.child=e===null?ew(t,null,n,r):oo(t,e.child,n,r)}function xv(e,t,n,r,i){n=n.render;var s=t.ref;return zs(t,i),r=zh(e,t,n,r,s,i),n=Vh(),e!==null&&!At?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,pr(e,t,i)):(Ee&&n&&jh(t),t.flags|=1,yt(e,t,r,i),t.child)}function wv(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!Zh(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,Ew(e,t,s,r,i)):(e=Jl(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:va,n(o,r)&&e.ref===t.ref)return pr(e,t,i)}return t.flags|=1,e=Yr(s,r),e.ref=t.ref,e.return=t,t.child=e}function Ew(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(va(s,r)&&e.ref===t.ref)if(At=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(At=!0);else return t.lanes=e.lanes,pr(e,t,i)}return $f(e,t,n,r,i)}function _w(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},be(Rs,$t),$t|=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,be(Rs,$t),$t|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,be(Rs,$t),$t|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,be(Rs,$t),$t|=r;return yt(e,t,i,n),t.child}function Pw(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function $f(e,t,n,r,i){var s=Dt(n)?Hi:mt.current;return s=io(t,s),zs(t,i),n=zh(e,t,n,r,s,i),r=Vh(),e!==null&&!At?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,pr(e,t,i)):(Ee&&r&&jh(t),t.flags|=1,yt(e,t,n,i),t.child)}function bv(e,t,n,r,i){if(Dt(n)){var s=!0;ku(t)}else s=!1;if(zs(t,i),t.stateNode===null)Kl(e,t),kw(t,n,r),Lf(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=un(c):(c=Dt(n)?Hi:mt.current,c=io(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)&&mv(t,o,r,c),Tr=!1;var f=t.memoizedState;o.state=f,Pu(t,r,o,i),l=t.memoizedState,a!==r||f!==l||Ot.current||Tr?(typeof d=="function"&&(Nf(t,n,d,r),l=t.memoizedState),(a=Tr||hv(t,n,a,r,f,l,c))?(u||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=c,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,nw(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:vn(t.type,a),o.props=c,u=t.pendingProps,f=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=un(l):(l=Dt(n)?Hi:mt.current,l=io(t,l));var p=n.getDerivedStateFromProps;(d=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==u||f!==l)&&mv(t,o,r,l),Tr=!1,f=t.memoizedState,o.state=f,Pu(t,r,o,i);var h=t.memoizedState;a!==u||f!==h||Ot.current||Tr?(typeof p=="function"&&(Nf(t,n,p,r),h=t.memoizedState),(c=Tr||hv(t,n,c,r,f,h,l)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,h,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,h,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=h),o.props=r,o.state=h,o.context=l,r=c):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Bf(e,t,n,r,s,i)}function Bf(e,t,n,r,i,s){Pw(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&ov(t,n,!1),pr(e,t,s);r=t.stateNode,XE.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=oo(t,e.child,null,s),t.child=oo(t,null,a,s)):yt(e,t,a,s),t.memoizedState=r.state,i&&ov(t,n,!0),t.child}function jw(e){var t=e.stateNode;t.pendingContext?sv(e,t.pendingContext,t.pendingContext!==t.context):t.context&&sv(e,t.context,!1),Lh(e,t.containerInfo)}function Sv(e,t,n,r,i){return so(),Ah(i),t.flags|=256,yt(e,t,n,r),t.child}var zf={dehydrated:null,treeContext:null,retryLane:0};function Vf(e){return{baseLanes:e,cachePool:null,transitions:null}}function Rw(e,t,n){var r=t.pendingProps,i=Pe.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),be(Pe,i&1),e===null)return Ff(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=pc(o,r,0,null),e=Bi(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Vf(n),t.memoizedState=zf,e):Wh(t,o));if(i=e.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return ZE(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=Yr(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=Yr(a,s):(s=Bi(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?Vf(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~n,t.memoizedState=zf,r}return s=e.child,e=s.sibling,r=Yr(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Wh(e,t){return t=pc({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Tl(e,t,n,r){return r!==null&&Ah(r),oo(t,e.child,null,n),e=Wh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function ZE(e,t,n,r,i,s,o){if(n)return t.flags&256?(t.flags&=-257,r=bd(Error(I(422))),Tl(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=pc({mode:"visible",children:r.children},i,0,null),s=Bi(s,i,o,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&oo(t,e.child,null,o),t.child.memoizedState=Vf(o),t.memoizedState=zf,s);if(!(t.mode&1))return Tl(e,t,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(I(419)),r=bd(s,r,void 0),Tl(e,t,o,r)}if(a=(o&e.childLanes)!==0,At||a){if(r=Xe,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,fr(e,i),Cn(r,e,i,-1))}return Xh(),r=bd(Error(I(421))),Tl(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=d_.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,Bt=Wr(i.nextSibling),Ut=t,Ee=!0,bn=null,e!==null&&(tn[nn++]=sr,tn[nn++]=or,tn[nn++]=Wi,sr=e.id,or=e.overflow,Wi=t),t=Wh(t,r.children),t.flags|=4096,t)}function kv(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Mf(e.return,t,n)}function Sd(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 Aw(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(yt(e,t,r.children,n),r=Pe.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&&kv(e,n,t);else if(e.tag===19)kv(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(be(Pe,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&&ju(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Sd(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&&ju(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Sd(t,!0,n,null,s);break;case"together":Sd(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Kl(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function pr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Gi|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(I(153));if(t.child!==null){for(e=t.child,n=Yr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Yr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function JE(e,t,n){switch(t.tag){case 3:jw(t),so();break;case 5:rw(t);break;case 1:Dt(t.type)&&ku(t);break;case 4:Lh(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;be(Eu,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(be(Pe,Pe.current&1),t.flags|=128,null):n&t.child.childLanes?Rw(e,t,n):(be(Pe,Pe.current&1),e=pr(e,t,n),e!==null?e.sibling:null);be(Pe,Pe.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Aw(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),be(Pe,Pe.current),r)break;return null;case 22:case 23:return t.lanes=0,_w(e,t,n)}return pr(e,t,n)}var Ow,Uf,Dw,Fw;Ow=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}};Uf=function(){};Dw=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,_i(Vn.current);var s=null;switch(n){case"input":i=df(e,i),r=df(e,r),s=[];break;case"select":i=Ae({},i,{value:void 0}),r=Ae({},r,{value:void 0}),s=[];break;case"textarea":i=hf(e,i),r=hf(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=bu)}gf(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"&&(ca.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"&&(ca.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&ke("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)}};Fw=function(e,t,n,r){n!==r&&(t.flags|=4)};function Mo(e,t){if(!Ee)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 ct(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 e_(e,t,n){var r=t.pendingProps;switch(Rh(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ct(t),null;case 1:return Dt(t.type)&&Su(),ct(t),null;case 3:return r=t.stateNode,ao(),Te(Ot),Te(mt),$h(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(kl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,bn!==null&&(Xf(bn),bn=null))),Uf(e,t),ct(t),null;case 5:Ih(t);var i=_i(Sa.current);if(n=t.type,e!==null&&t.stateNode!=null)Dw(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(I(166));return ct(t),null}if(e=_i(Vn.current),kl(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[$n]=t,r[wa]=s,e=(t.mode&1)!==0,n){case"dialog":ke("cancel",r),ke("close",r);break;case"iframe":case"object":case"embed":ke("load",r);break;case"video":case"audio":for(i=0;i<Uo.length;i++)ke(Uo[i],r);break;case"source":ke("error",r);break;case"img":case"image":case"link":ke("error",r),ke("load",r);break;case"details":ke("toggle",r);break;case"input":Og(r,s),ke("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},ke("invalid",r);break;case"textarea":Fg(r,s),ke("invalid",r)}gf(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&&Sl(r.textContent,a,e),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&Sl(r.textContent,a,e),i=["children",""+a]):ca.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&ke("scroll",r)}switch(n){case"input":hl(r),Dg(r,s,!0);break;case"textarea":hl(r),Mg(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=bu)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=l1(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[$n]=t,e[wa]=r,Ow(e,t,!1,!1),t.stateNode=e;e:{switch(o=vf(n,r),n){case"dialog":ke("cancel",e),ke("close",e),i=r;break;case"iframe":case"object":case"embed":ke("load",e),i=r;break;case"video":case"audio":for(i=0;i<Uo.length;i++)ke(Uo[i],e);i=r;break;case"source":ke("error",e),i=r;break;case"img":case"image":case"link":ke("error",e),ke("load",e),i=r;break;case"details":ke("toggle",e),i=r;break;case"input":Og(e,r),i=df(e,r),ke("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Ae({},r,{value:void 0}),ke("invalid",e);break;case"textarea":Fg(e,r),i=hf(e,r),ke("invalid",e);break;default:i=r}gf(n,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?d1(e,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&u1(e,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&da(e,l):typeof l=="number"&&da(e,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(ca.hasOwnProperty(s)?l!=null&&s==="onScroll"&&ke("scroll",e):l!=null&&mh(e,s,l,o))}switch(n){case"input":hl(e),Dg(e,r,!1);break;case"textarea":hl(e),Mg(e);break;case"option":r.value!=null&&e.setAttribute("value",""+ti(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?Ls(e,!!r.multiple,s,!1):r.defaultValue!=null&&Ls(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=bu)}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 ct(t),null;case 6:if(e&&t.stateNode!=null)Fw(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(I(166));if(n=_i(Sa.current),_i(Vn.current),kl(t)){if(r=t.stateNode,n=t.memoizedProps,r[$n]=t,(s=r.nodeValue!==n)&&(e=Ut,e!==null))switch(e.tag){case 3:Sl(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Sl(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[$n]=t,t.stateNode=r}return ct(t),null;case 13:if(Te(Pe),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ee&&Bt!==null&&t.mode&1&&!(t.flags&128))Z1(),so(),t.flags|=98560,s=!1;else if(s=kl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(I(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(I(317));s[$n]=t}else so(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ct(t),s=!1}else bn!==null&&(Xf(bn),bn=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||Pe.current&1?We===0&&(We=3):Xh())),t.updateQueue!==null&&(t.flags|=4),ct(t),null);case 4:return ao(),Uf(e,t),e===null&&ya(t.stateNode.containerInfo),ct(t),null;case 10:return Fh(t.type._context),ct(t),null;case 17:return Dt(t.type)&&Su(),ct(t),null;case 19:if(Te(Pe),s=t.memoizedState,s===null)return ct(t),null;if(r=(t.flags&128)!==0,o=s.rendering,o===null)if(r)Mo(s,!1);else{if(We!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ju(e),o!==null){for(t.flags|=128,Mo(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 be(Pe,Pe.current&1|2),t.child}e=e.sibling}s.tail!==null&&$e()>uo&&(t.flags|=128,r=!0,Mo(s,!1),t.lanes=4194304)}else{if(!r)if(e=ju(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Mo(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Ee)return ct(t),null}else 2*$e()-s.renderingStartTime>uo&&n!==1073741824&&(t.flags|=128,r=!0,Mo(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=$e(),t.sibling=null,n=Pe.current,be(Pe,r?n&1|2:n&1),t):(ct(t),null);case 22:case 23:return Kh(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?$t&1073741824&&(ct(t),t.subtreeFlags&6&&(t.flags|=8192)):ct(t),null;case 24:return null;case 25:return null}throw Error(I(156,t.tag))}function t_(e,t){switch(Rh(t),t.tag){case 1:return Dt(t.type)&&Su(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ao(),Te(Ot),Te(mt),$h(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ih(t),null;case 13:if(Te(Pe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(I(340));so()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Te(Pe),null;case 4:return ao(),null;case 10:return Fh(t.type._context),null;case 22:case 23:return Kh(),null;case 24:return null;default:return null}}var El=!1,pt=!1,n_=typeof WeakSet=="function"?WeakSet:Set,W=null;function js(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Me(e,t,r)}else n.current=null}function Hf(e,t,n){try{n()}catch(r){Me(e,t,r)}}var Cv=!1;function r_(e,t){if(_f=yu,e=$1(),Ph(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,f=null;t:for(;;){for(var p;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),(p=u.firstChild)!==null;)f=u,u=p;for(;;){if(u===e)break t;if(f===n&&++c===i&&(a=o),f===s&&++d===r&&(l=o),(p=u.nextSibling)!==null)break;u=f,f=u.parentNode}u=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Pf={focusedElem:e,selectionRange:n},yu=!1,W=t;W!==null;)if(t=W,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,W=e;else for(;W!==null;){t=W;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var m=h.memoizedProps,x=h.memoizedState,g=t.stateNode,w=g.getSnapshotBeforeUpdate(t.elementType===t.type?m:vn(t.type,m),x);g.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(I(163))}}catch(k){Me(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,W=e;break}W=t.return}return h=Cv,Cv=!1,h}function ea(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&&Hf(t,n,s)}i=i.next}while(i!==r)}}function dc(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 Wf(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 Mw(e){var t=e.alternate;t!==null&&(e.alternate=null,Mw(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[$n],delete t[wa],delete t[Af],delete t[$E],delete t[BE])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Nw(e){return e.tag===5||e.tag===3||e.tag===4}function Tv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Nw(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function qf(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=bu));else if(r!==4&&(e=e.child,e!==null))for(qf(e,t,n),e=e.sibling;e!==null;)qf(e,t,n),e=e.sibling}function Gf(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(Gf(e,t,n),e=e.sibling;e!==null;)Gf(e,t,n),e=e.sibling}var rt=null,xn=!1;function br(e,t,n){for(n=n.child;n!==null;)Lw(e,t,n),n=n.sibling}function Lw(e,t,n){if(zn&&typeof zn.onCommitFiberUnmount=="function")try{zn.onCommitFiberUnmount(rc,n)}catch{}switch(n.tag){case 5:pt||js(n,t);case 6:var r=rt,i=xn;rt=null,br(e,t,n),rt=r,xn=i,rt!==null&&(xn?(e=rt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):rt.removeChild(n.stateNode));break;case 18:rt!==null&&(xn?(e=rt,n=n.stateNode,e.nodeType===8?md(e.parentNode,n):e.nodeType===1&&md(e,n),ma(e)):md(rt,n.stateNode));break;case 4:r=rt,i=xn,rt=n.stateNode.containerInfo,xn=!0,br(e,t,n),rt=r,xn=i;break;case 0:case 11:case 14:case 15:if(!pt&&(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)&&Hf(n,t,o),i=i.next}while(i!==r)}br(e,t,n);break;case 1:if(!pt&&(js(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Me(n,t,a)}br(e,t,n);break;case 21:br(e,t,n);break;case 22:n.mode&1?(pt=(r=pt)||n.memoizedState!==null,br(e,t,n),pt=r):br(e,t,n);break;default:br(e,t,n)}}function Ev(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new n_),t.forEach(function(r){var i=f_.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function hn(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:rt=a.stateNode,xn=!1;break e;case 3:rt=a.stateNode.containerInfo,xn=!0;break e;case 4:rt=a.stateNode.containerInfo,xn=!0;break e}a=a.return}if(rt===null)throw Error(I(160));Lw(s,o,i),rt=null,xn=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(c){Me(i,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Iw(t,e),t=t.sibling}function Iw(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(hn(t,e),Rn(e),r&4){try{ea(3,e,e.return),dc(3,e)}catch(m){Me(e,e.return,m)}try{ea(5,e,e.return)}catch(m){Me(e,e.return,m)}}break;case 1:hn(t,e),Rn(e),r&512&&n!==null&&js(n,n.return);break;case 5:if(hn(t,e),Rn(e),r&512&&n!==null&&js(n,n.return),e.flags&32){var i=e.stateNode;try{da(i,"")}catch(m){Me(e,e.return,m)}}if(r&4&&(i=e.stateNode,i!=null)){var s=e.memoizedProps,o=n!==null?n.memoizedProps:s,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&o1(i,s),vf(a,o);var c=vf(a,s);for(o=0;o<l.length;o+=2){var d=l[o],u=l[o+1];d==="style"?d1(i,u):d==="dangerouslySetInnerHTML"?u1(i,u):d==="children"?da(i,u):mh(i,d,u,c)}switch(a){case"input":ff(i,s);break;case"textarea":a1(i,s);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var p=s.value;p!=null?Ls(i,!!s.multiple,p,!1):f!==!!s.multiple&&(s.defaultValue!=null?Ls(i,!!s.multiple,s.defaultValue,!0):Ls(i,!!s.multiple,s.multiple?[]:"",!1))}i[wa]=s}catch(m){Me(e,e.return,m)}}break;case 6:if(hn(t,e),Rn(e),r&4){if(e.stateNode===null)throw Error(I(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(m){Me(e,e.return,m)}}break;case 3:if(hn(t,e),Rn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ma(t.containerInfo)}catch(m){Me(e,e.return,m)}break;case 4:hn(t,e),Rn(e);break;case 13:hn(t,e),Rn(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(Qh=$e())),r&4&&Ev(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(pt=(c=pt)||d,hn(t,e),pt=c):hn(t,e),Rn(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!d&&e.mode&1)for(W=e,d=e.child;d!==null;){for(u=W=d;W!==null;){switch(f=W,p=f.child,f.tag){case 0:case 11:case 14:case 15:ea(4,f,f.return);break;case 1:js(f,f.return);var h=f.stateNode;if(typeof h.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,h.props=t.memoizedProps,h.state=t.memoizedState,h.componentWillUnmount()}catch(m){Me(r,n,m)}}break;case 5:js(f,f.return);break;case 22:if(f.memoizedState!==null){Pv(u);continue}}p!==null?(p.return=f,W=p):Pv(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=c1("display",o))}catch(m){Me(e,e.return,m)}}}else if(u.tag===6){if(d===null)try{u.stateNode.nodeValue=c?"":u.memoizedProps}catch(m){Me(e,e.return,m)}}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:hn(t,e),Rn(e),r&4&&Ev(e);break;case 21:break;default:hn(t,e),Rn(e)}}function Rn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Nw(n)){var r=n;break e}n=n.return}throw Error(I(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(da(i,""),r.flags&=-33);var s=Tv(e);Gf(e,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,a=Tv(e);qf(e,a,o);break;default:throw Error(I(161))}}catch(l){Me(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function i_(e,t,n){W=e,$w(e)}function $w(e,t,n){for(var r=(e.mode&1)!==0;W!==null;){var i=W,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||El;if(!o){var a=i.alternate,l=a!==null&&a.memoizedState!==null||pt;a=El;var c=pt;if(El=o,(pt=l)&&!c)for(W=i;W!==null;)o=W,l=o.child,o.tag===22&&o.memoizedState!==null?jv(i):l!==null?(l.return=o,W=l):jv(i);for(;s!==null;)W=s,$w(s),s=s.sibling;W=i,El=a,pt=c}_v(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,W=s):_v(e)}}function _v(e){for(;W!==null;){var t=W;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:pt||dc(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!pt)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:vn(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&dv(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}dv(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(I(163))}pt||t.flags&512&&Wf(t)}catch(f){Me(t,t.return,f)}}if(t===e){W=null;break}if(n=t.sibling,n!==null){n.return=t.return,W=n;break}W=t.return}}function Pv(e){for(;W!==null;){var t=W;if(t===e){W=null;break}var n=t.sibling;if(n!==null){n.return=t.return,W=n;break}W=t.return}}function jv(e){for(;W!==null;){var t=W;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{dc(4,t)}catch(l){Me(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){Me(t,i,l)}}var s=t.return;try{Wf(t)}catch(l){Me(t,s,l)}break;case 5:var o=t.return;try{Wf(t)}catch(l){Me(t,o,l)}}}catch(l){Me(t,t.return,l)}if(t===e){W=null;break}var a=t.sibling;if(a!==null){a.return=t.return,W=a;break}W=t.return}}var s_=Math.ceil,Ou=mr.ReactCurrentDispatcher,qh=mr.ReactCurrentOwner,an=mr.ReactCurrentBatchConfig,de=0,Xe=null,Be=null,ot=0,$t=0,Rs=ai(0),We=0,Ea=null,Gi=0,fc=0,Gh=0,ta=null,jt=null,Qh=0,uo=1/0,tr=null,Du=!1,Qf=null,Gr=null,_l=!1,$r=null,Fu=0,na=0,Yf=null,Xl=-1,Zl=0;function wt(){return de&6?$e():Xl!==-1?Xl:Xl=$e()}function Qr(e){return e.mode&1?de&2&&ot!==0?ot&-ot:VE.transition!==null?(Zl===0&&(Zl=k1()),Zl):(e=he,e!==0||(e=window.event,e=e===void 0?16:R1(e.type)),e):1}function Cn(e,t,n,r){if(50<na)throw na=0,Yf=null,Error(I(185));Ga(e,n,r),(!(de&2)||e!==Xe)&&(e===Xe&&(!(de&2)&&(fc|=n),We===4&&Pr(e,ot)),Ft(e,r),n===1&&de===0&&!(t.mode&1)&&(uo=$e()+500,lc&&li()))}function Ft(e,t){var n=e.callbackNode;VT(e,t);var r=vu(e,e===Xe?ot:0);if(r===0)n!==null&&Ig(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Ig(n),t===1)e.tag===0?zE(Rv.bind(null,e)):Y1(Rv.bind(null,e)),LE(function(){!(de&6)&&li()}),n=null;else{switch(C1(r)){case 1:n=wh;break;case 4:n=b1;break;case 16:n=gu;break;case 536870912:n=S1;break;default:n=gu}n=Gw(n,Bw.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Bw(e,t){if(Xl=-1,Zl=0,de&6)throw Error(I(327));var n=e.callbackNode;if(Vs()&&e.callbackNode!==n)return null;var r=vu(e,e===Xe?ot:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Mu(e,r);else{t=r;var i=de;de|=2;var s=Vw();(Xe!==e||ot!==t)&&(tr=null,uo=$e()+500,$i(e,t));do try{l_();break}catch(a){zw(e,a)}while(!0);Dh(),Ou.current=s,de=i,Be!==null?t=0:(Xe=null,ot=0,t=We)}if(t!==0){if(t===2&&(i=Sf(e),i!==0&&(r=i,t=Kf(e,i))),t===1)throw n=Ea,$i(e,0),Pr(e,r),Ft(e,$e()),n;if(t===6)Pr(e,r);else{if(i=e.current.alternate,!(r&30)&&!o_(i)&&(t=Mu(e,r),t===2&&(s=Sf(e),s!==0&&(r=s,t=Kf(e,s))),t===1))throw n=Ea,$i(e,0),Pr(e,r),Ft(e,$e()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(I(345));case 2:xi(e,jt,tr);break;case 3:if(Pr(e,r),(r&130023424)===r&&(t=Qh+500-$e(),10<t)){if(vu(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){wt(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Rf(xi.bind(null,e,jt,tr),t);break}xi(e,jt,tr);break;case 4:if(Pr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-kn(r);s=1<<o,o=t[o],o>i&&(i=o),r&=~s}if(r=i,r=$e()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*s_(r/1960))-r,10<r){e.timeoutHandle=Rf(xi.bind(null,e,jt,tr),r);break}xi(e,jt,tr);break;case 5:xi(e,jt,tr);break;default:throw Error(I(329))}}}return Ft(e,$e()),e.callbackNode===n?Bw.bind(null,e):null}function Kf(e,t){var n=ta;return e.current.memoizedState.isDehydrated&&($i(e,t).flags|=256),e=Mu(e,t),e!==2&&(t=jt,jt=n,t!==null&&Xf(t)),e}function Xf(e){jt===null?jt=e:jt.push.apply(jt,e)}function o_(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(!Tn(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 Pr(e,t){for(t&=~Gh,t&=~fc,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-kn(t),r=1<<n;e[n]=-1,t&=~r}}function Rv(e){if(de&6)throw Error(I(327));Vs();var t=vu(e,0);if(!(t&1))return Ft(e,$e()),null;var n=Mu(e,t);if(e.tag!==0&&n===2){var r=Sf(e);r!==0&&(t=r,n=Kf(e,r))}if(n===1)throw n=Ea,$i(e,0),Pr(e,t),Ft(e,$e()),n;if(n===6)throw Error(I(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,xi(e,jt,tr),Ft(e,$e()),null}function Yh(e,t){var n=de;de|=1;try{return e(t)}finally{de=n,de===0&&(uo=$e()+500,lc&&li())}}function Qi(e){$r!==null&&$r.tag===0&&!(de&6)&&Vs();var t=de;de|=1;var n=an.transition,r=he;try{if(an.transition=null,he=1,e)return e()}finally{he=r,an.transition=n,de=t,!(de&6)&&li()}}function Kh(){$t=Rs.current,Te(Rs)}function $i(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,NE(n)),Be!==null)for(n=Be.return;n!==null;){var r=n;switch(Rh(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Su();break;case 3:ao(),Te(Ot),Te(mt),$h();break;case 5:Ih(r);break;case 4:ao();break;case 13:Te(Pe);break;case 19:Te(Pe);break;case 10:Fh(r.type._context);break;case 22:case 23:Kh()}n=n.return}if(Xe=e,Be=e=Yr(e.current,null),ot=$t=t,We=0,Ea=null,Gh=fc=Gi=0,jt=ta=null,Ei!==null){for(t=0;t<Ei.length;t++)if(n=Ei[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}Ei=null}return e}function zw(e,t){do{var n=Be;try{if(Dh(),Ql.current=Au,Ru){for(var r=Re.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Ru=!1}if(qi=0,Ke=Ue=Re=null,Jo=!1,ka=0,qh.current=null,n===null||n.return===null){We=1,Ea=t,Be=null;break}e:{var s=e,o=n.return,a=n,l=t;if(t=ot,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 f=d.alternate;f?(d.updateQueue=f.updateQueue,d.memoizedState=f.memoizedState,d.lanes=f.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=vv(o);if(p!==null){p.flags&=-257,yv(p,o,a,s,t),p.mode&1&&gv(s,c,t),t=p,l=c;var h=t.updateQueue;if(h===null){var m=new Set;m.add(l),t.updateQueue=m}else h.add(l);break e}else{if(!(t&1)){gv(s,c,t),Xh();break e}l=Error(I(426))}}else if(Ee&&a.mode&1){var x=vv(o);if(x!==null){!(x.flags&65536)&&(x.flags|=256),yv(x,o,a,s,t),Ah(lo(l,a));break e}}s=l=lo(l,a),We!==4&&(We=2),ta===null?ta=[s]:ta.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var g=Cw(s,l,t);cv(s,g);break e;case 1:a=l;var w=s.type,b=s.stateNode;if(!(s.flags&128)&&(typeof w.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Gr===null||!Gr.has(b)))){s.flags|=65536,t&=-t,s.lanes|=t;var k=Tw(s,a,t);cv(s,k);break e}}s=s.return}while(s!==null)}Hw(n)}catch(T){t=T,Be===n&&n!==null&&(Be=n=n.return);continue}break}while(!0)}function Vw(){var e=Ou.current;return Ou.current=Au,e===null?Au:e}function Xh(){(We===0||We===3||We===2)&&(We=4),Xe===null||!(Gi&268435455)&&!(fc&268435455)||Pr(Xe,ot)}function Mu(e,t){var n=de;de|=2;var r=Vw();(Xe!==e||ot!==t)&&(tr=null,$i(e,t));do try{a_();break}catch(i){zw(e,i)}while(!0);if(Dh(),de=n,Ou.current=r,Be!==null)throw Error(I(261));return Xe=null,ot=0,We}function a_(){for(;Be!==null;)Uw(Be)}function l_(){for(;Be!==null&&!DT();)Uw(Be)}function Uw(e){var t=qw(e.alternate,e,$t);e.memoizedProps=e.pendingProps,t===null?Hw(e):Be=t,qh.current=null}function Hw(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=t_(n,t),n!==null){n.flags&=32767,Be=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{We=6,Be=null;return}}else if(n=e_(n,t,$t),n!==null){Be=n;return}if(t=t.sibling,t!==null){Be=t;return}Be=t=e}while(t!==null);We===0&&(We=5)}function xi(e,t,n){var r=he,i=an.transition;try{an.transition=null,he=1,u_(e,t,n,r)}finally{an.transition=i,he=r}return null}function u_(e,t,n,r){do Vs();while($r!==null);if(de&6)throw Error(I(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(I(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(UT(e,s),e===Xe&&(Be=Xe=null,ot=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||_l||(_l=!0,Gw(gu,function(){return Vs(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=an.transition,an.transition=null;var o=he;he=1;var a=de;de|=4,qh.current=null,r_(e,n),Iw(n,e),jE(Pf),yu=!!_f,Pf=_f=null,e.current=n,i_(n),FT(),de=a,he=o,an.transition=s}else e.current=n;if(_l&&(_l=!1,$r=e,Fu=i),s=e.pendingLanes,s===0&&(Gr=null),LT(n.stateNode),Ft(e,$e()),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(Du)throw Du=!1,e=Qf,Qf=null,e;return Fu&1&&e.tag!==0&&Vs(),s=e.pendingLanes,s&1?e===Yf?na++:(na=0,Yf=e):na=0,li(),null}function Vs(){if($r!==null){var e=C1(Fu),t=an.transition,n=he;try{if(an.transition=null,he=16>e?16:e,$r===null)var r=!1;else{if(e=$r,$r=null,Fu=0,de&6)throw Error(I(331));var i=de;for(de|=4,W=e.current;W!==null;){var s=W,o=s.child;if(W.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(W=c;W!==null;){var d=W;switch(d.tag){case 0:case 11:case 15:ea(8,d,s)}var u=d.child;if(u!==null)u.return=d,W=u;else for(;W!==null;){d=W;var f=d.sibling,p=d.return;if(Mw(d),d===c){W=null;break}if(f!==null){f.return=p,W=f;break}W=p}}}var h=s.alternate;if(h!==null){var m=h.child;if(m!==null){h.child=null;do{var x=m.sibling;m.sibling=null,m=x}while(m!==null)}}W=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,W=o;else e:for(;W!==null;){if(s=W,s.flags&2048)switch(s.tag){case 0:case 11:case 15:ea(9,s,s.return)}var g=s.sibling;if(g!==null){g.return=s.return,W=g;break e}W=s.return}}var w=e.current;for(W=w;W!==null;){o=W;var b=o.child;if(o.subtreeFlags&2064&&b!==null)b.return=o,W=b;else e:for(o=w;W!==null;){if(a=W,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:dc(9,a)}}catch(T){Me(a,a.return,T)}if(a===o){W=null;break e}var k=a.sibling;if(k!==null){k.return=a.return,W=k;break e}W=a.return}}if(de=i,li(),zn&&typeof zn.onPostCommitFiberRoot=="function")try{zn.onPostCommitFiberRoot(rc,e)}catch{}r=!0}return r}finally{he=n,an.transition=t}}return!1}function Av(e,t,n){t=lo(n,t),t=Cw(e,t,1),e=qr(e,t,1),t=wt(),e!==null&&(Ga(e,1,t),Ft(e,t))}function Me(e,t,n){if(e.tag===3)Av(e,e,n);else for(;t!==null;){if(t.tag===3){Av(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Gr===null||!Gr.has(r))){e=lo(n,e),e=Tw(t,e,1),t=qr(t,e,1),e=wt(),t!==null&&(Ga(t,1,e),Ft(t,e));break}}t=t.return}}function c_(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=wt(),e.pingedLanes|=e.suspendedLanes&n,Xe===e&&(ot&n)===n&&(We===4||We===3&&(ot&130023424)===ot&&500>$e()-Qh?$i(e,0):Gh|=n),Ft(e,t)}function Ww(e,t){t===0&&(e.mode&1?(t=vl,vl<<=1,!(vl&130023424)&&(vl=4194304)):t=1);var n=wt();e=fr(e,t),e!==null&&(Ga(e,t,n),Ft(e,n))}function d_(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ww(e,n)}function f_(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(I(314))}r!==null&&r.delete(t),Ww(e,n)}var qw;qw=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ot.current)At=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return At=!1,JE(e,t,n);At=!!(e.flags&131072)}else At=!1,Ee&&t.flags&1048576&&K1(t,Tu,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Kl(e,t),e=t.pendingProps;var i=io(t,mt.current);zs(t,n),i=zh(null,t,r,e,i,n);var s=Vh();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Dt(r)?(s=!0,ku(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Nh(t),i.updater=cc,t.stateNode=i,i._reactInternals=t,Lf(t,r,e,n),t=Bf(null,t,r,!0,s,n)):(t.tag=0,Ee&&s&&jh(t),yt(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Kl(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=h_(r),e=vn(r,e),i){case 0:t=$f(null,t,r,e,n);break e;case 1:t=bv(null,t,r,e,n);break e;case 11:t=xv(null,t,r,e,n);break e;case 14:t=wv(null,t,r,vn(r.type,e),n);break e}throw Error(I(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:vn(r,i),$f(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:vn(r,i),bv(e,t,r,i,n);case 3:e:{if(jw(t),e===null)throw Error(I(387));r=t.pendingProps,s=t.memoizedState,i=s.element,nw(e,t),Pu(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=lo(Error(I(423)),t),t=Sv(e,t,r,n,i);break e}else if(r!==i){i=lo(Error(I(424)),t),t=Sv(e,t,r,n,i);break e}else for(Bt=Wr(t.stateNode.containerInfo.firstChild),Ut=t,Ee=!0,bn=null,n=ew(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(so(),r===i){t=pr(e,t,n);break e}yt(e,t,r,n)}t=t.child}return t;case 5:return rw(t),e===null&&Ff(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,jf(r,i)?o=null:s!==null&&jf(r,s)&&(t.flags|=32),Pw(e,t),yt(e,t,o,n),t.child;case 6:return e===null&&Ff(t),null;case 13:return Rw(e,t,n);case 4:return Lh(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=oo(t,null,r,n):yt(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:vn(r,i),xv(e,t,r,i,n);case 7:return yt(e,t,t.pendingProps,n),t.child;case 8:return yt(e,t,t.pendingProps.children,n),t.child;case 12:return yt(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,be(Eu,r._currentValue),r._currentValue=o,s!==null)if(Tn(s.value,o)){if(s.children===i.children&&!Ot.current){t=pr(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=lr(-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),Mf(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(I(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Mf(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}yt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,zs(t,n),i=un(i),r=r(i),t.flags|=1,yt(e,t,r,n),t.child;case 14:return r=t.type,i=vn(r,t.pendingProps),i=vn(r.type,i),wv(e,t,r,i,n);case 15:return Ew(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:vn(r,i),Kl(e,t),t.tag=1,Dt(r)?(e=!0,ku(t)):e=!1,zs(t,n),kw(t,r,i),Lf(t,r,i,n),Bf(null,t,r,!0,e,n);case 19:return Aw(e,t,n);case 22:return _w(e,t,n)}throw Error(I(156,t.tag))};function Gw(e,t){return w1(e,t)}function p_(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 sn(e,t,n,r){return new p_(e,t,n,r)}function Zh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function h_(e){if(typeof e=="function")return Zh(e)?1:0;if(e!=null){if(e=e.$$typeof,e===vh)return 11;if(e===yh)return 14}return 2}function Yr(e,t){var n=e.alternate;return n===null?(n=sn(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 Jl(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")Zh(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case ws:return Bi(n.children,i,s,t);case gh:o=8,i|=8;break;case af:return e=sn(12,n,t,i|2),e.elementType=af,e.lanes=s,e;case lf:return e=sn(13,n,t,i),e.elementType=lf,e.lanes=s,e;case uf:return e=sn(19,n,t,i),e.elementType=uf,e.lanes=s,e;case r1:return pc(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case t1:o=10;break e;case n1:o=9;break e;case vh:o=11;break e;case yh:o=14;break e;case Cr:o=16,r=null;break e}throw Error(I(130,e==null?e:typeof e,""))}return t=sn(o,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function Bi(e,t,n,r){return e=sn(7,e,r,t),e.lanes=n,e}function pc(e,t,n,r){return e=sn(22,e,r,t),e.elementType=r1,e.lanes=n,e.stateNode={isHidden:!1},e}function kd(e,t,n){return e=sn(6,e,null,t),e.lanes=n,e}function Cd(e,t,n){return t=sn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function m_(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=id(0),this.expirationTimes=id(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=id(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Jh(e,t,n,r,i,s,o,a,l){return e=new m_(e,t,n,a,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=sn(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Nh(s),e}function g_(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:xs,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Qw(e){if(!e)return ni;e=e._reactInternals;e:{if(es(e)!==e||e.tag!==1)throw Error(I(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Dt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(I(171))}if(e.tag===1){var n=e.type;if(Dt(n))return Q1(e,n,t)}return t}function Yw(e,t,n,r,i,s,o,a,l){return e=Jh(n,r,!0,e,i,s,o,a,l),e.context=Qw(null),n=e.current,r=wt(),i=Qr(n),s=lr(r,i),s.callback=t??null,qr(n,s,i),e.current.lanes=i,Ga(e,i,r),Ft(e,r),e}function hc(e,t,n,r){var i=t.current,s=wt(),o=Qr(i);return n=Qw(n),t.context===null?t.context=n:t.pendingContext=n,t=lr(s,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=qr(i,t,o),e!==null&&(Cn(e,i,o,s),Gl(e,i,o)),o}function Nu(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 Ov(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function em(e,t){Ov(e,t),(e=e.alternate)&&Ov(e,t)}function v_(){return null}var Kw=typeof reportError=="function"?reportError:function(e){console.error(e)};function tm(e){this._internalRoot=e}mc.prototype.render=tm.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(I(409));hc(e,t,null,null)};mc.prototype.unmount=tm.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Qi(function(){hc(null,e,null,null)}),t[dr]=null}};function mc(e){this._internalRoot=e}mc.prototype.unstable_scheduleHydration=function(e){if(e){var t=_1();e={blockedOn:null,target:e,priority:t};for(var n=0;n<_r.length&&t!==0&&t<_r[n].priority;n++);_r.splice(n,0,e),n===0&&j1(e)}};function nm(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function gc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Dv(){}function y_(e,t,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var c=Nu(o);s.call(c)}}var o=Yw(t,r,e,0,null,!1,!1,"",Dv);return e._reactRootContainer=o,e[dr]=o.current,ya(e.nodeType===8?e.parentNode:e),Qi(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var c=Nu(l);a.call(c)}}var l=Jh(e,0,!1,null,null,!1,!1,"",Dv);return e._reactRootContainer=l,e[dr]=l.current,ya(e.nodeType===8?e.parentNode:e),Qi(function(){hc(t,l,n,r)}),l}function vc(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=Nu(o);a.call(l)}}hc(t,o,e,i)}else o=y_(n,t,e,i,r);return Nu(o)}T1=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Vo(t.pendingLanes);n!==0&&(bh(t,n|1),Ft(t,$e()),!(de&6)&&(uo=$e()+500,li()))}break;case 13:Qi(function(){var r=fr(e,1);if(r!==null){var i=wt();Cn(r,e,1,i)}}),em(e,1)}};Sh=function(e){if(e.tag===13){var t=fr(e,134217728);if(t!==null){var n=wt();Cn(t,e,134217728,n)}em(e,134217728)}};E1=function(e){if(e.tag===13){var t=Qr(e),n=fr(e,t);if(n!==null){var r=wt();Cn(n,e,t,r)}em(e,t)}};_1=function(){return he};P1=function(e,t){var n=he;try{return he=e,t()}finally{he=n}};xf=function(e,t,n){switch(t){case"input":if(ff(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=ac(r);if(!i)throw Error(I(90));s1(r),ff(r,i)}}}break;case"textarea":a1(e,n);break;case"select":t=n.value,t!=null&&Ls(e,!!n.multiple,t,!1)}};h1=Yh;m1=Qi;var x_={usingClientEntryPoint:!1,Events:[Ya,Cs,ac,f1,p1,Yh]},No={findFiberByHostInstance:Ti,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},w_={bundleType:No.bundleType,version:No.version,rendererPackageName:No.rendererPackageName,rendererConfig:No.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:mr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=y1(e),e===null?null:e.stateNode},findFiberByHostInstance:No.findFiberByHostInstance||v_,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 Pl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Pl.isDisabled&&Pl.supportsFiber)try{rc=Pl.inject(w_),zn=Pl}catch{}}Wt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=x_;Wt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!nm(t))throw Error(I(200));return g_(e,t,null,n)};Wt.createRoot=function(e,t){if(!nm(e))throw Error(I(299));var n=!1,r="",i=Kw;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=Jh(e,1,!1,null,null,n,!1,r,i),e[dr]=t.current,ya(e.nodeType===8?e.parentNode:e),new tm(t)};Wt.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(I(188)):(e=Object.keys(e).join(","),Error(I(268,e)));return e=y1(t),e=e===null?null:e.stateNode,e};Wt.flushSync=function(e){return Qi(e)};Wt.hydrate=function(e,t,n){if(!gc(t))throw Error(I(200));return vc(null,e,t,!0,n)};Wt.hydrateRoot=function(e,t,n){if(!nm(e))throw Error(I(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",o=Kw;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=Yw(t,null,e,1,n??null,i,!1,s,o),e[dr]=t.current,ya(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 mc(t)};Wt.render=function(e,t,n){if(!gc(t))throw Error(I(200));return vc(null,e,t,!1,n)};Wt.unmountComponentAtNode=function(e){if(!gc(e))throw Error(I(40));return e._reactRootContainer?(Qi(function(){vc(null,null,e,!1,function(){e._reactRootContainer=null,e[dr]=null})}),!0):!1};Wt.unstable_batchedUpdates=Yh;Wt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!gc(n))throw Error(I(200));if(e==null||e._reactInternals===void 0)throw Error(I(38));return vc(e,t,n,!1,r)};Wt.version="18.3.1-next-f1338f8080-20240426";function Xw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Xw)}catch(e){console.error(e)}}Xw(),Xx.exports=Wt;var Zw=Xx.exports;const b_=Zi(Zw);var Jw,Fv=Zw;Jw=Fv.createRoot,Fv.hydrateRoot;const S_="@alfatech/livechat",k_="v2025.10.23.4",C_="module",T_="https://api-live.alfatek.dev",E_="wss://api-live.alfatek.dev",__=["dist","README.md","component/chatier.js"],P_="dist/widget.js",j_={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"},R_={"@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"},A_={"@biomejs/biome":"^1.8.3","@types/node":"^22.5.4","@types/react":"^18.3.3","@types/react-dom":"^18.3.0","@vitejs/plugin-react-swc":"^3.5.0",globals:"^15.9.0",husky:"^9.1.5",tailwindcss:"^4.1.4",typescript:"^5.5.3",vite:"^5.4.1"},eb={name:S_,private:!1,version:k_,type:C_,apiURL:T_,wsURL:E_,files:__,main:P_,scripts:j_,dependencies:R_,devDependencies:A_,"lint-staged":{"./**/*.{js,ts,tsx,json}":["npm run format"]}},O_=eb.apiURL,D_=eb.wsURL,F_=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],M_=(e,t)=>[{message:"message"in t?t.message:"Not Found"},404],N_={429:F_,404:M_};async function bo(e,t={}){const n={};!(t.body instanceof FormData)&&t.body&&(n["Content-Type"]="application/json");const r=await fetch(`${O_}/${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=N_[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 Xa=e=>[200,201,204].includes(e),L_=(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 So=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(){}},Yi=typeof window>"u"||"Deno"in globalThis;function en(){}function I_(e,t){return typeof e=="function"?e(t):e}function Zf(e){return typeof e=="number"&&e>=0&&e!==1/0}function tb(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Us(e,t){return typeof e=="function"?e(t):e}function Sn(e,t){return typeof e=="function"?e(t):e}function Mv(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:a}=e;if(o){if(r){if(t.queryHash!==rm(o,t.options))return!1}else if(!_a(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 Nv(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Ki(t.options.mutationKey)!==Ki(s))return!1}else if(!_a(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function rm(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ki)(e)}function Ki(e){return JSON.stringify(e,(t,n)=>Jf(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function _a(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!_a(e[n],t[n])):!1}function nb(e,t){if(e===t)return e;const n=Lv(e)&&Lv(t);if(n||Jf(e)&&Jf(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]=nb(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&l++)}return i===o&&l===i?e:a}return t}function Lu(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 Lv(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Jf(e){if(!Iv(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Iv(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Iv(e){return Object.prototype.toString.call(e)==="[object Object]"}function $_(e){return new Promise(t=>{setTimeout(t,e)})}function ep(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?nb(e,t):t}function B_(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function z_(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var im=Symbol();function rb(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===im?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Oi,jr,Hs,Rx,V_=(Rx=class extends So{constructor(){super();X(this,Oi);X(this,jr);X(this,Hs);U(this,Hs,t=>{if(!Yi&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){S(this,jr)||this.setEventListener(S(this,Hs))}onUnsubscribe(){var t;this.hasListeners()||((t=S(this,jr))==null||t.call(this),U(this,jr,void 0))}setEventListener(t){var n;U(this,Hs,t),(n=S(this,jr))==null||n.call(this),U(this,jr,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){S(this,Oi)!==t&&(U(this,Oi,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof S(this,Oi)=="boolean"?S(this,Oi):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Oi=new WeakMap,jr=new WeakMap,Hs=new WeakMap,Rx),sm=new V_,Ws,Rr,qs,Ax,U_=(Ax=class extends So{constructor(){super();X(this,Ws,!0);X(this,Rr);X(this,qs);U(this,qs,t=>{if(!Yi&&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(){S(this,Rr)||this.setEventListener(S(this,qs))}onUnsubscribe(){var t;this.hasListeners()||((t=S(this,Rr))==null||t.call(this),U(this,Rr,void 0))}setEventListener(t){var n;U(this,qs,t),(n=S(this,Rr))==null||n.call(this),U(this,Rr,t(this.setOnline.bind(this)))}setOnline(t){S(this,Ws)!==t&&(U(this,Ws,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return S(this,Ws)}},Ws=new WeakMap,Rr=new WeakMap,qs=new WeakMap,Ax),Iu=new U_;function tp(){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 H_(e){return Math.min(1e3*2**e,3e4)}function ib(e){return(e??"online")==="online"?Iu.isOnline():!0}var sb=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Td(e){return e instanceof sb}function ob(e){let t=!1,n=0,r=!1,i;const s=tp(),o=m=>{var x;r||(f(new sb(m)),(x=e.abort)==null||x.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>sm.isFocused()&&(e.networkMode==="always"||Iu.isOnline())&&e.canRun(),d=()=>ib(e.networkMode)&&e.canRun(),u=m=>{var x;r||(r=!0,(x=e.onSuccess)==null||x.call(e,m),i==null||i(),s.resolve(m))},f=m=>{var x;r||(r=!0,(x=e.onError)==null||x.call(e,m),i==null||i(),s.reject(m))},p=()=>new Promise(m=>{var x;i=g=>{(r||c())&&m(g)},(x=e.onPause)==null||x.call(e)}).then(()=>{var m;i=void 0,r||(m=e.onContinue)==null||m.call(e)}),h=()=>{if(r)return;let m;const x=n===0?e.initialPromise:void 0;try{m=x??e.fn()}catch(g){m=Promise.reject(g)}Promise.resolve(m).then(u).catch(g=>{var E;if(r)return;const w=e.retry??(Yi?0:3),b=e.retryDelay??H_,k=typeof b=="function"?b(n,g):b,T=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,g);if(t||!T){f(g);return}n++,(E=e.onFail)==null||E.call(e,n,g),$_(k).then(()=>c()?void 0:p()).then(()=>{t?f(g):h()})})};return{promise:s,cancel:o,continue:()=>(i==null||i(),s),cancelRetry:a,continueRetry:l,canStart:d,start:()=>(d()?h():p().then(h),s)}}function W_(){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 He=W_(),Di,Ox,ab=(Ox=class{constructor(){X(this,Di)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Zf(this.gcTime)&&U(this,Di,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Yi?1/0:5*60*1e3))}clearGcTimeout(){S(this,Di)&&(clearTimeout(S(this,Di)),U(this,Di,void 0))}},Di=new WeakMap,Ox),Gs,Qs,Jt,dt,Va,Fi,yn,er,Dx,q_=(Dx=class extends ab{constructor(t){super();X(this,yn);X(this,Gs);X(this,Qs);X(this,Jt);X(this,dt);X(this,Va);X(this,Fi);U(this,Fi,!1),U(this,Va,t.defaultOptions),this.setOptions(t.options),this.observers=[],U(this,Jt,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,U(this,Gs,G_(this.options)),this.state=t.state??S(this,Gs),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=S(this,dt))==null?void 0:t.promise}setOptions(t){this.options={...S(this,Va),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&S(this,Jt).remove(this)}setData(t,n){const r=ep(this.state.data,t,this.options);return se(this,yn,er).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){se(this,yn,er).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=S(this,dt))==null?void 0:r.promise;return(i=S(this,dt))==null||i.cancel(t),n?n.then(en).catch(en):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(S(this,Gs))}isActive(){return this.observers.some(t=>Sn(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===im||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!tb(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=S(this,dt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=S(this,dt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),S(this,Jt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(S(this,dt)&&(S(this,Fi)?S(this,dt).cancel({revert:!0}):S(this,dt).cancelRetry()),this.scheduleGc()),S(this,Jt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||se(this,yn,er).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(S(this,dt))return S(this,dt).continueRetry(),S(this,dt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const u=this.observers.find(f=>f.options.queryFn);u&&this.setOptions(u.options)}const r=new AbortController,i=u=>{Object.defineProperty(u,"signal",{enumerable:!0,get:()=>(U(this,Fi,!0),r.signal)})},s=()=>{const u=rb(this.options,n),f={queryKey:this.queryKey,meta:this.meta};return i(f),U(this,Fi,!1),this.options.persister?this.options.persister(u,f,this):u(f)},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),U(this,Qs,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=o.fetchOptions)==null?void 0:c.meta))&&se(this,yn,er).call(this,{type:"fetch",meta:(d=o.fetchOptions)==null?void 0:d.meta});const a=u=>{var f,p,h,m;Td(u)&&u.silent||se(this,yn,er).call(this,{type:"error",error:u}),Td(u)||((p=(f=S(this,Jt).config).onError)==null||p.call(f,u,this),(m=(h=S(this,Jt).config).onSettled)==null||m.call(h,this.state.data,u,this)),this.scheduleGc()};return U(this,dt,ob({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:u=>{var f,p,h,m;if(u===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(u)}catch(x){a(x);return}(p=(f=S(this,Jt).config).onSuccess)==null||p.call(f,u,this),(m=(h=S(this,Jt).config).onSettled)==null||m.call(h,u,this.state.error,this),this.scheduleGc()},onError:a,onFail:(u,f)=>{se(this,yn,er).call(this,{type:"failed",failureCount:u,error:f})},onPause:()=>{se(this,yn,er).call(this,{type:"pause"})},onContinue:()=>{se(this,yn,er).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),S(this,dt).start()}},Gs=new WeakMap,Qs=new WeakMap,Jt=new WeakMap,dt=new WeakMap,Va=new WeakMap,Fi=new WeakMap,yn=new WeakSet,er=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,...lb(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return Td(i)&&i.revert&&S(this,Qs)?{...S(this,Qs),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),He.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),S(this,Jt).notify({query:this,type:"updated",action:t})})},Dx);function lb(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ib(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function G_(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 Mn,Fx,Q_=(Fx=class extends So{constructor(t={}){super();X(this,Mn);this.config=t,U(this,Mn,new Map)}build(t,n,r){const i=n.queryKey,s=n.queryHash??rm(i,n);let o=this.get(s);return o||(o=new q_({cache:this,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){S(this,Mn).has(t.queryHash)||(S(this,Mn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=S(this,Mn).get(t.queryHash);n&&(t.destroy(),n===t&&S(this,Mn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){He.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return S(this,Mn).get(t)}getAll(){return[...S(this,Mn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Mv(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Mv(t,r)):n}notify(t){He.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){He.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){He.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Mn=new WeakMap,Fx),Nn,gt,Mi,Ln,Sr,Mx,Y_=(Mx=class extends ab{constructor(t){super();X(this,Ln);X(this,Nn);X(this,gt);X(this,Mi);this.mutationId=t.mutationId,U(this,gt,t.mutationCache),U(this,Nn,[]),this.state=t.state||ub(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){S(this,Nn).includes(t)||(S(this,Nn).push(t),this.clearGcTimeout(),S(this,gt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){U(this,Nn,S(this,Nn).filter(n=>n!==t)),this.scheduleGc(),S(this,gt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){S(this,Nn).length||(this.state.status==="pending"?this.scheduleGc():S(this,gt).remove(this))}continue(){var t;return((t=S(this,Mi))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,s,o,a,l,c,d,u,f,p,h,m,x,g,w,b,k,T,E,_;U(this,Mi,ob({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(P,M)=>{se(this,Ln,Sr).call(this,{type:"failed",failureCount:P,error:M})},onPause:()=>{se(this,Ln,Sr).call(this,{type:"pause"})},onContinue:()=>{se(this,Ln,Sr).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>S(this,gt).canRun(this)}));const n=this.state.status==="pending",r=!S(this,Mi).canStart();try{if(!n){se(this,Ln,Sr).call(this,{type:"pending",variables:t,isPaused:r}),await((s=(i=S(this,gt).config).onMutate)==null?void 0:s.call(i,t,this));const M=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,t));M!==this.state.context&&se(this,Ln,Sr).call(this,{type:"pending",context:M,variables:t,isPaused:r})}const P=await S(this,Mi).start();return await((c=(l=S(this,gt).config).onSuccess)==null?void 0:c.call(l,P,t,this.state.context,this)),await((u=(d=this.options).onSuccess)==null?void 0:u.call(d,P,t,this.state.context)),await((p=(f=S(this,gt).config).onSettled)==null?void 0:p.call(f,P,null,this.state.variables,this.state.context,this)),await((m=(h=this.options).onSettled)==null?void 0:m.call(h,P,null,t,this.state.context)),se(this,Ln,Sr).call(this,{type:"success",data:P}),P}catch(P){try{throw await((g=(x=S(this,gt).config).onError)==null?void 0:g.call(x,P,t,this.state.context,this)),await((b=(w=this.options).onError)==null?void 0:b.call(w,P,t,this.state.context)),await((T=(k=S(this,gt).config).onSettled)==null?void 0:T.call(k,void 0,P,this.state.variables,this.state.context,this)),await((_=(E=this.options).onSettled)==null?void 0:_.call(E,void 0,P,t,this.state.context)),P}finally{se(this,Ln,Sr).call(this,{type:"error",error:P})}}finally{S(this,gt).runNext(this)}}},Nn=new WeakMap,gt=new WeakMap,Mi=new WeakMap,Ln=new WeakSet,Sr=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),He.batch(()=>{S(this,Nn).forEach(r=>{r.onMutationUpdate(t)}),S(this,gt).notify({mutation:this,type:"updated",action:t})})},Mx);function ub(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var It,Ua,Nx,K_=(Nx=class extends So{constructor(t={}){super();X(this,It);X(this,Ua);this.config=t,U(this,It,new Map),U(this,Ua,Date.now())}build(t,n,r){const i=new Y_({mutationCache:this,mutationId:++dl(this,Ua)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){const n=jl(t),r=S(this,It).get(n)??[];r.push(t),S(this,It).set(n,r),this.notify({type:"added",mutation:t})}remove(t){var r;const n=jl(t);if(S(this,It).has(n)){const i=(r=S(this,It).get(n))==null?void 0:r.filter(s=>s!==t);i&&(i.length===0?S(this,It).delete(n):S(this,It).set(n,i))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=(r=S(this,It).get(jl(t)))==null?void 0:r.find(i=>i.state.status==="pending");return!n||n===t}runNext(t){var r;const n=(r=S(this,It).get(jl(t)))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){He.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...S(this,It).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Nv(n,r))}findAll(t={}){return this.getAll().filter(n=>Nv(t,n))}notify(t){He.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return He.batch(()=>Promise.all(t.map(n=>n.continue().catch(en))))}},It=new WeakMap,Ua=new WeakMap,Nx);function jl(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function $v(e){return{onFetch:(t,n)=>{var d,u,f,p,h;const r=t.options,i=(f=(u=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:u.fetchMore)==null?void 0:f.direction,s=((p=t.state.data)==null?void 0:p.pages)||[],o=((h=t.state.data)==null?void 0:h.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let m=!1;const x=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(t.signal.aborted?m=!0:t.signal.addEventListener("abort",()=>{m=!0}),t.signal)})},g=rb(t.options,t.fetchOptions),w=async(b,k,T)=>{if(m)return Promise.reject();if(k==null&&b.pages.length)return Promise.resolve(b);const E={queryKey:t.queryKey,pageParam:k,direction:T?"backward":"forward",meta:t.options.meta};x(E);const _=await g(E),{maxPages:P}=t.options,M=T?z_:B_;return{pages:M(b.pages,_,P),pageParams:M(b.pageParams,k,P)}};if(i&&s.length){const b=i==="backward",k=b?X_:Bv,T={pages:s,pageParams:o},E=k(r,T);a=await w(T,E,b)}else{const b=e??s.length;do{const k=l===0?o[0]??r.initialPageParam:Bv(r,a);if(l>0&&k==null)break;a=await w(a,k),l++}while(l<b)}return a};t.options.persister?t.fetchFn=()=>{var m,x;return(x=(m=t.options).persister)==null?void 0:x.call(m,c,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function Bv(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 X_(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 De,Ar,Or,Ys,Ks,Dr,Xs,Zs,Lx,Z_=(Lx=class{constructor(e={}){X(this,De);X(this,Ar);X(this,Or);X(this,Ys);X(this,Ks);X(this,Dr);X(this,Xs);X(this,Zs);U(this,De,e.queryCache||new Q_),U(this,Ar,e.mutationCache||new K_),U(this,Or,e.defaultOptions||{}),U(this,Ys,new Map),U(this,Ks,new Map),U(this,Dr,0)}mount(){dl(this,Dr)._++,S(this,Dr)===1&&(U(this,Xs,sm.subscribe(async e=>{e&&(await this.resumePausedMutations(),S(this,De).onFocus())})),U(this,Zs,Iu.subscribe(async e=>{e&&(await this.resumePausedMutations(),S(this,De).onOnline())})))}unmount(){var e,t;dl(this,Dr)._--,S(this,Dr)===0&&((e=S(this,Xs))==null||e.call(this),U(this,Xs,void 0),(t=S(this,Zs))==null||t.call(this),U(this,Zs,void 0))}isFetching(e){return S(this,De).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return S(this,Ar).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=S(this,De).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=S(this,De).build(this,n);return e.revalidateIfStale&&r.isStaleByTime(Us(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return S(this,De).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=S(this,De).get(r.queryHash),s=i==null?void 0:i.state.data,o=I_(t,s);if(o!==void 0)return S(this,De).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return He.batch(()=>S(this,De).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=S(this,De).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=S(this,De);He.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=S(this,De),r={type:"active",...e};return He.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=He.batch(()=>S(this,De).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(en).catch(en)}invalidateQueries(e,t={}){return He.batch(()=>{if(S(this,De).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=He.batch(()=>S(this,De).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(en)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(en)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=S(this,De).build(this,t);return n.isStaleByTime(Us(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(en).catch(en)}fetchInfiniteQuery(e){return e.behavior=$v(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(en).catch(en)}ensureInfiniteQueryData(e){return e.behavior=$v(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Iu.isOnline()?S(this,Ar).resumePausedMutations():Promise.resolve()}getQueryCache(){return S(this,De)}getMutationCache(){return S(this,Ar)}getDefaultOptions(){return S(this,Or)}setDefaultOptions(e){U(this,Or,e)}setQueryDefaults(e,t){S(this,Ys).set(Ki(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...S(this,Ys).values()],n={};return t.forEach(r=>{_a(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){S(this,Ks).set(Ki(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...S(this,Ks).values()];let n={};return t.forEach(r=>{_a(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...S(this,Or).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=rm(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.enabled!==!0&&t.queryFn===im&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...S(this,Or).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){S(this,De).clear(),S(this,Ar).clear()}},De=new WeakMap,Ar=new WeakMap,Or=new WeakMap,Ys=new WeakMap,Ks=new WeakMap,Dr=new WeakMap,Xs=new WeakMap,Zs=new WeakMap,Lx),Et,le,Ha,vt,Ni,Js,Fr,In,Wa,eo,to,Li,Ii,Mr,no,pe,Ho,np,rp,ip,sp,op,ap,lp,cb,Ix,J_=(Ix=class extends So{constructor(t,n){super();X(this,pe);X(this,Et);X(this,le);X(this,Ha);X(this,vt);X(this,Ni);X(this,Js);X(this,Fr);X(this,In);X(this,Wa);X(this,eo);X(this,to);X(this,Li);X(this,Ii);X(this,Mr);X(this,no,new Set);this.options=n,U(this,Et,t),U(this,In,null),U(this,Fr,tp()),this.options.experimental_prefetchInRender||S(this,Fr).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&&(S(this,le).addObserver(this),zv(S(this,le),this.options)?se(this,pe,Ho).call(this):this.updateResult(),se(this,pe,sp).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return up(S(this,le),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return up(S(this,le),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,se(this,pe,op).call(this),se(this,pe,ap).call(this),S(this,le).removeObserver(this)}setOptions(t,n){const r=this.options,i=S(this,le);if(this.options=S(this,Et).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Sn(this.options.enabled,S(this,le))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");se(this,pe,lp).call(this),S(this,le).setOptions(this.options),r._defaulted&&!Lu(this.options,r)&&S(this,Et).getQueryCache().notify({type:"observerOptionsUpdated",query:S(this,le),observer:this});const s=this.hasListeners();s&&Vv(S(this,le),i,this.options,r)&&se(this,pe,Ho).call(this),this.updateResult(n),s&&(S(this,le)!==i||Sn(this.options.enabled,S(this,le))!==Sn(r.enabled,S(this,le))||Us(this.options.staleTime,S(this,le))!==Us(r.staleTime,S(this,le)))&&se(this,pe,np).call(this);const o=se(this,pe,rp).call(this);s&&(S(this,le)!==i||Sn(this.options.enabled,S(this,le))!==Sn(r.enabled,S(this,le))||o!==S(this,Mr))&&se(this,pe,ip).call(this,o)}getOptimisticResult(t){const n=S(this,Et).getQueryCache().build(S(this,Et),t),r=this.createResult(n,t);return t2(this,r)&&(U(this,vt,r),U(this,Js,this.options),U(this,Ni,S(this,le).state)),r}getCurrentResult(){return S(this,vt)}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){S(this,no).add(t)}getCurrentQuery(){return S(this,le)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=S(this,Et).defaultQueryOptions(t),r=S(this,Et).getQueryCache().build(S(this,Et),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return se(this,pe,Ho).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),S(this,vt)))}createResult(t,n){var P;const r=S(this,le),i=this.options,s=S(this,vt),o=S(this,Ni),a=S(this,Js),c=t!==r?t.state:S(this,Ha),{state:d}=t;let u={...d},f=!1,p;if(n._optimisticResults){const M=this.hasListeners(),N=!M&&zv(t,n),R=M&&Vv(t,r,n,i);(N||R)&&(u={...u,...lb(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:h,errorUpdatedAt:m,status:x}=u;if(n.select&&u.data!==void 0)if(s&&u.data===(o==null?void 0:o.data)&&n.select===S(this,Wa))p=S(this,eo);else try{U(this,Wa,n.select),p=n.select(u.data),p=ep(s==null?void 0:s.data,p,n),U(this,eo,p),U(this,In,null)}catch(M){U(this,In,M)}else p=u.data;if(n.placeholderData!==void 0&&p===void 0&&x==="pending"){let M;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))M=s.data;else if(M=typeof n.placeholderData=="function"?n.placeholderData((P=S(this,to))==null?void 0:P.state.data,S(this,to)):n.placeholderData,n.select&&M!==void 0)try{M=n.select(M),U(this,In,null)}catch(N){U(this,In,N)}M!==void 0&&(x="success",p=ep(s==null?void 0:s.data,M,n),f=!0)}S(this,In)&&(h=S(this,In),p=S(this,eo),m=Date.now(),x="error");const g=u.fetchStatus==="fetching",w=x==="pending",b=x==="error",k=w&&g,T=p!==void 0,_={status:x,fetchStatus:u.fetchStatus,isPending:w,isSuccess:x==="success",isError:b,isInitialLoading:k,isLoading:k,data:p,dataUpdatedAt:u.dataUpdatedAt,error:h,errorUpdatedAt:m,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&&!w,isLoadingError:b&&!T,isPaused:u.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:b&&T,isStale:om(t,n),refetch:this.refetch,promise:S(this,Fr)};if(this.options.experimental_prefetchInRender){const M=F=>{_.status==="error"?F.reject(_.error):_.data!==void 0&&F.resolve(_.data)},N=()=>{const F=U(this,Fr,_.promise=tp());M(F)},R=S(this,Fr);switch(R.status){case"pending":t.queryHash===r.queryHash&&M(R);break;case"fulfilled":(_.status==="error"||_.data!==R.value)&&N();break;case"rejected":(_.status!=="error"||_.error!==R.reason)&&N();break}}return _}updateResult(t){const n=S(this,vt),r=this.createResult(S(this,le),this.options);if(U(this,Ni,S(this,le).state),U(this,Js,this.options),S(this,Ni).data!==void 0&&U(this,to,S(this,le)),Lu(r,n))return;U(this,vt,r);const i={},s=()=>{if(!n)return!0;const{notifyOnChangeProps:o}=this.options,a=typeof o=="function"?o():o;if(a==="all"||!a&&!S(this,no).size)return!0;const l=new Set(a??S(this,no));return this.options.throwOnError&&l.add("error"),Object.keys(S(this,vt)).some(c=>{const d=c;return S(this,vt)[d]!==n[d]&&l.has(d)})};(t==null?void 0:t.listeners)!==!1&&s()&&(i.listeners=!0),se(this,pe,cb).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&se(this,pe,sp).call(this)}},Et=new WeakMap,le=new WeakMap,Ha=new WeakMap,vt=new WeakMap,Ni=new WeakMap,Js=new WeakMap,Fr=new WeakMap,In=new WeakMap,Wa=new WeakMap,eo=new WeakMap,to=new WeakMap,Li=new WeakMap,Ii=new WeakMap,Mr=new WeakMap,no=new WeakMap,pe=new WeakSet,Ho=function(t){se(this,pe,lp).call(this);let n=S(this,le).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(en)),n},np=function(){se(this,pe,op).call(this);const t=Us(this.options.staleTime,S(this,le));if(Yi||S(this,vt).isStale||!Zf(t))return;const r=tb(S(this,vt).dataUpdatedAt,t)+1;U(this,Li,setTimeout(()=>{S(this,vt).isStale||this.updateResult()},r))},rp=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(S(this,le)):this.options.refetchInterval)??!1},ip=function(t){se(this,pe,ap).call(this),U(this,Mr,t),!(Yi||Sn(this.options.enabled,S(this,le))===!1||!Zf(S(this,Mr))||S(this,Mr)===0)&&U(this,Ii,setInterval(()=>{(this.options.refetchIntervalInBackground||sm.isFocused())&&se(this,pe,Ho).call(this)},S(this,Mr)))},sp=function(){se(this,pe,np).call(this),se(this,pe,ip).call(this,se(this,pe,rp).call(this))},op=function(){S(this,Li)&&(clearTimeout(S(this,Li)),U(this,Li,void 0))},ap=function(){S(this,Ii)&&(clearInterval(S(this,Ii)),U(this,Ii,void 0))},lp=function(){const t=S(this,Et).getQueryCache().build(S(this,Et),this.options);if(t===S(this,le))return;const n=S(this,le);U(this,le,t),U(this,Ha,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},cb=function(t){He.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(S(this,vt))}),S(this,Et).getQueryCache().notify({query:S(this,le),type:"observerResultsUpdated"})})},Ix);function e2(e,t){return Sn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function zv(e,t){return e2(e,t)||e.state.data!==void 0&&up(e,t,t.refetchOnMount)}function up(e,t,n){if(Sn(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&om(e,t)}return!1}function Vv(e,t,n,r){return(e!==t||Sn(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&om(e,n)}function om(e,t){return Sn(t.enabled,e)!==!1&&e.isStaleByTime(Us(t.staleTime,e))}function t2(e,t){return!Lu(e.getCurrentResult(),t)}var Nr,Lr,_t,ir,ur,eu,cp,$x,n2=($x=class extends So{constructor(t,n){super();X(this,ur);X(this,Nr);X(this,Lr);X(this,_t);X(this,ir);U(this,Nr,t),this.setOptions(n),this.bindMethods(),se(this,ur,eu).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=S(this,Nr).defaultMutationOptions(t),Lu(this.options,n)||S(this,Nr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:S(this,_t),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&Ki(n.mutationKey)!==Ki(this.options.mutationKey)?this.reset():((r=S(this,_t))==null?void 0:r.state.status)==="pending"&&S(this,_t).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=S(this,_t))==null||t.removeObserver(this)}onMutationUpdate(t){se(this,ur,eu).call(this),se(this,ur,cp).call(this,t)}getCurrentResult(){return S(this,Lr)}reset(){var t;(t=S(this,_t))==null||t.removeObserver(this),U(this,_t,void 0),se(this,ur,eu).call(this),se(this,ur,cp).call(this)}mutate(t,n){var r;return U(this,ir,n),(r=S(this,_t))==null||r.removeObserver(this),U(this,_t,S(this,Nr).getMutationCache().build(S(this,Nr),this.options)),S(this,_t).addObserver(this),S(this,_t).execute(t)}},Nr=new WeakMap,Lr=new WeakMap,_t=new WeakMap,ir=new WeakMap,ur=new WeakSet,eu=function(){var n;const t=((n=S(this,_t))==null?void 0:n.state)??ub();U(this,Lr,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},cp=function(t){He.batch(()=>{var n,r,i,s,o,a,l,c;if(S(this,ir)&&this.hasListeners()){const d=S(this,Lr).variables,u=S(this,Lr).context;(t==null?void 0:t.type)==="success"?((r=(n=S(this,ir)).onSuccess)==null||r.call(n,t.data,d,u),(s=(i=S(this,ir)).onSettled)==null||s.call(i,t.data,null,d,u)):(t==null?void 0:t.type)==="error"&&((a=(o=S(this,ir)).onError)==null||a.call(o,t.error,d,u),(c=(l=S(this,ir)).onSettled)==null||c.call(l,void 0,t.error,d,u))}this.listeners.forEach(d=>{d(S(this,Lr))})})},$x),db=v.createContext(void 0),fb=e=>{const t=v.useContext(db);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},r2=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),y.jsx(db.Provider,{value:e,children:t})),pb=v.createContext(!1),i2=()=>v.useContext(pb);pb.Provider;function s2(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var o2=v.createContext(s2()),a2=()=>v.useContext(o2);function hb(e,t){return typeof e=="function"?e(...t):!!e}function dp(){}var l2=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},u2=e=>{v.useEffect(()=>{e.clearReset()},[e])},c2=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&hb(n,[e.error,r]),d2=e=>{e.suspense&&(e.staleTime===void 0&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},f2=(e,t)=>e.isLoading&&e.isFetching&&!t,p2=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Uv=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function h2(e,t,n){var d,u,f,p,h;const r=fb(),i=i2(),s=a2(),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",d2(o),l2(o,s),u2(s);const a=!r.getQueryCache().get(o.queryHash),[l]=v.useState(()=>new t(r,o)),c=l.getOptimisticResult(o);if(v.useSyncExternalStore(v.useCallback(m=>{const x=i?dp:l.subscribe(He.batchCalls(m));return l.updateResult(),x},[l,i]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),v.useEffect(()=>{l.setOptions(o,{listeners:!1})},[o,l]),p2(o,c))throw Uv(o,l,s);if(c2({result:c,errorResetBoundary:s,throwOnError:o.throwOnError,query:r.getQueryCache().get(o.queryHash)}))throw c.error;if((p=(f=r.getDefaultOptions().queries)==null?void 0:f._experimental_afterQuery)==null||p.call(f,o,c),o.experimental_prefetchInRender&&!Yi&&f2(c,i)){const m=a?Uv(o,l,s):(h=r.getQueryCache().get(o.queryHash))==null?void 0:h.promise;m==null||m.catch(dp).finally(()=>{l.updateResult()})}return o.notifyOnChangeProps?c:l.trackResult(c)}function m2(e,t){return h2(e,J_)}function am(e,t){const n=fb(),[r]=v.useState(()=>new n2(n,e));v.useEffect(()=>{r.setOptions(e)},[r,e]);const i=v.useSyncExternalStore(v.useCallback(o=>r.subscribe(He.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=v.useCallback((o,a)=>{r.mutate(o,a).catch(dp)},[r]);if(i.error&&hb(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}const g2=e=>m2({queryKey:["widgets",e],queryFn:()=>v2(e)}),v2=e=>bo(`widgets/with-link/${e}`);var C=(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.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))(C||{}),Y=(e=>(e.TooltipDefault="tooltip_default",e.TooltipActive="tooltip_active",e.CloseButtonAria="close_button_aria",e.MessagePlaceholder="message_placeholder",e.FileUploadDisabled="file_upload_disabled",e.NewMessagesNotification="new_messages_notification",e.ChatCloseConfirm="chat_close_confirm",e.ChatCloseWarning="chat_close_warning",e.ChatSettings="chat_settings",e.ChatEndConversation="chat_end_conversation",e.CancelAction="cancel_action",e.CloseAction="close_action",e.QuickActions="quick_actions",e.GreetingStartChat="greeting_start_chat",e.RateLimitMessage="rate_limit_message",e.RatingHeaderEvaluate="rating_header_evaluate",e.RatingHeaderThanks="rating_header_thanks",e.RatingDescription="rating_description",e.RatingRateConversation="rating_rate_conversation",e.RatingComment="rating_comment",e.RatingCommentPlaceholder="rating_comment_placeholder",e.RatingSubmit="rating_submit",e.RatingNewConversation="rating_new_conversation",e.RatingThankYouTitle="rating_thank_you_title",e.RatingThankYouDescription="rating_thank_you_description",e.RatingCountdown="rating_countdown",e.RatingMinimumError="rating_minimum_error",e.RatingYourScore="rating_your_score",e.PoweredBy="powered_by",e))(Y||{});function y2(e){return!!e&&typeof e.public_id=="string"&&typeof e.link_id=="string"&&typeof e.name=="string"&&typeof e.is_browser_notification_enabled=="boolean"&&typeof e.is_hidden_on_offline=="boolean"&&typeof e.is_upload_disabled=="boolean"}/**
|
|
41
41
|
* @remix-run/router v1.21.0
|
|
42
42
|
*
|
|
43
43
|
* Copyright (c) Remix Software Inc.
|
|
@@ -92,7 +92,7 @@ Error generating stack: `+s.message+`
|
|
|
92
92
|
${f}px !important;
|
|
93
93
|
top: ${c}px !important;
|
|
94
94
|
}
|
|
95
|
-
`),()=>{document.head.removeChild(p)}},[t]),y.jsx(YP,{isPresent:t,childRef:i,sizeRef:s,children:v.cloneElement(e,{ref:i})})}const XP=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:o,anchorX:a})=>{const l=wc(ZP),c=v.useId();let d=!0,u=v.useMemo(()=>(d=!1,{id:c,initial:t,isPresent:n,custom:i,onExitComplete:f=>{l.set(f,!0);for(const p of l.values())if(!p)return;r&&r()},register:f=>(l.set(f,!1),()=>l.delete(f))}),[n,l,r]);return s&&d&&(u={...u}),v.useMemo(()=>{l.forEach((f,p)=>l.set(p,!1))},[n]),v.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),o==="popLayout"&&(e=y.jsx(KP,{isPresent:n,anchorX:a,children:e})),y.jsx(bc.Provider,{value:u,children:e})};function ZP(){return new Map}function Db(e=!0){const t=v.useContext(bc);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 Rl=e=>e.key||"";function ny(e){const t=[];return v.Children.forEach(e,n=>{v.isValidElement(n)&&t.push(n)}),t}const Xr=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:o=!1,anchorX:a="left"})=>{const[l,c]=Db(o),d=v.useMemo(()=>ny(e),[e]),u=o&&!l?[]:d.map(Rl),f=v.useRef(!0),p=v.useRef(d),h=wc(()=>new Map),[m,x]=v.useState(d),[g,w]=v.useState(d);Ob(()=>{f.current=!1,p.current=d;for(let T=0;T<g.length;T++){const E=Rl(g[T]);u.includes(E)?h.delete(E):h.get(E)!==!0&&h.set(E,!1)}},[g,u.length,u.join("-")]);const b=[];if(d!==m){let T=[...d];for(let E=0;E<g.length;E++){const _=g[E],P=Rl(_);u.includes(P)||(T.splice(E,0,_),b.push(_))}return s==="wait"&&b.length&&(T=b),w(ny(T)),x(d),null}const{forceRender:k}=v.useContext(dm);return y.jsx(y.Fragment,{children:g.map(T=>{const E=Rl(T),_=o&&!l?!1:d===g||u.includes(E),P=()=>{if(h.has(E))h.set(E,!0);else return;let M=!0;h.forEach(N=>{N||(M=!1)}),M&&(k==null||k(),w(p.current),o&&(c==null||c()),r&&r())};return y.jsx(XP,{isPresent:_,initial:!f.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:s,onExitComplete:_?void 0:P,anchorX:a,children:T},E)})})};function hm(e,t){e.indexOf(t)===-1&&e.push(t)}function mm(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}let gp=()=>{};const vp={skipAnimations:!1,useManualTiming:!1};function gm(e){let t;return()=>(t===void 0&&(t=e()),t)}const ln=e=>e,ja=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class vm{constructor(){this.subscriptions=[]}add(t){return hm(this.subscriptions,t),()=>mm(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let s=0;s<i;s++){const o=this.subscriptions[s];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Un=e=>e*1e3,Hn=e=>e/1e3;function Fb(e,t){return t?e*(1e3/t):0}const JP=gm(()=>window.ScrollTimeline!==void 0);class ej{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(JP()&&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 ej{then(t,n){return this.finished.finally(t).then(()=>{})}}const ry={value:null,addProjectionMetrics:null},ym=e=>Array.isArray(e)&&typeof e[0]=="number",nj={};function rj(e,t){const n=gm(e);return()=>nj[t]??n()}const Ra=rj(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Mb=(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)})`},Wo=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,yp={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Wo([0,.65,.55,1]),circOut:Wo([.55,0,1,.45]),backIn:Wo([.31,.01,.66,-.59]),backOut:Wo([.33,1.53,.69,.99])};function Nb(e,t){if(e)return typeof e=="function"&&Ra()?Mb(e,t):ym(e)?Wo(e):Array.isArray(e)?e.map(n=>Nb(n,t)||yp.easeOut):yp[e]}function ij(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=Nb(a,i);return Array.isArray(u)&&(d.easing=u),e.animate(d,{delay:r,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal",pseudoElement:c})}function xm(e){return typeof e=="function"&&"applyToOptions"in e}function wm(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const zu=2e4;function bm(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<zu;)t+=n,r=e.next(t);return t>=zu?1/0:t}function sj(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(bm(r),zu);return{type:"keyframes",ease:s=>r.next(i*s).value/t,duration:Hn(i)}}function Lb(e){return!!(typeof e=="function"&&Ra()||!e||typeof e=="string"&&(e in yp||Ra())||ym(e)||Array.isArray(e)&&e.every(Lb))}function iy(e,t){e.timeline=t,e.onfinish=null}const Al=["read","resolveKeyframes","update","preRender","render","postRender"];function oj(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,f=!1,p=!1)=>{const m=p&&i?n:r;return f&&o.add(u),m.has(u)||m.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&&ry.value&&ry.value.frameloop[t].push(l),l=0,n.clear(),i=!1,s&&(s=!1,d.process(u))}};return d}const aj=40;function Ib(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=Al.reduce((g,w)=>(g[w]=oj(s,t?w:void 0),g),{}),{read:a,resolveKeyframes:l,update:c,preRender:d,render:u,postRender:f}=o,p=()=>{const g=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(g-i.timestamp,aj),1),i.timestamp=g,i.isProcessing=!0,a.process(i),l.process(i),c.process(i),d.process(i),u.process(i),f.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(p))},h=()=>{n=!0,r=!0,i.isProcessing||e(p)};return{schedule:Al.reduce((g,w)=>{const b=o[w];return g[w]=(k,T=!1,E=!1)=>(n||h(),b.schedule(k,T,E)),g},{}),cancel:g=>{for(let w=0;w<Al.length;w++)o[Al[w]].cancel(g)},state:i,steps:o}}const{schedule:Sm,cancel:dB}=Ib(queueMicrotask,!1),{schedule:Se,cancel:ri,state:it,steps:Pd}=Ib(typeof requestAnimationFrame<"u"?requestAnimationFrame:ln,!0);let tu;function lj(){tu=void 0}const Wn={now:()=>(tu===void 0&&Wn.set(it.isProcessing||vp.useManualTiming?it.timestamp:performance.now()),tu),set:e=>{tu=e,queueMicrotask(lj)}},gn={x:!1,y:!1};function $b(){return gn.x||gn.y}function uj(e){return e==="x"||e==="y"?gn[e]?null:(gn[e]=!0,()=>{gn[e]=!1}):gn.x||gn.y?null:(gn.x=gn.y=!0,()=>{gn.x=gn.y=!1})}function cj(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 Bb(e,t){const n=cj(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function sy(e){return!(e.pointerType==="touch"||$b())}function dj(e,t,n={}){const[r,i,s]=Bb(e,n),o=a=>{if(!sy(a))return;const{target:l}=a,c=t(l,a);if(typeof c!="function"||!l)return;const d=u=>{sy(u)&&(c(u),l.removeEventListener("pointerleave",d))};l.addEventListener("pointerleave",d,i)};return r.forEach(a=>{a.addEventListener("pointerenter",o,i)}),s}const zb=(e,t)=>t?e===t?!0:zb(e,t.parentElement):!1,km=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,fj=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function pj(e){return fj.has(e.tagName)||e.tabIndex!==-1}const qo=new WeakSet;function oy(e){return t=>{t.key==="Enter"&&e(t)}}function jd(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const hj=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=oy(()=>{if(qo.has(n))return;jd(n,"down");const i=oy(()=>{jd(n,"up")}),s=()=>jd(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 ay(e){return km(e)&&!$b()}function mj(e,t,n={}){const[r,i,s]=Bb(e,n),o=a=>{const l=a.currentTarget;if(!ay(a)||qo.has(l))return;qo.add(l);const c=t(l,a),d=(p,h)=>{window.removeEventListener("pointerup",u),window.removeEventListener("pointercancel",f),!(!ay(p)||!qo.has(l))&&(qo.delete(l),typeof c=="function"&&c(p,{success:h}))},u=p=>{d(p,l===window||l===document||n.useGlobalTarget||zb(l,p.target))},f=p=>{d(p,!1)};window.addEventListener("pointerup",u,i),window.addEventListener("pointercancel",f,i)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),a instanceof HTMLElement&&(a.addEventListener("focus",c=>hj(c,i)),!pj(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}const ly=30,gj=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=Wn.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=Wn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=gj(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new vm);const r=this.events[t].add(n);return t==="change"?()=>{r(),Se.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=Wn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>ly)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,ly);return Fb(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 Aa(e,t){return new vj(e,t)}const Vb=v.createContext({strict:!1}),uy={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},fo={};for(const e in uy)fo[e]={isEnabled:t=>uy[e].some(n=>!!t[n])};function yj(e){for(const t in e)fo[t]={...fo[t],...e[t]}}const xj=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 Vu(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||xj.has(e)}let Ub=e=>!Vu(e);function wj(e){e&&(Ub=t=>t.startsWith("on")?!Vu(t):e(t))}try{wj(require("@emotion/is-prop-valid").default)}catch{}function bj(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(Ub(i)||n===!0&&Vu(i)||!t&&!Vu(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function Sj(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 Sc=v.createContext({});function kc(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Oa(e){return typeof e=="string"||Array.isArray(e)}const Cm=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Tm=["initial",...Cm];function Cc(e){return kc(e.animate)||Tm.some(t=>Oa(e[t]))}function Hb(e){return!!(Cc(e)||e.variants)}function kj(e,t){if(Cc(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Oa(n)?n:void 0,animate:Oa(r)?r:void 0}}return e.inherit!==!1?t:{}}function Cj(e){const{initial:t,animate:n}=kj(e,v.useContext(Sc));return v.useMemo(()=>({initial:t,animate:n}),[cy(t),cy(n)])}function cy(e){return Array.isArray(e)?e.join(" "):e}const Tj=Symbol.for("motionComponentSymbol");function As(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Ej(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):As(n)&&(n.current=r))},[t])}const Em=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),_j="framerAppearId",Wb="data-"+Em(_j),qb=v.createContext({});function Pj(e,t,n,r,i){var m,x;const{visualElement:s}=v.useContext(Sc),o=v.useContext(Vb),a=v.useContext(bc),l=v.useContext(pm).reducedMotion,c=v.useRef(null);r=r||o.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:s,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const d=c.current,u=v.useContext(qb);d&&!d.projection&&i&&(d.type==="html"||d.type==="svg")&&jj(c.current,n,i,u);const f=v.useRef(!1);v.useInsertionEffect(()=>{d&&f.current&&d.update(n,a)});const p=n[Wb],h=v.useRef(!!p&&!((m=window.MotionHandoffIsComplete)!=null&&m.call(window,p))&&((x=window.MotionHasOptimisedAnimation)==null?void 0:x.call(window,p)));return Ob(()=>{d&&(f.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),Sm.render(d.render),h.current&&d.animationState&&d.animationState.animateChanges())}),v.useEffect(()=>{d&&(!h.current&&d.animationState&&d.animationState.animateChanges(),h.current&&(queueMicrotask(()=>{var g;(g=window.MotionHandoffMarkAsComplete)==null||g.call(window,p)}),h.current=!1))}),d}function jj(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:Gb(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&As(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:l,layoutRoot:c})}function Gb(e){if(e)return e.options.allowProjection!==!1?e.projection:Gb(e.parent)}function Rj({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&yj(e);function s(a,l){let c;const d={...v.useContext(pm),...a,layoutId:Aj(a)},{isStatic:u}=d,f=Cj(a),p=r(a,u);if(!u&&fm){Oj();const h=Dj(d);c=h.MeasureLayout,f.visualElement=Pj(i,p,d,t,h.ProjectionNode)}return y.jsxs(Sc.Provider,{value:f,children:[c&&f.visualElement?y.jsx(c,{visualElement:f.visualElement,...d}):null,n(i,a,Ej(p,f.visualElement,l),p,u,f.visualElement)]})}s.displayName=`motion.${typeof i=="string"?i:`create(${i.displayName??i.name??""})`}`;const o=v.forwardRef(s);return o[Tj]=i,o}function Aj({layoutId:e}){const t=v.useContext(dm).id;return t&&e!==void 0?t+"-"+e:e}function Oj(e,t){v.useContext(Vb).strict}function Dj(e){const{drag:t,layout:n}=fo;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 Qb=e=>t=>typeof t=="string"&&t.startsWith(e),_m=Qb("--"),Fj=Qb("var(--"),Pm=e=>Fj(e)?Mj.test(e.split("/*")[0].trim()):!1,Mj=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Da={};function Nj(e){for(const t in e)Da[t]=e[t],_m(t)&&(Da[t].isCSSVariable=!0)}const ko=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],is=new Set(ko);function Yb(e,{layout:t,layoutId:n}){return is.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Da[e]||e==="opacity")}const ht=e=>!!(e&&e.getVelocity),Kb=(e,t)=>t&&typeof e=="number"?t.transform(e):e,hr=(e,t,n)=>n>t?t:n<e?e:n,Co={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Fa={...Co,transform:e=>hr(0,1,e)},Ol={...Co,default:1},el=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),kr=el("deg"),qn=el("%"),J=el("px"),Lj=el("vh"),Ij=el("vw"),dy={...qn,parse:e=>qn.parse(e)/100,transform:e=>qn.transform(e*100)},$j={borderWidth:J,borderTopWidth:J,borderRightWidth:J,borderBottomWidth:J,borderLeftWidth:J,borderRadius:J,radius:J,borderTopLeftRadius:J,borderTopRightRadius:J,borderBottomRightRadius:J,borderBottomLeftRadius:J,width:J,maxWidth:J,height:J,maxHeight:J,top:J,right:J,bottom:J,left:J,padding:J,paddingTop:J,paddingRight:J,paddingBottom:J,paddingLeft:J,margin:J,marginTop:J,marginRight:J,marginBottom:J,marginLeft:J,backgroundPositionX:J,backgroundPositionY:J},Bj={rotate:kr,rotateX:kr,rotateY:kr,rotateZ:kr,scale:Ol,scaleX:Ol,scaleY:Ol,scaleZ:Ol,skew:kr,skewX:kr,skewY:kr,distance:J,translateX:J,translateY:J,translateZ:J,x:J,y:J,z:J,perspective:J,transformPerspective:J,opacity:Fa,originX:dy,originY:dy,originZ:J},fy={...Co,transform:Math.round},jm={...$j,...Bj,zIndex:fy,size:J,fillOpacity:Fa,strokeOpacity:Fa,numOctaves:fy},zj={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Vj=ko.length;function Uj(e,t,n){let r="",i=!0;for(let s=0;s<Vj;s++){const o=ko[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=Kb(a,jm[o]);if(!l){i=!1;const d=zj[o]||o;r+=`${d}(${c}) `}n&&(t[o]=c)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function Rm(e,t,n){const{style:r,vars:i,transformOrigin:s}=e;let o=!1,a=!1;for(const l in t){const c=t[l];if(is.has(l)){o=!0;continue}else if(_m(l)){i[l]=c;continue}else{const d=Kb(c,jm[l]);l.startsWith("origin")?(a=!0,s[l]=d):r[l]=d}}if(t.transform||(o||n?r.transform=Uj(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 Am=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Xb(e,t,n){for(const r in t)!ht(t[r])&&!Yb(r,n)&&(e[r]=t[r])}function Hj({transformTemplate:e},t){return v.useMemo(()=>{const n=Am();return Rm(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Wj(e,t){const n=e.style||{},r={};return Xb(r,n,e),Object.assign(r,Hj(e,t)),r}function qj(e,t){const n={},r=Wj(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 Gj=["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 Om(e){return typeof e!="string"||e.includes("-")?!1:!!(Gj.indexOf(e)>-1||/[A-Z]/u.test(e))}const Qj={offset:"stroke-dashoffset",array:"stroke-dasharray"},Yj={offset:"strokeDashoffset",array:"strokeDasharray"};function Kj(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?Qj:Yj;e[s.offset]=J.transform(-r);const o=J.transform(t),a=J.transform(n);e[s.array]=`${o} ${a}`}function py(e,t,n){return typeof e=="string"?e:J.transform(t+n*e)}function Xj(e,t,n){const r=py(t,e.x,e.width),i=py(n,e.y,e.height);return`${r} ${i}`}function Dm(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...c},d,u){if(Rm(e,c,u),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:p,dimensions:h}=e;f.transform&&(h&&(p.transform=f.transform),delete f.transform),h&&(i!==void 0||s!==void 0||p.transform)&&(p.transformOrigin=Xj(h,i!==void 0?i:.5,s!==void 0?s:.5)),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),o!==void 0&&Kj(f,o,a,l,!1)}const Zb=()=>({...Am(),attrs:{}}),Fm=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Zj(e,t,n,r){const i=v.useMemo(()=>{const s=Zb();return Dm(s,t,Fm(r),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};Xb(s,e.style,e),i.style={...s,...i.style}}return i}function Jj(e=!1){return(n,r,i,{latestValues:s},o)=>{const l=(Om(n)?Zj:qj)(r,s,o,n),c=bj(r,typeof n=="string",e),d=n!==v.Fragment?{...c,...l,ref:i}:{},{children:u}=r,f=v.useMemo(()=>ht(u)?u.get():u,[u]);return v.createElement(n,{...d,children:f})}}function hy(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Mm(e,t,n,r){if(typeof t=="function"){const[i,s]=hy(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]=hy(r);t=t(n!==void 0?n:e.custom,i,s)}return t}const xp=e=>Array.isArray(e),eR=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),tR=e=>xp(e)?e[e.length-1]||0:e;function nu(e){const t=ht(e)?e.get():e;return eR(t)?t.toValue():t}function nR({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,i,s){const o={latestValues:rR(r,i,s,e),renderState:t()};return n&&(o.onMount=a=>n({props:r,current:a,...o}),o.onUpdate=a=>n(a)),o}const Jb=e=>(t,n)=>{const r=v.useContext(Sc),i=v.useContext(bc),s=()=>nR(e,t,r,i);return n?s():wc(s)};function rR(e,t,n,r){const i={},s=r(e,{});for(const f in s)i[f]=nu(s[f]);let{initial:o,animate:a}=e;const l=Cc(e),c=Hb(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"&&!kc(u)){const f=Array.isArray(u)?u:[u];for(let p=0;p<f.length;p++){const h=Mm(e,f[p]);if(h){const{transitionEnd:m,transition:x,...g}=h;for(const w in g){let b=g[w];if(Array.isArray(b)){const k=d?b.length-1:0;b=b[k]}b!==null&&(i[w]=b)}for(const w in m)i[w]=m[w]}}}return i}function Nm(e,t,n){var s;const{style:r}=e,i={};for(const o in r)(ht(r[o])||t.style&&ht(t.style[o])||Yb(o,e)||((s=n==null?void 0:n.getValue(o))==null?void 0:s.liveStyle)!==void 0)&&(i[o]=r[o]);return i}const iR={useVisualState:Jb({scrapeMotionValuesFromProps:Nm,createRenderState:Am})};function eS(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 tS(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 nS=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 rS(e,t,n,r){tS(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(nS.has(i)?i:Em(i),t.attrs[i])}function iS(e,t,n){const r=Nm(e,t,n);for(const i in e)if(ht(e[i])||ht(t[i])){const s=ko.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=e[i]}return r}const my=["x","y","width","height","cx","cy","r"],sR={useVisualState:Jb({scrapeMotionValuesFromProps:iS,createRenderState:Zb,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(is.has(a)){s=!0;break}}if(!s)return;let o=!t;if(t)for(let a=0;a<my.length;a++){const l=my[a];e[l]!==t[l]&&(o=!0)}o&&Se.read(()=>{eS(n,r),Se.render(()=>{Dm(r,i,Fm(n.tagName),e.transformTemplate),rS(n,r)})})}})};function oR(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...Om(r)?sR:iR,preloadedFeatures:e,useRender:Jj(i),createVisualElement:t,Component:r};return Rj(o)}}function Ma(e,t,n){const r=e.getProps();return Mm(r,t,n!==void 0?n:r.custom,e)}const sS=new Set(["width","height","top","left","right","bottom",...ko]);function aR(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Aa(n))}function lR(e,t){const n=Ma(e,t);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const o in s){const a=tR(s[o]);aR(e,o,a)}}function uR(e){return!!(ht(e)&&e.add)}function wp(e,t){const n=e.getValue("willChange");if(uR(n))return n.add(t);if(!n&&vp.WillChange){const r=new vp.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function oS(e){return e.props[Wb]}const aS=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,cR=1e-7,dR=12;function fR(e,t,n,r,i){let s,o,a=0;do o=t+(n-t)/2,s=aS(o,r,i)-e,s>0?n=o:t=o;while(Math.abs(s)>cR&&++a<dR);return o}function tl(e,t,n,r){if(e===t&&n===r)return ln;const i=s=>fR(s,0,1,e,n);return s=>s===0||s===1?s:aS(i(s),t,r)}const lS=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,uS=e=>t=>1-e(1-t),cS=tl(.33,1.53,.69,.99),Lm=uS(cS),dS=lS(Lm),fS=e=>(e*=2)<1?.5*Lm(e):.5*(2-Math.pow(2,-10*(e-1))),Im=e=>1-Math.sin(Math.acos(e)),pS=uS(Im),hS=lS(Im),mS=e=>/^0[^.\s]+$/u.test(e);function pR(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||mS(e):!0}const ra=e=>Math.round(e*1e5)/1e5,$m=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function hR(e){return e==null}const mR=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Bm=(e,t)=>n=>!!(typeof n=="string"&&mR.test(n)&&n.startsWith(e)||t&&!hR(n)&&Object.prototype.hasOwnProperty.call(n,t)),gS=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,s,o,a]=r.match($m);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},gR=e=>hr(0,255,e),Rd={...Co,transform:e=>Math.round(gR(e))},Pi={test:Bm("rgb","red"),parse:gS("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Rd.transform(e)+", "+Rd.transform(t)+", "+Rd.transform(n)+", "+ra(Fa.transform(r))+")"};function vR(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const bp={test:Bm("#"),parse:vR,transform:Pi.transform},Os={test:Bm("hsl","hue"),parse:gS("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+qn.transform(ra(t))+", "+qn.transform(ra(n))+", "+ra(Fa.transform(r))+")"},ft={test:e=>Pi.test(e)||bp.test(e)||Os.test(e),parse:e=>Pi.test(e)?Pi.parse(e):Os.test(e)?Os.parse(e):bp.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Pi.transform(e):Os.transform(e)},yR=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function xR(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match($m))==null?void 0:t.length)||0)+(((n=e.match(yR))==null?void 0:n.length)||0)>0}const vS="number",yS="color",wR="var",bR="var(",gy="${}",SR=/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 Na(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const a=t.replace(SR,l=>(ft.test(l)?(r.color.push(s),i.push(yS),n.push(ft.parse(l))):l.startsWith(bR)?(r.var.push(s),i.push(wR),n.push(l)):(r.number.push(s),i.push(vS),n.push(parseFloat(l))),++s,gy)).split(gy);return{values:n,split:a,indexes:r,types:i}}function xS(e){return Na(e).values}function wS(e){const{split:t,types:n}=Na(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===vS?s+=ra(i[o]):a===yS?s+=ft.transform(i[o]):s+=i[o]}return s}}const kR=e=>typeof e=="number"?0:e;function CR(e){const t=xS(e);return wS(e)(t.map(kR))}const ii={test:xR,parse:xS,createTransformer:wS,getAnimatableNone:CR},TR=new Set(["brightness","contrast","saturate","opacity"]);function ER(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match($m)||[];if(!r)return e;const i=n.replace(r,"");let s=TR.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const _R=/\b([a-z-]*)\(.*?\)/gu,Sp={...ii,getAnimatableNone:e=>{const t=e.match(_R);return t?t.map(ER).join(" "):e}},PR={...jm,color:ft,backgroundColor:ft,outlineColor:ft,fill:ft,stroke:ft,borderColor:ft,borderTopColor:ft,borderRightColor:ft,borderBottomColor:ft,borderLeftColor:ft,filter:Sp,WebkitFilter:Sp},bS=e=>PR[e];function SS(e,t){let n=bS(e);return n!==Sp&&(n=ii),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const jR=new Set(["auto","none","0"]);function RR(e,t,n){let r=0,i;for(;r<e.length&&!i;){const s=e[r];typeof s=="string"&&!jR.has(s)&&Na(s).values.length&&(i=e[r]),r++}if(i&&n)for(const s of t)e[s]=SS(n,i)}const ji=e=>e*180/Math.PI,kp=e=>{const t=ji(Math.atan2(e[1],e[0]));return Cp(t)},AR={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:kp,rotateZ:kp,skewX:e=>ji(Math.atan(e[1])),skewY:e=>ji(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Cp=e=>(e=e%360,e<0&&(e+=360),e),vy=kp,yy=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),xy=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),OR={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:yy,scaleY:xy,scale:e=>(yy(e)+xy(e))/2,rotateX:e=>Cp(ji(Math.atan2(e[6],e[5]))),rotateY:e=>Cp(ji(Math.atan2(-e[2],e[0]))),rotateZ:vy,rotate:vy,skewX:e=>ji(Math.atan(e[4])),skewY:e=>ji(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function wy(e){return e.includes("scale")?1:0}function Tp(e,t){if(!e||e==="none")return wy(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=OR,i=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=AR,i=a}if(!i)return wy(t);const s=r[t],o=i[1].split(",").map(FR);return typeof s=="function"?s(o):o[s]}const DR=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Tp(n,t)};function FR(e){return parseFloat(e.trim())}const by=e=>e===Co||e===J,MR=new Set(["x","y","z"]),NR=ko.filter(e=>!MR.has(e));function LR(e){const t=[];return NR.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const po={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Tp(t,"x"),y:(e,{transform:t})=>Tp(t,"y")};po.translateX=po.x;po.translateY=po.y;const zi=new Set;let Ep=!1,_p=!1;function kS(){if(_p){const e=Array.from(zi).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=LR(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)})}_p=!1,Ep=!1,zi.forEach(e=>e.complete()),zi.clear()}function CS(){zi.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(_p=!0)})}function IR(){CS(),kS()}class zm{constructor(t,n,r,i,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(zi.add(this),Ep||(Ep=!0,Se.read(CS),Se.resolveKeyframes(kS))):(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),zi.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,zi.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const TS=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),$R=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function BR(e){const t=$R.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function ES(e,t,n=1){const[r,i]=BR(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const o=s.trim();return TS(o)?parseFloat(o):o}return Pm(i)?ES(i,t,n+1):i}const _S=e=>t=>t.test(e),zR={test:e=>e==="auto",parse:e=>e},PS=[Co,J,qn,kr,Ij,Lj,zR],Sy=e=>PS.find(_S(e));class jS extends zm{constructor(t,n,r,i,s){super(t,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),Pm(c))){const d=ES(c,n.current);d!==void 0&&(t[l]=d),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!sS.has(r)||t.length!==2)return;const[i,s]=t,o=Sy(i),a=Sy(s);if(o!==a)if(by(o)&&by(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++)pR(t[i])&&r.push(i);r.length&&RR(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=po[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]=po[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 ky=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ii.test(e)||e==="0")&&!e.startsWith("url("));function VR(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 UR(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=ky(i,t),a=ky(s,t);return!o||!a?!1:VR(e)||(n==="spring"||xm(n))&&r}const HR=e=>e!==null;function Tc(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(HR),s=t&&n!=="loop"&&t%2===1?0:i.length-1;return!s||r===void 0?i[s]:r}const WR=40;class RS{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=Wn.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>WR?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&IR(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Wn.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:s,delay:o,onComplete:a,onUpdate:l,isGenerator:c}=this.options;if(!c&&!UR(t,r,i,s))if(o)this.options.duration=0;else{l&&l(Tc(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 je=(e,t,n)=>e+(t-e)*n;function Ad(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 qR({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=Ad(l,a,e+1/3),s=Ad(l,a,e),o=Ad(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}function Uu(e,t){return n=>n>0?t:e}const Od=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},GR=[bp,Pi,Os],QR=e=>GR.find(t=>t.test(e));function Cy(e){const t=QR(e);if(!t)return!1;let n=t.parse(e);return t===Os&&(n=qR(n)),n}const Ty=(e,t)=>{const n=Cy(e),r=Cy(t);if(!n||!r)return Uu(e,t);const i={...n};return s=>(i.red=Od(n.red,r.red,s),i.green=Od(n.green,r.green,s),i.blue=Od(n.blue,r.blue,s),i.alpha=je(n.alpha,r.alpha,s),Pi.transform(i))},YR=(e,t)=>n=>t(e(n)),nl=(...e)=>e.reduce(YR),Pp=new Set(["none","hidden"]);function KR(e,t){return Pp.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function XR(e,t){return n=>je(e,t,n)}function Vm(e){return typeof e=="number"?XR:typeof e=="string"?Pm(e)?Uu:ft.test(e)?Ty:eA:Array.isArray(e)?AS:typeof e=="object"?ft.test(e)?Ty:ZR:Uu}function AS(e,t){const n=[...e],r=n.length,i=e.map((s,o)=>Vm(s)(s,t[o]));return s=>{for(let o=0;o<r;o++)n[o]=i[o](s);return n}}function ZR(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Vm(e[i])(e[i],t[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function JR(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 eA=(e,t)=>{const n=ii.createTransformer(t),r=Na(e),i=Na(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?Pp.has(e)&&!i.values.length||Pp.has(t)&&!r.values.length?KR(e,t):nl(AS(JR(r,i),i.values),n):Uu(e,t)};function OS(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?je(e,t,n):Vm(e)(e,t)}const tA=5;function DS(e,t,n){const r=Math.max(t-tA,0);return Fb(n-e(r),t-r)}const Fe={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},Dd=.001;function nA({duration:e=Fe.duration,bounce:t=Fe.bounce,velocity:n=Fe.velocity,mass:r=Fe.mass}){let i,s,o=1-t;o=hr(Fe.minDamping,Fe.maxDamping,o),e=hr(Fe.minDuration,Fe.maxDuration,Hn(e)),o<1?(i=c=>{const d=c*o,u=d*e,f=d-n,p=jp(c,o),h=Math.exp(-u);return Dd-f/p*h},s=c=>{const u=c*o*e,f=u*n+n,p=Math.pow(o,2)*Math.pow(c,2)*e,h=Math.exp(-u),m=jp(Math.pow(c,2),o);return(-i(c)+Dd>0?-1:1)*((f-p)*h)/m}):(i=c=>{const d=Math.exp(-c*e),u=(c-n)*e+1;return-Dd+d*u},s=c=>{const d=Math.exp(-c*e),u=(n-c)*(e*e);return d*u});const a=5/e,l=iA(i,s,a);if(e=Un(e),isNaN(l))return{stiffness:Fe.stiffness,damping:Fe.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const rA=12;function iA(e,t,n){let r=n;for(let i=1;i<rA;i++)r=r-e(r)/t(r);return r}function jp(e,t){return e*Math.sqrt(1-t*t)}const sA=["duration","bounce"],oA=["stiffness","damping","mass"];function Ey(e,t){return t.some(n=>e[n]!==void 0)}function aA(e){let t={velocity:Fe.velocity,stiffness:Fe.stiffness,damping:Fe.damping,mass:Fe.mass,isResolvedFromDuration:!1,...e};if(!Ey(e,oA)&&Ey(e,sA))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*hr(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Fe.mass,stiffness:i,damping:s}}else{const n=nA(e);t={...t,...n,mass:Fe.mass},t.isResolvedFromDuration=!0}return t}function Hu(e=Fe.visualDuration,t=Fe.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:f,isResolvedFromDuration:p}=aA({...n,velocity:-Hn(n.velocity||0)}),h=f||0,m=c/(2*Math.sqrt(l*d)),x=o-s,g=Hn(Math.sqrt(l/d)),w=Math.abs(x)<5;r||(r=w?Fe.restSpeed.granular:Fe.restSpeed.default),i||(i=w?Fe.restDelta.granular:Fe.restDelta.default);let b;if(m<1){const T=jp(g,m);b=E=>{const _=Math.exp(-m*g*E);return o-_*((h+m*g*x)/T*Math.sin(T*E)+x*Math.cos(T*E))}}else if(m===1)b=T=>o-Math.exp(-g*T)*(x+(h+g*x)*T);else{const T=g*Math.sqrt(m*m-1);b=E=>{const _=Math.exp(-m*g*E),P=Math.min(T*E,300);return o-_*((h+m*g*x)*Math.sinh(P)+T*x*Math.cosh(P))/T}}const k={calculatedDuration:p&&u||null,next:T=>{const E=b(T);if(p)a.done=T>=u;else{let _=0;m<1&&(_=T===0?Un(h):DS(b,T,E));const P=Math.abs(_)<=r,M=Math.abs(o-E)<=i;a.done=P&&M}return a.value=a.done?o:E,a},toString:()=>{const T=Math.min(bm(k),zu),E=Mb(_=>k.next(T*_).value,T,30);return T+"ms "+E},toTransition:()=>{}};return k}Hu.applyToOptions=e=>{const t=sj(e,100,Hu);return e.ease=Ra()?t.ease:"easeOut",e.duration=Un(t.duration),e.type="keyframes",e};function _y({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],f={done:!1,value:u},p=P=>a!==void 0&&P<a||l!==void 0&&P>l,h=P=>a===void 0?l:l===void 0||Math.abs(a-P)<Math.abs(l-P)?a:l;let m=n*t;const x=u+m,g=o===void 0?x:o(x);g!==x&&(m=g-u);const w=P=>-m*Math.exp(-P/r),b=P=>g+w(P),k=P=>{const M=w(P),N=b(P);f.done=Math.abs(M)<=c,f.value=f.done?g:N};let T,E;const _=P=>{p(f.value)&&(T=P,E=Hu({keyframes:[f.value,h(f.value)],velocity:DS(b,P,f.value),damping:i,stiffness:s,restDelta:c,restSpeed:d}))};return _(0),{calculatedDuration:null,next:P=>{let M=!1;return!E&&T===void 0&&(M=!0,k(P),_(P)),T!==void 0&&P>=T?E.next(P-T):(!M&&k(P),f)}}}const lA=tl(.42,0,1,1),uA=tl(0,0,.58,1),FS=tl(.42,0,.58,1),cA=e=>Array.isArray(e)&&typeof e[0]!="number",Py={linear:ln,easeIn:lA,easeInOut:FS,easeOut:uA,circIn:Im,circInOut:hS,circOut:pS,backIn:Lm,backInOut:dS,backOut:cS,anticipate:fS},jy=e=>{if(ym(e)){gp(e.length===4);const[t,n,r,i]=e;return tl(t,n,r,i)}else if(typeof e=="string")return gp(Py[e]!==void 0),Py[e];return e};function dA(e,t,n){const r=[],i=n||OS,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]||ln:t;a=nl(l,a)}r.push(a)}return r}function fA(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const s=e.length;if(gp(s===t.length),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=dA(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 f=ja(e[u],e[u+1],d);return a[u](f)};return n?d=>c(hr(e[0],e[s-1],d)):c}function pA(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=ja(0,t,r);e.push(je(n,1,i))}}function hA(e){const t=[0];return pA(t,e.length-1),t}function mA(e,t){return e.map(n=>n*t)}function gA(e,t){return e.map(()=>t||FS).splice(0,e.length-1)}function Wu({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=cA(r)?r.map(jy):jy(r),s={done:!1,value:t[0]},o=mA(n&&n.length===t.length?n:hA(t),e),a=fA(o,t,{ease:Array.isArray(i)?i:gA(t,i)});return{calculatedDuration:e,next:l=>(s.value=a(l),s.done=l>=e,s)}}const vA=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Se.update(t,!0),stop:()=>ri(t),now:()=>it.isProcessing?it.timestamp:Wn.now()}},yA={decay:_y,inertia:_y,tween:Wu,keyframes:Wu,spring:Hu},xA=e=>e/100;class Um extends RS{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:i,keyframes:s}=this.options,o=(i==null?void 0:i.KeyframeResolver)||zm,a=(l,c)=>this.onKeyframesResolved(l,c);this.resolver=new o(s,a,n,r,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=this.options,a=xm(n)?n:yA[n]||Wu;let l,c;a!==Wu&&typeof t[0]!="number"&&(l=nl(xA,OS(t[0],t[1])),t=[0,100]);const d=a({...this.options,keyframes:t});s==="mirror"&&(c=a({...this.options,keyframes:[...t].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=bm(d));const{calculatedDuration:u}=d,f=u+i,p=f*(r+1)-i;return{generator:d,mirroredGenerator:c,mapPercentToKeyframes:l,calculatedDuration:u,resolvedDuration:f,totalDuration:p}}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:P}=this.options;return{done:!0,value:P[P.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:f,repeat:p,repeatType:h,repeatDelay:m,onUpdate:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const g=this.currentTime-f*(this.speed>=0?1:-1),w=this.speed>=0?g<0:g>d;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let b=this.currentTime,k=s;if(p){const P=Math.min(this.currentTime,d)/u;let M=Math.floor(P),N=P%1;!N&&P>=1&&(N=1),N===1&&M--,M=Math.min(M,p+1),!!(M%2)&&(h==="reverse"?(N=1-N,m&&(N-=m/u)):h==="mirror"&&(k=o)),b=hr(0,1,N)*u}const T=w?{done:!1,value:l[0]}:k.next(b);a&&(T.value=a(T.value));let{done:E}=T;!w&&c!==null&&(E=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const _=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&E);return _&&i!==void 0&&(T.value=Tc(l,this.options,i)),x&&x(T.value),_&&this.finish(),T}get duration(){const{resolved:t}=this;return t?Hn(t.calculatedDuration):0}get time(){return Hn(this.currentTime)}set time(t){t=Un(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=Hn(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=vA,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 wA=new Set(["opacity","clipPath","filter","transform"]),bA=gm(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),qu=10,SA=2e4;function kA(e){return xm(e.type)||e.type==="spring"||!Lb(e.ease)}function CA(e,t){const n=new Um({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const i=[];let s=0;for(;!r.done&&s<SA;)r=n.sample(s),i.push(r.value),s+=qu;return{times:void 0,keyframes:i,duration:s-qu,ease:"linear"}}const MS={anticipate:fS,backInOut:dS,circInOut:hS};function TA(e){return e in MS}class Ry extends RS{constructor(t){super(t);const{name:n,motionValue:r,element:i,keyframes:s}=this.options;this.resolver=new jS(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"&&Ra()&&TA(s)&&(s=MS[s]),kA(this.options)){const{onComplete:u,onUpdate:f,motionValue:p,element:h,...m}=this.options,x=CA(t,m);t=x.keyframes,t.length===1&&(t[1]=t[0]),r=x.duration,i=x.times,s=x.ease,o="keyframes"}const d=ij(a.owner.current,l,t,{...this.options,duration:r,times:i,ease:s});return d.startTime=c??this.calcStartTime(),this.pendingTimeline?(iy(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:u}=this.options;a.set(Tc(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 Hn(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Hn(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=Un(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 ln;const{animation:r}=n;iy(r,t)}return ln}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:f,...p}=this.options,h=new Um({...p,keyframes:r,duration:i,type:s,ease:o,times:a,isGenerator:!0}),m=Un(this.time);c.setWithVelocity(h.sample(m-qu).value,h.sample(m).value,qu)}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 bA()&&r&&wA.has(r)&&(r!=="transform"||!c)&&!l&&!i&&s!=="mirror"&&o!==0&&a!=="inertia"}}const EA={type:"spring",stiffness:500,damping:25,restSpeed:10},_A=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),PA={type:"keyframes",duration:.8},jA={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},RA=(e,{keyframes:t})=>t.length>2?PA:is.has(e)?e.startsWith("scale")?_A(t[1]):EA:jA;function AA({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:l,elapsed:c,...d}){return!!Object.keys(d).length}const Hm=(e,t,n,r={},i,s)=>o=>{const a=wm(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-Un(l);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:f=>{t.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:i};AA(a)||(d={...d,...RA(e,d)}),d.duration&&(d.duration=Un(d.duration)),d.repeatDelay&&(d.repeatDelay=Un(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 f=Tc(d.keyframes,a);if(f!==void 0)return Se.update(()=>{d.onUpdate(f),d.onComplete()}),new tj([])}return!s&&Ry.supports(d)?new Ry(d):new Um(d)};function OA({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function NS(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),f=a[d];if(f===void 0||c&&OA(c,d))continue;const p={delay:n,...wm(s||{},d)};let h=!1;if(window.MotionHandoffAnimation){const x=oS(e);if(x){const g=window.MotionHandoffAnimation(x,d,Se);g!==null&&(p.startTime=g,h=!0)}}wp(e,d),u.start(Hm(d,u,f,e.shouldReduceMotion&&sS.has(d)?{type:!1}:p,e,h));const m=u.animation;m&&l.push(m)}return o&&Promise.all(l).then(()=>{Se.update(()=>{o&&lR(e,o)})}),l}function Rp(e,t,n={}){var l;const r=Ma(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(NS(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:d=0,staggerChildren:u,staggerDirection:f}=i;return DA(e,t,d+c,u,f,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 DA(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(FA).forEach((c,d)=>{c.notify("AnimationStart",t),o.push(Rp(c,t,{...s,delay:n+l(d)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(o)}function FA(e,t){return e.sortNodePosition(t)}function MA(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>Rp(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=Rp(e,t,n);else{const i=typeof t=="function"?Ma(e,t,n.custom):t;r=Promise.all(NS(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function LS(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 NA=Tm.length;function IS(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?IS(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<NA;n++){const r=Tm[n],i=e.props[r];(Oa(i)||i===!1)&&(t[r]=i)}return t}const LA=[...Cm].reverse(),IA=Cm.length;function $A(e){return t=>Promise.all(t.map(({animation:n,options:r})=>MA(e,n,r)))}function BA(e){let t=$A(e),n=Ay(),r=!0;const i=l=>(c,d)=>{var f;const u=Ma(e,d,l==="exit"?(f=e.presenceContext)==null?void 0:f.custom:void 0);if(u){const{transition:p,transitionEnd:h,...m}=u;c={...c,...m,...h}}return c};function s(l){t=l(e)}function o(l){const{props:c}=e,d=IS(e.parent)||{},u=[],f=new Set;let p={},h=1/0;for(let x=0;x<IA;x++){const g=LA[x],w=n[g],b=c[g]!==void 0?c[g]:d[g],k=Oa(b),T=g===l?w.isActive:null;T===!1&&(h=x);let E=b===d[g]&&b!==c[g]&&k;if(E&&r&&e.manuallyAnimateOnMount&&(E=!1),w.protectedKeys={...p},!w.isActive&&T===null||!b&&!w.prevProp||kc(b)||typeof b=="boolean")continue;const _=zA(w.prevProp,b);let P=_||g===l&&w.isActive&&!E&&k||x>h&&k,M=!1;const N=Array.isArray(b)?b:[b];let R=N.reduce(i(g),{});T===!1&&(R={});const{prevResolvedValues:F={}}=w,B={...F,...R},V=ne=>{P=!0,f.has(ne)&&(M=!0,f.delete(ne)),w.needsAnimating[ne]=!0;const O=e.getValue(ne);O&&(O.liveStyle=!1)};for(const ne in B){const O=R[ne],$=F[ne];if(p.hasOwnProperty(ne))continue;let H=!1;xp(O)&&xp($)?H=!LS(O,$):H=O!==$,H?O!=null?V(ne):f.add(ne):O!==void 0&&f.has(ne)?V(ne):w.protectedKeys[ne]=!0}w.prevProp=b,w.prevResolvedValues=R,w.isActive&&(p={...p,...R}),r&&e.blockInitialAnimation&&(P=!1),P&&(!(E&&_)||M)&&u.push(...N.map(ne=>({animation:ne,options:{type:g}})))}if(f.size){const x={};if(typeof c.initial!="boolean"){const g=Ma(e,Array.isArray(c.initial)?c.initial[0]:c.initial);g&&g.transition&&(x.transition=g.transition)}f.forEach(g=>{const w=e.getBaseTarget(g),b=e.getValue(g);b&&(b.liveStyle=!0),x[g]=w??null}),u.push({animation:x})}let m=!!u.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(m=!1),r=!1,m?t(u):Promise.resolve()}function a(l,c){var u;if(n[l].isActive===c)return Promise.resolve();(u=e.variantChildren)==null||u.forEach(f=>{var p;return(p=f.animationState)==null?void 0:p.setActive(l,c)}),n[l].isActive=c;const d=o(l);for(const f in n)n[f].protectedKeys={};return d}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=Ay(),r=!0}}}function zA(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!LS(t,e):!1}function gi(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ay(){return{animate:gi(!0),whileInView:gi(),whileHover:gi(),whileTap:gi(),whileDrag:gi(),whileFocus:gi(),exit:gi()}}class ui{constructor(t){this.isMounted=!1,this.node=t}update(){}}class VA extends ui{constructor(t){super(t),t.animationState||(t.animationState=BA(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();kc(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 UA=0;class HA extends ui{constructor(){super(...arguments),this.id=UA++}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 WA={animation:{Feature:VA},exit:{Feature:HA}};function La(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function rl(e){return{point:{x:e.pageX,y:e.pageY}}}const qA=e=>t=>km(t)&&e(t,rl(t));function ia(e,t,n,r){return La(e,t,qA(n),r)}function $S({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function GA({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function QA(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 BS=1e-4,YA=1-BS,KA=1+BS,zS=.01,XA=0-zS,ZA=0+zS;function xt(e){return e.max-e.min}function JA(e,t,n){return Math.abs(e-t)<=n}function Oy(e,t,n,r=.5){e.origin=r,e.originPoint=je(t.min,t.max,e.origin),e.scale=xt(n)/xt(t),e.translate=je(n.min,n.max,e.origin)-e.originPoint,(e.scale>=YA&&e.scale<=KA||isNaN(e.scale))&&(e.scale=1),(e.translate>=XA&&e.translate<=ZA||isNaN(e.translate))&&(e.translate=0)}function sa(e,t,n,r){Oy(e.x,t.x,n.x,r?r.originX:void 0),Oy(e.y,t.y,n.y,r?r.originY:void 0)}function Dy(e,t,n){e.min=n.min+t.min,e.max=e.min+xt(t)}function eO(e,t,n){Dy(e.x,t.x,n.x),Dy(e.y,t.y,n.y)}function Fy(e,t,n){e.min=t.min-n.min,e.max=e.min+xt(t)}function oa(e,t,n){Fy(e.x,t.x,n.x),Fy(e.y,t.y,n.y)}const My=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ds=()=>({x:My(),y:My()}),Ny=()=>({min:0,max:0}),Ie=()=>({x:Ny(),y:Ny()});function Zt(e){return[e("x"),e("y")]}function Fd(e){return e===void 0||e===1}function Ap({scale:e,scaleX:t,scaleY:n}){return!Fd(e)||!Fd(t)||!Fd(n)}function wi(e){return Ap(e)||VS(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function VS(e){return Ly(e.x)||Ly(e.y)}function Ly(e){return e&&e!=="0%"}function Gu(e,t,n){const r=e-n,i=t*r;return n+i}function Iy(e,t,n,r,i){return i!==void 0&&(e=Gu(e,i,r)),Gu(e,n,r)+t}function Op(e,t=0,n=1,r,i){e.min=Iy(e.min,t,n,r,i),e.max=Iy(e.max,t,n,r,i)}function US(e,{x:t,y:n}){Op(e.x,t.translate,t.scale,t.originPoint),Op(e.y,n.translate,n.scale,n.originPoint)}const $y=.999999999999,By=1.0000000000001;function tO(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&&Ms(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,US(e,o)),r&&wi(s.latestValues)&&Ms(e,s.latestValues))}t.x<By&&t.x>$y&&(t.x=1),t.y<By&&t.y>$y&&(t.y=1)}function Fs(e,t){e.min=e.min+t,e.max=e.max+t}function zy(e,t,n,r,i=.5){const s=je(e.min,e.max,i);Op(e,t,n,s,r)}function Ms(e,t){zy(e.x,t.x,t.scaleX,t.scale,t.originX),zy(e.y,t.y,t.scaleY,t.scale,t.originY)}function HS(e,t){return $S(QA(e.getBoundingClientRect(),t))}function nO(e,t,n){const r=HS(e,n),{scroll:i}=t;return i&&(Fs(r.x,i.offset.x),Fs(r.y,i.offset.y)),r}const WS=({current:e})=>e?e.ownerDocument.defaultView:null,Vy=(e,t)=>Math.abs(e-t);function rO(e,t){const n=Vy(e.x,t.x),r=Vy(e.y,t.y);return Math.sqrt(n**2+r**2)}class qS{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=Nd(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,p=rO(u.offset,{x:0,y:0})>=3;if(!f&&!p)return;const{point:h}=u,{timestamp:m}=it;this.history.push({...h,timestamp:m});const{onStart:x,onMove:g}=this.handlers;f||(x&&x(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,u)},this.handlePointerMove=(u,f)=>{this.lastMoveEvent=u,this.lastMoveEventInfo=Md(f,this.transformPagePoint),Se.update(this.updatePoint,!0)},this.handlePointerUp=(u,f)=>{this.end();const{onEnd:p,onSessionEnd:h,resumeAnimation:m}=this.handlers;if(this.dragSnapToOrigin&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=Nd(u.type==="pointercancel"?this.lastMoveEventInfo:Md(f,this.transformPagePoint),this.history);this.startEvent&&p&&p(u,x),h&&h(u,x)},!km(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const o=rl(t),a=Md(o,this.transformPagePoint),{point:l}=a,{timestamp:c}=it;this.history=[{...l,timestamp:c}];const{onSessionStart:d}=n;d&&d(t,Nd(a,this.history)),this.removeListeners=nl(ia(this.contextWindow,"pointermove",this.handlePointerMove),ia(this.contextWindow,"pointerup",this.handlePointerUp),ia(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),ri(this.updatePoint)}}function Md(e,t){return t?{point:t(e.point)}:e}function Uy(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Nd({point:e},t){return{point:e,delta:Uy(e,GS(t)),offset:Uy(e,iO(t)),velocity:sO(t,.1)}}function iO(e){return e[0]}function GS(e){return e[e.length-1]}function sO(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=GS(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Un(t)));)n--;if(!r)return{x:0,y:0};const s=Hn(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 oO(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?je(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?je(n,e,r.max):Math.min(e,n)),e}function Hy(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 aO(e,{top:t,left:n,bottom:r,right:i}){return{x:Hy(e.x,n,i),y:Hy(e.y,t,r)}}function Wy(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 lO(e,t){return{x:Wy(e.x,t.x),y:Wy(e.y,t.y)}}function uO(e,t){let n=.5;const r=xt(e),i=xt(t);return i>r?n=ja(t.min,t.max-r,e.min):r>i&&(n=ja(e.min,e.max-i,t.min)),hr(0,1,n)}function cO(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 Dp=.35;function dO(e=Dp){return e===!1?e=0:e===!0&&(e=Dp),{x:qy(e,"left","right"),y:qy(e,"top","bottom")}}function qy(e,t,n){return{min:Gy(e,t),max:Gy(e,n)}}function Gy(e,t){return typeof e=="number"?e:e[t]||0}const fO=new WeakMap;class pO{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=Ie(),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(rl(d).point)},s=(d,u)=>{const{drag:f,dragPropagation:p,onDragStart:h}=this.getProps();if(f&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=uj(f),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Zt(x=>{let g=this.getAxisMotionValue(x).get()||0;if(qn.test(g)){const{projection:w}=this.visualElement;if(w&&w.layout){const b=w.layout.layoutBox[x];b&&(g=xt(b)*(parseFloat(g)/100))}}this.originPoint[x]=g}),h&&Se.postRender(()=>h(d,u)),wp(this.visualElement,"transform");const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},o=(d,u)=>{const{dragPropagation:f,dragDirectionLock:p,onDirectionLock:h,onDrag:m}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:x}=u;if(p&&this.currentDirection===null){this.currentDirection=hO(x),this.currentDirection!==null&&h&&h(this.currentDirection);return}this.updateAxis("x",u.point,x),this.updateAxis("y",u.point,x),this.visualElement.render(),m&&m(d,u)},a=(d,u)=>this.stop(d,u),l=()=>Zt(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 qS(t,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:WS(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&&Se.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||!Dl(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=oO(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&&As(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=aO(r.layoutBox,t):this.constraints=!1,this.elastic=dO(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Zt(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=cO(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!As(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=nO(r,i.root,this.visualElement.getTransformPagePoint());let o=lO(i.layout.layoutBox,s);if(n){const a=n(GA(o));this.hasMutatedConstraints=!!a,a&&(o=$S(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=Zt(d=>{if(!Dl(d,n,this.currentDirection))return;let u=l&&l[d]||{};o&&(u={min:0,max:0});const f=i?200:1e6,p=i?40:1e7,h={type:"inertia",velocity:r?t[d]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...s,...u};return this.startAxisValueAnimation(d,h)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return wp(this.visualElement,t),r.start(Hm(t,r,0,n,this.visualElement,!1))}stopAnimation(){Zt(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Zt(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){Zt(n=>{const{drag:r}=this.getProps();if(!Dl(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]-je(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!As(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Zt(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=uO({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(),Zt(o=>{if(!Dl(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(je(l,c,i[o]))})}addListeners(){if(!this.visualElement.current)return;fO.set(this.visualElement,this);const t=this.visualElement.current,n=ia(t,"pointerdown",l=>{const{drag:c,dragListener:d=!0}=this.getProps();c&&d&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();As(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()),Se.read(r);const o=La(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(Zt(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=Dp,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function Dl(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function hO(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class mO extends ui{constructor(t){super(t),this.removeGroupControls=ln,this.removeListeners=ln,this.controls=new pO(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ln}unmount(){this.removeGroupControls(),this.removeListeners()}}const Qy=e=>(t,n)=>{e&&Se.postRender(()=>e(t,n))};class gO extends ui{constructor(){super(...arguments),this.removePointerDownListener=ln}onPointerDown(t){this.session=new qS(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:WS(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:Qy(t),onStart:Qy(n),onMove:r,onEnd:(s,o)=>{delete this.session,i&&Se.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=ia(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 ru={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Yy(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Lo={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(J.test(e))e=parseFloat(e);else return e;const n=Yy(e,t.target.x),r=Yy(e,t.target.y);return`${n}% ${r}%`}},vO={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=ii.parse(e);if(i.length>5)return r;const s=ii.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=je(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 yO extends v.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=t;Nj(xO),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()})),ru.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()||Se.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Sm.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 QS(e){const[t,n]=Db(),r=v.useContext(dm);return y.jsx(yO,{...e,layoutGroup:r,switchLayoutGroup:v.useContext(qb),isPresent:t,safeToRemove:n})}const xO={borderRadius:{...Lo,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Lo,borderTopRightRadius:Lo,borderBottomLeftRadius:Lo,borderBottomRightRadius:Lo,boxShadow:vO};function wO(e,t,n){const r=ht(e)?e:Aa(e);return r.start(Hm("",r,t,n)),r.animation}function bO(e){return e instanceof SVGElement&&e.tagName!=="svg"}const SO=(e,t)=>e.depth-t.depth;class kO{constructor(){this.children=[],this.isDirty=!1}add(t){hm(this.children,t),this.isDirty=!0}remove(t){mm(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(SO),this.isDirty=!1,this.children.forEach(t)}}function CO(e,t){const n=Wn.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(ri(r),e(s-t))};return Se.read(r,!0),()=>ri(r)}const YS=["TopLeft","TopRight","BottomLeft","BottomRight"],TO=YS.length,Ky=e=>typeof e=="string"?parseFloat(e):e,Xy=e=>typeof e=="number"||J.test(e);function EO(e,t,n,r,i,s){i?(e.opacity=je(0,n.opacity??1,_O(r)),e.opacityExit=je(t.opacity??1,0,PO(r))):s&&(e.opacity=je(t.opacity??1,n.opacity??1,r));for(let o=0;o<TO;o++){const a=`border${YS[o]}Radius`;let l=Zy(t,a),c=Zy(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Xy(l)===Xy(c)?(e[a]=Math.max(je(Ky(l),Ky(c),r),0),(qn.test(c)||qn.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=je(t.rotate||0,n.rotate||0,r))}function Zy(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const _O=KS(0,.5,pS),PO=KS(.5,.95,ln);function KS(e,t,n){return r=>r<e?0:r>t?1:n(ja(e,t,r))}function Jy(e,t){e.min=t.min,e.max=t.max}function Kt(e,t){Jy(e.x,t.x),Jy(e.y,t.y)}function e0(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function t0(e,t,n,r,i){return e-=t,e=Gu(e,1/n,r),i!==void 0&&(e=Gu(e,1/i,r)),e}function jO(e,t=0,n=1,r=.5,i,s=e,o=e){if(qn.test(t)&&(t=parseFloat(t),t=je(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=je(s.min,s.max,r);e===s&&(a-=t),e.min=t0(e.min,t,n,a,i),e.max=t0(e.max,t,n,a,i)}function n0(e,t,[n,r,i],s,o){jO(e,t[n],t[r],t[i],t.scale,s,o)}const RO=["x","scaleX","originX"],AO=["y","scaleY","originY"];function r0(e,t,n,r){n0(e.x,t,RO,n?n.x:void 0,r?r.x:void 0),n0(e.y,t,AO,n?n.y:void 0,r?r.y:void 0)}function i0(e){return e.translate===0&&e.scale===1}function XS(e){return i0(e.x)&&i0(e.y)}function s0(e,t){return e.min===t.min&&e.max===t.max}function OO(e,t){return s0(e.x,t.x)&&s0(e.y,t.y)}function o0(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function ZS(e,t){return o0(e.x,t.x)&&o0(e.y,t.y)}function a0(e){return xt(e.x)/xt(e.y)}function l0(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class DO{constructor(){this.members=[]}add(t){hm(this.members,t),t.scheduleRender()}remove(t){if(mm(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function FO(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:f,skewX:p,skewY:h}=n;c&&(r=`perspective(${c}px) ${r}`),d&&(r+=`rotate(${d}deg) `),u&&(r+=`rotateX(${u}deg) `),f&&(r+=`rotateY(${f}deg) `),p&&(r+=`skewX(${p}deg) `),h&&(r+=`skewY(${h}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const Ld=["","X","Y","Z"],MO={visibility:"hidden"},u0=1e3;let NO=0;function Id(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function JS(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=oS(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Se,!(i||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&JS(r)}function ek({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},a=t==null?void 0:t()){this.id=NO++,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($O),this.nodes.forEach(HO),this.nodes.forEach(WO),this.nodes.forEach(BO)},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 kO)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new vm),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=bO(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 f=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,u&&u(),u=CO(f,250),ru.hasAnimatedSinceResize&&(ru.hasAnimatedSinceResize=!1,this.nodes.forEach(d0))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||c)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:f,hasRelativeLayoutChanged:p,layout:h})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||d.getDefaultTransition()||KO,{onLayoutAnimationStart:x,onLayoutAnimationComplete:g}=d.getProps(),w=!this.targetLayout||!ZS(this.targetLayout,h),b=!f&&p;if(this.options.layoutRoot||this.resumeFrom||b||f&&(w||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(u,b);const k={...wm(m,"layout"),onPlay:x,onComplete:g};(d.shouldReduceMotion||this.options.layoutRoot)&&(k.delay=0,k.type=!1),this.startAnimation(k)}else f||d0(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=h})}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,ri(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(qO),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&&JS(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(c0);return}this.isUpdating||this.nodes.forEach(VO),this.isUpdating=!1,this.nodes.forEach(UO),this.nodes.forEach(LO),this.nodes.forEach(IO),this.clearAllSnapshots();const a=Wn.now();it.delta=hr(0,1e3/60,a-it.timestamp),it.timestamp=a,it.isProcessing=!0,Pd.update.process(it),Pd.preRender.process(it),Pd.render.process(it),it.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Sm.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(zO),this.sharedNodes.forEach(GO)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Se.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Se.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!xt(this.snapshot.measuredBox.x)&&!xt(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=Ie(),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&&!XS(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,d=c!==this.prevTransformTemplateValue;o&&(a||wi(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)),XO(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:o}=this.options;if(!o)return Ie();const a=o.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(ZO))){const{scroll:d}=this.root;d&&(Fs(a.x,d.offset.x),Fs(a.y,d.offset.y))}return a}removeElementScroll(o){var l;const a=Ie();if(Kt(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:f}=d;d!==this.root&&u&&f.layoutScroll&&(u.wasRoot&&Kt(a,o),Fs(a.x,u.offset.x),Fs(a.y,u.offset.y))}return a}applyTransform(o,a=!1){const l=Ie();Kt(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&&Ms(l,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),wi(d.latestValues)&&Ms(l,d.latestValues)}return wi(this.latestValues)&&Ms(l,this.latestValues),l}removeTransform(o){const a=Ie();Kt(a,o);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!wi(c.latestValues))continue;Ap(c.latestValues)&&c.updateSnapshot();const d=Ie(),u=c.measurePageBox();Kt(d,u),r0(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,d)}return wi(this.latestValues)&&r0(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!==it.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var f;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||(f=this.parent)!=null&&f.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:u}=this.options;if(!(!this.layout||!(d||u))){if(this.resolvedRelativeTargetAt=it.timestamp,!this.targetDelta&&!this.relativeTarget){const p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ie(),this.relativeTargetOrigin=Ie(),oa(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),Kt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Ie(),this.targetWithTransforms=Ie()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),eO(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Kt(this.target,this.layout.layoutBox),US(this.target,this.targetDelta)):Kt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const p=this.getClosestProjectingParent();p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ie(),this.relativeTargetOrigin=Ie(),oa(this.relativeTargetOrigin,this.target,p.target),Kt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Ap(this.parent.latestValues)||VS(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 h;const o=this.getLead(),a=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||(h=this.parent)!=null&&h.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===it.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;Kt(this.layoutCorrected,this.layout.layoutBox);const u=this.treeScale.x,f=this.treeScale.y;tO(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=Ie());const{target:p}=o;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(e0(this.prevProjectionDelta.x,this.projectionDelta.x),e0(this.prevProjectionDelta.y,this.projectionDelta.y)),sa(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==u||this.treeScale.y!==f||!l0(this.projectionDelta.x,this.prevProjectionDelta.x)||!l0(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}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=Ds(),this.projectionDelta=Ds(),this.projectionDeltaWithTransform=Ds()}setAnimationOrigin(o,a=!1){const l=this.snapshot,c=l?l.latestValues:{},d={...this.latestValues},u=Ds();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=Ie(),p=l?l.source:void 0,h=this.layout?this.layout.source:void 0,m=p!==h,x=this.getStack(),g=!x||x.members.length<=1,w=!!(m&&!g&&this.options.crossfade===!0&&!this.path.some(YO));this.animationProgress=0;let b;this.mixTargetDelta=k=>{const T=k/1e3;f0(u.x,o.x,T),f0(u.y,o.y,T),this.setTargetDelta(u),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(oa(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),QO(this.relativeTarget,this.relativeTargetOrigin,f,T),b&&OO(this.relativeTarget,b)&&(this.isProjectionDirty=!1),b||(b=Ie()),Kt(b,this.relativeTarget)),m&&(this.animationValues=d,EO(d,c,this.latestValues,T,w,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&&(ri(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Se.update(()=>{ru.hasAnimatedSinceResize=!0,this.currentAnimation=wO(0,u0,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(u0),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:d}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&tk(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||Ie();const u=xt(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+u;const f=xt(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+f}Kt(a,l),Ms(a,d),sa(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new DO),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&&Id("z",o,c,this.animationValues);for(let d=0;d<Ld.length;d++)Id(`rotate${Ld[d]}`,o,c,this.animationValues),Id(`skew${Ld[d]}`,o,c,this.animationValues);o.render();for(const d in c)o.setStaticValue(d,c[d]),this.animationValues&&(this.animationValues[d]=c[d]);o.scheduleRender()}getProjectionStyles(o){if(!this.instance||this.isSVG)return;if(!this.isVisible)return MO;const a={visibility:""},l=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,a.opacity="",a.pointerEvents=nu(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 p={};return this.options.layoutId&&(p.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,p.pointerEvents=nu(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!wi(this.latestValues)&&(p.transform=l?l({},""):"none",this.hasProjected=!1),p}const d=c.animationValues||c.latestValues;this.applyTransformsToTarget(),a.transform=FO(this.projectionDeltaWithTransform,this.treeScale,d),l&&(a.transform=l(d,a.transform));const{x:u,y:f}=this.projectionDelta;a.transformOrigin=`${u.origin*100}% ${f.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 p in Da){if(d[p]===void 0)continue;const{correct:h,applyTo:m,isCSSVariable:x}=Da[p],g=a.transform==="none"?d[p]:h(d[p],c);if(m){const w=m.length;for(let b=0;b<w;b++)a[m[b]]=g}else x?this.options.visualElement.renderState.vars[p]=g:a[p]=g}return this.options.layoutId&&(a.pointerEvents=c===this?nu(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(c0),this.root.sharedNodes.clear()}}}function LO(e){e.updateLayout()}function IO(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"?Zt(u=>{const f=o?t.measuredBox[u]:t.layoutBox[u],p=xt(f);f.min=r[u].min,f.max=f.min+p}):tk(s,t.layoutBox,r)&&Zt(u=>{const f=o?t.measuredBox[u]:t.layoutBox[u],p=xt(r[u]);f.max=f.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+p)});const a=Ds();sa(a,r,t.layoutBox);const l=Ds();o?sa(l,e.applyTransform(i,!0),t.measuredBox):sa(l,r,t.layoutBox);const c=!XS(a);let d=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:f,layout:p}=u;if(f&&p){const h=Ie();oa(h,t.layoutBox,f.layoutBox);const m=Ie();oa(m,r,p.layoutBox),ZS(h,m)||(d=!0),u.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=h,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 $O(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 BO(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function zO(e){e.clearSnapshot()}function c0(e){e.clearMeasurements()}function VO(e){e.isLayoutDirty=!1}function UO(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function d0(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function HO(e){e.resolveTargetDelta()}function WO(e){e.calcProjection()}function qO(e){e.resetSkewAndRotation()}function GO(e){e.removeLeadSnapshot()}function f0(e,t,n){e.translate=je(t.translate,0,n),e.scale=je(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function p0(e,t,n,r){e.min=je(t.min,n.min,r),e.max=je(t.max,n.max,r)}function QO(e,t,n,r){p0(e.x,t.x,n.x,r),p0(e.y,t.y,n.y,r)}function YO(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const KO={duration:.45,ease:[.4,0,.1,1]},h0=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),m0=h0("applewebkit/")&&!h0("chrome/")?Math.round:ln;function g0(e){e.min=m0(e.min),e.max=m0(e.max)}function XO(e){g0(e.x),g0(e.y)}function tk(e,t,n){return e==="position"||e==="preserve-aspect"&&!JA(a0(t),a0(n),.2)}function ZO(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const JO=ek({attachResizeListener:(e,t)=>La(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),$d={current:void 0},nk=ek({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!$d.current){const e=new JO({});e.mount(window),e.setOptions({layoutScroll:!0}),$d.current=e}return $d.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),e3={pan:{Feature:gO},drag:{Feature:mO,ProjectionNode:nk,MeasureLayout:QS}};function v0(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&&Se.postRender(()=>s(t,rl(t)))}class t3 extends ui{mount(){const{current:t}=this.node;t&&(this.unmount=dj(t,(n,r)=>(v0(this.node,r,"Start"),i=>v0(this.node,i,"End"))))}unmount(){}}class n3 extends ui{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=nl(La(this.node.current,"focus",()=>this.onFocus()),La(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function y0(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&&Se.postRender(()=>s(t,rl(t)))}class r3 extends ui{mount(){const{current:t}=this.node;t&&(this.unmount=mj(t,(n,r)=>(y0(this.node,r,"Start"),(i,{success:s})=>y0(this.node,i,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Fp=new WeakMap,Bd=new WeakMap,i3=e=>{const t=Fp.get(e.target);t&&t(e)},s3=e=>{e.forEach(i3)};function o3({root:e,...t}){const n=e||document;Bd.has(n)||Bd.set(n,{});const r=Bd.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(s3,{root:e,...t})),r[i]}function a3(e,t,n){const r=o3(t);return Fp.set(e,n),r.observe(e),()=>{Fp.delete(e),r.unobserve(e)}}const l3={some:0,all:1};class u3 extends ui{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:l3[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(),f=c?d:u;f&&f(l)};return a3(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(c3(t,n))&&this.startObserver()}unmount(){}}function c3({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const d3={inView:{Feature:u3},tap:{Feature:r3},focus:{Feature:n3},hover:{Feature:t3}},f3={layout:{ProjectionNode:nk,MeasureLayout:QS}},Mp={current:null},rk={current:!1};function p3(){if(rk.current=!0,!!fm)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Mp.current=e.matches;e.addListener(t),t()}else Mp.current=!1}const h3=[...PS,ft,ii],m3=e=>h3.find(_S(e)),g3=new WeakMap;function v3(e,t,n){for(const r in t){const i=t[r],s=n[r];if(ht(i))e.addValue(r,i);else if(ht(s))e.addValue(r,Aa(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,Aa(o!==void 0?o:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const x0=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class y3{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=zm,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=Wn.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,Se.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=Cc(n),this.isVariantNode=Hb(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in f){const h=f[p];l[p]!==void 0&&ht(h)&&h.set(l[p],!1)}}mount(t){this.current=t,g3.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)),rk.current||p3(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Mp.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),ri(this.notifyUpdate),ri(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=is.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&Se.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 fo){const n=fo[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):Ie()}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<x0.length;r++){const i=x0[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=v3(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=Aa(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"&&(TS(r)||mS(r))?r=parseFloat(r):!m3(r)&&ii.test(n)&&(r=SS(t,n)),this.setBaseTarget(t,ht(r)?r.get():r)),ht(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=Mm(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&&!ht(i)?i:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new vm),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class ik extends y3{constructor(){super(...arguments),this.KeyframeResolver=jS}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;ht(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function x3(e){return window.getComputedStyle(e)}class w3 extends ik{constructor(){super(...arguments),this.type="html",this.renderInstance=tS}readValueFromInstance(t,n){if(is.has(n))return DR(t,n);{const r=x3(t),i=(_m(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return HS(t,n)}build(t,n,r){Rm(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Nm(t,n,r)}}class b3 extends ik{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ie,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&eS(this.current,this.renderState)}}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(is.has(n)){const r=bS(n);return r&&r.default||0}return n=nS.has(n)?n:Em(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return iS(t,n,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&Se.postRender(this.updateDimensions)}build(t,n,r){Dm(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){rS(t,n,r,i)}mount(t){this.isSVGTag=Fm(t.tagName),super.mount(t)}}const S3=(e,t)=>Om(e)?new b3(t):new w3(t,{allowProjection:e!==v.Fragment}),k3=oR({...WA,...d3,...e3,...f3},S3),ve=Sj(k3);class C3{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 T3=()=>new C3;function E3(){return wc(T3)}var Er=(e=>(e.None="none",e.Sm="sm",e.Md="md",e.Lg="lg",e.Xl="xl",e.Full="full",e))(Er||{});const sk=v.createContext({}),_3={[Y.TooltipDefault]:"Bizimle sohbet edin!",[Y.TooltipActive]:"Yeni mesajlar var!",[Y.CloseButtonAria]:"Kapat",[Y.MessagePlaceholder]:"Mesajınızı yazın",[Y.FileUploadDisabled]:"Dosya gönderim izniniz olmadığı için yükleyemezsiniz",[Y.NewMessagesNotification]:"Yeni mesajlar var!",[Y.ChatCloseConfirm]:"Sohbeti kapatmak istediğinizden emin misiniz?",[Y.ChatCloseWarning]:"Bu işlem geri alınamaz.",[Y.ChatSettings]:"Sohbet Ayarları",[Y.ChatEndConversation]:"Sohbeti Sonlandır",[Y.CancelAction]:"Vazgeç",[Y.CloseAction]:"Kapat",[Y.QuickActions]:"Hızlı işlemler",[Y.GreetingStartChat]:"Sohbete başla",[Y.RateLimitMessage]:"Çok fazla mesaj gönderdiniz. Lütfen {seconds} saniye bekleyin.",[Y.RatingHeaderEvaluate]:"Görüşmenizi Değerlendirin",[Y.RatingHeaderThanks]:"Teşekkürler!",[Y.RatingDescription]:"Lütfen hizmetimizi değerlendirin. Görüşleriniz bizim için önemli.",[Y.RatingRateConversation]:"Görüşmeyi puanlayın",[Y.RatingComment]:"Yorumunuz (İsteğe bağlı)",[Y.RatingCommentPlaceholder]:"Görüşme hakkında düşüncelerinizi paylaşın...",[Y.RatingSubmit]:"Değerlendirmeyi Gönder",[Y.RatingNewConversation]:"Yeni Görüşme Başlat",[Y.RatingThankYouTitle]:"Değerlendirmeniz için teşekkürler!",[Y.RatingThankYouDescription]:"Geri bildiriminiz bizim için çok değerli.",[Y.RatingCountdown]:"Ekran {seconds} saniye içinde kapanacaktır.",[Y.RatingMinimumError]:"Lütfen en az 1 yıldız seçiniz.",[Y.RatingYourScore]:"Puanınız: {score}",[Y.PoweredBy]:"Powered by"},P3={[C.Background]:"#ffffff",[C.Border]:"#e2e8f0",[C.TooltipText]:"#1e40af",[C.TooltipBackground]:"#dbeafe",[C.TooltipBorder]:"#3b82f6",[C.HeaderBackground]:"#2563eb",[C.HeaderBorder]:"#e2e8f0",[C.HeaderText]:"#ffffff",[C.FooterBackground]:"#f8fafc",[C.FooterBorder]:"#e2e8f0",[C.FooterText]:"#475569",[C.MessageAdminBackground]:"#f1f5f9",[C.MessageAdminText]:"#334155",[C.MessageVisitorBackground]:"#3b82f6",[C.MessageVisitorText]:"#ffffff",[C.GreeterBackground]:"#ffffff",[C.GreeterText]:"#334155",[C.GreeterBorder]:"#e2e8f0",[C.GreeterTopBackground]:"linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%)",[C.GreeterTopText]:"#ffffff",[C.GreeterButtonBackground]:"#4f46e5",[C.GreeterButtonText]:"#ffffff",[C.ButtonBackground]:"#4f46e5",[C.ButtonText]:"#ffffff",[C.InputBackground]:"#ffffff",[C.InputText]:"#1e293b",[C.InputBorder]:"#e2e8f0",[C.CloseButtonBackground]:"#f1f5f9",[C.CloseButtonText]:"#475569",[C.CloseButtonHover]:"#e2e8f0",[C.IconColor]:"#64748b",[C.IconBackground]:"transparent",[C.ErrorBackground]:"#fef2f2",[C.ErrorText]:"#dc2626",[C.ErrorBorder]:"#fca5a5",[C.SuccessBackground]:"#f0fdf4",[C.SuccessText]:"#16a34a",[C.SuccessBorder]:"#86efac",[C.WarningBackground]:"#fffbeb",[C.WarningText]:"#d97706",[C.WarningBorder]:"#fcd34d",[C.LinkColor]:"#2563eb",[C.LinkHoverColor]:"#1d4ed8",[C.DividerColor]:"#e2e8f0",[C.ShadowColor]:"rgba(0, 0, 0, 0.1)",[C.StarActiveColor]:"#3b82f6",[C.StarInactiveColor]:"#e2e8f0",[C.ModalOverlayColor]:"rgba(0, 0, 0, 0.4)",[C.ChatCloseConfirmText]:"#dc2626",[C.RatingHeaderBackground]:"#4F46E5",[C.RatingHeaderText]:"#ffffff",[C.RatingSuccessBackground]:"#ffffff",[C.RatingSuccessText]:"#334155",[C.RatingRateConversationText]:"#1e293b"},j3={[Er.None]:"0px",[Er.Sm]:"var(--radius-xs)",[Er.Md]:"var(--radius-sm)",[Er.Lg]:"var(--radius-md)",[Er.Xl]:"var(--radius-lg)",[Er.Full]:"calc(infinity * 1px)"},R3=e=>{const t={..._3};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},A3=e=>{const t={...P3};if(!e||!e.appearance||!e.appearance.design||!e.appearance.design.colors)return t;for(const n in e.appearance.design.colors){const r=n;e.appearance.design.colors[r]&&(t[r]=e.appearance.design.colors[r])}return t};function O3({children:e,widget:t}){const n=A3(t),r=R3(t),i=t&&t.appearance&&t.appearance.design&&t.appearance.design.border_radius?t.appearance.design.border_radius:Er.Md,s=l=>n[l],o=l=>r[l],a=()=>j3[i];return y.jsx(sk.Provider,{value:{colors:n,texts:r,getColor:s,getText:o,getRadius:a},children:e})}const Oe=()=>v.useContext(sk),il=()=>Oe().getText;function on({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=C.ButtonText,bgKey:d=C.ButtonBackground,animations:u={},withoutTheming:f,...p}){const h=Oe();return y.jsx(ve.button,{type:t,className:ge("flex items-center justify-center focus:!ring-0 font-medium",{"rounded-full":o&&i!=="xs","rounded-lg":!o},a,ty[n]&&ty[n][r],GP[i][o?"rounded":"default"]),disabled:s,style:{...!f&&{color:h.getColor(c),backgroundColor:h.getColor(d),...o?{}:{borderRadius:h.getRadius()}},...l},...u,...p,children:e})}function fe(){}fe.Home=function(t){return y.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",height:"1em",width:"1em",...t,children:y.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"})})};fe.Chat=e=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:y.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"})});fe.Menu=e=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"})});fe.MessageTyping=({className:e="size-5",...t})=>y.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:y.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"})});fe.Check=function(t){return y.jsx("svg",{fill:"currentColor",viewBox:"0 0 16 16",height:"1em",width:"1em",...t,children:y.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"})})};fe.Website=function(t){return y.jsxs("svg",{fill:"none",viewBox:"0 0 24 24",height:"1em",width:"1em",...t,children:[y.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"}),y.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"}),y.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"})]})};fe.ArrowDown=e=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 13.5 12 21m0 0-7.5-7.5M12 21V3"})});fe.XCircle=({className:e="e-5",...t})=>y.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:y.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"})});fe.X=({className:e="e-5",...t})=>y.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:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})});fe.PaperAirplane=({className:e="e-5",...t})=>y.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:y.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"})});fe.Spin=function(t){return y.jsx("svg",{"data-name":"Layer 1",viewBox:"0 0 24 24",fill:"currentColor",height:"1em",width:"1em",...t,children:y.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"})})};fe.ExternalLink=e=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:y.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"})});fe.Phone=e=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:y.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"})});fe.Mail=e=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:y.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"})});const Yn=Object.create(null);Yn.open="0";Yn.close="1";Yn.ping="2";Yn.pong="3";Yn.message="4";Yn.upgrade="5";Yn.noop="6";const iu=Object.create(null);Object.keys(Yn).forEach(e=>{iu[Yn[e]]=e});const Np={type:"error",data:"parser error"},ok=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",ak=typeof ArrayBuffer=="function",lk=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Wm=({type:e,data:t},n,r)=>ok&&t instanceof Blob?n?r(t):w0(t,r):ak&&(t instanceof ArrayBuffer||lk(t))?n?r(t):w0(new Blob([t]),r):r(Yn[e]+(t||"")),w0=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function b0(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let zd;function D3(e,t){if(ok&&e.data instanceof Blob)return e.data.arrayBuffer().then(b0).then(t);if(ak&&(e.data instanceof ArrayBuffer||lk(e.data)))return t(b0(e.data));Wm(e,!1,n=>{zd||(zd=new TextEncoder),t(zd.encode(n))})}const S0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Go=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<S0.length;e++)Go[S0.charCodeAt(e)]=e;const F3=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=Go[e.charCodeAt(r)],o=Go[e.charCodeAt(r+1)],a=Go[e.charCodeAt(r+2)],l=Go[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},M3=typeof ArrayBuffer=="function",qm=(e,t)=>{if(typeof e!="string")return{type:"message",data:uk(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:N3(e.substring(1),t)}:iu[n]?e.length>1?{type:iu[n],data:e.substring(1)}:{type:iu[n]}:Np},N3=(e,t)=>{if(M3){const n=F3(e);return uk(n,t)}else return{base64:!0,data:e}},uk=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},ck="",L3=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((s,o)=>{Wm(s,!1,a=>{r[o]=a,++i===n&&t(r.join(ck))})})},I3=(e,t)=>{const n=e.split(ck),r=[];for(let i=0;i<n.length;i++){const s=qm(n[i],t);if(r.push(s),s.type==="error")break}return r};function $3(){return new TransformStream({transform(e,t){D3(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 Vd;function Fl(e){return e.reduce((t,n)=>t+n.length,0)}function Ml(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 B3(e,t){Vd||(Vd=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(Fl(n)<1)break;const l=Ml(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(Fl(n)<2)break;const l=Ml(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(Fl(n)<8)break;const l=Ml(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),d=c.getUint32(0);if(d>Math.pow(2,21)-1){a.enqueue(Np);break}i=d*Math.pow(2,32)+c.getUint32(4),r=3}else{if(Fl(n)<i)break;const l=Ml(n,i);a.enqueue(qm(s?l:Vd.decode(l),t)),r=0}if(i===0||i>e){a.enqueue(Np);break}}}})}const dk=4;function ze(e){if(e)return z3(e)}function z3(e){for(var t in ze.prototype)e[t]=ze.prototype[t];return e}ze.prototype.on=ze.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};ze.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};ze.prototype.off=ze.prototype.removeListener=ze.prototype.removeAllListeners=ze.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};ze.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};ze.prototype.emitReserved=ze.prototype.emit;ze.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};ze.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Ec=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),rn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),V3="arraybuffer";function fk(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const U3=rn.setTimeout,H3=rn.clearTimeout;function _c(e,t){t.useNativeTimers?(e.setTimeoutFn=U3.bind(rn),e.clearTimeoutFn=H3.bind(rn)):(e.setTimeoutFn=rn.setTimeout.bind(rn),e.clearTimeoutFn=rn.clearTimeout.bind(rn))}const W3=1.33;function q3(e){return typeof e=="string"?G3(e):Math.ceil((e.byteLength||e.size)*W3)}function G3(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 pk(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Q3(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function Y3(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 K3 extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Gm extends ze{constructor(t){super(),this.writable=!1,_c(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 K3(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=qm(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=Q3(t);return n.length?"?"+n:""}}class X3 extends Gm{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)};I3(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,L3(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]=pk()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let hk=!1;try{hk=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Z3=hk;function J3(){}class eD extends X3{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 Gn extends ze{constructor(t,n,r){super(),this.createRequest=t,_c(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=fk(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=Gn.requestsCount++,Gn.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=J3,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Gn.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()}}Gn.requestsCount=0;Gn.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",k0);else if(typeof addEventListener=="function"){const e="onpagehide"in rn?"pagehide":"unload";addEventListener(e,k0,!1)}}function k0(){for(let e in Gn.requests)Gn.requests.hasOwnProperty(e)&&Gn.requests[e].abort()}const tD=function(){const e=mk({xdomain:!1});return e&&e.responseType!==null}();class nD extends eD{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=tD&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Gn(mk,this.uri(),t)}}function mk(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Z3))return new XMLHttpRequest}catch{}if(!t)try{return new rn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const gk=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class rD extends Gm{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=gk?{}:fk(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;Wm(r,this.supportsBinary,s=>{try{this.doWrite(r,s)}catch{}i&&Ec(()=>{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]=pk()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Ud=rn.WebSocket||rn.MozWebSocket;class iD extends rD{createSocket(t,n,r){return gk?new Ud(t,n,r):n?new Ud(t,n):new Ud(t)}doWrite(t,n){this.ws.send(n)}}class sD extends Gm{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=B3(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=$3();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&&Ec(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const oD={websocket:iD,webtransport:sD,polling:nD},aD=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,lD=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Lp(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=aD.exec(e||""),s={},o=14;for(;o--;)s[lD[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=uD(s,s.path),s.queryKey=cD(s,s.query),s}function uD(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 cD(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,s){i&&(n[i]=s)}),n}const Ip=typeof addEventListener=="function"&&typeof removeEventListener=="function",su=[];Ip&&addEventListener("offline",()=>{su.forEach(e=>e())},!1);class Zr extends ze{constructor(t,n){if(super(),this.binaryType=V3,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=Lp(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=Lp(n.host).host);_c(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=Y3(this.opts.query)),Ip&&(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"})},su.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&&Zr.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",Zr.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+=q3(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,Ec(()=>{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(Zr.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(),Ip&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=su.indexOf(this._offlineEventListener);r!==-1&&su.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Zr.protocol=dk;class dD extends Zr{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;Zr.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;Zr.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 f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function s(){r||(r=!0,d(),n.close(),n=null)}const o=u=>{const f=new Error("probe error: "+u);f.transport=n.name,s(),this.emitReserved("upgradeError",f)};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 fD=class extends dD{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=>oD[i]).filter(i=>!!i)),super(t,r)}};function pD(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=Lp(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 hD=typeof ArrayBuffer=="function",mD=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,vk=Object.prototype.toString,gD=typeof Blob=="function"||typeof Blob<"u"&&vk.call(Blob)==="[object BlobConstructor]",vD=typeof File=="function"||typeof File<"u"&&vk.call(File)==="[object FileConstructor]";function Qm(e){return hD&&(e instanceof ArrayBuffer||mD(e))||gD&&e instanceof Blob||vD&&e instanceof File}function ou(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(ou(e[n]))return!0;return!1}if(Qm(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return ou(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&ou(e[n]))return!0;return!1}function yD(e){const t=[],n=e.data,r=e;return r.data=$p(n,t),r.attachments=t.length,{packet:r,buffers:t}}function $p(e,t){if(!e)return e;if(Qm(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]=$p(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]=$p(e[r],t));return n}return e}function xD(e,t){return e.data=Bp(e.data,t),delete e.attachments,e}function Bp(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]=Bp(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Bp(e[n],t));return e}const wD=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],bD=5;var ue;(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"})(ue||(ue={}));class SD{constructor(t){this.replacer=t}encode(t){return(t.type===ue.EVENT||t.type===ue.ACK)&&ou(t)?this.encodeAsBinary({type:t.type===ue.EVENT?ue.BINARY_EVENT:ue.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===ue.BINARY_EVENT||t.type===ue.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=yD(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function C0(e){return Object.prototype.toString.call(e)==="[object Object]"}class Ym extends ze{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===ue.BINARY_EVENT;r||n.type===ue.BINARY_ACK?(n.type=r?ue.EVENT:ue.ACK,this.reconstructor=new kD(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Qm(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(ue[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===ue.BINARY_EVENT||r.type===ue.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(Ym.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 ue.CONNECT:return C0(n);case ue.DISCONNECT:return n===void 0;case ue.CONNECT_ERROR:return typeof n=="string"||C0(n);case ue.EVENT:case ue.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&wD.indexOf(n[0])===-1);case ue.ACK:case ue.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class kD{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=xD(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const CD=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Ym,Encoder:SD,get PacketType(){return ue},protocol:bD},Symbol.toStringTag,{value:"Module"}));function wn(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const TD=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class yk extends ze{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=[wn(t,"open",this.onopen.bind(this)),wn(t,"packet",this.onpacket.bind(this)),wn(t,"error",this.onerror.bind(this)),wn(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(TD.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:ue.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:ue.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 ue.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 ue.EVENT:case ue.BINARY_EVENT:this.onevent(t);break;case ue.ACK:case ue.BINARY_ACK:this.onack(t);break;case ue.DISCONNECT:this.ondisconnect();break;case ue.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:ue.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:ue.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 To(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}To.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};To.prototype.reset=function(){this.attempts=0};To.prototype.setMin=function(e){this.ms=e};To.prototype.setMax=function(e){this.max=e};To.prototype.setJitter=function(e){this.jitter=e};class zp extends ze{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,_c(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 To({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||CD;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 fD(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=wn(n,"open",function(){r.onopen(),t&&t()}),s=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},o=wn(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(wn(t,"ping",this.onping.bind(this)),wn(t,"data",this.ondata.bind(this)),wn(t,"error",this.onerror.bind(this)),wn(t,"close",this.onclose.bind(this)),wn(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){Ec(()=>{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 yk(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 Io={};function au(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=pD(e,t.path||"/socket.io"),r=n.source,i=n.id,s=n.path,o=Io[i]&&s in Io[i].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let l;return a?l=new zp(r,t):(Io[i]||(Io[i]=new zp(r,t)),l=Io[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(au,{Manager:zp,Socket:yk,io:au,connect:au});const lu=e=>{const t=document.cookie.split(";").find(n=>n.includes(e));return t?t.split("=")[1]:null};var Qn=(e=>(e.CustomerToken="lc:customer:token",e.CustomerRefreshToken="lc:customer:refresh_token",e.DeviceId="lc:device:id",e))(Qn||{});const Hd=(e,t,n)=>{let r=e;["lc:customer:token","lc:customer:refresh_token"].includes(e)&&(r=`${n}:${e}`),localStorage.setItem(r,t)},uu=(e,t)=>{let n=e;return["lc:customer:token","lc:customer:refresh_token"].includes(e)&&(n=`${t}:${e}`),localStorage.getItem(n)},Vp=e=>{localStorage.removeItem(`${e}:lc:customer:token`),localStorage.removeItem(`${e}:lc:customer:refresh_token`)},xk=v.createContext(null),ci=()=>{const e=v.useContext(xk);if(!e)throw new Error("useWebsocket must be used within a WebSocketProvider");return e},ED=({children:e})=>{const{widget:t,isHaveChat:n}=kt(),r=v.useRef(null),i=v.useRef(!1),[s,o]=v.useState(!1),a=v.useCallback(()=>{r.current&&(console.log("WS: Cleaning up existing socket."),r.current.removeAllListeners(),r.current.disconnect(),r.current=null),o(!1),i.current=!1},[]),l=v.useCallback(x=>{if(i.current||r.current&&r.current.connected){console.log("WS: Connect called but already connecting or connected.");return}if(!n){console.log("WS: Connect skipped - no active chat");return}const g=uu(Qn.CustomerToken,x)||lu("customer_token"),w=uu(Qn.CustomerRefreshToken,x)||lu("customer_refresh_token");if(!g||!w){console.log("WS: Connect skipped - missing required tokens");return}r.current&&a(),console.log("WS: Attempting to connect..."),i.current=!0;const b=au(D_,{transports:["websocket"],forceNew:!0,timeout:1e4,auth:{customer_token:g,device_id:uu(Qn.DeviceId,x)||lu("device_id"),customer_refresh_token:w}});b.removeAllListeners(),b.on("error",k=>{console.error("WS: Websocket error",k),i.current=!1}),b.on("connect_error",k=>{console.error("WS: Connect error",k),i.current=!1,o(!1),r.current=null}),b.on("disconnect",k=>{console.log("WS: Disconnected",k),o(!1),i.current=!1,r.current===b&&(r.current=null)}),b.on("connect",()=>{console.log("WS: Connected successfully"),r.current=b,o(!0),i.current=!1})},[a,n]);v.useEffect(()=>{const x=t==null?void 0:t.link_id;return x&&n?(console.log("WS: Auto-connecting due to linkId and isHaveChat"),l(x)):(console.log("WS: Auto-disconnect due to missing linkId or isHaveChat"),a()),()=>{console.log("WS: Cleanup on effect change"),a()}},[t==null?void 0:t.link_id,n]);const c=v.useCallback(()=>{const x=t==null?void 0:t.link_id;x?l(x):console.warn("WS: Manual connect failed, no link_id available.")},[t==null?void 0:t.link_id,l]),d=v.useCallback(()=>{console.log("WS: Reconnecting..."),a();const x=t==null?void 0:t.link_id;x&&l(x)},[t==null?void 0:t.link_id,l,a]),u=v.useCallback(()=>{console.log("WS: Manual disconnect"),a()},[a]),f=v.useCallback((x,g)=>{var w;(w=r.current)==null||w.on(x,g)},[]),p=v.useCallback((x,g)=>{var w;(w=r.current)==null||w.off(x,g)},[]),h=v.useCallback((x,g,w)=>{r.current&&r.current.connected?r.current.emit(x,g,w):console.warn(`WS: Cannot emit event '${x}', socket not connected.`)},[]),m=v.useMemo(()=>({connected:s,connect:c,reconnect:d,disconnect:u,on:f,off:p,emit:h}),[s,c,d,u,f,p,h]);return y.jsx(xk.Provider,{value:m,children:e})};var En=(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))(En||{}),st=(e=>(e.MessageAgentCreate="message:agent: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))(st||{});const Pc=e=>{const t=Sb(),n=(r,i)=>{var o;const s=((o=rB.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}},_D=e=>({accessToken:localStorage.getItem(`${e}:${Qn.CustomerToken}`)||"",refreshToken:localStorage.getItem(`${e}:${Qn.CustomerRefreshToken}`)||""}),sl=()=>{const{widget:e}=kt();return e?_D(e.link_id):null},ho=e=>{if(!e)return{};const{accessToken:t,refreshToken:n}=e,r={};return t&&(r["X-Customer-Token"]=t),n&&(r["X-Customer-Refresh-Token"]=n),{...r}};function PD(e){return e&&typeof e=="object"&&"customer_token"in e&&"customer_refresh_token"in e}const jD=()=>am({mutationFn:e=>bo(`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})})}),RD=(e,t)=>bo(`clients/${e}/chats`,{headers:t}),Up=(e,t)=>bo(`clients/${e}/chats`,{method:"DELETE",headers:t}),AD=(e,t,n)=>bo("review",{method:"POST",body:JSON.stringify({rating:e,comment:t||void 0}),headers:{...n,"X-Device-Id":uu(Qn.DeviceId,"")||""}}),OD=()=>{const e=sl();return am({mutationFn:t=>AD(t.rating,t.comment,ho(e))})},DD=e=>{const t=sl();return am({mutationFn:n=>bo(`clients/${e}/chats/files`,{method:"POST",headers:ho(t),body:L_({files:n},{arrayWithBracketAndIndex:!1,arrayWithBrackets:!1})})})};function FD(e){return e&&typeof e=="object"&&"file_urls"in e}const Km=(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])},ss=()=>{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},Xm=()=>{let e=!1;return typeof window<"u"&&(e=new URLSearchParams(window.location.search).get("fullscreen")==="true"),e};function Hp({text:e}){var c,d,u,f;const{widget:t,isHaveChat:n,isTooltipVisible:r,setIsTooltipVisible:i,onTooltipClose:s}=kt(),o=Oe(),a=il(),l=()=>{i(!1),s&&s()};return r?y.jsxs(ve.div,{initial:{opacity:0,scale:.8,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.8,y:10},transition:{type:"spring",damping:20,stiffness:300},className:ge("absolute bottom-full mb-3 p-3 shadow-lg whitespace-nowrap","w-auto right-0"),style:{borderRadius:o.getRadius(),backgroundColor:o.getColor(C.TooltipBackground),color:o.getColor(C.TooltipText)},children:[y.jsx("button",{onClick:l,className:"absolute top-2 right-2 p-1 rounded-full hover:bg-black/10 transition-colors","aria-label":a(Y.CloseButtonAria),children:y.jsx(fe.X,{className:"size-3"})}),y.jsx(ve.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.1,duration:.3},className:"text-sm font-medium pr-5",style:{color:o.getColor(C.TooltipText)},children:e||(n?(d=(c=t==null?void 0:t.appearance)==null?void 0:c.design)==null?void 0:d.tooltip_message_active:(f=(u=t==null?void 0:t.appearance)==null?void 0:u.design)==null?void 0:f.tooltip_message)||a(n?Y.TooltipActive:Y.TooltipDefault)}),y.jsx("div",{className:ge("absolute bottom-0 right-4 w-3 h-3 transform rotate-45 translate-y-1.5 bg-blue-100")})]},"widget-tooltip"):null}const MD="/notify.mp3",ND=async e=>{await new Audio(e||MD).play()};function T0({fallback:e,fallbackOpen:t}){const[n]=v.useState(window.document.title),r=ci(),{isHaveChat:i,open:s,soundPath:o}=kt(),[a,l]=v.useState(!0),[c,d]=v.useState(0),[u,f]=v.useState(null),p=il(),h=()=>{ND(o)},m=(x,g)=>{if(u&&clearInterval(u),x||!i||g===0||Number.isNaN(g)){window.document.title=n,f(null);return}const w=setInterval(()=>{if(x||!i||g===0||Number.isNaN(g)){window.document.title=n,clearInterval(w),f(null);return}const b=`${g} ${p(Y.NewMessagesNotification)} - ${n}`;window.document.title!==b?window.document.title=b:window.document.title=n},1e3);return f(w),()=>{clearInterval(w),f(null)}};return v.useEffect(()=>m(s&&a,c),[c,s,a]),v.useEffect(()=>{const x=()=>{l(document.visibilityState==="visible")};return document.addEventListener("visibilitychange",x,!1),()=>{document.removeEventListener("visibilitychange",x)}},[]),v.useEffect(()=>{if(i&&s&&a&&d(0),!r||!i||s&&a)return;const x=()=>{!i||s&&a||(d(g=>g+1),h())};return r.on(st.MessageAgentCreate,x),r.on(st.ChatUserAssignee,h),()=>{r.off(st.MessageAgentCreate,x),r.off(st.ChatUserAssignee,h)}},[r,i,s,a]),s?null:!i||c===0?t?e:null:y.jsx(Hp,{text:p(Y.NewMessagesNotification)})}function LD({children:e,border:t}){var B,V,K,ee;const n=ci(),{open:r,setOpen:i,setIsHaveChat:s,isHaveChat:o,widget:a,onOpen:l,onClose:c}=kt(),[d]=v.useState(!0),u=Pc(),f=sl(),p=Ja(),h=Oe(),m=ss(),x=Xm(),[g,w]=v.useState({x:0,y:0}),b=E3(),k=v.useRef(null),T=v.useRef(null),[E,_]=v.useState(!1);v.useEffect(()=>((()=>{_("ontouchstart"in window||navigator.maxTouchPoints>0)})(),window.addEventListener("touchstart",()=>{_(!0)},{once:!0}),()=>{window.removeEventListener("touchstart",()=>{_(!0)})}),[]),v.useEffect(()=>{o&&p.pathname==="/"&&f&&f.accessToken&&u.push("chat")},[o]);const P=ne=>{if(!k.current||!T.current)return ne;const O=k.current.getBoundingClientRect(),$={width:window.innerWidth,height:window.innerHeight},H={top:20,right:20,bottom:40,left:20};let q=ne.x,Q=ne.y;return O.right+q-g.x>$.width-H.right&&(q=$.width-H.right-O.width-(O.left-g.x)),O.left+q-g.x<H.left&&(q=H.left-(O.left-g.x)),O.bottom+Q-g.y>$.height-H.bottom&&(Q=$.height-H.bottom-O.height-(O.top-g.y)),O.top+Q-g.y<H.top&&(Q=H.top-(O.top-g.y)),{x:q,y:Q}},M=()=>{i(!0),n&&(n.emit(En.WidgetOpen,{}),l&&l())},N=()=>{i(!1),n&&(n.emit(En.WidgetClose,{}),c&&c())},R=()=>{i(!1),s(!1),Up(a.client_id,ho(f)),u.push("registration")};v.useEffect(()=>{if(m&&(o||x)&&M(),!(!n||!a))return n.on(st.Banned,R),()=>{n.off(st.Banned,R)}},[]);function F(ne){E&&b.start(ne)}return y.jsx("section",{className:"relative w-full h-full",ref:T,children:y.jsxs(Xr,{children:[r&&y.jsx(ve.div,{initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},transition:{type:"spring",damping:25,stiffness:300,duration:.3},style:{width:m?"100%":((V=(B=a==null?void 0:a.appearance)==null?void 0:B.design)==null?void 0:V.width)||"21rem",height:m?"var(--app-height, 100dvh)":((ee=(K=a==null?void 0:a.appearance)==null?void 0:K.design)==null?void 0:ee.height)||"30rem",left:m?"0":"",right:m?"0px !important":"",maxHeight:m?"var(--app-height, 100dvh)":"",borderColor:m?"":h.getColor(C.Border),boxShadow:m?"":`0 10px 25px -5px ${h.getColor(C.ShadowColor)}, 0 8px 10px -6px ${h.getColor(C.ShadowColor)}`},className:ge("fixed z-300 overflow-hidden",{"border border-solid dark:border-zink-500 ":t,"bottom-12 right-12 rounded-t-xl":!m,"!bottom-0 !right-0":m}),children:e},"widget-container"),!E&&y.jsxs("div",{className:"fixed bottom-[40px] right-[20px] z-400",children:[y.jsx(T0,{fallback:y.jsx(Hp,{}),fallbackOpen:d}),y.jsxs(Xr,{mode:"wait",children:[!r&&y.jsxs(on,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"lg",rounded:!0,className:"relative",onClick:M,children:[y.jsx(ve.span,{initial:{scale:.8,opacity:0},animate:{scale:[1,1.2,1],opacity:[.7,0,.7]},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,repeatType:"loop"},className:ge("absolute -z-10 w-full h-full rounded-full opacity-30"),style:{backgroundColor:h.getColor(C.ButtonBackground)}}),y.jsx(fe.Chat,{className:"size-7"})]},"desktop-open-button"),r&&!m&&y.jsx(on,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"lg",rounded:!0,onClick:N,children:y.jsx(fe.X,{className:"size-7"})},"desktop-close-button")]})]}),E&&y.jsx(ve.div,{ref:k,className:"fixed z-400 bottom-24 right-5",initial:{bottom:"96px",right:"20px"},animate:{x:g.x,y:g.y},drag:E,dragControls:b,dragMomentum:!1,dragElastic:0,onDragEnd:(ne,O)=>{const $={x:g.x+O.offset.x,y:g.y+O.offset.y},H=P($);w(H)},children:y.jsxs(Xr,{children:[y.jsx(T0,{fallback:y.jsx(Hp,{}),fallbackOpen:d}),!r&&y.jsx("div",{className:"cursor-move",onPointerDown:F,children:y.jsxs(on,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"lg",rounded:!0,className:"relative",onClick:M,children:[y.jsx(ve.span,{initial:{scale:.8,opacity:0},animate:{scale:[1,1.2,1],opacity:[.7,0,.7]},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,repeatType:"loop"},className:ge("absolute -z-10 w-full h-full rounded-full opacity-30"),style:{backgroundColor:h.getColor(C.ButtonBackground)}}),y.jsx(fe.Chat,{className:"size-7"})]})},"chat-button"),r&&!m&&y.jsx(on,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"lg",rounded:!0,onClick:N,children:y.jsx(fe.X,{className:"size-7"})},"desktop-close-button")]})})]})})}function wk(e){const{widget:t}=kt();return y.jsx(O3,{widget:t,children:y.jsx(LD,{...e})})}function os(e){this._maxSize=e,this.clear()}os.prototype.clear=function(){this._size=0,this._values=Object.create(null)};os.prototype.get=function(e){return this._values[e]};os.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var ID=/[^.^\]^[]+|(?=\[\]|\.\.)/g,bk=/^\d+$/,$D=/^\d/,BD=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,zD=/^\s*(['"]?)(.*?)(\1)\s*$/,Zm=512,E0=new os(Zm),_0=new os(Zm),P0=new os(Zm),Vi={Cache:os,split:Wp,normalizePath:Wd,setter:function(e){var t=Wd(e);return _0.get(e)||_0.set(e,function(r,i){for(var s=0,o=t.length,a=r;s<o-1;){var l=t[s];if(l==="__proto__"||l==="constructor"||l==="prototype")return r;a=a[t[s++]]}a[t[s]]=i})},getter:function(e,t){var n=Wd(e);return P0.get(e)||P0.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+(Jm(n)||bk.test(n)?"["+n+"]":(t?".":"")+n)},"")},forEach:function(e,t,n){VD(Array.isArray(e)?e:Wp(e),t,n)}};function Wd(e){return E0.get(e)||E0.set(e,Wp(e).map(function(t){return t.replace(zD,"$2")}))}function Wp(e){return e.match(ID)||[""]}function VD(e,t,n){var r=e.length,i,s,o,a;for(s=0;s<r;s++)i=e[s],i&&(WD(i)&&(i='"'+i+'"'),a=Jm(i),o=!a&&/^\d+$/.test(i),t.call(n,i,a,o,s,e))}function Jm(e){return typeof e=="string"&&e&&["'",'"'].indexOf(e.charAt(0))!==-1}function UD(e){return e.match($D)&&!e.match(bk)}function HD(e){return BD.test(e)}function WD(e){return!Jm(e)&&(UD(e)||HD(e))}const qD=/[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,jc=e=>e.match(qD)||[],Rc=e=>e[0].toUpperCase()+e.slice(1),eg=(e,t)=>jc(e).join(t).toLowerCase(),Sk=e=>jc(e).reduce((t,n)=>`${t}${t?n[0].toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()}`,""),GD=e=>Rc(Sk(e)),QD=e=>eg(e,"_"),YD=e=>eg(e,"-"),KD=e=>Rc(eg(e," ")),XD=e=>jc(e).map(Rc).join(" ");var qd={words:jc,upperFirst:Rc,camelCase:Sk,pascalCase:GD,snakeCase:QD,kebabCase:YD,sentenceCase:KD,titleCase:XD},tg={exports:{}};tg.exports=function(e){return kk(ZD(e),e)};tg.exports.array=kk;function kk(e,t){var n=e.length,r=new Array(n),i={},s=n,o=JD(t),a=eF(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 f;try{f=", node was:"+JSON.stringify(c)}catch{f=""}throw new Error("Cyclic dependency"+f)}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 p=o.get(c)||new Set;if(p=Array.from(p),d=p.length){u.add(c);do{var h=p[--d];l(h,a.get(h),u)}while(d);u.delete(c)}r[--n]=c}}}function ZD(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 JD(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 eF(e){for(var t=new Map,n=0,r=e.length;n<r;n++)t.set(e[n],n);return t}var tF=tg.exports;const nF=Zi(tF),rF=Object.prototype.toString,iF=Error.prototype.toString,sF=RegExp.prototype.toString,oF=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",aF=/^Symbol\((.*)\)(.*)$/;function lF(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function j0(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const n=typeof e;if(n==="number")return lF(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return oF.call(e).replace(aF,"Symbol($1)");const r=rF.call(e).slice(8,-1);return r==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):r==="Error"||e instanceof Error?"["+iF.call(e)+"]":r==="RegExp"?sF.call(e):null}function Jr(e,t){let n=j0(e,t);return n!==null?n:JSON.stringify(e,function(r,i){let s=j0(this[r],t);return s!==null?s:i},2)}function Ck(e){return e==null?[]:[].concat(e)}let Tk,Ek,_k,uF=/\$\{\s*(\w+)\s*\}/g;Tk=Symbol.toStringTag;class R0{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[Tk]="Error",this.name="ValidationError",this.value=n,this.path=r,this.type=i,this.errors=[],this.inner=[],Ck(t).forEach(s=>{if(Rt.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]}}Ek=Symbol.hasInstance;_k=Symbol.toStringTag;class Rt 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(uF,(i,s)=>Jr(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 R0(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[_k]="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,Rt)}static[Ek](t){return R0[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let Fn={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 \`${Jr(r,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${Jr(n,!0)}\``+i:`${e} must match the configured type. The validated value was: \`${Jr(n,!0)}\``+i}},Tt={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"},cF={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"},qp={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},dF={isValue:"${path} field must be ${value}"},cu={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},fF={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"},pF={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: \`${Jr(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: \`${Jr(n,!0)}\``}return Rt.formatError(Fn.notType,e)}};Object.assign(Object.create(null),{mixed:Fn,string:Tt,number:cF,date:qp,object:cu,array:fF,boolean:dF,tuple:pF});const ng=e=>e&&e.__isYupSchema__;class Qu{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 Qu(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(!ng(i))throw new TypeError("conditions must return a schema object");return i.resolve(n)}}const Nl={context:"$",value:"."};class as{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]===Nl.context,this.isValue=this.key[0]===Nl.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?Nl.context:this.isValue?Nl.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&Vi.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}}as.prototype.__isYupRef=!0;const Ri=e=>e==null;function vs(e){function t({value:n,path:r="",options:i,originalValue:s,schema:o},a,l){const{name:c,test:d,params:u,message:f,skipAbsent:p}=e;let{parent:h,context:m,abortEarly:x=o.spec.abortEarly,disableStackTrace:g=o.spec.disableStackTrace}=i;function w(R){return as.isRef(R)?R.getValue(n,h,m):R}function b(R={}){const F=Object.assign({value:n,originalValue:s,label:o.spec.label,path:R.path||r,spec:o.spec,disableStackTrace:R.disableStackTrace||g},u,R.params);for(const V of Object.keys(F))F[V]=w(F[V]);const B=new Rt(Rt.formatError(R.message||f,F),n,F.path,R.type||c,F.disableStackTrace);return B.params=F,B}const k=x?a:l;let T={path:r,parent:h,type:c,from:i.from,createError:b,resolve:w,options:i,originalValue:s,schema:o};const E=R=>{Rt.isError(R)?k(R):R?l(null):k(b())},_=R=>{Rt.isError(R)?k(R):a(R)};if(p&&Ri(n))return E(!0);let M;try{var N;if(M=d.call(T,n,T),typeof((N=M)==null?void 0:N.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(M).then(E,_)}}catch(R){_(R);return}E(M)}return t.OPTIONS=e,t}function hF(e,t,n,r=n){let i,s,o;return t?(Vi.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",f=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&&f>=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[f],e=u?e.spec.types[f]: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 Yu extends Set{describe(){const t=[];for(const n of this.values())t.push(as.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 Yu(this.values())}merge(t,n){const r=this.clone();return t.forEach(i=>r.add(i)),n.forEach(i=>r.delete(i)),r}}function Ns(e,t=new Map){if(ng(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]=Ns(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,Ns(i,t))}else if(e instanceof Set){n=new Set,t.set(e,n);for(const r of e)n.add(Ns(r,t))}else if(e instanceof Object){n={},t.set(e,n);for(const[r,i]of Object.entries(e))n[r]=Ns(i,t)}else throw Error(`Unable to clone ${e}`);return n}class Kn{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 Yu,this._blacklist=new Yu,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Fn.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=Ns(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&&Ri(s))return s;let o=Jr(t),a=Jr(s);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}".
|
|
95
|
+
`),()=>{document.head.removeChild(p)}},[t]),y.jsx(YP,{isPresent:t,childRef:i,sizeRef:s,children:v.cloneElement(e,{ref:i})})}const XP=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:o,anchorX:a})=>{const l=wc(ZP),c=v.useId();let d=!0,u=v.useMemo(()=>(d=!1,{id:c,initial:t,isPresent:n,custom:i,onExitComplete:f=>{l.set(f,!0);for(const p of l.values())if(!p)return;r&&r()},register:f=>(l.set(f,!1),()=>l.delete(f))}),[n,l,r]);return s&&d&&(u={...u}),v.useMemo(()=>{l.forEach((f,p)=>l.set(p,!1))},[n]),v.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),o==="popLayout"&&(e=y.jsx(KP,{isPresent:n,anchorX:a,children:e})),y.jsx(bc.Provider,{value:u,children:e})};function ZP(){return new Map}function Db(e=!0){const t=v.useContext(bc);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 Rl=e=>e.key||"";function ny(e){const t=[];return v.Children.forEach(e,n=>{v.isValidElement(n)&&t.push(n)}),t}const Xr=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:o=!1,anchorX:a="left"})=>{const[l,c]=Db(o),d=v.useMemo(()=>ny(e),[e]),u=o&&!l?[]:d.map(Rl),f=v.useRef(!0),p=v.useRef(d),h=wc(()=>new Map),[m,x]=v.useState(d),[g,w]=v.useState(d);Ob(()=>{f.current=!1,p.current=d;for(let T=0;T<g.length;T++){const E=Rl(g[T]);u.includes(E)?h.delete(E):h.get(E)!==!0&&h.set(E,!1)}},[g,u.length,u.join("-")]);const b=[];if(d!==m){let T=[...d];for(let E=0;E<g.length;E++){const _=g[E],P=Rl(_);u.includes(P)||(T.splice(E,0,_),b.push(_))}return s==="wait"&&b.length&&(T=b),w(ny(T)),x(d),null}const{forceRender:k}=v.useContext(dm);return y.jsx(y.Fragment,{children:g.map(T=>{const E=Rl(T),_=o&&!l?!1:d===g||u.includes(E),P=()=>{if(h.has(E))h.set(E,!0);else return;let M=!0;h.forEach(N=>{N||(M=!1)}),M&&(k==null||k(),w(p.current),o&&(c==null||c()),r&&r())};return y.jsx(XP,{isPresent:_,initial:!f.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:s,onExitComplete:_?void 0:P,anchorX:a,children:T},E)})})};function hm(e,t){e.indexOf(t)===-1&&e.push(t)}function mm(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}let gp=()=>{};const vp={skipAnimations:!1,useManualTiming:!1};function gm(e){let t;return()=>(t===void 0&&(t=e()),t)}const ln=e=>e,ja=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class vm{constructor(){this.subscriptions=[]}add(t){return hm(this.subscriptions,t),()=>mm(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let s=0;s<i;s++){const o=this.subscriptions[s];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Un=e=>e*1e3,Hn=e=>e/1e3;function Fb(e,t){return t?e*(1e3/t):0}const JP=gm(()=>window.ScrollTimeline!==void 0);class ej{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(JP()&&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 ej{then(t,n){return this.finished.finally(t).then(()=>{})}}const ry={value:null,addProjectionMetrics:null},ym=e=>Array.isArray(e)&&typeof e[0]=="number",nj={};function rj(e,t){const n=gm(e);return()=>nj[t]??n()}const Ra=rj(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Mb=(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)})`},Wo=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,yp={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Wo([0,.65,.55,1]),circOut:Wo([.55,0,1,.45]),backIn:Wo([.31,.01,.66,-.59]),backOut:Wo([.33,1.53,.69,.99])};function Nb(e,t){if(e)return typeof e=="function"&&Ra()?Mb(e,t):ym(e)?Wo(e):Array.isArray(e)?e.map(n=>Nb(n,t)||yp.easeOut):yp[e]}function ij(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=Nb(a,i);return Array.isArray(u)&&(d.easing=u),e.animate(d,{delay:r,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal",pseudoElement:c})}function xm(e){return typeof e=="function"&&"applyToOptions"in e}function wm(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const zu=2e4;function bm(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<zu;)t+=n,r=e.next(t);return t>=zu?1/0:t}function sj(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(bm(r),zu);return{type:"keyframes",ease:s=>r.next(i*s).value/t,duration:Hn(i)}}function Lb(e){return!!(typeof e=="function"&&Ra()||!e||typeof e=="string"&&(e in yp||Ra())||ym(e)||Array.isArray(e)&&e.every(Lb))}function iy(e,t){e.timeline=t,e.onfinish=null}const Al=["read","resolveKeyframes","update","preRender","render","postRender"];function oj(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,f=!1,p=!1)=>{const m=p&&i?n:r;return f&&o.add(u),m.has(u)||m.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&&ry.value&&ry.value.frameloop[t].push(l),l=0,n.clear(),i=!1,s&&(s=!1,d.process(u))}};return d}const aj=40;function Ib(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=Al.reduce((g,w)=>(g[w]=oj(s,t?w:void 0),g),{}),{read:a,resolveKeyframes:l,update:c,preRender:d,render:u,postRender:f}=o,p=()=>{const g=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(g-i.timestamp,aj),1),i.timestamp=g,i.isProcessing=!0,a.process(i),l.process(i),c.process(i),d.process(i),u.process(i),f.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(p))},h=()=>{n=!0,r=!0,i.isProcessing||e(p)};return{schedule:Al.reduce((g,w)=>{const b=o[w];return g[w]=(k,T=!1,E=!1)=>(n||h(),b.schedule(k,T,E)),g},{}),cancel:g=>{for(let w=0;w<Al.length;w++)o[Al[w]].cancel(g)},state:i,steps:o}}const{schedule:Sm,cancel:dB}=Ib(queueMicrotask,!1),{schedule:Se,cancel:ri,state:it,steps:Pd}=Ib(typeof requestAnimationFrame<"u"?requestAnimationFrame:ln,!0);let tu;function lj(){tu=void 0}const Wn={now:()=>(tu===void 0&&Wn.set(it.isProcessing||vp.useManualTiming?it.timestamp:performance.now()),tu),set:e=>{tu=e,queueMicrotask(lj)}},gn={x:!1,y:!1};function $b(){return gn.x||gn.y}function uj(e){return e==="x"||e==="y"?gn[e]?null:(gn[e]=!0,()=>{gn[e]=!1}):gn.x||gn.y?null:(gn.x=gn.y=!0,()=>{gn.x=gn.y=!1})}function cj(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 Bb(e,t){const n=cj(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function sy(e){return!(e.pointerType==="touch"||$b())}function dj(e,t,n={}){const[r,i,s]=Bb(e,n),o=a=>{if(!sy(a))return;const{target:l}=a,c=t(l,a);if(typeof c!="function"||!l)return;const d=u=>{sy(u)&&(c(u),l.removeEventListener("pointerleave",d))};l.addEventListener("pointerleave",d,i)};return r.forEach(a=>{a.addEventListener("pointerenter",o,i)}),s}const zb=(e,t)=>t?e===t?!0:zb(e,t.parentElement):!1,km=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,fj=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function pj(e){return fj.has(e.tagName)||e.tabIndex!==-1}const qo=new WeakSet;function oy(e){return t=>{t.key==="Enter"&&e(t)}}function jd(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const hj=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=oy(()=>{if(qo.has(n))return;jd(n,"down");const i=oy(()=>{jd(n,"up")}),s=()=>jd(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 ay(e){return km(e)&&!$b()}function mj(e,t,n={}){const[r,i,s]=Bb(e,n),o=a=>{const l=a.currentTarget;if(!ay(a)||qo.has(l))return;qo.add(l);const c=t(l,a),d=(p,h)=>{window.removeEventListener("pointerup",u),window.removeEventListener("pointercancel",f),!(!ay(p)||!qo.has(l))&&(qo.delete(l),typeof c=="function"&&c(p,{success:h}))},u=p=>{d(p,l===window||l===document||n.useGlobalTarget||zb(l,p.target))},f=p=>{d(p,!1)};window.addEventListener("pointerup",u,i),window.addEventListener("pointercancel",f,i)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),a instanceof HTMLElement&&(a.addEventListener("focus",c=>hj(c,i)),!pj(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}const ly=30,gj=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=Wn.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=Wn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=gj(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new vm);const r=this.events[t].add(n);return t==="change"?()=>{r(),Se.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=Wn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>ly)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,ly);return Fb(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 Aa(e,t){return new vj(e,t)}const Vb=v.createContext({strict:!1}),uy={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},fo={};for(const e in uy)fo[e]={isEnabled:t=>uy[e].some(n=>!!t[n])};function yj(e){for(const t in e)fo[t]={...fo[t],...e[t]}}const xj=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 Vu(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||xj.has(e)}let Ub=e=>!Vu(e);function wj(e){e&&(Ub=t=>t.startsWith("on")?!Vu(t):e(t))}try{wj(require("@emotion/is-prop-valid").default)}catch{}function bj(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(Ub(i)||n===!0&&Vu(i)||!t&&!Vu(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function Sj(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 Sc=v.createContext({});function kc(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Oa(e){return typeof e=="string"||Array.isArray(e)}const Cm=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Tm=["initial",...Cm];function Cc(e){return kc(e.animate)||Tm.some(t=>Oa(e[t]))}function Hb(e){return!!(Cc(e)||e.variants)}function kj(e,t){if(Cc(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Oa(n)?n:void 0,animate:Oa(r)?r:void 0}}return e.inherit!==!1?t:{}}function Cj(e){const{initial:t,animate:n}=kj(e,v.useContext(Sc));return v.useMemo(()=>({initial:t,animate:n}),[cy(t),cy(n)])}function cy(e){return Array.isArray(e)?e.join(" "):e}const Tj=Symbol.for("motionComponentSymbol");function As(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Ej(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):As(n)&&(n.current=r))},[t])}const Em=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),_j="framerAppearId",Wb="data-"+Em(_j),qb=v.createContext({});function Pj(e,t,n,r,i){var m,x;const{visualElement:s}=v.useContext(Sc),o=v.useContext(Vb),a=v.useContext(bc),l=v.useContext(pm).reducedMotion,c=v.useRef(null);r=r||o.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:s,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const d=c.current,u=v.useContext(qb);d&&!d.projection&&i&&(d.type==="html"||d.type==="svg")&&jj(c.current,n,i,u);const f=v.useRef(!1);v.useInsertionEffect(()=>{d&&f.current&&d.update(n,a)});const p=n[Wb],h=v.useRef(!!p&&!((m=window.MotionHandoffIsComplete)!=null&&m.call(window,p))&&((x=window.MotionHasOptimisedAnimation)==null?void 0:x.call(window,p)));return Ob(()=>{d&&(f.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),Sm.render(d.render),h.current&&d.animationState&&d.animationState.animateChanges())}),v.useEffect(()=>{d&&(!h.current&&d.animationState&&d.animationState.animateChanges(),h.current&&(queueMicrotask(()=>{var g;(g=window.MotionHandoffMarkAsComplete)==null||g.call(window,p)}),h.current=!1))}),d}function jj(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:Gb(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&As(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:l,layoutRoot:c})}function Gb(e){if(e)return e.options.allowProjection!==!1?e.projection:Gb(e.parent)}function Rj({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&yj(e);function s(a,l){let c;const d={...v.useContext(pm),...a,layoutId:Aj(a)},{isStatic:u}=d,f=Cj(a),p=r(a,u);if(!u&&fm){Oj();const h=Dj(d);c=h.MeasureLayout,f.visualElement=Pj(i,p,d,t,h.ProjectionNode)}return y.jsxs(Sc.Provider,{value:f,children:[c&&f.visualElement?y.jsx(c,{visualElement:f.visualElement,...d}):null,n(i,a,Ej(p,f.visualElement,l),p,u,f.visualElement)]})}s.displayName=`motion.${typeof i=="string"?i:`create(${i.displayName??i.name??""})`}`;const o=v.forwardRef(s);return o[Tj]=i,o}function Aj({layoutId:e}){const t=v.useContext(dm).id;return t&&e!==void 0?t+"-"+e:e}function Oj(e,t){v.useContext(Vb).strict}function Dj(e){const{drag:t,layout:n}=fo;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 Qb=e=>t=>typeof t=="string"&&t.startsWith(e),_m=Qb("--"),Fj=Qb("var(--"),Pm=e=>Fj(e)?Mj.test(e.split("/*")[0].trim()):!1,Mj=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Da={};function Nj(e){for(const t in e)Da[t]=e[t],_m(t)&&(Da[t].isCSSVariable=!0)}const ko=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],is=new Set(ko);function Yb(e,{layout:t,layoutId:n}){return is.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Da[e]||e==="opacity")}const ht=e=>!!(e&&e.getVelocity),Kb=(e,t)=>t&&typeof e=="number"?t.transform(e):e,hr=(e,t,n)=>n>t?t:n<e?e:n,Co={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Fa={...Co,transform:e=>hr(0,1,e)},Ol={...Co,default:1},el=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),kr=el("deg"),qn=el("%"),J=el("px"),Lj=el("vh"),Ij=el("vw"),dy={...qn,parse:e=>qn.parse(e)/100,transform:e=>qn.transform(e*100)},$j={borderWidth:J,borderTopWidth:J,borderRightWidth:J,borderBottomWidth:J,borderLeftWidth:J,borderRadius:J,radius:J,borderTopLeftRadius:J,borderTopRightRadius:J,borderBottomRightRadius:J,borderBottomLeftRadius:J,width:J,maxWidth:J,height:J,maxHeight:J,top:J,right:J,bottom:J,left:J,padding:J,paddingTop:J,paddingRight:J,paddingBottom:J,paddingLeft:J,margin:J,marginTop:J,marginRight:J,marginBottom:J,marginLeft:J,backgroundPositionX:J,backgroundPositionY:J},Bj={rotate:kr,rotateX:kr,rotateY:kr,rotateZ:kr,scale:Ol,scaleX:Ol,scaleY:Ol,scaleZ:Ol,skew:kr,skewX:kr,skewY:kr,distance:J,translateX:J,translateY:J,translateZ:J,x:J,y:J,z:J,perspective:J,transformPerspective:J,opacity:Fa,originX:dy,originY:dy,originZ:J},fy={...Co,transform:Math.round},jm={...$j,...Bj,zIndex:fy,size:J,fillOpacity:Fa,strokeOpacity:Fa,numOctaves:fy},zj={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Vj=ko.length;function Uj(e,t,n){let r="",i=!0;for(let s=0;s<Vj;s++){const o=ko[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=Kb(a,jm[o]);if(!l){i=!1;const d=zj[o]||o;r+=`${d}(${c}) `}n&&(t[o]=c)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function Rm(e,t,n){const{style:r,vars:i,transformOrigin:s}=e;let o=!1,a=!1;for(const l in t){const c=t[l];if(is.has(l)){o=!0;continue}else if(_m(l)){i[l]=c;continue}else{const d=Kb(c,jm[l]);l.startsWith("origin")?(a=!0,s[l]=d):r[l]=d}}if(t.transform||(o||n?r.transform=Uj(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 Am=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Xb(e,t,n){for(const r in t)!ht(t[r])&&!Yb(r,n)&&(e[r]=t[r])}function Hj({transformTemplate:e},t){return v.useMemo(()=>{const n=Am();return Rm(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Wj(e,t){const n=e.style||{},r={};return Xb(r,n,e),Object.assign(r,Hj(e,t)),r}function qj(e,t){const n={},r=Wj(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 Gj=["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 Om(e){return typeof e!="string"||e.includes("-")?!1:!!(Gj.indexOf(e)>-1||/[A-Z]/u.test(e))}const Qj={offset:"stroke-dashoffset",array:"stroke-dasharray"},Yj={offset:"strokeDashoffset",array:"strokeDasharray"};function Kj(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?Qj:Yj;e[s.offset]=J.transform(-r);const o=J.transform(t),a=J.transform(n);e[s.array]=`${o} ${a}`}function py(e,t,n){return typeof e=="string"?e:J.transform(t+n*e)}function Xj(e,t,n){const r=py(t,e.x,e.width),i=py(n,e.y,e.height);return`${r} ${i}`}function Dm(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...c},d,u){if(Rm(e,c,u),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:p,dimensions:h}=e;f.transform&&(h&&(p.transform=f.transform),delete f.transform),h&&(i!==void 0||s!==void 0||p.transform)&&(p.transformOrigin=Xj(h,i!==void 0?i:.5,s!==void 0?s:.5)),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),o!==void 0&&Kj(f,o,a,l,!1)}const Zb=()=>({...Am(),attrs:{}}),Fm=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Zj(e,t,n,r){const i=v.useMemo(()=>{const s=Zb();return Dm(s,t,Fm(r),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};Xb(s,e.style,e),i.style={...s,...i.style}}return i}function Jj(e=!1){return(n,r,i,{latestValues:s},o)=>{const l=(Om(n)?Zj:qj)(r,s,o,n),c=bj(r,typeof n=="string",e),d=n!==v.Fragment?{...c,...l,ref:i}:{},{children:u}=r,f=v.useMemo(()=>ht(u)?u.get():u,[u]);return v.createElement(n,{...d,children:f})}}function hy(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Mm(e,t,n,r){if(typeof t=="function"){const[i,s]=hy(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]=hy(r);t=t(n!==void 0?n:e.custom,i,s)}return t}const xp=e=>Array.isArray(e),eR=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),tR=e=>xp(e)?e[e.length-1]||0:e;function nu(e){const t=ht(e)?e.get():e;return eR(t)?t.toValue():t}function nR({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,i,s){const o={latestValues:rR(r,i,s,e),renderState:t()};return n&&(o.onMount=a=>n({props:r,current:a,...o}),o.onUpdate=a=>n(a)),o}const Jb=e=>(t,n)=>{const r=v.useContext(Sc),i=v.useContext(bc),s=()=>nR(e,t,r,i);return n?s():wc(s)};function rR(e,t,n,r){const i={},s=r(e,{});for(const f in s)i[f]=nu(s[f]);let{initial:o,animate:a}=e;const l=Cc(e),c=Hb(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"&&!kc(u)){const f=Array.isArray(u)?u:[u];for(let p=0;p<f.length;p++){const h=Mm(e,f[p]);if(h){const{transitionEnd:m,transition:x,...g}=h;for(const w in g){let b=g[w];if(Array.isArray(b)){const k=d?b.length-1:0;b=b[k]}b!==null&&(i[w]=b)}for(const w in m)i[w]=m[w]}}}return i}function Nm(e,t,n){var s;const{style:r}=e,i={};for(const o in r)(ht(r[o])||t.style&&ht(t.style[o])||Yb(o,e)||((s=n==null?void 0:n.getValue(o))==null?void 0:s.liveStyle)!==void 0)&&(i[o]=r[o]);return i}const iR={useVisualState:Jb({scrapeMotionValuesFromProps:Nm,createRenderState:Am})};function eS(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 tS(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 nS=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 rS(e,t,n,r){tS(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(nS.has(i)?i:Em(i),t.attrs[i])}function iS(e,t,n){const r=Nm(e,t,n);for(const i in e)if(ht(e[i])||ht(t[i])){const s=ko.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=e[i]}return r}const my=["x","y","width","height","cx","cy","r"],sR={useVisualState:Jb({scrapeMotionValuesFromProps:iS,createRenderState:Zb,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(is.has(a)){s=!0;break}}if(!s)return;let o=!t;if(t)for(let a=0;a<my.length;a++){const l=my[a];e[l]!==t[l]&&(o=!0)}o&&Se.read(()=>{eS(n,r),Se.render(()=>{Dm(r,i,Fm(n.tagName),e.transformTemplate),rS(n,r)})})}})};function oR(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...Om(r)?sR:iR,preloadedFeatures:e,useRender:Jj(i),createVisualElement:t,Component:r};return Rj(o)}}function Ma(e,t,n){const r=e.getProps();return Mm(r,t,n!==void 0?n:r.custom,e)}const sS=new Set(["width","height","top","left","right","bottom",...ko]);function aR(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Aa(n))}function lR(e,t){const n=Ma(e,t);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const o in s){const a=tR(s[o]);aR(e,o,a)}}function uR(e){return!!(ht(e)&&e.add)}function wp(e,t){const n=e.getValue("willChange");if(uR(n))return n.add(t);if(!n&&vp.WillChange){const r=new vp.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function oS(e){return e.props[Wb]}const aS=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,cR=1e-7,dR=12;function fR(e,t,n,r,i){let s,o,a=0;do o=t+(n-t)/2,s=aS(o,r,i)-e,s>0?n=o:t=o;while(Math.abs(s)>cR&&++a<dR);return o}function tl(e,t,n,r){if(e===t&&n===r)return ln;const i=s=>fR(s,0,1,e,n);return s=>s===0||s===1?s:aS(i(s),t,r)}const lS=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,uS=e=>t=>1-e(1-t),cS=tl(.33,1.53,.69,.99),Lm=uS(cS),dS=lS(Lm),fS=e=>(e*=2)<1?.5*Lm(e):.5*(2-Math.pow(2,-10*(e-1))),Im=e=>1-Math.sin(Math.acos(e)),pS=uS(Im),hS=lS(Im),mS=e=>/^0[^.\s]+$/u.test(e);function pR(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||mS(e):!0}const ra=e=>Math.round(e*1e5)/1e5,$m=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function hR(e){return e==null}const mR=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Bm=(e,t)=>n=>!!(typeof n=="string"&&mR.test(n)&&n.startsWith(e)||t&&!hR(n)&&Object.prototype.hasOwnProperty.call(n,t)),gS=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,s,o,a]=r.match($m);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},gR=e=>hr(0,255,e),Rd={...Co,transform:e=>Math.round(gR(e))},Pi={test:Bm("rgb","red"),parse:gS("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Rd.transform(e)+", "+Rd.transform(t)+", "+Rd.transform(n)+", "+ra(Fa.transform(r))+")"};function vR(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const bp={test:Bm("#"),parse:vR,transform:Pi.transform},Os={test:Bm("hsl","hue"),parse:gS("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+qn.transform(ra(t))+", "+qn.transform(ra(n))+", "+ra(Fa.transform(r))+")"},ft={test:e=>Pi.test(e)||bp.test(e)||Os.test(e),parse:e=>Pi.test(e)?Pi.parse(e):Os.test(e)?Os.parse(e):bp.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Pi.transform(e):Os.transform(e)},yR=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function xR(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match($m))==null?void 0:t.length)||0)+(((n=e.match(yR))==null?void 0:n.length)||0)>0}const vS="number",yS="color",wR="var",bR="var(",gy="${}",SR=/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 Na(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const a=t.replace(SR,l=>(ft.test(l)?(r.color.push(s),i.push(yS),n.push(ft.parse(l))):l.startsWith(bR)?(r.var.push(s),i.push(wR),n.push(l)):(r.number.push(s),i.push(vS),n.push(parseFloat(l))),++s,gy)).split(gy);return{values:n,split:a,indexes:r,types:i}}function xS(e){return Na(e).values}function wS(e){const{split:t,types:n}=Na(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===vS?s+=ra(i[o]):a===yS?s+=ft.transform(i[o]):s+=i[o]}return s}}const kR=e=>typeof e=="number"?0:e;function CR(e){const t=xS(e);return wS(e)(t.map(kR))}const ii={test:xR,parse:xS,createTransformer:wS,getAnimatableNone:CR},TR=new Set(["brightness","contrast","saturate","opacity"]);function ER(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match($m)||[];if(!r)return e;const i=n.replace(r,"");let s=TR.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const _R=/\b([a-z-]*)\(.*?\)/gu,Sp={...ii,getAnimatableNone:e=>{const t=e.match(_R);return t?t.map(ER).join(" "):e}},PR={...jm,color:ft,backgroundColor:ft,outlineColor:ft,fill:ft,stroke:ft,borderColor:ft,borderTopColor:ft,borderRightColor:ft,borderBottomColor:ft,borderLeftColor:ft,filter:Sp,WebkitFilter:Sp},bS=e=>PR[e];function SS(e,t){let n=bS(e);return n!==Sp&&(n=ii),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const jR=new Set(["auto","none","0"]);function RR(e,t,n){let r=0,i;for(;r<e.length&&!i;){const s=e[r];typeof s=="string"&&!jR.has(s)&&Na(s).values.length&&(i=e[r]),r++}if(i&&n)for(const s of t)e[s]=SS(n,i)}const ji=e=>e*180/Math.PI,kp=e=>{const t=ji(Math.atan2(e[1],e[0]));return Cp(t)},AR={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:kp,rotateZ:kp,skewX:e=>ji(Math.atan(e[1])),skewY:e=>ji(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Cp=e=>(e=e%360,e<0&&(e+=360),e),vy=kp,yy=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),xy=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),OR={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:yy,scaleY:xy,scale:e=>(yy(e)+xy(e))/2,rotateX:e=>Cp(ji(Math.atan2(e[6],e[5]))),rotateY:e=>Cp(ji(Math.atan2(-e[2],e[0]))),rotateZ:vy,rotate:vy,skewX:e=>ji(Math.atan(e[4])),skewY:e=>ji(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function wy(e){return e.includes("scale")?1:0}function Tp(e,t){if(!e||e==="none")return wy(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=OR,i=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=AR,i=a}if(!i)return wy(t);const s=r[t],o=i[1].split(",").map(FR);return typeof s=="function"?s(o):o[s]}const DR=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Tp(n,t)};function FR(e){return parseFloat(e.trim())}const by=e=>e===Co||e===J,MR=new Set(["x","y","z"]),NR=ko.filter(e=>!MR.has(e));function LR(e){const t=[];return NR.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const po={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Tp(t,"x"),y:(e,{transform:t})=>Tp(t,"y")};po.translateX=po.x;po.translateY=po.y;const zi=new Set;let Ep=!1,_p=!1;function kS(){if(_p){const e=Array.from(zi).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=LR(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)})}_p=!1,Ep=!1,zi.forEach(e=>e.complete()),zi.clear()}function CS(){zi.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(_p=!0)})}function IR(){CS(),kS()}class zm{constructor(t,n,r,i,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(zi.add(this),Ep||(Ep=!0,Se.read(CS),Se.resolveKeyframes(kS))):(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),zi.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,zi.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const TS=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),$R=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function BR(e){const t=$R.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function ES(e,t,n=1){const[r,i]=BR(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const o=s.trim();return TS(o)?parseFloat(o):o}return Pm(i)?ES(i,t,n+1):i}const _S=e=>t=>t.test(e),zR={test:e=>e==="auto",parse:e=>e},PS=[Co,J,qn,kr,Ij,Lj,zR],Sy=e=>PS.find(_S(e));class jS extends zm{constructor(t,n,r,i,s){super(t,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),Pm(c))){const d=ES(c,n.current);d!==void 0&&(t[l]=d),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!sS.has(r)||t.length!==2)return;const[i,s]=t,o=Sy(i),a=Sy(s);if(o!==a)if(by(o)&&by(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++)pR(t[i])&&r.push(i);r.length&&RR(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=po[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]=po[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 ky=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ii.test(e)||e==="0")&&!e.startsWith("url("));function VR(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 UR(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=ky(i,t),a=ky(s,t);return!o||!a?!1:VR(e)||(n==="spring"||xm(n))&&r}const HR=e=>e!==null;function Tc(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(HR),s=t&&n!=="loop"&&t%2===1?0:i.length-1;return!s||r===void 0?i[s]:r}const WR=40;class RS{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=Wn.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>WR?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&IR(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Wn.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:s,delay:o,onComplete:a,onUpdate:l,isGenerator:c}=this.options;if(!c&&!UR(t,r,i,s))if(o)this.options.duration=0;else{l&&l(Tc(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 je=(e,t,n)=>e+(t-e)*n;function Ad(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 qR({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=Ad(l,a,e+1/3),s=Ad(l,a,e),o=Ad(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}function Uu(e,t){return n=>n>0?t:e}const Od=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},GR=[bp,Pi,Os],QR=e=>GR.find(t=>t.test(e));function Cy(e){const t=QR(e);if(!t)return!1;let n=t.parse(e);return t===Os&&(n=qR(n)),n}const Ty=(e,t)=>{const n=Cy(e),r=Cy(t);if(!n||!r)return Uu(e,t);const i={...n};return s=>(i.red=Od(n.red,r.red,s),i.green=Od(n.green,r.green,s),i.blue=Od(n.blue,r.blue,s),i.alpha=je(n.alpha,r.alpha,s),Pi.transform(i))},YR=(e,t)=>n=>t(e(n)),nl=(...e)=>e.reduce(YR),Pp=new Set(["none","hidden"]);function KR(e,t){return Pp.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function XR(e,t){return n=>je(e,t,n)}function Vm(e){return typeof e=="number"?XR:typeof e=="string"?Pm(e)?Uu:ft.test(e)?Ty:eA:Array.isArray(e)?AS:typeof e=="object"?ft.test(e)?Ty:ZR:Uu}function AS(e,t){const n=[...e],r=n.length,i=e.map((s,o)=>Vm(s)(s,t[o]));return s=>{for(let o=0;o<r;o++)n[o]=i[o](s);return n}}function ZR(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Vm(e[i])(e[i],t[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function JR(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 eA=(e,t)=>{const n=ii.createTransformer(t),r=Na(e),i=Na(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?Pp.has(e)&&!i.values.length||Pp.has(t)&&!r.values.length?KR(e,t):nl(AS(JR(r,i),i.values),n):Uu(e,t)};function OS(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?je(e,t,n):Vm(e)(e,t)}const tA=5;function DS(e,t,n){const r=Math.max(t-tA,0);return Fb(n-e(r),t-r)}const Fe={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},Dd=.001;function nA({duration:e=Fe.duration,bounce:t=Fe.bounce,velocity:n=Fe.velocity,mass:r=Fe.mass}){let i,s,o=1-t;o=hr(Fe.minDamping,Fe.maxDamping,o),e=hr(Fe.minDuration,Fe.maxDuration,Hn(e)),o<1?(i=c=>{const d=c*o,u=d*e,f=d-n,p=jp(c,o),h=Math.exp(-u);return Dd-f/p*h},s=c=>{const u=c*o*e,f=u*n+n,p=Math.pow(o,2)*Math.pow(c,2)*e,h=Math.exp(-u),m=jp(Math.pow(c,2),o);return(-i(c)+Dd>0?-1:1)*((f-p)*h)/m}):(i=c=>{const d=Math.exp(-c*e),u=(c-n)*e+1;return-Dd+d*u},s=c=>{const d=Math.exp(-c*e),u=(n-c)*(e*e);return d*u});const a=5/e,l=iA(i,s,a);if(e=Un(e),isNaN(l))return{stiffness:Fe.stiffness,damping:Fe.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const rA=12;function iA(e,t,n){let r=n;for(let i=1;i<rA;i++)r=r-e(r)/t(r);return r}function jp(e,t){return e*Math.sqrt(1-t*t)}const sA=["duration","bounce"],oA=["stiffness","damping","mass"];function Ey(e,t){return t.some(n=>e[n]!==void 0)}function aA(e){let t={velocity:Fe.velocity,stiffness:Fe.stiffness,damping:Fe.damping,mass:Fe.mass,isResolvedFromDuration:!1,...e};if(!Ey(e,oA)&&Ey(e,sA))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*hr(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Fe.mass,stiffness:i,damping:s}}else{const n=nA(e);t={...t,...n,mass:Fe.mass},t.isResolvedFromDuration=!0}return t}function Hu(e=Fe.visualDuration,t=Fe.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:f,isResolvedFromDuration:p}=aA({...n,velocity:-Hn(n.velocity||0)}),h=f||0,m=c/(2*Math.sqrt(l*d)),x=o-s,g=Hn(Math.sqrt(l/d)),w=Math.abs(x)<5;r||(r=w?Fe.restSpeed.granular:Fe.restSpeed.default),i||(i=w?Fe.restDelta.granular:Fe.restDelta.default);let b;if(m<1){const T=jp(g,m);b=E=>{const _=Math.exp(-m*g*E);return o-_*((h+m*g*x)/T*Math.sin(T*E)+x*Math.cos(T*E))}}else if(m===1)b=T=>o-Math.exp(-g*T)*(x+(h+g*x)*T);else{const T=g*Math.sqrt(m*m-1);b=E=>{const _=Math.exp(-m*g*E),P=Math.min(T*E,300);return o-_*((h+m*g*x)*Math.sinh(P)+T*x*Math.cosh(P))/T}}const k={calculatedDuration:p&&u||null,next:T=>{const E=b(T);if(p)a.done=T>=u;else{let _=0;m<1&&(_=T===0?Un(h):DS(b,T,E));const P=Math.abs(_)<=r,M=Math.abs(o-E)<=i;a.done=P&&M}return a.value=a.done?o:E,a},toString:()=>{const T=Math.min(bm(k),zu),E=Mb(_=>k.next(T*_).value,T,30);return T+"ms "+E},toTransition:()=>{}};return k}Hu.applyToOptions=e=>{const t=sj(e,100,Hu);return e.ease=Ra()?t.ease:"easeOut",e.duration=Un(t.duration),e.type="keyframes",e};function _y({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],f={done:!1,value:u},p=P=>a!==void 0&&P<a||l!==void 0&&P>l,h=P=>a===void 0?l:l===void 0||Math.abs(a-P)<Math.abs(l-P)?a:l;let m=n*t;const x=u+m,g=o===void 0?x:o(x);g!==x&&(m=g-u);const w=P=>-m*Math.exp(-P/r),b=P=>g+w(P),k=P=>{const M=w(P),N=b(P);f.done=Math.abs(M)<=c,f.value=f.done?g:N};let T,E;const _=P=>{p(f.value)&&(T=P,E=Hu({keyframes:[f.value,h(f.value)],velocity:DS(b,P,f.value),damping:i,stiffness:s,restDelta:c,restSpeed:d}))};return _(0),{calculatedDuration:null,next:P=>{let M=!1;return!E&&T===void 0&&(M=!0,k(P),_(P)),T!==void 0&&P>=T?E.next(P-T):(!M&&k(P),f)}}}const lA=tl(.42,0,1,1),uA=tl(0,0,.58,1),FS=tl(.42,0,.58,1),cA=e=>Array.isArray(e)&&typeof e[0]!="number",Py={linear:ln,easeIn:lA,easeInOut:FS,easeOut:uA,circIn:Im,circInOut:hS,circOut:pS,backIn:Lm,backInOut:dS,backOut:cS,anticipate:fS},jy=e=>{if(ym(e)){gp(e.length===4);const[t,n,r,i]=e;return tl(t,n,r,i)}else if(typeof e=="string")return gp(Py[e]!==void 0),Py[e];return e};function dA(e,t,n){const r=[],i=n||OS,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]||ln:t;a=nl(l,a)}r.push(a)}return r}function fA(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const s=e.length;if(gp(s===t.length),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=dA(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 f=ja(e[u],e[u+1],d);return a[u](f)};return n?d=>c(hr(e[0],e[s-1],d)):c}function pA(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=ja(0,t,r);e.push(je(n,1,i))}}function hA(e){const t=[0];return pA(t,e.length-1),t}function mA(e,t){return e.map(n=>n*t)}function gA(e,t){return e.map(()=>t||FS).splice(0,e.length-1)}function Wu({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=cA(r)?r.map(jy):jy(r),s={done:!1,value:t[0]},o=mA(n&&n.length===t.length?n:hA(t),e),a=fA(o,t,{ease:Array.isArray(i)?i:gA(t,i)});return{calculatedDuration:e,next:l=>(s.value=a(l),s.done=l>=e,s)}}const vA=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Se.update(t,!0),stop:()=>ri(t),now:()=>it.isProcessing?it.timestamp:Wn.now()}},yA={decay:_y,inertia:_y,tween:Wu,keyframes:Wu,spring:Hu},xA=e=>e/100;class Um extends RS{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:i,keyframes:s}=this.options,o=(i==null?void 0:i.KeyframeResolver)||zm,a=(l,c)=>this.onKeyframesResolved(l,c);this.resolver=new o(s,a,n,r,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=this.options,a=xm(n)?n:yA[n]||Wu;let l,c;a!==Wu&&typeof t[0]!="number"&&(l=nl(xA,OS(t[0],t[1])),t=[0,100]);const d=a({...this.options,keyframes:t});s==="mirror"&&(c=a({...this.options,keyframes:[...t].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=bm(d));const{calculatedDuration:u}=d,f=u+i,p=f*(r+1)-i;return{generator:d,mirroredGenerator:c,mapPercentToKeyframes:l,calculatedDuration:u,resolvedDuration:f,totalDuration:p}}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:P}=this.options;return{done:!0,value:P[P.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:f,repeat:p,repeatType:h,repeatDelay:m,onUpdate:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const g=this.currentTime-f*(this.speed>=0?1:-1),w=this.speed>=0?g<0:g>d;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let b=this.currentTime,k=s;if(p){const P=Math.min(this.currentTime,d)/u;let M=Math.floor(P),N=P%1;!N&&P>=1&&(N=1),N===1&&M--,M=Math.min(M,p+1),!!(M%2)&&(h==="reverse"?(N=1-N,m&&(N-=m/u)):h==="mirror"&&(k=o)),b=hr(0,1,N)*u}const T=w?{done:!1,value:l[0]}:k.next(b);a&&(T.value=a(T.value));let{done:E}=T;!w&&c!==null&&(E=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const _=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&E);return _&&i!==void 0&&(T.value=Tc(l,this.options,i)),x&&x(T.value),_&&this.finish(),T}get duration(){const{resolved:t}=this;return t?Hn(t.calculatedDuration):0}get time(){return Hn(this.currentTime)}set time(t){t=Un(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=Hn(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=vA,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 wA=new Set(["opacity","clipPath","filter","transform"]),bA=gm(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),qu=10,SA=2e4;function kA(e){return xm(e.type)||e.type==="spring"||!Lb(e.ease)}function CA(e,t){const n=new Um({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const i=[];let s=0;for(;!r.done&&s<SA;)r=n.sample(s),i.push(r.value),s+=qu;return{times:void 0,keyframes:i,duration:s-qu,ease:"linear"}}const MS={anticipate:fS,backInOut:dS,circInOut:hS};function TA(e){return e in MS}class Ry extends RS{constructor(t){super(t);const{name:n,motionValue:r,element:i,keyframes:s}=this.options;this.resolver=new jS(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"&&Ra()&&TA(s)&&(s=MS[s]),kA(this.options)){const{onComplete:u,onUpdate:f,motionValue:p,element:h,...m}=this.options,x=CA(t,m);t=x.keyframes,t.length===1&&(t[1]=t[0]),r=x.duration,i=x.times,s=x.ease,o="keyframes"}const d=ij(a.owner.current,l,t,{...this.options,duration:r,times:i,ease:s});return d.startTime=c??this.calcStartTime(),this.pendingTimeline?(iy(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:u}=this.options;a.set(Tc(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 Hn(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Hn(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=Un(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 ln;const{animation:r}=n;iy(r,t)}return ln}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:f,...p}=this.options,h=new Um({...p,keyframes:r,duration:i,type:s,ease:o,times:a,isGenerator:!0}),m=Un(this.time);c.setWithVelocity(h.sample(m-qu).value,h.sample(m).value,qu)}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 bA()&&r&&wA.has(r)&&(r!=="transform"||!c)&&!l&&!i&&s!=="mirror"&&o!==0&&a!=="inertia"}}const EA={type:"spring",stiffness:500,damping:25,restSpeed:10},_A=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),PA={type:"keyframes",duration:.8},jA={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},RA=(e,{keyframes:t})=>t.length>2?PA:is.has(e)?e.startsWith("scale")?_A(t[1]):EA:jA;function AA({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:l,elapsed:c,...d}){return!!Object.keys(d).length}const Hm=(e,t,n,r={},i,s)=>o=>{const a=wm(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-Un(l);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:f=>{t.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:i};AA(a)||(d={...d,...RA(e,d)}),d.duration&&(d.duration=Un(d.duration)),d.repeatDelay&&(d.repeatDelay=Un(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 f=Tc(d.keyframes,a);if(f!==void 0)return Se.update(()=>{d.onUpdate(f),d.onComplete()}),new tj([])}return!s&&Ry.supports(d)?new Ry(d):new Um(d)};function OA({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function NS(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),f=a[d];if(f===void 0||c&&OA(c,d))continue;const p={delay:n,...wm(s||{},d)};let h=!1;if(window.MotionHandoffAnimation){const x=oS(e);if(x){const g=window.MotionHandoffAnimation(x,d,Se);g!==null&&(p.startTime=g,h=!0)}}wp(e,d),u.start(Hm(d,u,f,e.shouldReduceMotion&&sS.has(d)?{type:!1}:p,e,h));const m=u.animation;m&&l.push(m)}return o&&Promise.all(l).then(()=>{Se.update(()=>{o&&lR(e,o)})}),l}function Rp(e,t,n={}){var l;const r=Ma(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(NS(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:d=0,staggerChildren:u,staggerDirection:f}=i;return DA(e,t,d+c,u,f,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 DA(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(FA).forEach((c,d)=>{c.notify("AnimationStart",t),o.push(Rp(c,t,{...s,delay:n+l(d)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(o)}function FA(e,t){return e.sortNodePosition(t)}function MA(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>Rp(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=Rp(e,t,n);else{const i=typeof t=="function"?Ma(e,t,n.custom):t;r=Promise.all(NS(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function LS(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 NA=Tm.length;function IS(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?IS(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<NA;n++){const r=Tm[n],i=e.props[r];(Oa(i)||i===!1)&&(t[r]=i)}return t}const LA=[...Cm].reverse(),IA=Cm.length;function $A(e){return t=>Promise.all(t.map(({animation:n,options:r})=>MA(e,n,r)))}function BA(e){let t=$A(e),n=Ay(),r=!0;const i=l=>(c,d)=>{var f;const u=Ma(e,d,l==="exit"?(f=e.presenceContext)==null?void 0:f.custom:void 0);if(u){const{transition:p,transitionEnd:h,...m}=u;c={...c,...m,...h}}return c};function s(l){t=l(e)}function o(l){const{props:c}=e,d=IS(e.parent)||{},u=[],f=new Set;let p={},h=1/0;for(let x=0;x<IA;x++){const g=LA[x],w=n[g],b=c[g]!==void 0?c[g]:d[g],k=Oa(b),T=g===l?w.isActive:null;T===!1&&(h=x);let E=b===d[g]&&b!==c[g]&&k;if(E&&r&&e.manuallyAnimateOnMount&&(E=!1),w.protectedKeys={...p},!w.isActive&&T===null||!b&&!w.prevProp||kc(b)||typeof b=="boolean")continue;const _=zA(w.prevProp,b);let P=_||g===l&&w.isActive&&!E&&k||x>h&&k,M=!1;const N=Array.isArray(b)?b:[b];let R=N.reduce(i(g),{});T===!1&&(R={});const{prevResolvedValues:F={}}=w,B={...F,...R},V=ne=>{P=!0,f.has(ne)&&(M=!0,f.delete(ne)),w.needsAnimating[ne]=!0;const O=e.getValue(ne);O&&(O.liveStyle=!1)};for(const ne in B){const O=R[ne],$=F[ne];if(p.hasOwnProperty(ne))continue;let H=!1;xp(O)&&xp($)?H=!LS(O,$):H=O!==$,H?O!=null?V(ne):f.add(ne):O!==void 0&&f.has(ne)?V(ne):w.protectedKeys[ne]=!0}w.prevProp=b,w.prevResolvedValues=R,w.isActive&&(p={...p,...R}),r&&e.blockInitialAnimation&&(P=!1),P&&(!(E&&_)||M)&&u.push(...N.map(ne=>({animation:ne,options:{type:g}})))}if(f.size){const x={};if(typeof c.initial!="boolean"){const g=Ma(e,Array.isArray(c.initial)?c.initial[0]:c.initial);g&&g.transition&&(x.transition=g.transition)}f.forEach(g=>{const w=e.getBaseTarget(g),b=e.getValue(g);b&&(b.liveStyle=!0),x[g]=w??null}),u.push({animation:x})}let m=!!u.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(m=!1),r=!1,m?t(u):Promise.resolve()}function a(l,c){var u;if(n[l].isActive===c)return Promise.resolve();(u=e.variantChildren)==null||u.forEach(f=>{var p;return(p=f.animationState)==null?void 0:p.setActive(l,c)}),n[l].isActive=c;const d=o(l);for(const f in n)n[f].protectedKeys={};return d}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=Ay(),r=!0}}}function zA(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!LS(t,e):!1}function gi(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ay(){return{animate:gi(!0),whileInView:gi(),whileHover:gi(),whileTap:gi(),whileDrag:gi(),whileFocus:gi(),exit:gi()}}class ui{constructor(t){this.isMounted=!1,this.node=t}update(){}}class VA extends ui{constructor(t){super(t),t.animationState||(t.animationState=BA(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();kc(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 UA=0;class HA extends ui{constructor(){super(...arguments),this.id=UA++}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 WA={animation:{Feature:VA},exit:{Feature:HA}};function La(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function rl(e){return{point:{x:e.pageX,y:e.pageY}}}const qA=e=>t=>km(t)&&e(t,rl(t));function ia(e,t,n,r){return La(e,t,qA(n),r)}function $S({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function GA({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function QA(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 BS=1e-4,YA=1-BS,KA=1+BS,zS=.01,XA=0-zS,ZA=0+zS;function xt(e){return e.max-e.min}function JA(e,t,n){return Math.abs(e-t)<=n}function Oy(e,t,n,r=.5){e.origin=r,e.originPoint=je(t.min,t.max,e.origin),e.scale=xt(n)/xt(t),e.translate=je(n.min,n.max,e.origin)-e.originPoint,(e.scale>=YA&&e.scale<=KA||isNaN(e.scale))&&(e.scale=1),(e.translate>=XA&&e.translate<=ZA||isNaN(e.translate))&&(e.translate=0)}function sa(e,t,n,r){Oy(e.x,t.x,n.x,r?r.originX:void 0),Oy(e.y,t.y,n.y,r?r.originY:void 0)}function Dy(e,t,n){e.min=n.min+t.min,e.max=e.min+xt(t)}function eO(e,t,n){Dy(e.x,t.x,n.x),Dy(e.y,t.y,n.y)}function Fy(e,t,n){e.min=t.min-n.min,e.max=e.min+xt(t)}function oa(e,t,n){Fy(e.x,t.x,n.x),Fy(e.y,t.y,n.y)}const My=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ds=()=>({x:My(),y:My()}),Ny=()=>({min:0,max:0}),Ie=()=>({x:Ny(),y:Ny()});function Zt(e){return[e("x"),e("y")]}function Fd(e){return e===void 0||e===1}function Ap({scale:e,scaleX:t,scaleY:n}){return!Fd(e)||!Fd(t)||!Fd(n)}function wi(e){return Ap(e)||VS(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function VS(e){return Ly(e.x)||Ly(e.y)}function Ly(e){return e&&e!=="0%"}function Gu(e,t,n){const r=e-n,i=t*r;return n+i}function Iy(e,t,n,r,i){return i!==void 0&&(e=Gu(e,i,r)),Gu(e,n,r)+t}function Op(e,t=0,n=1,r,i){e.min=Iy(e.min,t,n,r,i),e.max=Iy(e.max,t,n,r,i)}function US(e,{x:t,y:n}){Op(e.x,t.translate,t.scale,t.originPoint),Op(e.y,n.translate,n.scale,n.originPoint)}const $y=.999999999999,By=1.0000000000001;function tO(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&&Ms(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,US(e,o)),r&&wi(s.latestValues)&&Ms(e,s.latestValues))}t.x<By&&t.x>$y&&(t.x=1),t.y<By&&t.y>$y&&(t.y=1)}function Fs(e,t){e.min=e.min+t,e.max=e.max+t}function zy(e,t,n,r,i=.5){const s=je(e.min,e.max,i);Op(e,t,n,s,r)}function Ms(e,t){zy(e.x,t.x,t.scaleX,t.scale,t.originX),zy(e.y,t.y,t.scaleY,t.scale,t.originY)}function HS(e,t){return $S(QA(e.getBoundingClientRect(),t))}function nO(e,t,n){const r=HS(e,n),{scroll:i}=t;return i&&(Fs(r.x,i.offset.x),Fs(r.y,i.offset.y)),r}const WS=({current:e})=>e?e.ownerDocument.defaultView:null,Vy=(e,t)=>Math.abs(e-t);function rO(e,t){const n=Vy(e.x,t.x),r=Vy(e.y,t.y);return Math.sqrt(n**2+r**2)}class qS{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=Nd(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,p=rO(u.offset,{x:0,y:0})>=3;if(!f&&!p)return;const{point:h}=u,{timestamp:m}=it;this.history.push({...h,timestamp:m});const{onStart:x,onMove:g}=this.handlers;f||(x&&x(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,u)},this.handlePointerMove=(u,f)=>{this.lastMoveEvent=u,this.lastMoveEventInfo=Md(f,this.transformPagePoint),Se.update(this.updatePoint,!0)},this.handlePointerUp=(u,f)=>{this.end();const{onEnd:p,onSessionEnd:h,resumeAnimation:m}=this.handlers;if(this.dragSnapToOrigin&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=Nd(u.type==="pointercancel"?this.lastMoveEventInfo:Md(f,this.transformPagePoint),this.history);this.startEvent&&p&&p(u,x),h&&h(u,x)},!km(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const o=rl(t),a=Md(o,this.transformPagePoint),{point:l}=a,{timestamp:c}=it;this.history=[{...l,timestamp:c}];const{onSessionStart:d}=n;d&&d(t,Nd(a,this.history)),this.removeListeners=nl(ia(this.contextWindow,"pointermove",this.handlePointerMove),ia(this.contextWindow,"pointerup",this.handlePointerUp),ia(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),ri(this.updatePoint)}}function Md(e,t){return t?{point:t(e.point)}:e}function Uy(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Nd({point:e},t){return{point:e,delta:Uy(e,GS(t)),offset:Uy(e,iO(t)),velocity:sO(t,.1)}}function iO(e){return e[0]}function GS(e){return e[e.length-1]}function sO(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=GS(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Un(t)));)n--;if(!r)return{x:0,y:0};const s=Hn(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 oO(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?je(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?je(n,e,r.max):Math.min(e,n)),e}function Hy(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 aO(e,{top:t,left:n,bottom:r,right:i}){return{x:Hy(e.x,n,i),y:Hy(e.y,t,r)}}function Wy(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 lO(e,t){return{x:Wy(e.x,t.x),y:Wy(e.y,t.y)}}function uO(e,t){let n=.5;const r=xt(e),i=xt(t);return i>r?n=ja(t.min,t.max-r,e.min):r>i&&(n=ja(e.min,e.max-i,t.min)),hr(0,1,n)}function cO(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 Dp=.35;function dO(e=Dp){return e===!1?e=0:e===!0&&(e=Dp),{x:qy(e,"left","right"),y:qy(e,"top","bottom")}}function qy(e,t,n){return{min:Gy(e,t),max:Gy(e,n)}}function Gy(e,t){return typeof e=="number"?e:e[t]||0}const fO=new WeakMap;class pO{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=Ie(),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(rl(d).point)},s=(d,u)=>{const{drag:f,dragPropagation:p,onDragStart:h}=this.getProps();if(f&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=uj(f),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Zt(x=>{let g=this.getAxisMotionValue(x).get()||0;if(qn.test(g)){const{projection:w}=this.visualElement;if(w&&w.layout){const b=w.layout.layoutBox[x];b&&(g=xt(b)*(parseFloat(g)/100))}}this.originPoint[x]=g}),h&&Se.postRender(()=>h(d,u)),wp(this.visualElement,"transform");const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},o=(d,u)=>{const{dragPropagation:f,dragDirectionLock:p,onDirectionLock:h,onDrag:m}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:x}=u;if(p&&this.currentDirection===null){this.currentDirection=hO(x),this.currentDirection!==null&&h&&h(this.currentDirection);return}this.updateAxis("x",u.point,x),this.updateAxis("y",u.point,x),this.visualElement.render(),m&&m(d,u)},a=(d,u)=>this.stop(d,u),l=()=>Zt(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 qS(t,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:WS(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&&Se.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||!Dl(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=oO(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&&As(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=aO(r.layoutBox,t):this.constraints=!1,this.elastic=dO(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Zt(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=cO(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!As(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=nO(r,i.root,this.visualElement.getTransformPagePoint());let o=lO(i.layout.layoutBox,s);if(n){const a=n(GA(o));this.hasMutatedConstraints=!!a,a&&(o=$S(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=Zt(d=>{if(!Dl(d,n,this.currentDirection))return;let u=l&&l[d]||{};o&&(u={min:0,max:0});const f=i?200:1e6,p=i?40:1e7,h={type:"inertia",velocity:r?t[d]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...s,...u};return this.startAxisValueAnimation(d,h)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return wp(this.visualElement,t),r.start(Hm(t,r,0,n,this.visualElement,!1))}stopAnimation(){Zt(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Zt(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){Zt(n=>{const{drag:r}=this.getProps();if(!Dl(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]-je(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!As(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Zt(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=uO({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(),Zt(o=>{if(!Dl(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(je(l,c,i[o]))})}addListeners(){if(!this.visualElement.current)return;fO.set(this.visualElement,this);const t=this.visualElement.current,n=ia(t,"pointerdown",l=>{const{drag:c,dragListener:d=!0}=this.getProps();c&&d&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();As(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()),Se.read(r);const o=La(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(Zt(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=Dp,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function Dl(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function hO(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class mO extends ui{constructor(t){super(t),this.removeGroupControls=ln,this.removeListeners=ln,this.controls=new pO(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ln}unmount(){this.removeGroupControls(),this.removeListeners()}}const Qy=e=>(t,n)=>{e&&Se.postRender(()=>e(t,n))};class gO extends ui{constructor(){super(...arguments),this.removePointerDownListener=ln}onPointerDown(t){this.session=new qS(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:WS(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:Qy(t),onStart:Qy(n),onMove:r,onEnd:(s,o)=>{delete this.session,i&&Se.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=ia(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 ru={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Yy(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Lo={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(J.test(e))e=parseFloat(e);else return e;const n=Yy(e,t.target.x),r=Yy(e,t.target.y);return`${n}% ${r}%`}},vO={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=ii.parse(e);if(i.length>5)return r;const s=ii.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=je(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 yO extends v.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=t;Nj(xO),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()})),ru.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()||Se.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Sm.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 QS(e){const[t,n]=Db(),r=v.useContext(dm);return y.jsx(yO,{...e,layoutGroup:r,switchLayoutGroup:v.useContext(qb),isPresent:t,safeToRemove:n})}const xO={borderRadius:{...Lo,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Lo,borderTopRightRadius:Lo,borderBottomLeftRadius:Lo,borderBottomRightRadius:Lo,boxShadow:vO};function wO(e,t,n){const r=ht(e)?e:Aa(e);return r.start(Hm("",r,t,n)),r.animation}function bO(e){return e instanceof SVGElement&&e.tagName!=="svg"}const SO=(e,t)=>e.depth-t.depth;class kO{constructor(){this.children=[],this.isDirty=!1}add(t){hm(this.children,t),this.isDirty=!0}remove(t){mm(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(SO),this.isDirty=!1,this.children.forEach(t)}}function CO(e,t){const n=Wn.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(ri(r),e(s-t))};return Se.read(r,!0),()=>ri(r)}const YS=["TopLeft","TopRight","BottomLeft","BottomRight"],TO=YS.length,Ky=e=>typeof e=="string"?parseFloat(e):e,Xy=e=>typeof e=="number"||J.test(e);function EO(e,t,n,r,i,s){i?(e.opacity=je(0,n.opacity??1,_O(r)),e.opacityExit=je(t.opacity??1,0,PO(r))):s&&(e.opacity=je(t.opacity??1,n.opacity??1,r));for(let o=0;o<TO;o++){const a=`border${YS[o]}Radius`;let l=Zy(t,a),c=Zy(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Xy(l)===Xy(c)?(e[a]=Math.max(je(Ky(l),Ky(c),r),0),(qn.test(c)||qn.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=je(t.rotate||0,n.rotate||0,r))}function Zy(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const _O=KS(0,.5,pS),PO=KS(.5,.95,ln);function KS(e,t,n){return r=>r<e?0:r>t?1:n(ja(e,t,r))}function Jy(e,t){e.min=t.min,e.max=t.max}function Kt(e,t){Jy(e.x,t.x),Jy(e.y,t.y)}function e0(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function t0(e,t,n,r,i){return e-=t,e=Gu(e,1/n,r),i!==void 0&&(e=Gu(e,1/i,r)),e}function jO(e,t=0,n=1,r=.5,i,s=e,o=e){if(qn.test(t)&&(t=parseFloat(t),t=je(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=je(s.min,s.max,r);e===s&&(a-=t),e.min=t0(e.min,t,n,a,i),e.max=t0(e.max,t,n,a,i)}function n0(e,t,[n,r,i],s,o){jO(e,t[n],t[r],t[i],t.scale,s,o)}const RO=["x","scaleX","originX"],AO=["y","scaleY","originY"];function r0(e,t,n,r){n0(e.x,t,RO,n?n.x:void 0,r?r.x:void 0),n0(e.y,t,AO,n?n.y:void 0,r?r.y:void 0)}function i0(e){return e.translate===0&&e.scale===1}function XS(e){return i0(e.x)&&i0(e.y)}function s0(e,t){return e.min===t.min&&e.max===t.max}function OO(e,t){return s0(e.x,t.x)&&s0(e.y,t.y)}function o0(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function ZS(e,t){return o0(e.x,t.x)&&o0(e.y,t.y)}function a0(e){return xt(e.x)/xt(e.y)}function l0(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class DO{constructor(){this.members=[]}add(t){hm(this.members,t),t.scheduleRender()}remove(t){if(mm(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function FO(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:f,skewX:p,skewY:h}=n;c&&(r=`perspective(${c}px) ${r}`),d&&(r+=`rotate(${d}deg) `),u&&(r+=`rotateX(${u}deg) `),f&&(r+=`rotateY(${f}deg) `),p&&(r+=`skewX(${p}deg) `),h&&(r+=`skewY(${h}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const Ld=["","X","Y","Z"],MO={visibility:"hidden"},u0=1e3;let NO=0;function Id(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function JS(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=oS(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Se,!(i||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&JS(r)}function ek({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},a=t==null?void 0:t()){this.id=NO++,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($O),this.nodes.forEach(HO),this.nodes.forEach(WO),this.nodes.forEach(BO)},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 kO)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new vm),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=bO(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 f=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,u&&u(),u=CO(f,250),ru.hasAnimatedSinceResize&&(ru.hasAnimatedSinceResize=!1,this.nodes.forEach(d0))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||c)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:f,hasRelativeLayoutChanged:p,layout:h})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||d.getDefaultTransition()||KO,{onLayoutAnimationStart:x,onLayoutAnimationComplete:g}=d.getProps(),w=!this.targetLayout||!ZS(this.targetLayout,h),b=!f&&p;if(this.options.layoutRoot||this.resumeFrom||b||f&&(w||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(u,b);const k={...wm(m,"layout"),onPlay:x,onComplete:g};(d.shouldReduceMotion||this.options.layoutRoot)&&(k.delay=0,k.type=!1),this.startAnimation(k)}else f||d0(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=h})}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,ri(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(qO),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&&JS(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(c0);return}this.isUpdating||this.nodes.forEach(VO),this.isUpdating=!1,this.nodes.forEach(UO),this.nodes.forEach(LO),this.nodes.forEach(IO),this.clearAllSnapshots();const a=Wn.now();it.delta=hr(0,1e3/60,a-it.timestamp),it.timestamp=a,it.isProcessing=!0,Pd.update.process(it),Pd.preRender.process(it),Pd.render.process(it),it.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Sm.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(zO),this.sharedNodes.forEach(GO)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Se.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Se.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!xt(this.snapshot.measuredBox.x)&&!xt(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=Ie(),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&&!XS(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,d=c!==this.prevTransformTemplateValue;o&&(a||wi(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)),XO(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:o}=this.options;if(!o)return Ie();const a=o.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(ZO))){const{scroll:d}=this.root;d&&(Fs(a.x,d.offset.x),Fs(a.y,d.offset.y))}return a}removeElementScroll(o){var l;const a=Ie();if(Kt(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:f}=d;d!==this.root&&u&&f.layoutScroll&&(u.wasRoot&&Kt(a,o),Fs(a.x,u.offset.x),Fs(a.y,u.offset.y))}return a}applyTransform(o,a=!1){const l=Ie();Kt(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&&Ms(l,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),wi(d.latestValues)&&Ms(l,d.latestValues)}return wi(this.latestValues)&&Ms(l,this.latestValues),l}removeTransform(o){const a=Ie();Kt(a,o);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!wi(c.latestValues))continue;Ap(c.latestValues)&&c.updateSnapshot();const d=Ie(),u=c.measurePageBox();Kt(d,u),r0(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,d)}return wi(this.latestValues)&&r0(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!==it.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var f;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||(f=this.parent)!=null&&f.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:u}=this.options;if(!(!this.layout||!(d||u))){if(this.resolvedRelativeTargetAt=it.timestamp,!this.targetDelta&&!this.relativeTarget){const p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ie(),this.relativeTargetOrigin=Ie(),oa(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),Kt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Ie(),this.targetWithTransforms=Ie()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),eO(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Kt(this.target,this.layout.layoutBox),US(this.target,this.targetDelta)):Kt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const p=this.getClosestProjectingParent();p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ie(),this.relativeTargetOrigin=Ie(),oa(this.relativeTargetOrigin,this.target,p.target),Kt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Ap(this.parent.latestValues)||VS(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 h;const o=this.getLead(),a=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||(h=this.parent)!=null&&h.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===it.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;Kt(this.layoutCorrected,this.layout.layoutBox);const u=this.treeScale.x,f=this.treeScale.y;tO(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=Ie());const{target:p}=o;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(e0(this.prevProjectionDelta.x,this.projectionDelta.x),e0(this.prevProjectionDelta.y,this.projectionDelta.y)),sa(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==u||this.treeScale.y!==f||!l0(this.projectionDelta.x,this.prevProjectionDelta.x)||!l0(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}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=Ds(),this.projectionDelta=Ds(),this.projectionDeltaWithTransform=Ds()}setAnimationOrigin(o,a=!1){const l=this.snapshot,c=l?l.latestValues:{},d={...this.latestValues},u=Ds();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=Ie(),p=l?l.source:void 0,h=this.layout?this.layout.source:void 0,m=p!==h,x=this.getStack(),g=!x||x.members.length<=1,w=!!(m&&!g&&this.options.crossfade===!0&&!this.path.some(YO));this.animationProgress=0;let b;this.mixTargetDelta=k=>{const T=k/1e3;f0(u.x,o.x,T),f0(u.y,o.y,T),this.setTargetDelta(u),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(oa(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),QO(this.relativeTarget,this.relativeTargetOrigin,f,T),b&&OO(this.relativeTarget,b)&&(this.isProjectionDirty=!1),b||(b=Ie()),Kt(b,this.relativeTarget)),m&&(this.animationValues=d,EO(d,c,this.latestValues,T,w,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&&(ri(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Se.update(()=>{ru.hasAnimatedSinceResize=!0,this.currentAnimation=wO(0,u0,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(u0),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:d}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&tk(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||Ie();const u=xt(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+u;const f=xt(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+f}Kt(a,l),Ms(a,d),sa(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new DO),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&&Id("z",o,c,this.animationValues);for(let d=0;d<Ld.length;d++)Id(`rotate${Ld[d]}`,o,c,this.animationValues),Id(`skew${Ld[d]}`,o,c,this.animationValues);o.render();for(const d in c)o.setStaticValue(d,c[d]),this.animationValues&&(this.animationValues[d]=c[d]);o.scheduleRender()}getProjectionStyles(o){if(!this.instance||this.isSVG)return;if(!this.isVisible)return MO;const a={visibility:""},l=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,a.opacity="",a.pointerEvents=nu(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 p={};return this.options.layoutId&&(p.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,p.pointerEvents=nu(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!wi(this.latestValues)&&(p.transform=l?l({},""):"none",this.hasProjected=!1),p}const d=c.animationValues||c.latestValues;this.applyTransformsToTarget(),a.transform=FO(this.projectionDeltaWithTransform,this.treeScale,d),l&&(a.transform=l(d,a.transform));const{x:u,y:f}=this.projectionDelta;a.transformOrigin=`${u.origin*100}% ${f.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 p in Da){if(d[p]===void 0)continue;const{correct:h,applyTo:m,isCSSVariable:x}=Da[p],g=a.transform==="none"?d[p]:h(d[p],c);if(m){const w=m.length;for(let b=0;b<w;b++)a[m[b]]=g}else x?this.options.visualElement.renderState.vars[p]=g:a[p]=g}return this.options.layoutId&&(a.pointerEvents=c===this?nu(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(c0),this.root.sharedNodes.clear()}}}function LO(e){e.updateLayout()}function IO(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"?Zt(u=>{const f=o?t.measuredBox[u]:t.layoutBox[u],p=xt(f);f.min=r[u].min,f.max=f.min+p}):tk(s,t.layoutBox,r)&&Zt(u=>{const f=o?t.measuredBox[u]:t.layoutBox[u],p=xt(r[u]);f.max=f.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+p)});const a=Ds();sa(a,r,t.layoutBox);const l=Ds();o?sa(l,e.applyTransform(i,!0),t.measuredBox):sa(l,r,t.layoutBox);const c=!XS(a);let d=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:f,layout:p}=u;if(f&&p){const h=Ie();oa(h,t.layoutBox,f.layoutBox);const m=Ie();oa(m,r,p.layoutBox),ZS(h,m)||(d=!0),u.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=h,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 $O(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 BO(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function zO(e){e.clearSnapshot()}function c0(e){e.clearMeasurements()}function VO(e){e.isLayoutDirty=!1}function UO(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function d0(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function HO(e){e.resolveTargetDelta()}function WO(e){e.calcProjection()}function qO(e){e.resetSkewAndRotation()}function GO(e){e.removeLeadSnapshot()}function f0(e,t,n){e.translate=je(t.translate,0,n),e.scale=je(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function p0(e,t,n,r){e.min=je(t.min,n.min,r),e.max=je(t.max,n.max,r)}function QO(e,t,n,r){p0(e.x,t.x,n.x,r),p0(e.y,t.y,n.y,r)}function YO(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const KO={duration:.45,ease:[.4,0,.1,1]},h0=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),m0=h0("applewebkit/")&&!h0("chrome/")?Math.round:ln;function g0(e){e.min=m0(e.min),e.max=m0(e.max)}function XO(e){g0(e.x),g0(e.y)}function tk(e,t,n){return e==="position"||e==="preserve-aspect"&&!JA(a0(t),a0(n),.2)}function ZO(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const JO=ek({attachResizeListener:(e,t)=>La(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),$d={current:void 0},nk=ek({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!$d.current){const e=new JO({});e.mount(window),e.setOptions({layoutScroll:!0}),$d.current=e}return $d.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),e3={pan:{Feature:gO},drag:{Feature:mO,ProjectionNode:nk,MeasureLayout:QS}};function v0(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&&Se.postRender(()=>s(t,rl(t)))}class t3 extends ui{mount(){const{current:t}=this.node;t&&(this.unmount=dj(t,(n,r)=>(v0(this.node,r,"Start"),i=>v0(this.node,i,"End"))))}unmount(){}}class n3 extends ui{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=nl(La(this.node.current,"focus",()=>this.onFocus()),La(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function y0(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&&Se.postRender(()=>s(t,rl(t)))}class r3 extends ui{mount(){const{current:t}=this.node;t&&(this.unmount=mj(t,(n,r)=>(y0(this.node,r,"Start"),(i,{success:s})=>y0(this.node,i,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Fp=new WeakMap,Bd=new WeakMap,i3=e=>{const t=Fp.get(e.target);t&&t(e)},s3=e=>{e.forEach(i3)};function o3({root:e,...t}){const n=e||document;Bd.has(n)||Bd.set(n,{});const r=Bd.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(s3,{root:e,...t})),r[i]}function a3(e,t,n){const r=o3(t);return Fp.set(e,n),r.observe(e),()=>{Fp.delete(e),r.unobserve(e)}}const l3={some:0,all:1};class u3 extends ui{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:l3[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(),f=c?d:u;f&&f(l)};return a3(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(c3(t,n))&&this.startObserver()}unmount(){}}function c3({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const d3={inView:{Feature:u3},tap:{Feature:r3},focus:{Feature:n3},hover:{Feature:t3}},f3={layout:{ProjectionNode:nk,MeasureLayout:QS}},Mp={current:null},rk={current:!1};function p3(){if(rk.current=!0,!!fm)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Mp.current=e.matches;e.addListener(t),t()}else Mp.current=!1}const h3=[...PS,ft,ii],m3=e=>h3.find(_S(e)),g3=new WeakMap;function v3(e,t,n){for(const r in t){const i=t[r],s=n[r];if(ht(i))e.addValue(r,i);else if(ht(s))e.addValue(r,Aa(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,Aa(o!==void 0?o:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const x0=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class y3{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=zm,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=Wn.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,Se.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=Cc(n),this.isVariantNode=Hb(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in f){const h=f[p];l[p]!==void 0&&ht(h)&&h.set(l[p],!1)}}mount(t){this.current=t,g3.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)),rk.current||p3(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Mp.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),ri(this.notifyUpdate),ri(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=is.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&Se.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 fo){const n=fo[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):Ie()}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<x0.length;r++){const i=x0[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=v3(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=Aa(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"&&(TS(r)||mS(r))?r=parseFloat(r):!m3(r)&&ii.test(n)&&(r=SS(t,n)),this.setBaseTarget(t,ht(r)?r.get():r)),ht(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=Mm(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&&!ht(i)?i:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new vm),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class ik extends y3{constructor(){super(...arguments),this.KeyframeResolver=jS}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;ht(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function x3(e){return window.getComputedStyle(e)}class w3 extends ik{constructor(){super(...arguments),this.type="html",this.renderInstance=tS}readValueFromInstance(t,n){if(is.has(n))return DR(t,n);{const r=x3(t),i=(_m(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return HS(t,n)}build(t,n,r){Rm(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Nm(t,n,r)}}class b3 extends ik{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ie,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&eS(this.current,this.renderState)}}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(is.has(n)){const r=bS(n);return r&&r.default||0}return n=nS.has(n)?n:Em(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return iS(t,n,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&Se.postRender(this.updateDimensions)}build(t,n,r){Dm(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){rS(t,n,r,i)}mount(t){this.isSVGTag=Fm(t.tagName),super.mount(t)}}const S3=(e,t)=>Om(e)?new b3(t):new w3(t,{allowProjection:e!==v.Fragment}),k3=oR({...WA,...d3,...e3,...f3},S3),ve=Sj(k3);class C3{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 T3=()=>new C3;function E3(){return wc(T3)}var Er=(e=>(e.None="none",e.Sm="sm",e.Md="md",e.Lg="lg",e.Xl="xl",e.Full="full",e))(Er||{});const sk=v.createContext({}),_3={[Y.TooltipDefault]:"Bizimle sohbet edin!",[Y.TooltipActive]:"Yeni mesajlar var!",[Y.CloseButtonAria]:"Kapat",[Y.MessagePlaceholder]:"Mesajınızı yazın",[Y.FileUploadDisabled]:"Dosya gönderim izniniz olmadığı için yükleyemezsiniz",[Y.NewMessagesNotification]:"Yeni mesajlar var!",[Y.ChatCloseConfirm]:"Sohbeti kapatmak istediğinizden emin misiniz?",[Y.ChatCloseWarning]:"Bu işlem geri alınamaz.",[Y.ChatSettings]:"Sohbet Ayarları",[Y.ChatEndConversation]:"Sohbeti Sonlandır",[Y.CancelAction]:"Vazgeç",[Y.CloseAction]:"Kapat",[Y.QuickActions]:"Hızlı işlemler",[Y.GreetingStartChat]:"Sohbete başla",[Y.RateLimitMessage]:"Çok fazla mesaj gönderdiniz. Lütfen {seconds} saniye bekleyin.",[Y.RatingHeaderEvaluate]:"Görüşmenizi Değerlendirin",[Y.RatingHeaderThanks]:"Teşekkürler!",[Y.RatingDescription]:"Lütfen hizmetimizi değerlendirin. Görüşleriniz bizim için önemli.",[Y.RatingRateConversation]:"Görüşmeyi puanlayın",[Y.RatingComment]:"Yorumunuz (İsteğe bağlı)",[Y.RatingCommentPlaceholder]:"Görüşme hakkında düşüncelerinizi paylaşın...",[Y.RatingSubmit]:"Değerlendirmeyi Gönder",[Y.RatingNewConversation]:"Yeni Görüşme Başlat",[Y.RatingThankYouTitle]:"Değerlendirmeniz için teşekkürler!",[Y.RatingThankYouDescription]:"Geri bildiriminiz bizim için çok değerli.",[Y.RatingCountdown]:"Ekran {seconds} saniye içinde kapanacaktır.",[Y.RatingMinimumError]:"Lütfen en az 1 yıldız seçiniz.",[Y.RatingYourScore]:"Puanınız: {score}",[Y.PoweredBy]:"Powered by"},P3={[C.Background]:"#ffffff",[C.Border]:"#e2e8f0",[C.TooltipText]:"#1e40af",[C.TooltipBackground]:"#dbeafe",[C.TooltipBorder]:"#3b82f6",[C.HeaderBackground]:"#2563eb",[C.HeaderBorder]:"#e2e8f0",[C.HeaderText]:"#ffffff",[C.FooterBackground]:"#f8fafc",[C.FooterBorder]:"#e2e8f0",[C.FooterText]:"#475569",[C.MessageAdminBackground]:"#f1f5f9",[C.MessageAdminText]:"#334155",[C.MessageVisitorBackground]:"#3b82f6",[C.MessageVisitorText]:"#ffffff",[C.GreeterBackground]:"#ffffff",[C.GreeterText]:"#334155",[C.GreeterBorder]:"#e2e8f0",[C.GreeterTopBackground]:"linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%)",[C.GreeterTopText]:"#ffffff",[C.GreeterButtonBackground]:"#4f46e5",[C.GreeterButtonText]:"#ffffff",[C.ButtonBackground]:"#4f46e5",[C.ButtonText]:"#ffffff",[C.InputBackground]:"#ffffff",[C.InputText]:"#1e293b",[C.InputBorder]:"#e2e8f0",[C.CloseButtonBackground]:"#f1f5f9",[C.CloseButtonText]:"#475569",[C.CloseButtonHover]:"#e2e8f0",[C.IconColor]:"#64748b",[C.IconBackground]:"transparent",[C.ErrorBackground]:"#fef2f2",[C.ErrorText]:"#dc2626",[C.ErrorBorder]:"#fca5a5",[C.SuccessBackground]:"#f0fdf4",[C.SuccessText]:"#16a34a",[C.SuccessBorder]:"#86efac",[C.WarningBackground]:"#fffbeb",[C.WarningText]:"#d97706",[C.WarningBorder]:"#fcd34d",[C.LinkColor]:"#2563eb",[C.LinkHoverColor]:"#1d4ed8",[C.DividerColor]:"#e2e8f0",[C.ShadowColor]:"rgba(0, 0, 0, 0.1)",[C.StarActiveColor]:"#3b82f6",[C.StarInactiveColor]:"#e2e8f0",[C.ModalOverlayColor]:"rgba(0, 0, 0, 0.4)",[C.ChatCloseConfirmText]:"#dc2626",[C.RatingHeaderBackground]:"#4F46E5",[C.RatingHeaderText]:"#ffffff",[C.RatingSuccessBackground]:"#ffffff",[C.RatingSuccessText]:"#334155",[C.RatingRateConversationText]:"#1e293b"},j3={[Er.None]:"0px",[Er.Sm]:"var(--radius-xs)",[Er.Md]:"var(--radius-sm)",[Er.Lg]:"var(--radius-md)",[Er.Xl]:"var(--radius-lg)",[Er.Full]:"calc(infinity * 1px)"},R3=e=>{const t={..._3};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},A3=e=>{const t={...P3};if(!e||!e.appearance||!e.appearance.design||!e.appearance.design.colors)return t;for(const n in e.appearance.design.colors){const r=n;e.appearance.design.colors[r]&&(t[r]=e.appearance.design.colors[r])}return t};function O3({children:e,widget:t}){const n=A3(t),r=R3(t),i=t&&t.appearance&&t.appearance.design&&t.appearance.design.border_radius?t.appearance.design.border_radius:Er.Md,s=l=>n[l],o=l=>r[l],a=()=>j3[i];return y.jsx(sk.Provider,{value:{colors:n,texts:r,getColor:s,getText:o,getRadius:a},children:e})}const Oe=()=>v.useContext(sk),il=()=>Oe().getText;function on({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=C.ButtonText,bgKey:d=C.ButtonBackground,animations:u={},withoutTheming:f,...p}){const h=Oe();return y.jsx(ve.button,{type:t,className:ge("flex items-center justify-center focus:!ring-0 font-medium",{"rounded-full":o&&i!=="xs","rounded-lg":!o},a,ty[n]&&ty[n][r],GP[i][o?"rounded":"default"]),disabled:s,style:{...!f&&{color:h.getColor(c),backgroundColor:h.getColor(d),...o?{}:{borderRadius:h.getRadius()}},...l},...u,...p,children:e})}function fe(){}fe.Home=function(t){return y.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",height:"1em",width:"1em",...t,children:y.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"})})};fe.Chat=e=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:y.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"})});fe.Menu=e=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"})});fe.MessageTyping=({className:e="size-5",...t})=>y.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:y.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"})});fe.Check=function(t){return y.jsx("svg",{fill:"currentColor",viewBox:"0 0 16 16",height:"1em",width:"1em",...t,children:y.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"})})};fe.Website=function(t){return y.jsxs("svg",{fill:"none",viewBox:"0 0 24 24",height:"1em",width:"1em",...t,children:[y.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"}),y.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"}),y.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"})]})};fe.ArrowDown=e=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 13.5 12 21m0 0-7.5-7.5M12 21V3"})});fe.XCircle=({className:e="e-5",...t})=>y.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:y.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"})});fe.X=({className:e="e-5",...t})=>y.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:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})});fe.PaperAirplane=({className:e="e-5",...t})=>y.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:y.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"})});fe.Spin=function(t){return y.jsx("svg",{"data-name":"Layer 1",viewBox:"0 0 24 24",fill:"currentColor",height:"1em",width:"1em",...t,children:y.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"})})};fe.ExternalLink=e=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:y.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"})});fe.Phone=e=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:y.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"})});fe.Mail=e=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:y.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"})});const Yn=Object.create(null);Yn.open="0";Yn.close="1";Yn.ping="2";Yn.pong="3";Yn.message="4";Yn.upgrade="5";Yn.noop="6";const iu=Object.create(null);Object.keys(Yn).forEach(e=>{iu[Yn[e]]=e});const Np={type:"error",data:"parser error"},ok=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",ak=typeof ArrayBuffer=="function",lk=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Wm=({type:e,data:t},n,r)=>ok&&t instanceof Blob?n?r(t):w0(t,r):ak&&(t instanceof ArrayBuffer||lk(t))?n?r(t):w0(new Blob([t]),r):r(Yn[e]+(t||"")),w0=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function b0(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let zd;function D3(e,t){if(ok&&e.data instanceof Blob)return e.data.arrayBuffer().then(b0).then(t);if(ak&&(e.data instanceof ArrayBuffer||lk(e.data)))return t(b0(e.data));Wm(e,!1,n=>{zd||(zd=new TextEncoder),t(zd.encode(n))})}const S0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Go=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<S0.length;e++)Go[S0.charCodeAt(e)]=e;const F3=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=Go[e.charCodeAt(r)],o=Go[e.charCodeAt(r+1)],a=Go[e.charCodeAt(r+2)],l=Go[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},M3=typeof ArrayBuffer=="function",qm=(e,t)=>{if(typeof e!="string")return{type:"message",data:uk(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:N3(e.substring(1),t)}:iu[n]?e.length>1?{type:iu[n],data:e.substring(1)}:{type:iu[n]}:Np},N3=(e,t)=>{if(M3){const n=F3(e);return uk(n,t)}else return{base64:!0,data:e}},uk=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},ck="",L3=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((s,o)=>{Wm(s,!1,a=>{r[o]=a,++i===n&&t(r.join(ck))})})},I3=(e,t)=>{const n=e.split(ck),r=[];for(let i=0;i<n.length;i++){const s=qm(n[i],t);if(r.push(s),s.type==="error")break}return r};function $3(){return new TransformStream({transform(e,t){D3(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 Vd;function Fl(e){return e.reduce((t,n)=>t+n.length,0)}function Ml(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 B3(e,t){Vd||(Vd=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(Fl(n)<1)break;const l=Ml(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(Fl(n)<2)break;const l=Ml(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(Fl(n)<8)break;const l=Ml(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),d=c.getUint32(0);if(d>Math.pow(2,21)-1){a.enqueue(Np);break}i=d*Math.pow(2,32)+c.getUint32(4),r=3}else{if(Fl(n)<i)break;const l=Ml(n,i);a.enqueue(qm(s?l:Vd.decode(l),t)),r=0}if(i===0||i>e){a.enqueue(Np);break}}}})}const dk=4;function ze(e){if(e)return z3(e)}function z3(e){for(var t in ze.prototype)e[t]=ze.prototype[t];return e}ze.prototype.on=ze.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};ze.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};ze.prototype.off=ze.prototype.removeListener=ze.prototype.removeAllListeners=ze.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};ze.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};ze.prototype.emitReserved=ze.prototype.emit;ze.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};ze.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Ec=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),rn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),V3="arraybuffer";function fk(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const U3=rn.setTimeout,H3=rn.clearTimeout;function _c(e,t){t.useNativeTimers?(e.setTimeoutFn=U3.bind(rn),e.clearTimeoutFn=H3.bind(rn)):(e.setTimeoutFn=rn.setTimeout.bind(rn),e.clearTimeoutFn=rn.clearTimeout.bind(rn))}const W3=1.33;function q3(e){return typeof e=="string"?G3(e):Math.ceil((e.byteLength||e.size)*W3)}function G3(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 pk(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Q3(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function Y3(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 K3 extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Gm extends ze{constructor(t){super(),this.writable=!1,_c(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 K3(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=qm(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=Q3(t);return n.length?"?"+n:""}}class X3 extends Gm{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)};I3(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,L3(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]=pk()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let hk=!1;try{hk=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Z3=hk;function J3(){}class eD extends X3{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 Gn extends ze{constructor(t,n,r){super(),this.createRequest=t,_c(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=fk(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=Gn.requestsCount++,Gn.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=J3,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Gn.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()}}Gn.requestsCount=0;Gn.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",k0);else if(typeof addEventListener=="function"){const e="onpagehide"in rn?"pagehide":"unload";addEventListener(e,k0,!1)}}function k0(){for(let e in Gn.requests)Gn.requests.hasOwnProperty(e)&&Gn.requests[e].abort()}const tD=function(){const e=mk({xdomain:!1});return e&&e.responseType!==null}();class nD extends eD{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=tD&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Gn(mk,this.uri(),t)}}function mk(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Z3))return new XMLHttpRequest}catch{}if(!t)try{return new rn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const gk=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class rD extends Gm{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=gk?{}:fk(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;Wm(r,this.supportsBinary,s=>{try{this.doWrite(r,s)}catch{}i&&Ec(()=>{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]=pk()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Ud=rn.WebSocket||rn.MozWebSocket;class iD extends rD{createSocket(t,n,r){return gk?new Ud(t,n,r):n?new Ud(t,n):new Ud(t)}doWrite(t,n){this.ws.send(n)}}class sD extends Gm{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=B3(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=$3();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&&Ec(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const oD={websocket:iD,webtransport:sD,polling:nD},aD=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,lD=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Lp(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=aD.exec(e||""),s={},o=14;for(;o--;)s[lD[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=uD(s,s.path),s.queryKey=cD(s,s.query),s}function uD(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 cD(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,s){i&&(n[i]=s)}),n}const Ip=typeof addEventListener=="function"&&typeof removeEventListener=="function",su=[];Ip&&addEventListener("offline",()=>{su.forEach(e=>e())},!1);class Zr extends ze{constructor(t,n){if(super(),this.binaryType=V3,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=Lp(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=Lp(n.host).host);_c(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=Y3(this.opts.query)),Ip&&(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"})},su.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&&Zr.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",Zr.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+=q3(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,Ec(()=>{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(Zr.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(),Ip&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=su.indexOf(this._offlineEventListener);r!==-1&&su.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Zr.protocol=dk;class dD extends Zr{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;Zr.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;Zr.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 f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function s(){r||(r=!0,d(),n.close(),n=null)}const o=u=>{const f=new Error("probe error: "+u);f.transport=n.name,s(),this.emitReserved("upgradeError",f)};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 fD=class extends dD{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=>oD[i]).filter(i=>!!i)),super(t,r)}};function pD(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=Lp(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 hD=typeof ArrayBuffer=="function",mD=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,vk=Object.prototype.toString,gD=typeof Blob=="function"||typeof Blob<"u"&&vk.call(Blob)==="[object BlobConstructor]",vD=typeof File=="function"||typeof File<"u"&&vk.call(File)==="[object FileConstructor]";function Qm(e){return hD&&(e instanceof ArrayBuffer||mD(e))||gD&&e instanceof Blob||vD&&e instanceof File}function ou(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(ou(e[n]))return!0;return!1}if(Qm(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return ou(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&ou(e[n]))return!0;return!1}function yD(e){const t=[],n=e.data,r=e;return r.data=$p(n,t),r.attachments=t.length,{packet:r,buffers:t}}function $p(e,t){if(!e)return e;if(Qm(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]=$p(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]=$p(e[r],t));return n}return e}function xD(e,t){return e.data=Bp(e.data,t),delete e.attachments,e}function Bp(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]=Bp(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Bp(e[n],t));return e}const wD=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],bD=5;var ue;(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"})(ue||(ue={}));class SD{constructor(t){this.replacer=t}encode(t){return(t.type===ue.EVENT||t.type===ue.ACK)&&ou(t)?this.encodeAsBinary({type:t.type===ue.EVENT?ue.BINARY_EVENT:ue.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===ue.BINARY_EVENT||t.type===ue.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=yD(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function C0(e){return Object.prototype.toString.call(e)==="[object Object]"}class Ym extends ze{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===ue.BINARY_EVENT;r||n.type===ue.BINARY_ACK?(n.type=r?ue.EVENT:ue.ACK,this.reconstructor=new kD(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Qm(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(ue[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===ue.BINARY_EVENT||r.type===ue.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(Ym.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 ue.CONNECT:return C0(n);case ue.DISCONNECT:return n===void 0;case ue.CONNECT_ERROR:return typeof n=="string"||C0(n);case ue.EVENT:case ue.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&wD.indexOf(n[0])===-1);case ue.ACK:case ue.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class kD{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=xD(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const CD=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Ym,Encoder:SD,get PacketType(){return ue},protocol:bD},Symbol.toStringTag,{value:"Module"}));function wn(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const TD=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class yk extends ze{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=[wn(t,"open",this.onopen.bind(this)),wn(t,"packet",this.onpacket.bind(this)),wn(t,"error",this.onerror.bind(this)),wn(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(TD.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:ue.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:ue.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 ue.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 ue.EVENT:case ue.BINARY_EVENT:this.onevent(t);break;case ue.ACK:case ue.BINARY_ACK:this.onack(t);break;case ue.DISCONNECT:this.ondisconnect();break;case ue.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:ue.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:ue.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 To(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}To.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};To.prototype.reset=function(){this.attempts=0};To.prototype.setMin=function(e){this.ms=e};To.prototype.setMax=function(e){this.max=e};To.prototype.setJitter=function(e){this.jitter=e};class zp extends ze{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,_c(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 To({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||CD;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 fD(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=wn(n,"open",function(){r.onopen(),t&&t()}),s=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},o=wn(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(wn(t,"ping",this.onping.bind(this)),wn(t,"data",this.ondata.bind(this)),wn(t,"error",this.onerror.bind(this)),wn(t,"close",this.onclose.bind(this)),wn(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){Ec(()=>{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 yk(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 Io={};function au(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=pD(e,t.path||"/socket.io"),r=n.source,i=n.id,s=n.path,o=Io[i]&&s in Io[i].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let l;return a?l=new zp(r,t):(Io[i]||(Io[i]=new zp(r,t)),l=Io[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(au,{Manager:zp,Socket:yk,io:au,connect:au});const lu=e=>{const t=document.cookie.split(";").find(n=>n.includes(e));return t?t.split("=")[1]:null};var Qn=(e=>(e.CustomerToken="lc:customer:token",e.CustomerRefreshToken="lc:customer:refresh_token",e.DeviceId="lc:device:id",e))(Qn||{});const Hd=(e,t,n)=>{let r=e;["lc:customer:token","lc:customer:refresh_token"].includes(e)&&(r=`${n}:${e}`),localStorage.setItem(r,t)},uu=(e,t)=>{let n=e;return["lc:customer:token","lc:customer:refresh_token"].includes(e)&&(n=`${t}:${e}`),localStorage.getItem(n)},Vp=e=>{localStorage.removeItem(`${e}:lc:customer:token`),localStorage.removeItem(`${e}:lc:customer:refresh_token`)},xk=v.createContext(null),ci=()=>{const e=v.useContext(xk);if(!e)throw new Error("useWebsocket must be used within a WebSocketProvider");return e},ED=({children:e})=>{const{widget:t,isHaveChat:n}=kt(),r=v.useRef(null),i=v.useRef(!1),[s,o]=v.useState(!1),a=v.useCallback(()=>{r.current&&(console.log("WS: Cleaning up existing socket."),r.current.removeAllListeners(),r.current.disconnect(),r.current=null),o(!1),i.current=!1},[]),l=v.useCallback(x=>{if(i.current||r.current&&r.current.connected){console.log("WS: Connect called but already connecting or connected.");return}if(!n){console.log("WS: Connect skipped - no active chat");return}const g=uu(Qn.CustomerToken,x)||lu("customer_token"),w=uu(Qn.CustomerRefreshToken,x)||lu("customer_refresh_token");if(!g||!w){console.log("WS: Connect skipped - missing required tokens");return}r.current&&a(),console.log("WS: Attempting to connect..."),i.current=!0;const b=au(D_,{transports:["websocket"],forceNew:!0,timeout:1e4,auth:{customer_token:g,device_id:uu(Qn.DeviceId,x)||lu("device_id"),customer_refresh_token:w}});b.removeAllListeners(),b.on("error",k=>{console.error("WS: Websocket error",k),i.current=!1}),b.on("connect_error",k=>{console.error("WS: Connect error",k),i.current=!1,o(!1),r.current=null}),b.on("disconnect",k=>{console.log("WS: Disconnected",k),o(!1),i.current=!1,r.current===b&&(r.current=null)}),b.on("connect",()=>{console.log("WS: Connected successfully"),r.current=b,o(!0),i.current=!1})},[a,n]);v.useEffect(()=>{const x=t==null?void 0:t.link_id;return x&&n?(console.log("WS: Auto-connecting due to linkId and isHaveChat"),l(x)):(console.log("WS: Auto-disconnect due to missing linkId or isHaveChat"),a()),()=>{console.log("WS: Cleanup on effect change"),a()}},[t==null?void 0:t.link_id,n]);const c=v.useCallback(()=>{const x=t==null?void 0:t.link_id;x?l(x):console.warn("WS: Manual connect failed, no link_id available.")},[t==null?void 0:t.link_id,l]),d=v.useCallback(()=>{console.log("WS: Reconnecting..."),a();const x=t==null?void 0:t.link_id;x&&l(x)},[t==null?void 0:t.link_id,l,a]),u=v.useCallback(()=>{console.log("WS: Manual disconnect"),a()},[a]),f=v.useCallback((x,g)=>{var w;(w=r.current)==null||w.on(x,g)},[]),p=v.useCallback((x,g)=>{var w;(w=r.current)==null||w.off(x,g)},[]),h=v.useCallback((x,g,w)=>{r.current&&r.current.connected?r.current.emit(x,g,w):console.warn(`WS: Cannot emit event '${x}', socket not connected.`)},[]),m=v.useMemo(()=>({connected:s,connect:c,reconnect:d,disconnect:u,on:f,off:p,emit:h}),[s,c,d,u,f,p,h]);return y.jsx(xk.Provider,{value:m,children:e})};var En=(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))(En||{}),st=(e=>(e.MessageAgentCreate="message:agent: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))(st||{});const Pc=e=>{const t=Sb(),n=(r,i)=>{var o;const s=((o=rB.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}},_D=e=>({accessToken:localStorage.getItem(`${e}:${Qn.CustomerToken}`)||"",refreshToken:localStorage.getItem(`${e}:${Qn.CustomerRefreshToken}`)||""}),sl=()=>{const{widget:e}=kt();return e?_D(e.link_id):null},ho=e=>{if(!e)return{};const{accessToken:t,refreshToken:n}=e,r={};return t&&(r["X-Customer-Token"]=t),n&&(r["X-Customer-Refresh-Token"]=n),{...r}};function PD(e){return e&&typeof e=="object"&&"customer_token"in e&&"customer_refresh_token"in e}const jD=()=>am({mutationFn:e=>bo(`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})})}),RD=(e,t)=>bo(`clients/${e}/chats`,{headers:t}),Up=(e,t)=>bo(`clients/${e}/chats`,{method:"DELETE",headers:t}),AD=(e,t,n)=>bo("review",{method:"POST",body:JSON.stringify({rating:e,comment:t||void 0}),headers:{...n,"X-Device-Id":uu(Qn.DeviceId,"")||""}}),OD=()=>{const e=sl();return am({mutationFn:t=>AD(t.rating,t.comment,ho(e))})},DD=e=>{const t=sl();return am({mutationFn:n=>bo(`clients/${e}/chats/files`,{method:"POST",headers:ho(t),body:L_({files:n},{arrayWithBracketAndIndex:!1,arrayWithBrackets:!1})})})};function FD(e){return e&&typeof e=="object"&&"file_urls"in e}const Km=(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])},ss=()=>{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},Xm=()=>{let e=!1;return typeof window<"u"&&(e=new URLSearchParams(window.location.search).get("fullscreen")==="true"),e};function Hp({text:e}){var c,d,u,f;const{widget:t,isHaveChat:n,isTooltipVisible:r,setIsTooltipVisible:i,onTooltipClose:s}=kt(),o=Oe(),a=il(),l=()=>{i(!1),s&&s()};return r?y.jsxs(ve.div,{initial:{opacity:0,scale:.8,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.8,y:10},transition:{type:"spring",damping:20,stiffness:300},className:ge("absolute bottom-full mb-3 p-3 shadow-lg whitespace-nowrap","w-auto right-0"),style:{borderRadius:o.getRadius(),backgroundColor:o.getColor(C.TooltipBackground),color:o.getColor(C.TooltipText)},children:[y.jsx("button",{onClick:l,className:"absolute top-2 right-2 p-1 rounded-full hover:bg-black/10 transition-colors","aria-label":a(Y.CloseButtonAria),children:y.jsx(fe.X,{className:"size-3"})}),y.jsx(ve.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.1,duration:.3},className:"text-sm font-medium pr-5",style:{color:o.getColor(C.TooltipText)},children:e||(n?(d=(c=t==null?void 0:t.appearance)==null?void 0:c.design)==null?void 0:d.tooltip_message_active:(f=(u=t==null?void 0:t.appearance)==null?void 0:u.design)==null?void 0:f.tooltip_message)||a(n?Y.TooltipActive:Y.TooltipDefault)}),y.jsx("div",{className:ge("absolute bottom-0 right-4 w-3 h-3 transform rotate-45 translate-y-1.5 bg-blue-100")})]},"widget-tooltip"):null}const MD="/notify.mp3",ND=async e=>{await new Audio(e||MD).play()};function T0({fallback:e,fallbackOpen:t}){const[n]=v.useState(window.document.title),r=ci(),{isHaveChat:i,open:s,soundPath:o}=kt(),[a,l]=v.useState(!0),[c,d]=v.useState(0),[u,f]=v.useState(null),p=il(),h=()=>{ND(o)},m=(x,g)=>{if(u&&clearInterval(u),x||!i||g===0||Number.isNaN(g)){window.document.title=n,f(null);return}const w=setInterval(()=>{if(x||!i||g===0||Number.isNaN(g)){window.document.title=n,clearInterval(w),f(null);return}const b=`${g} ${p(Y.NewMessagesNotification)} - ${n}`;window.document.title!==b?window.document.title=b:window.document.title=n},1e3);return f(w),()=>{clearInterval(w),f(null)}};return v.useEffect(()=>m(s&&a,c),[c,s,a]),v.useEffect(()=>{const x=()=>{l(document.visibilityState==="visible")};return document.addEventListener("visibilitychange",x,!1),()=>{document.removeEventListener("visibilitychange",x)}},[]),v.useEffect(()=>{if(i&&s&&a&&d(0),!r||!i||s&&a)return;const x=()=>{!i||s&&a||(d(g=>g+1),h())};return r.on(st.MessageAgentCreate,x),r.on(st.ChatUserAssignee,h),()=>{r.off(st.MessageAgentCreate,x),r.off(st.ChatUserAssignee,h)}},[r,i,s,a]),s?null:!i||c===0?t?e:null:y.jsx(Hp,{text:p(Y.NewMessagesNotification)})}function LD({children:e,border:t}){var B,V,K,ee;const n=ci(),{open:r,setOpen:i,setIsHaveChat:s,isHaveChat:o,widget:a,onOpen:l,onClose:c}=kt(),[d]=v.useState(!0),u=Pc(),f=sl(),p=Ja(),h=Oe(),m=ss(),x=Xm(),[g,w]=v.useState({x:0,y:0}),b=E3(),k=v.useRef(null),T=v.useRef(null),[E,_]=v.useState(!1);v.useEffect(()=>((()=>{_("ontouchstart"in window||navigator.maxTouchPoints>0)})(),window.addEventListener("touchstart",()=>{_(!0)},{once:!0}),()=>{window.removeEventListener("touchstart",()=>{_(!0)})}),[]),v.useEffect(()=>{o&&p.pathname==="/"&&f&&f.accessToken&&u.push("chat")},[o]);const P=ne=>{if(!k.current||!T.current)return ne;const O=k.current.getBoundingClientRect(),$={width:window.innerWidth,height:window.innerHeight},H={top:20,right:20,bottom:40,left:20};let q=ne.x,Q=ne.y;return O.right+q-g.x>$.width-H.right&&(q=$.width-H.right-O.width-(O.left-g.x)),O.left+q-g.x<H.left&&(q=H.left-(O.left-g.x)),O.bottom+Q-g.y>$.height-H.bottom&&(Q=$.height-H.bottom-O.height-(O.top-g.y)),O.top+Q-g.y<H.top&&(Q=H.top-(O.top-g.y)),{x:q,y:Q}},M=()=>{i(!0),n&&(n.emit(En.WidgetOpen,{}),l&&l())},N=()=>{i(!1),n&&(n.emit(En.WidgetClose,{}),c&&c())},R=()=>{i(!1),s(!1),Up(a.client_id,ho(f)),u.push("registration")};v.useEffect(()=>{if(m&&(o||x)&&M(),!(!n||!a))return n.on(st.Banned,R),()=>{n.off(st.Banned,R)}},[]);function F(ne){E&&b.start(ne)}return y.jsx("section",{className:"relative w-full h-full",ref:T,children:y.jsxs(Xr,{children:[r&&y.jsx(ve.div,{initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},transition:{type:"spring",damping:25,stiffness:300,duration:.3},style:{width:m?"100%":((V=(B=a==null?void 0:a.appearance)==null?void 0:B.design)==null?void 0:V.width)||"21rem",height:m?"var(--app-height, 100dvh)":((ee=(K=a==null?void 0:a.appearance)==null?void 0:K.design)==null?void 0:ee.height)||"30rem",left:m?"0":"",right:m?"0px !important":"",maxHeight:m?"var(--app-height, 100dvh)":"",boxShadow:m?"":`0 10px 25px -5px ${h.getColor(C.ShadowColor)}, 0 8px 10px -6px ${h.getColor(C.ShadowColor)}`},className:ge("fixed z-300 overflow-hidden",{"border border-solid dark:border-zink-500 ":t,"bottom-12 right-12 rounded-t-xl":!m,"!bottom-0 !right-0":m}),children:e},"widget-container"),!E&&y.jsxs("div",{className:"fixed bottom-[40px] right-[20px] z-400",children:[y.jsx(T0,{fallback:y.jsx(Hp,{}),fallbackOpen:d}),y.jsxs(Xr,{mode:"wait",children:[!r&&y.jsxs(on,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"lg",rounded:!0,className:"relative",onClick:M,children:[y.jsx(ve.span,{initial:{scale:.8,opacity:0},animate:{scale:[1,1.2,1],opacity:[.7,0,.7]},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,repeatType:"loop"},className:ge("absolute -z-10 w-full h-full rounded-full opacity-30"),style:{backgroundColor:h.getColor(C.ButtonBackground)}}),y.jsx(fe.Chat,{className:"size-7"})]},"desktop-open-button"),r&&!m&&y.jsx(on,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"lg",rounded:!0,onClick:N,children:y.jsx(fe.X,{className:"size-7"})},"desktop-close-button")]})]}),E&&y.jsx(ve.div,{ref:k,className:"fixed z-400 bottom-24 right-5",initial:{bottom:"96px",right:"20px"},animate:{x:g.x,y:g.y},drag:E,dragControls:b,dragMomentum:!1,dragElastic:0,onDragEnd:(ne,O)=>{const $={x:g.x+O.offset.x,y:g.y+O.offset.y},H=P($);w(H)},children:y.jsxs(Xr,{children:[y.jsx(T0,{fallback:y.jsx(Hp,{}),fallbackOpen:d}),!r&&y.jsx("div",{className:"cursor-move",onPointerDown:F,children:y.jsxs(on,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"lg",rounded:!0,className:"relative",onClick:M,children:[y.jsx(ve.span,{initial:{scale:.8,opacity:0},animate:{scale:[1,1.2,1],opacity:[.7,0,.7]},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,repeatType:"loop"},className:ge("absolute -z-10 w-full h-full rounded-full opacity-30"),style:{backgroundColor:h.getColor(C.ButtonBackground)}}),y.jsx(fe.Chat,{className:"size-7"})]})},"chat-button"),r&&!m&&y.jsx(on,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"lg",rounded:!0,onClick:N,children:y.jsx(fe.X,{className:"size-7"})},"desktop-close-button")]})})]})})}function wk(e){const{widget:t}=kt();return y.jsx(O3,{widget:t,children:y.jsx(LD,{...e})})}function os(e){this._maxSize=e,this.clear()}os.prototype.clear=function(){this._size=0,this._values=Object.create(null)};os.prototype.get=function(e){return this._values[e]};os.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var ID=/[^.^\]^[]+|(?=\[\]|\.\.)/g,bk=/^\d+$/,$D=/^\d/,BD=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,zD=/^\s*(['"]?)(.*?)(\1)\s*$/,Zm=512,E0=new os(Zm),_0=new os(Zm),P0=new os(Zm),Vi={Cache:os,split:Wp,normalizePath:Wd,setter:function(e){var t=Wd(e);return _0.get(e)||_0.set(e,function(r,i){for(var s=0,o=t.length,a=r;s<o-1;){var l=t[s];if(l==="__proto__"||l==="constructor"||l==="prototype")return r;a=a[t[s++]]}a[t[s]]=i})},getter:function(e,t){var n=Wd(e);return P0.get(e)||P0.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+(Jm(n)||bk.test(n)?"["+n+"]":(t?".":"")+n)},"")},forEach:function(e,t,n){VD(Array.isArray(e)?e:Wp(e),t,n)}};function Wd(e){return E0.get(e)||E0.set(e,Wp(e).map(function(t){return t.replace(zD,"$2")}))}function Wp(e){return e.match(ID)||[""]}function VD(e,t,n){var r=e.length,i,s,o,a;for(s=0;s<r;s++)i=e[s],i&&(WD(i)&&(i='"'+i+'"'),a=Jm(i),o=!a&&/^\d+$/.test(i),t.call(n,i,a,o,s,e))}function Jm(e){return typeof e=="string"&&e&&["'",'"'].indexOf(e.charAt(0))!==-1}function UD(e){return e.match($D)&&!e.match(bk)}function HD(e){return BD.test(e)}function WD(e){return!Jm(e)&&(UD(e)||HD(e))}const qD=/[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,jc=e=>e.match(qD)||[],Rc=e=>e[0].toUpperCase()+e.slice(1),eg=(e,t)=>jc(e).join(t).toLowerCase(),Sk=e=>jc(e).reduce((t,n)=>`${t}${t?n[0].toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()}`,""),GD=e=>Rc(Sk(e)),QD=e=>eg(e,"_"),YD=e=>eg(e,"-"),KD=e=>Rc(eg(e," ")),XD=e=>jc(e).map(Rc).join(" ");var qd={words:jc,upperFirst:Rc,camelCase:Sk,pascalCase:GD,snakeCase:QD,kebabCase:YD,sentenceCase:KD,titleCase:XD},tg={exports:{}};tg.exports=function(e){return kk(ZD(e),e)};tg.exports.array=kk;function kk(e,t){var n=e.length,r=new Array(n),i={},s=n,o=JD(t),a=eF(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 f;try{f=", node was:"+JSON.stringify(c)}catch{f=""}throw new Error("Cyclic dependency"+f)}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 p=o.get(c)||new Set;if(p=Array.from(p),d=p.length){u.add(c);do{var h=p[--d];l(h,a.get(h),u)}while(d);u.delete(c)}r[--n]=c}}}function ZD(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 JD(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 eF(e){for(var t=new Map,n=0,r=e.length;n<r;n++)t.set(e[n],n);return t}var tF=tg.exports;const nF=Zi(tF),rF=Object.prototype.toString,iF=Error.prototype.toString,sF=RegExp.prototype.toString,oF=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",aF=/^Symbol\((.*)\)(.*)$/;function lF(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function j0(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const n=typeof e;if(n==="number")return lF(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return oF.call(e).replace(aF,"Symbol($1)");const r=rF.call(e).slice(8,-1);return r==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):r==="Error"||e instanceof Error?"["+iF.call(e)+"]":r==="RegExp"?sF.call(e):null}function Jr(e,t){let n=j0(e,t);return n!==null?n:JSON.stringify(e,function(r,i){let s=j0(this[r],t);return s!==null?s:i},2)}function Ck(e){return e==null?[]:[].concat(e)}let Tk,Ek,_k,uF=/\$\{\s*(\w+)\s*\}/g;Tk=Symbol.toStringTag;class R0{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[Tk]="Error",this.name="ValidationError",this.value=n,this.path=r,this.type=i,this.errors=[],this.inner=[],Ck(t).forEach(s=>{if(Rt.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]}}Ek=Symbol.hasInstance;_k=Symbol.toStringTag;class Rt 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(uF,(i,s)=>Jr(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 R0(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[_k]="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,Rt)}static[Ek](t){return R0[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let Fn={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 \`${Jr(r,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${Jr(n,!0)}\``+i:`${e} must match the configured type. The validated value was: \`${Jr(n,!0)}\``+i}},Tt={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"},cF={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"},qp={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},dF={isValue:"${path} field must be ${value}"},cu={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},fF={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"},pF={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: \`${Jr(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: \`${Jr(n,!0)}\``}return Rt.formatError(Fn.notType,e)}};Object.assign(Object.create(null),{mixed:Fn,string:Tt,number:cF,date:qp,object:cu,array:fF,boolean:dF,tuple:pF});const ng=e=>e&&e.__isYupSchema__;class Qu{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 Qu(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(!ng(i))throw new TypeError("conditions must return a schema object");return i.resolve(n)}}const Nl={context:"$",value:"."};class as{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]===Nl.context,this.isValue=this.key[0]===Nl.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?Nl.context:this.isValue?Nl.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&Vi.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}}as.prototype.__isYupRef=!0;const Ri=e=>e==null;function vs(e){function t({value:n,path:r="",options:i,originalValue:s,schema:o},a,l){const{name:c,test:d,params:u,message:f,skipAbsent:p}=e;let{parent:h,context:m,abortEarly:x=o.spec.abortEarly,disableStackTrace:g=o.spec.disableStackTrace}=i;function w(R){return as.isRef(R)?R.getValue(n,h,m):R}function b(R={}){const F=Object.assign({value:n,originalValue:s,label:o.spec.label,path:R.path||r,spec:o.spec,disableStackTrace:R.disableStackTrace||g},u,R.params);for(const V of Object.keys(F))F[V]=w(F[V]);const B=new Rt(Rt.formatError(R.message||f,F),n,F.path,R.type||c,F.disableStackTrace);return B.params=F,B}const k=x?a:l;let T={path:r,parent:h,type:c,from:i.from,createError:b,resolve:w,options:i,originalValue:s,schema:o};const E=R=>{Rt.isError(R)?k(R):R?l(null):k(b())},_=R=>{Rt.isError(R)?k(R):a(R)};if(p&&Ri(n))return E(!0);let M;try{var N;if(M=d.call(T,n,T),typeof((N=M)==null?void 0:N.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(M).then(E,_)}}catch(R){_(R);return}E(M)}return t.OPTIONS=e,t}function hF(e,t,n,r=n){let i,s,o;return t?(Vi.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",f=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&&f>=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[f],e=u?e.spec.types[f]: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 Yu extends Set{describe(){const t=[];for(const n of this.values())t.push(as.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 Yu(this.values())}merge(t,n){const r=this.clone();return t.forEach(i=>r.add(i)),n.forEach(i=>r.delete(i)),r}}function Ns(e,t=new Map){if(ng(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]=Ns(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,Ns(i,t))}else if(e instanceof Set){n=new Set,t.set(e,n);for(const r of e)n.add(Ns(r,t))}else if(e instanceof Object){n={},t.set(e,n);for(const[r,i]of Object.entries(e))n[r]=Ns(i,t)}else throw Error(`Unable to clone ${e}`);return n}class Kn{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 Yu,this._blacklist=new Yu,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Fn.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=Ns(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&&Ri(s))return s;let o=Jr(t),a=Jr(s);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}".
|
|
96
96
|
|
|
97
97
|
attempted value: ${o}
|
|
98
98
|
`+(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=m=>{i||(i=!0,n(m,o))},u=m=>{i||(i=!0,r(m,o))},f=s.length,p=[];if(!f)return u([]);let h={value:o,originalValue:a,path:l,options:c,schema:this};for(let m=0;m<s.length;m++){const x=s[m];x(h,d,function(w){w&&(Array.isArray(w)?p.push(...w):p.push(w)),--f<=0&&u(p)})}}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,f,p)=>this.resolve(d)._validate(c,d,f,p)}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)=>{Rt.isError(l)&&(l.value=c),a(l)},(l,c)=>{l.length?a(new Rt(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 Rt.isError(a)&&(a.value=l),a},(a,l)=>{if(a.length)throw new Rt(a,t,void 0,void 0,o);s=l}),s}isValid(t,n){return this.validate(t,n).then(()=>!0,r=>{if(Rt.isError(r))return!1;throw r})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(r){if(Rt.isError(r))return!1;throw r}}_getDefault(t){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,t):Ns(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=vs({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=vs({message:n,name:"optionality",test(i){return i===void 0?this.schema.spec.optional:!0}}),r}optional(){return this.optionality(!0)}defined(t=Fn.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=Fn.notNull){return this.nullability(!1,t)}required(t=Fn.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=Fn.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),i=vs(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=Ck(t).map(s=>new as(s));return i.forEach(s=>{s.isSibling&&r.deps.push(s.key)}),r.conditions.push(typeof n=="function"?new Qu(i,n):Qu.fromOptions(i,n)),r}typeError(t){let n=this.clone();return n.internalTests.typeError=vs({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=Fn.oneOf){let r=this.clone();return t.forEach(i=>{r._whitelist.add(i),r._blacklist.delete(i)}),r.internalTests.whiteList=vs({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=Fn.notOneOf){let r=this.clone();return t.forEach(i=>{r._blacklist.add(i),r._whitelist.delete(i)}),r.internalTests.blacklist=vs({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)}}}Kn.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])Kn.prototype[`${e}At`]=function(t,n,r={}){const{parent:i,parentPath:s,schema:o}=hF(this,t,n,r.context);return o[e](i&&i[s],Object.assign({},r,{parent:i,path:t}))};for(const e of["equals","is"])Kn.prototype[e]=Kn.prototype.oneOf;for(const e of["not","nope"])Kn.prototype[e]=Kn.prototype.notOneOf;const mF=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function gF(e){const t=Gp(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 Gp(e){var t,n;const r=mF.exec(e);return r?{year:Jn(r[1]),month:Jn(r[2],1)-1,day:Jn(r[3],1),hour:Jn(r[4]),minute:Jn(r[5]),second:Jn(r[6]),millisecond:r[7]?Jn(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:Jn(r[10]),minuteOffset:Jn(r[11])}:null}function Jn(e,t=0){return Number(e)||t}let vF=/^[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])?)*$/,yF=/^((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,xF=/^(?:[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,wF="^\\d{4}-\\d{2}-\\d{2}",bF="\\d{2}:\\d{2}:\\d{2}",SF="(([+-]\\d{2}(:?\\d{2})?)|Z)",kF=new RegExp(`${wF}T${bF}(\\.\\d+)?${SF}$`),CF=e=>Ri(e)||e===e.trim(),TF={}.toString();function Ku(){return new Pk}class Pk extends Kn{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===TF?t:i})})}required(t){return super.required(t).withMutation(n=>n.test({message:t||Fn.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=Tt.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=Tt.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=Tt.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||Tt.matches,params:{regex:t},skipAbsent:!0,test:o=>o===""&&r||o.search(t)!==-1})}email(t=Tt.email){return this.matches(vF,{name:"email",message:t,excludeEmptyString:!0})}url(t=Tt.url){return this.matches(yF,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=Tt.uuid){return this.matches(xF,{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(kF,{name:"datetime",message:n||Tt.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||Tt.datetime_offset,params:{allowOffset:r},skipAbsent:!0,test:s=>{if(!s||r)return!0;const o=Gp(s);return o?!!o.z:!1}}).test({name:"datetime_precision",message:n||Tt.datetime_precision,params:{precision:i},skipAbsent:!0,test:s=>{if(!s||i==null)return!0;const o=Gp(s);return o?o.precision===i:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=Tt.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:CF})}lowercase(t=Tt.lowercase){return this.transform(n=>Ri(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Ri(n)||n===n.toLowerCase()})}uppercase(t=Tt.uppercase){return this.transform(n=>Ri(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Ri(n)||n===n.toUpperCase()})}}Ku.prototype=Pk.prototype;let EF=new Date(""),_F=e=>Object.prototype.toString.call(e)==="[object Date]";class Ac extends Kn{constructor(){super({type:"date",check(t){return _F(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,n,r)=>!r.spec.coerce||r.isType(t)||t===null?t:(t=gF(t),isNaN(t)?Ac.INVALID_DATE:new Date(t)))})}prepareParam(t,n){let r;if(as.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=qp.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=qp.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)}})}}Ac.INVALID_DATE=EF;Ac.prototype;function PF(e,t=[]){let n=[],r=new Set,i=new Set(t.map(([o,a])=>`${o}-${a}`));function s(o,a){let l=Vi.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),as.isRef(a)&&a.isSibling?s(a.path,o):ng(a)&&"deps"in a&&a.deps.forEach(l=>s(l,o))}return nF.array(Array.from(r),n).reverse()}function A0(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 jk(e){return(t,n)=>A0(e,t)-A0(e,n)}const jF=(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 du(e){if("fields"in e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=du(r);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=du(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(du)}):"optional"in e?e.optional():e}const RF=(e,t)=>{const n=[...Vi.normalizePath(t)];if(n.length===1)return n[0]in e;let r=n.pop(),i=Vi.getter(Vi.join(n),!0)(e);return!!(i&&r in i)};let O0=e=>Object.prototype.toString.call(e)==="[object Object]";function D0(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(r=>n.indexOf(r)===-1)}const AF=jk([]);function rg(e){return new Rk(e)}class Rk extends Kn{constructor(t){super({type:"object",check(n){return O0(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=AF,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 f=s[u],p=u in i;if(f){let h,m=i[u];c.path=(n.path?`${n.path}.`:"")+u,f=f.resolve({value:m,context:n.context,parent:l});let x=f instanceof Kn?f.spec:void 0,g=x==null?void 0:x.strict;if(x!=null&&x.strip){d=d||u in i;continue}h=!n.__validating||!g?f.cast(i[u],c):i[u],h!==void 0&&(l[u]=h)}else p&&!o&&(l[u]=i[u]);(p!==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||!O0(c)){i(l,c);return}o=o||c;let d=[];for(let u of this._nodes){let f=this.fields[u];!f||as.isRef(f)||d.push(f.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=PF(t,n),r._sortErrors=jk(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 du(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=Vi.getter(t,!0);return this.transform(s=>{if(!s)return s;let o=s;return RF(s,t)&&(o=Object.assign({},s),r||delete o[t],o[n]=i(s)),o})}json(){return this.transform(jF)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||cu.exact,test(n){if(n==null)return!0;const r=D0(this.schema,n);return r.length===0||this.createError({params:{properties:r.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,n=cu.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=D0(this.schema,i);return!t||s.length===0||this.createError({params:{unknown:s.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,n=cu.noUnknown){return this.noUnknown(!t,n)}transformKeys(t){return this.transform(n=>{if(!n)return n;const r={};for(const i of Object.keys(n))r[t(i)]=n[i];return r})}camelCase(){return this.transformKeys(qd.camelCase)}snakeCase(){return this.transformKeys(qd.snakeCase)}constantCase(){return this.transformKeys(t=>qd.snakeCase(t).toUpperCase())}describe(t){const n=(t?this.resolve(t):this).clone(),r=super.describe(t);r.fields={};for(const[s,o]of Object.entries(n.fields)){var i;let a=t;(i=a)!=null&&i.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[s]})),r.fields[s]=o.describe(a)}return r}}rg.prototype=Rk.prototype;var OF=function(t){return DF(t)&&!FF(t)};function DF(e){return!!e&&typeof e=="object"}function FF(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||LF(e)}var MF=typeof Symbol=="function"&&Symbol.for,NF=MF?Symbol.for("react.element"):60103;function LF(e){return e.$$typeof===NF}function IF(e){return Array.isArray(e)?[]:{}}function Xu(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Ia(IF(e),e,t):e}function $F(e,t,n){return e.concat(t).map(function(r){return Xu(r,n)})}function BF(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(i){r[i]=Xu(e[i],n)}),Object.keys(t).forEach(function(i){!n.isMergeableObject(t[i])||!e[i]?r[i]=Xu(t[i],n):r[i]=Ia(e[i],t[i],n)}),r}function Ia(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||$F,n.isMergeableObject=n.isMergeableObject||OF;var r=Array.isArray(t),i=Array.isArray(e),s=r===i;return s?r?n.arrayMerge(e,t,n):BF(e,t,n):Xu(t,n)}Ia.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,i){return Ia(r,i,n)},{})};var Qp=Ia,Ak=typeof global=="object"&&global&&global.Object===Object&&global,zF=typeof self=="object"&&self&&self.Object===Object&&self,Xn=Ak||zF||Function("return this")(),si=Xn.Symbol,Ok=Object.prototype,VF=Ok.hasOwnProperty,UF=Ok.toString,$o=si?si.toStringTag:void 0;function HF(e){var t=VF.call(e,$o),n=e[$o];try{e[$o]=void 0;var r=!0}catch{}var i=UF.call(e);return r&&(t?e[$o]=n:delete e[$o]),i}var WF=Object.prototype,qF=WF.toString;function GF(e){return qF.call(e)}var QF="[object Null]",YF="[object Undefined]",F0=si?si.toStringTag:void 0;function ls(e){return e==null?e===void 0?YF:QF:F0&&F0 in Object(e)?HF(e):GF(e)}function Dk(e,t){return function(n){return e(t(n))}}var ig=Dk(Object.getPrototypeOf,Object);function us(e){return e!=null&&typeof e=="object"}var KF="[object Object]",XF=Function.prototype,ZF=Object.prototype,Fk=XF.toString,JF=ZF.hasOwnProperty,eM=Fk.call(Object);function M0(e){if(!us(e)||ls(e)!=KF)return!1;var t=ig(e);if(t===null)return!0;var n=JF.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Fk.call(n)==eM}function tM(){this.__data__=[],this.size=0}function Mk(e,t){return e===t||e!==e&&t!==t}function Oc(e,t){for(var n=e.length;n--;)if(Mk(e[n][0],t))return n;return-1}var nM=Array.prototype,rM=nM.splice;function iM(e){var t=this.__data__,n=Oc(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():rM.call(t,n,1),--this.size,!0}function sM(e){var t=this.__data__,n=Oc(t,e);return n<0?void 0:t[n][1]}function oM(e){return Oc(this.__data__,e)>-1}function aM(e,t){var n=this.__data__,r=Oc(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function gr(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])}}gr.prototype.clear=tM;gr.prototype.delete=iM;gr.prototype.get=sM;gr.prototype.has=oM;gr.prototype.set=aM;function lM(){this.__data__=new gr,this.size=0}function uM(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function cM(e){return this.__data__.get(e)}function dM(e){return this.__data__.has(e)}function ol(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var fM="[object AsyncFunction]",pM="[object Function]",hM="[object GeneratorFunction]",mM="[object Proxy]";function Nk(e){if(!ol(e))return!1;var t=ls(e);return t==pM||t==hM||t==fM||t==mM}var Gd=Xn["__core-js_shared__"],N0=function(){var e=/[^.]+$/.exec(Gd&&Gd.keys&&Gd.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function gM(e){return!!N0&&N0 in e}var vM=Function.prototype,yM=vM.toString;function cs(e){if(e!=null){try{return yM.call(e)}catch{}try{return e+""}catch{}}return""}var xM=/[\\^$.*+?()[\]{}|]/g,wM=/^\[object .+?Constructor\]$/,bM=Function.prototype,SM=Object.prototype,kM=bM.toString,CM=SM.hasOwnProperty,TM=RegExp("^"+kM.call(CM).replace(xM,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function EM(e){if(!ol(e)||gM(e))return!1;var t=Nk(e)?TM:wM;return t.test(cs(e))}function _M(e,t){return e==null?void 0:e[t]}function ds(e,t){var n=_M(e,t);return EM(n)?n:void 0}var $a=ds(Xn,"Map"),Ba=ds(Object,"create");function PM(){this.__data__=Ba?Ba(null):{},this.size=0}function jM(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var RM="__lodash_hash_undefined__",AM=Object.prototype,OM=AM.hasOwnProperty;function DM(e){var t=this.__data__;if(Ba){var n=t[e];return n===RM?void 0:n}return OM.call(t,e)?t[e]:void 0}var FM=Object.prototype,MM=FM.hasOwnProperty;function NM(e){var t=this.__data__;return Ba?t[e]!==void 0:MM.call(t,e)}var LM="__lodash_hash_undefined__";function IM(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ba&&t===void 0?LM:t,this}function Xi(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])}}Xi.prototype.clear=PM;Xi.prototype.delete=jM;Xi.prototype.get=DM;Xi.prototype.has=NM;Xi.prototype.set=IM;function $M(){this.size=0,this.__data__={hash:new Xi,map:new($a||gr),string:new Xi}}function BM(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Dc(e,t){var n=e.__data__;return BM(t)?n[typeof t=="string"?"string":"hash"]:n.map}function zM(e){var t=Dc(this,e).delete(e);return this.size-=t?1:0,t}function VM(e){return Dc(this,e).get(e)}function UM(e){return Dc(this,e).has(e)}function HM(e,t){var n=Dc(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function di(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])}}di.prototype.clear=$M;di.prototype.delete=zM;di.prototype.get=VM;di.prototype.has=UM;di.prototype.set=HM;var WM=200;function qM(e,t){var n=this.__data__;if(n instanceof gr){var r=n.__data__;if(!$a||r.length<WM-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new di(r)}return n.set(e,t),this.size=n.size,this}function Eo(e){var t=this.__data__=new gr(e);this.size=t.size}Eo.prototype.clear=lM;Eo.prototype.delete=uM;Eo.prototype.get=cM;Eo.prototype.has=dM;Eo.prototype.set=qM;function GM(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var L0=function(){try{var e=ds(Object,"defineProperty");return e({},"",{}),e}catch{}}();function Lk(e,t,n){t=="__proto__"&&L0?L0(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var QM=Object.prototype,YM=QM.hasOwnProperty;function Ik(e,t,n){var r=e[t];(!(YM.call(e,t)&&Mk(r,n))||n===void 0&&!(t in e))&&Lk(e,t,n)}function Fc(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?Lk(n,a,l):Ik(n,a,l)}return n}function KM(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var XM="[object Arguments]";function I0(e){return us(e)&&ls(e)==XM}var $k=Object.prototype,ZM=$k.hasOwnProperty,JM=$k.propertyIsEnumerable,eN=I0(function(){return arguments}())?I0:function(e){return us(e)&&ZM.call(e,"callee")&&!JM.call(e,"callee")},al=Array.isArray;function tN(){return!1}var Bk=typeof zt=="object"&&zt&&!zt.nodeType&&zt,$0=Bk&&typeof Vt=="object"&&Vt&&!Vt.nodeType&&Vt,nN=$0&&$0.exports===Bk,B0=nN?Xn.Buffer:void 0,rN=B0?B0.isBuffer:void 0,zk=rN||tN,iN=9007199254740991,sN=/^(?:0|[1-9]\d*)$/;function oN(e,t){var n=typeof e;return t=t??iN,!!t&&(n=="number"||n!="symbol"&&sN.test(e))&&e>-1&&e%1==0&&e<t}var aN=9007199254740991;function Vk(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=aN}var lN="[object Arguments]",uN="[object Array]",cN="[object Boolean]",dN="[object Date]",fN="[object Error]",pN="[object Function]",hN="[object Map]",mN="[object Number]",gN="[object Object]",vN="[object RegExp]",yN="[object Set]",xN="[object String]",wN="[object WeakMap]",bN="[object ArrayBuffer]",SN="[object DataView]",kN="[object Float32Array]",CN="[object Float64Array]",TN="[object Int8Array]",EN="[object Int16Array]",_N="[object Int32Array]",PN="[object Uint8Array]",jN="[object Uint8ClampedArray]",RN="[object Uint16Array]",AN="[object Uint32Array]",Ce={};Ce[kN]=Ce[CN]=Ce[TN]=Ce[EN]=Ce[_N]=Ce[PN]=Ce[jN]=Ce[RN]=Ce[AN]=!0;Ce[lN]=Ce[uN]=Ce[bN]=Ce[cN]=Ce[SN]=Ce[dN]=Ce[fN]=Ce[pN]=Ce[hN]=Ce[mN]=Ce[gN]=Ce[vN]=Ce[yN]=Ce[xN]=Ce[wN]=!1;function ON(e){return us(e)&&Vk(e.length)&&!!Ce[ls(e)]}function sg(e){return function(t){return e(t)}}var Uk=typeof zt=="object"&&zt&&!zt.nodeType&&zt,aa=Uk&&typeof Vt=="object"&&Vt&&!Vt.nodeType&&Vt,DN=aa&&aa.exports===Uk,Qd=DN&&Ak.process,mo=function(){try{var e=aa&&aa.require&&aa.require("util").types;return e||Qd&&Qd.binding&&Qd.binding("util")}catch{}}(),z0=mo&&mo.isTypedArray,FN=z0?sg(z0):ON,MN=Object.prototype,NN=MN.hasOwnProperty;function Hk(e,t){var n=al(e),r=!n&&eN(e),i=!n&&!r&&zk(e),s=!n&&!r&&!i&&FN(e),o=n||r||i||s,a=o?KM(e.length,String):[],l=a.length;for(var c in e)(t||NN.call(e,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||oN(c,l)))&&a.push(c);return a}var LN=Object.prototype;function og(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||LN;return e===n}var IN=Dk(Object.keys,Object),$N=Object.prototype,BN=$N.hasOwnProperty;function zN(e){if(!og(e))return IN(e);var t=[];for(var n in Object(e))BN.call(e,n)&&n!="constructor"&&t.push(n);return t}function Wk(e){return e!=null&&Vk(e.length)&&!Nk(e)}function ag(e){return Wk(e)?Hk(e):zN(e)}function VN(e,t){return e&&Fc(t,ag(t),e)}function UN(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var HN=Object.prototype,WN=HN.hasOwnProperty;function qN(e){if(!ol(e))return UN(e);var t=og(e),n=[];for(var r in e)r=="constructor"&&(t||!WN.call(e,r))||n.push(r);return n}function lg(e){return Wk(e)?Hk(e,!0):qN(e)}function GN(e,t){return e&&Fc(t,lg(t),e)}var qk=typeof zt=="object"&&zt&&!zt.nodeType&&zt,V0=qk&&typeof Vt=="object"&&Vt&&!Vt.nodeType&&Vt,QN=V0&&V0.exports===qk,U0=QN?Xn.Buffer:void 0,H0=U0?U0.allocUnsafe:void 0;function YN(e,t){if(t)return e.slice();var n=e.length,r=H0?H0(n):new e.constructor(n);return e.copy(r),r}function Gk(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}function KN(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 Qk(){return[]}var XN=Object.prototype,ZN=XN.propertyIsEnumerable,W0=Object.getOwnPropertySymbols,ug=W0?function(e){return e==null?[]:(e=Object(e),KN(W0(e),function(t){return ZN.call(e,t)}))}:Qk;function JN(e,t){return Fc(e,ug(e),t)}function Yk(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var e5=Object.getOwnPropertySymbols,Kk=e5?function(e){for(var t=[];e;)Yk(t,ug(e)),e=ig(e);return t}:Qk;function t5(e,t){return Fc(e,Kk(e),t)}function Xk(e,t,n){var r=t(e);return al(e)?r:Yk(r,n(e))}function n5(e){return Xk(e,ag,ug)}function r5(e){return Xk(e,lg,Kk)}var Yp=ds(Xn,"DataView"),Kp=ds(Xn,"Promise"),Xp=ds(Xn,"Set"),Zp=ds(Xn,"WeakMap"),q0="[object Map]",i5="[object Object]",G0="[object Promise]",Q0="[object Set]",Y0="[object WeakMap]",K0="[object DataView]",s5=cs(Yp),o5=cs($a),a5=cs(Kp),l5=cs(Xp),u5=cs(Zp),rr=ls;(Yp&&rr(new Yp(new ArrayBuffer(1)))!=K0||$a&&rr(new $a)!=q0||Kp&&rr(Kp.resolve())!=G0||Xp&&rr(new Xp)!=Q0||Zp&&rr(new Zp)!=Y0)&&(rr=function(e){var t=ls(e),n=t==i5?e.constructor:void 0,r=n?cs(n):"";if(r)switch(r){case s5:return K0;case o5:return q0;case a5:return G0;case l5:return Q0;case u5:return Y0}return t});var c5=Object.prototype,d5=c5.hasOwnProperty;function f5(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&d5.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var X0=Xn.Uint8Array;function cg(e){var t=new e.constructor(e.byteLength);return new X0(t).set(new X0(e)),t}function p5(e,t){var n=t?cg(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var h5=/\w*$/;function m5(e){var t=new e.constructor(e.source,h5.exec(e));return t.lastIndex=e.lastIndex,t}var Z0=si?si.prototype:void 0,J0=Z0?Z0.valueOf:void 0;function g5(e){return J0?Object(J0.call(e)):{}}function v5(e,t){var n=t?cg(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var y5="[object Boolean]",x5="[object Date]",w5="[object Map]",b5="[object Number]",S5="[object RegExp]",k5="[object Set]",C5="[object String]",T5="[object Symbol]",E5="[object ArrayBuffer]",_5="[object DataView]",P5="[object Float32Array]",j5="[object Float64Array]",R5="[object Int8Array]",A5="[object Int16Array]",O5="[object Int32Array]",D5="[object Uint8Array]",F5="[object Uint8ClampedArray]",M5="[object Uint16Array]",N5="[object Uint32Array]";function L5(e,t,n){var r=e.constructor;switch(t){case E5:return cg(e);case y5:case x5:return new r(+e);case _5:return p5(e,n);case P5:case j5:case R5:case A5:case O5:case D5:case F5:case M5:case N5:return v5(e,n);case w5:return new r;case b5:case C5:return new r(e);case S5:return m5(e);case k5:return new r;case T5:return g5(e)}}var ex=Object.create,I5=function(){function e(){}return function(t){if(!ol(t))return{};if(ex)return ex(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function $5(e){return typeof e.constructor=="function"&&!og(e)?I5(ig(e)):{}}var B5="[object Map]";function z5(e){return us(e)&&rr(e)==B5}var tx=mo&&mo.isMap,V5=tx?sg(tx):z5,U5="[object Set]";function H5(e){return us(e)&&rr(e)==U5}var nx=mo&&mo.isSet,W5=nx?sg(nx):H5,q5=1,G5=2,Q5=4,Zk="[object Arguments]",Y5="[object Array]",K5="[object Boolean]",X5="[object Date]",Z5="[object Error]",Jk="[object Function]",J5="[object GeneratorFunction]",e4="[object Map]",t4="[object Number]",eC="[object Object]",n4="[object RegExp]",r4="[object Set]",i4="[object String]",s4="[object Symbol]",o4="[object WeakMap]",a4="[object ArrayBuffer]",l4="[object DataView]",u4="[object Float32Array]",c4="[object Float64Array]",d4="[object Int8Array]",f4="[object Int16Array]",p4="[object Int32Array]",h4="[object Uint8Array]",m4="[object Uint8ClampedArray]",g4="[object Uint16Array]",v4="[object Uint32Array]",we={};we[Zk]=we[Y5]=we[a4]=we[l4]=we[K5]=we[X5]=we[u4]=we[c4]=we[d4]=we[f4]=we[p4]=we[e4]=we[t4]=we[eC]=we[n4]=we[r4]=we[i4]=we[s4]=we[h4]=we[m4]=we[g4]=we[v4]=!0;we[Z5]=we[Jk]=we[o4]=!1;function la(e,t,n,r,i,s){var o,a=t&q5,l=t&G5,c=t&Q5;if(o!==void 0)return o;if(!ol(e))return e;var d=al(e);if(d){if(o=f5(e),!a)return Gk(e,o)}else{var u=rr(e),f=u==Jk||u==J5;if(zk(e))return YN(e,a);if(u==eC||u==Zk||f&&!i){if(o=l||f?{}:$5(e),!a)return l?t5(e,GN(o,e)):JN(e,VN(o,e))}else{if(!we[u])return i?e:{};o=L5(e,u,a)}}s||(s=new Eo);var p=s.get(e);if(p)return p;s.set(e,o),W5(e)?e.forEach(function(x){o.add(la(x,t,n,x,e,s))}):V5(e)&&e.forEach(function(x,g){o.set(g,la(x,t,n,g,e,s))});var h=c?l?r5:n5:l?lg:ag,m=d?void 0:h(e);return GM(m||e,function(x,g){m&&(g=x,x=e[g]),Ik(o,g,la(x,t,n,g,e,s))}),o}var y4=1,x4=4;function Ll(e){return la(e,y4|x4)}var rx=Array.isArray,ix=Object.keys,w4=Object.prototype.hasOwnProperty,b4=typeof Element<"u";function Jp(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=rx(e),r=rx(t),i,s,o;if(n&&r){if(s=e.length,s!=t.length)return!1;for(i=s;i--!==0;)if(!Jp(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=ix(e);if(s=u.length,s!==ix(t).length)return!1;for(i=s;i--!==0;)if(!w4.call(t,u[i]))return!1;if(b4&&e instanceof Element&&t instanceof Element)return e===t;for(i=s;i--!==0;)if(o=u[i],!(o==="_owner"&&e.$$typeof)&&!Jp(e[o],t[o]))return!1;return!0}return e!==e&&t!==t}var S4=function(t,n){try{return Jp(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 bi=Zi(S4);var k4=4;function sx(e){return la(e,k4)}function tC(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var C4="[object Symbol]";function dg(e){return typeof e=="symbol"||us(e)&&ls(e)==C4}var T4="Expected a function";function fg(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(T4);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(fg.Cache||di),n}fg.Cache=di;var E4=500;function _4(e){var t=fg(e,function(r){return n.size===E4&&n.clear(),r}),n=t.cache;return t}var P4=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,j4=/\\(\\)?/g,R4=_4(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(P4,function(n,r,i,s){t.push(i?s.replace(j4,"$1"):r||n)}),t}),A4=1/0;function O4(e){if(typeof e=="string"||dg(e))return e;var t=e+"";return t=="0"&&1/e==-A4?"-0":t}var D4=1/0,ox=si?si.prototype:void 0,ax=ox?ox.toString:void 0;function nC(e){if(typeof e=="string")return e;if(al(e))return tC(e,nC)+"";if(dg(e))return ax?ax.call(e):"";var t=e+"";return t=="0"&&1/e==-D4?"-0":t}function F4(e){return e==null?"":nC(e)}function rC(e){return al(e)?tC(e,O4):dg(e)?[e]:Gk(R4(F4(e)))}var iC={exports:{}},me={};/** @license React v16.13.1
|
|
@@ -136,4 +136,4 @@ attempted value: ${o}
|
|
|
136
136
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d$(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function f$(e){if(Array.isArray(e))return sh(e)}function bx(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 Sx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bx(Object(n),!0).forEach(function(r){MC(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bx(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function MC(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function za(e,t){return m$(e)||h$(e,t)||NC(e,t)||p$()}function p$(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
137
137
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function NC(e,t){if(e){if(typeof e=="string")return sh(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 sh(e,t)}}function sh(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 h$(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 m$(e){if(Array.isArray(e))return e}var g$=typeof nf=="function"?nf:nf.default,v$="file-invalid-type",y$="file-too-large",x$="file-too-small",w$="too-many-files",b$=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=t.split(","),r=n.length>1?"one of ".concat(n.join(", ")):n[0];return{code:v$,message:"File type must be ".concat(r)}},kx=function(t){return{code:y$,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},Cx=function(t){return{code:x$,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},S$={code:w$,message:"Too many files"};function LC(e,t){var n=e.type==="application/x-moz-file"||g$(e,t);return[n,n?null:b$(t)]}function IC(e,t,n){if(Ci(e.size))if(Ci(t)&&Ci(n)){if(e.size>n)return[!1,kx(n)];if(e.size<t)return[!1,Cx(t)]}else{if(Ci(t)&&e.size<t)return[!1,Cx(t)];if(Ci(n)&&e.size>n)return[!1,kx(n)]}return[!0,null]}function Ci(e){return e!=null}function k$(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,s=e.multiple,o=e.maxFiles,a=e.validator;return!s&&t.length>1||s&&o>=1&&t.length>o?!1:t.every(function(l){var c=LC(l,n),d=za(c,1),u=d[0],f=IC(l,r,i),p=za(f,1),h=p[0],m=a?a(l):null;return u&&h&&!m})}function Ju(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function zl(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function Tx(e){e.preventDefault()}function C$(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function T$(e){return e.indexOf("Edge/")!==-1}function E$(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return C$(e)||T$(e)}function On(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];return t.some(function(a){return!Ju(r)&&a&&a.apply(void 0,[r].concat(s)),Ju(r)})}}function _$(){return"showOpenFilePicker"in window}function P$(e){if(Ci(e)){var t=Object.entries(e).filter(function(n){var r=za(n,2),i=r[0],s=r[1],o=!0;return $C(i)||(console.warn('Skipped "'.concat(i,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),o=!1),(!Array.isArray(s)||!s.every(BC))&&(console.warn('Skipped "'.concat(i,'" because an invalid file extension was provided.')),o=!1),o}).reduce(function(n,r){var i=za(r,2),s=i[0],o=i[1];return Sx(Sx({},n),{},MC({},s,o))},{});return[{description:"Files",accept:t}]}return e}function j$(e){if(Ci(e))return Object.entries(e).reduce(function(t,n){var r=za(n,2),i=r[0],s=r[1];return[].concat(wx(t),[i],wx(s))},[]).filter(function(t){return $C(t)||BC(t)}).join(",")}function R$(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function A$(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function $C(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function BC(e){return/^.*\.[\w]+$/.test(e)}var O$=["children"],D$=["open"],F$=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],M$=["refKey","onChange","onClick"];function N$(e){return $$(e)||I$(e)||zC(e)||L$()}function L$(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
138
138
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function I$(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function $$(e){if(Array.isArray(e))return oh(e)}function rf(e,t){return V$(e)||z$(e,t)||zC(e,t)||B$()}function B$(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
139
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zC(e,t){if(e){if(typeof e=="string")return oh(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 oh(e,t)}}function oh(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 z$(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 V$(e){if(Array.isArray(e))return e}function Ex(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ex(Object(n),!0).forEach(function(r){ah(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ex(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ah(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ec(e,t){if(e==null)return{};var n=U$(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 U$(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 ll=v.forwardRef(function(e,t){var n=e.children,r=ec(e,O$),i=H$(r),s=i.open,o=ec(i,D$);return v.useImperativeHandle(t,function(){return{open:s}},[s]),L.createElement(v.Fragment,null,n(_e(_e({},o),{},{open:s})))});ll.displayName="Dropzone";var VC={disabled:!1,getFilesFromEvent:t$,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};ll.defaultProps=VC;ll.propTypes={children:xe.func,accept:xe.objectOf(xe.arrayOf(xe.string)),multiple:xe.bool,preventDropOnDocument:xe.bool,noClick:xe.bool,noKeyboard:xe.bool,noDrag:xe.bool,noDragEventsBubbling:xe.bool,minSize:xe.number,maxSize:xe.number,maxFiles:xe.number,disabled:xe.bool,getFilesFromEvent:xe.func,onFileDialogCancel:xe.func,onFileDialogOpen:xe.func,useFsAccessApi:xe.bool,autoFocus:xe.bool,onDragEnter:xe.func,onDragLeave:xe.func,onDragOver:xe.func,onDrop:xe.func,onDropAccepted:xe.func,onDropRejected:xe.func,onError:xe.func,validator:xe.func};var lh={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function H$(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=_e(_e({},VC),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,f=t.onDrop,p=t.onDropAccepted,h=t.onDropRejected,m=t.onFileDialogCancel,x=t.onFileDialogOpen,g=t.useFsAccessApi,w=t.autoFocus,b=t.preventDropOnDocument,k=t.noClick,T=t.noKeyboard,E=t.noDrag,_=t.noDragEventsBubbling,P=t.onError,M=t.validator,N=v.useMemo(function(){return j$(n)},[n]),R=v.useMemo(function(){return P$(n)},[n]),F=v.useMemo(function(){return typeof x=="function"?x:_x},[x]),B=v.useMemo(function(){return typeof m=="function"?m:_x},[m]),V=v.useRef(null),K=v.useRef(null),ee=v.useReducer(W$,lh),ne=rf(ee,2),O=ne[0],$=ne[1],H=O.isFocused,q=O.isFileDialogActive,Q=v.useRef(typeof window<"u"&&window.isSecureContext&&g&&_$()),te=function(){!Q.current&&q&&setTimeout(function(){if(K.current){var D=K.current.files;D.length||($({type:"closeDialog"}),B())}},300)};v.useEffect(function(){return window.addEventListener("focus",te,!1),function(){window.removeEventListener("focus",te,!1)}},[K,q,B,Q]);var ce=v.useRef([]),ye=function(D){V.current&&V.current.contains(D.target)||(D.preventDefault(),ce.current=[])};v.useEffect(function(){return b&&(document.addEventListener("dragover",Tx,!1),document.addEventListener("drop",ye,!1)),function(){b&&(document.removeEventListener("dragover",Tx),document.removeEventListener("drop",ye))}},[V,b]),v.useEffect(function(){return!r&&w&&V.current&&V.current.focus(),function(){}},[V,w,r]);var re=v.useCallback(function(A){P?P(A):console.error(A)},[P]),Ne=v.useCallback(function(A){A.preventDefault(),A.persist(),xr(A),ce.current=[].concat(N$(ce.current),[A.target]),zl(A)&&Promise.resolve(i(A)).then(function(D){if(!(Ju(A)&&!_)){var G=D.length,Z=G>0&&k$({files:D,accept:N,minSize:o,maxSize:s,multiple:a,maxFiles:l,validator:M}),ae=G>0&&!Z;$({isDragAccept:Z,isDragReject:ae,isDragActive:!0,type:"setDraggedFiles"}),c&&c(A)}}).catch(function(D){return re(D)})},[i,c,re,_,N,o,s,a,l,M]),Je=v.useCallback(function(A){A.preventDefault(),A.persist(),xr(A);var D=zl(A);if(D&&A.dataTransfer)try{A.dataTransfer.dropEffect="copy"}catch{}return D&&u&&u(A),!1},[u,_]),et=v.useCallback(function(A){A.preventDefault(),A.persist(),xr(A);var D=ce.current.filter(function(Z){return V.current&&V.current.contains(Z)}),G=D.indexOf(A.target);G!==-1&&D.splice(G,1),ce.current=D,!(D.length>0)&&($({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),zl(A)&&d&&d(A))},[V,d,_]),Mt=v.useCallback(function(A,D){var G=[],Z=[];A.forEach(function(ae){var Ve=LC(ae,N),tt=rf(Ve,2),Pn=tt[0],Qt=tt[1],hs=IC(ae,o,s),Zn=rf(hs,2),wr=Zn[0],ms=Zn[1],Po=M?M(ae):null;if(Pn&&wr&&!Po)G.push(ae);else{var hi=[Qt,ms];Po&&(hi=hi.concat(Po)),Z.push({file:ae,errors:hi.filter(function(jn){return jn})})}}),(!a&&G.length>1||a&&l>=1&&G.length>l)&&(G.forEach(function(ae){Z.push({file:ae,errors:[S$]})}),G.splice(0)),$({acceptedFiles:G,fileRejections:Z,isDragReject:Z.length>0,type:"setFiles"}),f&&f(G,Z,D),Z.length>0&&h&&h(Z,D),G.length>0&&p&&p(G,D)},[$,a,N,o,s,l,f,p,h,M]),_n=v.useCallback(function(A){A.preventDefault(),A.persist(),xr(A),ce.current=[],zl(A)&&Promise.resolve(i(A)).then(function(D){Ju(A)&&!_||Mt(D,A)}).catch(function(D){return re(D)}),$({type:"reset"})},[i,Mt,re,_]),dn=v.useCallback(function(){if(Q.current){$({type:"openDialog"}),F();var A={multiple:a,types:R};window.showOpenFilePicker(A).then(function(D){return i(D)}).then(function(D){Mt(D,null),$({type:"closeDialog"})}).catch(function(D){R$(D)?(B(D),$({type:"closeDialog"})):A$(D)?(Q.current=!1,K.current?(K.current.value=null,K.current.click()):re(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."))):re(D)});return}K.current&&($({type:"openDialog"}),F(),K.current.value=null,K.current.click())},[$,F,B,g,Mt,re,R,a]),fi=v.useCallback(function(A){!V.current||!V.current.isEqualNode(A.target)||(A.key===" "||A.key==="Enter"||A.keyCode===32||A.keyCode===13)&&(A.preventDefault(),dn())},[V,dn]),vr=v.useCallback(function(){$({type:"focus"})},[]),ps=v.useCallback(function(){$({type:"blur"})},[]),pi=v.useCallback(function(){k||(E$()?setTimeout(dn,0):dn())},[k,dn]),Ct=function(D){return r?null:D},yr=function(D){return T?null:Ct(D)},Ge=function(D){return E?null:Ct(D)},xr=function(D){_&&D.stopPropagation()},_o=v.useMemo(function(){return function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},D=A.refKey,G=D===void 0?"ref":D,Z=A.role,ae=A.onKeyDown,Ve=A.onFocus,tt=A.onBlur,Pn=A.onClick,Qt=A.onDragEnter,hs=A.onDragOver,Zn=A.onDragLeave,wr=A.onDrop,ms=ec(A,F$);return _e(_e(ah({onKeyDown:yr(On(ae,fi)),onFocus:yr(On(Ve,vr)),onBlur:yr(On(tt,ps)),onClick:Ct(On(Pn,pi)),onDragEnter:Ge(On(Qt,Ne)),onDragOver:Ge(On(hs,Je)),onDragLeave:Ge(On(Zn,et)),onDrop:Ge(On(wr,_n)),role:typeof Z=="string"&&Z!==""?Z:"presentation"},G,V),!r&&!T?{tabIndex:0}:{}),ms)}},[V,fi,vr,ps,pi,Ne,Je,et,_n,T,E,r]),j=v.useCallback(function(A){A.stopPropagation()},[]),z=v.useMemo(function(){return function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},D=A.refKey,G=D===void 0?"ref":D,Z=A.onChange,ae=A.onClick,Ve=ec(A,M$),tt=ah({accept:N,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:Ct(On(Z,_n)),onClick:Ct(On(ae,j)),tabIndex:-1},G,K);return _e(_e({},tt),Ve)}},[K,n,a,_n,r]);return _e(_e({},O),{},{isFocused:H&&!r,getRootProps:_o,getInputProps:z,rootRef:V,inputRef:K,open:Ct(dn)})}function W$(e,t){switch(t.type){case"focus":return _e(_e({},e),{},{isFocused:!0});case"blur":return _e(_e({},e),{},{isFocused:!1});case"openDialog":return _e(_e({},lh),{},{isFileDialogActive:!0});case"closeDialog":return _e(_e({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return _e(_e({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return _e(_e({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return _e({},lh);default:return e}}function _x(){}const UC=5*1024*1024,vo={"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"]},Px=Object.values(vo).flat();function q$(e){var r;if(e.size>UC)return{isValid:!1,error:`Dosya boyutu 1MB'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(vo).includes(e.type)||Px.includes(t)?{isValid:!0,error:""}:{isValid:!1,error:`Desteklenmeyen dosya tipi. Kabul edilen tipler: ${Px.join(", ")}`}}function tc(e){for(const t of e){const n=q$(t);if(!n.isValid)return n}return{isValid:!0,error:""}}function HC({onDrop:e}){const t=n=>{const r=tc(n);if(!r.isValid){alert(r.error);return}e(n)};return y.jsx("div",{className:"flex items-center justify-center border rounded-md cursor-pointer bg-slate-100 dropzone border-slate-200 dz-clickable",children:y.jsx(ll,{onDrop:t,accept:Object.keys(vo).reduce((n,r)=>(n[r]=vo[r],n),{}),maxSize:UC,children:({getRootProps:n,getInputProps:r})=>y.jsxs("div",{className:"w-full py-5 text-lg text-center dz-message needsclick",...n(),children:[y.jsx("input",{...r()}),y.jsx("div",{className:"mb-3",children:y.jsx(jC,{className:"block size-12 mx-auto text-slate-500 fill-slate-200"})}),y.jsxs("h5",{className:"mb-0 font-normal text-slate-500 text-15",children:["Yüklemek istediğiniz görseli buraya sürükleyin veya"," ",y.jsx("span",{className:"text-custom-500",children:"seçmek için tıklayın"})]})]})})})}HC.Button=({onDrop:e})=>{const t=n=>{const r=tc(n);if(!r.isValid){Bn({description:r.error,variant:"error"});return}e(n)};return y.jsx(ll,{onDrop:t,accept:Object.keys(vo).reduce((n,r)=>(n[r]=vo[r],n),{}),children:({getRootProps:n,getInputProps:r})=>y.jsxs("div",{className:"w-12 h-12 rounded-lg flex items-center justify-center hover:bg-slate-100 text-center dz-message needsclick cursor-pointer",...n(),children:[y.jsx("input",{...r()}),y.jsx(jC,{className:"size-6 text-slate-500 fill-slate-200"})]})})};function G$({onNewMessage:e,client_id:t,is_uploadable:n,messages:r}){const i=v.useRef(null),s=ci(),o=DD(t),a=Oe(),l=il(),{setIsInputFocused:c}=kt(),[d,u]=v.useState(""),[f,p]=v.useState("3rem"),[h,m]=v.useState(!1),[x,g]=v.useState([]),[w,b]=v.useState(0),[k,T]=v.useState(!1),[E,_]=v.useState(0),[P,M]=v.useState(null);v.useEffect(()=>{if(r.length>0){const F=r[r.length-1];F.id!==P&&(M(F.id),F.sender_type===Le.User&&(b(0),T(!1)))}},[r,P]),v.useEffect(()=>{let F;return k&&E>0&&(F=window.setTimeout(()=>{_(B=>B<=1?(T(!1),b(0),0):B-1)},1e3)),()=>clearTimeout(F)},[k,E]),v.useEffect(()=>{const F=i.current;if(F){const B=()=>c(!0),V=()=>c(!1);return F.addEventListener("focus",B),F.addEventListener("blur",V),()=>{F.removeEventListener("focus",B),F.removeEventListener("blur",V)}}},[c]),Km("paste",F=>{const B=F.clipboardData.items,V=[];for(const K of B){const ee=K.getAsFile();ee&&V.push(ee)}if(V.length>0&&!n){Bn({description:l(Y.FileUploadDisabled),variant:"error"});return}if(V.length>0){const K=tc(V);if(!K.isValid){Bn({description:K.error,variant:"error"});return}g([...x,...V])}});const N=async()=>{if(!d.trim()&&(!n||x.length===0))return;if(w>5&&!k){T(!0),_(3);return}if(k)return;m(!0);let F;if(n&&x.length>0){const[B,V]=await o.mutateAsync(x);if(!Xa(V)){AL(B,V),m(!1);return}FD(B)&&(F=B.file_urls)}s==null||s.emit(En.MessageCreate,{content:d,files:F},B=>{u(""),e(B),m(!1),g([]),b(V=>V+1),i.current&&(i.current.style.height="3rem",p("3rem"))})},R=F=>{s==null||s.emit(En.MessageTyping,{content:F})};return y.jsxs(y.Fragment,{children:[k&&y.jsxs(ve.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:a.getColor(C.ErrorBackground),borderColor:a.getColor(C.ErrorBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:a.getRadius()},children:[y.jsx(fe.XCircle,{className:"size-4 mr-2",style:{color:a.getColor(C.ErrorText)}}),y.jsx("span",{className:"text-sm font-medium",style:{color:a.getColor(C.ErrorText)},children:l(Y.RateLimitMessage).replace("{seconds}",E.toString())})]}),y.jsxs("form",{className:"p-3 flex items-start gap-3 rounded-b-xl relative",style:{backgroundColor:a.getColor(C.FooterBackground),borderRadius:a.getRadius()},onSubmit:F=>{F.preventDefault(),N(),F.currentTarget.reset()},children:[n&&x&&x.length>0&&y.jsx("div",{className:"absolute bottom-18 w-full overflow-x-auto",children:y.jsx(_C,{files:x,onDelete:F=>{g(x.filter((B,V)=>V!==F))}})}),y.jsxs("div",{className:"grow relative",children:[y.jsx(yg,{id:"message",inputRef:i,className:"grow shadow-none",noMargin:!0,autoComplete:"off",style:{height:f,maxHeight:"6rem"},placeholder:l(Y.MessagePlaceholder),value:d,maxLength:2e3,onChange:F=>{const B=F.target.value;if(B.length<=2e3&&(u(B),R(B)),B.length>0&&F.currentTarget.scrollHeight>F.currentTarget.clientHeight){const V=`${F.currentTarget.scrollHeight}px`;F.currentTarget.style.height=V,p(V)}else F.currentTarget.style.height="3rem",p("3rem")},onKeyDown:F=>{F.key==="Enter"&&!F.shiftKey&&(F.preventDefault(),F.stopPropagation(),N())}}),d.length>=500&&y.jsx("div",{className:"absolute bottom-1 right-2 text-xs",style:{color:d.length>=2e3?a.getColor(C.ErrorText):a.getColor(C.FooterText),fontWeight:d.length>=2e3?"600":"normal"},children:2e3-d.length})]}),y.jsxs(ve.div,{whileTap:{scale:.95},className:"flex items-center gap-2 justify-center",children:[n&&y.jsx(HC.Button,{onDrop:F=>{if(F.length){const B=tc(F);if(!B.isValid){console.log("val",B),Bn({description:B.error,variant:"error"});return}g([...x,...F])}}}),y.jsx(on,{className:"rounded-full shadow-sm w-12 h-12 flex items-center justify-center",type:"submit",disabled:h||!d.trim()&&x.length===0||k,children:h?y.jsx(fe.Spin,{className:"size-6 animate-spin"}):k?y.jsx("span",{className:"text-xs font-bold",children:E}):y.jsx(fe.PaperAirplane,{className:"size-6 -rotate-12"})})]})]})]})}function Q$({chat:e,isTyping:t,shortcutMessages:n,messages:r,onNewMessage:i,onChatClose:s}){var w,b;const{widget:o,setOpen:a,open:l,isHaveChat:c,isInputFocused:d}=kt(),u=Oe(),f=ss(),p=Xm(),h=ci(),m=v.useRef(new Set),x=v.useRef(!1),g=v.useCallback(()=>{if(!h||!l||!c)return;const k=r.filter(T=>T.sender_type===Le.User&&!m.current.has(T.id)).map(T=>T.id);k.length!==0&&h.emit(En.MessageRead,{message_ids:k},T=>{if(T&&T.success===!0)for(const E of k)m.current.add(E)})},[h,r,l,c]);return v.useEffect(()=>{l&&(x.current=!0),l&&c&&(d||x.current)&&(g(),x.current=!1)},[l,c,d,g]),y.jsxs(y.Fragment,{children:[y.jsxs("header",{style:{backgroundColor:u.getColor(C.HeaderBackground),color:u.getColor(C.HeaderText),borderBottom:`1px solid ${u.getColor(C.HeaderBorder)}`,borderTopLeftRadius:f?"":u.getRadius(),borderTopRightRadius:f?"":u.getRadius()},className:"p-4 flex justify-between items-center z-10",children:[e!=null&&e.agent_name?y.jsx(nI,{name:e.agent_name,avatar:e.agent_avatar,textColor:u.getColor(C.HeaderText)}):y.jsx("div",{style:{color:u.getColor(C.HeaderText)},className:"font-medium",children:((b=(w=o==null?void 0:o.appearance)==null?void 0:w.design)==null?void 0:b.greeting_header)||"Bizimle Sohbet Edin"}),y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx(DI,{onChatClose:s}),!p&&!f&&y.jsx("button",{type:"button",style:{color:u.getColor(C.HeaderText)},onClick:()=>a(!1),children:y.jsx(fe.X,{className:"w-5 h-5 cursor-pointer"})})]})]}),y.jsx($I,{messages:r,isTyping:t||n.length>0}),y.jsx(G$,{client_id:(o==null?void 0:o.client_id)||"",is_uploadable:e.is_customer_uploadable,messages:r,onNewMessage:k=>{i(k)}}),y.jsxs("a",{href:"https://alfatekyazilim.com.tr",target:"_blank",rel:"noopener noreferrer",className:"py-1.5 px-3 text-xs text-center flex items-center justify-center gap-1 transition-colors",style:{color:u.getColor(C.FooterText),borderTop:`1px solid ${u.getColor(C.FooterBorder)}`,backgroundColor:u.getColor(C.FooterBackground)},children:[y.jsx("span",{children:"Powered by"}),y.jsx("span",{className:"font-medium",children:"Alfatek"}),y.jsx("img",{src:"https://alfatekyazilim.com.tr/images/favicon.png",alt:"Alfatek",className:"size-3.5 ml-0.5"})]})]})}function Y$({rating:e,onChange:t}){const n=Oe();return y.jsx("div",{className:"flex items-center justify-center gap-1 my-3",children:[1,2,3,4,5].map(r=>{const i=r<=e,s=!i&&r-.5<=e;return y.jsxs("div",{className:"relative w-10 h-10",children:[y.jsx("svg",{className:"w-10 h-10",style:{color:n.getColor(C.StarInactiveColor),fill:n.getColor(C.StarInactiveColor)},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1",children:y.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&&y.jsx("div",{className:"absolute top-0 left-0 w-5 h-10 overflow-hidden",children:y.jsx("svg",{className:"w-10 h-10",style:{color:n.getColor(C.StarActiveColor),fill:n.getColor(C.StarActiveColor)},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1",children:y.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&&y.jsx("svg",{className:"w-10 h-10 absolute top-0 left-0",style:{color:n.getColor(C.StarActiveColor),fill:n.getColor(C.StarActiveColor)},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1",children:y.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"})}),y.jsxs("div",{className:"absolute inset-0 flex",children:[y.jsx("button",{type:"button",onClick:()=>t(r-.5),className:"w-1/2 h-full cursor-pointer focus:outline-none","aria-label":`${r-.5} stars`}),y.jsx("button",{type:"button",onClick:()=>t(r),className:"w-1/2 h-full cursor-pointer focus:outline-none","aria-label":`${r} stars`})]})]},r)})})}function K$({onOk:e}){const t=Oe(),n=il(),[r,i]=v.useState(0),[s,o]=v.useState(!1),[a,l]=v.useState(10),c=OD(),[d,u]=v.useState(!1);v.useEffect(()=>{if(s){const m=setInterval(()=>{l(x=>x<=1?(clearInterval(m),e(!0),0):x-1)},1e3);return()=>clearInterval(m)}},[s]);const f=rg({comment:Ku()}),p=cC({init:{comment:""},schema:f,action:async m=>{const[x,g]=await c.mutateAsync({rating:r,comment:m.comment});if(Xa(g)){o(!0);return}fC(x,{form:p})}}),h=()=>{e(!0)};return y.jsxs("div",{className:"flex flex-col h-full",children:[y.jsxs("header",{style:{backgroundColor:s?t.getColor(C.RatingSuccessBackground):t.getColor(C.RatingHeaderBackground),color:s?t.getColor(C.RatingSuccessText):t.getColor(C.RatingHeaderText),borderBottom:`1px solid ${t.getColor(C.HeaderBorder)}`},className:"p-4 flex justify-between items-center z-10",children:[y.jsx("div",{className:"font-medium",children:n(s?Y.RatingHeaderThanks:Y.RatingHeaderEvaluate)}),y.jsx(on,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"sm",rounded:!0,onClick:()=>e(!1),className:"text-inherit cursor-pointer",children:y.jsx(fe.X,{className:"size-4"})})]}),y.jsx("div",{className:"flex-1 p-6 overflow-y-auto flex flex-col",children:s?y.jsxs(ve.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"flex flex-col items-center justify-center h-full text-center",children:[y.jsx("div",{className:"mb-4",style:{color:t.getColor(C.SuccessText)},children:y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-16 w-16",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),y.jsx("h2",{className:"text-xl font-semibold mb-2",style:{color:t.getColor(C.HeaderText)},children:n(Y.RatingThankYouTitle)}),y.jsx("p",{className:"mb-8",style:{color:t.getColor(C.FooterText)},children:n(Y.RatingThankYouDescription)}),y.jsx("p",{className:"mb-4",style:{color:t.getColor(C.FooterText)},children:n(Y.RatingCountdown).replace("{seconds}",a.toString())}),y.jsx(on,{onClick:h,className:"w-full max-w-xs rounded-lg py-2.5 font-medium transition-colors",style:{backgroundColor:t.getColor(C.ButtonBackground),color:t.getColor(C.ButtonText),borderRadius:t.getRadius()},children:n(Y.RatingNewConversation)})]}):y.jsxs(ve.div,{initial:{opacity:0},animate:{opacity:1},className:"flex flex-col",children:[y.jsx("div",{className:"text-center mb-6",children:y.jsx("p",{className:"text-base",style:{color:t.getColor(C.FooterText)},children:n(Y.RatingDescription)})}),y.jsxs("div",{className:"mb-6",children:[y.jsx("h3",{className:"text-center font-medium mb-2 text-lg",style:{color:t.getColor(C.RatingRateConversationText)},children:n(Y.RatingRateConversation)}),y.jsx(Y$,{rating:r,onChange:m=>{i(m),m>=1&&u(!1)}}),r>0&&y.jsx("p",{className:"text-center text-sm mt-1",style:{color:t.getColor(C.FooterText)},children:n(Y.RatingYourScore).replace("{score}",Number.isInteger(r)?r.toString():r.toFixed(1))}),r>0&&r<1||d?y.jsx("p",{className:"text-center text-sm mt-1",style:{color:t.getColor(C.ErrorText)},children:n(Y.RatingMinimumError)}):null]}),y.jsxs("form",{onSubmit:p.handleSubmit,className:"space-y-5",children:[y.jsxs("div",{children:[y.jsx("label",{htmlFor:"comment",className:"block text-sm font-medium mb-1",style:{color:t.getColor(C.InputText)},children:n(Y.RatingComment)}),y.jsx(yg,{id:"comment",onChange:p.handleChange,onBlur:p.handleBlur,value:p.values.comment,placeholder:n(Y.RatingCommentPlaceholder),className:"rounded-lg shadow-sm",style:{borderColor:t.getColor(C.InputBorder),backgroundColor:t.getColor(C.InputBackground),color:t.getColor(C.InputText),borderRadius:t.getRadius()},error:p.errors.comment})]}),y.jsxs("div",{className:"flex flex-col gap-3 pt-2",children:[y.jsx(on,{type:"submit",onClick:m=>{r<1&&(m.preventDefault(),m.stopPropagation(),u(!0))},className:"w-full rounded-lg py-2.5 font-medium transition-colors",style:{backgroundColor:t.getColor(C.ButtonBackground),color:t.getColor(C.ButtonText),borderRadius:t.getRadius()},children:n(Y.RatingSubmit)}),y.jsx(on,{onClick:h,className:"w-full rounded-lg py-2.5 font-medium transition-colors",style:{backgroundColor:t.getColor(C.GreeterBackground),color:t.getColor(C.GreeterText),borderRadius:t.getRadius()},children:n(Y.RatingNewConversation)})]})]})]})}),y.jsxs("a",{href:"https://alfatekyazilim.com.tr",target:"_blank",rel:"noopener noreferrer",className:"py-1.5 px-3 text-xs text-center flex items-center justify-center gap-1 transition-colors",style:{color:t.getColor(C.FooterText),borderTop:`1px solid ${t.getColor(C.FooterBorder)}`,backgroundColor:t.getColor(C.FooterBackground)},children:[y.jsx("span",{children:n(Y.PoweredBy)}),y.jsx("span",{className:"font-medium",children:"Alfatek"}),y.jsx("img",{src:"https://alfatekyazilim.com.tr/images/favicon.png",alt:"Alfatek",className:"size-3.5 ml-0.5"})]})]})}function X$({children:e}){const{widget:t}=kt();return t?y.jsx("section",{className:"h-full w-full relative",children:e}):null}function Z$({children:e}){const t=ci(),n=Pc();return v.useEffect(()=>{t&&t.connect()},[]),t?t.connected?e:(n.push("registration"),null):null}function J$(){const{widget:e,setOpen:t,setIsHaveChat:n}=kt(),r=Oe(),i=ci(),s=sl(),o=Pc(),a=ss(),[l,c]=v.useState(null),[d,u]=v.useState([]),[f,p]=v.useState(!1),[h,m]=v.useState([]),x=()=>{if(l){c({...l,status:ys.Closed});return}g()},g=b=>{b||t(!1),Vp((e==null?void 0:e.link_id)||""),n(!1),c(null),u([]),m([]),Up(e.client_id,ho(s)).then(()=>{i==null||i.disconnect(),o.push("registration")})};v.useEffect(()=>{i==null||i.emit(En.ChatView,{},b=>{if(b===null){t(!1),n(!1),Up(e.client_id,ho(s)),u([]),m([]),Vp((e==null?void 0:e.link_id)||""),o.push("registration");return}c(b),n(!0)})},[]);const w=v.useCallback(b=>{l&&![ys.Closed,ys.Deleted].includes(l.status)&&u([...d,b])},[d,l]);return v.useEffect(()=>{if(!i)return;const b=P=>{const M={content:P.content,created_at:P.created_at,files:P.files,id:P._id,sender_type:P.sender_type,answers:P.answers,reply_id:P.reply_id,buttons:P.buttons};if(h.length>0){m(N=>[...N,M]);return}P.is_shortcut?m([M]):w(M),p(!1)},k=P=>{c({...l,agent_name:P.name,agent_avatar:P.avatar,is_customer_uploadable:(l==null?void 0:l.is_customer_uploadable)??!1,status:(l==null?void 0:l.status)??ys.Open}),w({content:` _ _${P.name}`,created_at:new Date,files:[],id:Math.random().toString(),sender_type:Le.Activity,activity_type:ki.AdminJoin,sender_name:P.name})},T=()=>{p(!0)},E=()=>{x()},_=({is_customer_uploadable:P})=>{c(l?{...l,is_customer_uploadable:P}:null)};return i.on(st.MessageAgentCreate,b),i.on(st.ChatUserAssignee,k),i.on(st.MessageAgentTyping,T),i.on(st.ChatUserClose,E),i.on(st.ChatToggleUpload,_),()=>{i.off(st.MessageAgentCreate,b),i.off(st.ChatUserAssignee,k),i.off(st.MessageAgentTyping,T),i.off(st.ChatUserClose,E),i.off(st.ChatToggleUpload,_)}},[w]),v.useEffect(()=>{!i||!l||i.emit(En.MessageList,{},b=>{u(b)})},[i,l]),v.useEffect(()=>{const b=setTimeout(()=>{p(!1)},2e3);return()=>clearTimeout(b)},[f]),v.useEffect(()=>{if(!e||h.length===0)return;let b=0;e.writing_timeout&&(b=[...h[0].content].length/e.writing_timeout,b<0&&(b=0));const k=setTimeout(()=>{w(h[0]),m(h.slice(1))},b*1e3);return()=>clearTimeout(k)},[h,e]),l?y.jsxs(y.Fragment,{children:[y.jsx("div",{id:"chat-alert-portal"}),y.jsx(Xr,{children:y.jsx(ve.div,{initial:{opacity:0,scale:.98,y:5},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.98,y:5},transition:{type:"spring",damping:35,stiffness:400,duration:.2},className:`h-full w-full ${a?"":"rounded-xl"} shadow-sm flex flex-col overflow-hidden`,style:{height:a?"100%":"",minHeight:a?"var(--app-height, 100dvh)":"",maxHeight:a?"var(--app-height, 100dvh)":"",backgroundColor:r.getColor(C.Background)},children:l.status===ys.Closed?y.jsx(K$,{onOk:g}):y.jsx(Q$,{chat:l,isTyping:f,messages:d,shortcutMessages:h,onNewMessage:w,onChatClose:x})})})]}):null}function eB(){return KL(),null}function tB(){return y.jsxs(Z$,{children:[y.jsx(wk,{defaultOpen:!0,children:y.jsx(X$,{children:y.jsx(J$,{})})}),y.jsx(eB,{})]})}const nB=[{path:"/chat",component:tB,name:"chat"}],WC=[...nB],qC=[...tI],rB=[...WC,...qC];function iB(){return y.jsx(lP,{future:{v7_startTransition:!0},children:y.jsxs(cP,{children:[WC.map((e,t)=>y.jsx(pp,{path:e.path,element:y.jsx(e.component,{})},t)),qC.map((e,t)=>y.jsx(pp,{path:e.path,element:y.jsx(e.component,{})},t))]})})}const sB=v.forwardRef((e,t)=>{const{data:n,isLoading:r}=g2(e.link_id),{widget:i,setWidget:s,setSoundPath:o,setDefaultValues:a,setOpen:l,setOnTooltipClose:c,setIsTooltipVisible:d,setOnOpen:u,setOnClose:f,onOpen:p,onClose:h}=kt();return v.useImperativeHandle(t,()=>({open:()=>{l(!0),p&&p()},close:()=>{l(!1),h&&h()}})),v.useEffect(()=>{n&&Array.isArray(n)&&y2(n[0])&&s(n[0]),e.soundPath&&o(e.soundPath),e.defaultValues&&a(e.defaultValues),e.onTooltipClose&&c(e.onTooltipClose),e.showTooltip===!1&&d(!1),e.onOpen&&u(e.onOpen),e.onClose&&f(e.onClose)},[n,e.soundPath,e.defaultValues,e.onTooltipClose,e.showTooltip,e.onOpen,e.onClose]),r?y.jsx("div",{children:"Loading..."}):i?y.jsx(IL,{children:y.jsx(ED,{children:y.jsx(iB,{})})}):y.jsx("div",{children:"Widget not found"})}),oB=new Z_;let jx=null;function aB(e){if(!e.container)return;const t=L.createRef();return jx=Jw(e.container),jx.render(y.jsxs(r2,{client:oB,children:[y.jsx(sB,{...e,ref:t}),y.jsx(EL,{richColors:!0,style:{zIndex:999999,position:"fixed",bottom:"20px",right:"20px"},position:"bottom-right"})]})),{open:()=>{var n;return(n=t.current)==null?void 0:n.open()},close:()=>{var n;return(n=t.current)==null?void 0:n.close()}}}window.widget=aB});export default lB();
|
|
139
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zC(e,t){if(e){if(typeof e=="string")return oh(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 oh(e,t)}}function oh(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 z$(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 V$(e){if(Array.isArray(e))return e}function Ex(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ex(Object(n),!0).forEach(function(r){ah(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ex(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ah(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ec(e,t){if(e==null)return{};var n=U$(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 U$(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 ll=v.forwardRef(function(e,t){var n=e.children,r=ec(e,O$),i=H$(r),s=i.open,o=ec(i,D$);return v.useImperativeHandle(t,function(){return{open:s}},[s]),L.createElement(v.Fragment,null,n(_e(_e({},o),{},{open:s})))});ll.displayName="Dropzone";var VC={disabled:!1,getFilesFromEvent:t$,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};ll.defaultProps=VC;ll.propTypes={children:xe.func,accept:xe.objectOf(xe.arrayOf(xe.string)),multiple:xe.bool,preventDropOnDocument:xe.bool,noClick:xe.bool,noKeyboard:xe.bool,noDrag:xe.bool,noDragEventsBubbling:xe.bool,minSize:xe.number,maxSize:xe.number,maxFiles:xe.number,disabled:xe.bool,getFilesFromEvent:xe.func,onFileDialogCancel:xe.func,onFileDialogOpen:xe.func,useFsAccessApi:xe.bool,autoFocus:xe.bool,onDragEnter:xe.func,onDragLeave:xe.func,onDragOver:xe.func,onDrop:xe.func,onDropAccepted:xe.func,onDropRejected:xe.func,onError:xe.func,validator:xe.func};var lh={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function H$(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=_e(_e({},VC),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,f=t.onDrop,p=t.onDropAccepted,h=t.onDropRejected,m=t.onFileDialogCancel,x=t.onFileDialogOpen,g=t.useFsAccessApi,w=t.autoFocus,b=t.preventDropOnDocument,k=t.noClick,T=t.noKeyboard,E=t.noDrag,_=t.noDragEventsBubbling,P=t.onError,M=t.validator,N=v.useMemo(function(){return j$(n)},[n]),R=v.useMemo(function(){return P$(n)},[n]),F=v.useMemo(function(){return typeof x=="function"?x:_x},[x]),B=v.useMemo(function(){return typeof m=="function"?m:_x},[m]),V=v.useRef(null),K=v.useRef(null),ee=v.useReducer(W$,lh),ne=rf(ee,2),O=ne[0],$=ne[1],H=O.isFocused,q=O.isFileDialogActive,Q=v.useRef(typeof window<"u"&&window.isSecureContext&&g&&_$()),te=function(){!Q.current&&q&&setTimeout(function(){if(K.current){var D=K.current.files;D.length||($({type:"closeDialog"}),B())}},300)};v.useEffect(function(){return window.addEventListener("focus",te,!1),function(){window.removeEventListener("focus",te,!1)}},[K,q,B,Q]);var ce=v.useRef([]),ye=function(D){V.current&&V.current.contains(D.target)||(D.preventDefault(),ce.current=[])};v.useEffect(function(){return b&&(document.addEventListener("dragover",Tx,!1),document.addEventListener("drop",ye,!1)),function(){b&&(document.removeEventListener("dragover",Tx),document.removeEventListener("drop",ye))}},[V,b]),v.useEffect(function(){return!r&&w&&V.current&&V.current.focus(),function(){}},[V,w,r]);var re=v.useCallback(function(A){P?P(A):console.error(A)},[P]),Ne=v.useCallback(function(A){A.preventDefault(),A.persist(),xr(A),ce.current=[].concat(N$(ce.current),[A.target]),zl(A)&&Promise.resolve(i(A)).then(function(D){if(!(Ju(A)&&!_)){var G=D.length,Z=G>0&&k$({files:D,accept:N,minSize:o,maxSize:s,multiple:a,maxFiles:l,validator:M}),ae=G>0&&!Z;$({isDragAccept:Z,isDragReject:ae,isDragActive:!0,type:"setDraggedFiles"}),c&&c(A)}}).catch(function(D){return re(D)})},[i,c,re,_,N,o,s,a,l,M]),Je=v.useCallback(function(A){A.preventDefault(),A.persist(),xr(A);var D=zl(A);if(D&&A.dataTransfer)try{A.dataTransfer.dropEffect="copy"}catch{}return D&&u&&u(A),!1},[u,_]),et=v.useCallback(function(A){A.preventDefault(),A.persist(),xr(A);var D=ce.current.filter(function(Z){return V.current&&V.current.contains(Z)}),G=D.indexOf(A.target);G!==-1&&D.splice(G,1),ce.current=D,!(D.length>0)&&($({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),zl(A)&&d&&d(A))},[V,d,_]),Mt=v.useCallback(function(A,D){var G=[],Z=[];A.forEach(function(ae){var Ve=LC(ae,N),tt=rf(Ve,2),Pn=tt[0],Qt=tt[1],hs=IC(ae,o,s),Zn=rf(hs,2),wr=Zn[0],ms=Zn[1],Po=M?M(ae):null;if(Pn&&wr&&!Po)G.push(ae);else{var hi=[Qt,ms];Po&&(hi=hi.concat(Po)),Z.push({file:ae,errors:hi.filter(function(jn){return jn})})}}),(!a&&G.length>1||a&&l>=1&&G.length>l)&&(G.forEach(function(ae){Z.push({file:ae,errors:[S$]})}),G.splice(0)),$({acceptedFiles:G,fileRejections:Z,isDragReject:Z.length>0,type:"setFiles"}),f&&f(G,Z,D),Z.length>0&&h&&h(Z,D),G.length>0&&p&&p(G,D)},[$,a,N,o,s,l,f,p,h,M]),_n=v.useCallback(function(A){A.preventDefault(),A.persist(),xr(A),ce.current=[],zl(A)&&Promise.resolve(i(A)).then(function(D){Ju(A)&&!_||Mt(D,A)}).catch(function(D){return re(D)}),$({type:"reset"})},[i,Mt,re,_]),dn=v.useCallback(function(){if(Q.current){$({type:"openDialog"}),F();var A={multiple:a,types:R};window.showOpenFilePicker(A).then(function(D){return i(D)}).then(function(D){Mt(D,null),$({type:"closeDialog"})}).catch(function(D){R$(D)?(B(D),$({type:"closeDialog"})):A$(D)?(Q.current=!1,K.current?(K.current.value=null,K.current.click()):re(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."))):re(D)});return}K.current&&($({type:"openDialog"}),F(),K.current.value=null,K.current.click())},[$,F,B,g,Mt,re,R,a]),fi=v.useCallback(function(A){!V.current||!V.current.isEqualNode(A.target)||(A.key===" "||A.key==="Enter"||A.keyCode===32||A.keyCode===13)&&(A.preventDefault(),dn())},[V,dn]),vr=v.useCallback(function(){$({type:"focus"})},[]),ps=v.useCallback(function(){$({type:"blur"})},[]),pi=v.useCallback(function(){k||(E$()?setTimeout(dn,0):dn())},[k,dn]),Ct=function(D){return r?null:D},yr=function(D){return T?null:Ct(D)},Ge=function(D){return E?null:Ct(D)},xr=function(D){_&&D.stopPropagation()},_o=v.useMemo(function(){return function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},D=A.refKey,G=D===void 0?"ref":D,Z=A.role,ae=A.onKeyDown,Ve=A.onFocus,tt=A.onBlur,Pn=A.onClick,Qt=A.onDragEnter,hs=A.onDragOver,Zn=A.onDragLeave,wr=A.onDrop,ms=ec(A,F$);return _e(_e(ah({onKeyDown:yr(On(ae,fi)),onFocus:yr(On(Ve,vr)),onBlur:yr(On(tt,ps)),onClick:Ct(On(Pn,pi)),onDragEnter:Ge(On(Qt,Ne)),onDragOver:Ge(On(hs,Je)),onDragLeave:Ge(On(Zn,et)),onDrop:Ge(On(wr,_n)),role:typeof Z=="string"&&Z!==""?Z:"presentation"},G,V),!r&&!T?{tabIndex:0}:{}),ms)}},[V,fi,vr,ps,pi,Ne,Je,et,_n,T,E,r]),j=v.useCallback(function(A){A.stopPropagation()},[]),z=v.useMemo(function(){return function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},D=A.refKey,G=D===void 0?"ref":D,Z=A.onChange,ae=A.onClick,Ve=ec(A,M$),tt=ah({accept:N,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:Ct(On(Z,_n)),onClick:Ct(On(ae,j)),tabIndex:-1},G,K);return _e(_e({},tt),Ve)}},[K,n,a,_n,r]);return _e(_e({},O),{},{isFocused:H&&!r,getRootProps:_o,getInputProps:z,rootRef:V,inputRef:K,open:Ct(dn)})}function W$(e,t){switch(t.type){case"focus":return _e(_e({},e),{},{isFocused:!0});case"blur":return _e(_e({},e),{},{isFocused:!1});case"openDialog":return _e(_e({},lh),{},{isFileDialogActive:!0});case"closeDialog":return _e(_e({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return _e(_e({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return _e(_e({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return _e({},lh);default:return e}}function _x(){}const UC=5*1024*1024,vo={"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"]},Px=Object.values(vo).flat();function q$(e){var r;if(e.size>UC)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(vo).includes(e.type)||Px.includes(t)?{isValid:!0,error:""}:{isValid:!1,error:`Desteklenmeyen dosya tipi. Kabul edilen tipler: ${Px.join(", ")}`}}function tc(e){for(const t of e){const n=q$(t);if(!n.isValid)return n}return{isValid:!0,error:""}}function HC({onDrop:e}){const t=n=>{const r=tc(n);if(!r.isValid){alert(r.error);return}e(n)};return y.jsx("div",{className:"flex items-center justify-center border rounded-md cursor-pointer bg-slate-100 dropzone border-slate-200 dz-clickable",children:y.jsx(ll,{onDrop:t,accept:Object.keys(vo).reduce((n,r)=>(n[r]=vo[r],n),{}),maxSize:UC,children:({getRootProps:n,getInputProps:r})=>y.jsxs("div",{className:"w-full py-5 text-lg text-center dz-message needsclick",...n(),children:[y.jsx("input",{...r()}),y.jsx("div",{className:"mb-3",children:y.jsx(jC,{className:"block size-12 mx-auto text-slate-500 fill-slate-200"})}),y.jsxs("h5",{className:"mb-0 font-normal text-slate-500 text-15",children:["Yüklemek istediğiniz görseli buraya sürükleyin veya"," ",y.jsx("span",{className:"text-custom-500",children:"seçmek için tıklayın"})]})]})})})}HC.Button=({onDrop:e})=>{const t=n=>{const r=tc(n);if(!r.isValid){Bn({description:r.error,variant:"error"});return}e(n)};return y.jsx(ll,{onDrop:t,accept:Object.keys(vo).reduce((n,r)=>(n[r]=vo[r],n),{}),children:({getRootProps:n,getInputProps:r})=>y.jsxs("div",{className:"w-12 h-12 rounded-lg flex items-center justify-center hover:bg-slate-100 text-center dz-message needsclick cursor-pointer",...n(),children:[y.jsx("input",{...r()}),y.jsx(jC,{className:"size-6 text-slate-500 fill-slate-200"})]})})};function G$({onNewMessage:e,client_id:t,is_uploadable:n,messages:r}){const i=v.useRef(null),s=ci(),o=DD(t),a=Oe(),l=il(),{setIsInputFocused:c}=kt(),[d,u]=v.useState(""),[f,p]=v.useState("3rem"),[h,m]=v.useState(!1),[x,g]=v.useState([]),[w,b]=v.useState(0),[k,T]=v.useState(!1),[E,_]=v.useState(0),[P,M]=v.useState(null);v.useEffect(()=>{if(r.length>0){const F=r[r.length-1];F.id!==P&&(M(F.id),F.sender_type===Le.User&&(b(0),T(!1)))}},[r,P]),v.useEffect(()=>{let F;return k&&E>0&&(F=window.setTimeout(()=>{_(B=>B<=1?(T(!1),b(0),0):B-1)},1e3)),()=>clearTimeout(F)},[k,E]),v.useEffect(()=>{const F=i.current;if(F){const B=()=>c(!0),V=()=>c(!1);return F.addEventListener("focus",B),F.addEventListener("blur",V),()=>{F.removeEventListener("focus",B),F.removeEventListener("blur",V)}}},[c]),Km("paste",F=>{const B=F.clipboardData.items,V=[];for(const K of B){const ee=K.getAsFile();ee&&V.push(ee)}if(V.length>0&&!n){Bn({description:l(Y.FileUploadDisabled),variant:"error"});return}if(V.length>0){const K=tc(V);if(!K.isValid){Bn({description:K.error,variant:"error"});return}g([...x,...V])}});const N=async()=>{if(!d.trim()&&(!n||x.length===0))return;if(w>5&&!k){T(!0),_(3);return}if(k)return;m(!0);let F;if(n&&x.length>0){const[B,V]=await o.mutateAsync(x);if(!Xa(V)){AL(B,V),m(!1);return}FD(B)&&(F=B.file_urls)}s==null||s.emit(En.MessageCreate,{content:d,files:F},B=>{u(""),e(B),m(!1),g([]),b(V=>V+1),i.current&&(i.current.style.height="3rem",p("3rem"))})},R=F=>{s==null||s.emit(En.MessageTyping,{content:F})};return y.jsxs(y.Fragment,{children:[k&&y.jsxs(ve.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:a.getColor(C.ErrorBackground),borderColor:a.getColor(C.ErrorBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:a.getRadius()},children:[y.jsx(fe.XCircle,{className:"size-4 mr-2",style:{color:a.getColor(C.ErrorText)}}),y.jsx("span",{className:"text-sm font-medium",style:{color:a.getColor(C.ErrorText)},children:l(Y.RateLimitMessage).replace("{seconds}",E.toString())})]}),y.jsxs("form",{className:"p-3 flex items-start gap-3 rounded-b-xl relative",style:{backgroundColor:a.getColor(C.FooterBackground),borderRadius:a.getRadius()},onSubmit:F=>{F.preventDefault(),N(),F.currentTarget.reset()},children:[n&&x&&x.length>0&&y.jsx("div",{className:"absolute bottom-18 w-full overflow-x-auto",children:y.jsx(_C,{files:x,onDelete:F=>{g(x.filter((B,V)=>V!==F))}})}),y.jsxs("div",{className:"grow relative",children:[y.jsx(yg,{id:"message",inputRef:i,className:"grow shadow-none",noMargin:!0,autoComplete:"off",style:{height:f,maxHeight:"6rem"},placeholder:l(Y.MessagePlaceholder),value:d,maxLength:2e3,onChange:F=>{const B=F.target.value;if(B.length<=2e3&&(u(B),R(B)),B.length>0&&F.currentTarget.scrollHeight>F.currentTarget.clientHeight){const V=`${F.currentTarget.scrollHeight}px`;F.currentTarget.style.height=V,p(V)}else F.currentTarget.style.height="3rem",p("3rem")},onKeyDown:F=>{F.key==="Enter"&&!F.shiftKey&&(F.preventDefault(),F.stopPropagation(),N())}}),d.length>=500&&y.jsx("div",{className:"absolute bottom-1 right-2 text-xs",style:{color:d.length>=2e3?a.getColor(C.ErrorText):a.getColor(C.FooterText),fontWeight:d.length>=2e3?"600":"normal"},children:2e3-d.length})]}),y.jsxs(ve.div,{whileTap:{scale:.95},className:"flex items-center gap-2 justify-center",children:[n&&y.jsx(HC.Button,{onDrop:F=>{if(F.length){const B=tc(F);if(!B.isValid){console.log("val",B),Bn({description:B.error,variant:"error"});return}g([...x,...F])}}}),y.jsx(on,{className:"rounded-full shadow-sm w-12 h-12 flex items-center justify-center",type:"submit",disabled:h||!d.trim()&&x.length===0||k,children:h?y.jsx(fe.Spin,{className:"size-6 animate-spin"}):k?y.jsx("span",{className:"text-xs font-bold",children:E}):y.jsx(fe.PaperAirplane,{className:"size-6 -rotate-12"})})]})]})]})}function Q$({chat:e,isTyping:t,shortcutMessages:n,messages:r,onNewMessage:i,onChatClose:s}){var w,b;const{widget:o,setOpen:a,open:l,isHaveChat:c,isInputFocused:d}=kt(),u=Oe(),f=ss(),p=Xm(),h=ci(),m=v.useRef(new Set),x=v.useRef(!1),g=v.useCallback(()=>{if(!h||!l||!c)return;const k=r.filter(T=>T.sender_type===Le.User&&!m.current.has(T.id)).map(T=>T.id);k.length!==0&&h.emit(En.MessageRead,{message_ids:k},T=>{if(T&&T.success===!0)for(const E of k)m.current.add(E)})},[h,r,l,c]);return v.useEffect(()=>{l&&(x.current=!0),l&&c&&(d||x.current)&&(g(),x.current=!1)},[l,c,d,g]),y.jsxs(y.Fragment,{children:[y.jsxs("header",{style:{backgroundColor:u.getColor(C.HeaderBackground),color:u.getColor(C.HeaderText),borderBottom:`1px solid ${u.getColor(C.HeaderBorder)}`,borderTopLeftRadius:f?"":u.getRadius(),borderTopRightRadius:f?"":u.getRadius()},className:"p-4 flex justify-between items-center z-10",children:[e!=null&&e.agent_name?y.jsx(nI,{name:e.agent_name,avatar:e.agent_avatar,textColor:u.getColor(C.HeaderText)}):y.jsx("div",{style:{color:u.getColor(C.HeaderText)},className:"font-medium",children:((b=(w=o==null?void 0:o.appearance)==null?void 0:w.design)==null?void 0:b.greeting_header)||"Bizimle Sohbet Edin"}),y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx(DI,{onChatClose:s}),!p&&!f&&y.jsx("button",{type:"button",style:{color:u.getColor(C.HeaderText)},onClick:()=>a(!1),children:y.jsx(fe.X,{className:"w-5 h-5 cursor-pointer"})})]})]}),y.jsx($I,{messages:r,isTyping:t||n.length>0}),y.jsx(G$,{client_id:(o==null?void 0:o.client_id)||"",is_uploadable:e.is_customer_uploadable,messages:r,onNewMessage:k=>{i(k)}}),y.jsxs("a",{href:"https://alfatekyazilim.com.tr",target:"_blank",rel:"noopener noreferrer",className:"py-1.5 px-3 text-xs text-center flex items-center justify-center gap-1 transition-colors",style:{color:u.getColor(C.FooterText),borderTop:`1px solid ${u.getColor(C.FooterBorder)}`,backgroundColor:u.getColor(C.FooterBackground)},children:[y.jsx("span",{children:"Powered by"}),y.jsx("span",{className:"font-medium",children:"Alfatek"}),y.jsx("img",{src:"https://alfatekyazilim.com.tr/images/favicon.png",alt:"Alfatek",className:"size-3.5 ml-0.5"})]})]})}function Y$({rating:e,onChange:t}){const n=Oe();return y.jsx("div",{className:"flex items-center justify-center gap-1 my-3",children:[1,2,3,4,5].map(r=>{const i=r<=e,s=!i&&r-.5<=e;return y.jsxs("div",{className:"relative w-10 h-10",children:[y.jsx("svg",{className:"w-10 h-10",style:{color:n.getColor(C.StarInactiveColor),fill:n.getColor(C.StarInactiveColor)},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1",children:y.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&&y.jsx("div",{className:"absolute top-0 left-0 w-5 h-10 overflow-hidden",children:y.jsx("svg",{className:"w-10 h-10",style:{color:n.getColor(C.StarActiveColor),fill:n.getColor(C.StarActiveColor)},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1",children:y.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&&y.jsx("svg",{className:"w-10 h-10 absolute top-0 left-0",style:{color:n.getColor(C.StarActiveColor),fill:n.getColor(C.StarActiveColor)},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1",children:y.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"})}),y.jsxs("div",{className:"absolute inset-0 flex",children:[y.jsx("button",{type:"button",onClick:()=>t(r-.5),className:"w-1/2 h-full cursor-pointer focus:outline-none","aria-label":`${r-.5} stars`}),y.jsx("button",{type:"button",onClick:()=>t(r),className:"w-1/2 h-full cursor-pointer focus:outline-none","aria-label":`${r} stars`})]})]},r)})})}function K$({onOk:e}){const t=Oe(),n=il(),[r,i]=v.useState(0),[s,o]=v.useState(!1),[a,l]=v.useState(10),c=OD(),[d,u]=v.useState(!1);v.useEffect(()=>{if(s){const m=setInterval(()=>{l(x=>x<=1?(clearInterval(m),e(!0),0):x-1)},1e3);return()=>clearInterval(m)}},[s]);const f=rg({comment:Ku()}),p=cC({init:{comment:""},schema:f,action:async m=>{const[x,g]=await c.mutateAsync({rating:r,comment:m.comment});if(Xa(g)){o(!0);return}fC(x,{form:p})}}),h=()=>{e(!0)};return y.jsxs("div",{className:"flex flex-col h-full",children:[y.jsxs("header",{style:{backgroundColor:s?t.getColor(C.RatingSuccessBackground):t.getColor(C.RatingHeaderBackground),color:s?t.getColor(C.RatingSuccessText):t.getColor(C.RatingHeaderText),borderBottom:`1px solid ${t.getColor(C.HeaderBorder)}`},className:"p-4 flex justify-between items-center z-10",children:[y.jsx("div",{className:"font-medium",children:n(s?Y.RatingHeaderThanks:Y.RatingHeaderEvaluate)}),y.jsx(on,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"sm",rounded:!0,onClick:()=>e(!1),className:"text-inherit cursor-pointer",children:y.jsx(fe.X,{className:"size-4"})})]}),y.jsx("div",{className:"flex-1 p-6 overflow-y-auto flex flex-col",children:s?y.jsxs(ve.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"flex flex-col items-center justify-center h-full text-center",children:[y.jsx("div",{className:"mb-4",style:{color:t.getColor(C.SuccessText)},children:y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-16 w-16",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),y.jsx("h2",{className:"text-xl font-semibold mb-2",style:{color:t.getColor(C.HeaderText)},children:n(Y.RatingThankYouTitle)}),y.jsx("p",{className:"mb-8",style:{color:t.getColor(C.FooterText)},children:n(Y.RatingThankYouDescription)}),y.jsx("p",{className:"mb-4",style:{color:t.getColor(C.FooterText)},children:n(Y.RatingCountdown).replace("{seconds}",a.toString())}),y.jsx(on,{onClick:h,className:"w-full max-w-xs rounded-lg py-2.5 font-medium transition-colors",style:{backgroundColor:t.getColor(C.ButtonBackground),color:t.getColor(C.ButtonText),borderRadius:t.getRadius()},children:n(Y.RatingNewConversation)})]}):y.jsxs(ve.div,{initial:{opacity:0},animate:{opacity:1},className:"flex flex-col",children:[y.jsx("div",{className:"text-center mb-6",children:y.jsx("p",{className:"text-base",style:{color:t.getColor(C.FooterText)},children:n(Y.RatingDescription)})}),y.jsxs("div",{className:"mb-6",children:[y.jsx("h3",{className:"text-center font-medium mb-2 text-lg",style:{color:t.getColor(C.RatingRateConversationText)},children:n(Y.RatingRateConversation)}),y.jsx(Y$,{rating:r,onChange:m=>{i(m),m>=1&&u(!1)}}),r>0&&y.jsx("p",{className:"text-center text-sm mt-1",style:{color:t.getColor(C.FooterText)},children:n(Y.RatingYourScore).replace("{score}",Number.isInteger(r)?r.toString():r.toFixed(1))}),r>0&&r<1||d?y.jsx("p",{className:"text-center text-sm mt-1",style:{color:t.getColor(C.ErrorText)},children:n(Y.RatingMinimumError)}):null]}),y.jsxs("form",{onSubmit:p.handleSubmit,className:"space-y-5",children:[y.jsxs("div",{children:[y.jsx("label",{htmlFor:"comment",className:"block text-sm font-medium mb-1",style:{color:t.getColor(C.InputText)},children:n(Y.RatingComment)}),y.jsx(yg,{id:"comment",onChange:p.handleChange,onBlur:p.handleBlur,value:p.values.comment,placeholder:n(Y.RatingCommentPlaceholder),className:"rounded-lg shadow-sm",style:{borderColor:t.getColor(C.InputBorder),backgroundColor:t.getColor(C.InputBackground),color:t.getColor(C.InputText),borderRadius:t.getRadius()},error:p.errors.comment})]}),y.jsxs("div",{className:"flex flex-col gap-3 pt-2",children:[y.jsx(on,{type:"submit",onClick:m=>{r<1&&(m.preventDefault(),m.stopPropagation(),u(!0))},className:"w-full rounded-lg py-2.5 font-medium transition-colors",style:{backgroundColor:t.getColor(C.ButtonBackground),color:t.getColor(C.ButtonText),borderRadius:t.getRadius()},children:n(Y.RatingSubmit)}),y.jsx(on,{onClick:h,className:"w-full rounded-lg py-2.5 font-medium transition-colors",style:{backgroundColor:t.getColor(C.GreeterBackground),color:t.getColor(C.GreeterText),borderRadius:t.getRadius()},children:n(Y.RatingNewConversation)})]})]})]})}),y.jsxs("a",{href:"https://alfatekyazilim.com.tr",target:"_blank",rel:"noopener noreferrer",className:"py-1.5 px-3 text-xs text-center flex items-center justify-center gap-1 transition-colors",style:{color:t.getColor(C.FooterText),borderTop:`1px solid ${t.getColor(C.FooterBorder)}`,backgroundColor:t.getColor(C.FooterBackground)},children:[y.jsx("span",{children:n(Y.PoweredBy)}),y.jsx("span",{className:"font-medium",children:"Alfatek"}),y.jsx("img",{src:"https://alfatekyazilim.com.tr/images/favicon.png",alt:"Alfatek",className:"size-3.5 ml-0.5"})]})]})}function X$({children:e}){const{widget:t}=kt();return t?y.jsx("section",{className:"h-full w-full relative",children:e}):null}function Z$({children:e}){const t=ci(),n=Pc();return v.useEffect(()=>{t&&t.connect()},[]),t?t.connected?e:(n.push("registration"),null):null}function J$(){const{widget:e,setOpen:t,setIsHaveChat:n}=kt(),r=Oe(),i=ci(),s=sl(),o=Pc(),a=ss(),[l,c]=v.useState(null),[d,u]=v.useState([]),[f,p]=v.useState(!1),[h,m]=v.useState([]),x=()=>{if(l){c({...l,status:ys.Closed});return}g()},g=b=>{b||t(!1),Vp((e==null?void 0:e.link_id)||""),n(!1),c(null),u([]),m([]),Up(e.client_id,ho(s)).then(()=>{i==null||i.disconnect(),o.push("registration")})};v.useEffect(()=>{i==null||i.emit(En.ChatView,{},b=>{if(b===null){t(!1),n(!1),Up(e.client_id,ho(s)),u([]),m([]),Vp((e==null?void 0:e.link_id)||""),o.push("registration");return}c(b),n(!0)})},[]);const w=v.useCallback(b=>{l&&![ys.Closed,ys.Deleted].includes(l.status)&&u([...d,b])},[d,l]);return v.useEffect(()=>{if(!i)return;const b=P=>{const M={content:P.content,created_at:P.created_at,files:P.files,id:P._id,sender_type:P.sender_type,answers:P.answers,reply_id:P.reply_id,buttons:P.buttons};if(h.length>0){m(N=>[...N,M]);return}P.is_shortcut?m([M]):w(M),p(!1)},k=P=>{c({...l,agent_name:P.name,agent_avatar:P.avatar,is_customer_uploadable:(l==null?void 0:l.is_customer_uploadable)??!1,status:(l==null?void 0:l.status)??ys.Open}),w({content:` _ _${P.name}`,created_at:new Date,files:[],id:Math.random().toString(),sender_type:Le.Activity,activity_type:ki.AdminJoin,sender_name:P.name})},T=()=>{p(!0)},E=()=>{x()},_=({is_customer_uploadable:P})=>{c(l?{...l,is_customer_uploadable:P}:null)};return i.on(st.MessageAgentCreate,b),i.on(st.ChatUserAssignee,k),i.on(st.MessageAgentTyping,T),i.on(st.ChatUserClose,E),i.on(st.ChatToggleUpload,_),()=>{i.off(st.MessageAgentCreate,b),i.off(st.ChatUserAssignee,k),i.off(st.MessageAgentTyping,T),i.off(st.ChatUserClose,E),i.off(st.ChatToggleUpload,_)}},[w]),v.useEffect(()=>{!i||!l||i.emit(En.MessageList,{},b=>{u(b)})},[i,l]),v.useEffect(()=>{const b=setTimeout(()=>{p(!1)},2e3);return()=>clearTimeout(b)},[f]),v.useEffect(()=>{if(!e||h.length===0)return;let b=0;e.writing_timeout&&(b=[...h[0].content].length/e.writing_timeout,b<0&&(b=0));const k=setTimeout(()=>{w(h[0]),m(h.slice(1))},b*1e3);return()=>clearTimeout(k)},[h,e]),l?y.jsxs(y.Fragment,{children:[y.jsx("div",{id:"chat-alert-portal"}),y.jsx(Xr,{children:y.jsx(ve.div,{initial:{opacity:0,scale:.98,y:5},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.98,y:5},transition:{type:"spring",damping:35,stiffness:400,duration:.2},className:`h-full w-full ${a?"":"rounded-xl"} shadow-sm flex flex-col overflow-hidden`,style:{height:a?"100%":"",minHeight:a?"var(--app-height, 100dvh)":"",maxHeight:a?"var(--app-height, 100dvh)":"",backgroundColor:r.getColor(C.Background)},children:l.status===ys.Closed?y.jsx(K$,{onOk:g}):y.jsx(Q$,{chat:l,isTyping:f,messages:d,shortcutMessages:h,onNewMessage:w,onChatClose:x})})})]}):null}function eB(){return KL(),null}function tB(){return y.jsxs(Z$,{children:[y.jsx(wk,{defaultOpen:!0,children:y.jsx(X$,{children:y.jsx(J$,{})})}),y.jsx(eB,{})]})}const nB=[{path:"/chat",component:tB,name:"chat"}],WC=[...nB],qC=[...tI],rB=[...WC,...qC];function iB(){return y.jsx(lP,{future:{v7_startTransition:!0},children:y.jsxs(cP,{children:[WC.map((e,t)=>y.jsx(pp,{path:e.path,element:y.jsx(e.component,{})},t)),qC.map((e,t)=>y.jsx(pp,{path:e.path,element:y.jsx(e.component,{})},t))]})})}const sB=v.forwardRef((e,t)=>{const{data:n,isLoading:r}=g2(e.link_id),{widget:i,setWidget:s,setSoundPath:o,setDefaultValues:a,setOpen:l,setOnTooltipClose:c,setIsTooltipVisible:d,setOnOpen:u,setOnClose:f,onOpen:p,onClose:h}=kt();return v.useImperativeHandle(t,()=>({open:()=>{l(!0),p&&p()},close:()=>{l(!1),h&&h()}})),v.useEffect(()=>{n&&Array.isArray(n)&&y2(n[0])&&s(n[0]),e.soundPath&&o(e.soundPath),e.defaultValues&&a(e.defaultValues),e.onTooltipClose&&c(e.onTooltipClose),e.showTooltip===!1&&d(!1),e.onOpen&&u(e.onOpen),e.onClose&&f(e.onClose)},[n,e.soundPath,e.defaultValues,e.onTooltipClose,e.showTooltip,e.onOpen,e.onClose]),r?y.jsx("div",{children:"Loading..."}):i?y.jsx(IL,{children:y.jsx(ED,{children:y.jsx(iB,{})})}):y.jsx("div",{children:"Widget not found"})}),oB=new Z_;let jx=null;function aB(e){if(!e.container)return;const t=L.createRef();return jx=Jw(e.container),jx.render(y.jsxs(r2,{client:oB,children:[y.jsx(sB,{...e,ref:t}),y.jsx(EL,{richColors:!0,style:{zIndex:999999,position:"fixed",bottom:"20px",right:"20px"},position:"bottom-right"})]})),{open:()=>{var n;return(n=t.current)==null?void 0:n.open()},close:()=>{var n;return(n=t.current)==null?void 0:n.close()}}}window.widget=aB});export default lB();
|