@kite-copilot/chat-panel 0.2.42 → 0.2.43

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.
@@ -3,16 +3,16 @@
3
3
  `),n=r.stack.split(`
4
4
  `),s=o.length-1,i=n.length-1;1<=s&&0<=i&&o[s]!==n[i];)i--;for(;1<=s&&0<=i;s--,i--)if(o[s]!==n[i]){if(s!==1||i!==1)do if(s--,i--,0>i||o[s]!==n[i]){var l=`
5
5
  `+o[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=s&&0<=i);break}}}finally{Fp=!1,Error.prepareStackTrace=a}return(e=e?e.displayName||e.name:"")?Ui(e):""}function tP(e){switch(e.tag){case 5:return Ui(e.type);case 16:return Ui("Lazy");case 13:return Ui("Suspense");case 19:return Ui("SuspenseList");case 0:case 2:case 15:return e=Bp(e.type,!1),e;case 11:return e=Bp(e.type.render,!1),e;case 1:return e=Bp(e.type,!0),e;default:return""}}function lm(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case On:return"Fragment";case Nn:return"Portal";case nm:return"Profiler";case Zm:return"StrictMode";case sm:return"Suspense";case im:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case bv:return(e.displayName||"Context")+".Consumer";case Iv:return(e._context.displayName||"Context")+".Provider";case eh:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case th:return t=e.displayName||null,t!==null?t:lm(e.type)||"Memo";case Rr:t=e._payload,e=e._init;try{return lm(e(t))}catch{}}return null}function aP(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return lm(t);case 8:return t===Zm?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function zr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Pv(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function rP(e){var t=Pv(e)?"checked":"value",a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var o=a.get,n=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,n.call(this,s)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function qu(e){e._valueTracker||(e._valueTracker=rP(e))}function Tv(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),r="";return e&&(r=Pv(e)?e.checked?"true":"false":e.value),e=r,e!==a?(t.setValue(e),!0):!1}function gd(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function um(e,t){var a=t.checked;return Ee({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:a??e._wrapperState.initialChecked})}function wx(e,t){var a=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;a=zr(t.value!=null?t.value:a),e._wrapperState={initialChecked:r,initialValue:a,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Av(e,t){t=t.checked,t!=null&&Ym(e,"checked",t,!1)}function dm(e,t){Av(e,t);var a=zr(t.value),r=t.type;if(a!=null)r==="number"?(a===0&&e.value===""||e.value!=a)&&(e.value=""+a):e.value!==""+a&&(e.value=""+a);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?cm(e,t.type,a):t.hasOwnProperty("defaultValue")&&cm(e,t.type,zr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Sx(e,t,a){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,a||t===e.value||(e.value=t),e.defaultValue=t}a=e.name,a!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,a!==""&&(e.name=a)}function cm(e,t,a){(t!=="number"||gd(e.ownerDocument)!==e)&&(a==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+a&&(e.defaultValue=""+a))}var Vi=Array.isArray;function Gn(e,t,a,r){if(e=e.options,t){t={};for(var o=0;o<a.length;o++)t["$"+a[o]]=!0;for(a=0;a<e.length;a++)o=t.hasOwnProperty("$"+e[a].value),e[a].selected!==o&&(e[a].selected=o),o&&r&&(e[a].defaultSelected=!0)}else{for(a=""+zr(a),t=null,o=0;o<e.length;o++){if(e[o].value===a){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function fm(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(_(91));return Ee({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Cx(e,t){var a=t.value;if(a==null){if(a=t.children,t=t.defaultValue,a!=null){if(t!=null)throw Error(_(92));if(Vi(a)){if(1<a.length)throw Error(_(93));a=a[0]}t=a}t==null&&(t=""),a=t}e._wrapperState={initialValue:zr(a)}}function Rv(e,t){var a=zr(t.value),r=zr(t.defaultValue);a!=null&&(a=""+a,a!==e.value&&(e.value=a),t.defaultValue==null&&e.defaultValue!==a&&(e.defaultValue=a)),r!=null&&(e.defaultValue=""+r)}function Lx(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function _v(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function pm(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?_v(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Hu,Ev=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,a,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,a,r,o)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Hu=Hu||document.createElement("div"),Hu.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Hu.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Zi(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var Hi={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},oP=["Webkit","ms","Moz","O"];Object.keys(Hi).forEach(function(e){oP.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Hi[t]=Hi[e]})});function Dv(e,t,a){return t==null||typeof t=="boolean"||t===""?"":a||typeof t!="number"||t===0||Hi.hasOwnProperty(e)&&Hi[e]?(""+t).trim():t+"px"}function Mv(e,t){e=e.style;for(var a in t)if(t.hasOwnProperty(a)){var r=a.indexOf("--")===0,o=Dv(a,t[a],r);a==="float"&&(a="cssFloat"),r?e.setProperty(a,o):e[a]=o}}var nP=Ee({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function mm(e,t){if(t){if(nP[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(_(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(_(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(_(61))}if(t.style!=null&&typeof t.style!="object")throw Error(_(62))}}function hm(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var gm=null;function ah(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ym=null,Kn=null,Xn=null;function Ix(e){if(e=yl(e)){if(typeof ym!="function")throw Error(_(280));var t=e.stateNode;t&&(t=zd(t),ym(e.stateNode,e.type,t))}}function Nv(e){Kn?Xn?Xn.push(e):Xn=[e]:Kn=e}function Ov(){if(Kn){var e=Kn,t=Xn;if(Xn=Kn=null,Ix(e),t)for(e=0;e<t.length;e++)Ix(t[e])}}function Fv(e,t){return e(t)}function Bv(){}var Up=!1;function Uv(e,t,a){if(Up)return e(t,a);Up=!0;try{return Fv(e,t,a)}finally{Up=!1,(Kn!==null||Xn!==null)&&(Bv(),Ov())}}function el(e,t){var a=e.stateNode;if(a===null)return null;var r=zd(a);if(r===null)return null;a=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(_(231,t,typeof a));return a}var xm=!1;if(rr)try{Dn={},Object.defineProperty(Dn,"passive",{get:function(){xm=!0}}),window.addEventListener("test",Dn,Dn),window.removeEventListener("test",Dn,Dn)}catch{xm=!1}var Dn;function sP(e,t,a,r,o,n,s,i,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(a,u)}catch(d){this.onError(d)}}var zi=!1,yd=null,xd=!1,vm=null,iP={onError:function(e){zi=!0,yd=e}};function lP(e,t,a,r,o,n,s,i,l){zi=!1,yd=null,sP.apply(iP,arguments)}function uP(e,t,a,r,o,n,s,i,l){if(lP.apply(this,arguments),zi){if(zi){var u=yd;zi=!1,yd=null}else throw Error(_(198));xd||(xd=!0,vm=u)}}function Vo(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function Vv(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function bx(e){if(Vo(e)!==e)throw Error(_(188))}function dP(e){var t=e.alternate;if(!t){if(t=Vo(e),t===null)throw Error(_(188));return t!==e?null:e}for(var a=e,r=t;;){var o=a.return;if(o===null)break;var n=o.alternate;if(n===null){if(r=o.return,r!==null){a=r;continue}break}if(o.child===n.child){for(n=o.child;n;){if(n===a)return bx(o),e;if(n===r)return bx(o),t;n=n.sibling}throw Error(_(188))}if(a.return!==r.return)a=o,r=n;else{for(var s=!1,i=o.child;i;){if(i===a){s=!0,a=o,r=n;break}if(i===r){s=!0,r=o,a=n;break}i=i.sibling}if(!s){for(i=n.child;i;){if(i===a){s=!0,a=n,r=o;break}if(i===r){s=!0,r=n,a=o;break}i=i.sibling}if(!s)throw Error(_(189))}}if(a.alternate!==r)throw Error(_(190))}if(a.tag!==3)throw Error(_(188));return a.stateNode.current===a?e:t}function jv(e){return e=dP(e),e!==null?qv(e):null}function qv(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=qv(e);if(t!==null)return t;e=e.sibling}return null}var Hv=Gt.unstable_scheduleCallback,kx=Gt.unstable_cancelCallback,cP=Gt.unstable_shouldYield,fP=Gt.unstable_requestPaint,Fe=Gt.unstable_now,pP=Gt.unstable_getCurrentPriorityLevel,rh=Gt.unstable_ImmediatePriority,zv=Gt.unstable_UserBlockingPriority,vd=Gt.unstable_NormalPriority,mP=Gt.unstable_LowPriority,$v=Gt.unstable_IdlePriority,Vd=null,Da=null;function hP(e){if(Da&&typeof Da.onCommitFiberRoot=="function")try{Da.onCommitFiberRoot(Vd,e,void 0,(e.current.flags&128)===128)}catch{}}var Sa=Math.clz32?Math.clz32:xP,gP=Math.log,yP=Math.LN2;function xP(e){return e>>>=0,e===0?32:31-(gP(e)/yP|0)|0}var zu=64,$u=4194304;function ji(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function wd(e,t){var a=e.pendingLanes;if(a===0)return 0;var r=0,o=e.suspendedLanes,n=e.pingedLanes,s=a&268435455;if(s!==0){var i=s&~o;i!==0?r=ji(i):(n&=s,n!==0&&(r=ji(n)))}else s=a&~o,s!==0?r=ji(s):n!==0&&(r=ji(n));if(r===0)return 0;if(t!==0&&t!==r&&(t&o)===0&&(o=r&-r,n=t&-t,o>=n||o===16&&(n&4194240)!==0))return t;if((r&4)!==0&&(r|=a&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)a=31-Sa(t),o=1<<a,r|=e[a],t&=~o;return r}function vP(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function wP(e,t){for(var a=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,n=e.pendingLanes;0<n;){var s=31-Sa(n),i=1<<s,l=o[s];l===-1?((i&a)===0||(i&r)!==0)&&(o[s]=vP(i,t)):l<=t&&(e.expiredLanes|=i),n&=~i}}function wm(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Wv(){var e=zu;return zu<<=1,(zu&4194240)===0&&(zu=64),e}function Vp(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function hl(e,t,a){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Sa(t),e[t]=a}function SP(e,t){var a=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<a;){var o=31-Sa(a),n=1<<o;t[o]=0,r[o]=-1,e[o]=-1,a&=~n}}function oh(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var r=31-Sa(a),o=1<<r;o&t|e[r]&t&&(e[r]|=t),a&=~o}}var me=0;function Gv(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var Kv,nh,Xv,Qv,Jv,Sm=!1,Wu=[],Or=null,Fr=null,Br=null,tl=new Map,al=new Map,Er=[],CP="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Px(e,t){switch(e){case"focusin":case"focusout":Or=null;break;case"dragenter":case"dragleave":Fr=null;break;case"mouseover":case"mouseout":Br=null;break;case"pointerover":case"pointerout":tl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":al.delete(t.pointerId)}}function Ei(e,t,a,r,o,n){return e===null||e.nativeEvent!==n?(e={blockedOn:t,domEventName:a,eventSystemFlags:r,nativeEvent:n,targetContainers:[o]},t!==null&&(t=yl(t),t!==null&&nh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function LP(e,t,a,r,o){switch(t){case"focusin":return Or=Ei(Or,e,t,a,r,o),!0;case"dragenter":return Fr=Ei(Fr,e,t,a,r,o),!0;case"mouseover":return Br=Ei(Br,e,t,a,r,o),!0;case"pointerover":var n=o.pointerId;return tl.set(n,Ei(tl.get(n)||null,e,t,a,r,o)),!0;case"gotpointercapture":return n=o.pointerId,al.set(n,Ei(al.get(n)||null,e,t,a,r,o)),!0}return!1}function Yv(e){var t=Ao(e.target);if(t!==null){var a=Vo(t);if(a!==null){if(t=a.tag,t===13){if(t=Vv(a),t!==null){e.blockedOn=t,Jv(e.priority,function(){Xv(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function sd(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Cm(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(a===null){a=e.nativeEvent;var r=new a.constructor(a.type,a);gm=r,a.target.dispatchEvent(r),gm=null}else return t=yl(a),t!==null&&nh(t),e.blockedOn=a,!1;t.shift()}return!0}function Tx(e,t,a){sd(e)&&a.delete(t)}function IP(){Sm=!1,Or!==null&&sd(Or)&&(Or=null),Fr!==null&&sd(Fr)&&(Fr=null),Br!==null&&sd(Br)&&(Br=null),tl.forEach(Tx),al.forEach(Tx)}function Di(e,t){e.blockedOn===t&&(e.blockedOn=null,Sm||(Sm=!0,Gt.unstable_scheduleCallback(Gt.unstable_NormalPriority,IP)))}function rl(e){function t(o){return Di(o,e)}if(0<Wu.length){Di(Wu[0],e);for(var a=1;a<Wu.length;a++){var r=Wu[a];r.blockedOn===e&&(r.blockedOn=null)}}for(Or!==null&&Di(Or,e),Fr!==null&&Di(Fr,e),Br!==null&&Di(Br,e),tl.forEach(t),al.forEach(t),a=0;a<Er.length;a++)r=Er[a],r.blockedOn===e&&(r.blockedOn=null);for(;0<Er.length&&(a=Er[0],a.blockedOn===null);)Yv(a),a.blockedOn===null&&Er.shift()}var Qn=ir.ReactCurrentBatchConfig,Sd=!0;function bP(e,t,a,r){var o=me,n=Qn.transition;Qn.transition=null;try{me=1,sh(e,t,a,r)}finally{me=o,Qn.transition=n}}function kP(e,t,a,r){var o=me,n=Qn.transition;Qn.transition=null;try{me=4,sh(e,t,a,r)}finally{me=o,Qn.transition=n}}function sh(e,t,a,r){if(Sd){var o=Cm(e,t,a,r);if(o===null)Gp(e,t,r,Cd,a),Px(e,r);else if(LP(o,e,t,a,r))r.stopPropagation();else if(Px(e,r),t&4&&-1<CP.indexOf(e)){for(;o!==null;){var n=yl(o);if(n!==null&&Kv(n),n=Cm(e,t,a,r),n===null&&Gp(e,t,r,Cd,a),n===o)break;o=n}o!==null&&r.stopPropagation()}else Gp(e,t,r,null,a)}}var Cd=null;function Cm(e,t,a,r){if(Cd=null,e=ah(r),e=Ao(e),e!==null)if(t=Vo(e),t===null)e=null;else if(a=t.tag,a===13){if(e=Vv(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Cd=e,null}function Zv(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(pP()){case rh:return 1;case zv:return 4;case vd:case mP:return 16;case $v:return 536870912;default:return 16}default:return 16}}var Mr=null,ih=null,id=null;function e0(){if(id)return id;var e,t=ih,a=t.length,r,o="value"in Mr?Mr.value:Mr.textContent,n=o.length;for(e=0;e<a&&t[e]===o[e];e++);var s=a-e;for(r=1;r<=s&&t[a-r]===o[n-r];r++);return id=o.slice(e,1<r?1-r:void 0)}function ld(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Gu(){return!0}function Ax(){return!1}function Kt(e){function t(a,r,o,n,s){this._reactName=a,this._targetInst=o,this.type=r,this.nativeEvent=n,this.target=s,this.currentTarget=null;for(var i in e)e.hasOwnProperty(i)&&(a=e[i],this[i]=a?a(n):n[i]);return this.isDefaultPrevented=(n.defaultPrevented!=null?n.defaultPrevented:n.returnValue===!1)?Gu:Ax,this.isPropagationStopped=Ax,this}return Ee(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Gu)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Gu)},persist:function(){},isPersistent:Gu}),t}var ss={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},lh=Kt(ss),gl=Ee({},ss,{view:0,detail:0}),PP=Kt(gl),jp,qp,Mi,jd=Ee({},gl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:uh,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Mi&&(Mi&&e.type==="mousemove"?(jp=e.screenX-Mi.screenX,qp=e.screenY-Mi.screenY):qp=jp=0,Mi=e),jp)},movementY:function(e){return"movementY"in e?e.movementY:qp}}),Rx=Kt(jd),TP=Ee({},jd,{dataTransfer:0}),AP=Kt(TP),RP=Ee({},gl,{relatedTarget:0}),Hp=Kt(RP),_P=Ee({},ss,{animationName:0,elapsedTime:0,pseudoElement:0}),EP=Kt(_P),DP=Ee({},ss,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),MP=Kt(DP),NP=Ee({},ss,{data:0}),_x=Kt(NP),OP={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},FP={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},BP={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function UP(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=BP[e])?!!t[e]:!1}function uh(){return UP}var VP=Ee({},gl,{key:function(e){if(e.key){var t=OP[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ld(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?FP[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:uh,charCode:function(e){return e.type==="keypress"?ld(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ld(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),jP=Kt(VP),qP=Ee({},jd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ex=Kt(qP),HP=Ee({},gl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:uh}),zP=Kt(HP),$P=Ee({},ss,{propertyName:0,elapsedTime:0,pseudoElement:0}),WP=Kt($P),GP=Ee({},jd,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),KP=Kt(GP),XP=[9,13,27,32],dh=rr&&"CompositionEvent"in window,$i=null;rr&&"documentMode"in document&&($i=document.documentMode);var QP=rr&&"TextEvent"in window&&!$i,t0=rr&&(!dh||$i&&8<$i&&11>=$i),Dx=" ",Mx=!1;function a0(e,t){switch(e){case"keyup":return XP.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function r0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Fn=!1;function JP(e,t){switch(e){case"compositionend":return r0(t);case"keypress":return t.which!==32?null:(Mx=!0,Dx);case"textInput":return e=t.data,e===Dx&&Mx?null:e;default:return null}}function YP(e,t){if(Fn)return e==="compositionend"||!dh&&a0(e,t)?(e=e0(),id=ih=Mr=null,Fn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return t0&&t.locale!=="ko"?null:t.data;default:return null}}var ZP={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Nx(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ZP[e.type]:t==="textarea"}function o0(e,t,a,r){Nv(r),t=Ld(t,"onChange"),0<t.length&&(a=new lh("onChange","change",null,a,r),e.push({event:a,listeners:t}))}var Wi=null,ol=null;function eT(e){h0(e,0)}function qd(e){var t=Vn(e);if(Tv(t))return e}function tT(e,t){if(e==="change")return t}var n0=!1;rr&&(rr?(Xu="oninput"in document,Xu||(zp=document.createElement("div"),zp.setAttribute("oninput","return;"),Xu=typeof zp.oninput=="function"),Ku=Xu):Ku=!1,n0=Ku&&(!document.documentMode||9<document.documentMode));var Ku,Xu,zp;function Ox(){Wi&&(Wi.detachEvent("onpropertychange",s0),ol=Wi=null)}function s0(e){if(e.propertyName==="value"&&qd(ol)){var t=[];o0(t,ol,e,ah(e)),Uv(eT,t)}}function aT(e,t,a){e==="focusin"?(Ox(),Wi=t,ol=a,Wi.attachEvent("onpropertychange",s0)):e==="focusout"&&Ox()}function rT(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return qd(ol)}function oT(e,t){if(e==="click")return qd(t)}function nT(e,t){if(e==="input"||e==="change")return qd(t)}function sT(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var La=typeof Object.is=="function"?Object.is:sT;function nl(e,t){if(La(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),r=Object.keys(t);if(a.length!==r.length)return!1;for(r=0;r<a.length;r++){var o=a[r];if(!om.call(t,o)||!La(e[o],t[o]))return!1}return!0}function Fx(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Bx(e,t){var a=Fx(e);e=0;for(var r;a;){if(a.nodeType===3){if(r=e+a.textContent.length,e<=t&&r>=t)return{node:a,offset:t-e};e=r}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Fx(a)}}function i0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?i0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function l0(){for(var e=window,t=gd();t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=gd(e.document)}return t}function ch(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function iT(e){var t=l0(),a=e.focusedElem,r=e.selectionRange;if(t!==a&&a&&a.ownerDocument&&i0(a.ownerDocument.documentElement,a)){if(r!==null&&ch(a)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in a)a.selectionStart=t,a.selectionEnd=Math.min(e,a.value.length);else if(e=(t=a.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=a.textContent.length,n=Math.min(r.start,o);r=r.end===void 0?n:Math.min(r.end,o),!e.extend&&n>r&&(o=r,r=n,n=o),o=Bx(a,n);var s=Bx(a,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),n>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=a;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof a.focus=="function"&&a.focus(),a=0;a<t.length;a++)e=t[a],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var lT=rr&&"documentMode"in document&&11>=document.documentMode,Bn=null,Lm=null,Gi=null,Im=!1;function Ux(e,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Im||Bn==null||Bn!==gd(r)||(r=Bn,"selectionStart"in r&&ch(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Gi&&nl(Gi,r)||(Gi=r,r=Ld(Lm,"onSelect"),0<r.length&&(t=new lh("onSelect","select",null,t,a),e.push({event:t,listeners:r}),t.target=Bn)))}function Qu(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Un={animationend:Qu("Animation","AnimationEnd"),animationiteration:Qu("Animation","AnimationIteration"),animationstart:Qu("Animation","AnimationStart"),transitionend:Qu("Transition","TransitionEnd")},$p={},u0={};rr&&(u0=document.createElement("div").style,"AnimationEvent"in window||(delete Un.animationend.animation,delete Un.animationiteration.animation,delete Un.animationstart.animation),"TransitionEvent"in window||delete Un.transitionend.transition);function Hd(e){if($p[e])return $p[e];if(!Un[e])return e;var t=Un[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in u0)return $p[e]=t[a];return e}var d0=Hd("animationend"),c0=Hd("animationiteration"),f0=Hd("animationstart"),p0=Hd("transitionend"),m0=new Map,Vx="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Wr(e,t){m0.set(e,t),Uo(t,[e])}for(Ju=0;Ju<Vx.length;Ju++)Yu=Vx[Ju],jx=Yu.toLowerCase(),qx=Yu[0].toUpperCase()+Yu.slice(1),Wr(jx,"on"+qx);var Yu,jx,qx,Ju;Wr(d0,"onAnimationEnd");Wr(c0,"onAnimationIteration");Wr(f0,"onAnimationStart");Wr("dblclick","onDoubleClick");Wr("focusin","onFocus");Wr("focusout","onBlur");Wr(p0,"onTransitionEnd");Zn("onMouseEnter",["mouseout","mouseover"]);Zn("onMouseLeave",["mouseout","mouseover"]);Zn("onPointerEnter",["pointerout","pointerover"]);Zn("onPointerLeave",["pointerout","pointerover"]);Uo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Uo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Uo("onBeforeInput",["compositionend","keypress","textInput","paste"]);Uo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Uo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Uo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var qi="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),uT=new Set("cancel close invalid load scroll toggle".split(" ").concat(qi));function Hx(e,t,a){var r=e.type||"unknown-event";e.currentTarget=a,uP(r,t,void 0,e),e.currentTarget=null}function h0(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var r=e[a],o=r.event;r=r.listeners;e:{var n=void 0;if(t)for(var s=r.length-1;0<=s;s--){var i=r[s],l=i.instance,u=i.currentTarget;if(i=i.listener,l!==n&&o.isPropagationStopped())break e;Hx(o,i,u),n=l}else for(s=0;s<r.length;s++){if(i=r[s],l=i.instance,u=i.currentTarget,i=i.listener,l!==n&&o.isPropagationStopped())break e;Hx(o,i,u),n=l}}}if(xd)throw e=vm,xd=!1,vm=null,e}function Ie(e,t){var a=t[Am];a===void 0&&(a=t[Am]=new Set);var r=e+"__bubble";a.has(r)||(g0(t,e,2,!1),a.add(r))}function Wp(e,t,a){var r=0;t&&(r|=4),g0(a,e,r,t)}var Zu="_reactListening"+Math.random().toString(36).slice(2);function sl(e){if(!e[Zu]){e[Zu]=!0,Lv.forEach(function(a){a!=="selectionchange"&&(uT.has(a)||Wp(a,!1,e),Wp(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Zu]||(t[Zu]=!0,Wp("selectionchange",!1,t))}}function g0(e,t,a,r){switch(Zv(t)){case 1:var o=bP;break;case 4:o=kP;break;default:o=sh}a=o.bind(null,t,a,e),o=void 0,!xm||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,a,{capture:!0,passive:o}):e.addEventListener(t,a,!0):o!==void 0?e.addEventListener(t,a,{passive:o}):e.addEventListener(t,a,!1)}function Gp(e,t,a,r,o){var n=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var i=r.stateNode.containerInfo;if(i===o||i.nodeType===8&&i.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===o||l.nodeType===8&&l.parentNode===o))return;s=s.return}for(;i!==null;){if(s=Ao(i),s===null)return;if(l=s.tag,l===5||l===6){r=n=s;continue e}i=i.parentNode}}r=r.return}Uv(function(){var u=n,d=ah(a),c=[];e:{var f=m0.get(e);if(f!==void 0){var g=lh,x=e;switch(e){case"keypress":if(ld(a)===0)break e;case"keydown":case"keyup":g=jP;break;case"focusin":x="focus",g=Hp;break;case"focusout":x="blur",g=Hp;break;case"beforeblur":case"afterblur":g=Hp;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":g=Rx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=AP;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=zP;break;case d0:case c0:case f0:g=EP;break;case p0:g=WP;break;case"scroll":g=PP;break;case"wheel":g=KP;break;case"copy":case"cut":case"paste":g=MP;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=Ex}var w=(t&4)!==0,L=!w&&e==="scroll",y=w?f!==null?f+"Capture":null:f;w=[];for(var h=u,m;h!==null;){m=h;var C=m.stateNode;if(m.tag===5&&C!==null&&(m=C,y!==null&&(C=el(h,y),C!=null&&w.push(il(h,C,m)))),L)break;h=h.return}0<w.length&&(f=new g(f,x,null,a,d),c.push({event:f,listeners:w}))}}if((t&7)===0){e:{if(f=e==="mouseover"||e==="pointerover",g=e==="mouseout"||e==="pointerout",f&&a!==gm&&(x=a.relatedTarget||a.fromElement)&&(Ao(x)||x[or]))break e;if((g||f)&&(f=d.window===d?d:(f=d.ownerDocument)?f.defaultView||f.parentWindow:window,g?(x=a.relatedTarget||a.toElement,g=u,x=x?Ao(x):null,x!==null&&(L=Vo(x),x!==L||x.tag!==5&&x.tag!==6)&&(x=null)):(g=null,x=u),g!==x)){if(w=Rx,C="onMouseLeave",y="onMouseEnter",h="mouse",(e==="pointerout"||e==="pointerover")&&(w=Ex,C="onPointerLeave",y="onPointerEnter",h="pointer"),L=g==null?f:Vn(g),m=x==null?f:Vn(x),f=new w(C,h+"leave",g,a,d),f.target=L,f.relatedTarget=m,C=null,Ao(d)===u&&(w=new w(y,h+"enter",x,a,d),w.target=m,w.relatedTarget=L,C=w),L=C,g&&x)t:{for(w=g,y=x,h=0,m=w;m;m=Mn(m))h++;for(m=0,C=y;C;C=Mn(C))m++;for(;0<h-m;)w=Mn(w),h--;for(;0<m-h;)y=Mn(y),m--;for(;h--;){if(w===y||y!==null&&w===y.alternate)break t;w=Mn(w),y=Mn(y)}w=null}else w=null;g!==null&&zx(c,f,g,w,!1),x!==null&&L!==null&&zx(c,L,x,w,!0)}}e:{if(f=u?Vn(u):window,g=f.nodeName&&f.nodeName.toLowerCase(),g==="select"||g==="input"&&f.type==="file")var I=tT;else if(Nx(f))if(n0)I=nT;else{I=rT;var P=aT}else(g=f.nodeName)&&g.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(I=oT);if(I&&(I=I(e,u))){o0(c,I,a,d);break e}P&&P(e,f,u),e==="focusout"&&(P=f._wrapperState)&&P.controlled&&f.type==="number"&&cm(f,"number",f.value)}switch(P=u?Vn(u):window,e){case"focusin":(Nx(P)||P.contentEditable==="true")&&(Bn=P,Lm=u,Gi=null);break;case"focusout":Gi=Lm=Bn=null;break;case"mousedown":Im=!0;break;case"contextmenu":case"mouseup":case"dragend":Im=!1,Ux(c,a,d);break;case"selectionchange":if(lT)break;case"keydown":case"keyup":Ux(c,a,d)}var R;if(dh)e:{switch(e){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else Fn?a0(e,a)&&(A="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(A="onCompositionStart");A&&(t0&&a.locale!=="ko"&&(Fn||A!=="onCompositionStart"?A==="onCompositionEnd"&&Fn&&(R=e0()):(Mr=d,ih="value"in Mr?Mr.value:Mr.textContent,Fn=!0)),P=Ld(u,A),0<P.length&&(A=new _x(A,e,null,a,d),c.push({event:A,listeners:P}),R?A.data=R:(R=r0(a),R!==null&&(A.data=R)))),(R=QP?JP(e,a):YP(e,a))&&(u=Ld(u,"onBeforeInput"),0<u.length&&(d=new _x("onBeforeInput","beforeinput",null,a,d),c.push({event:d,listeners:u}),d.data=R))}h0(c,t)})}function il(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Ld(e,t){for(var a=t+"Capture",r=[];e!==null;){var o=e,n=o.stateNode;o.tag===5&&n!==null&&(o=n,n=el(e,a),n!=null&&r.unshift(il(e,n,o)),n=el(e,t),n!=null&&r.push(il(e,n,o))),e=e.return}return r}function Mn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function zx(e,t,a,r,o){for(var n=t._reactName,s=[];a!==null&&a!==r;){var i=a,l=i.alternate,u=i.stateNode;if(l!==null&&l===r)break;i.tag===5&&u!==null&&(i=u,o?(l=el(a,n),l!=null&&s.unshift(il(a,l,i))):o||(l=el(a,n),l!=null&&s.push(il(a,l,i)))),a=a.return}s.length!==0&&e.push({event:t,listeners:s})}var dT=/\r\n?/g,cT=/\u0000|\uFFFD/g;function $x(e){return(typeof e=="string"?e:""+e).replace(dT,`
6
- `).replace(cT,"")}function ed(e,t,a){if(t=$x(t),$x(e)!==t&&a)throw Error(_(425))}function Id(){}var bm=null,km=null;function Pm(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Tm=typeof setTimeout=="function"?setTimeout:void 0,fT=typeof clearTimeout=="function"?clearTimeout:void 0,Wx=typeof Promise=="function"?Promise:void 0,pT=typeof queueMicrotask=="function"?queueMicrotask:typeof Wx<"u"?function(e){return Wx.resolve(null).then(e).catch(mT)}:Tm;function mT(e){setTimeout(function(){throw e})}function Kp(e,t){var a=t,r=0;do{var o=a.nextSibling;if(e.removeChild(a),o&&o.nodeType===8)if(a=o.data,a==="/$"){if(r===0){e.removeChild(o),rl(t);return}r--}else a!=="$"&&a!=="$?"&&a!=="$!"||r++;a=o}while(a);rl(t)}function Ur(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Gx(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"){if(t===0)return e;t--}else a==="/$"&&t++}e=e.previousSibling}return null}var is=Math.random().toString(36).slice(2),Ea="__reactFiber$"+is,ll="__reactProps$"+is,or="__reactContainer$"+is,Am="__reactEvents$"+is,hT="__reactListeners$"+is,gT="__reactHandles$"+is;function Ao(e){var t=e[Ea];if(t)return t;for(var a=e.parentNode;a;){if(t=a[or]||a[Ea]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Gx(e);e!==null;){if(a=e[Ea])return a;e=Gx(e)}return t}e=a,a=e.parentNode}return null}function yl(e){return e=e[Ea]||e[or],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Vn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(_(33))}function zd(e){return e[ll]||null}var Rm=[],jn=-1;function Gr(e){return{current:e}}function be(e){0>jn||(e.current=Rm[jn],Rm[jn]=null,jn--)}function we(e,t){jn++,Rm[jn]=e.current,e.current=t}var $r={},vt=Gr($r),Et=Gr(!1),Mo=$r;function es(e,t){var a=e.type.contextTypes;if(!a)return $r;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},n;for(n in a)o[n]=t[n];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Dt(e){return e=e.childContextTypes,e!=null}function bd(){be(Et),be(vt)}function Kx(e,t,a){if(vt.current!==$r)throw Error(_(168));we(vt,t),we(Et,a)}function y0(e,t,a){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return a;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(_(108,aP(e)||"Unknown",o));return Ee({},a,r)}function kd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||$r,Mo=vt.current,we(vt,e),we(Et,Et.current),!0}function Xx(e,t,a){var r=e.stateNode;if(!r)throw Error(_(169));a?(e=y0(e,t,Mo),r.__reactInternalMemoizedMergedChildContext=e,be(Et),be(vt),we(vt,e)):be(Et),we(Et,a)}var Za=null,$d=!1,Xp=!1;function x0(e){Za===null?Za=[e]:Za.push(e)}function yT(e){$d=!0,x0(e)}function Kr(){if(!Xp&&Za!==null){Xp=!0;var e=0,t=me;try{var a=Za;for(me=1;e<a.length;e++){var r=a[e];do r=r(!0);while(r!==null)}Za=null,$d=!1}catch(o){throw Za!==null&&(Za=Za.slice(e+1)),Hv(rh,Kr),o}finally{me=t,Xp=!1}}return null}var qn=[],Hn=0,Pd=null,Td=0,oa=[],na=0,No=null,er=1,tr="";function Po(e,t){qn[Hn++]=Td,qn[Hn++]=Pd,Pd=e,Td=t}function v0(e,t,a){oa[na++]=er,oa[na++]=tr,oa[na++]=No,No=e;var r=er;e=tr;var o=32-Sa(r)-1;r&=~(1<<o),a+=1;var n=32-Sa(t)+o;if(30<n){var s=o-o%5;n=(r&(1<<s)-1).toString(32),r>>=s,o-=s,er=1<<32-Sa(t)+o|a<<o|r,tr=n+e}else er=1<<n|a<<o|r,tr=e}function fh(e){e.return!==null&&(Po(e,1),v0(e,1,0))}function ph(e){for(;e===Pd;)Pd=qn[--Hn],qn[Hn]=null,Td=qn[--Hn],qn[Hn]=null;for(;e===No;)No=oa[--na],oa[na]=null,tr=oa[--na],oa[na]=null,er=oa[--na],oa[na]=null}var Wt=null,$t=null,Ae=!1,wa=null;function w0(e,t){var a=sa(5,null,null,0);a.elementType="DELETED",a.stateNode=t,a.return=e,t=e.deletions,t===null?(e.deletions=[a],e.flags|=16):t.push(a)}function Qx(e,t){switch(e.tag){case 5:var a=e.type;return t=t.nodeType!==1||a.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Wt=e,$t=Ur(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Wt=e,$t=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(a=No!==null?{id:er,overflow:tr}:null,e.memoizedState={dehydrated:t,treeContext:a,retryLane:1073741824},a=sa(18,null,null,0),a.stateNode=t,a.return=e,e.child=a,Wt=e,$t=null,!0):!1;default:return!1}}function _m(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Em(e){if(Ae){var t=$t;if(t){var a=t;if(!Qx(e,t)){if(_m(e))throw Error(_(418));t=Ur(a.nextSibling);var r=Wt;t&&Qx(e,t)?w0(r,a):(e.flags=e.flags&-4097|2,Ae=!1,Wt=e)}}else{if(_m(e))throw Error(_(418));e.flags=e.flags&-4097|2,Ae=!1,Wt=e}}}function Jx(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Wt=e}function td(e){if(e!==Wt)return!1;if(!Ae)return Jx(e),Ae=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Pm(e.type,e.memoizedProps)),t&&(t=$t)){if(_m(e))throw S0(),Error(_(418));for(;t;)w0(e,t),t=Ur(t.nextSibling)}if(Jx(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(_(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"){if(t===0){$t=Ur(e.nextSibling);break e}t--}else a!=="$"&&a!=="$!"&&a!=="$?"||t++}e=e.nextSibling}$t=null}}else $t=Wt?Ur(e.stateNode.nextSibling):null;return!0}function S0(){for(var e=$t;e;)e=Ur(e.nextSibling)}function ts(){$t=Wt=null,Ae=!1}function mh(e){wa===null?wa=[e]:wa.push(e)}var xT=ir.ReactCurrentBatchConfig;function Ni(e,t,a){if(e=a.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(a._owner){if(a=a._owner,a){if(a.tag!==1)throw Error(_(309));var r=a.stateNode}if(!r)throw Error(_(147,e));var o=r,n=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===n?t.ref:(t=function(s){var i=o.refs;s===null?delete i[n]:i[n]=s},t._stringRef=n,t)}if(typeof e!="string")throw Error(_(284));if(!a._owner)throw Error(_(290,e))}return e}function ad(e,t){throw e=Object.prototype.toString.call(t),Error(_(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Yx(e){var t=e._init;return t(e._payload)}function C0(e){function t(y,h){if(e){var m=y.deletions;m===null?(y.deletions=[h],y.flags|=16):m.push(h)}}function a(y,h){if(!e)return null;for(;h!==null;)t(y,h),h=h.sibling;return null}function r(y,h){for(y=new Map;h!==null;)h.key!==null?y.set(h.key,h):y.set(h.index,h),h=h.sibling;return y}function o(y,h){return y=Hr(y,h),y.index=0,y.sibling=null,y}function n(y,h,m){return y.index=m,e?(m=y.alternate,m!==null?(m=m.index,m<h?(y.flags|=2,h):m):(y.flags|=2,h)):(y.flags|=1048576,h)}function s(y){return e&&y.alternate===null&&(y.flags|=2),y}function i(y,h,m,C){return h===null||h.tag!==6?(h=am(m,y.mode,C),h.return=y,h):(h=o(h,m),h.return=y,h)}function l(y,h,m,C){var I=m.type;return I===On?d(y,h,m.props.children,C,m.key):h!==null&&(h.elementType===I||typeof I=="object"&&I!==null&&I.$$typeof===Rr&&Yx(I)===h.type)?(C=o(h,m.props),C.ref=Ni(y,h,m),C.return=y,C):(C=hd(m.type,m.key,m.props,null,y.mode,C),C.ref=Ni(y,h,m),C.return=y,C)}function u(y,h,m,C){return h===null||h.tag!==4||h.stateNode.containerInfo!==m.containerInfo||h.stateNode.implementation!==m.implementation?(h=rm(m,y.mode,C),h.return=y,h):(h=o(h,m.children||[]),h.return=y,h)}function d(y,h,m,C,I){return h===null||h.tag!==7?(h=Do(m,y.mode,C,I),h.return=y,h):(h=o(h,m),h.return=y,h)}function c(y,h,m){if(typeof h=="string"&&h!==""||typeof h=="number")return h=am(""+h,y.mode,m),h.return=y,h;if(typeof h=="object"&&h!==null){switch(h.$$typeof){case ju:return m=hd(h.type,h.key,h.props,null,y.mode,m),m.ref=Ni(y,null,h),m.return=y,m;case Nn:return h=rm(h,y.mode,m),h.return=y,h;case Rr:var C=h._init;return c(y,C(h._payload),m)}if(Vi(h)||_i(h))return h=Do(h,y.mode,m,null),h.return=y,h;ad(y,h)}return null}function f(y,h,m,C){var I=h!==null?h.key:null;if(typeof m=="string"&&m!==""||typeof m=="number")return I!==null?null:i(y,h,""+m,C);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case ju:return m.key===I?l(y,h,m,C):null;case Nn:return m.key===I?u(y,h,m,C):null;case Rr:return I=m._init,f(y,h,I(m._payload),C)}if(Vi(m)||_i(m))return I!==null?null:d(y,h,m,C,null);ad(y,m)}return null}function g(y,h,m,C,I){if(typeof C=="string"&&C!==""||typeof C=="number")return y=y.get(m)||null,i(h,y,""+C,I);if(typeof C=="object"&&C!==null){switch(C.$$typeof){case ju:return y=y.get(C.key===null?m:C.key)||null,l(h,y,C,I);case Nn:return y=y.get(C.key===null?m:C.key)||null,u(h,y,C,I);case Rr:var P=C._init;return g(y,h,m,P(C._payload),I)}if(Vi(C)||_i(C))return y=y.get(m)||null,d(h,y,C,I,null);ad(h,C)}return null}function x(y,h,m,C){for(var I=null,P=null,R=h,A=h=0,q=null;R!==null&&A<m.length;A++){R.index>A?(q=R,R=null):q=R.sibling;var U=f(y,R,m[A],C);if(U===null){R===null&&(R=q);break}e&&R&&U.alternate===null&&t(y,R),h=n(U,h,A),P===null?I=U:P.sibling=U,P=U,R=q}if(A===m.length)return a(y,R),Ae&&Po(y,A),I;if(R===null){for(;A<m.length;A++)R=c(y,m[A],C),R!==null&&(h=n(R,h,A),P===null?I=R:P.sibling=R,P=R);return Ae&&Po(y,A),I}for(R=r(y,R);A<m.length;A++)q=g(R,y,A,m[A],C),q!==null&&(e&&q.alternate!==null&&R.delete(q.key===null?A:q.key),h=n(q,h,A),P===null?I=q:P.sibling=q,P=q);return e&&R.forEach(function(J){return t(y,J)}),Ae&&Po(y,A),I}function w(y,h,m,C){var I=_i(m);if(typeof I!="function")throw Error(_(150));if(m=I.call(m),m==null)throw Error(_(151));for(var P=I=null,R=h,A=h=0,q=null,U=m.next();R!==null&&!U.done;A++,U=m.next()){R.index>A?(q=R,R=null):q=R.sibling;var J=f(y,R,U.value,C);if(J===null){R===null&&(R=q);break}e&&R&&J.alternate===null&&t(y,R),h=n(J,h,A),P===null?I=J:P.sibling=J,P=J,R=q}if(U.done)return a(y,R),Ae&&Po(y,A),I;if(R===null){for(;!U.done;A++,U=m.next())U=c(y,U.value,C),U!==null&&(h=n(U,h,A),P===null?I=U:P.sibling=U,P=U);return Ae&&Po(y,A),I}for(R=r(y,R);!U.done;A++,U=m.next())U=g(R,y,A,U.value,C),U!==null&&(e&&U.alternate!==null&&R.delete(U.key===null?A:U.key),h=n(U,h,A),P===null?I=U:P.sibling=U,P=U);return e&&R.forEach(function(ue){return t(y,ue)}),Ae&&Po(y,A),I}function L(y,h,m,C){if(typeof m=="object"&&m!==null&&m.type===On&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case ju:e:{for(var I=m.key,P=h;P!==null;){if(P.key===I){if(I=m.type,I===On){if(P.tag===7){a(y,P.sibling),h=o(P,m.props.children),h.return=y,y=h;break e}}else if(P.elementType===I||typeof I=="object"&&I!==null&&I.$$typeof===Rr&&Yx(I)===P.type){a(y,P.sibling),h=o(P,m.props),h.ref=Ni(y,P,m),h.return=y,y=h;break e}a(y,P);break}else t(y,P);P=P.sibling}m.type===On?(h=Do(m.props.children,y.mode,C,m.key),h.return=y,y=h):(C=hd(m.type,m.key,m.props,null,y.mode,C),C.ref=Ni(y,h,m),C.return=y,y=C)}return s(y);case Nn:e:{for(P=m.key;h!==null;){if(h.key===P)if(h.tag===4&&h.stateNode.containerInfo===m.containerInfo&&h.stateNode.implementation===m.implementation){a(y,h.sibling),h=o(h,m.children||[]),h.return=y,y=h;break e}else{a(y,h);break}else t(y,h);h=h.sibling}h=rm(m,y.mode,C),h.return=y,y=h}return s(y);case Rr:return P=m._init,L(y,h,P(m._payload),C)}if(Vi(m))return x(y,h,m,C);if(_i(m))return w(y,h,m,C);ad(y,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,h!==null&&h.tag===6?(a(y,h.sibling),h=o(h,m),h.return=y,y=h):(a(y,h),h=am(m,y.mode,C),h.return=y,y=h),s(y)):a(y,h)}return L}var as=C0(!0),L0=C0(!1),Ad=Gr(null),Rd=null,zn=null,hh=null;function gh(){hh=zn=Rd=null}function yh(e){var t=Ad.current;be(Ad),e._currentValue=t}function Dm(e,t,a){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===a)break;e=e.return}}function Jn(e,t){Rd=e,hh=zn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(_t=!0),e.firstContext=null)}function la(e){var t=e._currentValue;if(hh!==e)if(e={context:e,memoizedValue:t,next:null},zn===null){if(Rd===null)throw Error(_(308));zn=e,Rd.dependencies={lanes:0,firstContext:e}}else zn=zn.next=e;return t}var Ro=null;function xh(e){Ro===null?Ro=[e]:Ro.push(e)}function I0(e,t,a,r){var o=t.interleaved;return o===null?(a.next=a,xh(t)):(a.next=o.next,o.next=a),t.interleaved=a,nr(e,r)}function nr(e,t){e.lanes|=t;var a=e.alternate;for(a!==null&&(a.lanes|=t),a=e,e=e.return;e!==null;)e.childLanes|=t,a=e.alternate,a!==null&&(a.childLanes|=t),a=e,e=e.return;return a.tag===3?a.stateNode:null}var _r=!1;function vh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function b0(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ar(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Vr(e,t,a){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(de&2)!==0){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,nr(e,a)}return o=r.interleaved,o===null?(t.next=t,xh(r)):(t.next=o.next,o.next=t),r.interleaved=t,nr(e,a)}function ud(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,oh(e,a)}}function Zx(e,t){var a=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var o=null,n=null;if(a=a.firstBaseUpdate,a!==null){do{var s={eventTime:a.eventTime,lane:a.lane,tag:a.tag,payload:a.payload,callback:a.callback,next:null};n===null?o=n=s:n=n.next=s,a=a.next}while(a!==null);n===null?o=n=t:n=n.next=t}else o=n=t;a={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:n,shared:r.shared,effects:r.effects},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}function _d(e,t,a,r){var o=e.updateQueue;_r=!1;var n=o.firstBaseUpdate,s=o.lastBaseUpdate,i=o.shared.pending;if(i!==null){o.shared.pending=null;var l=i,u=l.next;l.next=null,s===null?n=u:s.next=u,s=l;var d=e.alternate;d!==null&&(d=d.updateQueue,i=d.lastBaseUpdate,i!==s&&(i===null?d.firstBaseUpdate=u:i.next=u,d.lastBaseUpdate=l))}if(n!==null){var c=o.baseState;s=0,d=u=l=null,i=n;do{var f=i.lane,g=i.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:g,lane:0,tag:i.tag,payload:i.payload,callback:i.callback,next:null});e:{var x=e,w=i;switch(f=t,g=a,w.tag){case 1:if(x=w.payload,typeof x=="function"){c=x.call(g,c,f);break e}c=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=w.payload,f=typeof x=="function"?x.call(g,c,f):x,f==null)break e;c=Ee({},c,f);break e;case 2:_r=!0}}i.callback!==null&&i.lane!==0&&(e.flags|=64,f=o.effects,f===null?o.effects=[i]:f.push(i))}else g={eventTime:g,lane:f,tag:i.tag,payload:i.payload,callback:i.callback,next:null},d===null?(u=d=g,l=c):d=d.next=g,s|=f;if(i=i.next,i===null){if(i=o.shared.pending,i===null)break;f=i,i=f.next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}while(!0);if(d===null&&(l=c),o.baseState=l,o.firstBaseUpdate=u,o.lastBaseUpdate=d,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else n===null&&(o.shared.lanes=0);Fo|=s,e.lanes=s,e.memoizedState=c}}function ev(e,t,a){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=a,typeof o!="function")throw Error(_(191,o));o.call(r)}}}var xl={},Ma=Gr(xl),ul=Gr(xl),dl=Gr(xl);function _o(e){if(e===xl)throw Error(_(174));return e}function wh(e,t){switch(we(dl,t),we(ul,e),we(Ma,xl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:pm(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=pm(t,e)}be(Ma),we(Ma,t)}function rs(){be(Ma),be(ul),be(dl)}function k0(e){_o(dl.current);var t=_o(Ma.current),a=pm(t,e.type);t!==a&&(we(ul,e),we(Ma,a))}function Sh(e){ul.current===e&&(be(Ma),be(ul))}var Re=Gr(0);function Ed(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||a.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Qp=[];function Ch(){for(var e=0;e<Qp.length;e++)Qp[e]._workInProgressVersionPrimary=null;Qp.length=0}var dd=ir.ReactCurrentDispatcher,Jp=ir.ReactCurrentBatchConfig,Oo=0,_e=null,$e=null,et=null,Dd=!1,Ki=!1,cl=0,vT=0;function gt(){throw Error(_(321))}function Lh(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!La(e[a],t[a]))return!1;return!0}function Ih(e,t,a,r,o,n){if(Oo=n,_e=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,dd.current=e===null||e.memoizedState===null?LT:IT,e=a(r,o),Ki){n=0;do{if(Ki=!1,cl=0,25<=n)throw Error(_(301));n+=1,et=$e=null,t.updateQueue=null,dd.current=bT,e=a(r,o)}while(Ki)}if(dd.current=Md,t=$e!==null&&$e.next!==null,Oo=0,et=$e=_e=null,Dd=!1,t)throw Error(_(300));return e}function bh(){var e=cl!==0;return cl=0,e}function _a(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return et===null?_e.memoizedState=et=e:et=et.next=e,et}function ua(){if($e===null){var e=_e.alternate;e=e!==null?e.memoizedState:null}else e=$e.next;var t=et===null?_e.memoizedState:et.next;if(t!==null)et=t,$e=e;else{if(e===null)throw Error(_(310));$e=e,e={memoizedState:$e.memoizedState,baseState:$e.baseState,baseQueue:$e.baseQueue,queue:$e.queue,next:null},et===null?_e.memoizedState=et=e:et=et.next=e}return et}function fl(e,t){return typeof t=="function"?t(e):t}function Yp(e){var t=ua(),a=t.queue;if(a===null)throw Error(_(311));a.lastRenderedReducer=e;var r=$e,o=r.baseQueue,n=a.pending;if(n!==null){if(o!==null){var s=o.next;o.next=n.next,n.next=s}r.baseQueue=o=n,a.pending=null}if(o!==null){n=o.next,r=r.baseState;var i=s=null,l=null,u=n;do{var d=u.lane;if((Oo&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var c={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(i=l=c,s=r):l=l.next=c,_e.lanes|=d,Fo|=d}u=u.next}while(u!==null&&u!==n);l===null?s=r:l.next=i,La(r,t.memoizedState)||(_t=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=l,a.lastRenderedState=r}if(e=a.interleaved,e!==null){o=e;do n=o.lane,_e.lanes|=n,Fo|=n,o=o.next;while(o!==e)}else o===null&&(a.lanes=0);return[t.memoizedState,a.dispatch]}function Zp(e){var t=ua(),a=t.queue;if(a===null)throw Error(_(311));a.lastRenderedReducer=e;var r=a.dispatch,o=a.pending,n=t.memoizedState;if(o!==null){a.pending=null;var s=o=o.next;do n=e(n,s.action),s=s.next;while(s!==o);La(n,t.memoizedState)||(_t=!0),t.memoizedState=n,t.baseQueue===null&&(t.baseState=n),a.lastRenderedState=n}return[n,r]}function P0(){}function T0(e,t){var a=_e,r=ua(),o=t(),n=!La(r.memoizedState,o);if(n&&(r.memoizedState=o,_t=!0),r=r.queue,kh(_0.bind(null,a,r,e),[e]),r.getSnapshot!==t||n||et!==null&&et.memoizedState.tag&1){if(a.flags|=2048,pl(9,R0.bind(null,a,r,o,t),void 0,null),tt===null)throw Error(_(349));(Oo&30)!==0||A0(a,t,o)}return o}function A0(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=_e.updateQueue,t===null?(t={lastEffect:null,stores:null},_e.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function R0(e,t,a,r){t.value=a,t.getSnapshot=r,E0(t)&&D0(e)}function _0(e,t,a){return a(function(){E0(t)&&D0(e)})}function E0(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!La(e,a)}catch{return!0}}function D0(e){var t=nr(e,1);t!==null&&Ca(t,e,1,-1)}function tv(e){var t=_a();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:fl,lastRenderedState:e},t.queue=e,e=e.dispatch=CT.bind(null,_e,e),[t.memoizedState,e]}function pl(e,t,a,r){return e={tag:e,create:t,destroy:a,deps:r,next:null},t=_e.updateQueue,t===null?(t={lastEffect:null,stores:null},_e.updateQueue=t,t.lastEffect=e.next=e):(a=t.lastEffect,a===null?t.lastEffect=e.next=e:(r=a.next,a.next=e,e.next=r,t.lastEffect=e)),e}function M0(){return ua().memoizedState}function cd(e,t,a,r){var o=_a();_e.flags|=e,o.memoizedState=pl(1|t,a,void 0,r===void 0?null:r)}function Wd(e,t,a,r){var o=ua();r=r===void 0?null:r;var n=void 0;if($e!==null){var s=$e.memoizedState;if(n=s.destroy,r!==null&&Lh(r,s.deps)){o.memoizedState=pl(t,a,n,r);return}}_e.flags|=e,o.memoizedState=pl(1|t,a,n,r)}function av(e,t){return cd(8390656,8,e,t)}function kh(e,t){return Wd(2048,8,e,t)}function N0(e,t){return Wd(4,2,e,t)}function O0(e,t){return Wd(4,4,e,t)}function F0(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function B0(e,t,a){return a=a!=null?a.concat([e]):null,Wd(4,4,F0.bind(null,t,e),a)}function Ph(){}function U0(e,t){var a=ua();t=t===void 0?null:t;var r=a.memoizedState;return r!==null&&t!==null&&Lh(t,r[1])?r[0]:(a.memoizedState=[e,t],e)}function V0(e,t){var a=ua();t=t===void 0?null:t;var r=a.memoizedState;return r!==null&&t!==null&&Lh(t,r[1])?r[0]:(e=e(),a.memoizedState=[e,t],e)}function j0(e,t,a){return(Oo&21)===0?(e.baseState&&(e.baseState=!1,_t=!0),e.memoizedState=a):(La(a,t)||(a=Wv(),_e.lanes|=a,Fo|=a,e.baseState=!0),t)}function wT(e,t){var a=me;me=a!==0&&4>a?a:4,e(!0);var r=Jp.transition;Jp.transition={};try{e(!1),t()}finally{me=a,Jp.transition=r}}function q0(){return ua().memoizedState}function ST(e,t,a){var r=qr(e);if(a={lane:r,action:a,hasEagerState:!1,eagerState:null,next:null},H0(e))z0(t,a);else if(a=I0(e,t,a,r),a!==null){var o=bt();Ca(a,e,r,o),$0(a,t,r)}}function CT(e,t,a){var r=qr(e),o={lane:r,action:a,hasEagerState:!1,eagerState:null,next:null};if(H0(e))z0(t,o);else{var n=e.alternate;if(e.lanes===0&&(n===null||n.lanes===0)&&(n=t.lastRenderedReducer,n!==null))try{var s=t.lastRenderedState,i=n(s,a);if(o.hasEagerState=!0,o.eagerState=i,La(i,s)){var l=t.interleaved;l===null?(o.next=o,xh(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}a=I0(e,t,o,r),a!==null&&(o=bt(),Ca(a,e,r,o),$0(a,t,r))}}function H0(e){var t=e.alternate;return e===_e||t!==null&&t===_e}function z0(e,t){Ki=Dd=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function $0(e,t,a){if((a&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,oh(e,a)}}var Md={readContext:la,useCallback:gt,useContext:gt,useEffect:gt,useImperativeHandle:gt,useInsertionEffect:gt,useLayoutEffect:gt,useMemo:gt,useReducer:gt,useRef:gt,useState:gt,useDebugValue:gt,useDeferredValue:gt,useTransition:gt,useMutableSource:gt,useSyncExternalStore:gt,useId:gt,unstable_isNewReconciler:!1},LT={readContext:la,useCallback:function(e,t){return _a().memoizedState=[e,t===void 0?null:t],e},useContext:la,useEffect:av,useImperativeHandle:function(e,t,a){return a=a!=null?a.concat([e]):null,cd(4194308,4,F0.bind(null,t,e),a)},useLayoutEffect:function(e,t){return cd(4194308,4,e,t)},useInsertionEffect:function(e,t){return cd(4,2,e,t)},useMemo:function(e,t){var a=_a();return t=t===void 0?null:t,e=e(),a.memoizedState=[e,t],e},useReducer:function(e,t,a){var r=_a();return t=a!==void 0?a(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=ST.bind(null,_e,e),[r.memoizedState,e]},useRef:function(e){var t=_a();return e={current:e},t.memoizedState=e},useState:tv,useDebugValue:Ph,useDeferredValue:function(e){return _a().memoizedState=e},useTransition:function(){var e=tv(!1),t=e[0];return e=wT.bind(null,e[1]),_a().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,a){var r=_e,o=_a();if(Ae){if(a===void 0)throw Error(_(407));a=a()}else{if(a=t(),tt===null)throw Error(_(349));(Oo&30)!==0||A0(r,t,a)}o.memoizedState=a;var n={value:a,getSnapshot:t};return o.queue=n,av(_0.bind(null,r,n,e),[e]),r.flags|=2048,pl(9,R0.bind(null,r,n,a,t),void 0,null),a},useId:function(){var e=_a(),t=tt.identifierPrefix;if(Ae){var a=tr,r=er;a=(r&~(1<<32-Sa(r)-1)).toString(32)+a,t=":"+t+"R"+a,a=cl++,0<a&&(t+="H"+a.toString(32)),t+=":"}else a=vT++,t=":"+t+"r"+a.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},IT={readContext:la,useCallback:U0,useContext:la,useEffect:kh,useImperativeHandle:B0,useInsertionEffect:N0,useLayoutEffect:O0,useMemo:V0,useReducer:Yp,useRef:M0,useState:function(){return Yp(fl)},useDebugValue:Ph,useDeferredValue:function(e){var t=ua();return j0(t,$e.memoizedState,e)},useTransition:function(){var e=Yp(fl)[0],t=ua().memoizedState;return[e,t]},useMutableSource:P0,useSyncExternalStore:T0,useId:q0,unstable_isNewReconciler:!1},bT={readContext:la,useCallback:U0,useContext:la,useEffect:kh,useImperativeHandle:B0,useInsertionEffect:N0,useLayoutEffect:O0,useMemo:V0,useReducer:Zp,useRef:M0,useState:function(){return Zp(fl)},useDebugValue:Ph,useDeferredValue:function(e){var t=ua();return $e===null?t.memoizedState=e:j0(t,$e.memoizedState,e)},useTransition:function(){var e=Zp(fl)[0],t=ua().memoizedState;return[e,t]},useMutableSource:P0,useSyncExternalStore:T0,useId:q0,unstable_isNewReconciler:!1};function xa(e,t){if(e&&e.defaultProps){t=Ee({},t),e=e.defaultProps;for(var a in e)t[a]===void 0&&(t[a]=e[a]);return t}return t}function Mm(e,t,a,r){t=e.memoizedState,a=a(r,t),a=a==null?t:Ee({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Gd={isMounted:function(e){return(e=e._reactInternals)?Vo(e)===e:!1},enqueueSetState:function(e,t,a){e=e._reactInternals;var r=bt(),o=qr(e),n=ar(r,o);n.payload=t,a!=null&&(n.callback=a),t=Vr(e,n,o),t!==null&&(Ca(t,e,o,r),ud(t,e,o))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var r=bt(),o=qr(e),n=ar(r,o);n.tag=1,n.payload=t,a!=null&&(n.callback=a),t=Vr(e,n,o),t!==null&&(Ca(t,e,o,r),ud(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=bt(),r=qr(e),o=ar(a,r);o.tag=2,t!=null&&(o.callback=t),t=Vr(e,o,r),t!==null&&(Ca(t,e,r,a),ud(t,e,r))}};function rv(e,t,a,r,o,n,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,n,s):t.prototype&&t.prototype.isPureReactComponent?!nl(a,r)||!nl(o,n):!0}function W0(e,t,a){var r=!1,o=$r,n=t.contextType;return typeof n=="object"&&n!==null?n=la(n):(o=Dt(t)?Mo:vt.current,r=t.contextTypes,n=(r=r!=null)?es(e,o):$r),t=new t(a,n),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Gd,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=n),t}function ov(e,t,a,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,r),t.state!==e&&Gd.enqueueReplaceState(t,t.state,null)}function Nm(e,t,a,r){var o=e.stateNode;o.props=a,o.state=e.memoizedState,o.refs={},vh(e);var n=t.contextType;typeof n=="object"&&n!==null?o.context=la(n):(n=Dt(t)?Mo:vt.current,o.context=es(e,n)),o.state=e.memoizedState,n=t.getDerivedStateFromProps,typeof n=="function"&&(Mm(e,t,n,a),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&Gd.enqueueReplaceState(o,o.state,null),_d(e,a,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function os(e,t){try{var a="",r=t;do a+=tP(r),r=r.return;while(r);var o=a}catch(n){o=`
6
+ `).replace(cT,"")}function ed(e,t,a){if(t=$x(t),$x(e)!==t&&a)throw Error(_(425))}function Id(){}var bm=null,km=null;function Pm(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Tm=typeof setTimeout=="function"?setTimeout:void 0,fT=typeof clearTimeout=="function"?clearTimeout:void 0,Wx=typeof Promise=="function"?Promise:void 0,pT=typeof queueMicrotask=="function"?queueMicrotask:typeof Wx<"u"?function(e){return Wx.resolve(null).then(e).catch(mT)}:Tm;function mT(e){setTimeout(function(){throw e})}function Kp(e,t){var a=t,r=0;do{var o=a.nextSibling;if(e.removeChild(a),o&&o.nodeType===8)if(a=o.data,a==="/$"){if(r===0){e.removeChild(o),rl(t);return}r--}else a!=="$"&&a!=="$?"&&a!=="$!"||r++;a=o}while(a);rl(t)}function Ur(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Gx(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"){if(t===0)return e;t--}else a==="/$"&&t++}e=e.previousSibling}return null}var is=Math.random().toString(36).slice(2),Ea="__reactFiber$"+is,ll="__reactProps$"+is,or="__reactContainer$"+is,Am="__reactEvents$"+is,hT="__reactListeners$"+is,gT="__reactHandles$"+is;function Ao(e){var t=e[Ea];if(t)return t;for(var a=e.parentNode;a;){if(t=a[or]||a[Ea]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Gx(e);e!==null;){if(a=e[Ea])return a;e=Gx(e)}return t}e=a,a=e.parentNode}return null}function yl(e){return e=e[Ea]||e[or],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Vn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(_(33))}function zd(e){return e[ll]||null}var Rm=[],jn=-1;function Gr(e){return{current:e}}function be(e){0>jn||(e.current=Rm[jn],Rm[jn]=null,jn--)}function we(e,t){jn++,Rm[jn]=e.current,e.current=t}var $r={},vt=Gr($r),Et=Gr(!1),Mo=$r;function es(e,t){var a=e.type.contextTypes;if(!a)return $r;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},n;for(n in a)o[n]=t[n];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Dt(e){return e=e.childContextTypes,e!=null}function bd(){be(Et),be(vt)}function Kx(e,t,a){if(vt.current!==$r)throw Error(_(168));we(vt,t),we(Et,a)}function y0(e,t,a){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return a;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(_(108,aP(e)||"Unknown",o));return Ee({},a,r)}function kd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||$r,Mo=vt.current,we(vt,e),we(Et,Et.current),!0}function Xx(e,t,a){var r=e.stateNode;if(!r)throw Error(_(169));a?(e=y0(e,t,Mo),r.__reactInternalMemoizedMergedChildContext=e,be(Et),be(vt),we(vt,e)):be(Et),we(Et,a)}var Za=null,$d=!1,Xp=!1;function x0(e){Za===null?Za=[e]:Za.push(e)}function yT(e){$d=!0,x0(e)}function Kr(){if(!Xp&&Za!==null){Xp=!0;var e=0,t=me;try{var a=Za;for(me=1;e<a.length;e++){var r=a[e];do r=r(!0);while(r!==null)}Za=null,$d=!1}catch(o){throw Za!==null&&(Za=Za.slice(e+1)),Hv(rh,Kr),o}finally{me=t,Xp=!1}}return null}var qn=[],Hn=0,Pd=null,Td=0,oa=[],na=0,No=null,er=1,tr="";function Po(e,t){qn[Hn++]=Td,qn[Hn++]=Pd,Pd=e,Td=t}function v0(e,t,a){oa[na++]=er,oa[na++]=tr,oa[na++]=No,No=e;var r=er;e=tr;var o=32-Sa(r)-1;r&=~(1<<o),a+=1;var n=32-Sa(t)+o;if(30<n){var s=o-o%5;n=(r&(1<<s)-1).toString(32),r>>=s,o-=s,er=1<<32-Sa(t)+o|a<<o|r,tr=n+e}else er=1<<n|a<<o|r,tr=e}function fh(e){e.return!==null&&(Po(e,1),v0(e,1,0))}function ph(e){for(;e===Pd;)Pd=qn[--Hn],qn[Hn]=null,Td=qn[--Hn],qn[Hn]=null;for(;e===No;)No=oa[--na],oa[na]=null,tr=oa[--na],oa[na]=null,er=oa[--na],oa[na]=null}var Wt=null,$t=null,Ae=!1,wa=null;function w0(e,t){var a=sa(5,null,null,0);a.elementType="DELETED",a.stateNode=t,a.return=e,t=e.deletions,t===null?(e.deletions=[a],e.flags|=16):t.push(a)}function Qx(e,t){switch(e.tag){case 5:var a=e.type;return t=t.nodeType!==1||a.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Wt=e,$t=Ur(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Wt=e,$t=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(a=No!==null?{id:er,overflow:tr}:null,e.memoizedState={dehydrated:t,treeContext:a,retryLane:1073741824},a=sa(18,null,null,0),a.stateNode=t,a.return=e,e.child=a,Wt=e,$t=null,!0):!1;default:return!1}}function _m(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Em(e){if(Ae){var t=$t;if(t){var a=t;if(!Qx(e,t)){if(_m(e))throw Error(_(418));t=Ur(a.nextSibling);var r=Wt;t&&Qx(e,t)?w0(r,a):(e.flags=e.flags&-4097|2,Ae=!1,Wt=e)}}else{if(_m(e))throw Error(_(418));e.flags=e.flags&-4097|2,Ae=!1,Wt=e}}}function Jx(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Wt=e}function td(e){if(e!==Wt)return!1;if(!Ae)return Jx(e),Ae=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Pm(e.type,e.memoizedProps)),t&&(t=$t)){if(_m(e))throw S0(),Error(_(418));for(;t;)w0(e,t),t=Ur(t.nextSibling)}if(Jx(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(_(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"){if(t===0){$t=Ur(e.nextSibling);break e}t--}else a!=="$"&&a!=="$!"&&a!=="$?"||t++}e=e.nextSibling}$t=null}}else $t=Wt?Ur(e.stateNode.nextSibling):null;return!0}function S0(){for(var e=$t;e;)e=Ur(e.nextSibling)}function ts(){$t=Wt=null,Ae=!1}function mh(e){wa===null?wa=[e]:wa.push(e)}var xT=ir.ReactCurrentBatchConfig;function Ni(e,t,a){if(e=a.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(a._owner){if(a=a._owner,a){if(a.tag!==1)throw Error(_(309));var r=a.stateNode}if(!r)throw Error(_(147,e));var o=r,n=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===n?t.ref:(t=function(s){var i=o.refs;s===null?delete i[n]:i[n]=s},t._stringRef=n,t)}if(typeof e!="string")throw Error(_(284));if(!a._owner)throw Error(_(290,e))}return e}function ad(e,t){throw e=Object.prototype.toString.call(t),Error(_(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Yx(e){var t=e._init;return t(e._payload)}function C0(e){function t(y,h){if(e){var m=y.deletions;m===null?(y.deletions=[h],y.flags|=16):m.push(h)}}function a(y,h){if(!e)return null;for(;h!==null;)t(y,h),h=h.sibling;return null}function r(y,h){for(y=new Map;h!==null;)h.key!==null?y.set(h.key,h):y.set(h.index,h),h=h.sibling;return y}function o(y,h){return y=Hr(y,h),y.index=0,y.sibling=null,y}function n(y,h,m){return y.index=m,e?(m=y.alternate,m!==null?(m=m.index,m<h?(y.flags|=2,h):m):(y.flags|=2,h)):(y.flags|=1048576,h)}function s(y){return e&&y.alternate===null&&(y.flags|=2),y}function i(y,h,m,C){return h===null||h.tag!==6?(h=am(m,y.mode,C),h.return=y,h):(h=o(h,m),h.return=y,h)}function l(y,h,m,C){var I=m.type;return I===On?d(y,h,m.props.children,C,m.key):h!==null&&(h.elementType===I||typeof I=="object"&&I!==null&&I.$$typeof===Rr&&Yx(I)===h.type)?(C=o(h,m.props),C.ref=Ni(y,h,m),C.return=y,C):(C=hd(m.type,m.key,m.props,null,y.mode,C),C.ref=Ni(y,h,m),C.return=y,C)}function u(y,h,m,C){return h===null||h.tag!==4||h.stateNode.containerInfo!==m.containerInfo||h.stateNode.implementation!==m.implementation?(h=rm(m,y.mode,C),h.return=y,h):(h=o(h,m.children||[]),h.return=y,h)}function d(y,h,m,C,I){return h===null||h.tag!==7?(h=Do(m,y.mode,C,I),h.return=y,h):(h=o(h,m),h.return=y,h)}function c(y,h,m){if(typeof h=="string"&&h!==""||typeof h=="number")return h=am(""+h,y.mode,m),h.return=y,h;if(typeof h=="object"&&h!==null){switch(h.$$typeof){case ju:return m=hd(h.type,h.key,h.props,null,y.mode,m),m.ref=Ni(y,null,h),m.return=y,m;case Nn:return h=rm(h,y.mode,m),h.return=y,h;case Rr:var C=h._init;return c(y,C(h._payload),m)}if(Vi(h)||_i(h))return h=Do(h,y.mode,m,null),h.return=y,h;ad(y,h)}return null}function f(y,h,m,C){var I=h!==null?h.key:null;if(typeof m=="string"&&m!==""||typeof m=="number")return I!==null?null:i(y,h,""+m,C);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case ju:return m.key===I?l(y,h,m,C):null;case Nn:return m.key===I?u(y,h,m,C):null;case Rr:return I=m._init,f(y,h,I(m._payload),C)}if(Vi(m)||_i(m))return I!==null?null:d(y,h,m,C,null);ad(y,m)}return null}function g(y,h,m,C,I){if(typeof C=="string"&&C!==""||typeof C=="number")return y=y.get(m)||null,i(h,y,""+C,I);if(typeof C=="object"&&C!==null){switch(C.$$typeof){case ju:return y=y.get(C.key===null?m:C.key)||null,l(h,y,C,I);case Nn:return y=y.get(C.key===null?m:C.key)||null,u(h,y,C,I);case Rr:var P=C._init;return g(y,h,m,P(C._payload),I)}if(Vi(C)||_i(C))return y=y.get(m)||null,d(h,y,C,I,null);ad(h,C)}return null}function x(y,h,m,C){for(var I=null,P=null,R=h,A=h=0,q=null;R!==null&&A<m.length;A++){R.index>A?(q=R,R=null):q=R.sibling;var B=f(y,R,m[A],C);if(B===null){R===null&&(R=q);break}e&&R&&B.alternate===null&&t(y,R),h=n(B,h,A),P===null?I=B:P.sibling=B,P=B,R=q}if(A===m.length)return a(y,R),Ae&&Po(y,A),I;if(R===null){for(;A<m.length;A++)R=c(y,m[A],C),R!==null&&(h=n(R,h,A),P===null?I=R:P.sibling=R,P=R);return Ae&&Po(y,A),I}for(R=r(y,R);A<m.length;A++)q=g(R,y,A,m[A],C),q!==null&&(e&&q.alternate!==null&&R.delete(q.key===null?A:q.key),h=n(q,h,A),P===null?I=q:P.sibling=q,P=q);return e&&R.forEach(function(J){return t(y,J)}),Ae&&Po(y,A),I}function w(y,h,m,C){var I=_i(m);if(typeof I!="function")throw Error(_(150));if(m=I.call(m),m==null)throw Error(_(151));for(var P=I=null,R=h,A=h=0,q=null,B=m.next();R!==null&&!B.done;A++,B=m.next()){R.index>A?(q=R,R=null):q=R.sibling;var J=f(y,R,B.value,C);if(J===null){R===null&&(R=q);break}e&&R&&J.alternate===null&&t(y,R),h=n(J,h,A),P===null?I=J:P.sibling=J,P=J,R=q}if(B.done)return a(y,R),Ae&&Po(y,A),I;if(R===null){for(;!B.done;A++,B=m.next())B=c(y,B.value,C),B!==null&&(h=n(B,h,A),P===null?I=B:P.sibling=B,P=B);return Ae&&Po(y,A),I}for(R=r(y,R);!B.done;A++,B=m.next())B=g(R,y,A,B.value,C),B!==null&&(e&&B.alternate!==null&&R.delete(B.key===null?A:B.key),h=n(B,h,A),P===null?I=B:P.sibling=B,P=B);return e&&R.forEach(function(ue){return t(y,ue)}),Ae&&Po(y,A),I}function L(y,h,m,C){if(typeof m=="object"&&m!==null&&m.type===On&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case ju:e:{for(var I=m.key,P=h;P!==null;){if(P.key===I){if(I=m.type,I===On){if(P.tag===7){a(y,P.sibling),h=o(P,m.props.children),h.return=y,y=h;break e}}else if(P.elementType===I||typeof I=="object"&&I!==null&&I.$$typeof===Rr&&Yx(I)===P.type){a(y,P.sibling),h=o(P,m.props),h.ref=Ni(y,P,m),h.return=y,y=h;break e}a(y,P);break}else t(y,P);P=P.sibling}m.type===On?(h=Do(m.props.children,y.mode,C,m.key),h.return=y,y=h):(C=hd(m.type,m.key,m.props,null,y.mode,C),C.ref=Ni(y,h,m),C.return=y,y=C)}return s(y);case Nn:e:{for(P=m.key;h!==null;){if(h.key===P)if(h.tag===4&&h.stateNode.containerInfo===m.containerInfo&&h.stateNode.implementation===m.implementation){a(y,h.sibling),h=o(h,m.children||[]),h.return=y,y=h;break e}else{a(y,h);break}else t(y,h);h=h.sibling}h=rm(m,y.mode,C),h.return=y,y=h}return s(y);case Rr:return P=m._init,L(y,h,P(m._payload),C)}if(Vi(m))return x(y,h,m,C);if(_i(m))return w(y,h,m,C);ad(y,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,h!==null&&h.tag===6?(a(y,h.sibling),h=o(h,m),h.return=y,y=h):(a(y,h),h=am(m,y.mode,C),h.return=y,y=h),s(y)):a(y,h)}return L}var as=C0(!0),L0=C0(!1),Ad=Gr(null),Rd=null,zn=null,hh=null;function gh(){hh=zn=Rd=null}function yh(e){var t=Ad.current;be(Ad),e._currentValue=t}function Dm(e,t,a){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===a)break;e=e.return}}function Jn(e,t){Rd=e,hh=zn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(_t=!0),e.firstContext=null)}function la(e){var t=e._currentValue;if(hh!==e)if(e={context:e,memoizedValue:t,next:null},zn===null){if(Rd===null)throw Error(_(308));zn=e,Rd.dependencies={lanes:0,firstContext:e}}else zn=zn.next=e;return t}var Ro=null;function xh(e){Ro===null?Ro=[e]:Ro.push(e)}function I0(e,t,a,r){var o=t.interleaved;return o===null?(a.next=a,xh(t)):(a.next=o.next,o.next=a),t.interleaved=a,nr(e,r)}function nr(e,t){e.lanes|=t;var a=e.alternate;for(a!==null&&(a.lanes|=t),a=e,e=e.return;e!==null;)e.childLanes|=t,a=e.alternate,a!==null&&(a.childLanes|=t),a=e,e=e.return;return a.tag===3?a.stateNode:null}var _r=!1;function vh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function b0(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ar(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Vr(e,t,a){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(de&2)!==0){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,nr(e,a)}return o=r.interleaved,o===null?(t.next=t,xh(r)):(t.next=o.next,o.next=t),r.interleaved=t,nr(e,a)}function ud(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,oh(e,a)}}function Zx(e,t){var a=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var o=null,n=null;if(a=a.firstBaseUpdate,a!==null){do{var s={eventTime:a.eventTime,lane:a.lane,tag:a.tag,payload:a.payload,callback:a.callback,next:null};n===null?o=n=s:n=n.next=s,a=a.next}while(a!==null);n===null?o=n=t:n=n.next=t}else o=n=t;a={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:n,shared:r.shared,effects:r.effects},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}function _d(e,t,a,r){var o=e.updateQueue;_r=!1;var n=o.firstBaseUpdate,s=o.lastBaseUpdate,i=o.shared.pending;if(i!==null){o.shared.pending=null;var l=i,u=l.next;l.next=null,s===null?n=u:s.next=u,s=l;var d=e.alternate;d!==null&&(d=d.updateQueue,i=d.lastBaseUpdate,i!==s&&(i===null?d.firstBaseUpdate=u:i.next=u,d.lastBaseUpdate=l))}if(n!==null){var c=o.baseState;s=0,d=u=l=null,i=n;do{var f=i.lane,g=i.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:g,lane:0,tag:i.tag,payload:i.payload,callback:i.callback,next:null});e:{var x=e,w=i;switch(f=t,g=a,w.tag){case 1:if(x=w.payload,typeof x=="function"){c=x.call(g,c,f);break e}c=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=w.payload,f=typeof x=="function"?x.call(g,c,f):x,f==null)break e;c=Ee({},c,f);break e;case 2:_r=!0}}i.callback!==null&&i.lane!==0&&(e.flags|=64,f=o.effects,f===null?o.effects=[i]:f.push(i))}else g={eventTime:g,lane:f,tag:i.tag,payload:i.payload,callback:i.callback,next:null},d===null?(u=d=g,l=c):d=d.next=g,s|=f;if(i=i.next,i===null){if(i=o.shared.pending,i===null)break;f=i,i=f.next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}while(!0);if(d===null&&(l=c),o.baseState=l,o.firstBaseUpdate=u,o.lastBaseUpdate=d,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else n===null&&(o.shared.lanes=0);Fo|=s,e.lanes=s,e.memoizedState=c}}function ev(e,t,a){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=a,typeof o!="function")throw Error(_(191,o));o.call(r)}}}var xl={},Ma=Gr(xl),ul=Gr(xl),dl=Gr(xl);function _o(e){if(e===xl)throw Error(_(174));return e}function wh(e,t){switch(we(dl,t),we(ul,e),we(Ma,xl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:pm(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=pm(t,e)}be(Ma),we(Ma,t)}function rs(){be(Ma),be(ul),be(dl)}function k0(e){_o(dl.current);var t=_o(Ma.current),a=pm(t,e.type);t!==a&&(we(ul,e),we(Ma,a))}function Sh(e){ul.current===e&&(be(Ma),be(ul))}var Re=Gr(0);function Ed(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||a.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Qp=[];function Ch(){for(var e=0;e<Qp.length;e++)Qp[e]._workInProgressVersionPrimary=null;Qp.length=0}var dd=ir.ReactCurrentDispatcher,Jp=ir.ReactCurrentBatchConfig,Oo=0,_e=null,$e=null,et=null,Dd=!1,Ki=!1,cl=0,vT=0;function gt(){throw Error(_(321))}function Lh(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!La(e[a],t[a]))return!1;return!0}function Ih(e,t,a,r,o,n){if(Oo=n,_e=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,dd.current=e===null||e.memoizedState===null?LT:IT,e=a(r,o),Ki){n=0;do{if(Ki=!1,cl=0,25<=n)throw Error(_(301));n+=1,et=$e=null,t.updateQueue=null,dd.current=bT,e=a(r,o)}while(Ki)}if(dd.current=Md,t=$e!==null&&$e.next!==null,Oo=0,et=$e=_e=null,Dd=!1,t)throw Error(_(300));return e}function bh(){var e=cl!==0;return cl=0,e}function _a(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return et===null?_e.memoizedState=et=e:et=et.next=e,et}function ua(){if($e===null){var e=_e.alternate;e=e!==null?e.memoizedState:null}else e=$e.next;var t=et===null?_e.memoizedState:et.next;if(t!==null)et=t,$e=e;else{if(e===null)throw Error(_(310));$e=e,e={memoizedState:$e.memoizedState,baseState:$e.baseState,baseQueue:$e.baseQueue,queue:$e.queue,next:null},et===null?_e.memoizedState=et=e:et=et.next=e}return et}function fl(e,t){return typeof t=="function"?t(e):t}function Yp(e){var t=ua(),a=t.queue;if(a===null)throw Error(_(311));a.lastRenderedReducer=e;var r=$e,o=r.baseQueue,n=a.pending;if(n!==null){if(o!==null){var s=o.next;o.next=n.next,n.next=s}r.baseQueue=o=n,a.pending=null}if(o!==null){n=o.next,r=r.baseState;var i=s=null,l=null,u=n;do{var d=u.lane;if((Oo&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var c={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(i=l=c,s=r):l=l.next=c,_e.lanes|=d,Fo|=d}u=u.next}while(u!==null&&u!==n);l===null?s=r:l.next=i,La(r,t.memoizedState)||(_t=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=l,a.lastRenderedState=r}if(e=a.interleaved,e!==null){o=e;do n=o.lane,_e.lanes|=n,Fo|=n,o=o.next;while(o!==e)}else o===null&&(a.lanes=0);return[t.memoizedState,a.dispatch]}function Zp(e){var t=ua(),a=t.queue;if(a===null)throw Error(_(311));a.lastRenderedReducer=e;var r=a.dispatch,o=a.pending,n=t.memoizedState;if(o!==null){a.pending=null;var s=o=o.next;do n=e(n,s.action),s=s.next;while(s!==o);La(n,t.memoizedState)||(_t=!0),t.memoizedState=n,t.baseQueue===null&&(t.baseState=n),a.lastRenderedState=n}return[n,r]}function P0(){}function T0(e,t){var a=_e,r=ua(),o=t(),n=!La(r.memoizedState,o);if(n&&(r.memoizedState=o,_t=!0),r=r.queue,kh(_0.bind(null,a,r,e),[e]),r.getSnapshot!==t||n||et!==null&&et.memoizedState.tag&1){if(a.flags|=2048,pl(9,R0.bind(null,a,r,o,t),void 0,null),tt===null)throw Error(_(349));(Oo&30)!==0||A0(a,t,o)}return o}function A0(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=_e.updateQueue,t===null?(t={lastEffect:null,stores:null},_e.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function R0(e,t,a,r){t.value=a,t.getSnapshot=r,E0(t)&&D0(e)}function _0(e,t,a){return a(function(){E0(t)&&D0(e)})}function E0(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!La(e,a)}catch{return!0}}function D0(e){var t=nr(e,1);t!==null&&Ca(t,e,1,-1)}function tv(e){var t=_a();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:fl,lastRenderedState:e},t.queue=e,e=e.dispatch=CT.bind(null,_e,e),[t.memoizedState,e]}function pl(e,t,a,r){return e={tag:e,create:t,destroy:a,deps:r,next:null},t=_e.updateQueue,t===null?(t={lastEffect:null,stores:null},_e.updateQueue=t,t.lastEffect=e.next=e):(a=t.lastEffect,a===null?t.lastEffect=e.next=e:(r=a.next,a.next=e,e.next=r,t.lastEffect=e)),e}function M0(){return ua().memoizedState}function cd(e,t,a,r){var o=_a();_e.flags|=e,o.memoizedState=pl(1|t,a,void 0,r===void 0?null:r)}function Wd(e,t,a,r){var o=ua();r=r===void 0?null:r;var n=void 0;if($e!==null){var s=$e.memoizedState;if(n=s.destroy,r!==null&&Lh(r,s.deps)){o.memoizedState=pl(t,a,n,r);return}}_e.flags|=e,o.memoizedState=pl(1|t,a,n,r)}function av(e,t){return cd(8390656,8,e,t)}function kh(e,t){return Wd(2048,8,e,t)}function N0(e,t){return Wd(4,2,e,t)}function O0(e,t){return Wd(4,4,e,t)}function F0(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function B0(e,t,a){return a=a!=null?a.concat([e]):null,Wd(4,4,F0.bind(null,t,e),a)}function Ph(){}function U0(e,t){var a=ua();t=t===void 0?null:t;var r=a.memoizedState;return r!==null&&t!==null&&Lh(t,r[1])?r[0]:(a.memoizedState=[e,t],e)}function V0(e,t){var a=ua();t=t===void 0?null:t;var r=a.memoizedState;return r!==null&&t!==null&&Lh(t,r[1])?r[0]:(e=e(),a.memoizedState=[e,t],e)}function j0(e,t,a){return(Oo&21)===0?(e.baseState&&(e.baseState=!1,_t=!0),e.memoizedState=a):(La(a,t)||(a=Wv(),_e.lanes|=a,Fo|=a,e.baseState=!0),t)}function wT(e,t){var a=me;me=a!==0&&4>a?a:4,e(!0);var r=Jp.transition;Jp.transition={};try{e(!1),t()}finally{me=a,Jp.transition=r}}function q0(){return ua().memoizedState}function ST(e,t,a){var r=qr(e);if(a={lane:r,action:a,hasEagerState:!1,eagerState:null,next:null},H0(e))z0(t,a);else if(a=I0(e,t,a,r),a!==null){var o=bt();Ca(a,e,r,o),$0(a,t,r)}}function CT(e,t,a){var r=qr(e),o={lane:r,action:a,hasEagerState:!1,eagerState:null,next:null};if(H0(e))z0(t,o);else{var n=e.alternate;if(e.lanes===0&&(n===null||n.lanes===0)&&(n=t.lastRenderedReducer,n!==null))try{var s=t.lastRenderedState,i=n(s,a);if(o.hasEagerState=!0,o.eagerState=i,La(i,s)){var l=t.interleaved;l===null?(o.next=o,xh(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}a=I0(e,t,o,r),a!==null&&(o=bt(),Ca(a,e,r,o),$0(a,t,r))}}function H0(e){var t=e.alternate;return e===_e||t!==null&&t===_e}function z0(e,t){Ki=Dd=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function $0(e,t,a){if((a&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,oh(e,a)}}var Md={readContext:la,useCallback:gt,useContext:gt,useEffect:gt,useImperativeHandle:gt,useInsertionEffect:gt,useLayoutEffect:gt,useMemo:gt,useReducer:gt,useRef:gt,useState:gt,useDebugValue:gt,useDeferredValue:gt,useTransition:gt,useMutableSource:gt,useSyncExternalStore:gt,useId:gt,unstable_isNewReconciler:!1},LT={readContext:la,useCallback:function(e,t){return _a().memoizedState=[e,t===void 0?null:t],e},useContext:la,useEffect:av,useImperativeHandle:function(e,t,a){return a=a!=null?a.concat([e]):null,cd(4194308,4,F0.bind(null,t,e),a)},useLayoutEffect:function(e,t){return cd(4194308,4,e,t)},useInsertionEffect:function(e,t){return cd(4,2,e,t)},useMemo:function(e,t){var a=_a();return t=t===void 0?null:t,e=e(),a.memoizedState=[e,t],e},useReducer:function(e,t,a){var r=_a();return t=a!==void 0?a(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=ST.bind(null,_e,e),[r.memoizedState,e]},useRef:function(e){var t=_a();return e={current:e},t.memoizedState=e},useState:tv,useDebugValue:Ph,useDeferredValue:function(e){return _a().memoizedState=e},useTransition:function(){var e=tv(!1),t=e[0];return e=wT.bind(null,e[1]),_a().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,a){var r=_e,o=_a();if(Ae){if(a===void 0)throw Error(_(407));a=a()}else{if(a=t(),tt===null)throw Error(_(349));(Oo&30)!==0||A0(r,t,a)}o.memoizedState=a;var n={value:a,getSnapshot:t};return o.queue=n,av(_0.bind(null,r,n,e),[e]),r.flags|=2048,pl(9,R0.bind(null,r,n,a,t),void 0,null),a},useId:function(){var e=_a(),t=tt.identifierPrefix;if(Ae){var a=tr,r=er;a=(r&~(1<<32-Sa(r)-1)).toString(32)+a,t=":"+t+"R"+a,a=cl++,0<a&&(t+="H"+a.toString(32)),t+=":"}else a=vT++,t=":"+t+"r"+a.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},IT={readContext:la,useCallback:U0,useContext:la,useEffect:kh,useImperativeHandle:B0,useInsertionEffect:N0,useLayoutEffect:O0,useMemo:V0,useReducer:Yp,useRef:M0,useState:function(){return Yp(fl)},useDebugValue:Ph,useDeferredValue:function(e){var t=ua();return j0(t,$e.memoizedState,e)},useTransition:function(){var e=Yp(fl)[0],t=ua().memoizedState;return[e,t]},useMutableSource:P0,useSyncExternalStore:T0,useId:q0,unstable_isNewReconciler:!1},bT={readContext:la,useCallback:U0,useContext:la,useEffect:kh,useImperativeHandle:B0,useInsertionEffect:N0,useLayoutEffect:O0,useMemo:V0,useReducer:Zp,useRef:M0,useState:function(){return Zp(fl)},useDebugValue:Ph,useDeferredValue:function(e){var t=ua();return $e===null?t.memoizedState=e:j0(t,$e.memoizedState,e)},useTransition:function(){var e=Zp(fl)[0],t=ua().memoizedState;return[e,t]},useMutableSource:P0,useSyncExternalStore:T0,useId:q0,unstable_isNewReconciler:!1};function xa(e,t){if(e&&e.defaultProps){t=Ee({},t),e=e.defaultProps;for(var a in e)t[a]===void 0&&(t[a]=e[a]);return t}return t}function Mm(e,t,a,r){t=e.memoizedState,a=a(r,t),a=a==null?t:Ee({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Gd={isMounted:function(e){return(e=e._reactInternals)?Vo(e)===e:!1},enqueueSetState:function(e,t,a){e=e._reactInternals;var r=bt(),o=qr(e),n=ar(r,o);n.payload=t,a!=null&&(n.callback=a),t=Vr(e,n,o),t!==null&&(Ca(t,e,o,r),ud(t,e,o))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var r=bt(),o=qr(e),n=ar(r,o);n.tag=1,n.payload=t,a!=null&&(n.callback=a),t=Vr(e,n,o),t!==null&&(Ca(t,e,o,r),ud(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=bt(),r=qr(e),o=ar(a,r);o.tag=2,t!=null&&(o.callback=t),t=Vr(e,o,r),t!==null&&(Ca(t,e,r,a),ud(t,e,r))}};function rv(e,t,a,r,o,n,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,n,s):t.prototype&&t.prototype.isPureReactComponent?!nl(a,r)||!nl(o,n):!0}function W0(e,t,a){var r=!1,o=$r,n=t.contextType;return typeof n=="object"&&n!==null?n=la(n):(o=Dt(t)?Mo:vt.current,r=t.contextTypes,n=(r=r!=null)?es(e,o):$r),t=new t(a,n),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Gd,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=n),t}function ov(e,t,a,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,r),t.state!==e&&Gd.enqueueReplaceState(t,t.state,null)}function Nm(e,t,a,r){var o=e.stateNode;o.props=a,o.state=e.memoizedState,o.refs={},vh(e);var n=t.contextType;typeof n=="object"&&n!==null?o.context=la(n):(n=Dt(t)?Mo:vt.current,o.context=es(e,n)),o.state=e.memoizedState,n=t.getDerivedStateFromProps,typeof n=="function"&&(Mm(e,t,n,a),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&Gd.enqueueReplaceState(o,o.state,null),_d(e,a,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function os(e,t){try{var a="",r=t;do a+=tP(r),r=r.return;while(r);var o=a}catch(n){o=`
7
7
  Error generating stack: `+n.message+`
8
- `+n.stack}return{value:e,source:t,stack:o,digest:null}}function em(e,t,a){return{value:e,source:null,stack:a??null,digest:t??null}}function Om(e,t){try{console.error(t.value)}catch(a){setTimeout(function(){throw a})}}var kT=typeof WeakMap=="function"?WeakMap:Map;function G0(e,t,a){a=ar(-1,a),a.tag=3,a.payload={element:null};var r=t.value;return a.callback=function(){Od||(Od=!0,Wm=r),Om(e,t)},a}function K0(e,t,a){a=ar(-1,a),a.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;a.payload=function(){return r(o)},a.callback=function(){Om(e,t)}}var n=e.stateNode;return n!==null&&typeof n.componentDidCatch=="function"&&(a.callback=function(){Om(e,t),typeof r!="function"&&(jr===null?jr=new Set([this]):jr.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),a}function nv(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new kT;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(a)||(o.add(a),e=VT.bind(null,e,t,a),t.then(e,e))}function sv(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function iv(e,t,a,r,o){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,a.flags|=131072,a.flags&=-52805,a.tag===1&&(a.alternate===null?a.tag=17:(t=ar(-1,1),t.tag=2,Vr(a,t,1))),a.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var PT=ir.ReactCurrentOwner,_t=!1;function It(e,t,a,r){t.child=e===null?L0(t,null,a,r):as(t,e.child,a,r)}function lv(e,t,a,r,o){a=a.render;var n=t.ref;return Jn(t,o),r=Ih(e,t,a,r,n,o),a=bh(),e!==null&&!_t?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,sr(e,t,o)):(Ae&&a&&fh(t),t.flags|=1,It(e,t,r,o),t.child)}function uv(e,t,a,r,o){if(e===null){var n=a.type;return typeof n=="function"&&!Nh(n)&&n.defaultProps===void 0&&a.compare===null&&a.defaultProps===void 0?(t.tag=15,t.type=n,X0(e,t,n,r,o)):(e=hd(a.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(n=e.child,(e.lanes&o)===0){var s=n.memoizedProps;if(a=a.compare,a=a!==null?a:nl,a(s,r)&&e.ref===t.ref)return sr(e,t,o)}return t.flags|=1,e=Hr(n,r),e.ref=t.ref,e.return=t,t.child=e}function X0(e,t,a,r,o){if(e!==null){var n=e.memoizedProps;if(nl(n,r)&&e.ref===t.ref)if(_t=!1,t.pendingProps=r=n,(e.lanes&o)!==0)(e.flags&131072)!==0&&(_t=!0);else return t.lanes=e.lanes,sr(e,t,o)}return Fm(e,t,a,r,o)}function Q0(e,t,a){var r=t.pendingProps,o=r.children,n=e!==null?e.memoizedState:null;if(r.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},we(Wn,zt),zt|=a;else{if((a&1073741824)===0)return e=n!==null?n.baseLanes|a:a,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,we(Wn,zt),zt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=n!==null?n.baseLanes:a,we(Wn,zt),zt|=r}else n!==null?(r=n.baseLanes|a,t.memoizedState=null):r=a,we(Wn,zt),zt|=r;return It(e,t,o,a),t.child}function J0(e,t){var a=t.ref;(e===null&&a!==null||e!==null&&e.ref!==a)&&(t.flags|=512,t.flags|=2097152)}function Fm(e,t,a,r,o){var n=Dt(a)?Mo:vt.current;return n=es(t,n),Jn(t,o),a=Ih(e,t,a,r,n,o),r=bh(),e!==null&&!_t?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,sr(e,t,o)):(Ae&&r&&fh(t),t.flags|=1,It(e,t,a,o),t.child)}function dv(e,t,a,r,o){if(Dt(a)){var n=!0;kd(t)}else n=!1;if(Jn(t,o),t.stateNode===null)fd(e,t),W0(t,a,r),Nm(t,a,r,o),r=!0;else if(e===null){var s=t.stateNode,i=t.memoizedProps;s.props=i;var l=s.context,u=a.contextType;typeof u=="object"&&u!==null?u=la(u):(u=Dt(a)?Mo:vt.current,u=es(t,u));var d=a.getDerivedStateFromProps,c=typeof d=="function"||typeof s.getSnapshotBeforeUpdate=="function";c||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(i!==r||l!==u)&&ov(t,s,r,u),_r=!1;var f=t.memoizedState;s.state=f,_d(t,r,s,o),l=t.memoizedState,i!==r||f!==l||Et.current||_r?(typeof d=="function"&&(Mm(t,a,d,r),l=t.memoizedState),(i=_r||rv(t,a,i,r,f,l,u))?(c||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),s.props=r,s.state=l,s.context=u,r=i):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,b0(e,t),i=t.memoizedProps,u=t.type===t.elementType?i:xa(t.type,i),s.props=u,c=t.pendingProps,f=s.context,l=a.contextType,typeof l=="object"&&l!==null?l=la(l):(l=Dt(a)?Mo:vt.current,l=es(t,l));var g=a.getDerivedStateFromProps;(d=typeof g=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(i!==c||f!==l)&&ov(t,s,r,l),_r=!1,f=t.memoizedState,s.state=f,_d(t,r,s,o);var x=t.memoizedState;i!==c||f!==x||Et.current||_r?(typeof g=="function"&&(Mm(t,a,g,r),x=t.memoizedState),(u=_r||rv(t,a,u,r,f,x,l)||!1)?(d||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,x,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,x,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=x),s.props=r,s.state=x,s.context=l,r=u):(typeof s.componentDidUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Bm(e,t,a,r,n,o)}function Bm(e,t,a,r,o,n){J0(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&Xx(t,a,!1),sr(e,t,n);r=t.stateNode,PT.current=t;var i=s&&typeof a.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=as(t,e.child,null,n),t.child=as(t,null,i,n)):It(e,t,i,n),t.memoizedState=r.state,o&&Xx(t,a,!0),t.child}function Y0(e){var t=e.stateNode;t.pendingContext?Kx(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Kx(e,t.context,!1),wh(e,t.containerInfo)}function cv(e,t,a,r,o){return ts(),mh(o),t.flags|=256,It(e,t,a,r),t.child}var Um={dehydrated:null,treeContext:null,retryLane:0};function Vm(e){return{baseLanes:e,cachePool:null,transitions:null}}function Z0(e,t,a){var r=t.pendingProps,o=Re.current,n=!1,s=(t.flags&128)!==0,i;if((i=s)||(i=e!==null&&e.memoizedState===null?!1:(o&2)!==0),i?(n=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),we(Re,o&1),e===null)return Em(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(s=r.children,e=r.fallback,n?(r=t.mode,n=t.child,s={mode:"hidden",children:s},(r&1)===0&&n!==null?(n.childLanes=0,n.pendingProps=s):n=Qd(s,r,0,null),e=Do(e,r,a,null),n.return=t,e.return=t,n.sibling=e,t.child=n,t.child.memoizedState=Vm(a),t.memoizedState=Um,e):Th(t,s));if(o=e.memoizedState,o!==null&&(i=o.dehydrated,i!==null))return TT(e,t,s,r,i,o,a);if(n){n=r.fallback,s=t.mode,o=e.child,i=o.sibling;var l={mode:"hidden",children:r.children};return(s&1)===0&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=Hr(o,l),r.subtreeFlags=o.subtreeFlags&14680064),i!==null?n=Hr(i,n):(n=Do(n,s,a,null),n.flags|=2),n.return=t,r.return=t,r.sibling=n,t.child=r,r=n,n=t.child,s=e.child.memoizedState,s=s===null?Vm(a):{baseLanes:s.baseLanes|a,cachePool:null,transitions:s.transitions},n.memoizedState=s,n.childLanes=e.childLanes&~a,t.memoizedState=Um,r}return n=e.child,e=n.sibling,r=Hr(n,{mode:"visible",children:r.children}),(t.mode&1)===0&&(r.lanes=a),r.return=t,r.sibling=null,e!==null&&(a=t.deletions,a===null?(t.deletions=[e],t.flags|=16):a.push(e)),t.child=r,t.memoizedState=null,r}function Th(e,t){return t=Qd({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function rd(e,t,a,r){return r!==null&&mh(r),as(t,e.child,null,a),e=Th(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function TT(e,t,a,r,o,n,s){if(a)return t.flags&256?(t.flags&=-257,r=em(Error(_(422))),rd(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(n=r.fallback,o=t.mode,r=Qd({mode:"visible",children:r.children},o,0,null),n=Do(n,o,s,null),n.flags|=2,r.return=t,n.return=t,r.sibling=n,t.child=r,(t.mode&1)!==0&&as(t,e.child,null,s),t.child.memoizedState=Vm(s),t.memoizedState=Um,n);if((t.mode&1)===0)return rd(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var i=r.dgst;return r=i,n=Error(_(419)),r=em(n,r,void 0),rd(e,t,s,r)}if(i=(s&e.childLanes)!==0,_t||i){if(r=tt,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=(o&(r.suspendedLanes|s))!==0?0:o,o!==0&&o!==n.retryLane&&(n.retryLane=o,nr(e,o),Ca(r,e,o,-1))}return Mh(),r=em(Error(_(421))),rd(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=jT.bind(null,e),o._reactRetry=t,null):(e=n.treeContext,$t=Ur(o.nextSibling),Wt=t,Ae=!0,wa=null,e!==null&&(oa[na++]=er,oa[na++]=tr,oa[na++]=No,er=e.id,tr=e.overflow,No=t),t=Th(t,r.children),t.flags|=4096,t)}function fv(e,t,a){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Dm(e.return,t,a)}function tm(e,t,a,r,o){var n=e.memoizedState;n===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:a,tailMode:o}:(n.isBackwards=t,n.rendering=null,n.renderingStartTime=0,n.last=r,n.tail=a,n.tailMode=o)}function ew(e,t,a){var r=t.pendingProps,o=r.revealOrder,n=r.tail;if(It(e,t,r.children,a),r=Re.current,(r&2)!==0)r=r&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&fv(e,a,t);else if(e.tag===19)fv(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(we(Re,r),(t.mode&1)===0)t.memoizedState=null;else switch(o){case"forwards":for(a=t.child,o=null;a!==null;)e=a.alternate,e!==null&&Ed(e)===null&&(o=a),a=a.sibling;a=o,a===null?(o=t.child,t.child=null):(o=a.sibling,a.sibling=null),tm(t,!1,o,a,n);break;case"backwards":for(a=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Ed(e)===null){t.child=o;break}e=o.sibling,o.sibling=a,a=o,o=e}tm(t,!0,a,null,n);break;case"together":tm(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function fd(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function sr(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Fo|=t.lanes,(a&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(_(153));if(t.child!==null){for(e=t.child,a=Hr(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Hr(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function AT(e,t,a){switch(t.tag){case 3:Y0(t),ts();break;case 5:k0(t);break;case 1:Dt(t.type)&&kd(t);break;case 4:wh(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;we(Ad,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(we(Re,Re.current&1),t.flags|=128,null):(a&t.child.childLanes)!==0?Z0(e,t,a):(we(Re,Re.current&1),e=sr(e,t,a),e!==null?e.sibling:null);we(Re,Re.current&1);break;case 19:if(r=(a&t.childLanes)!==0,(e.flags&128)!==0){if(r)return ew(e,t,a);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),we(Re,Re.current),r)break;return null;case 22:case 23:return t.lanes=0,Q0(e,t,a)}return sr(e,t,a)}var tw,jm,aw,rw;tw=function(e,t){for(var a=t.child;a!==null;){if(a.tag===5||a.tag===6)e.appendChild(a.stateNode);else if(a.tag!==4&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return;a=a.return}a.sibling.return=a.return,a=a.sibling}};jm=function(){};aw=function(e,t,a,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,_o(Ma.current);var n=null;switch(a){case"input":o=um(e,o),r=um(e,r),n=[];break;case"select":o=Ee({},o,{value:void 0}),r=Ee({},r,{value:void 0}),n=[];break;case"textarea":o=fm(e,o),r=fm(e,r),n=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Id)}mm(a,r);var s;a=null;for(u in o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var i=o[u];for(s in i)i.hasOwnProperty(s)&&(a||(a={}),a[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Yi.hasOwnProperty(u)?n||(n=[]):(n=n||[]).push(u,null));for(u in r){var l=r[u];if(i=o?.[u],r.hasOwnProperty(u)&&l!==i&&(l!=null||i!=null))if(u==="style")if(i){for(s in i)!i.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(a||(a={}),a[s]="");for(s in l)l.hasOwnProperty(s)&&i[s]!==l[s]&&(a||(a={}),a[s]=l[s])}else a||(n||(n=[]),n.push(u,a)),a=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,i=i?i.__html:void 0,l!=null&&i!==l&&(n=n||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(n=n||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Yi.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&Ie("scroll",e),n||i===l||(n=[])):(n=n||[]).push(u,l))}a&&(n=n||[]).push("style",a);var u=n;(t.updateQueue=u)&&(t.flags|=4)}};rw=function(e,t,a,r){a!==r&&(t.flags|=4)};function Oi(e,t){if(!Ae)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var r=null;a!==null;)a.alternate!==null&&(r=a),a=a.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function yt(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,r=0;if(t)for(var o=e.child;o!==null;)a|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)a|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=a,t}function RT(e,t,a){var r=t.pendingProps;switch(ph(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yt(t),null;case 1:return Dt(t.type)&&bd(),yt(t),null;case 3:return r=t.stateNode,rs(),be(Et),be(vt),Ch(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(td(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,wa!==null&&(Xm(wa),wa=null))),jm(e,t),yt(t),null;case 5:Sh(t);var o=_o(dl.current);if(a=t.type,e!==null&&t.stateNode!=null)aw(e,t,a,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(_(166));return yt(t),null}if(e=_o(Ma.current),td(t)){r=t.stateNode,a=t.type;var n=t.memoizedProps;switch(r[Ea]=t,r[ll]=n,e=(t.mode&1)!==0,a){case"dialog":Ie("cancel",r),Ie("close",r);break;case"iframe":case"object":case"embed":Ie("load",r);break;case"video":case"audio":for(o=0;o<qi.length;o++)Ie(qi[o],r);break;case"source":Ie("error",r);break;case"img":case"image":case"link":Ie("error",r),Ie("load",r);break;case"details":Ie("toggle",r);break;case"input":wx(r,n),Ie("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!n.multiple},Ie("invalid",r);break;case"textarea":Cx(r,n),Ie("invalid",r)}mm(a,n),o=null;for(var s in n)if(n.hasOwnProperty(s)){var i=n[s];s==="children"?typeof i=="string"?r.textContent!==i&&(n.suppressHydrationWarning!==!0&&ed(r.textContent,i,e),o=["children",i]):typeof i=="number"&&r.textContent!==""+i&&(n.suppressHydrationWarning!==!0&&ed(r.textContent,i,e),o=["children",""+i]):Yi.hasOwnProperty(s)&&i!=null&&s==="onScroll"&&Ie("scroll",r)}switch(a){case"input":qu(r),Sx(r,n,!0);break;case"textarea":qu(r),Lx(r);break;case"select":case"option":break;default:typeof n.onClick=="function"&&(r.onclick=Id)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=_v(a)),e==="http://www.w3.org/1999/xhtml"?a==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(a,{is:r.is}):(e=s.createElement(a),a==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,a),e[Ea]=t,e[ll]=r,tw(e,t,!1,!1),t.stateNode=e;e:{switch(s=hm(a,r),a){case"dialog":Ie("cancel",e),Ie("close",e),o=r;break;case"iframe":case"object":case"embed":Ie("load",e),o=r;break;case"video":case"audio":for(o=0;o<qi.length;o++)Ie(qi[o],e);o=r;break;case"source":Ie("error",e),o=r;break;case"img":case"image":case"link":Ie("error",e),Ie("load",e),o=r;break;case"details":Ie("toggle",e),o=r;break;case"input":wx(e,r),o=um(e,r),Ie("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Ee({},r,{value:void 0}),Ie("invalid",e);break;case"textarea":Cx(e,r),o=fm(e,r),Ie("invalid",e);break;default:o=r}mm(a,o),i=o;for(n in i)if(i.hasOwnProperty(n)){var l=i[n];n==="style"?Mv(e,l):n==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Ev(e,l)):n==="children"?typeof l=="string"?(a!=="textarea"||l!=="")&&Zi(e,l):typeof l=="number"&&Zi(e,""+l):n!=="suppressContentEditableWarning"&&n!=="suppressHydrationWarning"&&n!=="autoFocus"&&(Yi.hasOwnProperty(n)?l!=null&&n==="onScroll"&&Ie("scroll",e):l!=null&&Ym(e,n,l,s))}switch(a){case"input":qu(e),Sx(e,r,!1);break;case"textarea":qu(e),Lx(e);break;case"option":r.value!=null&&e.setAttribute("value",""+zr(r.value));break;case"select":e.multiple=!!r.multiple,n=r.value,n!=null?Gn(e,!!r.multiple,n,!1):r.defaultValue!=null&&Gn(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Id)}switch(a){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return yt(t),null;case 6:if(e&&t.stateNode!=null)rw(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(_(166));if(a=_o(dl.current),_o(Ma.current),td(t)){if(r=t.stateNode,a=t.memoizedProps,r[Ea]=t,(n=r.nodeValue!==a)&&(e=Wt,e!==null))switch(e.tag){case 3:ed(r.nodeValue,a,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ed(r.nodeValue,a,(e.mode&1)!==0)}n&&(t.flags|=4)}else r=(a.nodeType===9?a:a.ownerDocument).createTextNode(r),r[Ea]=t,t.stateNode=r}return yt(t),null;case 13:if(be(Re),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ae&&$t!==null&&(t.mode&1)!==0&&(t.flags&128)===0)S0(),ts(),t.flags|=98560,n=!1;else if(n=td(t),r!==null&&r.dehydrated!==null){if(e===null){if(!n)throw Error(_(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(_(317));n[Ea]=t}else ts(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;yt(t),n=!1}else wa!==null&&(Xm(wa),wa=null),n=!0;if(!n)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=a,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(Re.current&1)!==0?We===0&&(We=3):Mh())),t.updateQueue!==null&&(t.flags|=4),yt(t),null);case 4:return rs(),jm(e,t),e===null&&sl(t.stateNode.containerInfo),yt(t),null;case 10:return yh(t.type._context),yt(t),null;case 17:return Dt(t.type)&&bd(),yt(t),null;case 19:if(be(Re),n=t.memoizedState,n===null)return yt(t),null;if(r=(t.flags&128)!==0,s=n.rendering,s===null)if(r)Oi(n,!1);else{if(We!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(s=Ed(e),s!==null){for(t.flags|=128,Oi(n,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=a,a=t.child;a!==null;)n=a,e=r,n.flags&=14680066,s=n.alternate,s===null?(n.childLanes=0,n.lanes=e,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=s.childLanes,n.lanes=s.lanes,n.child=s.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=s.memoizedProps,n.memoizedState=s.memoizedState,n.updateQueue=s.updateQueue,n.type=s.type,e=s.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),a=a.sibling;return we(Re,Re.current&1|2),t.child}e=e.sibling}n.tail!==null&&Fe()>ns&&(t.flags|=128,r=!0,Oi(n,!1),t.lanes=4194304)}else{if(!r)if(e=Ed(s),e!==null){if(t.flags|=128,r=!0,a=e.updateQueue,a!==null&&(t.updateQueue=a,t.flags|=4),Oi(n,!0),n.tail===null&&n.tailMode==="hidden"&&!s.alternate&&!Ae)return yt(t),null}else 2*Fe()-n.renderingStartTime>ns&&a!==1073741824&&(t.flags|=128,r=!0,Oi(n,!1),t.lanes=4194304);n.isBackwards?(s.sibling=t.child,t.child=s):(a=n.last,a!==null?a.sibling=s:t.child=s,n.last=s)}return n.tail!==null?(t=n.tail,n.rendering=t,n.tail=t.sibling,n.renderingStartTime=Fe(),t.sibling=null,a=Re.current,we(Re,r?a&1|2:a&1),t):(yt(t),null);case 22:case 23:return Dh(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(zt&1073741824)!==0&&(yt(t),t.subtreeFlags&6&&(t.flags|=8192)):yt(t),null;case 24:return null;case 25:return null}throw Error(_(156,t.tag))}function _T(e,t){switch(ph(t),t.tag){case 1:return Dt(t.type)&&bd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return rs(),be(Et),be(vt),Ch(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Sh(t),null;case 13:if(be(Re),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(_(340));ts()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return be(Re),null;case 4:return rs(),null;case 10:return yh(t.type._context),null;case 22:case 23:return Dh(),null;case 24:return null;default:return null}}var od=!1,xt=!1,ET=typeof WeakSet=="function"?WeakSet:Set,B=null;function $n(e,t){var a=e.ref;if(a!==null)if(typeof a=="function")try{a(null)}catch(r){Ne(e,t,r)}else a.current=null}function qm(e,t,a){try{a()}catch(r){Ne(e,t,r)}}var pv=!1;function DT(e,t){if(bm=Sd,e=l0(),ch(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var r=a.getSelection&&a.getSelection();if(r&&r.rangeCount!==0){a=r.anchorNode;var o=r.anchorOffset,n=r.focusNode;r=r.focusOffset;try{a.nodeType,n.nodeType}catch{a=null;break e}var s=0,i=-1,l=-1,u=0,d=0,c=e,f=null;t:for(;;){for(var g;c!==a||o!==0&&c.nodeType!==3||(i=s+o),c!==n||r!==0&&c.nodeType!==3||(l=s+r),c.nodeType===3&&(s+=c.nodeValue.length),(g=c.firstChild)!==null;)f=c,c=g;for(;;){if(c===e)break t;if(f===a&&++u===o&&(i=s),f===n&&++d===r&&(l=s),(g=c.nextSibling)!==null)break;c=f,f=c.parentNode}c=g}a=i===-1||l===-1?null:{start:i,end:l}}else a=null}a=a||{start:0,end:0}}else a=null;for(km={focusedElem:e,selectionRange:a},Sd=!1,B=t;B!==null;)if(t=B,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,B=e;else for(;B!==null;){t=B;try{var x=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var w=x.memoizedProps,L=x.memoizedState,y=t.stateNode,h=y.getSnapshotBeforeUpdate(t.elementType===t.type?w:xa(t.type,w),L);y.__reactInternalSnapshotBeforeUpdate=h}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(_(163))}}catch(C){Ne(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,B=e;break}B=t.return}return x=pv,pv=!1,x}function Xi(e,t,a){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var n=o.destroy;o.destroy=void 0,n!==void 0&&qm(t,a,n)}o=o.next}while(o!==r)}}function Kd(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var a=t=t.next;do{if((a.tag&e)===e){var r=a.create;a.destroy=r()}a=a.next}while(a!==t)}}function Hm(e){var t=e.ref;if(t!==null){var a=e.stateNode;e.tag,e=a,typeof t=="function"?t(e):t.current=e}}function ow(e){var t=e.alternate;t!==null&&(e.alternate=null,ow(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ea],delete t[ll],delete t[Am],delete t[hT],delete t[gT])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function nw(e){return e.tag===5||e.tag===3||e.tag===4}function mv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||nw(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function zm(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?a.nodeType===8?a.parentNode.insertBefore(e,t):a.insertBefore(e,t):(a.nodeType===8?(t=a.parentNode,t.insertBefore(e,a)):(t=a,t.appendChild(e)),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Id));else if(r!==4&&(e=e.child,e!==null))for(zm(e,t,a),e=e.sibling;e!==null;)zm(e,t,a),e=e.sibling}function $m(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for($m(e,t,a),e=e.sibling;e!==null;)$m(e,t,a),e=e.sibling}var ot=null,va=!1;function Ar(e,t,a){for(a=a.child;a!==null;)sw(e,t,a),a=a.sibling}function sw(e,t,a){if(Da&&typeof Da.onCommitFiberUnmount=="function")try{Da.onCommitFiberUnmount(Vd,a)}catch{}switch(a.tag){case 5:xt||$n(a,t);case 6:var r=ot,o=va;ot=null,Ar(e,t,a),ot=r,va=o,ot!==null&&(va?(e=ot,a=a.stateNode,e.nodeType===8?e.parentNode.removeChild(a):e.removeChild(a)):ot.removeChild(a.stateNode));break;case 18:ot!==null&&(va?(e=ot,a=a.stateNode,e.nodeType===8?Kp(e.parentNode,a):e.nodeType===1&&Kp(e,a),rl(e)):Kp(ot,a.stateNode));break;case 4:r=ot,o=va,ot=a.stateNode.containerInfo,va=!0,Ar(e,t,a),ot=r,va=o;break;case 0:case 11:case 14:case 15:if(!xt&&(r=a.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var n=o,s=n.destroy;n=n.tag,s!==void 0&&((n&2)!==0||(n&4)!==0)&&qm(a,t,s),o=o.next}while(o!==r)}Ar(e,t,a);break;case 1:if(!xt&&($n(a,t),r=a.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=a.memoizedProps,r.state=a.memoizedState,r.componentWillUnmount()}catch(i){Ne(a,t,i)}Ar(e,t,a);break;case 21:Ar(e,t,a);break;case 22:a.mode&1?(xt=(r=xt)||a.memoizedState!==null,Ar(e,t,a),xt=r):Ar(e,t,a);break;default:Ar(e,t,a)}}function hv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var a=e.stateNode;a===null&&(a=e.stateNode=new ET),t.forEach(function(r){var o=qT.bind(null,e,r);a.has(r)||(a.add(r),r.then(o,o))})}}function ya(e,t){var a=t.deletions;if(a!==null)for(var r=0;r<a.length;r++){var o=a[r];try{var n=e,s=t,i=s;e:for(;i!==null;){switch(i.tag){case 5:ot=i.stateNode,va=!1;break e;case 3:ot=i.stateNode.containerInfo,va=!0;break e;case 4:ot=i.stateNode.containerInfo,va=!0;break e}i=i.return}if(ot===null)throw Error(_(160));sw(n,s,o),ot=null,va=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(u){Ne(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)iw(t,e),t=t.sibling}function iw(e,t){var a=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ya(t,e),Ra(e),r&4){try{Xi(3,e,e.return),Kd(3,e)}catch(w){Ne(e,e.return,w)}try{Xi(5,e,e.return)}catch(w){Ne(e,e.return,w)}}break;case 1:ya(t,e),Ra(e),r&512&&a!==null&&$n(a,a.return);break;case 5:if(ya(t,e),Ra(e),r&512&&a!==null&&$n(a,a.return),e.flags&32){var o=e.stateNode;try{Zi(o,"")}catch(w){Ne(e,e.return,w)}}if(r&4&&(o=e.stateNode,o!=null)){var n=e.memoizedProps,s=a!==null?a.memoizedProps:n,i=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{i==="input"&&n.type==="radio"&&n.name!=null&&Av(o,n),hm(i,s);var u=hm(i,n);for(s=0;s<l.length;s+=2){var d=l[s],c=l[s+1];d==="style"?Mv(o,c):d==="dangerouslySetInnerHTML"?Ev(o,c):d==="children"?Zi(o,c):Ym(o,d,c,u)}switch(i){case"input":dm(o,n);break;case"textarea":Rv(o,n);break;case"select":var f=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!n.multiple;var g=n.value;g!=null?Gn(o,!!n.multiple,g,!1):f!==!!n.multiple&&(n.defaultValue!=null?Gn(o,!!n.multiple,n.defaultValue,!0):Gn(o,!!n.multiple,n.multiple?[]:"",!1))}o[ll]=n}catch(w){Ne(e,e.return,w)}}break;case 6:if(ya(t,e),Ra(e),r&4){if(e.stateNode===null)throw Error(_(162));o=e.stateNode,n=e.memoizedProps;try{o.nodeValue=n}catch(w){Ne(e,e.return,w)}}break;case 3:if(ya(t,e),Ra(e),r&4&&a!==null&&a.memoizedState.isDehydrated)try{rl(t.containerInfo)}catch(w){Ne(e,e.return,w)}break;case 4:ya(t,e),Ra(e);break;case 13:ya(t,e),Ra(e),o=e.child,o.flags&8192&&(n=o.memoizedState!==null,o.stateNode.isHidden=n,!n||o.alternate!==null&&o.alternate.memoizedState!==null||(_h=Fe())),r&4&&hv(e);break;case 22:if(d=a!==null&&a.memoizedState!==null,e.mode&1?(xt=(u=xt)||d,ya(t,e),xt=u):ya(t,e),Ra(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&(e.mode&1)!==0)for(B=e,d=e.child;d!==null;){for(c=B=d;B!==null;){switch(f=B,g=f.child,f.tag){case 0:case 11:case 14:case 15:Xi(4,f,f.return);break;case 1:$n(f,f.return);var x=f.stateNode;if(typeof x.componentWillUnmount=="function"){r=f,a=f.return;try{t=r,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(w){Ne(r,a,w)}}break;case 5:$n(f,f.return);break;case 22:if(f.memoizedState!==null){yv(c);continue}}g!==null?(g.return=f,B=g):yv(c)}d=d.sibling}e:for(d=null,c=e;;){if(c.tag===5){if(d===null){d=c;try{o=c.stateNode,u?(n=o.style,typeof n.setProperty=="function"?n.setProperty("display","none","important"):n.display="none"):(i=c.stateNode,l=c.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,i.style.display=Dv("display",s))}catch(w){Ne(e,e.return,w)}}}else if(c.tag===6){if(d===null)try{c.stateNode.nodeValue=u?"":c.memoizedProps}catch(w){Ne(e,e.return,w)}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===e)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===e)break e;for(;c.sibling===null;){if(c.return===null||c.return===e)break e;d===c&&(d=null),c=c.return}d===c&&(d=null),c.sibling.return=c.return,c=c.sibling}}break;case 19:ya(t,e),Ra(e),r&4&&hv(e);break;case 21:break;default:ya(t,e),Ra(e)}}function Ra(e){var t=e.flags;if(t&2){try{e:{for(var a=e.return;a!==null;){if(nw(a)){var r=a;break e}a=a.return}throw Error(_(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(Zi(o,""),r.flags&=-33);var n=mv(e);$m(e,n,o);break;case 3:case 4:var s=r.stateNode.containerInfo,i=mv(e);zm(e,i,s);break;default:throw Error(_(161))}}catch(l){Ne(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function MT(e,t,a){B=e,lw(e,t,a)}function lw(e,t,a){for(var r=(e.mode&1)!==0;B!==null;){var o=B,n=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||od;if(!s){var i=o.alternate,l=i!==null&&i.memoizedState!==null||xt;i=od;var u=xt;if(od=s,(xt=l)&&!u)for(B=o;B!==null;)s=B,l=s.child,s.tag===22&&s.memoizedState!==null?xv(o):l!==null?(l.return=s,B=l):xv(o);for(;n!==null;)B=n,lw(n,t,a),n=n.sibling;B=o,od=i,xt=u}gv(e,t,a)}else(o.subtreeFlags&8772)!==0&&n!==null?(n.return=o,B=n):gv(e,t,a)}}function gv(e){for(;B!==null;){var t=B;if((t.flags&8772)!==0){var a=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:xt||Kd(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!xt)if(a===null)r.componentDidMount();else{var o=t.elementType===t.type?a.memoizedProps:xa(t.type,a.memoizedProps);r.componentDidUpdate(o,a.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var n=t.updateQueue;n!==null&&ev(t,n,r);break;case 3:var s=t.updateQueue;if(s!==null){if(a=null,t.child!==null)switch(t.child.tag){case 5:a=t.child.stateNode;break;case 1:a=t.child.stateNode}ev(t,s,a)}break;case 5:var i=t.stateNode;if(a===null&&t.flags&4){a=i;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&a.focus();break;case"img":l.src&&(a.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var c=d.dehydrated;c!==null&&rl(c)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(_(163))}xt||t.flags&512&&Hm(t)}catch(f){Ne(t,t.return,f)}}if(t===e){B=null;break}if(a=t.sibling,a!==null){a.return=t.return,B=a;break}B=t.return}}function yv(e){for(;B!==null;){var t=B;if(t===e){B=null;break}var a=t.sibling;if(a!==null){a.return=t.return,B=a;break}B=t.return}}function xv(e){for(;B!==null;){var t=B;try{switch(t.tag){case 0:case 11:case 15:var a=t.return;try{Kd(4,t)}catch(l){Ne(t,a,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(l){Ne(t,o,l)}}var n=t.return;try{Hm(t)}catch(l){Ne(t,n,l)}break;case 5:var s=t.return;try{Hm(t)}catch(l){Ne(t,s,l)}}}catch(l){Ne(t,t.return,l)}if(t===e){B=null;break}var i=t.sibling;if(i!==null){i.return=t.return,B=i;break}B=t.return}}var NT=Math.ceil,Nd=ir.ReactCurrentDispatcher,Ah=ir.ReactCurrentOwner,ia=ir.ReactCurrentBatchConfig,de=0,tt=null,Ve=null,nt=0,zt=0,Wn=Gr(0),We=0,ml=null,Fo=0,Xd=0,Rh=0,Qi=null,Rt=null,_h=0,ns=1/0,Ya=null,Od=!1,Wm=null,jr=null,nd=!1,Nr=null,Fd=0,Ji=0,Gm=null,pd=-1,md=0;function bt(){return(de&6)!==0?Fe():pd!==-1?pd:pd=Fe()}function qr(e){return(e.mode&1)===0?1:(de&2)!==0&&nt!==0?nt&-nt:xT.transition!==null?(md===0&&(md=Wv()),md):(e=me,e!==0||(e=window.event,e=e===void 0?16:Zv(e.type)),e)}function Ca(e,t,a,r){if(50<Ji)throw Ji=0,Gm=null,Error(_(185));hl(e,a,r),((de&2)===0||e!==tt)&&(e===tt&&((de&2)===0&&(Xd|=a),We===4&&Dr(e,nt)),Mt(e,r),a===1&&de===0&&(t.mode&1)===0&&(ns=Fe()+500,$d&&Kr()))}function Mt(e,t){var a=e.callbackNode;wP(e,t);var r=wd(e,e===tt?nt:0);if(r===0)a!==null&&kx(a),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(a!=null&&kx(a),t===1)e.tag===0?yT(vv.bind(null,e)):x0(vv.bind(null,e)),pT(function(){(de&6)===0&&Kr()}),a=null;else{switch(Gv(r)){case 1:a=rh;break;case 4:a=zv;break;case 16:a=vd;break;case 536870912:a=$v;break;default:a=vd}a=gw(a,uw.bind(null,e))}e.callbackPriority=t,e.callbackNode=a}}function uw(e,t){if(pd=-1,md=0,(de&6)!==0)throw Error(_(327));var a=e.callbackNode;if(Yn()&&e.callbackNode!==a)return null;var r=wd(e,e===tt?nt:0);if(r===0)return null;if((r&30)!==0||(r&e.expiredLanes)!==0||t)t=Bd(e,r);else{t=r;var o=de;de|=2;var n=cw();(tt!==e||nt!==t)&&(Ya=null,ns=Fe()+500,Eo(e,t));do try{BT();break}catch(i){dw(e,i)}while(!0);gh(),Nd.current=n,de=o,Ve!==null?t=0:(tt=null,nt=0,t=We)}if(t!==0){if(t===2&&(o=wm(e),o!==0&&(r=o,t=Km(e,o))),t===1)throw a=ml,Eo(e,0),Dr(e,r),Mt(e,Fe()),a;if(t===6)Dr(e,r);else{if(o=e.current.alternate,(r&30)===0&&!OT(o)&&(t=Bd(e,r),t===2&&(n=wm(e),n!==0&&(r=n,t=Km(e,n))),t===1))throw a=ml,Eo(e,0),Dr(e,r),Mt(e,Fe()),a;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(_(345));case 2:To(e,Rt,Ya);break;case 3:if(Dr(e,r),(r&130023424)===r&&(t=_h+500-Fe(),10<t)){if(wd(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){bt(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Tm(To.bind(null,e,Rt,Ya),t);break}To(e,Rt,Ya);break;case 4:if(Dr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-Sa(r);n=1<<s,s=t[s],s>o&&(o=s),r&=~n}if(r=o,r=Fe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*NT(r/1960))-r,10<r){e.timeoutHandle=Tm(To.bind(null,e,Rt,Ya),r);break}To(e,Rt,Ya);break;case 5:To(e,Rt,Ya);break;default:throw Error(_(329))}}}return Mt(e,Fe()),e.callbackNode===a?uw.bind(null,e):null}function Km(e,t){var a=Qi;return e.current.memoizedState.isDehydrated&&(Eo(e,t).flags|=256),e=Bd(e,t),e!==2&&(t=Rt,Rt=a,t!==null&&Xm(t)),e}function Xm(e){Rt===null?Rt=e:Rt.push.apply(Rt,e)}function OT(e){for(var t=e;;){if(t.flags&16384){var a=t.updateQueue;if(a!==null&&(a=a.stores,a!==null))for(var r=0;r<a.length;r++){var o=a[r],n=o.getSnapshot;o=o.value;try{if(!La(n(),o))return!1}catch{return!1}}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Dr(e,t){for(t&=~Rh,t&=~Xd,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var a=31-Sa(t),r=1<<a;e[a]=-1,t&=~r}}function vv(e){if((de&6)!==0)throw Error(_(327));Yn();var t=wd(e,0);if((t&1)===0)return Mt(e,Fe()),null;var a=Bd(e,t);if(e.tag!==0&&a===2){var r=wm(e);r!==0&&(t=r,a=Km(e,r))}if(a===1)throw a=ml,Eo(e,0),Dr(e,t),Mt(e,Fe()),a;if(a===6)throw Error(_(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,To(e,Rt,Ya),Mt(e,Fe()),null}function Eh(e,t){var a=de;de|=1;try{return e(t)}finally{de=a,de===0&&(ns=Fe()+500,$d&&Kr())}}function Bo(e){Nr!==null&&Nr.tag===0&&(de&6)===0&&Yn();var t=de;de|=1;var a=ia.transition,r=me;try{if(ia.transition=null,me=1,e)return e()}finally{me=r,ia.transition=a,de=t,(de&6)===0&&Kr()}}function Dh(){zt=Wn.current,be(Wn)}function Eo(e,t){e.finishedWork=null,e.finishedLanes=0;var a=e.timeoutHandle;if(a!==-1&&(e.timeoutHandle=-1,fT(a)),Ve!==null)for(a=Ve.return;a!==null;){var r=a;switch(ph(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&bd();break;case 3:rs(),be(Et),be(vt),Ch();break;case 5:Sh(r);break;case 4:rs();break;case 13:be(Re);break;case 19:be(Re);break;case 10:yh(r.type._context);break;case 22:case 23:Dh()}a=a.return}if(tt=e,Ve=e=Hr(e.current,null),nt=zt=t,We=0,ml=null,Rh=Xd=Fo=0,Rt=Qi=null,Ro!==null){for(t=0;t<Ro.length;t++)if(a=Ro[t],r=a.interleaved,r!==null){a.interleaved=null;var o=r.next,n=a.pending;if(n!==null){var s=n.next;n.next=o,r.next=s}a.pending=r}Ro=null}return e}function dw(e,t){do{var a=Ve;try{if(gh(),dd.current=Md,Dd){for(var r=_e.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Dd=!1}if(Oo=0,et=$e=_e=null,Ki=!1,cl=0,Ah.current=null,a===null||a.return===null){We=1,ml=t,Ve=null;break}e:{var n=e,s=a.return,i=a,l=t;if(t=nt,i.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,d=i,c=d.tag;if((d.mode&1)===0&&(c===0||c===11||c===15)){var f=d.alternate;f?(d.updateQueue=f.updateQueue,d.memoizedState=f.memoizedState,d.lanes=f.lanes):(d.updateQueue=null,d.memoizedState=null)}var g=sv(s);if(g!==null){g.flags&=-257,iv(g,s,i,n,t),g.mode&1&&nv(n,u,t),t=g,l=u;var x=t.updateQueue;if(x===null){var w=new Set;w.add(l),t.updateQueue=w}else x.add(l);break e}else{if((t&1)===0){nv(n,u,t),Mh();break e}l=Error(_(426))}}else if(Ae&&i.mode&1){var L=sv(s);if(L!==null){(L.flags&65536)===0&&(L.flags|=256),iv(L,s,i,n,t),mh(os(l,i));break e}}n=l=os(l,i),We!==4&&(We=2),Qi===null?Qi=[n]:Qi.push(n),n=s;do{switch(n.tag){case 3:n.flags|=65536,t&=-t,n.lanes|=t;var y=G0(n,l,t);Zx(n,y);break e;case 1:i=l;var h=n.type,m=n.stateNode;if((n.flags&128)===0&&(typeof h.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(jr===null||!jr.has(m)))){n.flags|=65536,t&=-t,n.lanes|=t;var C=K0(n,i,t);Zx(n,C);break e}}n=n.return}while(n!==null)}pw(a)}catch(I){t=I,Ve===a&&a!==null&&(Ve=a=a.return);continue}break}while(!0)}function cw(){var e=Nd.current;return Nd.current=Md,e===null?Md:e}function Mh(){(We===0||We===3||We===2)&&(We=4),tt===null||(Fo&268435455)===0&&(Xd&268435455)===0||Dr(tt,nt)}function Bd(e,t){var a=de;de|=2;var r=cw();(tt!==e||nt!==t)&&(Ya=null,Eo(e,t));do try{FT();break}catch(o){dw(e,o)}while(!0);if(gh(),de=a,Nd.current=r,Ve!==null)throw Error(_(261));return tt=null,nt=0,We}function FT(){for(;Ve!==null;)fw(Ve)}function BT(){for(;Ve!==null&&!cP();)fw(Ve)}function fw(e){var t=hw(e.alternate,e,zt);e.memoizedProps=e.pendingProps,t===null?pw(e):Ve=t,Ah.current=null}function pw(e){var t=e;do{var a=t.alternate;if(e=t.return,(t.flags&32768)===0){if(a=RT(a,t,zt),a!==null){Ve=a;return}}else{if(a=_T(a,t),a!==null){a.flags&=32767,Ve=a;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{We=6,Ve=null;return}}if(t=t.sibling,t!==null){Ve=t;return}Ve=t=e}while(t!==null);We===0&&(We=5)}function To(e,t,a){var r=me,o=ia.transition;try{ia.transition=null,me=1,UT(e,t,a,r)}finally{ia.transition=o,me=r}return null}function UT(e,t,a,r){do Yn();while(Nr!==null);if((de&6)!==0)throw Error(_(327));a=e.finishedWork;var o=e.finishedLanes;if(a===null)return null;if(e.finishedWork=null,e.finishedLanes=0,a===e.current)throw Error(_(177));e.callbackNode=null,e.callbackPriority=0;var n=a.lanes|a.childLanes;if(SP(e,n),e===tt&&(Ve=tt=null,nt=0),(a.subtreeFlags&2064)===0&&(a.flags&2064)===0||nd||(nd=!0,gw(vd,function(){return Yn(),null})),n=(a.flags&15990)!==0,(a.subtreeFlags&15990)!==0||n){n=ia.transition,ia.transition=null;var s=me;me=1;var i=de;de|=4,Ah.current=null,DT(e,a),iw(a,e),iT(km),Sd=!!bm,km=bm=null,e.current=a,MT(a,e,o),fP(),de=i,me=s,ia.transition=n}else e.current=a;if(nd&&(nd=!1,Nr=e,Fd=o),n=e.pendingLanes,n===0&&(jr=null),hP(a.stateNode,r),Mt(e,Fe()),t!==null)for(r=e.onRecoverableError,a=0;a<t.length;a++)o=t[a],r(o.value,{componentStack:o.stack,digest:o.digest});if(Od)throw Od=!1,e=Wm,Wm=null,e;return(Fd&1)!==0&&e.tag!==0&&Yn(),n=e.pendingLanes,(n&1)!==0?e===Gm?Ji++:(Ji=0,Gm=e):Ji=0,Kr(),null}function Yn(){if(Nr!==null){var e=Gv(Fd),t=ia.transition,a=me;try{if(ia.transition=null,me=16>e?16:e,Nr===null)var r=!1;else{if(e=Nr,Nr=null,Fd=0,(de&6)!==0)throw Error(_(331));var o=de;for(de|=4,B=e.current;B!==null;){var n=B,s=n.child;if((B.flags&16)!==0){var i=n.deletions;if(i!==null){for(var l=0;l<i.length;l++){var u=i[l];for(B=u;B!==null;){var d=B;switch(d.tag){case 0:case 11:case 15:Xi(8,d,n)}var c=d.child;if(c!==null)c.return=d,B=c;else for(;B!==null;){d=B;var f=d.sibling,g=d.return;if(ow(d),d===u){B=null;break}if(f!==null){f.return=g,B=f;break}B=g}}}var x=n.alternate;if(x!==null){var w=x.child;if(w!==null){x.child=null;do{var L=w.sibling;w.sibling=null,w=L}while(w!==null)}}B=n}}if((n.subtreeFlags&2064)!==0&&s!==null)s.return=n,B=s;else e:for(;B!==null;){if(n=B,(n.flags&2048)!==0)switch(n.tag){case 0:case 11:case 15:Xi(9,n,n.return)}var y=n.sibling;if(y!==null){y.return=n.return,B=y;break e}B=n.return}}var h=e.current;for(B=h;B!==null;){s=B;var m=s.child;if((s.subtreeFlags&2064)!==0&&m!==null)m.return=s,B=m;else e:for(s=h;B!==null;){if(i=B,(i.flags&2048)!==0)try{switch(i.tag){case 0:case 11:case 15:Kd(9,i)}}catch(I){Ne(i,i.return,I)}if(i===s){B=null;break e}var C=i.sibling;if(C!==null){C.return=i.return,B=C;break e}B=i.return}}if(de=o,Kr(),Da&&typeof Da.onPostCommitFiberRoot=="function")try{Da.onPostCommitFiberRoot(Vd,e)}catch{}r=!0}return r}finally{me=a,ia.transition=t}}return!1}function wv(e,t,a){t=os(a,t),t=G0(e,t,1),e=Vr(e,t,1),t=bt(),e!==null&&(hl(e,1,t),Mt(e,t))}function Ne(e,t,a){if(e.tag===3)wv(e,e,a);else for(;t!==null;){if(t.tag===3){wv(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(jr===null||!jr.has(r))){e=os(a,e),e=K0(t,e,1),t=Vr(t,e,1),e=bt(),t!==null&&(hl(t,1,e),Mt(t,e));break}}t=t.return}}function VT(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),t=bt(),e.pingedLanes|=e.suspendedLanes&a,tt===e&&(nt&a)===a&&(We===4||We===3&&(nt&130023424)===nt&&500>Fe()-_h?Eo(e,0):Rh|=a),Mt(e,t)}function mw(e,t){t===0&&((e.mode&1)===0?t=1:(t=$u,$u<<=1,($u&130023424)===0&&($u=4194304)));var a=bt();e=nr(e,t),e!==null&&(hl(e,t,a),Mt(e,a))}function jT(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),mw(e,a)}function qT(e,t){var a=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(a=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(_(314))}r!==null&&r.delete(t),mw(e,a)}var hw;hw=function(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps||Et.current)_t=!0;else{if((e.lanes&a)===0&&(t.flags&128)===0)return _t=!1,AT(e,t,a);_t=(e.flags&131072)!==0}else _t=!1,Ae&&(t.flags&1048576)!==0&&v0(t,Td,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;fd(e,t),e=t.pendingProps;var o=es(t,vt.current);Jn(t,a),o=Ih(null,t,r,e,o,a);var n=bh();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Dt(r)?(n=!0,kd(t)):n=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,vh(t),o.updater=Gd,t.stateNode=o,o._reactInternals=t,Nm(t,r,e,a),t=Bm(null,t,r,!0,n,a)):(t.tag=0,Ae&&n&&fh(t),It(null,t,o,a),t=t.child),t;case 16:r=t.elementType;e:{switch(fd(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=zT(r),e=xa(r,e),o){case 0:t=Fm(null,t,r,e,a);break e;case 1:t=dv(null,t,r,e,a);break e;case 11:t=lv(null,t,r,e,a);break e;case 14:t=uv(null,t,r,xa(r.type,e),a);break e}throw Error(_(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:xa(r,o),Fm(e,t,r,o,a);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:xa(r,o),dv(e,t,r,o,a);case 3:e:{if(Y0(t),e===null)throw Error(_(387));r=t.pendingProps,n=t.memoizedState,o=n.element,b0(e,t),_d(t,r,null,a);var s=t.memoizedState;if(r=s.element,n.isDehydrated)if(n={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=n,t.memoizedState=n,t.flags&256){o=os(Error(_(423)),t),t=cv(e,t,r,a,o);break e}else if(r!==o){o=os(Error(_(424)),t),t=cv(e,t,r,a,o);break e}else for($t=Ur(t.stateNode.containerInfo.firstChild),Wt=t,Ae=!0,wa=null,a=L0(t,null,r,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(ts(),r===o){t=sr(e,t,a);break e}It(e,t,r,a)}t=t.child}return t;case 5:return k0(t),e===null&&Em(t),r=t.type,o=t.pendingProps,n=e!==null?e.memoizedProps:null,s=o.children,Pm(r,o)?s=null:n!==null&&Pm(r,n)&&(t.flags|=32),J0(e,t),It(e,t,s,a),t.child;case 6:return e===null&&Em(t),null;case 13:return Z0(e,t,a);case 4:return wh(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=as(t,null,r,a):It(e,t,r,a),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:xa(r,o),lv(e,t,r,o,a);case 7:return It(e,t,t.pendingProps,a),t.child;case 8:return It(e,t,t.pendingProps.children,a),t.child;case 12:return It(e,t,t.pendingProps.children,a),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,n=t.memoizedProps,s=o.value,we(Ad,r._currentValue),r._currentValue=s,n!==null)if(La(n.value,s)){if(n.children===o.children&&!Et.current){t=sr(e,t,a);break e}}else for(n=t.child,n!==null&&(n.return=t);n!==null;){var i=n.dependencies;if(i!==null){s=n.child;for(var l=i.firstContext;l!==null;){if(l.context===r){if(n.tag===1){l=ar(-1,a&-a),l.tag=2;var u=n.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}n.lanes|=a,l=n.alternate,l!==null&&(l.lanes|=a),Dm(n.return,a,t),i.lanes|=a;break}l=l.next}}else if(n.tag===10)s=n.type===t.type?null:n.child;else if(n.tag===18){if(s=n.return,s===null)throw Error(_(341));s.lanes|=a,i=s.alternate,i!==null&&(i.lanes|=a),Dm(s,a,t),s=n.sibling}else s=n.child;if(s!==null)s.return=n;else for(s=n;s!==null;){if(s===t){s=null;break}if(n=s.sibling,n!==null){n.return=s.return,s=n;break}s=s.return}n=s}It(e,t,o.children,a),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Jn(t,a),o=la(o),r=r(o),t.flags|=1,It(e,t,r,a),t.child;case 14:return r=t.type,o=xa(r,t.pendingProps),o=xa(r.type,o),uv(e,t,r,o,a);case 15:return X0(e,t,t.type,t.pendingProps,a);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:xa(r,o),fd(e,t),t.tag=1,Dt(r)?(e=!0,kd(t)):e=!1,Jn(t,a),W0(t,r,o),Nm(t,r,o,a),Bm(null,t,r,!0,e,a);case 19:return ew(e,t,a);case 22:return Q0(e,t,a)}throw Error(_(156,t.tag))};function gw(e,t){return Hv(e,t)}function HT(e,t,a,r){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function sa(e,t,a,r){return new HT(e,t,a,r)}function Nh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function zT(e){if(typeof e=="function")return Nh(e)?1:0;if(e!=null){if(e=e.$$typeof,e===eh)return 11;if(e===th)return 14}return 2}function Hr(e,t){var a=e.alternate;return a===null?(a=sa(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&14680064,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a}function hd(e,t,a,r,o,n){var s=2;if(r=e,typeof e=="function")Nh(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case On:return Do(a.children,o,n,t);case Zm:s=8,o|=8;break;case nm:return e=sa(12,a,t,o|2),e.elementType=nm,e.lanes=n,e;case sm:return e=sa(13,a,t,o),e.elementType=sm,e.lanes=n,e;case im:return e=sa(19,a,t,o),e.elementType=im,e.lanes=n,e;case kv:return Qd(a,o,n,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Iv:s=10;break e;case bv:s=9;break e;case eh:s=11;break e;case th:s=14;break e;case Rr:s=16,r=null;break e}throw Error(_(130,e==null?e:typeof e,""))}return t=sa(s,a,t,o),t.elementType=e,t.type=r,t.lanes=n,t}function Do(e,t,a,r){return e=sa(7,e,r,t),e.lanes=a,e}function Qd(e,t,a,r){return e=sa(22,e,r,t),e.elementType=kv,e.lanes=a,e.stateNode={isHidden:!1},e}function am(e,t,a){return e=sa(6,e,null,t),e.lanes=a,e}function rm(e,t,a){return t=sa(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function $T(e,t,a,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Vp(0),this.expirationTimes=Vp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vp(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Oh(e,t,a,r,o,n,s,i,l){return e=new $T(e,t,a,i,l),t===1?(t=1,n===!0&&(t|=8)):t=0,n=sa(3,null,null,t),e.current=n,n.stateNode=e,n.memoizedState={element:r,isDehydrated:a,cache:null,transitions:null,pendingSuspenseBoundaries:null},vh(n),e}function WT(e,t,a){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Nn,key:r==null?null:""+r,children:e,containerInfo:t,implementation:a}}function yw(e){if(!e)return $r;e=e._reactInternals;e:{if(Vo(e)!==e||e.tag!==1)throw Error(_(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Dt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(_(171))}if(e.tag===1){var a=e.type;if(Dt(a))return y0(e,a,t)}return t}function xw(e,t,a,r,o,n,s,i,l){return e=Oh(a,r,!0,e,o,n,s,i,l),e.context=yw(null),a=e.current,r=bt(),o=qr(a),n=ar(r,o),n.callback=t??null,Vr(a,n,o),e.current.lanes=o,hl(e,o,r),Mt(e,r),e}function Jd(e,t,a,r){var o=t.current,n=bt(),s=qr(o);return a=yw(a),t.context===null?t.context=a:t.pendingContext=a,t=ar(n,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Vr(o,t,s),e!==null&&(Ca(e,o,s,n),ud(e,o,s)),s}function Ud(e){return e=e.current,e.child?(e.child.tag===5,e.child.stateNode):null}function Sv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Fh(e,t){Sv(e,t),(e=e.alternate)&&Sv(e,t)}function GT(){return null}var vw=typeof reportError=="function"?reportError:function(e){console.error(e)};function Bh(e){this._internalRoot=e}Yd.prototype.render=Bh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(_(409));Jd(e,t,null,null)};Yd.prototype.unmount=Bh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Bo(function(){Jd(null,e,null,null)}),t[or]=null}};function Yd(e){this._internalRoot=e}Yd.prototype.unstable_scheduleHydration=function(e){if(e){var t=Qv();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Er.length&&t!==0&&t<Er[a].priority;a++);Er.splice(a,0,e),a===0&&Yv(e)}};function Uh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Zd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Cv(){}function KT(e,t,a,r,o){if(o){if(typeof r=="function"){var n=r;r=function(){var u=Ud(s);n.call(u)}}var s=xw(t,r,e,0,null,!1,!1,"",Cv);return e._reactRootContainer=s,e[or]=s.current,sl(e.nodeType===8?e.parentNode:e),Bo(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var i=r;r=function(){var u=Ud(l);i.call(u)}}var l=Oh(e,0,!1,null,null,!1,!1,"",Cv);return e._reactRootContainer=l,e[or]=l.current,sl(e.nodeType===8?e.parentNode:e),Bo(function(){Jd(t,l,a,r)}),l}function ec(e,t,a,r,o){var n=a._reactRootContainer;if(n){var s=n;if(typeof o=="function"){var i=o;o=function(){var l=Ud(s);i.call(l)}}Jd(t,s,e,o)}else s=KT(a,t,e,o,r);return Ud(s)}Kv=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var a=ji(t.pendingLanes);a!==0&&(oh(t,a|1),Mt(t,Fe()),(de&6)===0&&(ns=Fe()+500,Kr()))}break;case 13:Bo(function(){var r=nr(e,1);if(r!==null){var o=bt();Ca(r,e,1,o)}}),Fh(e,1)}};nh=function(e){if(e.tag===13){var t=nr(e,134217728);if(t!==null){var a=bt();Ca(t,e,134217728,a)}Fh(e,134217728)}};Xv=function(e){if(e.tag===13){var t=qr(e),a=nr(e,t);if(a!==null){var r=bt();Ca(a,e,t,r)}Fh(e,t)}};Qv=function(){return me};Jv=function(e,t){var a=me;try{return me=e,t()}finally{me=a}};ym=function(e,t,a){switch(t){case"input":if(dm(e,a),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<a.length;t++){var r=a[t];if(r!==e&&r.form===e.form){var o=zd(r);if(!o)throw Error(_(90));Tv(r),dm(r,o)}}}break;case"textarea":Rv(e,a);break;case"select":t=a.value,t!=null&&Gn(e,!!a.multiple,t,!1)}};Fv=Eh;Bv=Bo;var XT={usingClientEntryPoint:!1,Events:[yl,Vn,zd,Nv,Ov,Eh]},Fi={findFiberByHostInstance:Ao,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},QT={bundleType:Fi.bundleType,version:Fi.version,rendererPackageName:Fi.rendererPackageName,rendererConfig:Fi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ir.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=jv(e),e===null?null:e.stateNode},findFiberByHostInstance:Fi.findFiberByHostInstance||GT,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Bi=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Bi.isDisabled&&Bi.supportsFiber))try{Vd=Bi.inject(QT),Da=Bi}catch{}var Bi;Xt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=XT;Xt.createPortal=function(e,t){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Uh(t))throw Error(_(200));return WT(e,t,null,a)};Xt.createRoot=function(e,t){if(!Uh(e))throw Error(_(299));var a=!1,r="",o=vw;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Oh(e,1,!1,null,null,a,!1,r,o),e[or]=t.current,sl(e.nodeType===8?e.parentNode:e),new Bh(t)};Xt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(_(188)):(e=Object.keys(e).join(","),Error(_(268,e)));return e=jv(t),e=e===null?null:e.stateNode,e};Xt.flushSync=function(e){return Bo(e)};Xt.hydrate=function(e,t,a){if(!Zd(t))throw Error(_(200));return ec(null,e,t,!0,a)};Xt.hydrateRoot=function(e,t,a){if(!Uh(e))throw Error(_(405));var r=a!=null&&a.hydratedSources||null,o=!1,n="",s=vw;if(a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(n=a.identifierPrefix),a.onRecoverableError!==void 0&&(s=a.onRecoverableError)),t=xw(t,null,e,1,a??null,o,!1,n,s),e[or]=t.current,sl(e),r)for(e=0;e<r.length;e++)a=r[e],o=a._getVersion,o=o(a._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[a,o]:t.mutableSourceEagerHydrationData.push(a,o);return new Yd(t)};Xt.render=function(e,t,a){if(!Zd(t))throw Error(_(200));return ec(null,e,t,!1,a)};Xt.unmountComponentAtNode=function(e){if(!Zd(e))throw Error(_(40));return e._reactRootContainer?(Bo(function(){ec(null,null,e,!1,function(){e._reactRootContainer=null,e[or]=null})}),!0):!1};Xt.unstable_batchedUpdates=Eh;Xt.unstable_renderSubtreeIntoContainer=function(e,t,a,r){if(!Zd(a))throw Error(_(200));if(e==null||e._reactInternals===void 0)throw Error(_(38));return ec(e,t,a,!1,r)};Xt.version="18.3.1-next-f1338f8080-20240426"});var Vh=Ze((BD,Cw)=>{"use strict";function Sw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Sw)}catch(e){console.error(e)}}Sw(),Cw.exports=ww()});var Iw=Ze(jh=>{"use strict";var Lw=Vh();jh.createRoot=Lw.createRoot,jh.hydrateRoot=Lw.hydrateRoot;var UD});var jo={};Hy(jo,{Headers:()=>Hh,Request:()=>ZT,Response:()=>e1,default:()=>qh,fetch:()=>YT});var JT,ls,YT,qh,Hh,ZT,e1,Xr=Dk(()=>{"use strict";JT=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")},ls=JT(),YT=ls.fetch,qh=ls.fetch.bind(ls),Hh=ls.Headers,ZT=ls.Request,e1=ls.Response});var Wh=Ze($h=>{"use strict";Object.defineProperty($h,"__esModule",{value:!0});var zh=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.code=t.code}};$h.default=zh});var Kh=Ze(Ll=>{"use strict";var kw=Ll&&Ll.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ll,"__esModule",{value:!0});var a1=kw((Xr(),$y(jo))),r1=kw(Wh()),Gh=class{constructor(t){this.shouldThrowOnError=!1,this.method=t.method,this.url=t.url,this.headers=t.headers,this.schema=t.schema,this.body=t.body,this.shouldThrowOnError=t.shouldThrowOnError,this.signal=t.signal,this.isMaybeSingle=t.isMaybeSingle,t.fetch?this.fetch=t.fetch:typeof fetch>"u"?this.fetch=a1.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,a){return this.headers=Object.assign({},this.headers),this.headers[t]=a,this}then(t,a){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),this.method!=="GET"&&this.method!=="HEAD"&&(this.headers["Content-Type"]="application/json");let r=this.fetch,o=r(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async n=>{var s,i,l;let u=null,d=null,c=null,f=n.status,g=n.statusText;if(n.ok){if(this.method!=="HEAD"){let y=await n.text();y===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?d=y:d=JSON.parse(y))}let w=(s=this.headers.Prefer)===null||s===void 0?void 0:s.match(/count=(exact|planned|estimated)/),L=(i=n.headers.get("content-range"))===null||i===void 0?void 0:i.split("/");w&&L&&L.length>1&&(c=parseInt(L[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(d)&&(d.length>1?(u={code:"PGRST116",details:`Results contain ${d.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},d=null,c=null,f=406,g="Not Acceptable"):d.length===1?d=d[0]:d=null)}else{let w=await n.text();try{u=JSON.parse(w),Array.isArray(u)&&n.status===404&&(d=[],u=null,f=200,g="OK")}catch{n.status===404&&w===""?(f=204,g="No Content"):u={message:w}}if(u&&this.isMaybeSingle&&(!((l=u?.details)===null||l===void 0)&&l.includes("0 rows"))&&(u=null,f=200,g="OK"),u&&this.shouldThrowOnError)throw new r1.default(u)}return{error:u,data:d,count:c,status:f,statusText:g}});return this.shouldThrowOnError||(o=o.catch(n=>{var s,i,l;return{error:{message:`${(s=n?.name)!==null&&s!==void 0?s:"FetchError"}: ${n?.message}`,details:`${(i=n?.stack)!==null&&i!==void 0?i:""}`,hint:"",code:`${(l=n?.code)!==null&&l!==void 0?l:""}`},data:null,count:null,status:0,statusText:""}})),o.then(t,a)}returns(){return this}overrideTypes(){return this}};Ll.default=Gh});var Qh=Ze(Il=>{"use strict";var o1=Il&&Il.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Il,"__esModule",{value:!0});var n1=o1(Kh()),Xh=class extends n1.default{select(t){let a=!1,r=(t??"*").split("").map(o=>/\s/.test(o)&&!a?"":(o==='"'&&(a=!a),o)).join("");return this.url.searchParams.set("select",r),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(t,{ascending:a=!0,nullsFirst:r,foreignTable:o,referencedTable:n=o}={}){let s=n?`${n}.order`:"order",i=this.url.searchParams.get(s);return this.url.searchParams.set(s,`${i?`${i},`:""}${t}.${a?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(t,{foreignTable:a,referencedTable:r=a}={}){let o=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(o,`${t}`),this}range(t,a,{foreignTable:r,referencedTable:o=r}={}){let n=typeof o>"u"?"offset":`${o}.offset`,s=typeof o>"u"?"limit":`${o}.limit`;return this.url.searchParams.set(n,`${t}`),this.url.searchParams.set(s,`${a-t+1}`),this}abortSignal(t){return this.signal=t,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return this.method==="GET"?this.headers.Accept="application/json":this.headers.Accept="application/vnd.pgrst.object+json",this.isMaybeSingle=!0,this}csv(){return this.headers.Accept="text/csv",this}geojson(){return this.headers.Accept="application/geo+json",this}explain({analyze:t=!1,verbose:a=!1,settings:r=!1,buffers:o=!1,wal:n=!1,format:s="text"}={}){var i;let l=[t?"analyze":null,a?"verbose":null,r?"settings":null,o?"buffers":null,n?"wal":null].filter(Boolean).join("|"),u=(i=this.headers.Accept)!==null&&i!==void 0?i:"application/json";return this.headers.Accept=`application/vnd.pgrst.plan+${s}; for="${u}"; options=${l};`,s==="json"?this:this}rollback(){var t;return((t=this.headers.Prefer)!==null&&t!==void 0?t:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}};Il.default=Xh});var rc=Ze(bl=>{"use strict";var s1=bl&&bl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(bl,"__esModule",{value:!0});var i1=s1(Qh()),Jh=class extends i1.default{eq(t,a){return this.url.searchParams.append(t,`eq.${a}`),this}neq(t,a){return this.url.searchParams.append(t,`neq.${a}`),this}gt(t,a){return this.url.searchParams.append(t,`gt.${a}`),this}gte(t,a){return this.url.searchParams.append(t,`gte.${a}`),this}lt(t,a){return this.url.searchParams.append(t,`lt.${a}`),this}lte(t,a){return this.url.searchParams.append(t,`lte.${a}`),this}like(t,a){return this.url.searchParams.append(t,`like.${a}`),this}likeAllOf(t,a){return this.url.searchParams.append(t,`like(all).{${a.join(",")}}`),this}likeAnyOf(t,a){return this.url.searchParams.append(t,`like(any).{${a.join(",")}}`),this}ilike(t,a){return this.url.searchParams.append(t,`ilike.${a}`),this}ilikeAllOf(t,a){return this.url.searchParams.append(t,`ilike(all).{${a.join(",")}}`),this}ilikeAnyOf(t,a){return this.url.searchParams.append(t,`ilike(any).{${a.join(",")}}`),this}is(t,a){return this.url.searchParams.append(t,`is.${a}`),this}in(t,a){let r=Array.from(new Set(a)).map(o=>typeof o=="string"&&new RegExp("[,()]").test(o)?`"${o}"`:`${o}`).join(",");return this.url.searchParams.append(t,`in.(${r})`),this}contains(t,a){return typeof a=="string"?this.url.searchParams.append(t,`cs.${a}`):Array.isArray(a)?this.url.searchParams.append(t,`cs.{${a.join(",")}}`):this.url.searchParams.append(t,`cs.${JSON.stringify(a)}`),this}containedBy(t,a){return typeof a=="string"?this.url.searchParams.append(t,`cd.${a}`):Array.isArray(a)?this.url.searchParams.append(t,`cd.{${a.join(",")}}`):this.url.searchParams.append(t,`cd.${JSON.stringify(a)}`),this}rangeGt(t,a){return this.url.searchParams.append(t,`sr.${a}`),this}rangeGte(t,a){return this.url.searchParams.append(t,`nxl.${a}`),this}rangeLt(t,a){return this.url.searchParams.append(t,`sl.${a}`),this}rangeLte(t,a){return this.url.searchParams.append(t,`nxr.${a}`),this}rangeAdjacent(t,a){return this.url.searchParams.append(t,`adj.${a}`),this}overlaps(t,a){return typeof a=="string"?this.url.searchParams.append(t,`ov.${a}`):this.url.searchParams.append(t,`ov.{${a.join(",")}}`),this}textSearch(t,a,{config:r,type:o}={}){let n="";o==="plain"?n="pl":o==="phrase"?n="ph":o==="websearch"&&(n="w");let s=r===void 0?"":`(${r})`;return this.url.searchParams.append(t,`${n}fts${s}.${a}`),this}match(t){return Object.entries(t).forEach(([a,r])=>{this.url.searchParams.append(a,`eq.${r}`)}),this}not(t,a,r){return this.url.searchParams.append(t,`not.${a}.${r}`),this}or(t,{foreignTable:a,referencedTable:r=a}={}){let o=r?`${r}.or`:"or";return this.url.searchParams.append(o,`(${t})`),this}filter(t,a,r){return this.url.searchParams.append(t,`${a}.${r}`),this}};bl.default=Jh});var Zh=Ze(Pl=>{"use strict";var l1=Pl&&Pl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Pl,"__esModule",{value:!0});var kl=l1(rc()),Yh=class{constructor(t,{headers:a={},schema:r,fetch:o}){this.url=t,this.headers=a,this.schema=r,this.fetch=o}select(t,{head:a=!1,count:r}={}){let o=a?"HEAD":"GET",n=!1,s=(t??"*").split("").map(i=>/\s/.test(i)&&!n?"":(i==='"'&&(n=!n),i)).join("");return this.url.searchParams.set("select",s),r&&(this.headers.Prefer=`count=${r}`),new kl.default({method:o,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}insert(t,{count:a,defaultToNull:r=!0}={}){let o="POST",n=[];if(this.headers.Prefer&&n.push(this.headers.Prefer),a&&n.push(`count=${a}`),r||n.push("missing=default"),this.headers.Prefer=n.join(","),Array.isArray(t)){let s=t.reduce((i,l)=>i.concat(Object.keys(l)),[]);if(s.length>0){let i=[...new Set(s)].map(l=>`"${l}"`);this.url.searchParams.set("columns",i.join(","))}}return new kl.default({method:o,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:this.fetch,allowEmpty:!1})}upsert(t,{onConflict:a,ignoreDuplicates:r=!1,count:o,defaultToNull:n=!0}={}){let s="POST",i=[`resolution=${r?"ignore":"merge"}-duplicates`];if(a!==void 0&&this.url.searchParams.set("on_conflict",a),this.headers.Prefer&&i.push(this.headers.Prefer),o&&i.push(`count=${o}`),n||i.push("missing=default"),this.headers.Prefer=i.join(","),Array.isArray(t)){let l=t.reduce((u,d)=>u.concat(Object.keys(d)),[]);if(l.length>0){let u=[...new Set(l)].map(d=>`"${d}"`);this.url.searchParams.set("columns",u.join(","))}}return new kl.default({method:s,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:this.fetch,allowEmpty:!1})}update(t,{count:a}={}){let r="PATCH",o=[];return this.headers.Prefer&&o.push(this.headers.Prefer),a&&o.push(`count=${a}`),this.headers.Prefer=o.join(","),new kl.default({method:r,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:this.fetch,allowEmpty:!1})}delete({count:t}={}){let a="DELETE",r=[];return t&&r.push(`count=${t}`),this.headers.Prefer&&r.unshift(this.headers.Prefer),this.headers.Prefer=r.join(","),new kl.default({method:a,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}};Pl.default=Yh});var Pw=Ze(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});oc.version=void 0;oc.version="0.0.0-automated"});var Tw=Ze(nc=>{"use strict";Object.defineProperty(nc,"__esModule",{value:!0});nc.DEFAULT_HEADERS=void 0;var u1=Pw();nc.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${u1.version}`}});var Rw=Ze(Tl=>{"use strict";var Aw=Tl&&Tl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Tl,"__esModule",{value:!0});var d1=Aw(Zh()),c1=Aw(rc()),f1=Tw(),eg=class e{constructor(t,{headers:a={},schema:r,fetch:o}={}){this.url=t,this.headers=Object.assign(Object.assign({},f1.DEFAULT_HEADERS),a),this.schemaName=r,this.fetch=o}from(t){let a=new URL(`${this.url}/${t}`);return new d1.default(a,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(t){return new e(this.url,{headers:this.headers,schema:t,fetch:this.fetch})}rpc(t,a={},{head:r=!1,get:o=!1,count:n}={}){let s,i=new URL(`${this.url}/rpc/${t}`),l;r||o?(s=r?"HEAD":"GET",Object.entries(a).filter(([d,c])=>c!==void 0).map(([d,c])=>[d,Array.isArray(c)?`{${c.join(",")}}`:`${c}`]).forEach(([d,c])=>{i.searchParams.append(d,c)})):(s="POST",l=a);let u=Object.assign({},this.headers);return n&&(u.Prefer=`count=${n}`),new c1.default({method:s,url:i,headers:u,schema:this.schemaName,body:l,fetch:this.fetch,allowEmpty:!1})}};Tl.default=eg});var Fw=Ze(it=>{"use strict";var us=it&&it.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(it,"__esModule",{value:!0});it.PostgrestError=it.PostgrestBuilder=it.PostgrestTransformBuilder=it.PostgrestFilterBuilder=it.PostgrestQueryBuilder=it.PostgrestClient=void 0;var _w=us(Rw());it.PostgrestClient=_w.default;var Ew=us(Zh());it.PostgrestQueryBuilder=Ew.default;var Dw=us(rc());it.PostgrestFilterBuilder=Dw.default;var Mw=us(Qh());it.PostgrestTransformBuilder=Mw.default;var Nw=us(Kh());it.PostgrestBuilder=Nw.default;var Ow=us(Wh());it.PostgrestError=Ow.default;it.default={PostgrestClient:_w.default,PostgrestQueryBuilder:Ew.default,PostgrestFilterBuilder:Dw.default,PostgrestTransformBuilder:Mw.default,PostgrestBuilder:Nw.default,PostgrestError:Ow.default}});var GS=Ze(Pc=>{"use strict";var TA=G(),AA=Symbol.for("react.element"),RA=Symbol.for("react.fragment"),_A=Object.prototype.hasOwnProperty,EA=TA.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,DA={key:!0,ref:!0,__self:!0,__source:!0};function WS(e,t,a){var r,o={},n=null,s=null;a!==void 0&&(n=""+a),t.key!==void 0&&(n=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)_A.call(t,r)&&!DA.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:AA,type:e,key:n,ref:s,props:o,_owner:EA.current}}Pc.Fragment=RA;Pc.jsx=WS;Pc.jsxs=WS});var le=Ze((RN,KS)=>{"use strict";KS.exports=GS()});var AD={};Hy(AD,{initKiteChat:()=>Ty});var Ka=M(G(),1),fk=M(Iw(),1);var F=M(G(),1);var bw=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...a)=>Promise.resolve().then(()=>(Xr(),jo)).then(({default:r})=>r(...a)):t=fetch,(...a)=>t(...a)};var vl=class extends Error{constructor(t,a="FunctionsError",r){super(t),this.name=a,this.context=r}},tc=class extends vl{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}},wl=class extends vl{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}},Sl=class extends vl{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}},ac;(function(e){e.Any="any",e.ApNortheast1="ap-northeast-1",e.ApNortheast2="ap-northeast-2",e.ApSouth1="ap-south-1",e.ApSoutheast1="ap-southeast-1",e.ApSoutheast2="ap-southeast-2",e.CaCentral1="ca-central-1",e.EuCentral1="eu-central-1",e.EuWest1="eu-west-1",e.EuWest2="eu-west-2",e.EuWest3="eu-west-3",e.SaEast1="sa-east-1",e.UsEast1="us-east-1",e.UsWest1="us-west-1",e.UsWest2="us-west-2"})(ac||(ac={}));var t1=function(e,t,a,r){function o(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function i(d){try{u(r.next(d))}catch(c){s(c)}}function l(d){try{u(r.throw(d))}catch(c){s(c)}}function u(d){d.done?n(d.value):o(d.value).then(i,l)}u((r=r.apply(e,t||[])).next())})},Cl=class{constructor(t,{headers:a={},customFetch:r,region:o=ac.Any}={}){this.url=t,this.headers=a,this.region=o,this.fetch=bw(r)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t,a={}){var r;return t1(this,void 0,void 0,function*(){try{let{headers:o,method:n,body:s}=a,i={},{region:l}=a;l||(l=this.region);let u=new URL(`${this.url}/${t}`);l&&l!=="any"&&(i["x-region"]=l,u.searchParams.set("forceFunctionRegion",l));let d;s&&(o&&!Object.prototype.hasOwnProperty.call(o,"Content-Type")||!o)&&(typeof Blob<"u"&&s instanceof Blob||s instanceof ArrayBuffer?(i["Content-Type"]="application/octet-stream",d=s):typeof s=="string"?(i["Content-Type"]="text/plain",d=s):typeof FormData<"u"&&s instanceof FormData?d=s:(i["Content-Type"]="application/json",d=JSON.stringify(s)));let c=yield this.fetch(u.toString(),{method:n||"POST",headers:Object.assign(Object.assign(Object.assign({},i),this.headers),o),body:d}).catch(w=>{throw new tc(w)}),f=c.headers.get("x-relay-error");if(f&&f==="true")throw new wl(c);if(!c.ok)throw new Sl(c);let g=((r=c.headers.get("Content-Type"))!==null&&r!==void 0?r:"text/plain").split(";")[0].trim(),x;return g==="application/json"?x=yield c.json():g==="application/octet-stream"?x=yield c.blob():g==="text/event-stream"?x=c:g==="multipart/form-data"?x=yield c.formData():x=yield c.text(),{data:x,error:null,response:c}}catch(o){return{data:null,error:o,response:o instanceof Sl||o instanceof wl?o.context:void 0}}})}};var Bw=M(Fw(),1),{PostgrestClient:Uw,PostgrestQueryBuilder:rM,PostgrestFilterBuilder:oM,PostgrestTransformBuilder:nM,PostgrestBuilder:sM,PostgrestError:p1}=Bw.default;function Vw(){if(typeof WebSocket<"u")return WebSocket;if(typeof global.WebSocket<"u")return global.WebSocket;if(typeof window.WebSocket<"u")return window.WebSocket;if(typeof self.WebSocket<"u")return self.WebSocket;throw new Error("`WebSocket` is not supported in this environment")}var jw=Vw();var qw="2.11.15";var Hw=`realtime-js/${qw}`,zw="1.0.0";var ic=1e4,$w=1e3,ds;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(ds||(ds={}));var lt;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(lt||(lt={}));var Qt;(function(e){e.close="phx_close",e.error="phx_error",e.join="phx_join",e.reply="phx_reply",e.leave="phx_leave",e.access_token="access_token"})(Qt||(Qt={}));var sc;(function(e){e.websocket="websocket"})(sc||(sc={}));var Qr;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(Qr||(Qr={}));var Al=class{constructor(){this.HEADER_LENGTH=1}decode(t,a){return t.constructor===ArrayBuffer?a(this._binaryDecode(t)):a(typeof t=="string"?JSON.parse(t):{})}_binaryDecode(t){let a=new DataView(t),r=new TextDecoder;return this._decodeBroadcast(t,a,r)}_decodeBroadcast(t,a,r){let o=a.getUint8(1),n=a.getUint8(2),s=this.HEADER_LENGTH+2,i=r.decode(t.slice(s,s+o));s=s+o;let l=r.decode(t.slice(s,s+n));s=s+n;let u=JSON.parse(r.decode(t.slice(s,t.byteLength)));return{ref:null,topic:i,event:l,payload:u}}};var qo=class{constructor(t,a){this.callback=t,this.timerCalc=a,this.timer=void 0,this.tries=0,this.callback=t,this.timerCalc=a}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}};var Se;(function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"})(Se||(Se={}));var ag=(e,t,a={})=>{var r;let o=(r=a.skipTypes)!==null&&r!==void 0?r:[];return Object.keys(t).reduce((n,s)=>(n[s]=m1(s,e,t,o),n),{})},m1=(e,t,a,r)=>{let o=t.find(i=>i.name===e),n=o?.type,s=a[e];return n&&!r.includes(n)?Ww(n,s):tg(s)},Ww=(e,t)=>{if(e.charAt(0)==="_"){let a=e.slice(1,e.length);return x1(t,a)}switch(e){case Se.bool:return h1(t);case Se.float4:case Se.float8:case Se.int2:case Se.int4:case Se.int8:case Se.numeric:case Se.oid:return g1(t);case Se.json:case Se.jsonb:return y1(t);case Se.timestamp:return v1(t);case Se.abstime:case Se.date:case Se.daterange:case Se.int4range:case Se.int8range:case Se.money:case Se.reltime:case Se.text:case Se.time:case Se.timestamptz:case Se.timetz:case Se.tsrange:case Se.tstzrange:return tg(t);default:return tg(t)}},tg=e=>e,h1=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},g1=e=>{if(typeof e=="string"){let t=parseFloat(e);if(!Number.isNaN(t))return t}return e},y1=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch(t){return console.log(`JSON parse error: ${t}`),e}return e},x1=(e,t)=>{if(typeof e!="string")return e;let a=e.length-1,r=e[a];if(e[0]==="{"&&r==="}"){let n,s=e.slice(1,a);try{n=JSON.parse("["+s+"]")}catch{n=s?s.split(","):[]}return n.map(i=>Ww(t,i))}return e},v1=e=>typeof e=="string"?e.replace(" ","T"):e,lc=e=>{let t=e;return t=t.replace(/^ws/i,"http"),t=t.replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,""),t.replace(/\/+$/,"")};var Ho=class{constructor(t,a,r={},o=ic){this.channel=t,this.event=a,this.payload=r,this.timeout=o,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(t){this.timeout=t,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(t){this.payload=Object.assign(Object.assign({},this.payload),t)}receive(t,a){var r;return this._hasReceived(t)&&a((r=this.receivedResp)===null||r===void 0?void 0:r.response),this.recHooks.push({status:t,callback:a}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);let t=a=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=a,this._matchReceive(a)};this.channel._on(this.refEvent,{},t),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(t,a){this.refEvent&&this.channel._trigger(this.refEvent,{status:t,response:a})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:t,response:a}){this.recHooks.filter(r=>r.status===t).forEach(r=>r.callback(a))}_hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}};var rg;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(rg||(rg={}));var cs=class e{constructor(t,a){this.channel=t,this.state={},this.pendingDiffs=[],this.joinRef=null,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};let r=a?.events||{state:"presence_state",diff:"presence_diff"};this.channel._on(r.state,{},o=>{let{onJoin:n,onLeave:s,onSync:i}=this.caller;this.joinRef=this.channel._joinRef(),this.state=e.syncState(this.state,o,n,s),this.pendingDiffs.forEach(l=>{this.state=e.syncDiff(this.state,l,n,s)}),this.pendingDiffs=[],i()}),this.channel._on(r.diff,{},o=>{let{onJoin:n,onLeave:s,onSync:i}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(o):(this.state=e.syncDiff(this.state,o,n,s),i())}),this.onJoin((o,n,s)=>{this.channel._trigger("presence",{event:"join",key:o,currentPresences:n,newPresences:s})}),this.onLeave((o,n,s)=>{this.channel._trigger("presence",{event:"leave",key:o,currentPresences:n,leftPresences:s})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(t,a,r,o){let n=this.cloneDeep(t),s=this.transformState(a),i={},l={};return this.map(n,(u,d)=>{s[u]||(l[u]=d)}),this.map(s,(u,d)=>{let c=n[u];if(c){let f=d.map(L=>L.presence_ref),g=c.map(L=>L.presence_ref),x=d.filter(L=>g.indexOf(L.presence_ref)<0),w=c.filter(L=>f.indexOf(L.presence_ref)<0);x.length>0&&(i[u]=x),w.length>0&&(l[u]=w)}else i[u]=d}),this.syncDiff(n,{joins:i,leaves:l},r,o)}static syncDiff(t,a,r,o){let{joins:n,leaves:s}={joins:this.transformState(a.joins),leaves:this.transformState(a.leaves)};return r||(r=()=>{}),o||(o=()=>{}),this.map(n,(i,l)=>{var u;let d=(u=t[i])!==null&&u!==void 0?u:[];if(t[i]=this.cloneDeep(l),d.length>0){let c=t[i].map(g=>g.presence_ref),f=d.filter(g=>c.indexOf(g.presence_ref)<0);t[i].unshift(...f)}r(i,d,l)}),this.map(s,(i,l)=>{let u=t[i];if(!u)return;let d=l.map(c=>c.presence_ref);u=u.filter(c=>d.indexOf(c.presence_ref)<0),t[i]=u,o(i,u,l),u.length===0&&delete t[i]}),t}static map(t,a){return Object.getOwnPropertyNames(t).map(r=>a(r,t[r]))}static transformState(t){return t=this.cloneDeep(t),Object.getOwnPropertyNames(t).reduce((a,r)=>{let o=t[r];return"metas"in o?a[r]=o.metas.map(n=>(n.presence_ref=n.phx_ref,delete n.phx_ref,delete n.phx_ref_prev,n)):a[r]=o,a},{})}static cloneDeep(t){return JSON.parse(JSON.stringify(t))}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}};var og;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(og||(og={}));var ng;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(ng||(ng={}));var Na;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(Na||(Na={}));var fs=class e{constructor(t,a={config:{}},r){this.topic=t,this.params=a,this.socket=r,this.bindings={},this.state=lt.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:""},private:!1},a.config),this.timeout=this.socket.timeout,this.joinPush=new Ho(this,Qt.join,this.params,this.timeout),this.rejoinTimer=new qo(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=lt.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(o=>o.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=lt.closed,this.socket._remove(this)}),this._onError(o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=lt.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=lt.errored,this.rejoinTimer.scheduleTimeout())}),this._on(Qt.reply,{},(o,n)=>{this._trigger(this._replyEventName(n),o)}),this.presence=new cs(this),this.broadcastEndpointURL=lc(this.socket.endPoint)+"/api/broadcast",this.private=this.params.config.private||!1}subscribe(t,a=this.timeout){var r,o;if(this.socket.isConnected()||this.socket.connect(),this.state==lt.closed){let{config:{broadcast:n,presence:s,private:i}}=this.params;this._onError(d=>t?.(Na.CHANNEL_ERROR,d)),this._onClose(()=>t?.(Na.CLOSED));let l={},u={broadcast:n,presence:s,postgres_changes:(o=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(d=>d.filter))!==null&&o!==void 0?o:[],private:i};this.socket.accessTokenValue&&(l.access_token=this.socket.accessTokenValue),this.updateJoinPayload(Object.assign({config:u},l)),this.joinedOnce=!0,this._rejoin(a),this.joinPush.receive("ok",async({postgres_changes:d})=>{var c;if(this.socket.setAuth(),d===void 0){t?.(Na.SUBSCRIBED);return}else{let f=this.bindings.postgres_changes,g=(c=f?.length)!==null&&c!==void 0?c:0,x=[];for(let w=0;w<g;w++){let L=f[w],{filter:{event:y,schema:h,table:m,filter:C}}=L,I=d&&d[w];if(I&&I.event===y&&I.schema===h&&I.table===m&&I.filter===C)x.push(Object.assign(Object.assign({},L),{id:I.id}));else{this.unsubscribe(),this.state=lt.errored,t?.(Na.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=x,t&&t(Na.SUBSCRIBED);return}}).receive("error",d=>{this.state=lt.errored,t?.(Na.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(d).join(", ")||"error")))}).receive("timeout",()=>{t?.(Na.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(t,a={}){return await this.send({type:"presence",event:"track",payload:t},a.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,a,r){return this._on(t,a,r)}async send(t,a={}){var r,o;if(!this._canPush()&&t.type==="broadcast"){let{event:n,payload:s}=t,l={method:"POST",headers:{Authorization:this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:n,payload:s,private:this.private}]})};try{let u=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(r=a.timeout)!==null&&r!==void 0?r:this.timeout);return await((o=u.body)===null||o===void 0?void 0:o.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(n=>{var s,i,l;let u=this._push(t.type,t,a.timeout||this.timeout);t.type==="broadcast"&&!(!((l=(i=(s=this.params)===null||s===void 0?void 0:s.config)===null||i===void 0?void 0:i.broadcast)===null||l===void 0)&&l.ack)&&n("ok"),u.receive("ok",()=>n("ok")),u.receive("error",()=>n("error")),u.receive("timeout",()=>n("timed out"))})}updateJoinPayload(t){this.joinPush.updatePayload(t)}unsubscribe(t=this.timeout){this.state=lt.leaving;let a=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(Qt.close,"leave",this._joinRef())};this.joinPush.destroy();let r=null;return new Promise(o=>{r=new Ho(this,Qt.leave,{},t),r.receive("ok",()=>{a(),o("ok")}).receive("timeout",()=>{a(),o("timed out")}).receive("error",()=>{o("error")}),r.send(),this._canPush()||r.trigger("ok",{})}).finally(()=>{r?.destroy()})}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.rejoinTimer&&clearTimeout(this.rejoinTimer.timer),this.joinPush.destroy()}async _fetchWithTimeout(t,a,r){let o=new AbortController,n=setTimeout(()=>o.abort(),r),s=await this.socket.fetch(t,Object.assign(Object.assign({},a),{signal:o.signal}));return clearTimeout(n),s}_push(t,a,r=this.timeout){if(!this.joinedOnce)throw`tried to push '${t}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let o=new Ho(this,t,a,r);return this._canPush()?o.send():(o.startTimeout(),this.pushBuffer.push(o)),o}_onMessage(t,a,r){return a}_isMember(t){return this.topic===t}_joinRef(){return this.joinPush.ref}_trigger(t,a,r){var o,n;let s=t.toLocaleLowerCase(),{close:i,error:l,leave:u,join:d}=Qt;if(r&&[i,l,u,d].indexOf(s)>=0&&r!==this._joinRef())return;let f=this._onMessage(s,a,r);if(a&&!f)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(s)?(o=this.bindings.postgres_changes)===null||o===void 0||o.filter(g=>{var x,w,L;return((x=g.filter)===null||x===void 0?void 0:x.event)==="*"||((L=(w=g.filter)===null||w===void 0?void 0:w.event)===null||L===void 0?void 0:L.toLocaleLowerCase())===s}).map(g=>g.callback(f,r)):(n=this.bindings[s])===null||n===void 0||n.filter(g=>{var x,w,L,y,h,m;if(["broadcast","presence","postgres_changes"].includes(s))if("id"in g){let C=g.id,I=(x=g.filter)===null||x===void 0?void 0:x.event;return C&&((w=a.ids)===null||w===void 0?void 0:w.includes(C))&&(I==="*"||I?.toLocaleLowerCase()===((L=a.data)===null||L===void 0?void 0:L.type.toLocaleLowerCase()))}else{let C=(h=(y=g?.filter)===null||y===void 0?void 0:y.event)===null||h===void 0?void 0:h.toLocaleLowerCase();return C==="*"||C===((m=a?.event)===null||m===void 0?void 0:m.toLocaleLowerCase())}else return g.type.toLocaleLowerCase()===s}).map(g=>{if(typeof f=="object"&&"ids"in f){let x=f.data,{schema:w,table:L,commit_timestamp:y,type:h,errors:m}=x;f=Object.assign(Object.assign({},{schema:w,table:L,commit_timestamp:y,eventType:h,new:{},old:{},errors:m}),this._getPayloadRecords(x))}g.callback(f,r)})}_isClosed(){return this.state===lt.closed}_isJoined(){return this.state===lt.joined}_isJoining(){return this.state===lt.joining}_isLeaving(){return this.state===lt.leaving}_replyEventName(t){return`chan_reply_${t}`}_on(t,a,r){let o=t.toLocaleLowerCase(),n={type:o,filter:a,callback:r};return this.bindings[o]?this.bindings[o].push(n):this.bindings[o]=[n],this}_off(t,a){let r=t.toLocaleLowerCase();return this.bindings[r]=this.bindings[r].filter(o=>{var n;return!(((n=o.type)===null||n===void 0?void 0:n.toLocaleLowerCase())===r&&e.isEqual(o.filter,a))}),this}static isEqual(t,a){if(Object.keys(t).length!==Object.keys(a).length)return!1;for(let r in t)if(t[r]!==a[r])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(t){this._on(Qt.close,{},t)}_onError(t){this._on(Qt.error,{},a=>t(a))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=lt.joining,this.joinPush.resend(t))}_getPayloadRecords(t){let a={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(a.new=ag(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(a.old=ag(t.columns,t.old_record)),a}};var Gw=()=>{},S1=`
8
+ `+n.stack}return{value:e,source:t,stack:o,digest:null}}function em(e,t,a){return{value:e,source:null,stack:a??null,digest:t??null}}function Om(e,t){try{console.error(t.value)}catch(a){setTimeout(function(){throw a})}}var kT=typeof WeakMap=="function"?WeakMap:Map;function G0(e,t,a){a=ar(-1,a),a.tag=3,a.payload={element:null};var r=t.value;return a.callback=function(){Od||(Od=!0,Wm=r),Om(e,t)},a}function K0(e,t,a){a=ar(-1,a),a.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;a.payload=function(){return r(o)},a.callback=function(){Om(e,t)}}var n=e.stateNode;return n!==null&&typeof n.componentDidCatch=="function"&&(a.callback=function(){Om(e,t),typeof r!="function"&&(jr===null?jr=new Set([this]):jr.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),a}function nv(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new kT;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(a)||(o.add(a),e=VT.bind(null,e,t,a),t.then(e,e))}function sv(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function iv(e,t,a,r,o){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,a.flags|=131072,a.flags&=-52805,a.tag===1&&(a.alternate===null?a.tag=17:(t=ar(-1,1),t.tag=2,Vr(a,t,1))),a.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var PT=ir.ReactCurrentOwner,_t=!1;function It(e,t,a,r){t.child=e===null?L0(t,null,a,r):as(t,e.child,a,r)}function lv(e,t,a,r,o){a=a.render;var n=t.ref;return Jn(t,o),r=Ih(e,t,a,r,n,o),a=bh(),e!==null&&!_t?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,sr(e,t,o)):(Ae&&a&&fh(t),t.flags|=1,It(e,t,r,o),t.child)}function uv(e,t,a,r,o){if(e===null){var n=a.type;return typeof n=="function"&&!Nh(n)&&n.defaultProps===void 0&&a.compare===null&&a.defaultProps===void 0?(t.tag=15,t.type=n,X0(e,t,n,r,o)):(e=hd(a.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(n=e.child,(e.lanes&o)===0){var s=n.memoizedProps;if(a=a.compare,a=a!==null?a:nl,a(s,r)&&e.ref===t.ref)return sr(e,t,o)}return t.flags|=1,e=Hr(n,r),e.ref=t.ref,e.return=t,t.child=e}function X0(e,t,a,r,o){if(e!==null){var n=e.memoizedProps;if(nl(n,r)&&e.ref===t.ref)if(_t=!1,t.pendingProps=r=n,(e.lanes&o)!==0)(e.flags&131072)!==0&&(_t=!0);else return t.lanes=e.lanes,sr(e,t,o)}return Fm(e,t,a,r,o)}function Q0(e,t,a){var r=t.pendingProps,o=r.children,n=e!==null?e.memoizedState:null;if(r.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},we(Wn,zt),zt|=a;else{if((a&1073741824)===0)return e=n!==null?n.baseLanes|a:a,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,we(Wn,zt),zt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=n!==null?n.baseLanes:a,we(Wn,zt),zt|=r}else n!==null?(r=n.baseLanes|a,t.memoizedState=null):r=a,we(Wn,zt),zt|=r;return It(e,t,o,a),t.child}function J0(e,t){var a=t.ref;(e===null&&a!==null||e!==null&&e.ref!==a)&&(t.flags|=512,t.flags|=2097152)}function Fm(e,t,a,r,o){var n=Dt(a)?Mo:vt.current;return n=es(t,n),Jn(t,o),a=Ih(e,t,a,r,n,o),r=bh(),e!==null&&!_t?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,sr(e,t,o)):(Ae&&r&&fh(t),t.flags|=1,It(e,t,a,o),t.child)}function dv(e,t,a,r,o){if(Dt(a)){var n=!0;kd(t)}else n=!1;if(Jn(t,o),t.stateNode===null)fd(e,t),W0(t,a,r),Nm(t,a,r,o),r=!0;else if(e===null){var s=t.stateNode,i=t.memoizedProps;s.props=i;var l=s.context,u=a.contextType;typeof u=="object"&&u!==null?u=la(u):(u=Dt(a)?Mo:vt.current,u=es(t,u));var d=a.getDerivedStateFromProps,c=typeof d=="function"||typeof s.getSnapshotBeforeUpdate=="function";c||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(i!==r||l!==u)&&ov(t,s,r,u),_r=!1;var f=t.memoizedState;s.state=f,_d(t,r,s,o),l=t.memoizedState,i!==r||f!==l||Et.current||_r?(typeof d=="function"&&(Mm(t,a,d,r),l=t.memoizedState),(i=_r||rv(t,a,i,r,f,l,u))?(c||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),s.props=r,s.state=l,s.context=u,r=i):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,b0(e,t),i=t.memoizedProps,u=t.type===t.elementType?i:xa(t.type,i),s.props=u,c=t.pendingProps,f=s.context,l=a.contextType,typeof l=="object"&&l!==null?l=la(l):(l=Dt(a)?Mo:vt.current,l=es(t,l));var g=a.getDerivedStateFromProps;(d=typeof g=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(i!==c||f!==l)&&ov(t,s,r,l),_r=!1,f=t.memoizedState,s.state=f,_d(t,r,s,o);var x=t.memoizedState;i!==c||f!==x||Et.current||_r?(typeof g=="function"&&(Mm(t,a,g,r),x=t.memoizedState),(u=_r||rv(t,a,u,r,f,x,l)||!1)?(d||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,x,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,x,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=x),s.props=r,s.state=x,s.context=l,r=u):(typeof s.componentDidUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Bm(e,t,a,r,n,o)}function Bm(e,t,a,r,o,n){J0(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&Xx(t,a,!1),sr(e,t,n);r=t.stateNode,PT.current=t;var i=s&&typeof a.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=as(t,e.child,null,n),t.child=as(t,null,i,n)):It(e,t,i,n),t.memoizedState=r.state,o&&Xx(t,a,!0),t.child}function Y0(e){var t=e.stateNode;t.pendingContext?Kx(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Kx(e,t.context,!1),wh(e,t.containerInfo)}function cv(e,t,a,r,o){return ts(),mh(o),t.flags|=256,It(e,t,a,r),t.child}var Um={dehydrated:null,treeContext:null,retryLane:0};function Vm(e){return{baseLanes:e,cachePool:null,transitions:null}}function Z0(e,t,a){var r=t.pendingProps,o=Re.current,n=!1,s=(t.flags&128)!==0,i;if((i=s)||(i=e!==null&&e.memoizedState===null?!1:(o&2)!==0),i?(n=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),we(Re,o&1),e===null)return Em(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(s=r.children,e=r.fallback,n?(r=t.mode,n=t.child,s={mode:"hidden",children:s},(r&1)===0&&n!==null?(n.childLanes=0,n.pendingProps=s):n=Qd(s,r,0,null),e=Do(e,r,a,null),n.return=t,e.return=t,n.sibling=e,t.child=n,t.child.memoizedState=Vm(a),t.memoizedState=Um,e):Th(t,s));if(o=e.memoizedState,o!==null&&(i=o.dehydrated,i!==null))return TT(e,t,s,r,i,o,a);if(n){n=r.fallback,s=t.mode,o=e.child,i=o.sibling;var l={mode:"hidden",children:r.children};return(s&1)===0&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=Hr(o,l),r.subtreeFlags=o.subtreeFlags&14680064),i!==null?n=Hr(i,n):(n=Do(n,s,a,null),n.flags|=2),n.return=t,r.return=t,r.sibling=n,t.child=r,r=n,n=t.child,s=e.child.memoizedState,s=s===null?Vm(a):{baseLanes:s.baseLanes|a,cachePool:null,transitions:s.transitions},n.memoizedState=s,n.childLanes=e.childLanes&~a,t.memoizedState=Um,r}return n=e.child,e=n.sibling,r=Hr(n,{mode:"visible",children:r.children}),(t.mode&1)===0&&(r.lanes=a),r.return=t,r.sibling=null,e!==null&&(a=t.deletions,a===null?(t.deletions=[e],t.flags|=16):a.push(e)),t.child=r,t.memoizedState=null,r}function Th(e,t){return t=Qd({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function rd(e,t,a,r){return r!==null&&mh(r),as(t,e.child,null,a),e=Th(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function TT(e,t,a,r,o,n,s){if(a)return t.flags&256?(t.flags&=-257,r=em(Error(_(422))),rd(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(n=r.fallback,o=t.mode,r=Qd({mode:"visible",children:r.children},o,0,null),n=Do(n,o,s,null),n.flags|=2,r.return=t,n.return=t,r.sibling=n,t.child=r,(t.mode&1)!==0&&as(t,e.child,null,s),t.child.memoizedState=Vm(s),t.memoizedState=Um,n);if((t.mode&1)===0)return rd(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var i=r.dgst;return r=i,n=Error(_(419)),r=em(n,r,void 0),rd(e,t,s,r)}if(i=(s&e.childLanes)!==0,_t||i){if(r=tt,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=(o&(r.suspendedLanes|s))!==0?0:o,o!==0&&o!==n.retryLane&&(n.retryLane=o,nr(e,o),Ca(r,e,o,-1))}return Mh(),r=em(Error(_(421))),rd(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=jT.bind(null,e),o._reactRetry=t,null):(e=n.treeContext,$t=Ur(o.nextSibling),Wt=t,Ae=!0,wa=null,e!==null&&(oa[na++]=er,oa[na++]=tr,oa[na++]=No,er=e.id,tr=e.overflow,No=t),t=Th(t,r.children),t.flags|=4096,t)}function fv(e,t,a){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Dm(e.return,t,a)}function tm(e,t,a,r,o){var n=e.memoizedState;n===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:a,tailMode:o}:(n.isBackwards=t,n.rendering=null,n.renderingStartTime=0,n.last=r,n.tail=a,n.tailMode=o)}function ew(e,t,a){var r=t.pendingProps,o=r.revealOrder,n=r.tail;if(It(e,t,r.children,a),r=Re.current,(r&2)!==0)r=r&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&fv(e,a,t);else if(e.tag===19)fv(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(we(Re,r),(t.mode&1)===0)t.memoizedState=null;else switch(o){case"forwards":for(a=t.child,o=null;a!==null;)e=a.alternate,e!==null&&Ed(e)===null&&(o=a),a=a.sibling;a=o,a===null?(o=t.child,t.child=null):(o=a.sibling,a.sibling=null),tm(t,!1,o,a,n);break;case"backwards":for(a=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Ed(e)===null){t.child=o;break}e=o.sibling,o.sibling=a,a=o,o=e}tm(t,!0,a,null,n);break;case"together":tm(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function fd(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function sr(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Fo|=t.lanes,(a&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(_(153));if(t.child!==null){for(e=t.child,a=Hr(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Hr(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function AT(e,t,a){switch(t.tag){case 3:Y0(t),ts();break;case 5:k0(t);break;case 1:Dt(t.type)&&kd(t);break;case 4:wh(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;we(Ad,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(we(Re,Re.current&1),t.flags|=128,null):(a&t.child.childLanes)!==0?Z0(e,t,a):(we(Re,Re.current&1),e=sr(e,t,a),e!==null?e.sibling:null);we(Re,Re.current&1);break;case 19:if(r=(a&t.childLanes)!==0,(e.flags&128)!==0){if(r)return ew(e,t,a);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),we(Re,Re.current),r)break;return null;case 22:case 23:return t.lanes=0,Q0(e,t,a)}return sr(e,t,a)}var tw,jm,aw,rw;tw=function(e,t){for(var a=t.child;a!==null;){if(a.tag===5||a.tag===6)e.appendChild(a.stateNode);else if(a.tag!==4&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return;a=a.return}a.sibling.return=a.return,a=a.sibling}};jm=function(){};aw=function(e,t,a,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,_o(Ma.current);var n=null;switch(a){case"input":o=um(e,o),r=um(e,r),n=[];break;case"select":o=Ee({},o,{value:void 0}),r=Ee({},r,{value:void 0}),n=[];break;case"textarea":o=fm(e,o),r=fm(e,r),n=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Id)}mm(a,r);var s;a=null;for(u in o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var i=o[u];for(s in i)i.hasOwnProperty(s)&&(a||(a={}),a[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Yi.hasOwnProperty(u)?n||(n=[]):(n=n||[]).push(u,null));for(u in r){var l=r[u];if(i=o?.[u],r.hasOwnProperty(u)&&l!==i&&(l!=null||i!=null))if(u==="style")if(i){for(s in i)!i.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(a||(a={}),a[s]="");for(s in l)l.hasOwnProperty(s)&&i[s]!==l[s]&&(a||(a={}),a[s]=l[s])}else a||(n||(n=[]),n.push(u,a)),a=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,i=i?i.__html:void 0,l!=null&&i!==l&&(n=n||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(n=n||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Yi.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&Ie("scroll",e),n||i===l||(n=[])):(n=n||[]).push(u,l))}a&&(n=n||[]).push("style",a);var u=n;(t.updateQueue=u)&&(t.flags|=4)}};rw=function(e,t,a,r){a!==r&&(t.flags|=4)};function Oi(e,t){if(!Ae)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var r=null;a!==null;)a.alternate!==null&&(r=a),a=a.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function yt(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,r=0;if(t)for(var o=e.child;o!==null;)a|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)a|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=a,t}function RT(e,t,a){var r=t.pendingProps;switch(ph(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yt(t),null;case 1:return Dt(t.type)&&bd(),yt(t),null;case 3:return r=t.stateNode,rs(),be(Et),be(vt),Ch(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(td(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,wa!==null&&(Xm(wa),wa=null))),jm(e,t),yt(t),null;case 5:Sh(t);var o=_o(dl.current);if(a=t.type,e!==null&&t.stateNode!=null)aw(e,t,a,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(_(166));return yt(t),null}if(e=_o(Ma.current),td(t)){r=t.stateNode,a=t.type;var n=t.memoizedProps;switch(r[Ea]=t,r[ll]=n,e=(t.mode&1)!==0,a){case"dialog":Ie("cancel",r),Ie("close",r);break;case"iframe":case"object":case"embed":Ie("load",r);break;case"video":case"audio":for(o=0;o<qi.length;o++)Ie(qi[o],r);break;case"source":Ie("error",r);break;case"img":case"image":case"link":Ie("error",r),Ie("load",r);break;case"details":Ie("toggle",r);break;case"input":wx(r,n),Ie("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!n.multiple},Ie("invalid",r);break;case"textarea":Cx(r,n),Ie("invalid",r)}mm(a,n),o=null;for(var s in n)if(n.hasOwnProperty(s)){var i=n[s];s==="children"?typeof i=="string"?r.textContent!==i&&(n.suppressHydrationWarning!==!0&&ed(r.textContent,i,e),o=["children",i]):typeof i=="number"&&r.textContent!==""+i&&(n.suppressHydrationWarning!==!0&&ed(r.textContent,i,e),o=["children",""+i]):Yi.hasOwnProperty(s)&&i!=null&&s==="onScroll"&&Ie("scroll",r)}switch(a){case"input":qu(r),Sx(r,n,!0);break;case"textarea":qu(r),Lx(r);break;case"select":case"option":break;default:typeof n.onClick=="function"&&(r.onclick=Id)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=_v(a)),e==="http://www.w3.org/1999/xhtml"?a==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(a,{is:r.is}):(e=s.createElement(a),a==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,a),e[Ea]=t,e[ll]=r,tw(e,t,!1,!1),t.stateNode=e;e:{switch(s=hm(a,r),a){case"dialog":Ie("cancel",e),Ie("close",e),o=r;break;case"iframe":case"object":case"embed":Ie("load",e),o=r;break;case"video":case"audio":for(o=0;o<qi.length;o++)Ie(qi[o],e);o=r;break;case"source":Ie("error",e),o=r;break;case"img":case"image":case"link":Ie("error",e),Ie("load",e),o=r;break;case"details":Ie("toggle",e),o=r;break;case"input":wx(e,r),o=um(e,r),Ie("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Ee({},r,{value:void 0}),Ie("invalid",e);break;case"textarea":Cx(e,r),o=fm(e,r),Ie("invalid",e);break;default:o=r}mm(a,o),i=o;for(n in i)if(i.hasOwnProperty(n)){var l=i[n];n==="style"?Mv(e,l):n==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Ev(e,l)):n==="children"?typeof l=="string"?(a!=="textarea"||l!=="")&&Zi(e,l):typeof l=="number"&&Zi(e,""+l):n!=="suppressContentEditableWarning"&&n!=="suppressHydrationWarning"&&n!=="autoFocus"&&(Yi.hasOwnProperty(n)?l!=null&&n==="onScroll"&&Ie("scroll",e):l!=null&&Ym(e,n,l,s))}switch(a){case"input":qu(e),Sx(e,r,!1);break;case"textarea":qu(e),Lx(e);break;case"option":r.value!=null&&e.setAttribute("value",""+zr(r.value));break;case"select":e.multiple=!!r.multiple,n=r.value,n!=null?Gn(e,!!r.multiple,n,!1):r.defaultValue!=null&&Gn(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Id)}switch(a){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return yt(t),null;case 6:if(e&&t.stateNode!=null)rw(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(_(166));if(a=_o(dl.current),_o(Ma.current),td(t)){if(r=t.stateNode,a=t.memoizedProps,r[Ea]=t,(n=r.nodeValue!==a)&&(e=Wt,e!==null))switch(e.tag){case 3:ed(r.nodeValue,a,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ed(r.nodeValue,a,(e.mode&1)!==0)}n&&(t.flags|=4)}else r=(a.nodeType===9?a:a.ownerDocument).createTextNode(r),r[Ea]=t,t.stateNode=r}return yt(t),null;case 13:if(be(Re),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ae&&$t!==null&&(t.mode&1)!==0&&(t.flags&128)===0)S0(),ts(),t.flags|=98560,n=!1;else if(n=td(t),r!==null&&r.dehydrated!==null){if(e===null){if(!n)throw Error(_(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(_(317));n[Ea]=t}else ts(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;yt(t),n=!1}else wa!==null&&(Xm(wa),wa=null),n=!0;if(!n)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=a,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(Re.current&1)!==0?We===0&&(We=3):Mh())),t.updateQueue!==null&&(t.flags|=4),yt(t),null);case 4:return rs(),jm(e,t),e===null&&sl(t.stateNode.containerInfo),yt(t),null;case 10:return yh(t.type._context),yt(t),null;case 17:return Dt(t.type)&&bd(),yt(t),null;case 19:if(be(Re),n=t.memoizedState,n===null)return yt(t),null;if(r=(t.flags&128)!==0,s=n.rendering,s===null)if(r)Oi(n,!1);else{if(We!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(s=Ed(e),s!==null){for(t.flags|=128,Oi(n,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=a,a=t.child;a!==null;)n=a,e=r,n.flags&=14680066,s=n.alternate,s===null?(n.childLanes=0,n.lanes=e,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=s.childLanes,n.lanes=s.lanes,n.child=s.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=s.memoizedProps,n.memoizedState=s.memoizedState,n.updateQueue=s.updateQueue,n.type=s.type,e=s.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),a=a.sibling;return we(Re,Re.current&1|2),t.child}e=e.sibling}n.tail!==null&&Fe()>ns&&(t.flags|=128,r=!0,Oi(n,!1),t.lanes=4194304)}else{if(!r)if(e=Ed(s),e!==null){if(t.flags|=128,r=!0,a=e.updateQueue,a!==null&&(t.updateQueue=a,t.flags|=4),Oi(n,!0),n.tail===null&&n.tailMode==="hidden"&&!s.alternate&&!Ae)return yt(t),null}else 2*Fe()-n.renderingStartTime>ns&&a!==1073741824&&(t.flags|=128,r=!0,Oi(n,!1),t.lanes=4194304);n.isBackwards?(s.sibling=t.child,t.child=s):(a=n.last,a!==null?a.sibling=s:t.child=s,n.last=s)}return n.tail!==null?(t=n.tail,n.rendering=t,n.tail=t.sibling,n.renderingStartTime=Fe(),t.sibling=null,a=Re.current,we(Re,r?a&1|2:a&1),t):(yt(t),null);case 22:case 23:return Dh(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(zt&1073741824)!==0&&(yt(t),t.subtreeFlags&6&&(t.flags|=8192)):yt(t),null;case 24:return null;case 25:return null}throw Error(_(156,t.tag))}function _T(e,t){switch(ph(t),t.tag){case 1:return Dt(t.type)&&bd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return rs(),be(Et),be(vt),Ch(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Sh(t),null;case 13:if(be(Re),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(_(340));ts()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return be(Re),null;case 4:return rs(),null;case 10:return yh(t.type._context),null;case 22:case 23:return Dh(),null;case 24:return null;default:return null}}var od=!1,xt=!1,ET=typeof WeakSet=="function"?WeakSet:Set,U=null;function $n(e,t){var a=e.ref;if(a!==null)if(typeof a=="function")try{a(null)}catch(r){Ne(e,t,r)}else a.current=null}function qm(e,t,a){try{a()}catch(r){Ne(e,t,r)}}var pv=!1;function DT(e,t){if(bm=Sd,e=l0(),ch(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var r=a.getSelection&&a.getSelection();if(r&&r.rangeCount!==0){a=r.anchorNode;var o=r.anchorOffset,n=r.focusNode;r=r.focusOffset;try{a.nodeType,n.nodeType}catch{a=null;break e}var s=0,i=-1,l=-1,u=0,d=0,c=e,f=null;t:for(;;){for(var g;c!==a||o!==0&&c.nodeType!==3||(i=s+o),c!==n||r!==0&&c.nodeType!==3||(l=s+r),c.nodeType===3&&(s+=c.nodeValue.length),(g=c.firstChild)!==null;)f=c,c=g;for(;;){if(c===e)break t;if(f===a&&++u===o&&(i=s),f===n&&++d===r&&(l=s),(g=c.nextSibling)!==null)break;c=f,f=c.parentNode}c=g}a=i===-1||l===-1?null:{start:i,end:l}}else a=null}a=a||{start:0,end:0}}else a=null;for(km={focusedElem:e,selectionRange:a},Sd=!1,U=t;U!==null;)if(t=U,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,U=e;else for(;U!==null;){t=U;try{var x=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var w=x.memoizedProps,L=x.memoizedState,y=t.stateNode,h=y.getSnapshotBeforeUpdate(t.elementType===t.type?w:xa(t.type,w),L);y.__reactInternalSnapshotBeforeUpdate=h}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(_(163))}}catch(C){Ne(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,U=e;break}U=t.return}return x=pv,pv=!1,x}function Xi(e,t,a){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var n=o.destroy;o.destroy=void 0,n!==void 0&&qm(t,a,n)}o=o.next}while(o!==r)}}function Kd(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var a=t=t.next;do{if((a.tag&e)===e){var r=a.create;a.destroy=r()}a=a.next}while(a!==t)}}function Hm(e){var t=e.ref;if(t!==null){var a=e.stateNode;e.tag,e=a,typeof t=="function"?t(e):t.current=e}}function ow(e){var t=e.alternate;t!==null&&(e.alternate=null,ow(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ea],delete t[ll],delete t[Am],delete t[hT],delete t[gT])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function nw(e){return e.tag===5||e.tag===3||e.tag===4}function mv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||nw(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function zm(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?a.nodeType===8?a.parentNode.insertBefore(e,t):a.insertBefore(e,t):(a.nodeType===8?(t=a.parentNode,t.insertBefore(e,a)):(t=a,t.appendChild(e)),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Id));else if(r!==4&&(e=e.child,e!==null))for(zm(e,t,a),e=e.sibling;e!==null;)zm(e,t,a),e=e.sibling}function $m(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for($m(e,t,a),e=e.sibling;e!==null;)$m(e,t,a),e=e.sibling}var ot=null,va=!1;function Ar(e,t,a){for(a=a.child;a!==null;)sw(e,t,a),a=a.sibling}function sw(e,t,a){if(Da&&typeof Da.onCommitFiberUnmount=="function")try{Da.onCommitFiberUnmount(Vd,a)}catch{}switch(a.tag){case 5:xt||$n(a,t);case 6:var r=ot,o=va;ot=null,Ar(e,t,a),ot=r,va=o,ot!==null&&(va?(e=ot,a=a.stateNode,e.nodeType===8?e.parentNode.removeChild(a):e.removeChild(a)):ot.removeChild(a.stateNode));break;case 18:ot!==null&&(va?(e=ot,a=a.stateNode,e.nodeType===8?Kp(e.parentNode,a):e.nodeType===1&&Kp(e,a),rl(e)):Kp(ot,a.stateNode));break;case 4:r=ot,o=va,ot=a.stateNode.containerInfo,va=!0,Ar(e,t,a),ot=r,va=o;break;case 0:case 11:case 14:case 15:if(!xt&&(r=a.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var n=o,s=n.destroy;n=n.tag,s!==void 0&&((n&2)!==0||(n&4)!==0)&&qm(a,t,s),o=o.next}while(o!==r)}Ar(e,t,a);break;case 1:if(!xt&&($n(a,t),r=a.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=a.memoizedProps,r.state=a.memoizedState,r.componentWillUnmount()}catch(i){Ne(a,t,i)}Ar(e,t,a);break;case 21:Ar(e,t,a);break;case 22:a.mode&1?(xt=(r=xt)||a.memoizedState!==null,Ar(e,t,a),xt=r):Ar(e,t,a);break;default:Ar(e,t,a)}}function hv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var a=e.stateNode;a===null&&(a=e.stateNode=new ET),t.forEach(function(r){var o=qT.bind(null,e,r);a.has(r)||(a.add(r),r.then(o,o))})}}function ya(e,t){var a=t.deletions;if(a!==null)for(var r=0;r<a.length;r++){var o=a[r];try{var n=e,s=t,i=s;e:for(;i!==null;){switch(i.tag){case 5:ot=i.stateNode,va=!1;break e;case 3:ot=i.stateNode.containerInfo,va=!0;break e;case 4:ot=i.stateNode.containerInfo,va=!0;break e}i=i.return}if(ot===null)throw Error(_(160));sw(n,s,o),ot=null,va=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(u){Ne(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)iw(t,e),t=t.sibling}function iw(e,t){var a=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ya(t,e),Ra(e),r&4){try{Xi(3,e,e.return),Kd(3,e)}catch(w){Ne(e,e.return,w)}try{Xi(5,e,e.return)}catch(w){Ne(e,e.return,w)}}break;case 1:ya(t,e),Ra(e),r&512&&a!==null&&$n(a,a.return);break;case 5:if(ya(t,e),Ra(e),r&512&&a!==null&&$n(a,a.return),e.flags&32){var o=e.stateNode;try{Zi(o,"")}catch(w){Ne(e,e.return,w)}}if(r&4&&(o=e.stateNode,o!=null)){var n=e.memoizedProps,s=a!==null?a.memoizedProps:n,i=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{i==="input"&&n.type==="radio"&&n.name!=null&&Av(o,n),hm(i,s);var u=hm(i,n);for(s=0;s<l.length;s+=2){var d=l[s],c=l[s+1];d==="style"?Mv(o,c):d==="dangerouslySetInnerHTML"?Ev(o,c):d==="children"?Zi(o,c):Ym(o,d,c,u)}switch(i){case"input":dm(o,n);break;case"textarea":Rv(o,n);break;case"select":var f=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!n.multiple;var g=n.value;g!=null?Gn(o,!!n.multiple,g,!1):f!==!!n.multiple&&(n.defaultValue!=null?Gn(o,!!n.multiple,n.defaultValue,!0):Gn(o,!!n.multiple,n.multiple?[]:"",!1))}o[ll]=n}catch(w){Ne(e,e.return,w)}}break;case 6:if(ya(t,e),Ra(e),r&4){if(e.stateNode===null)throw Error(_(162));o=e.stateNode,n=e.memoizedProps;try{o.nodeValue=n}catch(w){Ne(e,e.return,w)}}break;case 3:if(ya(t,e),Ra(e),r&4&&a!==null&&a.memoizedState.isDehydrated)try{rl(t.containerInfo)}catch(w){Ne(e,e.return,w)}break;case 4:ya(t,e),Ra(e);break;case 13:ya(t,e),Ra(e),o=e.child,o.flags&8192&&(n=o.memoizedState!==null,o.stateNode.isHidden=n,!n||o.alternate!==null&&o.alternate.memoizedState!==null||(_h=Fe())),r&4&&hv(e);break;case 22:if(d=a!==null&&a.memoizedState!==null,e.mode&1?(xt=(u=xt)||d,ya(t,e),xt=u):ya(t,e),Ra(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&(e.mode&1)!==0)for(U=e,d=e.child;d!==null;){for(c=U=d;U!==null;){switch(f=U,g=f.child,f.tag){case 0:case 11:case 14:case 15:Xi(4,f,f.return);break;case 1:$n(f,f.return);var x=f.stateNode;if(typeof x.componentWillUnmount=="function"){r=f,a=f.return;try{t=r,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(w){Ne(r,a,w)}}break;case 5:$n(f,f.return);break;case 22:if(f.memoizedState!==null){yv(c);continue}}g!==null?(g.return=f,U=g):yv(c)}d=d.sibling}e:for(d=null,c=e;;){if(c.tag===5){if(d===null){d=c;try{o=c.stateNode,u?(n=o.style,typeof n.setProperty=="function"?n.setProperty("display","none","important"):n.display="none"):(i=c.stateNode,l=c.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,i.style.display=Dv("display",s))}catch(w){Ne(e,e.return,w)}}}else if(c.tag===6){if(d===null)try{c.stateNode.nodeValue=u?"":c.memoizedProps}catch(w){Ne(e,e.return,w)}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===e)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===e)break e;for(;c.sibling===null;){if(c.return===null||c.return===e)break e;d===c&&(d=null),c=c.return}d===c&&(d=null),c.sibling.return=c.return,c=c.sibling}}break;case 19:ya(t,e),Ra(e),r&4&&hv(e);break;case 21:break;default:ya(t,e),Ra(e)}}function Ra(e){var t=e.flags;if(t&2){try{e:{for(var a=e.return;a!==null;){if(nw(a)){var r=a;break e}a=a.return}throw Error(_(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(Zi(o,""),r.flags&=-33);var n=mv(e);$m(e,n,o);break;case 3:case 4:var s=r.stateNode.containerInfo,i=mv(e);zm(e,i,s);break;default:throw Error(_(161))}}catch(l){Ne(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function MT(e,t,a){U=e,lw(e,t,a)}function lw(e,t,a){for(var r=(e.mode&1)!==0;U!==null;){var o=U,n=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||od;if(!s){var i=o.alternate,l=i!==null&&i.memoizedState!==null||xt;i=od;var u=xt;if(od=s,(xt=l)&&!u)for(U=o;U!==null;)s=U,l=s.child,s.tag===22&&s.memoizedState!==null?xv(o):l!==null?(l.return=s,U=l):xv(o);for(;n!==null;)U=n,lw(n,t,a),n=n.sibling;U=o,od=i,xt=u}gv(e,t,a)}else(o.subtreeFlags&8772)!==0&&n!==null?(n.return=o,U=n):gv(e,t,a)}}function gv(e){for(;U!==null;){var t=U;if((t.flags&8772)!==0){var a=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:xt||Kd(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!xt)if(a===null)r.componentDidMount();else{var o=t.elementType===t.type?a.memoizedProps:xa(t.type,a.memoizedProps);r.componentDidUpdate(o,a.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var n=t.updateQueue;n!==null&&ev(t,n,r);break;case 3:var s=t.updateQueue;if(s!==null){if(a=null,t.child!==null)switch(t.child.tag){case 5:a=t.child.stateNode;break;case 1:a=t.child.stateNode}ev(t,s,a)}break;case 5:var i=t.stateNode;if(a===null&&t.flags&4){a=i;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&a.focus();break;case"img":l.src&&(a.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var c=d.dehydrated;c!==null&&rl(c)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(_(163))}xt||t.flags&512&&Hm(t)}catch(f){Ne(t,t.return,f)}}if(t===e){U=null;break}if(a=t.sibling,a!==null){a.return=t.return,U=a;break}U=t.return}}function yv(e){for(;U!==null;){var t=U;if(t===e){U=null;break}var a=t.sibling;if(a!==null){a.return=t.return,U=a;break}U=t.return}}function xv(e){for(;U!==null;){var t=U;try{switch(t.tag){case 0:case 11:case 15:var a=t.return;try{Kd(4,t)}catch(l){Ne(t,a,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(l){Ne(t,o,l)}}var n=t.return;try{Hm(t)}catch(l){Ne(t,n,l)}break;case 5:var s=t.return;try{Hm(t)}catch(l){Ne(t,s,l)}}}catch(l){Ne(t,t.return,l)}if(t===e){U=null;break}var i=t.sibling;if(i!==null){i.return=t.return,U=i;break}U=t.return}}var NT=Math.ceil,Nd=ir.ReactCurrentDispatcher,Ah=ir.ReactCurrentOwner,ia=ir.ReactCurrentBatchConfig,de=0,tt=null,Ve=null,nt=0,zt=0,Wn=Gr(0),We=0,ml=null,Fo=0,Xd=0,Rh=0,Qi=null,Rt=null,_h=0,ns=1/0,Ya=null,Od=!1,Wm=null,jr=null,nd=!1,Nr=null,Fd=0,Ji=0,Gm=null,pd=-1,md=0;function bt(){return(de&6)!==0?Fe():pd!==-1?pd:pd=Fe()}function qr(e){return(e.mode&1)===0?1:(de&2)!==0&&nt!==0?nt&-nt:xT.transition!==null?(md===0&&(md=Wv()),md):(e=me,e!==0||(e=window.event,e=e===void 0?16:Zv(e.type)),e)}function Ca(e,t,a,r){if(50<Ji)throw Ji=0,Gm=null,Error(_(185));hl(e,a,r),((de&2)===0||e!==tt)&&(e===tt&&((de&2)===0&&(Xd|=a),We===4&&Dr(e,nt)),Mt(e,r),a===1&&de===0&&(t.mode&1)===0&&(ns=Fe()+500,$d&&Kr()))}function Mt(e,t){var a=e.callbackNode;wP(e,t);var r=wd(e,e===tt?nt:0);if(r===0)a!==null&&kx(a),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(a!=null&&kx(a),t===1)e.tag===0?yT(vv.bind(null,e)):x0(vv.bind(null,e)),pT(function(){(de&6)===0&&Kr()}),a=null;else{switch(Gv(r)){case 1:a=rh;break;case 4:a=zv;break;case 16:a=vd;break;case 536870912:a=$v;break;default:a=vd}a=gw(a,uw.bind(null,e))}e.callbackPriority=t,e.callbackNode=a}}function uw(e,t){if(pd=-1,md=0,(de&6)!==0)throw Error(_(327));var a=e.callbackNode;if(Yn()&&e.callbackNode!==a)return null;var r=wd(e,e===tt?nt:0);if(r===0)return null;if((r&30)!==0||(r&e.expiredLanes)!==0||t)t=Bd(e,r);else{t=r;var o=de;de|=2;var n=cw();(tt!==e||nt!==t)&&(Ya=null,ns=Fe()+500,Eo(e,t));do try{BT();break}catch(i){dw(e,i)}while(!0);gh(),Nd.current=n,de=o,Ve!==null?t=0:(tt=null,nt=0,t=We)}if(t!==0){if(t===2&&(o=wm(e),o!==0&&(r=o,t=Km(e,o))),t===1)throw a=ml,Eo(e,0),Dr(e,r),Mt(e,Fe()),a;if(t===6)Dr(e,r);else{if(o=e.current.alternate,(r&30)===0&&!OT(o)&&(t=Bd(e,r),t===2&&(n=wm(e),n!==0&&(r=n,t=Km(e,n))),t===1))throw a=ml,Eo(e,0),Dr(e,r),Mt(e,Fe()),a;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(_(345));case 2:To(e,Rt,Ya);break;case 3:if(Dr(e,r),(r&130023424)===r&&(t=_h+500-Fe(),10<t)){if(wd(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){bt(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Tm(To.bind(null,e,Rt,Ya),t);break}To(e,Rt,Ya);break;case 4:if(Dr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-Sa(r);n=1<<s,s=t[s],s>o&&(o=s),r&=~n}if(r=o,r=Fe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*NT(r/1960))-r,10<r){e.timeoutHandle=Tm(To.bind(null,e,Rt,Ya),r);break}To(e,Rt,Ya);break;case 5:To(e,Rt,Ya);break;default:throw Error(_(329))}}}return Mt(e,Fe()),e.callbackNode===a?uw.bind(null,e):null}function Km(e,t){var a=Qi;return e.current.memoizedState.isDehydrated&&(Eo(e,t).flags|=256),e=Bd(e,t),e!==2&&(t=Rt,Rt=a,t!==null&&Xm(t)),e}function Xm(e){Rt===null?Rt=e:Rt.push.apply(Rt,e)}function OT(e){for(var t=e;;){if(t.flags&16384){var a=t.updateQueue;if(a!==null&&(a=a.stores,a!==null))for(var r=0;r<a.length;r++){var o=a[r],n=o.getSnapshot;o=o.value;try{if(!La(n(),o))return!1}catch{return!1}}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Dr(e,t){for(t&=~Rh,t&=~Xd,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var a=31-Sa(t),r=1<<a;e[a]=-1,t&=~r}}function vv(e){if((de&6)!==0)throw Error(_(327));Yn();var t=wd(e,0);if((t&1)===0)return Mt(e,Fe()),null;var a=Bd(e,t);if(e.tag!==0&&a===2){var r=wm(e);r!==0&&(t=r,a=Km(e,r))}if(a===1)throw a=ml,Eo(e,0),Dr(e,t),Mt(e,Fe()),a;if(a===6)throw Error(_(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,To(e,Rt,Ya),Mt(e,Fe()),null}function Eh(e,t){var a=de;de|=1;try{return e(t)}finally{de=a,de===0&&(ns=Fe()+500,$d&&Kr())}}function Bo(e){Nr!==null&&Nr.tag===0&&(de&6)===0&&Yn();var t=de;de|=1;var a=ia.transition,r=me;try{if(ia.transition=null,me=1,e)return e()}finally{me=r,ia.transition=a,de=t,(de&6)===0&&Kr()}}function Dh(){zt=Wn.current,be(Wn)}function Eo(e,t){e.finishedWork=null,e.finishedLanes=0;var a=e.timeoutHandle;if(a!==-1&&(e.timeoutHandle=-1,fT(a)),Ve!==null)for(a=Ve.return;a!==null;){var r=a;switch(ph(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&bd();break;case 3:rs(),be(Et),be(vt),Ch();break;case 5:Sh(r);break;case 4:rs();break;case 13:be(Re);break;case 19:be(Re);break;case 10:yh(r.type._context);break;case 22:case 23:Dh()}a=a.return}if(tt=e,Ve=e=Hr(e.current,null),nt=zt=t,We=0,ml=null,Rh=Xd=Fo=0,Rt=Qi=null,Ro!==null){for(t=0;t<Ro.length;t++)if(a=Ro[t],r=a.interleaved,r!==null){a.interleaved=null;var o=r.next,n=a.pending;if(n!==null){var s=n.next;n.next=o,r.next=s}a.pending=r}Ro=null}return e}function dw(e,t){do{var a=Ve;try{if(gh(),dd.current=Md,Dd){for(var r=_e.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Dd=!1}if(Oo=0,et=$e=_e=null,Ki=!1,cl=0,Ah.current=null,a===null||a.return===null){We=1,ml=t,Ve=null;break}e:{var n=e,s=a.return,i=a,l=t;if(t=nt,i.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,d=i,c=d.tag;if((d.mode&1)===0&&(c===0||c===11||c===15)){var f=d.alternate;f?(d.updateQueue=f.updateQueue,d.memoizedState=f.memoizedState,d.lanes=f.lanes):(d.updateQueue=null,d.memoizedState=null)}var g=sv(s);if(g!==null){g.flags&=-257,iv(g,s,i,n,t),g.mode&1&&nv(n,u,t),t=g,l=u;var x=t.updateQueue;if(x===null){var w=new Set;w.add(l),t.updateQueue=w}else x.add(l);break e}else{if((t&1)===0){nv(n,u,t),Mh();break e}l=Error(_(426))}}else if(Ae&&i.mode&1){var L=sv(s);if(L!==null){(L.flags&65536)===0&&(L.flags|=256),iv(L,s,i,n,t),mh(os(l,i));break e}}n=l=os(l,i),We!==4&&(We=2),Qi===null?Qi=[n]:Qi.push(n),n=s;do{switch(n.tag){case 3:n.flags|=65536,t&=-t,n.lanes|=t;var y=G0(n,l,t);Zx(n,y);break e;case 1:i=l;var h=n.type,m=n.stateNode;if((n.flags&128)===0&&(typeof h.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(jr===null||!jr.has(m)))){n.flags|=65536,t&=-t,n.lanes|=t;var C=K0(n,i,t);Zx(n,C);break e}}n=n.return}while(n!==null)}pw(a)}catch(I){t=I,Ve===a&&a!==null&&(Ve=a=a.return);continue}break}while(!0)}function cw(){var e=Nd.current;return Nd.current=Md,e===null?Md:e}function Mh(){(We===0||We===3||We===2)&&(We=4),tt===null||(Fo&268435455)===0&&(Xd&268435455)===0||Dr(tt,nt)}function Bd(e,t){var a=de;de|=2;var r=cw();(tt!==e||nt!==t)&&(Ya=null,Eo(e,t));do try{FT();break}catch(o){dw(e,o)}while(!0);if(gh(),de=a,Nd.current=r,Ve!==null)throw Error(_(261));return tt=null,nt=0,We}function FT(){for(;Ve!==null;)fw(Ve)}function BT(){for(;Ve!==null&&!cP();)fw(Ve)}function fw(e){var t=hw(e.alternate,e,zt);e.memoizedProps=e.pendingProps,t===null?pw(e):Ve=t,Ah.current=null}function pw(e){var t=e;do{var a=t.alternate;if(e=t.return,(t.flags&32768)===0){if(a=RT(a,t,zt),a!==null){Ve=a;return}}else{if(a=_T(a,t),a!==null){a.flags&=32767,Ve=a;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{We=6,Ve=null;return}}if(t=t.sibling,t!==null){Ve=t;return}Ve=t=e}while(t!==null);We===0&&(We=5)}function To(e,t,a){var r=me,o=ia.transition;try{ia.transition=null,me=1,UT(e,t,a,r)}finally{ia.transition=o,me=r}return null}function UT(e,t,a,r){do Yn();while(Nr!==null);if((de&6)!==0)throw Error(_(327));a=e.finishedWork;var o=e.finishedLanes;if(a===null)return null;if(e.finishedWork=null,e.finishedLanes=0,a===e.current)throw Error(_(177));e.callbackNode=null,e.callbackPriority=0;var n=a.lanes|a.childLanes;if(SP(e,n),e===tt&&(Ve=tt=null,nt=0),(a.subtreeFlags&2064)===0&&(a.flags&2064)===0||nd||(nd=!0,gw(vd,function(){return Yn(),null})),n=(a.flags&15990)!==0,(a.subtreeFlags&15990)!==0||n){n=ia.transition,ia.transition=null;var s=me;me=1;var i=de;de|=4,Ah.current=null,DT(e,a),iw(a,e),iT(km),Sd=!!bm,km=bm=null,e.current=a,MT(a,e,o),fP(),de=i,me=s,ia.transition=n}else e.current=a;if(nd&&(nd=!1,Nr=e,Fd=o),n=e.pendingLanes,n===0&&(jr=null),hP(a.stateNode,r),Mt(e,Fe()),t!==null)for(r=e.onRecoverableError,a=0;a<t.length;a++)o=t[a],r(o.value,{componentStack:o.stack,digest:o.digest});if(Od)throw Od=!1,e=Wm,Wm=null,e;return(Fd&1)!==0&&e.tag!==0&&Yn(),n=e.pendingLanes,(n&1)!==0?e===Gm?Ji++:(Ji=0,Gm=e):Ji=0,Kr(),null}function Yn(){if(Nr!==null){var e=Gv(Fd),t=ia.transition,a=me;try{if(ia.transition=null,me=16>e?16:e,Nr===null)var r=!1;else{if(e=Nr,Nr=null,Fd=0,(de&6)!==0)throw Error(_(331));var o=de;for(de|=4,U=e.current;U!==null;){var n=U,s=n.child;if((U.flags&16)!==0){var i=n.deletions;if(i!==null){for(var l=0;l<i.length;l++){var u=i[l];for(U=u;U!==null;){var d=U;switch(d.tag){case 0:case 11:case 15:Xi(8,d,n)}var c=d.child;if(c!==null)c.return=d,U=c;else for(;U!==null;){d=U;var f=d.sibling,g=d.return;if(ow(d),d===u){U=null;break}if(f!==null){f.return=g,U=f;break}U=g}}}var x=n.alternate;if(x!==null){var w=x.child;if(w!==null){x.child=null;do{var L=w.sibling;w.sibling=null,w=L}while(w!==null)}}U=n}}if((n.subtreeFlags&2064)!==0&&s!==null)s.return=n,U=s;else e:for(;U!==null;){if(n=U,(n.flags&2048)!==0)switch(n.tag){case 0:case 11:case 15:Xi(9,n,n.return)}var y=n.sibling;if(y!==null){y.return=n.return,U=y;break e}U=n.return}}var h=e.current;for(U=h;U!==null;){s=U;var m=s.child;if((s.subtreeFlags&2064)!==0&&m!==null)m.return=s,U=m;else e:for(s=h;U!==null;){if(i=U,(i.flags&2048)!==0)try{switch(i.tag){case 0:case 11:case 15:Kd(9,i)}}catch(I){Ne(i,i.return,I)}if(i===s){U=null;break e}var C=i.sibling;if(C!==null){C.return=i.return,U=C;break e}U=i.return}}if(de=o,Kr(),Da&&typeof Da.onPostCommitFiberRoot=="function")try{Da.onPostCommitFiberRoot(Vd,e)}catch{}r=!0}return r}finally{me=a,ia.transition=t}}return!1}function wv(e,t,a){t=os(a,t),t=G0(e,t,1),e=Vr(e,t,1),t=bt(),e!==null&&(hl(e,1,t),Mt(e,t))}function Ne(e,t,a){if(e.tag===3)wv(e,e,a);else for(;t!==null;){if(t.tag===3){wv(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(jr===null||!jr.has(r))){e=os(a,e),e=K0(t,e,1),t=Vr(t,e,1),e=bt(),t!==null&&(hl(t,1,e),Mt(t,e));break}}t=t.return}}function VT(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),t=bt(),e.pingedLanes|=e.suspendedLanes&a,tt===e&&(nt&a)===a&&(We===4||We===3&&(nt&130023424)===nt&&500>Fe()-_h?Eo(e,0):Rh|=a),Mt(e,t)}function mw(e,t){t===0&&((e.mode&1)===0?t=1:(t=$u,$u<<=1,($u&130023424)===0&&($u=4194304)));var a=bt();e=nr(e,t),e!==null&&(hl(e,t,a),Mt(e,a))}function jT(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),mw(e,a)}function qT(e,t){var a=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(a=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(_(314))}r!==null&&r.delete(t),mw(e,a)}var hw;hw=function(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps||Et.current)_t=!0;else{if((e.lanes&a)===0&&(t.flags&128)===0)return _t=!1,AT(e,t,a);_t=(e.flags&131072)!==0}else _t=!1,Ae&&(t.flags&1048576)!==0&&v0(t,Td,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;fd(e,t),e=t.pendingProps;var o=es(t,vt.current);Jn(t,a),o=Ih(null,t,r,e,o,a);var n=bh();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Dt(r)?(n=!0,kd(t)):n=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,vh(t),o.updater=Gd,t.stateNode=o,o._reactInternals=t,Nm(t,r,e,a),t=Bm(null,t,r,!0,n,a)):(t.tag=0,Ae&&n&&fh(t),It(null,t,o,a),t=t.child),t;case 16:r=t.elementType;e:{switch(fd(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=zT(r),e=xa(r,e),o){case 0:t=Fm(null,t,r,e,a);break e;case 1:t=dv(null,t,r,e,a);break e;case 11:t=lv(null,t,r,e,a);break e;case 14:t=uv(null,t,r,xa(r.type,e),a);break e}throw Error(_(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:xa(r,o),Fm(e,t,r,o,a);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:xa(r,o),dv(e,t,r,o,a);case 3:e:{if(Y0(t),e===null)throw Error(_(387));r=t.pendingProps,n=t.memoizedState,o=n.element,b0(e,t),_d(t,r,null,a);var s=t.memoizedState;if(r=s.element,n.isDehydrated)if(n={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=n,t.memoizedState=n,t.flags&256){o=os(Error(_(423)),t),t=cv(e,t,r,a,o);break e}else if(r!==o){o=os(Error(_(424)),t),t=cv(e,t,r,a,o);break e}else for($t=Ur(t.stateNode.containerInfo.firstChild),Wt=t,Ae=!0,wa=null,a=L0(t,null,r,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(ts(),r===o){t=sr(e,t,a);break e}It(e,t,r,a)}t=t.child}return t;case 5:return k0(t),e===null&&Em(t),r=t.type,o=t.pendingProps,n=e!==null?e.memoizedProps:null,s=o.children,Pm(r,o)?s=null:n!==null&&Pm(r,n)&&(t.flags|=32),J0(e,t),It(e,t,s,a),t.child;case 6:return e===null&&Em(t),null;case 13:return Z0(e,t,a);case 4:return wh(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=as(t,null,r,a):It(e,t,r,a),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:xa(r,o),lv(e,t,r,o,a);case 7:return It(e,t,t.pendingProps,a),t.child;case 8:return It(e,t,t.pendingProps.children,a),t.child;case 12:return It(e,t,t.pendingProps.children,a),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,n=t.memoizedProps,s=o.value,we(Ad,r._currentValue),r._currentValue=s,n!==null)if(La(n.value,s)){if(n.children===o.children&&!Et.current){t=sr(e,t,a);break e}}else for(n=t.child,n!==null&&(n.return=t);n!==null;){var i=n.dependencies;if(i!==null){s=n.child;for(var l=i.firstContext;l!==null;){if(l.context===r){if(n.tag===1){l=ar(-1,a&-a),l.tag=2;var u=n.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}n.lanes|=a,l=n.alternate,l!==null&&(l.lanes|=a),Dm(n.return,a,t),i.lanes|=a;break}l=l.next}}else if(n.tag===10)s=n.type===t.type?null:n.child;else if(n.tag===18){if(s=n.return,s===null)throw Error(_(341));s.lanes|=a,i=s.alternate,i!==null&&(i.lanes|=a),Dm(s,a,t),s=n.sibling}else s=n.child;if(s!==null)s.return=n;else for(s=n;s!==null;){if(s===t){s=null;break}if(n=s.sibling,n!==null){n.return=s.return,s=n;break}s=s.return}n=s}It(e,t,o.children,a),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Jn(t,a),o=la(o),r=r(o),t.flags|=1,It(e,t,r,a),t.child;case 14:return r=t.type,o=xa(r,t.pendingProps),o=xa(r.type,o),uv(e,t,r,o,a);case 15:return X0(e,t,t.type,t.pendingProps,a);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:xa(r,o),fd(e,t),t.tag=1,Dt(r)?(e=!0,kd(t)):e=!1,Jn(t,a),W0(t,r,o),Nm(t,r,o,a),Bm(null,t,r,!0,e,a);case 19:return ew(e,t,a);case 22:return Q0(e,t,a)}throw Error(_(156,t.tag))};function gw(e,t){return Hv(e,t)}function HT(e,t,a,r){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function sa(e,t,a,r){return new HT(e,t,a,r)}function Nh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function zT(e){if(typeof e=="function")return Nh(e)?1:0;if(e!=null){if(e=e.$$typeof,e===eh)return 11;if(e===th)return 14}return 2}function Hr(e,t){var a=e.alternate;return a===null?(a=sa(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&14680064,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a}function hd(e,t,a,r,o,n){var s=2;if(r=e,typeof e=="function")Nh(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case On:return Do(a.children,o,n,t);case Zm:s=8,o|=8;break;case nm:return e=sa(12,a,t,o|2),e.elementType=nm,e.lanes=n,e;case sm:return e=sa(13,a,t,o),e.elementType=sm,e.lanes=n,e;case im:return e=sa(19,a,t,o),e.elementType=im,e.lanes=n,e;case kv:return Qd(a,o,n,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Iv:s=10;break e;case bv:s=9;break e;case eh:s=11;break e;case th:s=14;break e;case Rr:s=16,r=null;break e}throw Error(_(130,e==null?e:typeof e,""))}return t=sa(s,a,t,o),t.elementType=e,t.type=r,t.lanes=n,t}function Do(e,t,a,r){return e=sa(7,e,r,t),e.lanes=a,e}function Qd(e,t,a,r){return e=sa(22,e,r,t),e.elementType=kv,e.lanes=a,e.stateNode={isHidden:!1},e}function am(e,t,a){return e=sa(6,e,null,t),e.lanes=a,e}function rm(e,t,a){return t=sa(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function $T(e,t,a,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Vp(0),this.expirationTimes=Vp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vp(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Oh(e,t,a,r,o,n,s,i,l){return e=new $T(e,t,a,i,l),t===1?(t=1,n===!0&&(t|=8)):t=0,n=sa(3,null,null,t),e.current=n,n.stateNode=e,n.memoizedState={element:r,isDehydrated:a,cache:null,transitions:null,pendingSuspenseBoundaries:null},vh(n),e}function WT(e,t,a){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Nn,key:r==null?null:""+r,children:e,containerInfo:t,implementation:a}}function yw(e){if(!e)return $r;e=e._reactInternals;e:{if(Vo(e)!==e||e.tag!==1)throw Error(_(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Dt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(_(171))}if(e.tag===1){var a=e.type;if(Dt(a))return y0(e,a,t)}return t}function xw(e,t,a,r,o,n,s,i,l){return e=Oh(a,r,!0,e,o,n,s,i,l),e.context=yw(null),a=e.current,r=bt(),o=qr(a),n=ar(r,o),n.callback=t??null,Vr(a,n,o),e.current.lanes=o,hl(e,o,r),Mt(e,r),e}function Jd(e,t,a,r){var o=t.current,n=bt(),s=qr(o);return a=yw(a),t.context===null?t.context=a:t.pendingContext=a,t=ar(n,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Vr(o,t,s),e!==null&&(Ca(e,o,s,n),ud(e,o,s)),s}function Ud(e){return e=e.current,e.child?(e.child.tag===5,e.child.stateNode):null}function Sv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Fh(e,t){Sv(e,t),(e=e.alternate)&&Sv(e,t)}function GT(){return null}var vw=typeof reportError=="function"?reportError:function(e){console.error(e)};function Bh(e){this._internalRoot=e}Yd.prototype.render=Bh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(_(409));Jd(e,t,null,null)};Yd.prototype.unmount=Bh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Bo(function(){Jd(null,e,null,null)}),t[or]=null}};function Yd(e){this._internalRoot=e}Yd.prototype.unstable_scheduleHydration=function(e){if(e){var t=Qv();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Er.length&&t!==0&&t<Er[a].priority;a++);Er.splice(a,0,e),a===0&&Yv(e)}};function Uh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Zd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Cv(){}function KT(e,t,a,r,o){if(o){if(typeof r=="function"){var n=r;r=function(){var u=Ud(s);n.call(u)}}var s=xw(t,r,e,0,null,!1,!1,"",Cv);return e._reactRootContainer=s,e[or]=s.current,sl(e.nodeType===8?e.parentNode:e),Bo(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var i=r;r=function(){var u=Ud(l);i.call(u)}}var l=Oh(e,0,!1,null,null,!1,!1,"",Cv);return e._reactRootContainer=l,e[or]=l.current,sl(e.nodeType===8?e.parentNode:e),Bo(function(){Jd(t,l,a,r)}),l}function ec(e,t,a,r,o){var n=a._reactRootContainer;if(n){var s=n;if(typeof o=="function"){var i=o;o=function(){var l=Ud(s);i.call(l)}}Jd(t,s,e,o)}else s=KT(a,t,e,o,r);return Ud(s)}Kv=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var a=ji(t.pendingLanes);a!==0&&(oh(t,a|1),Mt(t,Fe()),(de&6)===0&&(ns=Fe()+500,Kr()))}break;case 13:Bo(function(){var r=nr(e,1);if(r!==null){var o=bt();Ca(r,e,1,o)}}),Fh(e,1)}};nh=function(e){if(e.tag===13){var t=nr(e,134217728);if(t!==null){var a=bt();Ca(t,e,134217728,a)}Fh(e,134217728)}};Xv=function(e){if(e.tag===13){var t=qr(e),a=nr(e,t);if(a!==null){var r=bt();Ca(a,e,t,r)}Fh(e,t)}};Qv=function(){return me};Jv=function(e,t){var a=me;try{return me=e,t()}finally{me=a}};ym=function(e,t,a){switch(t){case"input":if(dm(e,a),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<a.length;t++){var r=a[t];if(r!==e&&r.form===e.form){var o=zd(r);if(!o)throw Error(_(90));Tv(r),dm(r,o)}}}break;case"textarea":Rv(e,a);break;case"select":t=a.value,t!=null&&Gn(e,!!a.multiple,t,!1)}};Fv=Eh;Bv=Bo;var XT={usingClientEntryPoint:!1,Events:[yl,Vn,zd,Nv,Ov,Eh]},Fi={findFiberByHostInstance:Ao,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},QT={bundleType:Fi.bundleType,version:Fi.version,rendererPackageName:Fi.rendererPackageName,rendererConfig:Fi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ir.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=jv(e),e===null?null:e.stateNode},findFiberByHostInstance:Fi.findFiberByHostInstance||GT,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Bi=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Bi.isDisabled&&Bi.supportsFiber))try{Vd=Bi.inject(QT),Da=Bi}catch{}var Bi;Xt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=XT;Xt.createPortal=function(e,t){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Uh(t))throw Error(_(200));return WT(e,t,null,a)};Xt.createRoot=function(e,t){if(!Uh(e))throw Error(_(299));var a=!1,r="",o=vw;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Oh(e,1,!1,null,null,a,!1,r,o),e[or]=t.current,sl(e.nodeType===8?e.parentNode:e),new Bh(t)};Xt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(_(188)):(e=Object.keys(e).join(","),Error(_(268,e)));return e=jv(t),e=e===null?null:e.stateNode,e};Xt.flushSync=function(e){return Bo(e)};Xt.hydrate=function(e,t,a){if(!Zd(t))throw Error(_(200));return ec(null,e,t,!0,a)};Xt.hydrateRoot=function(e,t,a){if(!Uh(e))throw Error(_(405));var r=a!=null&&a.hydratedSources||null,o=!1,n="",s=vw;if(a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(n=a.identifierPrefix),a.onRecoverableError!==void 0&&(s=a.onRecoverableError)),t=xw(t,null,e,1,a??null,o,!1,n,s),e[or]=t.current,sl(e),r)for(e=0;e<r.length;e++)a=r[e],o=a._getVersion,o=o(a._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[a,o]:t.mutableSourceEagerHydrationData.push(a,o);return new Yd(t)};Xt.render=function(e,t,a){if(!Zd(t))throw Error(_(200));return ec(null,e,t,!1,a)};Xt.unmountComponentAtNode=function(e){if(!Zd(e))throw Error(_(40));return e._reactRootContainer?(Bo(function(){ec(null,null,e,!1,function(){e._reactRootContainer=null,e[or]=null})}),!0):!1};Xt.unstable_batchedUpdates=Eh;Xt.unstable_renderSubtreeIntoContainer=function(e,t,a,r){if(!Zd(a))throw Error(_(200));if(e==null||e._reactInternals===void 0)throw Error(_(38));return ec(e,t,a,!1,r)};Xt.version="18.3.1-next-f1338f8080-20240426"});var Vh=Ze((BD,Cw)=>{"use strict";function Sw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Sw)}catch(e){console.error(e)}}Sw(),Cw.exports=ww()});var Iw=Ze(jh=>{"use strict";var Lw=Vh();jh.createRoot=Lw.createRoot,jh.hydrateRoot=Lw.hydrateRoot;var UD});var jo={};Hy(jo,{Headers:()=>Hh,Request:()=>ZT,Response:()=>e1,default:()=>qh,fetch:()=>YT});var JT,ls,YT,qh,Hh,ZT,e1,Xr=Dk(()=>{"use strict";JT=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")},ls=JT(),YT=ls.fetch,qh=ls.fetch.bind(ls),Hh=ls.Headers,ZT=ls.Request,e1=ls.Response});var Wh=Ze($h=>{"use strict";Object.defineProperty($h,"__esModule",{value:!0});var zh=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.code=t.code}};$h.default=zh});var Kh=Ze(Ll=>{"use strict";var kw=Ll&&Ll.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ll,"__esModule",{value:!0});var a1=kw((Xr(),$y(jo))),r1=kw(Wh()),Gh=class{constructor(t){this.shouldThrowOnError=!1,this.method=t.method,this.url=t.url,this.headers=t.headers,this.schema=t.schema,this.body=t.body,this.shouldThrowOnError=t.shouldThrowOnError,this.signal=t.signal,this.isMaybeSingle=t.isMaybeSingle,t.fetch?this.fetch=t.fetch:typeof fetch>"u"?this.fetch=a1.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,a){return this.headers=Object.assign({},this.headers),this.headers[t]=a,this}then(t,a){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),this.method!=="GET"&&this.method!=="HEAD"&&(this.headers["Content-Type"]="application/json");let r=this.fetch,o=r(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async n=>{var s,i,l;let u=null,d=null,c=null,f=n.status,g=n.statusText;if(n.ok){if(this.method!=="HEAD"){let y=await n.text();y===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?d=y:d=JSON.parse(y))}let w=(s=this.headers.Prefer)===null||s===void 0?void 0:s.match(/count=(exact|planned|estimated)/),L=(i=n.headers.get("content-range"))===null||i===void 0?void 0:i.split("/");w&&L&&L.length>1&&(c=parseInt(L[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(d)&&(d.length>1?(u={code:"PGRST116",details:`Results contain ${d.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},d=null,c=null,f=406,g="Not Acceptable"):d.length===1?d=d[0]:d=null)}else{let w=await n.text();try{u=JSON.parse(w),Array.isArray(u)&&n.status===404&&(d=[],u=null,f=200,g="OK")}catch{n.status===404&&w===""?(f=204,g="No Content"):u={message:w}}if(u&&this.isMaybeSingle&&(!((l=u?.details)===null||l===void 0)&&l.includes("0 rows"))&&(u=null,f=200,g="OK"),u&&this.shouldThrowOnError)throw new r1.default(u)}return{error:u,data:d,count:c,status:f,statusText:g}});return this.shouldThrowOnError||(o=o.catch(n=>{var s,i,l;return{error:{message:`${(s=n?.name)!==null&&s!==void 0?s:"FetchError"}: ${n?.message}`,details:`${(i=n?.stack)!==null&&i!==void 0?i:""}`,hint:"",code:`${(l=n?.code)!==null&&l!==void 0?l:""}`},data:null,count:null,status:0,statusText:""}})),o.then(t,a)}returns(){return this}overrideTypes(){return this}};Ll.default=Gh});var Qh=Ze(Il=>{"use strict";var o1=Il&&Il.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Il,"__esModule",{value:!0});var n1=o1(Kh()),Xh=class extends n1.default{select(t){let a=!1,r=(t??"*").split("").map(o=>/\s/.test(o)&&!a?"":(o==='"'&&(a=!a),o)).join("");return this.url.searchParams.set("select",r),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(t,{ascending:a=!0,nullsFirst:r,foreignTable:o,referencedTable:n=o}={}){let s=n?`${n}.order`:"order",i=this.url.searchParams.get(s);return this.url.searchParams.set(s,`${i?`${i},`:""}${t}.${a?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(t,{foreignTable:a,referencedTable:r=a}={}){let o=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(o,`${t}`),this}range(t,a,{foreignTable:r,referencedTable:o=r}={}){let n=typeof o>"u"?"offset":`${o}.offset`,s=typeof o>"u"?"limit":`${o}.limit`;return this.url.searchParams.set(n,`${t}`),this.url.searchParams.set(s,`${a-t+1}`),this}abortSignal(t){return this.signal=t,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return this.method==="GET"?this.headers.Accept="application/json":this.headers.Accept="application/vnd.pgrst.object+json",this.isMaybeSingle=!0,this}csv(){return this.headers.Accept="text/csv",this}geojson(){return this.headers.Accept="application/geo+json",this}explain({analyze:t=!1,verbose:a=!1,settings:r=!1,buffers:o=!1,wal:n=!1,format:s="text"}={}){var i;let l=[t?"analyze":null,a?"verbose":null,r?"settings":null,o?"buffers":null,n?"wal":null].filter(Boolean).join("|"),u=(i=this.headers.Accept)!==null&&i!==void 0?i:"application/json";return this.headers.Accept=`application/vnd.pgrst.plan+${s}; for="${u}"; options=${l};`,s==="json"?this:this}rollback(){var t;return((t=this.headers.Prefer)!==null&&t!==void 0?t:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}};Il.default=Xh});var rc=Ze(bl=>{"use strict";var s1=bl&&bl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(bl,"__esModule",{value:!0});var i1=s1(Qh()),Jh=class extends i1.default{eq(t,a){return this.url.searchParams.append(t,`eq.${a}`),this}neq(t,a){return this.url.searchParams.append(t,`neq.${a}`),this}gt(t,a){return this.url.searchParams.append(t,`gt.${a}`),this}gte(t,a){return this.url.searchParams.append(t,`gte.${a}`),this}lt(t,a){return this.url.searchParams.append(t,`lt.${a}`),this}lte(t,a){return this.url.searchParams.append(t,`lte.${a}`),this}like(t,a){return this.url.searchParams.append(t,`like.${a}`),this}likeAllOf(t,a){return this.url.searchParams.append(t,`like(all).{${a.join(",")}}`),this}likeAnyOf(t,a){return this.url.searchParams.append(t,`like(any).{${a.join(",")}}`),this}ilike(t,a){return this.url.searchParams.append(t,`ilike.${a}`),this}ilikeAllOf(t,a){return this.url.searchParams.append(t,`ilike(all).{${a.join(",")}}`),this}ilikeAnyOf(t,a){return this.url.searchParams.append(t,`ilike(any).{${a.join(",")}}`),this}is(t,a){return this.url.searchParams.append(t,`is.${a}`),this}in(t,a){let r=Array.from(new Set(a)).map(o=>typeof o=="string"&&new RegExp("[,()]").test(o)?`"${o}"`:`${o}`).join(",");return this.url.searchParams.append(t,`in.(${r})`),this}contains(t,a){return typeof a=="string"?this.url.searchParams.append(t,`cs.${a}`):Array.isArray(a)?this.url.searchParams.append(t,`cs.{${a.join(",")}}`):this.url.searchParams.append(t,`cs.${JSON.stringify(a)}`),this}containedBy(t,a){return typeof a=="string"?this.url.searchParams.append(t,`cd.${a}`):Array.isArray(a)?this.url.searchParams.append(t,`cd.{${a.join(",")}}`):this.url.searchParams.append(t,`cd.${JSON.stringify(a)}`),this}rangeGt(t,a){return this.url.searchParams.append(t,`sr.${a}`),this}rangeGte(t,a){return this.url.searchParams.append(t,`nxl.${a}`),this}rangeLt(t,a){return this.url.searchParams.append(t,`sl.${a}`),this}rangeLte(t,a){return this.url.searchParams.append(t,`nxr.${a}`),this}rangeAdjacent(t,a){return this.url.searchParams.append(t,`adj.${a}`),this}overlaps(t,a){return typeof a=="string"?this.url.searchParams.append(t,`ov.${a}`):this.url.searchParams.append(t,`ov.{${a.join(",")}}`),this}textSearch(t,a,{config:r,type:o}={}){let n="";o==="plain"?n="pl":o==="phrase"?n="ph":o==="websearch"&&(n="w");let s=r===void 0?"":`(${r})`;return this.url.searchParams.append(t,`${n}fts${s}.${a}`),this}match(t){return Object.entries(t).forEach(([a,r])=>{this.url.searchParams.append(a,`eq.${r}`)}),this}not(t,a,r){return this.url.searchParams.append(t,`not.${a}.${r}`),this}or(t,{foreignTable:a,referencedTable:r=a}={}){let o=r?`${r}.or`:"or";return this.url.searchParams.append(o,`(${t})`),this}filter(t,a,r){return this.url.searchParams.append(t,`${a}.${r}`),this}};bl.default=Jh});var Zh=Ze(Pl=>{"use strict";var l1=Pl&&Pl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Pl,"__esModule",{value:!0});var kl=l1(rc()),Yh=class{constructor(t,{headers:a={},schema:r,fetch:o}){this.url=t,this.headers=a,this.schema=r,this.fetch=o}select(t,{head:a=!1,count:r}={}){let o=a?"HEAD":"GET",n=!1,s=(t??"*").split("").map(i=>/\s/.test(i)&&!n?"":(i==='"'&&(n=!n),i)).join("");return this.url.searchParams.set("select",s),r&&(this.headers.Prefer=`count=${r}`),new kl.default({method:o,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}insert(t,{count:a,defaultToNull:r=!0}={}){let o="POST",n=[];if(this.headers.Prefer&&n.push(this.headers.Prefer),a&&n.push(`count=${a}`),r||n.push("missing=default"),this.headers.Prefer=n.join(","),Array.isArray(t)){let s=t.reduce((i,l)=>i.concat(Object.keys(l)),[]);if(s.length>0){let i=[...new Set(s)].map(l=>`"${l}"`);this.url.searchParams.set("columns",i.join(","))}}return new kl.default({method:o,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:this.fetch,allowEmpty:!1})}upsert(t,{onConflict:a,ignoreDuplicates:r=!1,count:o,defaultToNull:n=!0}={}){let s="POST",i=[`resolution=${r?"ignore":"merge"}-duplicates`];if(a!==void 0&&this.url.searchParams.set("on_conflict",a),this.headers.Prefer&&i.push(this.headers.Prefer),o&&i.push(`count=${o}`),n||i.push("missing=default"),this.headers.Prefer=i.join(","),Array.isArray(t)){let l=t.reduce((u,d)=>u.concat(Object.keys(d)),[]);if(l.length>0){let u=[...new Set(l)].map(d=>`"${d}"`);this.url.searchParams.set("columns",u.join(","))}}return new kl.default({method:s,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:this.fetch,allowEmpty:!1})}update(t,{count:a}={}){let r="PATCH",o=[];return this.headers.Prefer&&o.push(this.headers.Prefer),a&&o.push(`count=${a}`),this.headers.Prefer=o.join(","),new kl.default({method:r,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:this.fetch,allowEmpty:!1})}delete({count:t}={}){let a="DELETE",r=[];return t&&r.push(`count=${t}`),this.headers.Prefer&&r.unshift(this.headers.Prefer),this.headers.Prefer=r.join(","),new kl.default({method:a,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}};Pl.default=Yh});var Pw=Ze(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});oc.version=void 0;oc.version="0.0.0-automated"});var Tw=Ze(nc=>{"use strict";Object.defineProperty(nc,"__esModule",{value:!0});nc.DEFAULT_HEADERS=void 0;var u1=Pw();nc.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${u1.version}`}});var Rw=Ze(Tl=>{"use strict";var Aw=Tl&&Tl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Tl,"__esModule",{value:!0});var d1=Aw(Zh()),c1=Aw(rc()),f1=Tw(),eg=class e{constructor(t,{headers:a={},schema:r,fetch:o}={}){this.url=t,this.headers=Object.assign(Object.assign({},f1.DEFAULT_HEADERS),a),this.schemaName=r,this.fetch=o}from(t){let a=new URL(`${this.url}/${t}`);return new d1.default(a,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(t){return new e(this.url,{headers:this.headers,schema:t,fetch:this.fetch})}rpc(t,a={},{head:r=!1,get:o=!1,count:n}={}){let s,i=new URL(`${this.url}/rpc/${t}`),l;r||o?(s=r?"HEAD":"GET",Object.entries(a).filter(([d,c])=>c!==void 0).map(([d,c])=>[d,Array.isArray(c)?`{${c.join(",")}}`:`${c}`]).forEach(([d,c])=>{i.searchParams.append(d,c)})):(s="POST",l=a);let u=Object.assign({},this.headers);return n&&(u.Prefer=`count=${n}`),new c1.default({method:s,url:i,headers:u,schema:this.schemaName,body:l,fetch:this.fetch,allowEmpty:!1})}};Tl.default=eg});var Fw=Ze(it=>{"use strict";var us=it&&it.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(it,"__esModule",{value:!0});it.PostgrestError=it.PostgrestBuilder=it.PostgrestTransformBuilder=it.PostgrestFilterBuilder=it.PostgrestQueryBuilder=it.PostgrestClient=void 0;var _w=us(Rw());it.PostgrestClient=_w.default;var Ew=us(Zh());it.PostgrestQueryBuilder=Ew.default;var Dw=us(rc());it.PostgrestFilterBuilder=Dw.default;var Mw=us(Qh());it.PostgrestTransformBuilder=Mw.default;var Nw=us(Kh());it.PostgrestBuilder=Nw.default;var Ow=us(Wh());it.PostgrestError=Ow.default;it.default={PostgrestClient:_w.default,PostgrestQueryBuilder:Ew.default,PostgrestFilterBuilder:Dw.default,PostgrestTransformBuilder:Mw.default,PostgrestBuilder:Nw.default,PostgrestError:Ow.default}});var GS=Ze(Pc=>{"use strict";var TA=G(),AA=Symbol.for("react.element"),RA=Symbol.for("react.fragment"),_A=Object.prototype.hasOwnProperty,EA=TA.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,DA={key:!0,ref:!0,__self:!0,__source:!0};function WS(e,t,a){var r,o={},n=null,s=null;a!==void 0&&(n=""+a),t.key!==void 0&&(n=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)_A.call(t,r)&&!DA.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:AA,type:e,key:n,ref:s,props:o,_owner:EA.current}}Pc.Fragment=RA;Pc.jsx=WS;Pc.jsxs=WS});var le=Ze((RN,KS)=>{"use strict";KS.exports=GS()});var AD={};Hy(AD,{initKiteChat:()=>Ty});var Ka=M(G(),1),fk=M(Iw(),1);var F=M(G(),1);var bw=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...a)=>Promise.resolve().then(()=>(Xr(),jo)).then(({default:r})=>r(...a)):t=fetch,(...a)=>t(...a)};var vl=class extends Error{constructor(t,a="FunctionsError",r){super(t),this.name=a,this.context=r}},tc=class extends vl{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}},wl=class extends vl{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}},Sl=class extends vl{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}},ac;(function(e){e.Any="any",e.ApNortheast1="ap-northeast-1",e.ApNortheast2="ap-northeast-2",e.ApSouth1="ap-south-1",e.ApSoutheast1="ap-southeast-1",e.ApSoutheast2="ap-southeast-2",e.CaCentral1="ca-central-1",e.EuCentral1="eu-central-1",e.EuWest1="eu-west-1",e.EuWest2="eu-west-2",e.EuWest3="eu-west-3",e.SaEast1="sa-east-1",e.UsEast1="us-east-1",e.UsWest1="us-west-1",e.UsWest2="us-west-2"})(ac||(ac={}));var t1=function(e,t,a,r){function o(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function i(d){try{u(r.next(d))}catch(c){s(c)}}function l(d){try{u(r.throw(d))}catch(c){s(c)}}function u(d){d.done?n(d.value):o(d.value).then(i,l)}u((r=r.apply(e,t||[])).next())})},Cl=class{constructor(t,{headers:a={},customFetch:r,region:o=ac.Any}={}){this.url=t,this.headers=a,this.region=o,this.fetch=bw(r)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t,a={}){var r;return t1(this,void 0,void 0,function*(){try{let{headers:o,method:n,body:s}=a,i={},{region:l}=a;l||(l=this.region);let u=new URL(`${this.url}/${t}`);l&&l!=="any"&&(i["x-region"]=l,u.searchParams.set("forceFunctionRegion",l));let d;s&&(o&&!Object.prototype.hasOwnProperty.call(o,"Content-Type")||!o)&&(typeof Blob<"u"&&s instanceof Blob||s instanceof ArrayBuffer?(i["Content-Type"]="application/octet-stream",d=s):typeof s=="string"?(i["Content-Type"]="text/plain",d=s):typeof FormData<"u"&&s instanceof FormData?d=s:(i["Content-Type"]="application/json",d=JSON.stringify(s)));let c=yield this.fetch(u.toString(),{method:n||"POST",headers:Object.assign(Object.assign(Object.assign({},i),this.headers),o),body:d}).catch(w=>{throw new tc(w)}),f=c.headers.get("x-relay-error");if(f&&f==="true")throw new wl(c);if(!c.ok)throw new Sl(c);let g=((r=c.headers.get("Content-Type"))!==null&&r!==void 0?r:"text/plain").split(";")[0].trim(),x;return g==="application/json"?x=yield c.json():g==="application/octet-stream"?x=yield c.blob():g==="text/event-stream"?x=c:g==="multipart/form-data"?x=yield c.formData():x=yield c.text(),{data:x,error:null,response:c}}catch(o){return{data:null,error:o,response:o instanceof Sl||o instanceof wl?o.context:void 0}}})}};var Bw=M(Fw(),1),{PostgrestClient:Uw,PostgrestQueryBuilder:rM,PostgrestFilterBuilder:oM,PostgrestTransformBuilder:nM,PostgrestBuilder:sM,PostgrestError:p1}=Bw.default;function Vw(){if(typeof WebSocket<"u")return WebSocket;if(typeof global.WebSocket<"u")return global.WebSocket;if(typeof window.WebSocket<"u")return window.WebSocket;if(typeof self.WebSocket<"u")return self.WebSocket;throw new Error("`WebSocket` is not supported in this environment")}var jw=Vw();var qw="2.11.15";var Hw=`realtime-js/${qw}`,zw="1.0.0";var ic=1e4,$w=1e3,ds;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(ds||(ds={}));var lt;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(lt||(lt={}));var Qt;(function(e){e.close="phx_close",e.error="phx_error",e.join="phx_join",e.reply="phx_reply",e.leave="phx_leave",e.access_token="access_token"})(Qt||(Qt={}));var sc;(function(e){e.websocket="websocket"})(sc||(sc={}));var Qr;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(Qr||(Qr={}));var Al=class{constructor(){this.HEADER_LENGTH=1}decode(t,a){return t.constructor===ArrayBuffer?a(this._binaryDecode(t)):a(typeof t=="string"?JSON.parse(t):{})}_binaryDecode(t){let a=new DataView(t),r=new TextDecoder;return this._decodeBroadcast(t,a,r)}_decodeBroadcast(t,a,r){let o=a.getUint8(1),n=a.getUint8(2),s=this.HEADER_LENGTH+2,i=r.decode(t.slice(s,s+o));s=s+o;let l=r.decode(t.slice(s,s+n));s=s+n;let u=JSON.parse(r.decode(t.slice(s,t.byteLength)));return{ref:null,topic:i,event:l,payload:u}}};var qo=class{constructor(t,a){this.callback=t,this.timerCalc=a,this.timer=void 0,this.tries=0,this.callback=t,this.timerCalc=a}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}};var Se;(function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"})(Se||(Se={}));var ag=(e,t,a={})=>{var r;let o=(r=a.skipTypes)!==null&&r!==void 0?r:[];return Object.keys(t).reduce((n,s)=>(n[s]=m1(s,e,t,o),n),{})},m1=(e,t,a,r)=>{let o=t.find(i=>i.name===e),n=o?.type,s=a[e];return n&&!r.includes(n)?Ww(n,s):tg(s)},Ww=(e,t)=>{if(e.charAt(0)==="_"){let a=e.slice(1,e.length);return x1(t,a)}switch(e){case Se.bool:return h1(t);case Se.float4:case Se.float8:case Se.int2:case Se.int4:case Se.int8:case Se.numeric:case Se.oid:return g1(t);case Se.json:case Se.jsonb:return y1(t);case Se.timestamp:return v1(t);case Se.abstime:case Se.date:case Se.daterange:case Se.int4range:case Se.int8range:case Se.money:case Se.reltime:case Se.text:case Se.time:case Se.timestamptz:case Se.timetz:case Se.tsrange:case Se.tstzrange:return tg(t);default:return tg(t)}},tg=e=>e,h1=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},g1=e=>{if(typeof e=="string"){let t=parseFloat(e);if(!Number.isNaN(t))return t}return e},y1=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch(t){return console.log(`JSON parse error: ${t}`),e}return e},x1=(e,t)=>{if(typeof e!="string")return e;let a=e.length-1,r=e[a];if(e[0]==="{"&&r==="}"){let n,s=e.slice(1,a);try{n=JSON.parse("["+s+"]")}catch{n=s?s.split(","):[]}return n.map(i=>Ww(t,i))}return e},v1=e=>typeof e=="string"?e.replace(" ","T"):e,lc=e=>{let t=e;return t=t.replace(/^ws/i,"http"),t=t.replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,""),t.replace(/\/+$/,"")};var Ho=class{constructor(t,a,r={},o=ic){this.channel=t,this.event=a,this.payload=r,this.timeout=o,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(t){this.timeout=t,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(t){this.payload=Object.assign(Object.assign({},this.payload),t)}receive(t,a){var r;return this._hasReceived(t)&&a((r=this.receivedResp)===null||r===void 0?void 0:r.response),this.recHooks.push({status:t,callback:a}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);let t=a=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=a,this._matchReceive(a)};this.channel._on(this.refEvent,{},t),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(t,a){this.refEvent&&this.channel._trigger(this.refEvent,{status:t,response:a})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:t,response:a}){this.recHooks.filter(r=>r.status===t).forEach(r=>r.callback(a))}_hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}};var rg;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(rg||(rg={}));var cs=class e{constructor(t,a){this.channel=t,this.state={},this.pendingDiffs=[],this.joinRef=null,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};let r=a?.events||{state:"presence_state",diff:"presence_diff"};this.channel._on(r.state,{},o=>{let{onJoin:n,onLeave:s,onSync:i}=this.caller;this.joinRef=this.channel._joinRef(),this.state=e.syncState(this.state,o,n,s),this.pendingDiffs.forEach(l=>{this.state=e.syncDiff(this.state,l,n,s)}),this.pendingDiffs=[],i()}),this.channel._on(r.diff,{},o=>{let{onJoin:n,onLeave:s,onSync:i}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(o):(this.state=e.syncDiff(this.state,o,n,s),i())}),this.onJoin((o,n,s)=>{this.channel._trigger("presence",{event:"join",key:o,currentPresences:n,newPresences:s})}),this.onLeave((o,n,s)=>{this.channel._trigger("presence",{event:"leave",key:o,currentPresences:n,leftPresences:s})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(t,a,r,o){let n=this.cloneDeep(t),s=this.transformState(a),i={},l={};return this.map(n,(u,d)=>{s[u]||(l[u]=d)}),this.map(s,(u,d)=>{let c=n[u];if(c){let f=d.map(L=>L.presence_ref),g=c.map(L=>L.presence_ref),x=d.filter(L=>g.indexOf(L.presence_ref)<0),w=c.filter(L=>f.indexOf(L.presence_ref)<0);x.length>0&&(i[u]=x),w.length>0&&(l[u]=w)}else i[u]=d}),this.syncDiff(n,{joins:i,leaves:l},r,o)}static syncDiff(t,a,r,o){let{joins:n,leaves:s}={joins:this.transformState(a.joins),leaves:this.transformState(a.leaves)};return r||(r=()=>{}),o||(o=()=>{}),this.map(n,(i,l)=>{var u;let d=(u=t[i])!==null&&u!==void 0?u:[];if(t[i]=this.cloneDeep(l),d.length>0){let c=t[i].map(g=>g.presence_ref),f=d.filter(g=>c.indexOf(g.presence_ref)<0);t[i].unshift(...f)}r(i,d,l)}),this.map(s,(i,l)=>{let u=t[i];if(!u)return;let d=l.map(c=>c.presence_ref);u=u.filter(c=>d.indexOf(c.presence_ref)<0),t[i]=u,o(i,u,l),u.length===0&&delete t[i]}),t}static map(t,a){return Object.getOwnPropertyNames(t).map(r=>a(r,t[r]))}static transformState(t){return t=this.cloneDeep(t),Object.getOwnPropertyNames(t).reduce((a,r)=>{let o=t[r];return"metas"in o?a[r]=o.metas.map(n=>(n.presence_ref=n.phx_ref,delete n.phx_ref,delete n.phx_ref_prev,n)):a[r]=o,a},{})}static cloneDeep(t){return JSON.parse(JSON.stringify(t))}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}};var og;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(og||(og={}));var ng;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(ng||(ng={}));var Na;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(Na||(Na={}));var fs=class e{constructor(t,a={config:{}},r){this.topic=t,this.params=a,this.socket=r,this.bindings={},this.state=lt.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:""},private:!1},a.config),this.timeout=this.socket.timeout,this.joinPush=new Ho(this,Qt.join,this.params,this.timeout),this.rejoinTimer=new qo(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=lt.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(o=>o.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=lt.closed,this.socket._remove(this)}),this._onError(o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=lt.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=lt.errored,this.rejoinTimer.scheduleTimeout())}),this._on(Qt.reply,{},(o,n)=>{this._trigger(this._replyEventName(n),o)}),this.presence=new cs(this),this.broadcastEndpointURL=lc(this.socket.endPoint)+"/api/broadcast",this.private=this.params.config.private||!1}subscribe(t,a=this.timeout){var r,o;if(this.socket.isConnected()||this.socket.connect(),this.state==lt.closed){let{config:{broadcast:n,presence:s,private:i}}=this.params;this._onError(d=>t?.(Na.CHANNEL_ERROR,d)),this._onClose(()=>t?.(Na.CLOSED));let l={},u={broadcast:n,presence:s,postgres_changes:(o=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(d=>d.filter))!==null&&o!==void 0?o:[],private:i};this.socket.accessTokenValue&&(l.access_token=this.socket.accessTokenValue),this.updateJoinPayload(Object.assign({config:u},l)),this.joinedOnce=!0,this._rejoin(a),this.joinPush.receive("ok",async({postgres_changes:d})=>{var c;if(this.socket.setAuth(),d===void 0){t?.(Na.SUBSCRIBED);return}else{let f=this.bindings.postgres_changes,g=(c=f?.length)!==null&&c!==void 0?c:0,x=[];for(let w=0;w<g;w++){let L=f[w],{filter:{event:y,schema:h,table:m,filter:C}}=L,I=d&&d[w];if(I&&I.event===y&&I.schema===h&&I.table===m&&I.filter===C)x.push(Object.assign(Object.assign({},L),{id:I.id}));else{this.unsubscribe(),this.state=lt.errored,t?.(Na.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=x,t&&t(Na.SUBSCRIBED);return}}).receive("error",d=>{this.state=lt.errored,t?.(Na.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(d).join(", ")||"error")))}).receive("timeout",()=>{t?.(Na.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(t,a={}){return await this.send({type:"presence",event:"track",payload:t},a.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,a,r){return this._on(t,a,r)}async send(t,a={}){var r,o;if(!this._canPush()&&t.type==="broadcast"){let{event:n,payload:s}=t,l={method:"POST",headers:{Authorization:this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:n,payload:s,private:this.private}]})};try{let u=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(r=a.timeout)!==null&&r!==void 0?r:this.timeout);return await((o=u.body)===null||o===void 0?void 0:o.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(n=>{var s,i,l;let u=this._push(t.type,t,a.timeout||this.timeout);t.type==="broadcast"&&!(!((l=(i=(s=this.params)===null||s===void 0?void 0:s.config)===null||i===void 0?void 0:i.broadcast)===null||l===void 0)&&l.ack)&&n("ok"),u.receive("ok",()=>n("ok")),u.receive("error",()=>n("error")),u.receive("timeout",()=>n("timed out"))})}updateJoinPayload(t){this.joinPush.updatePayload(t)}unsubscribe(t=this.timeout){this.state=lt.leaving;let a=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(Qt.close,"leave",this._joinRef())};this.joinPush.destroy();let r=null;return new Promise(o=>{r=new Ho(this,Qt.leave,{},t),r.receive("ok",()=>{a(),o("ok")}).receive("timeout",()=>{a(),o("timed out")}).receive("error",()=>{o("error")}),r.send(),this._canPush()||r.trigger("ok",{})}).finally(()=>{r?.destroy()})}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.rejoinTimer&&clearTimeout(this.rejoinTimer.timer),this.joinPush.destroy()}async _fetchWithTimeout(t,a,r){let o=new AbortController,n=setTimeout(()=>o.abort(),r),s=await this.socket.fetch(t,Object.assign(Object.assign({},a),{signal:o.signal}));return clearTimeout(n),s}_push(t,a,r=this.timeout){if(!this.joinedOnce)throw`tried to push '${t}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let o=new Ho(this,t,a,r);return this._canPush()?o.send():(o.startTimeout(),this.pushBuffer.push(o)),o}_onMessage(t,a,r){return a}_isMember(t){return this.topic===t}_joinRef(){return this.joinPush.ref}_trigger(t,a,r){var o,n;let s=t.toLocaleLowerCase(),{close:i,error:l,leave:u,join:d}=Qt;if(r&&[i,l,u,d].indexOf(s)>=0&&r!==this._joinRef())return;let f=this._onMessage(s,a,r);if(a&&!f)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(s)?(o=this.bindings.postgres_changes)===null||o===void 0||o.filter(g=>{var x,w,L;return((x=g.filter)===null||x===void 0?void 0:x.event)==="*"||((L=(w=g.filter)===null||w===void 0?void 0:w.event)===null||L===void 0?void 0:L.toLocaleLowerCase())===s}).map(g=>g.callback(f,r)):(n=this.bindings[s])===null||n===void 0||n.filter(g=>{var x,w,L,y,h,m;if(["broadcast","presence","postgres_changes"].includes(s))if("id"in g){let C=g.id,I=(x=g.filter)===null||x===void 0?void 0:x.event;return C&&((w=a.ids)===null||w===void 0?void 0:w.includes(C))&&(I==="*"||I?.toLocaleLowerCase()===((L=a.data)===null||L===void 0?void 0:L.type.toLocaleLowerCase()))}else{let C=(h=(y=g?.filter)===null||y===void 0?void 0:y.event)===null||h===void 0?void 0:h.toLocaleLowerCase();return C==="*"||C===((m=a?.event)===null||m===void 0?void 0:m.toLocaleLowerCase())}else return g.type.toLocaleLowerCase()===s}).map(g=>{if(typeof f=="object"&&"ids"in f){let x=f.data,{schema:w,table:L,commit_timestamp:y,type:h,errors:m}=x;f=Object.assign(Object.assign({},{schema:w,table:L,commit_timestamp:y,eventType:h,new:{},old:{},errors:m}),this._getPayloadRecords(x))}g.callback(f,r)})}_isClosed(){return this.state===lt.closed}_isJoined(){return this.state===lt.joined}_isJoining(){return this.state===lt.joining}_isLeaving(){return this.state===lt.leaving}_replyEventName(t){return`chan_reply_${t}`}_on(t,a,r){let o=t.toLocaleLowerCase(),n={type:o,filter:a,callback:r};return this.bindings[o]?this.bindings[o].push(n):this.bindings[o]=[n],this}_off(t,a){let r=t.toLocaleLowerCase();return this.bindings[r]=this.bindings[r].filter(o=>{var n;return!(((n=o.type)===null||n===void 0?void 0:n.toLocaleLowerCase())===r&&e.isEqual(o.filter,a))}),this}static isEqual(t,a){if(Object.keys(t).length!==Object.keys(a).length)return!1;for(let r in t)if(t[r]!==a[r])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(t){this._on(Qt.close,{},t)}_onError(t){this._on(Qt.error,{},a=>t(a))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=lt.joining,this.joinPush.resend(t))}_getPayloadRecords(t){let a={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(a.new=ag(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(a.old=ag(t.columns,t.old_record)),a}};var Gw=()=>{},S1=`
9
9
  addEventListener("message", (e) => {
10
10
  if (e.data.event === "start") {
11
11
  setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
12
12
  }
13
13
  });`,ps=class{constructor(t,a){var r;this.accessTokenValue=null,this.apiKey=null,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=ic,this.heartbeatIntervalMs=25e3,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=Gw,this.ref=0,this.logger=Gw,this.conn=null,this.sendBuffer=[],this.serializer=new Al,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._resolveFetch=n=>{let s;return n?s=n:typeof fetch>"u"?s=(...i)=>Promise.resolve().then(()=>(Xr(),jo)).then(({default:l})=>l(...i)):s=fetch,(...i)=>s(...i)},this.endPoint=`${t}/${sc.websocket}`,this.httpEndpoint=lc(t),a?.transport?this.transport=a.transport:this.transport=null,a?.params&&(this.params=a.params),a?.timeout&&(this.timeout=a.timeout),a?.logger&&(this.logger=a.logger),(a?.logLevel||a?.log_level)&&(this.logLevel=a.logLevel||a.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),a?.heartbeatIntervalMs&&(this.heartbeatIntervalMs=a.heartbeatIntervalMs);let o=(r=a?.params)===null||r===void 0?void 0:r.apikey;if(o&&(this.accessTokenValue=o,this.apiKey=o),this.reconnectAfterMs=a?.reconnectAfterMs?a.reconnectAfterMs:n=>[1e3,2e3,5e3,1e4][n-1]||1e4,this.encode=a?.encode?a.encode:(n,s)=>s(JSON.stringify(n)),this.decode=a?.decode?a.decode:this.serializer.decode.bind(this.serializer),this.reconnectTimer=new qo(async()=>{this.disconnect(),this.connect()},this.reconnectAfterMs),this.fetch=this._resolveFetch(a?.fetch),a?.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.worker=a?.worker||!1,this.workerUrl=a?.workerUrl}this.accessToken=a?.accessToken||null}connect(){if(!this.conn){if(this.transport||(this.transport=jw),!this.transport)throw new Error("No transport provided");this.conn=new this.transport(this.endpointURL()),this.setupConnection()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:zw}))}disconnect(t,a){this.conn&&(this.conn.onclose=function(){},t?this.conn.close(t,a??""):this.conn.close(),this.conn=null,this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.reset(),this.channels.forEach(r=>r.teardown()))}getChannels(){return this.channels}async removeChannel(t){let a=await t.unsubscribe();return this.channels.length===0&&this.disconnect(),a}async removeAllChannels(){let t=await Promise.all(this.channels.map(a=>a.unsubscribe()));return this.channels=[],this.disconnect(),t}log(t,a,r){this.logger(t,a,r)}connectionState(){switch(this.conn&&this.conn.readyState){case ds.connecting:return Qr.Connecting;case ds.open:return Qr.Open;case ds.closing:return Qr.Closing;default:return Qr.Closed}}isConnected(){return this.connectionState()===Qr.Open}channel(t,a={config:{}}){let r=`realtime:${t}`,o=this.getChannels().find(n=>n.topic===r);if(o)return o;{let n=new fs(`realtime:${t}`,a,this);return this.channels.push(n),n}}push(t){let{topic:a,event:r,payload:o,ref:n}=t,s=()=>{this.encode(t,i=>{var l;(l=this.conn)===null||l===void 0||l.send(i)})};this.log("push",`${a} ${r} (${n})`,o),this.isConnected()?s():this.sendBuffer.push(s)}async setAuth(t=null){let a=t||this.accessToken&&await this.accessToken()||this.accessTokenValue;this.accessTokenValue!=a&&(this.accessTokenValue=a,this.channels.forEach(r=>{let o={access_token:a,version:Hw};a&&r.updateJoinPayload(o),r.joinedOnce&&r._isJoined()&&r._push(Qt.access_token,{access_token:a})}))}async sendHeartbeat(){var t;if(!this.isConnected()){this.heartbeatCallback("disconnected");return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection"),this.heartbeatCallback("timeout"),(t=this.conn)===null||t===void 0||t.close($w,"hearbeat timeout");return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.heartbeatCallback("sent"),await this.setAuth()}onHeartbeat(t){this.heartbeatCallback=t}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}_makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}_leaveOpenTopic(t){let a=this.channels.find(r=>r.topic===t&&(r._isJoined()||r._isJoining()));a&&(this.log("transport",`leaving duplicate topic "${t}"`),a.unsubscribe())}_remove(t){this.channels=this.channels.filter(a=>a.topic!==t.topic)}setupConnection(){this.conn&&(this.conn.binaryType="arraybuffer",this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=t=>this._onConnError(t),this.conn.onmessage=t=>this._onConnMessage(t),this.conn.onclose=t=>this._onConnClose(t))}_onConnMessage(t){this.decode(t.data,a=>{let{topic:r,event:o,payload:n,ref:s}=a;r==="phoenix"&&o==="phx_reply"&&this.heartbeatCallback(a.payload.status=="ok"?"ok":"error"),s&&s===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null),this.log("receive",`${n.status||""} ${r} ${o} ${s&&"("+s+")"||""}`,n),Array.from(this.channels).filter(i=>i._isMember(r)).forEach(i=>i._trigger(o,n,s)),this.stateChangeCallbacks.message.forEach(i=>i(a))})}_onConnOpen(){this.log("transport",`connected to ${this.endpointURL()}`),this.flushSendBuffer(),this.reconnectTimer.reset(),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this.stateChangeCallbacks.open.forEach(t=>t())}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");let t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=a=>{this.log("worker","worker error",a.message),this.workerRef.terminate()},this.workerRef.onmessage=a=>{a.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_onConnClose(t){this.log("transport","close",t),this._triggerChanError(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(a=>a(t))}_onConnError(t){this.log("transport",`${t}`),this._triggerChanError(),this.stateChangeCallbacks.error.forEach(a=>a(t))}_triggerChanError(){this.channels.forEach(t=>t._trigger(Qt.error))}_appendParams(t,a){if(Object.keys(a).length===0)return t;let r=t.match(/\?/)?"&":"?",o=new URLSearchParams(a);return`${t}${r}${o}`}_workerObjectUrl(t){let a;if(t)a=t;else{let r=new Blob([S1],{type:"application/javascript"});a=URL.createObjectURL(r)}return a}};var ms=class extends Error{constructor(t){super(t),this.__isStorageError=!0,this.name="StorageError"}};function je(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var uc=class extends ms{constructor(t,a,r){super(t),this.name="StorageApiError",this.status=a,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},zo=class extends ms{constructor(t,a){super(t),this.name="StorageUnknownError",this.originalError=a}};var C1=function(e,t,a,r){function o(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function i(d){try{u(r.next(d))}catch(c){s(c)}}function l(d){try{u(r.throw(d))}catch(c){s(c)}}function u(d){d.done?n(d.value):o(d.value).then(i,l)}u((r=r.apply(e,t||[])).next())})},cc=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...a)=>Promise.resolve().then(()=>(Xr(),jo)).then(({default:r})=>r(...a)):t=fetch,(...a)=>t(...a)},Kw=()=>C1(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield Promise.resolve().then(()=>(Xr(),jo))).Response:Response}),dc=e=>{if(Array.isArray(e))return e.map(a=>dc(a));if(typeof e=="function"||e!==Object(e))return e;let t={};return Object.entries(e).forEach(([a,r])=>{let o=a.replace(/([-_][a-z])/gi,n=>n.toUpperCase().replace(/[-_]/g,""));t[o]=dc(r)}),t},Xw=e=>{if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)};var $o=function(e,t,a,r){function o(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function i(d){try{u(r.next(d))}catch(c){s(c)}}function l(d){try{u(r.throw(d))}catch(c){s(c)}}function u(d){d.done?n(d.value):o(d.value).then(i,l)}u((r=r.apply(e,t||[])).next())})},sg=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),L1=(e,t,a)=>$o(void 0,void 0,void 0,function*(){let r=yield Kw();e instanceof r&&!a?.noResolveJson?e.json().then(o=>{let n=e.status||500,s=o?.statusCode||n+"";t(new uc(sg(o),n,s))}).catch(o=>{t(new zo(sg(o),o))}):t(new zo(sg(e),e))}),I1=(e,t,a,r)=>{let o={method:e,headers:t?.headers||{}};return e==="GET"||!r?o:(Xw(r)?(o.headers=Object.assign({"Content-Type":"application/json"},t?.headers),o.body=JSON.stringify(r)):o.body=r,Object.assign(Object.assign({},o),a))};function Rl(e,t,a,r,o,n){return $o(this,void 0,void 0,function*(){return new Promise((s,i)=>{e(a,I1(t,r,o,n)).then(l=>{if(!l.ok)throw l;return r?.noResolveJson?l:l.json()}).then(l=>s(l)).catch(l=>L1(l,i,r))})})}function hs(e,t,a,r){return $o(this,void 0,void 0,function*(){return Rl(e,"GET",t,a,r)})}function Ia(e,t,a,r,o){return $o(this,void 0,void 0,function*(){return Rl(e,"POST",t,r,o,a)})}function _l(e,t,a,r,o){return $o(this,void 0,void 0,function*(){return Rl(e,"PUT",t,r,o,a)})}function Qw(e,t,a,r){return $o(this,void 0,void 0,function*(){return Rl(e,"HEAD",t,Object.assign(Object.assign({},a),{noResolveJson:!0}),r)})}function fc(e,t,a,r,o){return $o(this,void 0,void 0,function*(){return Rl(e,"DELETE",t,r,o,a)})}var Nt=function(e,t,a,r){function o(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function i(d){try{u(r.next(d))}catch(c){s(c)}}function l(d){try{u(r.throw(d))}catch(c){s(c)}}function u(d){d.done?n(d.value):o(d.value).then(i,l)}u((r=r.apply(e,t||[])).next())})},b1={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Jw={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1},El=class{constructor(t,a={},r,o){this.url=t,this.headers=a,this.bucketId=r,this.fetch=cc(o)}uploadOrUpdate(t,a,r,o){return Nt(this,void 0,void 0,function*(){try{let n,s=Object.assign(Object.assign({},Jw),o),i=Object.assign(Object.assign({},this.headers),t==="POST"&&{"x-upsert":String(s.upsert)}),l=s.metadata;typeof Blob<"u"&&r instanceof Blob?(n=new FormData,n.append("cacheControl",s.cacheControl),l&&n.append("metadata",this.encodeMetadata(l)),n.append("",r)):typeof FormData<"u"&&r instanceof FormData?(n=r,n.append("cacheControl",s.cacheControl),l&&n.append("metadata",this.encodeMetadata(l))):(n=r,i["cache-control"]=`max-age=${s.cacheControl}`,i["content-type"]=s.contentType,l&&(i["x-metadata"]=this.toBase64(this.encodeMetadata(l)))),o?.headers&&(i=Object.assign(Object.assign({},i),o.headers));let u=this._removeEmptyFolders(a),d=this._getFinalPath(u),c=yield(t=="PUT"?_l:Ia)(this.fetch,`${this.url}/object/${d}`,n,Object.assign({headers:i},s?.duplex?{duplex:s.duplex}:{}));return{data:{path:u,id:c.Id,fullPath:c.Key},error:null}}catch(n){if(je(n))return{data:null,error:n};throw n}})}upload(t,a,r){return Nt(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",t,a,r)})}uploadToSignedUrl(t,a,r,o){return Nt(this,void 0,void 0,function*(){let n=this._removeEmptyFolders(t),s=this._getFinalPath(n),i=new URL(this.url+`/object/upload/sign/${s}`);i.searchParams.set("token",a);try{let l,u=Object.assign({upsert:Jw.upsert},o),d=Object.assign(Object.assign({},this.headers),{"x-upsert":String(u.upsert)});typeof Blob<"u"&&r instanceof Blob?(l=new FormData,l.append("cacheControl",u.cacheControl),l.append("",r)):typeof FormData<"u"&&r instanceof FormData?(l=r,l.append("cacheControl",u.cacheControl)):(l=r,d["cache-control"]=`max-age=${u.cacheControl}`,d["content-type"]=u.contentType);let c=yield _l(this.fetch,i.toString(),l,{headers:d});return{data:{path:n,fullPath:c.Key},error:null}}catch(l){if(je(l))return{data:null,error:l};throw l}})}createSignedUploadUrl(t,a){return Nt(this,void 0,void 0,function*(){try{let r=this._getFinalPath(t),o=Object.assign({},this.headers);a?.upsert&&(o["x-upsert"]="true");let n=yield Ia(this.fetch,`${this.url}/object/upload/sign/${r}`,{},{headers:o}),s=new URL(this.url+n.url),i=s.searchParams.get("token");if(!i)throw new ms("No token returned by API");return{data:{signedUrl:s.toString(),path:t,token:i},error:null}}catch(r){if(je(r))return{data:null,error:r};throw r}})}update(t,a,r){return Nt(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",t,a,r)})}move(t,a,r){return Nt(this,void 0,void 0,function*(){try{return{data:yield Ia(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:t,destinationKey:a,destinationBucket:r?.destinationBucket},{headers:this.headers}),error:null}}catch(o){if(je(o))return{data:null,error:o};throw o}})}copy(t,a,r){return Nt(this,void 0,void 0,function*(){try{return{data:{path:(yield Ia(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:t,destinationKey:a,destinationBucket:r?.destinationBucket},{headers:this.headers})).Key},error:null}}catch(o){if(je(o))return{data:null,error:o};throw o}})}createSignedUrl(t,a,r){return Nt(this,void 0,void 0,function*(){try{let o=this._getFinalPath(t),n=yield Ia(this.fetch,`${this.url}/object/sign/${o}`,Object.assign({expiresIn:a},r?.transform?{transform:r.transform}:{}),{headers:this.headers}),s=r?.download?`&download=${r.download===!0?"":r.download}`:"";return n={signedUrl:encodeURI(`${this.url}${n.signedURL}${s}`)},{data:n,error:null}}catch(o){if(je(o))return{data:null,error:o};throw o}})}createSignedUrls(t,a,r){return Nt(this,void 0,void 0,function*(){try{let o=yield Ia(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:a,paths:t},{headers:this.headers}),n=r?.download?`&download=${r.download===!0?"":r.download}`:"";return{data:o.map(s=>Object.assign(Object.assign({},s),{signedUrl:s.signedURL?encodeURI(`${this.url}${s.signedURL}${n}`):null})),error:null}}catch(o){if(je(o))return{data:null,error:o};throw o}})}download(t,a){return Nt(this,void 0,void 0,function*(){let o=typeof a?.transform<"u"?"render/image/authenticated":"object",n=this.transformOptsToQueryString(a?.transform||{}),s=n?`?${n}`:"";try{let i=this._getFinalPath(t);return{data:yield(yield hs(this.fetch,`${this.url}/${o}/${i}${s}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(i){if(je(i))return{data:null,error:i};throw i}})}info(t){return Nt(this,void 0,void 0,function*(){let a=this._getFinalPath(t);try{let r=yield hs(this.fetch,`${this.url}/object/info/${a}`,{headers:this.headers});return{data:dc(r),error:null}}catch(r){if(je(r))return{data:null,error:r};throw r}})}exists(t){return Nt(this,void 0,void 0,function*(){let a=this._getFinalPath(t);try{return yield Qw(this.fetch,`${this.url}/object/${a}`,{headers:this.headers}),{data:!0,error:null}}catch(r){if(je(r)&&r instanceof zo){let o=r.originalError;if([400,404].includes(o?.status))return{data:!1,error:r}}throw r}})}getPublicUrl(t,a){let r=this._getFinalPath(t),o=[],n=a?.download?`download=${a.download===!0?"":a.download}`:"";n!==""&&o.push(n);let i=typeof a?.transform<"u"?"render/image":"object",l=this.transformOptsToQueryString(a?.transform||{});l!==""&&o.push(l);let u=o.join("&");return u!==""&&(u=`?${u}`),{data:{publicUrl:encodeURI(`${this.url}/${i}/public/${r}${u}`)}}}remove(t){return Nt(this,void 0,void 0,function*(){try{return{data:yield fc(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:t},{headers:this.headers}),error:null}}catch(a){if(je(a))return{data:null,error:a};throw a}})}list(t,a,r){return Nt(this,void 0,void 0,function*(){try{let o=Object.assign(Object.assign(Object.assign({},b1),a),{prefix:t||""});return{data:yield Ia(this.fetch,`${this.url}/object/list/${this.bucketId}`,o,{headers:this.headers},r),error:null}}catch(o){if(je(o))return{data:null,error:o};throw o}})}encodeMetadata(t){return JSON.stringify(t)}toBase64(t){return typeof Buffer<"u"?Buffer.from(t).toString("base64"):btoa(t)}_getFinalPath(t){return`${this.bucketId}/${t.replace(/^\/+/,"")}`}_removeEmptyFolders(t){return t.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(t){let a=[];return t.width&&a.push(`width=${t.width}`),t.height&&a.push(`height=${t.height}`),t.resize&&a.push(`resize=${t.resize}`),t.format&&a.push(`format=${t.format}`),t.quality&&a.push(`quality=${t.quality}`),a.join("&")}};var Yw="2.10.4";var Zw={"X-Client-Info":`storage-js/${Yw}`};var gs=function(e,t,a,r){function o(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function i(d){try{u(r.next(d))}catch(c){s(c)}}function l(d){try{u(r.throw(d))}catch(c){s(c)}}function u(d){d.done?n(d.value):o(d.value).then(i,l)}u((r=r.apply(e,t||[])).next())})},Dl=class{constructor(t,a={},r,o){let n=new URL(t);o?.useNewHostname&&/supabase\.(co|in|red)$/.test(n.hostname)&&!n.hostname.includes("storage.supabase.")&&(n.hostname=n.hostname.replace("supabase.","storage.supabase.")),this.url=n.href,this.headers=Object.assign(Object.assign({},Zw),a),this.fetch=cc(r)}listBuckets(){return gs(this,void 0,void 0,function*(){try{return{data:yield hs(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(t){if(je(t))return{data:null,error:t};throw t}})}getBucket(t){return gs(this,void 0,void 0,function*(){try{return{data:yield hs(this.fetch,`${this.url}/bucket/${t}`,{headers:this.headers}),error:null}}catch(a){if(je(a))return{data:null,error:a};throw a}})}createBucket(t,a={public:!1}){return gs(this,void 0,void 0,function*(){try{return{data:yield Ia(this.fetch,`${this.url}/bucket`,{id:t,name:t,type:a.type,public:a.public,file_size_limit:a.fileSizeLimit,allowed_mime_types:a.allowedMimeTypes},{headers:this.headers}),error:null}}catch(r){if(je(r))return{data:null,error:r};throw r}})}updateBucket(t,a){return gs(this,void 0,void 0,function*(){try{return{data:yield _l(this.fetch,`${this.url}/bucket/${t}`,{id:t,name:t,public:a.public,file_size_limit:a.fileSizeLimit,allowed_mime_types:a.allowedMimeTypes},{headers:this.headers}),error:null}}catch(r){if(je(r))return{data:null,error:r};throw r}})}emptyBucket(t){return gs(this,void 0,void 0,function*(){try{return{data:yield Ia(this.fetch,`${this.url}/bucket/${t}/empty`,{},{headers:this.headers}),error:null}}catch(a){if(je(a))return{data:null,error:a};throw a}})}deleteBucket(t){return gs(this,void 0,void 0,function*(){try{return{data:yield fc(this.fetch,`${this.url}/bucket/${t}`,{},{headers:this.headers}),error:null}}catch(a){if(je(a))return{data:null,error:a};throw a}})}};var Ml=class extends Dl{constructor(t,a={},r,o){super(t,a,r,o)}from(t){return new El(this.url,this.headers,t,this.fetch)}};var eS="2.53.0";var Nl="";typeof Deno<"u"?Nl="deno":typeof document<"u"?Nl="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Nl="react-native":Nl="node";var k1={"X-Client-Info":`supabase-js-${Nl}/${eS}`},tS={headers:k1},aS={schema:"public"},rS={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},oS={};Xr();var P1=function(e,t,a,r){function o(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function i(d){try{u(r.next(d))}catch(c){s(c)}}function l(d){try{u(r.throw(d))}catch(c){s(c)}}function u(d){d.done?n(d.value):o(d.value).then(i,l)}u((r=r.apply(e,t||[])).next())})},T1=e=>{let t;return e?t=e:typeof fetch>"u"?t=qh:t=fetch,(...a)=>t(...a)},A1=()=>typeof Headers>"u"?Hh:Headers,nS=(e,t,a)=>{let r=T1(a),o=A1();return(n,s)=>P1(void 0,void 0,void 0,function*(){var i;let l=(i=yield t())!==null&&i!==void 0?i:e,u=new o(s?.headers);return u.has("apikey")||u.set("apikey",e),u.has("Authorization")||u.set("Authorization",`Bearer ${l}`),r(n,Object.assign(Object.assign({},s),{headers:u}))})};var R1=function(e,t,a,r){function o(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function i(d){try{u(r.next(d))}catch(c){s(c)}}function l(d){try{u(r.throw(d))}catch(c){s(c)}}function u(d){d.done?n(d.value):o(d.value).then(i,l)}u((r=r.apply(e,t||[])).next())})};function sS(e){return e.endsWith("/")?e:e+"/"}function iS(e,t){var a,r;let{db:o,auth:n,realtime:s,global:i}=e,{db:l,auth:u,realtime:d,global:c}=t,f={db:Object.assign(Object.assign({},l),o),auth:Object.assign(Object.assign({},u),n),realtime:Object.assign(Object.assign({},d),s),storage:{},global:Object.assign(Object.assign(Object.assign({},c),i),{headers:Object.assign(Object.assign({},(a=c?.headers)!==null&&a!==void 0?a:{}),(r=i?.headers)!==null&&r!==void 0?r:{})}),accessToken:()=>R1(this,void 0,void 0,function*(){return""})};return e.accessToken?f.accessToken=e.accessToken:delete f.accessToken,f}var pc="2.71.1";var Wo=30*1e3,mc=3,hc=mc*Wo,lS="http://localhost:9999",uS="supabase.auth.token";var dS={"X-Client-Info":`gotrue-js/${pc}`};var Ol="X-Supabase-Api-Version",ig={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},cS=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,fS=600*1e3;var Fl=class extends Error{constructor(t,a,r){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=a,this.code=r}};function Q(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}var gc=class extends Fl{constructor(t,a,r){super(t,a,r),this.name="AuthApiError",this.status=a,this.code=r}};function pS(e){return Q(e)&&e.name==="AuthApiError"}var ys=class extends Fl{constructor(t,a){super(t),this.name="AuthUnknownError",this.originalError=a}},Oa=class extends Fl{constructor(t,a,r,o){super(t,r,o),this.name=a,this.status=r}},da=class extends Oa{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}};function mS(e){return Q(e)&&e.name==="AuthSessionMissingError"}var Go=class extends Oa{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}},Ko=class extends Oa{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}},Xo=class extends Oa{constructor(t,a=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=a}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}};function hS(e){return Q(e)&&e.name==="AuthImplicitGrantRedirectError"}var Bl=class extends Oa{constructor(t,a=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=a}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}},xs=class extends Oa{constructor(t,a){super(t,"AuthRetryableFetchError",a,void 0)}};function yc(e){return Q(e)&&e.name==="AuthRetryableFetchError"}var Ul=class extends Oa{constructor(t,a,r){super(t,"AuthWeakPasswordError",a,"weak_password"),this.reasons=r}};var Qo=class extends Oa{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}};var xc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),gS=`
14
14
  \r=`.split(""),_1=(()=>{let e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<gS.length;t+=1)e[gS[t].charCodeAt(0)]=-2;for(let t=0;t<xc.length;t+=1)e[xc[t].charCodeAt(0)]=t;return e})();function yS(e,t,a){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){let r=t.queue>>t.queuedBits-6&63;a(xc[r]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){let r=t.queue>>t.queuedBits-6&63;a(xc[r]),t.queuedBits-=6}}function xS(e,t,a){let r=_1[e];if(r>-1)for(t.queue=t.queue<<6|r,t.queuedBits+=6;t.queuedBits>=8;)a(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(r===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function lg(e){let t=[],a=s=>{t.push(String.fromCodePoint(s))},r={utf8seq:0,codepoint:0},o={queue:0,queuedBits:0},n=s=>{M1(s,r,a)};for(let s=0;s<e.length;s+=1)xS(e.charCodeAt(s),o,n);return t.join("")}function E1(e,t){if(e<=127){t(e);return}else if(e<=2047){t(192|e>>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function D1(e,t){for(let a=0;a<e.length;a+=1){let r=e.charCodeAt(a);if(r>55295&&r<=56319){let o=(r-55296)*1024&65535;r=(e.charCodeAt(a+1)-56320&65535|o)+65536,a+=1}E1(r,t)}}function M1(e,t,a){if(t.utf8seq===0){if(e<=127){a(e);return}for(let r=1;r<6;r+=1)if((e>>7-r&1)===0){t.utf8seq=r;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&a(t.codepoint)}}function vS(e){let t=[],a={queue:0,queuedBits:0},r=o=>{t.push(o)};for(let o=0;o<e.length;o+=1)xS(e.charCodeAt(o),a,r);return new Uint8Array(t)}function wS(e){let t=[];return D1(e,a=>t.push(a)),new Uint8Array(t)}function SS(e){let t=[],a={queue:0,queuedBits:0},r=o=>{t.push(o)};return e.forEach(o=>yS(o,a,r)),yS(null,a,r),t.join("")}function CS(e){return Math.round(Date.now()/1e3)+e}function LS(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}var ca=()=>typeof window<"u"&&typeof document<"u",Jo={tested:!1,writable:!1},vc=()=>{if(!ca())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Jo.tested)return Jo.writable;let e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),Jo.tested=!0,Jo.writable=!0}catch{Jo.tested=!0,Jo.writable=!1}return Jo.writable};function IS(e){let t={},a=new URL(e);if(a.hash&&a.hash[0]==="#")try{new URLSearchParams(a.hash.substring(1)).forEach((o,n)=>{t[n]=o})}catch{}return a.searchParams.forEach((r,o)=>{t[o]=r}),t}var wc=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...a)=>Promise.resolve().then(()=>(Xr(),jo)).then(({default:r})=>r(...a)):t=fetch,(...a)=>t(...a)},bS=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",Yo=async(e,t,a)=>{await e.setItem(t,JSON.stringify(a))},Jr=async(e,t)=>{let a=await e.getItem(t);if(!a)return null;try{return JSON.parse(a)}catch{return a}},lr=async(e,t)=>{await e.removeItem(t)},Vl=class e{constructor(){this.promise=new e.promiseConstructor((t,a)=>{this.resolve=t,this.reject=a})}};Vl.promiseConstructor=Promise;function Sc(e){let t=e.split(".");if(t.length!==3)throw new Qo("Invalid JWT structure");for(let r=0;r<t.length;r++)if(!cS.test(t[r]))throw new Qo("JWT not in base64url format");return{header:JSON.parse(lg(t[0])),payload:JSON.parse(lg(t[1])),signature:vS(t[2]),raw:{header:t[0],payload:t[1]}}}async function kS(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function PS(e,t){return new Promise((r,o)=>{(async()=>{for(let n=0;n<1/0;n++)try{let s=await e(n);if(!t(n,null,s)){r(s);return}}catch(s){if(!t(n,s)){o(s);return}}})()})}function N1(e){return("0"+e.toString(16)).substr(-2)}function O1(){let t=new Uint32Array(56);if(typeof crypto>"u"){let a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=a.length,o="";for(let n=0;n<56;n++)o+=a.charAt(Math.floor(Math.random()*r));return o}return crypto.getRandomValues(t),Array.from(t,N1).join("")}async function F1(e){let a=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",a),o=new Uint8Array(r);return Array.from(o).map(n=>String.fromCharCode(n)).join("")}async function B1(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;let a=await F1(e);return btoa(a).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Zo(e,t,a=!1){let r=O1(),o=r;a&&(o+="/PASSWORD_RECOVERY"),await Yo(e,`${t}-code-verifier`,o);let n=await B1(r);return[n,r===n?"plain":"s256"]}var U1=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function TS(e){let t=e.headers.get(Ol);if(!t||!t.match(U1))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function AS(e){if(!e)throw new Error("Missing exp claim");let t=Math.floor(Date.now()/1e3);if(e<=t)throw new Error("JWT has expired")}function RS(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}var V1=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function en(e){if(!V1.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Cc(){let e={};return new Proxy(e,{get:(t,a)=>{if(a==="__isUserNotAvailableProxy")return!0;if(typeof a=="symbol"){let r=a.toString();if(r==="Symbol(Symbol.toPrimitive)"||r==="Symbol(Symbol.toStringTag)"||r==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${a}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,a)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${a}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,a)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${a}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function ug(e){return JSON.parse(JSON.stringify(e))}var j1=function(e,t){var a={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(a[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(a[r[o]]=e[r[o]]);return a},tn=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),q1=[502,503,504];async function _S(e){var t;if(!bS(e))throw new xs(tn(e),0);if(q1.includes(e.status))throw new xs(tn(e),e.status);let a;try{a=await e.json()}catch(n){throw new ys(tn(n),n)}let r,o=TS(e);if(o&&o.getTime()>=ig["2024-01-01"].timestamp&&typeof a=="object"&&a&&typeof a.code=="string"?r=a.code:typeof a=="object"&&a&&typeof a.error_code=="string"&&(r=a.error_code),r){if(r==="weak_password")throw new Ul(tn(a),e.status,((t=a.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(r==="session_not_found")throw new da}else if(typeof a=="object"&&a&&typeof a.weak_password=="object"&&a.weak_password&&Array.isArray(a.weak_password.reasons)&&a.weak_password.reasons.length&&a.weak_password.reasons.reduce((n,s)=>n&&typeof s=="string",!0))throw new Ul(tn(a),e.status,a.weak_password.reasons);throw new gc(tn(a),e.status||500,r)}var H1=(e,t,a,r)=>{let o={method:e,headers:t?.headers||{}};return e==="GET"?o:(o.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t?.headers),o.body=JSON.stringify(r),Object.assign(Object.assign({},o),a))};async function te(e,t,a,r){var o;let n=Object.assign({},r?.headers);n[Ol]||(n[Ol]=ig["2024-01-01"].name),r?.jwt&&(n.Authorization=`Bearer ${r.jwt}`);let s=(o=r?.query)!==null&&o!==void 0?o:{};r?.redirectTo&&(s.redirect_to=r.redirectTo);let i=Object.keys(s).length?"?"+new URLSearchParams(s).toString():"",l=await z1(e,t,a+i,{headers:n,noResolveJson:r?.noResolveJson},{},r?.body);return r?.xform?r?.xform(l):{data:Object.assign({},l),error:null}}async function z1(e,t,a,r,o,n){let s=H1(t,r,o,n),i;try{i=await e(a,Object.assign({},s))}catch(l){throw console.error(l),new xs(tn(l),0)}if(i.ok||await _S(i),r?.noResolveJson)return i;try{return await i.json()}catch(l){await _S(l)}}function Fa(e){var t;let a=null;$1(e)&&(a=Object.assign({},e),e.expires_at||(a.expires_at=CS(e.expires_in)));let r=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:a,user:r},error:null}}function dg(e){let t=Fa(e);return!t.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((a,r)=>a&&typeof r=="string",!0)&&(t.data.weak_password=e.weak_password),t}function Ba(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function ES(e){return{data:e,error:null}}function DS(e){let{action_link:t,email_otp:a,hashed_token:r,redirect_to:o,verification_type:n}=e,s=j1(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),i={action_link:t,email_otp:a,hashed_token:r,redirect_to:o,verification_type:n},l=Object.assign({},s);return{data:{properties:i,user:l},error:null}}function MS(e){return e}function $1(e){return e.access_token&&e.refresh_token&&e.expires_in}var Lc=["global","local","others"];var W1=function(e,t){var a={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(a[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(a[r[o]]=e[r[o]]);return a},an=class{constructor({url:t="",headers:a={},fetch:r}){this.url=t,this.headers=a,this.fetch=wc(r),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}async signOut(t,a=Lc[0]){if(Lc.indexOf(a)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Lc.join(", ")}`);try{return await te(this.fetch,"POST",`${this.url}/logout?scope=${a}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(r){if(Q(r))return{data:null,error:r};throw r}}async inviteUserByEmail(t,a={}){try{return await te(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:a.data},headers:this.headers,redirectTo:a.redirectTo,xform:Ba})}catch(r){if(Q(r))return{data:{user:null},error:r};throw r}}async generateLink(t){try{let{options:a}=t,r=W1(t,["options"]),o=Object.assign(Object.assign({},r),a);return"newEmail"in r&&(o.new_email=r?.newEmail,delete o.newEmail),await te(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:o,headers:this.headers,xform:DS,redirectTo:a?.redirectTo})}catch(a){if(Q(a))return{data:{properties:null,user:null},error:a};throw a}}async createUser(t){try{return await te(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:Ba})}catch(a){if(Q(a))return{data:{user:null},error:a};throw a}}async listUsers(t){var a,r,o,n,s,i,l;try{let u={nextPage:null,lastPage:0,total:0},d=await te(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(a=t?.page)===null||a===void 0?void 0:a.toString())!==null&&r!==void 0?r:"",per_page:(n=(o=t?.perPage)===null||o===void 0?void 0:o.toString())!==null&&n!==void 0?n:""},xform:MS});if(d.error)throw d.error;let c=await d.json(),f=(s=d.headers.get("x-total-count"))!==null&&s!==void 0?s:0,g=(l=(i=d.headers.get("link"))===null||i===void 0?void 0:i.split(","))!==null&&l!==void 0?l:[];return g.length>0&&(g.forEach(x=>{let w=parseInt(x.split(";")[0].split("=")[1].substring(0,1)),L=JSON.parse(x.split(";")[1].split("=")[1]);u[`${L}Page`]=w}),u.total=parseInt(f)),{data:Object.assign(Object.assign({},c),u),error:null}}catch(u){if(Q(u))return{data:{users:[]},error:u};throw u}}async getUserById(t){en(t);try{return await te(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:Ba})}catch(a){if(Q(a))return{data:{user:null},error:a};throw a}}async updateUserById(t,a){en(t);try{return await te(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:a,headers:this.headers,xform:Ba})}catch(r){if(Q(r))return{data:{user:null},error:r};throw r}}async deleteUser(t,a=!1){en(t);try{return await te(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:a},xform:Ba})}catch(r){if(Q(r))return{data:{user:null},error:r};throw r}}async _listFactors(t){en(t.userId);try{let{data:a,error:r}=await te(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:o=>({data:{factors:o},error:null})});return{data:a,error:r}}catch(a){if(Q(a))return{data:null,error:a};throw a}}async _deleteFactor(t){en(t.userId),en(t.id);try{return{data:await te(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(a){if(Q(a))return{data:null,error:a};throw a}}};function cg(e={}){return{getItem:t=>e[t]||null,setItem:(t,a)=>{e[t]=a},removeItem:t=>{delete e[t]}}}function NS(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}var rn={debug:!!(globalThis&&vc()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")},jl=class extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}},Ic=class extends jl{};async function fg(e,t,a){rn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);let r=new globalThis.AbortController;return t>0&&setTimeout(()=>{r.abort(),rn.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},async o=>{if(o){rn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,o.name);try{return await a()}finally{rn.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,o.name)}}else{if(t===0)throw rn.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new Ic(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(rn.debug)try{let n=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(n,null," "))}catch(n){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",n)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await a()}}))}NS();var G1={url:lS,storageKey:uS,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:dS,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1};async function OS(e,t,a){return await a()}var vs={},on=class e{constructor(t){var a,r;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=e.nextInstanceID,e.nextInstanceID+=1,this.instanceID>0&&ca()&&console.warn("Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.");let o=Object.assign(Object.assign({},G1),t);if(this.logDebugMessages=!!o.debug,typeof o.debug=="function"&&(this.logger=o.debug),this.persistSession=o.persistSession,this.storageKey=o.storageKey,this.autoRefreshToken=o.autoRefreshToken,this.admin=new an({url:o.url,headers:o.headers,fetch:o.fetch}),this.url=o.url,this.headers=o.headers,this.fetch=wc(o.fetch),this.lock=o.lock||OS,this.detectSessionInUrl=o.detectSessionInUrl,this.flowType=o.flowType,this.hasCustomAuthorizationHeader=o.hasCustomAuthorizationHeader,o.lock?this.lock=o.lock:ca()&&(!((a=globalThis?.navigator)===null||a===void 0)&&a.locks)?this.lock=fg:this.lock=OS,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this)},this.persistSession?(o.storage?this.storage=o.storage:vc()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=cg(this.memoryStorage)),o.userStorage&&(this.userStorage=o.userStorage)):(this.memoryStorage={},this.storage=cg(this.memoryStorage)),ca()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(n){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",n)}(r=this.broadcastChannel)===null||r===void 0||r.addEventListener("message",async n=>{this._debug("received broadcast notification from other tab or client",n),await this._notifyAllSubscribers(n.data.event,n.data.session,!1)})}this.initialize()}get jwks(){var t,a;return(a=(t=vs[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&a!==void 0?a:{keys:[]}}set jwks(t){vs[this.storageKey]=Object.assign(Object.assign({},vs[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,a;return(a=(t=vs[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&a!==void 0?a:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){vs[this.storageKey]=Object.assign(Object.assign({},vs[this.storageKey]),{cachedAt:t})}_debug(...t){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${pc}) ${new Date().toISOString()}`,...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{let a=IS(window.location.href),r="none";if(this._isImplicitGrantCallback(a)?r="implicit":await this._isPKCECallback(a)&&(r="pkce"),ca()&&this.detectSessionInUrl&&r!=="none"){let{data:o,error:n}=await this._getSessionFromURL(a,r);if(n){if(this._debug("#_initialize()","error detecting session from URL",n),hS(n)){let l=(t=n.details)===null||t===void 0?void 0:t.code;if(l==="identity_already_exists"||l==="identity_not_found"||l==="single_identity_not_deletable")return{error:n}}return await this._removeSession(),{error:n}}let{session:s,redirectType:i}=o;return this._debug("#_initialize()","detected session in URL",s,"redirect type",i),await this._saveSession(s),setTimeout(async()=>{i==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",s):await this._notifyAllSubscribers("SIGNED_IN",s)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(a){return Q(a)?{error:a}:{error:new ys("Unexpected error during initialization",a)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var a,r,o;try{let n=await te(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(a=t?.options)===null||a===void 0?void 0:a.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:(o=t?.options)===null||o===void 0?void 0:o.captchaToken}},xform:Fa}),{data:s,error:i}=n;if(i||!s)return{data:{user:null,session:null},error:i};let l=s.session,u=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",l)),{data:{user:u,session:l},error:null}}catch(n){if(Q(n))return{data:{user:null,session:null},error:n};throw n}}async signUp(t){var a,r,o;try{let n;if("email"in t){let{email:d,password:c,options:f}=t,g=null,x=null;this.flowType==="pkce"&&([g,x]=await Zo(this.storage,this.storageKey)),n=await te(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:f?.emailRedirectTo,body:{email:d,password:c,data:(a=f?.data)!==null&&a!==void 0?a:{},gotrue_meta_security:{captcha_token:f?.captchaToken},code_challenge:g,code_challenge_method:x},xform:Fa})}else if("phone"in t){let{phone:d,password:c,options:f}=t;n=await te(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:d,password:c,data:(r=f?.data)!==null&&r!==void 0?r:{},channel:(o=f?.channel)!==null&&o!==void 0?o:"sms",gotrue_meta_security:{captcha_token:f?.captchaToken}},xform:Fa})}else throw new Ko("You must provide either an email or phone number and a password");let{data:s,error:i}=n;if(i||!s)return{data:{user:null,session:null},error:i};let l=s.session,u=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",l)),{data:{user:u,session:l},error:null}}catch(n){if(Q(n))return{data:{user:null,session:null},error:n};throw n}}async signInWithPassword(t){try{let a;if("email"in t){let{email:n,password:s,options:i}=t;a=await te(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:n,password:s,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:dg})}else if("phone"in t){let{phone:n,password:s,options:i}=t;a=await te(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:n,password:s,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:dg})}else throw new Ko("You must provide either an email or phone number and a password");let{data:r,error:o}=a;return o?{data:{user:null,session:null},error:o}:!r||!r.session||!r.user?{data:{user:null,session:null},error:new Go}:(r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),{data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:o})}catch(a){if(Q(a))return{data:{user:null,session:null},error:a};throw a}}async signInWithOAuth(t){var a,r,o,n;return await this._handleProviderSignIn(t.provider,{redirectTo:(a=t.options)===null||a===void 0?void 0:a.redirectTo,scopes:(r=t.options)===null||r===void 0?void 0:r.scopes,queryParams:(o=t.options)===null||o===void 0?void 0:o.queryParams,skipBrowserRedirect:(n=t.options)===null||n===void 0?void 0:n.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){let{chain:a}=t;if(a==="solana")return await this.signInWithSolana(t);throw new Error(`@supabase/auth-js: Unsupported chain "${a}"`)}async signInWithSolana(t){var a,r,o,n,s,i,l,u,d,c,f,g;let x,w;if("message"in t)x=t.message,w=t.signature;else{let{chain:L,wallet:y,statement:h,options:m}=t,C;if(ca())if(typeof y=="object")C=y;else{let P=window;if("solana"in P&&typeof P.solana=="object"&&("signIn"in P.solana&&typeof P.solana.signIn=="function"||"signMessage"in P.solana&&typeof P.solana.signMessage=="function"))C=P.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof y!="object"||!m?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");C=y}let I=new URL((a=m?.url)!==null&&a!==void 0?a:window.location.href);if("signIn"in C&&C.signIn){let P=await C.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},m?.signInWithSolana),{version:"1",domain:I.host,uri:I.href}),h?{statement:h}:null)),R;if(Array.isArray(P)&&P[0]&&typeof P[0]=="object")R=P[0];else if(P&&typeof P=="object"&&"signedMessage"in P&&"signature"in P)R=P;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in R&&"signature"in R&&(typeof R.signedMessage=="string"||R.signedMessage instanceof Uint8Array)&&R.signature instanceof Uint8Array)x=typeof R.signedMessage=="string"?R.signedMessage:new TextDecoder().decode(R.signedMessage),w=R.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in C)||typeof C.signMessage!="function"||!("publicKey"in C)||typeof C!="object"||!C.publicKey||!("toBase58"in C.publicKey)||typeof C.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");x=[`${I.host} wants you to sign in with your Solana account:`,C.publicKey.toBase58(),...h?["",h,""]:[""],"Version: 1",`URI: ${I.href}`,`Issued At: ${(o=(r=m?.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&o!==void 0?o:new Date().toISOString()}`,...!((n=m?.signInWithSolana)===null||n===void 0)&&n.notBefore?[`Not Before: ${m.signInWithSolana.notBefore}`]:[],...!((s=m?.signInWithSolana)===null||s===void 0)&&s.expirationTime?[`Expiration Time: ${m.signInWithSolana.expirationTime}`]:[],...!((i=m?.signInWithSolana)===null||i===void 0)&&i.chainId?[`Chain ID: ${m.signInWithSolana.chainId}`]:[],...!((l=m?.signInWithSolana)===null||l===void 0)&&l.nonce?[`Nonce: ${m.signInWithSolana.nonce}`]:[],...!((u=m?.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${m.signInWithSolana.requestId}`]:[],...!((c=(d=m?.signInWithSolana)===null||d===void 0?void 0:d.resources)===null||c===void 0)&&c.length?["Resources",...m.signInWithSolana.resources.map(R=>`- ${R}`)]:[]].join(`
15
- `);let P=await C.signMessage(new TextEncoder().encode(x),"utf8");if(!P||!(P instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");w=P}}try{let{data:L,error:y}=await te(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:x,signature:SS(w)},!((f=t.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(g=t.options)===null||g===void 0?void 0:g.captchaToken}}:null),xform:Fa});if(y)throw y;return!L||!L.session||!L.user?{data:{user:null,session:null},error:new Go}:(L.session&&(await this._saveSession(L.session),await this._notifyAllSubscribers("SIGNED_IN",L.session)),{data:Object.assign({},L),error:y})}catch(L){if(Q(L))return{data:{user:null,session:null},error:L};throw L}}async _exchangeCodeForSession(t){let a=await Jr(this.storage,`${this.storageKey}-code-verifier`),[r,o]=(a??"").split("/");try{let{data:n,error:s}=await te(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:r},xform:Fa});if(await lr(this.storage,`${this.storageKey}-code-verifier`),s)throw s;return!n||!n.session||!n.user?{data:{user:null,session:null,redirectType:null},error:new Go}:(n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),{data:Object.assign(Object.assign({},n),{redirectType:o??null}),error:s})}catch(n){if(Q(n))return{data:{user:null,session:null,redirectType:null},error:n};throw n}}async signInWithIdToken(t){try{let{options:a,provider:r,token:o,access_token:n,nonce:s}=t,i=await te(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:o,access_token:n,nonce:s,gotrue_meta_security:{captcha_token:a?.captchaToken}},xform:Fa}),{data:l,error:u}=i;return u?{data:{user:null,session:null},error:u}:!l||!l.session||!l.user?{data:{user:null,session:null},error:new Go}:(l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),{data:l,error:u})}catch(a){if(Q(a))return{data:{user:null,session:null},error:a};throw a}}async signInWithOtp(t){var a,r,o,n,s;try{if("email"in t){let{email:i,options:l}=t,u=null,d=null;this.flowType==="pkce"&&([u,d]=await Zo(this.storage,this.storageKey));let{error:c}=await te(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:i,data:(a=l?.data)!==null&&a!==void 0?a:{},create_user:(r=l?.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:l?.captchaToken},code_challenge:u,code_challenge_method:d},redirectTo:l?.emailRedirectTo});return{data:{user:null,session:null},error:c}}if("phone"in t){let{phone:i,options:l}=t,{data:u,error:d}=await te(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:i,data:(o=l?.data)!==null&&o!==void 0?o:{},create_user:(n=l?.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:l?.captchaToken},channel:(s=l?.channel)!==null&&s!==void 0?s:"sms"}});return{data:{user:null,session:null,messageId:u?.message_id},error:d}}throw new Ko("You must provide either an email or phone number.")}catch(i){if(Q(i))return{data:{user:null,session:null},error:i};throw i}}async verifyOtp(t){var a,r;try{let o,n;"options"in t&&(o=(a=t.options)===null||a===void 0?void 0:a.redirectTo,n=(r=t.options)===null||r===void 0?void 0:r.captchaToken);let{data:s,error:i}=await te(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:n}}),redirectTo:o,xform:Fa});if(i)throw i;if(!s)throw new Error("An error occurred on token verification.");let l=s.session,u=s.user;return l?.access_token&&(await this._saveSession(l),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",l)),{data:{user:u,session:l},error:null}}catch(o){if(Q(o))return{data:{user:null,session:null},error:o};throw o}}async signInWithSSO(t){var a,r,o;try{let n=null,s=null;return this.flowType==="pkce"&&([n,s]=await Zo(this.storage,this.storageKey)),await te(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(r=(a=t.options)===null||a===void 0?void 0:a.redirectTo)!==null&&r!==void 0?r:void 0}),!((o=t?.options)===null||o===void 0)&&o.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:n,code_challenge_method:s}),headers:this.headers,xform:ES})}catch(n){if(Q(n))return{data:null,error:n};throw n}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{let{data:{session:a},error:r}=t;if(r)throw r;if(!a)throw new da;let{error:o}=await te(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:a.access_token});return{data:{user:null,session:null},error:o}})}catch(t){if(Q(t))return{data:{user:null,session:null},error:t};throw t}}async resend(t){try{let a=`${this.url}/resend`;if("email"in t){let{email:r,type:o,options:n}=t,{error:s}=await te(this.fetch,"POST",a,{headers:this.headers,body:{email:r,type:o,gotrue_meta_security:{captcha_token:n?.captchaToken}},redirectTo:n?.emailRedirectTo});return{data:{user:null,session:null},error:s}}else if("phone"in t){let{phone:r,type:o,options:n}=t,{data:s,error:i}=await te(this.fetch,"POST",a,{headers:this.headers,body:{phone:r,type:o,gotrue_meta_security:{captcha_token:n?.captchaToken}}});return{data:{user:null,session:null,messageId:s?.message_id},error:i}}throw new Ko("You must provide either an email or phone number and a type")}catch(a){if(Q(a))return{data:{user:null,session:null},error:a};throw a}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async a=>a))}async _acquireLock(t,a){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){let r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),o=(async()=>(await r,await a()))();return this.pendingInLock.push((async()=>{try{await o}catch{}})()),o}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;let r=a();for(this.pendingInLock.push((async()=>{try{await r}catch{}})()),await r;this.pendingInLock.length;){let o=[...this.pendingInLock];await Promise.all(o),this.pendingInLock.splice(0,o.length)}return await r}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{let a=await this.__loadSession();return await t(a)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null,a=await Jr(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",a),a!==null&&(this._isValidSession(a)?t=a:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!t)return{data:{session:null},error:null};let r=t.expires_at?t.expires_at*1e3-Date.now()<hc:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",t.expires_at),!r){if(this.userStorage){let s=await Jr(this.userStorage,this.storageKey+"-user");s?.user?t.user=s.user:t.user=Cc()}if(this.storage.isServer&&t.user){let s=this.suppressGetSessionWarning;t=new Proxy(t,{get:(l,u,d)=>(!s&&u==="user"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),s=!0,this.suppressGetSessionWarning=!0),Reflect.get(l,u,d))})}return{data:{session:t},error:null}}let{session:o,error:n}=await this._callRefreshToken(t.refresh_token);return n?{data:{session:null},error:n}:{data:{session:o},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(t){return t?await this._getUser(t):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(t){try{return t?await te(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:Ba}):await this._useSession(async a=>{var r,o,n;let{data:s,error:i}=a;if(i)throw i;return!(!((r=s.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new da}:await te(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(n=(o=s.session)===null||o===void 0?void 0:o.access_token)!==null&&n!==void 0?n:void 0,xform:Ba})})}catch(a){if(Q(a))return mS(a)&&(await this._removeSession(),await lr(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:a};throw a}}async updateUser(t,a={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(t,a))}async _updateUser(t,a={}){try{return await this._useSession(async r=>{let{data:o,error:n}=r;if(n)throw n;if(!o.session)throw new da;let s=o.session,i=null,l=null;this.flowType==="pkce"&&t.email!=null&&([i,l]=await Zo(this.storage,this.storageKey));let{data:u,error:d}=await te(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:a?.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:i,code_challenge_method:l}),jwt:s.access_token,xform:Ba});if(d)throw d;return s.user=u.user,await this._saveSession(s),await this._notifyAllSubscribers("USER_UPDATED",s),{data:{user:s.user},error:null}})}catch(r){if(Q(r))return{data:{user:null},error:r};throw r}}async setSession(t){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new da;let a=Date.now()/1e3,r=a,o=!0,n=null,{payload:s}=Sc(t.access_token);if(s.exp&&(r=s.exp,o=r<=a),o){let{session:i,error:l}=await this._callRefreshToken(t.refresh_token);if(l)return{data:{user:null,session:null},error:l};if(!i)return{data:{user:null,session:null},error:null};n=i}else{let{data:i,error:l}=await this._getUser(t.access_token);if(l)throw l;n={access_token:t.access_token,refresh_token:t.refresh_token,user:i.user,token_type:"bearer",expires_in:r-a,expires_at:r},await this._saveSession(n),await this._notifyAllSubscribers("SIGNED_IN",n)}return{data:{user:n.user,session:n},error:null}}catch(a){if(Q(a))return{data:{session:null,user:null},error:a};throw a}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async a=>{var r;if(!t){let{data:s,error:i}=a;if(i)throw i;t=(r=s.session)!==null&&r!==void 0?r:void 0}if(!t?.refresh_token)throw new da;let{session:o,error:n}=await this._callRefreshToken(t.refresh_token);return n?{data:{user:null,session:null},error:n}:o?{data:{user:o.user,session:o},error:null}:{data:{user:null,session:null},error:null}})}catch(a){if(Q(a))return{data:{user:null,session:null},error:a};throw a}}async _getSessionFromURL(t,a){try{if(!ca())throw new Xo("No browser detected.");if(t.error||t.error_description||t.error_code)throw new Xo(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(a){case"implicit":if(this.flowType==="pkce")throw new Bl("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Xo("Not a valid implicit grant flow url.");break;default:}if(a==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new Bl("No code detected.");let{data:h,error:m}=await this._exchangeCodeForSession(t.code);if(m)throw m;let C=new URL(window.location.href);return C.searchParams.delete("code"),window.history.replaceState(window.history.state,"",C.toString()),{data:{session:h.session,redirectType:null},error:null}}let{provider_token:r,provider_refresh_token:o,access_token:n,refresh_token:s,expires_in:i,expires_at:l,token_type:u}=t;if(!n||!i||!s||!u)throw new Xo("No session defined in URL");let d=Math.round(Date.now()/1e3),c=parseInt(i),f=d+c;l&&(f=parseInt(l));let g=f-d;g*1e3<=Wo&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${g}s, should have been closer to ${c}s`);let x=f-c;d-x>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",x,f,d):d-x<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",x,f,d);let{data:w,error:L}=await this._getUser(n);if(L)throw L;let y={provider_token:r,provider_refresh_token:o,access_token:n,expires_in:c,expires_at:f,refresh_token:s,token_type:u,user:w.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:y,redirectType:t.type},error:null}}catch(r){if(Q(r))return{data:{session:null,redirectType:null},error:r};throw r}}_isImplicitGrantCallback(t){return!!(t.access_token||t.error_description)}async _isPKCECallback(t){let a=await Jr(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&a)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async a=>{var r;let{data:o,error:n}=a;if(n)return{error:n};let s=(r=o.session)===null||r===void 0?void 0:r.access_token;if(s){let{error:i}=await this.admin.signOut(s,t);if(i&&!(pS(i)&&(i.status===404||i.status===401||i.status===403)))return{error:i}}return t!=="others"&&(await this._removeSession(),await lr(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(t){let a=LS(),r={id:a,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",a),this.stateChangeEmitters.delete(a)}};return this._debug("#onAuthStateChange()","registered callback with id",a),this.stateChangeEmitters.set(a,r),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(a)})))(),{data:{subscription:r}}}async _emitInitialSession(t){return await this._useSession(async a=>{var r,o;try{let{data:{session:n},error:s}=a;if(s)throw s;await((r=this.stateChangeEmitters.get(t))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",n)),this._debug("INITIAL_SESSION","callback id",t,"session",n)}catch(n){await((o=this.stateChangeEmitters.get(t))===null||o===void 0?void 0:o.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",n),console.error(n)}})}async resetPasswordForEmail(t,a={}){let r=null,o=null;this.flowType==="pkce"&&([r,o]=await Zo(this.storage,this.storageKey,!0));try{return await te(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:r,code_challenge_method:o,gotrue_meta_security:{captcha_token:a.captchaToken}},headers:this.headers,redirectTo:a.redirectTo})}catch(n){if(Q(n))return{data:null,error:n};throw n}}async getUserIdentities(){var t;try{let{data:a,error:r}=await this.getUser();if(r)throw r;return{data:{identities:(t=a.user.identities)!==null&&t!==void 0?t:[]},error:null}}catch(a){if(Q(a))return{data:null,error:a};throw a}}async linkIdentity(t){var a;try{let{data:r,error:o}=await this._useSession(async n=>{var s,i,l,u,d;let{data:c,error:f}=n;if(f)throw f;let g=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(s=t.options)===null||s===void 0?void 0:s.redirectTo,scopes:(i=t.options)===null||i===void 0?void 0:i.scopes,queryParams:(l=t.options)===null||l===void 0?void 0:l.queryParams,skipBrowserRedirect:!0});return await te(this.fetch,"GET",g,{headers:this.headers,jwt:(d=(u=c.session)===null||u===void 0?void 0:u.access_token)!==null&&d!==void 0?d:void 0})});if(o)throw o;return ca()&&!(!((a=t.options)===null||a===void 0)&&a.skipBrowserRedirect)&&window.location.assign(r?.url),{data:{provider:t.provider,url:r?.url},error:null}}catch(r){if(Q(r))return{data:{provider:t.provider,url:null},error:r};throw r}}async unlinkIdentity(t){try{return await this._useSession(async a=>{var r,o;let{data:n,error:s}=a;if(s)throw s;return await te(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(o=(r=n.session)===null||r===void 0?void 0:r.access_token)!==null&&o!==void 0?o:void 0})})}catch(a){if(Q(a))return{data:null,error:a};throw a}}async _refreshAccessToken(t){let a=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(a,"begin");try{let r=Date.now();return await PS(async o=>(o>0&&await kS(200*Math.pow(2,o-1)),this._debug(a,"refreshing attempt",o),await te(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:Fa})),(o,n)=>{let s=200*Math.pow(2,o);return n&&yc(n)&&Date.now()+s-r<Wo})}catch(r){if(this._debug(a,"error",r),Q(r))return{data:{session:null,user:null},error:r};throw r}finally{this._debug(a,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,a){let r=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:a.redirectTo,scopes:a.scopes,queryParams:a.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",a,"url",r),ca()&&!a.skipBrowserRedirect&&window.location.assign(r),{data:{provider:t,url:r},error:null}}async _recoverAndRefresh(){var t,a;let r="#_recoverAndRefresh()";this._debug(r,"begin");try{let o=await Jr(this.storage,this.storageKey);if(o&&this.userStorage){let s=await Jr(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!s&&(s={user:o.user},await Yo(this.userStorage,this.storageKey+"-user",s)),o.user=(t=s?.user)!==null&&t!==void 0?t:Cc()}else if(o&&!o.user&&!o.user){let s=await Jr(this.storage,this.storageKey+"-user");s&&s?.user?(o.user=s.user,await lr(this.storage,this.storageKey+"-user"),await Yo(this.storage,this.storageKey,o)):o.user=Cc()}if(this._debug(r,"session from storage",o),!this._isValidSession(o)){this._debug(r,"session is not valid"),o!==null&&await this._removeSession();return}let n=((a=o.expires_at)!==null&&a!==void 0?a:1/0)*1e3-Date.now()<hc;if(this._debug(r,`session has${n?"":" not"} expired with margin of ${hc}s`),n){if(this.autoRefreshToken&&o.refresh_token){let{error:s}=await this._callRefreshToken(o.refresh_token);s&&(console.error(s),yc(s)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",s),await this._removeSession()))}}else if(o.user&&o.user.__isUserNotAvailableProxy===!0)try{let{data:s,error:i}=await this._getUser(o.access_token);!i&&s?.user?(o.user=s.user,await this._saveSession(o),await this._notifyAllSubscribers("SIGNED_IN",o)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(s){console.error("Error getting user data:",s),this._debug(r,"error getting user data, skipping SIGNED_IN notification",s)}else await this._notifyAllSubscribers("SIGNED_IN",o)}catch(o){this._debug(r,"error",o),console.error(o);return}finally{this._debug(r,"end")}}async _callRefreshToken(t){var a,r;if(!t)throw new da;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let o=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(o,"begin");try{this.refreshingDeferred=new Vl;let{data:n,error:s}=await this._refreshAccessToken(t);if(s)throw s;if(!n.session)throw new da;await this._saveSession(n.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",n.session);let i={session:n.session,error:null};return this.refreshingDeferred.resolve(i),i}catch(n){if(this._debug(o,"error",n),Q(n)){let s={session:null,error:n};return yc(n)||await this._removeSession(),(a=this.refreshingDeferred)===null||a===void 0||a.resolve(s),s}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(n),n}finally{this.refreshingDeferred=null,this._debug(o,"end")}}async _notifyAllSubscribers(t,a,r=!0){let o=`#_notifyAllSubscribers(${t})`;this._debug(o,"begin",a,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:t,session:a});let n=[],s=Array.from(this.stateChangeEmitters.values()).map(async i=>{try{await i.callback(t,a)}catch(l){n.push(l)}});if(await Promise.all(s),n.length>0){for(let i=0;i<n.length;i+=1)console.error(n[i]);throw n[0]}}finally{this._debug(o,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0;let a=Object.assign({},t),r=a.user&&a.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!r&&a.user&&await Yo(this.userStorage,this.storageKey+"-user",{user:a.user});let o=Object.assign({},a);delete o.user;let n=ug(o);await Yo(this.storage,this.storageKey,n)}else{let o=ug(a);await Yo(this.storage,this.storageKey,o)}}async _removeSession(){this._debug("#_removeSession()"),await lr(this.storage,this.storageKey),await lr(this.storage,this.storageKey+"-code-verifier"),await lr(this.storage,this.storageKey+"-user"),this.userStorage&&await lr(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");let t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&ca()&&window?.removeEventListener&&window.removeEventListener("visibilitychange",t)}catch(a){console.error("removing visibilitychange callback failed",a)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");let t=setInterval(()=>this._autoRefreshTokenTick(),Wo);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");let t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{let t=Date.now();try{return await this._useSession(async a=>{let{data:{session:r}}=a;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}let o=Math.floor((r.expires_at*1e3-t)/Wo);this._debug("#_autoRefreshTokenTick()",`access token expires in ${o} ticks, a tick lasts ${Wo}ms, refresh threshold is ${mc} ticks`),o<=mc&&await this._callRefreshToken(r.refresh_token)})}catch(a){console.error("Auto refresh tick failed with error. This is likely a transient error.",a)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t.isAcquireTimeout||t instanceof jl)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!ca()||!window?.addEventListener)return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window?.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){let a=`#_onVisibilityChanged(${t})`;this._debug(a,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(a,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(t,a,r){let o=[`provider=${encodeURIComponent(a)}`];if(r?.redirectTo&&o.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r?.scopes&&o.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){let[n,s]=await Zo(this.storage,this.storageKey),i=new URLSearchParams({code_challenge:`${encodeURIComponent(n)}`,code_challenge_method:`${encodeURIComponent(s)}`});o.push(i.toString())}if(r?.queryParams){let n=new URLSearchParams(r.queryParams);o.push(n.toString())}return r?.skipBrowserRedirect&&o.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${t}?${o.join("&")}`}async _unenroll(t){try{return await this._useSession(async a=>{var r;let{data:o,error:n}=a;return n?{data:null,error:n}:await te(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(r=o?.session)===null||r===void 0?void 0:r.access_token})})}catch(a){if(Q(a))return{data:null,error:a};throw a}}async _enroll(t){try{return await this._useSession(async a=>{var r,o;let{data:n,error:s}=a;if(s)return{data:null,error:s};let i=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:{issuer:t.issuer}),{data:l,error:u}=await te(this.fetch,"POST",`${this.url}/factors`,{body:i,headers:this.headers,jwt:(r=n?.session)===null||r===void 0?void 0:r.access_token});return u?{data:null,error:u}:(t.factorType==="totp"&&(!((o=l?.totp)===null||o===void 0)&&o.qr_code)&&(l.totp.qr_code=`data:image/svg+xml;utf-8,${l.totp.qr_code}`),{data:l,error:null})})}catch(a){if(Q(a))return{data:null,error:a};throw a}}async _verify(t){return this._acquireLock(-1,async()=>{try{return await this._useSession(async a=>{var r;let{data:o,error:n}=a;if(n)return{data:null,error:n};let{data:s,error:i}=await te(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:{code:t.code,challenge_id:t.challengeId},headers:this.headers,jwt:(r=o?.session)===null||r===void 0?void 0:r.access_token});return i?{data:null,error:i}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+s.expires_in},s)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",s),{data:s,error:i})})}catch(a){if(Q(a))return{data:null,error:a};throw a}})}async _challenge(t){return this._acquireLock(-1,async()=>{try{return await this._useSession(async a=>{var r;let{data:o,error:n}=a;return n?{data:null,error:n}:await te(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:{channel:t.channel},headers:this.headers,jwt:(r=o?.session)===null||r===void 0?void 0:r.access_token})})}catch(a){if(Q(a))return{data:null,error:a};throw a}})}async _challengeAndVerify(t){let{data:a,error:r}=await this._challenge({factorId:t.factorId});return r?{data:null,error:r}:await this._verify({factorId:t.factorId,challengeId:a.id,code:t.code})}async _listFactors(){let{data:{user:t},error:a}=await this.getUser();if(a)return{data:null,error:a};let r=t?.factors||[],o=r.filter(s=>s.factor_type==="totp"&&s.status==="verified"),n=r.filter(s=>s.factor_type==="phone"&&s.status==="verified");return{data:{all:r,totp:o,phone:n},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async t=>{var a,r;let{data:{session:o},error:n}=t;if(n)return{data:null,error:n};if(!o)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let{payload:s}=Sc(o.access_token),i=null;s.aal&&(i=s.aal);let l=i;((r=(a=o.user.factors)===null||a===void 0?void 0:a.filter(c=>c.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(l="aal2");let d=s.amr||[];return{data:{currentLevel:i,nextLevel:l,currentAuthenticationMethods:d},error:null}}))}async fetchJwk(t,a={keys:[]}){let r=a.keys.find(i=>i.kid===t);if(r)return r;let o=Date.now();if(r=this.jwks.keys.find(i=>i.kid===t),r&&this.jwks_cached_at+fS>o)return r;let{data:n,error:s}=await te(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(s)throw s;return!n.keys||n.keys.length===0||(this.jwks=n,this.jwks_cached_at=o,r=n.keys.find(i=>i.kid===t),!r)?null:r}async getClaims(t,a={}){try{let r=t;if(!r){let{data:g,error:x}=await this.getSession();if(x||!g.session)return{data:null,error:x};r=g.session.access_token}let{header:o,payload:n,signature:s,raw:{header:i,payload:l}}=Sc(r);a?.allowExpired||AS(n.exp);let u=!o.alg||o.alg.startsWith("HS")||!o.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(o.kid,a?.keys?{keys:a.keys}:a?.jwks);if(!u){let{error:g}=await this.getUser(r);if(g)throw g;return{data:{claims:n,header:o,signature:s},error:null}}let d=RS(o.alg),c=await crypto.subtle.importKey("jwk",u,d,!0,["verify"]);if(!await crypto.subtle.verify(d,c,s,wS(`${i}.${l}`)))throw new Qo("Invalid JWT signature");return{data:{claims:n,header:o,signature:s},error:null}}catch(r){if(Q(r))return{data:null,error:r};throw r}}};on.nextInstanceID=0;var K1=on,pg=K1;var bc=class extends pg{constructor(t){super(t)}};var X1=function(e,t,a,r){function o(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function i(d){try{u(r.next(d))}catch(c){s(c)}}function l(d){try{u(r.throw(d))}catch(c){s(c)}}function u(d){d.done?n(d.value):o(d.value).then(i,l)}u((r=r.apply(e,t||[])).next())})},ql=class{constructor(t,a,r){var o,n,s;if(this.supabaseUrl=t,this.supabaseKey=a,!t)throw new Error("supabaseUrl is required.");if(!a)throw new Error("supabaseKey is required.");let i=sS(t),l=new URL(i);this.realtimeUrl=new URL("realtime/v1",l),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",l),this.storageUrl=new URL("storage/v1",l),this.functionsUrl=new URL("functions/v1",l);let u=`sb-${l.hostname.split(".")[0]}-auth-token`,d={db:aS,realtime:oS,auth:Object.assign(Object.assign({},rS),{storageKey:u}),global:tS},c=iS(r??{},d);this.storageKey=(o=c.auth.storageKey)!==null&&o!==void 0?o:"",this.headers=(n=c.global.headers)!==null&&n!==void 0?n:{},c.accessToken?(this.accessToken=c.accessToken,this.auth=new Proxy({},{get:(f,g)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(g)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((s=c.auth)!==null&&s!==void 0?s:{},this.headers,c.global.fetch),this.fetch=nS(a,this._getAccessToken.bind(this),c.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},c.realtime)),this.rest=new Uw(new URL("rest/v1",l).href,{headers:this.headers,schema:c.db.schema,fetch:this.fetch}),this.storage=new Ml(this.storageUrl.href,this.headers,this.fetch,r?.storage),c.accessToken||this._listenForAuthEvents()}get functions(){return new Cl(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(t){return this.rest.from(t)}schema(t){return this.rest.schema(t)}rpc(t,a={},r={}){return this.rest.rpc(t,a,r)}channel(t,a={config:{}}){return this.realtime.channel(t,a)}getChannels(){return this.realtime.getChannels()}removeChannel(t){return this.realtime.removeChannel(t)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var t,a;return X1(this,void 0,void 0,function*(){if(this.accessToken)return yield this.accessToken();let{data:r}=yield this.auth.getSession();return(a=(t=r.session)===null||t===void 0?void 0:t.access_token)!==null&&a!==void 0?a:null})}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:a,detectSessionInUrl:r,storage:o,storageKey:n,flowType:s,lock:i,debug:l},u,d){let c={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new bc({url:this.authUrl.href,headers:Object.assign(Object.assign({},c),u),storageKey:n,autoRefreshToken:t,persistSession:a,detectSessionInUrl:r,storage:o,flowType:s,lock:i,debug:l,fetch:d,hasCustomAuthorizationHeader:"Authorization"in this.headers})}_initRealtimeClient(t){return new ps(this.realtimeUrl.href,Object.assign(Object.assign({},t),{params:Object.assign({apikey:this.supabaseKey},t?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((a,r)=>{this._handleTokenChanged(a,"CLIENT",r?.access_token)})}_handleTokenChanged(t,a,r){(t==="TOKEN_REFRESHED"||t==="SIGNED_IN")&&this.changedAccessToken!==r?this.changedAccessToken=r:t==="SIGNED_OUT"&&(this.realtime.setAuth(),a=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};var FS=(e,t,a)=>new ql(e,t,a);function Q1(){if(typeof window<"u"||typeof process>"u"||process.version===void 0||process.version===null)return!1;let e=process.version.match(/^v(\d+)\./);return e?parseInt(e[1],10)<=18:!1}Q1()&&console.warn("\u26A0\uFE0F Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");function BS(e){var t,a,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(a=BS(e[t]))&&(r&&(r+=" "),r+=a)}else for(a in e)e[a]&&(r&&(r+=" "),r+=a);return r}function kc(){for(var e,t,a=0,r="",o=arguments.length;a<o;a++)(e=arguments[a])&&(t=BS(e))&&(r&&(r+=" "),r+=t);return r}var J1=e=>{let t=Z1(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{let i=s.split("-");return i[0]===""&&i.length!==1&&i.shift(),jS(i,t)||Y1(s)},getConflictingClassGroupIds:(s,i)=>{let l=a[s]||[];return i&&r[s]?[...l,...r[s]]:l}}},jS=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],r=t.nextPart.get(a),o=r?jS(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;let n=e.join("-");return t.validators.find(({validator:s})=>s(n))?.classGroupId},US=/^\[(.+)\]$/,Y1=e=>{if(US.test(e)){let t=US.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},Z1=e=>{let{theme:t,prefix:a}=e,r={nextPart:new Map,validators:[]};return tA(Object.entries(e.classGroups),a).forEach(([n,s])=>{hg(s,r,n,t)}),r},hg=(e,t,a,r)=>{e.forEach(o=>{if(typeof o=="string"){let n=o===""?t:VS(t,o);n.classGroupId=a;return}if(typeof o=="function"){if(eA(o)){hg(o(r),t,a,r);return}t.validators.push({validator:o,classGroupId:a});return}Object.entries(o).forEach(([n,s])=>{hg(s,VS(t,n),a,r)})})},VS=(e,t)=>{let a=e;return t.split("-").forEach(r=>{a.nextPart.has(r)||a.nextPart.set(r,{nextPart:new Map,validators:[]}),a=a.nextPart.get(r)}),a},eA=e=>e.isThemeGetter,tA=(e,t)=>t?e.map(([a,r])=>{let o=r.map(n=>typeof n=="string"?t+n:typeof n=="object"?Object.fromEntries(Object.entries(n).map(([s,i])=>[t+s,i])):n);return[a,o]}):e,aA=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,r=new Map,o=(n,s)=>{a.set(n,s),t++,t>e&&(t=0,r=a,a=new Map)};return{get(n){let s=a.get(n);if(s!==void 0)return s;if((s=r.get(n))!==void 0)return o(n,s),s},set(n,s){a.has(n)?a.set(n,s):o(n,s)}}};var rA=e=>{let{separator:t,experimentalParseClassName:a}=e,r=t.length===1,o=t[0],n=t.length,s=i=>{let l=[],u=0,d=0,c;for(let L=0;L<i.length;L++){let y=i[L];if(u===0){if(y===o&&(r||i.slice(L,L+n)===t)){l.push(i.slice(d,L)),d=L+n;continue}if(y==="/"){c=L;continue}}y==="["?u++:y==="]"&&u--}let f=l.length===0?i:i.substring(d),g=f.startsWith("!"),x=g?f.substring(1):f,w=c&&c>d?c-d:void 0;return{modifiers:l,hasImportantModifier:g,baseClassName:x,maybePostfixModifierPosition:w}};return a?i=>a({className:i,parseClassName:s}):s},oA=e=>{if(e.length<=1)return e;let t=[],a=[];return e.forEach(r=>{r[0]==="["?(t.push(...a.sort(),r),a=[]):a.push(r)}),t.push(...a.sort()),t},nA=e=>({cache:aA(e.cacheSize),parseClassName:rA(e),...J1(e)}),sA=/\s+/,iA=(e,t)=>{let{parseClassName:a,getClassGroupId:r,getConflictingClassGroupIds:o}=t,n=[],s=e.trim().split(sA),i="";for(let l=s.length-1;l>=0;l-=1){let u=s[l],{modifiers:d,hasImportantModifier:c,baseClassName:f,maybePostfixModifierPosition:g}=a(u),x=!!g,w=r(x?f.substring(0,g):f);if(!w){if(!x){i=u+(i.length>0?" "+i:i);continue}if(w=r(f),!w){i=u+(i.length>0?" "+i:i);continue}x=!1}let L=oA(d).join(":"),y=c?L+"!":L,h=y+w;if(n.includes(h))continue;n.push(h);let m=o(w,x);for(let C=0;C<m.length;++C){let I=m[C];n.push(y+I)}i=u+(i.length>0?" "+i:i)}return i};function lA(){let e=0,t,a,r="";for(;e<arguments.length;)(t=arguments[e++])&&(a=qS(t))&&(r&&(r+=" "),r+=a);return r}var qS=e=>{if(typeof e=="string")return e;let t,a="";for(let r=0;r<e.length;r++)e[r]&&(t=qS(e[r]))&&(a&&(a+=" "),a+=t);return a};function uA(e,...t){let a,r,o,n=s;function s(l){let u=t.reduce((d,c)=>c(d),e());return a=nA(u),r=a.cache.get,o=a.cache.set,n=i,i(l)}function i(l){let u=r(l);if(u)return u;let d=iA(l,a);return o(l,d),d}return function(){return n(lA.apply(null,arguments))}}var ke=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},HS=/^\[(?:([a-z-]+):)?(.+)\]$/i,dA=/^\d+\/\d+$/,cA=new Set(["px","full","screen"]),fA=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,pA=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,mA=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,hA=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,gA=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ur=e=>ws(e)||cA.has(e)||dA.test(e),Yr=e=>Ss(e,"length",IA),ws=e=>!!e&&!Number.isNaN(Number(e)),mg=e=>Ss(e,"number",ws),Hl=e=>!!e&&Number.isInteger(Number(e)),yA=e=>e.endsWith("%")&&ws(e.slice(0,-1)),Z=e=>HS.test(e),Zr=e=>fA.test(e),xA=new Set(["length","size","percentage"]),vA=e=>Ss(e,xA,zS),wA=e=>Ss(e,"position",zS),SA=new Set(["image","url"]),CA=e=>Ss(e,SA,kA),LA=e=>Ss(e,"",bA),zl=()=>!0,Ss=(e,t,a)=>{let r=HS.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):a(r[2]):!1},IA=e=>pA.test(e)&&!mA.test(e),zS=()=>!1,bA=e=>hA.test(e),kA=e=>gA.test(e);var PA=()=>{let e=ke("colors"),t=ke("spacing"),a=ke("blur"),r=ke("brightness"),o=ke("borderColor"),n=ke("borderRadius"),s=ke("borderSpacing"),i=ke("borderWidth"),l=ke("contrast"),u=ke("grayscale"),d=ke("hueRotate"),c=ke("invert"),f=ke("gap"),g=ke("gradientColorStops"),x=ke("gradientColorStopPositions"),w=ke("inset"),L=ke("margin"),y=ke("opacity"),h=ke("padding"),m=ke("saturate"),C=ke("scale"),I=ke("sepia"),P=ke("skew"),R=ke("space"),A=ke("translate"),q=()=>["auto","contain","none"],U=()=>["auto","hidden","clip","visible","scroll"],J=()=>["auto",Z,t],ue=()=>[Z,t],pt=()=>["",ur,Yr],Xa=()=>["auto",ws,Z],So=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Ke=()=>["solid","dashed","dotted","double","none"],xe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ze=()=>["start","end","center","between","around","evenly","stretch"],Ht=()=>["","0",Z],ma=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Xe=()=>[ws,Z];return{cacheSize:500,separator:":",theme:{colors:[zl],spacing:[ur,Yr],blur:["none","",Zr,Z],brightness:Xe(),borderColor:[e],borderRadius:["none","","full",Zr,Z],borderSpacing:ue(),borderWidth:pt(),contrast:Xe(),grayscale:Ht(),hueRotate:Xe(),invert:Ht(),gap:ue(),gradientColorStops:[e],gradientColorStopPositions:[yA,Yr],inset:J(),margin:J(),opacity:Xe(),padding:ue(),saturate:Xe(),scale:Xe(),sepia:Ht(),skew:Xe(),space:ue(),translate:ue()},classGroups:{aspect:[{aspect:["auto","square","video",Z]}],container:["container"],columns:[{columns:[Zr]}],"break-after":[{"break-after":ma()}],"break-before":[{"break-before":ma()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...So(),Z]}],overflow:[{overflow:U()}],"overflow-x":[{"overflow-x":U()}],"overflow-y":[{"overflow-y":U()}],overscroll:[{overscroll:q()}],"overscroll-x":[{"overscroll-x":q()}],"overscroll-y":[{"overscroll-y":q()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Hl,Z]}],basis:[{basis:J()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Z]}],grow:[{grow:Ht()}],shrink:[{shrink:Ht()}],order:[{order:["first","last","none",Hl,Z]}],"grid-cols":[{"grid-cols":[zl]}],"col-start-end":[{col:["auto",{span:["full",Hl,Z]},Z]}],"col-start":[{"col-start":Xa()}],"col-end":[{"col-end":Xa()}],"grid-rows":[{"grid-rows":[zl]}],"row-start-end":[{row:["auto",{span:[Hl,Z]},Z]}],"row-start":[{"row-start":Xa()}],"row-end":[{"row-end":Xa()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Z]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Z]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...ze()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ze(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ze(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[h]}],px:[{px:[h]}],py:[{py:[h]}],ps:[{ps:[h]}],pe:[{pe:[h]}],pt:[{pt:[h]}],pr:[{pr:[h]}],pb:[{pb:[h]}],pl:[{pl:[h]}],m:[{m:[L]}],mx:[{mx:[L]}],my:[{my:[L]}],ms:[{ms:[L]}],me:[{me:[L]}],mt:[{mt:[L]}],mr:[{mr:[L]}],mb:[{mb:[L]}],ml:[{ml:[L]}],"space-x":[{"space-x":[R]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[R]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Z,t]}],"min-w":[{"min-w":[Z,t,"min","max","fit"]}],"max-w":[{"max-w":[Z,t,"none","full","min","max","fit","prose",{screen:[Zr]},Zr]}],h:[{h:[Z,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Z,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Z,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Z,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Zr,Yr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",mg]}],"font-family":[{font:[zl]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Z]}],"line-clamp":[{"line-clamp":["none",ws,mg]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ur,Z]}],"list-image":[{"list-image":["none",Z]}],"list-style-type":[{list:["none","disc","decimal",Z]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ke(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ur,Yr]}],"underline-offset":[{"underline-offset":["auto",ur,Z]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:ue()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Z]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Z]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...So(),wA]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",vA]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},CA]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[n]}],"rounded-s":[{"rounded-s":[n]}],"rounded-e":[{"rounded-e":[n]}],"rounded-t":[{"rounded-t":[n]}],"rounded-r":[{"rounded-r":[n]}],"rounded-b":[{"rounded-b":[n]}],"rounded-l":[{"rounded-l":[n]}],"rounded-ss":[{"rounded-ss":[n]}],"rounded-se":[{"rounded-se":[n]}],"rounded-ee":[{"rounded-ee":[n]}],"rounded-es":[{"rounded-es":[n]}],"rounded-tl":[{"rounded-tl":[n]}],"rounded-tr":[{"rounded-tr":[n]}],"rounded-br":[{"rounded-br":[n]}],"rounded-bl":[{"rounded-bl":[n]}],"border-w":[{border:[i]}],"border-w-x":[{"border-x":[i]}],"border-w-y":[{"border-y":[i]}],"border-w-s":[{"border-s":[i]}],"border-w-e":[{"border-e":[i]}],"border-w-t":[{"border-t":[i]}],"border-w-r":[{"border-r":[i]}],"border-w-b":[{"border-b":[i]}],"border-w-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...Ke(),"hidden"]}],"divide-x":[{"divide-x":[i]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[i]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:Ke()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...Ke()]}],"outline-offset":[{"outline-offset":[ur,Z]}],"outline-w":[{outline:[ur,Yr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:pt()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[ur,Yr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Zr,LA]}],"shadow-color":[{shadow:[zl]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...xe(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":xe()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Zr,Z]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[c]}],saturate:[{saturate:[m]}],sepia:[{sepia:[I]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[c]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[m]}],"backdrop-sepia":[{"backdrop-sepia":[I]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Z]}],duration:[{duration:Xe()}],ease:[{ease:["linear","in","out","in-out",Z]}],delay:[{delay:Xe()}],animate:[{animate:["none","spin","ping","pulse","bounce",Z]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[Hl,Z]}],"translate-x":[{"translate-x":[A]}],"translate-y":[{"translate-y":[A]}],"skew-x":[{"skew-x":[P]}],"skew-y":[{"skew-y":[P]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Z]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Z]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":ue()}],"scroll-mx":[{"scroll-mx":ue()}],"scroll-my":[{"scroll-my":ue()}],"scroll-ms":[{"scroll-ms":ue()}],"scroll-me":[{"scroll-me":ue()}],"scroll-mt":[{"scroll-mt":ue()}],"scroll-mr":[{"scroll-mr":ue()}],"scroll-mb":[{"scroll-mb":ue()}],"scroll-ml":[{"scroll-ml":ue()}],"scroll-p":[{"scroll-p":ue()}],"scroll-px":[{"scroll-px":ue()}],"scroll-py":[{"scroll-py":ue()}],"scroll-ps":[{"scroll-ps":ue()}],"scroll-pe":[{"scroll-pe":ue()}],"scroll-pt":[{"scroll-pt":ue()}],"scroll-pr":[{"scroll-pr":ue()}],"scroll-pb":[{"scroll-pb":ue()}],"scroll-pl":[{"scroll-pl":ue()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Z]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ur,Yr,mg]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var $S=uA(PA);function Jt(...e){return $S(kc(e))}var XS=M(le(),1);function De({className:e,type:t,...a}){return(0,XS.jsx)("input",{type:t,"data-slot":"input",className:Jt("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...a})}var qe=M(G(),1);var JS=M(G(),1);function QS(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function $l(...e){return t=>{let a=!1,r=e.map(o=>{let n=QS(o,t);return!a&&typeof n=="function"&&(a=!0),n});if(a)return()=>{for(let o=0;o<r.length;o++){let n=r[o];typeof n=="function"?n():QS(e[o],null)}}}}function dr(...e){return JS.useCallback($l(...e),e)}var Tc=M(le(),1),MA=Symbol.for("react.lazy"),Ac=qe[" use ".trim().toString()];function NA(e){return typeof e=="object"&&e!==null&&"then"in e}function YS(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===MA&&"_payload"in e&&NA(e._payload)}function OA(e){let t=FA(e),a=qe.forwardRef((r,o)=>{let{children:n,...s}=r;YS(n)&&typeof Ac=="function"&&(n=Ac(n._payload));let i=qe.Children.toArray(n),l=i.find(UA);if(l){let u=l.props.children,d=i.map(c=>c===l?qe.Children.count(u)>1?qe.Children.only(null):qe.isValidElement(u)?u.props.children:null:c);return(0,Tc.jsx)(t,{...s,ref:o,children:qe.isValidElement(u)?qe.cloneElement(u,void 0,d):null})}return(0,Tc.jsx)(t,{...s,ref:o,children:n})});return a.displayName=`${e}.Slot`,a}var ZS=OA("Slot");function FA(e){let t=qe.forwardRef((a,r)=>{let{children:o,...n}=a;if(YS(o)&&typeof Ac=="function"&&(o=Ac(o._payload)),qe.isValidElement(o)){let s=jA(o),i=VA(n,o.props);return o.type!==qe.Fragment&&(i.ref=r?$l(r,s):s),qe.cloneElement(o,i)}return qe.Children.count(o)>1?qe.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var BA=Symbol("radix.slottable");function UA(e){return qe.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===BA}function VA(e,t){let a={...t};for(let r in t){let o=e[r],n=t[r];/^on[A-Z]/.test(r)?o&&n?a[r]=(...i)=>{let l=n(...i);return o(...i),l}:o&&(a[r]=o):r==="style"?a[r]={...o,...n}:r==="className"&&(a[r]=[o,n].filter(Boolean).join(" "))}return{...e,...a}}function jA(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var eC=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,tC=kc,aC=(e,t)=>a=>{var r;if(t?.variants==null)return tC(e,a?.class,a?.className);let{variants:o,defaultVariants:n}=t,s=Object.keys(o).map(u=>{let d=a?.[u],c=n?.[u];if(d===null)return null;let f=eC(d)||eC(c);return o[u][f]}),i=a&&Object.entries(a).reduce((u,d)=>{let[c,f]=d;return f===void 0||(u[c]=f),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:c,className:f,...g}=d;return Object.entries(g).every(x=>{let[w,L]=x;return Array.isArray(L)?L.includes({...n,...i}[w]):{...n,...i}[w]===L})?[...u,c,f]:u},[]);return tC(e,s,l,a?.class,a?.className)};var rC=M(le(),1),qA=aC("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function ut({className:e,variant:t,size:a,asChild:r=!1,...o}){return(0,rC.jsx)(r?ZS:"button",{"data-slot":"button",className:Jt(qA({variant:t,size:a,className:e})),...o})}var AC=M(G(),1);var $=M(G(),1);var nC=M(G(),1),KA=M(Vh(),1);var Ge=M(G(),1);var Rc=M(le(),1);function oC(e){let t=HA(e),a=Ge.forwardRef((r,o)=>{let{children:n,...s}=r,i=Ge.Children.toArray(n),l=i.find($A);if(l){let u=l.props.children,d=i.map(c=>c===l?Ge.Children.count(u)>1?Ge.Children.only(null):Ge.isValidElement(u)?u.props.children:null:c);return(0,Rc.jsx)(t,{...s,ref:o,children:Ge.isValidElement(u)?Ge.cloneElement(u,void 0,d):null})}return(0,Rc.jsx)(t,{...s,ref:o,children:n})});return a.displayName=`${e}.Slot`,a}function HA(e){let t=Ge.forwardRef((a,r)=>{let{children:o,...n}=a;if(Ge.isValidElement(o)){let s=GA(o),i=WA(n,o.props);return o.type!==Ge.Fragment&&(i.ref=r?$l(r,s):s),Ge.cloneElement(o,i)}return Ge.Children.count(o)>1?Ge.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var zA=Symbol("radix.slottable");function $A(e){return Ge.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===zA}function WA(e,t){let a={...t};for(let r in t){let o=e[r],n=t[r];/^on[A-Z]/.test(r)?o&&n?a[r]=(...i)=>{let l=n(...i);return o(...i),l}:o&&(a[r]=o):r==="style"?a[r]={...o,...n}:r==="className"&&(a[r]=[o,n].filter(Boolean).join(" "))}return{...e,...a}}function GA(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var sC=M(le(),1),XA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Cs=XA.reduce((e,t)=>{let a=oC(`Primitive.${t}`),r=nC.forwardRef((o,n)=>{let{asChild:s,...i}=o,l=s?a:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),(0,sC.jsx)(l,{...i,ref:n})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});var Ot=M(G(),1);var iC=M(G(),1),Wl=globalThis?.document?iC.useLayoutEffect:()=>{};var lC=M(G(),1);function QA(e,t){return lC.useReducer((a,r)=>t[a][r]??a,e)}var Ls=e=>{let{present:t,children:a}=e,r=JA(t),o=typeof a=="function"?a({present:r.isPresent}):Ot.Children.only(a),n=dr(r.ref,YA(o));return typeof a=="function"||r.isPresent?Ot.cloneElement(o,{ref:n}):null};Ls.displayName="Presence";function JA(e){let[t,a]=Ot.useState(),r=Ot.useRef(null),o=Ot.useRef(e),n=Ot.useRef("none"),s=e?"mounted":"unmounted",[i,l]=QA(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return Ot.useEffect(()=>{let u=_c(r.current);n.current=i==="mounted"?u:"none"},[i]),Wl(()=>{let u=r.current,d=o.current;if(d!==e){let f=n.current,g=_c(u);e?l("MOUNT"):g==="none"||u?.display==="none"?l("UNMOUNT"):l(d&&f!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Wl(()=>{if(t){let u,d=t.ownerDocument.defaultView??window,c=g=>{let w=_c(r.current).includes(CSS.escape(g.animationName));if(g.target===t&&w&&(l("ANIMATION_END"),!o.current)){let L=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=L)})}},f=g=>{g.target===t&&(n.current=_c(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:Ot.useCallback(u=>{r.current=u?getComputedStyle(u):null,a(u)},[])}}function _c(e){return e?.animationName||"none"}function YA(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var cr=M(G(),1),uC=M(le(),1);function dC(e,t=[]){let a=[];function r(n,s){let i=cr.createContext(s),l=a.length;a=[...a,s];let u=c=>{let{scope:f,children:g,...x}=c,w=f?.[e]?.[l]||i,L=cr.useMemo(()=>x,Object.values(x));return(0,uC.jsx)(w.Provider,{value:L,children:g})};u.displayName=n+"Provider";function d(c,f){let g=f?.[e]?.[l]||i,x=cr.useContext(g);if(x)return x;if(s!==void 0)return s;throw new Error(`\`${c}\` must be used within \`${n}\``)}return[u,d]}let o=()=>{let n=a.map(s=>cr.createContext(s));return function(i){let l=i?.[e]||n;return cr.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return o.scopeName=e,[r,ZA(o,...t)]}function ZA(...e){let t=e[0];if(e.length===1)return t;let a=()=>{let r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(n){let s=r.reduce((i,{useScope:l,scopeName:u})=>{let c=l(n)[`__scope${u}`];return{...i,...c}},{});return cr.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return a.scopeName=t.scopeName,a}var Is=M(G(),1);function eo(e){let t=Is.useRef(e);return Is.useEffect(()=>{t.current=e}),Is.useMemo(()=>(...a)=>t.current?.(...a),[])}var Ec=M(G(),1),eR=M(le(),1),tR=Ec.createContext(void 0);function cC(e){let t=Ec.useContext(tR);return e||t||"ltr"}function fC(e,[t,a]){return Math.min(a,Math.max(t,e))}var eO=!!(typeof window<"u"&&window.document&&window.document.createElement);function to(e,t,{checkForDefaultPrevented:a=!0}={}){return function(o){if(e?.(o),a===!1||!o.defaultPrevented)return t?.(o)}}var mC=M(G(),1),fe=M(le(),1);function aR(e,t){return mC.useReducer((a,r)=>t[a][r]??a,e)}var gg="ScrollArea",[hC,cO]=dC(gg),[rR,fa]=hC(gg),gC=$.forwardRef((e,t)=>{let{__scopeScrollArea:a,type:r="hover",dir:o,scrollHideDelay:n=600,...s}=e,[i,l]=$.useState(null),[u,d]=$.useState(null),[c,f]=$.useState(null),[g,x]=$.useState(null),[w,L]=$.useState(null),[y,h]=$.useState(0),[m,C]=$.useState(0),[I,P]=$.useState(!1),[R,A]=$.useState(!1),q=dr(t,J=>l(J)),U=cC(o);return(0,fe.jsx)(rR,{scope:a,type:r,dir:U,scrollHideDelay:n,scrollArea:i,viewport:u,onViewportChange:d,content:c,onContentChange:f,scrollbarX:g,onScrollbarXChange:x,scrollbarXEnabled:I,onScrollbarXEnabledChange:P,scrollbarY:w,onScrollbarYChange:L,scrollbarYEnabled:R,onScrollbarYEnabledChange:A,onCornerWidthChange:h,onCornerHeightChange:C,children:(0,fe.jsx)(Cs.div,{dir:U,...s,ref:q,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":m+"px",...e.style}})})});gC.displayName=gg;var yC="ScrollAreaViewport",xC=$.forwardRef((e,t)=>{let{__scopeScrollArea:a,children:r,nonce:o,...n}=e,s=fa(yC,a),i=$.useRef(null),l=dr(t,i,s.onViewportChange);return(0,fe.jsxs)(fe.Fragment,{children:[(0,fe.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),(0,fe.jsx)(Cs.div,{"data-radix-scroll-area-viewport":"",...n,ref:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:(0,fe.jsx)("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});xC.displayName=yC;var Ua="ScrollAreaScrollbar",yg=$.forwardRef((e,t)=>{let{forceMount:a,...r}=e,o=fa(Ua,e.__scopeScrollArea),{onScrollbarXEnabledChange:n,onScrollbarYEnabledChange:s}=o,i=e.orientation==="horizontal";return $.useEffect(()=>(i?n(!0):s(!0),()=>{i?n(!1):s(!1)}),[i,n,s]),o.type==="hover"?(0,fe.jsx)(oR,{...r,ref:t,forceMount:a}):o.type==="scroll"?(0,fe.jsx)(nR,{...r,ref:t,forceMount:a}):o.type==="auto"?(0,fe.jsx)(vC,{...r,ref:t,forceMount:a}):o.type==="always"?(0,fe.jsx)(xg,{...r,ref:t}):null});yg.displayName=Ua;var oR=$.forwardRef((e,t)=>{let{forceMount:a,...r}=e,o=fa(Ua,e.__scopeScrollArea),[n,s]=$.useState(!1);return $.useEffect(()=>{let i=o.scrollArea,l=0;if(i){let u=()=>{window.clearTimeout(l),s(!0)},d=()=>{l=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return i.addEventListener("pointerenter",u),i.addEventListener("pointerleave",d),()=>{window.clearTimeout(l),i.removeEventListener("pointerenter",u),i.removeEventListener("pointerleave",d)}}},[o.scrollArea,o.scrollHideDelay]),(0,fe.jsx)(Ls,{present:a||n,children:(0,fe.jsx)(vC,{"data-state":n?"visible":"hidden",...r,ref:t})})}),nR=$.forwardRef((e,t)=>{let{forceMount:a,...r}=e,o=fa(Ua,e.__scopeScrollArea),n=e.orientation==="horizontal",s=Oc(()=>l("SCROLL_END"),100),[i,l]=aR("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return $.useEffect(()=>{if(i==="idle"){let u=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(u)}},[i,o.scrollHideDelay,l]),$.useEffect(()=>{let u=o.viewport,d=n?"scrollLeft":"scrollTop";if(u){let c=u[d],f=()=>{let g=u[d];c!==g&&(l("SCROLL"),s()),c=g};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[o.viewport,n,l,s]),(0,fe.jsx)(Ls,{present:a||i!=="hidden",children:(0,fe.jsx)(xg,{"data-state":i==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:to(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:to(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),vC=$.forwardRef((e,t)=>{let a=fa(Ua,e.__scopeScrollArea),{forceMount:r,...o}=e,[n,s]=$.useState(!1),i=e.orientation==="horizontal",l=Oc(()=>{if(a.viewport){let u=a.viewport.offsetWidth<a.viewport.scrollWidth,d=a.viewport.offsetHeight<a.viewport.scrollHeight;s(i?u:d)}},10);return bs(a.viewport,l),bs(a.content,l),(0,fe.jsx)(Ls,{present:r||n,children:(0,fe.jsx)(xg,{"data-state":n?"visible":"hidden",...o,ref:t})})}),xg=$.forwardRef((e,t)=>{let{orientation:a="vertical",...r}=e,o=fa(Ua,e.__scopeScrollArea),n=$.useRef(null),s=$.useRef(0),[i,l]=$.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=LC(i.viewport,i.content),d={...r,sizes:i,onSizesChange:l,hasThumb:u>0&&u<1,onThumbChange:f=>n.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function c(f,g){return cR(f,s.current,i,g)}return a==="horizontal"?(0,fe.jsx)(sR,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&n.current){let f=o.viewport.scrollLeft,g=pC(f,i,o.dir);n.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollLeft=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollLeft=c(f,o.dir))}}):a==="vertical"?(0,fe.jsx)(iR,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&n.current){let f=o.viewport.scrollTop,g=pC(f,i);n.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollTop=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollTop=c(f))}}):null}),sR=$.forwardRef((e,t)=>{let{sizes:a,onSizesChange:r,...o}=e,n=fa(Ua,e.__scopeScrollArea),[s,i]=$.useState(),l=$.useRef(null),u=dr(t,l,n.onScrollbarXChange);return $.useEffect(()=>{l.current&&i(getComputedStyle(l.current))},[l]),(0,fe.jsx)(SC,{"data-orientation":"horizontal",...o,ref:u,sizes:a,style:{bottom:0,left:n.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:n.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Nc(a)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,c)=>{if(n.viewport){let f=n.viewport.scrollLeft+d.deltaX;e.onWheelScroll(f),bC(f,c)&&d.preventDefault()}},onResize:()=>{l.current&&n.viewport&&s&&r({content:n.viewport.scrollWidth,viewport:n.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Mc(s.paddingLeft),paddingEnd:Mc(s.paddingRight)}})}})}),iR=$.forwardRef((e,t)=>{let{sizes:a,onSizesChange:r,...o}=e,n=fa(Ua,e.__scopeScrollArea),[s,i]=$.useState(),l=$.useRef(null),u=dr(t,l,n.onScrollbarYChange);return $.useEffect(()=>{l.current&&i(getComputedStyle(l.current))},[l]),(0,fe.jsx)(SC,{"data-orientation":"vertical",...o,ref:u,sizes:a,style:{top:0,right:n.dir==="ltr"?0:void 0,left:n.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Nc(a)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,c)=>{if(n.viewport){let f=n.viewport.scrollTop+d.deltaY;e.onWheelScroll(f),bC(f,c)&&d.preventDefault()}},onResize:()=>{l.current&&n.viewport&&s&&r({content:n.viewport.scrollHeight,viewport:n.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Mc(s.paddingTop),paddingEnd:Mc(s.paddingBottom)}})}})}),[lR,wC]=hC(Ua),SC=$.forwardRef((e,t)=>{let{__scopeScrollArea:a,sizes:r,hasThumb:o,onThumbChange:n,onThumbPointerUp:s,onThumbPointerDown:i,onThumbPositionChange:l,onDragScroll:u,onWheelScroll:d,onResize:c,...f}=e,g=fa(Ua,a),[x,w]=$.useState(null),L=dr(t,q=>w(q)),y=$.useRef(null),h=$.useRef(""),m=g.viewport,C=r.content-r.viewport,I=eo(d),P=eo(l),R=Oc(c,10);function A(q){if(y.current){let U=q.clientX-y.current.left,J=q.clientY-y.current.top;u({x:U,y:J})}}return $.useEffect(()=>{let q=U=>{let J=U.target;x?.contains(J)&&I(U,C)};return document.addEventListener("wheel",q,{passive:!1}),()=>document.removeEventListener("wheel",q,{passive:!1})},[m,x,C,I]),$.useEffect(P,[r,P]),bs(x,R),bs(g.content,R),(0,fe.jsx)(lR,{scope:a,scrollbar:x,hasThumb:o,onThumbChange:eo(n),onThumbPointerUp:eo(s),onThumbPositionChange:P,onThumbPointerDown:eo(i),children:(0,fe.jsx)(Cs.div,{...f,ref:L,style:{position:"absolute",...f.style},onPointerDown:to(e.onPointerDown,q=>{q.button===0&&(q.target.setPointerCapture(q.pointerId),y.current=x.getBoundingClientRect(),h.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),A(q))}),onPointerMove:to(e.onPointerMove,A),onPointerUp:to(e.onPointerUp,q=>{let U=q.target;U.hasPointerCapture(q.pointerId)&&U.releasePointerCapture(q.pointerId),document.body.style.webkitUserSelect=h.current,g.viewport&&(g.viewport.style.scrollBehavior=""),y.current=null})})})}),Dc="ScrollAreaThumb",vg=$.forwardRef((e,t)=>{let{forceMount:a,...r}=e,o=wC(Dc,e.__scopeScrollArea);return(0,fe.jsx)(Ls,{present:a||o.hasThumb,children:(0,fe.jsx)(uR,{ref:t,...r})})}),uR=$.forwardRef((e,t)=>{let{__scopeScrollArea:a,style:r,...o}=e,n=fa(Dc,a),s=wC(Dc,a),{onThumbPositionChange:i}=s,l=dr(t,c=>s.onThumbChange(c)),u=$.useRef(void 0),d=Oc(()=>{u.current&&(u.current(),u.current=void 0)},100);return $.useEffect(()=>{let c=n.viewport;if(c){let f=()=>{if(d(),!u.current){let g=fR(c,i);u.current=g,i()}};return i(),c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)}},[n.viewport,d,i]),(0,fe.jsx)(Cs.div,{"data-state":s.hasThumb?"visible":"hidden",...o,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:to(e.onPointerDownCapture,c=>{let g=c.target.getBoundingClientRect(),x=c.clientX-g.left,w=c.clientY-g.top;s.onThumbPointerDown({x,y:w})}),onPointerUp:to(e.onPointerUp,s.onThumbPointerUp)})});vg.displayName=Dc;var wg="ScrollAreaCorner",CC=$.forwardRef((e,t)=>{let a=fa(wg,e.__scopeScrollArea),r=!!(a.scrollbarX&&a.scrollbarY);return a.type!=="scroll"&&r?(0,fe.jsx)(dR,{...e,ref:t}):null});CC.displayName=wg;var dR=$.forwardRef((e,t)=>{let{__scopeScrollArea:a,...r}=e,o=fa(wg,a),[n,s]=$.useState(0),[i,l]=$.useState(0),u=!!(n&&i);return bs(o.scrollbarX,()=>{let d=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(d),l(d)}),bs(o.scrollbarY,()=>{let d=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(d),s(d)}),u?(0,fe.jsx)(Cs.div,{...r,ref:t,style:{width:n,height:i,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Mc(e){return e?parseInt(e,10):0}function LC(e,t){let a=e/t;return isNaN(a)?0:a}function Nc(e){let t=LC(e.viewport,e.content),a=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-a)*t;return Math.max(r,18)}function cR(e,t,a,r="ltr"){let o=Nc(a),n=o/2,s=t||n,i=o-s,l=a.scrollbar.paddingStart+s,u=a.scrollbar.size-a.scrollbar.paddingEnd-i,d=a.content-a.viewport,c=r==="ltr"?[0,d]:[d*-1,0];return IC([l,u],c)(e)}function pC(e,t,a="ltr"){let r=Nc(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,n=t.scrollbar.size-o,s=t.content-t.viewport,i=n-r,l=a==="ltr"?[0,s]:[s*-1,0],u=fC(e,l);return IC([0,s],[0,i])(u)}function IC(e,t){return a=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(a-e[0])}}function bC(e,t){return e>0&&e<t}var fR=(e,t=()=>{})=>{let a={left:e.scrollLeft,top:e.scrollTop},r=0;return(function o(){let n={left:e.scrollLeft,top:e.scrollTop},s=a.left!==n.left,i=a.top!==n.top;(s||i)&&t(),a=n,r=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(r)};function Oc(e,t){let a=eo(e),r=$.useRef(0);return $.useEffect(()=>()=>window.clearTimeout(r.current),[]),$.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(a,t)},[a,t])}function bs(e,t){let a=eo(t);Wl(()=>{let r=0;if(e){let o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(a)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,a])}var kC=gC,PC=xC;var TC=CC;var ao=M(le(),1),Sg=AC.forwardRef(({className:e,children:t,...a},r)=>(0,ao.jsxs)(kC,{"data-slot":"scroll-area",className:Jt("relative",e),...a,children:[(0,ao.jsx)(PC,{ref:r,"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),(0,ao.jsx)(mR,{}),(0,ao.jsx)(TC,{})]}));Sg.displayName="ScrollArea";function mR({className:e,orientation:t="vertical",...a}){return(0,ao.jsx)(yg,{"data-slot":"scroll-area-scrollbar",orientation:t,className:Jt("flex touch-none p-px transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...a,children:(0,ao.jsx)(vg,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}var Bc=M(G());var RC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),hR=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,r)=>r?r.toUpperCase():a.toLowerCase()),Cg=e=>{let t=hR(e);return t.charAt(0).toUpperCase()+t.slice(1)},Fc=(...e)=>e.filter((t,a,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===a).join(" ").trim(),_C=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var Gl=M(G());var EC={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var DC=(0,Gl.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:r,className:o="",children:n,iconNode:s,...i},l)=>(0,Gl.createElement)("svg",{ref:l,...EC,width:t,height:t,stroke:e,strokeWidth:r?Number(a)*24/Number(t):a,className:Fc("lucide",o),...!n&&!_C(i)&&{"aria-hidden":"true"},...i},[...s.map(([u,d])=>(0,Gl.createElement)(u,d)),...Array.isArray(n)?n:[n]]));var V=(e,t)=>{let a=(0,Bc.forwardRef)(({className:r,...o},n)=>(0,Bc.createElement)(DC,{ref:n,iconNode:t,className:Fc(`lucide-${RC(Cg(e))}`,`lucide-${e}`,r),...o}));return a.displayName=Cg(e),a};var gR=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Kl=V("activity",gR);var yR=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],ks=V("arrow-left",yR);var xR=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Xl=V("arrow-up",xR);var vR=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],Ql=V("calendar",vR);var wR=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Jl=V("chevron-down",wR);var SR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],ba=V("circle-alert",SR);var CR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],at=V("circle-check",CR);var LR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],ka=V("circle-x",LR);var IR=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],nn=V("clock",IR);var bR=[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]],fr=V("command",bR);var kR=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],pr=V("corner-down-left",kR);var PR=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],sn=V("credit-card",PR);var TR=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],ln=V("crown",TR);var AR=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],un=V("dollar-sign",AR);var RR=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],Ps=V("file-spreadsheet",RR);var _R=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],Ts=V("key",_R);var ER=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],Yl=V("laptop",ER);var DR=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ft=V("loader-circle",DR);var MR=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],As=V("mail",MR);var NR=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],Rs=V("map-pin",NR);var OR=[["path",{d:"M5 12h14",key:"1ays0h"}]],dn=V("minus",OR);var FR=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],Zl=V("paperclip",FR);var BR=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],_s=V("refresh-cw",BR);var UR=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],cn=V("search",UR);var VR=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],Es=V("shield",VR);var jR=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],eu=V("smartphone",jR);var qR=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],pa=V("sparkles",qR);var HR=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],Bt=V("square-pen",HR);var zR=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],tu=V("trending-up",zR);var $R=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Ds=V("users",$R);var WR=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ro=V("x",WR);var GR=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],au=V("zap",GR);var Oe=M(le(),1);function MC({phase:e,progressSteps:t=[]}){return(0,Oe.jsxs)("div",{className:"mb-3 rounded-lg bg-muted/40 px-3 py-3 text-xs text-muted-foreground transition-colors",children:[e==="thinking"&&t.length===0&&(0,Oe.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Oe.jsx)(Ft,{className:"h-3.5 w-3.5 animate-spin"}),(0,Oe.jsx)("span",{children:"Thinking\u2026"})]}),e==="searching"&&(0,Oe.jsxs)("div",{className:"space-y-2 animate-in fade-in-0 duration-300",children:[(0,Oe.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Oe.jsx)(cn,{className:"h-3.5 w-3.5 opacity-70"}),(0,Oe.jsx)("span",{children:"Searching across pages\u2026"})]}),(0,Oe.jsxs)("ul",{className:"ml-6 list-disc space-y-1",children:[(0,Oe.jsx)("li",{className:"opacity-90",children:"Checking recent changes"}),(0,Oe.jsx)("li",{className:"opacity-90",children:"Scanning documentation"}),(0,Oe.jsx)("li",{className:"opacity-90",children:"Summarizing relevant sections"})]})]}),(e==="thinking"||e==="executing"||e==="responding")&&t.length>0&&(0,Oe.jsxs)("div",{className:"space-y-2 animate-in fade-in-0 duration-200",children:[t.map((a,r)=>(0,Oe.jsxs)("div",{className:`flex items-center gap-2 transition-opacity duration-200 ${a.completed?"opacity-60":"opacity-100"}`,children:[a.completed?(0,Oe.jsx)(at,{className:"h-3.5 w-3.5 text-green-500 flex-shrink-0"}):(0,Oe.jsx)(Ft,{className:"h-3.5 w-3.5 animate-spin flex-shrink-0"}),(0,Oe.jsx)("span",{className:a.completed?"line-through":"",children:a.message})]},r)),e==="responding"&&(0,Oe.jsxs)("div",{className:"flex items-center gap-2 opacity-100 animate-in fade-in-0 duration-200",children:[(0,Oe.jsx)(Ft,{className:"h-3.5 w-3.5 animate-spin flex-shrink-0"}),(0,Oe.jsx)("span",{children:"Preparing response..."})]})]})]})}var NC=M(G(),1);var Pa=M(le(),1);function OC({title:e,links:t}){let[a,r]=NC.useState(!1);return(0,Pa.jsxs)("div",{className:"text-xs text-muted-foreground",children:[(0,Pa.jsx)("button",{type:"button",onClick:()=>r(o=>!o),className:"flex w-full items-center gap-2 px-0 py-0","aria-expanded":a,children:(0,Pa.jsxs)("div",{className:"flex items-center gap-1.5",children:[a?(0,Pa.jsx)(Jl,{className:"h-3 w-3 opacity-70"}):(0,Pa.jsx)(cn,{className:"h-3 w-3 opacity-70"}),(0,Pa.jsx)("span",{children:e})]})}),a&&t.length>0&&(0,Pa.jsx)("ul",{className:"ml-5 mt-1 space-y-0.5",children:t.map(o=>(0,Pa.jsx)("li",{children:(0,Pa.jsx)("a",{href:o.href,target:"_blank",rel:"noreferrer",className:"text-primary hover:underline",children:o.label})},o.href))})]})}var ou=M(le(),1),Va=M(G(),1);var FC=M(G(),1),Ms=(0,FC.createContext)({});var BC=M(G(),1);function Ns(e){let t=(0,BC.useRef)(null);return t.current===null&&(t.current=e()),t.current}var Ig=M(le(),1),HC=M(G(),1),fn=M(G(),1);var UC=M(G(),1),oo=(0,UC.createContext)(null);var jC=M(le(),1),Uc=M(G(),1),mr=M(G(),1);var VC=M(G(),1),Os=(0,VC.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});var Lg=class extends Uc.Component{getSnapshotBeforeUpdate(t){let a=this.props.childRef.current;if(a&&t.isPresent&&!this.props.isPresent){let r=this.props.sizeRef.current;r.height=a.offsetHeight||0,r.width=a.offsetWidth||0,r.top=a.offsetTop,r.left=a.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}};function qC({children:e,isPresent:t}){let a=(0,mr.useId)(),r=(0,mr.useRef)(null),o=(0,mr.useRef)({width:0,height:0,top:0,left:0}),{nonce:n}=(0,mr.useContext)(Os);return(0,mr.useInsertionEffect)(()=>{let{width:s,height:i,top:l,left:u}=o.current;if(t||!r.current||!s||!i)return;r.current.dataset.motionPopId=a;let d=document.createElement("style");return n&&(d.nonce=n),document.head.appendChild(d),d.sheet&&d.sheet.insertRule(`
15
+ `);let P=await C.signMessage(new TextEncoder().encode(x),"utf8");if(!P||!(P instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");w=P}}try{let{data:L,error:y}=await te(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:x,signature:SS(w)},!((f=t.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(g=t.options)===null||g===void 0?void 0:g.captchaToken}}:null),xform:Fa});if(y)throw y;return!L||!L.session||!L.user?{data:{user:null,session:null},error:new Go}:(L.session&&(await this._saveSession(L.session),await this._notifyAllSubscribers("SIGNED_IN",L.session)),{data:Object.assign({},L),error:y})}catch(L){if(Q(L))return{data:{user:null,session:null},error:L};throw L}}async _exchangeCodeForSession(t){let a=await Jr(this.storage,`${this.storageKey}-code-verifier`),[r,o]=(a??"").split("/");try{let{data:n,error:s}=await te(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:r},xform:Fa});if(await lr(this.storage,`${this.storageKey}-code-verifier`),s)throw s;return!n||!n.session||!n.user?{data:{user:null,session:null,redirectType:null},error:new Go}:(n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),{data:Object.assign(Object.assign({},n),{redirectType:o??null}),error:s})}catch(n){if(Q(n))return{data:{user:null,session:null,redirectType:null},error:n};throw n}}async signInWithIdToken(t){try{let{options:a,provider:r,token:o,access_token:n,nonce:s}=t,i=await te(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:o,access_token:n,nonce:s,gotrue_meta_security:{captcha_token:a?.captchaToken}},xform:Fa}),{data:l,error:u}=i;return u?{data:{user:null,session:null},error:u}:!l||!l.session||!l.user?{data:{user:null,session:null},error:new Go}:(l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),{data:l,error:u})}catch(a){if(Q(a))return{data:{user:null,session:null},error:a};throw a}}async signInWithOtp(t){var a,r,o,n,s;try{if("email"in t){let{email:i,options:l}=t,u=null,d=null;this.flowType==="pkce"&&([u,d]=await Zo(this.storage,this.storageKey));let{error:c}=await te(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:i,data:(a=l?.data)!==null&&a!==void 0?a:{},create_user:(r=l?.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:l?.captchaToken},code_challenge:u,code_challenge_method:d},redirectTo:l?.emailRedirectTo});return{data:{user:null,session:null},error:c}}if("phone"in t){let{phone:i,options:l}=t,{data:u,error:d}=await te(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:i,data:(o=l?.data)!==null&&o!==void 0?o:{},create_user:(n=l?.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:l?.captchaToken},channel:(s=l?.channel)!==null&&s!==void 0?s:"sms"}});return{data:{user:null,session:null,messageId:u?.message_id},error:d}}throw new Ko("You must provide either an email or phone number.")}catch(i){if(Q(i))return{data:{user:null,session:null},error:i};throw i}}async verifyOtp(t){var a,r;try{let o,n;"options"in t&&(o=(a=t.options)===null||a===void 0?void 0:a.redirectTo,n=(r=t.options)===null||r===void 0?void 0:r.captchaToken);let{data:s,error:i}=await te(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:n}}),redirectTo:o,xform:Fa});if(i)throw i;if(!s)throw new Error("An error occurred on token verification.");let l=s.session,u=s.user;return l?.access_token&&(await this._saveSession(l),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",l)),{data:{user:u,session:l},error:null}}catch(o){if(Q(o))return{data:{user:null,session:null},error:o};throw o}}async signInWithSSO(t){var a,r,o;try{let n=null,s=null;return this.flowType==="pkce"&&([n,s]=await Zo(this.storage,this.storageKey)),await te(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(r=(a=t.options)===null||a===void 0?void 0:a.redirectTo)!==null&&r!==void 0?r:void 0}),!((o=t?.options)===null||o===void 0)&&o.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:n,code_challenge_method:s}),headers:this.headers,xform:ES})}catch(n){if(Q(n))return{data:null,error:n};throw n}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{let{data:{session:a},error:r}=t;if(r)throw r;if(!a)throw new da;let{error:o}=await te(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:a.access_token});return{data:{user:null,session:null},error:o}})}catch(t){if(Q(t))return{data:{user:null,session:null},error:t};throw t}}async resend(t){try{let a=`${this.url}/resend`;if("email"in t){let{email:r,type:o,options:n}=t,{error:s}=await te(this.fetch,"POST",a,{headers:this.headers,body:{email:r,type:o,gotrue_meta_security:{captcha_token:n?.captchaToken}},redirectTo:n?.emailRedirectTo});return{data:{user:null,session:null},error:s}}else if("phone"in t){let{phone:r,type:o,options:n}=t,{data:s,error:i}=await te(this.fetch,"POST",a,{headers:this.headers,body:{phone:r,type:o,gotrue_meta_security:{captcha_token:n?.captchaToken}}});return{data:{user:null,session:null,messageId:s?.message_id},error:i}}throw new Ko("You must provide either an email or phone number and a type")}catch(a){if(Q(a))return{data:{user:null,session:null},error:a};throw a}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async a=>a))}async _acquireLock(t,a){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){let r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),o=(async()=>(await r,await a()))();return this.pendingInLock.push((async()=>{try{await o}catch{}})()),o}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;let r=a();for(this.pendingInLock.push((async()=>{try{await r}catch{}})()),await r;this.pendingInLock.length;){let o=[...this.pendingInLock];await Promise.all(o),this.pendingInLock.splice(0,o.length)}return await r}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{let a=await this.__loadSession();return await t(a)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null,a=await Jr(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",a),a!==null&&(this._isValidSession(a)?t=a:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!t)return{data:{session:null},error:null};let r=t.expires_at?t.expires_at*1e3-Date.now()<hc:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",t.expires_at),!r){if(this.userStorage){let s=await Jr(this.userStorage,this.storageKey+"-user");s?.user?t.user=s.user:t.user=Cc()}if(this.storage.isServer&&t.user){let s=this.suppressGetSessionWarning;t=new Proxy(t,{get:(l,u,d)=>(!s&&u==="user"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),s=!0,this.suppressGetSessionWarning=!0),Reflect.get(l,u,d))})}return{data:{session:t},error:null}}let{session:o,error:n}=await this._callRefreshToken(t.refresh_token);return n?{data:{session:null},error:n}:{data:{session:o},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(t){return t?await this._getUser(t):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(t){try{return t?await te(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:Ba}):await this._useSession(async a=>{var r,o,n;let{data:s,error:i}=a;if(i)throw i;return!(!((r=s.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new da}:await te(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(n=(o=s.session)===null||o===void 0?void 0:o.access_token)!==null&&n!==void 0?n:void 0,xform:Ba})})}catch(a){if(Q(a))return mS(a)&&(await this._removeSession(),await lr(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:a};throw a}}async updateUser(t,a={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(t,a))}async _updateUser(t,a={}){try{return await this._useSession(async r=>{let{data:o,error:n}=r;if(n)throw n;if(!o.session)throw new da;let s=o.session,i=null,l=null;this.flowType==="pkce"&&t.email!=null&&([i,l]=await Zo(this.storage,this.storageKey));let{data:u,error:d}=await te(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:a?.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:i,code_challenge_method:l}),jwt:s.access_token,xform:Ba});if(d)throw d;return s.user=u.user,await this._saveSession(s),await this._notifyAllSubscribers("USER_UPDATED",s),{data:{user:s.user},error:null}})}catch(r){if(Q(r))return{data:{user:null},error:r};throw r}}async setSession(t){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new da;let a=Date.now()/1e3,r=a,o=!0,n=null,{payload:s}=Sc(t.access_token);if(s.exp&&(r=s.exp,o=r<=a),o){let{session:i,error:l}=await this._callRefreshToken(t.refresh_token);if(l)return{data:{user:null,session:null},error:l};if(!i)return{data:{user:null,session:null},error:null};n=i}else{let{data:i,error:l}=await this._getUser(t.access_token);if(l)throw l;n={access_token:t.access_token,refresh_token:t.refresh_token,user:i.user,token_type:"bearer",expires_in:r-a,expires_at:r},await this._saveSession(n),await this._notifyAllSubscribers("SIGNED_IN",n)}return{data:{user:n.user,session:n},error:null}}catch(a){if(Q(a))return{data:{session:null,user:null},error:a};throw a}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async a=>{var r;if(!t){let{data:s,error:i}=a;if(i)throw i;t=(r=s.session)!==null&&r!==void 0?r:void 0}if(!t?.refresh_token)throw new da;let{session:o,error:n}=await this._callRefreshToken(t.refresh_token);return n?{data:{user:null,session:null},error:n}:o?{data:{user:o.user,session:o},error:null}:{data:{user:null,session:null},error:null}})}catch(a){if(Q(a))return{data:{user:null,session:null},error:a};throw a}}async _getSessionFromURL(t,a){try{if(!ca())throw new Xo("No browser detected.");if(t.error||t.error_description||t.error_code)throw new Xo(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(a){case"implicit":if(this.flowType==="pkce")throw new Bl("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Xo("Not a valid implicit grant flow url.");break;default:}if(a==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new Bl("No code detected.");let{data:h,error:m}=await this._exchangeCodeForSession(t.code);if(m)throw m;let C=new URL(window.location.href);return C.searchParams.delete("code"),window.history.replaceState(window.history.state,"",C.toString()),{data:{session:h.session,redirectType:null},error:null}}let{provider_token:r,provider_refresh_token:o,access_token:n,refresh_token:s,expires_in:i,expires_at:l,token_type:u}=t;if(!n||!i||!s||!u)throw new Xo("No session defined in URL");let d=Math.round(Date.now()/1e3),c=parseInt(i),f=d+c;l&&(f=parseInt(l));let g=f-d;g*1e3<=Wo&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${g}s, should have been closer to ${c}s`);let x=f-c;d-x>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",x,f,d):d-x<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",x,f,d);let{data:w,error:L}=await this._getUser(n);if(L)throw L;let y={provider_token:r,provider_refresh_token:o,access_token:n,expires_in:c,expires_at:f,refresh_token:s,token_type:u,user:w.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:y,redirectType:t.type},error:null}}catch(r){if(Q(r))return{data:{session:null,redirectType:null},error:r};throw r}}_isImplicitGrantCallback(t){return!!(t.access_token||t.error_description)}async _isPKCECallback(t){let a=await Jr(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&a)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async a=>{var r;let{data:o,error:n}=a;if(n)return{error:n};let s=(r=o.session)===null||r===void 0?void 0:r.access_token;if(s){let{error:i}=await this.admin.signOut(s,t);if(i&&!(pS(i)&&(i.status===404||i.status===401||i.status===403)))return{error:i}}return t!=="others"&&(await this._removeSession(),await lr(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(t){let a=LS(),r={id:a,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",a),this.stateChangeEmitters.delete(a)}};return this._debug("#onAuthStateChange()","registered callback with id",a),this.stateChangeEmitters.set(a,r),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(a)})))(),{data:{subscription:r}}}async _emitInitialSession(t){return await this._useSession(async a=>{var r,o;try{let{data:{session:n},error:s}=a;if(s)throw s;await((r=this.stateChangeEmitters.get(t))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",n)),this._debug("INITIAL_SESSION","callback id",t,"session",n)}catch(n){await((o=this.stateChangeEmitters.get(t))===null||o===void 0?void 0:o.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",n),console.error(n)}})}async resetPasswordForEmail(t,a={}){let r=null,o=null;this.flowType==="pkce"&&([r,o]=await Zo(this.storage,this.storageKey,!0));try{return await te(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:r,code_challenge_method:o,gotrue_meta_security:{captcha_token:a.captchaToken}},headers:this.headers,redirectTo:a.redirectTo})}catch(n){if(Q(n))return{data:null,error:n};throw n}}async getUserIdentities(){var t;try{let{data:a,error:r}=await this.getUser();if(r)throw r;return{data:{identities:(t=a.user.identities)!==null&&t!==void 0?t:[]},error:null}}catch(a){if(Q(a))return{data:null,error:a};throw a}}async linkIdentity(t){var a;try{let{data:r,error:o}=await this._useSession(async n=>{var s,i,l,u,d;let{data:c,error:f}=n;if(f)throw f;let g=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(s=t.options)===null||s===void 0?void 0:s.redirectTo,scopes:(i=t.options)===null||i===void 0?void 0:i.scopes,queryParams:(l=t.options)===null||l===void 0?void 0:l.queryParams,skipBrowserRedirect:!0});return await te(this.fetch,"GET",g,{headers:this.headers,jwt:(d=(u=c.session)===null||u===void 0?void 0:u.access_token)!==null&&d!==void 0?d:void 0})});if(o)throw o;return ca()&&!(!((a=t.options)===null||a===void 0)&&a.skipBrowserRedirect)&&window.location.assign(r?.url),{data:{provider:t.provider,url:r?.url},error:null}}catch(r){if(Q(r))return{data:{provider:t.provider,url:null},error:r};throw r}}async unlinkIdentity(t){try{return await this._useSession(async a=>{var r,o;let{data:n,error:s}=a;if(s)throw s;return await te(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(o=(r=n.session)===null||r===void 0?void 0:r.access_token)!==null&&o!==void 0?o:void 0})})}catch(a){if(Q(a))return{data:null,error:a};throw a}}async _refreshAccessToken(t){let a=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(a,"begin");try{let r=Date.now();return await PS(async o=>(o>0&&await kS(200*Math.pow(2,o-1)),this._debug(a,"refreshing attempt",o),await te(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:Fa})),(o,n)=>{let s=200*Math.pow(2,o);return n&&yc(n)&&Date.now()+s-r<Wo})}catch(r){if(this._debug(a,"error",r),Q(r))return{data:{session:null,user:null},error:r};throw r}finally{this._debug(a,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,a){let r=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:a.redirectTo,scopes:a.scopes,queryParams:a.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",a,"url",r),ca()&&!a.skipBrowserRedirect&&window.location.assign(r),{data:{provider:t,url:r},error:null}}async _recoverAndRefresh(){var t,a;let r="#_recoverAndRefresh()";this._debug(r,"begin");try{let o=await Jr(this.storage,this.storageKey);if(o&&this.userStorage){let s=await Jr(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!s&&(s={user:o.user},await Yo(this.userStorage,this.storageKey+"-user",s)),o.user=(t=s?.user)!==null&&t!==void 0?t:Cc()}else if(o&&!o.user&&!o.user){let s=await Jr(this.storage,this.storageKey+"-user");s&&s?.user?(o.user=s.user,await lr(this.storage,this.storageKey+"-user"),await Yo(this.storage,this.storageKey,o)):o.user=Cc()}if(this._debug(r,"session from storage",o),!this._isValidSession(o)){this._debug(r,"session is not valid"),o!==null&&await this._removeSession();return}let n=((a=o.expires_at)!==null&&a!==void 0?a:1/0)*1e3-Date.now()<hc;if(this._debug(r,`session has${n?"":" not"} expired with margin of ${hc}s`),n){if(this.autoRefreshToken&&o.refresh_token){let{error:s}=await this._callRefreshToken(o.refresh_token);s&&(console.error(s),yc(s)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",s),await this._removeSession()))}}else if(o.user&&o.user.__isUserNotAvailableProxy===!0)try{let{data:s,error:i}=await this._getUser(o.access_token);!i&&s?.user?(o.user=s.user,await this._saveSession(o),await this._notifyAllSubscribers("SIGNED_IN",o)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(s){console.error("Error getting user data:",s),this._debug(r,"error getting user data, skipping SIGNED_IN notification",s)}else await this._notifyAllSubscribers("SIGNED_IN",o)}catch(o){this._debug(r,"error",o),console.error(o);return}finally{this._debug(r,"end")}}async _callRefreshToken(t){var a,r;if(!t)throw new da;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let o=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(o,"begin");try{this.refreshingDeferred=new Vl;let{data:n,error:s}=await this._refreshAccessToken(t);if(s)throw s;if(!n.session)throw new da;await this._saveSession(n.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",n.session);let i={session:n.session,error:null};return this.refreshingDeferred.resolve(i),i}catch(n){if(this._debug(o,"error",n),Q(n)){let s={session:null,error:n};return yc(n)||await this._removeSession(),(a=this.refreshingDeferred)===null||a===void 0||a.resolve(s),s}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(n),n}finally{this.refreshingDeferred=null,this._debug(o,"end")}}async _notifyAllSubscribers(t,a,r=!0){let o=`#_notifyAllSubscribers(${t})`;this._debug(o,"begin",a,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:t,session:a});let n=[],s=Array.from(this.stateChangeEmitters.values()).map(async i=>{try{await i.callback(t,a)}catch(l){n.push(l)}});if(await Promise.all(s),n.length>0){for(let i=0;i<n.length;i+=1)console.error(n[i]);throw n[0]}}finally{this._debug(o,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0;let a=Object.assign({},t),r=a.user&&a.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!r&&a.user&&await Yo(this.userStorage,this.storageKey+"-user",{user:a.user});let o=Object.assign({},a);delete o.user;let n=ug(o);await Yo(this.storage,this.storageKey,n)}else{let o=ug(a);await Yo(this.storage,this.storageKey,o)}}async _removeSession(){this._debug("#_removeSession()"),await lr(this.storage,this.storageKey),await lr(this.storage,this.storageKey+"-code-verifier"),await lr(this.storage,this.storageKey+"-user"),this.userStorage&&await lr(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");let t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&ca()&&window?.removeEventListener&&window.removeEventListener("visibilitychange",t)}catch(a){console.error("removing visibilitychange callback failed",a)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");let t=setInterval(()=>this._autoRefreshTokenTick(),Wo);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");let t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{let t=Date.now();try{return await this._useSession(async a=>{let{data:{session:r}}=a;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}let o=Math.floor((r.expires_at*1e3-t)/Wo);this._debug("#_autoRefreshTokenTick()",`access token expires in ${o} ticks, a tick lasts ${Wo}ms, refresh threshold is ${mc} ticks`),o<=mc&&await this._callRefreshToken(r.refresh_token)})}catch(a){console.error("Auto refresh tick failed with error. This is likely a transient error.",a)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t.isAcquireTimeout||t instanceof jl)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!ca()||!window?.addEventListener)return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window?.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){let a=`#_onVisibilityChanged(${t})`;this._debug(a,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(a,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(t,a,r){let o=[`provider=${encodeURIComponent(a)}`];if(r?.redirectTo&&o.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r?.scopes&&o.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){let[n,s]=await Zo(this.storage,this.storageKey),i=new URLSearchParams({code_challenge:`${encodeURIComponent(n)}`,code_challenge_method:`${encodeURIComponent(s)}`});o.push(i.toString())}if(r?.queryParams){let n=new URLSearchParams(r.queryParams);o.push(n.toString())}return r?.skipBrowserRedirect&&o.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${t}?${o.join("&")}`}async _unenroll(t){try{return await this._useSession(async a=>{var r;let{data:o,error:n}=a;return n?{data:null,error:n}:await te(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(r=o?.session)===null||r===void 0?void 0:r.access_token})})}catch(a){if(Q(a))return{data:null,error:a};throw a}}async _enroll(t){try{return await this._useSession(async a=>{var r,o;let{data:n,error:s}=a;if(s)return{data:null,error:s};let i=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:{issuer:t.issuer}),{data:l,error:u}=await te(this.fetch,"POST",`${this.url}/factors`,{body:i,headers:this.headers,jwt:(r=n?.session)===null||r===void 0?void 0:r.access_token});return u?{data:null,error:u}:(t.factorType==="totp"&&(!((o=l?.totp)===null||o===void 0)&&o.qr_code)&&(l.totp.qr_code=`data:image/svg+xml;utf-8,${l.totp.qr_code}`),{data:l,error:null})})}catch(a){if(Q(a))return{data:null,error:a};throw a}}async _verify(t){return this._acquireLock(-1,async()=>{try{return await this._useSession(async a=>{var r;let{data:o,error:n}=a;if(n)return{data:null,error:n};let{data:s,error:i}=await te(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:{code:t.code,challenge_id:t.challengeId},headers:this.headers,jwt:(r=o?.session)===null||r===void 0?void 0:r.access_token});return i?{data:null,error:i}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+s.expires_in},s)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",s),{data:s,error:i})})}catch(a){if(Q(a))return{data:null,error:a};throw a}})}async _challenge(t){return this._acquireLock(-1,async()=>{try{return await this._useSession(async a=>{var r;let{data:o,error:n}=a;return n?{data:null,error:n}:await te(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:{channel:t.channel},headers:this.headers,jwt:(r=o?.session)===null||r===void 0?void 0:r.access_token})})}catch(a){if(Q(a))return{data:null,error:a};throw a}})}async _challengeAndVerify(t){let{data:a,error:r}=await this._challenge({factorId:t.factorId});return r?{data:null,error:r}:await this._verify({factorId:t.factorId,challengeId:a.id,code:t.code})}async _listFactors(){let{data:{user:t},error:a}=await this.getUser();if(a)return{data:null,error:a};let r=t?.factors||[],o=r.filter(s=>s.factor_type==="totp"&&s.status==="verified"),n=r.filter(s=>s.factor_type==="phone"&&s.status==="verified");return{data:{all:r,totp:o,phone:n},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async t=>{var a,r;let{data:{session:o},error:n}=t;if(n)return{data:null,error:n};if(!o)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let{payload:s}=Sc(o.access_token),i=null;s.aal&&(i=s.aal);let l=i;((r=(a=o.user.factors)===null||a===void 0?void 0:a.filter(c=>c.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(l="aal2");let d=s.amr||[];return{data:{currentLevel:i,nextLevel:l,currentAuthenticationMethods:d},error:null}}))}async fetchJwk(t,a={keys:[]}){let r=a.keys.find(i=>i.kid===t);if(r)return r;let o=Date.now();if(r=this.jwks.keys.find(i=>i.kid===t),r&&this.jwks_cached_at+fS>o)return r;let{data:n,error:s}=await te(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(s)throw s;return!n.keys||n.keys.length===0||(this.jwks=n,this.jwks_cached_at=o,r=n.keys.find(i=>i.kid===t),!r)?null:r}async getClaims(t,a={}){try{let r=t;if(!r){let{data:g,error:x}=await this.getSession();if(x||!g.session)return{data:null,error:x};r=g.session.access_token}let{header:o,payload:n,signature:s,raw:{header:i,payload:l}}=Sc(r);a?.allowExpired||AS(n.exp);let u=!o.alg||o.alg.startsWith("HS")||!o.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(o.kid,a?.keys?{keys:a.keys}:a?.jwks);if(!u){let{error:g}=await this.getUser(r);if(g)throw g;return{data:{claims:n,header:o,signature:s},error:null}}let d=RS(o.alg),c=await crypto.subtle.importKey("jwk",u,d,!0,["verify"]);if(!await crypto.subtle.verify(d,c,s,wS(`${i}.${l}`)))throw new Qo("Invalid JWT signature");return{data:{claims:n,header:o,signature:s},error:null}}catch(r){if(Q(r))return{data:null,error:r};throw r}}};on.nextInstanceID=0;var K1=on,pg=K1;var bc=class extends pg{constructor(t){super(t)}};var X1=function(e,t,a,r){function o(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function i(d){try{u(r.next(d))}catch(c){s(c)}}function l(d){try{u(r.throw(d))}catch(c){s(c)}}function u(d){d.done?n(d.value):o(d.value).then(i,l)}u((r=r.apply(e,t||[])).next())})},ql=class{constructor(t,a,r){var o,n,s;if(this.supabaseUrl=t,this.supabaseKey=a,!t)throw new Error("supabaseUrl is required.");if(!a)throw new Error("supabaseKey is required.");let i=sS(t),l=new URL(i);this.realtimeUrl=new URL("realtime/v1",l),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",l),this.storageUrl=new URL("storage/v1",l),this.functionsUrl=new URL("functions/v1",l);let u=`sb-${l.hostname.split(".")[0]}-auth-token`,d={db:aS,realtime:oS,auth:Object.assign(Object.assign({},rS),{storageKey:u}),global:tS},c=iS(r??{},d);this.storageKey=(o=c.auth.storageKey)!==null&&o!==void 0?o:"",this.headers=(n=c.global.headers)!==null&&n!==void 0?n:{},c.accessToken?(this.accessToken=c.accessToken,this.auth=new Proxy({},{get:(f,g)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(g)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((s=c.auth)!==null&&s!==void 0?s:{},this.headers,c.global.fetch),this.fetch=nS(a,this._getAccessToken.bind(this),c.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},c.realtime)),this.rest=new Uw(new URL("rest/v1",l).href,{headers:this.headers,schema:c.db.schema,fetch:this.fetch}),this.storage=new Ml(this.storageUrl.href,this.headers,this.fetch,r?.storage),c.accessToken||this._listenForAuthEvents()}get functions(){return new Cl(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(t){return this.rest.from(t)}schema(t){return this.rest.schema(t)}rpc(t,a={},r={}){return this.rest.rpc(t,a,r)}channel(t,a={config:{}}){return this.realtime.channel(t,a)}getChannels(){return this.realtime.getChannels()}removeChannel(t){return this.realtime.removeChannel(t)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var t,a;return X1(this,void 0,void 0,function*(){if(this.accessToken)return yield this.accessToken();let{data:r}=yield this.auth.getSession();return(a=(t=r.session)===null||t===void 0?void 0:t.access_token)!==null&&a!==void 0?a:null})}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:a,detectSessionInUrl:r,storage:o,storageKey:n,flowType:s,lock:i,debug:l},u,d){let c={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new bc({url:this.authUrl.href,headers:Object.assign(Object.assign({},c),u),storageKey:n,autoRefreshToken:t,persistSession:a,detectSessionInUrl:r,storage:o,flowType:s,lock:i,debug:l,fetch:d,hasCustomAuthorizationHeader:"Authorization"in this.headers})}_initRealtimeClient(t){return new ps(this.realtimeUrl.href,Object.assign(Object.assign({},t),{params:Object.assign({apikey:this.supabaseKey},t?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((a,r)=>{this._handleTokenChanged(a,"CLIENT",r?.access_token)})}_handleTokenChanged(t,a,r){(t==="TOKEN_REFRESHED"||t==="SIGNED_IN")&&this.changedAccessToken!==r?this.changedAccessToken=r:t==="SIGNED_OUT"&&(this.realtime.setAuth(),a=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};var FS=(e,t,a)=>new ql(e,t,a);function Q1(){if(typeof window<"u"||typeof process>"u"||process.version===void 0||process.version===null)return!1;let e=process.version.match(/^v(\d+)\./);return e?parseInt(e[1],10)<=18:!1}Q1()&&console.warn("\u26A0\uFE0F Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");function BS(e){var t,a,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(a=BS(e[t]))&&(r&&(r+=" "),r+=a)}else for(a in e)e[a]&&(r&&(r+=" "),r+=a);return r}function kc(){for(var e,t,a=0,r="",o=arguments.length;a<o;a++)(e=arguments[a])&&(t=BS(e))&&(r&&(r+=" "),r+=t);return r}var J1=e=>{let t=Z1(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{let i=s.split("-");return i[0]===""&&i.length!==1&&i.shift(),jS(i,t)||Y1(s)},getConflictingClassGroupIds:(s,i)=>{let l=a[s]||[];return i&&r[s]?[...l,...r[s]]:l}}},jS=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],r=t.nextPart.get(a),o=r?jS(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;let n=e.join("-");return t.validators.find(({validator:s})=>s(n))?.classGroupId},US=/^\[(.+)\]$/,Y1=e=>{if(US.test(e)){let t=US.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},Z1=e=>{let{theme:t,prefix:a}=e,r={nextPart:new Map,validators:[]};return tA(Object.entries(e.classGroups),a).forEach(([n,s])=>{hg(s,r,n,t)}),r},hg=(e,t,a,r)=>{e.forEach(o=>{if(typeof o=="string"){let n=o===""?t:VS(t,o);n.classGroupId=a;return}if(typeof o=="function"){if(eA(o)){hg(o(r),t,a,r);return}t.validators.push({validator:o,classGroupId:a});return}Object.entries(o).forEach(([n,s])=>{hg(s,VS(t,n),a,r)})})},VS=(e,t)=>{let a=e;return t.split("-").forEach(r=>{a.nextPart.has(r)||a.nextPart.set(r,{nextPart:new Map,validators:[]}),a=a.nextPart.get(r)}),a},eA=e=>e.isThemeGetter,tA=(e,t)=>t?e.map(([a,r])=>{let o=r.map(n=>typeof n=="string"?t+n:typeof n=="object"?Object.fromEntries(Object.entries(n).map(([s,i])=>[t+s,i])):n);return[a,o]}):e,aA=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,r=new Map,o=(n,s)=>{a.set(n,s),t++,t>e&&(t=0,r=a,a=new Map)};return{get(n){let s=a.get(n);if(s!==void 0)return s;if((s=r.get(n))!==void 0)return o(n,s),s},set(n,s){a.has(n)?a.set(n,s):o(n,s)}}};var rA=e=>{let{separator:t,experimentalParseClassName:a}=e,r=t.length===1,o=t[0],n=t.length,s=i=>{let l=[],u=0,d=0,c;for(let L=0;L<i.length;L++){let y=i[L];if(u===0){if(y===o&&(r||i.slice(L,L+n)===t)){l.push(i.slice(d,L)),d=L+n;continue}if(y==="/"){c=L;continue}}y==="["?u++:y==="]"&&u--}let f=l.length===0?i:i.substring(d),g=f.startsWith("!"),x=g?f.substring(1):f,w=c&&c>d?c-d:void 0;return{modifiers:l,hasImportantModifier:g,baseClassName:x,maybePostfixModifierPosition:w}};return a?i=>a({className:i,parseClassName:s}):s},oA=e=>{if(e.length<=1)return e;let t=[],a=[];return e.forEach(r=>{r[0]==="["?(t.push(...a.sort(),r),a=[]):a.push(r)}),t.push(...a.sort()),t},nA=e=>({cache:aA(e.cacheSize),parseClassName:rA(e),...J1(e)}),sA=/\s+/,iA=(e,t)=>{let{parseClassName:a,getClassGroupId:r,getConflictingClassGroupIds:o}=t,n=[],s=e.trim().split(sA),i="";for(let l=s.length-1;l>=0;l-=1){let u=s[l],{modifiers:d,hasImportantModifier:c,baseClassName:f,maybePostfixModifierPosition:g}=a(u),x=!!g,w=r(x?f.substring(0,g):f);if(!w){if(!x){i=u+(i.length>0?" "+i:i);continue}if(w=r(f),!w){i=u+(i.length>0?" "+i:i);continue}x=!1}let L=oA(d).join(":"),y=c?L+"!":L,h=y+w;if(n.includes(h))continue;n.push(h);let m=o(w,x);for(let C=0;C<m.length;++C){let I=m[C];n.push(y+I)}i=u+(i.length>0?" "+i:i)}return i};function lA(){let e=0,t,a,r="";for(;e<arguments.length;)(t=arguments[e++])&&(a=qS(t))&&(r&&(r+=" "),r+=a);return r}var qS=e=>{if(typeof e=="string")return e;let t,a="";for(let r=0;r<e.length;r++)e[r]&&(t=qS(e[r]))&&(a&&(a+=" "),a+=t);return a};function uA(e,...t){let a,r,o,n=s;function s(l){let u=t.reduce((d,c)=>c(d),e());return a=nA(u),r=a.cache.get,o=a.cache.set,n=i,i(l)}function i(l){let u=r(l);if(u)return u;let d=iA(l,a);return o(l,d),d}return function(){return n(lA.apply(null,arguments))}}var ke=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},HS=/^\[(?:([a-z-]+):)?(.+)\]$/i,dA=/^\d+\/\d+$/,cA=new Set(["px","full","screen"]),fA=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,pA=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,mA=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,hA=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,gA=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ur=e=>ws(e)||cA.has(e)||dA.test(e),Yr=e=>Ss(e,"length",IA),ws=e=>!!e&&!Number.isNaN(Number(e)),mg=e=>Ss(e,"number",ws),Hl=e=>!!e&&Number.isInteger(Number(e)),yA=e=>e.endsWith("%")&&ws(e.slice(0,-1)),Z=e=>HS.test(e),Zr=e=>fA.test(e),xA=new Set(["length","size","percentage"]),vA=e=>Ss(e,xA,zS),wA=e=>Ss(e,"position",zS),SA=new Set(["image","url"]),CA=e=>Ss(e,SA,kA),LA=e=>Ss(e,"",bA),zl=()=>!0,Ss=(e,t,a)=>{let r=HS.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):a(r[2]):!1},IA=e=>pA.test(e)&&!mA.test(e),zS=()=>!1,bA=e=>hA.test(e),kA=e=>gA.test(e);var PA=()=>{let e=ke("colors"),t=ke("spacing"),a=ke("blur"),r=ke("brightness"),o=ke("borderColor"),n=ke("borderRadius"),s=ke("borderSpacing"),i=ke("borderWidth"),l=ke("contrast"),u=ke("grayscale"),d=ke("hueRotate"),c=ke("invert"),f=ke("gap"),g=ke("gradientColorStops"),x=ke("gradientColorStopPositions"),w=ke("inset"),L=ke("margin"),y=ke("opacity"),h=ke("padding"),m=ke("saturate"),C=ke("scale"),I=ke("sepia"),P=ke("skew"),R=ke("space"),A=ke("translate"),q=()=>["auto","contain","none"],B=()=>["auto","hidden","clip","visible","scroll"],J=()=>["auto",Z,t],ue=()=>[Z,t],pt=()=>["",ur,Yr],Xa=()=>["auto",ws,Z],So=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Ke=()=>["solid","dashed","dotted","double","none"],xe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ze=()=>["start","end","center","between","around","evenly","stretch"],Ht=()=>["","0",Z],ma=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Xe=()=>[ws,Z];return{cacheSize:500,separator:":",theme:{colors:[zl],spacing:[ur,Yr],blur:["none","",Zr,Z],brightness:Xe(),borderColor:[e],borderRadius:["none","","full",Zr,Z],borderSpacing:ue(),borderWidth:pt(),contrast:Xe(),grayscale:Ht(),hueRotate:Xe(),invert:Ht(),gap:ue(),gradientColorStops:[e],gradientColorStopPositions:[yA,Yr],inset:J(),margin:J(),opacity:Xe(),padding:ue(),saturate:Xe(),scale:Xe(),sepia:Ht(),skew:Xe(),space:ue(),translate:ue()},classGroups:{aspect:[{aspect:["auto","square","video",Z]}],container:["container"],columns:[{columns:[Zr]}],"break-after":[{"break-after":ma()}],"break-before":[{"break-before":ma()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...So(),Z]}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:q()}],"overscroll-x":[{"overscroll-x":q()}],"overscroll-y":[{"overscroll-y":q()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Hl,Z]}],basis:[{basis:J()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Z]}],grow:[{grow:Ht()}],shrink:[{shrink:Ht()}],order:[{order:["first","last","none",Hl,Z]}],"grid-cols":[{"grid-cols":[zl]}],"col-start-end":[{col:["auto",{span:["full",Hl,Z]},Z]}],"col-start":[{"col-start":Xa()}],"col-end":[{"col-end":Xa()}],"grid-rows":[{"grid-rows":[zl]}],"row-start-end":[{row:["auto",{span:[Hl,Z]},Z]}],"row-start":[{"row-start":Xa()}],"row-end":[{"row-end":Xa()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Z]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Z]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...ze()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ze(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ze(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[h]}],px:[{px:[h]}],py:[{py:[h]}],ps:[{ps:[h]}],pe:[{pe:[h]}],pt:[{pt:[h]}],pr:[{pr:[h]}],pb:[{pb:[h]}],pl:[{pl:[h]}],m:[{m:[L]}],mx:[{mx:[L]}],my:[{my:[L]}],ms:[{ms:[L]}],me:[{me:[L]}],mt:[{mt:[L]}],mr:[{mr:[L]}],mb:[{mb:[L]}],ml:[{ml:[L]}],"space-x":[{"space-x":[R]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[R]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Z,t]}],"min-w":[{"min-w":[Z,t,"min","max","fit"]}],"max-w":[{"max-w":[Z,t,"none","full","min","max","fit","prose",{screen:[Zr]},Zr]}],h:[{h:[Z,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Z,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Z,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Z,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Zr,Yr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",mg]}],"font-family":[{font:[zl]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Z]}],"line-clamp":[{"line-clamp":["none",ws,mg]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ur,Z]}],"list-image":[{"list-image":["none",Z]}],"list-style-type":[{list:["none","disc","decimal",Z]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ke(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ur,Yr]}],"underline-offset":[{"underline-offset":["auto",ur,Z]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:ue()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Z]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Z]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...So(),wA]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",vA]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},CA]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[n]}],"rounded-s":[{"rounded-s":[n]}],"rounded-e":[{"rounded-e":[n]}],"rounded-t":[{"rounded-t":[n]}],"rounded-r":[{"rounded-r":[n]}],"rounded-b":[{"rounded-b":[n]}],"rounded-l":[{"rounded-l":[n]}],"rounded-ss":[{"rounded-ss":[n]}],"rounded-se":[{"rounded-se":[n]}],"rounded-ee":[{"rounded-ee":[n]}],"rounded-es":[{"rounded-es":[n]}],"rounded-tl":[{"rounded-tl":[n]}],"rounded-tr":[{"rounded-tr":[n]}],"rounded-br":[{"rounded-br":[n]}],"rounded-bl":[{"rounded-bl":[n]}],"border-w":[{border:[i]}],"border-w-x":[{"border-x":[i]}],"border-w-y":[{"border-y":[i]}],"border-w-s":[{"border-s":[i]}],"border-w-e":[{"border-e":[i]}],"border-w-t":[{"border-t":[i]}],"border-w-r":[{"border-r":[i]}],"border-w-b":[{"border-b":[i]}],"border-w-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...Ke(),"hidden"]}],"divide-x":[{"divide-x":[i]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[i]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:Ke()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...Ke()]}],"outline-offset":[{"outline-offset":[ur,Z]}],"outline-w":[{outline:[ur,Yr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:pt()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[ur,Yr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Zr,LA]}],"shadow-color":[{shadow:[zl]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...xe(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":xe()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Zr,Z]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[c]}],saturate:[{saturate:[m]}],sepia:[{sepia:[I]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[c]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[m]}],"backdrop-sepia":[{"backdrop-sepia":[I]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Z]}],duration:[{duration:Xe()}],ease:[{ease:["linear","in","out","in-out",Z]}],delay:[{delay:Xe()}],animate:[{animate:["none","spin","ping","pulse","bounce",Z]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[Hl,Z]}],"translate-x":[{"translate-x":[A]}],"translate-y":[{"translate-y":[A]}],"skew-x":[{"skew-x":[P]}],"skew-y":[{"skew-y":[P]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Z]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Z]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":ue()}],"scroll-mx":[{"scroll-mx":ue()}],"scroll-my":[{"scroll-my":ue()}],"scroll-ms":[{"scroll-ms":ue()}],"scroll-me":[{"scroll-me":ue()}],"scroll-mt":[{"scroll-mt":ue()}],"scroll-mr":[{"scroll-mr":ue()}],"scroll-mb":[{"scroll-mb":ue()}],"scroll-ml":[{"scroll-ml":ue()}],"scroll-p":[{"scroll-p":ue()}],"scroll-px":[{"scroll-px":ue()}],"scroll-py":[{"scroll-py":ue()}],"scroll-ps":[{"scroll-ps":ue()}],"scroll-pe":[{"scroll-pe":ue()}],"scroll-pt":[{"scroll-pt":ue()}],"scroll-pr":[{"scroll-pr":ue()}],"scroll-pb":[{"scroll-pb":ue()}],"scroll-pl":[{"scroll-pl":ue()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Z]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ur,Yr,mg]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var $S=uA(PA);function Jt(...e){return $S(kc(e))}var XS=M(le(),1);function De({className:e,type:t,...a}){return(0,XS.jsx)("input",{type:t,"data-slot":"input",className:Jt("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...a})}var qe=M(G(),1);var JS=M(G(),1);function QS(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function $l(...e){return t=>{let a=!1,r=e.map(o=>{let n=QS(o,t);return!a&&typeof n=="function"&&(a=!0),n});if(a)return()=>{for(let o=0;o<r.length;o++){let n=r[o];typeof n=="function"?n():QS(e[o],null)}}}}function dr(...e){return JS.useCallback($l(...e),e)}var Tc=M(le(),1),MA=Symbol.for("react.lazy"),Ac=qe[" use ".trim().toString()];function NA(e){return typeof e=="object"&&e!==null&&"then"in e}function YS(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===MA&&"_payload"in e&&NA(e._payload)}function OA(e){let t=FA(e),a=qe.forwardRef((r,o)=>{let{children:n,...s}=r;YS(n)&&typeof Ac=="function"&&(n=Ac(n._payload));let i=qe.Children.toArray(n),l=i.find(UA);if(l){let u=l.props.children,d=i.map(c=>c===l?qe.Children.count(u)>1?qe.Children.only(null):qe.isValidElement(u)?u.props.children:null:c);return(0,Tc.jsx)(t,{...s,ref:o,children:qe.isValidElement(u)?qe.cloneElement(u,void 0,d):null})}return(0,Tc.jsx)(t,{...s,ref:o,children:n})});return a.displayName=`${e}.Slot`,a}var ZS=OA("Slot");function FA(e){let t=qe.forwardRef((a,r)=>{let{children:o,...n}=a;if(YS(o)&&typeof Ac=="function"&&(o=Ac(o._payload)),qe.isValidElement(o)){let s=jA(o),i=VA(n,o.props);return o.type!==qe.Fragment&&(i.ref=r?$l(r,s):s),qe.cloneElement(o,i)}return qe.Children.count(o)>1?qe.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var BA=Symbol("radix.slottable");function UA(e){return qe.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===BA}function VA(e,t){let a={...t};for(let r in t){let o=e[r],n=t[r];/^on[A-Z]/.test(r)?o&&n?a[r]=(...i)=>{let l=n(...i);return o(...i),l}:o&&(a[r]=o):r==="style"?a[r]={...o,...n}:r==="className"&&(a[r]=[o,n].filter(Boolean).join(" "))}return{...e,...a}}function jA(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var eC=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,tC=kc,aC=(e,t)=>a=>{var r;if(t?.variants==null)return tC(e,a?.class,a?.className);let{variants:o,defaultVariants:n}=t,s=Object.keys(o).map(u=>{let d=a?.[u],c=n?.[u];if(d===null)return null;let f=eC(d)||eC(c);return o[u][f]}),i=a&&Object.entries(a).reduce((u,d)=>{let[c,f]=d;return f===void 0||(u[c]=f),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:c,className:f,...g}=d;return Object.entries(g).every(x=>{let[w,L]=x;return Array.isArray(L)?L.includes({...n,...i}[w]):{...n,...i}[w]===L})?[...u,c,f]:u},[]);return tC(e,s,l,a?.class,a?.className)};var rC=M(le(),1),qA=aC("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function ut({className:e,variant:t,size:a,asChild:r=!1,...o}){return(0,rC.jsx)(r?ZS:"button",{"data-slot":"button",className:Jt(qA({variant:t,size:a,className:e})),...o})}var AC=M(G(),1);var $=M(G(),1);var nC=M(G(),1),KA=M(Vh(),1);var Ge=M(G(),1);var Rc=M(le(),1);function oC(e){let t=HA(e),a=Ge.forwardRef((r,o)=>{let{children:n,...s}=r,i=Ge.Children.toArray(n),l=i.find($A);if(l){let u=l.props.children,d=i.map(c=>c===l?Ge.Children.count(u)>1?Ge.Children.only(null):Ge.isValidElement(u)?u.props.children:null:c);return(0,Rc.jsx)(t,{...s,ref:o,children:Ge.isValidElement(u)?Ge.cloneElement(u,void 0,d):null})}return(0,Rc.jsx)(t,{...s,ref:o,children:n})});return a.displayName=`${e}.Slot`,a}function HA(e){let t=Ge.forwardRef((a,r)=>{let{children:o,...n}=a;if(Ge.isValidElement(o)){let s=GA(o),i=WA(n,o.props);return o.type!==Ge.Fragment&&(i.ref=r?$l(r,s):s),Ge.cloneElement(o,i)}return Ge.Children.count(o)>1?Ge.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var zA=Symbol("radix.slottable");function $A(e){return Ge.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===zA}function WA(e,t){let a={...t};for(let r in t){let o=e[r],n=t[r];/^on[A-Z]/.test(r)?o&&n?a[r]=(...i)=>{let l=n(...i);return o(...i),l}:o&&(a[r]=o):r==="style"?a[r]={...o,...n}:r==="className"&&(a[r]=[o,n].filter(Boolean).join(" "))}return{...e,...a}}function GA(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var sC=M(le(),1),XA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Cs=XA.reduce((e,t)=>{let a=oC(`Primitive.${t}`),r=nC.forwardRef((o,n)=>{let{asChild:s,...i}=o,l=s?a:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),(0,sC.jsx)(l,{...i,ref:n})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});var Ot=M(G(),1);var iC=M(G(),1),Wl=globalThis?.document?iC.useLayoutEffect:()=>{};var lC=M(G(),1);function QA(e,t){return lC.useReducer((a,r)=>t[a][r]??a,e)}var Ls=e=>{let{present:t,children:a}=e,r=JA(t),o=typeof a=="function"?a({present:r.isPresent}):Ot.Children.only(a),n=dr(r.ref,YA(o));return typeof a=="function"||r.isPresent?Ot.cloneElement(o,{ref:n}):null};Ls.displayName="Presence";function JA(e){let[t,a]=Ot.useState(),r=Ot.useRef(null),o=Ot.useRef(e),n=Ot.useRef("none"),s=e?"mounted":"unmounted",[i,l]=QA(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return Ot.useEffect(()=>{let u=_c(r.current);n.current=i==="mounted"?u:"none"},[i]),Wl(()=>{let u=r.current,d=o.current;if(d!==e){let f=n.current,g=_c(u);e?l("MOUNT"):g==="none"||u?.display==="none"?l("UNMOUNT"):l(d&&f!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Wl(()=>{if(t){let u,d=t.ownerDocument.defaultView??window,c=g=>{let w=_c(r.current).includes(CSS.escape(g.animationName));if(g.target===t&&w&&(l("ANIMATION_END"),!o.current)){let L=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=L)})}},f=g=>{g.target===t&&(n.current=_c(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:Ot.useCallback(u=>{r.current=u?getComputedStyle(u):null,a(u)},[])}}function _c(e){return e?.animationName||"none"}function YA(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var cr=M(G(),1),uC=M(le(),1);function dC(e,t=[]){let a=[];function r(n,s){let i=cr.createContext(s),l=a.length;a=[...a,s];let u=c=>{let{scope:f,children:g,...x}=c,w=f?.[e]?.[l]||i,L=cr.useMemo(()=>x,Object.values(x));return(0,uC.jsx)(w.Provider,{value:L,children:g})};u.displayName=n+"Provider";function d(c,f){let g=f?.[e]?.[l]||i,x=cr.useContext(g);if(x)return x;if(s!==void 0)return s;throw new Error(`\`${c}\` must be used within \`${n}\``)}return[u,d]}let o=()=>{let n=a.map(s=>cr.createContext(s));return function(i){let l=i?.[e]||n;return cr.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return o.scopeName=e,[r,ZA(o,...t)]}function ZA(...e){let t=e[0];if(e.length===1)return t;let a=()=>{let r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(n){let s=r.reduce((i,{useScope:l,scopeName:u})=>{let c=l(n)[`__scope${u}`];return{...i,...c}},{});return cr.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return a.scopeName=t.scopeName,a}var Is=M(G(),1);function eo(e){let t=Is.useRef(e);return Is.useEffect(()=>{t.current=e}),Is.useMemo(()=>(...a)=>t.current?.(...a),[])}var Ec=M(G(),1),eR=M(le(),1),tR=Ec.createContext(void 0);function cC(e){let t=Ec.useContext(tR);return e||t||"ltr"}function fC(e,[t,a]){return Math.min(a,Math.max(t,e))}var eO=!!(typeof window<"u"&&window.document&&window.document.createElement);function to(e,t,{checkForDefaultPrevented:a=!0}={}){return function(o){if(e?.(o),a===!1||!o.defaultPrevented)return t?.(o)}}var mC=M(G(),1),fe=M(le(),1);function aR(e,t){return mC.useReducer((a,r)=>t[a][r]??a,e)}var gg="ScrollArea",[hC,cO]=dC(gg),[rR,fa]=hC(gg),gC=$.forwardRef((e,t)=>{let{__scopeScrollArea:a,type:r="hover",dir:o,scrollHideDelay:n=600,...s}=e,[i,l]=$.useState(null),[u,d]=$.useState(null),[c,f]=$.useState(null),[g,x]=$.useState(null),[w,L]=$.useState(null),[y,h]=$.useState(0),[m,C]=$.useState(0),[I,P]=$.useState(!1),[R,A]=$.useState(!1),q=dr(t,J=>l(J)),B=cC(o);return(0,fe.jsx)(rR,{scope:a,type:r,dir:B,scrollHideDelay:n,scrollArea:i,viewport:u,onViewportChange:d,content:c,onContentChange:f,scrollbarX:g,onScrollbarXChange:x,scrollbarXEnabled:I,onScrollbarXEnabledChange:P,scrollbarY:w,onScrollbarYChange:L,scrollbarYEnabled:R,onScrollbarYEnabledChange:A,onCornerWidthChange:h,onCornerHeightChange:C,children:(0,fe.jsx)(Cs.div,{dir:B,...s,ref:q,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":m+"px",...e.style}})})});gC.displayName=gg;var yC="ScrollAreaViewport",xC=$.forwardRef((e,t)=>{let{__scopeScrollArea:a,children:r,nonce:o,...n}=e,s=fa(yC,a),i=$.useRef(null),l=dr(t,i,s.onViewportChange);return(0,fe.jsxs)(fe.Fragment,{children:[(0,fe.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),(0,fe.jsx)(Cs.div,{"data-radix-scroll-area-viewport":"",...n,ref:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:(0,fe.jsx)("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});xC.displayName=yC;var Ua="ScrollAreaScrollbar",yg=$.forwardRef((e,t)=>{let{forceMount:a,...r}=e,o=fa(Ua,e.__scopeScrollArea),{onScrollbarXEnabledChange:n,onScrollbarYEnabledChange:s}=o,i=e.orientation==="horizontal";return $.useEffect(()=>(i?n(!0):s(!0),()=>{i?n(!1):s(!1)}),[i,n,s]),o.type==="hover"?(0,fe.jsx)(oR,{...r,ref:t,forceMount:a}):o.type==="scroll"?(0,fe.jsx)(nR,{...r,ref:t,forceMount:a}):o.type==="auto"?(0,fe.jsx)(vC,{...r,ref:t,forceMount:a}):o.type==="always"?(0,fe.jsx)(xg,{...r,ref:t}):null});yg.displayName=Ua;var oR=$.forwardRef((e,t)=>{let{forceMount:a,...r}=e,o=fa(Ua,e.__scopeScrollArea),[n,s]=$.useState(!1);return $.useEffect(()=>{let i=o.scrollArea,l=0;if(i){let u=()=>{window.clearTimeout(l),s(!0)},d=()=>{l=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return i.addEventListener("pointerenter",u),i.addEventListener("pointerleave",d),()=>{window.clearTimeout(l),i.removeEventListener("pointerenter",u),i.removeEventListener("pointerleave",d)}}},[o.scrollArea,o.scrollHideDelay]),(0,fe.jsx)(Ls,{present:a||n,children:(0,fe.jsx)(vC,{"data-state":n?"visible":"hidden",...r,ref:t})})}),nR=$.forwardRef((e,t)=>{let{forceMount:a,...r}=e,o=fa(Ua,e.__scopeScrollArea),n=e.orientation==="horizontal",s=Oc(()=>l("SCROLL_END"),100),[i,l]=aR("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return $.useEffect(()=>{if(i==="idle"){let u=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(u)}},[i,o.scrollHideDelay,l]),$.useEffect(()=>{let u=o.viewport,d=n?"scrollLeft":"scrollTop";if(u){let c=u[d],f=()=>{let g=u[d];c!==g&&(l("SCROLL"),s()),c=g};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[o.viewport,n,l,s]),(0,fe.jsx)(Ls,{present:a||i!=="hidden",children:(0,fe.jsx)(xg,{"data-state":i==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:to(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:to(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),vC=$.forwardRef((e,t)=>{let a=fa(Ua,e.__scopeScrollArea),{forceMount:r,...o}=e,[n,s]=$.useState(!1),i=e.orientation==="horizontal",l=Oc(()=>{if(a.viewport){let u=a.viewport.offsetWidth<a.viewport.scrollWidth,d=a.viewport.offsetHeight<a.viewport.scrollHeight;s(i?u:d)}},10);return bs(a.viewport,l),bs(a.content,l),(0,fe.jsx)(Ls,{present:r||n,children:(0,fe.jsx)(xg,{"data-state":n?"visible":"hidden",...o,ref:t})})}),xg=$.forwardRef((e,t)=>{let{orientation:a="vertical",...r}=e,o=fa(Ua,e.__scopeScrollArea),n=$.useRef(null),s=$.useRef(0),[i,l]=$.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=LC(i.viewport,i.content),d={...r,sizes:i,onSizesChange:l,hasThumb:u>0&&u<1,onThumbChange:f=>n.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function c(f,g){return cR(f,s.current,i,g)}return a==="horizontal"?(0,fe.jsx)(sR,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&n.current){let f=o.viewport.scrollLeft,g=pC(f,i,o.dir);n.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollLeft=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollLeft=c(f,o.dir))}}):a==="vertical"?(0,fe.jsx)(iR,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&n.current){let f=o.viewport.scrollTop,g=pC(f,i);n.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollTop=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollTop=c(f))}}):null}),sR=$.forwardRef((e,t)=>{let{sizes:a,onSizesChange:r,...o}=e,n=fa(Ua,e.__scopeScrollArea),[s,i]=$.useState(),l=$.useRef(null),u=dr(t,l,n.onScrollbarXChange);return $.useEffect(()=>{l.current&&i(getComputedStyle(l.current))},[l]),(0,fe.jsx)(SC,{"data-orientation":"horizontal",...o,ref:u,sizes:a,style:{bottom:0,left:n.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:n.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Nc(a)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,c)=>{if(n.viewport){let f=n.viewport.scrollLeft+d.deltaX;e.onWheelScroll(f),bC(f,c)&&d.preventDefault()}},onResize:()=>{l.current&&n.viewport&&s&&r({content:n.viewport.scrollWidth,viewport:n.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Mc(s.paddingLeft),paddingEnd:Mc(s.paddingRight)}})}})}),iR=$.forwardRef((e,t)=>{let{sizes:a,onSizesChange:r,...o}=e,n=fa(Ua,e.__scopeScrollArea),[s,i]=$.useState(),l=$.useRef(null),u=dr(t,l,n.onScrollbarYChange);return $.useEffect(()=>{l.current&&i(getComputedStyle(l.current))},[l]),(0,fe.jsx)(SC,{"data-orientation":"vertical",...o,ref:u,sizes:a,style:{top:0,right:n.dir==="ltr"?0:void 0,left:n.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Nc(a)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,c)=>{if(n.viewport){let f=n.viewport.scrollTop+d.deltaY;e.onWheelScroll(f),bC(f,c)&&d.preventDefault()}},onResize:()=>{l.current&&n.viewport&&s&&r({content:n.viewport.scrollHeight,viewport:n.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Mc(s.paddingTop),paddingEnd:Mc(s.paddingBottom)}})}})}),[lR,wC]=hC(Ua),SC=$.forwardRef((e,t)=>{let{__scopeScrollArea:a,sizes:r,hasThumb:o,onThumbChange:n,onThumbPointerUp:s,onThumbPointerDown:i,onThumbPositionChange:l,onDragScroll:u,onWheelScroll:d,onResize:c,...f}=e,g=fa(Ua,a),[x,w]=$.useState(null),L=dr(t,q=>w(q)),y=$.useRef(null),h=$.useRef(""),m=g.viewport,C=r.content-r.viewport,I=eo(d),P=eo(l),R=Oc(c,10);function A(q){if(y.current){let B=q.clientX-y.current.left,J=q.clientY-y.current.top;u({x:B,y:J})}}return $.useEffect(()=>{let q=B=>{let J=B.target;x?.contains(J)&&I(B,C)};return document.addEventListener("wheel",q,{passive:!1}),()=>document.removeEventListener("wheel",q,{passive:!1})},[m,x,C,I]),$.useEffect(P,[r,P]),bs(x,R),bs(g.content,R),(0,fe.jsx)(lR,{scope:a,scrollbar:x,hasThumb:o,onThumbChange:eo(n),onThumbPointerUp:eo(s),onThumbPositionChange:P,onThumbPointerDown:eo(i),children:(0,fe.jsx)(Cs.div,{...f,ref:L,style:{position:"absolute",...f.style},onPointerDown:to(e.onPointerDown,q=>{q.button===0&&(q.target.setPointerCapture(q.pointerId),y.current=x.getBoundingClientRect(),h.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),A(q))}),onPointerMove:to(e.onPointerMove,A),onPointerUp:to(e.onPointerUp,q=>{let B=q.target;B.hasPointerCapture(q.pointerId)&&B.releasePointerCapture(q.pointerId),document.body.style.webkitUserSelect=h.current,g.viewport&&(g.viewport.style.scrollBehavior=""),y.current=null})})})}),Dc="ScrollAreaThumb",vg=$.forwardRef((e,t)=>{let{forceMount:a,...r}=e,o=wC(Dc,e.__scopeScrollArea);return(0,fe.jsx)(Ls,{present:a||o.hasThumb,children:(0,fe.jsx)(uR,{ref:t,...r})})}),uR=$.forwardRef((e,t)=>{let{__scopeScrollArea:a,style:r,...o}=e,n=fa(Dc,a),s=wC(Dc,a),{onThumbPositionChange:i}=s,l=dr(t,c=>s.onThumbChange(c)),u=$.useRef(void 0),d=Oc(()=>{u.current&&(u.current(),u.current=void 0)},100);return $.useEffect(()=>{let c=n.viewport;if(c){let f=()=>{if(d(),!u.current){let g=fR(c,i);u.current=g,i()}};return i(),c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)}},[n.viewport,d,i]),(0,fe.jsx)(Cs.div,{"data-state":s.hasThumb?"visible":"hidden",...o,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:to(e.onPointerDownCapture,c=>{let g=c.target.getBoundingClientRect(),x=c.clientX-g.left,w=c.clientY-g.top;s.onThumbPointerDown({x,y:w})}),onPointerUp:to(e.onPointerUp,s.onThumbPointerUp)})});vg.displayName=Dc;var wg="ScrollAreaCorner",CC=$.forwardRef((e,t)=>{let a=fa(wg,e.__scopeScrollArea),r=!!(a.scrollbarX&&a.scrollbarY);return a.type!=="scroll"&&r?(0,fe.jsx)(dR,{...e,ref:t}):null});CC.displayName=wg;var dR=$.forwardRef((e,t)=>{let{__scopeScrollArea:a,...r}=e,o=fa(wg,a),[n,s]=$.useState(0),[i,l]=$.useState(0),u=!!(n&&i);return bs(o.scrollbarX,()=>{let d=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(d),l(d)}),bs(o.scrollbarY,()=>{let d=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(d),s(d)}),u?(0,fe.jsx)(Cs.div,{...r,ref:t,style:{width:n,height:i,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Mc(e){return e?parseInt(e,10):0}function LC(e,t){let a=e/t;return isNaN(a)?0:a}function Nc(e){let t=LC(e.viewport,e.content),a=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-a)*t;return Math.max(r,18)}function cR(e,t,a,r="ltr"){let o=Nc(a),n=o/2,s=t||n,i=o-s,l=a.scrollbar.paddingStart+s,u=a.scrollbar.size-a.scrollbar.paddingEnd-i,d=a.content-a.viewport,c=r==="ltr"?[0,d]:[d*-1,0];return IC([l,u],c)(e)}function pC(e,t,a="ltr"){let r=Nc(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,n=t.scrollbar.size-o,s=t.content-t.viewport,i=n-r,l=a==="ltr"?[0,s]:[s*-1,0],u=fC(e,l);return IC([0,s],[0,i])(u)}function IC(e,t){return a=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(a-e[0])}}function bC(e,t){return e>0&&e<t}var fR=(e,t=()=>{})=>{let a={left:e.scrollLeft,top:e.scrollTop},r=0;return(function o(){let n={left:e.scrollLeft,top:e.scrollTop},s=a.left!==n.left,i=a.top!==n.top;(s||i)&&t(),a=n,r=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(r)};function Oc(e,t){let a=eo(e),r=$.useRef(0);return $.useEffect(()=>()=>window.clearTimeout(r.current),[]),$.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(a,t)},[a,t])}function bs(e,t){let a=eo(t);Wl(()=>{let r=0;if(e){let o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(a)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,a])}var kC=gC,PC=xC;var TC=CC;var ao=M(le(),1),Sg=AC.forwardRef(({className:e,children:t,...a},r)=>(0,ao.jsxs)(kC,{"data-slot":"scroll-area",className:Jt("relative",e),...a,children:[(0,ao.jsx)(PC,{ref:r,"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),(0,ao.jsx)(mR,{}),(0,ao.jsx)(TC,{})]}));Sg.displayName="ScrollArea";function mR({className:e,orientation:t="vertical",...a}){return(0,ao.jsx)(yg,{"data-slot":"scroll-area-scrollbar",orientation:t,className:Jt("flex touch-none p-px transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...a,children:(0,ao.jsx)(vg,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}var Bc=M(G());var RC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),hR=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,r)=>r?r.toUpperCase():a.toLowerCase()),Cg=e=>{let t=hR(e);return t.charAt(0).toUpperCase()+t.slice(1)},Fc=(...e)=>e.filter((t,a,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===a).join(" ").trim(),_C=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var Gl=M(G());var EC={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var DC=(0,Gl.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:r,className:o="",children:n,iconNode:s,...i},l)=>(0,Gl.createElement)("svg",{ref:l,...EC,width:t,height:t,stroke:e,strokeWidth:r?Number(a)*24/Number(t):a,className:Fc("lucide",o),...!n&&!_C(i)&&{"aria-hidden":"true"},...i},[...s.map(([u,d])=>(0,Gl.createElement)(u,d)),...Array.isArray(n)?n:[n]]));var V=(e,t)=>{let a=(0,Bc.forwardRef)(({className:r,...o},n)=>(0,Bc.createElement)(DC,{ref:n,iconNode:t,className:Fc(`lucide-${RC(Cg(e))}`,`lucide-${e}`,r),...o}));return a.displayName=Cg(e),a};var gR=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Kl=V("activity",gR);var yR=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],ks=V("arrow-left",yR);var xR=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Xl=V("arrow-up",xR);var vR=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],Ql=V("calendar",vR);var wR=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Jl=V("chevron-down",wR);var SR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],ba=V("circle-alert",SR);var CR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],at=V("circle-check",CR);var LR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],ka=V("circle-x",LR);var IR=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],nn=V("clock",IR);var bR=[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]],fr=V("command",bR);var kR=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],pr=V("corner-down-left",kR);var PR=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],sn=V("credit-card",PR);var TR=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],ln=V("crown",TR);var AR=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],un=V("dollar-sign",AR);var RR=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],Ps=V("file-spreadsheet",RR);var _R=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],Ts=V("key",_R);var ER=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],Yl=V("laptop",ER);var DR=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ft=V("loader-circle",DR);var MR=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],As=V("mail",MR);var NR=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],Rs=V("map-pin",NR);var OR=[["path",{d:"M5 12h14",key:"1ays0h"}]],dn=V("minus",OR);var FR=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],Zl=V("paperclip",FR);var BR=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],_s=V("refresh-cw",BR);var UR=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],cn=V("search",UR);var VR=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],Es=V("shield",VR);var jR=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],eu=V("smartphone",jR);var qR=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],pa=V("sparkles",qR);var HR=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],Bt=V("square-pen",HR);var zR=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],tu=V("trending-up",zR);var $R=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Ds=V("users",$R);var WR=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ro=V("x",WR);var GR=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],au=V("zap",GR);var Oe=M(le(),1);function MC({phase:e,progressSteps:t=[]}){return(0,Oe.jsxs)("div",{className:"mb-3 rounded-lg bg-muted/40 px-3 py-3 text-xs text-muted-foreground transition-colors",children:[e==="thinking"&&t.length===0&&(0,Oe.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Oe.jsx)(Ft,{className:"h-3.5 w-3.5 animate-spin"}),(0,Oe.jsx)("span",{children:"Thinking\u2026"})]}),e==="searching"&&(0,Oe.jsxs)("div",{className:"space-y-2 animate-in fade-in-0 duration-300",children:[(0,Oe.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Oe.jsx)(cn,{className:"h-3.5 w-3.5 opacity-70"}),(0,Oe.jsx)("span",{children:"Searching across pages\u2026"})]}),(0,Oe.jsxs)("ul",{className:"ml-6 list-disc space-y-1",children:[(0,Oe.jsx)("li",{className:"opacity-90",children:"Checking recent changes"}),(0,Oe.jsx)("li",{className:"opacity-90",children:"Scanning documentation"}),(0,Oe.jsx)("li",{className:"opacity-90",children:"Summarizing relevant sections"})]})]}),(e==="thinking"||e==="executing"||e==="responding")&&t.length>0&&(0,Oe.jsxs)("div",{className:"space-y-2 animate-in fade-in-0 duration-200",children:[t.map((a,r)=>(0,Oe.jsxs)("div",{className:`flex items-center gap-2 transition-opacity duration-200 ${a.completed?"opacity-60":"opacity-100"}`,children:[a.completed?(0,Oe.jsx)(at,{className:"h-3.5 w-3.5 text-green-500 flex-shrink-0"}):(0,Oe.jsx)(Ft,{className:"h-3.5 w-3.5 animate-spin flex-shrink-0"}),(0,Oe.jsx)("span",{className:a.completed?"line-through":"",children:a.message})]},r)),e==="responding"&&(0,Oe.jsxs)("div",{className:"flex items-center gap-2 opacity-100 animate-in fade-in-0 duration-200",children:[(0,Oe.jsx)(Ft,{className:"h-3.5 w-3.5 animate-spin flex-shrink-0"}),(0,Oe.jsx)("span",{children:"Preparing response..."})]})]})]})}var NC=M(G(),1);var Pa=M(le(),1);function OC({title:e,links:t}){let[a,r]=NC.useState(!1);return(0,Pa.jsxs)("div",{className:"text-xs text-muted-foreground",children:[(0,Pa.jsx)("button",{type:"button",onClick:()=>r(o=>!o),className:"flex w-full items-center gap-2 px-0 py-0","aria-expanded":a,children:(0,Pa.jsxs)("div",{className:"flex items-center gap-1.5",children:[a?(0,Pa.jsx)(Jl,{className:"h-3 w-3 opacity-70"}):(0,Pa.jsx)(cn,{className:"h-3 w-3 opacity-70"}),(0,Pa.jsx)("span",{children:e})]})}),a&&t.length>0&&(0,Pa.jsx)("ul",{className:"ml-5 mt-1 space-y-0.5",children:t.map(o=>(0,Pa.jsx)("li",{children:(0,Pa.jsx)("a",{href:o.href,target:"_blank",rel:"noreferrer",className:"text-primary hover:underline",children:o.label})},o.href))})]})}var ou=M(le(),1),Va=M(G(),1);var FC=M(G(),1),Ms=(0,FC.createContext)({});var BC=M(G(),1);function Ns(e){let t=(0,BC.useRef)(null);return t.current===null&&(t.current=e()),t.current}var Ig=M(le(),1),HC=M(G(),1),fn=M(G(),1);var UC=M(G(),1),oo=(0,UC.createContext)(null);var jC=M(le(),1),Uc=M(G(),1),mr=M(G(),1);var VC=M(G(),1),Os=(0,VC.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});var Lg=class extends Uc.Component{getSnapshotBeforeUpdate(t){let a=this.props.childRef.current;if(a&&t.isPresent&&!this.props.isPresent){let r=this.props.sizeRef.current;r.height=a.offsetHeight||0,r.width=a.offsetWidth||0,r.top=a.offsetTop,r.left=a.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}};function qC({children:e,isPresent:t}){let a=(0,mr.useId)(),r=(0,mr.useRef)(null),o=(0,mr.useRef)({width:0,height:0,top:0,left:0}),{nonce:n}=(0,mr.useContext)(Os);return(0,mr.useInsertionEffect)(()=>{let{width:s,height:i,top:l,left:u}=o.current;if(t||!r.current||!s||!i)return;r.current.dataset.motionPopId=a;let d=document.createElement("style");return n&&(d.nonce=n),document.head.appendChild(d),d.sheet&&d.sheet.insertRule(`
16
16
  [data-motion-pop-id="${a}"] {
17
17
  position: absolute !important;
18
18
  width: ${s}px !important;
@@ -20,11 +20,11 @@ Error generating stack: `+n.message+`
20
20
  top: ${l}px !important;
21
21
  left: ${u}px !important;
22
22
  }
23
- `),()=>{document.head.removeChild(d)}},[t]),(0,jC.jsx)(Lg,{isPresent:t,childRef:r,sizeRef:o,children:Uc.cloneElement(e,{ref:r})})}var zC=({children:e,initial:t,isPresent:a,onExitComplete:r,custom:o,presenceAffectsLayout:n,mode:s})=>{let i=Ns(KR),l=(0,fn.useId)(),u=(0,fn.useCallback)(c=>{i.set(c,!0);for(let f of i.values())if(!f)return;r&&r()},[i,r]),d=(0,fn.useMemo)(()=>({id:l,initial:t,isPresent:a,custom:o,onExitComplete:u,register:c=>(i.set(c,!1),()=>i.delete(c))}),n?[Math.random(),u]:[a,u]);return(0,fn.useMemo)(()=>{i.forEach((c,f)=>i.set(f,!1))},[a]),HC.useEffect(()=>{!a&&!i.size&&r&&r()},[a]),s==="popLayout"&&(e=(0,Ig.jsx)(qC,{isPresent:a,children:e})),(0,Ig.jsx)(oo.Provider,{value:d,children:e})};function KR(){return new Map}var no=M(G(),1);function Vc(e=!0){let t=(0,no.useContext)(oo);if(t===null)return[!0,null];let{isPresent:a,onExitComplete:r,register:o}=t,n=(0,no.useId)();(0,no.useEffect)(()=>{e&&o(n)},[e]);let s=(0,no.useCallback)(()=>e&&r&&r(n),[n,r,e]);return!a&&r?[!1,s]:[!0]}var jc=M(G(),1),ru=e=>e.key||"";function bg(e){let t=[];return jc.Children.forEach(e,a=>{(0,jc.isValidElement)(a)&&t.push(a)}),t}var qc=M(G(),1);var Fs=typeof window<"u";var Hc=Fs?qc.useLayoutEffect:qc.useEffect;var kg=({children:e,custom:t,initial:a=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:n="sync",propagate:s=!1})=>{let[i,l]=Vc(s),u=(0,Va.useMemo)(()=>bg(e),[e]),d=s&&!i?[]:u.map(ru),c=(0,Va.useRef)(!0),f=(0,Va.useRef)(u),g=Ns(()=>new Map),[x,w]=(0,Va.useState)(u),[L,y]=(0,Va.useState)(u);Hc(()=>{c.current=!1,f.current=u;for(let C=0;C<L.length;C++){let I=ru(L[C]);d.includes(I)?g.delete(I):g.get(I)!==!0&&g.set(I,!1)}},[L,d.length,d.join("-")]);let h=[];if(u!==x){let C=[...u];for(let I=0;I<L.length;I++){let P=L[I],R=ru(P);d.includes(R)||(C.splice(I,0,P),h.push(P))}n==="wait"&&h.length&&(C=h),y(bg(C)),w(u);return}let{forceRender:m}=(0,Va.useContext)(Ms);return(0,ou.jsx)(ou.Fragment,{children:L.map(C=>{let I=ru(C),P=s&&!i?!1:u===L||d.includes(I),R=()=>{if(g.has(I))g.set(I,!0);else return;let A=!0;g.forEach(q=>{q||(A=!1)}),A&&(m?.(),y(f.current),s&&l?.(),r&&r())};return(0,ou.jsx)(zC,{isPresent:P,initial:!c.current||a?void 0:!1,custom:P?void 0:t,presenceAffectsLayout:o,mode:n,onExitComplete:P?void 0:R,children:C},I)})})};var ge=e=>e;var hr=ge,Ta=ge;function pn(e){let t;return()=>(t===void 0&&(t=e()),t)}var Yt=(e,t,a)=>{let r=t-e;return r===0?1:(a-e)/r};var Be=e=>e*1e3,dt=e=>e/1e3;var Bs={skipAnimations:!1,useManualTiming:!1};function $C(e){let t=new Set,a=new Set,r=!1,o=!1,n=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1};function i(u){n.has(u)&&(l.schedule(u),e()),u(s)}let l={schedule:(u,d=!1,c=!1)=>{let g=c&&r?t:a;return d&&n.add(u),g.has(u)||g.add(u),u},cancel:u=>{a.delete(u),n.delete(u)},process:u=>{if(s=u,r){o=!0;return}r=!0,[t,a]=[a,t],t.forEach(i),t.clear(),r=!1,o&&(o=!1,l.process(u))}};return l}var zc=["read","resolveKeyframes","update","preRender","render","postRender"],XR=40;function $c(e,t){let a=!1,r=!0,o={delta:0,timestamp:0,isProcessing:!1},n=()=>a=!0,s=zc.reduce((y,h)=>(y[h]=$C(n),y),{}),{read:i,resolveKeyframes:l,update:u,preRender:d,render:c,postRender:f}=s,g=()=>{let y=Bs.useManualTiming?o.timestamp:performance.now();a=!1,o.delta=r?1e3/60:Math.max(Math.min(y-o.timestamp,XR),1),o.timestamp=y,o.isProcessing=!0,i.process(o),l.process(o),u.process(o),d.process(o),c.process(o),f.process(o),o.isProcessing=!1,a&&t&&(r=!1,e(g))},x=()=>{a=!0,r=!0,o.isProcessing||e(g)};return{schedule:zc.reduce((y,h)=>{let m=s[h];return y[h]=(C,I=!1,P=!1)=>(a||x(),m.schedule(C,I,P)),y},{}),cancel:y=>{for(let h=0;h<zc.length;h++)s[zc[h]].cancel(y)},state:o,steps:s}}var{schedule:ee,cancel:Zt,state:Ue,steps:Wc}=$c(typeof requestAnimationFrame<"u"?requestAnimationFrame:ge,!0);var WC=M(G(),1),Gc=(0,WC.createContext)({strict:!1});var GC={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},gr={};for(let e in GC)gr[e]={isEnabled:t=>GC[e].some(a=>!!t[a])};function KC(e){for(let t in e)gr[t]={...gr[t],...e[t]}}var QR=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function nu(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||QR.has(e)}var XC=e=>!nu(e);function JR(e){e&&(XC=t=>t.startsWith("on")?!nu(t):e(t))}try{JR(Ek("@emotion/is-prop-valid").default)}catch{}function QC(e,t,a){let r={};for(let o in e)o==="values"&&typeof e.values=="object"||(XC(o)||a===!0&&nu(o)||!t&&!nu(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}function JC(e){if(typeof Proxy>"u")return e;let t=new Map,a=(...r)=>e(...r);return new Proxy(a,{get:(r,o)=>o==="create"?e:(t.has(o)||t.set(o,e(o)),t.get(o))})}var Zc=M(le(),1);var js=M(G(),1);var YC=M(G(),1),so=(0,YC.createContext)({});var Qc=M(G(),1);function yr(e){return typeof e=="string"||Array.isArray(e)}function io(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}var Kc=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],su=["initial",...Kc];function mn(e){return io(e.animate)||su.some(t=>yr(e[t]))}function Xc(e){return!!(mn(e)||e.variants)}function ZC(e,t){if(mn(e)){let{initial:a,animate:r}=e;return{initial:a===!1||yr(a)?a:void 0,animate:yr(r)?r:void 0}}return e.inherit!==!1?t:{}}function tL(e){let{initial:t,animate:a}=ZC(e,(0,Qc.useContext)(so));return(0,Qc.useMemo)(()=>({initial:t,animate:a}),[eL(t),eL(a)])}function eL(e){return Array.isArray(e)?e.join(" "):e}var aL=Symbol.for("motionComponentSymbol");var rL=M(G(),1);function xr(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function oL(e,t,a){return(0,rL.useCallback)(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),a&&(typeof a=="function"?a(r):xr(a)&&(a.current=r))},[t])}var Ut=M(G(),1);var Us=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase();var YR="framerAppearId",Jc="data-"+Us(YR);var{schedule:Vs,cancel:MU}=$c(queueMicrotask,!1);var nL=M(G(),1),Yc=(0,nL.createContext)({});function sL(e,t,a,r,o){var n,s;let{visualElement:i}=(0,Ut.useContext)(so),l=(0,Ut.useContext)(Gc),u=(0,Ut.useContext)(oo),d=(0,Ut.useContext)(Os).reducedMotion,c=(0,Ut.useRef)(null);r=r||l.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:i,props:a,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d}));let f=c.current,g=(0,Ut.useContext)(Yc);f&&!f.projection&&o&&(f.type==="html"||f.type==="svg")&&ZR(c.current,a,o,g);let x=(0,Ut.useRef)(!1);(0,Ut.useInsertionEffect)(()=>{f&&x.current&&f.update(a,u)});let w=a[Jc],L=(0,Ut.useRef)(!!w&&!(!((n=window.MotionHandoffIsComplete)===null||n===void 0)&&n.call(window,w))&&((s=window.MotionHasOptimisedAnimation)===null||s===void 0?void 0:s.call(window,w)));return Hc(()=>{f&&(x.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),Vs.render(f.render),L.current&&f.animationState&&f.animationState.animateChanges())}),(0,Ut.useEffect)(()=>{f&&(!L.current&&f.animationState&&f.animationState.animateChanges(),L.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)===null||y===void 0||y.call(window,w)}),L.current=!1))}),f}function ZR(e,t,a,r){let{layoutId:o,layout:n,drag:s,dragConstraints:i,layoutScroll:l,layoutRoot:u}=t;e.projection=new a(e.latestValues,t["data-framer-portal-id"]?void 0:iL(e.parent)),e.projection.setOptions({layoutId:o,layout:n,alwaysMeasureLayout:!!s||i&&xr(i),visualElement:e,animationType:typeof n=="string"?n:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:u})}function iL(e){if(e)return e.options.allowProjection!==!1?e.projection:iL(e.parent)}function lL({preloadedFeatures:e,createVisualElement:t,useRender:a,useVisualState:r,Component:o}){var n,s;e&&KC(e);function i(u,d){let c,f={...(0,js.useContext)(Os),...u,layoutId:e_(u)},{isStatic:g}=f,x=tL(u),w=r(u,g);if(!g&&Fs){t_(f,e);let L=a_(f);c=L.MeasureLayout,x.visualElement=sL(o,w,f,t,L.ProjectionNode)}return(0,Zc.jsxs)(so.Provider,{value:x,children:[c&&x.visualElement?(0,Zc.jsx)(c,{visualElement:x.visualElement,...f}):null,a(o,u,oL(w,x.visualElement,d),w,g,x.visualElement)]})}i.displayName=`motion.${typeof o=="string"?o:`create(${(s=(n=o.displayName)!==null&&n!==void 0?n:o.name)!==null&&s!==void 0?s:""})`}`;let l=(0,js.forwardRef)(i);return l[aL]=o,l}function e_({layoutId:e}){let t=(0,js.useContext)(Ms).id;return t&&e!==void 0?t+"-"+e:e}function t_(e,t){let a=(0,js.useContext)(Gc).strict}function a_(e){let{drag:t,layout:a}=gr;if(!t&&!a)return{};let r={...t,...a};return{MeasureLayout:t?.isEnabled(e)||a?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}var uL=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function qs(e){return typeof e!="string"||e.includes("-")?!1:!!(uL.indexOf(e)>-1||/[A-Z]/u.test(e))}var Pg=M(G(),1);function dL(e){let t=[{},{}];return e?.values.forEach((a,r)=>{t[0][r]=a.get(),t[1][r]=a.getVelocity()}),t}function Hs(e,t,a,r){if(typeof t=="function"){let[o,n]=dL(r);t=t(a!==void 0?a:e.custom,o,n)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){let[o,n]=dL(r);t=t(a!==void 0?a:e.custom,o,n)}return t}var iu=e=>Array.isArray(e);var cL=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),fL=e=>iu(e)?e[e.length-1]||0:e;var Ce=e=>!!(e&&e.getVelocity);function zs(e){let t=Ce(e)?e.get():e;return cL(t)?t.toValue():t}function r_({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:a},r,o,n){let s={latestValues:o_(r,o,n,e),renderState:t()};return a&&(s.onMount=i=>a({props:r,current:i,...s}),s.onUpdate=i=>a(i)),s}var ef=e=>(t,a)=>{let r=(0,Pg.useContext)(so),o=(0,Pg.useContext)(oo),n=()=>r_(e,t,r,o);return a?n():Ns(n)};function o_(e,t,a,r){let o={},n=r(e,{});for(let f in n)o[f]=zs(n[f]);let{initial:s,animate:i}=e,l=mn(e),u=Xc(e);t&&u&&!l&&e.inherit!==!1&&(s===void 0&&(s=t.initial),i===void 0&&(i=t.animate));let d=a?a.initial===!1:!1;d=d||s===!1;let c=d?i:s;if(c&&typeof c!="boolean"&&!io(c)){let f=Array.isArray(c)?c:[c];for(let g=0;g<f.length;g++){let x=Hs(e,f[g]);if(x){let{transitionEnd:w,transition:L,...y}=x;for(let h in y){let m=y[h];if(Array.isArray(m)){let C=d?m.length-1:0;m=m[C]}m!==null&&(o[h]=m)}for(let h in w)o[h]=w[h]}}}return o}var ja=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Vt=new Set(ja);var pL=e=>t=>typeof t=="string"&&t.startsWith(e),tf=pL("--"),n_=pL("var(--"),$s=e=>n_(e)?s_.test(e.split("/*")[0].trim()):!1,s_=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;var af=(e,t)=>t&&typeof e=="number"?t.transform(e):e;var ct=(e,t,a)=>a>t?t:a<e?e:a;var qa={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},vr={...qa,transform:e=>ct(0,1,e)},lu={...qa,default:1};var uu=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ha=uu("deg"),Pt=uu("%"),H=uu("px"),mL=uu("vh"),hL=uu("vw"),Tg={...Pt,parse:e=>Pt.parse(e)/100,transform:e=>Pt.transform(e*100)};var gL={borderWidth:H,borderTopWidth:H,borderRightWidth:H,borderBottomWidth:H,borderLeftWidth:H,borderRadius:H,radius:H,borderTopLeftRadius:H,borderTopRightRadius:H,borderBottomRightRadius:H,borderBottomLeftRadius:H,width:H,maxWidth:H,height:H,maxHeight:H,top:H,right:H,bottom:H,left:H,padding:H,paddingTop:H,paddingRight:H,paddingBottom:H,paddingLeft:H,margin:H,marginTop:H,marginRight:H,marginBottom:H,marginLeft:H,backgroundPositionX:H,backgroundPositionY:H};var yL={rotate:Ha,rotateX:Ha,rotateY:Ha,rotateZ:Ha,scale:lu,scaleX:lu,scaleY:lu,scaleZ:lu,skew:Ha,skewX:Ha,skewY:Ha,distance:H,translateX:H,translateY:H,translateZ:H,x:H,y:H,z:H,perspective:H,transformPerspective:H,opacity:vr,originX:Tg,originY:Tg,originZ:H};var Ag={...qa,transform:Math.round};var Ws={...gL,...yL,zIndex:Ag,size:H,fillOpacity:vr,strokeOpacity:vr,numOctaves:Ag};var i_={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},l_=ja.length;function xL(e,t,a){let r="",o=!0;for(let n=0;n<l_;n++){let s=ja[n],i=e[s];if(i===void 0)continue;let l=!0;if(typeof i=="number"?l=i===(s.startsWith("scale")?1:0):l=parseFloat(i)===0,!l||a){let u=af(i,Ws[s]);if(!l){o=!1;let d=i_[s]||s;r+=`${d}(${u}) `}a&&(t[s]=u)}}return r=r.trim(),a?r=a(t,o?"":r):o&&(r="none"),r}function Gs(e,t,a){let{style:r,vars:o,transformOrigin:n}=e,s=!1,i=!1;for(let l in t){let u=t[l];if(Vt.has(l)){s=!0;continue}else if(tf(l)){o[l]=u;continue}else{let d=af(u,Ws[l]);l.startsWith("origin")?(i=!0,n[l]=d):r[l]=d}}if(t.transform||(s||a?r.transform=xL(t,e.transform,a):r.transform&&(r.transform="none")),i){let{originX:l="50%",originY:u="50%",originZ:d=0}=n;r.transformOrigin=`${l} ${u} ${d}`}}var u_={offset:"stroke-dashoffset",array:"stroke-dasharray"},d_={offset:"strokeDashoffset",array:"strokeDasharray"};function vL(e,t,a=1,r=0,o=!0){e.pathLength=1;let n=o?u_:d_;e[n.offset]=H.transform(-r);let s=H.transform(t),i=H.transform(a);e[n.array]=`${s} ${i}`}function wL(e,t,a){return typeof e=="string"?e:H.transform(t+a*e)}function SL(e,t,a){let r=wL(t,e.x,e.width),o=wL(a,e.y,e.height);return`${r} ${o}`}function Ks(e,{attrX:t,attrY:a,attrScale:r,originX:o,originY:n,pathLength:s,pathSpacing:i=1,pathOffset:l=0,...u},d,c){if(Gs(e,u,c),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:f,style:g,dimensions:x}=e;f.transform&&(x&&(g.transform=f.transform),delete f.transform),x&&(o!==void 0||n!==void 0||g.transform)&&(g.transformOrigin=SL(x,o!==void 0?o:.5,n!==void 0?n:.5)),t!==void 0&&(f.x=t),a!==void 0&&(f.y=a),r!==void 0&&(f.scale=r),s!==void 0&&vL(f,s,i,l,!1)}var Xs=()=>({style:{},transform:{},transformOrigin:{},vars:{}});var rf=()=>({...Xs(),attrs:{}});var Qs=e=>typeof e=="string"&&e.toLowerCase()==="svg";function of(e,{style:t,vars:a},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(let n in a)e.style.setProperty(n,a[n])}var nf=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function sf(e,t,a,r){of(e,t,void 0,r);for(let o in t.attrs)e.setAttribute(nf.has(o)?o:Us(o),t.attrs[o])}var Js={};function CL(e){Object.assign(Js,e)}function lf(e,{layout:t,layoutId:a}){return Vt.has(e)||e.startsWith("origin")||(t||a!==void 0)&&(!!Js[e]||e==="opacity")}function Ys(e,t,a){var r;let{style:o}=e,n={};for(let s in o)(Ce(o[s])||t.style&&Ce(t.style[s])||lf(s,e)||((r=a?.getValue(s))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(n[s]=o[s]);return n}function uf(e,t,a){let r=Ys(e,t,a);for(let o in e)if(Ce(e[o])||Ce(t[o])){let n=ja.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[n]=e[o]}return r}function c_(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}var LL=["x","y","width","height","cx","cy","r"],IL={useVisualState:ef({scrapeMotionValuesFromProps:uf,createRenderState:rf,onUpdate:({props:e,prevProps:t,current:a,renderState:r,latestValues:o})=>{if(!a)return;let n=!!e.drag;if(!n){for(let i in o)if(Vt.has(i)){n=!0;break}}if(!n)return;let s=!t;if(t)for(let i=0;i<LL.length;i++){let l=LL[i];e[l]!==t[l]&&(s=!0)}s&&ee.read(()=>{c_(a,r),ee.render(()=>{Ks(r,o,Qs(a.tagName),e.transformTemplate),sf(a,r)})})}})};var bL={useVisualState:ef({scrapeMotionValuesFromProps:Ys,createRenderState:Xs})};var Zs=M(G(),1);var kL=M(G(),1);function Rg(e,t,a){for(let r in t)!Ce(t[r])&&!lf(r,a)&&(e[r]=t[r])}function f_({transformTemplate:e},t){return(0,kL.useMemo)(()=>{let a=Xs();return Gs(a,t,e),Object.assign({},a.vars,a.style)},[t])}function p_(e,t){let a=e.style||{},r={};return Rg(r,a,e),Object.assign(r,f_(e,t)),r}function PL(e,t){let a={},r=p_(e,t);return e.drag&&e.dragListener!==!1&&(a.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(a.tabIndex=0),a.style=r,a}var TL=M(G(),1);function AL(e,t,a,r){let o=(0,TL.useMemo)(()=>{let n=rf();return Ks(n,t,Qs(r),e.transformTemplate),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let n={};Rg(n,e.style,e),o.style={...n,...o.style}}return o}function RL(e=!1){return(a,r,o,{latestValues:n},s)=>{let l=(qs(a)?AL:PL)(r,n,s,a),u=QC(r,typeof a=="string",e),d=a!==Zs.Fragment?{...u,...l,ref:o}:{},{children:c}=r,f=(0,Zs.useMemo)(()=>Ce(c)?c.get():c,[c]);return(0,Zs.createElement)(a,{...d,children:f})}}function _L(e,t){return function(r,{forwardMotionProps:o}={forwardMotionProps:!1}){let s={...qs(r)?IL:bL,preloadedFeatures:e,useRender:RL(o),createVisualElement:t,Component:r};return lL(s)}}function _g(e,t){if(!Array.isArray(t))return!1;let a=t.length;if(a!==e.length)return!1;for(let r=0;r<a;r++)if(t[r]!==e[r])return!1;return!0}function lo(e,t,a){let r=e.getProps();return Hs(r,t,a!==void 0?a:r.custom,e)}var Eg=pn(()=>window.ScrollTimeline!==void 0);var du=class{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,a){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=a}attachTimeline(t,a){let r=this.animations.map(o=>{if(Eg()&&o.attachTimeline)return o.attachTimeline(t);if(typeof a=="function")return a(o)});return()=>{r.forEach((o,n)=>{o&&o(),this.animations[n].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let a=0;a<this.animations.length;a++)t=Math.max(t,this.animations[a].duration);return t}runAll(t){this.animations.forEach(a=>a[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}};var cu=class extends du{then(t,a){return Promise.all(this.animations).then(t).catch(a)}};function uo(e,t){return e?e[t]||e.default||e:void 0}function ei(e){let t=0,a=50,r=e.next(t);for(;!r.done&&t<2e4;)t+=a,r=e.next(t);return t>=2e4?1/0:t}function co(e){return typeof e=="function"}function fu(e,t){e.timeline=t,e.onfinish=null}var ti=e=>Array.isArray(e)&&typeof e[0]=="number";var Mg={linearEasing:void 0};function EL(e,t){let a=pn(e);return()=>{var r;return(r=Mg[t])!==null&&r!==void 0?r:a()}}var fo=EL(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");var pu=(e,t,a=10)=>{let r="",o=Math.max(Math.round(t/a),2);for(let n=0;n<o;n++)r+=e(Yt(0,o-1,n))+", ";return`linear(${r.substring(0,r.length-2)})`};function cf(e){return!!(typeof e=="function"&&fo()||!e||typeof e=="string"&&(e in df||fo())||ti(e)||Array.isArray(e)&&e.every(cf))}var ai=([e,t,a,r])=>`cubic-bezier(${e}, ${t}, ${a}, ${r})`,df={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ai([0,.65,.55,1]),circOut:ai([.55,0,1,.45]),backIn:ai([.31,.01,.66,-.59]),backOut:ai([.33,1.53,.69,.99])};function ri(e,t){if(e)return typeof e=="function"&&fo()?pu(e,t):ti(e)?ai(e):Array.isArray(e)?e.map(a=>ri(a,t)||df.easeOut):df[e]}var ea={x:!1,y:!1};function oi(){return ea.x||ea.y}function Ng(e,t,a){var r;if(e instanceof Element)return[e];if(typeof e=="string"){let o=document;t&&(o=t.current);let n=(r=a?.[e])!==null&&r!==void 0?r:o.querySelectorAll(e);return n?Array.from(n):[]}return Array.from(e)}function ff(e,t){let a=Ng(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[a,o,()=>r.abort()]}function DL(e){return t=>{t.pointerType==="touch"||oi()||e(t)}}function Og(e,t,a={}){let[r,o,n]=ff(e,a),s=DL(i=>{let{target:l}=i,u=t(i);if(typeof u!="function"||!l)return;let d=DL(c=>{u(c),l.removeEventListener("pointerleave",d)});l.addEventListener("pointerleave",d,o)});return r.forEach(i=>{i.addEventListener("pointerenter",s,o)}),n}var pf=(e,t)=>t?e===t?!0:pf(e,t.parentElement):!1;var hn=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;var m_=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function ML(e){return m_.has(e.tagName)||e.tabIndex!==-1}var gn=new WeakSet;function NL(e){return t=>{t.key==="Enter"&&e(t)}}function Fg(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}var OL=(e,t)=>{let a=e.currentTarget;if(!a)return;let r=NL(()=>{if(gn.has(a))return;Fg(a,"down");let o=NL(()=>{Fg(a,"up")}),n=()=>Fg(a,"cancel");a.addEventListener("keyup",o,t),a.addEventListener("blur",n,t)});a.addEventListener("keydown",r,t),a.addEventListener("blur",()=>a.removeEventListener("keydown",r),t)};function FL(e){return hn(e)&&!oi()}function Bg(e,t,a={}){let[r,o,n]=ff(e,a),s=i=>{let l=i.currentTarget;if(!FL(i)||gn.has(l))return;gn.add(l);let u=t(i),d=(g,x)=>{window.removeEventListener("pointerup",c),window.removeEventListener("pointercancel",f),!(!FL(g)||!gn.has(l))&&(gn.delete(l),typeof u=="function"&&u(g,{success:x}))},c=g=>{d(g,a.useGlobalTarget||pf(l,g.target))},f=g=>{d(g,!1)};window.addEventListener("pointerup",c,o),window.addEventListener("pointercancel",f,o)};return r.forEach(i=>{!ML(i)&&i.getAttribute("tabindex")===null&&(i.tabIndex=0),(a.useGlobalTarget?window:i).addEventListener("pointerdown",s,o),i.addEventListener("focus",u=>OL(u,o),o)}),n}function Ug(e){return e==="x"||e==="y"?ea[e]?null:(ea[e]=!0,()=>{ea[e]=!1}):ea.x||ea.y?null:(ea.x=ea.y=!0,()=>{ea.x=ea.y=!1})}var mf=new Set(["width","height","top","left","right","bottom",...ja]);var hf;function g_(){hf=void 0}var wt={now:()=>(hf===void 0&&wt.set(Ue.isProcessing||Bs.useManualTiming?Ue.timestamp:performance.now()),hf),set:e=>{hf=e,queueMicrotask(g_)}};function ni(e,t){e.indexOf(t)===-1&&e.push(t)}function si(e,t){let a=e.indexOf(t);a>-1&&e.splice(a,1)}var po=class{constructor(){this.subscriptions=[]}add(t){return ni(this.subscriptions,t),()=>si(this.subscriptions,t)}notify(t,a,r){let o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,a,r);else for(let n=0;n<o;n++){let s=this.subscriptions[n];s&&s(t,a,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}};function gf(e,t){return t?e*(1e3/t):0}var UL=30,y_=e=>!isNaN(parseFloat(e)),VL={current:void 0},Vg=class{constructor(t,a={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,o=!0)=>{let n=wt.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),o&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=a.owner}setCurrent(t){this.current=t,this.updatedAt=wt.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=y_(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,a){this.events[t]||(this.events[t]=new po);let r=this.events[t].add(a);return t==="change"?()=>{r(),ee.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(let t in this.events)this.events[t].clear()}attach(t,a){this.passiveEffect=t,this.stopPassiveEffect=a}set(t,a=!0){!a||!this.passiveEffect?this.updateAndNotify(t,a):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,a,r){this.set(a),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,a=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,a&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return VL.current&&VL.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let t=wt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>UL)return 0;let a=Math.min(this.updatedAt-this.prevUpdatedAt,UL);return gf(parseFloat(this.current)-parseFloat(this.prevFrameValue),a)}start(t){return this.stop(),new Promise(a=>{this.hasAnimated=!0,this.animation=t(a),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function wr(e,t){return new Vg(e,t)}function x_(e,t,a){e.hasValue(t)?e.getValue(t).set(a):e.addValue(t,wr(a))}function jL(e,t){let a=lo(e,t),{transitionEnd:r={},transition:o={},...n}=a||{};n={...n,...r};for(let s in n){let i=fL(n[s]);x_(e,s,i)}}function qL(e){return!!(Ce(e)&&e.add)}function mu(e,t){let a=e.getValue("willChange");if(qL(a))return a.add(t)}function yf(e){return e.props[Jc]}var xf={current:!1};var HL=(e,t,a)=>(((1-3*a+3*t)*e+(3*a-6*t))*e+3*t)*e,v_=1e-7,w_=12;function S_(e,t,a,r,o){let n,s,i=0;do s=t+(a-t)/2,n=HL(s,r,o)-e,n>0?a=s:t=s;while(Math.abs(n)>v_&&++i<w_);return s}function mo(e,t,a,r){if(e===t&&a===r)return ge;let o=n=>S_(n,0,1,e,a);return n=>n===0||n===1?n:HL(o(n),t,r)}var vf=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2;var wf=e=>t=>1-e(1-t);var jg=mo(.33,1.53,.69,.99),hu=wf(jg),Sf=vf(hu);var Cf=e=>(e*=2)<1?.5*hu(e):.5*(2-Math.pow(2,-10*(e-1)));var Lf=e=>1-Math.sin(Math.acos(e)),If=wf(Lf),bf=vf(Lf);var kf=e=>/^0[^.\s]+$/u.test(e);function zL(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||kf(e):!0}var ho=e=>Math.round(e*1e5)/1e5;var ii=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function $L(e){return e==null}var WL=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;var li=(e,t)=>a=>!!(typeof a=="string"&&WL.test(a)&&a.startsWith(e)||t&&!$L(a)&&Object.prototype.hasOwnProperty.call(a,t)),Pf=(e,t,a)=>r=>{if(typeof r!="string")return r;let[o,n,s,i]=r.match(ii);return{[e]:parseFloat(o),[t]:parseFloat(n),[a]:parseFloat(s),alpha:i!==void 0?parseFloat(i):1}};var C_=e=>ct(0,255,e),qg={...qa,transform:e=>Math.round(C_(e))},za={test:li("rgb","red"),parse:Pf("red","green","blue"),transform:({red:e,green:t,blue:a,alpha:r=1})=>"rgba("+qg.transform(e)+", "+qg.transform(t)+", "+qg.transform(a)+", "+ho(vr.transform(r))+")"};function L_(e){let t="",a="",r="",o="";return e.length>5?(t=e.substring(1,3),a=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),a=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,a+=a,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(a,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}var gu={test:li("#"),parse:L_,transform:za.transform};var go={test:li("hsl","hue"),parse:Pf("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:a,alpha:r=1})=>"hsla("+Math.round(e)+", "+Pt.transform(ho(t))+", "+Pt.transform(ho(a))+", "+ho(vr.transform(r))+")"};var He={test:e=>za.test(e)||gu.test(e)||go.test(e),parse:e=>za.test(e)?za.parse(e):go.test(e)?go.parse(e):gu.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?za.transform(e):go.transform(e)};var GL=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function I_(e){var t,a;return isNaN(e)&&typeof e=="string"&&(((t=e.match(ii))===null||t===void 0?void 0:t.length)||0)+(((a=e.match(GL))===null||a===void 0?void 0:a.length)||0)>0}var XL="number",QL="color",b_="var",k_="var(",KL="${}",P_=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function yn(e){let t=e.toString(),a=[],r={color:[],number:[],var:[]},o=[],n=0,i=t.replace(P_,l=>(He.test(l)?(r.color.push(n),o.push(QL),a.push(He.parse(l))):l.startsWith(k_)?(r.var.push(n),o.push(b_),a.push(l)):(r.number.push(n),o.push(XL),a.push(parseFloat(l))),++n,KL)).split(KL);return{values:a,split:i,indexes:r,types:o}}function JL(e){return yn(e).values}function YL(e){let{split:t,types:a}=yn(e),r=t.length;return o=>{let n="";for(let s=0;s<r;s++)if(n+=t[s],o[s]!==void 0){let i=a[s];i===XL?n+=ho(o[s]):i===QL?n+=He.transform(o[s]):n+=o[s]}return n}}var T_=e=>typeof e=="number"?0:e;function A_(e){let t=JL(e);return YL(e)(t.map(T_))}var Tt={test:I_,parse:JL,createTransformer:YL,getAnimatableNone:A_};var R_=new Set(["brightness","contrast","saturate","opacity"]);function __(e){let[t,a]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;let[r]=a.match(ii)||[];if(!r)return e;let o=a.replace(r,""),n=R_.has(t)?1:0;return r!==a&&(n*=100),t+"("+n+o+")"}var E_=/\b([a-z-]*)\(.*?\)/gu,yu={...Tt,getAnimatableNone:e=>{let t=e.match(E_);return t?t.map(__).join(" "):e}};var D_={...Ws,color:He,backgroundColor:He,outlineColor:He,fill:He,stroke:He,borderColor:He,borderTopColor:He,borderRightColor:He,borderBottomColor:He,borderLeftColor:He,filter:yu,WebkitFilter:yu},ui=e=>D_[e];function Tf(e,t){let a=ui(e);return a!==yu&&(a=Tt),a.getAnimatableNone?a.getAnimatableNone(t):void 0}var M_=new Set(["auto","none","0"]);function ZL(e,t,a){let r=0,o;for(;r<e.length&&!o;){let n=e[r];typeof n=="string"&&!M_.has(n)&&yn(n).values.length&&(o=e[r]),r++}if(o&&a)for(let n of t)e[n]=Tf(a,o)}var Hg=e=>e===qa||e===H,eI=(e,t)=>parseFloat(e.split(", ")[t]),tI=(e,t)=>(a,{transform:r})=>{if(r==="none"||!r)return 0;let o=r.match(/^matrix3d\((.+)\)$/u);if(o)return eI(o[1],t);{let n=r.match(/^matrix\((.+)\)$/u);return n?eI(n[1],e):0}},N_=new Set(["x","y","z"]),O_=ja.filter(e=>!N_.has(e));function aI(e){let t=[];return O_.forEach(a=>{let r=e.getValue(a);r!==void 0&&(t.push([a,r.get()]),r.set(a.startsWith("scale")?1:0))}),t}var xn={width:({x:e},{paddingLeft:t="0",paddingRight:a="0"})=>e.max-e.min-parseFloat(t)-parseFloat(a),height:({y:e},{paddingTop:t="0",paddingBottom:a="0"})=>e.max-e.min-parseFloat(t)-parseFloat(a),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:tI(4,13),y:tI(5,14)};xn.translateX=xn.x;xn.translateY=xn.y;var vn=new Set,zg=!1,$g=!1;function rI(){if($g){let e=Array.from(vn).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),a=new Map;t.forEach(r=>{let o=aI(r);o.length&&(a.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();let o=a.get(r);o&&o.forEach(([n,s])=>{var i;(i=r.getValue(n))===null||i===void 0||i.set(s)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}$g=!1,zg=!1,vn.forEach(e=>e.complete()),vn.clear()}function oI(){vn.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&($g=!0)})}function nI(){oI(),rI()}var yo=class{constructor(t,a,r,o,n,s=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=a,this.name=r,this.motionValue=o,this.element=n,this.isAsync=s}scheduleResolve(){this.isScheduled=!0,this.isAsync?(vn.add(this),zg||(zg=!0,ee.read(oI),ee.resolveKeyframes(rI))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:t,name:a,element:r,motionValue:o}=this;for(let n=0;n<t.length;n++)if(t[n]===null)if(n===0){let s=o?.get(),i=t[t.length-1];if(s!==void 0)t[0]=s;else if(r&&a){let l=r.readValue(a,i);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=i),o&&s===void 0&&o.set(t[0])}else t[n]=t[n-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),vn.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,vn.delete(this))}resume(){this.isComplete||this.scheduleResolve()}};var Af=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);var F_=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function B_(e){let t=F_.exec(e);if(!t)return[,];let[,a,r,o]=t;return[`--${a??r}`,o]}var U_=4;function Wg(e,t,a=1){Ta(a<=U_,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);let[r,o]=B_(e);if(!r)return;let n=window.getComputedStyle(t).getPropertyValue(r);if(n){let s=n.trim();return Af(s)?parseFloat(s):s}return $s(o)?Wg(o,t,a+1):o}var Rf=e=>t=>t.test(e);var sI={test:e=>e==="auto",parse:e=>e};var Gg=[qa,H,Pt,Ha,hL,mL,sI],Kg=e=>Gg.find(Rf(e));var di=class extends yo{constructor(t,a,r,o,n){super(t,a,r,o,n,!0)}readKeyframes(){let{unresolvedKeyframes:t,element:a,name:r}=this;if(!a||!a.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let u=t[l];if(typeof u=="string"&&(u=u.trim(),$s(u))){let d=Wg(u,a.current);d!==void 0&&(t[l]=d),l===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!mf.has(r)||t.length!==2)return;let[o,n]=t,s=Kg(o),i=Kg(n);if(s!==i)if(Hg(s)&&Hg(i))for(let l=0;l<t.length;l++){let u=t[l];typeof u=="string"&&(t[l]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){let{unresolvedKeyframes:t,name:a}=this,r=[];for(let o=0;o<t.length;o++)zL(t[o])&&r.push(o);r.length&&ZL(t,r,a)}measureInitialState(){let{element:t,unresolvedKeyframes:a,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=xn[r](t.measureViewportBox(),window.getComputedStyle(t.current)),a[0]=this.measuredOrigin;let o=a[a.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){var t;let{element:a,name:r,unresolvedKeyframes:o}=this;if(!a||!a.current)return;let n=a.getValue(r);n&&n.jump(this.measuredOrigin,!1);let s=o.length-1,i=o[s];o[s]=xn[r](a.measureViewportBox(),window.getComputedStyle(a.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([l,u])=>{a.getValue(l).set(u)}),this.resolveNoneKeyframes()}};var Xg=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Tt.test(e)||e==="0")&&!e.startsWith("url("));function V_(e){let t=e[0];if(e.length===1)return!0;for(let a=0;a<e.length;a++)if(e[a]!==t)return!0}function iI(e,t,a,r){let o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;let n=e[e.length-1],s=Xg(o,t),i=Xg(n,t);return hr(s===i,`You are trying to animate ${t} from "${o}" to "${n}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${n} via the \`style\` property.`),!s||!i?!1:V_(e)||(a==="spring"||co(a))&&r}var j_=e=>e!==null;function xo(e,{repeat:t,repeatType:a="loop"},r){let o=e.filter(j_),n=t&&a!=="loop"&&t%2===1?0:o.length-1;return!n||r===void 0?o[n]:r}var q_=40,ci=class{constructor({autoplay:t=!0,delay:a=0,type:r="keyframes",repeat:o=0,repeatDelay:n=0,repeatType:s="loop",...i}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=wt.now(),this.options={autoplay:t,delay:a,type:r,repeat:o,repeatDelay:n,repeatType:s,...i},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>q_?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&nI(),this._resolved}onKeyframesResolved(t,a){this.resolvedAt=wt.now(),this.hasAttemptedResolve=!0;let{name:r,type:o,velocity:n,delay:s,onComplete:i,onUpdate:l,isGenerator:u}=this.options;if(!u&&!iI(t,r,o,n))if(xf.current||!s){l&&l(xo(t,this.options,a)),i&&i(),this.resolveFinishedPromise();return}else this.options.duration=0;let d=this.initPlayback(t,a);d!==!1&&(this._resolved={keyframes:t,finalKeyframe:a,...d},this.onPostResolved())}onPostResolved(){}then(t,a){return this.currentFinishedPromise.then(t,a)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}};var ie=(e,t,a)=>e+(t-e)*a;function Qg(e,t,a){return a<0&&(a+=1),a>1&&(a-=1),a<1/6?e+(t-e)*6*a:a<1/2?t:a<2/3?e+(t-e)*(2/3-a)*6:e}function lI({hue:e,saturation:t,lightness:a,alpha:r}){e/=360,t/=100,a/=100;let o=0,n=0,s=0;if(!t)o=n=s=a;else{let i=a<.5?a*(1+t):a+t-a*t,l=2*a-i;o=Qg(l,i,e+1/3),n=Qg(l,i,e),s=Qg(l,i,e-1/3)}return{red:Math.round(o*255),green:Math.round(n*255),blue:Math.round(s*255),alpha:r}}function fi(e,t){return a=>a>0?t:e}var Jg=(e,t,a)=>{let r=e*e,o=a*(t*t-r)+r;return o<0?0:Math.sqrt(o)},H_=[gu,za,go],z_=e=>H_.find(t=>t.test(e));function uI(e){let t=z_(e);if(hr(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let a=t.parse(e);return t===go&&(a=lI(a)),a}var Yg=(e,t)=>{let a=uI(e),r=uI(t);if(!a||!r)return fi(e,t);let o={...a};return n=>(o.red=Jg(a.red,r.red,n),o.green=Jg(a.green,r.green,n),o.blue=Jg(a.blue,r.blue,n),o.alpha=ie(a.alpha,r.alpha,n),za.transform(o))};var $_=(e,t)=>a=>t(e(a)),$a=(...e)=>e.reduce($_);var _f=new Set(["none","hidden"]);function dI(e,t){return _f.has(e)?a=>a<=0?e:t:a=>a>=1?t:e}function W_(e,t){return a=>ie(e,t,a)}function Ef(e){return typeof e=="number"?W_:typeof e=="string"?$s(e)?fi:He.test(e)?Yg:X_:Array.isArray(e)?cI:typeof e=="object"?He.test(e)?Yg:G_:fi}function cI(e,t){let a=[...e],r=a.length,o=e.map((n,s)=>Ef(n)(n,t[s]));return n=>{for(let s=0;s<r;s++)a[s]=o[s](n);return a}}function G_(e,t){let a={...e,...t},r={};for(let o in a)e[o]!==void 0&&t[o]!==void 0&&(r[o]=Ef(e[o])(e[o],t[o]));return o=>{for(let n in r)a[n]=r[n](o);return a}}function K_(e,t){var a;let r=[],o={color:0,var:0,number:0};for(let n=0;n<t.values.length;n++){let s=t.types[n],i=e.indexes[s][o[s]],l=(a=e.values[i])!==null&&a!==void 0?a:0;r[n]=l,o[s]++}return r}var X_=(e,t)=>{let a=Tt.createTransformer(t),r=yn(e),o=yn(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?_f.has(e)&&!o.values.length||_f.has(t)&&!r.values.length?dI(e,t):$a(cI(K_(r,o),o.values),a):(hr(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),fi(e,t))};function Df(e,t,a){return typeof e=="number"&&typeof t=="number"&&typeof a=="number"?ie(e,t,a):Ef(e)(e,t)}var Q_=5;function Mf(e,t,a){let r=Math.max(t-Q_,0);return gf(a-e(r),t-r)}var Pe={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};var Zg=.001;function fI({duration:e=Pe.duration,bounce:t=Pe.bounce,velocity:a=Pe.velocity,mass:r=Pe.mass}){let o,n;hr(e<=Be(Pe.maxDuration),"Spring duration must be 10 seconds or less");let s=1-t;s=ct(Pe.minDamping,Pe.maxDamping,s),e=ct(Pe.minDuration,Pe.maxDuration,dt(e)),s<1?(o=u=>{let d=u*s,c=d*e,f=d-a,g=Nf(u,s),x=Math.exp(-c);return Zg-f/g*x},n=u=>{let c=u*s*e,f=c*a+a,g=Math.pow(s,2)*Math.pow(u,2)*e,x=Math.exp(-c),w=Nf(Math.pow(u,2),s);return(-o(u)+Zg>0?-1:1)*((f-g)*x)/w}):(o=u=>{let d=Math.exp(-u*e),c=(u-a)*e+1;return-Zg+d*c},n=u=>{let d=Math.exp(-u*e),c=(a-u)*(e*e);return d*c});let i=5/e,l=Y_(o,n,i);if(e=Be(e),isNaN(l))return{stiffness:Pe.stiffness,damping:Pe.damping,duration:e};{let u=Math.pow(l,2)*r;return{stiffness:u,damping:s*2*Math.sqrt(r*u),duration:e}}}var J_=12;function Y_(e,t,a){let r=a;for(let o=1;o<J_;o++)r=r-e(r)/t(r);return r}function Nf(e,t){return e*Math.sqrt(1-t*t)}var Z_=["duration","bounce"],eE=["stiffness","damping","mass"];function pI(e,t){return t.some(a=>e[a]!==void 0)}function tE(e){let t={velocity:Pe.velocity,stiffness:Pe.stiffness,damping:Pe.damping,mass:Pe.mass,isResolvedFromDuration:!1,...e};if(!pI(e,eE)&&pI(e,Z_))if(e.visualDuration){let a=e.visualDuration,r=2*Math.PI/(a*1.2),o=r*r,n=2*ct(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:Pe.mass,stiffness:o,damping:n}}else{let a=fI(e);t={...t,...a,mass:Pe.mass},t.isResolvedFromDuration=!0}return t}function Of(e=Pe.visualDuration,t=Pe.bounce){let a=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e,{restSpeed:r,restDelta:o}=a,n=a.keyframes[0],s=a.keyframes[a.keyframes.length-1],i={done:!1,value:n},{stiffness:l,damping:u,mass:d,duration:c,velocity:f,isResolvedFromDuration:g}=tE({...a,velocity:-dt(a.velocity||0)}),x=f||0,w=u/(2*Math.sqrt(l*d)),L=s-n,y=dt(Math.sqrt(l/d)),h=Math.abs(L)<5;r||(r=h?Pe.restSpeed.granular:Pe.restSpeed.default),o||(o=h?Pe.restDelta.granular:Pe.restDelta.default);let m;if(w<1){let I=Nf(y,w);m=P=>{let R=Math.exp(-w*y*P);return s-R*((x+w*y*L)/I*Math.sin(I*P)+L*Math.cos(I*P))}}else if(w===1)m=I=>s-Math.exp(-y*I)*(L+(x+y*L)*I);else{let I=y*Math.sqrt(w*w-1);m=P=>{let R=Math.exp(-w*y*P),A=Math.min(I*P,300);return s-R*((x+w*y*L)*Math.sinh(A)+I*L*Math.cosh(A))/I}}let C={calculatedDuration:g&&c||null,next:I=>{let P=m(I);if(g)i.done=I>=c;else{let R=0;w<1&&(R=I===0?Be(x):Mf(m,I,P));let A=Math.abs(R)<=r,q=Math.abs(s-P)<=o;i.done=A&&q}return i.value=i.done?s:P,i},toString:()=>{let I=Math.min(ei(C),2e4),P=pu(R=>C.next(I*R).value,I,30);return I+"ms "+P}};return C}function ey({keyframes:e,velocity:t=0,power:a=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:n=500,modifyTarget:s,min:i,max:l,restDelta:u=.5,restSpeed:d}){let c=e[0],f={done:!1,value:c},g=A=>i!==void 0&&A<i||l!==void 0&&A>l,x=A=>i===void 0?l:l===void 0||Math.abs(i-A)<Math.abs(l-A)?i:l,w=a*t,L=c+w,y=s===void 0?L:s(L);y!==L&&(w=y-c);let h=A=>-w*Math.exp(-A/r),m=A=>y+h(A),C=A=>{let q=h(A),U=m(A);f.done=Math.abs(q)<=u,f.value=f.done?y:U},I,P,R=A=>{g(f.value)&&(I=A,P=Of({keyframes:[f.value,x(f.value)],velocity:Mf(m,A,f.value),damping:o,stiffness:n,restDelta:u,restSpeed:d}))};return R(0),{calculatedDuration:null,next:A=>{let q=!1;return!P&&I===void 0&&(q=!0,C(A),R(A)),I!==void 0&&A>=I?P.next(A-I):(!q&&C(A),f)}}}var mI=mo(.42,0,1,1),hI=mo(0,0,.58,1),Ff=mo(.42,0,.58,1);var gI=e=>Array.isArray(e)&&typeof e[0]!="number";var yI={linear:ge,easeIn:mI,easeInOut:Ff,easeOut:hI,circIn:Lf,circInOut:bf,circOut:If,backIn:hu,backInOut:Sf,backOut:jg,anticipate:Cf},ty=e=>{if(ti(e)){Ta(e.length===4,"Cubic bezier arrays must contain four numerical values.");let[t,a,r,o]=e;return mo(t,a,r,o)}else if(typeof e=="string")return Ta(yI[e]!==void 0,`Invalid easing type '${e}'`),yI[e];return e};function aE(e,t,a){let r=[],o=a||Df,n=e.length-1;for(let s=0;s<n;s++){let i=o(e[s],e[s+1]);if(t){let l=Array.isArray(t)?t[s]||ge:t;i=$a(l,i)}r.push(i)}return r}function xI(e,t,{clamp:a=!0,ease:r,mixer:o}={}){let n=e.length;if(Ta(n===t.length,"Both input and output ranges must be the same length"),n===1)return()=>t[0];if(n===2&&t[0]===t[1])return()=>t[1];let s=e[0]===e[1];e[0]>e[n-1]&&(e=[...e].reverse(),t=[...t].reverse());let i=aE(t,r,o),l=i.length,u=d=>{if(s&&d<e[0])return t[0];let c=0;if(l>1)for(;c<e.length-2&&!(d<e[c+1]);c++);let f=Yt(e[c],e[c+1],d);return i[c](f)};return a?d=>u(ct(e[0],e[n-1],d)):u}function vI(e,t){let a=e[e.length-1];for(let r=1;r<=t;r++){let o=Yt(0,t,r);e.push(ie(a,1,o))}}function wI(e){let t=[0];return vI(t,e.length-1),t}function SI(e,t){return e.map(a=>a*t)}function rE(e,t){return e.map(()=>t||Ff).splice(0,e.length-1)}function xu({duration:e=300,keyframes:t,times:a,ease:r="easeInOut"}){let o=gI(r)?r.map(ty):ty(r),n={done:!1,value:t[0]},s=SI(a&&a.length===t.length?a:wI(t),e),i=xI(s,t,{ease:Array.isArray(o)?o:rE(t,o)});return{calculatedDuration:e,next:l=>(n.value=i(l),n.done=l>=e,n)}}var CI=e=>{let t=({timestamp:a})=>e(a);return{start:()=>ee.update(t,!0),stop:()=>Zt(t),now:()=>Ue.isProcessing?Ue.timestamp:wt.now()}};var oE={decay:ey,inertia:ey,tween:xu,keyframes:xu,spring:Of},nE=e=>e/100,wn=class extends ci{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();let{onStop:l}=this.options;l&&l()};let{name:a,motionValue:r,element:o,keyframes:n}=this.options,s=o?.KeyframeResolver||yo,i=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new s(n,i,a,r,o),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){let{type:a="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:n,velocity:s=0}=this.options,i=co(a)?a:oE[a]||xu,l,u;i!==xu&&typeof t[0]!="number"&&(l=$a(nE,Df(t[0],t[1])),t=[0,100]);let d=i({...this.options,keyframes:t});n==="mirror"&&(u=i({...this.options,keyframes:[...t].reverse(),velocity:-s})),d.calculatedDuration===null&&(d.calculatedDuration=ei(d));let{calculatedDuration:c}=d,f=c+o,g=f*(r+1)-o;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:c,resolvedDuration:f,totalDuration:g}}onPostResolved(){let{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,a=!1){let{resolved:r}=this;if(!r){let{keyframes:A}=this.options;return{done:!0,value:A[A.length-1]}}let{finalKeyframe:o,generator:n,mirroredGenerator:s,mapPercentToKeyframes:i,keyframes:l,calculatedDuration:u,totalDuration:d,resolvedDuration:c}=r;if(this.startTime===null)return n.next(0);let{delay:f,repeat:g,repeatType:x,repeatDelay:w,onUpdate:L}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),a?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;let y=this.currentTime-f*(this.speed>=0?1:-1),h=this.speed>=0?y<0:y>d;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let m=this.currentTime,C=n;if(g){let A=Math.min(this.currentTime,d)/c,q=Math.floor(A),U=A%1;!U&&A>=1&&(U=1),U===1&&q--,q=Math.min(q,g+1),q%2&&(x==="reverse"?(U=1-U,w&&(U-=w/c)):x==="mirror"&&(C=s)),m=ct(0,1,U)*c}let I=h?{done:!1,value:l[0]}:C.next(m);i&&(I.value=i(I.value));let{done:P}=I;!h&&u!==null&&(P=this.speed>=0?this.currentTime>=d:this.currentTime<=0);let R=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&P);return R&&o!==void 0&&(I.value=xo(l,this.options,o)),L&&L(I.value),R&&this.finish(),I}get duration(){let{resolved:t}=this;return t?dt(t.calculatedDuration):0}get time(){return dt(this.currentTime)}set time(t){t=Be(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){let a=this.playbackSpeed!==t;this.playbackSpeed=t,a&&(this.time=dt(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;let{driver:t=CI,onPlay:a,startTime:r}=this.options;this.driver||(this.driver=t(n=>this.tick(n))),a&&a();let o=this.driver.now();this.holdTime!==null?this.startTime=o-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=o):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";let{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}};var LI=new Set(["opacity","clipPath","filter","transform"]);function II(e,t,a,{delay:r=0,duration:o=300,repeat:n=0,repeatType:s="loop",ease:i="easeInOut",times:l}={}){let u={[t]:a};l&&(u.offset=l);let d=ri(i,o);return Array.isArray(d)&&(u.easing=d),e.animate(u,{delay:r,duration:o,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:n+1,direction:s==="reverse"?"alternate":"normal"})}var bI=pn(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));var Bf=10,sE=2e4;function iE(e){return co(e.type)||e.type==="spring"||!cf(e.ease)}function lE(e,t){let a=new wn({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0}),r={done:!1,value:e[0]},o=[],n=0;for(;!r.done&&n<sE;)r=a.sample(n),o.push(r.value),n+=Bf;return{times:void 0,keyframes:o,duration:n-Bf,ease:"linear"}}var kI={anticipate:Cf,backInOut:Sf,circInOut:bf};function uE(e){return e in kI}var vu=class extends ci{constructor(t){super(t);let{name:a,motionValue:r,element:o,keyframes:n}=this.options;this.resolver=new di(n,(s,i)=>this.onKeyframesResolved(s,i),a,r,o),this.resolver.scheduleResolve()}initPlayback(t,a){let{duration:r=300,times:o,ease:n,type:s,motionValue:i,name:l,startTime:u}=this.options;if(!i.owner||!i.owner.current)return!1;if(typeof n=="string"&&fo()&&uE(n)&&(n=kI[n]),iE(this.options)){let{onComplete:c,onUpdate:f,motionValue:g,element:x,...w}=this.options,L=lE(t,w);t=L.keyframes,t.length===1&&(t[1]=t[0]),r=L.duration,o=L.times,n=L.ease,s="keyframes"}let d=II(i.owner.current,l,t,{...this.options,duration:r,times:o,ease:n});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(fu(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{let{onComplete:c}=this.options;i.set(xo(t,this.options,a)),c&&c(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:r,times:o,type:s,ease:n,keyframes:t}}get duration(){let{resolved:t}=this;if(!t)return 0;let{duration:a}=t;return dt(a)}get time(){let{resolved:t}=this;if(!t)return 0;let{animation:a}=t;return dt(a.currentTime||0)}set time(t){let{resolved:a}=this;if(!a)return;let{animation:r}=a;r.currentTime=Be(t)}get speed(){let{resolved:t}=this;if(!t)return 1;let{animation:a}=t;return a.playbackRate}set speed(t){let{resolved:a}=this;if(!a)return;let{animation:r}=a;r.playbackRate=t}get state(){let{resolved:t}=this;if(!t)return"idle";let{animation:a}=t;return a.playState}get startTime(){let{resolved:t}=this;if(!t)return null;let{animation:a}=t;return a.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{let{resolved:a}=this;if(!a)return ge;let{animation:r}=a;fu(r,t)}return ge}play(){if(this.isStopped)return;let{resolved:t}=this;if(!t)return;let{animation:a}=t;a.playState==="finished"&&this.updateFinishedPromise(),a.play()}pause(){let{resolved:t}=this;if(!t)return;let{animation:a}=t;a.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();let{resolved:t}=this;if(!t)return;let{animation:a,keyframes:r,duration:o,type:n,ease:s,times:i}=t;if(a.playState==="idle"||a.playState==="finished")return;if(this.time){let{motionValue:u,onUpdate:d,onComplete:c,element:f,...g}=this.options,x=new wn({...g,keyframes:r,duration:o,type:n,ease:s,times:i,isGenerator:!0}),w=Be(this.time);u.setWithVelocity(x.sample(w-Bf).value,x.sample(w).value,Bf)}let{onStop:l}=this.options;l&&l(),this.cancel()}complete(){let{resolved:t}=this;t&&t.animation.finish()}cancel(){let{resolved:t}=this;t&&t.animation.cancel()}static supports(t){let{motionValue:a,name:r,repeatDelay:o,repeatType:n,damping:s,type:i}=t;if(!a||!a.owner||!(a.owner.current instanceof HTMLElement))return!1;let{onUpdate:l,transformTemplate:u}=a.owner.getProps();return bI()&&r&&LI.has(r)&&!l&&!u&&!o&&n!=="mirror"&&s!==0&&i!=="inertia"}};var dE={type:"spring",stiffness:500,damping:25,restSpeed:10},cE=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),fE={type:"keyframes",duration:.8},pE={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},PI=(e,{keyframes:t})=>t.length>2?fE:Vt.has(e)?e.startsWith("scale")?cE(t[1]):dE:pE;function TI({when:e,delay:t,delayChildren:a,staggerChildren:r,staggerDirection:o,repeat:n,repeatType:s,repeatDelay:i,from:l,elapsed:u,...d}){return!!Object.keys(d).length}var pi=(e,t,a,r={},o,n)=>s=>{let i=uo(r,e)||{},l=i.delay||r.delay||0,{elapsed:u=0}=r;u=u-Be(l);let d={keyframes:Array.isArray(a)?a:[null,a],ease:"easeOut",velocity:t.getVelocity(),...i,delay:-u,onUpdate:f=>{t.set(f),i.onUpdate&&i.onUpdate(f)},onComplete:()=>{s(),i.onComplete&&i.onComplete()},name:e,motionValue:t,element:n?void 0:o};TI(i)||(d={...d,...PI(e,d)}),d.duration&&(d.duration=Be(d.duration)),d.repeatDelay&&(d.repeatDelay=Be(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let c=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(c=!0)),(xf.current||Bs.skipAnimations)&&(c=!0,d.duration=0,d.delay=0),c&&!n&&t.get()!==void 0){let f=xo(d.keyframes,i);if(f!==void 0)return ee.update(()=>{d.onUpdate(f),d.onComplete()}),new cu([])}return!n&&vu.supports(d)?new vu(d):new wn(d)};function mE({protectedKeys:e,needsAnimating:t},a){let r=e.hasOwnProperty(a)&&t[a]!==!0;return t[a]=!1,r}function Uf(e,t,{delay:a=0,transitionOverride:r,type:o}={}){var n;let{transition:s=e.getDefaultTransition(),transitionEnd:i,...l}=t;r&&(s=r);let u=[],d=o&&e.animationState&&e.animationState.getState()[o];for(let c in l){let f=e.getValue(c,(n=e.latestValues[c])!==null&&n!==void 0?n:null),g=l[c];if(g===void 0||d&&mE(d,c))continue;let x={delay:a,...uo(s||{},c)},w=!1;if(window.MotionHandoffAnimation){let y=yf(e);if(y){let h=window.MotionHandoffAnimation(y,c,ee);h!==null&&(x.startTime=h,w=!0)}}mu(e,c),f.start(pi(c,f,g,e.shouldReduceMotion&&mf.has(c)?{type:!1}:x,e,w));let L=f.animation;L&&u.push(L)}return i&&Promise.all(u).then(()=>{ee.update(()=>{i&&jL(e,i)})}),u}function Vf(e,t,a={}){var r;let o=lo(e,t,a.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0),{transition:n=e.getDefaultTransition()||{}}=o||{};a.transitionOverride&&(n=a.transitionOverride);let s=o?()=>Promise.all(Uf(e,o,a)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(u=0)=>{let{delayChildren:d=0,staggerChildren:c,staggerDirection:f}=n;return hE(e,t,d+u,c,f,a)}:()=>Promise.resolve(),{when:l}=n;if(l){let[u,d]=l==="beforeChildren"?[s,i]:[i,s];return u().then(()=>d())}else return Promise.all([s(),i(a.delay)])}function hE(e,t,a=0,r=0,o=1,n){let s=[],i=(e.variantChildren.size-1)*r,l=o===1?(u=0)=>u*r:(u=0)=>i-u*r;return Array.from(e.variantChildren).sort(gE).forEach((u,d)=>{u.notify("AnimationStart",t),s.push(Vf(u,t,{...n,delay:a+l(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(s)}function gE(e,t){return e.sortNodePosition(t)}function AI(e,t,a={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){let o=t.map(n=>Vf(e,n,a));r=Promise.all(o)}else if(typeof t=="string")r=Vf(e,t,a);else{let o=typeof t=="function"?lo(e,t,a.custom):t;r=Promise.all(Uf(e,o,a))}return r.then(()=>{e.notify("AnimationComplete",t)})}var yE=su.length;function ay(e){if(!e)return;if(!e.isControllingVariants){let a=e.parent?ay(e.parent)||{}:{};return e.props.initial!==void 0&&(a.initial=e.props.initial),a}let t={};for(let a=0;a<yE;a++){let r=su[a],o=e.props[r];(yr(o)||o===!1)&&(t[r]=o)}return t}var xE=[...Kc].reverse(),vE=Kc.length;function wE(e){return t=>Promise.all(t.map(({animation:a,options:r})=>AI(e,a,r)))}function _I(e){let t=wE(e),a=RI(),r=!0,o=l=>(u,d)=>{var c;let f=lo(e,d,l==="exit"?(c=e.presenceContext)===null||c===void 0?void 0:c.custom:void 0);if(f){let{transition:g,transitionEnd:x,...w}=f;u={...u,...w,...x}}return u};function n(l){t=l(e)}function s(l){let{props:u}=e,d=ay(e.parent)||{},c=[],f=new Set,g={},x=1/0;for(let L=0;L<vE;L++){let y=xE[L],h=a[y],m=u[y]!==void 0?u[y]:d[y],C=yr(m),I=y===l?h.isActive:null;I===!1&&(x=L);let P=m===d[y]&&m!==u[y]&&C;if(P&&r&&e.manuallyAnimateOnMount&&(P=!1),h.protectedKeys={...g},!h.isActive&&I===null||!m&&!h.prevProp||io(m)||typeof m=="boolean")continue;let R=SE(h.prevProp,m),A=R||y===l&&h.isActive&&!P&&C||L>x&&C,q=!1,U=Array.isArray(m)?m:[m],J=U.reduce(o(y),{});I===!1&&(J={});let{prevResolvedValues:ue={}}=h,pt={...ue,...J},Xa=xe=>{A=!0,f.has(xe)&&(q=!0,f.delete(xe)),h.needsAnimating[xe]=!0;let ze=e.getValue(xe);ze&&(ze.liveStyle=!1)};for(let xe in pt){let ze=J[xe],Ht=ue[xe];if(g.hasOwnProperty(xe))continue;let ma=!1;iu(ze)&&iu(Ht)?ma=!_g(ze,Ht):ma=ze!==Ht,ma?ze!=null?Xa(xe):f.add(xe):ze!==void 0&&f.has(xe)?Xa(xe):h.protectedKeys[xe]=!0}h.prevProp=m,h.prevResolvedValues=J,h.isActive&&(g={...g,...J}),r&&e.blockInitialAnimation&&(A=!1),A&&(!(P&&R)||q)&&c.push(...U.map(xe=>({animation:xe,options:{type:y}})))}if(f.size){let L={};f.forEach(y=>{let h=e.getBaseTarget(y),m=e.getValue(y);m&&(m.liveStyle=!0),L[y]=h??null}),c.push({animation:L})}let w=!!c.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(w=!1),r=!1,w?t(c):Promise.resolve()}function i(l,u){var d;if(a[l].isActive===u)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(f=>{var g;return(g=f.animationState)===null||g===void 0?void 0:g.setActive(l,u)}),a[l].isActive=u;let c=s(l);for(let f in a)a[f].protectedKeys={};return c}return{animateChanges:s,setActive:i,setAnimateFunction:n,getState:()=>a,reset:()=>{a=RI(),r=!0}}}function SE(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!_g(t,e):!1}function Sn(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function RI(){return{animate:Sn(!0),whileInView:Sn(),whileHover:Sn(),whileTap:Sn(),whileDrag:Sn(),whileFocus:Sn(),exit:Sn()}}var rt=class{constructor(t){this.isMounted=!1,this.node=t}update(){}};var jf=class extends rt{constructor(t){super(t),t.animationState||(t.animationState=_I(t))}updateAnimationControlsSubscription(){let{animate:t}=this.node.getProps();io(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:t}=this.node.getProps(),{animate:a}=this.node.prevProps||{};t!==a&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}};var CE=0,qf=class extends rt{constructor(){super(...arguments),this.id=CE++}update(){if(!this.node.presenceContext)return;let{isPresent:t,onExitComplete:a}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;let o=this.node.animationState.setActive("exit",!t);a&&!t&&o.then(()=>a(this.id))}mount(){let{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}};var EI={animation:{Feature:jf},exit:{Feature:qf}};function Sr(e,t,a,r={passive:!0}){return e.addEventListener(t,a,r),()=>e.removeEventListener(t,a)}function Cr(e){return{point:{x:e.pageX,y:e.pageY}}}var DI=e=>t=>hn(t)&&e(t,Cr(t));function vo(e,t,a,r){return Sr(e,t,DI(a),r)}var MI=(e,t)=>Math.abs(e-t);function NI(e,t){let a=MI(e.x,t.x),r=MI(e.y,t.y);return Math.sqrt(a**2+r**2)}var mi=class{constructor(t,a,{transformPagePoint:r,contextWindow:o,dragSnapToOrigin:n=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let c=oy(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,g=NI(c.offset,{x:0,y:0})>=3;if(!f&&!g)return;let{point:x}=c,{timestamp:w}=Ue;this.history.push({...x,timestamp:w});let{onStart:L,onMove:y}=this.handlers;f||(L&&L(this.lastMoveEvent,c),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,c)},this.handlePointerMove=(c,f)=>{this.lastMoveEvent=c,this.lastMoveEventInfo=ry(f,this.transformPagePoint),ee.update(this.updatePoint,!0)},this.handlePointerUp=(c,f)=>{this.end();let{onEnd:g,onSessionEnd:x,resumeAnimation:w}=this.handlers;if(this.dragSnapToOrigin&&w&&w(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let L=oy(c.type==="pointercancel"?this.lastMoveEventInfo:ry(f,this.transformPagePoint),this.history);this.startEvent&&g&&g(c,L),x&&x(c,L)},!hn(t))return;this.dragSnapToOrigin=n,this.handlers=a,this.transformPagePoint=r,this.contextWindow=o||window;let s=Cr(t),i=ry(s,this.transformPagePoint),{point:l}=i,{timestamp:u}=Ue;this.history=[{...l,timestamp:u}];let{onSessionStart:d}=a;d&&d(t,oy(i,this.history)),this.removeListeners=$a(vo(this.contextWindow,"pointermove",this.handlePointerMove),vo(this.contextWindow,"pointerup",this.handlePointerUp),vo(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Zt(this.updatePoint)}};function ry(e,t){return t?{point:t(e.point)}:e}function OI(e,t){return{x:e.x-t.x,y:e.y-t.y}}function oy({point:e},t){return{point:e,delta:OI(e,FI(t)),offset:OI(e,LE(t)),velocity:IE(t,.1)}}function LE(e){return e[0]}function FI(e){return e[e.length-1]}function IE(e,t){if(e.length<2)return{x:0,y:0};let a=e.length-1,r=null,o=FI(e);for(;a>=0&&(r=e[a],!(o.timestamp-r.timestamp>Be(t)));)a--;if(!r)return{x:0,y:0};let n=dt(o.timestamp-r.timestamp);if(n===0)return{x:0,y:0};let s={x:(o.x-r.x)/n,y:(o.y-r.y)/n};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}var jI=1e-4,bE=1-jI,kE=1+jI,qI=.01,PE=0-qI,TE=0+qI;function ft(e){return e.max-e.min}function HI(e,t,a){return Math.abs(e-t)<=a}function BI(e,t,a,r=.5){e.origin=r,e.originPoint=ie(t.min,t.max,e.origin),e.scale=ft(a)/ft(t),e.translate=ie(a.min,a.max,e.origin)-e.originPoint,(e.scale>=bE&&e.scale<=kE||isNaN(e.scale))&&(e.scale=1),(e.translate>=PE&&e.translate<=TE||isNaN(e.translate))&&(e.translate=0)}function hi(e,t,a,r){BI(e.x,t.x,a.x,r?r.originX:void 0),BI(e.y,t.y,a.y,r?r.originY:void 0)}function UI(e,t,a){e.min=a.min+t.min,e.max=e.min+ft(t)}function zI(e,t,a){UI(e.x,t.x,a.x),UI(e.y,t.y,a.y)}function VI(e,t,a){e.min=t.min-a.min,e.max=e.min+ft(t)}function gi(e,t,a){VI(e.x,t.x,a.x),VI(e.y,t.y,a.y)}function XI(e,{min:t,max:a},r){return t!==void 0&&e<t?e=r?ie(t,e,r.min):Math.max(e,t):a!==void 0&&e>a&&(e=r?ie(a,e,r.max):Math.min(e,a)),e}function $I(e,t,a){return{min:t!==void 0?e.min+t:void 0,max:a!==void 0?e.max+a-(e.max-e.min):void 0}}function QI(e,{top:t,left:a,bottom:r,right:o}){return{x:$I(e.x,a,o),y:$I(e.y,t,r)}}function WI(e,t){let a=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([a,r]=[r,a]),{min:a,max:r}}function JI(e,t){return{x:WI(e.x,t.x),y:WI(e.y,t.y)}}function YI(e,t){let a=.5,r=ft(e),o=ft(t);return o>r?a=Yt(t.min,t.max-r,e.min):r>o&&(a=Yt(e.min,e.max-o,t.min)),ct(0,1,a)}function ZI(e,t){let a={};return t.min!==void 0&&(a.min=t.min-e.min),t.max!==void 0&&(a.max=t.max-e.min),a}var Hf=.35;function eb(e=Hf){return e===!1?e=0:e===!0&&(e=Hf),{x:GI(e,"left","right"),y:GI(e,"top","bottom")}}function GI(e,t,a){return{min:KI(e,t),max:KI(e,a)}}function KI(e,t){return typeof e=="number"?e:e[t]||0}var tb=()=>({translate:0,scale:1,origin:0,originPoint:0}),Cn=()=>({x:tb(),y:tb()}),ab=()=>({min:0,max:0}),Te=()=>({x:ab(),y:ab()});function jt(e){return[e("x"),e("y")]}function zf({top:e,left:t,right:a,bottom:r}){return{x:{min:t,max:a},y:{min:e,max:r}}}function rb({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function ob(e,t){if(!t)return e;let a=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:a.y,left:a.x,bottom:r.y,right:r.x}}function ny(e){return e===void 0||e===1}function $f({scale:e,scaleX:t,scaleY:a}){return!ny(e)||!ny(t)||!ny(a)}function Lr(e){return $f(e)||sy(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function sy(e){return nb(e.x)||nb(e.y)}function nb(e){return e&&e!=="0%"}function wu(e,t,a){let r=e-a,o=t*r;return a+o}function sb(e,t,a,r,o){return o!==void 0&&(e=wu(e,o,r)),wu(e,a,r)+t}function iy(e,t=0,a=1,r,o){e.min=sb(e.min,t,a,r,o),e.max=sb(e.max,t,a,r,o)}function ly(e,{x:t,y:a}){iy(e.x,t.translate,t.scale,t.originPoint),iy(e.y,a.translate,a.scale,a.originPoint)}var ib=.999999999999,lb=1.0000000000001;function db(e,t,a,r=!1){let o=a.length;if(!o)return;t.x=t.y=1;let n,s;for(let i=0;i<o;i++){n=a[i],s=n.projectionDelta;let{visualElement:l}=n.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&n.options.layoutScroll&&n.scroll&&n!==n.root&&Ln(e,{x:-n.scroll.offset.x,y:-n.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,ly(e,s)),r&&Lr(n.latestValues)&&Ln(e,n.latestValues))}t.x<lb&&t.x>ib&&(t.x=1),t.y<lb&&t.y>ib&&(t.y=1)}function wo(e,t){e.min=e.min+t,e.max=e.max+t}function ub(e,t,a,r,o=.5){let n=ie(e.min,e.max,o);iy(e,t,a,n,r)}function Ln(e,t){ub(e.x,t.x,t.scaleX,t.scale,t.originX),ub(e.y,t.y,t.scaleY,t.scale,t.originY)}function uy(e,t){return zf(ob(e.getBoundingClientRect(),t))}function cb(e,t,a){let r=uy(e,a),{scroll:o}=t;return o&&(wo(r.x,o.offset.x),wo(r.y,o.offset.y)),r}var Wf=({current:e})=>e?e.ownerDocument.defaultView:null;var AE=new WeakMap,Kf=class{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Te(),this.visualElement=t}start(t,{snapToCursor:a=!1}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let o=d=>{let{dragSnapToOrigin:c}=this.getProps();c?this.pauseAnimation():this.stopAnimation(),a&&this.snapToCursor(Cr(d).point)},n=(d,c)=>{let{drag:f,dragPropagation:g,onDragStart:x}=this.getProps();if(f&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Ug(f),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),jt(L=>{let y=this.getAxisMotionValue(L).get()||0;if(Pt.test(y)){let{projection:h}=this.visualElement;if(h&&h.layout){let m=h.layout.layoutBox[L];m&&(y=ft(m)*(parseFloat(y)/100))}}this.originPoint[L]=y}),x&&ee.postRender(()=>x(d,c)),mu(this.visualElement,"transform");let{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},s=(d,c)=>{let{dragPropagation:f,dragDirectionLock:g,onDirectionLock:x,onDrag:w}=this.getProps();if(!f&&!this.openDragLock)return;let{offset:L}=c;if(g&&this.currentDirection===null){this.currentDirection=RE(L),this.currentDirection!==null&&x&&x(this.currentDirection);return}this.updateAxis("x",c.point,L),this.updateAxis("y",c.point,L),this.visualElement.render(),w&&w(d,c)},i=(d,c)=>this.stop(d,c),l=()=>jt(d=>{var c;return this.getAnimationState(d)==="paused"&&((c=this.getAxisMotionValue(d).animation)===null||c===void 0?void 0:c.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new mi(t,{onSessionStart:o,onStart:n,onMove:s,onSessionEnd:i,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:Wf(this.visualElement)})}stop(t,a){let r=this.isDragging;if(this.cancel(),!r)return;let{velocity:o}=a;this.startAnimation(o);let{onDragEnd:n}=this.getProps();n&&ee.postRender(()=>n(t,a))}cancel(){this.isDragging=!1;let{projection:t,animationState:a}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),a&&a.setActive("whileDrag",!1)}updateAxis(t,a,r){let{drag:o}=this.getProps();if(!r||!Gf(t,o,this.currentDirection))return;let n=this.getAxisMotionValue(t),s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=XI(s,this.constraints[t],this.elastic[t])),n.set(s)}resolveConstraints(){var t;let{dragConstraints:a,dragElastic:r}=this.getProps(),o=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,n=this.constraints;a&&xr(a)?this.constraints||(this.constraints=this.resolveRefConstraints()):a&&o?this.constraints=QI(o.layoutBox,a):this.constraints=!1,this.elastic=eb(r),n!==this.constraints&&o&&this.constraints&&!this.hasMutatedConstraints&&jt(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=ZI(o.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){let{dragConstraints:t,onMeasureDragConstraints:a}=this.getProps();if(!t||!xr(t))return!1;let r=t.current;Ta(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");let{projection:o}=this.visualElement;if(!o||!o.layout)return!1;let n=cb(r,o.root,this.visualElement.getTransformPagePoint()),s=JI(o.layout.layoutBox,n);if(a){let i=a(rb(s));this.hasMutatedConstraints=!!i,i&&(s=zf(i))}return s}startAnimation(t){let{drag:a,dragMomentum:r,dragElastic:o,dragTransition:n,dragSnapToOrigin:s,onDragTransitionEnd:i}=this.getProps(),l=this.constraints||{},u=jt(d=>{if(!Gf(d,a,this.currentDirection))return;let c=l&&l[d]||{};s&&(c={min:0,max:0});let f=o?200:1e6,g=o?40:1e7,x={type:"inertia",velocity:r?t[d]:0,bounceStiffness:f,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10,...n,...c};return this.startAxisValueAnimation(d,x)});return Promise.all(u).then(i)}startAxisValueAnimation(t,a){let r=this.getAxisMotionValue(t);return mu(this.visualElement,t),r.start(pi(t,r,0,a,this.visualElement,!1))}stopAnimation(){jt(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){jt(t=>{var a;return(a=this.getAxisMotionValue(t).animation)===null||a===void 0?void 0:a.pause()})}getAnimationState(t){var a;return(a=this.getAxisMotionValue(t).animation)===null||a===void 0?void 0:a.state}getAxisMotionValue(t){let a=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[a];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){jt(a=>{let{drag:r}=this.getProps();if(!Gf(a,r,this.currentDirection))return;let{projection:o}=this.visualElement,n=this.getAxisMotionValue(a);if(o&&o.layout){let{min:s,max:i}=o.layout.layoutBox[a];n.set(t[a]-ie(s,i,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:t,dragConstraints:a}=this.getProps(),{projection:r}=this.visualElement;if(!xr(a)||!r||!this.constraints)return;this.stopAnimation();let o={x:0,y:0};jt(s=>{let i=this.getAxisMotionValue(s);if(i&&this.constraints!==!1){let l=i.get();o[s]=YI({min:l,max:l},this.constraints[s])}});let{transformTemplate:n}=this.visualElement.getProps();this.visualElement.current.style.transform=n?n({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),jt(s=>{if(!Gf(s,t,null))return;let i=this.getAxisMotionValue(s),{min:l,max:u}=this.constraints[s];i.set(ie(l,u,o[s]))})}addListeners(){if(!this.visualElement.current)return;AE.set(this.visualElement,this);let t=this.visualElement.current,a=vo(t,"pointerdown",l=>{let{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(l)}),r=()=>{let{dragConstraints:l}=this.getProps();xr(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,n=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),ee.read(r);let s=Sr(window,"resize",()=>this.scalePositionWithinConstraints()),i=o.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(jt(d=>{let c=this.getAxisMotionValue(d);c&&(this.originPoint[d]+=l[d].translate,c.set(c.get()+l[d].translate))}),this.visualElement.render())}));return()=>{s(),a(),n(),i&&i()}}getProps(){let t=this.visualElement.getProps(),{drag:a=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:n=!1,dragElastic:s=Hf,dragMomentum:i=!0}=t;return{...t,drag:a,dragDirectionLock:r,dragPropagation:o,dragConstraints:n,dragElastic:s,dragMomentum:i}}};function Gf(e,t,a){return(t===!0||t===e)&&(a===null||a===e)}function RE(e,t=10){let a=null;return Math.abs(e.y)>t?a="y":Math.abs(e.x)>t&&(a="x"),a}var Xf=class extends rt{constructor(t){super(t),this.removeGroupControls=ge,this.removeListeners=ge,this.controls=new Kf(t)}mount(){let{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ge}unmount(){this.removeGroupControls(),this.removeListeners()}};var fb=e=>(t,a)=>{e&&ee.postRender(()=>e(t,a))},Qf=class extends rt{constructor(){super(...arguments),this.removePointerDownListener=ge}onPointerDown(t){this.session=new mi(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Wf(this.node)})}createPanHandlers(){let{onPanSessionStart:t,onPanStart:a,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:fb(t),onStart:fb(a),onMove:r,onEnd:(n,s)=>{delete this.session,o&&ee.postRender(()=>o(n,s))}}}mount(){this.removePointerDownListener=vo(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}};var hb=M(le(),1),Su=M(G(),1);var yi={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function pb(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var xi={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(H.test(e))e=parseFloat(e);else return e;let a=pb(e,t.target.x),r=pb(e,t.target.y);return`${a}% ${r}%`}};var mb={correct:(e,{treeScale:t,projectionDelta:a})=>{let r=e,o=Tt.parse(e);if(o.length>5)return r;let n=Tt.createTransformer(e),s=typeof o[0]!="number"?1:0,i=a.x.scale*t.x,l=a.y.scale*t.y;o[0+s]/=i,o[1+s]/=l;let u=ie(i,l,.5);return typeof o[2+s]=="number"&&(o[2+s]/=u),typeof o[3+s]=="number"&&(o[3+s]/=u),n(o)}};var dy=class extends Su.Component{componentDidMount(){let{visualElement:t,layoutGroup:a,switchLayoutGroup:r,layoutId:o}=this.props,{projection:n}=t;CL(_E),n&&(a.group&&a.group.add(n),r&&r.register&&o&&r.register(n),n.root.didUpdate(),n.addEventListener("animationComplete",()=>{this.safeToRemove()}),n.setOptions({...n.options,onExitComplete:()=>this.safeToRemove()})),yi.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){let{layoutDependency:a,visualElement:r,drag:o,isPresent:n}=this.props,s=r.projection;return s&&(s.isPresent=n,o||t.layoutDependency!==a||a===void 0?s.willUpdate():this.safeToRemove(),t.isPresent!==n&&(n?s.promote():s.relegate()||ee.postRender(()=>{let i=s.getStack();(!i||!i.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){let{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Vs.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:t,layoutGroup:a,switchLayoutGroup:r}=this.props,{projection:o}=t;o&&(o.scheduleCheckAfterUnmount(),a&&a.group&&a.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){let{safeToRemove:t}=this.props;t&&t()}render(){return null}};function Jf(e){let[t,a]=Vc(),r=(0,Su.useContext)(Ms);return(0,hb.jsx)(dy,{...e,layoutGroup:r,switchLayoutGroup:(0,Su.useContext)(Yc),isPresent:t,safeToRemove:a})}var _E={borderRadius:{...xi,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:xi,borderTopRightRadius:xi,borderBottomLeftRadius:xi,borderBottomRightRadius:xi,boxShadow:mb};function gb(e,t,a){let r=Ce(e)?e:wr(e);return r.start(pi("",r,t,a)),r.animation}function yb(e){return e instanceof SVGElement&&e.tagName!=="svg"}var xb=(e,t)=>e.depth-t.depth;var Yf=class{constructor(){this.children=[],this.isDirty=!1}add(t){ni(this.children,t),this.isDirty=!0}remove(t){si(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(xb),this.isDirty=!1,this.children.forEach(t)}};function vb(e,t){let a=wt.now(),r=({timestamp:o})=>{let n=o-a;n>=t&&(Zt(r),e(n-t))};return ee.read(r,!0),()=>Zt(r)}var Lb=["TopLeft","TopRight","BottomLeft","BottomRight"],EE=Lb.length,wb=e=>typeof e=="string"?parseFloat(e):e,Sb=e=>typeof e=="number"||H.test(e);function Ib(e,t,a,r,o,n){o?(e.opacity=ie(0,a.opacity!==void 0?a.opacity:1,DE(r)),e.opacityExit=ie(t.opacity!==void 0?t.opacity:1,0,ME(r))):n&&(e.opacity=ie(t.opacity!==void 0?t.opacity:1,a.opacity!==void 0?a.opacity:1,r));for(let s=0;s<EE;s++){let i=`border${Lb[s]}Radius`,l=Cb(t,i),u=Cb(a,i);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||Sb(l)===Sb(u)?(e[i]=Math.max(ie(wb(l),wb(u),r),0),(Pt.test(u)||Pt.test(l))&&(e[i]+="%")):e[i]=u}(t.rotate||a.rotate)&&(e.rotate=ie(t.rotate||0,a.rotate||0,r))}function Cb(e,t){return e[t]!==void 0?e[t]:e.borderRadius}var DE=bb(0,.5,If),ME=bb(.5,.95,ge);function bb(e,t,a){return r=>r<e?0:r>t?1:a(Yt(e,t,r))}function kb(e,t){e.min=t.min,e.max=t.max}function ta(e,t){kb(e.x,t.x),kb(e.y,t.y)}function cy(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Pb(e,t,a,r,o){return e-=t,e=wu(e,1/a,r),o!==void 0&&(e=wu(e,1/o,r)),e}function NE(e,t=0,a=1,r=.5,o,n=e,s=e){if(Pt.test(t)&&(t=parseFloat(t),t=ie(s.min,s.max,t/100)-s.min),typeof t!="number")return;let i=ie(n.min,n.max,r);e===n&&(i-=t),e.min=Pb(e.min,t,a,i,o),e.max=Pb(e.max,t,a,i,o)}function Tb(e,t,[a,r,o],n,s){NE(e,t[a],t[r],t[o],t.scale,n,s)}var OE=["x","scaleX","originX"],FE=["y","scaleY","originY"];function fy(e,t,a,r){Tb(e.x,t,OE,a?a.x:void 0,r?r.x:void 0),Tb(e.y,t,FE,a?a.y:void 0,r?r.y:void 0)}function Ab(e){return e.translate===0&&e.scale===1}function py(e){return Ab(e.x)&&Ab(e.y)}function Rb(e,t){return e.min===t.min&&e.max===t.max}function Eb(e,t){return Rb(e.x,t.x)&&Rb(e.y,t.y)}function _b(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function my(e,t){return _b(e.x,t.x)&&_b(e.y,t.y)}function hy(e){return ft(e.x)/ft(e.y)}function gy(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var Zf=class{constructor(){this.members=[]}add(t){ni(this.members,t),t.scheduleRender()}remove(t){if(si(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){let a=this.members[this.members.length-1];a&&this.promote(a)}}relegate(t){let a=this.members.findIndex(o=>t===o);if(a===0)return!1;let r;for(let o=a;o>=0;o--){let n=this.members[o];if(n.isPresent!==!1){r=n;break}}return r?(this.promote(r),!0):!1}promote(t,a){let r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,a&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);let{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{let{options:a,resumingFrom:r}=t;a.onExitComplete&&a.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}};function Db(e,t,a){let r="",o=e.x.translate/t.x,n=e.y.translate/t.y,s=a?.z||0;if((o||n||s)&&(r=`translate3d(${o}px, ${n}px, ${s}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),a){let{transformPerspective:u,rotate:d,rotateX:c,rotateY:f,skewX:g,skewY:x}=a;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),c&&(r+=`rotateX(${c}deg) `),f&&(r+=`rotateY(${f}deg) `),g&&(r+=`skewX(${g}deg) `),x&&(r+=`skewY(${x}deg) `)}let i=e.x.scale*t.x,l=e.y.scale*t.y;return(i!==1||l!==1)&&(r+=`scale(${i}, ${l})`),r||"none"}var In={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Cu=typeof window<"u"&&window.MotionDebug!==void 0,yy=["","X","Y","Z"],BE={visibility:"hidden"},Mb=1e3,UE=0;function xy(e,t,a,r){let{latestValues:o}=t;o[e]&&(a[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function qb(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let a=yf(t);if(window.MotionHasOptimisedAnimation(a,"transform")){let{layout:o,layoutId:n}=e.options;window.MotionCancelOptimisedAnimation(a,"transform",ee,!(o||n))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&qb(r)}function ep({attachResizeListener:e,defaultParent:t,measureScroll:a,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(s={},i=t?.()){this.id=UE++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Cu&&(In.totalNodes=In.resolvedTargetDeltas=In.recalculatedProjection=0),this.nodes.forEach(qE),this.nodes.forEach(GE),this.nodes.forEach(KE),this.nodes.forEach(HE),Cu&&window.MotionDebug.record(In)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Yf)}addEventListener(s,i){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new po),this.eventHandlers.get(s).add(i)}notifyListeners(s,...i){let l=this.eventHandlers.get(s);l&&l.notify(...i)}hasListeners(s){return this.eventHandlers.has(s)}mount(s,i=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=yb(s),this.instance=s;let{layoutId:l,layout:u,visualElement:d}=this.options;if(d&&!d.current&&d.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),i&&(u||l)&&(this.isLayoutDirty=!0),e){let c,f=()=>this.root.updateBlockedByResize=!1;e(s,()=>{this.root.updateBlockedByResize=!0,c&&c(),c=vb(f,250),yi.hasAnimatedSinceResize&&(yi.hasAnimatedSinceResize=!1,this.nodes.forEach(Ob))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||u)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:f,hasRelativeTargetChanged:g,layout:x})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let w=this.options.transition||d.getDefaultTransition()||ZE,{onLayoutAnimationStart:L,onLayoutAnimationComplete:y}=d.getProps(),h=!this.targetLayout||!my(this.targetLayout,x)||g,m=!f&&g;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||m||f&&(h||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(c,m);let C={...uo(w,"layout"),onPlay:L,onComplete:y};(d.shouldReduceMotion||this.options.layoutRoot)&&(C.delay=0,C.type=!1),this.startAnimation(C)}else f||Ob(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=x})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Zt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(XE),this.animationId++)}getTransformTemplate(){let{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&qb(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){let c=this.path[d];c.shouldResetTransform=!0,c.updateScroll("snapshot"),c.options.layoutRoot&&c.willUpdate(!1)}let{layoutId:i,layout:l}=this.options;if(i===void 0&&!l)return;let u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Nb);return}this.isUpdating||this.nodes.forEach($E),this.isUpdating=!1,this.nodes.forEach(WE),this.nodes.forEach(VE),this.nodes.forEach(jE),this.clearAllSnapshots();let i=wt.now();Ue.delta=ct(0,1e3/60,i-Ue.timestamp),Ue.timestamp=i,Ue.isProcessing=!0,Wc.update.process(Ue),Wc.preRender.process(Ue),Wc.render.process(Ue),Ue.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Vs.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(zE),this.sharedNodes.forEach(QE)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ee.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ee.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();let s=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Te(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:i}=this.options;i&&i.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let i=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(i=!1),i){let l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:l,offset:a(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!o)return;let s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,i=this.projectionDelta&&!py(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;s&&(i||Lr(this.latestValues)||d)&&(o(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){let i=this.measurePageBox(),l=this.removeElementScroll(i);return s&&(l=this.removeTransform(l)),eD(l),{animationId:this.root.animationId,measuredBox:i,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var s;let{visualElement:i}=this.options;if(!i)return Te();let l=i.measureViewportBox();if(!(((s=this.scroll)===null||s===void 0?void 0:s.wasRoot)||this.path.some(tD))){let{scroll:d}=this.root;d&&(wo(l.x,d.offset.x),wo(l.y,d.offset.y))}return l}removeElementScroll(s){var i;let l=Te();if(ta(l,s),!((i=this.scroll)===null||i===void 0)&&i.wasRoot)return l;for(let u=0;u<this.path.length;u++){let d=this.path[u],{scroll:c,options:f}=d;d!==this.root&&c&&f.layoutScroll&&(c.wasRoot&&ta(l,s),wo(l.x,c.offset.x),wo(l.y,c.offset.y))}return l}applyTransform(s,i=!1){let l=Te();ta(l,s);for(let u=0;u<this.path.length;u++){let d=this.path[u];!i&&d.options.layoutScroll&&d.scroll&&d!==d.root&&Ln(l,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),Lr(d.latestValues)&&Ln(l,d.latestValues)}return Lr(this.latestValues)&&Ln(l,this.latestValues),l}removeTransform(s){let i=Te();ta(i,s);for(let l=0;l<this.path.length;l++){let u=this.path[l];if(!u.instance||!Lr(u.latestValues))continue;$f(u.latestValues)&&u.updateSnapshot();let d=Te(),c=u.measurePageBox();ta(d,c),fy(i,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return Lr(this.latestValues)&&fy(i,this.latestValues),i}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ue.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){var i;let l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);let u=!!this.resumingFrom||this!==l;if(!(s||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((i=this.parent)===null||i===void 0)&&i.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:c,layoutId:f}=this.options;if(!(!this.layout||!(c||f))){if(this.resolvedRelativeTargetAt=Ue.timestamp,!this.targetDelta&&!this.relativeTarget){let g=this.getClosestProjectingParent();g&&g.layout&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Te(),this.relativeTargetOrigin=Te(),gi(this.relativeTargetOrigin,this.layout.layoutBox,g.layout.layoutBox),ta(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Te(),this.targetWithTransforms=Te()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),zI(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ta(this.target,this.layout.layoutBox),ly(this.target,this.targetDelta)):ta(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;let g=this.getClosestProjectingParent();g&&!!g.resumingFrom==!!this.resumingFrom&&!g.options.layoutScroll&&g.target&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Te(),this.relativeTargetOrigin=Te(),gi(this.relativeTargetOrigin,this.target,g.target),ta(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Cu&&In.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||$f(this.parent.latestValues)||sy(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var s;let i=this.getLead(),l=!!this.resumingFrom||this!==i,u=!0;if((this.isProjectionDirty||!((s=this.parent)===null||s===void 0)&&s.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===Ue.timestamp&&(u=!1),u)return;let{layout:d,layoutId:c}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||c))return;ta(this.layoutCorrected,this.layout.layoutBox);let f=this.treeScale.x,g=this.treeScale.y;db(this.layoutCorrected,this.treeScale,this.path,l),i.layout&&!i.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(i.target=i.layout.layoutBox,i.targetWithTransforms=Te());let{target:x}=i;if(!x){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(cy(this.prevProjectionDelta.x,this.projectionDelta.x),cy(this.prevProjectionDelta.y,this.projectionDelta.y)),hi(this.projectionDelta,this.layoutCorrected,x,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==g||!gy(this.projectionDelta.x,this.prevProjectionDelta.x)||!gy(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",x)),Cu&&In.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){var i;if((i=this.options.visualElement)===null||i===void 0||i.scheduleRender(),s){let l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Cn(),this.projectionDelta=Cn(),this.projectionDeltaWithTransform=Cn()}setAnimationOrigin(s,i=!1){let l=this.snapshot,u=l?l.latestValues:{},d={...this.latestValues},c=Cn();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!i;let f=Te(),g=l?l.source:void 0,x=this.layout?this.layout.source:void 0,w=g!==x,L=this.getStack(),y=!L||L.members.length<=1,h=!!(w&&!y&&this.options.crossfade===!0&&!this.path.some(YE));this.animationProgress=0;let m;this.mixTargetDelta=C=>{let I=C/1e3;Fb(c.x,s.x,I),Fb(c.y,s.y,I),this.setTargetDelta(c),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(gi(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),JE(this.relativeTarget,this.relativeTargetOrigin,f,I),m&&Eb(this.relativeTarget,m)&&(this.isProjectionDirty=!1),m||(m=Te()),ta(m,this.relativeTarget)),w&&(this.animationValues=d,Ib(d,u,this.latestValues,I,h,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=I},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Zt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ee.update(()=>{yi.hasAnimatedSinceResize=!0,this.currentAnimation=gb(0,Mb,{...s,onUpdate:i=>{this.mixTargetDelta(i),s.onUpdate&&s.onUpdate(i)},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Mb),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let s=this.getLead(),{targetWithTransforms:i,target:l,layout:u,latestValues:d}=s;if(!(!i||!l||!u)){if(this!==s&&this.layout&&u&&Hb(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Te();let c=ft(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+c;let f=ft(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+f}ta(i,l),Ln(i,d),hi(this.projectionDeltaWithTransform,this.layoutCorrected,i,d)}}registerSharedNode(s,i){this.sharedNodes.has(s)||this.sharedNodes.set(s,new Zf),this.sharedNodes.get(s).add(i);let u=i.options.initialPromotionConfig;i.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(i):void 0})}isLead(){let s=this.getStack();return s?s.lead===this:!0}getLead(){var s;let{layoutId:i}=this.options;return i?((s=this.getStack())===null||s===void 0?void 0:s.lead)||this:this}getPrevLead(){var s;let{layoutId:i}=this.options;return i?(s=this.getStack())===null||s===void 0?void 0:s.prevLead:void 0}getStack(){let{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:i,preserveFollowOpacity:l}={}){let u=this.getStack();u&&u.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),i&&this.setOptions({transition:i})}relegate(){let s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){let{visualElement:s}=this.options;if(!s)return;let i=!1,{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(i=!0),!i)return;let u={};l.z&&xy("z",s,u,this.animationValues);for(let d=0;d<yy.length;d++)xy(`rotate${yy[d]}`,s,u,this.animationValues),xy(`skew${yy[d]}`,s,u,this.animationValues);s.render();for(let d in u)s.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);s.scheduleRender()}getProjectionStyles(s){var i,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return BE;let u={visibility:""},d=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=zs(s?.pointerEvents)||"",u.transform=d?d(this.latestValues,""):"none",u;let c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){let w={};return this.options.layoutId&&(w.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,w.pointerEvents=zs(s?.pointerEvents)||""),this.hasProjected&&!Lr(this.latestValues)&&(w.transform=d?d({},""):"none",this.hasProjected=!1),w}let f=c.animationValues||c.latestValues;this.applyTransformsToTarget(),u.transform=Db(this.projectionDeltaWithTransform,this.treeScale,f),d&&(u.transform=d(f,u.transform));let{x:g,y:x}=this.projectionDelta;u.transformOrigin=`${g.origin*100}% ${x.origin*100}% 0`,c.animationValues?u.opacity=c===this?(l=(i=f.opacity)!==null&&i!==void 0?i:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:u.opacity=c===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(let w in Js){if(f[w]===void 0)continue;let{correct:L,applyTo:y}=Js[w],h=u.transform==="none"?f[w]:L(f[w],c);if(y){let m=y.length;for(let C=0;C<m;C++)u[y[C]]=h}else u[w]=h}return this.options.layoutId&&(u.pointerEvents=c===this?zs(s?.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>{var i;return(i=s.currentAnimation)===null||i===void 0?void 0:i.stop()}),this.root.nodes.forEach(Nb),this.root.sharedNodes.clear()}}}function VE(e){e.updateLayout()}function jE(e){var t;let a=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&a&&e.hasListeners("didUpdate")){let{layoutBox:r,measuredBox:o}=e.layout,{animationType:n}=e.options,s=a.source!==e.layout.source;n==="size"?jt(c=>{let f=s?a.measuredBox[c]:a.layoutBox[c],g=ft(f);f.min=r[c].min,f.max=f.min+g}):Hb(n,a.layoutBox,r)&&jt(c=>{let f=s?a.measuredBox[c]:a.layoutBox[c],g=ft(r[c]);f.max=f.min+g,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[c].max=e.relativeTarget[c].min+g)});let i=Cn();hi(i,r,a.layoutBox);let l=Cn();s?hi(l,e.applyTransform(o,!0),a.measuredBox):hi(l,r,a.layoutBox);let u=!py(i),d=!1;if(!e.resumeFrom){let c=e.getClosestProjectingParent();if(c&&!c.resumeFrom){let{snapshot:f,layout:g}=c;if(f&&g){let x=Te();gi(x,a.layoutBox,f.layoutBox);let w=Te();gi(w,r,g.layoutBox),my(x,w)||(d=!0),c.options.layoutRoot&&(e.relativeTarget=w,e.relativeTargetOrigin=x,e.relativeParent=c)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:a,delta:l,layoutDelta:i,hasLayoutChanged:u,hasRelativeTargetChanged:d})}else if(e.isLead()){let{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function qE(e){Cu&&In.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function HE(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function zE(e){e.clearSnapshot()}function Nb(e){e.clearMeasurements()}function $E(e){e.isLayoutDirty=!1}function WE(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Ob(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function GE(e){e.resolveTargetDelta()}function KE(e){e.calcProjection()}function XE(e){e.resetSkewAndRotation()}function QE(e){e.removeLeadSnapshot()}function Fb(e,t,a){e.translate=ie(t.translate,0,a),e.scale=ie(t.scale,1,a),e.origin=t.origin,e.originPoint=t.originPoint}function Bb(e,t,a,r){e.min=ie(t.min,a.min,r),e.max=ie(t.max,a.max,r)}function JE(e,t,a,r){Bb(e.x,t.x,a.x,r),Bb(e.y,t.y,a.y,r)}function YE(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var ZE={duration:.45,ease:[.4,0,.1,1]},Ub=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Vb=Ub("applewebkit/")&&!Ub("chrome/")?Math.round:ge;function jb(e){e.min=Vb(e.min),e.max=Vb(e.max)}function eD(e){jb(e.x),jb(e.y)}function Hb(e,t,a){return e==="position"||e==="preserve-aspect"&&!HI(hy(t),hy(a),.2)}function tD(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}var zb=ep({attachResizeListener:(e,t)=>Sr(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0});var vy={current:void 0},tp=ep({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!vy.current){let e=new zb({});e.mount(window),e.setOptions({layoutScroll:!0}),vy.current=e}return vy.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"});var $b={pan:{Feature:Qf},drag:{Feature:Xf,ProjectionNode:tp,MeasureLayout:Jf}};function Wb(e,t,a){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",a==="Start");let o="onHover"+a,n=r[o];n&&ee.postRender(()=>n(t,Cr(t)))}var ap=class extends rt{mount(){let{current:t}=this.node;t&&(this.unmount=Og(t,a=>(Wb(this.node,a,"Start"),r=>Wb(this.node,r,"End"))))}unmount(){}};var rp=class extends rt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=$a(Sr(this.node.current,"focus",()=>this.onFocus()),Sr(this.node.current,"blur",()=>this.onBlur()))}unmount(){}};function Gb(e,t,a){let{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",a==="Start");let o="onTap"+(a==="End"?"":a),n=r[o];n&&ee.postRender(()=>n(t,Cr(t)))}var op=class extends rt{mount(){let{current:t}=this.node;t&&(this.unmount=Bg(t,a=>(Gb(this.node,a,"Start"),(r,{success:o})=>Gb(this.node,r,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}};var Sy=new WeakMap,wy=new WeakMap,aD=e=>{let t=Sy.get(e.target);t&&t(e)},rD=e=>{e.forEach(aD)};function oD({root:e,...t}){let a=e||document;wy.has(a)||wy.set(a,{});let r=wy.get(a),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(rD,{root:e,...t})),r[o]}function Kb(e,t,a){let r=oD(t);return Sy.set(e,a),r.observe(e),()=>{Sy.delete(e),r.unobserve(e)}}var nD={some:0,all:1},np=class extends rt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:t={}}=this.node.getProps(),{root:a,margin:r,amount:o="some",once:n}=t,s={root:a?a.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:nD[o]},i=l=>{let{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,n&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);let{onViewportEnter:d,onViewportLeave:c}=this.node.getProps(),f=u?d:c;f&&f(l)};return Kb(this.node.current,s,i)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;let{props:t,prevProps:a}=this.node;["amount","margin","root"].some(sD(t,a))&&this.startObserver()}unmount(){}};function sD({viewport:e={}},{viewport:t={}}={}){return a=>e[a]!==t[a]}var Xb={inView:{Feature:np},tap:{Feature:op},focus:{Feature:rp},hover:{Feature:ap}};var Qb={layout:{ProjectionNode:tp,MeasureLayout:Jf}};var tk=M(G(),1);var Lu={current:null},sp={current:!1};function Jb(){if(sp.current=!0,!!Fs)if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Lu.current=e.matches;e.addListener(t),t()}else Lu.current=!1}var iD=[...Gg,He,Tt],Yb=e=>iD.find(Rf(e));var Cy=new WeakMap;function Zb(e,t,a){for(let r in t){let o=t[r],n=a[r];if(Ce(o))e.addValue(r,o);else if(Ce(n))e.addValue(r,wr(o,{owner:e}));else if(n!==o)if(e.hasValue(r)){let s=e.getValue(r);s.liveStyle===!0?s.jump(o):s.hasAnimated||s.set(o)}else{let s=e.getStaticValue(r);e.addValue(r,wr(s!==void 0?s:o,{owner:e}))}}for(let r in a)t[r]===void 0&&e.removeValue(r);return t}var ek=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],ip=class{scrapeMotionValuesFromProps(t,a,r){return{}}constructor({parent:t,props:a,presenceContext:r,reducedMotionConfig:o,blockInitialAnimation:n,visualState:s},i={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=yo,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let g=wt.now();this.renderScheduledAt<g&&(this.renderScheduledAt=g,ee.render(this.render,!1,!0))};let{latestValues:l,renderState:u,onUpdate:d}=s;this.onUpdate=d,this.latestValues=l,this.baseTarget={...l},this.initialValues=a.initial?{...l}:{},this.renderState=u,this.parent=t,this.props=a,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=i,this.blockInitialAnimation=!!n,this.isControllingVariants=mn(a),this.isVariantNode=Xc(a),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);let{willChange:c,...f}=this.scrapeMotionValuesFromProps(a,{},this);for(let g in f){let x=f[g];l[g]!==void 0&&Ce(x)&&x.set(l[g],!1)}}mount(t){this.current=t,Cy.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((a,r)=>this.bindToMotionValue(r,a)),sp.current||Jb(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Lu.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Cy.delete(this.current),this.projection&&this.projection.unmount(),Zt(this.notifyUpdate),Zt(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(let t in this.events)this.events[t].clear();for(let t in this.features){let a=this.features[t];a&&(a.unmount(),a.isMounted=!1)}this.current=null}bindToMotionValue(t,a){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();let r=Vt.has(t),o=a.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&ee.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),n=a.on("renderRequest",this.scheduleRender),s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,a)),this.valueSubscriptions.set(t,()=>{o(),n(),s&&s(),a.owner&&a.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in gr){let a=gr[t];if(!a)continue;let{isEnabled:r,Feature:o}=a;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){let n=this.features[t];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Te()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,a){this.latestValues[t]=a}update(t,a){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=a;for(let r=0;r<ek.length;r++){let o=ek[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);let n="on"+o,s=t[n];s&&(this.propEventSubscriptions[o]=this.on(o,s))}this.prevMotionValues=Zb(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){let a=this.getClosestVariantNode();if(a)return a.variantChildren&&a.variantChildren.add(t),()=>a.variantChildren.delete(t)}addValue(t,a){let r=this.values.get(t);a!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,a),this.values.set(t,a),this.latestValues[t]=a.get())}removeValue(t){this.values.delete(t);let a=this.valueSubscriptions.get(t);a&&(a(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,a){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&a!==void 0&&(r=wr(a===null?void 0:a,{owner:this}),this.addValue(t,r)),r}readValue(t,a){var r;let o=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return o!=null&&(typeof o=="string"&&(Af(o)||kf(o))?o=parseFloat(o):!Yb(o)&&Tt.test(a)&&(o=Tf(t,a)),this.setBaseTarget(t,Ce(o)?o.get():o)),Ce(o)?o.get():o}setBaseTarget(t,a){this.baseTarget[t]=a}getBaseTarget(t){var a;let{initial:r}=this.props,o;if(typeof r=="string"||typeof r=="object"){let s=Hs(this.props,r,(a=this.presenceContext)===null||a===void 0?void 0:a.custom);s&&(o=s[t])}if(r&&o!==void 0)return o;let n=this.getBaseTargetFromProps(this.props,t);return n!==void 0&&!Ce(n)?n:this.initialValues[t]!==void 0&&o===void 0?void 0:this.baseTarget[t]}on(t,a){return this.events[t]||(this.events[t]=new po),this.events[t].add(a)}notify(t,...a){this.events[t]&&this.events[t].notify(...a)}};var vi=class extends ip{constructor(){super(...arguments),this.KeyframeResolver=di}sortInstanceNodePosition(t,a){return t.compareDocumentPosition(a)&2?1:-1}getBaseTargetFromProps(t,a){return t.style?t.style[a]:void 0}removeValueFromRenderState(t,{vars:a,style:r}){delete a[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:t}=this.props;Ce(t)&&(this.childSubscription=t.on("change",a=>{this.current&&(this.current.textContent=`${a}`)}))}};function lD(e){return window.getComputedStyle(e)}var lp=class extends vi{constructor(){super(...arguments),this.type="html",this.renderInstance=of}readValueFromInstance(t,a){if(Vt.has(a)){let r=ui(a);return r&&r.default||0}else{let r=lD(t),o=(tf(a)?r.getPropertyValue(a):r[a])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:a}){return uy(t,a)}build(t,a,r){Gs(t,a,r.transformTemplate)}scrapeMotionValuesFromProps(t,a,r){return Ys(t,a,r)}};var up=class extends vi{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Te}getBaseTargetFromProps(t,a){return t[a]}readValueFromInstance(t,a){if(Vt.has(a)){let r=ui(a);return r&&r.default||0}return a=nf.has(a)?a:Us(a),t.getAttribute(a)}scrapeMotionValuesFromProps(t,a,r){return uf(t,a,r)}build(t,a,r){Ks(t,a,this.isSVGTag,r.transformTemplate)}renderInstance(t,a,r,o){sf(t,a,r,o)}mount(t){this.isSVGTag=Qs(t.tagName),super.mount(t)}};var ak=(e,t)=>qs(e)?new up(t):new lp(t,{allowProjection:e!==tk.Fragment});var rk=_L({...EI,...Xb,...$b,...Qb},ak);var Ly=JC(rk);var Iu=M(le(),1);function ok({x:e,y:t,visible:a,onClick:r=!1}){return(0,Iu.jsx)(kg,{children:a&&(0,Iu.jsx)(Ly.div,{className:"fixed pointer-events-none z-[9999]",initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1,x:e,y:t},exit:{opacity:0,scale:.5},transition:{type:"spring",stiffness:200,damping:20},style:{left:0,top:0},children:(0,Iu.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Iu.jsx)("path",{d:"M3 3L10.07 19.97L12.58 12.58L19.97 10.07L3 3Z",fill:"#C4B5FD"})})})})}var wi=M(G(),1);function nk(){let[e,t]=wi.useState({x:0,y:0,visible:!1,onClick:!1}),a=wi.useCallback(n=>{let s=document.querySelector(n.selector);if(s){let i=s.getBoundingClientRect(),l=n.offset?.x||0,u=n.offset?.y||0;t({x:i.left+i.width/2+l,y:i.top+i.height/2+u,visible:!0,onClick:n.onClick||!1})}},[]),r=wi.useCallback(()=>{t(n=>({...n,visible:!1}))},[]),o=wi.useCallback(()=>{t(n=>({...n,visible:!0}))},[]);return{cursorState:e,moveTo:a,hide:r,show:o}}var Ir=M(G(),1);function sk({productBackendUrl:e,sessionId:t,enabled:a=!0}){let[r,o]=Ir.useState({status:"idle"}),n=Ir.useRef(null),s=Ir.useCallback(async()=>{if(!e||!a){o({status:"idle"});return}o({status:"loading"});try{let l=await fetch(`${e}/users/me`,{method:"GET",credentials:"include",headers:{Accept:"application/json"}});if(!l.ok)throw l.status===401?new Error("Please log in to use the chat assistant."):l.status===403?new Error("You do not have permission to access this feature."):new Error(`Authentication failed (${l.status})`);let u=await l.json();o({status:"authenticated",user:u})}catch(l){let u=l instanceof Error?l.message:"Unable to verify your identity. Please try again.";o({status:"error",error:u})}},[e,a]);Ir.useEffect(()=>{t!==n.current&&(n.current=t,s())},[t,s]);let i=Ir.useCallback(()=>{s()},[s]);return{authState:r,retry:i}}var Si=M(le(),1);function St({className:e,...t}){return(0,Si.jsx)("div",{"data-slot":"card",className:Jt("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function Wa({className:e,...t}){return(0,Si.jsx)("div",{"data-slot":"card-header",className:Jt("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function Ga({className:e,...t}){return(0,Si.jsx)("div",{"data-slot":"card-title",className:Jt("leading-none font-semibold",e),...t})}function Iy({className:e,...t}){return(0,Si.jsx)("div",{"data-slot":"card-description",className:Jt("text-muted-foreground text-sm",e),...t})}function Ct({className:e,...t}){return(0,Si.jsx)("div",{"data-slot":"card-content",className:Jt("px-6",e),...t})}var S=M(le(),1),by=e=>new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),dp=(e,t="USD")=>new Intl.NumberFormat("en-US",{style:"currency",currency:t}).format(e),ky=e=>{switch(e){case"Enterprise":return ln;case"Professional":return au;default:return Kl}},cp=e=>{switch(e){case"Enterprise":return"bg-purple-50 text-purple-700 border-purple-200";case"Professional":return"bg-blue-50 text-blue-700 border-blue-200";default:return"bg-gray-50 text-gray-700 border-gray-200"}};function bu({status:e,type:t="default"}){let r=(()=>{let n=e.toLowerCase();if(t==="transaction")switch(n){case"paid":return{color:"bg-emerald-50 text-emerald-700 border-emerald-200",icon:at};case"failed":return{color:"bg-red-50 text-red-700 border-red-200",icon:ka};case"pending":return{color:"bg-amber-50 text-amber-700 border-amber-200",icon:nn};case"refunded":return{color:"bg-slate-50 text-slate-700 border-slate-200",icon:_s};default:return{color:"bg-gray-50 text-gray-700 border-gray-200",icon:ba}}if(t==="subscription")switch(n){case"active":return{color:"bg-emerald-50 text-emerald-700 border-emerald-200",icon:at};case"cancelled":return{color:"bg-slate-50 text-slate-700 border-slate-200",icon:ka};case"past_due":return{color:"bg-red-50 text-red-700 border-red-200",icon:ba};case"trialing":return{color:"bg-blue-50 text-blue-700 border-blue-200",icon:nn};default:return{color:"bg-gray-50 text-gray-700 border-gray-200",icon:ba}}switch(n){case"active":return{color:"bg-emerald-50 text-emerald-700 border-emerald-200",icon:at};case"inactive":return{color:"bg-slate-50 text-slate-700 border-slate-200",icon:ka};default:return{color:"bg-gray-50 text-gray-700 border-gray-200",icon:ba}}})(),o=r.icon;return(0,S.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium border ${r.color}`,children:[(0,S.jsx)(o,{className:"h-3 w-3"}),e]})}function uD({subscription:e}){let t=ky(e.plan);return(0,S.jsxs)(St,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)("div",{className:`h-1 ${e.status==="active"?"bg-emerald-500":e.status==="past_due"?"bg-red-500":"bg-slate-300"}`}),(0,S.jsx)(Wa,{className:"pb-3",children:(0,S.jsxs)("div",{className:"flex items-start justify-between",children:[(0,S.jsxs)("div",{className:"space-y-1",children:[(0,S.jsxs)(Ga,{className:"text-base font-semibold text-gray-900 flex items-center gap-2",children:[(0,S.jsx)(sn,{className:"h-4 w-4 text-gray-500"}),e.id]}),e.customer_email&&(0,S.jsxs)(Iy,{className:"text-sm text-gray-500 flex items-center gap-1.5",children:[(0,S.jsx)(As,{className:"h-3 w-3"}),e.customer_email]})]}),(0,S.jsx)(bu,{status:e.status,type:"subscription"})]})}),(0,S.jsx)(Ct,{className:"pt-0",children:(0,S.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,S.jsxs)("div",{className:"space-y-3",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Plan"}),(0,S.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium border ${cp(e.plan)}`,children:[(0,S.jsx)(t,{className:"h-3 w-3"}),e.plan]})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Billing"}),(0,S.jsxs)("div",{className:"text-sm font-medium text-gray-900",children:[dp(e.amount,e.currency)," / ",e.billing_cycle]})]})]}),(0,S.jsxs)("div",{className:"space-y-3",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Current Period"}),(0,S.jsxs)("div",{className:"text-sm text-gray-700",children:[by(e.current_period_start)," - ",by(e.current_period_end)]})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Created"}),(0,S.jsx)("div",{className:"text-sm text-gray-700",children:by(e.created_at)})]})]})]})})]})}function dD({subscriptions:e,maxItems:t=5}){let a=e.slice(0,t),r=e.length>t;return e.length===0?(0,S.jsx)(St,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(Ct,{className:"py-8 text-center",children:[(0,S.jsx)(sn,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,S.jsx)("p",{className:"text-sm text-gray-500",children:"No subscriptions found"})]})}):(0,S.jsxs)(St,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Wa,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ga,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(sn,{className:"h-4 w-4"}),e.length," Subscription",e.length!==1?"s":""]})}),(0,S.jsxs)(Ct,{className:"p-0",children:[(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:a.map(o=>{let n=ky(o.plan);return(0,S.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,S.jsx)("div",{className:`p-2 rounded-lg ${cp(o.plan).replace("text-","text-").replace("border-","bg-").split(" ")[0]}`,children:(0,S.jsx)(n,{className:"h-4 w-4"})}),(0,S.jsxs)("div",{className:"min-w-0",children:[(0,S.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:o.customer_email||o.customer_id}),(0,S.jsxs)("div",{className:"text-xs text-gray-500",children:[o.plan," \xB7 ",dp(o.amount,o.currency),"/",o.billing_cycle]})]})]}),(0,S.jsx)(bu,{status:o.status,type:"subscription"})]})},o.id)})}),r&&(0,S.jsx)("div",{className:"px-4 py-2 bg-gray-50 border-t border-gray-100 text-center",children:(0,S.jsxs)("span",{className:"text-xs text-gray-500",children:["+",e.length-t," more subscription",e.length-t!==1?"s":""]})})]})]})}function cD({customer:e}){let t=ky(e.subscription);return(0,S.jsxs)(St,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)("div",{className:`h-1 ${e.status==="active"?"bg-emerald-500":"bg-slate-300"}`}),(0,S.jsx)(Wa,{className:"pb-3",children:(0,S.jsxs)("div",{className:"flex items-start justify-between",children:[(0,S.jsx)("div",{className:"flex items-center gap-3",children:(0,S.jsxs)("div",{children:[(0,S.jsx)(Ga,{className:"text-base font-semibold text-gray-900",children:e.name}),(0,S.jsxs)(Iy,{className:"text-sm text-gray-500 flex items-center gap-1",children:[(0,S.jsx)(As,{className:"h-3 w-3"}),e.email]})]})}),(0,S.jsx)(bu,{status:e.status,type:"customer"})]})}),(0,S.jsx)(Ct,{className:"pt-0",children:(0,S.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,S.jsxs)("div",{className:"space-y-3",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Plan"}),(0,S.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium border ${cp(e.subscription)}`,children:[(0,S.jsx)(t,{className:"h-3 w-3"}),e.subscription]})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Revenue"}),(0,S.jsxs)("div",{className:"text-sm font-medium text-gray-900 flex items-center gap-1",children:[(0,S.jsx)(un,{className:"h-3 w-3 text-emerald-500"}),e.revenue]})]})]}),(0,S.jsxs)("div",{className:"space-y-3",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Location"}),(0,S.jsxs)("div",{className:"text-sm text-gray-700 flex items-center gap-1",children:[(0,S.jsx)(Rs,{className:"h-3 w-3 text-gray-400"}),e.location||"Not specified"]})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Customer Since"}),(0,S.jsxs)("div",{className:"text-sm text-gray-700 flex items-center gap-1",children:[(0,S.jsx)(Ql,{className:"h-3 w-3 text-gray-400"}),e.joinDate]})]})]})]})})]})}function fD({customers:e,maxItems:t=5}){let a=e.slice(0,t),r=e.length>t;return e.length===0?(0,S.jsx)(St,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(Ct,{className:"py-8 text-center",children:[(0,S.jsx)(Ds,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,S.jsx)("p",{className:"text-sm text-gray-500",children:"No customers found"})]})}):(0,S.jsxs)(St,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Wa,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ga,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(Ds,{className:"h-4 w-4"}),e.length," Customer",e.length!==1?"s":""]})}),(0,S.jsxs)(Ct,{className:"p-0",children:[(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:a.map(o=>(0,S.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsx)("div",{className:"flex items-center gap-3 min-w-0",children:(0,S.jsxs)("div",{className:"min-w-0",children:[(0,S.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:o.name}),(0,S.jsx)("div",{className:"text-xs text-gray-500 truncate",children:o.email})]})}),(0,S.jsxs)("div",{className:"flex items-center gap-2",children:[(0,S.jsx)("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${cp(o.subscription)}`,children:o.subscription}),(0,S.jsx)(bu,{status:o.status,type:"customer"})]})]})},o.id))}),r&&(0,S.jsx)("div",{className:"px-4 py-2 bg-gray-50 border-t border-gray-100 text-center",children:(0,S.jsxs)("span",{className:"text-xs text-gray-500",children:["+",e.length-t," more customer",e.length-t!==1?"s":""]})})]})]})}function ik({transactions:e,maxItems:t=5}){let a=e.slice(0,t),r=e.length>t;return e.length===0?(0,S.jsx)(St,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(Ct,{className:"py-8 text-center",children:[(0,S.jsx)(un,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,S.jsx)("p",{className:"text-sm text-gray-500",children:"No transactions found"})]})}):(0,S.jsxs)(St,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Wa,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ga,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(un,{className:"h-4 w-4"}),e.length," Transaction",e.length!==1?"s":""]})}),(0,S.jsxs)(Ct,{className:"p-0",children:[(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:a.map(o=>(0,S.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,S.jsx)("div",{className:`p-2 rounded-lg ${o.status==="paid"?"bg-emerald-50":o.status==="failed"?"bg-red-50":o.status==="refunded"?"bg-slate-50":"bg-amber-50"}`,children:o.status==="paid"?(0,S.jsx)(at,{className:"h-4 w-4 text-emerald-600"}):o.status==="failed"?(0,S.jsx)(ka,{className:"h-4 w-4 text-red-600"}):o.status==="refunded"?(0,S.jsx)(_s,{className:"h-4 w-4 text-slate-600"}):(0,S.jsx)(nn,{className:"h-4 w-4 text-amber-600"})}),(0,S.jsxs)("div",{className:"min-w-0",children:[(0,S.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:o.customer}),(0,S.jsxs)("div",{className:"text-xs text-gray-500",children:[o.date,o.decline_reason&&(0,S.jsxs)("span",{className:"text-red-500 ml-2",children:["\xB7 ",o.decline_reason]})]})]})]}),(0,S.jsxs)("div",{className:"flex items-center gap-3",children:[(0,S.jsxs)("span",{className:`text-sm font-semibold ${o.status==="paid"?"text-emerald-600":o.status==="failed"?"text-red-600":o.status==="refunded"?"text-slate-600":"text-amber-600"}`,children:[o.status==="refunded"?"-":"",o.amount]}),(0,S.jsx)(bu,{status:o.status,type:"transaction"})]})]})},o.id))}),r&&(0,S.jsx)("div",{className:"px-4 py-2 bg-gray-50 border-t border-gray-100 text-center",children:(0,S.jsxs)("span",{className:"text-xs text-gray-500",children:["+",e.length-t," more transaction",e.length-t!==1?"s":""]})})]})]})}function pD({apiKeys:e}){return e.length===0?(0,S.jsx)(St,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(Ct,{className:"py-8 text-center",children:[(0,S.jsx)(Ts,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,S.jsx)("p",{className:"text-sm text-gray-500",children:"No API keys found"})]})}):(0,S.jsxs)(St,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Wa,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ga,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(Ts,{className:"h-4 w-4"}),e.length," API Key",e.length!==1?"s":""]})}),(0,S.jsx)(Ct,{className:"p-0",children:(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:e.map((t,a)=>(0,S.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsxs)("div",{className:"min-w-0",children:[(0,S.jsx)("div",{className:"text-sm font-medium text-gray-900",children:t.name}),(0,S.jsxs)("div",{className:"text-xs text-gray-500 font-mono",children:[t.key.slice(0,12),"...",t.key.slice(-4)]})]}),(0,S.jsxs)("div",{className:"text-xs text-gray-500",children:["Last used: ",t.lastUsed]})]})},a))})})]})}function mD({sessions:e}){let t=a=>{let r=a.toLowerCase();return r.includes("mobile")||r.includes("iphone")||r.includes("android")?eu:Yl};return e.length===0?(0,S.jsx)(St,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(Ct,{className:"py-8 text-center",children:[(0,S.jsx)(Es,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,S.jsx)("p",{className:"text-sm text-gray-500",children:"No active sessions"})]})}):(0,S.jsxs)(St,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Wa,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ga,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(Es,{className:"h-4 w-4"}),e.length," Active Session",e.length!==1?"s":""]})}),(0,S.jsx)(Ct,{className:"p-0",children:(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:e.map((a,r)=>{let o=t(a.device);return(0,S.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsxs)("div",{className:"flex items-center gap-3",children:[(0,S.jsx)("div",{className:"p-2 rounded-lg bg-gray-100",children:(0,S.jsx)(o,{className:"h-4 w-4 text-gray-600"})}),(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-sm font-medium text-gray-900",children:a.device}),(0,S.jsxs)("div",{className:"text-xs text-gray-500 flex items-center gap-1",children:[(0,S.jsx)(Rs,{className:"h-3 w-3"}),a.location]})]})]}),(0,S.jsx)("div",{className:"text-xs text-gray-500",children:a.time})]})},r)})})})]})}function hD({stats:e}){return(0,S.jsxs)(St,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Wa,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ga,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(tu,{className:"h-4 w-4"}),"Dashboard Overview"]})}),(0,S.jsx)(Ct,{className:"p-4",children:(0,S.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[e.revenue&&(0,S.jsxs)("div",{className:"p-3 rounded-lg bg-emerald-50 border border-emerald-100",children:[(0,S.jsx)("div",{className:"text-xs text-emerald-600 font-medium mb-1",children:"Revenue"}),(0,S.jsx)("div",{className:"text-lg font-bold text-emerald-700",children:dp(e.revenue.total)}),e.revenue.change!==0&&(0,S.jsxs)("div",{className:`text-xs ${e.revenue.change>0?"text-emerald-600":"text-red-600"}`,children:[e.revenue.change>0?"+":"",e.revenue.change,"% from last period"]})]}),e.subscriptions&&(0,S.jsxs)("div",{className:"p-3 rounded-lg bg-blue-50 border border-blue-100",children:[(0,S.jsx)("div",{className:"text-xs text-blue-600 font-medium mb-1",children:"Subscriptions"}),(0,S.jsxs)("div",{className:"text-lg font-bold text-blue-700",children:[e.subscriptions.active," active"]}),(0,S.jsxs)("div",{className:"text-xs text-blue-600",children:[e.subscriptions.total," total"]})]}),e.customers&&(0,S.jsxs)("div",{className:"p-3 rounded-lg bg-purple-50 border border-purple-100",children:[(0,S.jsx)("div",{className:"text-xs text-purple-600 font-medium mb-1",children:"Customers"}),(0,S.jsx)("div",{className:"text-lg font-bold text-purple-700",children:e.customers.total}),e.customers.new>0&&(0,S.jsxs)("div",{className:"text-xs text-purple-600",children:["+",e.customers.new," new this period"]})]}),e.transactions&&(0,S.jsxs)("div",{className:"p-3 rounded-lg bg-amber-50 border border-amber-100",children:[(0,S.jsx)("div",{className:"text-xs text-amber-600 font-medium mb-1",children:"Transactions"}),(0,S.jsxs)("div",{className:"text-lg font-bold text-amber-700",children:[e.transactions.successful," successful"]}),e.transactions.failed>0&&(0,S.jsxs)("div",{className:"text-xs text-red-600",children:[e.transactions.failed," failed"]})]})]})})]})}function gD({customers:e}){return e.length===0?(0,S.jsx)(St,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(Ct,{className:"py-8 text-center",children:[(0,S.jsx)(ln,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,S.jsx)("p",{className:"text-sm text-gray-500",children:"No top customers data"})]})}):(0,S.jsxs)(St,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Wa,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ga,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(ln,{className:"h-4 w-4 text-amber-500"}),"Top Customers"]})}),(0,S.jsx)(Ct,{className:"p-0",children:(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:e.map((t,a)=>(0,S.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,S.jsx)("div",{className:`h-6 w-6 rounded-full flex items-center justify-center text-xs font-bold ${a===0?"bg-amber-100 text-amber-700":a===1?"bg-slate-100 text-slate-700":a===2?"bg-orange-100 text-orange-700":"bg-gray-100 text-gray-700"}`,children:a+1}),(0,S.jsxs)("div",{className:"min-w-0",children:[(0,S.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:t.name}),(0,S.jsx)("div",{className:"text-xs text-gray-500 truncate",children:t.email})]})]}),(0,S.jsx)("div",{className:"text-sm font-semibold text-emerald-600",children:typeof t.revenue=="number"?dp(t.revenue):t.revenue})]})},a))})})]})}function lk({type:e,data:t}){if(!t)return null;switch(e){case"subscription":return(0,S.jsx)(uD,{subscription:t});case"subscriptions":let a=t.subscriptions||t||[];return(0,S.jsx)(dD,{subscriptions:Array.isArray(a)?a:[a]});case"customer":return(0,S.jsx)(cD,{customer:t.customer||t});case"customers":let r=t.customers||t||[];return(0,S.jsx)(fD,{customers:Array.isArray(r)?r:[r]});case"transactions":let o=t.transactions||t||[];return(0,S.jsx)(ik,{transactions:Array.isArray(o)?o:[o]});case"transaction":return(0,S.jsx)(ik,{transactions:[t],maxItems:1});case"dashboard_stats":return(0,S.jsx)(hD,{stats:t});case"top_customers":let n=t.customers||t||[];return(0,S.jsx)(gD,{customers:Array.isArray(n)?n:[n]});case"api_keys":let s=t.api_keys||t||[];return(0,S.jsx)(pD,{apiKeys:Array.isArray(s)?s:[s]});case"sessions":let i=t.sessions||t||[];return(0,S.jsx)(mD,{sessions:Array.isArray(i)?i:[i]});default:return null}}var bn=M(le(),1);function uk({className:e=""}){return(0,bn.jsx)("div",{className:`flex items-center gap-1 px-4 py-3 ${e}`,children:(0,bn.jsxs)("div",{className:"flex items-center gap-1",children:[(0,bn.jsx)("span",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"0ms",animationDuration:"600ms"}}),(0,bn.jsx)("span",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"150ms",animationDuration:"600ms"}}),(0,bn.jsx)("span",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"300ms",animationDuration:"600ms"}})]})})}var p=M(le(),1),yD="0.2.42",xD="http://localhost:5002",fp=340;function vD(e){return e.replace(/\\\\n/g,`
23
+ `),()=>{document.head.removeChild(d)}},[t]),(0,jC.jsx)(Lg,{isPresent:t,childRef:r,sizeRef:o,children:Uc.cloneElement(e,{ref:r})})}var zC=({children:e,initial:t,isPresent:a,onExitComplete:r,custom:o,presenceAffectsLayout:n,mode:s})=>{let i=Ns(KR),l=(0,fn.useId)(),u=(0,fn.useCallback)(c=>{i.set(c,!0);for(let f of i.values())if(!f)return;r&&r()},[i,r]),d=(0,fn.useMemo)(()=>({id:l,initial:t,isPresent:a,custom:o,onExitComplete:u,register:c=>(i.set(c,!1),()=>i.delete(c))}),n?[Math.random(),u]:[a,u]);return(0,fn.useMemo)(()=>{i.forEach((c,f)=>i.set(f,!1))},[a]),HC.useEffect(()=>{!a&&!i.size&&r&&r()},[a]),s==="popLayout"&&(e=(0,Ig.jsx)(qC,{isPresent:a,children:e})),(0,Ig.jsx)(oo.Provider,{value:d,children:e})};function KR(){return new Map}var no=M(G(),1);function Vc(e=!0){let t=(0,no.useContext)(oo);if(t===null)return[!0,null];let{isPresent:a,onExitComplete:r,register:o}=t,n=(0,no.useId)();(0,no.useEffect)(()=>{e&&o(n)},[e]);let s=(0,no.useCallback)(()=>e&&r&&r(n),[n,r,e]);return!a&&r?[!1,s]:[!0]}var jc=M(G(),1),ru=e=>e.key||"";function bg(e){let t=[];return jc.Children.forEach(e,a=>{(0,jc.isValidElement)(a)&&t.push(a)}),t}var qc=M(G(),1);var Fs=typeof window<"u";var Hc=Fs?qc.useLayoutEffect:qc.useEffect;var kg=({children:e,custom:t,initial:a=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:n="sync",propagate:s=!1})=>{let[i,l]=Vc(s),u=(0,Va.useMemo)(()=>bg(e),[e]),d=s&&!i?[]:u.map(ru),c=(0,Va.useRef)(!0),f=(0,Va.useRef)(u),g=Ns(()=>new Map),[x,w]=(0,Va.useState)(u),[L,y]=(0,Va.useState)(u);Hc(()=>{c.current=!1,f.current=u;for(let C=0;C<L.length;C++){let I=ru(L[C]);d.includes(I)?g.delete(I):g.get(I)!==!0&&g.set(I,!1)}},[L,d.length,d.join("-")]);let h=[];if(u!==x){let C=[...u];for(let I=0;I<L.length;I++){let P=L[I],R=ru(P);d.includes(R)||(C.splice(I,0,P),h.push(P))}n==="wait"&&h.length&&(C=h),y(bg(C)),w(u);return}let{forceRender:m}=(0,Va.useContext)(Ms);return(0,ou.jsx)(ou.Fragment,{children:L.map(C=>{let I=ru(C),P=s&&!i?!1:u===L||d.includes(I),R=()=>{if(g.has(I))g.set(I,!0);else return;let A=!0;g.forEach(q=>{q||(A=!1)}),A&&(m?.(),y(f.current),s&&l?.(),r&&r())};return(0,ou.jsx)(zC,{isPresent:P,initial:!c.current||a?void 0:!1,custom:P?void 0:t,presenceAffectsLayout:o,mode:n,onExitComplete:P?void 0:R,children:C},I)})})};var ge=e=>e;var hr=ge,Ta=ge;function pn(e){let t;return()=>(t===void 0&&(t=e()),t)}var Yt=(e,t,a)=>{let r=t-e;return r===0?1:(a-e)/r};var Be=e=>e*1e3,dt=e=>e/1e3;var Bs={skipAnimations:!1,useManualTiming:!1};function $C(e){let t=new Set,a=new Set,r=!1,o=!1,n=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1};function i(u){n.has(u)&&(l.schedule(u),e()),u(s)}let l={schedule:(u,d=!1,c=!1)=>{let g=c&&r?t:a;return d&&n.add(u),g.has(u)||g.add(u),u},cancel:u=>{a.delete(u),n.delete(u)},process:u=>{if(s=u,r){o=!0;return}r=!0,[t,a]=[a,t],t.forEach(i),t.clear(),r=!1,o&&(o=!1,l.process(u))}};return l}var zc=["read","resolveKeyframes","update","preRender","render","postRender"],XR=40;function $c(e,t){let a=!1,r=!0,o={delta:0,timestamp:0,isProcessing:!1},n=()=>a=!0,s=zc.reduce((y,h)=>(y[h]=$C(n),y),{}),{read:i,resolveKeyframes:l,update:u,preRender:d,render:c,postRender:f}=s,g=()=>{let y=Bs.useManualTiming?o.timestamp:performance.now();a=!1,o.delta=r?1e3/60:Math.max(Math.min(y-o.timestamp,XR),1),o.timestamp=y,o.isProcessing=!0,i.process(o),l.process(o),u.process(o),d.process(o),c.process(o),f.process(o),o.isProcessing=!1,a&&t&&(r=!1,e(g))},x=()=>{a=!0,r=!0,o.isProcessing||e(g)};return{schedule:zc.reduce((y,h)=>{let m=s[h];return y[h]=(C,I=!1,P=!1)=>(a||x(),m.schedule(C,I,P)),y},{}),cancel:y=>{for(let h=0;h<zc.length;h++)s[zc[h]].cancel(y)},state:o,steps:s}}var{schedule:ee,cancel:Zt,state:Ue,steps:Wc}=$c(typeof requestAnimationFrame<"u"?requestAnimationFrame:ge,!0);var WC=M(G(),1),Gc=(0,WC.createContext)({strict:!1});var GC={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},gr={};for(let e in GC)gr[e]={isEnabled:t=>GC[e].some(a=>!!t[a])};function KC(e){for(let t in e)gr[t]={...gr[t],...e[t]}}var QR=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function nu(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||QR.has(e)}var XC=e=>!nu(e);function JR(e){e&&(XC=t=>t.startsWith("on")?!nu(t):e(t))}try{JR(Ek("@emotion/is-prop-valid").default)}catch{}function QC(e,t,a){let r={};for(let o in e)o==="values"&&typeof e.values=="object"||(XC(o)||a===!0&&nu(o)||!t&&!nu(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}function JC(e){if(typeof Proxy>"u")return e;let t=new Map,a=(...r)=>e(...r);return new Proxy(a,{get:(r,o)=>o==="create"?e:(t.has(o)||t.set(o,e(o)),t.get(o))})}var Zc=M(le(),1);var js=M(G(),1);var YC=M(G(),1),so=(0,YC.createContext)({});var Qc=M(G(),1);function yr(e){return typeof e=="string"||Array.isArray(e)}function io(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}var Kc=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],su=["initial",...Kc];function mn(e){return io(e.animate)||su.some(t=>yr(e[t]))}function Xc(e){return!!(mn(e)||e.variants)}function ZC(e,t){if(mn(e)){let{initial:a,animate:r}=e;return{initial:a===!1||yr(a)?a:void 0,animate:yr(r)?r:void 0}}return e.inherit!==!1?t:{}}function tL(e){let{initial:t,animate:a}=ZC(e,(0,Qc.useContext)(so));return(0,Qc.useMemo)(()=>({initial:t,animate:a}),[eL(t),eL(a)])}function eL(e){return Array.isArray(e)?e.join(" "):e}var aL=Symbol.for("motionComponentSymbol");var rL=M(G(),1);function xr(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function oL(e,t,a){return(0,rL.useCallback)(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),a&&(typeof a=="function"?a(r):xr(a)&&(a.current=r))},[t])}var Ut=M(G(),1);var Us=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase();var YR="framerAppearId",Jc="data-"+Us(YR);var{schedule:Vs,cancel:MU}=$c(queueMicrotask,!1);var nL=M(G(),1),Yc=(0,nL.createContext)({});function sL(e,t,a,r,o){var n,s;let{visualElement:i}=(0,Ut.useContext)(so),l=(0,Ut.useContext)(Gc),u=(0,Ut.useContext)(oo),d=(0,Ut.useContext)(Os).reducedMotion,c=(0,Ut.useRef)(null);r=r||l.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:i,props:a,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d}));let f=c.current,g=(0,Ut.useContext)(Yc);f&&!f.projection&&o&&(f.type==="html"||f.type==="svg")&&ZR(c.current,a,o,g);let x=(0,Ut.useRef)(!1);(0,Ut.useInsertionEffect)(()=>{f&&x.current&&f.update(a,u)});let w=a[Jc],L=(0,Ut.useRef)(!!w&&!(!((n=window.MotionHandoffIsComplete)===null||n===void 0)&&n.call(window,w))&&((s=window.MotionHasOptimisedAnimation)===null||s===void 0?void 0:s.call(window,w)));return Hc(()=>{f&&(x.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),Vs.render(f.render),L.current&&f.animationState&&f.animationState.animateChanges())}),(0,Ut.useEffect)(()=>{f&&(!L.current&&f.animationState&&f.animationState.animateChanges(),L.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)===null||y===void 0||y.call(window,w)}),L.current=!1))}),f}function ZR(e,t,a,r){let{layoutId:o,layout:n,drag:s,dragConstraints:i,layoutScroll:l,layoutRoot:u}=t;e.projection=new a(e.latestValues,t["data-framer-portal-id"]?void 0:iL(e.parent)),e.projection.setOptions({layoutId:o,layout:n,alwaysMeasureLayout:!!s||i&&xr(i),visualElement:e,animationType:typeof n=="string"?n:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:u})}function iL(e){if(e)return e.options.allowProjection!==!1?e.projection:iL(e.parent)}function lL({preloadedFeatures:e,createVisualElement:t,useRender:a,useVisualState:r,Component:o}){var n,s;e&&KC(e);function i(u,d){let c,f={...(0,js.useContext)(Os),...u,layoutId:e_(u)},{isStatic:g}=f,x=tL(u),w=r(u,g);if(!g&&Fs){t_(f,e);let L=a_(f);c=L.MeasureLayout,x.visualElement=sL(o,w,f,t,L.ProjectionNode)}return(0,Zc.jsxs)(so.Provider,{value:x,children:[c&&x.visualElement?(0,Zc.jsx)(c,{visualElement:x.visualElement,...f}):null,a(o,u,oL(w,x.visualElement,d),w,g,x.visualElement)]})}i.displayName=`motion.${typeof o=="string"?o:`create(${(s=(n=o.displayName)!==null&&n!==void 0?n:o.name)!==null&&s!==void 0?s:""})`}`;let l=(0,js.forwardRef)(i);return l[aL]=o,l}function e_({layoutId:e}){let t=(0,js.useContext)(Ms).id;return t&&e!==void 0?t+"-"+e:e}function t_(e,t){let a=(0,js.useContext)(Gc).strict}function a_(e){let{drag:t,layout:a}=gr;if(!t&&!a)return{};let r={...t,...a};return{MeasureLayout:t?.isEnabled(e)||a?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}var uL=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function qs(e){return typeof e!="string"||e.includes("-")?!1:!!(uL.indexOf(e)>-1||/[A-Z]/u.test(e))}var Pg=M(G(),1);function dL(e){let t=[{},{}];return e?.values.forEach((a,r)=>{t[0][r]=a.get(),t[1][r]=a.getVelocity()}),t}function Hs(e,t,a,r){if(typeof t=="function"){let[o,n]=dL(r);t=t(a!==void 0?a:e.custom,o,n)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){let[o,n]=dL(r);t=t(a!==void 0?a:e.custom,o,n)}return t}var iu=e=>Array.isArray(e);var cL=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),fL=e=>iu(e)?e[e.length-1]||0:e;var Ce=e=>!!(e&&e.getVelocity);function zs(e){let t=Ce(e)?e.get():e;return cL(t)?t.toValue():t}function r_({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:a},r,o,n){let s={latestValues:o_(r,o,n,e),renderState:t()};return a&&(s.onMount=i=>a({props:r,current:i,...s}),s.onUpdate=i=>a(i)),s}var ef=e=>(t,a)=>{let r=(0,Pg.useContext)(so),o=(0,Pg.useContext)(oo),n=()=>r_(e,t,r,o);return a?n():Ns(n)};function o_(e,t,a,r){let o={},n=r(e,{});for(let f in n)o[f]=zs(n[f]);let{initial:s,animate:i}=e,l=mn(e),u=Xc(e);t&&u&&!l&&e.inherit!==!1&&(s===void 0&&(s=t.initial),i===void 0&&(i=t.animate));let d=a?a.initial===!1:!1;d=d||s===!1;let c=d?i:s;if(c&&typeof c!="boolean"&&!io(c)){let f=Array.isArray(c)?c:[c];for(let g=0;g<f.length;g++){let x=Hs(e,f[g]);if(x){let{transitionEnd:w,transition:L,...y}=x;for(let h in y){let m=y[h];if(Array.isArray(m)){let C=d?m.length-1:0;m=m[C]}m!==null&&(o[h]=m)}for(let h in w)o[h]=w[h]}}}return o}var ja=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Vt=new Set(ja);var pL=e=>t=>typeof t=="string"&&t.startsWith(e),tf=pL("--"),n_=pL("var(--"),$s=e=>n_(e)?s_.test(e.split("/*")[0].trim()):!1,s_=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;var af=(e,t)=>t&&typeof e=="number"?t.transform(e):e;var ct=(e,t,a)=>a>t?t:a<e?e:a;var qa={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},vr={...qa,transform:e=>ct(0,1,e)},lu={...qa,default:1};var uu=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ha=uu("deg"),Pt=uu("%"),H=uu("px"),mL=uu("vh"),hL=uu("vw"),Tg={...Pt,parse:e=>Pt.parse(e)/100,transform:e=>Pt.transform(e*100)};var gL={borderWidth:H,borderTopWidth:H,borderRightWidth:H,borderBottomWidth:H,borderLeftWidth:H,borderRadius:H,radius:H,borderTopLeftRadius:H,borderTopRightRadius:H,borderBottomRightRadius:H,borderBottomLeftRadius:H,width:H,maxWidth:H,height:H,maxHeight:H,top:H,right:H,bottom:H,left:H,padding:H,paddingTop:H,paddingRight:H,paddingBottom:H,paddingLeft:H,margin:H,marginTop:H,marginRight:H,marginBottom:H,marginLeft:H,backgroundPositionX:H,backgroundPositionY:H};var yL={rotate:Ha,rotateX:Ha,rotateY:Ha,rotateZ:Ha,scale:lu,scaleX:lu,scaleY:lu,scaleZ:lu,skew:Ha,skewX:Ha,skewY:Ha,distance:H,translateX:H,translateY:H,translateZ:H,x:H,y:H,z:H,perspective:H,transformPerspective:H,opacity:vr,originX:Tg,originY:Tg,originZ:H};var Ag={...qa,transform:Math.round};var Ws={...gL,...yL,zIndex:Ag,size:H,fillOpacity:vr,strokeOpacity:vr,numOctaves:Ag};var i_={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},l_=ja.length;function xL(e,t,a){let r="",o=!0;for(let n=0;n<l_;n++){let s=ja[n],i=e[s];if(i===void 0)continue;let l=!0;if(typeof i=="number"?l=i===(s.startsWith("scale")?1:0):l=parseFloat(i)===0,!l||a){let u=af(i,Ws[s]);if(!l){o=!1;let d=i_[s]||s;r+=`${d}(${u}) `}a&&(t[s]=u)}}return r=r.trim(),a?r=a(t,o?"":r):o&&(r="none"),r}function Gs(e,t,a){let{style:r,vars:o,transformOrigin:n}=e,s=!1,i=!1;for(let l in t){let u=t[l];if(Vt.has(l)){s=!0;continue}else if(tf(l)){o[l]=u;continue}else{let d=af(u,Ws[l]);l.startsWith("origin")?(i=!0,n[l]=d):r[l]=d}}if(t.transform||(s||a?r.transform=xL(t,e.transform,a):r.transform&&(r.transform="none")),i){let{originX:l="50%",originY:u="50%",originZ:d=0}=n;r.transformOrigin=`${l} ${u} ${d}`}}var u_={offset:"stroke-dashoffset",array:"stroke-dasharray"},d_={offset:"strokeDashoffset",array:"strokeDasharray"};function vL(e,t,a=1,r=0,o=!0){e.pathLength=1;let n=o?u_:d_;e[n.offset]=H.transform(-r);let s=H.transform(t),i=H.transform(a);e[n.array]=`${s} ${i}`}function wL(e,t,a){return typeof e=="string"?e:H.transform(t+a*e)}function SL(e,t,a){let r=wL(t,e.x,e.width),o=wL(a,e.y,e.height);return`${r} ${o}`}function Ks(e,{attrX:t,attrY:a,attrScale:r,originX:o,originY:n,pathLength:s,pathSpacing:i=1,pathOffset:l=0,...u},d,c){if(Gs(e,u,c),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:f,style:g,dimensions:x}=e;f.transform&&(x&&(g.transform=f.transform),delete f.transform),x&&(o!==void 0||n!==void 0||g.transform)&&(g.transformOrigin=SL(x,o!==void 0?o:.5,n!==void 0?n:.5)),t!==void 0&&(f.x=t),a!==void 0&&(f.y=a),r!==void 0&&(f.scale=r),s!==void 0&&vL(f,s,i,l,!1)}var Xs=()=>({style:{},transform:{},transformOrigin:{},vars:{}});var rf=()=>({...Xs(),attrs:{}});var Qs=e=>typeof e=="string"&&e.toLowerCase()==="svg";function of(e,{style:t,vars:a},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(let n in a)e.style.setProperty(n,a[n])}var nf=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function sf(e,t,a,r){of(e,t,void 0,r);for(let o in t.attrs)e.setAttribute(nf.has(o)?o:Us(o),t.attrs[o])}var Js={};function CL(e){Object.assign(Js,e)}function lf(e,{layout:t,layoutId:a}){return Vt.has(e)||e.startsWith("origin")||(t||a!==void 0)&&(!!Js[e]||e==="opacity")}function Ys(e,t,a){var r;let{style:o}=e,n={};for(let s in o)(Ce(o[s])||t.style&&Ce(t.style[s])||lf(s,e)||((r=a?.getValue(s))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(n[s]=o[s]);return n}function uf(e,t,a){let r=Ys(e,t,a);for(let o in e)if(Ce(e[o])||Ce(t[o])){let n=ja.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[n]=e[o]}return r}function c_(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}var LL=["x","y","width","height","cx","cy","r"],IL={useVisualState:ef({scrapeMotionValuesFromProps:uf,createRenderState:rf,onUpdate:({props:e,prevProps:t,current:a,renderState:r,latestValues:o})=>{if(!a)return;let n=!!e.drag;if(!n){for(let i in o)if(Vt.has(i)){n=!0;break}}if(!n)return;let s=!t;if(t)for(let i=0;i<LL.length;i++){let l=LL[i];e[l]!==t[l]&&(s=!0)}s&&ee.read(()=>{c_(a,r),ee.render(()=>{Ks(r,o,Qs(a.tagName),e.transformTemplate),sf(a,r)})})}})};var bL={useVisualState:ef({scrapeMotionValuesFromProps:Ys,createRenderState:Xs})};var Zs=M(G(),1);var kL=M(G(),1);function Rg(e,t,a){for(let r in t)!Ce(t[r])&&!lf(r,a)&&(e[r]=t[r])}function f_({transformTemplate:e},t){return(0,kL.useMemo)(()=>{let a=Xs();return Gs(a,t,e),Object.assign({},a.vars,a.style)},[t])}function p_(e,t){let a=e.style||{},r={};return Rg(r,a,e),Object.assign(r,f_(e,t)),r}function PL(e,t){let a={},r=p_(e,t);return e.drag&&e.dragListener!==!1&&(a.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(a.tabIndex=0),a.style=r,a}var TL=M(G(),1);function AL(e,t,a,r){let o=(0,TL.useMemo)(()=>{let n=rf();return Ks(n,t,Qs(r),e.transformTemplate),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let n={};Rg(n,e.style,e),o.style={...n,...o.style}}return o}function RL(e=!1){return(a,r,o,{latestValues:n},s)=>{let l=(qs(a)?AL:PL)(r,n,s,a),u=QC(r,typeof a=="string",e),d=a!==Zs.Fragment?{...u,...l,ref:o}:{},{children:c}=r,f=(0,Zs.useMemo)(()=>Ce(c)?c.get():c,[c]);return(0,Zs.createElement)(a,{...d,children:f})}}function _L(e,t){return function(r,{forwardMotionProps:o}={forwardMotionProps:!1}){let s={...qs(r)?IL:bL,preloadedFeatures:e,useRender:RL(o),createVisualElement:t,Component:r};return lL(s)}}function _g(e,t){if(!Array.isArray(t))return!1;let a=t.length;if(a!==e.length)return!1;for(let r=0;r<a;r++)if(t[r]!==e[r])return!1;return!0}function lo(e,t,a){let r=e.getProps();return Hs(r,t,a!==void 0?a:r.custom,e)}var Eg=pn(()=>window.ScrollTimeline!==void 0);var du=class{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,a){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=a}attachTimeline(t,a){let r=this.animations.map(o=>{if(Eg()&&o.attachTimeline)return o.attachTimeline(t);if(typeof a=="function")return a(o)});return()=>{r.forEach((o,n)=>{o&&o(),this.animations[n].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let a=0;a<this.animations.length;a++)t=Math.max(t,this.animations[a].duration);return t}runAll(t){this.animations.forEach(a=>a[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}};var cu=class extends du{then(t,a){return Promise.all(this.animations).then(t).catch(a)}};function uo(e,t){return e?e[t]||e.default||e:void 0}function ei(e){let t=0,a=50,r=e.next(t);for(;!r.done&&t<2e4;)t+=a,r=e.next(t);return t>=2e4?1/0:t}function co(e){return typeof e=="function"}function fu(e,t){e.timeline=t,e.onfinish=null}var ti=e=>Array.isArray(e)&&typeof e[0]=="number";var Mg={linearEasing:void 0};function EL(e,t){let a=pn(e);return()=>{var r;return(r=Mg[t])!==null&&r!==void 0?r:a()}}var fo=EL(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");var pu=(e,t,a=10)=>{let r="",o=Math.max(Math.round(t/a),2);for(let n=0;n<o;n++)r+=e(Yt(0,o-1,n))+", ";return`linear(${r.substring(0,r.length-2)})`};function cf(e){return!!(typeof e=="function"&&fo()||!e||typeof e=="string"&&(e in df||fo())||ti(e)||Array.isArray(e)&&e.every(cf))}var ai=([e,t,a,r])=>`cubic-bezier(${e}, ${t}, ${a}, ${r})`,df={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ai([0,.65,.55,1]),circOut:ai([.55,0,1,.45]),backIn:ai([.31,.01,.66,-.59]),backOut:ai([.33,1.53,.69,.99])};function ri(e,t){if(e)return typeof e=="function"&&fo()?pu(e,t):ti(e)?ai(e):Array.isArray(e)?e.map(a=>ri(a,t)||df.easeOut):df[e]}var ea={x:!1,y:!1};function oi(){return ea.x||ea.y}function Ng(e,t,a){var r;if(e instanceof Element)return[e];if(typeof e=="string"){let o=document;t&&(o=t.current);let n=(r=a?.[e])!==null&&r!==void 0?r:o.querySelectorAll(e);return n?Array.from(n):[]}return Array.from(e)}function ff(e,t){let a=Ng(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[a,o,()=>r.abort()]}function DL(e){return t=>{t.pointerType==="touch"||oi()||e(t)}}function Og(e,t,a={}){let[r,o,n]=ff(e,a),s=DL(i=>{let{target:l}=i,u=t(i);if(typeof u!="function"||!l)return;let d=DL(c=>{u(c),l.removeEventListener("pointerleave",d)});l.addEventListener("pointerleave",d,o)});return r.forEach(i=>{i.addEventListener("pointerenter",s,o)}),n}var pf=(e,t)=>t?e===t?!0:pf(e,t.parentElement):!1;var hn=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;var m_=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function ML(e){return m_.has(e.tagName)||e.tabIndex!==-1}var gn=new WeakSet;function NL(e){return t=>{t.key==="Enter"&&e(t)}}function Fg(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}var OL=(e,t)=>{let a=e.currentTarget;if(!a)return;let r=NL(()=>{if(gn.has(a))return;Fg(a,"down");let o=NL(()=>{Fg(a,"up")}),n=()=>Fg(a,"cancel");a.addEventListener("keyup",o,t),a.addEventListener("blur",n,t)});a.addEventListener("keydown",r,t),a.addEventListener("blur",()=>a.removeEventListener("keydown",r),t)};function FL(e){return hn(e)&&!oi()}function Bg(e,t,a={}){let[r,o,n]=ff(e,a),s=i=>{let l=i.currentTarget;if(!FL(i)||gn.has(l))return;gn.add(l);let u=t(i),d=(g,x)=>{window.removeEventListener("pointerup",c),window.removeEventListener("pointercancel",f),!(!FL(g)||!gn.has(l))&&(gn.delete(l),typeof u=="function"&&u(g,{success:x}))},c=g=>{d(g,a.useGlobalTarget||pf(l,g.target))},f=g=>{d(g,!1)};window.addEventListener("pointerup",c,o),window.addEventListener("pointercancel",f,o)};return r.forEach(i=>{!ML(i)&&i.getAttribute("tabindex")===null&&(i.tabIndex=0),(a.useGlobalTarget?window:i).addEventListener("pointerdown",s,o),i.addEventListener("focus",u=>OL(u,o),o)}),n}function Ug(e){return e==="x"||e==="y"?ea[e]?null:(ea[e]=!0,()=>{ea[e]=!1}):ea.x||ea.y?null:(ea.x=ea.y=!0,()=>{ea.x=ea.y=!1})}var mf=new Set(["width","height","top","left","right","bottom",...ja]);var hf;function g_(){hf=void 0}var wt={now:()=>(hf===void 0&&wt.set(Ue.isProcessing||Bs.useManualTiming?Ue.timestamp:performance.now()),hf),set:e=>{hf=e,queueMicrotask(g_)}};function ni(e,t){e.indexOf(t)===-1&&e.push(t)}function si(e,t){let a=e.indexOf(t);a>-1&&e.splice(a,1)}var po=class{constructor(){this.subscriptions=[]}add(t){return ni(this.subscriptions,t),()=>si(this.subscriptions,t)}notify(t,a,r){let o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,a,r);else for(let n=0;n<o;n++){let s=this.subscriptions[n];s&&s(t,a,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}};function gf(e,t){return t?e*(1e3/t):0}var UL=30,y_=e=>!isNaN(parseFloat(e)),VL={current:void 0},Vg=class{constructor(t,a={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,o=!0)=>{let n=wt.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),o&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=a.owner}setCurrent(t){this.current=t,this.updatedAt=wt.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=y_(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,a){this.events[t]||(this.events[t]=new po);let r=this.events[t].add(a);return t==="change"?()=>{r(),ee.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(let t in this.events)this.events[t].clear()}attach(t,a){this.passiveEffect=t,this.stopPassiveEffect=a}set(t,a=!0){!a||!this.passiveEffect?this.updateAndNotify(t,a):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,a,r){this.set(a),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,a=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,a&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return VL.current&&VL.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let t=wt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>UL)return 0;let a=Math.min(this.updatedAt-this.prevUpdatedAt,UL);return gf(parseFloat(this.current)-parseFloat(this.prevFrameValue),a)}start(t){return this.stop(),new Promise(a=>{this.hasAnimated=!0,this.animation=t(a),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function wr(e,t){return new Vg(e,t)}function x_(e,t,a){e.hasValue(t)?e.getValue(t).set(a):e.addValue(t,wr(a))}function jL(e,t){let a=lo(e,t),{transitionEnd:r={},transition:o={},...n}=a||{};n={...n,...r};for(let s in n){let i=fL(n[s]);x_(e,s,i)}}function qL(e){return!!(Ce(e)&&e.add)}function mu(e,t){let a=e.getValue("willChange");if(qL(a))return a.add(t)}function yf(e){return e.props[Jc]}var xf={current:!1};var HL=(e,t,a)=>(((1-3*a+3*t)*e+(3*a-6*t))*e+3*t)*e,v_=1e-7,w_=12;function S_(e,t,a,r,o){let n,s,i=0;do s=t+(a-t)/2,n=HL(s,r,o)-e,n>0?a=s:t=s;while(Math.abs(n)>v_&&++i<w_);return s}function mo(e,t,a,r){if(e===t&&a===r)return ge;let o=n=>S_(n,0,1,e,a);return n=>n===0||n===1?n:HL(o(n),t,r)}var vf=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2;var wf=e=>t=>1-e(1-t);var jg=mo(.33,1.53,.69,.99),hu=wf(jg),Sf=vf(hu);var Cf=e=>(e*=2)<1?.5*hu(e):.5*(2-Math.pow(2,-10*(e-1)));var Lf=e=>1-Math.sin(Math.acos(e)),If=wf(Lf),bf=vf(Lf);var kf=e=>/^0[^.\s]+$/u.test(e);function zL(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||kf(e):!0}var ho=e=>Math.round(e*1e5)/1e5;var ii=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function $L(e){return e==null}var WL=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;var li=(e,t)=>a=>!!(typeof a=="string"&&WL.test(a)&&a.startsWith(e)||t&&!$L(a)&&Object.prototype.hasOwnProperty.call(a,t)),Pf=(e,t,a)=>r=>{if(typeof r!="string")return r;let[o,n,s,i]=r.match(ii);return{[e]:parseFloat(o),[t]:parseFloat(n),[a]:parseFloat(s),alpha:i!==void 0?parseFloat(i):1}};var C_=e=>ct(0,255,e),qg={...qa,transform:e=>Math.round(C_(e))},za={test:li("rgb","red"),parse:Pf("red","green","blue"),transform:({red:e,green:t,blue:a,alpha:r=1})=>"rgba("+qg.transform(e)+", "+qg.transform(t)+", "+qg.transform(a)+", "+ho(vr.transform(r))+")"};function L_(e){let t="",a="",r="",o="";return e.length>5?(t=e.substring(1,3),a=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),a=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,a+=a,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(a,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}var gu={test:li("#"),parse:L_,transform:za.transform};var go={test:li("hsl","hue"),parse:Pf("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:a,alpha:r=1})=>"hsla("+Math.round(e)+", "+Pt.transform(ho(t))+", "+Pt.transform(ho(a))+", "+ho(vr.transform(r))+")"};var He={test:e=>za.test(e)||gu.test(e)||go.test(e),parse:e=>za.test(e)?za.parse(e):go.test(e)?go.parse(e):gu.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?za.transform(e):go.transform(e)};var GL=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function I_(e){var t,a;return isNaN(e)&&typeof e=="string"&&(((t=e.match(ii))===null||t===void 0?void 0:t.length)||0)+(((a=e.match(GL))===null||a===void 0?void 0:a.length)||0)>0}var XL="number",QL="color",b_="var",k_="var(",KL="${}",P_=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function yn(e){let t=e.toString(),a=[],r={color:[],number:[],var:[]},o=[],n=0,i=t.replace(P_,l=>(He.test(l)?(r.color.push(n),o.push(QL),a.push(He.parse(l))):l.startsWith(k_)?(r.var.push(n),o.push(b_),a.push(l)):(r.number.push(n),o.push(XL),a.push(parseFloat(l))),++n,KL)).split(KL);return{values:a,split:i,indexes:r,types:o}}function JL(e){return yn(e).values}function YL(e){let{split:t,types:a}=yn(e),r=t.length;return o=>{let n="";for(let s=0;s<r;s++)if(n+=t[s],o[s]!==void 0){let i=a[s];i===XL?n+=ho(o[s]):i===QL?n+=He.transform(o[s]):n+=o[s]}return n}}var T_=e=>typeof e=="number"?0:e;function A_(e){let t=JL(e);return YL(e)(t.map(T_))}var Tt={test:I_,parse:JL,createTransformer:YL,getAnimatableNone:A_};var R_=new Set(["brightness","contrast","saturate","opacity"]);function __(e){let[t,a]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;let[r]=a.match(ii)||[];if(!r)return e;let o=a.replace(r,""),n=R_.has(t)?1:0;return r!==a&&(n*=100),t+"("+n+o+")"}var E_=/\b([a-z-]*)\(.*?\)/gu,yu={...Tt,getAnimatableNone:e=>{let t=e.match(E_);return t?t.map(__).join(" "):e}};var D_={...Ws,color:He,backgroundColor:He,outlineColor:He,fill:He,stroke:He,borderColor:He,borderTopColor:He,borderRightColor:He,borderBottomColor:He,borderLeftColor:He,filter:yu,WebkitFilter:yu},ui=e=>D_[e];function Tf(e,t){let a=ui(e);return a!==yu&&(a=Tt),a.getAnimatableNone?a.getAnimatableNone(t):void 0}var M_=new Set(["auto","none","0"]);function ZL(e,t,a){let r=0,o;for(;r<e.length&&!o;){let n=e[r];typeof n=="string"&&!M_.has(n)&&yn(n).values.length&&(o=e[r]),r++}if(o&&a)for(let n of t)e[n]=Tf(a,o)}var Hg=e=>e===qa||e===H,eI=(e,t)=>parseFloat(e.split(", ")[t]),tI=(e,t)=>(a,{transform:r})=>{if(r==="none"||!r)return 0;let o=r.match(/^matrix3d\((.+)\)$/u);if(o)return eI(o[1],t);{let n=r.match(/^matrix\((.+)\)$/u);return n?eI(n[1],e):0}},N_=new Set(["x","y","z"]),O_=ja.filter(e=>!N_.has(e));function aI(e){let t=[];return O_.forEach(a=>{let r=e.getValue(a);r!==void 0&&(t.push([a,r.get()]),r.set(a.startsWith("scale")?1:0))}),t}var xn={width:({x:e},{paddingLeft:t="0",paddingRight:a="0"})=>e.max-e.min-parseFloat(t)-parseFloat(a),height:({y:e},{paddingTop:t="0",paddingBottom:a="0"})=>e.max-e.min-parseFloat(t)-parseFloat(a),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:tI(4,13),y:tI(5,14)};xn.translateX=xn.x;xn.translateY=xn.y;var vn=new Set,zg=!1,$g=!1;function rI(){if($g){let e=Array.from(vn).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),a=new Map;t.forEach(r=>{let o=aI(r);o.length&&(a.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();let o=a.get(r);o&&o.forEach(([n,s])=>{var i;(i=r.getValue(n))===null||i===void 0||i.set(s)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}$g=!1,zg=!1,vn.forEach(e=>e.complete()),vn.clear()}function oI(){vn.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&($g=!0)})}function nI(){oI(),rI()}var yo=class{constructor(t,a,r,o,n,s=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=a,this.name=r,this.motionValue=o,this.element=n,this.isAsync=s}scheduleResolve(){this.isScheduled=!0,this.isAsync?(vn.add(this),zg||(zg=!0,ee.read(oI),ee.resolveKeyframes(rI))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:t,name:a,element:r,motionValue:o}=this;for(let n=0;n<t.length;n++)if(t[n]===null)if(n===0){let s=o?.get(),i=t[t.length-1];if(s!==void 0)t[0]=s;else if(r&&a){let l=r.readValue(a,i);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=i),o&&s===void 0&&o.set(t[0])}else t[n]=t[n-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),vn.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,vn.delete(this))}resume(){this.isComplete||this.scheduleResolve()}};var Af=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);var F_=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function B_(e){let t=F_.exec(e);if(!t)return[,];let[,a,r,o]=t;return[`--${a??r}`,o]}var U_=4;function Wg(e,t,a=1){Ta(a<=U_,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);let[r,o]=B_(e);if(!r)return;let n=window.getComputedStyle(t).getPropertyValue(r);if(n){let s=n.trim();return Af(s)?parseFloat(s):s}return $s(o)?Wg(o,t,a+1):o}var Rf=e=>t=>t.test(e);var sI={test:e=>e==="auto",parse:e=>e};var Gg=[qa,H,Pt,Ha,hL,mL,sI],Kg=e=>Gg.find(Rf(e));var di=class extends yo{constructor(t,a,r,o,n){super(t,a,r,o,n,!0)}readKeyframes(){let{unresolvedKeyframes:t,element:a,name:r}=this;if(!a||!a.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let u=t[l];if(typeof u=="string"&&(u=u.trim(),$s(u))){let d=Wg(u,a.current);d!==void 0&&(t[l]=d),l===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!mf.has(r)||t.length!==2)return;let[o,n]=t,s=Kg(o),i=Kg(n);if(s!==i)if(Hg(s)&&Hg(i))for(let l=0;l<t.length;l++){let u=t[l];typeof u=="string"&&(t[l]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){let{unresolvedKeyframes:t,name:a}=this,r=[];for(let o=0;o<t.length;o++)zL(t[o])&&r.push(o);r.length&&ZL(t,r,a)}measureInitialState(){let{element:t,unresolvedKeyframes:a,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=xn[r](t.measureViewportBox(),window.getComputedStyle(t.current)),a[0]=this.measuredOrigin;let o=a[a.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){var t;let{element:a,name:r,unresolvedKeyframes:o}=this;if(!a||!a.current)return;let n=a.getValue(r);n&&n.jump(this.measuredOrigin,!1);let s=o.length-1,i=o[s];o[s]=xn[r](a.measureViewportBox(),window.getComputedStyle(a.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([l,u])=>{a.getValue(l).set(u)}),this.resolveNoneKeyframes()}};var Xg=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Tt.test(e)||e==="0")&&!e.startsWith("url("));function V_(e){let t=e[0];if(e.length===1)return!0;for(let a=0;a<e.length;a++)if(e[a]!==t)return!0}function iI(e,t,a,r){let o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;let n=e[e.length-1],s=Xg(o,t),i=Xg(n,t);return hr(s===i,`You are trying to animate ${t} from "${o}" to "${n}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${n} via the \`style\` property.`),!s||!i?!1:V_(e)||(a==="spring"||co(a))&&r}var j_=e=>e!==null;function xo(e,{repeat:t,repeatType:a="loop"},r){let o=e.filter(j_),n=t&&a!=="loop"&&t%2===1?0:o.length-1;return!n||r===void 0?o[n]:r}var q_=40,ci=class{constructor({autoplay:t=!0,delay:a=0,type:r="keyframes",repeat:o=0,repeatDelay:n=0,repeatType:s="loop",...i}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=wt.now(),this.options={autoplay:t,delay:a,type:r,repeat:o,repeatDelay:n,repeatType:s,...i},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>q_?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&nI(),this._resolved}onKeyframesResolved(t,a){this.resolvedAt=wt.now(),this.hasAttemptedResolve=!0;let{name:r,type:o,velocity:n,delay:s,onComplete:i,onUpdate:l,isGenerator:u}=this.options;if(!u&&!iI(t,r,o,n))if(xf.current||!s){l&&l(xo(t,this.options,a)),i&&i(),this.resolveFinishedPromise();return}else this.options.duration=0;let d=this.initPlayback(t,a);d!==!1&&(this._resolved={keyframes:t,finalKeyframe:a,...d},this.onPostResolved())}onPostResolved(){}then(t,a){return this.currentFinishedPromise.then(t,a)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}};var ie=(e,t,a)=>e+(t-e)*a;function Qg(e,t,a){return a<0&&(a+=1),a>1&&(a-=1),a<1/6?e+(t-e)*6*a:a<1/2?t:a<2/3?e+(t-e)*(2/3-a)*6:e}function lI({hue:e,saturation:t,lightness:a,alpha:r}){e/=360,t/=100,a/=100;let o=0,n=0,s=0;if(!t)o=n=s=a;else{let i=a<.5?a*(1+t):a+t-a*t,l=2*a-i;o=Qg(l,i,e+1/3),n=Qg(l,i,e),s=Qg(l,i,e-1/3)}return{red:Math.round(o*255),green:Math.round(n*255),blue:Math.round(s*255),alpha:r}}function fi(e,t){return a=>a>0?t:e}var Jg=(e,t,a)=>{let r=e*e,o=a*(t*t-r)+r;return o<0?0:Math.sqrt(o)},H_=[gu,za,go],z_=e=>H_.find(t=>t.test(e));function uI(e){let t=z_(e);if(hr(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let a=t.parse(e);return t===go&&(a=lI(a)),a}var Yg=(e,t)=>{let a=uI(e),r=uI(t);if(!a||!r)return fi(e,t);let o={...a};return n=>(o.red=Jg(a.red,r.red,n),o.green=Jg(a.green,r.green,n),o.blue=Jg(a.blue,r.blue,n),o.alpha=ie(a.alpha,r.alpha,n),za.transform(o))};var $_=(e,t)=>a=>t(e(a)),$a=(...e)=>e.reduce($_);var _f=new Set(["none","hidden"]);function dI(e,t){return _f.has(e)?a=>a<=0?e:t:a=>a>=1?t:e}function W_(e,t){return a=>ie(e,t,a)}function Ef(e){return typeof e=="number"?W_:typeof e=="string"?$s(e)?fi:He.test(e)?Yg:X_:Array.isArray(e)?cI:typeof e=="object"?He.test(e)?Yg:G_:fi}function cI(e,t){let a=[...e],r=a.length,o=e.map((n,s)=>Ef(n)(n,t[s]));return n=>{for(let s=0;s<r;s++)a[s]=o[s](n);return a}}function G_(e,t){let a={...e,...t},r={};for(let o in a)e[o]!==void 0&&t[o]!==void 0&&(r[o]=Ef(e[o])(e[o],t[o]));return o=>{for(let n in r)a[n]=r[n](o);return a}}function K_(e,t){var a;let r=[],o={color:0,var:0,number:0};for(let n=0;n<t.values.length;n++){let s=t.types[n],i=e.indexes[s][o[s]],l=(a=e.values[i])!==null&&a!==void 0?a:0;r[n]=l,o[s]++}return r}var X_=(e,t)=>{let a=Tt.createTransformer(t),r=yn(e),o=yn(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?_f.has(e)&&!o.values.length||_f.has(t)&&!r.values.length?dI(e,t):$a(cI(K_(r,o),o.values),a):(hr(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),fi(e,t))};function Df(e,t,a){return typeof e=="number"&&typeof t=="number"&&typeof a=="number"?ie(e,t,a):Ef(e)(e,t)}var Q_=5;function Mf(e,t,a){let r=Math.max(t-Q_,0);return gf(a-e(r),t-r)}var Pe={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};var Zg=.001;function fI({duration:e=Pe.duration,bounce:t=Pe.bounce,velocity:a=Pe.velocity,mass:r=Pe.mass}){let o,n;hr(e<=Be(Pe.maxDuration),"Spring duration must be 10 seconds or less");let s=1-t;s=ct(Pe.minDamping,Pe.maxDamping,s),e=ct(Pe.minDuration,Pe.maxDuration,dt(e)),s<1?(o=u=>{let d=u*s,c=d*e,f=d-a,g=Nf(u,s),x=Math.exp(-c);return Zg-f/g*x},n=u=>{let c=u*s*e,f=c*a+a,g=Math.pow(s,2)*Math.pow(u,2)*e,x=Math.exp(-c),w=Nf(Math.pow(u,2),s);return(-o(u)+Zg>0?-1:1)*((f-g)*x)/w}):(o=u=>{let d=Math.exp(-u*e),c=(u-a)*e+1;return-Zg+d*c},n=u=>{let d=Math.exp(-u*e),c=(a-u)*(e*e);return d*c});let i=5/e,l=Y_(o,n,i);if(e=Be(e),isNaN(l))return{stiffness:Pe.stiffness,damping:Pe.damping,duration:e};{let u=Math.pow(l,2)*r;return{stiffness:u,damping:s*2*Math.sqrt(r*u),duration:e}}}var J_=12;function Y_(e,t,a){let r=a;for(let o=1;o<J_;o++)r=r-e(r)/t(r);return r}function Nf(e,t){return e*Math.sqrt(1-t*t)}var Z_=["duration","bounce"],eE=["stiffness","damping","mass"];function pI(e,t){return t.some(a=>e[a]!==void 0)}function tE(e){let t={velocity:Pe.velocity,stiffness:Pe.stiffness,damping:Pe.damping,mass:Pe.mass,isResolvedFromDuration:!1,...e};if(!pI(e,eE)&&pI(e,Z_))if(e.visualDuration){let a=e.visualDuration,r=2*Math.PI/(a*1.2),o=r*r,n=2*ct(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:Pe.mass,stiffness:o,damping:n}}else{let a=fI(e);t={...t,...a,mass:Pe.mass},t.isResolvedFromDuration=!0}return t}function Of(e=Pe.visualDuration,t=Pe.bounce){let a=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e,{restSpeed:r,restDelta:o}=a,n=a.keyframes[0],s=a.keyframes[a.keyframes.length-1],i={done:!1,value:n},{stiffness:l,damping:u,mass:d,duration:c,velocity:f,isResolvedFromDuration:g}=tE({...a,velocity:-dt(a.velocity||0)}),x=f||0,w=u/(2*Math.sqrt(l*d)),L=s-n,y=dt(Math.sqrt(l/d)),h=Math.abs(L)<5;r||(r=h?Pe.restSpeed.granular:Pe.restSpeed.default),o||(o=h?Pe.restDelta.granular:Pe.restDelta.default);let m;if(w<1){let I=Nf(y,w);m=P=>{let R=Math.exp(-w*y*P);return s-R*((x+w*y*L)/I*Math.sin(I*P)+L*Math.cos(I*P))}}else if(w===1)m=I=>s-Math.exp(-y*I)*(L+(x+y*L)*I);else{let I=y*Math.sqrt(w*w-1);m=P=>{let R=Math.exp(-w*y*P),A=Math.min(I*P,300);return s-R*((x+w*y*L)*Math.sinh(A)+I*L*Math.cosh(A))/I}}let C={calculatedDuration:g&&c||null,next:I=>{let P=m(I);if(g)i.done=I>=c;else{let R=0;w<1&&(R=I===0?Be(x):Mf(m,I,P));let A=Math.abs(R)<=r,q=Math.abs(s-P)<=o;i.done=A&&q}return i.value=i.done?s:P,i},toString:()=>{let I=Math.min(ei(C),2e4),P=pu(R=>C.next(I*R).value,I,30);return I+"ms "+P}};return C}function ey({keyframes:e,velocity:t=0,power:a=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:n=500,modifyTarget:s,min:i,max:l,restDelta:u=.5,restSpeed:d}){let c=e[0],f={done:!1,value:c},g=A=>i!==void 0&&A<i||l!==void 0&&A>l,x=A=>i===void 0?l:l===void 0||Math.abs(i-A)<Math.abs(l-A)?i:l,w=a*t,L=c+w,y=s===void 0?L:s(L);y!==L&&(w=y-c);let h=A=>-w*Math.exp(-A/r),m=A=>y+h(A),C=A=>{let q=h(A),B=m(A);f.done=Math.abs(q)<=u,f.value=f.done?y:B},I,P,R=A=>{g(f.value)&&(I=A,P=Of({keyframes:[f.value,x(f.value)],velocity:Mf(m,A,f.value),damping:o,stiffness:n,restDelta:u,restSpeed:d}))};return R(0),{calculatedDuration:null,next:A=>{let q=!1;return!P&&I===void 0&&(q=!0,C(A),R(A)),I!==void 0&&A>=I?P.next(A-I):(!q&&C(A),f)}}}var mI=mo(.42,0,1,1),hI=mo(0,0,.58,1),Ff=mo(.42,0,.58,1);var gI=e=>Array.isArray(e)&&typeof e[0]!="number";var yI={linear:ge,easeIn:mI,easeInOut:Ff,easeOut:hI,circIn:Lf,circInOut:bf,circOut:If,backIn:hu,backInOut:Sf,backOut:jg,anticipate:Cf},ty=e=>{if(ti(e)){Ta(e.length===4,"Cubic bezier arrays must contain four numerical values.");let[t,a,r,o]=e;return mo(t,a,r,o)}else if(typeof e=="string")return Ta(yI[e]!==void 0,`Invalid easing type '${e}'`),yI[e];return e};function aE(e,t,a){let r=[],o=a||Df,n=e.length-1;for(let s=0;s<n;s++){let i=o(e[s],e[s+1]);if(t){let l=Array.isArray(t)?t[s]||ge:t;i=$a(l,i)}r.push(i)}return r}function xI(e,t,{clamp:a=!0,ease:r,mixer:o}={}){let n=e.length;if(Ta(n===t.length,"Both input and output ranges must be the same length"),n===1)return()=>t[0];if(n===2&&t[0]===t[1])return()=>t[1];let s=e[0]===e[1];e[0]>e[n-1]&&(e=[...e].reverse(),t=[...t].reverse());let i=aE(t,r,o),l=i.length,u=d=>{if(s&&d<e[0])return t[0];let c=0;if(l>1)for(;c<e.length-2&&!(d<e[c+1]);c++);let f=Yt(e[c],e[c+1],d);return i[c](f)};return a?d=>u(ct(e[0],e[n-1],d)):u}function vI(e,t){let a=e[e.length-1];for(let r=1;r<=t;r++){let o=Yt(0,t,r);e.push(ie(a,1,o))}}function wI(e){let t=[0];return vI(t,e.length-1),t}function SI(e,t){return e.map(a=>a*t)}function rE(e,t){return e.map(()=>t||Ff).splice(0,e.length-1)}function xu({duration:e=300,keyframes:t,times:a,ease:r="easeInOut"}){let o=gI(r)?r.map(ty):ty(r),n={done:!1,value:t[0]},s=SI(a&&a.length===t.length?a:wI(t),e),i=xI(s,t,{ease:Array.isArray(o)?o:rE(t,o)});return{calculatedDuration:e,next:l=>(n.value=i(l),n.done=l>=e,n)}}var CI=e=>{let t=({timestamp:a})=>e(a);return{start:()=>ee.update(t,!0),stop:()=>Zt(t),now:()=>Ue.isProcessing?Ue.timestamp:wt.now()}};var oE={decay:ey,inertia:ey,tween:xu,keyframes:xu,spring:Of},nE=e=>e/100,wn=class extends ci{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();let{onStop:l}=this.options;l&&l()};let{name:a,motionValue:r,element:o,keyframes:n}=this.options,s=o?.KeyframeResolver||yo,i=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new s(n,i,a,r,o),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){let{type:a="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:n,velocity:s=0}=this.options,i=co(a)?a:oE[a]||xu,l,u;i!==xu&&typeof t[0]!="number"&&(l=$a(nE,Df(t[0],t[1])),t=[0,100]);let d=i({...this.options,keyframes:t});n==="mirror"&&(u=i({...this.options,keyframes:[...t].reverse(),velocity:-s})),d.calculatedDuration===null&&(d.calculatedDuration=ei(d));let{calculatedDuration:c}=d,f=c+o,g=f*(r+1)-o;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:c,resolvedDuration:f,totalDuration:g}}onPostResolved(){let{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,a=!1){let{resolved:r}=this;if(!r){let{keyframes:A}=this.options;return{done:!0,value:A[A.length-1]}}let{finalKeyframe:o,generator:n,mirroredGenerator:s,mapPercentToKeyframes:i,keyframes:l,calculatedDuration:u,totalDuration:d,resolvedDuration:c}=r;if(this.startTime===null)return n.next(0);let{delay:f,repeat:g,repeatType:x,repeatDelay:w,onUpdate:L}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),a?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;let y=this.currentTime-f*(this.speed>=0?1:-1),h=this.speed>=0?y<0:y>d;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let m=this.currentTime,C=n;if(g){let A=Math.min(this.currentTime,d)/c,q=Math.floor(A),B=A%1;!B&&A>=1&&(B=1),B===1&&q--,q=Math.min(q,g+1),q%2&&(x==="reverse"?(B=1-B,w&&(B-=w/c)):x==="mirror"&&(C=s)),m=ct(0,1,B)*c}let I=h?{done:!1,value:l[0]}:C.next(m);i&&(I.value=i(I.value));let{done:P}=I;!h&&u!==null&&(P=this.speed>=0?this.currentTime>=d:this.currentTime<=0);let R=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&P);return R&&o!==void 0&&(I.value=xo(l,this.options,o)),L&&L(I.value),R&&this.finish(),I}get duration(){let{resolved:t}=this;return t?dt(t.calculatedDuration):0}get time(){return dt(this.currentTime)}set time(t){t=Be(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){let a=this.playbackSpeed!==t;this.playbackSpeed=t,a&&(this.time=dt(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;let{driver:t=CI,onPlay:a,startTime:r}=this.options;this.driver||(this.driver=t(n=>this.tick(n))),a&&a();let o=this.driver.now();this.holdTime!==null?this.startTime=o-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=o):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";let{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}};var LI=new Set(["opacity","clipPath","filter","transform"]);function II(e,t,a,{delay:r=0,duration:o=300,repeat:n=0,repeatType:s="loop",ease:i="easeInOut",times:l}={}){let u={[t]:a};l&&(u.offset=l);let d=ri(i,o);return Array.isArray(d)&&(u.easing=d),e.animate(u,{delay:r,duration:o,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:n+1,direction:s==="reverse"?"alternate":"normal"})}var bI=pn(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));var Bf=10,sE=2e4;function iE(e){return co(e.type)||e.type==="spring"||!cf(e.ease)}function lE(e,t){let a=new wn({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0}),r={done:!1,value:e[0]},o=[],n=0;for(;!r.done&&n<sE;)r=a.sample(n),o.push(r.value),n+=Bf;return{times:void 0,keyframes:o,duration:n-Bf,ease:"linear"}}var kI={anticipate:Cf,backInOut:Sf,circInOut:bf};function uE(e){return e in kI}var vu=class extends ci{constructor(t){super(t);let{name:a,motionValue:r,element:o,keyframes:n}=this.options;this.resolver=new di(n,(s,i)=>this.onKeyframesResolved(s,i),a,r,o),this.resolver.scheduleResolve()}initPlayback(t,a){let{duration:r=300,times:o,ease:n,type:s,motionValue:i,name:l,startTime:u}=this.options;if(!i.owner||!i.owner.current)return!1;if(typeof n=="string"&&fo()&&uE(n)&&(n=kI[n]),iE(this.options)){let{onComplete:c,onUpdate:f,motionValue:g,element:x,...w}=this.options,L=lE(t,w);t=L.keyframes,t.length===1&&(t[1]=t[0]),r=L.duration,o=L.times,n=L.ease,s="keyframes"}let d=II(i.owner.current,l,t,{...this.options,duration:r,times:o,ease:n});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(fu(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{let{onComplete:c}=this.options;i.set(xo(t,this.options,a)),c&&c(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:r,times:o,type:s,ease:n,keyframes:t}}get duration(){let{resolved:t}=this;if(!t)return 0;let{duration:a}=t;return dt(a)}get time(){let{resolved:t}=this;if(!t)return 0;let{animation:a}=t;return dt(a.currentTime||0)}set time(t){let{resolved:a}=this;if(!a)return;let{animation:r}=a;r.currentTime=Be(t)}get speed(){let{resolved:t}=this;if(!t)return 1;let{animation:a}=t;return a.playbackRate}set speed(t){let{resolved:a}=this;if(!a)return;let{animation:r}=a;r.playbackRate=t}get state(){let{resolved:t}=this;if(!t)return"idle";let{animation:a}=t;return a.playState}get startTime(){let{resolved:t}=this;if(!t)return null;let{animation:a}=t;return a.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{let{resolved:a}=this;if(!a)return ge;let{animation:r}=a;fu(r,t)}return ge}play(){if(this.isStopped)return;let{resolved:t}=this;if(!t)return;let{animation:a}=t;a.playState==="finished"&&this.updateFinishedPromise(),a.play()}pause(){let{resolved:t}=this;if(!t)return;let{animation:a}=t;a.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();let{resolved:t}=this;if(!t)return;let{animation:a,keyframes:r,duration:o,type:n,ease:s,times:i}=t;if(a.playState==="idle"||a.playState==="finished")return;if(this.time){let{motionValue:u,onUpdate:d,onComplete:c,element:f,...g}=this.options,x=new wn({...g,keyframes:r,duration:o,type:n,ease:s,times:i,isGenerator:!0}),w=Be(this.time);u.setWithVelocity(x.sample(w-Bf).value,x.sample(w).value,Bf)}let{onStop:l}=this.options;l&&l(),this.cancel()}complete(){let{resolved:t}=this;t&&t.animation.finish()}cancel(){let{resolved:t}=this;t&&t.animation.cancel()}static supports(t){let{motionValue:a,name:r,repeatDelay:o,repeatType:n,damping:s,type:i}=t;if(!a||!a.owner||!(a.owner.current instanceof HTMLElement))return!1;let{onUpdate:l,transformTemplate:u}=a.owner.getProps();return bI()&&r&&LI.has(r)&&!l&&!u&&!o&&n!=="mirror"&&s!==0&&i!=="inertia"}};var dE={type:"spring",stiffness:500,damping:25,restSpeed:10},cE=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),fE={type:"keyframes",duration:.8},pE={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},PI=(e,{keyframes:t})=>t.length>2?fE:Vt.has(e)?e.startsWith("scale")?cE(t[1]):dE:pE;function TI({when:e,delay:t,delayChildren:a,staggerChildren:r,staggerDirection:o,repeat:n,repeatType:s,repeatDelay:i,from:l,elapsed:u,...d}){return!!Object.keys(d).length}var pi=(e,t,a,r={},o,n)=>s=>{let i=uo(r,e)||{},l=i.delay||r.delay||0,{elapsed:u=0}=r;u=u-Be(l);let d={keyframes:Array.isArray(a)?a:[null,a],ease:"easeOut",velocity:t.getVelocity(),...i,delay:-u,onUpdate:f=>{t.set(f),i.onUpdate&&i.onUpdate(f)},onComplete:()=>{s(),i.onComplete&&i.onComplete()},name:e,motionValue:t,element:n?void 0:o};TI(i)||(d={...d,...PI(e,d)}),d.duration&&(d.duration=Be(d.duration)),d.repeatDelay&&(d.repeatDelay=Be(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let c=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(c=!0)),(xf.current||Bs.skipAnimations)&&(c=!0,d.duration=0,d.delay=0),c&&!n&&t.get()!==void 0){let f=xo(d.keyframes,i);if(f!==void 0)return ee.update(()=>{d.onUpdate(f),d.onComplete()}),new cu([])}return!n&&vu.supports(d)?new vu(d):new wn(d)};function mE({protectedKeys:e,needsAnimating:t},a){let r=e.hasOwnProperty(a)&&t[a]!==!0;return t[a]=!1,r}function Uf(e,t,{delay:a=0,transitionOverride:r,type:o}={}){var n;let{transition:s=e.getDefaultTransition(),transitionEnd:i,...l}=t;r&&(s=r);let u=[],d=o&&e.animationState&&e.animationState.getState()[o];for(let c in l){let f=e.getValue(c,(n=e.latestValues[c])!==null&&n!==void 0?n:null),g=l[c];if(g===void 0||d&&mE(d,c))continue;let x={delay:a,...uo(s||{},c)},w=!1;if(window.MotionHandoffAnimation){let y=yf(e);if(y){let h=window.MotionHandoffAnimation(y,c,ee);h!==null&&(x.startTime=h,w=!0)}}mu(e,c),f.start(pi(c,f,g,e.shouldReduceMotion&&mf.has(c)?{type:!1}:x,e,w));let L=f.animation;L&&u.push(L)}return i&&Promise.all(u).then(()=>{ee.update(()=>{i&&jL(e,i)})}),u}function Vf(e,t,a={}){var r;let o=lo(e,t,a.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0),{transition:n=e.getDefaultTransition()||{}}=o||{};a.transitionOverride&&(n=a.transitionOverride);let s=o?()=>Promise.all(Uf(e,o,a)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(u=0)=>{let{delayChildren:d=0,staggerChildren:c,staggerDirection:f}=n;return hE(e,t,d+u,c,f,a)}:()=>Promise.resolve(),{when:l}=n;if(l){let[u,d]=l==="beforeChildren"?[s,i]:[i,s];return u().then(()=>d())}else return Promise.all([s(),i(a.delay)])}function hE(e,t,a=0,r=0,o=1,n){let s=[],i=(e.variantChildren.size-1)*r,l=o===1?(u=0)=>u*r:(u=0)=>i-u*r;return Array.from(e.variantChildren).sort(gE).forEach((u,d)=>{u.notify("AnimationStart",t),s.push(Vf(u,t,{...n,delay:a+l(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(s)}function gE(e,t){return e.sortNodePosition(t)}function AI(e,t,a={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){let o=t.map(n=>Vf(e,n,a));r=Promise.all(o)}else if(typeof t=="string")r=Vf(e,t,a);else{let o=typeof t=="function"?lo(e,t,a.custom):t;r=Promise.all(Uf(e,o,a))}return r.then(()=>{e.notify("AnimationComplete",t)})}var yE=su.length;function ay(e){if(!e)return;if(!e.isControllingVariants){let a=e.parent?ay(e.parent)||{}:{};return e.props.initial!==void 0&&(a.initial=e.props.initial),a}let t={};for(let a=0;a<yE;a++){let r=su[a],o=e.props[r];(yr(o)||o===!1)&&(t[r]=o)}return t}var xE=[...Kc].reverse(),vE=Kc.length;function wE(e){return t=>Promise.all(t.map(({animation:a,options:r})=>AI(e,a,r)))}function _I(e){let t=wE(e),a=RI(),r=!0,o=l=>(u,d)=>{var c;let f=lo(e,d,l==="exit"?(c=e.presenceContext)===null||c===void 0?void 0:c.custom:void 0);if(f){let{transition:g,transitionEnd:x,...w}=f;u={...u,...w,...x}}return u};function n(l){t=l(e)}function s(l){let{props:u}=e,d=ay(e.parent)||{},c=[],f=new Set,g={},x=1/0;for(let L=0;L<vE;L++){let y=xE[L],h=a[y],m=u[y]!==void 0?u[y]:d[y],C=yr(m),I=y===l?h.isActive:null;I===!1&&(x=L);let P=m===d[y]&&m!==u[y]&&C;if(P&&r&&e.manuallyAnimateOnMount&&(P=!1),h.protectedKeys={...g},!h.isActive&&I===null||!m&&!h.prevProp||io(m)||typeof m=="boolean")continue;let R=SE(h.prevProp,m),A=R||y===l&&h.isActive&&!P&&C||L>x&&C,q=!1,B=Array.isArray(m)?m:[m],J=B.reduce(o(y),{});I===!1&&(J={});let{prevResolvedValues:ue={}}=h,pt={...ue,...J},Xa=xe=>{A=!0,f.has(xe)&&(q=!0,f.delete(xe)),h.needsAnimating[xe]=!0;let ze=e.getValue(xe);ze&&(ze.liveStyle=!1)};for(let xe in pt){let ze=J[xe],Ht=ue[xe];if(g.hasOwnProperty(xe))continue;let ma=!1;iu(ze)&&iu(Ht)?ma=!_g(ze,Ht):ma=ze!==Ht,ma?ze!=null?Xa(xe):f.add(xe):ze!==void 0&&f.has(xe)?Xa(xe):h.protectedKeys[xe]=!0}h.prevProp=m,h.prevResolvedValues=J,h.isActive&&(g={...g,...J}),r&&e.blockInitialAnimation&&(A=!1),A&&(!(P&&R)||q)&&c.push(...B.map(xe=>({animation:xe,options:{type:y}})))}if(f.size){let L={};f.forEach(y=>{let h=e.getBaseTarget(y),m=e.getValue(y);m&&(m.liveStyle=!0),L[y]=h??null}),c.push({animation:L})}let w=!!c.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(w=!1),r=!1,w?t(c):Promise.resolve()}function i(l,u){var d;if(a[l].isActive===u)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(f=>{var g;return(g=f.animationState)===null||g===void 0?void 0:g.setActive(l,u)}),a[l].isActive=u;let c=s(l);for(let f in a)a[f].protectedKeys={};return c}return{animateChanges:s,setActive:i,setAnimateFunction:n,getState:()=>a,reset:()=>{a=RI(),r=!0}}}function SE(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!_g(t,e):!1}function Sn(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function RI(){return{animate:Sn(!0),whileInView:Sn(),whileHover:Sn(),whileTap:Sn(),whileDrag:Sn(),whileFocus:Sn(),exit:Sn()}}var rt=class{constructor(t){this.isMounted=!1,this.node=t}update(){}};var jf=class extends rt{constructor(t){super(t),t.animationState||(t.animationState=_I(t))}updateAnimationControlsSubscription(){let{animate:t}=this.node.getProps();io(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:t}=this.node.getProps(),{animate:a}=this.node.prevProps||{};t!==a&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}};var CE=0,qf=class extends rt{constructor(){super(...arguments),this.id=CE++}update(){if(!this.node.presenceContext)return;let{isPresent:t,onExitComplete:a}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;let o=this.node.animationState.setActive("exit",!t);a&&!t&&o.then(()=>a(this.id))}mount(){let{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}};var EI={animation:{Feature:jf},exit:{Feature:qf}};function Sr(e,t,a,r={passive:!0}){return e.addEventListener(t,a,r),()=>e.removeEventListener(t,a)}function Cr(e){return{point:{x:e.pageX,y:e.pageY}}}var DI=e=>t=>hn(t)&&e(t,Cr(t));function vo(e,t,a,r){return Sr(e,t,DI(a),r)}var MI=(e,t)=>Math.abs(e-t);function NI(e,t){let a=MI(e.x,t.x),r=MI(e.y,t.y);return Math.sqrt(a**2+r**2)}var mi=class{constructor(t,a,{transformPagePoint:r,contextWindow:o,dragSnapToOrigin:n=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let c=oy(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,g=NI(c.offset,{x:0,y:0})>=3;if(!f&&!g)return;let{point:x}=c,{timestamp:w}=Ue;this.history.push({...x,timestamp:w});let{onStart:L,onMove:y}=this.handlers;f||(L&&L(this.lastMoveEvent,c),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,c)},this.handlePointerMove=(c,f)=>{this.lastMoveEvent=c,this.lastMoveEventInfo=ry(f,this.transformPagePoint),ee.update(this.updatePoint,!0)},this.handlePointerUp=(c,f)=>{this.end();let{onEnd:g,onSessionEnd:x,resumeAnimation:w}=this.handlers;if(this.dragSnapToOrigin&&w&&w(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let L=oy(c.type==="pointercancel"?this.lastMoveEventInfo:ry(f,this.transformPagePoint),this.history);this.startEvent&&g&&g(c,L),x&&x(c,L)},!hn(t))return;this.dragSnapToOrigin=n,this.handlers=a,this.transformPagePoint=r,this.contextWindow=o||window;let s=Cr(t),i=ry(s,this.transformPagePoint),{point:l}=i,{timestamp:u}=Ue;this.history=[{...l,timestamp:u}];let{onSessionStart:d}=a;d&&d(t,oy(i,this.history)),this.removeListeners=$a(vo(this.contextWindow,"pointermove",this.handlePointerMove),vo(this.contextWindow,"pointerup",this.handlePointerUp),vo(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Zt(this.updatePoint)}};function ry(e,t){return t?{point:t(e.point)}:e}function OI(e,t){return{x:e.x-t.x,y:e.y-t.y}}function oy({point:e},t){return{point:e,delta:OI(e,FI(t)),offset:OI(e,LE(t)),velocity:IE(t,.1)}}function LE(e){return e[0]}function FI(e){return e[e.length-1]}function IE(e,t){if(e.length<2)return{x:0,y:0};let a=e.length-1,r=null,o=FI(e);for(;a>=0&&(r=e[a],!(o.timestamp-r.timestamp>Be(t)));)a--;if(!r)return{x:0,y:0};let n=dt(o.timestamp-r.timestamp);if(n===0)return{x:0,y:0};let s={x:(o.x-r.x)/n,y:(o.y-r.y)/n};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}var jI=1e-4,bE=1-jI,kE=1+jI,qI=.01,PE=0-qI,TE=0+qI;function ft(e){return e.max-e.min}function HI(e,t,a){return Math.abs(e-t)<=a}function BI(e,t,a,r=.5){e.origin=r,e.originPoint=ie(t.min,t.max,e.origin),e.scale=ft(a)/ft(t),e.translate=ie(a.min,a.max,e.origin)-e.originPoint,(e.scale>=bE&&e.scale<=kE||isNaN(e.scale))&&(e.scale=1),(e.translate>=PE&&e.translate<=TE||isNaN(e.translate))&&(e.translate=0)}function hi(e,t,a,r){BI(e.x,t.x,a.x,r?r.originX:void 0),BI(e.y,t.y,a.y,r?r.originY:void 0)}function UI(e,t,a){e.min=a.min+t.min,e.max=e.min+ft(t)}function zI(e,t,a){UI(e.x,t.x,a.x),UI(e.y,t.y,a.y)}function VI(e,t,a){e.min=t.min-a.min,e.max=e.min+ft(t)}function gi(e,t,a){VI(e.x,t.x,a.x),VI(e.y,t.y,a.y)}function XI(e,{min:t,max:a},r){return t!==void 0&&e<t?e=r?ie(t,e,r.min):Math.max(e,t):a!==void 0&&e>a&&(e=r?ie(a,e,r.max):Math.min(e,a)),e}function $I(e,t,a){return{min:t!==void 0?e.min+t:void 0,max:a!==void 0?e.max+a-(e.max-e.min):void 0}}function QI(e,{top:t,left:a,bottom:r,right:o}){return{x:$I(e.x,a,o),y:$I(e.y,t,r)}}function WI(e,t){let a=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([a,r]=[r,a]),{min:a,max:r}}function JI(e,t){return{x:WI(e.x,t.x),y:WI(e.y,t.y)}}function YI(e,t){let a=.5,r=ft(e),o=ft(t);return o>r?a=Yt(t.min,t.max-r,e.min):r>o&&(a=Yt(e.min,e.max-o,t.min)),ct(0,1,a)}function ZI(e,t){let a={};return t.min!==void 0&&(a.min=t.min-e.min),t.max!==void 0&&(a.max=t.max-e.min),a}var Hf=.35;function eb(e=Hf){return e===!1?e=0:e===!0&&(e=Hf),{x:GI(e,"left","right"),y:GI(e,"top","bottom")}}function GI(e,t,a){return{min:KI(e,t),max:KI(e,a)}}function KI(e,t){return typeof e=="number"?e:e[t]||0}var tb=()=>({translate:0,scale:1,origin:0,originPoint:0}),Cn=()=>({x:tb(),y:tb()}),ab=()=>({min:0,max:0}),Te=()=>({x:ab(),y:ab()});function jt(e){return[e("x"),e("y")]}function zf({top:e,left:t,right:a,bottom:r}){return{x:{min:t,max:a},y:{min:e,max:r}}}function rb({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function ob(e,t){if(!t)return e;let a=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:a.y,left:a.x,bottom:r.y,right:r.x}}function ny(e){return e===void 0||e===1}function $f({scale:e,scaleX:t,scaleY:a}){return!ny(e)||!ny(t)||!ny(a)}function Lr(e){return $f(e)||sy(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function sy(e){return nb(e.x)||nb(e.y)}function nb(e){return e&&e!=="0%"}function wu(e,t,a){let r=e-a,o=t*r;return a+o}function sb(e,t,a,r,o){return o!==void 0&&(e=wu(e,o,r)),wu(e,a,r)+t}function iy(e,t=0,a=1,r,o){e.min=sb(e.min,t,a,r,o),e.max=sb(e.max,t,a,r,o)}function ly(e,{x:t,y:a}){iy(e.x,t.translate,t.scale,t.originPoint),iy(e.y,a.translate,a.scale,a.originPoint)}var ib=.999999999999,lb=1.0000000000001;function db(e,t,a,r=!1){let o=a.length;if(!o)return;t.x=t.y=1;let n,s;for(let i=0;i<o;i++){n=a[i],s=n.projectionDelta;let{visualElement:l}=n.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&n.options.layoutScroll&&n.scroll&&n!==n.root&&Ln(e,{x:-n.scroll.offset.x,y:-n.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,ly(e,s)),r&&Lr(n.latestValues)&&Ln(e,n.latestValues))}t.x<lb&&t.x>ib&&(t.x=1),t.y<lb&&t.y>ib&&(t.y=1)}function wo(e,t){e.min=e.min+t,e.max=e.max+t}function ub(e,t,a,r,o=.5){let n=ie(e.min,e.max,o);iy(e,t,a,n,r)}function Ln(e,t){ub(e.x,t.x,t.scaleX,t.scale,t.originX),ub(e.y,t.y,t.scaleY,t.scale,t.originY)}function uy(e,t){return zf(ob(e.getBoundingClientRect(),t))}function cb(e,t,a){let r=uy(e,a),{scroll:o}=t;return o&&(wo(r.x,o.offset.x),wo(r.y,o.offset.y)),r}var Wf=({current:e})=>e?e.ownerDocument.defaultView:null;var AE=new WeakMap,Kf=class{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Te(),this.visualElement=t}start(t,{snapToCursor:a=!1}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let o=d=>{let{dragSnapToOrigin:c}=this.getProps();c?this.pauseAnimation():this.stopAnimation(),a&&this.snapToCursor(Cr(d).point)},n=(d,c)=>{let{drag:f,dragPropagation:g,onDragStart:x}=this.getProps();if(f&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Ug(f),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),jt(L=>{let y=this.getAxisMotionValue(L).get()||0;if(Pt.test(y)){let{projection:h}=this.visualElement;if(h&&h.layout){let m=h.layout.layoutBox[L];m&&(y=ft(m)*(parseFloat(y)/100))}}this.originPoint[L]=y}),x&&ee.postRender(()=>x(d,c)),mu(this.visualElement,"transform");let{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},s=(d,c)=>{let{dragPropagation:f,dragDirectionLock:g,onDirectionLock:x,onDrag:w}=this.getProps();if(!f&&!this.openDragLock)return;let{offset:L}=c;if(g&&this.currentDirection===null){this.currentDirection=RE(L),this.currentDirection!==null&&x&&x(this.currentDirection);return}this.updateAxis("x",c.point,L),this.updateAxis("y",c.point,L),this.visualElement.render(),w&&w(d,c)},i=(d,c)=>this.stop(d,c),l=()=>jt(d=>{var c;return this.getAnimationState(d)==="paused"&&((c=this.getAxisMotionValue(d).animation)===null||c===void 0?void 0:c.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new mi(t,{onSessionStart:o,onStart:n,onMove:s,onSessionEnd:i,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:Wf(this.visualElement)})}stop(t,a){let r=this.isDragging;if(this.cancel(),!r)return;let{velocity:o}=a;this.startAnimation(o);let{onDragEnd:n}=this.getProps();n&&ee.postRender(()=>n(t,a))}cancel(){this.isDragging=!1;let{projection:t,animationState:a}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),a&&a.setActive("whileDrag",!1)}updateAxis(t,a,r){let{drag:o}=this.getProps();if(!r||!Gf(t,o,this.currentDirection))return;let n=this.getAxisMotionValue(t),s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=XI(s,this.constraints[t],this.elastic[t])),n.set(s)}resolveConstraints(){var t;let{dragConstraints:a,dragElastic:r}=this.getProps(),o=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,n=this.constraints;a&&xr(a)?this.constraints||(this.constraints=this.resolveRefConstraints()):a&&o?this.constraints=QI(o.layoutBox,a):this.constraints=!1,this.elastic=eb(r),n!==this.constraints&&o&&this.constraints&&!this.hasMutatedConstraints&&jt(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=ZI(o.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){let{dragConstraints:t,onMeasureDragConstraints:a}=this.getProps();if(!t||!xr(t))return!1;let r=t.current;Ta(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");let{projection:o}=this.visualElement;if(!o||!o.layout)return!1;let n=cb(r,o.root,this.visualElement.getTransformPagePoint()),s=JI(o.layout.layoutBox,n);if(a){let i=a(rb(s));this.hasMutatedConstraints=!!i,i&&(s=zf(i))}return s}startAnimation(t){let{drag:a,dragMomentum:r,dragElastic:o,dragTransition:n,dragSnapToOrigin:s,onDragTransitionEnd:i}=this.getProps(),l=this.constraints||{},u=jt(d=>{if(!Gf(d,a,this.currentDirection))return;let c=l&&l[d]||{};s&&(c={min:0,max:0});let f=o?200:1e6,g=o?40:1e7,x={type:"inertia",velocity:r?t[d]:0,bounceStiffness:f,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10,...n,...c};return this.startAxisValueAnimation(d,x)});return Promise.all(u).then(i)}startAxisValueAnimation(t,a){let r=this.getAxisMotionValue(t);return mu(this.visualElement,t),r.start(pi(t,r,0,a,this.visualElement,!1))}stopAnimation(){jt(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){jt(t=>{var a;return(a=this.getAxisMotionValue(t).animation)===null||a===void 0?void 0:a.pause()})}getAnimationState(t){var a;return(a=this.getAxisMotionValue(t).animation)===null||a===void 0?void 0:a.state}getAxisMotionValue(t){let a=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[a];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){jt(a=>{let{drag:r}=this.getProps();if(!Gf(a,r,this.currentDirection))return;let{projection:o}=this.visualElement,n=this.getAxisMotionValue(a);if(o&&o.layout){let{min:s,max:i}=o.layout.layoutBox[a];n.set(t[a]-ie(s,i,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:t,dragConstraints:a}=this.getProps(),{projection:r}=this.visualElement;if(!xr(a)||!r||!this.constraints)return;this.stopAnimation();let o={x:0,y:0};jt(s=>{let i=this.getAxisMotionValue(s);if(i&&this.constraints!==!1){let l=i.get();o[s]=YI({min:l,max:l},this.constraints[s])}});let{transformTemplate:n}=this.visualElement.getProps();this.visualElement.current.style.transform=n?n({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),jt(s=>{if(!Gf(s,t,null))return;let i=this.getAxisMotionValue(s),{min:l,max:u}=this.constraints[s];i.set(ie(l,u,o[s]))})}addListeners(){if(!this.visualElement.current)return;AE.set(this.visualElement,this);let t=this.visualElement.current,a=vo(t,"pointerdown",l=>{let{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(l)}),r=()=>{let{dragConstraints:l}=this.getProps();xr(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,n=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),ee.read(r);let s=Sr(window,"resize",()=>this.scalePositionWithinConstraints()),i=o.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(jt(d=>{let c=this.getAxisMotionValue(d);c&&(this.originPoint[d]+=l[d].translate,c.set(c.get()+l[d].translate))}),this.visualElement.render())}));return()=>{s(),a(),n(),i&&i()}}getProps(){let t=this.visualElement.getProps(),{drag:a=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:n=!1,dragElastic:s=Hf,dragMomentum:i=!0}=t;return{...t,drag:a,dragDirectionLock:r,dragPropagation:o,dragConstraints:n,dragElastic:s,dragMomentum:i}}};function Gf(e,t,a){return(t===!0||t===e)&&(a===null||a===e)}function RE(e,t=10){let a=null;return Math.abs(e.y)>t?a="y":Math.abs(e.x)>t&&(a="x"),a}var Xf=class extends rt{constructor(t){super(t),this.removeGroupControls=ge,this.removeListeners=ge,this.controls=new Kf(t)}mount(){let{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ge}unmount(){this.removeGroupControls(),this.removeListeners()}};var fb=e=>(t,a)=>{e&&ee.postRender(()=>e(t,a))},Qf=class extends rt{constructor(){super(...arguments),this.removePointerDownListener=ge}onPointerDown(t){this.session=new mi(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Wf(this.node)})}createPanHandlers(){let{onPanSessionStart:t,onPanStart:a,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:fb(t),onStart:fb(a),onMove:r,onEnd:(n,s)=>{delete this.session,o&&ee.postRender(()=>o(n,s))}}}mount(){this.removePointerDownListener=vo(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}};var hb=M(le(),1),Su=M(G(),1);var yi={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function pb(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var xi={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(H.test(e))e=parseFloat(e);else return e;let a=pb(e,t.target.x),r=pb(e,t.target.y);return`${a}% ${r}%`}};var mb={correct:(e,{treeScale:t,projectionDelta:a})=>{let r=e,o=Tt.parse(e);if(o.length>5)return r;let n=Tt.createTransformer(e),s=typeof o[0]!="number"?1:0,i=a.x.scale*t.x,l=a.y.scale*t.y;o[0+s]/=i,o[1+s]/=l;let u=ie(i,l,.5);return typeof o[2+s]=="number"&&(o[2+s]/=u),typeof o[3+s]=="number"&&(o[3+s]/=u),n(o)}};var dy=class extends Su.Component{componentDidMount(){let{visualElement:t,layoutGroup:a,switchLayoutGroup:r,layoutId:o}=this.props,{projection:n}=t;CL(_E),n&&(a.group&&a.group.add(n),r&&r.register&&o&&r.register(n),n.root.didUpdate(),n.addEventListener("animationComplete",()=>{this.safeToRemove()}),n.setOptions({...n.options,onExitComplete:()=>this.safeToRemove()})),yi.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){let{layoutDependency:a,visualElement:r,drag:o,isPresent:n}=this.props,s=r.projection;return s&&(s.isPresent=n,o||t.layoutDependency!==a||a===void 0?s.willUpdate():this.safeToRemove(),t.isPresent!==n&&(n?s.promote():s.relegate()||ee.postRender(()=>{let i=s.getStack();(!i||!i.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){let{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Vs.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:t,layoutGroup:a,switchLayoutGroup:r}=this.props,{projection:o}=t;o&&(o.scheduleCheckAfterUnmount(),a&&a.group&&a.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){let{safeToRemove:t}=this.props;t&&t()}render(){return null}};function Jf(e){let[t,a]=Vc(),r=(0,Su.useContext)(Ms);return(0,hb.jsx)(dy,{...e,layoutGroup:r,switchLayoutGroup:(0,Su.useContext)(Yc),isPresent:t,safeToRemove:a})}var _E={borderRadius:{...xi,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:xi,borderTopRightRadius:xi,borderBottomLeftRadius:xi,borderBottomRightRadius:xi,boxShadow:mb};function gb(e,t,a){let r=Ce(e)?e:wr(e);return r.start(pi("",r,t,a)),r.animation}function yb(e){return e instanceof SVGElement&&e.tagName!=="svg"}var xb=(e,t)=>e.depth-t.depth;var Yf=class{constructor(){this.children=[],this.isDirty=!1}add(t){ni(this.children,t),this.isDirty=!0}remove(t){si(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(xb),this.isDirty=!1,this.children.forEach(t)}};function vb(e,t){let a=wt.now(),r=({timestamp:o})=>{let n=o-a;n>=t&&(Zt(r),e(n-t))};return ee.read(r,!0),()=>Zt(r)}var Lb=["TopLeft","TopRight","BottomLeft","BottomRight"],EE=Lb.length,wb=e=>typeof e=="string"?parseFloat(e):e,Sb=e=>typeof e=="number"||H.test(e);function Ib(e,t,a,r,o,n){o?(e.opacity=ie(0,a.opacity!==void 0?a.opacity:1,DE(r)),e.opacityExit=ie(t.opacity!==void 0?t.opacity:1,0,ME(r))):n&&(e.opacity=ie(t.opacity!==void 0?t.opacity:1,a.opacity!==void 0?a.opacity:1,r));for(let s=0;s<EE;s++){let i=`border${Lb[s]}Radius`,l=Cb(t,i),u=Cb(a,i);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||Sb(l)===Sb(u)?(e[i]=Math.max(ie(wb(l),wb(u),r),0),(Pt.test(u)||Pt.test(l))&&(e[i]+="%")):e[i]=u}(t.rotate||a.rotate)&&(e.rotate=ie(t.rotate||0,a.rotate||0,r))}function Cb(e,t){return e[t]!==void 0?e[t]:e.borderRadius}var DE=bb(0,.5,If),ME=bb(.5,.95,ge);function bb(e,t,a){return r=>r<e?0:r>t?1:a(Yt(e,t,r))}function kb(e,t){e.min=t.min,e.max=t.max}function ta(e,t){kb(e.x,t.x),kb(e.y,t.y)}function cy(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Pb(e,t,a,r,o){return e-=t,e=wu(e,1/a,r),o!==void 0&&(e=wu(e,1/o,r)),e}function NE(e,t=0,a=1,r=.5,o,n=e,s=e){if(Pt.test(t)&&(t=parseFloat(t),t=ie(s.min,s.max,t/100)-s.min),typeof t!="number")return;let i=ie(n.min,n.max,r);e===n&&(i-=t),e.min=Pb(e.min,t,a,i,o),e.max=Pb(e.max,t,a,i,o)}function Tb(e,t,[a,r,o],n,s){NE(e,t[a],t[r],t[o],t.scale,n,s)}var OE=["x","scaleX","originX"],FE=["y","scaleY","originY"];function fy(e,t,a,r){Tb(e.x,t,OE,a?a.x:void 0,r?r.x:void 0),Tb(e.y,t,FE,a?a.y:void 0,r?r.y:void 0)}function Ab(e){return e.translate===0&&e.scale===1}function py(e){return Ab(e.x)&&Ab(e.y)}function Rb(e,t){return e.min===t.min&&e.max===t.max}function Eb(e,t){return Rb(e.x,t.x)&&Rb(e.y,t.y)}function _b(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function my(e,t){return _b(e.x,t.x)&&_b(e.y,t.y)}function hy(e){return ft(e.x)/ft(e.y)}function gy(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var Zf=class{constructor(){this.members=[]}add(t){ni(this.members,t),t.scheduleRender()}remove(t){if(si(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){let a=this.members[this.members.length-1];a&&this.promote(a)}}relegate(t){let a=this.members.findIndex(o=>t===o);if(a===0)return!1;let r;for(let o=a;o>=0;o--){let n=this.members[o];if(n.isPresent!==!1){r=n;break}}return r?(this.promote(r),!0):!1}promote(t,a){let r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,a&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);let{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{let{options:a,resumingFrom:r}=t;a.onExitComplete&&a.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}};function Db(e,t,a){let r="",o=e.x.translate/t.x,n=e.y.translate/t.y,s=a?.z||0;if((o||n||s)&&(r=`translate3d(${o}px, ${n}px, ${s}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),a){let{transformPerspective:u,rotate:d,rotateX:c,rotateY:f,skewX:g,skewY:x}=a;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),c&&(r+=`rotateX(${c}deg) `),f&&(r+=`rotateY(${f}deg) `),g&&(r+=`skewX(${g}deg) `),x&&(r+=`skewY(${x}deg) `)}let i=e.x.scale*t.x,l=e.y.scale*t.y;return(i!==1||l!==1)&&(r+=`scale(${i}, ${l})`),r||"none"}var In={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Cu=typeof window<"u"&&window.MotionDebug!==void 0,yy=["","X","Y","Z"],BE={visibility:"hidden"},Mb=1e3,UE=0;function xy(e,t,a,r){let{latestValues:o}=t;o[e]&&(a[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function qb(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let a=yf(t);if(window.MotionHasOptimisedAnimation(a,"transform")){let{layout:o,layoutId:n}=e.options;window.MotionCancelOptimisedAnimation(a,"transform",ee,!(o||n))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&qb(r)}function ep({attachResizeListener:e,defaultParent:t,measureScroll:a,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(s={},i=t?.()){this.id=UE++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Cu&&(In.totalNodes=In.resolvedTargetDeltas=In.recalculatedProjection=0),this.nodes.forEach(qE),this.nodes.forEach(GE),this.nodes.forEach(KE),this.nodes.forEach(HE),Cu&&window.MotionDebug.record(In)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Yf)}addEventListener(s,i){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new po),this.eventHandlers.get(s).add(i)}notifyListeners(s,...i){let l=this.eventHandlers.get(s);l&&l.notify(...i)}hasListeners(s){return this.eventHandlers.has(s)}mount(s,i=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=yb(s),this.instance=s;let{layoutId:l,layout:u,visualElement:d}=this.options;if(d&&!d.current&&d.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),i&&(u||l)&&(this.isLayoutDirty=!0),e){let c,f=()=>this.root.updateBlockedByResize=!1;e(s,()=>{this.root.updateBlockedByResize=!0,c&&c(),c=vb(f,250),yi.hasAnimatedSinceResize&&(yi.hasAnimatedSinceResize=!1,this.nodes.forEach(Ob))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||u)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:f,hasRelativeTargetChanged:g,layout:x})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let w=this.options.transition||d.getDefaultTransition()||ZE,{onLayoutAnimationStart:L,onLayoutAnimationComplete:y}=d.getProps(),h=!this.targetLayout||!my(this.targetLayout,x)||g,m=!f&&g;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||m||f&&(h||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(c,m);let C={...uo(w,"layout"),onPlay:L,onComplete:y};(d.shouldReduceMotion||this.options.layoutRoot)&&(C.delay=0,C.type=!1),this.startAnimation(C)}else f||Ob(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=x})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Zt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(XE),this.animationId++)}getTransformTemplate(){let{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&qb(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){let c=this.path[d];c.shouldResetTransform=!0,c.updateScroll("snapshot"),c.options.layoutRoot&&c.willUpdate(!1)}let{layoutId:i,layout:l}=this.options;if(i===void 0&&!l)return;let u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Nb);return}this.isUpdating||this.nodes.forEach($E),this.isUpdating=!1,this.nodes.forEach(WE),this.nodes.forEach(VE),this.nodes.forEach(jE),this.clearAllSnapshots();let i=wt.now();Ue.delta=ct(0,1e3/60,i-Ue.timestamp),Ue.timestamp=i,Ue.isProcessing=!0,Wc.update.process(Ue),Wc.preRender.process(Ue),Wc.render.process(Ue),Ue.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Vs.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(zE),this.sharedNodes.forEach(QE)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ee.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ee.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();let s=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Te(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:i}=this.options;i&&i.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let i=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(i=!1),i){let l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:l,offset:a(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!o)return;let s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,i=this.projectionDelta&&!py(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;s&&(i||Lr(this.latestValues)||d)&&(o(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){let i=this.measurePageBox(),l=this.removeElementScroll(i);return s&&(l=this.removeTransform(l)),eD(l),{animationId:this.root.animationId,measuredBox:i,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var s;let{visualElement:i}=this.options;if(!i)return Te();let l=i.measureViewportBox();if(!(((s=this.scroll)===null||s===void 0?void 0:s.wasRoot)||this.path.some(tD))){let{scroll:d}=this.root;d&&(wo(l.x,d.offset.x),wo(l.y,d.offset.y))}return l}removeElementScroll(s){var i;let l=Te();if(ta(l,s),!((i=this.scroll)===null||i===void 0)&&i.wasRoot)return l;for(let u=0;u<this.path.length;u++){let d=this.path[u],{scroll:c,options:f}=d;d!==this.root&&c&&f.layoutScroll&&(c.wasRoot&&ta(l,s),wo(l.x,c.offset.x),wo(l.y,c.offset.y))}return l}applyTransform(s,i=!1){let l=Te();ta(l,s);for(let u=0;u<this.path.length;u++){let d=this.path[u];!i&&d.options.layoutScroll&&d.scroll&&d!==d.root&&Ln(l,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),Lr(d.latestValues)&&Ln(l,d.latestValues)}return Lr(this.latestValues)&&Ln(l,this.latestValues),l}removeTransform(s){let i=Te();ta(i,s);for(let l=0;l<this.path.length;l++){let u=this.path[l];if(!u.instance||!Lr(u.latestValues))continue;$f(u.latestValues)&&u.updateSnapshot();let d=Te(),c=u.measurePageBox();ta(d,c),fy(i,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return Lr(this.latestValues)&&fy(i,this.latestValues),i}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ue.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){var i;let l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);let u=!!this.resumingFrom||this!==l;if(!(s||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((i=this.parent)===null||i===void 0)&&i.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:c,layoutId:f}=this.options;if(!(!this.layout||!(c||f))){if(this.resolvedRelativeTargetAt=Ue.timestamp,!this.targetDelta&&!this.relativeTarget){let g=this.getClosestProjectingParent();g&&g.layout&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Te(),this.relativeTargetOrigin=Te(),gi(this.relativeTargetOrigin,this.layout.layoutBox,g.layout.layoutBox),ta(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Te(),this.targetWithTransforms=Te()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),zI(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ta(this.target,this.layout.layoutBox),ly(this.target,this.targetDelta)):ta(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;let g=this.getClosestProjectingParent();g&&!!g.resumingFrom==!!this.resumingFrom&&!g.options.layoutScroll&&g.target&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Te(),this.relativeTargetOrigin=Te(),gi(this.relativeTargetOrigin,this.target,g.target),ta(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Cu&&In.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||$f(this.parent.latestValues)||sy(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var s;let i=this.getLead(),l=!!this.resumingFrom||this!==i,u=!0;if((this.isProjectionDirty||!((s=this.parent)===null||s===void 0)&&s.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===Ue.timestamp&&(u=!1),u)return;let{layout:d,layoutId:c}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||c))return;ta(this.layoutCorrected,this.layout.layoutBox);let f=this.treeScale.x,g=this.treeScale.y;db(this.layoutCorrected,this.treeScale,this.path,l),i.layout&&!i.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(i.target=i.layout.layoutBox,i.targetWithTransforms=Te());let{target:x}=i;if(!x){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(cy(this.prevProjectionDelta.x,this.projectionDelta.x),cy(this.prevProjectionDelta.y,this.projectionDelta.y)),hi(this.projectionDelta,this.layoutCorrected,x,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==g||!gy(this.projectionDelta.x,this.prevProjectionDelta.x)||!gy(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",x)),Cu&&In.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){var i;if((i=this.options.visualElement)===null||i===void 0||i.scheduleRender(),s){let l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Cn(),this.projectionDelta=Cn(),this.projectionDeltaWithTransform=Cn()}setAnimationOrigin(s,i=!1){let l=this.snapshot,u=l?l.latestValues:{},d={...this.latestValues},c=Cn();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!i;let f=Te(),g=l?l.source:void 0,x=this.layout?this.layout.source:void 0,w=g!==x,L=this.getStack(),y=!L||L.members.length<=1,h=!!(w&&!y&&this.options.crossfade===!0&&!this.path.some(YE));this.animationProgress=0;let m;this.mixTargetDelta=C=>{let I=C/1e3;Fb(c.x,s.x,I),Fb(c.y,s.y,I),this.setTargetDelta(c),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(gi(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),JE(this.relativeTarget,this.relativeTargetOrigin,f,I),m&&Eb(this.relativeTarget,m)&&(this.isProjectionDirty=!1),m||(m=Te()),ta(m,this.relativeTarget)),w&&(this.animationValues=d,Ib(d,u,this.latestValues,I,h,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=I},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Zt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ee.update(()=>{yi.hasAnimatedSinceResize=!0,this.currentAnimation=gb(0,Mb,{...s,onUpdate:i=>{this.mixTargetDelta(i),s.onUpdate&&s.onUpdate(i)},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Mb),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let s=this.getLead(),{targetWithTransforms:i,target:l,layout:u,latestValues:d}=s;if(!(!i||!l||!u)){if(this!==s&&this.layout&&u&&Hb(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Te();let c=ft(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+c;let f=ft(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+f}ta(i,l),Ln(i,d),hi(this.projectionDeltaWithTransform,this.layoutCorrected,i,d)}}registerSharedNode(s,i){this.sharedNodes.has(s)||this.sharedNodes.set(s,new Zf),this.sharedNodes.get(s).add(i);let u=i.options.initialPromotionConfig;i.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(i):void 0})}isLead(){let s=this.getStack();return s?s.lead===this:!0}getLead(){var s;let{layoutId:i}=this.options;return i?((s=this.getStack())===null||s===void 0?void 0:s.lead)||this:this}getPrevLead(){var s;let{layoutId:i}=this.options;return i?(s=this.getStack())===null||s===void 0?void 0:s.prevLead:void 0}getStack(){let{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:i,preserveFollowOpacity:l}={}){let u=this.getStack();u&&u.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),i&&this.setOptions({transition:i})}relegate(){let s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){let{visualElement:s}=this.options;if(!s)return;let i=!1,{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(i=!0),!i)return;let u={};l.z&&xy("z",s,u,this.animationValues);for(let d=0;d<yy.length;d++)xy(`rotate${yy[d]}`,s,u,this.animationValues),xy(`skew${yy[d]}`,s,u,this.animationValues);s.render();for(let d in u)s.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);s.scheduleRender()}getProjectionStyles(s){var i,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return BE;let u={visibility:""},d=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=zs(s?.pointerEvents)||"",u.transform=d?d(this.latestValues,""):"none",u;let c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){let w={};return this.options.layoutId&&(w.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,w.pointerEvents=zs(s?.pointerEvents)||""),this.hasProjected&&!Lr(this.latestValues)&&(w.transform=d?d({},""):"none",this.hasProjected=!1),w}let f=c.animationValues||c.latestValues;this.applyTransformsToTarget(),u.transform=Db(this.projectionDeltaWithTransform,this.treeScale,f),d&&(u.transform=d(f,u.transform));let{x:g,y:x}=this.projectionDelta;u.transformOrigin=`${g.origin*100}% ${x.origin*100}% 0`,c.animationValues?u.opacity=c===this?(l=(i=f.opacity)!==null&&i!==void 0?i:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:u.opacity=c===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(let w in Js){if(f[w]===void 0)continue;let{correct:L,applyTo:y}=Js[w],h=u.transform==="none"?f[w]:L(f[w],c);if(y){let m=y.length;for(let C=0;C<m;C++)u[y[C]]=h}else u[w]=h}return this.options.layoutId&&(u.pointerEvents=c===this?zs(s?.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>{var i;return(i=s.currentAnimation)===null||i===void 0?void 0:i.stop()}),this.root.nodes.forEach(Nb),this.root.sharedNodes.clear()}}}function VE(e){e.updateLayout()}function jE(e){var t;let a=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&a&&e.hasListeners("didUpdate")){let{layoutBox:r,measuredBox:o}=e.layout,{animationType:n}=e.options,s=a.source!==e.layout.source;n==="size"?jt(c=>{let f=s?a.measuredBox[c]:a.layoutBox[c],g=ft(f);f.min=r[c].min,f.max=f.min+g}):Hb(n,a.layoutBox,r)&&jt(c=>{let f=s?a.measuredBox[c]:a.layoutBox[c],g=ft(r[c]);f.max=f.min+g,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[c].max=e.relativeTarget[c].min+g)});let i=Cn();hi(i,r,a.layoutBox);let l=Cn();s?hi(l,e.applyTransform(o,!0),a.measuredBox):hi(l,r,a.layoutBox);let u=!py(i),d=!1;if(!e.resumeFrom){let c=e.getClosestProjectingParent();if(c&&!c.resumeFrom){let{snapshot:f,layout:g}=c;if(f&&g){let x=Te();gi(x,a.layoutBox,f.layoutBox);let w=Te();gi(w,r,g.layoutBox),my(x,w)||(d=!0),c.options.layoutRoot&&(e.relativeTarget=w,e.relativeTargetOrigin=x,e.relativeParent=c)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:a,delta:l,layoutDelta:i,hasLayoutChanged:u,hasRelativeTargetChanged:d})}else if(e.isLead()){let{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function qE(e){Cu&&In.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function HE(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function zE(e){e.clearSnapshot()}function Nb(e){e.clearMeasurements()}function $E(e){e.isLayoutDirty=!1}function WE(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Ob(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function GE(e){e.resolveTargetDelta()}function KE(e){e.calcProjection()}function XE(e){e.resetSkewAndRotation()}function QE(e){e.removeLeadSnapshot()}function Fb(e,t,a){e.translate=ie(t.translate,0,a),e.scale=ie(t.scale,1,a),e.origin=t.origin,e.originPoint=t.originPoint}function Bb(e,t,a,r){e.min=ie(t.min,a.min,r),e.max=ie(t.max,a.max,r)}function JE(e,t,a,r){Bb(e.x,t.x,a.x,r),Bb(e.y,t.y,a.y,r)}function YE(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var ZE={duration:.45,ease:[.4,0,.1,1]},Ub=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Vb=Ub("applewebkit/")&&!Ub("chrome/")?Math.round:ge;function jb(e){e.min=Vb(e.min),e.max=Vb(e.max)}function eD(e){jb(e.x),jb(e.y)}function Hb(e,t,a){return e==="position"||e==="preserve-aspect"&&!HI(hy(t),hy(a),.2)}function tD(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}var zb=ep({attachResizeListener:(e,t)=>Sr(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0});var vy={current:void 0},tp=ep({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!vy.current){let e=new zb({});e.mount(window),e.setOptions({layoutScroll:!0}),vy.current=e}return vy.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"});var $b={pan:{Feature:Qf},drag:{Feature:Xf,ProjectionNode:tp,MeasureLayout:Jf}};function Wb(e,t,a){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",a==="Start");let o="onHover"+a,n=r[o];n&&ee.postRender(()=>n(t,Cr(t)))}var ap=class extends rt{mount(){let{current:t}=this.node;t&&(this.unmount=Og(t,a=>(Wb(this.node,a,"Start"),r=>Wb(this.node,r,"End"))))}unmount(){}};var rp=class extends rt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=$a(Sr(this.node.current,"focus",()=>this.onFocus()),Sr(this.node.current,"blur",()=>this.onBlur()))}unmount(){}};function Gb(e,t,a){let{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",a==="Start");let o="onTap"+(a==="End"?"":a),n=r[o];n&&ee.postRender(()=>n(t,Cr(t)))}var op=class extends rt{mount(){let{current:t}=this.node;t&&(this.unmount=Bg(t,a=>(Gb(this.node,a,"Start"),(r,{success:o})=>Gb(this.node,r,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}};var Sy=new WeakMap,wy=new WeakMap,aD=e=>{let t=Sy.get(e.target);t&&t(e)},rD=e=>{e.forEach(aD)};function oD({root:e,...t}){let a=e||document;wy.has(a)||wy.set(a,{});let r=wy.get(a),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(rD,{root:e,...t})),r[o]}function Kb(e,t,a){let r=oD(t);return Sy.set(e,a),r.observe(e),()=>{Sy.delete(e),r.unobserve(e)}}var nD={some:0,all:1},np=class extends rt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:t={}}=this.node.getProps(),{root:a,margin:r,amount:o="some",once:n}=t,s={root:a?a.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:nD[o]},i=l=>{let{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,n&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);let{onViewportEnter:d,onViewportLeave:c}=this.node.getProps(),f=u?d:c;f&&f(l)};return Kb(this.node.current,s,i)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;let{props:t,prevProps:a}=this.node;["amount","margin","root"].some(sD(t,a))&&this.startObserver()}unmount(){}};function sD({viewport:e={}},{viewport:t={}}={}){return a=>e[a]!==t[a]}var Xb={inView:{Feature:np},tap:{Feature:op},focus:{Feature:rp},hover:{Feature:ap}};var Qb={layout:{ProjectionNode:tp,MeasureLayout:Jf}};var tk=M(G(),1);var Lu={current:null},sp={current:!1};function Jb(){if(sp.current=!0,!!Fs)if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Lu.current=e.matches;e.addListener(t),t()}else Lu.current=!1}var iD=[...Gg,He,Tt],Yb=e=>iD.find(Rf(e));var Cy=new WeakMap;function Zb(e,t,a){for(let r in t){let o=t[r],n=a[r];if(Ce(o))e.addValue(r,o);else if(Ce(n))e.addValue(r,wr(o,{owner:e}));else if(n!==o)if(e.hasValue(r)){let s=e.getValue(r);s.liveStyle===!0?s.jump(o):s.hasAnimated||s.set(o)}else{let s=e.getStaticValue(r);e.addValue(r,wr(s!==void 0?s:o,{owner:e}))}}for(let r in a)t[r]===void 0&&e.removeValue(r);return t}var ek=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],ip=class{scrapeMotionValuesFromProps(t,a,r){return{}}constructor({parent:t,props:a,presenceContext:r,reducedMotionConfig:o,blockInitialAnimation:n,visualState:s},i={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=yo,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let g=wt.now();this.renderScheduledAt<g&&(this.renderScheduledAt=g,ee.render(this.render,!1,!0))};let{latestValues:l,renderState:u,onUpdate:d}=s;this.onUpdate=d,this.latestValues=l,this.baseTarget={...l},this.initialValues=a.initial?{...l}:{},this.renderState=u,this.parent=t,this.props=a,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=i,this.blockInitialAnimation=!!n,this.isControllingVariants=mn(a),this.isVariantNode=Xc(a),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);let{willChange:c,...f}=this.scrapeMotionValuesFromProps(a,{},this);for(let g in f){let x=f[g];l[g]!==void 0&&Ce(x)&&x.set(l[g],!1)}}mount(t){this.current=t,Cy.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((a,r)=>this.bindToMotionValue(r,a)),sp.current||Jb(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Lu.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Cy.delete(this.current),this.projection&&this.projection.unmount(),Zt(this.notifyUpdate),Zt(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(let t in this.events)this.events[t].clear();for(let t in this.features){let a=this.features[t];a&&(a.unmount(),a.isMounted=!1)}this.current=null}bindToMotionValue(t,a){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();let r=Vt.has(t),o=a.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&ee.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),n=a.on("renderRequest",this.scheduleRender),s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,a)),this.valueSubscriptions.set(t,()=>{o(),n(),s&&s(),a.owner&&a.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in gr){let a=gr[t];if(!a)continue;let{isEnabled:r,Feature:o}=a;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){let n=this.features[t];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Te()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,a){this.latestValues[t]=a}update(t,a){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=a;for(let r=0;r<ek.length;r++){let o=ek[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);let n="on"+o,s=t[n];s&&(this.propEventSubscriptions[o]=this.on(o,s))}this.prevMotionValues=Zb(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){let a=this.getClosestVariantNode();if(a)return a.variantChildren&&a.variantChildren.add(t),()=>a.variantChildren.delete(t)}addValue(t,a){let r=this.values.get(t);a!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,a),this.values.set(t,a),this.latestValues[t]=a.get())}removeValue(t){this.values.delete(t);let a=this.valueSubscriptions.get(t);a&&(a(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,a){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&a!==void 0&&(r=wr(a===null?void 0:a,{owner:this}),this.addValue(t,r)),r}readValue(t,a){var r;let o=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return o!=null&&(typeof o=="string"&&(Af(o)||kf(o))?o=parseFloat(o):!Yb(o)&&Tt.test(a)&&(o=Tf(t,a)),this.setBaseTarget(t,Ce(o)?o.get():o)),Ce(o)?o.get():o}setBaseTarget(t,a){this.baseTarget[t]=a}getBaseTarget(t){var a;let{initial:r}=this.props,o;if(typeof r=="string"||typeof r=="object"){let s=Hs(this.props,r,(a=this.presenceContext)===null||a===void 0?void 0:a.custom);s&&(o=s[t])}if(r&&o!==void 0)return o;let n=this.getBaseTargetFromProps(this.props,t);return n!==void 0&&!Ce(n)?n:this.initialValues[t]!==void 0&&o===void 0?void 0:this.baseTarget[t]}on(t,a){return this.events[t]||(this.events[t]=new po),this.events[t].add(a)}notify(t,...a){this.events[t]&&this.events[t].notify(...a)}};var vi=class extends ip{constructor(){super(...arguments),this.KeyframeResolver=di}sortInstanceNodePosition(t,a){return t.compareDocumentPosition(a)&2?1:-1}getBaseTargetFromProps(t,a){return t.style?t.style[a]:void 0}removeValueFromRenderState(t,{vars:a,style:r}){delete a[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:t}=this.props;Ce(t)&&(this.childSubscription=t.on("change",a=>{this.current&&(this.current.textContent=`${a}`)}))}};function lD(e){return window.getComputedStyle(e)}var lp=class extends vi{constructor(){super(...arguments),this.type="html",this.renderInstance=of}readValueFromInstance(t,a){if(Vt.has(a)){let r=ui(a);return r&&r.default||0}else{let r=lD(t),o=(tf(a)?r.getPropertyValue(a):r[a])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:a}){return uy(t,a)}build(t,a,r){Gs(t,a,r.transformTemplate)}scrapeMotionValuesFromProps(t,a,r){return Ys(t,a,r)}};var up=class extends vi{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Te}getBaseTargetFromProps(t,a){return t[a]}readValueFromInstance(t,a){if(Vt.has(a)){let r=ui(a);return r&&r.default||0}return a=nf.has(a)?a:Us(a),t.getAttribute(a)}scrapeMotionValuesFromProps(t,a,r){return uf(t,a,r)}build(t,a,r){Ks(t,a,this.isSVGTag,r.transformTemplate)}renderInstance(t,a,r,o){sf(t,a,r,o)}mount(t){this.isSVGTag=Qs(t.tagName),super.mount(t)}};var ak=(e,t)=>qs(e)?new up(t):new lp(t,{allowProjection:e!==tk.Fragment});var rk=_L({...EI,...Xb,...$b,...Qb},ak);var Ly=JC(rk);var Iu=M(le(),1);function ok({x:e,y:t,visible:a,onClick:r=!1}){return(0,Iu.jsx)(kg,{children:a&&(0,Iu.jsx)(Ly.div,{className:"fixed pointer-events-none z-[9999]",initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1,x:e,y:t},exit:{opacity:0,scale:.5},transition:{type:"spring",stiffness:200,damping:20},style:{left:0,top:0},children:(0,Iu.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Iu.jsx)("path",{d:"M3 3L10.07 19.97L12.58 12.58L19.97 10.07L3 3Z",fill:"#C4B5FD"})})})})}var wi=M(G(),1);function nk(){let[e,t]=wi.useState({x:0,y:0,visible:!1,onClick:!1}),a=wi.useCallback(n=>{let s=document.querySelector(n.selector);if(s){let i=s.getBoundingClientRect(),l=n.offset?.x||0,u=n.offset?.y||0;t({x:i.left+i.width/2+l,y:i.top+i.height/2+u,visible:!0,onClick:n.onClick||!1})}},[]),r=wi.useCallback(()=>{t(n=>({...n,visible:!1}))},[]),o=wi.useCallback(()=>{t(n=>({...n,visible:!0}))},[]);return{cursorState:e,moveTo:a,hide:r,show:o}}var Ir=M(G(),1);function sk({productBackendUrl:e,sessionId:t,enabled:a=!0}){let[r,o]=Ir.useState({status:"idle"}),n=Ir.useRef(null),s=Ir.useCallback(async()=>{if(!e||!a){console.log("[useUserAuth] Skipping auth - productBackendUrl:",e,"enabled:",a),o({status:"idle"});return}console.log("[useUserAuth] Starting auth request to product backend..."),console.log("[useUserAuth] Product backend URL:",e),console.log("[useUserAuth] Full request URL:",`${e}/users/me`),o({status:"loading"});try{let l=await fetch(`${e}/users/me`,{method:"GET",credentials:"include",headers:{Accept:"application/json"}});if(console.log("[useUserAuth] Response received - status:",l.status,"ok:",l.ok),!l.ok)throw console.log("[useUserAuth] Auth request failed with status:",l.status),l.status===401?new Error("Please log in to use the chat assistant."):l.status===403?new Error("You do not have permission to access this feature."):new Error(`Authentication failed (${l.status})`);let u=await l.json();console.log("[useUserAuth] Auth SUCCESS - parsed user data:"),console.log("[useUserAuth] id:",u.id),console.log("[useUserAuth] email:",u.email),console.log("[useUserAuth] name:",u.name),console.log("[useUserAuth] role:",u.role),console.log("[useUserAuth] isInternal:",u.isInternal),console.log("[useUserAuth] agreementsSigned:",u.agreementsSigned),console.log("[useUserAuth] lastLoginTime:",u.lastLoginTime),o({status:"authenticated",user:u})}catch(l){console.log("[useUserAuth] Auth ERROR:",l);let u=l instanceof Error?l.message:"Unable to verify your identity. Please try again.";o({status:"error",error:u})}},[e,a]);Ir.useEffect(()=>{t!==n.current&&(n.current=t,s())},[t,s]);let i=Ir.useCallback(()=>{s()},[s]);return{authState:r,retry:i}}var Si=M(le(),1);function St({className:e,...t}){return(0,Si.jsx)("div",{"data-slot":"card",className:Jt("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function Wa({className:e,...t}){return(0,Si.jsx)("div",{"data-slot":"card-header",className:Jt("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function Ga({className:e,...t}){return(0,Si.jsx)("div",{"data-slot":"card-title",className:Jt("leading-none font-semibold",e),...t})}function Iy({className:e,...t}){return(0,Si.jsx)("div",{"data-slot":"card-description",className:Jt("text-muted-foreground text-sm",e),...t})}function Ct({className:e,...t}){return(0,Si.jsx)("div",{"data-slot":"card-content",className:Jt("px-6",e),...t})}var S=M(le(),1),by=e=>new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),dp=(e,t="USD")=>new Intl.NumberFormat("en-US",{style:"currency",currency:t}).format(e),ky=e=>{switch(e){case"Enterprise":return ln;case"Professional":return au;default:return Kl}},cp=e=>{switch(e){case"Enterprise":return"bg-purple-50 text-purple-700 border-purple-200";case"Professional":return"bg-blue-50 text-blue-700 border-blue-200";default:return"bg-gray-50 text-gray-700 border-gray-200"}};function bu({status:e,type:t="default"}){let r=(()=>{let n=e.toLowerCase();if(t==="transaction")switch(n){case"paid":return{color:"bg-emerald-50 text-emerald-700 border-emerald-200",icon:at};case"failed":return{color:"bg-red-50 text-red-700 border-red-200",icon:ka};case"pending":return{color:"bg-amber-50 text-amber-700 border-amber-200",icon:nn};case"refunded":return{color:"bg-slate-50 text-slate-700 border-slate-200",icon:_s};default:return{color:"bg-gray-50 text-gray-700 border-gray-200",icon:ba}}if(t==="subscription")switch(n){case"active":return{color:"bg-emerald-50 text-emerald-700 border-emerald-200",icon:at};case"cancelled":return{color:"bg-slate-50 text-slate-700 border-slate-200",icon:ka};case"past_due":return{color:"bg-red-50 text-red-700 border-red-200",icon:ba};case"trialing":return{color:"bg-blue-50 text-blue-700 border-blue-200",icon:nn};default:return{color:"bg-gray-50 text-gray-700 border-gray-200",icon:ba}}switch(n){case"active":return{color:"bg-emerald-50 text-emerald-700 border-emerald-200",icon:at};case"inactive":return{color:"bg-slate-50 text-slate-700 border-slate-200",icon:ka};default:return{color:"bg-gray-50 text-gray-700 border-gray-200",icon:ba}}})(),o=r.icon;return(0,S.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium border ${r.color}`,children:[(0,S.jsx)(o,{className:"h-3 w-3"}),e]})}function uD({subscription:e}){let t=ky(e.plan);return(0,S.jsxs)(St,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)("div",{className:`h-1 ${e.status==="active"?"bg-emerald-500":e.status==="past_due"?"bg-red-500":"bg-slate-300"}`}),(0,S.jsx)(Wa,{className:"pb-3",children:(0,S.jsxs)("div",{className:"flex items-start justify-between",children:[(0,S.jsxs)("div",{className:"space-y-1",children:[(0,S.jsxs)(Ga,{className:"text-base font-semibold text-gray-900 flex items-center gap-2",children:[(0,S.jsx)(sn,{className:"h-4 w-4 text-gray-500"}),e.id]}),e.customer_email&&(0,S.jsxs)(Iy,{className:"text-sm text-gray-500 flex items-center gap-1.5",children:[(0,S.jsx)(As,{className:"h-3 w-3"}),e.customer_email]})]}),(0,S.jsx)(bu,{status:e.status,type:"subscription"})]})}),(0,S.jsx)(Ct,{className:"pt-0",children:(0,S.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,S.jsxs)("div",{className:"space-y-3",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Plan"}),(0,S.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium border ${cp(e.plan)}`,children:[(0,S.jsx)(t,{className:"h-3 w-3"}),e.plan]})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Billing"}),(0,S.jsxs)("div",{className:"text-sm font-medium text-gray-900",children:[dp(e.amount,e.currency)," / ",e.billing_cycle]})]})]}),(0,S.jsxs)("div",{className:"space-y-3",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Current Period"}),(0,S.jsxs)("div",{className:"text-sm text-gray-700",children:[by(e.current_period_start)," - ",by(e.current_period_end)]})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Created"}),(0,S.jsx)("div",{className:"text-sm text-gray-700",children:by(e.created_at)})]})]})]})})]})}function dD({subscriptions:e,maxItems:t=5}){let a=e.slice(0,t),r=e.length>t;return e.length===0?(0,S.jsx)(St,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(Ct,{className:"py-8 text-center",children:[(0,S.jsx)(sn,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,S.jsx)("p",{className:"text-sm text-gray-500",children:"No subscriptions found"})]})}):(0,S.jsxs)(St,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Wa,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ga,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(sn,{className:"h-4 w-4"}),e.length," Subscription",e.length!==1?"s":""]})}),(0,S.jsxs)(Ct,{className:"p-0",children:[(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:a.map(o=>{let n=ky(o.plan);return(0,S.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,S.jsx)("div",{className:`p-2 rounded-lg ${cp(o.plan).replace("text-","text-").replace("border-","bg-").split(" ")[0]}`,children:(0,S.jsx)(n,{className:"h-4 w-4"})}),(0,S.jsxs)("div",{className:"min-w-0",children:[(0,S.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:o.customer_email||o.customer_id}),(0,S.jsxs)("div",{className:"text-xs text-gray-500",children:[o.plan," \xB7 ",dp(o.amount,o.currency),"/",o.billing_cycle]})]})]}),(0,S.jsx)(bu,{status:o.status,type:"subscription"})]})},o.id)})}),r&&(0,S.jsx)("div",{className:"px-4 py-2 bg-gray-50 border-t border-gray-100 text-center",children:(0,S.jsxs)("span",{className:"text-xs text-gray-500",children:["+",e.length-t," more subscription",e.length-t!==1?"s":""]})})]})]})}function cD({customer:e}){let t=ky(e.subscription);return(0,S.jsxs)(St,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)("div",{className:`h-1 ${e.status==="active"?"bg-emerald-500":"bg-slate-300"}`}),(0,S.jsx)(Wa,{className:"pb-3",children:(0,S.jsxs)("div",{className:"flex items-start justify-between",children:[(0,S.jsx)("div",{className:"flex items-center gap-3",children:(0,S.jsxs)("div",{children:[(0,S.jsx)(Ga,{className:"text-base font-semibold text-gray-900",children:e.name}),(0,S.jsxs)(Iy,{className:"text-sm text-gray-500 flex items-center gap-1",children:[(0,S.jsx)(As,{className:"h-3 w-3"}),e.email]})]})}),(0,S.jsx)(bu,{status:e.status,type:"customer"})]})}),(0,S.jsx)(Ct,{className:"pt-0",children:(0,S.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,S.jsxs)("div",{className:"space-y-3",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Plan"}),(0,S.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium border ${cp(e.subscription)}`,children:[(0,S.jsx)(t,{className:"h-3 w-3"}),e.subscription]})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Revenue"}),(0,S.jsxs)("div",{className:"text-sm font-medium text-gray-900 flex items-center gap-1",children:[(0,S.jsx)(un,{className:"h-3 w-3 text-emerald-500"}),e.revenue]})]})]}),(0,S.jsxs)("div",{className:"space-y-3",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Location"}),(0,S.jsxs)("div",{className:"text-sm text-gray-700 flex items-center gap-1",children:[(0,S.jsx)(Rs,{className:"h-3 w-3 text-gray-400"}),e.location||"Not specified"]})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Customer Since"}),(0,S.jsxs)("div",{className:"text-sm text-gray-700 flex items-center gap-1",children:[(0,S.jsx)(Ql,{className:"h-3 w-3 text-gray-400"}),e.joinDate]})]})]})]})})]})}function fD({customers:e,maxItems:t=5}){let a=e.slice(0,t),r=e.length>t;return e.length===0?(0,S.jsx)(St,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(Ct,{className:"py-8 text-center",children:[(0,S.jsx)(Ds,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,S.jsx)("p",{className:"text-sm text-gray-500",children:"No customers found"})]})}):(0,S.jsxs)(St,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Wa,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ga,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(Ds,{className:"h-4 w-4"}),e.length," Customer",e.length!==1?"s":""]})}),(0,S.jsxs)(Ct,{className:"p-0",children:[(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:a.map(o=>(0,S.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsx)("div",{className:"flex items-center gap-3 min-w-0",children:(0,S.jsxs)("div",{className:"min-w-0",children:[(0,S.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:o.name}),(0,S.jsx)("div",{className:"text-xs text-gray-500 truncate",children:o.email})]})}),(0,S.jsxs)("div",{className:"flex items-center gap-2",children:[(0,S.jsx)("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${cp(o.subscription)}`,children:o.subscription}),(0,S.jsx)(bu,{status:o.status,type:"customer"})]})]})},o.id))}),r&&(0,S.jsx)("div",{className:"px-4 py-2 bg-gray-50 border-t border-gray-100 text-center",children:(0,S.jsxs)("span",{className:"text-xs text-gray-500",children:["+",e.length-t," more customer",e.length-t!==1?"s":""]})})]})]})}function ik({transactions:e,maxItems:t=5}){let a=e.slice(0,t),r=e.length>t;return e.length===0?(0,S.jsx)(St,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(Ct,{className:"py-8 text-center",children:[(0,S.jsx)(un,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,S.jsx)("p",{className:"text-sm text-gray-500",children:"No transactions found"})]})}):(0,S.jsxs)(St,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Wa,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ga,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(un,{className:"h-4 w-4"}),e.length," Transaction",e.length!==1?"s":""]})}),(0,S.jsxs)(Ct,{className:"p-0",children:[(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:a.map(o=>(0,S.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,S.jsx)("div",{className:`p-2 rounded-lg ${o.status==="paid"?"bg-emerald-50":o.status==="failed"?"bg-red-50":o.status==="refunded"?"bg-slate-50":"bg-amber-50"}`,children:o.status==="paid"?(0,S.jsx)(at,{className:"h-4 w-4 text-emerald-600"}):o.status==="failed"?(0,S.jsx)(ka,{className:"h-4 w-4 text-red-600"}):o.status==="refunded"?(0,S.jsx)(_s,{className:"h-4 w-4 text-slate-600"}):(0,S.jsx)(nn,{className:"h-4 w-4 text-amber-600"})}),(0,S.jsxs)("div",{className:"min-w-0",children:[(0,S.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:o.customer}),(0,S.jsxs)("div",{className:"text-xs text-gray-500",children:[o.date,o.decline_reason&&(0,S.jsxs)("span",{className:"text-red-500 ml-2",children:["\xB7 ",o.decline_reason]})]})]})]}),(0,S.jsxs)("div",{className:"flex items-center gap-3",children:[(0,S.jsxs)("span",{className:`text-sm font-semibold ${o.status==="paid"?"text-emerald-600":o.status==="failed"?"text-red-600":o.status==="refunded"?"text-slate-600":"text-amber-600"}`,children:[o.status==="refunded"?"-":"",o.amount]}),(0,S.jsx)(bu,{status:o.status,type:"transaction"})]})]})},o.id))}),r&&(0,S.jsx)("div",{className:"px-4 py-2 bg-gray-50 border-t border-gray-100 text-center",children:(0,S.jsxs)("span",{className:"text-xs text-gray-500",children:["+",e.length-t," more transaction",e.length-t!==1?"s":""]})})]})]})}function pD({apiKeys:e}){return e.length===0?(0,S.jsx)(St,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(Ct,{className:"py-8 text-center",children:[(0,S.jsx)(Ts,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,S.jsx)("p",{className:"text-sm text-gray-500",children:"No API keys found"})]})}):(0,S.jsxs)(St,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Wa,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ga,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(Ts,{className:"h-4 w-4"}),e.length," API Key",e.length!==1?"s":""]})}),(0,S.jsx)(Ct,{className:"p-0",children:(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:e.map((t,a)=>(0,S.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsxs)("div",{className:"min-w-0",children:[(0,S.jsx)("div",{className:"text-sm font-medium text-gray-900",children:t.name}),(0,S.jsxs)("div",{className:"text-xs text-gray-500 font-mono",children:[t.key.slice(0,12),"...",t.key.slice(-4)]})]}),(0,S.jsxs)("div",{className:"text-xs text-gray-500",children:["Last used: ",t.lastUsed]})]})},a))})})]})}function mD({sessions:e}){let t=a=>{let r=a.toLowerCase();return r.includes("mobile")||r.includes("iphone")||r.includes("android")?eu:Yl};return e.length===0?(0,S.jsx)(St,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(Ct,{className:"py-8 text-center",children:[(0,S.jsx)(Es,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,S.jsx)("p",{className:"text-sm text-gray-500",children:"No active sessions"})]})}):(0,S.jsxs)(St,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Wa,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ga,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(Es,{className:"h-4 w-4"}),e.length," Active Session",e.length!==1?"s":""]})}),(0,S.jsx)(Ct,{className:"p-0",children:(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:e.map((a,r)=>{let o=t(a.device);return(0,S.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsxs)("div",{className:"flex items-center gap-3",children:[(0,S.jsx)("div",{className:"p-2 rounded-lg bg-gray-100",children:(0,S.jsx)(o,{className:"h-4 w-4 text-gray-600"})}),(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-sm font-medium text-gray-900",children:a.device}),(0,S.jsxs)("div",{className:"text-xs text-gray-500 flex items-center gap-1",children:[(0,S.jsx)(Rs,{className:"h-3 w-3"}),a.location]})]})]}),(0,S.jsx)("div",{className:"text-xs text-gray-500",children:a.time})]})},r)})})})]})}function hD({stats:e}){return(0,S.jsxs)(St,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Wa,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ga,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(tu,{className:"h-4 w-4"}),"Dashboard Overview"]})}),(0,S.jsx)(Ct,{className:"p-4",children:(0,S.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[e.revenue&&(0,S.jsxs)("div",{className:"p-3 rounded-lg bg-emerald-50 border border-emerald-100",children:[(0,S.jsx)("div",{className:"text-xs text-emerald-600 font-medium mb-1",children:"Revenue"}),(0,S.jsx)("div",{className:"text-lg font-bold text-emerald-700",children:dp(e.revenue.total)}),e.revenue.change!==0&&(0,S.jsxs)("div",{className:`text-xs ${e.revenue.change>0?"text-emerald-600":"text-red-600"}`,children:[e.revenue.change>0?"+":"",e.revenue.change,"% from last period"]})]}),e.subscriptions&&(0,S.jsxs)("div",{className:"p-3 rounded-lg bg-blue-50 border border-blue-100",children:[(0,S.jsx)("div",{className:"text-xs text-blue-600 font-medium mb-1",children:"Subscriptions"}),(0,S.jsxs)("div",{className:"text-lg font-bold text-blue-700",children:[e.subscriptions.active," active"]}),(0,S.jsxs)("div",{className:"text-xs text-blue-600",children:[e.subscriptions.total," total"]})]}),e.customers&&(0,S.jsxs)("div",{className:"p-3 rounded-lg bg-purple-50 border border-purple-100",children:[(0,S.jsx)("div",{className:"text-xs text-purple-600 font-medium mb-1",children:"Customers"}),(0,S.jsx)("div",{className:"text-lg font-bold text-purple-700",children:e.customers.total}),e.customers.new>0&&(0,S.jsxs)("div",{className:"text-xs text-purple-600",children:["+",e.customers.new," new this period"]})]}),e.transactions&&(0,S.jsxs)("div",{className:"p-3 rounded-lg bg-amber-50 border border-amber-100",children:[(0,S.jsx)("div",{className:"text-xs text-amber-600 font-medium mb-1",children:"Transactions"}),(0,S.jsxs)("div",{className:"text-lg font-bold text-amber-700",children:[e.transactions.successful," successful"]}),e.transactions.failed>0&&(0,S.jsxs)("div",{className:"text-xs text-red-600",children:[e.transactions.failed," failed"]})]})]})})]})}function gD({customers:e}){return e.length===0?(0,S.jsx)(St,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(Ct,{className:"py-8 text-center",children:[(0,S.jsx)(ln,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,S.jsx)("p",{className:"text-sm text-gray-500",children:"No top customers data"})]})}):(0,S.jsxs)(St,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Wa,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ga,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(ln,{className:"h-4 w-4 text-amber-500"}),"Top Customers"]})}),(0,S.jsx)(Ct,{className:"p-0",children:(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:e.map((t,a)=>(0,S.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,S.jsx)("div",{className:`h-6 w-6 rounded-full flex items-center justify-center text-xs font-bold ${a===0?"bg-amber-100 text-amber-700":a===1?"bg-slate-100 text-slate-700":a===2?"bg-orange-100 text-orange-700":"bg-gray-100 text-gray-700"}`,children:a+1}),(0,S.jsxs)("div",{className:"min-w-0",children:[(0,S.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:t.name}),(0,S.jsx)("div",{className:"text-xs text-gray-500 truncate",children:t.email})]})]}),(0,S.jsx)("div",{className:"text-sm font-semibold text-emerald-600",children:typeof t.revenue=="number"?dp(t.revenue):t.revenue})]})},a))})})]})}function lk({type:e,data:t}){if(!t)return null;switch(e){case"subscription":return(0,S.jsx)(uD,{subscription:t});case"subscriptions":let a=t.subscriptions||t||[];return(0,S.jsx)(dD,{subscriptions:Array.isArray(a)?a:[a]});case"customer":return(0,S.jsx)(cD,{customer:t.customer||t});case"customers":let r=t.customers||t||[];return(0,S.jsx)(fD,{customers:Array.isArray(r)?r:[r]});case"transactions":let o=t.transactions||t||[];return(0,S.jsx)(ik,{transactions:Array.isArray(o)?o:[o]});case"transaction":return(0,S.jsx)(ik,{transactions:[t],maxItems:1});case"dashboard_stats":return(0,S.jsx)(hD,{stats:t});case"top_customers":let n=t.customers||t||[];return(0,S.jsx)(gD,{customers:Array.isArray(n)?n:[n]});case"api_keys":let s=t.api_keys||t||[];return(0,S.jsx)(pD,{apiKeys:Array.isArray(s)?s:[s]});case"sessions":let i=t.sessions||t||[];return(0,S.jsx)(mD,{sessions:Array.isArray(i)?i:[i]});default:return null}}var bn=M(le(),1);function uk({className:e=""}){return(0,bn.jsx)("div",{className:`flex items-center gap-1 px-4 py-3 ${e}`,children:(0,bn.jsxs)("div",{className:"flex items-center gap-1",children:[(0,bn.jsx)("span",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"0ms",animationDuration:"600ms"}}),(0,bn.jsx)("span",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"150ms",animationDuration:"600ms"}}),(0,bn.jsx)("span",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"300ms",animationDuration:"600ms"}})]})})}var p=M(le(),1),yD="0.2.43",xD="http://localhost:5002",fp=340;function vD(e){return e.replace(/\\\\n/g,`
24
24
  `).replace(/\\\\t/g," ").replace(/\\\\"/g,'"').replace(/\\\\\\\\/g,"\\").replace(/\\n/g,`
25
25
  `).replace(/\\t/g," ").replace(/\\"/g,'"').replace(/\\\\/g,"\\")}function wD(e){if(!e)return null;let t=e.split(`
26
26
  `),a=[],r=null,o=!1,n=[],s="",i=u=>{let d=[],c=u,f=0;for(;c.length>0;){let g=c.match(/^`([^`]+)`/);if(g){d.push((0,p.jsx)("code",{className:"bg-gray-100 px-1 py-0.5 rounded text-xs font-mono",children:g[1]},f++)),c=c.slice(g[0].length);continue}let x=c.match(/^\*\*([^*]+)\*\*/);if(x){d.push((0,p.jsx)("strong",{children:x[1]},f++)),c=c.slice(x[0].length);continue}let w=c.match(/^\*([^*]+)\*/);if(w){d.push((0,p.jsx)("em",{children:w[1]},f++)),c=c.slice(w[0].length);continue}let L=c.match(/^\[([^\]]+)\]\(([^)]+)\)/);if(L){d.push((0,p.jsx)("a",{href:L[2],className:"kite-link",target:"_blank",rel:"noopener noreferrer",children:L[1]},f++)),c=c.slice(L[0].length);continue}let y=c.match(/^(https?:\/\/[^\s<>]+|www\.[^\s<>]+)/);if(y){let C=y[1],I=C.startsWith("www.")?`https://${C}`:C;d.push((0,p.jsx)("a",{href:I,className:"kite-link",target:"_blank",rel:"noopener noreferrer",children:C},f++)),c=c.slice(C.length);continue}let h=c.match(/^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})/);if(h){let C=h[1];d.push((0,p.jsx)("a",{href:`mailto:${C}`,className:"kite-link",children:C},f++)),c=c.slice(C.length);continue}let m=c.search(/[`*\[@h]/);if(m===-1){d.push(c);break}else m===0?(d.push(c[0]),c=c.slice(1)):(d.push(c.slice(0,m)),c=c.slice(m))}return d.length===1?d[0]:(0,p.jsx)(p.Fragment,{children:d})},l=()=>{if(r){let u=r.type==="ul"?"ul":"ol";a.push((0,p.jsx)(u,{className:`${r.type==="ul"?"list-disc":"list-decimal"} ml-4 my-1`,children:r.items.map((d,c)=>(0,p.jsx)("li",{className:"ml-2",children:d},c))},a.length)),r=null}};for(let u=0;u<t.length;u++){let d=t[u];if(d.startsWith("```")){o?(a.push((0,p.jsx)("pre",{className:"bg-gray-100 rounded p-2 my-1 overflow-x-auto",children:(0,p.jsx)("code",{className:"text-xs font-mono",children:n.join(`
27
- `)})},a.length)),o=!1,n=[],s=""):(l(),o=!0,s=d.slice(3).trim());continue}if(o){n.push(d);continue}let c=d.match(/^(#{1,6})\s+(.+)/);if(c){l();let x=c[1].length,w=i(c[2]),L=x===1?"text-lg font-bold my-1":x===2?"text-base font-bold my-1":"text-sm font-semibold my-1";a.push((0,p.jsx)("div",{className:L,children:w},a.length));continue}let f=d.match(/^[-*]\s+(.+)/);if(f){(!r||r.type!=="ul")&&(l(),r={type:"ul",items:[]}),r.items.push(i(f[1]));continue}let g=d.match(/^\d+[.)]\s+(.+)/);if(g){(!r||r.type!=="ol")&&(l(),r={type:"ol",items:[]}),r.items.push(i(g[1]));continue}if(d.trim()===""){l(),a.push((0,p.jsx)("div",{className:"h-2"},a.length));continue}if(d.match(/^[-*_]{3,}$/)){l(),a.push((0,p.jsx)("hr",{className:"my-2 border-gray-200"},a.length));continue}l(),a.push((0,p.jsx)("div",{children:i(d)},a.length))}return l(),(0,p.jsx)(p.Fragment,{children:a})}var SD=[{id:"changing-layouts",label:"Changing layouts",prompt:"How do I change the layout of my profiles or folders?",icon:"layout"},{id:"bulk-uploads",label:"Bulk uploads",prompt:"How do I bulk upload profiles using a CSV file?",icon:"upload"},{id:"example-setups",label:"Example setups",prompt:"Can you show me some example folder setups?",icon:"setup"}],dk=[{id:"customers",title:"Customer Management",topics:[{id:"add-customer",label:"Add a new customer",prompt:"How do I add a new customer to the system and what information is required?"},{id:"customer-details",label:"View customer details",prompt:"Show me how to view and edit customer information and their payment history."}]},{id:"payments",title:"Payment Processing",topics:[{id:"process-payment",label:"Process a payment",prompt:"How do I process a one-time payment for a customer?"},{id:"refund-payment",label:"Issue a refund",prompt:"Walk me through issuing a refund for a customer payment."}]},{id:"subscriptions",title:"Subscription Management",topics:[{id:"create-subscription",label:"Create a subscription",prompt:"How do I set up a new subscription plan for a customer?"},{id:"update-subscription",label:"Update subscription tier",prompt:"How can I change a customer's subscription plan or upgrade them?"}]},{id:"billing",title:"Billing",topics:[{id:"payment-methods",label:"Manage payment methods",prompt:"How do customers add or update their payment methods?"}]}],Py={"getting-started":{id:"getting-started",title:"Getting started",steps:[{text:"Step 1: Let's open the Customers page. This is where you'll manage all your customers - you can view, add, and edit customer information here.",navigation:{page:"customers"},cursorTarget:{selector:'[data-page="customers"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 2: Now let's open the Add customer dialog. This is where you'll enter information for your first customer, including their name, email, and other details.",navigation:{page:"customers"},cursorTarget:{selector:'[data-testid="add-customer-button"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 3: Let's open the Settings page. This is where you manage your account settings, company information, and preferences. We're going to verify your company address is correct.",navigation:{page:"settings",subtab:"general"},cursorTarget:{selector:'[data-page="settings"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 4: Here's the address field in the Company Information section. It's important to verify this address is accurate since it's used for billing and shipping purposes. Make sure it's up to date.",navigation:{page:"settings",subtab:"general"},cursorTarget:{selector:'[data-testid="company-address-input"]',offset:{x:0,y:0},onClick:!1}},{text:"Step 5: Let's open the API Keys tab. This section shows all your API keys - you'll need these to connect your application to our services. We're going to create a production API key.",navigation:{page:"settings",subtab:"api"},cursorTarget:{selector:'[data-settings-tab="api"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 6: Let's open the Create API Key dialog. Here you can create a new API key for your application. You'll want to give it a descriptive name like 'Production Key' so you can easily identify it later.",navigation:{page:"settings",subtab:"api"},cursorTarget:{selector:'[data-testid="create-api-key-button"]',offset:{x:0,y:0},onClick:!0}}]},"add-api-key":{id:"add-api-key",title:"How to add an API key",steps:[{text:"Step 1: Let's open the Settings page. This is where you manage your account settings and preferences. We need to go here to access the API Keys section.",navigation:{page:"settings",subtab:"general"},cursorTarget:{selector:'[data-page="settings"]',offset:{x:0,y:0},onClick:!1}},{text:"Step 2: Let's open the API Keys tab. This section shows all your API keys and allows you to create new ones. You'll need API keys to connect your application to our services.",navigation:{page:"settings",subtab:"api"},cursorTarget:{selector:'[data-settings-tab="api"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 3: Let's open the Create API Key dialog. This is where you'll create your new API key - you can give it a name to help you identify it later, then click Create to generate it.",navigation:{page:"settings",subtab:"api"},cursorTarget:{selector:'[data-testid="create-api-key-button"]',offset:{x:0,y:0},onClick:!0}}]},"refund-payment":{id:"refund-payment",title:"How to refund a payment",steps:[{text:"Step 1: Let's open the Home page. This is your dashboard where you can view today's activity, your payment overview, and recent transactions. We need to go here to find the payment you want to refund.",navigation:{page:"dashboard"},cursorTarget:{selector:'[data-page="dashboard"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 2: Scroll down to see the Recent transactions section at the bottom. This shows your latest payment transactions with their status. We're looking for a transaction with 'paid' status - only paid transactions can be refunded.",navigation:{page:"dashboard"},cursorTarget:{selector:'[data-testid="recent-activity-card"]',offset:{x:0,y:0},onClick:!1}},{text:"Step 3: Let's open the dropdown menu for this paid transaction. Each transaction has a menu button (three dots) that gives you options like refunding. Click it to see the available actions, including the 'Refund payment' option.",navigation:{page:"dashboard"},cursorTarget:{selector:'[data-testid="transaction-menu-button"]',offset:{x:0,y:0},onClick:!0}}]}},CD=[];function LD(){return(0,p.jsxs)("div",{className:"flex flex-col items-center justify-center h-full p-6",children:[(0,p.jsx)(Ft,{className:"h-8 w-8 animate-spin text-gray-400 mb-3"}),(0,p.jsx)("p",{className:"text-xs text-gray-500",children:"Verifying your identity..."})]})}function ID({error:e,onRetry:t}){return(0,p.jsxs)("div",{className:"flex flex-col items-center justify-center h-full p-6 text-center",children:[(0,p.jsx)("div",{className:"w-12 h-12 rounded-full bg-red-100 flex items-center justify-center mb-4",children:(0,p.jsx)(ro,{className:"h-6 w-6 text-red-600"})}),(0,p.jsx)("h3",{className:"text-sm font-semibold text-gray-900 mb-2",children:"Unable to Start Chat"}),(0,p.jsx)("p",{className:"text-xs text-gray-500 mb-4 max-w-[240px]",children:e}),(0,p.jsx)(ut,{variant:"secondary",size:"sm",onClick:t,className:"h-8 px-4 text-xs",children:"Try Again"})]})}function bD({isOpen:e=!0,onClose:t,onOpen:a,onBack:r,onNavigate:o,onActionComplete:n,currentPage:s,agentUrl:i=xD,startingQuestions:l,startingQuestionsEndpoint:u,userId:d,orgId:c,userName:f,userEmail:g,userOrganization:x,supabaseUrl:w,supabaseAnonKey:L,productBackendUrl:y}={}){let[h,m]=F.useState(CD),[C,I]=F.useState(""),[P,R]=F.useState(()=>crypto.randomUUID()),{authState:A,retry:q}=sk({productBackendUrl:y,sessionId:P,enabled:!!y}),U=F.useMemo(()=>A.status==="authenticated"?{userId:A.user.id,userName:A.user.name,userEmail:A.user.email,userRole:A.user.role,isInternal:A.user.isInternal}:{userId:d||"anonymous",userName:f||"Anonymous User",userEmail:g||"Not provided",userRole:void 0,isInternal:!1},[A,d,f,g]),[J,ue]=F.useState(!1),pt=F.useRef(null),[Xa,So]=F.useState(!1),Ke=F.useRef(null),xe=F.useRef(null),ze=F.useRef(null);F.useEffect(()=>{console.log(`[KiteChat] Chat Panel v${yD} loaded`)},[]);let Ht=F.useCallback(()=>{console.log("[KiteChat] resetSession called",{isEscalated:J,hasSupabase:!!Ke.current,sessionId:P}),J&&Ke.current&&P?(console.log("[KiteChat] Updating customer_status to disconnected for session:",P),Ke.current.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",P).then(v=>{console.log("[KiteChat] Disconnect update result:",v)},v=>{console.error("[KiteChat] Disconnect update failed:",v)})):console.log("[KiteChat] Skipping disconnect update - conditions not met"),R(crypto.randomUUID()),ue(!1),pt.current&&(pt.current.close(),pt.current=null),So(!1),xe.current&&(xe.current.unsubscribe(),xe.current=null)},[J,P]);F.useEffect(()=>{w&&L&&!Ke.current&&(Ke.current=FS(w,L))},[w,L]),F.useEffect(()=>{if(!J||!P||!Ke.current)return;let v=`typing:${P}`,k=Ke.current.channel(v);return console.log(`[KiteChat] Subscribing to typing channel: ${v}`),k.on("broadcast",{event:"typing"},O=>{console.log("[KiteChat] Received typing broadcast:",O);let{sender:D,isTyping:E}=O.payload;D==="agent"&&(console.log(`[KiteChat] Agent typing: ${E}`),So(E),E&&(ze.current&&window.clearTimeout(ze.current),ze.current=window.setTimeout(()=>{So(!1)},5e3)))}).subscribe(O=>{console.log(`[KiteChat] Typing channel status: ${O}`),O==="SUBSCRIBED"&&(xe.current=k,console.log("[KiteChat] Typing channel ready"))}),()=>{k.unsubscribe(),xe.current=null,ze.current&&window.clearTimeout(ze.current)}},[J,P]);let ma=F.useRef(null),Xe=F.useCallback(async v=>{if(!(!Ke.current||!P))try{await Ke.current.from("escalations").update({customer_status:v,customer_last_seen:new Date().toISOString()}).eq("session_id",P)}catch(k){console.error("[KiteChat] Failed to update customer status:",k)}},[P]);F.useEffect(()=>{if(!J||!P||!Ke.current)return;let v=P,k=Ke.current;Xe("active"),ma.current=window.setInterval(()=>{Xe("active")},6e4);let O=()=>{k.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",v)},D=()=>{document.visibilityState==="hidden"?k.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",v):document.visibilityState==="visible"&&Xe("active")};return window.addEventListener("beforeunload",O),document.addEventListener("visibilitychange",D),()=>{window.removeEventListener("beforeunload",O),document.removeEventListener("visibilitychange",D),k.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",v).then(()=>{console.log("[KiteChat] Marked customer as disconnected")},E=>{console.error("[KiteChat] Failed to mark disconnected:",E)}),ma.current&&(window.clearInterval(ma.current),ma.current=null)}},[J,P,Xe]);let ku=F.useCallback(v=>{if(!xe.current){console.log("[KiteChat] Cannot send typing - channel not ready");return}if(!J){console.log("[KiteChat] Cannot send typing - not escalated");return}console.log(`[KiteChat] Sending typing indicator: ${v}`),xe.current.send({type:"broadcast",event:"typing",payload:{sender:"user",isTyping:v}})},[J]),kn=F.useRef(null),pk=F.useCallback(()=>{!J||!Ke.current||(ku(!0),Xe("active"),kn.current&&window.clearTimeout(kn.current),kn.current=window.setTimeout(()=>{ku(!1)},1500))},[J,ku,Xe]),Pn=F.useRef({}),Ry=h.length===0,[Tn,ye]=F.useState("idle"),[mk,Le]=F.useState([]),br=F.useRef([]),hk=h.length?h[h.length-1].role:void 0,[pp,Co]=F.useState("landing"),[_y,Lo]=F.useState(void 0),[gk,Ey]=F.useState(l||SD),[yk,Dy]=F.useState(!1);F.useEffect(()=>{u&&!l&&(Dy(!0),fetch(u).then(v=>v.json()).then(v=>{Array.isArray(v)&&v.length>0&&Ey(v)}).catch(v=>{console.warn("[KiteChat] Failed to fetch starting questions:",v)}).finally(()=>Dy(!1)))},[u,l]),F.useEffect(()=>{l&&Ey(l)},[l]);let[he,kr]=F.useState(void 0),Me=F.useRef(void 0),My=F.useRef(null),[Li,Ii]=F.useState(!1);F.useEffect(()=>{window.resetIntegrationNotification=()=>{localStorage.removeItem("gmailNotificationSeen"),console.log("Integration notification reset! Click the Integrations tab to see it again.")};let v=()=>{if(!localStorage.getItem("gmailNotificationSeen")){Co("landing"),Lo(void 0);let O=Date.now(),D="I see you're exploring integrations. Let me know if there are any other connections we should add.",E={id:O,role:"assistant",kind:"text",content:"",isNotificationMessage:!0};m(Y=>[...Y,E]),Qa(O,D),localStorage.setItem("gmailNotificationSeen","true")}};return window.addEventListener("integrationTabClicked",v),()=>{window.removeEventListener("integrationTabClicked",v)}},[]),F.useEffect(()=>{he?(!Me.current||Me.current.id!==he.id||Me.current.stepIndex!==he.stepIndex)&&(Me.current=he):Me.current=void 0},[he]);let[bi,Pu]=F.useState(null),[Qe,mp]=F.useState(null),[ne,se]=F.useState({}),Ny=F.useRef(null),hp=F.useRef(null),Tu=F.useRef(null),{cursorState:Au,moveTo:Io,hide:An}=nk(),[bo,gp]=F.useState(null),[Oy,Pr]=F.useState(null),yp=F.useRef(null),Rn=F.useRef(null),[Fy,ki]=F.useState(!1),[_n,Ru]=F.useState(""),By=F.useRef(null);F.useEffect(()=>{if(!he||he.id!=="add-api-key"||he.stepIndex!==2)return;let k=setInterval(()=>{let O=document.querySelector('[role="dialog"]'),D=Me.current;if(O&&D&&D.id==="add-api-key"&&D.stepIndex===2){An();let E=Date.now()+1;m(Y=>[...Y,{id:E,role:"assistant",kind:"guideComplete",content:"Perfect! The dialog is now open. You can enter a name and create your API key."}]),kr(void 0),Ii(!0)}},300);return()=>clearInterval(k)},[he,An]),F.useEffect(()=>()=>{Object.values(Pn.current).forEach(v=>window.clearInterval(v)),Pn.current={},br.current.forEach(v=>window.clearTimeout(v)),br.current=[]},[]),F.useEffect(()=>{if(he&&h.length>0){let v=h[h.length-1];if((v.kind==="guideStep"||v.kind==="guideComplete")&&Tu.current&&hp.current){let k=hp.current,O=Tu.current,D=k.getBoundingClientRect(),Y=O.getBoundingClientRect().top-D.top+k.scrollTop;k.scrollTop=Y}}else!he&&h.length>0&&Ny.current?.scrollIntoView({behavior:"smooth"})},[h,Tn,he]);let Uy=F.useMemo(()=>{for(let v=h.length-1;v>=0;v--){let k=h[v];if(k.kind==="bulkSummary"&&k.bulkSummary?.navigationPage&&k.bulkSummary.successes>0)return k.bulkSummary.navigationPage}return null},[h]);F.useEffect(()=>{My.current=Uy},[Uy]),F.useEffect(()=>{yp.current=Oy},[Oy]),F.useEffect(()=>{let v=k=>{if((k.metaKey||k.ctrlKey)&&k.key==="Enter"){let O=yp.current;if(O){k.preventDefault(),k.stopPropagation(),wp(O);return}if(Qe){k.preventDefault(),k.stopPropagation(),vp();return}if(bi){k.preventDefault(),k.stopPropagation(),xp(bi);return}let D=My.current;if(console.log("[DEBUG] Keyboard handler - latestBulkSummaryNavigation:",D,"onNavigate:",!!o),D&&o){console.log("[DEBUG] Navigating via keyboard to:",D.page),k.preventDefault(),k.stopPropagation(),o(D.page,D.subtab);return}if(Li){k.preventDefault(),k.stopPropagation(),jy();return}if(Me.current){k.preventDefault(),k.stopPropagation(),Sp();return}}};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[Qe,bi,he,Li,o]);let Vy=F.useCallback(v=>{if(!i)return;pt.current&&pt.current.close();let k=i.replace(/^http/,"ws")+`/ws/escalation/${v}`,O=new WebSocket(k);O.onmessage=D=>{try{let E=JSON.parse(D.data);E.type==="agent_message"?m(Y=>{let X=E.content,T=E.message_id;return(T?Y.some(b=>b.serverMessageId===T):Y.slice(-5).some(b=>b.content===X))?(console.debug("[KiteChat] Skipping duplicate agent message:",T||X.slice(0,30)),Y):[...Y,{id:Date.now(),role:"agent",kind:"text",content:X,serverMessageId:T}]}):E.type==="error"&&console.error("[KiteChat] Escalation error:",E.message)}catch(E){console.error("[KiteChat] Failed to parse escalation message:",E)}},O.onerror=D=>{console.error("[KiteChat] Escalation WebSocket error:",D)},O.onclose=()=>{console.log("[KiteChat] Escalation WebSocket closed")},pt.current=O},[i]),xk=F.useCallback(async v=>{if(!pt.current||pt.current.readyState!==WebSocket.OPEN)return console.error("[KiteChat] Escalation WebSocket not connected"),!1;try{return pt.current.send(JSON.stringify({type:"user_message",content:v})),Xe("active"),!0}catch(k){return console.error("[KiteChat] Failed to send escalated message:",k),!1}},[Xe]);F.useEffect(()=>()=>{pt.current&&pt.current.close()},[]),F.useEffect(()=>{J&&P&&Vy(P)},[J,P,Vy]);function Qa(v,k,O){let D=k||"",E=O;if(k&&k.startsWith("{")&&k.includes('"response"'))try{let N=0,b=0;for(let W=0;W<k.length;W++)if(k[W]==="{")N++;else if(k[W]==="}"&&(N--,N===0)){b=W+1;break}let K=b>0?k.slice(0,b):k,ae=JSON.parse(K);ae.response&&typeof ae.response=="string"&&(D=ae.response,!E&&ae.followups&&(E=ae.followups))}catch{}D=vD(D);let Y=D.split(" "),X=0,T=window.setInterval(()=>{X+=1,m(N=>N.map(b=>b.id===v?{...b,content:Y.slice(0,X).join(" ")}:b)),X>=Y.length&&(window.clearInterval(T),delete Pn.current[v],E&&E.length>0&&m(N=>N.map(b=>b.id===v?{...b,followups:E}:b)),ye("idle"))},25);Pn.current[v]=T}function vk(v,k){m(O=>O.map(D=>D.id===v?{...D,followupSelected:!0}:D)),_u(k.label)}function jy(){Object.values(Pn.current).forEach(v=>window.clearInterval(v)),Pn.current={},br.current.forEach(v=>window.clearTimeout(v)),br.current=[],An(),Ht(),m([]),I(""),ye("idle"),Co("landing"),Lo(void 0),kr(void 0),Ii(!1),Pu(null),mp(null),se({}),r&&r()}function RD(v){Co("folder"),Lo(v)}function wk(){Co("landing"),Lo(void 0)}function Sk(v){v.preventDefault();let k=C.trim();if(bo){if(!k){let O={id:Date.now(),role:"assistant",kind:"text",content:"Please describe what you'd like to do with this CSV file. For example: 'Create customers from this file' or 'Add these subscriptions'."};m(D=>[...D,O]);return}Lk(k,bo),I(""),gp(null),Rn.current&&(Rn.current.value="");return}if(k){if(J){let O={id:Date.now(),role:"user",content:k};m(D=>[...D,O]),xk(k),ku(!1),kn.current&&(window.clearTimeout(kn.current),kn.current=null),I("");return}_u(k),I("")}}function Ck(v){let k={dashboard:"dashboard",customers:"customers page",payments:"payments page",settings:"settings page",support:"support page",disputes:"disputes page",radar:"radar page"};if(v.page==="settings"&&v.subtab){let O={general:"General",billing:"Billing",security:"Security",api:"API Keys",notifications:"Notifications",integrations:"Integrations"};return`${k.settings} (${O[v.subtab]} tab)`}return k[v.page]}function xp(v){o&&o(v.page,v.subtab),Pu(null),m(k=>k.map(O=>O.kind==="navigationAction"&&O.navigationTarget?.page===v.page&&O.navigationTarget?.subtab===v.subtab?{...O,navigationTarget:void 0}:O))}function vp(){if(!Qe)return;let v=ne;if(Qe.type!=="updateCompanyInfo"){if(Qe.type==="addApiKey"){let k=v;if(!k.name||!k.name.trim())return}else if(Qe.type==="addCustomer"){let k=v;if(!k.name||!k.name.trim()||!k.email||!k.email.trim())return}else if(Qe.type==="changePassword"){let k=v;if(!k.currentPassword||!k.newPassword||!k.confirmPassword||k.newPassword!==k.confirmPassword)return}else if(Qe.type==="addWebhook"){let k=v;if(!k.url||!k.url.trim())return}else if(Qe.type==="addPaymentMethod"){let k=v;if(!k.cardNumber||!k.expiryDate)return}else if(Qe.type==="deleteApiKey"){let k=v;if(!k.keyId&&!k.name)return}else if(Qe.type==="refundPayment"){let k=v;if(!k.transactionId&&!k.customer)return}else if(Qe.type==="createSubscription"){let k=v;if(!k.customerEmail&&!k.customerId)return}else if((Qe.type==="toggleBlockRule"||Qe.type==="enableBlockRule"||Qe.type==="disableBlockRule")&&!v.ruleId)return}n&&n(Qe.type,v),m(k=>k.map(O=>O.kind==="actionForm"&&O.actionType===Qe.type?{...O,isSubmitted:!0}:O)),mp(null),se({})}async function _u(v){br.current.forEach(X=>window.clearTimeout(X)),br.current=[];let O=[...h].reverse().find(X=>X.role==="assistant")?.isNotificationMessage===!0,D=Date.now(),E={id:D,role:"user",content:v};if(m(X=>X.map(T=>T.followups&&T.followups.length>0?{...T,followupSelected:!0}:T).concat(E)),O){let X=Date.now()+1,T={id:X,role:"assistant",kind:"text",content:""};m(N=>[...N,T]),Qa(X,"Thank you, your feedback is saved.");return}Pu(null),ye("thinking"),Le([]);let Y=!1;try{let X=new AbortController,T=setTimeout(()=>X.abort(),6e4),N=await fetch(`${i}/chat/stream`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:P,message:v,current_page:s||"dashboard",user_id:U.userId,user_name:U.userName,user_email:U.userEmail,user_organization:x,org_id:c}),signal:X.signal});if(clearTimeout(T),!N.ok)throw new Error(`Agent request failed: ${N.status}`);let b=N.body?.getReader();if(!b)throw new Error("No response body");let K=new TextDecoder,ae="";for(;;){let{done:W,value:pe}=await b.read();if(W)break;ae+=K.decode(pe,{stream:!0});let Je=ae.split(`
27
+ `)})},a.length)),o=!1,n=[],s=""):(l(),o=!0,s=d.slice(3).trim());continue}if(o){n.push(d);continue}let c=d.match(/^(#{1,6})\s+(.+)/);if(c){l();let x=c[1].length,w=i(c[2]),L=x===1?"text-lg font-bold my-1":x===2?"text-base font-bold my-1":"text-sm font-semibold my-1";a.push((0,p.jsx)("div",{className:L,children:w},a.length));continue}let f=d.match(/^[-*]\s+(.+)/);if(f){(!r||r.type!=="ul")&&(l(),r={type:"ul",items:[]}),r.items.push(i(f[1]));continue}let g=d.match(/^\d+[.)]\s+(.+)/);if(g){(!r||r.type!=="ol")&&(l(),r={type:"ol",items:[]}),r.items.push(i(g[1]));continue}if(d.trim()===""){l(),a.push((0,p.jsx)("div",{className:"h-2"},a.length));continue}if(d.match(/^[-*_]{3,}$/)){l(),a.push((0,p.jsx)("hr",{className:"my-2 border-gray-200"},a.length));continue}l(),a.push((0,p.jsx)("div",{children:i(d)},a.length))}return l(),(0,p.jsx)(p.Fragment,{children:a})}var SD=[{id:"changing-layouts",label:"Changing layouts",prompt:"How do I change the layout of my profiles or folders?",icon:"layout"},{id:"bulk-uploads",label:"Bulk uploads",prompt:"How do I bulk upload profiles using a CSV file?",icon:"upload"},{id:"example-setups",label:"Example setups",prompt:"Can you show me some example folder setups?",icon:"setup"}],dk=[{id:"customers",title:"Customer Management",topics:[{id:"add-customer",label:"Add a new customer",prompt:"How do I add a new customer to the system and what information is required?"},{id:"customer-details",label:"View customer details",prompt:"Show me how to view and edit customer information and their payment history."}]},{id:"payments",title:"Payment Processing",topics:[{id:"process-payment",label:"Process a payment",prompt:"How do I process a one-time payment for a customer?"},{id:"refund-payment",label:"Issue a refund",prompt:"Walk me through issuing a refund for a customer payment."}]},{id:"subscriptions",title:"Subscription Management",topics:[{id:"create-subscription",label:"Create a subscription",prompt:"How do I set up a new subscription plan for a customer?"},{id:"update-subscription",label:"Update subscription tier",prompt:"How can I change a customer's subscription plan or upgrade them?"}]},{id:"billing",title:"Billing",topics:[{id:"payment-methods",label:"Manage payment methods",prompt:"How do customers add or update their payment methods?"}]}],Py={"getting-started":{id:"getting-started",title:"Getting started",steps:[{text:"Step 1: Let's open the Customers page. This is where you'll manage all your customers - you can view, add, and edit customer information here.",navigation:{page:"customers"},cursorTarget:{selector:'[data-page="customers"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 2: Now let's open the Add customer dialog. This is where you'll enter information for your first customer, including their name, email, and other details.",navigation:{page:"customers"},cursorTarget:{selector:'[data-testid="add-customer-button"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 3: Let's open the Settings page. This is where you manage your account settings, company information, and preferences. We're going to verify your company address is correct.",navigation:{page:"settings",subtab:"general"},cursorTarget:{selector:'[data-page="settings"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 4: Here's the address field in the Company Information section. It's important to verify this address is accurate since it's used for billing and shipping purposes. Make sure it's up to date.",navigation:{page:"settings",subtab:"general"},cursorTarget:{selector:'[data-testid="company-address-input"]',offset:{x:0,y:0},onClick:!1}},{text:"Step 5: Let's open the API Keys tab. This section shows all your API keys - you'll need these to connect your application to our services. We're going to create a production API key.",navigation:{page:"settings",subtab:"api"},cursorTarget:{selector:'[data-settings-tab="api"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 6: Let's open the Create API Key dialog. Here you can create a new API key for your application. You'll want to give it a descriptive name like 'Production Key' so you can easily identify it later.",navigation:{page:"settings",subtab:"api"},cursorTarget:{selector:'[data-testid="create-api-key-button"]',offset:{x:0,y:0},onClick:!0}}]},"add-api-key":{id:"add-api-key",title:"How to add an API key",steps:[{text:"Step 1: Let's open the Settings page. This is where you manage your account settings and preferences. We need to go here to access the API Keys section.",navigation:{page:"settings",subtab:"general"},cursorTarget:{selector:'[data-page="settings"]',offset:{x:0,y:0},onClick:!1}},{text:"Step 2: Let's open the API Keys tab. This section shows all your API keys and allows you to create new ones. You'll need API keys to connect your application to our services.",navigation:{page:"settings",subtab:"api"},cursorTarget:{selector:'[data-settings-tab="api"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 3: Let's open the Create API Key dialog. This is where you'll create your new API key - you can give it a name to help you identify it later, then click Create to generate it.",navigation:{page:"settings",subtab:"api"},cursorTarget:{selector:'[data-testid="create-api-key-button"]',offset:{x:0,y:0},onClick:!0}}]},"refund-payment":{id:"refund-payment",title:"How to refund a payment",steps:[{text:"Step 1: Let's open the Home page. This is your dashboard where you can view today's activity, your payment overview, and recent transactions. We need to go here to find the payment you want to refund.",navigation:{page:"dashboard"},cursorTarget:{selector:'[data-page="dashboard"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 2: Scroll down to see the Recent transactions section at the bottom. This shows your latest payment transactions with their status. We're looking for a transaction with 'paid' status - only paid transactions can be refunded.",navigation:{page:"dashboard"},cursorTarget:{selector:'[data-testid="recent-activity-card"]',offset:{x:0,y:0},onClick:!1}},{text:"Step 3: Let's open the dropdown menu for this paid transaction. Each transaction has a menu button (three dots) that gives you options like refunding. Click it to see the available actions, including the 'Refund payment' option.",navigation:{page:"dashboard"},cursorTarget:{selector:'[data-testid="transaction-menu-button"]',offset:{x:0,y:0},onClick:!0}}]}},CD=[];function LD(){return(0,p.jsxs)("div",{className:"flex flex-col items-center justify-center h-full p-6",children:[(0,p.jsx)(Ft,{className:"h-8 w-8 animate-spin text-gray-400 mb-3"}),(0,p.jsx)("p",{className:"text-xs text-gray-500",children:"Verifying your identity..."})]})}function ID({error:e,onRetry:t}){return(0,p.jsxs)("div",{className:"flex flex-col items-center justify-center h-full p-6 text-center",children:[(0,p.jsx)("div",{className:"w-12 h-12 rounded-full bg-red-100 flex items-center justify-center mb-4",children:(0,p.jsx)(ro,{className:"h-6 w-6 text-red-600"})}),(0,p.jsx)("h3",{className:"text-sm font-semibold text-gray-900 mb-2",children:"Unable to Start Chat"}),(0,p.jsx)("p",{className:"text-xs text-gray-500 mb-4 max-w-[240px]",children:e}),(0,p.jsx)(ut,{variant:"secondary",size:"sm",onClick:t,className:"h-8 px-4 text-xs",children:"Try Again"})]})}function bD({isOpen:e=!0,onClose:t,onOpen:a,onBack:r,onNavigate:o,onActionComplete:n,currentPage:s,agentUrl:i=xD,startingQuestions:l,startingQuestionsEndpoint:u,userId:d,orgId:c,userName:f,userEmail:g,userOrganization:x,supabaseUrl:w,supabaseAnonKey:L,productBackendUrl:y}={}){let[h,m]=F.useState(CD),[C,I]=F.useState(""),[P,R]=F.useState(()=>crypto.randomUUID()),{authState:A,retry:q}=sk({productBackendUrl:y,sessionId:P,enabled:!!y}),B=F.useMemo(()=>A.status==="authenticated"?{userId:A.user.id,userName:A.user.name,userEmail:A.user.email,userRole:A.user.role,isInternal:A.user.isInternal}:{userId:d||"anonymous",userName:f||"Anonymous User",userEmail:g||"Not provided",userRole:void 0,isInternal:!1},[A,d,f,g]),[J,ue]=F.useState(!1),pt=F.useRef(null),[Xa,So]=F.useState(!1),Ke=F.useRef(null),xe=F.useRef(null),ze=F.useRef(null);F.useEffect(()=>{console.log(`[KiteChat] Chat Panel v${yD} loaded`)},[]);let Ht=F.useCallback(()=>{console.log("[KiteChat] resetSession called",{isEscalated:J,hasSupabase:!!Ke.current,sessionId:P}),J&&Ke.current&&P?(console.log("[KiteChat] Updating customer_status to disconnected for session:",P),Ke.current.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",P).then(v=>{console.log("[KiteChat] Disconnect update result:",v)},v=>{console.error("[KiteChat] Disconnect update failed:",v)})):console.log("[KiteChat] Skipping disconnect update - conditions not met"),R(crypto.randomUUID()),ue(!1),pt.current&&(pt.current.close(),pt.current=null),So(!1),xe.current&&(xe.current.unsubscribe(),xe.current=null)},[J,P]);F.useEffect(()=>{w&&L&&!Ke.current&&(Ke.current=FS(w,L))},[w,L]),F.useEffect(()=>{if(!J||!P||!Ke.current)return;let v=`typing:${P}`,k=Ke.current.channel(v);return console.log(`[KiteChat] Subscribing to typing channel: ${v}`),k.on("broadcast",{event:"typing"},O=>{console.log("[KiteChat] Received typing broadcast:",O);let{sender:D,isTyping:E}=O.payload;D==="agent"&&(console.log(`[KiteChat] Agent typing: ${E}`),So(E),E&&(ze.current&&window.clearTimeout(ze.current),ze.current=window.setTimeout(()=>{So(!1)},5e3)))}).subscribe(O=>{console.log(`[KiteChat] Typing channel status: ${O}`),O==="SUBSCRIBED"&&(xe.current=k,console.log("[KiteChat] Typing channel ready"))}),()=>{k.unsubscribe(),xe.current=null,ze.current&&window.clearTimeout(ze.current)}},[J,P]);let ma=F.useRef(null),Xe=F.useCallback(async v=>{if(!(!Ke.current||!P))try{await Ke.current.from("escalations").update({customer_status:v,customer_last_seen:new Date().toISOString()}).eq("session_id",P)}catch(k){console.error("[KiteChat] Failed to update customer status:",k)}},[P]);F.useEffect(()=>{if(!J||!P||!Ke.current)return;let v=P,k=Ke.current;Xe("active"),ma.current=window.setInterval(()=>{Xe("active")},6e4);let O=()=>{k.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",v)},D=()=>{document.visibilityState==="hidden"?k.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",v):document.visibilityState==="visible"&&Xe("active")};return window.addEventListener("beforeunload",O),document.addEventListener("visibilitychange",D),()=>{window.removeEventListener("beforeunload",O),document.removeEventListener("visibilitychange",D),k.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",v).then(()=>{console.log("[KiteChat] Marked customer as disconnected")},E=>{console.error("[KiteChat] Failed to mark disconnected:",E)}),ma.current&&(window.clearInterval(ma.current),ma.current=null)}},[J,P,Xe]);let ku=F.useCallback(v=>{if(!xe.current){console.log("[KiteChat] Cannot send typing - channel not ready");return}if(!J){console.log("[KiteChat] Cannot send typing - not escalated");return}console.log(`[KiteChat] Sending typing indicator: ${v}`),xe.current.send({type:"broadcast",event:"typing",payload:{sender:"user",isTyping:v}})},[J]),kn=F.useRef(null),pk=F.useCallback(()=>{!J||!Ke.current||(ku(!0),Xe("active"),kn.current&&window.clearTimeout(kn.current),kn.current=window.setTimeout(()=>{ku(!1)},1500))},[J,ku,Xe]),Pn=F.useRef({}),Ry=h.length===0,[Tn,ye]=F.useState("idle"),[mk,Le]=F.useState([]),br=F.useRef([]),hk=h.length?h[h.length-1].role:void 0,[pp,Co]=F.useState("landing"),[_y,Lo]=F.useState(void 0),[gk,Ey]=F.useState(l||SD),[yk,Dy]=F.useState(!1);F.useEffect(()=>{u&&!l&&(Dy(!0),fetch(u).then(v=>v.json()).then(v=>{Array.isArray(v)&&v.length>0&&Ey(v)}).catch(v=>{console.warn("[KiteChat] Failed to fetch starting questions:",v)}).finally(()=>Dy(!1)))},[u,l]),F.useEffect(()=>{l&&Ey(l)},[l]);let[he,kr]=F.useState(void 0),Me=F.useRef(void 0),My=F.useRef(null),[Li,Ii]=F.useState(!1);F.useEffect(()=>{window.resetIntegrationNotification=()=>{localStorage.removeItem("gmailNotificationSeen"),console.log("Integration notification reset! Click the Integrations tab to see it again.")};let v=()=>{if(!localStorage.getItem("gmailNotificationSeen")){Co("landing"),Lo(void 0);let O=Date.now(),D="I see you're exploring integrations. Let me know if there are any other connections we should add.",E={id:O,role:"assistant",kind:"text",content:"",isNotificationMessage:!0};m(Y=>[...Y,E]),Qa(O,D),localStorage.setItem("gmailNotificationSeen","true")}};return window.addEventListener("integrationTabClicked",v),()=>{window.removeEventListener("integrationTabClicked",v)}},[]),F.useEffect(()=>{he?(!Me.current||Me.current.id!==he.id||Me.current.stepIndex!==he.stepIndex)&&(Me.current=he):Me.current=void 0},[he]);let[bi,Pu]=F.useState(null),[Qe,mp]=F.useState(null),[ne,se]=F.useState({}),Ny=F.useRef(null),hp=F.useRef(null),Tu=F.useRef(null),{cursorState:Au,moveTo:Io,hide:An}=nk(),[bo,gp]=F.useState(null),[Oy,Pr]=F.useState(null),yp=F.useRef(null),Rn=F.useRef(null),[Fy,ki]=F.useState(!1),[_n,Ru]=F.useState(""),By=F.useRef(null);F.useEffect(()=>{if(!he||he.id!=="add-api-key"||he.stepIndex!==2)return;let k=setInterval(()=>{let O=document.querySelector('[role="dialog"]'),D=Me.current;if(O&&D&&D.id==="add-api-key"&&D.stepIndex===2){An();let E=Date.now()+1;m(Y=>[...Y,{id:E,role:"assistant",kind:"guideComplete",content:"Perfect! The dialog is now open. You can enter a name and create your API key."}]),kr(void 0),Ii(!0)}},300);return()=>clearInterval(k)},[he,An]),F.useEffect(()=>()=>{Object.values(Pn.current).forEach(v=>window.clearInterval(v)),Pn.current={},br.current.forEach(v=>window.clearTimeout(v)),br.current=[]},[]),F.useEffect(()=>{if(he&&h.length>0){let v=h[h.length-1];if((v.kind==="guideStep"||v.kind==="guideComplete")&&Tu.current&&hp.current){let k=hp.current,O=Tu.current,D=k.getBoundingClientRect(),Y=O.getBoundingClientRect().top-D.top+k.scrollTop;k.scrollTop=Y}}else!he&&h.length>0&&Ny.current?.scrollIntoView({behavior:"smooth"})},[h,Tn,he]);let Uy=F.useMemo(()=>{for(let v=h.length-1;v>=0;v--){let k=h[v];if(k.kind==="bulkSummary"&&k.bulkSummary?.navigationPage&&k.bulkSummary.successes>0)return k.bulkSummary.navigationPage}return null},[h]);F.useEffect(()=>{My.current=Uy},[Uy]),F.useEffect(()=>{yp.current=Oy},[Oy]),F.useEffect(()=>{let v=k=>{if((k.metaKey||k.ctrlKey)&&k.key==="Enter"){let O=yp.current;if(O){k.preventDefault(),k.stopPropagation(),wp(O);return}if(Qe){k.preventDefault(),k.stopPropagation(),vp();return}if(bi){k.preventDefault(),k.stopPropagation(),xp(bi);return}let D=My.current;if(console.log("[DEBUG] Keyboard handler - latestBulkSummaryNavigation:",D,"onNavigate:",!!o),D&&o){console.log("[DEBUG] Navigating via keyboard to:",D.page),k.preventDefault(),k.stopPropagation(),o(D.page,D.subtab);return}if(Li){k.preventDefault(),k.stopPropagation(),jy();return}if(Me.current){k.preventDefault(),k.stopPropagation(),Sp();return}}};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[Qe,bi,he,Li,o]);let Vy=F.useCallback(v=>{if(!i)return;pt.current&&pt.current.close();let k=i.replace(/^http/,"ws")+`/ws/escalation/${v}`,O=new WebSocket(k);O.onmessage=D=>{try{let E=JSON.parse(D.data);E.type==="agent_message"?m(Y=>{let X=E.content,T=E.message_id;return(T?Y.some(b=>b.serverMessageId===T):Y.slice(-5).some(b=>b.content===X))?(console.debug("[KiteChat] Skipping duplicate agent message:",T||X.slice(0,30)),Y):[...Y,{id:Date.now(),role:"agent",kind:"text",content:X,serverMessageId:T}]}):E.type==="error"&&console.error("[KiteChat] Escalation error:",E.message)}catch(E){console.error("[KiteChat] Failed to parse escalation message:",E)}},O.onerror=D=>{console.error("[KiteChat] Escalation WebSocket error:",D)},O.onclose=()=>{console.log("[KiteChat] Escalation WebSocket closed")},pt.current=O},[i]),xk=F.useCallback(async v=>{if(!pt.current||pt.current.readyState!==WebSocket.OPEN)return console.error("[KiteChat] Escalation WebSocket not connected"),!1;try{return pt.current.send(JSON.stringify({type:"user_message",content:v})),Xe("active"),!0}catch(k){return console.error("[KiteChat] Failed to send escalated message:",k),!1}},[Xe]);F.useEffect(()=>()=>{pt.current&&pt.current.close()},[]),F.useEffect(()=>{J&&P&&Vy(P)},[J,P,Vy]);function Qa(v,k,O){let D=k||"",E=O;if(k&&k.startsWith("{")&&k.includes('"response"'))try{let N=0,b=0;for(let W=0;W<k.length;W++)if(k[W]==="{")N++;else if(k[W]==="}"&&(N--,N===0)){b=W+1;break}let K=b>0?k.slice(0,b):k,ae=JSON.parse(K);ae.response&&typeof ae.response=="string"&&(D=ae.response,!E&&ae.followups&&(E=ae.followups))}catch{}D=vD(D);let Y=D.split(" "),X=0,T=window.setInterval(()=>{X+=1,m(N=>N.map(b=>b.id===v?{...b,content:Y.slice(0,X).join(" ")}:b)),X>=Y.length&&(window.clearInterval(T),delete Pn.current[v],E&&E.length>0&&m(N=>N.map(b=>b.id===v?{...b,followups:E}:b)),ye("idle"))},25);Pn.current[v]=T}function vk(v,k){m(O=>O.map(D=>D.id===v?{...D,followupSelected:!0}:D)),_u(k.label)}function jy(){Object.values(Pn.current).forEach(v=>window.clearInterval(v)),Pn.current={},br.current.forEach(v=>window.clearTimeout(v)),br.current=[],An(),Ht(),m([]),I(""),ye("idle"),Co("landing"),Lo(void 0),kr(void 0),Ii(!1),Pu(null),mp(null),se({}),r&&r()}function RD(v){Co("folder"),Lo(v)}function wk(){Co("landing"),Lo(void 0)}function Sk(v){v.preventDefault();let k=C.trim();if(bo){if(!k){let O={id:Date.now(),role:"assistant",kind:"text",content:"Please describe what you'd like to do with this CSV file. For example: 'Create customers from this file' or 'Add these subscriptions'."};m(D=>[...D,O]);return}Lk(k,bo),I(""),gp(null),Rn.current&&(Rn.current.value="");return}if(k){if(J){let O={id:Date.now(),role:"user",content:k};m(D=>[...D,O]),xk(k),ku(!1),kn.current&&(window.clearTimeout(kn.current),kn.current=null),I("");return}_u(k),I("")}}function Ck(v){let k={dashboard:"dashboard",customers:"customers page",payments:"payments page",settings:"settings page",support:"support page",disputes:"disputes page",radar:"radar page"};if(v.page==="settings"&&v.subtab){let O={general:"General",billing:"Billing",security:"Security",api:"API Keys",notifications:"Notifications",integrations:"Integrations"};return`${k.settings} (${O[v.subtab]} tab)`}return k[v.page]}function xp(v){o&&o(v.page,v.subtab),Pu(null),m(k=>k.map(O=>O.kind==="navigationAction"&&O.navigationTarget?.page===v.page&&O.navigationTarget?.subtab===v.subtab?{...O,navigationTarget:void 0}:O))}function vp(){if(!Qe)return;let v=ne;if(Qe.type!=="updateCompanyInfo"){if(Qe.type==="addApiKey"){let k=v;if(!k.name||!k.name.trim())return}else if(Qe.type==="addCustomer"){let k=v;if(!k.name||!k.name.trim()||!k.email||!k.email.trim())return}else if(Qe.type==="changePassword"){let k=v;if(!k.currentPassword||!k.newPassword||!k.confirmPassword||k.newPassword!==k.confirmPassword)return}else if(Qe.type==="addWebhook"){let k=v;if(!k.url||!k.url.trim())return}else if(Qe.type==="addPaymentMethod"){let k=v;if(!k.cardNumber||!k.expiryDate)return}else if(Qe.type==="deleteApiKey"){let k=v;if(!k.keyId&&!k.name)return}else if(Qe.type==="refundPayment"){let k=v;if(!k.transactionId&&!k.customer)return}else if(Qe.type==="createSubscription"){let k=v;if(!k.customerEmail&&!k.customerId)return}else if((Qe.type==="toggleBlockRule"||Qe.type==="enableBlockRule"||Qe.type==="disableBlockRule")&&!v.ruleId)return}n&&n(Qe.type,v),m(k=>k.map(O=>O.kind==="actionForm"&&O.actionType===Qe.type?{...O,isSubmitted:!0}:O)),mp(null),se({})}async function _u(v){br.current.forEach(X=>window.clearTimeout(X)),br.current=[];let O=[...h].reverse().find(X=>X.role==="assistant")?.isNotificationMessage===!0,D=Date.now(),E={id:D,role:"user",content:v};if(m(X=>X.map(T=>T.followups&&T.followups.length>0?{...T,followupSelected:!0}:T).concat(E)),O){let X=Date.now()+1,T={id:X,role:"assistant",kind:"text",content:""};m(N=>[...N,T]),Qa(X,"Thank you, your feedback is saved.");return}Pu(null),ye("thinking"),Le([]);let Y=!1;try{let X=new AbortController,T=setTimeout(()=>X.abort(),6e4);console.log("[ChatPanel] Sending chat request to agent backend..."),console.log("[ChatPanel] Agent URL:",i),console.log("[ChatPanel] User data being sent:"),console.log("[ChatPanel] user_id:",B.userId),console.log("[ChatPanel] user_name:",B.userName),console.log("[ChatPanel] user_email:",B.userEmail),console.log("[ChatPanel] user_organization:",x),console.log("[ChatPanel] org_id:",c),console.log("[ChatPanel] authState.status:",A.status);let N=await fetch(`${i}/chat/stream`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:P,message:v,current_page:s||"dashboard",user_id:B.userId,user_name:B.userName,user_email:B.userEmail,user_organization:x,org_id:c}),signal:X.signal});if(clearTimeout(T),!N.ok)throw new Error(`Agent request failed: ${N.status}`);let b=N.body?.getReader();if(!b)throw new Error("No response body");let K=new TextDecoder,ae="";for(;;){let{done:W,value:pe}=await b.read();if(W)break;ae+=K.decode(pe,{stream:!0});let Je=ae.split(`
28
28
 
29
29
  `);ae=Je.pop()||"";for(let mt of Je){if(!mt.trim())continue;let Ja=mt.split(`
30
30
  `),Ye="",ha="";for(let z of Ja)z.startsWith("event: ")?Ye=z.slice(7):z.startsWith("data: ")&&(ha=z.slice(6));if(!(!Ye||!ha))try{let z=JSON.parse(ha);if(Ye==="progress")z.status==="thinking"?(ye("thinking"),Le([{message:z.message,completed:!1}])):z.status==="searching"?(ye("thinking"),Le([{message:z.message||"Searching knowledge base...",completed:!1}])):z.status==="evaluating"?(ye("thinking"),Le([{message:z.message||"Evaluating sources...",completed:!1}])):z.status==="executing"?(ye("executing"),Le(j=>{let re=j.map(At=>({...At,completed:!0})),ce=re[re.length-1];return(!ce||ce.message!==z.message)&&re.push({message:z.message,completed:!1}),re})):z.status==="responding"&&(ye("responding"),Le(j=>j.map(re=>({...re,completed:!0}))));else if(Ye==="response"){Le([]),Y=!0;let j=z;if(j.action==="navigate"&&j.navigation){let re={page:j.navigation.page,subtab:j.navigation.subtab};Pu(re);let ce={id:D+1,role:"assistant",kind:"navigationAction",content:j.response||`I can take you to the ${Ck(re)}.`,navigationTarget:re};m(At=>[...At,ce]),ye("idle")}else if(j.action==="show_form"&&j.actionType){mp({type:j.actionType,data:j.actionData||{}}),se(j.actionData||{});let re={id:D+1,role:"assistant",kind:"actionForm",content:j.response||j.message||"Please fill in the details below:",actionType:j.actionType,actionData:j.actionData||{}};m(ce=>[...ce,re]),ye("idle")}else if(j.action==="suggest_bulk"){let re=D+1,ce={id:re,role:"assistant",kind:"text",content:""};m(At=>[...At,ce]),Qa(re,j.response||j.message||"For bulk operations, you can upload a CSV file - just click the \u{1F4CE} button!",j.followups),Y=!0}else if(j.action==="bulk_preview"){Pr(j.bulk_session_id);let re={id:D+1,role:"assistant",kind:"bulkPreview",content:j.message||`I found ${j.csv_data?.rowCount||0} items. Here's a preview:`,csvData:j.csv_data?{rowCount:j.csv_data.rowCount,columns:j.csv_data.columns,sampleRows:j.csv_data.sampleRows,fileName:"From context"}:void 0,suggestedAction:j.suggested_action,bulkSessionId:j.bulk_session_id};m(ce=>[...ce,re]),ye("idle"),Y=!0}else if(j.action==="execute"&&j.executionResult){let re=D+1,ce={id:re,role:"assistant",kind:"text",content:"",structuredData:j.structuredData||void 0};m(At=>[...At,ce]),Qa(re,j.response||"Action completed successfully.",j.followups),Y=!0,setTimeout(()=>{window.dispatchEvent(new CustomEvent("agentActionComplete",{detail:{result:j.executionResult}}))},100)}else{let re=D+1,ce={id:re,role:"assistant",kind:"text",content:""};m(At=>[...At,ce]),Qa(re,j.response||j.message||"",j.followups),Y=!0}}else if(Ye==="error"){ye("idle"),Le([]),Y=!0;let j=D+1,re={id:j,role:"assistant",kind:"text",content:""};m(ce=>[...ce,re]),Qa(j,z.message||"An error occurred processing your request.")}else if(Ye==="done")Le([]),ye("idle"),Y=!0;else if(Ye==="escalation"){ue(!0),ye("idle");let re={id:Date.now()+2,role:"assistant",kind:"text",content:z.message||"You've been connected to our support queue. An agent will be with you shortly."};m(ce=>[...ce,re])}}catch(z){console.error("Failed to parse SSE event:",z)}}}Le([]),Y||ye("idle")}catch(X){console.error("Agent request failed:",X),Le([]);let T=D+1,N={id:T,role:"assistant",kind:"text",content:""};m(K=>[...K,N]);let b="I'm having trouble connecting to my backend.";X instanceof Error&&(X.name==="AbortError"?b="The request timed out. The server might be busy - please try again.":X.message.includes("Failed to fetch")||X.message.includes("NetworkError")?b="I'm having trouble connecting to my backend. Please make sure the agent server is running on port 5002.":X.message.includes("Agent request failed:")&&(b="The server encountered an error. Please try again.")),b+=" For simple navigation requests, I can still help you locally.",Qa(T,b)}finally{Le([])}}async function Lk(v,k){br.current.forEach(E=>window.clearTimeout(E)),br.current=[];let O=Date.now(),D={id:O,role:"user",content:`\u{1F4CE} ${k.name}