@mcpjam/inspector 1.0.6 → 1.0.8
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"
|
|
1
|
+
(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"47e45860a657066dfa3cc68697618d6664ff4a28"}}catch{}})();try{(function(){var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="c0fa5fd7-3c6a-4f3c-ad8e-c08092eb55b1",t._sentryDebugIdIdentifier="sentry-dbid-c0fa5fd7-3c6a-4f3c-ad8e-c08092eb55b1")})()}catch{}function XK(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in t)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();function Vf(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var fS={exports:{}},cp={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -38,15 +38,15 @@
|
|
|
38
38
|
*
|
|
39
39
|
* This source code is licensed under the MIT license found in the
|
|
40
40
|
* LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/var _P;function rX(){if(_P)return up;_P=1;var t=tX(),e=Bx(),n=Az();function r(o){var c="https://react.dev/errors/"+o;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)c+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+o+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function i(o){var c=o,m=o;if(o.alternate)for(;c.return;)c=c.return;else{o=c;do c=o,(c.flags&4098)!==0&&(m=c.return),o=c.return;while(o)}return c.tag===3?m:null}function a(o){if(o.tag===13){var c=o.memoizedState;if(c===null&&(o=o.alternate,o!==null&&(c=o.memoizedState)),c!==null)return c.dehydrated}return null}function l(o){if(i(o)!==o)throw Error(r(188))}function u(o){var c=o.alternate;if(!c){if(c=i(o),c===null)throw Error(r(188));return c!==o?null:o}for(var m=o,y=c;;){var _=m.return;if(_===null)break;var C=_.alternate;if(C===null){if(y=_.return,y!==null){m=y;continue}break}if(_.child===C.child){for(C=_.child;C;){if(C===m)return l(_),o;if(C===y)return l(_),c;C=C.sibling}throw Error(r(188))}if(m.return!==y.return)m=_,y=C;else{for(var $=!1,q=_.child;q;){if(q===m){$=!0,m=_,y=C;break}if(q===y){$=!0,y=_,m=C;break}q=q.sibling}if(!$){for(q=C.child;q;){if(q===m){$=!0,m=C,y=_;break}if(q===y){$=!0,y=C,m=_;break}q=q.sibling}if(!$)throw Error(r(189))}}if(m.alternate!==y)throw Error(r(190))}if(m.tag!==3)throw Error(r(188));return m.stateNode.current===m?o:c}function d(o){var c=o.tag;if(c===5||c===26||c===27||c===6)return o;for(o=o.child;o!==null;){if(c=d(o),c!==null)return c;o=o.sibling}return null}var p=Object.assign,h=Symbol.for("react.element"),g=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),S=Symbol.for("react.provider"),k=Symbol.for("react.consumer"),T=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),O=Symbol.for("react.memo_cache_sentinel"),L=Symbol.iterator;function z(o){return o===null||typeof o!="object"?null:(o=L&&o[L]||o["@@iterator"],typeof o=="function"?o:null)}var G=Symbol.for("react.client.reference");function W(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===G?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case b:return"Fragment";case E:return"Profiler";case x:return"StrictMode";case j:return"Suspense";case A:return"SuspenseList";case I:return"Activity"}if(typeof o=="object")switch(o.$$typeof){case v:return"Portal";case T:return(o.displayName||"Context")+".Provider";case k:return(o._context.displayName||"Context")+".Consumer";case R:var c=o.render;return o=o.displayName,o||(o=c.displayName||c.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case N:return c=o.displayName||null,c!==null?c:W(o.type)||"Memo";case M:c=o._payload,o=o._init;try{return W(o(c))}catch{}}return null}var X=Array.isArray,F=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H={pending:!1,data:null,method:null,action:null},te=[],P=-1;function re(o){return{current:o}}function ue(o){0>P||(o.current=te[P],te[P]=null,P--)}function D(o,c){P++,te[P]=o.current,o.current=c}var Z=re(null),he=re(null),V=re(null),U=re(null);function K(o,c){switch(D(V,c),D(he,o),D(Z,null),c.nodeType){case 9:case 11:o=(o=c.documentElement)&&(o=o.namespaceURI)?UO(o):0;break;default:if(o=c.tagName,c=c.namespaceURI)c=UO(c),o=BO(c,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}ue(Z),D(Z,o)}function ae(){ue(Z),ue(he),ue(V)}function B(o){o.memoizedState!==null&&D(U,o);var c=Z.current,m=BO(c,o.type);c!==m&&(D(he,o),D(Z,m))}function J(o){he.current===o&&(ue(Z),ue(he)),U.current===o&&(ue(U),sp._currentValue=H)}var oe=Object.prototype.hasOwnProperty,fe=t.unstable_scheduleCallback,be=t.unstable_cancelCallback,Ae=t.unstable_shouldYield,Oe=t.unstable_requestPaint,Ne=t.unstable_now,Qe=t.unstable_getCurrentPriorityLevel,dt=t.unstable_ImmediatePriority,Be=t.unstable_UserBlockingPriority,pt=t.unstable_NormalPriority,De=t.unstable_LowPriority,et=t.unstable_IdlePriority,ot=t.log,lr=t.unstable_setDisableYieldValue,xe=null,Te=null;function st(o){if(typeof ot=="function"&&lr(o),Te&&typeof Te.setStrictMode=="function")try{Te.setStrictMode(xe,o)}catch{}}var qe=Math.clz32?Math.clz32:Zn,At=Math.log,Jn=Math.LN2;function Zn(o){return o>>>=0,o===0?32:31-(At(o)/Jn|0)|0}var Pe=256,bt=4194304;function Xt(o){var c=o&42;if(c!==0)return c;switch(o&-o){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:return 64;case 128:return 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 o&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function vt(o,c,m){var y=o.pendingLanes;if(y===0)return 0;var _=0,C=o.suspendedLanes,$=o.pingedLanes;o=o.warmLanes;var q=y&134217727;return q!==0?(y=q&~C,y!==0?_=Xt(y):($&=q,$!==0?_=Xt($):m||(m=q&~o,m!==0&&(_=Xt(m))))):(q=y&~C,q!==0?_=Xt(q):$!==0?_=Xt($):m||(m=y&~o,m!==0&&(_=Xt(m)))),_===0?0:c!==0&&c!==_&&(c&C)===0&&(C=_&-_,m=c&-c,C>=m||C===32&&(m&4194048)!==0)?c:_}function Qt(o,c){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&c)===0}function cr(o,c){switch(o){case 1:case 2:case 4:case 8:case 64:return c+250;case 16:case 32: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 c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function br(){var o=Pe;return Pe<<=1,(Pe&4194048)===0&&(Pe=256),o}function Yo(){var o=bt;return bt<<=1,(bt&62914560)===0&&(bt=4194304),o}function pc(o){for(var c=[],m=0;31>m;m++)c.push(o);return c}function fa(o,c){o.pendingLanes|=c,c!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function Du(o,c,m,y,_,C){var $=o.pendingLanes;o.pendingLanes=m,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=m,o.entangledLanes&=m,o.errorRecoveryDisabledLanes&=m,o.shellSuspendCounter=0;var q=o.entanglements,ee=o.expirationTimes,de=o.hiddenUpdates;for(m=$&~m;0<m;){var we=31-qe(m),ke=1<<we;q[we]=0,ee[we]=-1;var pe=de[we];if(pe!==null)for(de[we]=null,we=0;we<pe.length;we++){var ge=pe[we];ge!==null&&(ge.lane&=-536870913)}m&=~ke}y!==0&&ft(o,y,0),C!==0&&_===0&&o.tag!==0&&(o.suspendedLanes|=C&~($&~c))}function ft(o,c,m){o.pendingLanes|=c,o.suspendedLanes&=~c;var y=31-qe(c);o.entangledLanes|=c,o.entanglements[y]=o.entanglements[y]|1073741824|m&4194090}function Ln(o,c){var m=o.entangledLanes|=c;for(o=o.entanglements;m;){var y=31-qe(m),_=1<<y;_&c|o[y]&c&&(o[y]|=c),m&=~_}}function $n(o){switch(o){case 2:o=1;break;case 8:o=4;break;case 32:o=16;break;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:o=128;break;case 268435456:o=134217728;break;default:o=0}return o}function xr(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function $i(){var o=Y.p;return o!==0?o:(o=window.event,o===void 0?32:oP(o.type))}function Vn(o,c){var m=Y.p;try{return Y.p=o,c()}finally{Y.p=m}}var zn=Math.random().toString(36).slice(2),Rn="__reactFiber$"+zn,fn="__reactProps$"+zn,er="__reactContainer$"+zn,ne="__reactEvents$"+zn,Q="__reactListeners$"+zn,se="__reactHandles$"+zn,ye="__reactResources$"+zn,me="__reactMarker$"+zn;function nt(o){delete o[Rn],delete o[fn],delete o[ne],delete o[Q],delete o[se]}function tt(o){var c=o[Rn];if(c)return c;for(var m=o.parentNode;m;){if(c=m[er]||m[Rn]){if(m=c.alternate,c.child!==null||m!==null&&m.child!==null)for(o=GO(o);o!==null;){if(m=o[Rn])return m;o=GO(o)}return c}o=m,m=o.parentNode}return null}function Mt(o){if(o=o[Rn]||o[er]){var c=o.tag;if(c===5||c===6||c===13||c===26||c===27||c===3)return o}return null}function sn(o){var c=o.tag;if(c===5||c===26||c===27||c===6)return o.stateNode;throw Error(r(33))}function hn(o){var c=o[ye];return c||(c=o[ye]={hoistableStyles:new Map,hoistableScripts:new Map}),c}function at(o){o[me]=!0}var ln=new Set,jn={};function lt(o,c){an(o,c),an(o+"Capture",c)}function an(o,c){for(jn[o]=c,o=0;o<c.length;o++)ln.add(c[o])}var Hn=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),yn={},zi={};function oi(o){return oe.call(zi,o)?!0:oe.call(yn,o)?!1:Hn.test(o)?zi[o]=!0:(yn[o]=!0,!1)}function as(o,c,m){if(oi(c))if(m===null)o.removeAttribute(c);else{switch(typeof m){case"undefined":case"function":case"symbol":o.removeAttribute(c);return;case"boolean":var y=c.toLowerCase().slice(0,5);if(y!=="data-"&&y!=="aria-"){o.removeAttribute(c);return}}o.setAttribute(c,""+m)}}function Fi(o,c,m){if(m===null)o.removeAttribute(c);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(c);return}o.setAttribute(c,""+m)}}function zr(o,c,m,y){if(y===null)o.removeAttribute(m);else{switch(typeof y){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(m);return}o.setAttributeNS(c,m,""+y)}}var Qr,zs;function bs(o){if(Qr===void 0)try{throw Error()}catch(m){var c=m.stack.trim().match(/\n( *(at )?)/);Qr=c&&c[1]||"",zs=-1<m.stack.indexOf(`
|
|
41
|
+
*/var _P;function rX(){if(_P)return up;_P=1;var t=tX(),e=Bx(),n=Az();function r(o){var c="https://react.dev/errors/"+o;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)c+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+o+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function i(o){var c=o,m=o;if(o.alternate)for(;c.return;)c=c.return;else{o=c;do c=o,(c.flags&4098)!==0&&(m=c.return),o=c.return;while(o)}return c.tag===3?m:null}function a(o){if(o.tag===13){var c=o.memoizedState;if(c===null&&(o=o.alternate,o!==null&&(c=o.memoizedState)),c!==null)return c.dehydrated}return null}function l(o){if(i(o)!==o)throw Error(r(188))}function u(o){var c=o.alternate;if(!c){if(c=i(o),c===null)throw Error(r(188));return c!==o?null:o}for(var m=o,y=c;;){var _=m.return;if(_===null)break;var C=_.alternate;if(C===null){if(y=_.return,y!==null){m=y;continue}break}if(_.child===C.child){for(C=_.child;C;){if(C===m)return l(_),o;if(C===y)return l(_),c;C=C.sibling}throw Error(r(188))}if(m.return!==y.return)m=_,y=C;else{for(var $=!1,q=_.child;q;){if(q===m){$=!0,m=_,y=C;break}if(q===y){$=!0,y=_,m=C;break}q=q.sibling}if(!$){for(q=C.child;q;){if(q===m){$=!0,m=C,y=_;break}if(q===y){$=!0,y=C,m=_;break}q=q.sibling}if(!$)throw Error(r(189))}}if(m.alternate!==y)throw Error(r(190))}if(m.tag!==3)throw Error(r(188));return m.stateNode.current===m?o:c}function d(o){var c=o.tag;if(c===5||c===26||c===27||c===6)return o;for(o=o.child;o!==null;){if(c=d(o),c!==null)return c;o=o.sibling}return null}var p=Object.assign,h=Symbol.for("react.element"),g=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),S=Symbol.for("react.provider"),k=Symbol.for("react.consumer"),T=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),O=Symbol.for("react.memo_cache_sentinel"),L=Symbol.iterator;function z(o){return o===null||typeof o!="object"?null:(o=L&&o[L]||o["@@iterator"],typeof o=="function"?o:null)}var G=Symbol.for("react.client.reference");function W(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===G?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case b:return"Fragment";case E:return"Profiler";case x:return"StrictMode";case j:return"Suspense";case A:return"SuspenseList";case I:return"Activity"}if(typeof o=="object")switch(o.$$typeof){case v:return"Portal";case T:return(o.displayName||"Context")+".Provider";case k:return(o._context.displayName||"Context")+".Consumer";case R:var c=o.render;return o=o.displayName,o||(o=c.displayName||c.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case N:return c=o.displayName||null,c!==null?c:W(o.type)||"Memo";case M:c=o._payload,o=o._init;try{return W(o(c))}catch{}}return null}var X=Array.isArray,F=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H={pending:!1,data:null,method:null,action:null},te=[],P=-1;function re(o){return{current:o}}function ue(o){0>P||(o.current=te[P],te[P]=null,P--)}function D(o,c){P++,te[P]=o.current,o.current=c}var Z=re(null),he=re(null),V=re(null),U=re(null);function K(o,c){switch(D(V,c),D(he,o),D(Z,null),c.nodeType){case 9:case 11:o=(o=c.documentElement)&&(o=o.namespaceURI)?U2(o):0;break;default:if(o=c.tagName,c=c.namespaceURI)c=U2(c),o=B2(c,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}ue(Z),D(Z,o)}function ae(){ue(Z),ue(he),ue(V)}function B(o){o.memoizedState!==null&&D(U,o);var c=Z.current,m=B2(c,o.type);c!==m&&(D(he,o),D(Z,m))}function J(o){he.current===o&&(ue(Z),ue(he)),U.current===o&&(ue(U),sp._currentValue=H)}var oe=Object.prototype.hasOwnProperty,fe=t.unstable_scheduleCallback,be=t.unstable_cancelCallback,Ae=t.unstable_shouldYield,Oe=t.unstable_requestPaint,Ne=t.unstable_now,Qe=t.unstable_getCurrentPriorityLevel,dt=t.unstable_ImmediatePriority,Be=t.unstable_UserBlockingPriority,pt=t.unstable_NormalPriority,De=t.unstable_LowPriority,et=t.unstable_IdlePriority,ot=t.log,lr=t.unstable_setDisableYieldValue,xe=null,Te=null;function st(o){if(typeof ot=="function"&&lr(o),Te&&typeof Te.setStrictMode=="function")try{Te.setStrictMode(xe,o)}catch{}}var qe=Math.clz32?Math.clz32:Zn,At=Math.log,Jn=Math.LN2;function Zn(o){return o>>>=0,o===0?32:31-(At(o)/Jn|0)|0}var Pe=256,bt=4194304;function Xt(o){var c=o&42;if(c!==0)return c;switch(o&-o){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:return 64;case 128:return 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 o&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function vt(o,c,m){var y=o.pendingLanes;if(y===0)return 0;var _=0,C=o.suspendedLanes,$=o.pingedLanes;o=o.warmLanes;var q=y&134217727;return q!==0?(y=q&~C,y!==0?_=Xt(y):($&=q,$!==0?_=Xt($):m||(m=q&~o,m!==0&&(_=Xt(m))))):(q=y&~C,q!==0?_=Xt(q):$!==0?_=Xt($):m||(m=y&~o,m!==0&&(_=Xt(m)))),_===0?0:c!==0&&c!==_&&(c&C)===0&&(C=_&-_,m=c&-c,C>=m||C===32&&(m&4194048)!==0)?c:_}function Qt(o,c){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&c)===0}function cr(o,c){switch(o){case 1:case 2:case 4:case 8:case 64:return c+250;case 16:case 32: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 c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function br(){var o=Pe;return Pe<<=1,(Pe&4194048)===0&&(Pe=256),o}function Yo(){var o=bt;return bt<<=1,(bt&62914560)===0&&(bt=4194304),o}function pc(o){for(var c=[],m=0;31>m;m++)c.push(o);return c}function fa(o,c){o.pendingLanes|=c,c!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function Du(o,c,m,y,_,C){var $=o.pendingLanes;o.pendingLanes=m,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=m,o.entangledLanes&=m,o.errorRecoveryDisabledLanes&=m,o.shellSuspendCounter=0;var q=o.entanglements,ee=o.expirationTimes,de=o.hiddenUpdates;for(m=$&~m;0<m;){var we=31-qe(m),ke=1<<we;q[we]=0,ee[we]=-1;var pe=de[we];if(pe!==null)for(de[we]=null,we=0;we<pe.length;we++){var ge=pe[we];ge!==null&&(ge.lane&=-536870913)}m&=~ke}y!==0&&ft(o,y,0),C!==0&&_===0&&o.tag!==0&&(o.suspendedLanes|=C&~($&~c))}function ft(o,c,m){o.pendingLanes|=c,o.suspendedLanes&=~c;var y=31-qe(c);o.entangledLanes|=c,o.entanglements[y]=o.entanglements[y]|1073741824|m&4194090}function Ln(o,c){var m=o.entangledLanes|=c;for(o=o.entanglements;m;){var y=31-qe(m),_=1<<y;_&c|o[y]&c&&(o[y]|=c),m&=~_}}function $n(o){switch(o){case 2:o=1;break;case 8:o=4;break;case 32:o=16;break;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:o=128;break;case 268435456:o=134217728;break;default:o=0}return o}function xr(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function $i(){var o=Y.p;return o!==0?o:(o=window.event,o===void 0?32:oP(o.type))}function Vn(o,c){var m=Y.p;try{return Y.p=o,c()}finally{Y.p=m}}var zn=Math.random().toString(36).slice(2),Rn="__reactFiber$"+zn,fn="__reactProps$"+zn,er="__reactContainer$"+zn,ne="__reactEvents$"+zn,Q="__reactListeners$"+zn,se="__reactHandles$"+zn,ye="__reactResources$"+zn,me="__reactMarker$"+zn;function nt(o){delete o[Rn],delete o[fn],delete o[ne],delete o[Q],delete o[se]}function tt(o){var c=o[Rn];if(c)return c;for(var m=o.parentNode;m;){if(c=m[er]||m[Rn]){if(m=c.alternate,c.child!==null||m!==null&&m.child!==null)for(o=G2(o);o!==null;){if(m=o[Rn])return m;o=G2(o)}return c}o=m,m=o.parentNode}return null}function Mt(o){if(o=o[Rn]||o[er]){var c=o.tag;if(c===5||c===6||c===13||c===26||c===27||c===3)return o}return null}function sn(o){var c=o.tag;if(c===5||c===26||c===27||c===6)return o.stateNode;throw Error(r(33))}function hn(o){var c=o[ye];return c||(c=o[ye]={hoistableStyles:new Map,hoistableScripts:new Map}),c}function at(o){o[me]=!0}var ln=new Set,jn={};function lt(o,c){an(o,c),an(o+"Capture",c)}function an(o,c){for(jn[o]=c,o=0;o<c.length;o++)ln.add(c[o])}var Hn=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),yn={},zi={};function oi(o){return oe.call(zi,o)?!0:oe.call(yn,o)?!1:Hn.test(o)?zi[o]=!0:(yn[o]=!0,!1)}function as(o,c,m){if(oi(c))if(m===null)o.removeAttribute(c);else{switch(typeof m){case"undefined":case"function":case"symbol":o.removeAttribute(c);return;case"boolean":var y=c.toLowerCase().slice(0,5);if(y!=="data-"&&y!=="aria-"){o.removeAttribute(c);return}}o.setAttribute(c,""+m)}}function Fi(o,c,m){if(m===null)o.removeAttribute(c);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(c);return}o.setAttribute(c,""+m)}}function zr(o,c,m,y){if(y===null)o.removeAttribute(m);else{switch(typeof y){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(m);return}o.setAttributeNS(c,m,""+y)}}var Qr,zs;function bs(o){if(Qr===void 0)try{throw Error()}catch(m){var c=m.stack.trim().match(/\n( *(at )?)/);Qr=c&&c[1]||"",zs=-1<m.stack.indexOf(`
|
|
42
42
|
at`)?" (<anonymous>)":-1<m.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
43
|
`+Qr+o+zs}var Fs=!1;function Qa(o,c){if(!o||Fs)return"";Fs=!0;var m=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var y={DetermineComponentFrameRoot:function(){try{if(c){var ke=function(){throw Error()};if(Object.defineProperty(ke.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ke,[])}catch(ge){var pe=ge}Reflect.construct(o,[],ke)}else{try{ke.call()}catch(ge){pe=ge}o.call(ke.prototype)}}else{try{throw Error()}catch(ge){pe=ge}(ke=o())&&typeof ke.catch=="function"&&ke.catch(function(){})}}catch(ge){if(ge&&pe&&typeof ge.stack=="string")return[ge.stack,pe.stack]}return[null,null]}};y.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var _=Object.getOwnPropertyDescriptor(y.DetermineComponentFrameRoot,"name");_&&_.configurable&&Object.defineProperty(y.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var C=y.DetermineComponentFrameRoot(),$=C[0],q=C[1];if($&&q){var ee=$.split(`
|
|
44
44
|
`),de=q.split(`
|
|
45
45
|
`);for(_=y=0;y<ee.length&&!ee[y].includes("DetermineComponentFrameRoot");)y++;for(;_<de.length&&!de[_].includes("DetermineComponentFrameRoot");)_++;if(y===ee.length||_===de.length)for(y=ee.length-1,_=de.length-1;1<=y&&0<=_&&ee[y]!==de[_];)_--;for(;1<=y&&0<=_;y--,_--)if(ee[y]!==de[_]){if(y!==1||_!==1)do if(y--,_--,0>_||ee[y]!==de[_]){var we=`
|
|
46
46
|
`+ee[y].replace(" at new "," at ");return o.displayName&&we.includes("<anonymous>")&&(we=we.replace("<anonymous>",o.displayName)),we}while(1<=y&&0<=_);break}}}finally{Fs=!1,Error.prepareStackTrace=m}return(m=o?o.displayName||o.name:"")?bs(m):""}function Fg(o){switch(o.tag){case 26:case 27:case 5:return bs(o.type);case 16:return bs("Lazy");case 13:return bs("Suspense");case 19:return bs("SuspenseList");case 0:case 15:return Qa(o.type,!1);case 11:return Qa(o.type.render,!1);case 1:return Qa(o.type,!0);case 31:return bs("Activity");default:return""}}function mh(o){try{var c="";do c+=Fg(o),o=o.return;while(o);return c}catch(m){return`
|
|
47
47
|
Error generating stack: `+m.message+`
|
|
48
|
-
`+m.stack}}function Fr(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function mc(o){var c=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function Lu(o){var c=mc(o)?"checked":"value",m=Object.getOwnPropertyDescriptor(o.constructor.prototype,c),y=""+o[c];if(!o.hasOwnProperty(c)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var _=m.get,C=m.set;return Object.defineProperty(o,c,{configurable:!0,get:function(){return _.call(this)},set:function($){y=""+$,C.call(this,$)}}),Object.defineProperty(o,c,{enumerable:m.enumerable}),{getValue:function(){return y},setValue:function($){y=""+$},stopTracking:function(){o._valueTracker=null,delete o[c]}}}}function gc(o){o._valueTracker||(o._valueTracker=Lu(o))}function gh(o){if(!o)return!1;var c=o._valueTracker;if(!c)return!0;var m=c.getValue(),y="";return o&&(y=mc(o)?o.checked?"true":"false":o.value),o=y,o!==m?(c.setValue(o),!0):!1}function ha(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}var GW=/[\n"\\]/g;function li(o){return o.replace(GW,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function c_(o,c,m,y,_,C,$,q){o.name="",$!=null&&typeof $!="function"&&typeof $!="symbol"&&typeof $!="boolean"?o.type=$:o.removeAttribute("type"),c!=null?$==="number"?(c===0&&o.value===""||o.value!=c)&&(o.value=""+Fr(c)):o.value!==""+Fr(c)&&(o.value=""+Fr(c)):$!=="submit"&&$!=="reset"||o.removeAttribute("value"),c!=null?u_(o,$,Fr(c)):m!=null?u_(o,$,Fr(m)):y!=null&&o.removeAttribute("value"),_==null&&C!=null&&(o.defaultChecked=!!C),_!=null&&(o.checked=_&&typeof _!="function"&&typeof _!="symbol"),q!=null&&typeof q!="function"&&typeof q!="symbol"&&typeof q!="boolean"?o.name=""+Fr(q):o.removeAttribute("name")}function $j(o,c,m,y,_,C,$,q){if(C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(o.type=C),c!=null||m!=null){if(!(C!=="submit"&&C!=="reset"||c!=null))return;m=m!=null?""+Fr(m):"",c=c!=null?""+Fr(c):m,q||c===o.value||(o.value=c),o.defaultValue=c}y=y??_,y=typeof y!="function"&&typeof y!="symbol"&&!!y,o.checked=q?o.checked:!!y,o.defaultChecked=!!y,$!=null&&typeof $!="function"&&typeof $!="symbol"&&typeof $!="boolean"&&(o.name=$)}function u_(o,c,m){c==="number"&&ha(o.ownerDocument)===o||o.defaultValue===""+m||(o.defaultValue=""+m)}function $u(o,c,m,y){if(o=o.options,c){c={};for(var _=0;_<m.length;_++)c["$"+m[_]]=!0;for(m=0;m<o.length;m++)_=c.hasOwnProperty("$"+o[m].value),o[m].selected!==_&&(o[m].selected=_),_&&y&&(o[m].defaultSelected=!0)}else{for(m=""+Fr(m),c=null,_=0;_<o.length;_++){if(o[_].value===m){o[_].selected=!0,y&&(o[_].defaultSelected=!0);return}c!==null||o[_].disabled||(c=o[_])}c!==null&&(c.selected=!0)}}function zj(o,c,m){if(c!=null&&(c=""+Fr(c),c!==o.value&&(o.value=c),m==null)){o.defaultValue!==c&&(o.defaultValue=c);return}o.defaultValue=m!=null?""+Fr(m):""}function Fj(o,c,m,y){if(c==null){if(y!=null){if(m!=null)throw Error(r(92));if(X(y)){if(1<y.length)throw Error(r(93));y=y[0]}m=y}m==null&&(m=""),c=m}m=Fr(c),o.defaultValue=m,y=o.textContent,y===m&&y!==""&&y!==null&&(o.value=y)}function zu(o,c){if(c){var m=o.firstChild;if(m&&m===o.lastChild&&m.nodeType===3){m.nodeValue=c;return}}o.textContent=c}var WW=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Uj(o,c,m){var y=c.indexOf("--")===0;m==null||typeof m=="boolean"||m===""?y?o.setProperty(c,""):c==="float"?o.cssFloat="":o[c]="":y?o.setProperty(c,m):typeof m!="number"||m===0||WW.has(c)?c==="float"?o.cssFloat=m:o[c]=(""+m).trim():o[c]=m+"px"}function Bj(o,c,m){if(c!=null&&typeof c!="object")throw Error(r(62));if(o=o.style,m!=null){for(var y in m)!m.hasOwnProperty(y)||c!=null&&c.hasOwnProperty(y)||(y.indexOf("--")===0?o.setProperty(y,""):y==="float"?o.cssFloat="":o[y]="");for(var _ in c)y=c[_],c.hasOwnProperty(_)&&m[_]!==y&&Uj(o,_,y)}else for(var C in c)c.hasOwnProperty(C)&&Uj(o,C,c[C])}function d_(o){if(o.indexOf("-")===-1)return!1;switch(o){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 YW=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),KW=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ug(o){return KW.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}var f_=null;function h_(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var Fu=null,Uu=null;function qj(o){var c=Mt(o);if(c&&(o=c.stateNode)){var m=o[fn]||null;e:switch(o=c.stateNode,c.type){case"input":if(c_(o,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name),c=m.name,m.type==="radio"&&c!=null){for(m=o;m.parentNode;)m=m.parentNode;for(m=m.querySelectorAll('input[name="'+li(""+c)+'"][type="radio"]'),c=0;c<m.length;c++){var y=m[c];if(y!==o&&y.form===o.form){var _=y[fn]||null;if(!_)throw Error(r(90));c_(y,_.value,_.defaultValue,_.defaultValue,_.checked,_.defaultChecked,_.type,_.name)}}for(c=0;c<m.length;c++)y=m[c],y.form===o.form&&gh(y)}break e;case"textarea":zj(o,m.value,m.defaultValue);break e;case"select":c=m.value,c!=null&&$u(o,!!m.multiple,c,!1)}}}var p_=!1;function Vj(o,c,m){if(p_)return o(c,m);p_=!0;try{var y=o(c);return y}finally{if(p_=!1,(Fu!==null||Uu!==null)&&(Tv(),Fu&&(c=Fu,o=Uu,Uu=Fu=null,qj(c),o)))for(c=0;c<o.length;c++)qj(o[c])}}function vh(o,c){var m=o.stateNode;if(m===null)return null;var y=m[fn]||null;if(y===null)return null;m=y[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(o=o.type,y=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!y;break e;default:o=!1}if(o)return null;if(m&&typeof m!="function")throw Error(r(231,c,typeof m));return m}var Ja=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),m_=!1;if(Ja)try{var yh={};Object.defineProperty(yh,"passive",{get:function(){m_=!0}}),window.addEventListener("test",yh,yh),window.removeEventListener("test",yh,yh)}catch{m_=!1}var Ko=null,g_=null,Bg=null;function Hj(){if(Bg)return Bg;var o,c=g_,m=c.length,y,_="value"in Ko?Ko.value:Ko.textContent,C=_.length;for(o=0;o<m&&c[o]===_[o];o++);var $=m-o;for(y=1;y<=$&&c[m-y]===_[C-y];y++);return Bg=_.slice(o,1<y?1-y:void 0)}function qg(o){var c=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&c===13&&(o=13)):o=c,o===10&&(o=13),32<=o||o===13?o:0}function Vg(){return!0}function Gj(){return!1}function xs(o){function c(m,y,_,C,$){this._reactName=m,this._targetInst=_,this.type=y,this.nativeEvent=C,this.target=$,this.currentTarget=null;for(var q in o)o.hasOwnProperty(q)&&(m=o[q],this[q]=m?m(C):C[q]);return this.isDefaultPrevented=(C.defaultPrevented!=null?C.defaultPrevented:C.returnValue===!1)?Vg:Gj,this.isPropagationStopped=Gj,this}return p(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var m=this.nativeEvent;m&&(m.preventDefault?m.preventDefault():typeof m.returnValue!="unknown"&&(m.returnValue=!1),this.isDefaultPrevented=Vg)},stopPropagation:function(){var m=this.nativeEvent;m&&(m.stopPropagation?m.stopPropagation():typeof m.cancelBubble!="unknown"&&(m.cancelBubble=!0),this.isPropagationStopped=Vg)},persist:function(){},isPersistent:Vg}),c}var vc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Hg=xs(vc),bh=p({},vc,{view:0,detail:0}),XW=xs(bh),v_,y_,xh,Gg=p({},bh,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:x_,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==xh&&(xh&&o.type==="mousemove"?(v_=o.screenX-xh.screenX,y_=o.screenY-xh.screenY):y_=v_=0,xh=o),v_)},movementY:function(o){return"movementY"in o?o.movementY:y_}}),Wj=xs(Gg),QW=p({},Gg,{dataTransfer:0}),JW=xs(QW),ZW=p({},bh,{relatedTarget:0}),b_=xs(ZW),eY=p({},vc,{animationName:0,elapsedTime:0,pseudoElement:0}),tY=xs(eY),nY=p({},vc,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),rY=xs(nY),sY=p({},vc,{data:0}),Yj=xs(sY),iY={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},aY={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"},oY={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function lY(o){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(o):(o=oY[o])?!!c[o]:!1}function x_(){return lY}var cY=p({},bh,{key:function(o){if(o.key){var c=iY[o.key]||o.key;if(c!=="Unidentified")return c}return o.type==="keypress"?(o=qg(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?aY[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:x_,charCode:function(o){return o.type==="keypress"?qg(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?qg(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),uY=xs(cY),dY=p({},Gg,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Kj=xs(dY),fY=p({},bh,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:x_}),hY=xs(fY),pY=p({},vc,{propertyName:0,elapsedTime:0,pseudoElement:0}),mY=xs(pY),gY=p({},Gg,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),vY=xs(gY),yY=p({},vc,{newState:0,oldState:0}),bY=xs(yY),xY=[9,13,27,32],__=Ja&&"CompositionEvent"in window,_h=null;Ja&&"documentMode"in document&&(_h=document.documentMode);var _Y=Ja&&"TextEvent"in window&&!_h,Xj=Ja&&(!__||_h&&8<_h&&11>=_h),Qj=" ",Jj=!1;function Zj(o,c){switch(o){case"keyup":return xY.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function eM(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Bu=!1;function wY(o,c){switch(o){case"compositionend":return eM(c);case"keypress":return c.which!==32?null:(Jj=!0,Qj);case"textInput":return o=c.data,o===Qj&&Jj?null:o;default:return null}}function SY(o,c){if(Bu)return o==="compositionend"||!__&&Zj(o,c)?(o=Hj(),Bg=g_=Ko=null,Bu=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return Xj&&c.locale!=="ko"?null:c.data;default:return null}}var EY={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 tM(o){var c=o&&o.nodeName&&o.nodeName.toLowerCase();return c==="input"?!!EY[o.type]:c==="textarea"}function nM(o,c,m,y){Fu?Uu?Uu.push(y):Uu=[y]:Fu=y,c=Mv(c,"onChange"),0<c.length&&(m=new Hg("onChange","change",null,m,y),o.push({event:m,listeners:c}))}var wh=null,Sh=null;function kY(o){DO(o,0)}function Wg(o){var c=sn(o);if(gh(c))return o}function rM(o,c){if(o==="change")return c}var sM=!1;if(Ja){var w_;if(Ja){var S_="oninput"in document;if(!S_){var iM=document.createElement("div");iM.setAttribute("oninput","return;"),S_=typeof iM.oninput=="function"}w_=S_}else w_=!1;sM=w_&&(!document.documentMode||9<document.documentMode)}function aM(){wh&&(wh.detachEvent("onpropertychange",oM),Sh=wh=null)}function oM(o){if(o.propertyName==="value"&&Wg(Sh)){var c=[];nM(c,Sh,o,h_(o)),Vj(kY,c)}}function TY(o,c,m){o==="focusin"?(aM(),wh=c,Sh=m,wh.attachEvent("onpropertychange",oM)):o==="focusout"&&aM()}function CY(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return Wg(Sh)}function AY(o,c){if(o==="click")return Wg(c)}function NY(o,c){if(o==="input"||o==="change")return Wg(c)}function RY(o,c){return o===c&&(o!==0||1/o===1/c)||o!==o&&c!==c}var Us=typeof Object.is=="function"?Object.is:RY;function Eh(o,c){if(Us(o,c))return!0;if(typeof o!="object"||o===null||typeof c!="object"||c===null)return!1;var m=Object.keys(o),y=Object.keys(c);if(m.length!==y.length)return!1;for(y=0;y<m.length;y++){var _=m[y];if(!oe.call(c,_)||!Us(o[_],c[_]))return!1}return!0}function lM(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function cM(o,c){var m=lM(o);o=0;for(var y;m;){if(m.nodeType===3){if(y=o+m.textContent.length,o<=c&&y>=c)return{node:m,offset:c-o};o=y}e:{for(;m;){if(m.nextSibling){m=m.nextSibling;break e}m=m.parentNode}m=void 0}m=lM(m)}}function uM(o,c){return o&&c?o===c?!0:o&&o.nodeType===3?!1:c&&c.nodeType===3?uM(o,c.parentNode):"contains"in o?o.contains(c):o.compareDocumentPosition?!!(o.compareDocumentPosition(c)&16):!1:!1}function dM(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var c=ha(o.document);c instanceof o.HTMLIFrameElement;){try{var m=typeof c.contentWindow.location.href=="string"}catch{m=!1}if(m)o=c.contentWindow;else break;c=ha(o.document)}return c}function E_(o){var c=o&&o.nodeName&&o.nodeName.toLowerCase();return c&&(c==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||c==="textarea"||o.contentEditable==="true")}var jY=Ja&&"documentMode"in document&&11>=document.documentMode,qu=null,k_=null,kh=null,T_=!1;function fM(o,c,m){var y=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;T_||qu==null||qu!==ha(y)||(y=qu,"selectionStart"in y&&E_(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),kh&&Eh(kh,y)||(kh=y,y=Mv(k_,"onSelect"),0<y.length&&(c=new Hg("onSelect","select",null,c,m),o.push({event:c,listeners:y}),c.target=qu)))}function yc(o,c){var m={};return m[o.toLowerCase()]=c.toLowerCase(),m["Webkit"+o]="webkit"+c,m["Moz"+o]="moz"+c,m}var Vu={animationend:yc("Animation","AnimationEnd"),animationiteration:yc("Animation","AnimationIteration"),animationstart:yc("Animation","AnimationStart"),transitionrun:yc("Transition","TransitionRun"),transitionstart:yc("Transition","TransitionStart"),transitioncancel:yc("Transition","TransitionCancel"),transitionend:yc("Transition","TransitionEnd")},C_={},hM={};Ja&&(hM=document.createElement("div").style,"AnimationEvent"in window||(delete Vu.animationend.animation,delete Vu.animationiteration.animation,delete Vu.animationstart.animation),"TransitionEvent"in window||delete Vu.transitionend.transition);function bc(o){if(C_[o])return C_[o];if(!Vu[o])return o;var c=Vu[o],m;for(m in c)if(c.hasOwnProperty(m)&&m in hM)return C_[o]=c[m];return o}var pM=bc("animationend"),mM=bc("animationiteration"),gM=bc("animationstart"),MY=bc("transitionrun"),OY=bc("transitionstart"),PY=bc("transitioncancel"),vM=bc("transitionend"),yM=new Map,A_="abort auxClick beforeToggle 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(" ");A_.push("scrollEnd");function Ui(o,c){yM.set(o,c),lt(c,[o])}var bM=new WeakMap;function ci(o,c){if(typeof o=="object"&&o!==null){var m=bM.get(o);return m!==void 0?m:(c={value:o,source:c,stack:mh(c)},bM.set(o,c),c)}return{value:o,source:c,stack:mh(c)}}var ui=[],Hu=0,N_=0;function Yg(){for(var o=Hu,c=N_=Hu=0;c<o;){var m=ui[c];ui[c++]=null;var y=ui[c];ui[c++]=null;var _=ui[c];ui[c++]=null;var C=ui[c];if(ui[c++]=null,y!==null&&_!==null){var $=y.pending;$===null?_.next=_:(_.next=$.next,$.next=_),y.pending=_}C!==0&&xM(m,_,C)}}function Kg(o,c,m,y){ui[Hu++]=o,ui[Hu++]=c,ui[Hu++]=m,ui[Hu++]=y,N_|=y,o.lanes|=y,o=o.alternate,o!==null&&(o.lanes|=y)}function R_(o,c,m,y){return Kg(o,c,m,y),Xg(o)}function Gu(o,c){return Kg(o,null,null,c),Xg(o)}function xM(o,c,m){o.lanes|=m;var y=o.alternate;y!==null&&(y.lanes|=m);for(var _=!1,C=o.return;C!==null;)C.childLanes|=m,y=C.alternate,y!==null&&(y.childLanes|=m),C.tag===22&&(o=C.stateNode,o===null||o._visibility&1||(_=!0)),o=C,C=C.return;return o.tag===3?(C=o.stateNode,_&&c!==null&&(_=31-qe(m),o=C.hiddenUpdates,y=o[_],y===null?o[_]=[c]:y.push(c),c.lane=m|536870912),C):null}function Xg(o){if(50<Xh)throw Xh=0,Dw=null,Error(r(185));for(var c=o.return;c!==null;)o=c,c=o.return;return o.tag===3?o.stateNode:null}var Wu={};function IY(o,c,m,y){this.tag=o,this.key=m,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bs(o,c,m,y){return new IY(o,c,m,y)}function j_(o){return o=o.prototype,!(!o||!o.isReactComponent)}function Za(o,c){var m=o.alternate;return m===null?(m=Bs(o.tag,c,o.key,o.mode),m.elementType=o.elementType,m.type=o.type,m.stateNode=o.stateNode,m.alternate=o,o.alternate=m):(m.pendingProps=c,m.type=o.type,m.flags=0,m.subtreeFlags=0,m.deletions=null),m.flags=o.flags&65011712,m.childLanes=o.childLanes,m.lanes=o.lanes,m.child=o.child,m.memoizedProps=o.memoizedProps,m.memoizedState=o.memoizedState,m.updateQueue=o.updateQueue,c=o.dependencies,m.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},m.sibling=o.sibling,m.index=o.index,m.ref=o.ref,m.refCleanup=o.refCleanup,m}function _M(o,c){o.flags&=65011714;var m=o.alternate;return m===null?(o.childLanes=0,o.lanes=c,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=m.childLanes,o.lanes=m.lanes,o.child=m.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=m.memoizedProps,o.memoizedState=m.memoizedState,o.updateQueue=m.updateQueue,o.type=m.type,c=m.dependencies,o.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext}),o}function Qg(o,c,m,y,_,C){var $=0;if(y=o,typeof o=="function")j_(o)&&($=1);else if(typeof o=="string")$=LK(o,m,Z.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case I:return o=Bs(31,m,c,_),o.elementType=I,o.lanes=C,o;case b:return xc(m.children,_,C,c);case x:$=8,_|=24;break;case E:return o=Bs(12,m,c,_|2),o.elementType=E,o.lanes=C,o;case j:return o=Bs(13,m,c,_),o.elementType=j,o.lanes=C,o;case A:return o=Bs(19,m,c,_),o.elementType=A,o.lanes=C,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case S:case T:$=10;break e;case k:$=9;break e;case R:$=11;break e;case N:$=14;break e;case M:$=16,y=null;break e}$=29,m=Error(r(130,o===null?"null":typeof o,"")),y=null}return c=Bs($,m,c,_),c.elementType=o,c.type=y,c.lanes=C,c}function xc(o,c,m,y){return o=Bs(7,o,y,c),o.lanes=m,o}function M_(o,c,m){return o=Bs(6,o,null,c),o.lanes=m,o}function O_(o,c,m){return c=Bs(4,o.children!==null?o.children:[],o.key,c),c.lanes=m,c.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},c}var Yu=[],Ku=0,Jg=null,Zg=0,di=[],fi=0,_c=null,eo=1,to="";function wc(o,c){Yu[Ku++]=Zg,Yu[Ku++]=Jg,Jg=o,Zg=c}function wM(o,c,m){di[fi++]=eo,di[fi++]=to,di[fi++]=_c,_c=o;var y=eo;o=to;var _=32-qe(y)-1;y&=~(1<<_),m+=1;var C=32-qe(c)+_;if(30<C){var $=_-_%5;C=(y&(1<<$)-1).toString(32),y>>=$,_-=$,eo=1<<32-qe(c)+_|m<<_|y,to=C+o}else eo=1<<C|m<<_|y,to=o}function P_(o){o.return!==null&&(wc(o,1),wM(o,1,0))}function I_(o){for(;o===Jg;)Jg=Yu[--Ku],Yu[Ku]=null,Zg=Yu[--Ku],Yu[Ku]=null;for(;o===_c;)_c=di[--fi],di[fi]=null,to=di[--fi],di[fi]=null,eo=di[--fi],di[fi]=null}var os=null,Gn=null,on=!1,Sc=null,pa=!1,D_=Error(r(519));function Ec(o){var c=Error(r(418,""));throw Ah(ci(c,o)),D_}function SM(o){var c=o.stateNode,m=o.type,y=o.memoizedProps;switch(c[Rn]=o,c[fn]=y,m){case"dialog":qt("cancel",c),qt("close",c);break;case"iframe":case"object":case"embed":qt("load",c);break;case"video":case"audio":for(m=0;m<Jh.length;m++)qt(Jh[m],c);break;case"source":qt("error",c);break;case"img":case"image":case"link":qt("error",c),qt("load",c);break;case"details":qt("toggle",c);break;case"input":qt("invalid",c),$j(c,y.value,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name,!0),gc(c);break;case"select":qt("invalid",c);break;case"textarea":qt("invalid",c),Fj(c,y.value,y.defaultValue,y.children),gc(c)}m=y.children,typeof m!="string"&&typeof m!="number"&&typeof m!="bigint"||c.textContent===""+m||y.suppressHydrationWarning===!0||FO(c.textContent,m)?(y.popover!=null&&(qt("beforetoggle",c),qt("toggle",c)),y.onScroll!=null&&qt("scroll",c),y.onScrollEnd!=null&&qt("scrollend",c),y.onClick!=null&&(c.onclick=Ov),c=!0):c=!1,c||Ec(o)}function EM(o){for(os=o.return;os;)switch(os.tag){case 5:case 13:pa=!1;return;case 27:case 3:pa=!0;return;default:os=os.return}}function Th(o){if(o!==os)return!1;if(!on)return EM(o),on=!0,!1;var c=o.tag,m;if((m=c!==3&&c!==27)&&((m=c===5)&&(m=o.type,m=!(m!=="form"&&m!=="button")||Jw(o.type,o.memoizedProps)),m=!m),m&&Gn&&Ec(o),EM(o),c===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));e:{for(o=o.nextSibling,c=0;o;){if(o.nodeType===8)if(m=o.data,m==="/$"){if(c===0){Gn=qi(o.nextSibling);break e}c--}else m!=="$"&&m!=="$!"&&m!=="$?"||c++;o=o.nextSibling}Gn=null}}else c===27?(c=Gn,dl(o.type)?(o=nS,nS=null,Gn=o):Gn=c):Gn=os?qi(o.stateNode.nextSibling):null;return!0}function Ch(){Gn=os=null,on=!1}function kM(){var o=Sc;return o!==null&&(Ss===null?Ss=o:Ss.push.apply(Ss,o),Sc=null),o}function Ah(o){Sc===null?Sc=[o]:Sc.push(o)}var L_=re(null),kc=null,no=null;function Xo(o,c,m){D(L_,c._currentValue),c._currentValue=m}function ro(o){o._currentValue=L_.current,ue(L_)}function $_(o,c,m){for(;o!==null;){var y=o.alternate;if((o.childLanes&c)!==c?(o.childLanes|=c,y!==null&&(y.childLanes|=c)):y!==null&&(y.childLanes&c)!==c&&(y.childLanes|=c),o===m)break;o=o.return}}function z_(o,c,m,y){var _=o.child;for(_!==null&&(_.return=o);_!==null;){var C=_.dependencies;if(C!==null){var $=_.child;C=C.firstContext;e:for(;C!==null;){var q=C;C=_;for(var ee=0;ee<c.length;ee++)if(q.context===c[ee]){C.lanes|=m,q=C.alternate,q!==null&&(q.lanes|=m),$_(C.return,m,o),y||($=null);break e}C=q.next}}else if(_.tag===18){if($=_.return,$===null)throw Error(r(341));$.lanes|=m,C=$.alternate,C!==null&&(C.lanes|=m),$_($,m,o),$=null}else $=_.child;if($!==null)$.return=_;else for($=_;$!==null;){if($===o){$=null;break}if(_=$.sibling,_!==null){_.return=$.return,$=_;break}$=$.return}_=$}}function Nh(o,c,m,y){o=null;for(var _=c,C=!1;_!==null;){if(!C){if((_.flags&524288)!==0)C=!0;else if((_.flags&262144)!==0)break}if(_.tag===10){var $=_.alternate;if($===null)throw Error(r(387));if($=$.memoizedProps,$!==null){var q=_.type;Us(_.pendingProps.value,$.value)||(o!==null?o.push(q):o=[q])}}else if(_===U.current){if($=_.alternate,$===null)throw Error(r(387));$.memoizedState.memoizedState!==_.memoizedState.memoizedState&&(o!==null?o.push(sp):o=[sp])}_=_.return}o!==null&&z_(c,o,m,y),c.flags|=262144}function ev(o){for(o=o.firstContext;o!==null;){if(!Us(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function Tc(o){kc=o,no=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function Jr(o){return TM(kc,o)}function tv(o,c){return kc===null&&Tc(o),TM(o,c)}function TM(o,c){var m=c._currentValue;if(c={context:c,memoizedValue:m,next:null},no===null){if(o===null)throw Error(r(308));no=c,o.dependencies={lanes:0,firstContext:c},o.flags|=524288}else no=no.next=c;return m}var DY=typeof AbortController<"u"?AbortController:function(){var o=[],c=this.signal={aborted:!1,addEventListener:function(m,y){o.push(y)}};this.abort=function(){c.aborted=!0,o.forEach(function(m){return m()})}},LY=t.unstable_scheduleCallback,$Y=t.unstable_NormalPriority,_r={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function F_(){return{controller:new DY,data:new Map,refCount:0}}function Rh(o){o.refCount--,o.refCount===0&&LY($Y,function(){o.controller.abort()})}var jh=null,U_=0,Xu=0,Qu=null;function zY(o,c){if(jh===null){var m=jh=[];U_=0,Xu=qw(),Qu={status:"pending",value:void 0,then:function(y){m.push(y)}}}return U_++,c.then(CM,CM),c}function CM(){if(--U_===0&&jh!==null){Qu!==null&&(Qu.status="fulfilled");var o=jh;jh=null,Xu=0,Qu=null;for(var c=0;c<o.length;c++)(0,o[c])()}}function FY(o,c){var m=[],y={status:"pending",value:null,reason:null,then:function(_){m.push(_)}};return o.then(function(){y.status="fulfilled",y.value=c;for(var _=0;_<m.length;_++)(0,m[_])(c)},function(_){for(y.status="rejected",y.reason=_,_=0;_<m.length;_++)(0,m[_])(void 0)}),y}var AM=F.S;F.S=function(o,c){typeof c=="object"&&c!==null&&typeof c.then=="function"&&zY(o,c),AM!==null&&AM(o,c)};var Cc=re(null);function B_(){var o=Cc.current;return o!==null?o:wn.pooledCache}function nv(o,c){c===null?D(Cc,Cc.current):D(Cc,c.pool)}function NM(){var o=B_();return o===null?null:{parent:_r._currentValue,pool:o}}var Mh=Error(r(460)),RM=Error(r(474)),rv=Error(r(542)),q_={then:function(){}};function jM(o){return o=o.status,o==="fulfilled"||o==="rejected"}function sv(){}function MM(o,c,m){switch(m=o[m],m===void 0?o.push(c):m!==c&&(c.then(sv,sv),c=m),c.status){case"fulfilled":return c.value;case"rejected":throw o=c.reason,PM(o),o;default:if(typeof c.status=="string")c.then(sv,sv);else{if(o=wn,o!==null&&100<o.shellSuspendCounter)throw Error(r(482));o=c,o.status="pending",o.then(function(y){if(c.status==="pending"){var _=c;_.status="fulfilled",_.value=y}},function(y){if(c.status==="pending"){var _=c;_.status="rejected",_.reason=y}})}switch(c.status){case"fulfilled":return c.value;case"rejected":throw o=c.reason,PM(o),o}throw Oh=c,Mh}}var Oh=null;function OM(){if(Oh===null)throw Error(r(459));var o=Oh;return Oh=null,o}function PM(o){if(o===Mh||o===rv)throw Error(r(483))}var Qo=!1;function V_(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function H_(o,c){o=o.updateQueue,c.updateQueue===o&&(c.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,callbacks:null})}function Jo(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function Zo(o,c,m){var y=o.updateQueue;if(y===null)return null;if(y=y.shared,(cn&2)!==0){var _=y.pending;return _===null?c.next=c:(c.next=_.next,_.next=c),y.pending=c,c=Xg(o),xM(o,null,m),c}return Kg(o,y,c,m),Xg(o)}function Ph(o,c,m){if(c=c.updateQueue,c!==null&&(c=c.shared,(m&4194048)!==0)){var y=c.lanes;y&=o.pendingLanes,m|=y,c.lanes=m,Ln(o,m)}}function G_(o,c){var m=o.updateQueue,y=o.alternate;if(y!==null&&(y=y.updateQueue,m===y)){var _=null,C=null;if(m=m.firstBaseUpdate,m!==null){do{var $={lane:m.lane,tag:m.tag,payload:m.payload,callback:null,next:null};C===null?_=C=$:C=C.next=$,m=m.next}while(m!==null);C===null?_=C=c:C=C.next=c}else _=C=c;m={baseState:y.baseState,firstBaseUpdate:_,lastBaseUpdate:C,shared:y.shared,callbacks:y.callbacks},o.updateQueue=m;return}o=m.lastBaseUpdate,o===null?m.firstBaseUpdate=c:o.next=c,m.lastBaseUpdate=c}var W_=!1;function Ih(){if(W_){var o=Qu;if(o!==null)throw o}}function Dh(o,c,m,y){W_=!1;var _=o.updateQueue;Qo=!1;var C=_.firstBaseUpdate,$=_.lastBaseUpdate,q=_.shared.pending;if(q!==null){_.shared.pending=null;var ee=q,de=ee.next;ee.next=null,$===null?C=de:$.next=de,$=ee;var we=o.alternate;we!==null&&(we=we.updateQueue,q=we.lastBaseUpdate,q!==$&&(q===null?we.firstBaseUpdate=de:q.next=de,we.lastBaseUpdate=ee))}if(C!==null){var ke=_.baseState;$=0,we=de=ee=null,q=C;do{var pe=q.lane&-536870913,ge=pe!==q.lane;if(ge?(Jt&pe)===pe:(y&pe)===pe){pe!==0&&pe===Xu&&(W_=!0),we!==null&&(we=we.next={lane:0,tag:q.tag,payload:q.payload,callback:null,next:null});e:{var xt=o,ht=q;pe=c;var gn=m;switch(ht.tag){case 1:if(xt=ht.payload,typeof xt=="function"){ke=xt.call(gn,ke,pe);break e}ke=xt;break e;case 3:xt.flags=xt.flags&-65537|128;case 0:if(xt=ht.payload,pe=typeof xt=="function"?xt.call(gn,ke,pe):xt,pe==null)break e;ke=p({},ke,pe);break e;case 2:Qo=!0}}pe=q.callback,pe!==null&&(o.flags|=64,ge&&(o.flags|=8192),ge=_.callbacks,ge===null?_.callbacks=[pe]:ge.push(pe))}else ge={lane:pe,tag:q.tag,payload:q.payload,callback:q.callback,next:null},we===null?(de=we=ge,ee=ke):we=we.next=ge,$|=pe;if(q=q.next,q===null){if(q=_.shared.pending,q===null)break;ge=q,q=ge.next,ge.next=null,_.lastBaseUpdate=ge,_.shared.pending=null}}while(!0);we===null&&(ee=ke),_.baseState=ee,_.firstBaseUpdate=de,_.lastBaseUpdate=we,C===null&&(_.shared.lanes=0),ol|=$,o.lanes=$,o.memoizedState=ke}}function IM(o,c){if(typeof o!="function")throw Error(r(191,o));o.call(c)}function DM(o,c){var m=o.callbacks;if(m!==null)for(o.callbacks=null,o=0;o<m.length;o++)IM(m[o],c)}var Ju=re(null),iv=re(0);function LM(o,c){o=uo,D(iv,o),D(Ju,c),uo=o|c.baseLanes}function Y_(){D(iv,uo),D(Ju,Ju.current)}function K_(){uo=iv.current,ue(Ju),ue(iv)}var el=0,$t=null,pn=null,ur=null,av=!1,Zu=!1,Ac=!1,ov=0,Lh=0,ed=null,UY=0;function tr(){throw Error(r(321))}function X_(o,c){if(c===null)return!1;for(var m=0;m<c.length&&m<o.length;m++)if(!Us(o[m],c[m]))return!1;return!0}function Q_(o,c,m,y,_,C){return el=C,$t=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,F.H=o===null||o.memoizedState===null?x2:_2,Ac=!1,C=m(y,_),Ac=!1,Zu&&(C=zM(c,m,y,_)),$M(o),C}function $M(o){F.H=hv;var c=pn!==null&&pn.next!==null;if(el=0,ur=pn=$t=null,av=!1,Lh=0,ed=null,c)throw Error(r(300));o===null||Rr||(o=o.dependencies,o!==null&&ev(o)&&(Rr=!0))}function zM(o,c,m,y){$t=o;var _=0;do{if(Zu&&(ed=null),Lh=0,Zu=!1,25<=_)throw Error(r(301));if(_+=1,ur=pn=null,o.updateQueue!=null){var C=o.updateQueue;C.lastEffect=null,C.events=null,C.stores=null,C.memoCache!=null&&(C.memoCache.index=0)}F.H=YY,C=c(m,y)}while(Zu);return C}function BY(){var o=F.H,c=o.useState()[0];return c=typeof c.then=="function"?$h(c):c,o=o.useState()[0],(pn!==null?pn.memoizedState:null)!==o&&($t.flags|=1024),c}function J_(){var o=ov!==0;return ov=0,o}function Z_(o,c,m){c.updateQueue=o.updateQueue,c.flags&=-2053,o.lanes&=~m}function ew(o){if(av){for(o=o.memoizedState;o!==null;){var c=o.queue;c!==null&&(c.pending=null),o=o.next}av=!1}el=0,ur=pn=$t=null,Zu=!1,Lh=ov=0,ed=null}function _s(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ur===null?$t.memoizedState=ur=o:ur=ur.next=o,ur}function dr(){if(pn===null){var o=$t.alternate;o=o!==null?o.memoizedState:null}else o=pn.next;var c=ur===null?$t.memoizedState:ur.next;if(c!==null)ur=c,pn=o;else{if(o===null)throw $t.alternate===null?Error(r(467)):Error(r(310));pn=o,o={memoizedState:pn.memoizedState,baseState:pn.baseState,baseQueue:pn.baseQueue,queue:pn.queue,next:null},ur===null?$t.memoizedState=ur=o:ur=ur.next=o}return ur}function tw(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function $h(o){var c=Lh;return Lh+=1,ed===null&&(ed=[]),o=MM(ed,o,c),c=$t,(ur===null?c.memoizedState:ur.next)===null&&(c=c.alternate,F.H=c===null||c.memoizedState===null?x2:_2),o}function lv(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return $h(o);if(o.$$typeof===T)return Jr(o)}throw Error(r(438,String(o)))}function nw(o){var c=null,m=$t.updateQueue;if(m!==null&&(c=m.memoCache),c==null){var y=$t.alternate;y!==null&&(y=y.updateQueue,y!==null&&(y=y.memoCache,y!=null&&(c={data:y.data.map(function(_){return _.slice()}),index:0})))}if(c==null&&(c={data:[],index:0}),m===null&&(m=tw(),$t.updateQueue=m),m.memoCache=c,m=c.data[c.index],m===void 0)for(m=c.data[c.index]=Array(o),y=0;y<o;y++)m[y]=O;return c.index++,m}function so(o,c){return typeof c=="function"?c(o):c}function cv(o){var c=dr();return rw(c,pn,o)}function rw(o,c,m){var y=o.queue;if(y===null)throw Error(r(311));y.lastRenderedReducer=m;var _=o.baseQueue,C=y.pending;if(C!==null){if(_!==null){var $=_.next;_.next=C.next,C.next=$}c.baseQueue=_=C,y.pending=null}if(C=o.baseState,_===null)o.memoizedState=C;else{c=_.next;var q=$=null,ee=null,de=c,we=!1;do{var ke=de.lane&-536870913;if(ke!==de.lane?(Jt&ke)===ke:(el&ke)===ke){var pe=de.revertLane;if(pe===0)ee!==null&&(ee=ee.next={lane:0,revertLane:0,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null}),ke===Xu&&(we=!0);else if((el&pe)===pe){de=de.next,pe===Xu&&(we=!0);continue}else ke={lane:0,revertLane:de.revertLane,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},ee===null?(q=ee=ke,$=C):ee=ee.next=ke,$t.lanes|=pe,ol|=pe;ke=de.action,Ac&&m(C,ke),C=de.hasEagerState?de.eagerState:m(C,ke)}else pe={lane:ke,revertLane:de.revertLane,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},ee===null?(q=ee=pe,$=C):ee=ee.next=pe,$t.lanes|=ke,ol|=ke;de=de.next}while(de!==null&&de!==c);if(ee===null?$=C:ee.next=q,!Us(C,o.memoizedState)&&(Rr=!0,we&&(m=Qu,m!==null)))throw m;o.memoizedState=C,o.baseState=$,o.baseQueue=ee,y.lastRenderedState=C}return _===null&&(y.lanes=0),[o.memoizedState,y.dispatch]}function sw(o){var c=dr(),m=c.queue;if(m===null)throw Error(r(311));m.lastRenderedReducer=o;var y=m.dispatch,_=m.pending,C=c.memoizedState;if(_!==null){m.pending=null;var $=_=_.next;do C=o(C,$.action),$=$.next;while($!==_);Us(C,c.memoizedState)||(Rr=!0),c.memoizedState=C,c.baseQueue===null&&(c.baseState=C),m.lastRenderedState=C}return[C,y]}function FM(o,c,m){var y=$t,_=dr(),C=on;if(C){if(m===void 0)throw Error(r(407));m=m()}else m=c();var $=!Us((pn||_).memoizedState,m);$&&(_.memoizedState=m,Rr=!0),_=_.queue;var q=qM.bind(null,y,_,o);if(zh(2048,8,q,[o]),_.getSnapshot!==c||$||ur!==null&&ur.memoizedState.tag&1){if(y.flags|=2048,td(9,uv(),BM.bind(null,y,_,m,c),null),wn===null)throw Error(r(349));C||(el&124)!==0||UM(y,c,m)}return m}function UM(o,c,m){o.flags|=16384,o={getSnapshot:c,value:m},c=$t.updateQueue,c===null?(c=tw(),$t.updateQueue=c,c.stores=[o]):(m=c.stores,m===null?c.stores=[o]:m.push(o))}function BM(o,c,m,y){c.value=m,c.getSnapshot=y,VM(c)&&HM(o)}function qM(o,c,m){return m(function(){VM(c)&&HM(o)})}function VM(o){var c=o.getSnapshot;o=o.value;try{var m=c();return!Us(o,m)}catch{return!0}}function HM(o){var c=Gu(o,2);c!==null&&Ws(c,o,2)}function iw(o){var c=_s();if(typeof o=="function"){var m=o;if(o=m(),Ac){st(!0);try{m()}finally{st(!1)}}}return c.memoizedState=c.baseState=o,c.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:so,lastRenderedState:o},c}function GM(o,c,m,y){return o.baseState=m,rw(o,pn,typeof y=="function"?y:so)}function qY(o,c,m,y,_){if(fv(o))throw Error(r(485));if(o=c.action,o!==null){var C={payload:_,action:o,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function($){C.listeners.push($)}};F.T!==null?m(!0):C.isTransition=!1,y(C),m=c.pending,m===null?(C.next=c.pending=C,WM(c,C)):(C.next=m.next,c.pending=m.next=C)}}function WM(o,c){var m=c.action,y=c.payload,_=o.state;if(c.isTransition){var C=F.T,$={};F.T=$;try{var q=m(_,y),ee=F.S;ee!==null&&ee($,q),YM(o,c,q)}catch(de){aw(o,c,de)}finally{F.T=C}}else try{C=m(_,y),YM(o,c,C)}catch(de){aw(o,c,de)}}function YM(o,c,m){m!==null&&typeof m=="object"&&typeof m.then=="function"?m.then(function(y){KM(o,c,y)},function(y){return aw(o,c,y)}):KM(o,c,m)}function KM(o,c,m){c.status="fulfilled",c.value=m,XM(c),o.state=m,c=o.pending,c!==null&&(m=c.next,m===c?o.pending=null:(m=m.next,c.next=m,WM(o,m)))}function aw(o,c,m){var y=o.pending;if(o.pending=null,y!==null){y=y.next;do c.status="rejected",c.reason=m,XM(c),c=c.next;while(c!==y)}o.action=null}function XM(o){o=o.listeners;for(var c=0;c<o.length;c++)(0,o[c])()}function QM(o,c){return c}function JM(o,c){if(on){var m=wn.formState;if(m!==null){e:{var y=$t;if(on){if(Gn){t:{for(var _=Gn,C=pa;_.nodeType!==8;){if(!C){_=null;break t}if(_=qi(_.nextSibling),_===null){_=null;break t}}C=_.data,_=C==="F!"||C==="F"?_:null}if(_){Gn=qi(_.nextSibling),y=_.data==="F!";break e}}Ec(y)}y=!1}y&&(c=m[0])}}return m=_s(),m.memoizedState=m.baseState=c,y={pending:null,lanes:0,dispatch:null,lastRenderedReducer:QM,lastRenderedState:c},m.queue=y,m=v2.bind(null,$t,y),y.dispatch=m,y=iw(!1),C=dw.bind(null,$t,!1,y.queue),y=_s(),_={state:c,dispatch:null,action:o,pending:null},y.queue=_,m=qY.bind(null,$t,_,C,m),_.dispatch=m,y.memoizedState=o,[c,m,!1]}function ZM(o){var c=dr();return e2(c,pn,o)}function e2(o,c,m){if(c=rw(o,c,QM)[0],o=cv(so)[0],typeof c=="object"&&c!==null&&typeof c.then=="function")try{var y=$h(c)}catch($){throw $===Mh?rv:$}else y=c;c=dr();var _=c.queue,C=_.dispatch;return m!==c.memoizedState&&($t.flags|=2048,td(9,uv(),VY.bind(null,_,m),null)),[y,C,o]}function VY(o,c){o.action=c}function t2(o){var c=dr(),m=pn;if(m!==null)return e2(c,m,o);dr(),c=c.memoizedState,m=dr();var y=m.queue.dispatch;return m.memoizedState=o,[c,y,!1]}function td(o,c,m,y){return o={tag:o,create:m,deps:y,inst:c,next:null},c=$t.updateQueue,c===null&&(c=tw(),$t.updateQueue=c),m=c.lastEffect,m===null?c.lastEffect=o.next=o:(y=m.next,m.next=o,o.next=y,c.lastEffect=o),o}function uv(){return{destroy:void 0,resource:void 0}}function n2(){return dr().memoizedState}function dv(o,c,m,y){var _=_s();y=y===void 0?null:y,$t.flags|=o,_.memoizedState=td(1|c,uv(),m,y)}function zh(o,c,m,y){var _=dr();y=y===void 0?null:y;var C=_.memoizedState.inst;pn!==null&&y!==null&&X_(y,pn.memoizedState.deps)?_.memoizedState=td(c,C,m,y):($t.flags|=o,_.memoizedState=td(1|c,C,m,y))}function r2(o,c){dv(8390656,8,o,c)}function s2(o,c){zh(2048,8,o,c)}function i2(o,c){return zh(4,2,o,c)}function a2(o,c){return zh(4,4,o,c)}function o2(o,c){if(typeof c=="function"){o=o();var m=c(o);return function(){typeof m=="function"?m():c(null)}}if(c!=null)return o=o(),c.current=o,function(){c.current=null}}function l2(o,c,m){m=m!=null?m.concat([o]):null,zh(4,4,o2.bind(null,c,o),m)}function ow(){}function c2(o,c){var m=dr();c=c===void 0?null:c;var y=m.memoizedState;return c!==null&&X_(c,y[1])?y[0]:(m.memoizedState=[o,c],o)}function u2(o,c){var m=dr();c=c===void 0?null:c;var y=m.memoizedState;if(c!==null&&X_(c,y[1]))return y[0];if(y=o(),Ac){st(!0);try{o()}finally{st(!1)}}return m.memoizedState=[y,c],y}function lw(o,c,m){return m===void 0||(el&1073741824)!==0?o.memoizedState=c:(o.memoizedState=m,o=hO(),$t.lanes|=o,ol|=o,m)}function d2(o,c,m,y){return Us(m,c)?m:Ju.current!==null?(o=lw(o,m,y),Us(o,c)||(Rr=!0),o):(el&42)===0?(Rr=!0,o.memoizedState=m):(o=hO(),$t.lanes|=o,ol|=o,c)}function f2(o,c,m,y,_){var C=Y.p;Y.p=C!==0&&8>C?C:8;var $=F.T,q={};F.T=q,dw(o,!1,c,m);try{var ee=_(),de=F.S;if(de!==null&&de(q,ee),ee!==null&&typeof ee=="object"&&typeof ee.then=="function"){var we=FY(ee,y);Fh(o,c,we,Gs(o))}else Fh(o,c,y,Gs(o))}catch(ke){Fh(o,c,{then:function(){},status:"rejected",reason:ke},Gs())}finally{Y.p=C,F.T=$}}function HY(){}function cw(o,c,m,y){if(o.tag!==5)throw Error(r(476));var _=h2(o).queue;f2(o,_,c,H,m===null?HY:function(){return p2(o),m(y)})}function h2(o){var c=o.memoizedState;if(c!==null)return c;c={memoizedState:H,baseState:H,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:so,lastRenderedState:H},next:null};var m={};return c.next={memoizedState:m,baseState:m,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:so,lastRenderedState:m},next:null},o.memoizedState=c,o=o.alternate,o!==null&&(o.memoizedState=c),c}function p2(o){var c=h2(o).next.queue;Fh(o,c,{},Gs())}function uw(){return Jr(sp)}function m2(){return dr().memoizedState}function g2(){return dr().memoizedState}function GY(o){for(var c=o.return;c!==null;){switch(c.tag){case 24:case 3:var m=Gs();o=Jo(m);var y=Zo(c,o,m);y!==null&&(Ws(y,c,m),Ph(y,c,m)),c={cache:F_()},o.payload=c;return}c=c.return}}function WY(o,c,m){var y=Gs();m={lane:y,revertLane:0,action:m,hasEagerState:!1,eagerState:null,next:null},fv(o)?y2(c,m):(m=R_(o,c,m,y),m!==null&&(Ws(m,o,y),b2(m,c,y)))}function v2(o,c,m){var y=Gs();Fh(o,c,m,y)}function Fh(o,c,m,y){var _={lane:y,revertLane:0,action:m,hasEagerState:!1,eagerState:null,next:null};if(fv(o))y2(c,_);else{var C=o.alternate;if(o.lanes===0&&(C===null||C.lanes===0)&&(C=c.lastRenderedReducer,C!==null))try{var $=c.lastRenderedState,q=C($,m);if(_.hasEagerState=!0,_.eagerState=q,Us(q,$))return Kg(o,c,_,0),wn===null&&Yg(),!1}catch{}finally{}if(m=R_(o,c,_,y),m!==null)return Ws(m,o,y),b2(m,c,y),!0}return!1}function dw(o,c,m,y){if(y={lane:2,revertLane:qw(),action:y,hasEagerState:!1,eagerState:null,next:null},fv(o)){if(c)throw Error(r(479))}else c=R_(o,m,y,2),c!==null&&Ws(c,o,2)}function fv(o){var c=o.alternate;return o===$t||c!==null&&c===$t}function y2(o,c){Zu=av=!0;var m=o.pending;m===null?c.next=c:(c.next=m.next,m.next=c),o.pending=c}function b2(o,c,m){if((m&4194048)!==0){var y=c.lanes;y&=o.pendingLanes,m|=y,c.lanes=m,Ln(o,m)}}var hv={readContext:Jr,use:lv,useCallback:tr,useContext:tr,useEffect:tr,useImperativeHandle:tr,useLayoutEffect:tr,useInsertionEffect:tr,useMemo:tr,useReducer:tr,useRef:tr,useState:tr,useDebugValue:tr,useDeferredValue:tr,useTransition:tr,useSyncExternalStore:tr,useId:tr,useHostTransitionStatus:tr,useFormState:tr,useActionState:tr,useOptimistic:tr,useMemoCache:tr,useCacheRefresh:tr},x2={readContext:Jr,use:lv,useCallback:function(o,c){return _s().memoizedState=[o,c===void 0?null:c],o},useContext:Jr,useEffect:r2,useImperativeHandle:function(o,c,m){m=m!=null?m.concat([o]):null,dv(4194308,4,o2.bind(null,c,o),m)},useLayoutEffect:function(o,c){return dv(4194308,4,o,c)},useInsertionEffect:function(o,c){dv(4,2,o,c)},useMemo:function(o,c){var m=_s();c=c===void 0?null:c;var y=o();if(Ac){st(!0);try{o()}finally{st(!1)}}return m.memoizedState=[y,c],y},useReducer:function(o,c,m){var y=_s();if(m!==void 0){var _=m(c);if(Ac){st(!0);try{m(c)}finally{st(!1)}}}else _=c;return y.memoizedState=y.baseState=_,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:_},y.queue=o,o=o.dispatch=WY.bind(null,$t,o),[y.memoizedState,o]},useRef:function(o){var c=_s();return o={current:o},c.memoizedState=o},useState:function(o){o=iw(o);var c=o.queue,m=v2.bind(null,$t,c);return c.dispatch=m,[o.memoizedState,m]},useDebugValue:ow,useDeferredValue:function(o,c){var m=_s();return lw(m,o,c)},useTransition:function(){var o=iw(!1);return o=f2.bind(null,$t,o.queue,!0,!1),_s().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,c,m){var y=$t,_=_s();if(on){if(m===void 0)throw Error(r(407));m=m()}else{if(m=c(),wn===null)throw Error(r(349));(Jt&124)!==0||UM(y,c,m)}_.memoizedState=m;var C={value:m,getSnapshot:c};return _.queue=C,r2(qM.bind(null,y,C,o),[o]),y.flags|=2048,td(9,uv(),BM.bind(null,y,C,m,c),null),m},useId:function(){var o=_s(),c=wn.identifierPrefix;if(on){var m=to,y=eo;m=(y&~(1<<32-qe(y)-1)).toString(32)+m,c="«"+c+"R"+m,m=ov++,0<m&&(c+="H"+m.toString(32)),c+="»"}else m=UY++,c="«"+c+"r"+m.toString(32)+"»";return o.memoizedState=c},useHostTransitionStatus:uw,useFormState:JM,useActionState:JM,useOptimistic:function(o){var c=_s();c.memoizedState=c.baseState=o;var m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return c.queue=m,c=dw.bind(null,$t,!0,m),m.dispatch=c,[o,c]},useMemoCache:nw,useCacheRefresh:function(){return _s().memoizedState=GY.bind(null,$t)}},_2={readContext:Jr,use:lv,useCallback:c2,useContext:Jr,useEffect:s2,useImperativeHandle:l2,useInsertionEffect:i2,useLayoutEffect:a2,useMemo:u2,useReducer:cv,useRef:n2,useState:function(){return cv(so)},useDebugValue:ow,useDeferredValue:function(o,c){var m=dr();return d2(m,pn.memoizedState,o,c)},useTransition:function(){var o=cv(so)[0],c=dr().memoizedState;return[typeof o=="boolean"?o:$h(o),c]},useSyncExternalStore:FM,useId:m2,useHostTransitionStatus:uw,useFormState:ZM,useActionState:ZM,useOptimistic:function(o,c){var m=dr();return GM(m,pn,o,c)},useMemoCache:nw,useCacheRefresh:g2},YY={readContext:Jr,use:lv,useCallback:c2,useContext:Jr,useEffect:s2,useImperativeHandle:l2,useInsertionEffect:i2,useLayoutEffect:a2,useMemo:u2,useReducer:sw,useRef:n2,useState:function(){return sw(so)},useDebugValue:ow,useDeferredValue:function(o,c){var m=dr();return pn===null?lw(m,o,c):d2(m,pn.memoizedState,o,c)},useTransition:function(){var o=sw(so)[0],c=dr().memoizedState;return[typeof o=="boolean"?o:$h(o),c]},useSyncExternalStore:FM,useId:m2,useHostTransitionStatus:uw,useFormState:t2,useActionState:t2,useOptimistic:function(o,c){var m=dr();return pn!==null?GM(m,pn,o,c):(m.baseState=o,[o,m.queue.dispatch])},useMemoCache:nw,useCacheRefresh:g2},nd=null,Uh=0;function pv(o){var c=Uh;return Uh+=1,nd===null&&(nd=[]),MM(nd,o,c)}function Bh(o,c){c=c.props.ref,o.ref=c!==void 0?c:null}function mv(o,c){throw c.$$typeof===h?Error(r(525)):(o=Object.prototype.toString.call(c),Error(r(31,o==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":o)))}function w2(o){var c=o._init;return c(o._payload)}function S2(o){function c(le,ie){if(o){var ce=le.deletions;ce===null?(le.deletions=[ie],le.flags|=16):ce.push(ie)}}function m(le,ie){if(!o)return null;for(;ie!==null;)c(le,ie),ie=ie.sibling;return null}function y(le){for(var ie=new Map;le!==null;)le.key!==null?ie.set(le.key,le):ie.set(le.index,le),le=le.sibling;return ie}function _(le,ie){return le=Za(le,ie),le.index=0,le.sibling=null,le}function C(le,ie,ce){return le.index=ce,o?(ce=le.alternate,ce!==null?(ce=ce.index,ce<ie?(le.flags|=67108866,ie):ce):(le.flags|=67108866,ie)):(le.flags|=1048576,ie)}function $(le){return o&&le.alternate===null&&(le.flags|=67108866),le}function q(le,ie,ce,Se){return ie===null||ie.tag!==6?(ie=M_(ce,le.mode,Se),ie.return=le,ie):(ie=_(ie,ce),ie.return=le,ie)}function ee(le,ie,ce,Se){var Ye=ce.type;return Ye===b?we(le,ie,ce.props.children,Se,ce.key):ie!==null&&(ie.elementType===Ye||typeof Ye=="object"&&Ye!==null&&Ye.$$typeof===M&&w2(Ye)===ie.type)?(ie=_(ie,ce.props),Bh(ie,ce),ie.return=le,ie):(ie=Qg(ce.type,ce.key,ce.props,null,le.mode,Se),Bh(ie,ce),ie.return=le,ie)}function de(le,ie,ce,Se){return ie===null||ie.tag!==4||ie.stateNode.containerInfo!==ce.containerInfo||ie.stateNode.implementation!==ce.implementation?(ie=O_(ce,le.mode,Se),ie.return=le,ie):(ie=_(ie,ce.children||[]),ie.return=le,ie)}function we(le,ie,ce,Se,Ye){return ie===null||ie.tag!==7?(ie=xc(ce,le.mode,Se,Ye),ie.return=le,ie):(ie=_(ie,ce),ie.return=le,ie)}function ke(le,ie,ce){if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return ie=M_(""+ie,le.mode,ce),ie.return=le,ie;if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case g:return ce=Qg(ie.type,ie.key,ie.props,null,le.mode,ce),Bh(ce,ie),ce.return=le,ce;case v:return ie=O_(ie,le.mode,ce),ie.return=le,ie;case M:var Se=ie._init;return ie=Se(ie._payload),ke(le,ie,ce)}if(X(ie)||z(ie))return ie=xc(ie,le.mode,ce,null),ie.return=le,ie;if(typeof ie.then=="function")return ke(le,pv(ie),ce);if(ie.$$typeof===T)return ke(le,tv(le,ie),ce);mv(le,ie)}return null}function pe(le,ie,ce,Se){var Ye=ie!==null?ie.key:null;if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return Ye!==null?null:q(le,ie,""+ce,Se);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case g:return ce.key===Ye?ee(le,ie,ce,Se):null;case v:return ce.key===Ye?de(le,ie,ce,Se):null;case M:return Ye=ce._init,ce=Ye(ce._payload),pe(le,ie,ce,Se)}if(X(ce)||z(ce))return Ye!==null?null:we(le,ie,ce,Se,null);if(typeof ce.then=="function")return pe(le,ie,pv(ce),Se);if(ce.$$typeof===T)return pe(le,ie,tv(le,ce),Se);mv(le,ce)}return null}function ge(le,ie,ce,Se,Ye){if(typeof Se=="string"&&Se!==""||typeof Se=="number"||typeof Se=="bigint")return le=le.get(ce)||null,q(ie,le,""+Se,Ye);if(typeof Se=="object"&&Se!==null){switch(Se.$$typeof){case g:return le=le.get(Se.key===null?ce:Se.key)||null,ee(ie,le,Se,Ye);case v:return le=le.get(Se.key===null?ce:Se.key)||null,de(ie,le,Se,Ye);case M:var Ut=Se._init;return Se=Ut(Se._payload),ge(le,ie,ce,Se,Ye)}if(X(Se)||z(Se))return le=le.get(ce)||null,we(ie,le,Se,Ye,null);if(typeof Se.then=="function")return ge(le,ie,ce,pv(Se),Ye);if(Se.$$typeof===T)return ge(le,ie,ce,tv(ie,Se),Ye);mv(ie,Se)}return null}function xt(le,ie,ce,Se){for(var Ye=null,Ut=null,it=ie,mt=ie=0,Mr=null;it!==null&&mt<ce.length;mt++){it.index>mt?(Mr=it,it=null):Mr=it.sibling;var nn=pe(le,it,ce[mt],Se);if(nn===null){it===null&&(it=Mr);break}o&&it&&nn.alternate===null&&c(le,it),ie=C(nn,ie,mt),Ut===null?Ye=nn:Ut.sibling=nn,Ut=nn,it=Mr}if(mt===ce.length)return m(le,it),on&&wc(le,mt),Ye;if(it===null){for(;mt<ce.length;mt++)it=ke(le,ce[mt],Se),it!==null&&(ie=C(it,ie,mt),Ut===null?Ye=it:Ut.sibling=it,Ut=it);return on&&wc(le,mt),Ye}for(it=y(it);mt<ce.length;mt++)Mr=ge(it,le,mt,ce[mt],Se),Mr!==null&&(o&&Mr.alternate!==null&&it.delete(Mr.key===null?mt:Mr.key),ie=C(Mr,ie,mt),Ut===null?Ye=Mr:Ut.sibling=Mr,Ut=Mr);return o&&it.forEach(function(gl){return c(le,gl)}),on&&wc(le,mt),Ye}function ht(le,ie,ce,Se){if(ce==null)throw Error(r(151));for(var Ye=null,Ut=null,it=ie,mt=ie=0,Mr=null,nn=ce.next();it!==null&&!nn.done;mt++,nn=ce.next()){it.index>mt?(Mr=it,it=null):Mr=it.sibling;var gl=pe(le,it,nn.value,Se);if(gl===null){it===null&&(it=Mr);break}o&&it&&gl.alternate===null&&c(le,it),ie=C(gl,ie,mt),Ut===null?Ye=gl:Ut.sibling=gl,Ut=gl,it=Mr}if(nn.done)return m(le,it),on&&wc(le,mt),Ye;if(it===null){for(;!nn.done;mt++,nn=ce.next())nn=ke(le,nn.value,Se),nn!==null&&(ie=C(nn,ie,mt),Ut===null?Ye=nn:Ut.sibling=nn,Ut=nn);return on&&wc(le,mt),Ye}for(it=y(it);!nn.done;mt++,nn=ce.next())nn=ge(it,le,mt,nn.value,Se),nn!==null&&(o&&nn.alternate!==null&&it.delete(nn.key===null?mt:nn.key),ie=C(nn,ie,mt),Ut===null?Ye=nn:Ut.sibling=nn,Ut=nn);return o&&it.forEach(function(KK){return c(le,KK)}),on&&wc(le,mt),Ye}function gn(le,ie,ce,Se){if(typeof ce=="object"&&ce!==null&&ce.type===b&&ce.key===null&&(ce=ce.props.children),typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case g:e:{for(var Ye=ce.key;ie!==null;){if(ie.key===Ye){if(Ye=ce.type,Ye===b){if(ie.tag===7){m(le,ie.sibling),Se=_(ie,ce.props.children),Se.return=le,le=Se;break e}}else if(ie.elementType===Ye||typeof Ye=="object"&&Ye!==null&&Ye.$$typeof===M&&w2(Ye)===ie.type){m(le,ie.sibling),Se=_(ie,ce.props),Bh(Se,ce),Se.return=le,le=Se;break e}m(le,ie);break}else c(le,ie);ie=ie.sibling}ce.type===b?(Se=xc(ce.props.children,le.mode,Se,ce.key),Se.return=le,le=Se):(Se=Qg(ce.type,ce.key,ce.props,null,le.mode,Se),Bh(Se,ce),Se.return=le,le=Se)}return $(le);case v:e:{for(Ye=ce.key;ie!==null;){if(ie.key===Ye)if(ie.tag===4&&ie.stateNode.containerInfo===ce.containerInfo&&ie.stateNode.implementation===ce.implementation){m(le,ie.sibling),Se=_(ie,ce.children||[]),Se.return=le,le=Se;break e}else{m(le,ie);break}else c(le,ie);ie=ie.sibling}Se=O_(ce,le.mode,Se),Se.return=le,le=Se}return $(le);case M:return Ye=ce._init,ce=Ye(ce._payload),gn(le,ie,ce,Se)}if(X(ce))return xt(le,ie,ce,Se);if(z(ce)){if(Ye=z(ce),typeof Ye!="function")throw Error(r(150));return ce=Ye.call(ce),ht(le,ie,ce,Se)}if(typeof ce.then=="function")return gn(le,ie,pv(ce),Se);if(ce.$$typeof===T)return gn(le,ie,tv(le,ce),Se);mv(le,ce)}return typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint"?(ce=""+ce,ie!==null&&ie.tag===6?(m(le,ie.sibling),Se=_(ie,ce),Se.return=le,le=Se):(m(le,ie),Se=M_(ce,le.mode,Se),Se.return=le,le=Se),$(le)):m(le,ie)}return function(le,ie,ce,Se){try{Uh=0;var Ye=gn(le,ie,ce,Se);return nd=null,Ye}catch(it){if(it===Mh||it===rv)throw it;var Ut=Bs(29,it,null,le.mode);return Ut.lanes=Se,Ut.return=le,Ut}finally{}}}var rd=S2(!0),E2=S2(!1),hi=re(null),ma=null;function tl(o){var c=o.alternate;D(wr,wr.current&1),D(hi,o),ma===null&&(c===null||Ju.current!==null||c.memoizedState!==null)&&(ma=o)}function k2(o){if(o.tag===22){if(D(wr,wr.current),D(hi,o),ma===null){var c=o.alternate;c!==null&&c.memoizedState!==null&&(ma=o)}}else nl()}function nl(){D(wr,wr.current),D(hi,hi.current)}function io(o){ue(hi),ma===o&&(ma=null),ue(wr)}var wr=re(0);function gv(o){for(var c=o;c!==null;){if(c.tag===13){var m=c.memoizedState;if(m!==null&&(m=m.dehydrated,m===null||m.data==="$?"||tS(m)))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===o)break;for(;c.sibling===null;){if(c.return===null||c.return===o)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}function fw(o,c,m,y){c=o.memoizedState,m=m(y,c),m=m==null?c:p({},c,m),o.memoizedState=m,o.lanes===0&&(o.updateQueue.baseState=m)}var hw={enqueueSetState:function(o,c,m){o=o._reactInternals;var y=Gs(),_=Jo(y);_.payload=c,m!=null&&(_.callback=m),c=Zo(o,_,y),c!==null&&(Ws(c,o,y),Ph(c,o,y))},enqueueReplaceState:function(o,c,m){o=o._reactInternals;var y=Gs(),_=Jo(y);_.tag=1,_.payload=c,m!=null&&(_.callback=m),c=Zo(o,_,y),c!==null&&(Ws(c,o,y),Ph(c,o,y))},enqueueForceUpdate:function(o,c){o=o._reactInternals;var m=Gs(),y=Jo(m);y.tag=2,c!=null&&(y.callback=c),c=Zo(o,y,m),c!==null&&(Ws(c,o,m),Ph(c,o,m))}};function T2(o,c,m,y,_,C,$){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(y,C,$):c.prototype&&c.prototype.isPureReactComponent?!Eh(m,y)||!Eh(_,C):!0}function C2(o,c,m,y){o=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(m,y),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(m,y),c.state!==o&&hw.enqueueReplaceState(c,c.state,null)}function Nc(o,c){var m=c;if("ref"in c){m={};for(var y in c)y!=="ref"&&(m[y]=c[y])}if(o=o.defaultProps){m===c&&(m=p({},m));for(var _ in o)m[_]===void 0&&(m[_]=o[_])}return m}var vv=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var c=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o!==null&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(c))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)};function A2(o){vv(o)}function N2(o){console.error(o)}function R2(o){vv(o)}function yv(o,c){try{var m=o.onUncaughtError;m(c.value,{componentStack:c.stack})}catch(y){setTimeout(function(){throw y})}}function j2(o,c,m){try{var y=o.onCaughtError;y(m.value,{componentStack:m.stack,errorBoundary:c.tag===1?c.stateNode:null})}catch(_){setTimeout(function(){throw _})}}function pw(o,c,m){return m=Jo(m),m.tag=3,m.payload={element:null},m.callback=function(){yv(o,c)},m}function M2(o){return o=Jo(o),o.tag=3,o}function O2(o,c,m,y){var _=m.type.getDerivedStateFromError;if(typeof _=="function"){var C=y.value;o.payload=function(){return _(C)},o.callback=function(){j2(c,m,y)}}var $=m.stateNode;$!==null&&typeof $.componentDidCatch=="function"&&(o.callback=function(){j2(c,m,y),typeof _!="function"&&(ll===null?ll=new Set([this]):ll.add(this));var q=y.stack;this.componentDidCatch(y.value,{componentStack:q!==null?q:""})})}function KY(o,c,m,y,_){if(m.flags|=32768,y!==null&&typeof y=="object"&&typeof y.then=="function"){if(c=m.alternate,c!==null&&Nh(c,m,_,!0),m=hi.current,m!==null){switch(m.tag){case 13:return ma===null?$w():m.alternate===null&&Wn===0&&(Wn=3),m.flags&=-257,m.flags|=65536,m.lanes=_,y===q_?m.flags|=16384:(c=m.updateQueue,c===null?m.updateQueue=new Set([y]):c.add(y),Fw(o,y,_)),!1;case 22:return m.flags|=65536,y===q_?m.flags|=16384:(c=m.updateQueue,c===null?(c={transitions:null,markerInstances:null,retryQueue:new Set([y])},m.updateQueue=c):(m=c.retryQueue,m===null?c.retryQueue=new Set([y]):m.add(y)),Fw(o,y,_)),!1}throw Error(r(435,m.tag))}return Fw(o,y,_),$w(),!1}if(on)return c=hi.current,c!==null?((c.flags&65536)===0&&(c.flags|=256),c.flags|=65536,c.lanes=_,y!==D_&&(o=Error(r(422),{cause:y}),Ah(ci(o,m)))):(y!==D_&&(c=Error(r(423),{cause:y}),Ah(ci(c,m))),o=o.current.alternate,o.flags|=65536,_&=-_,o.lanes|=_,y=ci(y,m),_=pw(o.stateNode,y,_),G_(o,_),Wn!==4&&(Wn=2)),!1;var C=Error(r(520),{cause:y});if(C=ci(C,m),Kh===null?Kh=[C]:Kh.push(C),Wn!==4&&(Wn=2),c===null)return!0;y=ci(y,m),m=c;do{switch(m.tag){case 3:return m.flags|=65536,o=_&-_,m.lanes|=o,o=pw(m.stateNode,y,o),G_(m,o),!1;case 1:if(c=m.type,C=m.stateNode,(m.flags&128)===0&&(typeof c.getDerivedStateFromError=="function"||C!==null&&typeof C.componentDidCatch=="function"&&(ll===null||!ll.has(C))))return m.flags|=65536,_&=-_,m.lanes|=_,_=M2(_),O2(_,o,m,y),G_(m,_),!1}m=m.return}while(m!==null);return!1}var P2=Error(r(461)),Rr=!1;function Ur(o,c,m,y){c.child=o===null?E2(c,null,m,y):rd(c,o.child,m,y)}function I2(o,c,m,y,_){m=m.render;var C=c.ref;if("ref"in y){var $={};for(var q in y)q!=="ref"&&($[q]=y[q])}else $=y;return Tc(c),y=Q_(o,c,m,$,C,_),q=J_(),o!==null&&!Rr?(Z_(o,c,_),ao(o,c,_)):(on&&q&&P_(c),c.flags|=1,Ur(o,c,y,_),c.child)}function D2(o,c,m,y,_){if(o===null){var C=m.type;return typeof C=="function"&&!j_(C)&&C.defaultProps===void 0&&m.compare===null?(c.tag=15,c.type=C,L2(o,c,C,y,_)):(o=Qg(m.type,null,y,c,c.mode,_),o.ref=c.ref,o.return=c,c.child=o)}if(C=o.child,!ww(o,_)){var $=C.memoizedProps;if(m=m.compare,m=m!==null?m:Eh,m($,y)&&o.ref===c.ref)return ao(o,c,_)}return c.flags|=1,o=Za(C,y),o.ref=c.ref,o.return=c,c.child=o}function L2(o,c,m,y,_){if(o!==null){var C=o.memoizedProps;if(Eh(C,y)&&o.ref===c.ref)if(Rr=!1,c.pendingProps=y=C,ww(o,_))(o.flags&131072)!==0&&(Rr=!0);else return c.lanes=o.lanes,ao(o,c,_)}return mw(o,c,m,y,_)}function $2(o,c,m){var y=c.pendingProps,_=y.children,C=o!==null?o.memoizedState:null;if(y.mode==="hidden"){if((c.flags&128)!==0){if(y=C!==null?C.baseLanes|m:m,o!==null){for(_=c.child=o.child,C=0;_!==null;)C=C|_.lanes|_.childLanes,_=_.sibling;c.childLanes=C&~y}else c.childLanes=0,c.child=null;return z2(o,c,y,m)}if((m&536870912)!==0)c.memoizedState={baseLanes:0,cachePool:null},o!==null&&nv(c,C!==null?C.cachePool:null),C!==null?LM(c,C):Y_(),k2(c);else return c.lanes=c.childLanes=536870912,z2(o,c,C!==null?C.baseLanes|m:m,m)}else C!==null?(nv(c,C.cachePool),LM(c,C),nl(),c.memoizedState=null):(o!==null&&nv(c,null),Y_(),nl());return Ur(o,c,_,m),c.child}function z2(o,c,m,y){var _=B_();return _=_===null?null:{parent:_r._currentValue,pool:_},c.memoizedState={baseLanes:m,cachePool:_},o!==null&&nv(c,null),Y_(),k2(c),o!==null&&Nh(o,c,y,!0),null}function bv(o,c){var m=c.ref;if(m===null)o!==null&&o.ref!==null&&(c.flags|=4194816);else{if(typeof m!="function"&&typeof m!="object")throw Error(r(284));(o===null||o.ref!==m)&&(c.flags|=4194816)}}function mw(o,c,m,y,_){return Tc(c),m=Q_(o,c,m,y,void 0,_),y=J_(),o!==null&&!Rr?(Z_(o,c,_),ao(o,c,_)):(on&&y&&P_(c),c.flags|=1,Ur(o,c,m,_),c.child)}function F2(o,c,m,y,_,C){return Tc(c),c.updateQueue=null,m=zM(c,y,m,_),$M(o),y=J_(),o!==null&&!Rr?(Z_(o,c,C),ao(o,c,C)):(on&&y&&P_(c),c.flags|=1,Ur(o,c,m,C),c.child)}function U2(o,c,m,y,_){if(Tc(c),c.stateNode===null){var C=Wu,$=m.contextType;typeof $=="object"&&$!==null&&(C=Jr($)),C=new m(y,C),c.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,C.updater=hw,c.stateNode=C,C._reactInternals=c,C=c.stateNode,C.props=y,C.state=c.memoizedState,C.refs={},V_(c),$=m.contextType,C.context=typeof $=="object"&&$!==null?Jr($):Wu,C.state=c.memoizedState,$=m.getDerivedStateFromProps,typeof $=="function"&&(fw(c,m,$,y),C.state=c.memoizedState),typeof m.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||($=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),$!==C.state&&hw.enqueueReplaceState(C,C.state,null),Dh(c,y,C,_),Ih(),C.state=c.memoizedState),typeof C.componentDidMount=="function"&&(c.flags|=4194308),y=!0}else if(o===null){C=c.stateNode;var q=c.memoizedProps,ee=Nc(m,q);C.props=ee;var de=C.context,we=m.contextType;$=Wu,typeof we=="object"&&we!==null&&($=Jr(we));var ke=m.getDerivedStateFromProps;we=typeof ke=="function"||typeof C.getSnapshotBeforeUpdate=="function",q=c.pendingProps!==q,we||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(q||de!==$)&&C2(c,C,y,$),Qo=!1;var pe=c.memoizedState;C.state=pe,Dh(c,y,C,_),Ih(),de=c.memoizedState,q||pe!==de||Qo?(typeof ke=="function"&&(fw(c,m,ke,y),de=c.memoizedState),(ee=Qo||T2(c,m,ee,y,pe,de,$))?(we||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount()),typeof C.componentDidMount=="function"&&(c.flags|=4194308)):(typeof C.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=y,c.memoizedState=de),C.props=y,C.state=de,C.context=$,y=ee):(typeof C.componentDidMount=="function"&&(c.flags|=4194308),y=!1)}else{C=c.stateNode,H_(o,c),$=c.memoizedProps,we=Nc(m,$),C.props=we,ke=c.pendingProps,pe=C.context,de=m.contextType,ee=Wu,typeof de=="object"&&de!==null&&(ee=Jr(de)),q=m.getDerivedStateFromProps,(de=typeof q=="function"||typeof C.getSnapshotBeforeUpdate=="function")||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||($!==ke||pe!==ee)&&C2(c,C,y,ee),Qo=!1,pe=c.memoizedState,C.state=pe,Dh(c,y,C,_),Ih();var ge=c.memoizedState;$!==ke||pe!==ge||Qo||o!==null&&o.dependencies!==null&&ev(o.dependencies)?(typeof q=="function"&&(fw(c,m,q,y),ge=c.memoizedState),(we=Qo||T2(c,m,we,y,pe,ge,ee)||o!==null&&o.dependencies!==null&&ev(o.dependencies))?(de||typeof C.UNSAFE_componentWillUpdate!="function"&&typeof C.componentWillUpdate!="function"||(typeof C.componentWillUpdate=="function"&&C.componentWillUpdate(y,ge,ee),typeof C.UNSAFE_componentWillUpdate=="function"&&C.UNSAFE_componentWillUpdate(y,ge,ee)),typeof C.componentDidUpdate=="function"&&(c.flags|=4),typeof C.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof C.componentDidUpdate!="function"||$===o.memoizedProps&&pe===o.memoizedState||(c.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||$===o.memoizedProps&&pe===o.memoizedState||(c.flags|=1024),c.memoizedProps=y,c.memoizedState=ge),C.props=y,C.state=ge,C.context=ee,y=we):(typeof C.componentDidUpdate!="function"||$===o.memoizedProps&&pe===o.memoizedState||(c.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||$===o.memoizedProps&&pe===o.memoizedState||(c.flags|=1024),y=!1)}return C=y,bv(o,c),y=(c.flags&128)!==0,C||y?(C=c.stateNode,m=y&&typeof m.getDerivedStateFromError!="function"?null:C.render(),c.flags|=1,o!==null&&y?(c.child=rd(c,o.child,null,_),c.child=rd(c,null,m,_)):Ur(o,c,m,_),c.memoizedState=C.state,o=c.child):o=ao(o,c,_),o}function B2(o,c,m,y){return Ch(),c.flags|=256,Ur(o,c,m,y),c.child}var gw={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function vw(o){return{baseLanes:o,cachePool:NM()}}function yw(o,c,m){return o=o!==null?o.childLanes&~m:0,c&&(o|=pi),o}function q2(o,c,m){var y=c.pendingProps,_=!1,C=(c.flags&128)!==0,$;if(($=C)||($=o!==null&&o.memoizedState===null?!1:(wr.current&2)!==0),$&&(_=!0,c.flags&=-129),$=(c.flags&32)!==0,c.flags&=-33,o===null){if(on){if(_?tl(c):nl(),on){var q=Gn,ee;if(ee=q){e:{for(ee=q,q=pa;ee.nodeType!==8;){if(!q){q=null;break e}if(ee=qi(ee.nextSibling),ee===null){q=null;break e}}q=ee}q!==null?(c.memoizedState={dehydrated:q,treeContext:_c!==null?{id:eo,overflow:to}:null,retryLane:536870912,hydrationErrors:null},ee=Bs(18,null,null,0),ee.stateNode=q,ee.return=c,c.child=ee,os=c,Gn=null,ee=!0):ee=!1}ee||Ec(c)}if(q=c.memoizedState,q!==null&&(q=q.dehydrated,q!==null))return tS(q)?c.lanes=32:c.lanes=536870912,null;io(c)}return q=y.children,y=y.fallback,_?(nl(),_=c.mode,q=xv({mode:"hidden",children:q},_),y=xc(y,_,m,null),q.return=c,y.return=c,q.sibling=y,c.child=q,_=c.child,_.memoizedState=vw(m),_.childLanes=yw(o,$,m),c.memoizedState=gw,y):(tl(c),bw(c,q))}if(ee=o.memoizedState,ee!==null&&(q=ee.dehydrated,q!==null)){if(C)c.flags&256?(tl(c),c.flags&=-257,c=xw(o,c,m)):c.memoizedState!==null?(nl(),c.child=o.child,c.flags|=128,c=null):(nl(),_=y.fallback,q=c.mode,y=xv({mode:"visible",children:y.children},q),_=xc(_,q,m,null),_.flags|=2,y.return=c,_.return=c,y.sibling=_,c.child=y,rd(c,o.child,null,m),y=c.child,y.memoizedState=vw(m),y.childLanes=yw(o,$,m),c.memoizedState=gw,c=_);else if(tl(c),tS(q)){if($=q.nextSibling&&q.nextSibling.dataset,$)var de=$.dgst;$=de,y=Error(r(419)),y.stack="",y.digest=$,Ah({value:y,source:null,stack:null}),c=xw(o,c,m)}else if(Rr||Nh(o,c,m,!1),$=(m&o.childLanes)!==0,Rr||$){if($=wn,$!==null&&(y=m&-m,y=(y&42)!==0?1:$n(y),y=(y&($.suspendedLanes|m))!==0?0:y,y!==0&&y!==ee.retryLane))throw ee.retryLane=y,Gu(o,y),Ws($,o,y),P2;q.data==="$?"||$w(),c=xw(o,c,m)}else q.data==="$?"?(c.flags|=192,c.child=o.child,c=null):(o=ee.treeContext,Gn=qi(q.nextSibling),os=c,on=!0,Sc=null,pa=!1,o!==null&&(di[fi++]=eo,di[fi++]=to,di[fi++]=_c,eo=o.id,to=o.overflow,_c=c),c=bw(c,y.children),c.flags|=4096);return c}return _?(nl(),_=y.fallback,q=c.mode,ee=o.child,de=ee.sibling,y=Za(ee,{mode:"hidden",children:y.children}),y.subtreeFlags=ee.subtreeFlags&65011712,de!==null?_=Za(de,_):(_=xc(_,q,m,null),_.flags|=2),_.return=c,y.return=c,y.sibling=_,c.child=y,y=_,_=c.child,q=o.child.memoizedState,q===null?q=vw(m):(ee=q.cachePool,ee!==null?(de=_r._currentValue,ee=ee.parent!==de?{parent:de,pool:de}:ee):ee=NM(),q={baseLanes:q.baseLanes|m,cachePool:ee}),_.memoizedState=q,_.childLanes=yw(o,$,m),c.memoizedState=gw,y):(tl(c),m=o.child,o=m.sibling,m=Za(m,{mode:"visible",children:y.children}),m.return=c,m.sibling=null,o!==null&&($=c.deletions,$===null?(c.deletions=[o],c.flags|=16):$.push(o)),c.child=m,c.memoizedState=null,m)}function bw(o,c){return c=xv({mode:"visible",children:c},o.mode),c.return=o,o.child=c}function xv(o,c){return o=Bs(22,o,null,c),o.lanes=0,o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},o}function xw(o,c,m){return rd(c,o.child,null,m),o=bw(c,c.pendingProps.children),o.flags|=2,c.memoizedState=null,o}function V2(o,c,m){o.lanes|=c;var y=o.alternate;y!==null&&(y.lanes|=c),$_(o.return,c,m)}function _w(o,c,m,y,_){var C=o.memoizedState;C===null?o.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:y,tail:m,tailMode:_}:(C.isBackwards=c,C.rendering=null,C.renderingStartTime=0,C.last=y,C.tail=m,C.tailMode=_)}function H2(o,c,m){var y=c.pendingProps,_=y.revealOrder,C=y.tail;if(Ur(o,c,y.children,m),y=wr.current,(y&2)!==0)y=y&1|2,c.flags|=128;else{if(o!==null&&(o.flags&128)!==0)e:for(o=c.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&V2(o,m,c);else if(o.tag===19)V2(o,m,c);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===c)break e;for(;o.sibling===null;){if(o.return===null||o.return===c)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}y&=1}switch(D(wr,y),_){case"forwards":for(m=c.child,_=null;m!==null;)o=m.alternate,o!==null&&gv(o)===null&&(_=m),m=m.sibling;m=_,m===null?(_=c.child,c.child=null):(_=m.sibling,m.sibling=null),_w(c,!1,_,m,C);break;case"backwards":for(m=null,_=c.child,c.child=null;_!==null;){if(o=_.alternate,o!==null&&gv(o)===null){c.child=_;break}o=_.sibling,_.sibling=m,m=_,_=o}_w(c,!0,m,null,C);break;case"together":_w(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function ao(o,c,m){if(o!==null&&(c.dependencies=o.dependencies),ol|=c.lanes,(m&c.childLanes)===0)if(o!==null){if(Nh(o,c,m,!1),(m&c.childLanes)===0)return null}else return null;if(o!==null&&c.child!==o.child)throw Error(r(153));if(c.child!==null){for(o=c.child,m=Za(o,o.pendingProps),c.child=m,m.return=c;o.sibling!==null;)o=o.sibling,m=m.sibling=Za(o,o.pendingProps),m.return=c;m.sibling=null}return c.child}function ww(o,c){return(o.lanes&c)!==0?!0:(o=o.dependencies,!!(o!==null&&ev(o)))}function XY(o,c,m){switch(c.tag){case 3:K(c,c.stateNode.containerInfo),Xo(c,_r,o.memoizedState.cache),Ch();break;case 27:case 5:B(c);break;case 4:K(c,c.stateNode.containerInfo);break;case 10:Xo(c,c.type,c.memoizedProps.value);break;case 13:var y=c.memoizedState;if(y!==null)return y.dehydrated!==null?(tl(c),c.flags|=128,null):(m&c.child.childLanes)!==0?q2(o,c,m):(tl(c),o=ao(o,c,m),o!==null?o.sibling:null);tl(c);break;case 19:var _=(o.flags&128)!==0;if(y=(m&c.childLanes)!==0,y||(Nh(o,c,m,!1),y=(m&c.childLanes)!==0),_){if(y)return H2(o,c,m);c.flags|=128}if(_=c.memoizedState,_!==null&&(_.rendering=null,_.tail=null,_.lastEffect=null),D(wr,wr.current),y)break;return null;case 22:case 23:return c.lanes=0,$2(o,c,m);case 24:Xo(c,_r,o.memoizedState.cache)}return ao(o,c,m)}function G2(o,c,m){if(o!==null)if(o.memoizedProps!==c.pendingProps)Rr=!0;else{if(!ww(o,m)&&(c.flags&128)===0)return Rr=!1,XY(o,c,m);Rr=(o.flags&131072)!==0}else Rr=!1,on&&(c.flags&1048576)!==0&&wM(c,Zg,c.index);switch(c.lanes=0,c.tag){case 16:e:{o=c.pendingProps;var y=c.elementType,_=y._init;if(y=_(y._payload),c.type=y,typeof y=="function")j_(y)?(o=Nc(y,o),c.tag=1,c=U2(null,c,y,o,m)):(c.tag=0,c=mw(null,c,y,o,m));else{if(y!=null){if(_=y.$$typeof,_===R){c.tag=11,c=I2(null,c,y,o,m);break e}else if(_===N){c.tag=14,c=D2(null,c,y,o,m);break e}}throw c=W(y)||y,Error(r(306,c,""))}}return c;case 0:return mw(o,c,c.type,c.pendingProps,m);case 1:return y=c.type,_=Nc(y,c.pendingProps),U2(o,c,y,_,m);case 3:e:{if(K(c,c.stateNode.containerInfo),o===null)throw Error(r(387));y=c.pendingProps;var C=c.memoizedState;_=C.element,H_(o,c),Dh(c,y,null,m);var $=c.memoizedState;if(y=$.cache,Xo(c,_r,y),y!==C.cache&&z_(c,[_r],m,!0),Ih(),y=$.element,C.isDehydrated)if(C={element:y,isDehydrated:!1,cache:$.cache},c.updateQueue.baseState=C,c.memoizedState=C,c.flags&256){c=B2(o,c,y,m);break e}else if(y!==_){_=ci(Error(r(424)),c),Ah(_),c=B2(o,c,y,m);break e}else{switch(o=c.stateNode.containerInfo,o.nodeType){case 9:o=o.body;break;default:o=o.nodeName==="HTML"?o.ownerDocument.body:o}for(Gn=qi(o.firstChild),os=c,on=!0,Sc=null,pa=!0,m=E2(c,null,y,m),c.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling}else{if(Ch(),y===_){c=ao(o,c,m);break e}Ur(o,c,y,m)}c=c.child}return c;case 26:return bv(o,c),o===null?(m=XO(c.type,null,c.pendingProps,null))?c.memoizedState=m:on||(m=c.type,o=c.pendingProps,y=Pv(V.current).createElement(m),y[Rn]=c,y[fn]=o,qr(y,m,o),at(y),c.stateNode=y):c.memoizedState=XO(c.type,o.memoizedProps,c.pendingProps,o.memoizedState),null;case 27:return B(c),o===null&&on&&(y=c.stateNode=WO(c.type,c.pendingProps,V.current),os=c,pa=!0,_=Gn,dl(c.type)?(nS=_,Gn=qi(y.firstChild)):Gn=_),Ur(o,c,c.pendingProps.children,m),bv(o,c),o===null&&(c.flags|=4194304),c.child;case 5:return o===null&&on&&((_=y=Gn)&&(y=EK(y,c.type,c.pendingProps,pa),y!==null?(c.stateNode=y,os=c,Gn=qi(y.firstChild),pa=!1,_=!0):_=!1),_||Ec(c)),B(c),_=c.type,C=c.pendingProps,$=o!==null?o.memoizedProps:null,y=C.children,Jw(_,C)?y=null:$!==null&&Jw(_,$)&&(c.flags|=32),c.memoizedState!==null&&(_=Q_(o,c,BY,null,null,m),sp._currentValue=_),bv(o,c),Ur(o,c,y,m),c.child;case 6:return o===null&&on&&((o=m=Gn)&&(m=kK(m,c.pendingProps,pa),m!==null?(c.stateNode=m,os=c,Gn=null,o=!0):o=!1),o||Ec(c)),null;case 13:return q2(o,c,m);case 4:return K(c,c.stateNode.containerInfo),y=c.pendingProps,o===null?c.child=rd(c,null,y,m):Ur(o,c,y,m),c.child;case 11:return I2(o,c,c.type,c.pendingProps,m);case 7:return Ur(o,c,c.pendingProps,m),c.child;case 8:return Ur(o,c,c.pendingProps.children,m),c.child;case 12:return Ur(o,c,c.pendingProps.children,m),c.child;case 10:return y=c.pendingProps,Xo(c,c.type,y.value),Ur(o,c,y.children,m),c.child;case 9:return _=c.type._context,y=c.pendingProps.children,Tc(c),_=Jr(_),y=y(_),c.flags|=1,Ur(o,c,y,m),c.child;case 14:return D2(o,c,c.type,c.pendingProps,m);case 15:return L2(o,c,c.type,c.pendingProps,m);case 19:return H2(o,c,m);case 31:return y=c.pendingProps,m=c.mode,y={mode:y.mode,children:y.children},o===null?(m=xv(y,m),m.ref=c.ref,c.child=m,m.return=c,c=m):(m=Za(o.child,y),m.ref=c.ref,c.child=m,m.return=c,c=m),c;case 22:return $2(o,c,m);case 24:return Tc(c),y=Jr(_r),o===null?(_=B_(),_===null&&(_=wn,C=F_(),_.pooledCache=C,C.refCount++,C!==null&&(_.pooledCacheLanes|=m),_=C),c.memoizedState={parent:y,cache:_},V_(c),Xo(c,_r,_)):((o.lanes&m)!==0&&(H_(o,c),Dh(c,null,null,m),Ih()),_=o.memoizedState,C=c.memoizedState,_.parent!==y?(_={parent:y,cache:y},c.memoizedState=_,c.lanes===0&&(c.memoizedState=c.updateQueue.baseState=_),Xo(c,_r,y)):(y=C.cache,Xo(c,_r,y),y!==_.cache&&z_(c,[_r],m,!0))),Ur(o,c,c.pendingProps.children,m),c.child;case 29:throw c.pendingProps}throw Error(r(156,c.tag))}function oo(o){o.flags|=4}function W2(o,c){if(c.type!=="stylesheet"||(c.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!tP(c)){if(c=hi.current,c!==null&&((Jt&4194048)===Jt?ma!==null:(Jt&62914560)!==Jt&&(Jt&536870912)===0||c!==ma))throw Oh=q_,RM;o.flags|=8192}}function _v(o,c){c!==null&&(o.flags|=4),o.flags&16384&&(c=o.tag!==22?Yo():536870912,o.lanes|=c,od|=c)}function qh(o,c){if(!on)switch(o.tailMode){case"hidden":c=o.tail;for(var m=null;c!==null;)c.alternate!==null&&(m=c),c=c.sibling;m===null?o.tail=null:m.sibling=null;break;case"collapsed":m=o.tail;for(var y=null;m!==null;)m.alternate!==null&&(y=m),m=m.sibling;y===null?c||o.tail===null?o.tail=null:o.tail.sibling=null:y.sibling=null}}function Fn(o){var c=o.alternate!==null&&o.alternate.child===o.child,m=0,y=0;if(c)for(var _=o.child;_!==null;)m|=_.lanes|_.childLanes,y|=_.subtreeFlags&65011712,y|=_.flags&65011712,_.return=o,_=_.sibling;else for(_=o.child;_!==null;)m|=_.lanes|_.childLanes,y|=_.subtreeFlags,y|=_.flags,_.return=o,_=_.sibling;return o.subtreeFlags|=y,o.childLanes=m,c}function QY(o,c,m){var y=c.pendingProps;switch(I_(c),c.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fn(c),null;case 1:return Fn(c),null;case 3:return m=c.stateNode,y=null,o!==null&&(y=o.memoizedState.cache),c.memoizedState.cache!==y&&(c.flags|=2048),ro(_r),ae(),m.pendingContext&&(m.context=m.pendingContext,m.pendingContext=null),(o===null||o.child===null)&&(Th(c)?oo(c):o===null||o.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,kM())),Fn(c),null;case 26:return m=c.memoizedState,o===null?(oo(c),m!==null?(Fn(c),W2(c,m)):(Fn(c),c.flags&=-16777217)):m?m!==o.memoizedState?(oo(c),Fn(c),W2(c,m)):(Fn(c),c.flags&=-16777217):(o.memoizedProps!==y&&oo(c),Fn(c),c.flags&=-16777217),null;case 27:J(c),m=V.current;var _=c.type;if(o!==null&&c.stateNode!=null)o.memoizedProps!==y&&oo(c);else{if(!y){if(c.stateNode===null)throw Error(r(166));return Fn(c),null}o=Z.current,Th(c)?SM(c):(o=WO(_,y,m),c.stateNode=o,oo(c))}return Fn(c),null;case 5:if(J(c),m=c.type,o!==null&&c.stateNode!=null)o.memoizedProps!==y&&oo(c);else{if(!y){if(c.stateNode===null)throw Error(r(166));return Fn(c),null}if(o=Z.current,Th(c))SM(c);else{switch(_=Pv(V.current),o){case 1:o=_.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:o=_.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":o=_.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":o=_.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":o=_.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof y.is=="string"?_.createElement("select",{is:y.is}):_.createElement("select"),y.multiple?o.multiple=!0:y.size&&(o.size=y.size);break;default:o=typeof y.is=="string"?_.createElement(m,{is:y.is}):_.createElement(m)}}o[Rn]=c,o[fn]=y;e:for(_=c.child;_!==null;){if(_.tag===5||_.tag===6)o.appendChild(_.stateNode);else if(_.tag!==4&&_.tag!==27&&_.child!==null){_.child.return=_,_=_.child;continue}if(_===c)break e;for(;_.sibling===null;){if(_.return===null||_.return===c)break e;_=_.return}_.sibling.return=_.return,_=_.sibling}c.stateNode=o;e:switch(qr(o,m,y),m){case"button":case"input":case"select":case"textarea":o=!!y.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&oo(c)}}return Fn(c),c.flags&=-16777217,null;case 6:if(o&&c.stateNode!=null)o.memoizedProps!==y&&oo(c);else{if(typeof y!="string"&&c.stateNode===null)throw Error(r(166));if(o=V.current,Th(c)){if(o=c.stateNode,m=c.memoizedProps,y=null,_=os,_!==null)switch(_.tag){case 27:case 5:y=_.memoizedProps}o[Rn]=c,o=!!(o.nodeValue===m||y!==null&&y.suppressHydrationWarning===!0||FO(o.nodeValue,m)),o||Ec(c)}else o=Pv(o).createTextNode(y),o[Rn]=c,c.stateNode=o}return Fn(c),null;case 13:if(y=c.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(_=Th(c),y!==null&&y.dehydrated!==null){if(o===null){if(!_)throw Error(r(318));if(_=c.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(r(317));_[Rn]=c}else Ch(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Fn(c),_=!1}else _=kM(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=_),_=!0;if(!_)return c.flags&256?(io(c),c):(io(c),null)}if(io(c),(c.flags&128)!==0)return c.lanes=m,c;if(m=y!==null,o=o!==null&&o.memoizedState!==null,m){y=c.child,_=null,y.alternate!==null&&y.alternate.memoizedState!==null&&y.alternate.memoizedState.cachePool!==null&&(_=y.alternate.memoizedState.cachePool.pool);var C=null;y.memoizedState!==null&&y.memoizedState.cachePool!==null&&(C=y.memoizedState.cachePool.pool),C!==_&&(y.flags|=2048)}return m!==o&&m&&(c.child.flags|=8192),_v(c,c.updateQueue),Fn(c),null;case 4:return ae(),o===null&&Ww(c.stateNode.containerInfo),Fn(c),null;case 10:return ro(c.type),Fn(c),null;case 19:if(ue(wr),_=c.memoizedState,_===null)return Fn(c),null;if(y=(c.flags&128)!==0,C=_.rendering,C===null)if(y)qh(_,!1);else{if(Wn!==0||o!==null&&(o.flags&128)!==0)for(o=c.child;o!==null;){if(C=gv(o),C!==null){for(c.flags|=128,qh(_,!1),o=C.updateQueue,c.updateQueue=o,_v(c,o),c.subtreeFlags=0,o=m,m=c.child;m!==null;)_M(m,o),m=m.sibling;return D(wr,wr.current&1|2),c.child}o=o.sibling}_.tail!==null&&Ne()>Ev&&(c.flags|=128,y=!0,qh(_,!1),c.lanes=4194304)}else{if(!y)if(o=gv(C),o!==null){if(c.flags|=128,y=!0,o=o.updateQueue,c.updateQueue=o,_v(c,o),qh(_,!0),_.tail===null&&_.tailMode==="hidden"&&!C.alternate&&!on)return Fn(c),null}else 2*Ne()-_.renderingStartTime>Ev&&m!==536870912&&(c.flags|=128,y=!0,qh(_,!1),c.lanes=4194304);_.isBackwards?(C.sibling=c.child,c.child=C):(o=_.last,o!==null?o.sibling=C:c.child=C,_.last=C)}return _.tail!==null?(c=_.tail,_.rendering=c,_.tail=c.sibling,_.renderingStartTime=Ne(),c.sibling=null,o=wr.current,D(wr,y?o&1|2:o&1),c):(Fn(c),null);case 22:case 23:return io(c),K_(),y=c.memoizedState!==null,o!==null?o.memoizedState!==null!==y&&(c.flags|=8192):y&&(c.flags|=8192),y?(m&536870912)!==0&&(c.flags&128)===0&&(Fn(c),c.subtreeFlags&6&&(c.flags|=8192)):Fn(c),m=c.updateQueue,m!==null&&_v(c,m.retryQueue),m=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(m=o.memoizedState.cachePool.pool),y=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(y=c.memoizedState.cachePool.pool),y!==m&&(c.flags|=2048),o!==null&&ue(Cc),null;case 24:return m=null,o!==null&&(m=o.memoizedState.cache),c.memoizedState.cache!==m&&(c.flags|=2048),ro(_r),Fn(c),null;case 25:return null;case 30:return null}throw Error(r(156,c.tag))}function JY(o,c){switch(I_(c),c.tag){case 1:return o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 3:return ro(_r),ae(),o=c.flags,(o&65536)!==0&&(o&128)===0?(c.flags=o&-65537|128,c):null;case 26:case 27:case 5:return J(c),null;case 13:if(io(c),o=c.memoizedState,o!==null&&o.dehydrated!==null){if(c.alternate===null)throw Error(r(340));Ch()}return o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 19:return ue(wr),null;case 4:return ae(),null;case 10:return ro(c.type),null;case 22:case 23:return io(c),K_(),o!==null&&ue(Cc),o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 24:return ro(_r),null;case 25:return null;default:return null}}function Y2(o,c){switch(I_(c),c.tag){case 3:ro(_r),ae();break;case 26:case 27:case 5:J(c);break;case 4:ae();break;case 13:io(c);break;case 19:ue(wr);break;case 10:ro(c.type);break;case 22:case 23:io(c),K_(),o!==null&&ue(Cc);break;case 24:ro(_r)}}function Vh(o,c){try{var m=c.updateQueue,y=m!==null?m.lastEffect:null;if(y!==null){var _=y.next;m=_;do{if((m.tag&o)===o){y=void 0;var C=m.create,$=m.inst;y=C(),$.destroy=y}m=m.next}while(m!==_)}}catch(q){bn(c,c.return,q)}}function rl(o,c,m){try{var y=c.updateQueue,_=y!==null?y.lastEffect:null;if(_!==null){var C=_.next;y=C;do{if((y.tag&o)===o){var $=y.inst,q=$.destroy;if(q!==void 0){$.destroy=void 0,_=c;var ee=m,de=q;try{de()}catch(we){bn(_,ee,we)}}}y=y.next}while(y!==C)}}catch(we){bn(c,c.return,we)}}function K2(o){var c=o.updateQueue;if(c!==null){var m=o.stateNode;try{DM(c,m)}catch(y){bn(o,o.return,y)}}}function X2(o,c,m){m.props=Nc(o.type,o.memoizedProps),m.state=o.memoizedState;try{m.componentWillUnmount()}catch(y){bn(o,c,y)}}function Hh(o,c){try{var m=o.ref;if(m!==null){switch(o.tag){case 26:case 27:case 5:var y=o.stateNode;break;case 30:y=o.stateNode;break;default:y=o.stateNode}typeof m=="function"?o.refCleanup=m(y):m.current=y}}catch(_){bn(o,c,_)}}function ga(o,c){var m=o.ref,y=o.refCleanup;if(m!==null)if(typeof y=="function")try{y()}catch(_){bn(o,c,_)}finally{o.refCleanup=null,o=o.alternate,o!=null&&(o.refCleanup=null)}else if(typeof m=="function")try{m(null)}catch(_){bn(o,c,_)}else m.current=null}function Q2(o){var c=o.type,m=o.memoizedProps,y=o.stateNode;try{e:switch(c){case"button":case"input":case"select":case"textarea":m.autoFocus&&y.focus();break e;case"img":m.src?y.src=m.src:m.srcSet&&(y.srcset=m.srcSet)}}catch(_){bn(o,o.return,_)}}function Sw(o,c,m){try{var y=o.stateNode;bK(y,o.type,m,c),y[fn]=c}catch(_){bn(o,o.return,_)}}function J2(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&dl(o.type)||o.tag===4}function Ew(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||J2(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.tag===27&&dl(o.type)||o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function kw(o,c,m){var y=o.tag;if(y===5||y===6)o=o.stateNode,c?(m.nodeType===9?m.body:m.nodeName==="HTML"?m.ownerDocument.body:m).insertBefore(o,c):(c=m.nodeType===9?m.body:m.nodeName==="HTML"?m.ownerDocument.body:m,c.appendChild(o),m=m._reactRootContainer,m!=null||c.onclick!==null||(c.onclick=Ov));else if(y!==4&&(y===27&&dl(o.type)&&(m=o.stateNode,c=null),o=o.child,o!==null))for(kw(o,c,m),o=o.sibling;o!==null;)kw(o,c,m),o=o.sibling}function wv(o,c,m){var y=o.tag;if(y===5||y===6)o=o.stateNode,c?m.insertBefore(o,c):m.appendChild(o);else if(y!==4&&(y===27&&dl(o.type)&&(m=o.stateNode),o=o.child,o!==null))for(wv(o,c,m),o=o.sibling;o!==null;)wv(o,c,m),o=o.sibling}function Z2(o){var c=o.stateNode,m=o.memoizedProps;try{for(var y=o.type,_=c.attributes;_.length;)c.removeAttributeNode(_[0]);qr(c,y,m),c[Rn]=o,c[fn]=m}catch(C){bn(o,o.return,C)}}var lo=!1,nr=!1,Tw=!1,eO=typeof WeakSet=="function"?WeakSet:Set,jr=null;function ZY(o,c){if(o=o.containerInfo,Xw=Fv,o=dM(o),E_(o)){if("selectionStart"in o)var m={start:o.selectionStart,end:o.selectionEnd};else e:{m=(m=o.ownerDocument)&&m.defaultView||window;var y=m.getSelection&&m.getSelection();if(y&&y.rangeCount!==0){m=y.anchorNode;var _=y.anchorOffset,C=y.focusNode;y=y.focusOffset;try{m.nodeType,C.nodeType}catch{m=null;break e}var $=0,q=-1,ee=-1,de=0,we=0,ke=o,pe=null;t:for(;;){for(var ge;ke!==m||_!==0&&ke.nodeType!==3||(q=$+_),ke!==C||y!==0&&ke.nodeType!==3||(ee=$+y),ke.nodeType===3&&($+=ke.nodeValue.length),(ge=ke.firstChild)!==null;)pe=ke,ke=ge;for(;;){if(ke===o)break t;if(pe===m&&++de===_&&(q=$),pe===C&&++we===y&&(ee=$),(ge=ke.nextSibling)!==null)break;ke=pe,pe=ke.parentNode}ke=ge}m=q===-1||ee===-1?null:{start:q,end:ee}}else m=null}m=m||{start:0,end:0}}else m=null;for(Qw={focusedElem:o,selectionRange:m},Fv=!1,jr=c;jr!==null;)if(c=jr,o=c.child,(c.subtreeFlags&1024)!==0&&o!==null)o.return=c,jr=o;else for(;jr!==null;){switch(c=jr,C=c.alternate,o=c.flags,c.tag){case 0:break;case 11:case 15:break;case 1:if((o&1024)!==0&&C!==null){o=void 0,m=c,_=C.memoizedProps,C=C.memoizedState,y=m.stateNode;try{var xt=Nc(m.type,_,m.elementType===m.type);o=y.getSnapshotBeforeUpdate(xt,C),y.__reactInternalSnapshotBeforeUpdate=o}catch(ht){bn(m,m.return,ht)}}break;case 3:if((o&1024)!==0){if(o=c.stateNode.containerInfo,m=o.nodeType,m===9)eS(o);else if(m===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":eS(o);break;default:o.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((o&1024)!==0)throw Error(r(163))}if(o=c.sibling,o!==null){o.return=c.return,jr=o;break}jr=c.return}}function tO(o,c,m){var y=m.flags;switch(m.tag){case 0:case 11:case 15:sl(o,m),y&4&&Vh(5,m);break;case 1:if(sl(o,m),y&4)if(o=m.stateNode,c===null)try{o.componentDidMount()}catch($){bn(m,m.return,$)}else{var _=Nc(m.type,c.memoizedProps);c=c.memoizedState;try{o.componentDidUpdate(_,c,o.__reactInternalSnapshotBeforeUpdate)}catch($){bn(m,m.return,$)}}y&64&&K2(m),y&512&&Hh(m,m.return);break;case 3:if(sl(o,m),y&64&&(o=m.updateQueue,o!==null)){if(c=null,m.child!==null)switch(m.child.tag){case 27:case 5:c=m.child.stateNode;break;case 1:c=m.child.stateNode}try{DM(o,c)}catch($){bn(m,m.return,$)}}break;case 27:c===null&&y&4&&Z2(m);case 26:case 5:sl(o,m),c===null&&y&4&&Q2(m),y&512&&Hh(m,m.return);break;case 12:sl(o,m);break;case 13:sl(o,m),y&4&&sO(o,m),y&64&&(o=m.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(m=lK.bind(null,m),TK(o,m))));break;case 22:if(y=m.memoizedState!==null||lo,!y){c=c!==null&&c.memoizedState!==null||nr,_=lo;var C=nr;lo=y,(nr=c)&&!C?il(o,m,(m.subtreeFlags&8772)!==0):sl(o,m),lo=_,nr=C}break;case 30:break;default:sl(o,m)}}function nO(o){var c=o.alternate;c!==null&&(o.alternate=null,nO(c)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(c=o.stateNode,c!==null&&nt(c)),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}var Mn=null,ws=!1;function co(o,c,m){for(m=m.child;m!==null;)rO(o,c,m),m=m.sibling}function rO(o,c,m){if(Te&&typeof Te.onCommitFiberUnmount=="function")try{Te.onCommitFiberUnmount(xe,m)}catch{}switch(m.tag){case 26:nr||ga(m,c),co(o,c,m),m.memoizedState?m.memoizedState.count--:m.stateNode&&(m=m.stateNode,m.parentNode.removeChild(m));break;case 27:nr||ga(m,c);var y=Mn,_=ws;dl(m.type)&&(Mn=m.stateNode,ws=!1),co(o,c,m),ep(m.stateNode),Mn=y,ws=_;break;case 5:nr||ga(m,c);case 6:if(y=Mn,_=ws,Mn=null,co(o,c,m),Mn=y,ws=_,Mn!==null)if(ws)try{(Mn.nodeType===9?Mn.body:Mn.nodeName==="HTML"?Mn.ownerDocument.body:Mn).removeChild(m.stateNode)}catch(C){bn(m,c,C)}else try{Mn.removeChild(m.stateNode)}catch(C){bn(m,c,C)}break;case 18:Mn!==null&&(ws?(o=Mn,HO(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,m.stateNode),lp(o)):HO(Mn,m.stateNode));break;case 4:y=Mn,_=ws,Mn=m.stateNode.containerInfo,ws=!0,co(o,c,m),Mn=y,ws=_;break;case 0:case 11:case 14:case 15:nr||rl(2,m,c),nr||rl(4,m,c),co(o,c,m);break;case 1:nr||(ga(m,c),y=m.stateNode,typeof y.componentWillUnmount=="function"&&X2(m,c,y)),co(o,c,m);break;case 21:co(o,c,m);break;case 22:nr=(y=nr)||m.memoizedState!==null,co(o,c,m),nr=y;break;default:co(o,c,m)}}function sO(o,c){if(c.memoizedState===null&&(o=c.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{lp(o)}catch(m){bn(c,c.return,m)}}function eK(o){switch(o.tag){case 13:case 19:var c=o.stateNode;return c===null&&(c=o.stateNode=new eO),c;case 22:return o=o.stateNode,c=o._retryCache,c===null&&(c=o._retryCache=new eO),c;default:throw Error(r(435,o.tag))}}function Cw(o,c){var m=eK(o);c.forEach(function(y){var _=cK.bind(null,o,y);m.has(y)||(m.add(y),y.then(_,_))})}function qs(o,c){var m=c.deletions;if(m!==null)for(var y=0;y<m.length;y++){var _=m[y],C=o,$=c,q=$;e:for(;q!==null;){switch(q.tag){case 27:if(dl(q.type)){Mn=q.stateNode,ws=!1;break e}break;case 5:Mn=q.stateNode,ws=!1;break e;case 3:case 4:Mn=q.stateNode.containerInfo,ws=!0;break e}q=q.return}if(Mn===null)throw Error(r(160));rO(C,$,_),Mn=null,ws=!1,C=_.alternate,C!==null&&(C.return=null),_.return=null}if(c.subtreeFlags&13878)for(c=c.child;c!==null;)iO(c,o),c=c.sibling}var Bi=null;function iO(o,c){var m=o.alternate,y=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:qs(c,o),Vs(o),y&4&&(rl(3,o,o.return),Vh(3,o),rl(5,o,o.return));break;case 1:qs(c,o),Vs(o),y&512&&(nr||m===null||ga(m,m.return)),y&64&&lo&&(o=o.updateQueue,o!==null&&(y=o.callbacks,y!==null&&(m=o.shared.hiddenCallbacks,o.shared.hiddenCallbacks=m===null?y:m.concat(y))));break;case 26:var _=Bi;if(qs(c,o),Vs(o),y&512&&(nr||m===null||ga(m,m.return)),y&4){var C=m!==null?m.memoizedState:null;if(y=o.memoizedState,m===null)if(y===null)if(o.stateNode===null){e:{y=o.type,m=o.memoizedProps,_=_.ownerDocument||_;t:switch(y){case"title":C=_.getElementsByTagName("title")[0],(!C||C[me]||C[Rn]||C.namespaceURI==="http://www.w3.org/2000/svg"||C.hasAttribute("itemprop"))&&(C=_.createElement(y),_.head.insertBefore(C,_.querySelector("head > title"))),qr(C,y,m),C[Rn]=o,at(C),y=C;break e;case"link":var $=ZO("link","href",_).get(y+(m.href||""));if($){for(var q=0;q<$.length;q++)if(C=$[q],C.getAttribute("href")===(m.href==null||m.href===""?null:m.href)&&C.getAttribute("rel")===(m.rel==null?null:m.rel)&&C.getAttribute("title")===(m.title==null?null:m.title)&&C.getAttribute("crossorigin")===(m.crossOrigin==null?null:m.crossOrigin)){$.splice(q,1);break t}}C=_.createElement(y),qr(C,y,m),_.head.appendChild(C);break;case"meta":if($=ZO("meta","content",_).get(y+(m.content||""))){for(q=0;q<$.length;q++)if(C=$[q],C.getAttribute("content")===(m.content==null?null:""+m.content)&&C.getAttribute("name")===(m.name==null?null:m.name)&&C.getAttribute("property")===(m.property==null?null:m.property)&&C.getAttribute("http-equiv")===(m.httpEquiv==null?null:m.httpEquiv)&&C.getAttribute("charset")===(m.charSet==null?null:m.charSet)){$.splice(q,1);break t}}C=_.createElement(y),qr(C,y,m),_.head.appendChild(C);break;default:throw Error(r(468,y))}C[Rn]=o,at(C),y=C}o.stateNode=y}else eP(_,o.type,o.stateNode);else o.stateNode=JO(_,y,o.memoizedProps);else C!==y?(C===null?m.stateNode!==null&&(m=m.stateNode,m.parentNode.removeChild(m)):C.count--,y===null?eP(_,o.type,o.stateNode):JO(_,y,o.memoizedProps)):y===null&&o.stateNode!==null&&Sw(o,o.memoizedProps,m.memoizedProps)}break;case 27:qs(c,o),Vs(o),y&512&&(nr||m===null||ga(m,m.return)),m!==null&&y&4&&Sw(o,o.memoizedProps,m.memoizedProps);break;case 5:if(qs(c,o),Vs(o),y&512&&(nr||m===null||ga(m,m.return)),o.flags&32){_=o.stateNode;try{zu(_,"")}catch(ge){bn(o,o.return,ge)}}y&4&&o.stateNode!=null&&(_=o.memoizedProps,Sw(o,_,m!==null?m.memoizedProps:_)),y&1024&&(Tw=!0);break;case 6:if(qs(c,o),Vs(o),y&4){if(o.stateNode===null)throw Error(r(162));y=o.memoizedProps,m=o.stateNode;try{m.nodeValue=y}catch(ge){bn(o,o.return,ge)}}break;case 3:if(Lv=null,_=Bi,Bi=Iv(c.containerInfo),qs(c,o),Bi=_,Vs(o),y&4&&m!==null&&m.memoizedState.isDehydrated)try{lp(c.containerInfo)}catch(ge){bn(o,o.return,ge)}Tw&&(Tw=!1,aO(o));break;case 4:y=Bi,Bi=Iv(o.stateNode.containerInfo),qs(c,o),Vs(o),Bi=y;break;case 12:qs(c,o),Vs(o);break;case 13:qs(c,o),Vs(o),o.child.flags&8192&&o.memoizedState!==null!=(m!==null&&m.memoizedState!==null)&&(Ow=Ne()),y&4&&(y=o.updateQueue,y!==null&&(o.updateQueue=null,Cw(o,y)));break;case 22:_=o.memoizedState!==null;var ee=m!==null&&m.memoizedState!==null,de=lo,we=nr;if(lo=de||_,nr=we||ee,qs(c,o),nr=we,lo=de,Vs(o),y&8192)e:for(c=o.stateNode,c._visibility=_?c._visibility&-2:c._visibility|1,_&&(m===null||ee||lo||nr||Rc(o)),m=null,c=o;;){if(c.tag===5||c.tag===26){if(m===null){ee=m=c;try{if(C=ee.stateNode,_)$=C.style,typeof $.setProperty=="function"?$.setProperty("display","none","important"):$.display="none";else{q=ee.stateNode;var ke=ee.memoizedProps.style,pe=ke!=null&&ke.hasOwnProperty("display")?ke.display:null;q.style.display=pe==null||typeof pe=="boolean"?"":(""+pe).trim()}}catch(ge){bn(ee,ee.return,ge)}}}else if(c.tag===6){if(m===null){ee=c;try{ee.stateNode.nodeValue=_?"":ee.memoizedProps}catch(ge){bn(ee,ee.return,ge)}}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===o)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===o)break e;for(;c.sibling===null;){if(c.return===null||c.return===o)break e;m===c&&(m=null),c=c.return}m===c&&(m=null),c.sibling.return=c.return,c=c.sibling}y&4&&(y=o.updateQueue,y!==null&&(m=y.retryQueue,m!==null&&(y.retryQueue=null,Cw(o,m))));break;case 19:qs(c,o),Vs(o),y&4&&(y=o.updateQueue,y!==null&&(o.updateQueue=null,Cw(o,y)));break;case 30:break;case 21:break;default:qs(c,o),Vs(o)}}function Vs(o){var c=o.flags;if(c&2){try{for(var m,y=o.return;y!==null;){if(J2(y)){m=y;break}y=y.return}if(m==null)throw Error(r(160));switch(m.tag){case 27:var _=m.stateNode,C=Ew(o);wv(o,C,_);break;case 5:var $=m.stateNode;m.flags&32&&(zu($,""),m.flags&=-33);var q=Ew(o);wv(o,q,$);break;case 3:case 4:var ee=m.stateNode.containerInfo,de=Ew(o);kw(o,de,ee);break;default:throw Error(r(161))}}catch(we){bn(o,o.return,we)}o.flags&=-3}c&4096&&(o.flags&=-4097)}function aO(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var c=o;aO(c),c.tag===5&&c.flags&1024&&c.stateNode.reset(),o=o.sibling}}function sl(o,c){if(c.subtreeFlags&8772)for(c=c.child;c!==null;)tO(o,c.alternate,c),c=c.sibling}function Rc(o){for(o=o.child;o!==null;){var c=o;switch(c.tag){case 0:case 11:case 14:case 15:rl(4,c,c.return),Rc(c);break;case 1:ga(c,c.return);var m=c.stateNode;typeof m.componentWillUnmount=="function"&&X2(c,c.return,m),Rc(c);break;case 27:ep(c.stateNode);case 26:case 5:ga(c,c.return),Rc(c);break;case 22:c.memoizedState===null&&Rc(c);break;case 30:Rc(c);break;default:Rc(c)}o=o.sibling}}function il(o,c,m){for(m=m&&(c.subtreeFlags&8772)!==0,c=c.child;c!==null;){var y=c.alternate,_=o,C=c,$=C.flags;switch(C.tag){case 0:case 11:case 15:il(_,C,m),Vh(4,C);break;case 1:if(il(_,C,m),y=C,_=y.stateNode,typeof _.componentDidMount=="function")try{_.componentDidMount()}catch(de){bn(y,y.return,de)}if(y=C,_=y.updateQueue,_!==null){var q=y.stateNode;try{var ee=_.shared.hiddenCallbacks;if(ee!==null)for(_.shared.hiddenCallbacks=null,_=0;_<ee.length;_++)IM(ee[_],q)}catch(de){bn(y,y.return,de)}}m&&$&64&&K2(C),Hh(C,C.return);break;case 27:Z2(C);case 26:case 5:il(_,C,m),m&&y===null&&$&4&&Q2(C),Hh(C,C.return);break;case 12:il(_,C,m);break;case 13:il(_,C,m),m&&$&4&&sO(_,C);break;case 22:C.memoizedState===null&&il(_,C,m),Hh(C,C.return);break;case 30:break;default:il(_,C,m)}c=c.sibling}}function Aw(o,c){var m=null;o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(m=o.memoizedState.cachePool.pool),o=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(o=c.memoizedState.cachePool.pool),o!==m&&(o!=null&&o.refCount++,m!=null&&Rh(m))}function Nw(o,c){o=null,c.alternate!==null&&(o=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==o&&(c.refCount++,o!=null&&Rh(o))}function va(o,c,m,y){if(c.subtreeFlags&10256)for(c=c.child;c!==null;)oO(o,c,m,y),c=c.sibling}function oO(o,c,m,y){var _=c.flags;switch(c.tag){case 0:case 11:case 15:va(o,c,m,y),_&2048&&Vh(9,c);break;case 1:va(o,c,m,y);break;case 3:va(o,c,m,y),_&2048&&(o=null,c.alternate!==null&&(o=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==o&&(c.refCount++,o!=null&&Rh(o)));break;case 12:if(_&2048){va(o,c,m,y),o=c.stateNode;try{var C=c.memoizedProps,$=C.id,q=C.onPostCommit;typeof q=="function"&&q($,c.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(ee){bn(c,c.return,ee)}}else va(o,c,m,y);break;case 13:va(o,c,m,y);break;case 23:break;case 22:C=c.stateNode,$=c.alternate,c.memoizedState!==null?C._visibility&2?va(o,c,m,y):Gh(o,c):C._visibility&2?va(o,c,m,y):(C._visibility|=2,sd(o,c,m,y,(c.subtreeFlags&10256)!==0)),_&2048&&Aw($,c);break;case 24:va(o,c,m,y),_&2048&&Nw(c.alternate,c);break;default:va(o,c,m,y)}}function sd(o,c,m,y,_){for(_=_&&(c.subtreeFlags&10256)!==0,c=c.child;c!==null;){var C=o,$=c,q=m,ee=y,de=$.flags;switch($.tag){case 0:case 11:case 15:sd(C,$,q,ee,_),Vh(8,$);break;case 23:break;case 22:var we=$.stateNode;$.memoizedState!==null?we._visibility&2?sd(C,$,q,ee,_):Gh(C,$):(we._visibility|=2,sd(C,$,q,ee,_)),_&&de&2048&&Aw($.alternate,$);break;case 24:sd(C,$,q,ee,_),_&&de&2048&&Nw($.alternate,$);break;default:sd(C,$,q,ee,_)}c=c.sibling}}function Gh(o,c){if(c.subtreeFlags&10256)for(c=c.child;c!==null;){var m=o,y=c,_=y.flags;switch(y.tag){case 22:Gh(m,y),_&2048&&Aw(y.alternate,y);break;case 24:Gh(m,y),_&2048&&Nw(y.alternate,y);break;default:Gh(m,y)}c=c.sibling}}var Wh=8192;function id(o){if(o.subtreeFlags&Wh)for(o=o.child;o!==null;)lO(o),o=o.sibling}function lO(o){switch(o.tag){case 26:id(o),o.flags&Wh&&o.memoizedState!==null&&zK(Bi,o.memoizedState,o.memoizedProps);break;case 5:id(o);break;case 3:case 4:var c=Bi;Bi=Iv(o.stateNode.containerInfo),id(o),Bi=c;break;case 22:o.memoizedState===null&&(c=o.alternate,c!==null&&c.memoizedState!==null?(c=Wh,Wh=16777216,id(o),Wh=c):id(o));break;default:id(o)}}function cO(o){var c=o.alternate;if(c!==null&&(o=c.child,o!==null)){c.child=null;do c=o.sibling,o.sibling=null,o=c;while(o!==null)}}function Yh(o){var c=o.deletions;if((o.flags&16)!==0){if(c!==null)for(var m=0;m<c.length;m++){var y=c[m];jr=y,dO(y,o)}cO(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)uO(o),o=o.sibling}function uO(o){switch(o.tag){case 0:case 11:case 15:Yh(o),o.flags&2048&&rl(9,o,o.return);break;case 3:Yh(o);break;case 12:Yh(o);break;case 22:var c=o.stateNode;o.memoizedState!==null&&c._visibility&2&&(o.return===null||o.return.tag!==13)?(c._visibility&=-3,Sv(o)):Yh(o);break;default:Yh(o)}}function Sv(o){var c=o.deletions;if((o.flags&16)!==0){if(c!==null)for(var m=0;m<c.length;m++){var y=c[m];jr=y,dO(y,o)}cO(o)}for(o=o.child;o!==null;){switch(c=o,c.tag){case 0:case 11:case 15:rl(8,c,c.return),Sv(c);break;case 22:m=c.stateNode,m._visibility&2&&(m._visibility&=-3,Sv(c));break;default:Sv(c)}o=o.sibling}}function dO(o,c){for(;jr!==null;){var m=jr;switch(m.tag){case 0:case 11:case 15:rl(8,m,c);break;case 23:case 22:if(m.memoizedState!==null&&m.memoizedState.cachePool!==null){var y=m.memoizedState.cachePool.pool;y!=null&&y.refCount++}break;case 24:Rh(m.memoizedState.cache)}if(y=m.child,y!==null)y.return=m,jr=y;else e:for(m=o;jr!==null;){y=jr;var _=y.sibling,C=y.return;if(nO(y),y===m){jr=null;break e}if(_!==null){_.return=C,jr=_;break e}jr=C}}}var tK={getCacheForType:function(o){var c=Jr(_r),m=c.data.get(o);return m===void 0&&(m=o(),c.data.set(o,m)),m}},nK=typeof WeakMap=="function"?WeakMap:Map,cn=0,wn=null,Bt=null,Jt=0,un=0,Hs=null,al=!1,ad=!1,Rw=!1,uo=0,Wn=0,ol=0,jc=0,jw=0,pi=0,od=0,Kh=null,Ss=null,Mw=!1,Ow=0,Ev=1/0,kv=null,ll=null,Br=0,cl=null,ld=null,cd=0,Pw=0,Iw=null,fO=null,Xh=0,Dw=null;function Gs(){if((cn&2)!==0&&Jt!==0)return Jt&-Jt;if(F.T!==null){var o=Xu;return o!==0?o:qw()}return $i()}function hO(){pi===0&&(pi=(Jt&536870912)===0||on?br():536870912);var o=hi.current;return o!==null&&(o.flags|=32),pi}function Ws(o,c,m){(o===wn&&(un===2||un===9)||o.cancelPendingCommit!==null)&&(ud(o,0),ul(o,Jt,pi,!1)),fa(o,m),((cn&2)===0||o!==wn)&&(o===wn&&((cn&2)===0&&(jc|=m),Wn===4&&ul(o,Jt,pi,!1)),ya(o))}function pO(o,c,m){if((cn&6)!==0)throw Error(r(327));var y=!m&&(c&124)===0&&(c&o.expiredLanes)===0||Qt(o,c),_=y?iK(o,c):zw(o,c,!0),C=y;do{if(_===0){ad&&!y&&ul(o,c,0,!1);break}else{if(m=o.current.alternate,C&&!rK(m)){_=zw(o,c,!1),C=!1;continue}if(_===2){if(C=c,o.errorRecoveryDisabledLanes&C)var $=0;else $=o.pendingLanes&-536870913,$=$!==0?$:$&536870912?536870912:0;if($!==0){c=$;e:{var q=o;_=Kh;var ee=q.current.memoizedState.isDehydrated;if(ee&&(ud(q,$).flags|=256),$=zw(q,$,!1),$!==2){if(Rw&&!ee){q.errorRecoveryDisabledLanes|=C,jc|=C,_=4;break e}C=Ss,Ss=_,C!==null&&(Ss===null?Ss=C:Ss.push.apply(Ss,C))}_=$}if(C=!1,_!==2)continue}}if(_===1){ud(o,0),ul(o,c,0,!0);break}e:{switch(y=o,C=_,C){case 0:case 1:throw Error(r(345));case 4:if((c&4194048)!==c)break;case 6:ul(y,c,pi,!al);break e;case 2:Ss=null;break;case 3:case 5:break;default:throw Error(r(329))}if((c&62914560)===c&&(_=Ow+300-Ne(),10<_)){if(ul(y,c,pi,!al),vt(y,0,!0)!==0)break e;y.timeoutHandle=qO(mO.bind(null,y,m,Ss,kv,Mw,c,pi,jc,od,al,C,2,-0,0),_);break e}mO(y,m,Ss,kv,Mw,c,pi,jc,od,al,C,0,-0,0)}}break}while(!0);ya(o)}function mO(o,c,m,y,_,C,$,q,ee,de,we,ke,pe,ge){if(o.timeoutHandle=-1,ke=c.subtreeFlags,(ke&8192||(ke&16785408)===16785408)&&(rp={stylesheets:null,count:0,unsuspend:$K},lO(c),ke=FK(),ke!==null)){o.cancelPendingCommit=ke(wO.bind(null,o,c,C,m,y,_,$,q,ee,we,1,pe,ge)),ul(o,C,$,!de);return}wO(o,c,C,m,y,_,$,q,ee)}function rK(o){for(var c=o;;){var m=c.tag;if((m===0||m===11||m===15)&&c.flags&16384&&(m=c.updateQueue,m!==null&&(m=m.stores,m!==null)))for(var y=0;y<m.length;y++){var _=m[y],C=_.getSnapshot;_=_.value;try{if(!Us(C(),_))return!1}catch{return!1}}if(m=c.child,c.subtreeFlags&16384&&m!==null)m.return=c,c=m;else{if(c===o)break;for(;c.sibling===null;){if(c.return===null||c.return===o)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function ul(o,c,m,y){c&=~jw,c&=~jc,o.suspendedLanes|=c,o.pingedLanes&=~c,y&&(o.warmLanes|=c),y=o.expirationTimes;for(var _=c;0<_;){var C=31-qe(_),$=1<<C;y[C]=-1,_&=~$}m!==0&&ft(o,m,c)}function Tv(){return(cn&6)===0?(Qh(0),!1):!0}function Lw(){if(Bt!==null){if(un===0)var o=Bt.return;else o=Bt,no=kc=null,ew(o),nd=null,Uh=0,o=Bt;for(;o!==null;)Y2(o.alternate,o),o=o.return;Bt=null}}function ud(o,c){var m=o.timeoutHandle;m!==-1&&(o.timeoutHandle=-1,_K(m)),m=o.cancelPendingCommit,m!==null&&(o.cancelPendingCommit=null,m()),Lw(),wn=o,Bt=m=Za(o.current,null),Jt=c,un=0,Hs=null,al=!1,ad=Qt(o,c),Rw=!1,od=pi=jw=jc=ol=Wn=0,Ss=Kh=null,Mw=!1,(c&8)!==0&&(c|=c&32);var y=o.entangledLanes;if(y!==0)for(o=o.entanglements,y&=c;0<y;){var _=31-qe(y),C=1<<_;c|=o[_],y&=~C}return uo=c,Yg(),m}function gO(o,c){$t=null,F.H=hv,c===Mh||c===rv?(c=OM(),un=3):c===RM?(c=OM(),un=4):un=c===P2?8:c!==null&&typeof c=="object"&&typeof c.then=="function"?6:1,Hs=c,Bt===null&&(Wn=1,yv(o,ci(c,o.current)))}function vO(){var o=F.H;return F.H=hv,o===null?hv:o}function yO(){var o=F.A;return F.A=tK,o}function $w(){Wn=4,al||(Jt&4194048)!==Jt&&hi.current!==null||(ad=!0),(ol&134217727)===0&&(jc&134217727)===0||wn===null||ul(wn,Jt,pi,!1)}function zw(o,c,m){var y=cn;cn|=2;var _=vO(),C=yO();(wn!==o||Jt!==c)&&(kv=null,ud(o,c)),c=!1;var $=Wn;e:do try{if(un!==0&&Bt!==null){var q=Bt,ee=Hs;switch(un){case 8:Lw(),$=6;break e;case 3:case 2:case 9:case 6:hi.current===null&&(c=!0);var de=un;if(un=0,Hs=null,dd(o,q,ee,de),m&&ad){$=0;break e}break;default:de=un,un=0,Hs=null,dd(o,q,ee,de)}}sK(),$=Wn;break}catch(we){gO(o,we)}while(!0);return c&&o.shellSuspendCounter++,no=kc=null,cn=y,F.H=_,F.A=C,Bt===null&&(wn=null,Jt=0,Yg()),$}function sK(){for(;Bt!==null;)bO(Bt)}function iK(o,c){var m=cn;cn|=2;var y=vO(),_=yO();wn!==o||Jt!==c?(kv=null,Ev=Ne()+500,ud(o,c)):ad=Qt(o,c);e:do try{if(un!==0&&Bt!==null){c=Bt;var C=Hs;t:switch(un){case 1:un=0,Hs=null,dd(o,c,C,1);break;case 2:case 9:if(jM(C)){un=0,Hs=null,xO(c);break}c=function(){un!==2&&un!==9||wn!==o||(un=7),ya(o)},C.then(c,c);break e;case 3:un=7;break e;case 4:un=5;break e;case 7:jM(C)?(un=0,Hs=null,xO(c)):(un=0,Hs=null,dd(o,c,C,7));break;case 5:var $=null;switch(Bt.tag){case 26:$=Bt.memoizedState;case 5:case 27:var q=Bt;if(!$||tP($)){un=0,Hs=null;var ee=q.sibling;if(ee!==null)Bt=ee;else{var de=q.return;de!==null?(Bt=de,Cv(de)):Bt=null}break t}}un=0,Hs=null,dd(o,c,C,5);break;case 6:un=0,Hs=null,dd(o,c,C,6);break;case 8:Lw(),Wn=6;break e;default:throw Error(r(462))}}aK();break}catch(we){gO(o,we)}while(!0);return no=kc=null,F.H=y,F.A=_,cn=m,Bt!==null?0:(wn=null,Jt=0,Yg(),Wn)}function aK(){for(;Bt!==null&&!Ae();)bO(Bt)}function bO(o){var c=G2(o.alternate,o,uo);o.memoizedProps=o.pendingProps,c===null?Cv(o):Bt=c}function xO(o){var c=o,m=c.alternate;switch(c.tag){case 15:case 0:c=F2(m,c,c.pendingProps,c.type,void 0,Jt);break;case 11:c=F2(m,c,c.pendingProps,c.type.render,c.ref,Jt);break;case 5:ew(c);default:Y2(m,c),c=Bt=_M(c,uo),c=G2(m,c,uo)}o.memoizedProps=o.pendingProps,c===null?Cv(o):Bt=c}function dd(o,c,m,y){no=kc=null,ew(c),nd=null,Uh=0;var _=c.return;try{if(KY(o,_,c,m,Jt)){Wn=1,yv(o,ci(m,o.current)),Bt=null;return}}catch(C){if(_!==null)throw Bt=_,C;Wn=1,yv(o,ci(m,o.current)),Bt=null;return}c.flags&32768?(on||y===1?o=!0:ad||(Jt&536870912)!==0?o=!1:(al=o=!0,(y===2||y===9||y===3||y===6)&&(y=hi.current,y!==null&&y.tag===13&&(y.flags|=16384))),_O(c,o)):Cv(c)}function Cv(o){var c=o;do{if((c.flags&32768)!==0){_O(c,al);return}o=c.return;var m=QY(c.alternate,c,uo);if(m!==null){Bt=m;return}if(c=c.sibling,c!==null){Bt=c;return}Bt=c=o}while(c!==null);Wn===0&&(Wn=5)}function _O(o,c){do{var m=JY(o.alternate,o);if(m!==null){m.flags&=32767,Bt=m;return}if(m=o.return,m!==null&&(m.flags|=32768,m.subtreeFlags=0,m.deletions=null),!c&&(o=o.sibling,o!==null)){Bt=o;return}Bt=o=m}while(o!==null);Wn=6,Bt=null}function wO(o,c,m,y,_,C,$,q,ee){o.cancelPendingCommit=null;do Av();while(Br!==0);if((cn&6)!==0)throw Error(r(327));if(c!==null){if(c===o.current)throw Error(r(177));if(C=c.lanes|c.childLanes,C|=N_,Du(o,m,C,$,q,ee),o===wn&&(Bt=wn=null,Jt=0),ld=c,cl=o,cd=m,Pw=C,Iw=_,fO=y,(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,uK(pt,function(){return CO(),null})):(o.callbackNode=null,o.callbackPriority=0),y=(c.flags&13878)!==0,(c.subtreeFlags&13878)!==0||y){y=F.T,F.T=null,_=Y.p,Y.p=2,$=cn,cn|=4;try{ZY(o,c,m)}finally{cn=$,Y.p=_,F.T=y}}Br=1,SO(),EO(),kO()}}function SO(){if(Br===1){Br=0;var o=cl,c=ld,m=(c.flags&13878)!==0;if((c.subtreeFlags&13878)!==0||m){m=F.T,F.T=null;var y=Y.p;Y.p=2;var _=cn;cn|=4;try{iO(c,o);var C=Qw,$=dM(o.containerInfo),q=C.focusedElem,ee=C.selectionRange;if($!==q&&q&&q.ownerDocument&&uM(q.ownerDocument.documentElement,q)){if(ee!==null&&E_(q)){var de=ee.start,we=ee.end;if(we===void 0&&(we=de),"selectionStart"in q)q.selectionStart=de,q.selectionEnd=Math.min(we,q.value.length);else{var ke=q.ownerDocument||document,pe=ke&&ke.defaultView||window;if(pe.getSelection){var ge=pe.getSelection(),xt=q.textContent.length,ht=Math.min(ee.start,xt),gn=ee.end===void 0?ht:Math.min(ee.end,xt);!ge.extend&&ht>gn&&($=gn,gn=ht,ht=$);var le=cM(q,ht),ie=cM(q,gn);if(le&&ie&&(ge.rangeCount!==1||ge.anchorNode!==le.node||ge.anchorOffset!==le.offset||ge.focusNode!==ie.node||ge.focusOffset!==ie.offset)){var ce=ke.createRange();ce.setStart(le.node,le.offset),ge.removeAllRanges(),ht>gn?(ge.addRange(ce),ge.extend(ie.node,ie.offset)):(ce.setEnd(ie.node,ie.offset),ge.addRange(ce))}}}}for(ke=[],ge=q;ge=ge.parentNode;)ge.nodeType===1&&ke.push({element:ge,left:ge.scrollLeft,top:ge.scrollTop});for(typeof q.focus=="function"&&q.focus(),q=0;q<ke.length;q++){var Se=ke[q];Se.element.scrollLeft=Se.left,Se.element.scrollTop=Se.top}}Fv=!!Xw,Qw=Xw=null}finally{cn=_,Y.p=y,F.T=m}}o.current=c,Br=2}}function EO(){if(Br===2){Br=0;var o=cl,c=ld,m=(c.flags&8772)!==0;if((c.subtreeFlags&8772)!==0||m){m=F.T,F.T=null;var y=Y.p;Y.p=2;var _=cn;cn|=4;try{tO(o,c.alternate,c)}finally{cn=_,Y.p=y,F.T=m}}Br=3}}function kO(){if(Br===4||Br===3){Br=0,Oe();var o=cl,c=ld,m=cd,y=fO;(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?Br=5:(Br=0,ld=cl=null,TO(o,o.pendingLanes));var _=o.pendingLanes;if(_===0&&(ll=null),xr(m),c=c.stateNode,Te&&typeof Te.onCommitFiberRoot=="function")try{Te.onCommitFiberRoot(xe,c,void 0,(c.current.flags&128)===128)}catch{}if(y!==null){c=F.T,_=Y.p,Y.p=2,F.T=null;try{for(var C=o.onRecoverableError,$=0;$<y.length;$++){var q=y[$];C(q.value,{componentStack:q.stack})}}finally{F.T=c,Y.p=_}}(cd&3)!==0&&Av(),ya(o),_=o.pendingLanes,(m&4194090)!==0&&(_&42)!==0?o===Dw?Xh++:(Xh=0,Dw=o):Xh=0,Qh(0)}}function TO(o,c){(o.pooledCacheLanes&=c)===0&&(c=o.pooledCache,c!=null&&(o.pooledCache=null,Rh(c)))}function Av(o){return SO(),EO(),kO(),CO()}function CO(){if(Br!==5)return!1;var o=cl,c=Pw;Pw=0;var m=xr(cd),y=F.T,_=Y.p;try{Y.p=32>m?32:m,F.T=null,m=Iw,Iw=null;var C=cl,$=cd;if(Br=0,ld=cl=null,cd=0,(cn&6)!==0)throw Error(r(331));var q=cn;if(cn|=4,uO(C.current),oO(C,C.current,$,m),cn=q,Qh(0,!1),Te&&typeof Te.onPostCommitFiberRoot=="function")try{Te.onPostCommitFiberRoot(xe,C)}catch{}return!0}finally{Y.p=_,F.T=y,TO(o,c)}}function AO(o,c,m){c=ci(m,c),c=pw(o.stateNode,c,2),o=Zo(o,c,2),o!==null&&(fa(o,2),ya(o))}function bn(o,c,m){if(o.tag===3)AO(o,o,m);else for(;c!==null;){if(c.tag===3){AO(c,o,m);break}else if(c.tag===1){var y=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(ll===null||!ll.has(y))){o=ci(m,o),m=M2(2),y=Zo(c,m,2),y!==null&&(O2(m,y,c,o),fa(y,2),ya(y));break}}c=c.return}}function Fw(o,c,m){var y=o.pingCache;if(y===null){y=o.pingCache=new nK;var _=new Set;y.set(c,_)}else _=y.get(c),_===void 0&&(_=new Set,y.set(c,_));_.has(m)||(Rw=!0,_.add(m),o=oK.bind(null,o,c,m),c.then(o,o))}function oK(o,c,m){var y=o.pingCache;y!==null&&y.delete(c),o.pingedLanes|=o.suspendedLanes&m,o.warmLanes&=~m,wn===o&&(Jt&m)===m&&(Wn===4||Wn===3&&(Jt&62914560)===Jt&&300>Ne()-Ow?(cn&2)===0&&ud(o,0):jw|=m,od===Jt&&(od=0)),ya(o)}function NO(o,c){c===0&&(c=Yo()),o=Gu(o,c),o!==null&&(fa(o,c),ya(o))}function lK(o){var c=o.memoizedState,m=0;c!==null&&(m=c.retryLane),NO(o,m)}function cK(o,c){var m=0;switch(o.tag){case 13:var y=o.stateNode,_=o.memoizedState;_!==null&&(m=_.retryLane);break;case 19:y=o.stateNode;break;case 22:y=o.stateNode._retryCache;break;default:throw Error(r(314))}y!==null&&y.delete(c),NO(o,m)}function uK(o,c){return fe(o,c)}var Nv=null,fd=null,Uw=!1,Rv=!1,Bw=!1,Mc=0;function ya(o){o!==fd&&o.next===null&&(fd===null?Nv=fd=o:fd=fd.next=o),Rv=!0,Uw||(Uw=!0,fK())}function Qh(o,c){if(!Bw&&Rv){Bw=!0;do for(var m=!1,y=Nv;y!==null;){if(o!==0){var _=y.pendingLanes;if(_===0)var C=0;else{var $=y.suspendedLanes,q=y.pingedLanes;C=(1<<31-qe(42|o)+1)-1,C&=_&~($&~q),C=C&201326741?C&201326741|1:C?C|2:0}C!==0&&(m=!0,OO(y,C))}else C=Jt,C=vt(y,y===wn?C:0,y.cancelPendingCommit!==null||y.timeoutHandle!==-1),(C&3)===0||Qt(y,C)||(m=!0,OO(y,C));y=y.next}while(m);Bw=!1}}function dK(){RO()}function RO(){Rv=Uw=!1;var o=0;Mc!==0&&(xK()&&(o=Mc),Mc=0);for(var c=Ne(),m=null,y=Nv;y!==null;){var _=y.next,C=jO(y,c);C===0?(y.next=null,m===null?Nv=_:m.next=_,_===null&&(fd=m)):(m=y,(o!==0||(C&3)!==0)&&(Rv=!0)),y=_}Qh(o)}function jO(o,c){for(var m=o.suspendedLanes,y=o.pingedLanes,_=o.expirationTimes,C=o.pendingLanes&-62914561;0<C;){var $=31-qe(C),q=1<<$,ee=_[$];ee===-1?((q&m)===0||(q&y)!==0)&&(_[$]=cr(q,c)):ee<=c&&(o.expiredLanes|=q),C&=~q}if(c=wn,m=Jt,m=vt(o,o===c?m:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),y=o.callbackNode,m===0||o===c&&(un===2||un===9)||o.cancelPendingCommit!==null)return y!==null&&y!==null&&be(y),o.callbackNode=null,o.callbackPriority=0;if((m&3)===0||Qt(o,m)){if(c=m&-m,c===o.callbackPriority)return c;switch(y!==null&&be(y),xr(m)){case 2:case 8:m=Be;break;case 32:m=pt;break;case 268435456:m=et;break;default:m=pt}return y=MO.bind(null,o),m=fe(m,y),o.callbackPriority=c,o.callbackNode=m,c}return y!==null&&y!==null&&be(y),o.callbackPriority=2,o.callbackNode=null,2}function MO(o,c){if(Br!==0&&Br!==5)return o.callbackNode=null,o.callbackPriority=0,null;var m=o.callbackNode;if(Av()&&o.callbackNode!==m)return null;var y=Jt;return y=vt(o,o===wn?y:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),y===0?null:(pO(o,y,c),jO(o,Ne()),o.callbackNode!=null&&o.callbackNode===m?MO.bind(null,o):null)}function OO(o,c){if(Av())return null;pO(o,c,!0)}function fK(){wK(function(){(cn&6)!==0?fe(dt,dK):RO()})}function qw(){return Mc===0&&(Mc=br()),Mc}function PO(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:Ug(""+o)}function IO(o,c){var m=c.ownerDocument.createElement("input");return m.name=c.name,m.value=c.value,o.id&&m.setAttribute("form",o.id),c.parentNode.insertBefore(m,c),o=new FormData(o),m.parentNode.removeChild(m),o}function hK(o,c,m,y,_){if(c==="submit"&&m&&m.stateNode===_){var C=PO((_[fn]||null).action),$=y.submitter;$&&(c=(c=$[fn]||null)?PO(c.formAction):$.getAttribute("formAction"),c!==null&&(C=c,$=null));var q=new Hg("action","action",null,y,_);o.push({event:q,listeners:[{instance:null,listener:function(){if(y.defaultPrevented){if(Mc!==0){var ee=$?IO(_,$):new FormData(_);cw(m,{pending:!0,data:ee,method:_.method,action:C},null,ee)}}else typeof C=="function"&&(q.preventDefault(),ee=$?IO(_,$):new FormData(_),cw(m,{pending:!0,data:ee,method:_.method,action:C},C,ee))},currentTarget:_}]})}}for(var Vw=0;Vw<A_.length;Vw++){var Hw=A_[Vw],pK=Hw.toLowerCase(),mK=Hw[0].toUpperCase()+Hw.slice(1);Ui(pK,"on"+mK)}Ui(pM,"onAnimationEnd"),Ui(mM,"onAnimationIteration"),Ui(gM,"onAnimationStart"),Ui("dblclick","onDoubleClick"),Ui("focusin","onFocus"),Ui("focusout","onBlur"),Ui(MY,"onTransitionRun"),Ui(OY,"onTransitionStart"),Ui(PY,"onTransitionCancel"),Ui(vM,"onTransitionEnd"),an("onMouseEnter",["mouseout","mouseover"]),an("onMouseLeave",["mouseout","mouseover"]),an("onPointerEnter",["pointerout","pointerover"]),an("onPointerLeave",["pointerout","pointerover"]),lt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),lt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),lt("onBeforeInput",["compositionend","keypress","textInput","paste"]),lt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),lt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),lt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Jh="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(" "),gK=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Jh));function DO(o,c){c=(c&4)!==0;for(var m=0;m<o.length;m++){var y=o[m],_=y.event;y=y.listeners;e:{var C=void 0;if(c)for(var $=y.length-1;0<=$;$--){var q=y[$],ee=q.instance,de=q.currentTarget;if(q=q.listener,ee!==C&&_.isPropagationStopped())break e;C=q,_.currentTarget=de;try{C(_)}catch(we){vv(we)}_.currentTarget=null,C=ee}else for($=0;$<y.length;$++){if(q=y[$],ee=q.instance,de=q.currentTarget,q=q.listener,ee!==C&&_.isPropagationStopped())break e;C=q,_.currentTarget=de;try{C(_)}catch(we){vv(we)}_.currentTarget=null,C=ee}}}}function qt(o,c){var m=c[ne];m===void 0&&(m=c[ne]=new Set);var y=o+"__bubble";m.has(y)||(LO(c,o,2,!1),m.add(y))}function Gw(o,c,m){var y=0;c&&(y|=4),LO(m,o,y,c)}var jv="_reactListening"+Math.random().toString(36).slice(2);function Ww(o){if(!o[jv]){o[jv]=!0,ln.forEach(function(m){m!=="selectionchange"&&(gK.has(m)||Gw(m,!1,o),Gw(m,!0,o))});var c=o.nodeType===9?o:o.ownerDocument;c===null||c[jv]||(c[jv]=!0,Gw("selectionchange",!1,c))}}function LO(o,c,m,y){switch(oP(c)){case 2:var _=qK;break;case 8:_=VK;break;default:_=oS}m=_.bind(null,c,m,o),_=void 0,!m_||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(_=!0),y?_!==void 0?o.addEventListener(c,m,{capture:!0,passive:_}):o.addEventListener(c,m,!0):_!==void 0?o.addEventListener(c,m,{passive:_}):o.addEventListener(c,m,!1)}function Yw(o,c,m,y,_){var C=y;if((c&1)===0&&(c&2)===0&&y!==null)e:for(;;){if(y===null)return;var $=y.tag;if($===3||$===4){var q=y.stateNode.containerInfo;if(q===_)break;if($===4)for($=y.return;$!==null;){var ee=$.tag;if((ee===3||ee===4)&&$.stateNode.containerInfo===_)return;$=$.return}for(;q!==null;){if($=tt(q),$===null)return;if(ee=$.tag,ee===5||ee===6||ee===26||ee===27){y=C=$;continue e}q=q.parentNode}}y=y.return}Vj(function(){var de=C,we=h_(m),ke=[];e:{var pe=yM.get(o);if(pe!==void 0){var ge=Hg,xt=o;switch(o){case"keypress":if(qg(m)===0)break e;case"keydown":case"keyup":ge=uY;break;case"focusin":xt="focus",ge=b_;break;case"focusout":xt="blur",ge=b_;break;case"beforeblur":case"afterblur":ge=b_;break;case"click":if(m.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ge=Wj;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ge=JW;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ge=hY;break;case pM:case mM:case gM:ge=tY;break;case vM:ge=mY;break;case"scroll":case"scrollend":ge=XW;break;case"wheel":ge=vY;break;case"copy":case"cut":case"paste":ge=rY;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ge=Kj;break;case"toggle":case"beforetoggle":ge=bY}var ht=(c&4)!==0,gn=!ht&&(o==="scroll"||o==="scrollend"),le=ht?pe!==null?pe+"Capture":null:pe;ht=[];for(var ie=de,ce;ie!==null;){var Se=ie;if(ce=Se.stateNode,Se=Se.tag,Se!==5&&Se!==26&&Se!==27||ce===null||le===null||(Se=vh(ie,le),Se!=null&&ht.push(Zh(ie,Se,ce))),gn)break;ie=ie.return}0<ht.length&&(pe=new ge(pe,xt,null,m,we),ke.push({event:pe,listeners:ht}))}}if((c&7)===0){e:{if(pe=o==="mouseover"||o==="pointerover",ge=o==="mouseout"||o==="pointerout",pe&&m!==f_&&(xt=m.relatedTarget||m.fromElement)&&(tt(xt)||xt[er]))break e;if((ge||pe)&&(pe=we.window===we?we:(pe=we.ownerDocument)?pe.defaultView||pe.parentWindow:window,ge?(xt=m.relatedTarget||m.toElement,ge=de,xt=xt?tt(xt):null,xt!==null&&(gn=i(xt),ht=xt.tag,xt!==gn||ht!==5&&ht!==27&&ht!==6)&&(xt=null)):(ge=null,xt=de),ge!==xt)){if(ht=Wj,Se="onMouseLeave",le="onMouseEnter",ie="mouse",(o==="pointerout"||o==="pointerover")&&(ht=Kj,Se="onPointerLeave",le="onPointerEnter",ie="pointer"),gn=ge==null?pe:sn(ge),ce=xt==null?pe:sn(xt),pe=new ht(Se,ie+"leave",ge,m,we),pe.target=gn,pe.relatedTarget=ce,Se=null,tt(we)===de&&(ht=new ht(le,ie+"enter",xt,m,we),ht.target=ce,ht.relatedTarget=gn,Se=ht),gn=Se,ge&&xt)t:{for(ht=ge,le=xt,ie=0,ce=ht;ce;ce=hd(ce))ie++;for(ce=0,Se=le;Se;Se=hd(Se))ce++;for(;0<ie-ce;)ht=hd(ht),ie--;for(;0<ce-ie;)le=hd(le),ce--;for(;ie--;){if(ht===le||le!==null&&ht===le.alternate)break t;ht=hd(ht),le=hd(le)}ht=null}else ht=null;ge!==null&&$O(ke,pe,ge,ht,!1),xt!==null&&gn!==null&&$O(ke,gn,xt,ht,!0)}}e:{if(pe=de?sn(de):window,ge=pe.nodeName&&pe.nodeName.toLowerCase(),ge==="select"||ge==="input"&&pe.type==="file")var Ye=rM;else if(tM(pe))if(sM)Ye=NY;else{Ye=CY;var Ut=TY}else ge=pe.nodeName,!ge||ge.toLowerCase()!=="input"||pe.type!=="checkbox"&&pe.type!=="radio"?de&&d_(de.elementType)&&(Ye=rM):Ye=AY;if(Ye&&(Ye=Ye(o,de))){nM(ke,Ye,m,we);break e}Ut&&Ut(o,pe,de),o==="focusout"&&de&&pe.type==="number"&&de.memoizedProps.value!=null&&u_(pe,"number",pe.value)}switch(Ut=de?sn(de):window,o){case"focusin":(tM(Ut)||Ut.contentEditable==="true")&&(qu=Ut,k_=de,kh=null);break;case"focusout":kh=k_=qu=null;break;case"mousedown":T_=!0;break;case"contextmenu":case"mouseup":case"dragend":T_=!1,fM(ke,m,we);break;case"selectionchange":if(jY)break;case"keydown":case"keyup":fM(ke,m,we)}var it;if(__)e:{switch(o){case"compositionstart":var mt="onCompositionStart";break e;case"compositionend":mt="onCompositionEnd";break e;case"compositionupdate":mt="onCompositionUpdate";break e}mt=void 0}else Bu?Zj(o,m)&&(mt="onCompositionEnd"):o==="keydown"&&m.keyCode===229&&(mt="onCompositionStart");mt&&(Xj&&m.locale!=="ko"&&(Bu||mt!=="onCompositionStart"?mt==="onCompositionEnd"&&Bu&&(it=Hj()):(Ko=we,g_="value"in Ko?Ko.value:Ko.textContent,Bu=!0)),Ut=Mv(de,mt),0<Ut.length&&(mt=new Yj(mt,o,null,m,we),ke.push({event:mt,listeners:Ut}),it?mt.data=it:(it=eM(m),it!==null&&(mt.data=it)))),(it=_Y?wY(o,m):SY(o,m))&&(mt=Mv(de,"onBeforeInput"),0<mt.length&&(Ut=new Yj("onBeforeInput","beforeinput",null,m,we),ke.push({event:Ut,listeners:mt}),Ut.data=it)),hK(ke,o,de,m,we)}DO(ke,c)})}function Zh(o,c,m){return{instance:o,listener:c,currentTarget:m}}function Mv(o,c){for(var m=c+"Capture",y=[];o!==null;){var _=o,C=_.stateNode;if(_=_.tag,_!==5&&_!==26&&_!==27||C===null||(_=vh(o,m),_!=null&&y.unshift(Zh(o,_,C)),_=vh(o,c),_!=null&&y.push(Zh(o,_,C))),o.tag===3)return y;o=o.return}return[]}function hd(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function $O(o,c,m,y,_){for(var C=c._reactName,$=[];m!==null&&m!==y;){var q=m,ee=q.alternate,de=q.stateNode;if(q=q.tag,ee!==null&&ee===y)break;q!==5&&q!==26&&q!==27||de===null||(ee=de,_?(de=vh(m,C),de!=null&&$.unshift(Zh(m,de,ee))):_||(de=vh(m,C),de!=null&&$.push(Zh(m,de,ee)))),m=m.return}$.length!==0&&o.push({event:c,listeners:$})}var vK=/\r\n?/g,yK=/\u0000|\uFFFD/g;function zO(o){return(typeof o=="string"?o:""+o).replace(vK,`
|
|
49
|
-
`).replace(yK,"")}function FO(o,c){return c=zO(c),zO(o)===c}function Ov(){}function mn(o,c,m,y,_,C){switch(m){case"children":typeof y=="string"?c==="body"||c==="textarea"&&y===""||zu(o,y):(typeof y=="number"||typeof y=="bigint")&&c!=="body"&&zu(o,""+y);break;case"className":Fi(o,"class",y);break;case"tabIndex":Fi(o,"tabindex",y);break;case"dir":case"role":case"viewBox":case"width":case"height":Fi(o,m,y);break;case"style":Bj(o,y,C);break;case"data":if(c!=="object"){Fi(o,"data",y);break}case"src":case"href":if(y===""&&(c!=="a"||m!=="href")){o.removeAttribute(m);break}if(y==null||typeof y=="function"||typeof y=="symbol"||typeof y=="boolean"){o.removeAttribute(m);break}y=Ug(""+y),o.setAttribute(m,y);break;case"action":case"formAction":if(typeof y=="function"){o.setAttribute(m,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof C=="function"&&(m==="formAction"?(c!=="input"&&mn(o,c,"name",_.name,_,null),mn(o,c,"formEncType",_.formEncType,_,null),mn(o,c,"formMethod",_.formMethod,_,null),mn(o,c,"formTarget",_.formTarget,_,null)):(mn(o,c,"encType",_.encType,_,null),mn(o,c,"method",_.method,_,null),mn(o,c,"target",_.target,_,null)));if(y==null||typeof y=="symbol"||typeof y=="boolean"){o.removeAttribute(m);break}y=Ug(""+y),o.setAttribute(m,y);break;case"onClick":y!=null&&(o.onclick=Ov);break;case"onScroll":y!=null&&qt("scroll",o);break;case"onScrollEnd":y!=null&&qt("scrollend",o);break;case"dangerouslySetInnerHTML":if(y!=null){if(typeof y!="object"||!("__html"in y))throw Error(r(61));if(m=y.__html,m!=null){if(_.children!=null)throw Error(r(60));o.innerHTML=m}}break;case"multiple":o.multiple=y&&typeof y!="function"&&typeof y!="symbol";break;case"muted":o.muted=y&&typeof y!="function"&&typeof y!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(y==null||typeof y=="function"||typeof y=="boolean"||typeof y=="symbol"){o.removeAttribute("xlink:href");break}m=Ug(""+y),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",m);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":y!=null&&typeof y!="function"&&typeof y!="symbol"?o.setAttribute(m,""+y):o.removeAttribute(m);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":y&&typeof y!="function"&&typeof y!="symbol"?o.setAttribute(m,""):o.removeAttribute(m);break;case"capture":case"download":y===!0?o.setAttribute(m,""):y!==!1&&y!=null&&typeof y!="function"&&typeof y!="symbol"?o.setAttribute(m,y):o.removeAttribute(m);break;case"cols":case"rows":case"size":case"span":y!=null&&typeof y!="function"&&typeof y!="symbol"&&!isNaN(y)&&1<=y?o.setAttribute(m,y):o.removeAttribute(m);break;case"rowSpan":case"start":y==null||typeof y=="function"||typeof y=="symbol"||isNaN(y)?o.removeAttribute(m):o.setAttribute(m,y);break;case"popover":qt("beforetoggle",o),qt("toggle",o),as(o,"popover",y);break;case"xlinkActuate":zr(o,"http://www.w3.org/1999/xlink","xlink:actuate",y);break;case"xlinkArcrole":zr(o,"http://www.w3.org/1999/xlink","xlink:arcrole",y);break;case"xlinkRole":zr(o,"http://www.w3.org/1999/xlink","xlink:role",y);break;case"xlinkShow":zr(o,"http://www.w3.org/1999/xlink","xlink:show",y);break;case"xlinkTitle":zr(o,"http://www.w3.org/1999/xlink","xlink:title",y);break;case"xlinkType":zr(o,"http://www.w3.org/1999/xlink","xlink:type",y);break;case"xmlBase":zr(o,"http://www.w3.org/XML/1998/namespace","xml:base",y);break;case"xmlLang":zr(o,"http://www.w3.org/XML/1998/namespace","xml:lang",y);break;case"xmlSpace":zr(o,"http://www.w3.org/XML/1998/namespace","xml:space",y);break;case"is":as(o,"is",y);break;case"innerText":case"textContent":break;default:(!(2<m.length)||m[0]!=="o"&&m[0]!=="O"||m[1]!=="n"&&m[1]!=="N")&&(m=YW.get(m)||m,as(o,m,y))}}function Kw(o,c,m,y,_,C){switch(m){case"style":Bj(o,y,C);break;case"dangerouslySetInnerHTML":if(y!=null){if(typeof y!="object"||!("__html"in y))throw Error(r(61));if(m=y.__html,m!=null){if(_.children!=null)throw Error(r(60));o.innerHTML=m}}break;case"children":typeof y=="string"?zu(o,y):(typeof y=="number"||typeof y=="bigint")&&zu(o,""+y);break;case"onScroll":y!=null&&qt("scroll",o);break;case"onScrollEnd":y!=null&&qt("scrollend",o);break;case"onClick":y!=null&&(o.onclick=Ov);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!jn.hasOwnProperty(m))e:{if(m[0]==="o"&&m[1]==="n"&&(_=m.endsWith("Capture"),c=m.slice(2,_?m.length-7:void 0),C=o[fn]||null,C=C!=null?C[m]:null,typeof C=="function"&&o.removeEventListener(c,C,_),typeof y=="function")){typeof C!="function"&&C!==null&&(m in o?o[m]=null:o.hasAttribute(m)&&o.removeAttribute(m)),o.addEventListener(c,y,_);break e}m in o?o[m]=y:y===!0?o.setAttribute(m,""):as(o,m,y)}}}function qr(o,c,m){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":qt("error",o),qt("load",o);var y=!1,_=!1,C;for(C in m)if(m.hasOwnProperty(C)){var $=m[C];if($!=null)switch(C){case"src":y=!0;break;case"srcSet":_=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:mn(o,c,C,$,m,null)}}_&&mn(o,c,"srcSet",m.srcSet,m,null),y&&mn(o,c,"src",m.src,m,null);return;case"input":qt("invalid",o);var q=C=$=_=null,ee=null,de=null;for(y in m)if(m.hasOwnProperty(y)){var we=m[y];if(we!=null)switch(y){case"name":_=we;break;case"type":$=we;break;case"checked":ee=we;break;case"defaultChecked":de=we;break;case"value":C=we;break;case"defaultValue":q=we;break;case"children":case"dangerouslySetInnerHTML":if(we!=null)throw Error(r(137,c));break;default:mn(o,c,y,we,m,null)}}$j(o,C,q,ee,de,$,_,!1),gc(o);return;case"select":qt("invalid",o),y=$=C=null;for(_ in m)if(m.hasOwnProperty(_)&&(q=m[_],q!=null))switch(_){case"value":C=q;break;case"defaultValue":$=q;break;case"multiple":y=q;default:mn(o,c,_,q,m,null)}c=C,m=$,o.multiple=!!y,c!=null?$u(o,!!y,c,!1):m!=null&&$u(o,!!y,m,!0);return;case"textarea":qt("invalid",o),C=_=y=null;for($ in m)if(m.hasOwnProperty($)&&(q=m[$],q!=null))switch($){case"value":y=q;break;case"defaultValue":_=q;break;case"children":C=q;break;case"dangerouslySetInnerHTML":if(q!=null)throw Error(r(91));break;default:mn(o,c,$,q,m,null)}Fj(o,y,_,C),gc(o);return;case"option":for(ee in m)if(m.hasOwnProperty(ee)&&(y=m[ee],y!=null))switch(ee){case"selected":o.selected=y&&typeof y!="function"&&typeof y!="symbol";break;default:mn(o,c,ee,y,m,null)}return;case"dialog":qt("beforetoggle",o),qt("toggle",o),qt("cancel",o),qt("close",o);break;case"iframe":case"object":qt("load",o);break;case"video":case"audio":for(y=0;y<Jh.length;y++)qt(Jh[y],o);break;case"image":qt("error",o),qt("load",o);break;case"details":qt("toggle",o);break;case"embed":case"source":case"link":qt("error",o),qt("load",o);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(de in m)if(m.hasOwnProperty(de)&&(y=m[de],y!=null))switch(de){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:mn(o,c,de,y,m,null)}return;default:if(d_(c)){for(we in m)m.hasOwnProperty(we)&&(y=m[we],y!==void 0&&Kw(o,c,we,y,m,void 0));return}}for(q in m)m.hasOwnProperty(q)&&(y=m[q],y!=null&&mn(o,c,q,y,m,null))}function bK(o,c,m,y){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var _=null,C=null,$=null,q=null,ee=null,de=null,we=null;for(ge in m){var ke=m[ge];if(m.hasOwnProperty(ge)&&ke!=null)switch(ge){case"checked":break;case"value":break;case"defaultValue":ee=ke;default:y.hasOwnProperty(ge)||mn(o,c,ge,null,y,ke)}}for(var pe in y){var ge=y[pe];if(ke=m[pe],y.hasOwnProperty(pe)&&(ge!=null||ke!=null))switch(pe){case"type":C=ge;break;case"name":_=ge;break;case"checked":de=ge;break;case"defaultChecked":we=ge;break;case"value":$=ge;break;case"defaultValue":q=ge;break;case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(r(137,c));break;default:ge!==ke&&mn(o,c,pe,ge,y,ke)}}c_(o,$,q,ee,de,we,C,_);return;case"select":ge=$=q=pe=null;for(C in m)if(ee=m[C],m.hasOwnProperty(C)&&ee!=null)switch(C){case"value":break;case"multiple":ge=ee;default:y.hasOwnProperty(C)||mn(o,c,C,null,y,ee)}for(_ in y)if(C=y[_],ee=m[_],y.hasOwnProperty(_)&&(C!=null||ee!=null))switch(_){case"value":pe=C;break;case"defaultValue":q=C;break;case"multiple":$=C;default:C!==ee&&mn(o,c,_,C,y,ee)}c=q,m=$,y=ge,pe!=null?$u(o,!!m,pe,!1):!!y!=!!m&&(c!=null?$u(o,!!m,c,!0):$u(o,!!m,m?[]:"",!1));return;case"textarea":ge=pe=null;for(q in m)if(_=m[q],m.hasOwnProperty(q)&&_!=null&&!y.hasOwnProperty(q))switch(q){case"value":break;case"children":break;default:mn(o,c,q,null,y,_)}for($ in y)if(_=y[$],C=m[$],y.hasOwnProperty($)&&(_!=null||C!=null))switch($){case"value":pe=_;break;case"defaultValue":ge=_;break;case"children":break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(r(91));break;default:_!==C&&mn(o,c,$,_,y,C)}zj(o,pe,ge);return;case"option":for(var xt in m)if(pe=m[xt],m.hasOwnProperty(xt)&&pe!=null&&!y.hasOwnProperty(xt))switch(xt){case"selected":o.selected=!1;break;default:mn(o,c,xt,null,y,pe)}for(ee in y)if(pe=y[ee],ge=m[ee],y.hasOwnProperty(ee)&&pe!==ge&&(pe!=null||ge!=null))switch(ee){case"selected":o.selected=pe&&typeof pe!="function"&&typeof pe!="symbol";break;default:mn(o,c,ee,pe,y,ge)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ht in m)pe=m[ht],m.hasOwnProperty(ht)&&pe!=null&&!y.hasOwnProperty(ht)&&mn(o,c,ht,null,y,pe);for(de in y)if(pe=y[de],ge=m[de],y.hasOwnProperty(de)&&pe!==ge&&(pe!=null||ge!=null))switch(de){case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(r(137,c));break;default:mn(o,c,de,pe,y,ge)}return;default:if(d_(c)){for(var gn in m)pe=m[gn],m.hasOwnProperty(gn)&&pe!==void 0&&!y.hasOwnProperty(gn)&&Kw(o,c,gn,void 0,y,pe);for(we in y)pe=y[we],ge=m[we],!y.hasOwnProperty(we)||pe===ge||pe===void 0&&ge===void 0||Kw(o,c,we,pe,y,ge);return}}for(var le in m)pe=m[le],m.hasOwnProperty(le)&&pe!=null&&!y.hasOwnProperty(le)&&mn(o,c,le,null,y,pe);for(ke in y)pe=y[ke],ge=m[ke],!y.hasOwnProperty(ke)||pe===ge||pe==null&&ge==null||mn(o,c,ke,pe,y,ge)}var Xw=null,Qw=null;function Pv(o){return o.nodeType===9?o:o.ownerDocument}function UO(o){switch(o){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function BO(o,c){if(o===0)switch(c){case"svg":return 1;case"math":return 2;default:return 0}return o===1&&c==="foreignObject"?0:o}function Jw(o,c){return o==="textarea"||o==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.children=="bigint"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var Zw=null;function xK(){var o=window.event;return o&&o.type==="popstate"?o===Zw?!1:(Zw=o,!0):(Zw=null,!1)}var qO=typeof setTimeout=="function"?setTimeout:void 0,_K=typeof clearTimeout=="function"?clearTimeout:void 0,VO=typeof Promise=="function"?Promise:void 0,wK=typeof queueMicrotask=="function"?queueMicrotask:typeof VO<"u"?function(o){return VO.resolve(null).then(o).catch(SK)}:qO;function SK(o){setTimeout(function(){throw o})}function dl(o){return o==="head"}function HO(o,c){var m=c,y=0,_=0;do{var C=m.nextSibling;if(o.removeChild(m),C&&C.nodeType===8)if(m=C.data,m==="/$"){if(0<y&&8>y){m=y;var $=o.ownerDocument;if(m&1&&ep($.documentElement),m&2&&ep($.body),m&4)for(m=$.head,ep(m),$=m.firstChild;$;){var q=$.nextSibling,ee=$.nodeName;$[me]||ee==="SCRIPT"||ee==="STYLE"||ee==="LINK"&&$.rel.toLowerCase()==="stylesheet"||m.removeChild($),$=q}}if(_===0){o.removeChild(C),lp(c);return}_--}else m==="$"||m==="$?"||m==="$!"?_++:y=m.charCodeAt(0)-48;else y=0;m=C}while(m);lp(c)}function eS(o){var c=o.firstChild;for(c&&c.nodeType===10&&(c=c.nextSibling);c;){var m=c;switch(c=c.nextSibling,m.nodeName){case"HTML":case"HEAD":case"BODY":eS(m),nt(m);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(m.rel.toLowerCase()==="stylesheet")continue}o.removeChild(m)}}function EK(o,c,m,y){for(;o.nodeType===1;){var _=m;if(o.nodeName.toLowerCase()!==c.toLowerCase()){if(!y&&(o.nodeName!=="INPUT"||o.type!=="hidden"))break}else if(y){if(!o[me])switch(c){case"meta":if(!o.hasAttribute("itemprop"))break;return o;case"link":if(C=o.getAttribute("rel"),C==="stylesheet"&&o.hasAttribute("data-precedence"))break;if(C!==_.rel||o.getAttribute("href")!==(_.href==null||_.href===""?null:_.href)||o.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin)||o.getAttribute("title")!==(_.title==null?null:_.title))break;return o;case"style":if(o.hasAttribute("data-precedence"))break;return o;case"script":if(C=o.getAttribute("src"),(C!==(_.src==null?null:_.src)||o.getAttribute("type")!==(_.type==null?null:_.type)||o.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin))&&C&&o.hasAttribute("async")&&!o.hasAttribute("itemprop"))break;return o;default:return o}}else if(c==="input"&&o.type==="hidden"){var C=_.name==null?null:""+_.name;if(_.type==="hidden"&&o.getAttribute("name")===C)return o}else return o;if(o=qi(o.nextSibling),o===null)break}return null}function kK(o,c,m){if(c==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!m||(o=qi(o.nextSibling),o===null))return null;return o}function tS(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState==="complete"}function TK(o,c){var m=o.ownerDocument;if(o.data!=="$?"||m.readyState==="complete")c();else{var y=function(){c(),m.removeEventListener("DOMContentLoaded",y)};m.addEventListener("DOMContentLoaded",y),o._reactRetry=y}}function qi(o){for(;o!=null;o=o.nextSibling){var c=o.nodeType;if(c===1||c===3)break;if(c===8){if(c=o.data,c==="$"||c==="$!"||c==="$?"||c==="F!"||c==="F")break;if(c==="/$")return null}}return o}var nS=null;function GO(o){o=o.previousSibling;for(var c=0;o;){if(o.nodeType===8){var m=o.data;if(m==="$"||m==="$!"||m==="$?"){if(c===0)return o;c--}else m==="/$"&&c++}o=o.previousSibling}return null}function WO(o,c,m){switch(c=Pv(m),o){case"html":if(o=c.documentElement,!o)throw Error(r(452));return o;case"head":if(o=c.head,!o)throw Error(r(453));return o;case"body":if(o=c.body,!o)throw Error(r(454));return o;default:throw Error(r(451))}}function ep(o){for(var c=o.attributes;c.length;)o.removeAttributeNode(c[0]);nt(o)}var mi=new Map,YO=new Set;function Iv(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var fo=Y.d;Y.d={f:CK,r:AK,D:NK,C:RK,L:jK,m:MK,X:PK,S:OK,M:IK};function CK(){var o=fo.f(),c=Tv();return o||c}function AK(o){var c=Mt(o);c!==null&&c.tag===5&&c.type==="form"?p2(c):fo.r(o)}var pd=typeof document>"u"?null:document;function KO(o,c,m){var y=pd;if(y&&typeof c=="string"&&c){var _=li(c);_='link[rel="'+o+'"][href="'+_+'"]',typeof m=="string"&&(_+='[crossorigin="'+m+'"]'),YO.has(_)||(YO.add(_),o={rel:o,crossOrigin:m,href:c},y.querySelector(_)===null&&(c=y.createElement("link"),qr(c,"link",o),at(c),y.head.appendChild(c)))}}function NK(o){fo.D(o),KO("dns-prefetch",o,null)}function RK(o,c){fo.C(o,c),KO("preconnect",o,c)}function jK(o,c,m){fo.L(o,c,m);var y=pd;if(y&&o&&c){var _='link[rel="preload"][as="'+li(c)+'"]';c==="image"&&m&&m.imageSrcSet?(_+='[imagesrcset="'+li(m.imageSrcSet)+'"]',typeof m.imageSizes=="string"&&(_+='[imagesizes="'+li(m.imageSizes)+'"]')):_+='[href="'+li(o)+'"]';var C=_;switch(c){case"style":C=md(o);break;case"script":C=gd(o)}mi.has(C)||(o=p({rel:"preload",href:c==="image"&&m&&m.imageSrcSet?void 0:o,as:c},m),mi.set(C,o),y.querySelector(_)!==null||c==="style"&&y.querySelector(tp(C))||c==="script"&&y.querySelector(np(C))||(c=y.createElement("link"),qr(c,"link",o),at(c),y.head.appendChild(c)))}}function MK(o,c){fo.m(o,c);var m=pd;if(m&&o){var y=c&&typeof c.as=="string"?c.as:"script",_='link[rel="modulepreload"][as="'+li(y)+'"][href="'+li(o)+'"]',C=_;switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":C=gd(o)}if(!mi.has(C)&&(o=p({rel:"modulepreload",href:o},c),mi.set(C,o),m.querySelector(_)===null)){switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(m.querySelector(np(C)))return}y=m.createElement("link"),qr(y,"link",o),at(y),m.head.appendChild(y)}}}function OK(o,c,m){fo.S(o,c,m);var y=pd;if(y&&o){var _=hn(y).hoistableStyles,C=md(o);c=c||"default";var $=_.get(C);if(!$){var q={loading:0,preload:null};if($=y.querySelector(tp(C)))q.loading=5;else{o=p({rel:"stylesheet",href:o,"data-precedence":c},m),(m=mi.get(C))&&rS(o,m);var ee=$=y.createElement("link");at(ee),qr(ee,"link",o),ee._p=new Promise(function(de,we){ee.onload=de,ee.onerror=we}),ee.addEventListener("load",function(){q.loading|=1}),ee.addEventListener("error",function(){q.loading|=2}),q.loading|=4,Dv($,c,y)}$={type:"stylesheet",instance:$,count:1,state:q},_.set(C,$)}}}function PK(o,c){fo.X(o,c);var m=pd;if(m&&o){var y=hn(m).hoistableScripts,_=gd(o),C=y.get(_);C||(C=m.querySelector(np(_)),C||(o=p({src:o,async:!0},c),(c=mi.get(_))&&sS(o,c),C=m.createElement("script"),at(C),qr(C,"link",o),m.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},y.set(_,C))}}function IK(o,c){fo.M(o,c);var m=pd;if(m&&o){var y=hn(m).hoistableScripts,_=gd(o),C=y.get(_);C||(C=m.querySelector(np(_)),C||(o=p({src:o,async:!0,type:"module"},c),(c=mi.get(_))&&sS(o,c),C=m.createElement("script"),at(C),qr(C,"link",o),m.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},y.set(_,C))}}function XO(o,c,m,y){var _=(_=V.current)?Iv(_):null;if(!_)throw Error(r(446));switch(o){case"meta":case"title":return null;case"style":return typeof m.precedence=="string"&&typeof m.href=="string"?(c=md(m.href),m=hn(_).hoistableStyles,y=m.get(c),y||(y={type:"style",instance:null,count:0,state:null},m.set(c,y)),y):{type:"void",instance:null,count:0,state:null};case"link":if(m.rel==="stylesheet"&&typeof m.href=="string"&&typeof m.precedence=="string"){o=md(m.href);var C=hn(_).hoistableStyles,$=C.get(o);if($||(_=_.ownerDocument||_,$={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},C.set(o,$),(C=_.querySelector(tp(o)))&&!C._p&&($.instance=C,$.state.loading=5),mi.has(o)||(m={rel:"preload",as:"style",href:m.href,crossOrigin:m.crossOrigin,integrity:m.integrity,media:m.media,hrefLang:m.hrefLang,referrerPolicy:m.referrerPolicy},mi.set(o,m),C||DK(_,o,m,$.state))),c&&y===null)throw Error(r(528,""));return $}if(c&&y!==null)throw Error(r(529,""));return null;case"script":return c=m.async,m=m.src,typeof m=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=gd(m),m=hn(_).hoistableScripts,y=m.get(c),y||(y={type:"script",instance:null,count:0,state:null},m.set(c,y)),y):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,o))}}function md(o){return'href="'+li(o)+'"'}function tp(o){return'link[rel="stylesheet"]['+o+"]"}function QO(o){return p({},o,{"data-precedence":o.precedence,precedence:null})}function DK(o,c,m,y){o.querySelector('link[rel="preload"][as="style"]['+c+"]")?y.loading=1:(c=o.createElement("link"),y.preload=c,c.addEventListener("load",function(){return y.loading|=1}),c.addEventListener("error",function(){return y.loading|=2}),qr(c,"link",m),at(c),o.head.appendChild(c))}function gd(o){return'[src="'+li(o)+'"]'}function np(o){return"script[async]"+o}function JO(o,c,m){if(c.count++,c.instance===null)switch(c.type){case"style":var y=o.querySelector('style[data-href~="'+li(m.href)+'"]');if(y)return c.instance=y,at(y),y;var _=p({},m,{"data-href":m.href,"data-precedence":m.precedence,href:null,precedence:null});return y=(o.ownerDocument||o).createElement("style"),at(y),qr(y,"style",_),Dv(y,m.precedence,o),c.instance=y;case"stylesheet":_=md(m.href);var C=o.querySelector(tp(_));if(C)return c.state.loading|=4,c.instance=C,at(C),C;y=QO(m),(_=mi.get(_))&&rS(y,_),C=(o.ownerDocument||o).createElement("link"),at(C);var $=C;return $._p=new Promise(function(q,ee){$.onload=q,$.onerror=ee}),qr(C,"link",y),c.state.loading|=4,Dv(C,m.precedence,o),c.instance=C;case"script":return C=gd(m.src),(_=o.querySelector(np(C)))?(c.instance=_,at(_),_):(y=m,(_=mi.get(C))&&(y=p({},m),sS(y,_)),o=o.ownerDocument||o,_=o.createElement("script"),at(_),qr(_,"link",y),o.head.appendChild(_),c.instance=_);case"void":return null;default:throw Error(r(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(y=c.instance,c.state.loading|=4,Dv(y,m.precedence,o));return c.instance}function Dv(o,c,m){for(var y=m.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),_=y.length?y[y.length-1]:null,C=_,$=0;$<y.length;$++){var q=y[$];if(q.dataset.precedence===c)C=q;else if(C!==_)break}C?C.parentNode.insertBefore(o,C.nextSibling):(c=m.nodeType===9?m.head:m,c.insertBefore(o,c.firstChild))}function rS(o,c){o.crossOrigin==null&&(o.crossOrigin=c.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=c.referrerPolicy),o.title==null&&(o.title=c.title)}function sS(o,c){o.crossOrigin==null&&(o.crossOrigin=c.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=c.referrerPolicy),o.integrity==null&&(o.integrity=c.integrity)}var Lv=null;function ZO(o,c,m){if(Lv===null){var y=new Map,_=Lv=new Map;_.set(m,y)}else _=Lv,y=_.get(m),y||(y=new Map,_.set(m,y));if(y.has(o))return y;for(y.set(o,null),m=m.getElementsByTagName(o),_=0;_<m.length;_++){var C=m[_];if(!(C[me]||C[Rn]||o==="link"&&C.getAttribute("rel")==="stylesheet")&&C.namespaceURI!=="http://www.w3.org/2000/svg"){var $=C.getAttribute(c)||"";$=o+$;var q=y.get($);q?q.push(C):y.set($,[C])}}return y}function eP(o,c,m){o=o.ownerDocument||o,o.head.insertBefore(m,c==="title"?o.querySelector("head > title"):null)}function LK(o,c,m){if(m===1||c.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;switch(c.rel){case"stylesheet":return o=c.disabled,typeof c.precedence=="string"&&o==null;default:return!0}case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function tP(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}var rp=null;function $K(){}function zK(o,c,m){if(rp===null)throw Error(r(475));var y=rp;if(c.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var _=md(m.href),C=o.querySelector(tp(_));if(C){o=C._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(y.count++,y=$v.bind(y),o.then(y,y)),c.state.loading|=4,c.instance=C,at(C);return}C=o.ownerDocument||o,m=QO(m),(_=mi.get(_))&&rS(m,_),C=C.createElement("link"),at(C);var $=C;$._p=new Promise(function(q,ee){$.onload=q,$.onerror=ee}),qr(C,"link",m),c.instance=C}y.stylesheets===null&&(y.stylesheets=new Map),y.stylesheets.set(c,o),(o=c.state.preload)&&(c.state.loading&3)===0&&(y.count++,c=$v.bind(y),o.addEventListener("load",c),o.addEventListener("error",c))}}function FK(){if(rp===null)throw Error(r(475));var o=rp;return o.stylesheets&&o.count===0&&iS(o,o.stylesheets),0<o.count?function(c){var m=setTimeout(function(){if(o.stylesheets&&iS(o,o.stylesheets),o.unsuspend){var y=o.unsuspend;o.unsuspend=null,y()}},6e4);return o.unsuspend=c,function(){o.unsuspend=null,clearTimeout(m)}}:null}function $v(){if(this.count--,this.count===0){if(this.stylesheets)iS(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var zv=null;function iS(o,c){o.stylesheets=null,o.unsuspend!==null&&(o.count++,zv=new Map,c.forEach(UK,o),zv=null,$v.call(o))}function UK(o,c){if(!(c.state.loading&4)){var m=zv.get(o);if(m)var y=m.get(null);else{m=new Map,zv.set(o,m);for(var _=o.querySelectorAll("link[data-precedence],style[data-precedence]"),C=0;C<_.length;C++){var $=_[C];($.nodeName==="LINK"||$.getAttribute("media")!=="not all")&&(m.set($.dataset.precedence,$),y=$)}y&&m.set(null,y)}_=c.instance,$=_.getAttribute("data-precedence"),C=m.get($)||y,C===y&&m.set(null,_),m.set($,_),this.count++,y=$v.bind(this),_.addEventListener("load",y),_.addEventListener("error",y),C?C.parentNode.insertBefore(_,C.nextSibling):(o=o.nodeType===9?o.head:o,o.insertBefore(_,o.firstChild)),c.state.loading|=4}}var sp={$$typeof:T,Provider:null,Consumer:null,_currentValue:H,_currentValue2:H,_threadCount:0};function BK(o,c,m,y,_,C,$,q){this.tag=1,this.containerInfo=o,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=pc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pc(0),this.hiddenUpdates=pc(null),this.identifierPrefix=y,this.onUncaughtError=_,this.onCaughtError=C,this.onRecoverableError=$,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=q,this.incompleteTransitions=new Map}function nP(o,c,m,y,_,C,$,q,ee,de,we,ke){return o=new BK(o,c,m,$,q,ee,de,ke),c=1,C===!0&&(c|=24),C=Bs(3,null,null,c),o.current=C,C.stateNode=o,c=F_(),c.refCount++,o.pooledCache=c,c.refCount++,C.memoizedState={element:y,isDehydrated:m,cache:c},V_(C),o}function rP(o){return o?(o=Wu,o):Wu}function sP(o,c,m,y,_,C){_=rP(_),y.context===null?y.context=_:y.pendingContext=_,y=Jo(c),y.payload={element:m},C=C===void 0?null:C,C!==null&&(y.callback=C),m=Zo(o,y,c),m!==null&&(Ws(m,o,c),Ph(m,o,c))}function iP(o,c){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var m=o.retryLane;o.retryLane=m!==0&&m<c?m:c}}function aS(o,c){iP(o,c),(o=o.alternate)&&iP(o,c)}function aP(o){if(o.tag===13){var c=Gu(o,67108864);c!==null&&Ws(c,o,67108864),aS(o,67108864)}}var Fv=!0;function qK(o,c,m,y){var _=F.T;F.T=null;var C=Y.p;try{Y.p=2,oS(o,c,m,y)}finally{Y.p=C,F.T=_}}function VK(o,c,m,y){var _=F.T;F.T=null;var C=Y.p;try{Y.p=8,oS(o,c,m,y)}finally{Y.p=C,F.T=_}}function oS(o,c,m,y){if(Fv){var _=lS(y);if(_===null)Yw(o,c,y,Uv,m),lP(o,y);else if(GK(_,o,c,m,y))y.stopPropagation();else if(lP(o,y),c&4&&-1<HK.indexOf(o)){for(;_!==null;){var C=Mt(_);if(C!==null)switch(C.tag){case 3:if(C=C.stateNode,C.current.memoizedState.isDehydrated){var $=Xt(C.pendingLanes);if($!==0){var q=C;for(q.pendingLanes|=2,q.entangledLanes|=2;$;){var ee=1<<31-qe($);q.entanglements[1]|=ee,$&=~ee}ya(C),(cn&6)===0&&(Ev=Ne()+500,Qh(0))}}break;case 13:q=Gu(C,2),q!==null&&Ws(q,C,2),Tv(),aS(C,2)}if(C=lS(y),C===null&&Yw(o,c,y,Uv,m),C===_)break;_=C}_!==null&&y.stopPropagation()}else Yw(o,c,y,null,m)}}function lS(o){return o=h_(o),cS(o)}var Uv=null;function cS(o){if(Uv=null,o=tt(o),o!==null){var c=i(o);if(c===null)o=null;else{var m=c.tag;if(m===13){if(o=a(c),o!==null)return o;o=null}else if(m===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;o=null}else c!==o&&(o=null)}}return Uv=o,null}function oP(o){switch(o){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Qe()){case dt:return 2;case Be:return 8;case pt:case De:return 32;case et:return 268435456;default:return 32}default:return 32}}var uS=!1,fl=null,hl=null,pl=null,ip=new Map,ap=new Map,ml=[],HK="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".split(" ");function lP(o,c){switch(o){case"focusin":case"focusout":fl=null;break;case"dragenter":case"dragleave":hl=null;break;case"mouseover":case"mouseout":pl=null;break;case"pointerover":case"pointerout":ip.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":ap.delete(c.pointerId)}}function op(o,c,m,y,_,C){return o===null||o.nativeEvent!==C?(o={blockedOn:c,domEventName:m,eventSystemFlags:y,nativeEvent:C,targetContainers:[_]},c!==null&&(c=Mt(c),c!==null&&aP(c)),o):(o.eventSystemFlags|=y,c=o.targetContainers,_!==null&&c.indexOf(_)===-1&&c.push(_),o)}function GK(o,c,m,y,_){switch(c){case"focusin":return fl=op(fl,o,c,m,y,_),!0;case"dragenter":return hl=op(hl,o,c,m,y,_),!0;case"mouseover":return pl=op(pl,o,c,m,y,_),!0;case"pointerover":var C=_.pointerId;return ip.set(C,op(ip.get(C)||null,o,c,m,y,_)),!0;case"gotpointercapture":return C=_.pointerId,ap.set(C,op(ap.get(C)||null,o,c,m,y,_)),!0}return!1}function cP(o){var c=tt(o.target);if(c!==null){var m=i(c);if(m!==null){if(c=m.tag,c===13){if(c=a(m),c!==null){o.blockedOn=c,Vn(o.priority,function(){if(m.tag===13){var y=Gs();y=$n(y);var _=Gu(m,y);_!==null&&Ws(_,m,y),aS(m,y)}});return}}else if(c===3&&m.stateNode.current.memoizedState.isDehydrated){o.blockedOn=m.tag===3?m.stateNode.containerInfo:null;return}}}o.blockedOn=null}function Bv(o){if(o.blockedOn!==null)return!1;for(var c=o.targetContainers;0<c.length;){var m=lS(o.nativeEvent);if(m===null){m=o.nativeEvent;var y=new m.constructor(m.type,m);f_=y,m.target.dispatchEvent(y),f_=null}else return c=Mt(m),c!==null&&aP(c),o.blockedOn=m,!1;c.shift()}return!0}function uP(o,c,m){Bv(o)&&m.delete(c)}function WK(){uS=!1,fl!==null&&Bv(fl)&&(fl=null),hl!==null&&Bv(hl)&&(hl=null),pl!==null&&Bv(pl)&&(pl=null),ip.forEach(uP),ap.forEach(uP)}function qv(o,c){o.blockedOn===c&&(o.blockedOn=null,uS||(uS=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,WK)))}var Vv=null;function dP(o){Vv!==o&&(Vv=o,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Vv===o&&(Vv=null);for(var c=0;c<o.length;c+=3){var m=o[c],y=o[c+1],_=o[c+2];if(typeof y!="function"){if(cS(y||m)===null)continue;break}var C=Mt(m);C!==null&&(o.splice(c,3),c-=3,cw(C,{pending:!0,data:_,method:m.method,action:y},y,_))}}))}function lp(o){function c(ee){return qv(ee,o)}fl!==null&&qv(fl,o),hl!==null&&qv(hl,o),pl!==null&&qv(pl,o),ip.forEach(c),ap.forEach(c);for(var m=0;m<ml.length;m++){var y=ml[m];y.blockedOn===o&&(y.blockedOn=null)}for(;0<ml.length&&(m=ml[0],m.blockedOn===null);)cP(m),m.blockedOn===null&&ml.shift();if(m=(o.ownerDocument||o).$$reactFormReplay,m!=null)for(y=0;y<m.length;y+=3){var _=m[y],C=m[y+1],$=_[fn]||null;if(typeof C=="function")$||dP(m);else if($){var q=null;if(C&&C.hasAttribute("formAction")){if(_=C,$=C[fn]||null)q=$.formAction;else if(cS(_)!==null)continue}else q=$.action;typeof q=="function"?m[y+1]=q:(m.splice(y,3),y-=3),dP(m)}}}function dS(o){this._internalRoot=o}Hv.prototype.render=dS.prototype.render=function(o){var c=this._internalRoot;if(c===null)throw Error(r(409));var m=c.current,y=Gs();sP(m,y,o,c,null,null)},Hv.prototype.unmount=dS.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var c=o.containerInfo;sP(o.current,2,null,o,null,null),Tv(),c[er]=null}};function Hv(o){this._internalRoot=o}Hv.prototype.unstable_scheduleHydration=function(o){if(o){var c=$i();o={blockedOn:null,target:o,priority:c};for(var m=0;m<ml.length&&c!==0&&c<ml[m].priority;m++);ml.splice(m,0,o),m===0&&cP(o)}};var fP=e.version;if(fP!=="19.1.0")throw Error(r(527,fP,"19.1.0"));Y.findDOMNode=function(o){var c=o._reactInternals;if(c===void 0)throw typeof o.render=="function"?Error(r(188)):(o=Object.keys(o).join(","),Error(r(268,o)));return o=u(c),o=o!==null?d(o):null,o=o===null?null:o.stateNode,o};var YK={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:F,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Gv=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Gv.isDisabled&&Gv.supportsFiber)try{xe=Gv.inject(YK),Te=Gv}catch{}}return up.createRoot=function(o,c){if(!s(o))throw Error(r(299));var m=!1,y="",_=A2,C=N2,$=R2,q=null;return c!=null&&(c.unstable_strictMode===!0&&(m=!0),c.identifierPrefix!==void 0&&(y=c.identifierPrefix),c.onUncaughtError!==void 0&&(_=c.onUncaughtError),c.onCaughtError!==void 0&&(C=c.onCaughtError),c.onRecoverableError!==void 0&&($=c.onRecoverableError),c.unstable_transitionCallbacks!==void 0&&(q=c.unstable_transitionCallbacks)),c=nP(o,1,!1,null,null,m,y,_,C,$,q,null),o[er]=c.current,Ww(o),new dS(c)},up.hydrateRoot=function(o,c,m){if(!s(o))throw Error(r(299));var y=!1,_="",C=A2,$=N2,q=R2,ee=null,de=null;return m!=null&&(m.unstable_strictMode===!0&&(y=!0),m.identifierPrefix!==void 0&&(_=m.identifierPrefix),m.onUncaughtError!==void 0&&(C=m.onUncaughtError),m.onCaughtError!==void 0&&($=m.onCaughtError),m.onRecoverableError!==void 0&&(q=m.onRecoverableError),m.unstable_transitionCallbacks!==void 0&&(ee=m.unstable_transitionCallbacks),m.formState!==void 0&&(de=m.formState)),c=nP(o,1,!0,c,m??null,y,_,C,$,q,ee,de),c.context=rP(null),m=c.current,y=Gs(),y=$n(y),_=Jo(y),_.callback=null,Zo(m,_,y),m=y,c.current.lanes=m,fa(c,m),ya(c),o[er]=c.current,Ww(o),new Hv(c)},up.version="19.1.0",up}var wP;function sX(){if(wP)return pS.exports;wP=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),pS.exports=rX(),pS.exports}var iX=sX();function Nz(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(n=Nz(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function lA(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=Nz(t))&&(r&&(r+=" "),r+=e);return r}const cA="-",aX=t=>{const e=lX(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{const l=a.split(cA);return l[0]===""&&l.length!==1&&l.shift(),Rz(l,e)||oX(a)},getConflictingClassGroupIds:(a,l)=>{const u=n[a]||[];return l&&r[a]?[...u,...r[a]]:u}}},Rz=(t,e)=>{if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),s=r?Rz(t.slice(1),r):void 0;if(s)return s;if(e.validators.length===0)return;const i=t.join(cA);return e.validators.find(({validator:a})=>a(i))?.classGroupId},SP=/^\[(.+)\]$/,oX=t=>{if(SP.test(t)){const e=SP.exec(t)[1],n=e?.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},lX=t=>{const{theme:e,classGroups:n}=t,r={nextPart:new Map,validators:[]};for(const s in n)ik(n[s],r,s,e);return r},ik=(t,e,n,r)=>{t.forEach(s=>{if(typeof s=="string"){const i=s===""?e:EP(e,s);i.classGroupId=n;return}if(typeof s=="function"){if(cX(s)){ik(s(r),e,n,r);return}e.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,a])=>{ik(a,EP(e,i),n,r)})})},EP=(t,e)=>{let n=t;return e.split(cA).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},cX=t=>t.isThemeGetter,uX=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const s=(i,a)=>{n.set(i,a),e++,e>t&&(e=0,r=n,n=new Map)};return{get(i){let a=n.get(i);if(a!==void 0)return a;if((a=r.get(i))!==void 0)return s(i,a),a},set(i,a){n.has(i)?n.set(i,a):s(i,a)}}},ak="!",ok=":",dX=ok.length,fX=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=s=>{const i=[];let a=0,l=0,u=0,d;for(let b=0;b<s.length;b++){let x=s[b];if(a===0&&l===0){if(x===ok){i.push(s.slice(u,b)),u=b+dX;continue}if(x==="/"){d=b;continue}}x==="["?a++:x==="]"?a--:x==="("?l++:x===")"&&l--}const p=i.length===0?s:s.substring(u),h=hX(p),g=h!==p,v=d&&d>u?d-u:void 0;return{modifiers:i,hasImportantModifier:g,baseClassName:h,maybePostfixModifierPosition:v}};if(e){const s=e+ok,i=r;r=a=>a.startsWith(s)?i(a.substring(s.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:a,maybePostfixModifierPosition:void 0}}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},hX=t=>t.endsWith(ak)?t.substring(0,t.length-1):t.startsWith(ak)?t.substring(1):t,pX=t=>{const e=Object.fromEntries(t.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const s=[];let i=[];return r.forEach(a=>{a[0]==="["||e[a]?(s.push(...i.sort(),a),i=[]):i.push(a)}),s.push(...i.sort()),s}},mX=t=>({cache:uX(t.cacheSize),parseClassName:fX(t),sortModifiers:pX(t),...aX(t)}),gX=/\s+/,vX=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i}=e,a=[],l=t.trim().split(gX);let u="";for(let d=l.length-1;d>=0;d-=1){const p=l[d],{isExternal:h,modifiers:g,hasImportantModifier:v,baseClassName:b,maybePostfixModifierPosition:x}=n(p);if(h){u=p+(u.length>0?" "+u:u);continue}let E=!!x,S=r(E?b.substring(0,x):b);if(!S){if(!E){u=p+(u.length>0?" "+u:u);continue}if(S=r(b),!S){u=p+(u.length>0?" "+u:u);continue}E=!1}const k=i(g).join(":"),T=v?k+ak:k,R=T+S;if(a.includes(R))continue;a.push(R);const j=s(S,E);for(let A=0;A<j.length;++A){const N=j[A];a.push(T+N)}u=p+(u.length>0?" "+u:u)}return u};function yX(){let t=0,e,n,r="";for(;t<arguments.length;)(e=arguments[t++])&&(n=jz(e))&&(r&&(r+=" "),r+=n);return r}const jz=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=jz(t[r]))&&(n&&(n+=" "),n+=e);return n};function bX(t,...e){let n,r,s,i=a;function a(u){const d=e.reduce((p,h)=>h(p),t());return n=mX(d),r=n.cache.get,s=n.cache.set,i=l,l(u)}function l(u){const d=r(u);if(d)return d;const p=vX(u,n);return s(u,p),p}return function(){return i(yX.apply(null,arguments))}}const Sr=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},Mz=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Oz=/^\((?:(\w[\w-]*):)?(.+)\)$/i,xX=/^\d+\/\d+$/,_X=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,wX=/\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$/,SX=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,EX=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,kX=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,vd=t=>xX.test(t),zt=t=>!!t&&!Number.isNaN(Number(t)),vl=t=>!!t&&Number.isInteger(Number(t)),yS=t=>t.endsWith("%")&&zt(t.slice(0,-1)),ho=t=>_X.test(t),TX=()=>!0,CX=t=>wX.test(t)&&!SX.test(t),Pz=()=>!1,AX=t=>EX.test(t),NX=t=>kX.test(t),RX=t=>!Ke(t)&&!Xe(t),jX=t=>Hf(t,Lz,Pz),Ke=t=>Mz.test(t),Oc=t=>Hf(t,$z,CX),bS=t=>Hf(t,DX,zt),kP=t=>Hf(t,Iz,Pz),MX=t=>Hf(t,Dz,NX),Wv=t=>Hf(t,zz,AX),Xe=t=>Oz.test(t),dp=t=>Gf(t,$z),OX=t=>Gf(t,LX),TP=t=>Gf(t,Iz),PX=t=>Gf(t,Lz),IX=t=>Gf(t,Dz),Yv=t=>Gf(t,zz,!0),Hf=(t,e,n)=>{const r=Mz.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},Gf=(t,e,n=!1)=>{const r=Oz.exec(t);return r?r[1]?e(r[1]):n:!1},Iz=t=>t==="position"||t==="percentage",Dz=t=>t==="image"||t==="url",Lz=t=>t==="length"||t==="size"||t==="bg-size",$z=t=>t==="length",DX=t=>t==="number",LX=t=>t==="family-name",zz=t=>t==="shadow",$X=()=>{const t=Sr("color"),e=Sr("font"),n=Sr("text"),r=Sr("font-weight"),s=Sr("tracking"),i=Sr("leading"),a=Sr("breakpoint"),l=Sr("container"),u=Sr("spacing"),d=Sr("radius"),p=Sr("shadow"),h=Sr("inset-shadow"),g=Sr("text-shadow"),v=Sr("drop-shadow"),b=Sr("blur"),x=Sr("perspective"),E=Sr("aspect"),S=Sr("ease"),k=Sr("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],j=()=>[...R(),Xe,Ke],A=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto","contain","none"],M=()=>[Xe,Ke,u],I=()=>[vd,"full","auto",...M()],O=()=>[vl,"none","subgrid",Xe,Ke],L=()=>["auto",{span:["full",vl,Xe,Ke]},vl,Xe,Ke],z=()=>[vl,"auto",Xe,Ke],G=()=>["auto","min","max","fr",Xe,Ke],W=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],X=()=>["start","end","center","stretch","center-safe","end-safe"],F=()=>["auto",...M()],Y=()=>[vd,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],H=()=>[t,Xe,Ke],te=()=>[...R(),TP,kP,{position:[Xe,Ke]}],P=()=>["no-repeat",{repeat:["","x","y","space","round"]}],re=()=>["auto","cover","contain",PX,jX,{size:[Xe,Ke]}],ue=()=>[yS,dp,Oc],D=()=>["","none","full",d,Xe,Ke],Z=()=>["",zt,dp,Oc],he=()=>["solid","dashed","dotted","double"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],U=()=>[zt,yS,TP,kP],K=()=>["","none",b,Xe,Ke],ae=()=>["none",zt,Xe,Ke],B=()=>["none",zt,Xe,Ke],J=()=>[zt,Xe,Ke],oe=()=>[vd,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ho],breakpoint:[ho],color:[TX],container:[ho],"drop-shadow":[ho],ease:["in","out","in-out"],font:[RX],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ho],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ho],shadow:[ho],spacing:["px",zt],text:[ho],"text-shadow":[ho],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",vd,Ke,Xe,E]}],container:["container"],columns:[{columns:[zt,Ke,Xe,l]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"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"],sr:["sr-only","not-sr-only"],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:j()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{start:I()}],end:[{end:I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[vl,"auto",Xe,Ke]}],basis:[{basis:[vd,"full","auto",l,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[zt,vd,"auto","initial","none",Ke]}],grow:[{grow:["",zt,Xe,Ke]}],shrink:[{shrink:["",zt,Xe,Ke]}],order:[{order:[vl,"first","last","none",Xe,Ke]}],"grid-cols":[{"grid-cols":O()}],"col-start-end":[{col:L()}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":O()}],"row-start-end":[{row:L()}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":G()}],"auto-rows":[{"auto-rows":G()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...W(),"normal"]}],"justify-items":[{"justify-items":[...X(),"normal"]}],"justify-self":[{"justify-self":["auto",...X()]}],"align-content":[{content:["normal",...W()]}],"align-items":[{items:[...X(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...X(),{baseline:["","last"]}]}],"place-content":[{"place-content":W()}],"place-items":[{"place-items":[...X(),"baseline"]}],"place-self":[{"place-self":["auto",...X()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:F()}],mx:[{mx:F()}],my:[{my:F()}],ms:[{ms:F()}],me:[{me:F()}],mt:[{mt:F()}],mr:[{mr:F()}],mb:[{mb:F()}],ml:[{ml:F()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:Y()}],w:[{w:[l,"screen",...Y()]}],"min-w":[{"min-w":[l,"screen","none",...Y()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[a]},...Y()]}],h:[{h:["screen","lh",...Y()]}],"min-h":[{"min-h":["screen","lh","none",...Y()]}],"max-h":[{"max-h":["screen","lh",...Y()]}],"font-size":[{text:["base",n,dp,Oc]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Xe,bS]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",yS,Ke]}],"font-family":[{font:[OX,Ke,e]}],"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:[s,Xe,Ke]}],"line-clamp":[{"line-clamp":[zt,"none",Xe,bS]}],leading:[{leading:[i,...M()]}],"list-image":[{"list-image":["none",Xe,Ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Xe,Ke]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:H()}],"text-color":[{text:H()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...he(),"wavy"]}],"text-decoration-thickness":[{decoration:[zt,"from-font","auto",Xe,Oc]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[zt,"auto",Xe,Ke]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Xe,Ke]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Xe,Ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:te()}],"bg-repeat":[{bg:P()}],"bg-size":[{bg:re()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},vl,Xe,Ke],radial:["",Xe,Ke],conic:[vl,Xe,Ke]},IX,MX]}],"bg-color":[{bg:H()}],"gradient-from-pos":[{from:ue()}],"gradient-via-pos":[{via:ue()}],"gradient-to-pos":[{to:ue()}],"gradient-from":[{from:H()}],"gradient-via":[{via:H()}],"gradient-to":[{to:H()}],rounded:[{rounded:D()}],"rounded-s":[{"rounded-s":D()}],"rounded-e":[{"rounded-e":D()}],"rounded-t":[{"rounded-t":D()}],"rounded-r":[{"rounded-r":D()}],"rounded-b":[{"rounded-b":D()}],"rounded-l":[{"rounded-l":D()}],"rounded-ss":[{"rounded-ss":D()}],"rounded-se":[{"rounded-se":D()}],"rounded-ee":[{"rounded-ee":D()}],"rounded-es":[{"rounded-es":D()}],"rounded-tl":[{"rounded-tl":D()}],"rounded-tr":[{"rounded-tr":D()}],"rounded-br":[{"rounded-br":D()}],"rounded-bl":[{"rounded-bl":D()}],"border-w":[{border:Z()}],"border-w-x":[{"border-x":Z()}],"border-w-y":[{"border-y":Z()}],"border-w-s":[{"border-s":Z()}],"border-w-e":[{"border-e":Z()}],"border-w-t":[{"border-t":Z()}],"border-w-r":[{"border-r":Z()}],"border-w-b":[{"border-b":Z()}],"border-w-l":[{"border-l":Z()}],"divide-x":[{"divide-x":Z()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Z()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...he(),"hidden","none"]}],"divide-style":[{divide:[...he(),"hidden","none"]}],"border-color":[{border:H()}],"border-color-x":[{"border-x":H()}],"border-color-y":[{"border-y":H()}],"border-color-s":[{"border-s":H()}],"border-color-e":[{"border-e":H()}],"border-color-t":[{"border-t":H()}],"border-color-r":[{"border-r":H()}],"border-color-b":[{"border-b":H()}],"border-color-l":[{"border-l":H()}],"divide-color":[{divide:H()}],"outline-style":[{outline:[...he(),"none","hidden"]}],"outline-offset":[{"outline-offset":[zt,Xe,Ke]}],"outline-w":[{outline:["",zt,dp,Oc]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","none",p,Yv,Wv]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",h,Yv,Wv]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:Z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[zt,Oc]}],"ring-offset-color":[{"ring-offset":H()}],"inset-ring-w":[{"inset-ring":Z()}],"inset-ring-color":[{"inset-ring":H()}],"text-shadow":[{"text-shadow":["none",g,Yv,Wv]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[zt,Xe,Ke]}],"mix-blend":[{"mix-blend":[...V(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":V()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[zt]}],"mask-image-linear-from-pos":[{"mask-linear-from":U()}],"mask-image-linear-to-pos":[{"mask-linear-to":U()}],"mask-image-linear-from-color":[{"mask-linear-from":H()}],"mask-image-linear-to-color":[{"mask-linear-to":H()}],"mask-image-t-from-pos":[{"mask-t-from":U()}],"mask-image-t-to-pos":[{"mask-t-to":U()}],"mask-image-t-from-color":[{"mask-t-from":H()}],"mask-image-t-to-color":[{"mask-t-to":H()}],"mask-image-r-from-pos":[{"mask-r-from":U()}],"mask-image-r-to-pos":[{"mask-r-to":U()}],"mask-image-r-from-color":[{"mask-r-from":H()}],"mask-image-r-to-color":[{"mask-r-to":H()}],"mask-image-b-from-pos":[{"mask-b-from":U()}],"mask-image-b-to-pos":[{"mask-b-to":U()}],"mask-image-b-from-color":[{"mask-b-from":H()}],"mask-image-b-to-color":[{"mask-b-to":H()}],"mask-image-l-from-pos":[{"mask-l-from":U()}],"mask-image-l-to-pos":[{"mask-l-to":U()}],"mask-image-l-from-color":[{"mask-l-from":H()}],"mask-image-l-to-color":[{"mask-l-to":H()}],"mask-image-x-from-pos":[{"mask-x-from":U()}],"mask-image-x-to-pos":[{"mask-x-to":U()}],"mask-image-x-from-color":[{"mask-x-from":H()}],"mask-image-x-to-color":[{"mask-x-to":H()}],"mask-image-y-from-pos":[{"mask-y-from":U()}],"mask-image-y-to-pos":[{"mask-y-to":U()}],"mask-image-y-from-color":[{"mask-y-from":H()}],"mask-image-y-to-color":[{"mask-y-to":H()}],"mask-image-radial":[{"mask-radial":[Xe,Ke]}],"mask-image-radial-from-pos":[{"mask-radial-from":U()}],"mask-image-radial-to-pos":[{"mask-radial-to":U()}],"mask-image-radial-from-color":[{"mask-radial-from":H()}],"mask-image-radial-to-color":[{"mask-radial-to":H()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":R()}],"mask-image-conic-pos":[{"mask-conic":[zt]}],"mask-image-conic-from-pos":[{"mask-conic-from":U()}],"mask-image-conic-to-pos":[{"mask-conic-to":U()}],"mask-image-conic-from-color":[{"mask-conic-from":H()}],"mask-image-conic-to-color":[{"mask-conic-to":H()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:te()}],"mask-repeat":[{mask:P()}],"mask-size":[{mask:re()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Xe,Ke]}],filter:[{filter:["","none",Xe,Ke]}],blur:[{blur:K()}],brightness:[{brightness:[zt,Xe,Ke]}],contrast:[{contrast:[zt,Xe,Ke]}],"drop-shadow":[{"drop-shadow":["","none",v,Yv,Wv]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",zt,Xe,Ke]}],"hue-rotate":[{"hue-rotate":[zt,Xe,Ke]}],invert:[{invert:["",zt,Xe,Ke]}],saturate:[{saturate:[zt,Xe,Ke]}],sepia:[{sepia:["",zt,Xe,Ke]}],"backdrop-filter":[{"backdrop-filter":["","none",Xe,Ke]}],"backdrop-blur":[{"backdrop-blur":K()}],"backdrop-brightness":[{"backdrop-brightness":[zt,Xe,Ke]}],"backdrop-contrast":[{"backdrop-contrast":[zt,Xe,Ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",zt,Xe,Ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[zt,Xe,Ke]}],"backdrop-invert":[{"backdrop-invert":["",zt,Xe,Ke]}],"backdrop-opacity":[{"backdrop-opacity":[zt,Xe,Ke]}],"backdrop-saturate":[{"backdrop-saturate":[zt,Xe,Ke]}],"backdrop-sepia":[{"backdrop-sepia":["",zt,Xe,Ke]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Xe,Ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[zt,"initial",Xe,Ke]}],ease:[{ease:["linear","initial",S,Xe,Ke]}],delay:[{delay:[zt,Xe,Ke]}],animate:[{animate:["none",k,Xe,Ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[x,Xe,Ke]}],"perspective-origin":[{"perspective-origin":j()}],rotate:[{rotate:ae()}],"rotate-x":[{"rotate-x":ae()}],"rotate-y":[{"rotate-y":ae()}],"rotate-z":[{"rotate-z":ae()}],scale:[{scale:B()}],"scale-x":[{"scale-x":B()}],"scale-y":[{"scale-y":B()}],"scale-z":[{"scale-z":B()}],"scale-3d":["scale-3d"],skew:[{skew:J()}],"skew-x":[{"skew-x":J()}],"skew-y":[{"skew-y":J()}],transform:[{transform:[Xe,Ke,"","none","gpu","cpu"]}],"transform-origin":[{origin:j()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:oe()}],"translate-x":[{"translate-x":oe()}],"translate-y":[{"translate-y":oe()}],"translate-z":[{"translate-z":oe()}],"translate-none":["translate-none"],accent:[{accent:H()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:H()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],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",Xe,Ke]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"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",Xe,Ke]}],fill:[{fill:["none",...H()]}],"stroke-w":[{stroke:[zt,dp,Oc,bS]}],stroke:[{stroke:["none",...H()]}],"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-x","border-w-y","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-x","border-color-y","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Fz=bX($X);function Me(...t){return Fz(lA(t))}const zX=t=>typeof t!="string"||!t.trim()?"?":t.trim().split(/\s+/).filter(Boolean).map(e=>e[0]).join("").toUpperCase()||"?";function Fa({className:t,...e}){return f.jsx("div",{"data-slot":"card",className:Me("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",t),...e})}function FX({className:t,...e}){return f.jsx("div",{"data-slot":"card-content",className:Me("px-6",t),...e})}var ag=Az();const Uz=Vf(ag);function CP(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function qx(...t){return e=>{let n=!1;const r=t.map(s=>{const i=CP(s,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():CP(t[s],null)}}}}function Ct(...t){return w.useCallback(qx(...t),t)}function uu(t){const e=UX(t),n=w.forwardRef((r,s)=>{const{children:i,...a}=r,l=w.Children.toArray(i),u=l.find(BX);if(u){const d=u.props.children,p=l.map(h=>h===u?w.Children.count(d)>1?w.Children.only(null):w.isValidElement(d)?d.props.children:null:h);return f.jsx(e,{...a,ref:s,children:w.isValidElement(d)?w.cloneElement(d,void 0,p):null})}return f.jsx(e,{...a,ref:s,children:i})});return n.displayName=`${t}.Slot`,n}var uA=uu("Slot");function UX(t){const e=w.forwardRef((n,r)=>{const{children:s,...i}=n;if(w.isValidElement(s)){const a=VX(s),l=qX(i,s.props);return s.type!==w.Fragment&&(l.ref=r?qx(r,a):a),w.cloneElement(s,l)}return w.Children.count(s)>1?w.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var Bz=Symbol("radix.slottable");function qz(t){const e=({children:n})=>f.jsx(f.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=Bz,e}function BX(t){return w.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Bz}function qX(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...l)=>{const u=i(...l);return s(...l),u}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function VX(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var HX=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ut=HX.reduce((t,e)=>{const n=uu(`Primitive.${e}`),r=w.forwardRef((s,i)=>{const{asChild:a,...l}=s,u=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(u,{...l,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function Vz(t,e){t&&ag.flushSync(()=>t.dispatchEvent(e))}var Hz=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),GX="VisuallyHidden",Gz=w.forwardRef((t,e)=>f.jsx(ut.span,{...t,ref:e,style:{...Hz,...t.style}}));Gz.displayName=GX;var WX=Gz;function YX(t,e){const n=w.createContext(e),r=i=>{const{children:a,...l}=i,u=w.useMemo(()=>l,Object.values(l));return f.jsx(n.Provider,{value:u,children:a})};r.displayName=t+"Provider";function s(i){const a=w.useContext(n);if(a)return a;if(e!==void 0)return e;throw new Error(`\`${i}\` must be used within \`${t}\``)}return[r,s]}function ai(t,e=[]){let n=[];function r(i,a){const l=w.createContext(a),u=n.length;n=[...n,a];const d=h=>{const{scope:g,children:v,...b}=h,x=g?.[t]?.[u]||l,E=w.useMemo(()=>b,Object.values(b));return f.jsx(x.Provider,{value:E,children:v})};d.displayName=i+"Provider";function p(h,g){const v=g?.[t]?.[u]||l,b=w.useContext(v);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${i}\``)}return[d,p]}const s=()=>{const i=n.map(a=>w.createContext(a));return function(l){const u=l?.[t]||i;return w.useMemo(()=>({[`__scope${t}`]:{...l,[t]:u}}),[l,u])}};return s.scopeName=t,[r,KX(s,...e)]}function KX(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const a=r.reduce((l,{useScope:u,scopeName:d})=>{const h=u(i)[`__scope${d}`];return{...l,...h}},{});return w.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}function Vx(t){const e=t+"CollectionProvider",[n,r]=ai(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=x=>{const{scope:E,children:S}=x,k=Ee.useRef(null),T=Ee.useRef(new Map).current;return f.jsx(s,{scope:E,itemMap:T,collectionRef:k,children:S})};a.displayName=e;const l=t+"CollectionSlot",u=uu(l),d=Ee.forwardRef((x,E)=>{const{scope:S,children:k}=x,T=i(l,S),R=Ct(E,T.collectionRef);return f.jsx(u,{ref:R,children:k})});d.displayName=l;const p=t+"CollectionItemSlot",h="data-radix-collection-item",g=uu(p),v=Ee.forwardRef((x,E)=>{const{scope:S,children:k,...T}=x,R=Ee.useRef(null),j=Ct(E,R),A=i(p,S);return Ee.useEffect(()=>(A.itemMap.set(R,{ref:R,...T}),()=>void A.itemMap.delete(R))),f.jsx(g,{[h]:"",ref:j,children:k})});v.displayName=p;function b(x){const E=i(t+"CollectionConsumer",x);return Ee.useCallback(()=>{const k=E.collectionRef.current;if(!k)return[];const T=Array.from(k.querySelectorAll(`[${h}]`));return Array.from(E.itemMap.values()).sort((A,N)=>T.indexOf(A.ref.current)-T.indexOf(N.ref.current))},[E.collectionRef,E.itemMap])}return[{Provider:a,Slot:d,ItemSlot:v},b,r]}function Le(t,e,{checkForDefaultPrevented:n=!0}={}){return function(s){if(t?.(s),n===!1||!s.defaultPrevented)return e?.(s)}}var yr=globalThis?.document?w.useLayoutEffect:()=>{},XX=oA[" useInsertionEffect ".trim().toString()]||yr;function jo({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[s,i,a]=QX({defaultProp:e,onChange:n}),l=t!==void 0,u=l?t:s;{const p=w.useRef(t!==void 0);w.useEffect(()=>{const h=p.current;h!==l&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=l},[l,r])}const d=w.useCallback(p=>{if(l){const h=JX(p)?p(t):p;h!==t&&a.current?.(h)}else i(p)},[l,t,i,a]);return[u,d]}function QX({defaultProp:t,onChange:e}){const[n,r]=w.useState(t),s=w.useRef(n),i=w.useRef(e);return XX(()=>{i.current=e},[e]),w.useEffect(()=>{s.current!==n&&(i.current?.(n),s.current=n)},[n,s]),[n,r,i]}function JX(t){return typeof t=="function"}function ZX(t,e){return w.useReducer((n,r)=>e[n][r]??n,t)}var Ds=t=>{const{present:e,children:n}=t,r=eQ(e),s=typeof n=="function"?n({present:r.isPresent}):w.Children.only(n),i=Ct(r.ref,tQ(s));return typeof n=="function"||r.isPresent?w.cloneElement(s,{ref:i}):null};Ds.displayName="Presence";function eQ(t){const[e,n]=w.useState(),r=w.useRef(null),s=w.useRef(t),i=w.useRef("none"),a=t?"mounted":"unmounted",[l,u]=ZX(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const d=Kv(r.current);i.current=l==="mounted"?d:"none"},[l]),yr(()=>{const d=r.current,p=s.current;if(p!==t){const g=i.current,v=Kv(d);t?u("MOUNT"):v==="none"||d?.display==="none"?u("UNMOUNT"):u(p&&g!==v?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,u]),yr(()=>{if(e){let d;const p=e.ownerDocument.defaultView??window,h=v=>{const x=Kv(r.current).includes(CSS.escape(v.animationName));if(v.target===e&&x&&(u("ANIMATION_END"),!s.current)){const E=e.style.animationFillMode;e.style.animationFillMode="forwards",d=p.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=E)})}},g=v=>{v.target===e&&(i.current=Kv(r.current))};return e.addEventListener("animationstart",g),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{p.clearTimeout(d),e.removeEventListener("animationstart",g),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else u("ANIMATION_END")},[e,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:w.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function Kv(t){return t?.animationName||"none"}function tQ(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var nQ=oA[" useId ".trim().toString()]||(()=>{}),rQ=0;function Ei(t){const[e,n]=w.useState(nQ());return yr(()=>{n(r=>r??String(rQ++))},[t]),e?`radix-${e}`:""}var sQ=w.createContext(void 0);function og(t){const e=w.useContext(sQ);return t||e||"ltr"}function kr(t){const e=w.useRef(t);return w.useEffect(()=>{e.current=t}),w.useMemo(()=>(...n)=>e.current?.(...n),[])}function iQ(t,e=globalThis?.document){const n=kr(t);w.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var aQ="DismissableLayer",lk="dismissableLayer.update",oQ="dismissableLayer.pointerDownOutside",lQ="dismissableLayer.focusOutside",AP,Wz=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),lg=w.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:a,onDismiss:l,...u}=t,d=w.useContext(Wz),[p,h]=w.useState(null),g=p?.ownerDocument??globalThis?.document,[,v]=w.useState({}),b=Ct(e,N=>h(N)),x=Array.from(d.layers),[E]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),S=x.indexOf(E),k=p?x.indexOf(p):-1,T=d.layersWithOutsidePointerEventsDisabled.size>0,R=k>=S,j=dQ(N=>{const M=N.target,I=[...d.branches].some(O=>O.contains(M));!R||I||(s?.(N),a?.(N),N.defaultPrevented||l?.())},g),A=fQ(N=>{const M=N.target;[...d.branches].some(O=>O.contains(M))||(i?.(N),a?.(N),N.defaultPrevented||l?.())},g);return iQ(N=>{k===d.layers.size-1&&(r?.(N),!N.defaultPrevented&&l&&(N.preventDefault(),l()))},g),w.useEffect(()=>{if(p)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(AP=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),NP(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=AP)}},[p,g,n,d]),w.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),NP())},[p,d]),w.useEffect(()=>{const N=()=>v({});return document.addEventListener(lk,N),()=>document.removeEventListener(lk,N)},[]),f.jsx(ut.div,{...u,ref:b,style:{pointerEvents:T?R?"auto":"none":void 0,...t.style},onFocusCapture:Le(t.onFocusCapture,A.onFocusCapture),onBlurCapture:Le(t.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Le(t.onPointerDownCapture,j.onPointerDownCapture)})});lg.displayName=aQ;var cQ="DismissableLayerBranch",uQ=w.forwardRef((t,e)=>{const n=w.useContext(Wz),r=w.useRef(null),s=Ct(e,r);return w.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),f.jsx(ut.div,{...t,ref:s})});uQ.displayName=cQ;function dQ(t,e=globalThis?.document){const n=kr(t),r=w.useRef(!1),s=w.useRef(()=>{});return w.useEffect(()=>{const i=l=>{if(l.target&&!r.current){let u=function(){Yz(oQ,n,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(e.removeEventListener("click",s.current),s.current=u,e.addEventListener("click",s.current,{once:!0})):u()}else e.removeEventListener("click",s.current);r.current=!1},a=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),e.removeEventListener("pointerdown",i),e.removeEventListener("click",s.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function fQ(t,e=globalThis?.document){const n=kr(t),r=w.useRef(!1);return w.useEffect(()=>{const s=i=>{i.target&&!r.current&&Yz(lQ,n,{originalEvent:i},{discrete:!1})};return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function NP(){const t=new CustomEvent(lk);document.dispatchEvent(t)}function Yz(t,e,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?Vz(s,i):s.dispatchEvent(i)}var xS="focusScope.autoFocusOnMount",_S="focusScope.autoFocusOnUnmount",RP={bubbles:!1,cancelable:!0},hQ="FocusScope",Hx=w.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...a}=t,[l,u]=w.useState(null),d=kr(s),p=kr(i),h=w.useRef(null),g=Ct(e,x=>u(x)),v=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let x=function(T){if(v.paused||!l)return;const R=T.target;l.contains(R)?h.current=R:El(h.current,{select:!0})},E=function(T){if(v.paused||!l)return;const R=T.relatedTarget;R!==null&&(l.contains(R)||El(h.current,{select:!0}))},S=function(T){if(document.activeElement===document.body)for(const j of T)j.removedNodes.length>0&&El(l)};document.addEventListener("focusin",x),document.addEventListener("focusout",E);const k=new MutationObserver(S);return l&&k.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",E),k.disconnect()}}},[r,l,v.paused]),w.useEffect(()=>{if(l){MP.add(v);const x=document.activeElement;if(!l.contains(x)){const S=new CustomEvent(xS,RP);l.addEventListener(xS,d),l.dispatchEvent(S),S.defaultPrevented||(pQ(bQ(Kz(l)),{select:!0}),document.activeElement===x&&El(l))}return()=>{l.removeEventListener(xS,d),setTimeout(()=>{const S=new CustomEvent(_S,RP);l.addEventListener(_S,p),l.dispatchEvent(S),S.defaultPrevented||El(x??document.body,{select:!0}),l.removeEventListener(_S,p),MP.remove(v)},0)}}},[l,d,p,v]);const b=w.useCallback(x=>{if(!n&&!r||v.paused)return;const E=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,S=document.activeElement;if(E&&S){const k=x.currentTarget,[T,R]=mQ(k);T&&R?!x.shiftKey&&S===R?(x.preventDefault(),n&&El(T,{select:!0})):x.shiftKey&&S===T&&(x.preventDefault(),n&&El(R,{select:!0})):S===k&&x.preventDefault()}},[n,r,v.paused]);return f.jsx(ut.div,{tabIndex:-1,...a,ref:g,onKeyDown:b})});Hx.displayName=hQ;function pQ(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(El(r,{select:e}),document.activeElement!==n)return}function mQ(t){const e=Kz(t),n=jP(e,t),r=jP(e.reverse(),t);return[n,r]}function Kz(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function jP(t,e){for(const n of t)if(!gQ(n,{upTo:e}))return n}function gQ(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function vQ(t){return t instanceof HTMLInputElement&&"select"in t}function El(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&vQ(t)&&e&&t.select()}}var MP=yQ();function yQ(){let t=[];return{add(e){const n=t[0];e!==n&&n?.pause(),t=OP(t,e),t.unshift(e)},remove(e){t=OP(t,e),t[0]?.resume()}}}function OP(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function bQ(t){return t.filter(e=>e.tagName!=="A")}var xQ="Portal",cg=w.forwardRef((t,e)=>{const{container:n,...r}=t,[s,i]=w.useState(!1);yr(()=>i(!0),[]);const a=n||s&&globalThis?.document?.body;return a?Uz.createPortal(f.jsx(ut.div,{...r,ref:e}),a):null});cg.displayName=xQ;var wS=0;function dA(){w.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??PP()),document.body.insertAdjacentElement("beforeend",t[1]??PP()),wS++,()=>{wS===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),wS--}},[])}function PP(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var Sa=function(){return Sa=Object.assign||function(e){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Sa.apply(this,arguments)};function Xz(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(n[r[s]]=t[r[s]]);return n}function _Q(t,e,n){if(n||arguments.length===2)for(var r=0,s=e.length,i;r<s;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}var qy="right-scroll-bar-position",Vy="width-before-scroll-bar",wQ="with-scroll-bars-hidden",SQ="--removed-body-scroll-bar-size";function SS(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function EQ(t,e){var n=w.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=e,n.facade}var kQ=typeof window<"u"?w.useLayoutEffect:w.useEffect,IP=new WeakMap;function TQ(t,e){var n=EQ(null,function(r){return t.forEach(function(s){return SS(s,r)})});return kQ(function(){var r=IP.get(n);if(r){var s=new Set(r),i=new Set(t),a=n.current;s.forEach(function(l){i.has(l)||SS(l,null)}),i.forEach(function(l){s.has(l)||SS(l,a)})}IP.set(n,t)},[t]),n}function CQ(t){return t}function AQ(t,e){e===void 0&&(e=CQ);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(i){var a=e(i,r);return n.push(a),function(){n=n.filter(function(l){return l!==a})}},assignSyncMedium:function(i){for(r=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){r=!0;var a=[];if(n.length){var l=n;n=[],l.forEach(i),a=n}var u=function(){var p=a;a=[],p.forEach(i)},d=function(){return Promise.resolve().then(u)};d(),n={push:function(p){a.push(p),d()},filter:function(p){return a=a.filter(p),n}}}};return s}function NQ(t){t===void 0&&(t={});var e=AQ(null);return e.options=Sa({async:!0,ssr:!1},t),e}var Qz=function(t){var e=t.sideCar,n=Xz(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return w.createElement(r,Sa({},n))};Qz.isSideCarExport=!0;function RQ(t,e){return t.useMedium(e),Qz}var Jz=NQ(),ES=function(){},Gx=w.forwardRef(function(t,e){var n=w.useRef(null),r=w.useState({onScrollCapture:ES,onWheelCapture:ES,onTouchMoveCapture:ES}),s=r[0],i=r[1],a=t.forwardProps,l=t.children,u=t.className,d=t.removeScrollBar,p=t.enabled,h=t.shards,g=t.sideCar,v=t.noRelative,b=t.noIsolation,x=t.inert,E=t.allowPinchZoom,S=t.as,k=S===void 0?"div":S,T=t.gapMode,R=Xz(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=g,A=TQ([n,e]),N=Sa(Sa({},R),s);return w.createElement(w.Fragment,null,p&&w.createElement(j,{sideCar:Jz,removeScrollBar:d,shards:h,noRelative:v,noIsolation:b,inert:x,setCallbacks:i,allowPinchZoom:!!E,lockRef:n,gapMode:T}),a?w.cloneElement(w.Children.only(l),Sa(Sa({},N),{ref:A})):w.createElement(k,Sa({},N,{className:u,ref:A}),l))});Gx.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Gx.classNames={fullWidth:Vy,zeroRight:qy};var jQ=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function MQ(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=jQ();return e&&t.setAttribute("nonce",e),t}function OQ(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function PQ(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var IQ=function(){var t=0,e=null;return{add:function(n){t==0&&(e=MQ())&&(OQ(e,n),PQ(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},DQ=function(){var t=IQ();return function(e,n){w.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},Zz=function(){var t=DQ(),e=function(n){var r=n.styles,s=n.dynamic;return t(r,s),null};return e},LQ={left:0,top:0,right:0,gap:0},kS=function(t){return parseInt(t||"",10)||0},$Q=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],s=e[t==="padding"?"paddingRight":"marginRight"];return[kS(n),kS(r),kS(s)]},zQ=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return LQ;var e=$Q(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},FQ=Zz(),tf="data-scroll-locked",UQ=function(t,e,n,r){var s=t.left,i=t.top,a=t.right,l=t.gap;return n===void 0&&(n="margin"),`
|
|
48
|
+
`+m.stack}}function Fr(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function mc(o){var c=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function Lu(o){var c=mc(o)?"checked":"value",m=Object.getOwnPropertyDescriptor(o.constructor.prototype,c),y=""+o[c];if(!o.hasOwnProperty(c)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var _=m.get,C=m.set;return Object.defineProperty(o,c,{configurable:!0,get:function(){return _.call(this)},set:function($){y=""+$,C.call(this,$)}}),Object.defineProperty(o,c,{enumerable:m.enumerable}),{getValue:function(){return y},setValue:function($){y=""+$},stopTracking:function(){o._valueTracker=null,delete o[c]}}}}function gc(o){o._valueTracker||(o._valueTracker=Lu(o))}function gh(o){if(!o)return!1;var c=o._valueTracker;if(!c)return!0;var m=c.getValue(),y="";return o&&(y=mc(o)?o.checked?"true":"false":o.value),o=y,o!==m?(c.setValue(o),!0):!1}function ha(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}var GW=/[\n"\\]/g;function li(o){return o.replace(GW,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function c_(o,c,m,y,_,C,$,q){o.name="",$!=null&&typeof $!="function"&&typeof $!="symbol"&&typeof $!="boolean"?o.type=$:o.removeAttribute("type"),c!=null?$==="number"?(c===0&&o.value===""||o.value!=c)&&(o.value=""+Fr(c)):o.value!==""+Fr(c)&&(o.value=""+Fr(c)):$!=="submit"&&$!=="reset"||o.removeAttribute("value"),c!=null?u_(o,$,Fr(c)):m!=null?u_(o,$,Fr(m)):y!=null&&o.removeAttribute("value"),_==null&&C!=null&&(o.defaultChecked=!!C),_!=null&&(o.checked=_&&typeof _!="function"&&typeof _!="symbol"),q!=null&&typeof q!="function"&&typeof q!="symbol"&&typeof q!="boolean"?o.name=""+Fr(q):o.removeAttribute("name")}function $j(o,c,m,y,_,C,$,q){if(C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(o.type=C),c!=null||m!=null){if(!(C!=="submit"&&C!=="reset"||c!=null))return;m=m!=null?""+Fr(m):"",c=c!=null?""+Fr(c):m,q||c===o.value||(o.value=c),o.defaultValue=c}y=y??_,y=typeof y!="function"&&typeof y!="symbol"&&!!y,o.checked=q?o.checked:!!y,o.defaultChecked=!!y,$!=null&&typeof $!="function"&&typeof $!="symbol"&&typeof $!="boolean"&&(o.name=$)}function u_(o,c,m){c==="number"&&ha(o.ownerDocument)===o||o.defaultValue===""+m||(o.defaultValue=""+m)}function $u(o,c,m,y){if(o=o.options,c){c={};for(var _=0;_<m.length;_++)c["$"+m[_]]=!0;for(m=0;m<o.length;m++)_=c.hasOwnProperty("$"+o[m].value),o[m].selected!==_&&(o[m].selected=_),_&&y&&(o[m].defaultSelected=!0)}else{for(m=""+Fr(m),c=null,_=0;_<o.length;_++){if(o[_].value===m){o[_].selected=!0,y&&(o[_].defaultSelected=!0);return}c!==null||o[_].disabled||(c=o[_])}c!==null&&(c.selected=!0)}}function zj(o,c,m){if(c!=null&&(c=""+Fr(c),c!==o.value&&(o.value=c),m==null)){o.defaultValue!==c&&(o.defaultValue=c);return}o.defaultValue=m!=null?""+Fr(m):""}function Fj(o,c,m,y){if(c==null){if(y!=null){if(m!=null)throw Error(r(92));if(X(y)){if(1<y.length)throw Error(r(93));y=y[0]}m=y}m==null&&(m=""),c=m}m=Fr(c),o.defaultValue=m,y=o.textContent,y===m&&y!==""&&y!==null&&(o.value=y)}function zu(o,c){if(c){var m=o.firstChild;if(m&&m===o.lastChild&&m.nodeType===3){m.nodeValue=c;return}}o.textContent=c}var WW=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Uj(o,c,m){var y=c.indexOf("--")===0;m==null||typeof m=="boolean"||m===""?y?o.setProperty(c,""):c==="float"?o.cssFloat="":o[c]="":y?o.setProperty(c,m):typeof m!="number"||m===0||WW.has(c)?c==="float"?o.cssFloat=m:o[c]=(""+m).trim():o[c]=m+"px"}function Bj(o,c,m){if(c!=null&&typeof c!="object")throw Error(r(62));if(o=o.style,m!=null){for(var y in m)!m.hasOwnProperty(y)||c!=null&&c.hasOwnProperty(y)||(y.indexOf("--")===0?o.setProperty(y,""):y==="float"?o.cssFloat="":o[y]="");for(var _ in c)y=c[_],c.hasOwnProperty(_)&&m[_]!==y&&Uj(o,_,y)}else for(var C in c)c.hasOwnProperty(C)&&Uj(o,C,c[C])}function d_(o){if(o.indexOf("-")===-1)return!1;switch(o){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 YW=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),KW=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ug(o){return KW.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}var f_=null;function h_(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var Fu=null,Uu=null;function qj(o){var c=Mt(o);if(c&&(o=c.stateNode)){var m=o[fn]||null;e:switch(o=c.stateNode,c.type){case"input":if(c_(o,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name),c=m.name,m.type==="radio"&&c!=null){for(m=o;m.parentNode;)m=m.parentNode;for(m=m.querySelectorAll('input[name="'+li(""+c)+'"][type="radio"]'),c=0;c<m.length;c++){var y=m[c];if(y!==o&&y.form===o.form){var _=y[fn]||null;if(!_)throw Error(r(90));c_(y,_.value,_.defaultValue,_.defaultValue,_.checked,_.defaultChecked,_.type,_.name)}}for(c=0;c<m.length;c++)y=m[c],y.form===o.form&&gh(y)}break e;case"textarea":zj(o,m.value,m.defaultValue);break e;case"select":c=m.value,c!=null&&$u(o,!!m.multiple,c,!1)}}}var p_=!1;function Vj(o,c,m){if(p_)return o(c,m);p_=!0;try{var y=o(c);return y}finally{if(p_=!1,(Fu!==null||Uu!==null)&&(Tv(),Fu&&(c=Fu,o=Uu,Uu=Fu=null,qj(c),o)))for(c=0;c<o.length;c++)qj(o[c])}}function vh(o,c){var m=o.stateNode;if(m===null)return null;var y=m[fn]||null;if(y===null)return null;m=y[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(o=o.type,y=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!y;break e;default:o=!1}if(o)return null;if(m&&typeof m!="function")throw Error(r(231,c,typeof m));return m}var Ja=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),m_=!1;if(Ja)try{var yh={};Object.defineProperty(yh,"passive",{get:function(){m_=!0}}),window.addEventListener("test",yh,yh),window.removeEventListener("test",yh,yh)}catch{m_=!1}var Ko=null,g_=null,Bg=null;function Hj(){if(Bg)return Bg;var o,c=g_,m=c.length,y,_="value"in Ko?Ko.value:Ko.textContent,C=_.length;for(o=0;o<m&&c[o]===_[o];o++);var $=m-o;for(y=1;y<=$&&c[m-y]===_[C-y];y++);return Bg=_.slice(o,1<y?1-y:void 0)}function qg(o){var c=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&c===13&&(o=13)):o=c,o===10&&(o=13),32<=o||o===13?o:0}function Vg(){return!0}function Gj(){return!1}function xs(o){function c(m,y,_,C,$){this._reactName=m,this._targetInst=_,this.type=y,this.nativeEvent=C,this.target=$,this.currentTarget=null;for(var q in o)o.hasOwnProperty(q)&&(m=o[q],this[q]=m?m(C):C[q]);return this.isDefaultPrevented=(C.defaultPrevented!=null?C.defaultPrevented:C.returnValue===!1)?Vg:Gj,this.isPropagationStopped=Gj,this}return p(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var m=this.nativeEvent;m&&(m.preventDefault?m.preventDefault():typeof m.returnValue!="unknown"&&(m.returnValue=!1),this.isDefaultPrevented=Vg)},stopPropagation:function(){var m=this.nativeEvent;m&&(m.stopPropagation?m.stopPropagation():typeof m.cancelBubble!="unknown"&&(m.cancelBubble=!0),this.isPropagationStopped=Vg)},persist:function(){},isPersistent:Vg}),c}var vc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Hg=xs(vc),bh=p({},vc,{view:0,detail:0}),XW=xs(bh),v_,y_,xh,Gg=p({},bh,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:x_,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==xh&&(xh&&o.type==="mousemove"?(v_=o.screenX-xh.screenX,y_=o.screenY-xh.screenY):y_=v_=0,xh=o),v_)},movementY:function(o){return"movementY"in o?o.movementY:y_}}),Wj=xs(Gg),QW=p({},Gg,{dataTransfer:0}),JW=xs(QW),ZW=p({},bh,{relatedTarget:0}),b_=xs(ZW),eY=p({},vc,{animationName:0,elapsedTime:0,pseudoElement:0}),tY=xs(eY),nY=p({},vc,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),rY=xs(nY),sY=p({},vc,{data:0}),Yj=xs(sY),iY={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},aY={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"},oY={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function lY(o){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(o):(o=oY[o])?!!c[o]:!1}function x_(){return lY}var cY=p({},bh,{key:function(o){if(o.key){var c=iY[o.key]||o.key;if(c!=="Unidentified")return c}return o.type==="keypress"?(o=qg(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?aY[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:x_,charCode:function(o){return o.type==="keypress"?qg(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?qg(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),uY=xs(cY),dY=p({},Gg,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Kj=xs(dY),fY=p({},bh,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:x_}),hY=xs(fY),pY=p({},vc,{propertyName:0,elapsedTime:0,pseudoElement:0}),mY=xs(pY),gY=p({},Gg,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),vY=xs(gY),yY=p({},vc,{newState:0,oldState:0}),bY=xs(yY),xY=[9,13,27,32],__=Ja&&"CompositionEvent"in window,_h=null;Ja&&"documentMode"in document&&(_h=document.documentMode);var _Y=Ja&&"TextEvent"in window&&!_h,Xj=Ja&&(!__||_h&&8<_h&&11>=_h),Qj=" ",Jj=!1;function Zj(o,c){switch(o){case"keyup":return xY.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function eM(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Bu=!1;function wY(o,c){switch(o){case"compositionend":return eM(c);case"keypress":return c.which!==32?null:(Jj=!0,Qj);case"textInput":return o=c.data,o===Qj&&Jj?null:o;default:return null}}function SY(o,c){if(Bu)return o==="compositionend"||!__&&Zj(o,c)?(o=Hj(),Bg=g_=Ko=null,Bu=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return Xj&&c.locale!=="ko"?null:c.data;default:return null}}var EY={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 tM(o){var c=o&&o.nodeName&&o.nodeName.toLowerCase();return c==="input"?!!EY[o.type]:c==="textarea"}function nM(o,c,m,y){Fu?Uu?Uu.push(y):Uu=[y]:Fu=y,c=Mv(c,"onChange"),0<c.length&&(m=new Hg("onChange","change",null,m,y),o.push({event:m,listeners:c}))}var wh=null,Sh=null;function kY(o){D2(o,0)}function Wg(o){var c=sn(o);if(gh(c))return o}function rM(o,c){if(o==="change")return c}var sM=!1;if(Ja){var w_;if(Ja){var S_="oninput"in document;if(!S_){var iM=document.createElement("div");iM.setAttribute("oninput","return;"),S_=typeof iM.oninput=="function"}w_=S_}else w_=!1;sM=w_&&(!document.documentMode||9<document.documentMode)}function aM(){wh&&(wh.detachEvent("onpropertychange",oM),Sh=wh=null)}function oM(o){if(o.propertyName==="value"&&Wg(Sh)){var c=[];nM(c,Sh,o,h_(o)),Vj(kY,c)}}function TY(o,c,m){o==="focusin"?(aM(),wh=c,Sh=m,wh.attachEvent("onpropertychange",oM)):o==="focusout"&&aM()}function CY(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return Wg(Sh)}function AY(o,c){if(o==="click")return Wg(c)}function NY(o,c){if(o==="input"||o==="change")return Wg(c)}function RY(o,c){return o===c&&(o!==0||1/o===1/c)||o!==o&&c!==c}var Us=typeof Object.is=="function"?Object.is:RY;function Eh(o,c){if(Us(o,c))return!0;if(typeof o!="object"||o===null||typeof c!="object"||c===null)return!1;var m=Object.keys(o),y=Object.keys(c);if(m.length!==y.length)return!1;for(y=0;y<m.length;y++){var _=m[y];if(!oe.call(c,_)||!Us(o[_],c[_]))return!1}return!0}function lM(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function cM(o,c){var m=lM(o);o=0;for(var y;m;){if(m.nodeType===3){if(y=o+m.textContent.length,o<=c&&y>=c)return{node:m,offset:c-o};o=y}e:{for(;m;){if(m.nextSibling){m=m.nextSibling;break e}m=m.parentNode}m=void 0}m=lM(m)}}function uM(o,c){return o&&c?o===c?!0:o&&o.nodeType===3?!1:c&&c.nodeType===3?uM(o,c.parentNode):"contains"in o?o.contains(c):o.compareDocumentPosition?!!(o.compareDocumentPosition(c)&16):!1:!1}function dM(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var c=ha(o.document);c instanceof o.HTMLIFrameElement;){try{var m=typeof c.contentWindow.location.href=="string"}catch{m=!1}if(m)o=c.contentWindow;else break;c=ha(o.document)}return c}function E_(o){var c=o&&o.nodeName&&o.nodeName.toLowerCase();return c&&(c==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||c==="textarea"||o.contentEditable==="true")}var jY=Ja&&"documentMode"in document&&11>=document.documentMode,qu=null,k_=null,kh=null,T_=!1;function fM(o,c,m){var y=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;T_||qu==null||qu!==ha(y)||(y=qu,"selectionStart"in y&&E_(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),kh&&Eh(kh,y)||(kh=y,y=Mv(k_,"onSelect"),0<y.length&&(c=new Hg("onSelect","select",null,c,m),o.push({event:c,listeners:y}),c.target=qu)))}function yc(o,c){var m={};return m[o.toLowerCase()]=c.toLowerCase(),m["Webkit"+o]="webkit"+c,m["Moz"+o]="moz"+c,m}var Vu={animationend:yc("Animation","AnimationEnd"),animationiteration:yc("Animation","AnimationIteration"),animationstart:yc("Animation","AnimationStart"),transitionrun:yc("Transition","TransitionRun"),transitionstart:yc("Transition","TransitionStart"),transitioncancel:yc("Transition","TransitionCancel"),transitionend:yc("Transition","TransitionEnd")},C_={},hM={};Ja&&(hM=document.createElement("div").style,"AnimationEvent"in window||(delete Vu.animationend.animation,delete Vu.animationiteration.animation,delete Vu.animationstart.animation),"TransitionEvent"in window||delete Vu.transitionend.transition);function bc(o){if(C_[o])return C_[o];if(!Vu[o])return o;var c=Vu[o],m;for(m in c)if(c.hasOwnProperty(m)&&m in hM)return C_[o]=c[m];return o}var pM=bc("animationend"),mM=bc("animationiteration"),gM=bc("animationstart"),MY=bc("transitionrun"),OY=bc("transitionstart"),PY=bc("transitioncancel"),vM=bc("transitionend"),yM=new Map,A_="abort auxClick beforeToggle 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(" ");A_.push("scrollEnd");function Ui(o,c){yM.set(o,c),lt(c,[o])}var bM=new WeakMap;function ci(o,c){if(typeof o=="object"&&o!==null){var m=bM.get(o);return m!==void 0?m:(c={value:o,source:c,stack:mh(c)},bM.set(o,c),c)}return{value:o,source:c,stack:mh(c)}}var ui=[],Hu=0,N_=0;function Yg(){for(var o=Hu,c=N_=Hu=0;c<o;){var m=ui[c];ui[c++]=null;var y=ui[c];ui[c++]=null;var _=ui[c];ui[c++]=null;var C=ui[c];if(ui[c++]=null,y!==null&&_!==null){var $=y.pending;$===null?_.next=_:(_.next=$.next,$.next=_),y.pending=_}C!==0&&xM(m,_,C)}}function Kg(o,c,m,y){ui[Hu++]=o,ui[Hu++]=c,ui[Hu++]=m,ui[Hu++]=y,N_|=y,o.lanes|=y,o=o.alternate,o!==null&&(o.lanes|=y)}function R_(o,c,m,y){return Kg(o,c,m,y),Xg(o)}function Gu(o,c){return Kg(o,null,null,c),Xg(o)}function xM(o,c,m){o.lanes|=m;var y=o.alternate;y!==null&&(y.lanes|=m);for(var _=!1,C=o.return;C!==null;)C.childLanes|=m,y=C.alternate,y!==null&&(y.childLanes|=m),C.tag===22&&(o=C.stateNode,o===null||o._visibility&1||(_=!0)),o=C,C=C.return;return o.tag===3?(C=o.stateNode,_&&c!==null&&(_=31-qe(m),o=C.hiddenUpdates,y=o[_],y===null?o[_]=[c]:y.push(c),c.lane=m|536870912),C):null}function Xg(o){if(50<Xh)throw Xh=0,Dw=null,Error(r(185));for(var c=o.return;c!==null;)o=c,c=o.return;return o.tag===3?o.stateNode:null}var Wu={};function IY(o,c,m,y){this.tag=o,this.key=m,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bs(o,c,m,y){return new IY(o,c,m,y)}function j_(o){return o=o.prototype,!(!o||!o.isReactComponent)}function Za(o,c){var m=o.alternate;return m===null?(m=Bs(o.tag,c,o.key,o.mode),m.elementType=o.elementType,m.type=o.type,m.stateNode=o.stateNode,m.alternate=o,o.alternate=m):(m.pendingProps=c,m.type=o.type,m.flags=0,m.subtreeFlags=0,m.deletions=null),m.flags=o.flags&65011712,m.childLanes=o.childLanes,m.lanes=o.lanes,m.child=o.child,m.memoizedProps=o.memoizedProps,m.memoizedState=o.memoizedState,m.updateQueue=o.updateQueue,c=o.dependencies,m.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},m.sibling=o.sibling,m.index=o.index,m.ref=o.ref,m.refCleanup=o.refCleanup,m}function _M(o,c){o.flags&=65011714;var m=o.alternate;return m===null?(o.childLanes=0,o.lanes=c,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=m.childLanes,o.lanes=m.lanes,o.child=m.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=m.memoizedProps,o.memoizedState=m.memoizedState,o.updateQueue=m.updateQueue,o.type=m.type,c=m.dependencies,o.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext}),o}function Qg(o,c,m,y,_,C){var $=0;if(y=o,typeof o=="function")j_(o)&&($=1);else if(typeof o=="string")$=LK(o,m,Z.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case I:return o=Bs(31,m,c,_),o.elementType=I,o.lanes=C,o;case b:return xc(m.children,_,C,c);case x:$=8,_|=24;break;case E:return o=Bs(12,m,c,_|2),o.elementType=E,o.lanes=C,o;case j:return o=Bs(13,m,c,_),o.elementType=j,o.lanes=C,o;case A:return o=Bs(19,m,c,_),o.elementType=A,o.lanes=C,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case S:case T:$=10;break e;case k:$=9;break e;case R:$=11;break e;case N:$=14;break e;case M:$=16,y=null;break e}$=29,m=Error(r(130,o===null?"null":typeof o,"")),y=null}return c=Bs($,m,c,_),c.elementType=o,c.type=y,c.lanes=C,c}function xc(o,c,m,y){return o=Bs(7,o,y,c),o.lanes=m,o}function M_(o,c,m){return o=Bs(6,o,null,c),o.lanes=m,o}function O_(o,c,m){return c=Bs(4,o.children!==null?o.children:[],o.key,c),c.lanes=m,c.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},c}var Yu=[],Ku=0,Jg=null,Zg=0,di=[],fi=0,_c=null,eo=1,to="";function wc(o,c){Yu[Ku++]=Zg,Yu[Ku++]=Jg,Jg=o,Zg=c}function wM(o,c,m){di[fi++]=eo,di[fi++]=to,di[fi++]=_c,_c=o;var y=eo;o=to;var _=32-qe(y)-1;y&=~(1<<_),m+=1;var C=32-qe(c)+_;if(30<C){var $=_-_%5;C=(y&(1<<$)-1).toString(32),y>>=$,_-=$,eo=1<<32-qe(c)+_|m<<_|y,to=C+o}else eo=1<<C|m<<_|y,to=o}function P_(o){o.return!==null&&(wc(o,1),wM(o,1,0))}function I_(o){for(;o===Jg;)Jg=Yu[--Ku],Yu[Ku]=null,Zg=Yu[--Ku],Yu[Ku]=null;for(;o===_c;)_c=di[--fi],di[fi]=null,to=di[--fi],di[fi]=null,eo=di[--fi],di[fi]=null}var os=null,Gn=null,on=!1,Sc=null,pa=!1,D_=Error(r(519));function Ec(o){var c=Error(r(418,""));throw Ah(ci(c,o)),D_}function SM(o){var c=o.stateNode,m=o.type,y=o.memoizedProps;switch(c[Rn]=o,c[fn]=y,m){case"dialog":qt("cancel",c),qt("close",c);break;case"iframe":case"object":case"embed":qt("load",c);break;case"video":case"audio":for(m=0;m<Jh.length;m++)qt(Jh[m],c);break;case"source":qt("error",c);break;case"img":case"image":case"link":qt("error",c),qt("load",c);break;case"details":qt("toggle",c);break;case"input":qt("invalid",c),$j(c,y.value,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name,!0),gc(c);break;case"select":qt("invalid",c);break;case"textarea":qt("invalid",c),Fj(c,y.value,y.defaultValue,y.children),gc(c)}m=y.children,typeof m!="string"&&typeof m!="number"&&typeof m!="bigint"||c.textContent===""+m||y.suppressHydrationWarning===!0||F2(c.textContent,m)?(y.popover!=null&&(qt("beforetoggle",c),qt("toggle",c)),y.onScroll!=null&&qt("scroll",c),y.onScrollEnd!=null&&qt("scrollend",c),y.onClick!=null&&(c.onclick=Ov),c=!0):c=!1,c||Ec(o)}function EM(o){for(os=o.return;os;)switch(os.tag){case 5:case 13:pa=!1;return;case 27:case 3:pa=!0;return;default:os=os.return}}function Th(o){if(o!==os)return!1;if(!on)return EM(o),on=!0,!1;var c=o.tag,m;if((m=c!==3&&c!==27)&&((m=c===5)&&(m=o.type,m=!(m!=="form"&&m!=="button")||Jw(o.type,o.memoizedProps)),m=!m),m&&Gn&&Ec(o),EM(o),c===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));e:{for(o=o.nextSibling,c=0;o;){if(o.nodeType===8)if(m=o.data,m==="/$"){if(c===0){Gn=qi(o.nextSibling);break e}c--}else m!=="$"&&m!=="$!"&&m!=="$?"||c++;o=o.nextSibling}Gn=null}}else c===27?(c=Gn,dl(o.type)?(o=nS,nS=null,Gn=o):Gn=c):Gn=os?qi(o.stateNode.nextSibling):null;return!0}function Ch(){Gn=os=null,on=!1}function kM(){var o=Sc;return o!==null&&(Ss===null?Ss=o:Ss.push.apply(Ss,o),Sc=null),o}function Ah(o){Sc===null?Sc=[o]:Sc.push(o)}var L_=re(null),kc=null,no=null;function Xo(o,c,m){D(L_,c._currentValue),c._currentValue=m}function ro(o){o._currentValue=L_.current,ue(L_)}function $_(o,c,m){for(;o!==null;){var y=o.alternate;if((o.childLanes&c)!==c?(o.childLanes|=c,y!==null&&(y.childLanes|=c)):y!==null&&(y.childLanes&c)!==c&&(y.childLanes|=c),o===m)break;o=o.return}}function z_(o,c,m,y){var _=o.child;for(_!==null&&(_.return=o);_!==null;){var C=_.dependencies;if(C!==null){var $=_.child;C=C.firstContext;e:for(;C!==null;){var q=C;C=_;for(var ee=0;ee<c.length;ee++)if(q.context===c[ee]){C.lanes|=m,q=C.alternate,q!==null&&(q.lanes|=m),$_(C.return,m,o),y||($=null);break e}C=q.next}}else if(_.tag===18){if($=_.return,$===null)throw Error(r(341));$.lanes|=m,C=$.alternate,C!==null&&(C.lanes|=m),$_($,m,o),$=null}else $=_.child;if($!==null)$.return=_;else for($=_;$!==null;){if($===o){$=null;break}if(_=$.sibling,_!==null){_.return=$.return,$=_;break}$=$.return}_=$}}function Nh(o,c,m,y){o=null;for(var _=c,C=!1;_!==null;){if(!C){if((_.flags&524288)!==0)C=!0;else if((_.flags&262144)!==0)break}if(_.tag===10){var $=_.alternate;if($===null)throw Error(r(387));if($=$.memoizedProps,$!==null){var q=_.type;Us(_.pendingProps.value,$.value)||(o!==null?o.push(q):o=[q])}}else if(_===U.current){if($=_.alternate,$===null)throw Error(r(387));$.memoizedState.memoizedState!==_.memoizedState.memoizedState&&(o!==null?o.push(sp):o=[sp])}_=_.return}o!==null&&z_(c,o,m,y),c.flags|=262144}function ev(o){for(o=o.firstContext;o!==null;){if(!Us(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function Tc(o){kc=o,no=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function Jr(o){return TM(kc,o)}function tv(o,c){return kc===null&&Tc(o),TM(o,c)}function TM(o,c){var m=c._currentValue;if(c={context:c,memoizedValue:m,next:null},no===null){if(o===null)throw Error(r(308));no=c,o.dependencies={lanes:0,firstContext:c},o.flags|=524288}else no=no.next=c;return m}var DY=typeof AbortController<"u"?AbortController:function(){var o=[],c=this.signal={aborted:!1,addEventListener:function(m,y){o.push(y)}};this.abort=function(){c.aborted=!0,o.forEach(function(m){return m()})}},LY=t.unstable_scheduleCallback,$Y=t.unstable_NormalPriority,_r={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function F_(){return{controller:new DY,data:new Map,refCount:0}}function Rh(o){o.refCount--,o.refCount===0&&LY($Y,function(){o.controller.abort()})}var jh=null,U_=0,Xu=0,Qu=null;function zY(o,c){if(jh===null){var m=jh=[];U_=0,Xu=qw(),Qu={status:"pending",value:void 0,then:function(y){m.push(y)}}}return U_++,c.then(CM,CM),c}function CM(){if(--U_===0&&jh!==null){Qu!==null&&(Qu.status="fulfilled");var o=jh;jh=null,Xu=0,Qu=null;for(var c=0;c<o.length;c++)(0,o[c])()}}function FY(o,c){var m=[],y={status:"pending",value:null,reason:null,then:function(_){m.push(_)}};return o.then(function(){y.status="fulfilled",y.value=c;for(var _=0;_<m.length;_++)(0,m[_])(c)},function(_){for(y.status="rejected",y.reason=_,_=0;_<m.length;_++)(0,m[_])(void 0)}),y}var AM=F.S;F.S=function(o,c){typeof c=="object"&&c!==null&&typeof c.then=="function"&&zY(o,c),AM!==null&&AM(o,c)};var Cc=re(null);function B_(){var o=Cc.current;return o!==null?o:wn.pooledCache}function nv(o,c){c===null?D(Cc,Cc.current):D(Cc,c.pool)}function NM(){var o=B_();return o===null?null:{parent:_r._currentValue,pool:o}}var Mh=Error(r(460)),RM=Error(r(474)),rv=Error(r(542)),q_={then:function(){}};function jM(o){return o=o.status,o==="fulfilled"||o==="rejected"}function sv(){}function MM(o,c,m){switch(m=o[m],m===void 0?o.push(c):m!==c&&(c.then(sv,sv),c=m),c.status){case"fulfilled":return c.value;case"rejected":throw o=c.reason,PM(o),o;default:if(typeof c.status=="string")c.then(sv,sv);else{if(o=wn,o!==null&&100<o.shellSuspendCounter)throw Error(r(482));o=c,o.status="pending",o.then(function(y){if(c.status==="pending"){var _=c;_.status="fulfilled",_.value=y}},function(y){if(c.status==="pending"){var _=c;_.status="rejected",_.reason=y}})}switch(c.status){case"fulfilled":return c.value;case"rejected":throw o=c.reason,PM(o),o}throw Oh=c,Mh}}var Oh=null;function OM(){if(Oh===null)throw Error(r(459));var o=Oh;return Oh=null,o}function PM(o){if(o===Mh||o===rv)throw Error(r(483))}var Qo=!1;function V_(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function H_(o,c){o=o.updateQueue,c.updateQueue===o&&(c.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,callbacks:null})}function Jo(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function Zo(o,c,m){var y=o.updateQueue;if(y===null)return null;if(y=y.shared,(cn&2)!==0){var _=y.pending;return _===null?c.next=c:(c.next=_.next,_.next=c),y.pending=c,c=Xg(o),xM(o,null,m),c}return Kg(o,y,c,m),Xg(o)}function Ph(o,c,m){if(c=c.updateQueue,c!==null&&(c=c.shared,(m&4194048)!==0)){var y=c.lanes;y&=o.pendingLanes,m|=y,c.lanes=m,Ln(o,m)}}function G_(o,c){var m=o.updateQueue,y=o.alternate;if(y!==null&&(y=y.updateQueue,m===y)){var _=null,C=null;if(m=m.firstBaseUpdate,m!==null){do{var $={lane:m.lane,tag:m.tag,payload:m.payload,callback:null,next:null};C===null?_=C=$:C=C.next=$,m=m.next}while(m!==null);C===null?_=C=c:C=C.next=c}else _=C=c;m={baseState:y.baseState,firstBaseUpdate:_,lastBaseUpdate:C,shared:y.shared,callbacks:y.callbacks},o.updateQueue=m;return}o=m.lastBaseUpdate,o===null?m.firstBaseUpdate=c:o.next=c,m.lastBaseUpdate=c}var W_=!1;function Ih(){if(W_){var o=Qu;if(o!==null)throw o}}function Dh(o,c,m,y){W_=!1;var _=o.updateQueue;Qo=!1;var C=_.firstBaseUpdate,$=_.lastBaseUpdate,q=_.shared.pending;if(q!==null){_.shared.pending=null;var ee=q,de=ee.next;ee.next=null,$===null?C=de:$.next=de,$=ee;var we=o.alternate;we!==null&&(we=we.updateQueue,q=we.lastBaseUpdate,q!==$&&(q===null?we.firstBaseUpdate=de:q.next=de,we.lastBaseUpdate=ee))}if(C!==null){var ke=_.baseState;$=0,we=de=ee=null,q=C;do{var pe=q.lane&-536870913,ge=pe!==q.lane;if(ge?(Jt&pe)===pe:(y&pe)===pe){pe!==0&&pe===Xu&&(W_=!0),we!==null&&(we=we.next={lane:0,tag:q.tag,payload:q.payload,callback:null,next:null});e:{var xt=o,ht=q;pe=c;var gn=m;switch(ht.tag){case 1:if(xt=ht.payload,typeof xt=="function"){ke=xt.call(gn,ke,pe);break e}ke=xt;break e;case 3:xt.flags=xt.flags&-65537|128;case 0:if(xt=ht.payload,pe=typeof xt=="function"?xt.call(gn,ke,pe):xt,pe==null)break e;ke=p({},ke,pe);break e;case 2:Qo=!0}}pe=q.callback,pe!==null&&(o.flags|=64,ge&&(o.flags|=8192),ge=_.callbacks,ge===null?_.callbacks=[pe]:ge.push(pe))}else ge={lane:pe,tag:q.tag,payload:q.payload,callback:q.callback,next:null},we===null?(de=we=ge,ee=ke):we=we.next=ge,$|=pe;if(q=q.next,q===null){if(q=_.shared.pending,q===null)break;ge=q,q=ge.next,ge.next=null,_.lastBaseUpdate=ge,_.shared.pending=null}}while(!0);we===null&&(ee=ke),_.baseState=ee,_.firstBaseUpdate=de,_.lastBaseUpdate=we,C===null&&(_.shared.lanes=0),ol|=$,o.lanes=$,o.memoizedState=ke}}function IM(o,c){if(typeof o!="function")throw Error(r(191,o));o.call(c)}function DM(o,c){var m=o.callbacks;if(m!==null)for(o.callbacks=null,o=0;o<m.length;o++)IM(m[o],c)}var Ju=re(null),iv=re(0);function LM(o,c){o=uo,D(iv,o),D(Ju,c),uo=o|c.baseLanes}function Y_(){D(iv,uo),D(Ju,Ju.current)}function K_(){uo=iv.current,ue(Ju),ue(iv)}var el=0,$t=null,pn=null,ur=null,av=!1,Zu=!1,Ac=!1,ov=0,Lh=0,ed=null,UY=0;function tr(){throw Error(r(321))}function X_(o,c){if(c===null)return!1;for(var m=0;m<c.length&&m<o.length;m++)if(!Us(o[m],c[m]))return!1;return!0}function Q_(o,c,m,y,_,C){return el=C,$t=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,F.H=o===null||o.memoizedState===null?xO:_O,Ac=!1,C=m(y,_),Ac=!1,Zu&&(C=zM(c,m,y,_)),$M(o),C}function $M(o){F.H=hv;var c=pn!==null&&pn.next!==null;if(el=0,ur=pn=$t=null,av=!1,Lh=0,ed=null,c)throw Error(r(300));o===null||Rr||(o=o.dependencies,o!==null&&ev(o)&&(Rr=!0))}function zM(o,c,m,y){$t=o;var _=0;do{if(Zu&&(ed=null),Lh=0,Zu=!1,25<=_)throw Error(r(301));if(_+=1,ur=pn=null,o.updateQueue!=null){var C=o.updateQueue;C.lastEffect=null,C.events=null,C.stores=null,C.memoCache!=null&&(C.memoCache.index=0)}F.H=YY,C=c(m,y)}while(Zu);return C}function BY(){var o=F.H,c=o.useState()[0];return c=typeof c.then=="function"?$h(c):c,o=o.useState()[0],(pn!==null?pn.memoizedState:null)!==o&&($t.flags|=1024),c}function J_(){var o=ov!==0;return ov=0,o}function Z_(o,c,m){c.updateQueue=o.updateQueue,c.flags&=-2053,o.lanes&=~m}function ew(o){if(av){for(o=o.memoizedState;o!==null;){var c=o.queue;c!==null&&(c.pending=null),o=o.next}av=!1}el=0,ur=pn=$t=null,Zu=!1,Lh=ov=0,ed=null}function _s(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ur===null?$t.memoizedState=ur=o:ur=ur.next=o,ur}function dr(){if(pn===null){var o=$t.alternate;o=o!==null?o.memoizedState:null}else o=pn.next;var c=ur===null?$t.memoizedState:ur.next;if(c!==null)ur=c,pn=o;else{if(o===null)throw $t.alternate===null?Error(r(467)):Error(r(310));pn=o,o={memoizedState:pn.memoizedState,baseState:pn.baseState,baseQueue:pn.baseQueue,queue:pn.queue,next:null},ur===null?$t.memoizedState=ur=o:ur=ur.next=o}return ur}function tw(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function $h(o){var c=Lh;return Lh+=1,ed===null&&(ed=[]),o=MM(ed,o,c),c=$t,(ur===null?c.memoizedState:ur.next)===null&&(c=c.alternate,F.H=c===null||c.memoizedState===null?xO:_O),o}function lv(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return $h(o);if(o.$$typeof===T)return Jr(o)}throw Error(r(438,String(o)))}function nw(o){var c=null,m=$t.updateQueue;if(m!==null&&(c=m.memoCache),c==null){var y=$t.alternate;y!==null&&(y=y.updateQueue,y!==null&&(y=y.memoCache,y!=null&&(c={data:y.data.map(function(_){return _.slice()}),index:0})))}if(c==null&&(c={data:[],index:0}),m===null&&(m=tw(),$t.updateQueue=m),m.memoCache=c,m=c.data[c.index],m===void 0)for(m=c.data[c.index]=Array(o),y=0;y<o;y++)m[y]=O;return c.index++,m}function so(o,c){return typeof c=="function"?c(o):c}function cv(o){var c=dr();return rw(c,pn,o)}function rw(o,c,m){var y=o.queue;if(y===null)throw Error(r(311));y.lastRenderedReducer=m;var _=o.baseQueue,C=y.pending;if(C!==null){if(_!==null){var $=_.next;_.next=C.next,C.next=$}c.baseQueue=_=C,y.pending=null}if(C=o.baseState,_===null)o.memoizedState=C;else{c=_.next;var q=$=null,ee=null,de=c,we=!1;do{var ke=de.lane&-536870913;if(ke!==de.lane?(Jt&ke)===ke:(el&ke)===ke){var pe=de.revertLane;if(pe===0)ee!==null&&(ee=ee.next={lane:0,revertLane:0,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null}),ke===Xu&&(we=!0);else if((el&pe)===pe){de=de.next,pe===Xu&&(we=!0);continue}else ke={lane:0,revertLane:de.revertLane,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},ee===null?(q=ee=ke,$=C):ee=ee.next=ke,$t.lanes|=pe,ol|=pe;ke=de.action,Ac&&m(C,ke),C=de.hasEagerState?de.eagerState:m(C,ke)}else pe={lane:ke,revertLane:de.revertLane,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},ee===null?(q=ee=pe,$=C):ee=ee.next=pe,$t.lanes|=ke,ol|=ke;de=de.next}while(de!==null&&de!==c);if(ee===null?$=C:ee.next=q,!Us(C,o.memoizedState)&&(Rr=!0,we&&(m=Qu,m!==null)))throw m;o.memoizedState=C,o.baseState=$,o.baseQueue=ee,y.lastRenderedState=C}return _===null&&(y.lanes=0),[o.memoizedState,y.dispatch]}function sw(o){var c=dr(),m=c.queue;if(m===null)throw Error(r(311));m.lastRenderedReducer=o;var y=m.dispatch,_=m.pending,C=c.memoizedState;if(_!==null){m.pending=null;var $=_=_.next;do C=o(C,$.action),$=$.next;while($!==_);Us(C,c.memoizedState)||(Rr=!0),c.memoizedState=C,c.baseQueue===null&&(c.baseState=C),m.lastRenderedState=C}return[C,y]}function FM(o,c,m){var y=$t,_=dr(),C=on;if(C){if(m===void 0)throw Error(r(407));m=m()}else m=c();var $=!Us((pn||_).memoizedState,m);$&&(_.memoizedState=m,Rr=!0),_=_.queue;var q=qM.bind(null,y,_,o);if(zh(2048,8,q,[o]),_.getSnapshot!==c||$||ur!==null&&ur.memoizedState.tag&1){if(y.flags|=2048,td(9,uv(),BM.bind(null,y,_,m,c),null),wn===null)throw Error(r(349));C||(el&124)!==0||UM(y,c,m)}return m}function UM(o,c,m){o.flags|=16384,o={getSnapshot:c,value:m},c=$t.updateQueue,c===null?(c=tw(),$t.updateQueue=c,c.stores=[o]):(m=c.stores,m===null?c.stores=[o]:m.push(o))}function BM(o,c,m,y){c.value=m,c.getSnapshot=y,VM(c)&&HM(o)}function qM(o,c,m){return m(function(){VM(c)&&HM(o)})}function VM(o){var c=o.getSnapshot;o=o.value;try{var m=c();return!Us(o,m)}catch{return!0}}function HM(o){var c=Gu(o,2);c!==null&&Ws(c,o,2)}function iw(o){var c=_s();if(typeof o=="function"){var m=o;if(o=m(),Ac){st(!0);try{m()}finally{st(!1)}}}return c.memoizedState=c.baseState=o,c.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:so,lastRenderedState:o},c}function GM(o,c,m,y){return o.baseState=m,rw(o,pn,typeof y=="function"?y:so)}function qY(o,c,m,y,_){if(fv(o))throw Error(r(485));if(o=c.action,o!==null){var C={payload:_,action:o,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function($){C.listeners.push($)}};F.T!==null?m(!0):C.isTransition=!1,y(C),m=c.pending,m===null?(C.next=c.pending=C,WM(c,C)):(C.next=m.next,c.pending=m.next=C)}}function WM(o,c){var m=c.action,y=c.payload,_=o.state;if(c.isTransition){var C=F.T,$={};F.T=$;try{var q=m(_,y),ee=F.S;ee!==null&&ee($,q),YM(o,c,q)}catch(de){aw(o,c,de)}finally{F.T=C}}else try{C=m(_,y),YM(o,c,C)}catch(de){aw(o,c,de)}}function YM(o,c,m){m!==null&&typeof m=="object"&&typeof m.then=="function"?m.then(function(y){KM(o,c,y)},function(y){return aw(o,c,y)}):KM(o,c,m)}function KM(o,c,m){c.status="fulfilled",c.value=m,XM(c),o.state=m,c=o.pending,c!==null&&(m=c.next,m===c?o.pending=null:(m=m.next,c.next=m,WM(o,m)))}function aw(o,c,m){var y=o.pending;if(o.pending=null,y!==null){y=y.next;do c.status="rejected",c.reason=m,XM(c),c=c.next;while(c!==y)}o.action=null}function XM(o){o=o.listeners;for(var c=0;c<o.length;c++)(0,o[c])()}function QM(o,c){return c}function JM(o,c){if(on){var m=wn.formState;if(m!==null){e:{var y=$t;if(on){if(Gn){t:{for(var _=Gn,C=pa;_.nodeType!==8;){if(!C){_=null;break t}if(_=qi(_.nextSibling),_===null){_=null;break t}}C=_.data,_=C==="F!"||C==="F"?_:null}if(_){Gn=qi(_.nextSibling),y=_.data==="F!";break e}}Ec(y)}y=!1}y&&(c=m[0])}}return m=_s(),m.memoizedState=m.baseState=c,y={pending:null,lanes:0,dispatch:null,lastRenderedReducer:QM,lastRenderedState:c},m.queue=y,m=vO.bind(null,$t,y),y.dispatch=m,y=iw(!1),C=dw.bind(null,$t,!1,y.queue),y=_s(),_={state:c,dispatch:null,action:o,pending:null},y.queue=_,m=qY.bind(null,$t,_,C,m),_.dispatch=m,y.memoizedState=o,[c,m,!1]}function ZM(o){var c=dr();return eO(c,pn,o)}function eO(o,c,m){if(c=rw(o,c,QM)[0],o=cv(so)[0],typeof c=="object"&&c!==null&&typeof c.then=="function")try{var y=$h(c)}catch($){throw $===Mh?rv:$}else y=c;c=dr();var _=c.queue,C=_.dispatch;return m!==c.memoizedState&&($t.flags|=2048,td(9,uv(),VY.bind(null,_,m),null)),[y,C,o]}function VY(o,c){o.action=c}function tO(o){var c=dr(),m=pn;if(m!==null)return eO(c,m,o);dr(),c=c.memoizedState,m=dr();var y=m.queue.dispatch;return m.memoizedState=o,[c,y,!1]}function td(o,c,m,y){return o={tag:o,create:m,deps:y,inst:c,next:null},c=$t.updateQueue,c===null&&(c=tw(),$t.updateQueue=c),m=c.lastEffect,m===null?c.lastEffect=o.next=o:(y=m.next,m.next=o,o.next=y,c.lastEffect=o),o}function uv(){return{destroy:void 0,resource:void 0}}function nO(){return dr().memoizedState}function dv(o,c,m,y){var _=_s();y=y===void 0?null:y,$t.flags|=o,_.memoizedState=td(1|c,uv(),m,y)}function zh(o,c,m,y){var _=dr();y=y===void 0?null:y;var C=_.memoizedState.inst;pn!==null&&y!==null&&X_(y,pn.memoizedState.deps)?_.memoizedState=td(c,C,m,y):($t.flags|=o,_.memoizedState=td(1|c,C,m,y))}function rO(o,c){dv(8390656,8,o,c)}function sO(o,c){zh(2048,8,o,c)}function iO(o,c){return zh(4,2,o,c)}function aO(o,c){return zh(4,4,o,c)}function oO(o,c){if(typeof c=="function"){o=o();var m=c(o);return function(){typeof m=="function"?m():c(null)}}if(c!=null)return o=o(),c.current=o,function(){c.current=null}}function lO(o,c,m){m=m!=null?m.concat([o]):null,zh(4,4,oO.bind(null,c,o),m)}function ow(){}function cO(o,c){var m=dr();c=c===void 0?null:c;var y=m.memoizedState;return c!==null&&X_(c,y[1])?y[0]:(m.memoizedState=[o,c],o)}function uO(o,c){var m=dr();c=c===void 0?null:c;var y=m.memoizedState;if(c!==null&&X_(c,y[1]))return y[0];if(y=o(),Ac){st(!0);try{o()}finally{st(!1)}}return m.memoizedState=[y,c],y}function lw(o,c,m){return m===void 0||(el&1073741824)!==0?o.memoizedState=c:(o.memoizedState=m,o=h2(),$t.lanes|=o,ol|=o,m)}function dO(o,c,m,y){return Us(m,c)?m:Ju.current!==null?(o=lw(o,m,y),Us(o,c)||(Rr=!0),o):(el&42)===0?(Rr=!0,o.memoizedState=m):(o=h2(),$t.lanes|=o,ol|=o,c)}function fO(o,c,m,y,_){var C=Y.p;Y.p=C!==0&&8>C?C:8;var $=F.T,q={};F.T=q,dw(o,!1,c,m);try{var ee=_(),de=F.S;if(de!==null&&de(q,ee),ee!==null&&typeof ee=="object"&&typeof ee.then=="function"){var we=FY(ee,y);Fh(o,c,we,Gs(o))}else Fh(o,c,y,Gs(o))}catch(ke){Fh(o,c,{then:function(){},status:"rejected",reason:ke},Gs())}finally{Y.p=C,F.T=$}}function HY(){}function cw(o,c,m,y){if(o.tag!==5)throw Error(r(476));var _=hO(o).queue;fO(o,_,c,H,m===null?HY:function(){return pO(o),m(y)})}function hO(o){var c=o.memoizedState;if(c!==null)return c;c={memoizedState:H,baseState:H,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:so,lastRenderedState:H},next:null};var m={};return c.next={memoizedState:m,baseState:m,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:so,lastRenderedState:m},next:null},o.memoizedState=c,o=o.alternate,o!==null&&(o.memoizedState=c),c}function pO(o){var c=hO(o).next.queue;Fh(o,c,{},Gs())}function uw(){return Jr(sp)}function mO(){return dr().memoizedState}function gO(){return dr().memoizedState}function GY(o){for(var c=o.return;c!==null;){switch(c.tag){case 24:case 3:var m=Gs();o=Jo(m);var y=Zo(c,o,m);y!==null&&(Ws(y,c,m),Ph(y,c,m)),c={cache:F_()},o.payload=c;return}c=c.return}}function WY(o,c,m){var y=Gs();m={lane:y,revertLane:0,action:m,hasEagerState:!1,eagerState:null,next:null},fv(o)?yO(c,m):(m=R_(o,c,m,y),m!==null&&(Ws(m,o,y),bO(m,c,y)))}function vO(o,c,m){var y=Gs();Fh(o,c,m,y)}function Fh(o,c,m,y){var _={lane:y,revertLane:0,action:m,hasEagerState:!1,eagerState:null,next:null};if(fv(o))yO(c,_);else{var C=o.alternate;if(o.lanes===0&&(C===null||C.lanes===0)&&(C=c.lastRenderedReducer,C!==null))try{var $=c.lastRenderedState,q=C($,m);if(_.hasEagerState=!0,_.eagerState=q,Us(q,$))return Kg(o,c,_,0),wn===null&&Yg(),!1}catch{}finally{}if(m=R_(o,c,_,y),m!==null)return Ws(m,o,y),bO(m,c,y),!0}return!1}function dw(o,c,m,y){if(y={lane:2,revertLane:qw(),action:y,hasEagerState:!1,eagerState:null,next:null},fv(o)){if(c)throw Error(r(479))}else c=R_(o,m,y,2),c!==null&&Ws(c,o,2)}function fv(o){var c=o.alternate;return o===$t||c!==null&&c===$t}function yO(o,c){Zu=av=!0;var m=o.pending;m===null?c.next=c:(c.next=m.next,m.next=c),o.pending=c}function bO(o,c,m){if((m&4194048)!==0){var y=c.lanes;y&=o.pendingLanes,m|=y,c.lanes=m,Ln(o,m)}}var hv={readContext:Jr,use:lv,useCallback:tr,useContext:tr,useEffect:tr,useImperativeHandle:tr,useLayoutEffect:tr,useInsertionEffect:tr,useMemo:tr,useReducer:tr,useRef:tr,useState:tr,useDebugValue:tr,useDeferredValue:tr,useTransition:tr,useSyncExternalStore:tr,useId:tr,useHostTransitionStatus:tr,useFormState:tr,useActionState:tr,useOptimistic:tr,useMemoCache:tr,useCacheRefresh:tr},xO={readContext:Jr,use:lv,useCallback:function(o,c){return _s().memoizedState=[o,c===void 0?null:c],o},useContext:Jr,useEffect:rO,useImperativeHandle:function(o,c,m){m=m!=null?m.concat([o]):null,dv(4194308,4,oO.bind(null,c,o),m)},useLayoutEffect:function(o,c){return dv(4194308,4,o,c)},useInsertionEffect:function(o,c){dv(4,2,o,c)},useMemo:function(o,c){var m=_s();c=c===void 0?null:c;var y=o();if(Ac){st(!0);try{o()}finally{st(!1)}}return m.memoizedState=[y,c],y},useReducer:function(o,c,m){var y=_s();if(m!==void 0){var _=m(c);if(Ac){st(!0);try{m(c)}finally{st(!1)}}}else _=c;return y.memoizedState=y.baseState=_,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:_},y.queue=o,o=o.dispatch=WY.bind(null,$t,o),[y.memoizedState,o]},useRef:function(o){var c=_s();return o={current:o},c.memoizedState=o},useState:function(o){o=iw(o);var c=o.queue,m=vO.bind(null,$t,c);return c.dispatch=m,[o.memoizedState,m]},useDebugValue:ow,useDeferredValue:function(o,c){var m=_s();return lw(m,o,c)},useTransition:function(){var o=iw(!1);return o=fO.bind(null,$t,o.queue,!0,!1),_s().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,c,m){var y=$t,_=_s();if(on){if(m===void 0)throw Error(r(407));m=m()}else{if(m=c(),wn===null)throw Error(r(349));(Jt&124)!==0||UM(y,c,m)}_.memoizedState=m;var C={value:m,getSnapshot:c};return _.queue=C,rO(qM.bind(null,y,C,o),[o]),y.flags|=2048,td(9,uv(),BM.bind(null,y,C,m,c),null),m},useId:function(){var o=_s(),c=wn.identifierPrefix;if(on){var m=to,y=eo;m=(y&~(1<<32-qe(y)-1)).toString(32)+m,c="«"+c+"R"+m,m=ov++,0<m&&(c+="H"+m.toString(32)),c+="»"}else m=UY++,c="«"+c+"r"+m.toString(32)+"»";return o.memoizedState=c},useHostTransitionStatus:uw,useFormState:JM,useActionState:JM,useOptimistic:function(o){var c=_s();c.memoizedState=c.baseState=o;var m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return c.queue=m,c=dw.bind(null,$t,!0,m),m.dispatch=c,[o,c]},useMemoCache:nw,useCacheRefresh:function(){return _s().memoizedState=GY.bind(null,$t)}},_O={readContext:Jr,use:lv,useCallback:cO,useContext:Jr,useEffect:sO,useImperativeHandle:lO,useInsertionEffect:iO,useLayoutEffect:aO,useMemo:uO,useReducer:cv,useRef:nO,useState:function(){return cv(so)},useDebugValue:ow,useDeferredValue:function(o,c){var m=dr();return dO(m,pn.memoizedState,o,c)},useTransition:function(){var o=cv(so)[0],c=dr().memoizedState;return[typeof o=="boolean"?o:$h(o),c]},useSyncExternalStore:FM,useId:mO,useHostTransitionStatus:uw,useFormState:ZM,useActionState:ZM,useOptimistic:function(o,c){var m=dr();return GM(m,pn,o,c)},useMemoCache:nw,useCacheRefresh:gO},YY={readContext:Jr,use:lv,useCallback:cO,useContext:Jr,useEffect:sO,useImperativeHandle:lO,useInsertionEffect:iO,useLayoutEffect:aO,useMemo:uO,useReducer:sw,useRef:nO,useState:function(){return sw(so)},useDebugValue:ow,useDeferredValue:function(o,c){var m=dr();return pn===null?lw(m,o,c):dO(m,pn.memoizedState,o,c)},useTransition:function(){var o=sw(so)[0],c=dr().memoizedState;return[typeof o=="boolean"?o:$h(o),c]},useSyncExternalStore:FM,useId:mO,useHostTransitionStatus:uw,useFormState:tO,useActionState:tO,useOptimistic:function(o,c){var m=dr();return pn!==null?GM(m,pn,o,c):(m.baseState=o,[o,m.queue.dispatch])},useMemoCache:nw,useCacheRefresh:gO},nd=null,Uh=0;function pv(o){var c=Uh;return Uh+=1,nd===null&&(nd=[]),MM(nd,o,c)}function Bh(o,c){c=c.props.ref,o.ref=c!==void 0?c:null}function mv(o,c){throw c.$$typeof===h?Error(r(525)):(o=Object.prototype.toString.call(c),Error(r(31,o==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":o)))}function wO(o){var c=o._init;return c(o._payload)}function SO(o){function c(le,ie){if(o){var ce=le.deletions;ce===null?(le.deletions=[ie],le.flags|=16):ce.push(ie)}}function m(le,ie){if(!o)return null;for(;ie!==null;)c(le,ie),ie=ie.sibling;return null}function y(le){for(var ie=new Map;le!==null;)le.key!==null?ie.set(le.key,le):ie.set(le.index,le),le=le.sibling;return ie}function _(le,ie){return le=Za(le,ie),le.index=0,le.sibling=null,le}function C(le,ie,ce){return le.index=ce,o?(ce=le.alternate,ce!==null?(ce=ce.index,ce<ie?(le.flags|=67108866,ie):ce):(le.flags|=67108866,ie)):(le.flags|=1048576,ie)}function $(le){return o&&le.alternate===null&&(le.flags|=67108866),le}function q(le,ie,ce,Se){return ie===null||ie.tag!==6?(ie=M_(ce,le.mode,Se),ie.return=le,ie):(ie=_(ie,ce),ie.return=le,ie)}function ee(le,ie,ce,Se){var Ye=ce.type;return Ye===b?we(le,ie,ce.props.children,Se,ce.key):ie!==null&&(ie.elementType===Ye||typeof Ye=="object"&&Ye!==null&&Ye.$$typeof===M&&wO(Ye)===ie.type)?(ie=_(ie,ce.props),Bh(ie,ce),ie.return=le,ie):(ie=Qg(ce.type,ce.key,ce.props,null,le.mode,Se),Bh(ie,ce),ie.return=le,ie)}function de(le,ie,ce,Se){return ie===null||ie.tag!==4||ie.stateNode.containerInfo!==ce.containerInfo||ie.stateNode.implementation!==ce.implementation?(ie=O_(ce,le.mode,Se),ie.return=le,ie):(ie=_(ie,ce.children||[]),ie.return=le,ie)}function we(le,ie,ce,Se,Ye){return ie===null||ie.tag!==7?(ie=xc(ce,le.mode,Se,Ye),ie.return=le,ie):(ie=_(ie,ce),ie.return=le,ie)}function ke(le,ie,ce){if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return ie=M_(""+ie,le.mode,ce),ie.return=le,ie;if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case g:return ce=Qg(ie.type,ie.key,ie.props,null,le.mode,ce),Bh(ce,ie),ce.return=le,ce;case v:return ie=O_(ie,le.mode,ce),ie.return=le,ie;case M:var Se=ie._init;return ie=Se(ie._payload),ke(le,ie,ce)}if(X(ie)||z(ie))return ie=xc(ie,le.mode,ce,null),ie.return=le,ie;if(typeof ie.then=="function")return ke(le,pv(ie),ce);if(ie.$$typeof===T)return ke(le,tv(le,ie),ce);mv(le,ie)}return null}function pe(le,ie,ce,Se){var Ye=ie!==null?ie.key:null;if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return Ye!==null?null:q(le,ie,""+ce,Se);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case g:return ce.key===Ye?ee(le,ie,ce,Se):null;case v:return ce.key===Ye?de(le,ie,ce,Se):null;case M:return Ye=ce._init,ce=Ye(ce._payload),pe(le,ie,ce,Se)}if(X(ce)||z(ce))return Ye!==null?null:we(le,ie,ce,Se,null);if(typeof ce.then=="function")return pe(le,ie,pv(ce),Se);if(ce.$$typeof===T)return pe(le,ie,tv(le,ce),Se);mv(le,ce)}return null}function ge(le,ie,ce,Se,Ye){if(typeof Se=="string"&&Se!==""||typeof Se=="number"||typeof Se=="bigint")return le=le.get(ce)||null,q(ie,le,""+Se,Ye);if(typeof Se=="object"&&Se!==null){switch(Se.$$typeof){case g:return le=le.get(Se.key===null?ce:Se.key)||null,ee(ie,le,Se,Ye);case v:return le=le.get(Se.key===null?ce:Se.key)||null,de(ie,le,Se,Ye);case M:var Ut=Se._init;return Se=Ut(Se._payload),ge(le,ie,ce,Se,Ye)}if(X(Se)||z(Se))return le=le.get(ce)||null,we(ie,le,Se,Ye,null);if(typeof Se.then=="function")return ge(le,ie,ce,pv(Se),Ye);if(Se.$$typeof===T)return ge(le,ie,ce,tv(ie,Se),Ye);mv(ie,Se)}return null}function xt(le,ie,ce,Se){for(var Ye=null,Ut=null,it=ie,mt=ie=0,Mr=null;it!==null&&mt<ce.length;mt++){it.index>mt?(Mr=it,it=null):Mr=it.sibling;var nn=pe(le,it,ce[mt],Se);if(nn===null){it===null&&(it=Mr);break}o&&it&&nn.alternate===null&&c(le,it),ie=C(nn,ie,mt),Ut===null?Ye=nn:Ut.sibling=nn,Ut=nn,it=Mr}if(mt===ce.length)return m(le,it),on&&wc(le,mt),Ye;if(it===null){for(;mt<ce.length;mt++)it=ke(le,ce[mt],Se),it!==null&&(ie=C(it,ie,mt),Ut===null?Ye=it:Ut.sibling=it,Ut=it);return on&&wc(le,mt),Ye}for(it=y(it);mt<ce.length;mt++)Mr=ge(it,le,mt,ce[mt],Se),Mr!==null&&(o&&Mr.alternate!==null&&it.delete(Mr.key===null?mt:Mr.key),ie=C(Mr,ie,mt),Ut===null?Ye=Mr:Ut.sibling=Mr,Ut=Mr);return o&&it.forEach(function(gl){return c(le,gl)}),on&&wc(le,mt),Ye}function ht(le,ie,ce,Se){if(ce==null)throw Error(r(151));for(var Ye=null,Ut=null,it=ie,mt=ie=0,Mr=null,nn=ce.next();it!==null&&!nn.done;mt++,nn=ce.next()){it.index>mt?(Mr=it,it=null):Mr=it.sibling;var gl=pe(le,it,nn.value,Se);if(gl===null){it===null&&(it=Mr);break}o&&it&&gl.alternate===null&&c(le,it),ie=C(gl,ie,mt),Ut===null?Ye=gl:Ut.sibling=gl,Ut=gl,it=Mr}if(nn.done)return m(le,it),on&&wc(le,mt),Ye;if(it===null){for(;!nn.done;mt++,nn=ce.next())nn=ke(le,nn.value,Se),nn!==null&&(ie=C(nn,ie,mt),Ut===null?Ye=nn:Ut.sibling=nn,Ut=nn);return on&&wc(le,mt),Ye}for(it=y(it);!nn.done;mt++,nn=ce.next())nn=ge(it,le,mt,nn.value,Se),nn!==null&&(o&&nn.alternate!==null&&it.delete(nn.key===null?mt:nn.key),ie=C(nn,ie,mt),Ut===null?Ye=nn:Ut.sibling=nn,Ut=nn);return o&&it.forEach(function(KK){return c(le,KK)}),on&&wc(le,mt),Ye}function gn(le,ie,ce,Se){if(typeof ce=="object"&&ce!==null&&ce.type===b&&ce.key===null&&(ce=ce.props.children),typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case g:e:{for(var Ye=ce.key;ie!==null;){if(ie.key===Ye){if(Ye=ce.type,Ye===b){if(ie.tag===7){m(le,ie.sibling),Se=_(ie,ce.props.children),Se.return=le,le=Se;break e}}else if(ie.elementType===Ye||typeof Ye=="object"&&Ye!==null&&Ye.$$typeof===M&&wO(Ye)===ie.type){m(le,ie.sibling),Se=_(ie,ce.props),Bh(Se,ce),Se.return=le,le=Se;break e}m(le,ie);break}else c(le,ie);ie=ie.sibling}ce.type===b?(Se=xc(ce.props.children,le.mode,Se,ce.key),Se.return=le,le=Se):(Se=Qg(ce.type,ce.key,ce.props,null,le.mode,Se),Bh(Se,ce),Se.return=le,le=Se)}return $(le);case v:e:{for(Ye=ce.key;ie!==null;){if(ie.key===Ye)if(ie.tag===4&&ie.stateNode.containerInfo===ce.containerInfo&&ie.stateNode.implementation===ce.implementation){m(le,ie.sibling),Se=_(ie,ce.children||[]),Se.return=le,le=Se;break e}else{m(le,ie);break}else c(le,ie);ie=ie.sibling}Se=O_(ce,le.mode,Se),Se.return=le,le=Se}return $(le);case M:return Ye=ce._init,ce=Ye(ce._payload),gn(le,ie,ce,Se)}if(X(ce))return xt(le,ie,ce,Se);if(z(ce)){if(Ye=z(ce),typeof Ye!="function")throw Error(r(150));return ce=Ye.call(ce),ht(le,ie,ce,Se)}if(typeof ce.then=="function")return gn(le,ie,pv(ce),Se);if(ce.$$typeof===T)return gn(le,ie,tv(le,ce),Se);mv(le,ce)}return typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint"?(ce=""+ce,ie!==null&&ie.tag===6?(m(le,ie.sibling),Se=_(ie,ce),Se.return=le,le=Se):(m(le,ie),Se=M_(ce,le.mode,Se),Se.return=le,le=Se),$(le)):m(le,ie)}return function(le,ie,ce,Se){try{Uh=0;var Ye=gn(le,ie,ce,Se);return nd=null,Ye}catch(it){if(it===Mh||it===rv)throw it;var Ut=Bs(29,it,null,le.mode);return Ut.lanes=Se,Ut.return=le,Ut}finally{}}}var rd=SO(!0),EO=SO(!1),hi=re(null),ma=null;function tl(o){var c=o.alternate;D(wr,wr.current&1),D(hi,o),ma===null&&(c===null||Ju.current!==null||c.memoizedState!==null)&&(ma=o)}function kO(o){if(o.tag===22){if(D(wr,wr.current),D(hi,o),ma===null){var c=o.alternate;c!==null&&c.memoizedState!==null&&(ma=o)}}else nl()}function nl(){D(wr,wr.current),D(hi,hi.current)}function io(o){ue(hi),ma===o&&(ma=null),ue(wr)}var wr=re(0);function gv(o){for(var c=o;c!==null;){if(c.tag===13){var m=c.memoizedState;if(m!==null&&(m=m.dehydrated,m===null||m.data==="$?"||tS(m)))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===o)break;for(;c.sibling===null;){if(c.return===null||c.return===o)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}function fw(o,c,m,y){c=o.memoizedState,m=m(y,c),m=m==null?c:p({},c,m),o.memoizedState=m,o.lanes===0&&(o.updateQueue.baseState=m)}var hw={enqueueSetState:function(o,c,m){o=o._reactInternals;var y=Gs(),_=Jo(y);_.payload=c,m!=null&&(_.callback=m),c=Zo(o,_,y),c!==null&&(Ws(c,o,y),Ph(c,o,y))},enqueueReplaceState:function(o,c,m){o=o._reactInternals;var y=Gs(),_=Jo(y);_.tag=1,_.payload=c,m!=null&&(_.callback=m),c=Zo(o,_,y),c!==null&&(Ws(c,o,y),Ph(c,o,y))},enqueueForceUpdate:function(o,c){o=o._reactInternals;var m=Gs(),y=Jo(m);y.tag=2,c!=null&&(y.callback=c),c=Zo(o,y,m),c!==null&&(Ws(c,o,m),Ph(c,o,m))}};function TO(o,c,m,y,_,C,$){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(y,C,$):c.prototype&&c.prototype.isPureReactComponent?!Eh(m,y)||!Eh(_,C):!0}function CO(o,c,m,y){o=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(m,y),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(m,y),c.state!==o&&hw.enqueueReplaceState(c,c.state,null)}function Nc(o,c){var m=c;if("ref"in c){m={};for(var y in c)y!=="ref"&&(m[y]=c[y])}if(o=o.defaultProps){m===c&&(m=p({},m));for(var _ in o)m[_]===void 0&&(m[_]=o[_])}return m}var vv=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var c=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o!==null&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(c))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)};function AO(o){vv(o)}function NO(o){console.error(o)}function RO(o){vv(o)}function yv(o,c){try{var m=o.onUncaughtError;m(c.value,{componentStack:c.stack})}catch(y){setTimeout(function(){throw y})}}function jO(o,c,m){try{var y=o.onCaughtError;y(m.value,{componentStack:m.stack,errorBoundary:c.tag===1?c.stateNode:null})}catch(_){setTimeout(function(){throw _})}}function pw(o,c,m){return m=Jo(m),m.tag=3,m.payload={element:null},m.callback=function(){yv(o,c)},m}function MO(o){return o=Jo(o),o.tag=3,o}function OO(o,c,m,y){var _=m.type.getDerivedStateFromError;if(typeof _=="function"){var C=y.value;o.payload=function(){return _(C)},o.callback=function(){jO(c,m,y)}}var $=m.stateNode;$!==null&&typeof $.componentDidCatch=="function"&&(o.callback=function(){jO(c,m,y),typeof _!="function"&&(ll===null?ll=new Set([this]):ll.add(this));var q=y.stack;this.componentDidCatch(y.value,{componentStack:q!==null?q:""})})}function KY(o,c,m,y,_){if(m.flags|=32768,y!==null&&typeof y=="object"&&typeof y.then=="function"){if(c=m.alternate,c!==null&&Nh(c,m,_,!0),m=hi.current,m!==null){switch(m.tag){case 13:return ma===null?$w():m.alternate===null&&Wn===0&&(Wn=3),m.flags&=-257,m.flags|=65536,m.lanes=_,y===q_?m.flags|=16384:(c=m.updateQueue,c===null?m.updateQueue=new Set([y]):c.add(y),Fw(o,y,_)),!1;case 22:return m.flags|=65536,y===q_?m.flags|=16384:(c=m.updateQueue,c===null?(c={transitions:null,markerInstances:null,retryQueue:new Set([y])},m.updateQueue=c):(m=c.retryQueue,m===null?c.retryQueue=new Set([y]):m.add(y)),Fw(o,y,_)),!1}throw Error(r(435,m.tag))}return Fw(o,y,_),$w(),!1}if(on)return c=hi.current,c!==null?((c.flags&65536)===0&&(c.flags|=256),c.flags|=65536,c.lanes=_,y!==D_&&(o=Error(r(422),{cause:y}),Ah(ci(o,m)))):(y!==D_&&(c=Error(r(423),{cause:y}),Ah(ci(c,m))),o=o.current.alternate,o.flags|=65536,_&=-_,o.lanes|=_,y=ci(y,m),_=pw(o.stateNode,y,_),G_(o,_),Wn!==4&&(Wn=2)),!1;var C=Error(r(520),{cause:y});if(C=ci(C,m),Kh===null?Kh=[C]:Kh.push(C),Wn!==4&&(Wn=2),c===null)return!0;y=ci(y,m),m=c;do{switch(m.tag){case 3:return m.flags|=65536,o=_&-_,m.lanes|=o,o=pw(m.stateNode,y,o),G_(m,o),!1;case 1:if(c=m.type,C=m.stateNode,(m.flags&128)===0&&(typeof c.getDerivedStateFromError=="function"||C!==null&&typeof C.componentDidCatch=="function"&&(ll===null||!ll.has(C))))return m.flags|=65536,_&=-_,m.lanes|=_,_=MO(_),OO(_,o,m,y),G_(m,_),!1}m=m.return}while(m!==null);return!1}var PO=Error(r(461)),Rr=!1;function Ur(o,c,m,y){c.child=o===null?EO(c,null,m,y):rd(c,o.child,m,y)}function IO(o,c,m,y,_){m=m.render;var C=c.ref;if("ref"in y){var $={};for(var q in y)q!=="ref"&&($[q]=y[q])}else $=y;return Tc(c),y=Q_(o,c,m,$,C,_),q=J_(),o!==null&&!Rr?(Z_(o,c,_),ao(o,c,_)):(on&&q&&P_(c),c.flags|=1,Ur(o,c,y,_),c.child)}function DO(o,c,m,y,_){if(o===null){var C=m.type;return typeof C=="function"&&!j_(C)&&C.defaultProps===void 0&&m.compare===null?(c.tag=15,c.type=C,LO(o,c,C,y,_)):(o=Qg(m.type,null,y,c,c.mode,_),o.ref=c.ref,o.return=c,c.child=o)}if(C=o.child,!ww(o,_)){var $=C.memoizedProps;if(m=m.compare,m=m!==null?m:Eh,m($,y)&&o.ref===c.ref)return ao(o,c,_)}return c.flags|=1,o=Za(C,y),o.ref=c.ref,o.return=c,c.child=o}function LO(o,c,m,y,_){if(o!==null){var C=o.memoizedProps;if(Eh(C,y)&&o.ref===c.ref)if(Rr=!1,c.pendingProps=y=C,ww(o,_))(o.flags&131072)!==0&&(Rr=!0);else return c.lanes=o.lanes,ao(o,c,_)}return mw(o,c,m,y,_)}function $O(o,c,m){var y=c.pendingProps,_=y.children,C=o!==null?o.memoizedState:null;if(y.mode==="hidden"){if((c.flags&128)!==0){if(y=C!==null?C.baseLanes|m:m,o!==null){for(_=c.child=o.child,C=0;_!==null;)C=C|_.lanes|_.childLanes,_=_.sibling;c.childLanes=C&~y}else c.childLanes=0,c.child=null;return zO(o,c,y,m)}if((m&536870912)!==0)c.memoizedState={baseLanes:0,cachePool:null},o!==null&&nv(c,C!==null?C.cachePool:null),C!==null?LM(c,C):Y_(),kO(c);else return c.lanes=c.childLanes=536870912,zO(o,c,C!==null?C.baseLanes|m:m,m)}else C!==null?(nv(c,C.cachePool),LM(c,C),nl(),c.memoizedState=null):(o!==null&&nv(c,null),Y_(),nl());return Ur(o,c,_,m),c.child}function zO(o,c,m,y){var _=B_();return _=_===null?null:{parent:_r._currentValue,pool:_},c.memoizedState={baseLanes:m,cachePool:_},o!==null&&nv(c,null),Y_(),kO(c),o!==null&&Nh(o,c,y,!0),null}function bv(o,c){var m=c.ref;if(m===null)o!==null&&o.ref!==null&&(c.flags|=4194816);else{if(typeof m!="function"&&typeof m!="object")throw Error(r(284));(o===null||o.ref!==m)&&(c.flags|=4194816)}}function mw(o,c,m,y,_){return Tc(c),m=Q_(o,c,m,y,void 0,_),y=J_(),o!==null&&!Rr?(Z_(o,c,_),ao(o,c,_)):(on&&y&&P_(c),c.flags|=1,Ur(o,c,m,_),c.child)}function FO(o,c,m,y,_,C){return Tc(c),c.updateQueue=null,m=zM(c,y,m,_),$M(o),y=J_(),o!==null&&!Rr?(Z_(o,c,C),ao(o,c,C)):(on&&y&&P_(c),c.flags|=1,Ur(o,c,m,C),c.child)}function UO(o,c,m,y,_){if(Tc(c),c.stateNode===null){var C=Wu,$=m.contextType;typeof $=="object"&&$!==null&&(C=Jr($)),C=new m(y,C),c.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,C.updater=hw,c.stateNode=C,C._reactInternals=c,C=c.stateNode,C.props=y,C.state=c.memoizedState,C.refs={},V_(c),$=m.contextType,C.context=typeof $=="object"&&$!==null?Jr($):Wu,C.state=c.memoizedState,$=m.getDerivedStateFromProps,typeof $=="function"&&(fw(c,m,$,y),C.state=c.memoizedState),typeof m.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||($=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),$!==C.state&&hw.enqueueReplaceState(C,C.state,null),Dh(c,y,C,_),Ih(),C.state=c.memoizedState),typeof C.componentDidMount=="function"&&(c.flags|=4194308),y=!0}else if(o===null){C=c.stateNode;var q=c.memoizedProps,ee=Nc(m,q);C.props=ee;var de=C.context,we=m.contextType;$=Wu,typeof we=="object"&&we!==null&&($=Jr(we));var ke=m.getDerivedStateFromProps;we=typeof ke=="function"||typeof C.getSnapshotBeforeUpdate=="function",q=c.pendingProps!==q,we||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(q||de!==$)&&CO(c,C,y,$),Qo=!1;var pe=c.memoizedState;C.state=pe,Dh(c,y,C,_),Ih(),de=c.memoizedState,q||pe!==de||Qo?(typeof ke=="function"&&(fw(c,m,ke,y),de=c.memoizedState),(ee=Qo||TO(c,m,ee,y,pe,de,$))?(we||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount()),typeof C.componentDidMount=="function"&&(c.flags|=4194308)):(typeof C.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=y,c.memoizedState=de),C.props=y,C.state=de,C.context=$,y=ee):(typeof C.componentDidMount=="function"&&(c.flags|=4194308),y=!1)}else{C=c.stateNode,H_(o,c),$=c.memoizedProps,we=Nc(m,$),C.props=we,ke=c.pendingProps,pe=C.context,de=m.contextType,ee=Wu,typeof de=="object"&&de!==null&&(ee=Jr(de)),q=m.getDerivedStateFromProps,(de=typeof q=="function"||typeof C.getSnapshotBeforeUpdate=="function")||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||($!==ke||pe!==ee)&&CO(c,C,y,ee),Qo=!1,pe=c.memoizedState,C.state=pe,Dh(c,y,C,_),Ih();var ge=c.memoizedState;$!==ke||pe!==ge||Qo||o!==null&&o.dependencies!==null&&ev(o.dependencies)?(typeof q=="function"&&(fw(c,m,q,y),ge=c.memoizedState),(we=Qo||TO(c,m,we,y,pe,ge,ee)||o!==null&&o.dependencies!==null&&ev(o.dependencies))?(de||typeof C.UNSAFE_componentWillUpdate!="function"&&typeof C.componentWillUpdate!="function"||(typeof C.componentWillUpdate=="function"&&C.componentWillUpdate(y,ge,ee),typeof C.UNSAFE_componentWillUpdate=="function"&&C.UNSAFE_componentWillUpdate(y,ge,ee)),typeof C.componentDidUpdate=="function"&&(c.flags|=4),typeof C.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof C.componentDidUpdate!="function"||$===o.memoizedProps&&pe===o.memoizedState||(c.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||$===o.memoizedProps&&pe===o.memoizedState||(c.flags|=1024),c.memoizedProps=y,c.memoizedState=ge),C.props=y,C.state=ge,C.context=ee,y=we):(typeof C.componentDidUpdate!="function"||$===o.memoizedProps&&pe===o.memoizedState||(c.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||$===o.memoizedProps&&pe===o.memoizedState||(c.flags|=1024),y=!1)}return C=y,bv(o,c),y=(c.flags&128)!==0,C||y?(C=c.stateNode,m=y&&typeof m.getDerivedStateFromError!="function"?null:C.render(),c.flags|=1,o!==null&&y?(c.child=rd(c,o.child,null,_),c.child=rd(c,null,m,_)):Ur(o,c,m,_),c.memoizedState=C.state,o=c.child):o=ao(o,c,_),o}function BO(o,c,m,y){return Ch(),c.flags|=256,Ur(o,c,m,y),c.child}var gw={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function vw(o){return{baseLanes:o,cachePool:NM()}}function yw(o,c,m){return o=o!==null?o.childLanes&~m:0,c&&(o|=pi),o}function qO(o,c,m){var y=c.pendingProps,_=!1,C=(c.flags&128)!==0,$;if(($=C)||($=o!==null&&o.memoizedState===null?!1:(wr.current&2)!==0),$&&(_=!0,c.flags&=-129),$=(c.flags&32)!==0,c.flags&=-33,o===null){if(on){if(_?tl(c):nl(),on){var q=Gn,ee;if(ee=q){e:{for(ee=q,q=pa;ee.nodeType!==8;){if(!q){q=null;break e}if(ee=qi(ee.nextSibling),ee===null){q=null;break e}}q=ee}q!==null?(c.memoizedState={dehydrated:q,treeContext:_c!==null?{id:eo,overflow:to}:null,retryLane:536870912,hydrationErrors:null},ee=Bs(18,null,null,0),ee.stateNode=q,ee.return=c,c.child=ee,os=c,Gn=null,ee=!0):ee=!1}ee||Ec(c)}if(q=c.memoizedState,q!==null&&(q=q.dehydrated,q!==null))return tS(q)?c.lanes=32:c.lanes=536870912,null;io(c)}return q=y.children,y=y.fallback,_?(nl(),_=c.mode,q=xv({mode:"hidden",children:q},_),y=xc(y,_,m,null),q.return=c,y.return=c,q.sibling=y,c.child=q,_=c.child,_.memoizedState=vw(m),_.childLanes=yw(o,$,m),c.memoizedState=gw,y):(tl(c),bw(c,q))}if(ee=o.memoizedState,ee!==null&&(q=ee.dehydrated,q!==null)){if(C)c.flags&256?(tl(c),c.flags&=-257,c=xw(o,c,m)):c.memoizedState!==null?(nl(),c.child=o.child,c.flags|=128,c=null):(nl(),_=y.fallback,q=c.mode,y=xv({mode:"visible",children:y.children},q),_=xc(_,q,m,null),_.flags|=2,y.return=c,_.return=c,y.sibling=_,c.child=y,rd(c,o.child,null,m),y=c.child,y.memoizedState=vw(m),y.childLanes=yw(o,$,m),c.memoizedState=gw,c=_);else if(tl(c),tS(q)){if($=q.nextSibling&&q.nextSibling.dataset,$)var de=$.dgst;$=de,y=Error(r(419)),y.stack="",y.digest=$,Ah({value:y,source:null,stack:null}),c=xw(o,c,m)}else if(Rr||Nh(o,c,m,!1),$=(m&o.childLanes)!==0,Rr||$){if($=wn,$!==null&&(y=m&-m,y=(y&42)!==0?1:$n(y),y=(y&($.suspendedLanes|m))!==0?0:y,y!==0&&y!==ee.retryLane))throw ee.retryLane=y,Gu(o,y),Ws($,o,y),PO;q.data==="$?"||$w(),c=xw(o,c,m)}else q.data==="$?"?(c.flags|=192,c.child=o.child,c=null):(o=ee.treeContext,Gn=qi(q.nextSibling),os=c,on=!0,Sc=null,pa=!1,o!==null&&(di[fi++]=eo,di[fi++]=to,di[fi++]=_c,eo=o.id,to=o.overflow,_c=c),c=bw(c,y.children),c.flags|=4096);return c}return _?(nl(),_=y.fallback,q=c.mode,ee=o.child,de=ee.sibling,y=Za(ee,{mode:"hidden",children:y.children}),y.subtreeFlags=ee.subtreeFlags&65011712,de!==null?_=Za(de,_):(_=xc(_,q,m,null),_.flags|=2),_.return=c,y.return=c,y.sibling=_,c.child=y,y=_,_=c.child,q=o.child.memoizedState,q===null?q=vw(m):(ee=q.cachePool,ee!==null?(de=_r._currentValue,ee=ee.parent!==de?{parent:de,pool:de}:ee):ee=NM(),q={baseLanes:q.baseLanes|m,cachePool:ee}),_.memoizedState=q,_.childLanes=yw(o,$,m),c.memoizedState=gw,y):(tl(c),m=o.child,o=m.sibling,m=Za(m,{mode:"visible",children:y.children}),m.return=c,m.sibling=null,o!==null&&($=c.deletions,$===null?(c.deletions=[o],c.flags|=16):$.push(o)),c.child=m,c.memoizedState=null,m)}function bw(o,c){return c=xv({mode:"visible",children:c},o.mode),c.return=o,o.child=c}function xv(o,c){return o=Bs(22,o,null,c),o.lanes=0,o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},o}function xw(o,c,m){return rd(c,o.child,null,m),o=bw(c,c.pendingProps.children),o.flags|=2,c.memoizedState=null,o}function VO(o,c,m){o.lanes|=c;var y=o.alternate;y!==null&&(y.lanes|=c),$_(o.return,c,m)}function _w(o,c,m,y,_){var C=o.memoizedState;C===null?o.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:y,tail:m,tailMode:_}:(C.isBackwards=c,C.rendering=null,C.renderingStartTime=0,C.last=y,C.tail=m,C.tailMode=_)}function HO(o,c,m){var y=c.pendingProps,_=y.revealOrder,C=y.tail;if(Ur(o,c,y.children,m),y=wr.current,(y&2)!==0)y=y&1|2,c.flags|=128;else{if(o!==null&&(o.flags&128)!==0)e:for(o=c.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&VO(o,m,c);else if(o.tag===19)VO(o,m,c);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===c)break e;for(;o.sibling===null;){if(o.return===null||o.return===c)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}y&=1}switch(D(wr,y),_){case"forwards":for(m=c.child,_=null;m!==null;)o=m.alternate,o!==null&&gv(o)===null&&(_=m),m=m.sibling;m=_,m===null?(_=c.child,c.child=null):(_=m.sibling,m.sibling=null),_w(c,!1,_,m,C);break;case"backwards":for(m=null,_=c.child,c.child=null;_!==null;){if(o=_.alternate,o!==null&&gv(o)===null){c.child=_;break}o=_.sibling,_.sibling=m,m=_,_=o}_w(c,!0,m,null,C);break;case"together":_w(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function ao(o,c,m){if(o!==null&&(c.dependencies=o.dependencies),ol|=c.lanes,(m&c.childLanes)===0)if(o!==null){if(Nh(o,c,m,!1),(m&c.childLanes)===0)return null}else return null;if(o!==null&&c.child!==o.child)throw Error(r(153));if(c.child!==null){for(o=c.child,m=Za(o,o.pendingProps),c.child=m,m.return=c;o.sibling!==null;)o=o.sibling,m=m.sibling=Za(o,o.pendingProps),m.return=c;m.sibling=null}return c.child}function ww(o,c){return(o.lanes&c)!==0?!0:(o=o.dependencies,!!(o!==null&&ev(o)))}function XY(o,c,m){switch(c.tag){case 3:K(c,c.stateNode.containerInfo),Xo(c,_r,o.memoizedState.cache),Ch();break;case 27:case 5:B(c);break;case 4:K(c,c.stateNode.containerInfo);break;case 10:Xo(c,c.type,c.memoizedProps.value);break;case 13:var y=c.memoizedState;if(y!==null)return y.dehydrated!==null?(tl(c),c.flags|=128,null):(m&c.child.childLanes)!==0?qO(o,c,m):(tl(c),o=ao(o,c,m),o!==null?o.sibling:null);tl(c);break;case 19:var _=(o.flags&128)!==0;if(y=(m&c.childLanes)!==0,y||(Nh(o,c,m,!1),y=(m&c.childLanes)!==0),_){if(y)return HO(o,c,m);c.flags|=128}if(_=c.memoizedState,_!==null&&(_.rendering=null,_.tail=null,_.lastEffect=null),D(wr,wr.current),y)break;return null;case 22:case 23:return c.lanes=0,$O(o,c,m);case 24:Xo(c,_r,o.memoizedState.cache)}return ao(o,c,m)}function GO(o,c,m){if(o!==null)if(o.memoizedProps!==c.pendingProps)Rr=!0;else{if(!ww(o,m)&&(c.flags&128)===0)return Rr=!1,XY(o,c,m);Rr=(o.flags&131072)!==0}else Rr=!1,on&&(c.flags&1048576)!==0&&wM(c,Zg,c.index);switch(c.lanes=0,c.tag){case 16:e:{o=c.pendingProps;var y=c.elementType,_=y._init;if(y=_(y._payload),c.type=y,typeof y=="function")j_(y)?(o=Nc(y,o),c.tag=1,c=UO(null,c,y,o,m)):(c.tag=0,c=mw(null,c,y,o,m));else{if(y!=null){if(_=y.$$typeof,_===R){c.tag=11,c=IO(null,c,y,o,m);break e}else if(_===N){c.tag=14,c=DO(null,c,y,o,m);break e}}throw c=W(y)||y,Error(r(306,c,""))}}return c;case 0:return mw(o,c,c.type,c.pendingProps,m);case 1:return y=c.type,_=Nc(y,c.pendingProps),UO(o,c,y,_,m);case 3:e:{if(K(c,c.stateNode.containerInfo),o===null)throw Error(r(387));y=c.pendingProps;var C=c.memoizedState;_=C.element,H_(o,c),Dh(c,y,null,m);var $=c.memoizedState;if(y=$.cache,Xo(c,_r,y),y!==C.cache&&z_(c,[_r],m,!0),Ih(),y=$.element,C.isDehydrated)if(C={element:y,isDehydrated:!1,cache:$.cache},c.updateQueue.baseState=C,c.memoizedState=C,c.flags&256){c=BO(o,c,y,m);break e}else if(y!==_){_=ci(Error(r(424)),c),Ah(_),c=BO(o,c,y,m);break e}else{switch(o=c.stateNode.containerInfo,o.nodeType){case 9:o=o.body;break;default:o=o.nodeName==="HTML"?o.ownerDocument.body:o}for(Gn=qi(o.firstChild),os=c,on=!0,Sc=null,pa=!0,m=EO(c,null,y,m),c.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling}else{if(Ch(),y===_){c=ao(o,c,m);break e}Ur(o,c,y,m)}c=c.child}return c;case 26:return bv(o,c),o===null?(m=X2(c.type,null,c.pendingProps,null))?c.memoizedState=m:on||(m=c.type,o=c.pendingProps,y=Pv(V.current).createElement(m),y[Rn]=c,y[fn]=o,qr(y,m,o),at(y),c.stateNode=y):c.memoizedState=X2(c.type,o.memoizedProps,c.pendingProps,o.memoizedState),null;case 27:return B(c),o===null&&on&&(y=c.stateNode=W2(c.type,c.pendingProps,V.current),os=c,pa=!0,_=Gn,dl(c.type)?(nS=_,Gn=qi(y.firstChild)):Gn=_),Ur(o,c,c.pendingProps.children,m),bv(o,c),o===null&&(c.flags|=4194304),c.child;case 5:return o===null&&on&&((_=y=Gn)&&(y=EK(y,c.type,c.pendingProps,pa),y!==null?(c.stateNode=y,os=c,Gn=qi(y.firstChild),pa=!1,_=!0):_=!1),_||Ec(c)),B(c),_=c.type,C=c.pendingProps,$=o!==null?o.memoizedProps:null,y=C.children,Jw(_,C)?y=null:$!==null&&Jw(_,$)&&(c.flags|=32),c.memoizedState!==null&&(_=Q_(o,c,BY,null,null,m),sp._currentValue=_),bv(o,c),Ur(o,c,y,m),c.child;case 6:return o===null&&on&&((o=m=Gn)&&(m=kK(m,c.pendingProps,pa),m!==null?(c.stateNode=m,os=c,Gn=null,o=!0):o=!1),o||Ec(c)),null;case 13:return qO(o,c,m);case 4:return K(c,c.stateNode.containerInfo),y=c.pendingProps,o===null?c.child=rd(c,null,y,m):Ur(o,c,y,m),c.child;case 11:return IO(o,c,c.type,c.pendingProps,m);case 7:return Ur(o,c,c.pendingProps,m),c.child;case 8:return Ur(o,c,c.pendingProps.children,m),c.child;case 12:return Ur(o,c,c.pendingProps.children,m),c.child;case 10:return y=c.pendingProps,Xo(c,c.type,y.value),Ur(o,c,y.children,m),c.child;case 9:return _=c.type._context,y=c.pendingProps.children,Tc(c),_=Jr(_),y=y(_),c.flags|=1,Ur(o,c,y,m),c.child;case 14:return DO(o,c,c.type,c.pendingProps,m);case 15:return LO(o,c,c.type,c.pendingProps,m);case 19:return HO(o,c,m);case 31:return y=c.pendingProps,m=c.mode,y={mode:y.mode,children:y.children},o===null?(m=xv(y,m),m.ref=c.ref,c.child=m,m.return=c,c=m):(m=Za(o.child,y),m.ref=c.ref,c.child=m,m.return=c,c=m),c;case 22:return $O(o,c,m);case 24:return Tc(c),y=Jr(_r),o===null?(_=B_(),_===null&&(_=wn,C=F_(),_.pooledCache=C,C.refCount++,C!==null&&(_.pooledCacheLanes|=m),_=C),c.memoizedState={parent:y,cache:_},V_(c),Xo(c,_r,_)):((o.lanes&m)!==0&&(H_(o,c),Dh(c,null,null,m),Ih()),_=o.memoizedState,C=c.memoizedState,_.parent!==y?(_={parent:y,cache:y},c.memoizedState=_,c.lanes===0&&(c.memoizedState=c.updateQueue.baseState=_),Xo(c,_r,y)):(y=C.cache,Xo(c,_r,y),y!==_.cache&&z_(c,[_r],m,!0))),Ur(o,c,c.pendingProps.children,m),c.child;case 29:throw c.pendingProps}throw Error(r(156,c.tag))}function oo(o){o.flags|=4}function WO(o,c){if(c.type!=="stylesheet"||(c.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!tP(c)){if(c=hi.current,c!==null&&((Jt&4194048)===Jt?ma!==null:(Jt&62914560)!==Jt&&(Jt&536870912)===0||c!==ma))throw Oh=q_,RM;o.flags|=8192}}function _v(o,c){c!==null&&(o.flags|=4),o.flags&16384&&(c=o.tag!==22?Yo():536870912,o.lanes|=c,od|=c)}function qh(o,c){if(!on)switch(o.tailMode){case"hidden":c=o.tail;for(var m=null;c!==null;)c.alternate!==null&&(m=c),c=c.sibling;m===null?o.tail=null:m.sibling=null;break;case"collapsed":m=o.tail;for(var y=null;m!==null;)m.alternate!==null&&(y=m),m=m.sibling;y===null?c||o.tail===null?o.tail=null:o.tail.sibling=null:y.sibling=null}}function Fn(o){var c=o.alternate!==null&&o.alternate.child===o.child,m=0,y=0;if(c)for(var _=o.child;_!==null;)m|=_.lanes|_.childLanes,y|=_.subtreeFlags&65011712,y|=_.flags&65011712,_.return=o,_=_.sibling;else for(_=o.child;_!==null;)m|=_.lanes|_.childLanes,y|=_.subtreeFlags,y|=_.flags,_.return=o,_=_.sibling;return o.subtreeFlags|=y,o.childLanes=m,c}function QY(o,c,m){var y=c.pendingProps;switch(I_(c),c.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fn(c),null;case 1:return Fn(c),null;case 3:return m=c.stateNode,y=null,o!==null&&(y=o.memoizedState.cache),c.memoizedState.cache!==y&&(c.flags|=2048),ro(_r),ae(),m.pendingContext&&(m.context=m.pendingContext,m.pendingContext=null),(o===null||o.child===null)&&(Th(c)?oo(c):o===null||o.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,kM())),Fn(c),null;case 26:return m=c.memoizedState,o===null?(oo(c),m!==null?(Fn(c),WO(c,m)):(Fn(c),c.flags&=-16777217)):m?m!==o.memoizedState?(oo(c),Fn(c),WO(c,m)):(Fn(c),c.flags&=-16777217):(o.memoizedProps!==y&&oo(c),Fn(c),c.flags&=-16777217),null;case 27:J(c),m=V.current;var _=c.type;if(o!==null&&c.stateNode!=null)o.memoizedProps!==y&&oo(c);else{if(!y){if(c.stateNode===null)throw Error(r(166));return Fn(c),null}o=Z.current,Th(c)?SM(c):(o=W2(_,y,m),c.stateNode=o,oo(c))}return Fn(c),null;case 5:if(J(c),m=c.type,o!==null&&c.stateNode!=null)o.memoizedProps!==y&&oo(c);else{if(!y){if(c.stateNode===null)throw Error(r(166));return Fn(c),null}if(o=Z.current,Th(c))SM(c);else{switch(_=Pv(V.current),o){case 1:o=_.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:o=_.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":o=_.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":o=_.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":o=_.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof y.is=="string"?_.createElement("select",{is:y.is}):_.createElement("select"),y.multiple?o.multiple=!0:y.size&&(o.size=y.size);break;default:o=typeof y.is=="string"?_.createElement(m,{is:y.is}):_.createElement(m)}}o[Rn]=c,o[fn]=y;e:for(_=c.child;_!==null;){if(_.tag===5||_.tag===6)o.appendChild(_.stateNode);else if(_.tag!==4&&_.tag!==27&&_.child!==null){_.child.return=_,_=_.child;continue}if(_===c)break e;for(;_.sibling===null;){if(_.return===null||_.return===c)break e;_=_.return}_.sibling.return=_.return,_=_.sibling}c.stateNode=o;e:switch(qr(o,m,y),m){case"button":case"input":case"select":case"textarea":o=!!y.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&oo(c)}}return Fn(c),c.flags&=-16777217,null;case 6:if(o&&c.stateNode!=null)o.memoizedProps!==y&&oo(c);else{if(typeof y!="string"&&c.stateNode===null)throw Error(r(166));if(o=V.current,Th(c)){if(o=c.stateNode,m=c.memoizedProps,y=null,_=os,_!==null)switch(_.tag){case 27:case 5:y=_.memoizedProps}o[Rn]=c,o=!!(o.nodeValue===m||y!==null&&y.suppressHydrationWarning===!0||F2(o.nodeValue,m)),o||Ec(c)}else o=Pv(o).createTextNode(y),o[Rn]=c,c.stateNode=o}return Fn(c),null;case 13:if(y=c.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(_=Th(c),y!==null&&y.dehydrated!==null){if(o===null){if(!_)throw Error(r(318));if(_=c.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(r(317));_[Rn]=c}else Ch(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Fn(c),_=!1}else _=kM(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=_),_=!0;if(!_)return c.flags&256?(io(c),c):(io(c),null)}if(io(c),(c.flags&128)!==0)return c.lanes=m,c;if(m=y!==null,o=o!==null&&o.memoizedState!==null,m){y=c.child,_=null,y.alternate!==null&&y.alternate.memoizedState!==null&&y.alternate.memoizedState.cachePool!==null&&(_=y.alternate.memoizedState.cachePool.pool);var C=null;y.memoizedState!==null&&y.memoizedState.cachePool!==null&&(C=y.memoizedState.cachePool.pool),C!==_&&(y.flags|=2048)}return m!==o&&m&&(c.child.flags|=8192),_v(c,c.updateQueue),Fn(c),null;case 4:return ae(),o===null&&Ww(c.stateNode.containerInfo),Fn(c),null;case 10:return ro(c.type),Fn(c),null;case 19:if(ue(wr),_=c.memoizedState,_===null)return Fn(c),null;if(y=(c.flags&128)!==0,C=_.rendering,C===null)if(y)qh(_,!1);else{if(Wn!==0||o!==null&&(o.flags&128)!==0)for(o=c.child;o!==null;){if(C=gv(o),C!==null){for(c.flags|=128,qh(_,!1),o=C.updateQueue,c.updateQueue=o,_v(c,o),c.subtreeFlags=0,o=m,m=c.child;m!==null;)_M(m,o),m=m.sibling;return D(wr,wr.current&1|2),c.child}o=o.sibling}_.tail!==null&&Ne()>Ev&&(c.flags|=128,y=!0,qh(_,!1),c.lanes=4194304)}else{if(!y)if(o=gv(C),o!==null){if(c.flags|=128,y=!0,o=o.updateQueue,c.updateQueue=o,_v(c,o),qh(_,!0),_.tail===null&&_.tailMode==="hidden"&&!C.alternate&&!on)return Fn(c),null}else 2*Ne()-_.renderingStartTime>Ev&&m!==536870912&&(c.flags|=128,y=!0,qh(_,!1),c.lanes=4194304);_.isBackwards?(C.sibling=c.child,c.child=C):(o=_.last,o!==null?o.sibling=C:c.child=C,_.last=C)}return _.tail!==null?(c=_.tail,_.rendering=c,_.tail=c.sibling,_.renderingStartTime=Ne(),c.sibling=null,o=wr.current,D(wr,y?o&1|2:o&1),c):(Fn(c),null);case 22:case 23:return io(c),K_(),y=c.memoizedState!==null,o!==null?o.memoizedState!==null!==y&&(c.flags|=8192):y&&(c.flags|=8192),y?(m&536870912)!==0&&(c.flags&128)===0&&(Fn(c),c.subtreeFlags&6&&(c.flags|=8192)):Fn(c),m=c.updateQueue,m!==null&&_v(c,m.retryQueue),m=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(m=o.memoizedState.cachePool.pool),y=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(y=c.memoizedState.cachePool.pool),y!==m&&(c.flags|=2048),o!==null&&ue(Cc),null;case 24:return m=null,o!==null&&(m=o.memoizedState.cache),c.memoizedState.cache!==m&&(c.flags|=2048),ro(_r),Fn(c),null;case 25:return null;case 30:return null}throw Error(r(156,c.tag))}function JY(o,c){switch(I_(c),c.tag){case 1:return o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 3:return ro(_r),ae(),o=c.flags,(o&65536)!==0&&(o&128)===0?(c.flags=o&-65537|128,c):null;case 26:case 27:case 5:return J(c),null;case 13:if(io(c),o=c.memoizedState,o!==null&&o.dehydrated!==null){if(c.alternate===null)throw Error(r(340));Ch()}return o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 19:return ue(wr),null;case 4:return ae(),null;case 10:return ro(c.type),null;case 22:case 23:return io(c),K_(),o!==null&&ue(Cc),o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 24:return ro(_r),null;case 25:return null;default:return null}}function YO(o,c){switch(I_(c),c.tag){case 3:ro(_r),ae();break;case 26:case 27:case 5:J(c);break;case 4:ae();break;case 13:io(c);break;case 19:ue(wr);break;case 10:ro(c.type);break;case 22:case 23:io(c),K_(),o!==null&&ue(Cc);break;case 24:ro(_r)}}function Vh(o,c){try{var m=c.updateQueue,y=m!==null?m.lastEffect:null;if(y!==null){var _=y.next;m=_;do{if((m.tag&o)===o){y=void 0;var C=m.create,$=m.inst;y=C(),$.destroy=y}m=m.next}while(m!==_)}}catch(q){bn(c,c.return,q)}}function rl(o,c,m){try{var y=c.updateQueue,_=y!==null?y.lastEffect:null;if(_!==null){var C=_.next;y=C;do{if((y.tag&o)===o){var $=y.inst,q=$.destroy;if(q!==void 0){$.destroy=void 0,_=c;var ee=m,de=q;try{de()}catch(we){bn(_,ee,we)}}}y=y.next}while(y!==C)}}catch(we){bn(c,c.return,we)}}function KO(o){var c=o.updateQueue;if(c!==null){var m=o.stateNode;try{DM(c,m)}catch(y){bn(o,o.return,y)}}}function XO(o,c,m){m.props=Nc(o.type,o.memoizedProps),m.state=o.memoizedState;try{m.componentWillUnmount()}catch(y){bn(o,c,y)}}function Hh(o,c){try{var m=o.ref;if(m!==null){switch(o.tag){case 26:case 27:case 5:var y=o.stateNode;break;case 30:y=o.stateNode;break;default:y=o.stateNode}typeof m=="function"?o.refCleanup=m(y):m.current=y}}catch(_){bn(o,c,_)}}function ga(o,c){var m=o.ref,y=o.refCleanup;if(m!==null)if(typeof y=="function")try{y()}catch(_){bn(o,c,_)}finally{o.refCleanup=null,o=o.alternate,o!=null&&(o.refCleanup=null)}else if(typeof m=="function")try{m(null)}catch(_){bn(o,c,_)}else m.current=null}function QO(o){var c=o.type,m=o.memoizedProps,y=o.stateNode;try{e:switch(c){case"button":case"input":case"select":case"textarea":m.autoFocus&&y.focus();break e;case"img":m.src?y.src=m.src:m.srcSet&&(y.srcset=m.srcSet)}}catch(_){bn(o,o.return,_)}}function Sw(o,c,m){try{var y=o.stateNode;bK(y,o.type,m,c),y[fn]=c}catch(_){bn(o,o.return,_)}}function JO(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&dl(o.type)||o.tag===4}function Ew(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||JO(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.tag===27&&dl(o.type)||o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function kw(o,c,m){var y=o.tag;if(y===5||y===6)o=o.stateNode,c?(m.nodeType===9?m.body:m.nodeName==="HTML"?m.ownerDocument.body:m).insertBefore(o,c):(c=m.nodeType===9?m.body:m.nodeName==="HTML"?m.ownerDocument.body:m,c.appendChild(o),m=m._reactRootContainer,m!=null||c.onclick!==null||(c.onclick=Ov));else if(y!==4&&(y===27&&dl(o.type)&&(m=o.stateNode,c=null),o=o.child,o!==null))for(kw(o,c,m),o=o.sibling;o!==null;)kw(o,c,m),o=o.sibling}function wv(o,c,m){var y=o.tag;if(y===5||y===6)o=o.stateNode,c?m.insertBefore(o,c):m.appendChild(o);else if(y!==4&&(y===27&&dl(o.type)&&(m=o.stateNode),o=o.child,o!==null))for(wv(o,c,m),o=o.sibling;o!==null;)wv(o,c,m),o=o.sibling}function ZO(o){var c=o.stateNode,m=o.memoizedProps;try{for(var y=o.type,_=c.attributes;_.length;)c.removeAttributeNode(_[0]);qr(c,y,m),c[Rn]=o,c[fn]=m}catch(C){bn(o,o.return,C)}}var lo=!1,nr=!1,Tw=!1,e2=typeof WeakSet=="function"?WeakSet:Set,jr=null;function ZY(o,c){if(o=o.containerInfo,Xw=Fv,o=dM(o),E_(o)){if("selectionStart"in o)var m={start:o.selectionStart,end:o.selectionEnd};else e:{m=(m=o.ownerDocument)&&m.defaultView||window;var y=m.getSelection&&m.getSelection();if(y&&y.rangeCount!==0){m=y.anchorNode;var _=y.anchorOffset,C=y.focusNode;y=y.focusOffset;try{m.nodeType,C.nodeType}catch{m=null;break e}var $=0,q=-1,ee=-1,de=0,we=0,ke=o,pe=null;t:for(;;){for(var ge;ke!==m||_!==0&&ke.nodeType!==3||(q=$+_),ke!==C||y!==0&&ke.nodeType!==3||(ee=$+y),ke.nodeType===3&&($+=ke.nodeValue.length),(ge=ke.firstChild)!==null;)pe=ke,ke=ge;for(;;){if(ke===o)break t;if(pe===m&&++de===_&&(q=$),pe===C&&++we===y&&(ee=$),(ge=ke.nextSibling)!==null)break;ke=pe,pe=ke.parentNode}ke=ge}m=q===-1||ee===-1?null:{start:q,end:ee}}else m=null}m=m||{start:0,end:0}}else m=null;for(Qw={focusedElem:o,selectionRange:m},Fv=!1,jr=c;jr!==null;)if(c=jr,o=c.child,(c.subtreeFlags&1024)!==0&&o!==null)o.return=c,jr=o;else for(;jr!==null;){switch(c=jr,C=c.alternate,o=c.flags,c.tag){case 0:break;case 11:case 15:break;case 1:if((o&1024)!==0&&C!==null){o=void 0,m=c,_=C.memoizedProps,C=C.memoizedState,y=m.stateNode;try{var xt=Nc(m.type,_,m.elementType===m.type);o=y.getSnapshotBeforeUpdate(xt,C),y.__reactInternalSnapshotBeforeUpdate=o}catch(ht){bn(m,m.return,ht)}}break;case 3:if((o&1024)!==0){if(o=c.stateNode.containerInfo,m=o.nodeType,m===9)eS(o);else if(m===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":eS(o);break;default:o.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((o&1024)!==0)throw Error(r(163))}if(o=c.sibling,o!==null){o.return=c.return,jr=o;break}jr=c.return}}function t2(o,c,m){var y=m.flags;switch(m.tag){case 0:case 11:case 15:sl(o,m),y&4&&Vh(5,m);break;case 1:if(sl(o,m),y&4)if(o=m.stateNode,c===null)try{o.componentDidMount()}catch($){bn(m,m.return,$)}else{var _=Nc(m.type,c.memoizedProps);c=c.memoizedState;try{o.componentDidUpdate(_,c,o.__reactInternalSnapshotBeforeUpdate)}catch($){bn(m,m.return,$)}}y&64&&KO(m),y&512&&Hh(m,m.return);break;case 3:if(sl(o,m),y&64&&(o=m.updateQueue,o!==null)){if(c=null,m.child!==null)switch(m.child.tag){case 27:case 5:c=m.child.stateNode;break;case 1:c=m.child.stateNode}try{DM(o,c)}catch($){bn(m,m.return,$)}}break;case 27:c===null&&y&4&&ZO(m);case 26:case 5:sl(o,m),c===null&&y&4&&QO(m),y&512&&Hh(m,m.return);break;case 12:sl(o,m);break;case 13:sl(o,m),y&4&&s2(o,m),y&64&&(o=m.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(m=lK.bind(null,m),TK(o,m))));break;case 22:if(y=m.memoizedState!==null||lo,!y){c=c!==null&&c.memoizedState!==null||nr,_=lo;var C=nr;lo=y,(nr=c)&&!C?il(o,m,(m.subtreeFlags&8772)!==0):sl(o,m),lo=_,nr=C}break;case 30:break;default:sl(o,m)}}function n2(o){var c=o.alternate;c!==null&&(o.alternate=null,n2(c)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(c=o.stateNode,c!==null&&nt(c)),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}var Mn=null,ws=!1;function co(o,c,m){for(m=m.child;m!==null;)r2(o,c,m),m=m.sibling}function r2(o,c,m){if(Te&&typeof Te.onCommitFiberUnmount=="function")try{Te.onCommitFiberUnmount(xe,m)}catch{}switch(m.tag){case 26:nr||ga(m,c),co(o,c,m),m.memoizedState?m.memoizedState.count--:m.stateNode&&(m=m.stateNode,m.parentNode.removeChild(m));break;case 27:nr||ga(m,c);var y=Mn,_=ws;dl(m.type)&&(Mn=m.stateNode,ws=!1),co(o,c,m),ep(m.stateNode),Mn=y,ws=_;break;case 5:nr||ga(m,c);case 6:if(y=Mn,_=ws,Mn=null,co(o,c,m),Mn=y,ws=_,Mn!==null)if(ws)try{(Mn.nodeType===9?Mn.body:Mn.nodeName==="HTML"?Mn.ownerDocument.body:Mn).removeChild(m.stateNode)}catch(C){bn(m,c,C)}else try{Mn.removeChild(m.stateNode)}catch(C){bn(m,c,C)}break;case 18:Mn!==null&&(ws?(o=Mn,H2(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,m.stateNode),lp(o)):H2(Mn,m.stateNode));break;case 4:y=Mn,_=ws,Mn=m.stateNode.containerInfo,ws=!0,co(o,c,m),Mn=y,ws=_;break;case 0:case 11:case 14:case 15:nr||rl(2,m,c),nr||rl(4,m,c),co(o,c,m);break;case 1:nr||(ga(m,c),y=m.stateNode,typeof y.componentWillUnmount=="function"&&XO(m,c,y)),co(o,c,m);break;case 21:co(o,c,m);break;case 22:nr=(y=nr)||m.memoizedState!==null,co(o,c,m),nr=y;break;default:co(o,c,m)}}function s2(o,c){if(c.memoizedState===null&&(o=c.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{lp(o)}catch(m){bn(c,c.return,m)}}function eK(o){switch(o.tag){case 13:case 19:var c=o.stateNode;return c===null&&(c=o.stateNode=new e2),c;case 22:return o=o.stateNode,c=o._retryCache,c===null&&(c=o._retryCache=new e2),c;default:throw Error(r(435,o.tag))}}function Cw(o,c){var m=eK(o);c.forEach(function(y){var _=cK.bind(null,o,y);m.has(y)||(m.add(y),y.then(_,_))})}function qs(o,c){var m=c.deletions;if(m!==null)for(var y=0;y<m.length;y++){var _=m[y],C=o,$=c,q=$;e:for(;q!==null;){switch(q.tag){case 27:if(dl(q.type)){Mn=q.stateNode,ws=!1;break e}break;case 5:Mn=q.stateNode,ws=!1;break e;case 3:case 4:Mn=q.stateNode.containerInfo,ws=!0;break e}q=q.return}if(Mn===null)throw Error(r(160));r2(C,$,_),Mn=null,ws=!1,C=_.alternate,C!==null&&(C.return=null),_.return=null}if(c.subtreeFlags&13878)for(c=c.child;c!==null;)i2(c,o),c=c.sibling}var Bi=null;function i2(o,c){var m=o.alternate,y=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:qs(c,o),Vs(o),y&4&&(rl(3,o,o.return),Vh(3,o),rl(5,o,o.return));break;case 1:qs(c,o),Vs(o),y&512&&(nr||m===null||ga(m,m.return)),y&64&&lo&&(o=o.updateQueue,o!==null&&(y=o.callbacks,y!==null&&(m=o.shared.hiddenCallbacks,o.shared.hiddenCallbacks=m===null?y:m.concat(y))));break;case 26:var _=Bi;if(qs(c,o),Vs(o),y&512&&(nr||m===null||ga(m,m.return)),y&4){var C=m!==null?m.memoizedState:null;if(y=o.memoizedState,m===null)if(y===null)if(o.stateNode===null){e:{y=o.type,m=o.memoizedProps,_=_.ownerDocument||_;t:switch(y){case"title":C=_.getElementsByTagName("title")[0],(!C||C[me]||C[Rn]||C.namespaceURI==="http://www.w3.org/2000/svg"||C.hasAttribute("itemprop"))&&(C=_.createElement(y),_.head.insertBefore(C,_.querySelector("head > title"))),qr(C,y,m),C[Rn]=o,at(C),y=C;break e;case"link":var $=Z2("link","href",_).get(y+(m.href||""));if($){for(var q=0;q<$.length;q++)if(C=$[q],C.getAttribute("href")===(m.href==null||m.href===""?null:m.href)&&C.getAttribute("rel")===(m.rel==null?null:m.rel)&&C.getAttribute("title")===(m.title==null?null:m.title)&&C.getAttribute("crossorigin")===(m.crossOrigin==null?null:m.crossOrigin)){$.splice(q,1);break t}}C=_.createElement(y),qr(C,y,m),_.head.appendChild(C);break;case"meta":if($=Z2("meta","content",_).get(y+(m.content||""))){for(q=0;q<$.length;q++)if(C=$[q],C.getAttribute("content")===(m.content==null?null:""+m.content)&&C.getAttribute("name")===(m.name==null?null:m.name)&&C.getAttribute("property")===(m.property==null?null:m.property)&&C.getAttribute("http-equiv")===(m.httpEquiv==null?null:m.httpEquiv)&&C.getAttribute("charset")===(m.charSet==null?null:m.charSet)){$.splice(q,1);break t}}C=_.createElement(y),qr(C,y,m),_.head.appendChild(C);break;default:throw Error(r(468,y))}C[Rn]=o,at(C),y=C}o.stateNode=y}else eP(_,o.type,o.stateNode);else o.stateNode=J2(_,y,o.memoizedProps);else C!==y?(C===null?m.stateNode!==null&&(m=m.stateNode,m.parentNode.removeChild(m)):C.count--,y===null?eP(_,o.type,o.stateNode):J2(_,y,o.memoizedProps)):y===null&&o.stateNode!==null&&Sw(o,o.memoizedProps,m.memoizedProps)}break;case 27:qs(c,o),Vs(o),y&512&&(nr||m===null||ga(m,m.return)),m!==null&&y&4&&Sw(o,o.memoizedProps,m.memoizedProps);break;case 5:if(qs(c,o),Vs(o),y&512&&(nr||m===null||ga(m,m.return)),o.flags&32){_=o.stateNode;try{zu(_,"")}catch(ge){bn(o,o.return,ge)}}y&4&&o.stateNode!=null&&(_=o.memoizedProps,Sw(o,_,m!==null?m.memoizedProps:_)),y&1024&&(Tw=!0);break;case 6:if(qs(c,o),Vs(o),y&4){if(o.stateNode===null)throw Error(r(162));y=o.memoizedProps,m=o.stateNode;try{m.nodeValue=y}catch(ge){bn(o,o.return,ge)}}break;case 3:if(Lv=null,_=Bi,Bi=Iv(c.containerInfo),qs(c,o),Bi=_,Vs(o),y&4&&m!==null&&m.memoizedState.isDehydrated)try{lp(c.containerInfo)}catch(ge){bn(o,o.return,ge)}Tw&&(Tw=!1,a2(o));break;case 4:y=Bi,Bi=Iv(o.stateNode.containerInfo),qs(c,o),Vs(o),Bi=y;break;case 12:qs(c,o),Vs(o);break;case 13:qs(c,o),Vs(o),o.child.flags&8192&&o.memoizedState!==null!=(m!==null&&m.memoizedState!==null)&&(Ow=Ne()),y&4&&(y=o.updateQueue,y!==null&&(o.updateQueue=null,Cw(o,y)));break;case 22:_=o.memoizedState!==null;var ee=m!==null&&m.memoizedState!==null,de=lo,we=nr;if(lo=de||_,nr=we||ee,qs(c,o),nr=we,lo=de,Vs(o),y&8192)e:for(c=o.stateNode,c._visibility=_?c._visibility&-2:c._visibility|1,_&&(m===null||ee||lo||nr||Rc(o)),m=null,c=o;;){if(c.tag===5||c.tag===26){if(m===null){ee=m=c;try{if(C=ee.stateNode,_)$=C.style,typeof $.setProperty=="function"?$.setProperty("display","none","important"):$.display="none";else{q=ee.stateNode;var ke=ee.memoizedProps.style,pe=ke!=null&&ke.hasOwnProperty("display")?ke.display:null;q.style.display=pe==null||typeof pe=="boolean"?"":(""+pe).trim()}}catch(ge){bn(ee,ee.return,ge)}}}else if(c.tag===6){if(m===null){ee=c;try{ee.stateNode.nodeValue=_?"":ee.memoizedProps}catch(ge){bn(ee,ee.return,ge)}}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===o)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===o)break e;for(;c.sibling===null;){if(c.return===null||c.return===o)break e;m===c&&(m=null),c=c.return}m===c&&(m=null),c.sibling.return=c.return,c=c.sibling}y&4&&(y=o.updateQueue,y!==null&&(m=y.retryQueue,m!==null&&(y.retryQueue=null,Cw(o,m))));break;case 19:qs(c,o),Vs(o),y&4&&(y=o.updateQueue,y!==null&&(o.updateQueue=null,Cw(o,y)));break;case 30:break;case 21:break;default:qs(c,o),Vs(o)}}function Vs(o){var c=o.flags;if(c&2){try{for(var m,y=o.return;y!==null;){if(JO(y)){m=y;break}y=y.return}if(m==null)throw Error(r(160));switch(m.tag){case 27:var _=m.stateNode,C=Ew(o);wv(o,C,_);break;case 5:var $=m.stateNode;m.flags&32&&(zu($,""),m.flags&=-33);var q=Ew(o);wv(o,q,$);break;case 3:case 4:var ee=m.stateNode.containerInfo,de=Ew(o);kw(o,de,ee);break;default:throw Error(r(161))}}catch(we){bn(o,o.return,we)}o.flags&=-3}c&4096&&(o.flags&=-4097)}function a2(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var c=o;a2(c),c.tag===5&&c.flags&1024&&c.stateNode.reset(),o=o.sibling}}function sl(o,c){if(c.subtreeFlags&8772)for(c=c.child;c!==null;)t2(o,c.alternate,c),c=c.sibling}function Rc(o){for(o=o.child;o!==null;){var c=o;switch(c.tag){case 0:case 11:case 14:case 15:rl(4,c,c.return),Rc(c);break;case 1:ga(c,c.return);var m=c.stateNode;typeof m.componentWillUnmount=="function"&&XO(c,c.return,m),Rc(c);break;case 27:ep(c.stateNode);case 26:case 5:ga(c,c.return),Rc(c);break;case 22:c.memoizedState===null&&Rc(c);break;case 30:Rc(c);break;default:Rc(c)}o=o.sibling}}function il(o,c,m){for(m=m&&(c.subtreeFlags&8772)!==0,c=c.child;c!==null;){var y=c.alternate,_=o,C=c,$=C.flags;switch(C.tag){case 0:case 11:case 15:il(_,C,m),Vh(4,C);break;case 1:if(il(_,C,m),y=C,_=y.stateNode,typeof _.componentDidMount=="function")try{_.componentDidMount()}catch(de){bn(y,y.return,de)}if(y=C,_=y.updateQueue,_!==null){var q=y.stateNode;try{var ee=_.shared.hiddenCallbacks;if(ee!==null)for(_.shared.hiddenCallbacks=null,_=0;_<ee.length;_++)IM(ee[_],q)}catch(de){bn(y,y.return,de)}}m&&$&64&&KO(C),Hh(C,C.return);break;case 27:ZO(C);case 26:case 5:il(_,C,m),m&&y===null&&$&4&&QO(C),Hh(C,C.return);break;case 12:il(_,C,m);break;case 13:il(_,C,m),m&&$&4&&s2(_,C);break;case 22:C.memoizedState===null&&il(_,C,m),Hh(C,C.return);break;case 30:break;default:il(_,C,m)}c=c.sibling}}function Aw(o,c){var m=null;o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(m=o.memoizedState.cachePool.pool),o=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(o=c.memoizedState.cachePool.pool),o!==m&&(o!=null&&o.refCount++,m!=null&&Rh(m))}function Nw(o,c){o=null,c.alternate!==null&&(o=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==o&&(c.refCount++,o!=null&&Rh(o))}function va(o,c,m,y){if(c.subtreeFlags&10256)for(c=c.child;c!==null;)o2(o,c,m,y),c=c.sibling}function o2(o,c,m,y){var _=c.flags;switch(c.tag){case 0:case 11:case 15:va(o,c,m,y),_&2048&&Vh(9,c);break;case 1:va(o,c,m,y);break;case 3:va(o,c,m,y),_&2048&&(o=null,c.alternate!==null&&(o=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==o&&(c.refCount++,o!=null&&Rh(o)));break;case 12:if(_&2048){va(o,c,m,y),o=c.stateNode;try{var C=c.memoizedProps,$=C.id,q=C.onPostCommit;typeof q=="function"&&q($,c.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(ee){bn(c,c.return,ee)}}else va(o,c,m,y);break;case 13:va(o,c,m,y);break;case 23:break;case 22:C=c.stateNode,$=c.alternate,c.memoizedState!==null?C._visibility&2?va(o,c,m,y):Gh(o,c):C._visibility&2?va(o,c,m,y):(C._visibility|=2,sd(o,c,m,y,(c.subtreeFlags&10256)!==0)),_&2048&&Aw($,c);break;case 24:va(o,c,m,y),_&2048&&Nw(c.alternate,c);break;default:va(o,c,m,y)}}function sd(o,c,m,y,_){for(_=_&&(c.subtreeFlags&10256)!==0,c=c.child;c!==null;){var C=o,$=c,q=m,ee=y,de=$.flags;switch($.tag){case 0:case 11:case 15:sd(C,$,q,ee,_),Vh(8,$);break;case 23:break;case 22:var we=$.stateNode;$.memoizedState!==null?we._visibility&2?sd(C,$,q,ee,_):Gh(C,$):(we._visibility|=2,sd(C,$,q,ee,_)),_&&de&2048&&Aw($.alternate,$);break;case 24:sd(C,$,q,ee,_),_&&de&2048&&Nw($.alternate,$);break;default:sd(C,$,q,ee,_)}c=c.sibling}}function Gh(o,c){if(c.subtreeFlags&10256)for(c=c.child;c!==null;){var m=o,y=c,_=y.flags;switch(y.tag){case 22:Gh(m,y),_&2048&&Aw(y.alternate,y);break;case 24:Gh(m,y),_&2048&&Nw(y.alternate,y);break;default:Gh(m,y)}c=c.sibling}}var Wh=8192;function id(o){if(o.subtreeFlags&Wh)for(o=o.child;o!==null;)l2(o),o=o.sibling}function l2(o){switch(o.tag){case 26:id(o),o.flags&Wh&&o.memoizedState!==null&&zK(Bi,o.memoizedState,o.memoizedProps);break;case 5:id(o);break;case 3:case 4:var c=Bi;Bi=Iv(o.stateNode.containerInfo),id(o),Bi=c;break;case 22:o.memoizedState===null&&(c=o.alternate,c!==null&&c.memoizedState!==null?(c=Wh,Wh=16777216,id(o),Wh=c):id(o));break;default:id(o)}}function c2(o){var c=o.alternate;if(c!==null&&(o=c.child,o!==null)){c.child=null;do c=o.sibling,o.sibling=null,o=c;while(o!==null)}}function Yh(o){var c=o.deletions;if((o.flags&16)!==0){if(c!==null)for(var m=0;m<c.length;m++){var y=c[m];jr=y,d2(y,o)}c2(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)u2(o),o=o.sibling}function u2(o){switch(o.tag){case 0:case 11:case 15:Yh(o),o.flags&2048&&rl(9,o,o.return);break;case 3:Yh(o);break;case 12:Yh(o);break;case 22:var c=o.stateNode;o.memoizedState!==null&&c._visibility&2&&(o.return===null||o.return.tag!==13)?(c._visibility&=-3,Sv(o)):Yh(o);break;default:Yh(o)}}function Sv(o){var c=o.deletions;if((o.flags&16)!==0){if(c!==null)for(var m=0;m<c.length;m++){var y=c[m];jr=y,d2(y,o)}c2(o)}for(o=o.child;o!==null;){switch(c=o,c.tag){case 0:case 11:case 15:rl(8,c,c.return),Sv(c);break;case 22:m=c.stateNode,m._visibility&2&&(m._visibility&=-3,Sv(c));break;default:Sv(c)}o=o.sibling}}function d2(o,c){for(;jr!==null;){var m=jr;switch(m.tag){case 0:case 11:case 15:rl(8,m,c);break;case 23:case 22:if(m.memoizedState!==null&&m.memoizedState.cachePool!==null){var y=m.memoizedState.cachePool.pool;y!=null&&y.refCount++}break;case 24:Rh(m.memoizedState.cache)}if(y=m.child,y!==null)y.return=m,jr=y;else e:for(m=o;jr!==null;){y=jr;var _=y.sibling,C=y.return;if(n2(y),y===m){jr=null;break e}if(_!==null){_.return=C,jr=_;break e}jr=C}}}var tK={getCacheForType:function(o){var c=Jr(_r),m=c.data.get(o);return m===void 0&&(m=o(),c.data.set(o,m)),m}},nK=typeof WeakMap=="function"?WeakMap:Map,cn=0,wn=null,Bt=null,Jt=0,un=0,Hs=null,al=!1,ad=!1,Rw=!1,uo=0,Wn=0,ol=0,jc=0,jw=0,pi=0,od=0,Kh=null,Ss=null,Mw=!1,Ow=0,Ev=1/0,kv=null,ll=null,Br=0,cl=null,ld=null,cd=0,Pw=0,Iw=null,f2=null,Xh=0,Dw=null;function Gs(){if((cn&2)!==0&&Jt!==0)return Jt&-Jt;if(F.T!==null){var o=Xu;return o!==0?o:qw()}return $i()}function h2(){pi===0&&(pi=(Jt&536870912)===0||on?br():536870912);var o=hi.current;return o!==null&&(o.flags|=32),pi}function Ws(o,c,m){(o===wn&&(un===2||un===9)||o.cancelPendingCommit!==null)&&(ud(o,0),ul(o,Jt,pi,!1)),fa(o,m),((cn&2)===0||o!==wn)&&(o===wn&&((cn&2)===0&&(jc|=m),Wn===4&&ul(o,Jt,pi,!1)),ya(o))}function p2(o,c,m){if((cn&6)!==0)throw Error(r(327));var y=!m&&(c&124)===0&&(c&o.expiredLanes)===0||Qt(o,c),_=y?iK(o,c):zw(o,c,!0),C=y;do{if(_===0){ad&&!y&&ul(o,c,0,!1);break}else{if(m=o.current.alternate,C&&!rK(m)){_=zw(o,c,!1),C=!1;continue}if(_===2){if(C=c,o.errorRecoveryDisabledLanes&C)var $=0;else $=o.pendingLanes&-536870913,$=$!==0?$:$&536870912?536870912:0;if($!==0){c=$;e:{var q=o;_=Kh;var ee=q.current.memoizedState.isDehydrated;if(ee&&(ud(q,$).flags|=256),$=zw(q,$,!1),$!==2){if(Rw&&!ee){q.errorRecoveryDisabledLanes|=C,jc|=C,_=4;break e}C=Ss,Ss=_,C!==null&&(Ss===null?Ss=C:Ss.push.apply(Ss,C))}_=$}if(C=!1,_!==2)continue}}if(_===1){ud(o,0),ul(o,c,0,!0);break}e:{switch(y=o,C=_,C){case 0:case 1:throw Error(r(345));case 4:if((c&4194048)!==c)break;case 6:ul(y,c,pi,!al);break e;case 2:Ss=null;break;case 3:case 5:break;default:throw Error(r(329))}if((c&62914560)===c&&(_=Ow+300-Ne(),10<_)){if(ul(y,c,pi,!al),vt(y,0,!0)!==0)break e;y.timeoutHandle=q2(m2.bind(null,y,m,Ss,kv,Mw,c,pi,jc,od,al,C,2,-0,0),_);break e}m2(y,m,Ss,kv,Mw,c,pi,jc,od,al,C,0,-0,0)}}break}while(!0);ya(o)}function m2(o,c,m,y,_,C,$,q,ee,de,we,ke,pe,ge){if(o.timeoutHandle=-1,ke=c.subtreeFlags,(ke&8192||(ke&16785408)===16785408)&&(rp={stylesheets:null,count:0,unsuspend:$K},l2(c),ke=FK(),ke!==null)){o.cancelPendingCommit=ke(w2.bind(null,o,c,C,m,y,_,$,q,ee,we,1,pe,ge)),ul(o,C,$,!de);return}w2(o,c,C,m,y,_,$,q,ee)}function rK(o){for(var c=o;;){var m=c.tag;if((m===0||m===11||m===15)&&c.flags&16384&&(m=c.updateQueue,m!==null&&(m=m.stores,m!==null)))for(var y=0;y<m.length;y++){var _=m[y],C=_.getSnapshot;_=_.value;try{if(!Us(C(),_))return!1}catch{return!1}}if(m=c.child,c.subtreeFlags&16384&&m!==null)m.return=c,c=m;else{if(c===o)break;for(;c.sibling===null;){if(c.return===null||c.return===o)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function ul(o,c,m,y){c&=~jw,c&=~jc,o.suspendedLanes|=c,o.pingedLanes&=~c,y&&(o.warmLanes|=c),y=o.expirationTimes;for(var _=c;0<_;){var C=31-qe(_),$=1<<C;y[C]=-1,_&=~$}m!==0&&ft(o,m,c)}function Tv(){return(cn&6)===0?(Qh(0),!1):!0}function Lw(){if(Bt!==null){if(un===0)var o=Bt.return;else o=Bt,no=kc=null,ew(o),nd=null,Uh=0,o=Bt;for(;o!==null;)YO(o.alternate,o),o=o.return;Bt=null}}function ud(o,c){var m=o.timeoutHandle;m!==-1&&(o.timeoutHandle=-1,_K(m)),m=o.cancelPendingCommit,m!==null&&(o.cancelPendingCommit=null,m()),Lw(),wn=o,Bt=m=Za(o.current,null),Jt=c,un=0,Hs=null,al=!1,ad=Qt(o,c),Rw=!1,od=pi=jw=jc=ol=Wn=0,Ss=Kh=null,Mw=!1,(c&8)!==0&&(c|=c&32);var y=o.entangledLanes;if(y!==0)for(o=o.entanglements,y&=c;0<y;){var _=31-qe(y),C=1<<_;c|=o[_],y&=~C}return uo=c,Yg(),m}function g2(o,c){$t=null,F.H=hv,c===Mh||c===rv?(c=OM(),un=3):c===RM?(c=OM(),un=4):un=c===PO?8:c!==null&&typeof c=="object"&&typeof c.then=="function"?6:1,Hs=c,Bt===null&&(Wn=1,yv(o,ci(c,o.current)))}function v2(){var o=F.H;return F.H=hv,o===null?hv:o}function y2(){var o=F.A;return F.A=tK,o}function $w(){Wn=4,al||(Jt&4194048)!==Jt&&hi.current!==null||(ad=!0),(ol&134217727)===0&&(jc&134217727)===0||wn===null||ul(wn,Jt,pi,!1)}function zw(o,c,m){var y=cn;cn|=2;var _=v2(),C=y2();(wn!==o||Jt!==c)&&(kv=null,ud(o,c)),c=!1;var $=Wn;e:do try{if(un!==0&&Bt!==null){var q=Bt,ee=Hs;switch(un){case 8:Lw(),$=6;break e;case 3:case 2:case 9:case 6:hi.current===null&&(c=!0);var de=un;if(un=0,Hs=null,dd(o,q,ee,de),m&&ad){$=0;break e}break;default:de=un,un=0,Hs=null,dd(o,q,ee,de)}}sK(),$=Wn;break}catch(we){g2(o,we)}while(!0);return c&&o.shellSuspendCounter++,no=kc=null,cn=y,F.H=_,F.A=C,Bt===null&&(wn=null,Jt=0,Yg()),$}function sK(){for(;Bt!==null;)b2(Bt)}function iK(o,c){var m=cn;cn|=2;var y=v2(),_=y2();wn!==o||Jt!==c?(kv=null,Ev=Ne()+500,ud(o,c)):ad=Qt(o,c);e:do try{if(un!==0&&Bt!==null){c=Bt;var C=Hs;t:switch(un){case 1:un=0,Hs=null,dd(o,c,C,1);break;case 2:case 9:if(jM(C)){un=0,Hs=null,x2(c);break}c=function(){un!==2&&un!==9||wn!==o||(un=7),ya(o)},C.then(c,c);break e;case 3:un=7;break e;case 4:un=5;break e;case 7:jM(C)?(un=0,Hs=null,x2(c)):(un=0,Hs=null,dd(o,c,C,7));break;case 5:var $=null;switch(Bt.tag){case 26:$=Bt.memoizedState;case 5:case 27:var q=Bt;if(!$||tP($)){un=0,Hs=null;var ee=q.sibling;if(ee!==null)Bt=ee;else{var de=q.return;de!==null?(Bt=de,Cv(de)):Bt=null}break t}}un=0,Hs=null,dd(o,c,C,5);break;case 6:un=0,Hs=null,dd(o,c,C,6);break;case 8:Lw(),Wn=6;break e;default:throw Error(r(462))}}aK();break}catch(we){g2(o,we)}while(!0);return no=kc=null,F.H=y,F.A=_,cn=m,Bt!==null?0:(wn=null,Jt=0,Yg(),Wn)}function aK(){for(;Bt!==null&&!Ae();)b2(Bt)}function b2(o){var c=GO(o.alternate,o,uo);o.memoizedProps=o.pendingProps,c===null?Cv(o):Bt=c}function x2(o){var c=o,m=c.alternate;switch(c.tag){case 15:case 0:c=FO(m,c,c.pendingProps,c.type,void 0,Jt);break;case 11:c=FO(m,c,c.pendingProps,c.type.render,c.ref,Jt);break;case 5:ew(c);default:YO(m,c),c=Bt=_M(c,uo),c=GO(m,c,uo)}o.memoizedProps=o.pendingProps,c===null?Cv(o):Bt=c}function dd(o,c,m,y){no=kc=null,ew(c),nd=null,Uh=0;var _=c.return;try{if(KY(o,_,c,m,Jt)){Wn=1,yv(o,ci(m,o.current)),Bt=null;return}}catch(C){if(_!==null)throw Bt=_,C;Wn=1,yv(o,ci(m,o.current)),Bt=null;return}c.flags&32768?(on||y===1?o=!0:ad||(Jt&536870912)!==0?o=!1:(al=o=!0,(y===2||y===9||y===3||y===6)&&(y=hi.current,y!==null&&y.tag===13&&(y.flags|=16384))),_2(c,o)):Cv(c)}function Cv(o){var c=o;do{if((c.flags&32768)!==0){_2(c,al);return}o=c.return;var m=QY(c.alternate,c,uo);if(m!==null){Bt=m;return}if(c=c.sibling,c!==null){Bt=c;return}Bt=c=o}while(c!==null);Wn===0&&(Wn=5)}function _2(o,c){do{var m=JY(o.alternate,o);if(m!==null){m.flags&=32767,Bt=m;return}if(m=o.return,m!==null&&(m.flags|=32768,m.subtreeFlags=0,m.deletions=null),!c&&(o=o.sibling,o!==null)){Bt=o;return}Bt=o=m}while(o!==null);Wn=6,Bt=null}function w2(o,c,m,y,_,C,$,q,ee){o.cancelPendingCommit=null;do Av();while(Br!==0);if((cn&6)!==0)throw Error(r(327));if(c!==null){if(c===o.current)throw Error(r(177));if(C=c.lanes|c.childLanes,C|=N_,Du(o,m,C,$,q,ee),o===wn&&(Bt=wn=null,Jt=0),ld=c,cl=o,cd=m,Pw=C,Iw=_,f2=y,(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,uK(pt,function(){return C2(),null})):(o.callbackNode=null,o.callbackPriority=0),y=(c.flags&13878)!==0,(c.subtreeFlags&13878)!==0||y){y=F.T,F.T=null,_=Y.p,Y.p=2,$=cn,cn|=4;try{ZY(o,c,m)}finally{cn=$,Y.p=_,F.T=y}}Br=1,S2(),E2(),k2()}}function S2(){if(Br===1){Br=0;var o=cl,c=ld,m=(c.flags&13878)!==0;if((c.subtreeFlags&13878)!==0||m){m=F.T,F.T=null;var y=Y.p;Y.p=2;var _=cn;cn|=4;try{i2(c,o);var C=Qw,$=dM(o.containerInfo),q=C.focusedElem,ee=C.selectionRange;if($!==q&&q&&q.ownerDocument&&uM(q.ownerDocument.documentElement,q)){if(ee!==null&&E_(q)){var de=ee.start,we=ee.end;if(we===void 0&&(we=de),"selectionStart"in q)q.selectionStart=de,q.selectionEnd=Math.min(we,q.value.length);else{var ke=q.ownerDocument||document,pe=ke&&ke.defaultView||window;if(pe.getSelection){var ge=pe.getSelection(),xt=q.textContent.length,ht=Math.min(ee.start,xt),gn=ee.end===void 0?ht:Math.min(ee.end,xt);!ge.extend&&ht>gn&&($=gn,gn=ht,ht=$);var le=cM(q,ht),ie=cM(q,gn);if(le&&ie&&(ge.rangeCount!==1||ge.anchorNode!==le.node||ge.anchorOffset!==le.offset||ge.focusNode!==ie.node||ge.focusOffset!==ie.offset)){var ce=ke.createRange();ce.setStart(le.node,le.offset),ge.removeAllRanges(),ht>gn?(ge.addRange(ce),ge.extend(ie.node,ie.offset)):(ce.setEnd(ie.node,ie.offset),ge.addRange(ce))}}}}for(ke=[],ge=q;ge=ge.parentNode;)ge.nodeType===1&&ke.push({element:ge,left:ge.scrollLeft,top:ge.scrollTop});for(typeof q.focus=="function"&&q.focus(),q=0;q<ke.length;q++){var Se=ke[q];Se.element.scrollLeft=Se.left,Se.element.scrollTop=Se.top}}Fv=!!Xw,Qw=Xw=null}finally{cn=_,Y.p=y,F.T=m}}o.current=c,Br=2}}function E2(){if(Br===2){Br=0;var o=cl,c=ld,m=(c.flags&8772)!==0;if((c.subtreeFlags&8772)!==0||m){m=F.T,F.T=null;var y=Y.p;Y.p=2;var _=cn;cn|=4;try{t2(o,c.alternate,c)}finally{cn=_,Y.p=y,F.T=m}}Br=3}}function k2(){if(Br===4||Br===3){Br=0,Oe();var o=cl,c=ld,m=cd,y=f2;(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?Br=5:(Br=0,ld=cl=null,T2(o,o.pendingLanes));var _=o.pendingLanes;if(_===0&&(ll=null),xr(m),c=c.stateNode,Te&&typeof Te.onCommitFiberRoot=="function")try{Te.onCommitFiberRoot(xe,c,void 0,(c.current.flags&128)===128)}catch{}if(y!==null){c=F.T,_=Y.p,Y.p=2,F.T=null;try{for(var C=o.onRecoverableError,$=0;$<y.length;$++){var q=y[$];C(q.value,{componentStack:q.stack})}}finally{F.T=c,Y.p=_}}(cd&3)!==0&&Av(),ya(o),_=o.pendingLanes,(m&4194090)!==0&&(_&42)!==0?o===Dw?Xh++:(Xh=0,Dw=o):Xh=0,Qh(0)}}function T2(o,c){(o.pooledCacheLanes&=c)===0&&(c=o.pooledCache,c!=null&&(o.pooledCache=null,Rh(c)))}function Av(o){return S2(),E2(),k2(),C2()}function C2(){if(Br!==5)return!1;var o=cl,c=Pw;Pw=0;var m=xr(cd),y=F.T,_=Y.p;try{Y.p=32>m?32:m,F.T=null,m=Iw,Iw=null;var C=cl,$=cd;if(Br=0,ld=cl=null,cd=0,(cn&6)!==0)throw Error(r(331));var q=cn;if(cn|=4,u2(C.current),o2(C,C.current,$,m),cn=q,Qh(0,!1),Te&&typeof Te.onPostCommitFiberRoot=="function")try{Te.onPostCommitFiberRoot(xe,C)}catch{}return!0}finally{Y.p=_,F.T=y,T2(o,c)}}function A2(o,c,m){c=ci(m,c),c=pw(o.stateNode,c,2),o=Zo(o,c,2),o!==null&&(fa(o,2),ya(o))}function bn(o,c,m){if(o.tag===3)A2(o,o,m);else for(;c!==null;){if(c.tag===3){A2(c,o,m);break}else if(c.tag===1){var y=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(ll===null||!ll.has(y))){o=ci(m,o),m=MO(2),y=Zo(c,m,2),y!==null&&(OO(m,y,c,o),fa(y,2),ya(y));break}}c=c.return}}function Fw(o,c,m){var y=o.pingCache;if(y===null){y=o.pingCache=new nK;var _=new Set;y.set(c,_)}else _=y.get(c),_===void 0&&(_=new Set,y.set(c,_));_.has(m)||(Rw=!0,_.add(m),o=oK.bind(null,o,c,m),c.then(o,o))}function oK(o,c,m){var y=o.pingCache;y!==null&&y.delete(c),o.pingedLanes|=o.suspendedLanes&m,o.warmLanes&=~m,wn===o&&(Jt&m)===m&&(Wn===4||Wn===3&&(Jt&62914560)===Jt&&300>Ne()-Ow?(cn&2)===0&&ud(o,0):jw|=m,od===Jt&&(od=0)),ya(o)}function N2(o,c){c===0&&(c=Yo()),o=Gu(o,c),o!==null&&(fa(o,c),ya(o))}function lK(o){var c=o.memoizedState,m=0;c!==null&&(m=c.retryLane),N2(o,m)}function cK(o,c){var m=0;switch(o.tag){case 13:var y=o.stateNode,_=o.memoizedState;_!==null&&(m=_.retryLane);break;case 19:y=o.stateNode;break;case 22:y=o.stateNode._retryCache;break;default:throw Error(r(314))}y!==null&&y.delete(c),N2(o,m)}function uK(o,c){return fe(o,c)}var Nv=null,fd=null,Uw=!1,Rv=!1,Bw=!1,Mc=0;function ya(o){o!==fd&&o.next===null&&(fd===null?Nv=fd=o:fd=fd.next=o),Rv=!0,Uw||(Uw=!0,fK())}function Qh(o,c){if(!Bw&&Rv){Bw=!0;do for(var m=!1,y=Nv;y!==null;){if(o!==0){var _=y.pendingLanes;if(_===0)var C=0;else{var $=y.suspendedLanes,q=y.pingedLanes;C=(1<<31-qe(42|o)+1)-1,C&=_&~($&~q),C=C&201326741?C&201326741|1:C?C|2:0}C!==0&&(m=!0,O2(y,C))}else C=Jt,C=vt(y,y===wn?C:0,y.cancelPendingCommit!==null||y.timeoutHandle!==-1),(C&3)===0||Qt(y,C)||(m=!0,O2(y,C));y=y.next}while(m);Bw=!1}}function dK(){R2()}function R2(){Rv=Uw=!1;var o=0;Mc!==0&&(xK()&&(o=Mc),Mc=0);for(var c=Ne(),m=null,y=Nv;y!==null;){var _=y.next,C=j2(y,c);C===0?(y.next=null,m===null?Nv=_:m.next=_,_===null&&(fd=m)):(m=y,(o!==0||(C&3)!==0)&&(Rv=!0)),y=_}Qh(o)}function j2(o,c){for(var m=o.suspendedLanes,y=o.pingedLanes,_=o.expirationTimes,C=o.pendingLanes&-62914561;0<C;){var $=31-qe(C),q=1<<$,ee=_[$];ee===-1?((q&m)===0||(q&y)!==0)&&(_[$]=cr(q,c)):ee<=c&&(o.expiredLanes|=q),C&=~q}if(c=wn,m=Jt,m=vt(o,o===c?m:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),y=o.callbackNode,m===0||o===c&&(un===2||un===9)||o.cancelPendingCommit!==null)return y!==null&&y!==null&&be(y),o.callbackNode=null,o.callbackPriority=0;if((m&3)===0||Qt(o,m)){if(c=m&-m,c===o.callbackPriority)return c;switch(y!==null&&be(y),xr(m)){case 2:case 8:m=Be;break;case 32:m=pt;break;case 268435456:m=et;break;default:m=pt}return y=M2.bind(null,o),m=fe(m,y),o.callbackPriority=c,o.callbackNode=m,c}return y!==null&&y!==null&&be(y),o.callbackPriority=2,o.callbackNode=null,2}function M2(o,c){if(Br!==0&&Br!==5)return o.callbackNode=null,o.callbackPriority=0,null;var m=o.callbackNode;if(Av()&&o.callbackNode!==m)return null;var y=Jt;return y=vt(o,o===wn?y:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),y===0?null:(p2(o,y,c),j2(o,Ne()),o.callbackNode!=null&&o.callbackNode===m?M2.bind(null,o):null)}function O2(o,c){if(Av())return null;p2(o,c,!0)}function fK(){wK(function(){(cn&6)!==0?fe(dt,dK):R2()})}function qw(){return Mc===0&&(Mc=br()),Mc}function P2(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:Ug(""+o)}function I2(o,c){var m=c.ownerDocument.createElement("input");return m.name=c.name,m.value=c.value,o.id&&m.setAttribute("form",o.id),c.parentNode.insertBefore(m,c),o=new FormData(o),m.parentNode.removeChild(m),o}function hK(o,c,m,y,_){if(c==="submit"&&m&&m.stateNode===_){var C=P2((_[fn]||null).action),$=y.submitter;$&&(c=(c=$[fn]||null)?P2(c.formAction):$.getAttribute("formAction"),c!==null&&(C=c,$=null));var q=new Hg("action","action",null,y,_);o.push({event:q,listeners:[{instance:null,listener:function(){if(y.defaultPrevented){if(Mc!==0){var ee=$?I2(_,$):new FormData(_);cw(m,{pending:!0,data:ee,method:_.method,action:C},null,ee)}}else typeof C=="function"&&(q.preventDefault(),ee=$?I2(_,$):new FormData(_),cw(m,{pending:!0,data:ee,method:_.method,action:C},C,ee))},currentTarget:_}]})}}for(var Vw=0;Vw<A_.length;Vw++){var Hw=A_[Vw],pK=Hw.toLowerCase(),mK=Hw[0].toUpperCase()+Hw.slice(1);Ui(pK,"on"+mK)}Ui(pM,"onAnimationEnd"),Ui(mM,"onAnimationIteration"),Ui(gM,"onAnimationStart"),Ui("dblclick","onDoubleClick"),Ui("focusin","onFocus"),Ui("focusout","onBlur"),Ui(MY,"onTransitionRun"),Ui(OY,"onTransitionStart"),Ui(PY,"onTransitionCancel"),Ui(vM,"onTransitionEnd"),an("onMouseEnter",["mouseout","mouseover"]),an("onMouseLeave",["mouseout","mouseover"]),an("onPointerEnter",["pointerout","pointerover"]),an("onPointerLeave",["pointerout","pointerover"]),lt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),lt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),lt("onBeforeInput",["compositionend","keypress","textInput","paste"]),lt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),lt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),lt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Jh="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(" "),gK=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Jh));function D2(o,c){c=(c&4)!==0;for(var m=0;m<o.length;m++){var y=o[m],_=y.event;y=y.listeners;e:{var C=void 0;if(c)for(var $=y.length-1;0<=$;$--){var q=y[$],ee=q.instance,de=q.currentTarget;if(q=q.listener,ee!==C&&_.isPropagationStopped())break e;C=q,_.currentTarget=de;try{C(_)}catch(we){vv(we)}_.currentTarget=null,C=ee}else for($=0;$<y.length;$++){if(q=y[$],ee=q.instance,de=q.currentTarget,q=q.listener,ee!==C&&_.isPropagationStopped())break e;C=q,_.currentTarget=de;try{C(_)}catch(we){vv(we)}_.currentTarget=null,C=ee}}}}function qt(o,c){var m=c[ne];m===void 0&&(m=c[ne]=new Set);var y=o+"__bubble";m.has(y)||(L2(c,o,2,!1),m.add(y))}function Gw(o,c,m){var y=0;c&&(y|=4),L2(m,o,y,c)}var jv="_reactListening"+Math.random().toString(36).slice(2);function Ww(o){if(!o[jv]){o[jv]=!0,ln.forEach(function(m){m!=="selectionchange"&&(gK.has(m)||Gw(m,!1,o),Gw(m,!0,o))});var c=o.nodeType===9?o:o.ownerDocument;c===null||c[jv]||(c[jv]=!0,Gw("selectionchange",!1,c))}}function L2(o,c,m,y){switch(oP(c)){case 2:var _=qK;break;case 8:_=VK;break;default:_=oS}m=_.bind(null,c,m,o),_=void 0,!m_||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(_=!0),y?_!==void 0?o.addEventListener(c,m,{capture:!0,passive:_}):o.addEventListener(c,m,!0):_!==void 0?o.addEventListener(c,m,{passive:_}):o.addEventListener(c,m,!1)}function Yw(o,c,m,y,_){var C=y;if((c&1)===0&&(c&2)===0&&y!==null)e:for(;;){if(y===null)return;var $=y.tag;if($===3||$===4){var q=y.stateNode.containerInfo;if(q===_)break;if($===4)for($=y.return;$!==null;){var ee=$.tag;if((ee===3||ee===4)&&$.stateNode.containerInfo===_)return;$=$.return}for(;q!==null;){if($=tt(q),$===null)return;if(ee=$.tag,ee===5||ee===6||ee===26||ee===27){y=C=$;continue e}q=q.parentNode}}y=y.return}Vj(function(){var de=C,we=h_(m),ke=[];e:{var pe=yM.get(o);if(pe!==void 0){var ge=Hg,xt=o;switch(o){case"keypress":if(qg(m)===0)break e;case"keydown":case"keyup":ge=uY;break;case"focusin":xt="focus",ge=b_;break;case"focusout":xt="blur",ge=b_;break;case"beforeblur":case"afterblur":ge=b_;break;case"click":if(m.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ge=Wj;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ge=JW;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ge=hY;break;case pM:case mM:case gM:ge=tY;break;case vM:ge=mY;break;case"scroll":case"scrollend":ge=XW;break;case"wheel":ge=vY;break;case"copy":case"cut":case"paste":ge=rY;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ge=Kj;break;case"toggle":case"beforetoggle":ge=bY}var ht=(c&4)!==0,gn=!ht&&(o==="scroll"||o==="scrollend"),le=ht?pe!==null?pe+"Capture":null:pe;ht=[];for(var ie=de,ce;ie!==null;){var Se=ie;if(ce=Se.stateNode,Se=Se.tag,Se!==5&&Se!==26&&Se!==27||ce===null||le===null||(Se=vh(ie,le),Se!=null&&ht.push(Zh(ie,Se,ce))),gn)break;ie=ie.return}0<ht.length&&(pe=new ge(pe,xt,null,m,we),ke.push({event:pe,listeners:ht}))}}if((c&7)===0){e:{if(pe=o==="mouseover"||o==="pointerover",ge=o==="mouseout"||o==="pointerout",pe&&m!==f_&&(xt=m.relatedTarget||m.fromElement)&&(tt(xt)||xt[er]))break e;if((ge||pe)&&(pe=we.window===we?we:(pe=we.ownerDocument)?pe.defaultView||pe.parentWindow:window,ge?(xt=m.relatedTarget||m.toElement,ge=de,xt=xt?tt(xt):null,xt!==null&&(gn=i(xt),ht=xt.tag,xt!==gn||ht!==5&&ht!==27&&ht!==6)&&(xt=null)):(ge=null,xt=de),ge!==xt)){if(ht=Wj,Se="onMouseLeave",le="onMouseEnter",ie="mouse",(o==="pointerout"||o==="pointerover")&&(ht=Kj,Se="onPointerLeave",le="onPointerEnter",ie="pointer"),gn=ge==null?pe:sn(ge),ce=xt==null?pe:sn(xt),pe=new ht(Se,ie+"leave",ge,m,we),pe.target=gn,pe.relatedTarget=ce,Se=null,tt(we)===de&&(ht=new ht(le,ie+"enter",xt,m,we),ht.target=ce,ht.relatedTarget=gn,Se=ht),gn=Se,ge&&xt)t:{for(ht=ge,le=xt,ie=0,ce=ht;ce;ce=hd(ce))ie++;for(ce=0,Se=le;Se;Se=hd(Se))ce++;for(;0<ie-ce;)ht=hd(ht),ie--;for(;0<ce-ie;)le=hd(le),ce--;for(;ie--;){if(ht===le||le!==null&&ht===le.alternate)break t;ht=hd(ht),le=hd(le)}ht=null}else ht=null;ge!==null&&$2(ke,pe,ge,ht,!1),xt!==null&&gn!==null&&$2(ke,gn,xt,ht,!0)}}e:{if(pe=de?sn(de):window,ge=pe.nodeName&&pe.nodeName.toLowerCase(),ge==="select"||ge==="input"&&pe.type==="file")var Ye=rM;else if(tM(pe))if(sM)Ye=NY;else{Ye=CY;var Ut=TY}else ge=pe.nodeName,!ge||ge.toLowerCase()!=="input"||pe.type!=="checkbox"&&pe.type!=="radio"?de&&d_(de.elementType)&&(Ye=rM):Ye=AY;if(Ye&&(Ye=Ye(o,de))){nM(ke,Ye,m,we);break e}Ut&&Ut(o,pe,de),o==="focusout"&&de&&pe.type==="number"&&de.memoizedProps.value!=null&&u_(pe,"number",pe.value)}switch(Ut=de?sn(de):window,o){case"focusin":(tM(Ut)||Ut.contentEditable==="true")&&(qu=Ut,k_=de,kh=null);break;case"focusout":kh=k_=qu=null;break;case"mousedown":T_=!0;break;case"contextmenu":case"mouseup":case"dragend":T_=!1,fM(ke,m,we);break;case"selectionchange":if(jY)break;case"keydown":case"keyup":fM(ke,m,we)}var it;if(__)e:{switch(o){case"compositionstart":var mt="onCompositionStart";break e;case"compositionend":mt="onCompositionEnd";break e;case"compositionupdate":mt="onCompositionUpdate";break e}mt=void 0}else Bu?Zj(o,m)&&(mt="onCompositionEnd"):o==="keydown"&&m.keyCode===229&&(mt="onCompositionStart");mt&&(Xj&&m.locale!=="ko"&&(Bu||mt!=="onCompositionStart"?mt==="onCompositionEnd"&&Bu&&(it=Hj()):(Ko=we,g_="value"in Ko?Ko.value:Ko.textContent,Bu=!0)),Ut=Mv(de,mt),0<Ut.length&&(mt=new Yj(mt,o,null,m,we),ke.push({event:mt,listeners:Ut}),it?mt.data=it:(it=eM(m),it!==null&&(mt.data=it)))),(it=_Y?wY(o,m):SY(o,m))&&(mt=Mv(de,"onBeforeInput"),0<mt.length&&(Ut=new Yj("onBeforeInput","beforeinput",null,m,we),ke.push({event:Ut,listeners:mt}),Ut.data=it)),hK(ke,o,de,m,we)}D2(ke,c)})}function Zh(o,c,m){return{instance:o,listener:c,currentTarget:m}}function Mv(o,c){for(var m=c+"Capture",y=[];o!==null;){var _=o,C=_.stateNode;if(_=_.tag,_!==5&&_!==26&&_!==27||C===null||(_=vh(o,m),_!=null&&y.unshift(Zh(o,_,C)),_=vh(o,c),_!=null&&y.push(Zh(o,_,C))),o.tag===3)return y;o=o.return}return[]}function hd(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function $2(o,c,m,y,_){for(var C=c._reactName,$=[];m!==null&&m!==y;){var q=m,ee=q.alternate,de=q.stateNode;if(q=q.tag,ee!==null&&ee===y)break;q!==5&&q!==26&&q!==27||de===null||(ee=de,_?(de=vh(m,C),de!=null&&$.unshift(Zh(m,de,ee))):_||(de=vh(m,C),de!=null&&$.push(Zh(m,de,ee)))),m=m.return}$.length!==0&&o.push({event:c,listeners:$})}var vK=/\r\n?/g,yK=/\u0000|\uFFFD/g;function z2(o){return(typeof o=="string"?o:""+o).replace(vK,`
|
|
49
|
+
`).replace(yK,"")}function F2(o,c){return c=z2(c),z2(o)===c}function Ov(){}function mn(o,c,m,y,_,C){switch(m){case"children":typeof y=="string"?c==="body"||c==="textarea"&&y===""||zu(o,y):(typeof y=="number"||typeof y=="bigint")&&c!=="body"&&zu(o,""+y);break;case"className":Fi(o,"class",y);break;case"tabIndex":Fi(o,"tabindex",y);break;case"dir":case"role":case"viewBox":case"width":case"height":Fi(o,m,y);break;case"style":Bj(o,y,C);break;case"data":if(c!=="object"){Fi(o,"data",y);break}case"src":case"href":if(y===""&&(c!=="a"||m!=="href")){o.removeAttribute(m);break}if(y==null||typeof y=="function"||typeof y=="symbol"||typeof y=="boolean"){o.removeAttribute(m);break}y=Ug(""+y),o.setAttribute(m,y);break;case"action":case"formAction":if(typeof y=="function"){o.setAttribute(m,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof C=="function"&&(m==="formAction"?(c!=="input"&&mn(o,c,"name",_.name,_,null),mn(o,c,"formEncType",_.formEncType,_,null),mn(o,c,"formMethod",_.formMethod,_,null),mn(o,c,"formTarget",_.formTarget,_,null)):(mn(o,c,"encType",_.encType,_,null),mn(o,c,"method",_.method,_,null),mn(o,c,"target",_.target,_,null)));if(y==null||typeof y=="symbol"||typeof y=="boolean"){o.removeAttribute(m);break}y=Ug(""+y),o.setAttribute(m,y);break;case"onClick":y!=null&&(o.onclick=Ov);break;case"onScroll":y!=null&&qt("scroll",o);break;case"onScrollEnd":y!=null&&qt("scrollend",o);break;case"dangerouslySetInnerHTML":if(y!=null){if(typeof y!="object"||!("__html"in y))throw Error(r(61));if(m=y.__html,m!=null){if(_.children!=null)throw Error(r(60));o.innerHTML=m}}break;case"multiple":o.multiple=y&&typeof y!="function"&&typeof y!="symbol";break;case"muted":o.muted=y&&typeof y!="function"&&typeof y!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(y==null||typeof y=="function"||typeof y=="boolean"||typeof y=="symbol"){o.removeAttribute("xlink:href");break}m=Ug(""+y),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",m);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":y!=null&&typeof y!="function"&&typeof y!="symbol"?o.setAttribute(m,""+y):o.removeAttribute(m);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":y&&typeof y!="function"&&typeof y!="symbol"?o.setAttribute(m,""):o.removeAttribute(m);break;case"capture":case"download":y===!0?o.setAttribute(m,""):y!==!1&&y!=null&&typeof y!="function"&&typeof y!="symbol"?o.setAttribute(m,y):o.removeAttribute(m);break;case"cols":case"rows":case"size":case"span":y!=null&&typeof y!="function"&&typeof y!="symbol"&&!isNaN(y)&&1<=y?o.setAttribute(m,y):o.removeAttribute(m);break;case"rowSpan":case"start":y==null||typeof y=="function"||typeof y=="symbol"||isNaN(y)?o.removeAttribute(m):o.setAttribute(m,y);break;case"popover":qt("beforetoggle",o),qt("toggle",o),as(o,"popover",y);break;case"xlinkActuate":zr(o,"http://www.w3.org/1999/xlink","xlink:actuate",y);break;case"xlinkArcrole":zr(o,"http://www.w3.org/1999/xlink","xlink:arcrole",y);break;case"xlinkRole":zr(o,"http://www.w3.org/1999/xlink","xlink:role",y);break;case"xlinkShow":zr(o,"http://www.w3.org/1999/xlink","xlink:show",y);break;case"xlinkTitle":zr(o,"http://www.w3.org/1999/xlink","xlink:title",y);break;case"xlinkType":zr(o,"http://www.w3.org/1999/xlink","xlink:type",y);break;case"xmlBase":zr(o,"http://www.w3.org/XML/1998/namespace","xml:base",y);break;case"xmlLang":zr(o,"http://www.w3.org/XML/1998/namespace","xml:lang",y);break;case"xmlSpace":zr(o,"http://www.w3.org/XML/1998/namespace","xml:space",y);break;case"is":as(o,"is",y);break;case"innerText":case"textContent":break;default:(!(2<m.length)||m[0]!=="o"&&m[0]!=="O"||m[1]!=="n"&&m[1]!=="N")&&(m=YW.get(m)||m,as(o,m,y))}}function Kw(o,c,m,y,_,C){switch(m){case"style":Bj(o,y,C);break;case"dangerouslySetInnerHTML":if(y!=null){if(typeof y!="object"||!("__html"in y))throw Error(r(61));if(m=y.__html,m!=null){if(_.children!=null)throw Error(r(60));o.innerHTML=m}}break;case"children":typeof y=="string"?zu(o,y):(typeof y=="number"||typeof y=="bigint")&&zu(o,""+y);break;case"onScroll":y!=null&&qt("scroll",o);break;case"onScrollEnd":y!=null&&qt("scrollend",o);break;case"onClick":y!=null&&(o.onclick=Ov);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!jn.hasOwnProperty(m))e:{if(m[0]==="o"&&m[1]==="n"&&(_=m.endsWith("Capture"),c=m.slice(2,_?m.length-7:void 0),C=o[fn]||null,C=C!=null?C[m]:null,typeof C=="function"&&o.removeEventListener(c,C,_),typeof y=="function")){typeof C!="function"&&C!==null&&(m in o?o[m]=null:o.hasAttribute(m)&&o.removeAttribute(m)),o.addEventListener(c,y,_);break e}m in o?o[m]=y:y===!0?o.setAttribute(m,""):as(o,m,y)}}}function qr(o,c,m){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":qt("error",o),qt("load",o);var y=!1,_=!1,C;for(C in m)if(m.hasOwnProperty(C)){var $=m[C];if($!=null)switch(C){case"src":y=!0;break;case"srcSet":_=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:mn(o,c,C,$,m,null)}}_&&mn(o,c,"srcSet",m.srcSet,m,null),y&&mn(o,c,"src",m.src,m,null);return;case"input":qt("invalid",o);var q=C=$=_=null,ee=null,de=null;for(y in m)if(m.hasOwnProperty(y)){var we=m[y];if(we!=null)switch(y){case"name":_=we;break;case"type":$=we;break;case"checked":ee=we;break;case"defaultChecked":de=we;break;case"value":C=we;break;case"defaultValue":q=we;break;case"children":case"dangerouslySetInnerHTML":if(we!=null)throw Error(r(137,c));break;default:mn(o,c,y,we,m,null)}}$j(o,C,q,ee,de,$,_,!1),gc(o);return;case"select":qt("invalid",o),y=$=C=null;for(_ in m)if(m.hasOwnProperty(_)&&(q=m[_],q!=null))switch(_){case"value":C=q;break;case"defaultValue":$=q;break;case"multiple":y=q;default:mn(o,c,_,q,m,null)}c=C,m=$,o.multiple=!!y,c!=null?$u(o,!!y,c,!1):m!=null&&$u(o,!!y,m,!0);return;case"textarea":qt("invalid",o),C=_=y=null;for($ in m)if(m.hasOwnProperty($)&&(q=m[$],q!=null))switch($){case"value":y=q;break;case"defaultValue":_=q;break;case"children":C=q;break;case"dangerouslySetInnerHTML":if(q!=null)throw Error(r(91));break;default:mn(o,c,$,q,m,null)}Fj(o,y,_,C),gc(o);return;case"option":for(ee in m)if(m.hasOwnProperty(ee)&&(y=m[ee],y!=null))switch(ee){case"selected":o.selected=y&&typeof y!="function"&&typeof y!="symbol";break;default:mn(o,c,ee,y,m,null)}return;case"dialog":qt("beforetoggle",o),qt("toggle",o),qt("cancel",o),qt("close",o);break;case"iframe":case"object":qt("load",o);break;case"video":case"audio":for(y=0;y<Jh.length;y++)qt(Jh[y],o);break;case"image":qt("error",o),qt("load",o);break;case"details":qt("toggle",o);break;case"embed":case"source":case"link":qt("error",o),qt("load",o);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(de in m)if(m.hasOwnProperty(de)&&(y=m[de],y!=null))switch(de){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:mn(o,c,de,y,m,null)}return;default:if(d_(c)){for(we in m)m.hasOwnProperty(we)&&(y=m[we],y!==void 0&&Kw(o,c,we,y,m,void 0));return}}for(q in m)m.hasOwnProperty(q)&&(y=m[q],y!=null&&mn(o,c,q,y,m,null))}function bK(o,c,m,y){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var _=null,C=null,$=null,q=null,ee=null,de=null,we=null;for(ge in m){var ke=m[ge];if(m.hasOwnProperty(ge)&&ke!=null)switch(ge){case"checked":break;case"value":break;case"defaultValue":ee=ke;default:y.hasOwnProperty(ge)||mn(o,c,ge,null,y,ke)}}for(var pe in y){var ge=y[pe];if(ke=m[pe],y.hasOwnProperty(pe)&&(ge!=null||ke!=null))switch(pe){case"type":C=ge;break;case"name":_=ge;break;case"checked":de=ge;break;case"defaultChecked":we=ge;break;case"value":$=ge;break;case"defaultValue":q=ge;break;case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(r(137,c));break;default:ge!==ke&&mn(o,c,pe,ge,y,ke)}}c_(o,$,q,ee,de,we,C,_);return;case"select":ge=$=q=pe=null;for(C in m)if(ee=m[C],m.hasOwnProperty(C)&&ee!=null)switch(C){case"value":break;case"multiple":ge=ee;default:y.hasOwnProperty(C)||mn(o,c,C,null,y,ee)}for(_ in y)if(C=y[_],ee=m[_],y.hasOwnProperty(_)&&(C!=null||ee!=null))switch(_){case"value":pe=C;break;case"defaultValue":q=C;break;case"multiple":$=C;default:C!==ee&&mn(o,c,_,C,y,ee)}c=q,m=$,y=ge,pe!=null?$u(o,!!m,pe,!1):!!y!=!!m&&(c!=null?$u(o,!!m,c,!0):$u(o,!!m,m?[]:"",!1));return;case"textarea":ge=pe=null;for(q in m)if(_=m[q],m.hasOwnProperty(q)&&_!=null&&!y.hasOwnProperty(q))switch(q){case"value":break;case"children":break;default:mn(o,c,q,null,y,_)}for($ in y)if(_=y[$],C=m[$],y.hasOwnProperty($)&&(_!=null||C!=null))switch($){case"value":pe=_;break;case"defaultValue":ge=_;break;case"children":break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(r(91));break;default:_!==C&&mn(o,c,$,_,y,C)}zj(o,pe,ge);return;case"option":for(var xt in m)if(pe=m[xt],m.hasOwnProperty(xt)&&pe!=null&&!y.hasOwnProperty(xt))switch(xt){case"selected":o.selected=!1;break;default:mn(o,c,xt,null,y,pe)}for(ee in y)if(pe=y[ee],ge=m[ee],y.hasOwnProperty(ee)&&pe!==ge&&(pe!=null||ge!=null))switch(ee){case"selected":o.selected=pe&&typeof pe!="function"&&typeof pe!="symbol";break;default:mn(o,c,ee,pe,y,ge)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ht in m)pe=m[ht],m.hasOwnProperty(ht)&&pe!=null&&!y.hasOwnProperty(ht)&&mn(o,c,ht,null,y,pe);for(de in y)if(pe=y[de],ge=m[de],y.hasOwnProperty(de)&&pe!==ge&&(pe!=null||ge!=null))switch(de){case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(r(137,c));break;default:mn(o,c,de,pe,y,ge)}return;default:if(d_(c)){for(var gn in m)pe=m[gn],m.hasOwnProperty(gn)&&pe!==void 0&&!y.hasOwnProperty(gn)&&Kw(o,c,gn,void 0,y,pe);for(we in y)pe=y[we],ge=m[we],!y.hasOwnProperty(we)||pe===ge||pe===void 0&&ge===void 0||Kw(o,c,we,pe,y,ge);return}}for(var le in m)pe=m[le],m.hasOwnProperty(le)&&pe!=null&&!y.hasOwnProperty(le)&&mn(o,c,le,null,y,pe);for(ke in y)pe=y[ke],ge=m[ke],!y.hasOwnProperty(ke)||pe===ge||pe==null&&ge==null||mn(o,c,ke,pe,y,ge)}var Xw=null,Qw=null;function Pv(o){return o.nodeType===9?o:o.ownerDocument}function U2(o){switch(o){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function B2(o,c){if(o===0)switch(c){case"svg":return 1;case"math":return 2;default:return 0}return o===1&&c==="foreignObject"?0:o}function Jw(o,c){return o==="textarea"||o==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.children=="bigint"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var Zw=null;function xK(){var o=window.event;return o&&o.type==="popstate"?o===Zw?!1:(Zw=o,!0):(Zw=null,!1)}var q2=typeof setTimeout=="function"?setTimeout:void 0,_K=typeof clearTimeout=="function"?clearTimeout:void 0,V2=typeof Promise=="function"?Promise:void 0,wK=typeof queueMicrotask=="function"?queueMicrotask:typeof V2<"u"?function(o){return V2.resolve(null).then(o).catch(SK)}:q2;function SK(o){setTimeout(function(){throw o})}function dl(o){return o==="head"}function H2(o,c){var m=c,y=0,_=0;do{var C=m.nextSibling;if(o.removeChild(m),C&&C.nodeType===8)if(m=C.data,m==="/$"){if(0<y&&8>y){m=y;var $=o.ownerDocument;if(m&1&&ep($.documentElement),m&2&&ep($.body),m&4)for(m=$.head,ep(m),$=m.firstChild;$;){var q=$.nextSibling,ee=$.nodeName;$[me]||ee==="SCRIPT"||ee==="STYLE"||ee==="LINK"&&$.rel.toLowerCase()==="stylesheet"||m.removeChild($),$=q}}if(_===0){o.removeChild(C),lp(c);return}_--}else m==="$"||m==="$?"||m==="$!"?_++:y=m.charCodeAt(0)-48;else y=0;m=C}while(m);lp(c)}function eS(o){var c=o.firstChild;for(c&&c.nodeType===10&&(c=c.nextSibling);c;){var m=c;switch(c=c.nextSibling,m.nodeName){case"HTML":case"HEAD":case"BODY":eS(m),nt(m);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(m.rel.toLowerCase()==="stylesheet")continue}o.removeChild(m)}}function EK(o,c,m,y){for(;o.nodeType===1;){var _=m;if(o.nodeName.toLowerCase()!==c.toLowerCase()){if(!y&&(o.nodeName!=="INPUT"||o.type!=="hidden"))break}else if(y){if(!o[me])switch(c){case"meta":if(!o.hasAttribute("itemprop"))break;return o;case"link":if(C=o.getAttribute("rel"),C==="stylesheet"&&o.hasAttribute("data-precedence"))break;if(C!==_.rel||o.getAttribute("href")!==(_.href==null||_.href===""?null:_.href)||o.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin)||o.getAttribute("title")!==(_.title==null?null:_.title))break;return o;case"style":if(o.hasAttribute("data-precedence"))break;return o;case"script":if(C=o.getAttribute("src"),(C!==(_.src==null?null:_.src)||o.getAttribute("type")!==(_.type==null?null:_.type)||o.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin))&&C&&o.hasAttribute("async")&&!o.hasAttribute("itemprop"))break;return o;default:return o}}else if(c==="input"&&o.type==="hidden"){var C=_.name==null?null:""+_.name;if(_.type==="hidden"&&o.getAttribute("name")===C)return o}else return o;if(o=qi(o.nextSibling),o===null)break}return null}function kK(o,c,m){if(c==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!m||(o=qi(o.nextSibling),o===null))return null;return o}function tS(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState==="complete"}function TK(o,c){var m=o.ownerDocument;if(o.data!=="$?"||m.readyState==="complete")c();else{var y=function(){c(),m.removeEventListener("DOMContentLoaded",y)};m.addEventListener("DOMContentLoaded",y),o._reactRetry=y}}function qi(o){for(;o!=null;o=o.nextSibling){var c=o.nodeType;if(c===1||c===3)break;if(c===8){if(c=o.data,c==="$"||c==="$!"||c==="$?"||c==="F!"||c==="F")break;if(c==="/$")return null}}return o}var nS=null;function G2(o){o=o.previousSibling;for(var c=0;o;){if(o.nodeType===8){var m=o.data;if(m==="$"||m==="$!"||m==="$?"){if(c===0)return o;c--}else m==="/$"&&c++}o=o.previousSibling}return null}function W2(o,c,m){switch(c=Pv(m),o){case"html":if(o=c.documentElement,!o)throw Error(r(452));return o;case"head":if(o=c.head,!o)throw Error(r(453));return o;case"body":if(o=c.body,!o)throw Error(r(454));return o;default:throw Error(r(451))}}function ep(o){for(var c=o.attributes;c.length;)o.removeAttributeNode(c[0]);nt(o)}var mi=new Map,Y2=new Set;function Iv(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var fo=Y.d;Y.d={f:CK,r:AK,D:NK,C:RK,L:jK,m:MK,X:PK,S:OK,M:IK};function CK(){var o=fo.f(),c=Tv();return o||c}function AK(o){var c=Mt(o);c!==null&&c.tag===5&&c.type==="form"?pO(c):fo.r(o)}var pd=typeof document>"u"?null:document;function K2(o,c,m){var y=pd;if(y&&typeof c=="string"&&c){var _=li(c);_='link[rel="'+o+'"][href="'+_+'"]',typeof m=="string"&&(_+='[crossorigin="'+m+'"]'),Y2.has(_)||(Y2.add(_),o={rel:o,crossOrigin:m,href:c},y.querySelector(_)===null&&(c=y.createElement("link"),qr(c,"link",o),at(c),y.head.appendChild(c)))}}function NK(o){fo.D(o),K2("dns-prefetch",o,null)}function RK(o,c){fo.C(o,c),K2("preconnect",o,c)}function jK(o,c,m){fo.L(o,c,m);var y=pd;if(y&&o&&c){var _='link[rel="preload"][as="'+li(c)+'"]';c==="image"&&m&&m.imageSrcSet?(_+='[imagesrcset="'+li(m.imageSrcSet)+'"]',typeof m.imageSizes=="string"&&(_+='[imagesizes="'+li(m.imageSizes)+'"]')):_+='[href="'+li(o)+'"]';var C=_;switch(c){case"style":C=md(o);break;case"script":C=gd(o)}mi.has(C)||(o=p({rel:"preload",href:c==="image"&&m&&m.imageSrcSet?void 0:o,as:c},m),mi.set(C,o),y.querySelector(_)!==null||c==="style"&&y.querySelector(tp(C))||c==="script"&&y.querySelector(np(C))||(c=y.createElement("link"),qr(c,"link",o),at(c),y.head.appendChild(c)))}}function MK(o,c){fo.m(o,c);var m=pd;if(m&&o){var y=c&&typeof c.as=="string"?c.as:"script",_='link[rel="modulepreload"][as="'+li(y)+'"][href="'+li(o)+'"]',C=_;switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":C=gd(o)}if(!mi.has(C)&&(o=p({rel:"modulepreload",href:o},c),mi.set(C,o),m.querySelector(_)===null)){switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(m.querySelector(np(C)))return}y=m.createElement("link"),qr(y,"link",o),at(y),m.head.appendChild(y)}}}function OK(o,c,m){fo.S(o,c,m);var y=pd;if(y&&o){var _=hn(y).hoistableStyles,C=md(o);c=c||"default";var $=_.get(C);if(!$){var q={loading:0,preload:null};if($=y.querySelector(tp(C)))q.loading=5;else{o=p({rel:"stylesheet",href:o,"data-precedence":c},m),(m=mi.get(C))&&rS(o,m);var ee=$=y.createElement("link");at(ee),qr(ee,"link",o),ee._p=new Promise(function(de,we){ee.onload=de,ee.onerror=we}),ee.addEventListener("load",function(){q.loading|=1}),ee.addEventListener("error",function(){q.loading|=2}),q.loading|=4,Dv($,c,y)}$={type:"stylesheet",instance:$,count:1,state:q},_.set(C,$)}}}function PK(o,c){fo.X(o,c);var m=pd;if(m&&o){var y=hn(m).hoistableScripts,_=gd(o),C=y.get(_);C||(C=m.querySelector(np(_)),C||(o=p({src:o,async:!0},c),(c=mi.get(_))&&sS(o,c),C=m.createElement("script"),at(C),qr(C,"link",o),m.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},y.set(_,C))}}function IK(o,c){fo.M(o,c);var m=pd;if(m&&o){var y=hn(m).hoistableScripts,_=gd(o),C=y.get(_);C||(C=m.querySelector(np(_)),C||(o=p({src:o,async:!0,type:"module"},c),(c=mi.get(_))&&sS(o,c),C=m.createElement("script"),at(C),qr(C,"link",o),m.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},y.set(_,C))}}function X2(o,c,m,y){var _=(_=V.current)?Iv(_):null;if(!_)throw Error(r(446));switch(o){case"meta":case"title":return null;case"style":return typeof m.precedence=="string"&&typeof m.href=="string"?(c=md(m.href),m=hn(_).hoistableStyles,y=m.get(c),y||(y={type:"style",instance:null,count:0,state:null},m.set(c,y)),y):{type:"void",instance:null,count:0,state:null};case"link":if(m.rel==="stylesheet"&&typeof m.href=="string"&&typeof m.precedence=="string"){o=md(m.href);var C=hn(_).hoistableStyles,$=C.get(o);if($||(_=_.ownerDocument||_,$={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},C.set(o,$),(C=_.querySelector(tp(o)))&&!C._p&&($.instance=C,$.state.loading=5),mi.has(o)||(m={rel:"preload",as:"style",href:m.href,crossOrigin:m.crossOrigin,integrity:m.integrity,media:m.media,hrefLang:m.hrefLang,referrerPolicy:m.referrerPolicy},mi.set(o,m),C||DK(_,o,m,$.state))),c&&y===null)throw Error(r(528,""));return $}if(c&&y!==null)throw Error(r(529,""));return null;case"script":return c=m.async,m=m.src,typeof m=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=gd(m),m=hn(_).hoistableScripts,y=m.get(c),y||(y={type:"script",instance:null,count:0,state:null},m.set(c,y)),y):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,o))}}function md(o){return'href="'+li(o)+'"'}function tp(o){return'link[rel="stylesheet"]['+o+"]"}function Q2(o){return p({},o,{"data-precedence":o.precedence,precedence:null})}function DK(o,c,m,y){o.querySelector('link[rel="preload"][as="style"]['+c+"]")?y.loading=1:(c=o.createElement("link"),y.preload=c,c.addEventListener("load",function(){return y.loading|=1}),c.addEventListener("error",function(){return y.loading|=2}),qr(c,"link",m),at(c),o.head.appendChild(c))}function gd(o){return'[src="'+li(o)+'"]'}function np(o){return"script[async]"+o}function J2(o,c,m){if(c.count++,c.instance===null)switch(c.type){case"style":var y=o.querySelector('style[data-href~="'+li(m.href)+'"]');if(y)return c.instance=y,at(y),y;var _=p({},m,{"data-href":m.href,"data-precedence":m.precedence,href:null,precedence:null});return y=(o.ownerDocument||o).createElement("style"),at(y),qr(y,"style",_),Dv(y,m.precedence,o),c.instance=y;case"stylesheet":_=md(m.href);var C=o.querySelector(tp(_));if(C)return c.state.loading|=4,c.instance=C,at(C),C;y=Q2(m),(_=mi.get(_))&&rS(y,_),C=(o.ownerDocument||o).createElement("link"),at(C);var $=C;return $._p=new Promise(function(q,ee){$.onload=q,$.onerror=ee}),qr(C,"link",y),c.state.loading|=4,Dv(C,m.precedence,o),c.instance=C;case"script":return C=gd(m.src),(_=o.querySelector(np(C)))?(c.instance=_,at(_),_):(y=m,(_=mi.get(C))&&(y=p({},m),sS(y,_)),o=o.ownerDocument||o,_=o.createElement("script"),at(_),qr(_,"link",y),o.head.appendChild(_),c.instance=_);case"void":return null;default:throw Error(r(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(y=c.instance,c.state.loading|=4,Dv(y,m.precedence,o));return c.instance}function Dv(o,c,m){for(var y=m.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),_=y.length?y[y.length-1]:null,C=_,$=0;$<y.length;$++){var q=y[$];if(q.dataset.precedence===c)C=q;else if(C!==_)break}C?C.parentNode.insertBefore(o,C.nextSibling):(c=m.nodeType===9?m.head:m,c.insertBefore(o,c.firstChild))}function rS(o,c){o.crossOrigin==null&&(o.crossOrigin=c.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=c.referrerPolicy),o.title==null&&(o.title=c.title)}function sS(o,c){o.crossOrigin==null&&(o.crossOrigin=c.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=c.referrerPolicy),o.integrity==null&&(o.integrity=c.integrity)}var Lv=null;function Z2(o,c,m){if(Lv===null){var y=new Map,_=Lv=new Map;_.set(m,y)}else _=Lv,y=_.get(m),y||(y=new Map,_.set(m,y));if(y.has(o))return y;for(y.set(o,null),m=m.getElementsByTagName(o),_=0;_<m.length;_++){var C=m[_];if(!(C[me]||C[Rn]||o==="link"&&C.getAttribute("rel")==="stylesheet")&&C.namespaceURI!=="http://www.w3.org/2000/svg"){var $=C.getAttribute(c)||"";$=o+$;var q=y.get($);q?q.push(C):y.set($,[C])}}return y}function eP(o,c,m){o=o.ownerDocument||o,o.head.insertBefore(m,c==="title"?o.querySelector("head > title"):null)}function LK(o,c,m){if(m===1||c.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;switch(c.rel){case"stylesheet":return o=c.disabled,typeof c.precedence=="string"&&o==null;default:return!0}case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function tP(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}var rp=null;function $K(){}function zK(o,c,m){if(rp===null)throw Error(r(475));var y=rp;if(c.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var _=md(m.href),C=o.querySelector(tp(_));if(C){o=C._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(y.count++,y=$v.bind(y),o.then(y,y)),c.state.loading|=4,c.instance=C,at(C);return}C=o.ownerDocument||o,m=Q2(m),(_=mi.get(_))&&rS(m,_),C=C.createElement("link"),at(C);var $=C;$._p=new Promise(function(q,ee){$.onload=q,$.onerror=ee}),qr(C,"link",m),c.instance=C}y.stylesheets===null&&(y.stylesheets=new Map),y.stylesheets.set(c,o),(o=c.state.preload)&&(c.state.loading&3)===0&&(y.count++,c=$v.bind(y),o.addEventListener("load",c),o.addEventListener("error",c))}}function FK(){if(rp===null)throw Error(r(475));var o=rp;return o.stylesheets&&o.count===0&&iS(o,o.stylesheets),0<o.count?function(c){var m=setTimeout(function(){if(o.stylesheets&&iS(o,o.stylesheets),o.unsuspend){var y=o.unsuspend;o.unsuspend=null,y()}},6e4);return o.unsuspend=c,function(){o.unsuspend=null,clearTimeout(m)}}:null}function $v(){if(this.count--,this.count===0){if(this.stylesheets)iS(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var zv=null;function iS(o,c){o.stylesheets=null,o.unsuspend!==null&&(o.count++,zv=new Map,c.forEach(UK,o),zv=null,$v.call(o))}function UK(o,c){if(!(c.state.loading&4)){var m=zv.get(o);if(m)var y=m.get(null);else{m=new Map,zv.set(o,m);for(var _=o.querySelectorAll("link[data-precedence],style[data-precedence]"),C=0;C<_.length;C++){var $=_[C];($.nodeName==="LINK"||$.getAttribute("media")!=="not all")&&(m.set($.dataset.precedence,$),y=$)}y&&m.set(null,y)}_=c.instance,$=_.getAttribute("data-precedence"),C=m.get($)||y,C===y&&m.set(null,_),m.set($,_),this.count++,y=$v.bind(this),_.addEventListener("load",y),_.addEventListener("error",y),C?C.parentNode.insertBefore(_,C.nextSibling):(o=o.nodeType===9?o.head:o,o.insertBefore(_,o.firstChild)),c.state.loading|=4}}var sp={$$typeof:T,Provider:null,Consumer:null,_currentValue:H,_currentValue2:H,_threadCount:0};function BK(o,c,m,y,_,C,$,q){this.tag=1,this.containerInfo=o,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=pc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pc(0),this.hiddenUpdates=pc(null),this.identifierPrefix=y,this.onUncaughtError=_,this.onCaughtError=C,this.onRecoverableError=$,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=q,this.incompleteTransitions=new Map}function nP(o,c,m,y,_,C,$,q,ee,de,we,ke){return o=new BK(o,c,m,$,q,ee,de,ke),c=1,C===!0&&(c|=24),C=Bs(3,null,null,c),o.current=C,C.stateNode=o,c=F_(),c.refCount++,o.pooledCache=c,c.refCount++,C.memoizedState={element:y,isDehydrated:m,cache:c},V_(C),o}function rP(o){return o?(o=Wu,o):Wu}function sP(o,c,m,y,_,C){_=rP(_),y.context===null?y.context=_:y.pendingContext=_,y=Jo(c),y.payload={element:m},C=C===void 0?null:C,C!==null&&(y.callback=C),m=Zo(o,y,c),m!==null&&(Ws(m,o,c),Ph(m,o,c))}function iP(o,c){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var m=o.retryLane;o.retryLane=m!==0&&m<c?m:c}}function aS(o,c){iP(o,c),(o=o.alternate)&&iP(o,c)}function aP(o){if(o.tag===13){var c=Gu(o,67108864);c!==null&&Ws(c,o,67108864),aS(o,67108864)}}var Fv=!0;function qK(o,c,m,y){var _=F.T;F.T=null;var C=Y.p;try{Y.p=2,oS(o,c,m,y)}finally{Y.p=C,F.T=_}}function VK(o,c,m,y){var _=F.T;F.T=null;var C=Y.p;try{Y.p=8,oS(o,c,m,y)}finally{Y.p=C,F.T=_}}function oS(o,c,m,y){if(Fv){var _=lS(y);if(_===null)Yw(o,c,y,Uv,m),lP(o,y);else if(GK(_,o,c,m,y))y.stopPropagation();else if(lP(o,y),c&4&&-1<HK.indexOf(o)){for(;_!==null;){var C=Mt(_);if(C!==null)switch(C.tag){case 3:if(C=C.stateNode,C.current.memoizedState.isDehydrated){var $=Xt(C.pendingLanes);if($!==0){var q=C;for(q.pendingLanes|=2,q.entangledLanes|=2;$;){var ee=1<<31-qe($);q.entanglements[1]|=ee,$&=~ee}ya(C),(cn&6)===0&&(Ev=Ne()+500,Qh(0))}}break;case 13:q=Gu(C,2),q!==null&&Ws(q,C,2),Tv(),aS(C,2)}if(C=lS(y),C===null&&Yw(o,c,y,Uv,m),C===_)break;_=C}_!==null&&y.stopPropagation()}else Yw(o,c,y,null,m)}}function lS(o){return o=h_(o),cS(o)}var Uv=null;function cS(o){if(Uv=null,o=tt(o),o!==null){var c=i(o);if(c===null)o=null;else{var m=c.tag;if(m===13){if(o=a(c),o!==null)return o;o=null}else if(m===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;o=null}else c!==o&&(o=null)}}return Uv=o,null}function oP(o){switch(o){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Qe()){case dt:return 2;case Be:return 8;case pt:case De:return 32;case et:return 268435456;default:return 32}default:return 32}}var uS=!1,fl=null,hl=null,pl=null,ip=new Map,ap=new Map,ml=[],HK="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".split(" ");function lP(o,c){switch(o){case"focusin":case"focusout":fl=null;break;case"dragenter":case"dragleave":hl=null;break;case"mouseover":case"mouseout":pl=null;break;case"pointerover":case"pointerout":ip.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":ap.delete(c.pointerId)}}function op(o,c,m,y,_,C){return o===null||o.nativeEvent!==C?(o={blockedOn:c,domEventName:m,eventSystemFlags:y,nativeEvent:C,targetContainers:[_]},c!==null&&(c=Mt(c),c!==null&&aP(c)),o):(o.eventSystemFlags|=y,c=o.targetContainers,_!==null&&c.indexOf(_)===-1&&c.push(_),o)}function GK(o,c,m,y,_){switch(c){case"focusin":return fl=op(fl,o,c,m,y,_),!0;case"dragenter":return hl=op(hl,o,c,m,y,_),!0;case"mouseover":return pl=op(pl,o,c,m,y,_),!0;case"pointerover":var C=_.pointerId;return ip.set(C,op(ip.get(C)||null,o,c,m,y,_)),!0;case"gotpointercapture":return C=_.pointerId,ap.set(C,op(ap.get(C)||null,o,c,m,y,_)),!0}return!1}function cP(o){var c=tt(o.target);if(c!==null){var m=i(c);if(m!==null){if(c=m.tag,c===13){if(c=a(m),c!==null){o.blockedOn=c,Vn(o.priority,function(){if(m.tag===13){var y=Gs();y=$n(y);var _=Gu(m,y);_!==null&&Ws(_,m,y),aS(m,y)}});return}}else if(c===3&&m.stateNode.current.memoizedState.isDehydrated){o.blockedOn=m.tag===3?m.stateNode.containerInfo:null;return}}}o.blockedOn=null}function Bv(o){if(o.blockedOn!==null)return!1;for(var c=o.targetContainers;0<c.length;){var m=lS(o.nativeEvent);if(m===null){m=o.nativeEvent;var y=new m.constructor(m.type,m);f_=y,m.target.dispatchEvent(y),f_=null}else return c=Mt(m),c!==null&&aP(c),o.blockedOn=m,!1;c.shift()}return!0}function uP(o,c,m){Bv(o)&&m.delete(c)}function WK(){uS=!1,fl!==null&&Bv(fl)&&(fl=null),hl!==null&&Bv(hl)&&(hl=null),pl!==null&&Bv(pl)&&(pl=null),ip.forEach(uP),ap.forEach(uP)}function qv(o,c){o.blockedOn===c&&(o.blockedOn=null,uS||(uS=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,WK)))}var Vv=null;function dP(o){Vv!==o&&(Vv=o,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Vv===o&&(Vv=null);for(var c=0;c<o.length;c+=3){var m=o[c],y=o[c+1],_=o[c+2];if(typeof y!="function"){if(cS(y||m)===null)continue;break}var C=Mt(m);C!==null&&(o.splice(c,3),c-=3,cw(C,{pending:!0,data:_,method:m.method,action:y},y,_))}}))}function lp(o){function c(ee){return qv(ee,o)}fl!==null&&qv(fl,o),hl!==null&&qv(hl,o),pl!==null&&qv(pl,o),ip.forEach(c),ap.forEach(c);for(var m=0;m<ml.length;m++){var y=ml[m];y.blockedOn===o&&(y.blockedOn=null)}for(;0<ml.length&&(m=ml[0],m.blockedOn===null);)cP(m),m.blockedOn===null&&ml.shift();if(m=(o.ownerDocument||o).$$reactFormReplay,m!=null)for(y=0;y<m.length;y+=3){var _=m[y],C=m[y+1],$=_[fn]||null;if(typeof C=="function")$||dP(m);else if($){var q=null;if(C&&C.hasAttribute("formAction")){if(_=C,$=C[fn]||null)q=$.formAction;else if(cS(_)!==null)continue}else q=$.action;typeof q=="function"?m[y+1]=q:(m.splice(y,3),y-=3),dP(m)}}}function dS(o){this._internalRoot=o}Hv.prototype.render=dS.prototype.render=function(o){var c=this._internalRoot;if(c===null)throw Error(r(409));var m=c.current,y=Gs();sP(m,y,o,c,null,null)},Hv.prototype.unmount=dS.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var c=o.containerInfo;sP(o.current,2,null,o,null,null),Tv(),c[er]=null}};function Hv(o){this._internalRoot=o}Hv.prototype.unstable_scheduleHydration=function(o){if(o){var c=$i();o={blockedOn:null,target:o,priority:c};for(var m=0;m<ml.length&&c!==0&&c<ml[m].priority;m++);ml.splice(m,0,o),m===0&&cP(o)}};var fP=e.version;if(fP!=="19.1.0")throw Error(r(527,fP,"19.1.0"));Y.findDOMNode=function(o){var c=o._reactInternals;if(c===void 0)throw typeof o.render=="function"?Error(r(188)):(o=Object.keys(o).join(","),Error(r(268,o)));return o=u(c),o=o!==null?d(o):null,o=o===null?null:o.stateNode,o};var YK={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:F,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Gv=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Gv.isDisabled&&Gv.supportsFiber)try{xe=Gv.inject(YK),Te=Gv}catch{}}return up.createRoot=function(o,c){if(!s(o))throw Error(r(299));var m=!1,y="",_=AO,C=NO,$=RO,q=null;return c!=null&&(c.unstable_strictMode===!0&&(m=!0),c.identifierPrefix!==void 0&&(y=c.identifierPrefix),c.onUncaughtError!==void 0&&(_=c.onUncaughtError),c.onCaughtError!==void 0&&(C=c.onCaughtError),c.onRecoverableError!==void 0&&($=c.onRecoverableError),c.unstable_transitionCallbacks!==void 0&&(q=c.unstable_transitionCallbacks)),c=nP(o,1,!1,null,null,m,y,_,C,$,q,null),o[er]=c.current,Ww(o),new dS(c)},up.hydrateRoot=function(o,c,m){if(!s(o))throw Error(r(299));var y=!1,_="",C=AO,$=NO,q=RO,ee=null,de=null;return m!=null&&(m.unstable_strictMode===!0&&(y=!0),m.identifierPrefix!==void 0&&(_=m.identifierPrefix),m.onUncaughtError!==void 0&&(C=m.onUncaughtError),m.onCaughtError!==void 0&&($=m.onCaughtError),m.onRecoverableError!==void 0&&(q=m.onRecoverableError),m.unstable_transitionCallbacks!==void 0&&(ee=m.unstable_transitionCallbacks),m.formState!==void 0&&(de=m.formState)),c=nP(o,1,!0,c,m??null,y,_,C,$,q,ee,de),c.context=rP(null),m=c.current,y=Gs(),y=$n(y),_=Jo(y),_.callback=null,Zo(m,_,y),m=y,c.current.lanes=m,fa(c,m),ya(c),o[er]=c.current,Ww(o),new Hv(c)},up.version="19.1.0",up}var wP;function sX(){if(wP)return pS.exports;wP=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),pS.exports=rX(),pS.exports}var iX=sX();function Nz(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(n=Nz(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function lA(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=Nz(t))&&(r&&(r+=" "),r+=e);return r}const cA="-",aX=t=>{const e=lX(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{const l=a.split(cA);return l[0]===""&&l.length!==1&&l.shift(),Rz(l,e)||oX(a)},getConflictingClassGroupIds:(a,l)=>{const u=n[a]||[];return l&&r[a]?[...u,...r[a]]:u}}},Rz=(t,e)=>{if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),s=r?Rz(t.slice(1),r):void 0;if(s)return s;if(e.validators.length===0)return;const i=t.join(cA);return e.validators.find(({validator:a})=>a(i))?.classGroupId},SP=/^\[(.+)\]$/,oX=t=>{if(SP.test(t)){const e=SP.exec(t)[1],n=e?.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},lX=t=>{const{theme:e,classGroups:n}=t,r={nextPart:new Map,validators:[]};for(const s in n)ik(n[s],r,s,e);return r},ik=(t,e,n,r)=>{t.forEach(s=>{if(typeof s=="string"){const i=s===""?e:EP(e,s);i.classGroupId=n;return}if(typeof s=="function"){if(cX(s)){ik(s(r),e,n,r);return}e.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,a])=>{ik(a,EP(e,i),n,r)})})},EP=(t,e)=>{let n=t;return e.split(cA).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},cX=t=>t.isThemeGetter,uX=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const s=(i,a)=>{n.set(i,a),e++,e>t&&(e=0,r=n,n=new Map)};return{get(i){let a=n.get(i);if(a!==void 0)return a;if((a=r.get(i))!==void 0)return s(i,a),a},set(i,a){n.has(i)?n.set(i,a):s(i,a)}}},ak="!",ok=":",dX=ok.length,fX=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=s=>{const i=[];let a=0,l=0,u=0,d;for(let b=0;b<s.length;b++){let x=s[b];if(a===0&&l===0){if(x===ok){i.push(s.slice(u,b)),u=b+dX;continue}if(x==="/"){d=b;continue}}x==="["?a++:x==="]"?a--:x==="("?l++:x===")"&&l--}const p=i.length===0?s:s.substring(u),h=hX(p),g=h!==p,v=d&&d>u?d-u:void 0;return{modifiers:i,hasImportantModifier:g,baseClassName:h,maybePostfixModifierPosition:v}};if(e){const s=e+ok,i=r;r=a=>a.startsWith(s)?i(a.substring(s.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:a,maybePostfixModifierPosition:void 0}}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},hX=t=>t.endsWith(ak)?t.substring(0,t.length-1):t.startsWith(ak)?t.substring(1):t,pX=t=>{const e=Object.fromEntries(t.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const s=[];let i=[];return r.forEach(a=>{a[0]==="["||e[a]?(s.push(...i.sort(),a),i=[]):i.push(a)}),s.push(...i.sort()),s}},mX=t=>({cache:uX(t.cacheSize),parseClassName:fX(t),sortModifiers:pX(t),...aX(t)}),gX=/\s+/,vX=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i}=e,a=[],l=t.trim().split(gX);let u="";for(let d=l.length-1;d>=0;d-=1){const p=l[d],{isExternal:h,modifiers:g,hasImportantModifier:v,baseClassName:b,maybePostfixModifierPosition:x}=n(p);if(h){u=p+(u.length>0?" "+u:u);continue}let E=!!x,S=r(E?b.substring(0,x):b);if(!S){if(!E){u=p+(u.length>0?" "+u:u);continue}if(S=r(b),!S){u=p+(u.length>0?" "+u:u);continue}E=!1}const k=i(g).join(":"),T=v?k+ak:k,R=T+S;if(a.includes(R))continue;a.push(R);const j=s(S,E);for(let A=0;A<j.length;++A){const N=j[A];a.push(T+N)}u=p+(u.length>0?" "+u:u)}return u};function yX(){let t=0,e,n,r="";for(;t<arguments.length;)(e=arguments[t++])&&(n=jz(e))&&(r&&(r+=" "),r+=n);return r}const jz=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=jz(t[r]))&&(n&&(n+=" "),n+=e);return n};function bX(t,...e){let n,r,s,i=a;function a(u){const d=e.reduce((p,h)=>h(p),t());return n=mX(d),r=n.cache.get,s=n.cache.set,i=l,l(u)}function l(u){const d=r(u);if(d)return d;const p=vX(u,n);return s(u,p),p}return function(){return i(yX.apply(null,arguments))}}const Sr=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},Mz=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Oz=/^\((?:(\w[\w-]*):)?(.+)\)$/i,xX=/^\d+\/\d+$/,_X=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,wX=/\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$/,SX=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,EX=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,kX=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,vd=t=>xX.test(t),zt=t=>!!t&&!Number.isNaN(Number(t)),vl=t=>!!t&&Number.isInteger(Number(t)),yS=t=>t.endsWith("%")&&zt(t.slice(0,-1)),ho=t=>_X.test(t),TX=()=>!0,CX=t=>wX.test(t)&&!SX.test(t),Pz=()=>!1,AX=t=>EX.test(t),NX=t=>kX.test(t),RX=t=>!Ke(t)&&!Xe(t),jX=t=>Hf(t,Lz,Pz),Ke=t=>Mz.test(t),Oc=t=>Hf(t,$z,CX),bS=t=>Hf(t,DX,zt),kP=t=>Hf(t,Iz,Pz),MX=t=>Hf(t,Dz,NX),Wv=t=>Hf(t,zz,AX),Xe=t=>Oz.test(t),dp=t=>Gf(t,$z),OX=t=>Gf(t,LX),TP=t=>Gf(t,Iz),PX=t=>Gf(t,Lz),IX=t=>Gf(t,Dz),Yv=t=>Gf(t,zz,!0),Hf=(t,e,n)=>{const r=Mz.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},Gf=(t,e,n=!1)=>{const r=Oz.exec(t);return r?r[1]?e(r[1]):n:!1},Iz=t=>t==="position"||t==="percentage",Dz=t=>t==="image"||t==="url",Lz=t=>t==="length"||t==="size"||t==="bg-size",$z=t=>t==="length",DX=t=>t==="number",LX=t=>t==="family-name",zz=t=>t==="shadow",$X=()=>{const t=Sr("color"),e=Sr("font"),n=Sr("text"),r=Sr("font-weight"),s=Sr("tracking"),i=Sr("leading"),a=Sr("breakpoint"),l=Sr("container"),u=Sr("spacing"),d=Sr("radius"),p=Sr("shadow"),h=Sr("inset-shadow"),g=Sr("text-shadow"),v=Sr("drop-shadow"),b=Sr("blur"),x=Sr("perspective"),E=Sr("aspect"),S=Sr("ease"),k=Sr("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],j=()=>[...R(),Xe,Ke],A=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto","contain","none"],M=()=>[Xe,Ke,u],I=()=>[vd,"full","auto",...M()],O=()=>[vl,"none","subgrid",Xe,Ke],L=()=>["auto",{span:["full",vl,Xe,Ke]},vl,Xe,Ke],z=()=>[vl,"auto",Xe,Ke],G=()=>["auto","min","max","fr",Xe,Ke],W=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],X=()=>["start","end","center","stretch","center-safe","end-safe"],F=()=>["auto",...M()],Y=()=>[vd,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],H=()=>[t,Xe,Ke],te=()=>[...R(),TP,kP,{position:[Xe,Ke]}],P=()=>["no-repeat",{repeat:["","x","y","space","round"]}],re=()=>["auto","cover","contain",PX,jX,{size:[Xe,Ke]}],ue=()=>[yS,dp,Oc],D=()=>["","none","full",d,Xe,Ke],Z=()=>["",zt,dp,Oc],he=()=>["solid","dashed","dotted","double"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],U=()=>[zt,yS,TP,kP],K=()=>["","none",b,Xe,Ke],ae=()=>["none",zt,Xe,Ke],B=()=>["none",zt,Xe,Ke],J=()=>[zt,Xe,Ke],oe=()=>[vd,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ho],breakpoint:[ho],color:[TX],container:[ho],"drop-shadow":[ho],ease:["in","out","in-out"],font:[RX],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ho],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ho],shadow:[ho],spacing:["px",zt],text:[ho],"text-shadow":[ho],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",vd,Ke,Xe,E]}],container:["container"],columns:[{columns:[zt,Ke,Xe,l]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"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"],sr:["sr-only","not-sr-only"],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:j()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{start:I()}],end:[{end:I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[vl,"auto",Xe,Ke]}],basis:[{basis:[vd,"full","auto",l,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[zt,vd,"auto","initial","none",Ke]}],grow:[{grow:["",zt,Xe,Ke]}],shrink:[{shrink:["",zt,Xe,Ke]}],order:[{order:[vl,"first","last","none",Xe,Ke]}],"grid-cols":[{"grid-cols":O()}],"col-start-end":[{col:L()}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":O()}],"row-start-end":[{row:L()}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":G()}],"auto-rows":[{"auto-rows":G()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...W(),"normal"]}],"justify-items":[{"justify-items":[...X(),"normal"]}],"justify-self":[{"justify-self":["auto",...X()]}],"align-content":[{content:["normal",...W()]}],"align-items":[{items:[...X(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...X(),{baseline:["","last"]}]}],"place-content":[{"place-content":W()}],"place-items":[{"place-items":[...X(),"baseline"]}],"place-self":[{"place-self":["auto",...X()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:F()}],mx:[{mx:F()}],my:[{my:F()}],ms:[{ms:F()}],me:[{me:F()}],mt:[{mt:F()}],mr:[{mr:F()}],mb:[{mb:F()}],ml:[{ml:F()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:Y()}],w:[{w:[l,"screen",...Y()]}],"min-w":[{"min-w":[l,"screen","none",...Y()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[a]},...Y()]}],h:[{h:["screen","lh",...Y()]}],"min-h":[{"min-h":["screen","lh","none",...Y()]}],"max-h":[{"max-h":["screen","lh",...Y()]}],"font-size":[{text:["base",n,dp,Oc]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Xe,bS]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",yS,Ke]}],"font-family":[{font:[OX,Ke,e]}],"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:[s,Xe,Ke]}],"line-clamp":[{"line-clamp":[zt,"none",Xe,bS]}],leading:[{leading:[i,...M()]}],"list-image":[{"list-image":["none",Xe,Ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Xe,Ke]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:H()}],"text-color":[{text:H()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...he(),"wavy"]}],"text-decoration-thickness":[{decoration:[zt,"from-font","auto",Xe,Oc]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[zt,"auto",Xe,Ke]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Xe,Ke]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Xe,Ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:te()}],"bg-repeat":[{bg:P()}],"bg-size":[{bg:re()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},vl,Xe,Ke],radial:["",Xe,Ke],conic:[vl,Xe,Ke]},IX,MX]}],"bg-color":[{bg:H()}],"gradient-from-pos":[{from:ue()}],"gradient-via-pos":[{via:ue()}],"gradient-to-pos":[{to:ue()}],"gradient-from":[{from:H()}],"gradient-via":[{via:H()}],"gradient-to":[{to:H()}],rounded:[{rounded:D()}],"rounded-s":[{"rounded-s":D()}],"rounded-e":[{"rounded-e":D()}],"rounded-t":[{"rounded-t":D()}],"rounded-r":[{"rounded-r":D()}],"rounded-b":[{"rounded-b":D()}],"rounded-l":[{"rounded-l":D()}],"rounded-ss":[{"rounded-ss":D()}],"rounded-se":[{"rounded-se":D()}],"rounded-ee":[{"rounded-ee":D()}],"rounded-es":[{"rounded-es":D()}],"rounded-tl":[{"rounded-tl":D()}],"rounded-tr":[{"rounded-tr":D()}],"rounded-br":[{"rounded-br":D()}],"rounded-bl":[{"rounded-bl":D()}],"border-w":[{border:Z()}],"border-w-x":[{"border-x":Z()}],"border-w-y":[{"border-y":Z()}],"border-w-s":[{"border-s":Z()}],"border-w-e":[{"border-e":Z()}],"border-w-t":[{"border-t":Z()}],"border-w-r":[{"border-r":Z()}],"border-w-b":[{"border-b":Z()}],"border-w-l":[{"border-l":Z()}],"divide-x":[{"divide-x":Z()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Z()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...he(),"hidden","none"]}],"divide-style":[{divide:[...he(),"hidden","none"]}],"border-color":[{border:H()}],"border-color-x":[{"border-x":H()}],"border-color-y":[{"border-y":H()}],"border-color-s":[{"border-s":H()}],"border-color-e":[{"border-e":H()}],"border-color-t":[{"border-t":H()}],"border-color-r":[{"border-r":H()}],"border-color-b":[{"border-b":H()}],"border-color-l":[{"border-l":H()}],"divide-color":[{divide:H()}],"outline-style":[{outline:[...he(),"none","hidden"]}],"outline-offset":[{"outline-offset":[zt,Xe,Ke]}],"outline-w":[{outline:["",zt,dp,Oc]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","none",p,Yv,Wv]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",h,Yv,Wv]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:Z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[zt,Oc]}],"ring-offset-color":[{"ring-offset":H()}],"inset-ring-w":[{"inset-ring":Z()}],"inset-ring-color":[{"inset-ring":H()}],"text-shadow":[{"text-shadow":["none",g,Yv,Wv]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[zt,Xe,Ke]}],"mix-blend":[{"mix-blend":[...V(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":V()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[zt]}],"mask-image-linear-from-pos":[{"mask-linear-from":U()}],"mask-image-linear-to-pos":[{"mask-linear-to":U()}],"mask-image-linear-from-color":[{"mask-linear-from":H()}],"mask-image-linear-to-color":[{"mask-linear-to":H()}],"mask-image-t-from-pos":[{"mask-t-from":U()}],"mask-image-t-to-pos":[{"mask-t-to":U()}],"mask-image-t-from-color":[{"mask-t-from":H()}],"mask-image-t-to-color":[{"mask-t-to":H()}],"mask-image-r-from-pos":[{"mask-r-from":U()}],"mask-image-r-to-pos":[{"mask-r-to":U()}],"mask-image-r-from-color":[{"mask-r-from":H()}],"mask-image-r-to-color":[{"mask-r-to":H()}],"mask-image-b-from-pos":[{"mask-b-from":U()}],"mask-image-b-to-pos":[{"mask-b-to":U()}],"mask-image-b-from-color":[{"mask-b-from":H()}],"mask-image-b-to-color":[{"mask-b-to":H()}],"mask-image-l-from-pos":[{"mask-l-from":U()}],"mask-image-l-to-pos":[{"mask-l-to":U()}],"mask-image-l-from-color":[{"mask-l-from":H()}],"mask-image-l-to-color":[{"mask-l-to":H()}],"mask-image-x-from-pos":[{"mask-x-from":U()}],"mask-image-x-to-pos":[{"mask-x-to":U()}],"mask-image-x-from-color":[{"mask-x-from":H()}],"mask-image-x-to-color":[{"mask-x-to":H()}],"mask-image-y-from-pos":[{"mask-y-from":U()}],"mask-image-y-to-pos":[{"mask-y-to":U()}],"mask-image-y-from-color":[{"mask-y-from":H()}],"mask-image-y-to-color":[{"mask-y-to":H()}],"mask-image-radial":[{"mask-radial":[Xe,Ke]}],"mask-image-radial-from-pos":[{"mask-radial-from":U()}],"mask-image-radial-to-pos":[{"mask-radial-to":U()}],"mask-image-radial-from-color":[{"mask-radial-from":H()}],"mask-image-radial-to-color":[{"mask-radial-to":H()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":R()}],"mask-image-conic-pos":[{"mask-conic":[zt]}],"mask-image-conic-from-pos":[{"mask-conic-from":U()}],"mask-image-conic-to-pos":[{"mask-conic-to":U()}],"mask-image-conic-from-color":[{"mask-conic-from":H()}],"mask-image-conic-to-color":[{"mask-conic-to":H()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:te()}],"mask-repeat":[{mask:P()}],"mask-size":[{mask:re()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Xe,Ke]}],filter:[{filter:["","none",Xe,Ke]}],blur:[{blur:K()}],brightness:[{brightness:[zt,Xe,Ke]}],contrast:[{contrast:[zt,Xe,Ke]}],"drop-shadow":[{"drop-shadow":["","none",v,Yv,Wv]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",zt,Xe,Ke]}],"hue-rotate":[{"hue-rotate":[zt,Xe,Ke]}],invert:[{invert:["",zt,Xe,Ke]}],saturate:[{saturate:[zt,Xe,Ke]}],sepia:[{sepia:["",zt,Xe,Ke]}],"backdrop-filter":[{"backdrop-filter":["","none",Xe,Ke]}],"backdrop-blur":[{"backdrop-blur":K()}],"backdrop-brightness":[{"backdrop-brightness":[zt,Xe,Ke]}],"backdrop-contrast":[{"backdrop-contrast":[zt,Xe,Ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",zt,Xe,Ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[zt,Xe,Ke]}],"backdrop-invert":[{"backdrop-invert":["",zt,Xe,Ke]}],"backdrop-opacity":[{"backdrop-opacity":[zt,Xe,Ke]}],"backdrop-saturate":[{"backdrop-saturate":[zt,Xe,Ke]}],"backdrop-sepia":[{"backdrop-sepia":["",zt,Xe,Ke]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Xe,Ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[zt,"initial",Xe,Ke]}],ease:[{ease:["linear","initial",S,Xe,Ke]}],delay:[{delay:[zt,Xe,Ke]}],animate:[{animate:["none",k,Xe,Ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[x,Xe,Ke]}],"perspective-origin":[{"perspective-origin":j()}],rotate:[{rotate:ae()}],"rotate-x":[{"rotate-x":ae()}],"rotate-y":[{"rotate-y":ae()}],"rotate-z":[{"rotate-z":ae()}],scale:[{scale:B()}],"scale-x":[{"scale-x":B()}],"scale-y":[{"scale-y":B()}],"scale-z":[{"scale-z":B()}],"scale-3d":["scale-3d"],skew:[{skew:J()}],"skew-x":[{"skew-x":J()}],"skew-y":[{"skew-y":J()}],transform:[{transform:[Xe,Ke,"","none","gpu","cpu"]}],"transform-origin":[{origin:j()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:oe()}],"translate-x":[{"translate-x":oe()}],"translate-y":[{"translate-y":oe()}],"translate-z":[{"translate-z":oe()}],"translate-none":["translate-none"],accent:[{accent:H()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:H()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],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",Xe,Ke]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"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",Xe,Ke]}],fill:[{fill:["none",...H()]}],"stroke-w":[{stroke:[zt,dp,Oc,bS]}],stroke:[{stroke:["none",...H()]}],"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-x","border-w-y","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-x","border-color-y","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Fz=bX($X);function Me(...t){return Fz(lA(t))}const zX=t=>typeof t!="string"||!t.trim()?"?":t.trim().split(/\s+/).filter(Boolean).map(e=>e[0]).join("").toUpperCase()||"?";function Fa({className:t,...e}){return f.jsx("div",{"data-slot":"card",className:Me("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",t),...e})}function FX({className:t,...e}){return f.jsx("div",{"data-slot":"card-content",className:Me("px-6",t),...e})}var ag=Az();const Uz=Vf(ag);function CP(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function qx(...t){return e=>{let n=!1;const r=t.map(s=>{const i=CP(s,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():CP(t[s],null)}}}}function Ct(...t){return w.useCallback(qx(...t),t)}function uu(t){const e=UX(t),n=w.forwardRef((r,s)=>{const{children:i,...a}=r,l=w.Children.toArray(i),u=l.find(BX);if(u){const d=u.props.children,p=l.map(h=>h===u?w.Children.count(d)>1?w.Children.only(null):w.isValidElement(d)?d.props.children:null:h);return f.jsx(e,{...a,ref:s,children:w.isValidElement(d)?w.cloneElement(d,void 0,p):null})}return f.jsx(e,{...a,ref:s,children:i})});return n.displayName=`${t}.Slot`,n}var uA=uu("Slot");function UX(t){const e=w.forwardRef((n,r)=>{const{children:s,...i}=n;if(w.isValidElement(s)){const a=VX(s),l=qX(i,s.props);return s.type!==w.Fragment&&(l.ref=r?qx(r,a):a),w.cloneElement(s,l)}return w.Children.count(s)>1?w.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var Bz=Symbol("radix.slottable");function qz(t){const e=({children:n})=>f.jsx(f.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=Bz,e}function BX(t){return w.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Bz}function qX(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...l)=>{const u=i(...l);return s(...l),u}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function VX(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var HX=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ut=HX.reduce((t,e)=>{const n=uu(`Primitive.${e}`),r=w.forwardRef((s,i)=>{const{asChild:a,...l}=s,u=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(u,{...l,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function Vz(t,e){t&&ag.flushSync(()=>t.dispatchEvent(e))}var Hz=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),GX="VisuallyHidden",Gz=w.forwardRef((t,e)=>f.jsx(ut.span,{...t,ref:e,style:{...Hz,...t.style}}));Gz.displayName=GX;var WX=Gz;function YX(t,e){const n=w.createContext(e),r=i=>{const{children:a,...l}=i,u=w.useMemo(()=>l,Object.values(l));return f.jsx(n.Provider,{value:u,children:a})};r.displayName=t+"Provider";function s(i){const a=w.useContext(n);if(a)return a;if(e!==void 0)return e;throw new Error(`\`${i}\` must be used within \`${t}\``)}return[r,s]}function ai(t,e=[]){let n=[];function r(i,a){const l=w.createContext(a),u=n.length;n=[...n,a];const d=h=>{const{scope:g,children:v,...b}=h,x=g?.[t]?.[u]||l,E=w.useMemo(()=>b,Object.values(b));return f.jsx(x.Provider,{value:E,children:v})};d.displayName=i+"Provider";function p(h,g){const v=g?.[t]?.[u]||l,b=w.useContext(v);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${i}\``)}return[d,p]}const s=()=>{const i=n.map(a=>w.createContext(a));return function(l){const u=l?.[t]||i;return w.useMemo(()=>({[`__scope${t}`]:{...l,[t]:u}}),[l,u])}};return s.scopeName=t,[r,KX(s,...e)]}function KX(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const a=r.reduce((l,{useScope:u,scopeName:d})=>{const h=u(i)[`__scope${d}`];return{...l,...h}},{});return w.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}function Vx(t){const e=t+"CollectionProvider",[n,r]=ai(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=x=>{const{scope:E,children:S}=x,k=Ee.useRef(null),T=Ee.useRef(new Map).current;return f.jsx(s,{scope:E,itemMap:T,collectionRef:k,children:S})};a.displayName=e;const l=t+"CollectionSlot",u=uu(l),d=Ee.forwardRef((x,E)=>{const{scope:S,children:k}=x,T=i(l,S),R=Ct(E,T.collectionRef);return f.jsx(u,{ref:R,children:k})});d.displayName=l;const p=t+"CollectionItemSlot",h="data-radix-collection-item",g=uu(p),v=Ee.forwardRef((x,E)=>{const{scope:S,children:k,...T}=x,R=Ee.useRef(null),j=Ct(E,R),A=i(p,S);return Ee.useEffect(()=>(A.itemMap.set(R,{ref:R,...T}),()=>void A.itemMap.delete(R))),f.jsx(g,{[h]:"",ref:j,children:k})});v.displayName=p;function b(x){const E=i(t+"CollectionConsumer",x);return Ee.useCallback(()=>{const k=E.collectionRef.current;if(!k)return[];const T=Array.from(k.querySelectorAll(`[${h}]`));return Array.from(E.itemMap.values()).sort((A,N)=>T.indexOf(A.ref.current)-T.indexOf(N.ref.current))},[E.collectionRef,E.itemMap])}return[{Provider:a,Slot:d,ItemSlot:v},b,r]}function Le(t,e,{checkForDefaultPrevented:n=!0}={}){return function(s){if(t?.(s),n===!1||!s.defaultPrevented)return e?.(s)}}var yr=globalThis?.document?w.useLayoutEffect:()=>{},XX=oA[" useInsertionEffect ".trim().toString()]||yr;function jo({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[s,i,a]=QX({defaultProp:e,onChange:n}),l=t!==void 0,u=l?t:s;{const p=w.useRef(t!==void 0);w.useEffect(()=>{const h=p.current;h!==l&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=l},[l,r])}const d=w.useCallback(p=>{if(l){const h=JX(p)?p(t):p;h!==t&&a.current?.(h)}else i(p)},[l,t,i,a]);return[u,d]}function QX({defaultProp:t,onChange:e}){const[n,r]=w.useState(t),s=w.useRef(n),i=w.useRef(e);return XX(()=>{i.current=e},[e]),w.useEffect(()=>{s.current!==n&&(i.current?.(n),s.current=n)},[n,s]),[n,r,i]}function JX(t){return typeof t=="function"}function ZX(t,e){return w.useReducer((n,r)=>e[n][r]??n,t)}var Ds=t=>{const{present:e,children:n}=t,r=eQ(e),s=typeof n=="function"?n({present:r.isPresent}):w.Children.only(n),i=Ct(r.ref,tQ(s));return typeof n=="function"||r.isPresent?w.cloneElement(s,{ref:i}):null};Ds.displayName="Presence";function eQ(t){const[e,n]=w.useState(),r=w.useRef(null),s=w.useRef(t),i=w.useRef("none"),a=t?"mounted":"unmounted",[l,u]=ZX(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const d=Kv(r.current);i.current=l==="mounted"?d:"none"},[l]),yr(()=>{const d=r.current,p=s.current;if(p!==t){const g=i.current,v=Kv(d);t?u("MOUNT"):v==="none"||d?.display==="none"?u("UNMOUNT"):u(p&&g!==v?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,u]),yr(()=>{if(e){let d;const p=e.ownerDocument.defaultView??window,h=v=>{const x=Kv(r.current).includes(CSS.escape(v.animationName));if(v.target===e&&x&&(u("ANIMATION_END"),!s.current)){const E=e.style.animationFillMode;e.style.animationFillMode="forwards",d=p.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=E)})}},g=v=>{v.target===e&&(i.current=Kv(r.current))};return e.addEventListener("animationstart",g),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{p.clearTimeout(d),e.removeEventListener("animationstart",g),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else u("ANIMATION_END")},[e,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:w.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function Kv(t){return t?.animationName||"none"}function tQ(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var nQ=oA[" useId ".trim().toString()]||(()=>{}),rQ=0;function Ei(t){const[e,n]=w.useState(nQ());return yr(()=>{n(r=>r??String(rQ++))},[t]),e?`radix-${e}`:""}var sQ=w.createContext(void 0);function og(t){const e=w.useContext(sQ);return t||e||"ltr"}function kr(t){const e=w.useRef(t);return w.useEffect(()=>{e.current=t}),w.useMemo(()=>(...n)=>e.current?.(...n),[])}function iQ(t,e=globalThis?.document){const n=kr(t);w.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var aQ="DismissableLayer",lk="dismissableLayer.update",oQ="dismissableLayer.pointerDownOutside",lQ="dismissableLayer.focusOutside",AP,Wz=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),lg=w.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:a,onDismiss:l,...u}=t,d=w.useContext(Wz),[p,h]=w.useState(null),g=p?.ownerDocument??globalThis?.document,[,v]=w.useState({}),b=Ct(e,N=>h(N)),x=Array.from(d.layers),[E]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),S=x.indexOf(E),k=p?x.indexOf(p):-1,T=d.layersWithOutsidePointerEventsDisabled.size>0,R=k>=S,j=dQ(N=>{const M=N.target,I=[...d.branches].some(O=>O.contains(M));!R||I||(s?.(N),a?.(N),N.defaultPrevented||l?.())},g),A=fQ(N=>{const M=N.target;[...d.branches].some(O=>O.contains(M))||(i?.(N),a?.(N),N.defaultPrevented||l?.())},g);return iQ(N=>{k===d.layers.size-1&&(r?.(N),!N.defaultPrevented&&l&&(N.preventDefault(),l()))},g),w.useEffect(()=>{if(p)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(AP=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),NP(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=AP)}},[p,g,n,d]),w.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),NP())},[p,d]),w.useEffect(()=>{const N=()=>v({});return document.addEventListener(lk,N),()=>document.removeEventListener(lk,N)},[]),f.jsx(ut.div,{...u,ref:b,style:{pointerEvents:T?R?"auto":"none":void 0,...t.style},onFocusCapture:Le(t.onFocusCapture,A.onFocusCapture),onBlurCapture:Le(t.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Le(t.onPointerDownCapture,j.onPointerDownCapture)})});lg.displayName=aQ;var cQ="DismissableLayerBranch",uQ=w.forwardRef((t,e)=>{const n=w.useContext(Wz),r=w.useRef(null),s=Ct(e,r);return w.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),f.jsx(ut.div,{...t,ref:s})});uQ.displayName=cQ;function dQ(t,e=globalThis?.document){const n=kr(t),r=w.useRef(!1),s=w.useRef(()=>{});return w.useEffect(()=>{const i=l=>{if(l.target&&!r.current){let u=function(){Yz(oQ,n,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(e.removeEventListener("click",s.current),s.current=u,e.addEventListener("click",s.current,{once:!0})):u()}else e.removeEventListener("click",s.current);r.current=!1},a=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),e.removeEventListener("pointerdown",i),e.removeEventListener("click",s.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function fQ(t,e=globalThis?.document){const n=kr(t),r=w.useRef(!1);return w.useEffect(()=>{const s=i=>{i.target&&!r.current&&Yz(lQ,n,{originalEvent:i},{discrete:!1})};return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function NP(){const t=new CustomEvent(lk);document.dispatchEvent(t)}function Yz(t,e,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?Vz(s,i):s.dispatchEvent(i)}var xS="focusScope.autoFocusOnMount",_S="focusScope.autoFocusOnUnmount",RP={bubbles:!1,cancelable:!0},hQ="FocusScope",Hx=w.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...a}=t,[l,u]=w.useState(null),d=kr(s),p=kr(i),h=w.useRef(null),g=Ct(e,x=>u(x)),v=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let x=function(T){if(v.paused||!l)return;const R=T.target;l.contains(R)?h.current=R:El(h.current,{select:!0})},E=function(T){if(v.paused||!l)return;const R=T.relatedTarget;R!==null&&(l.contains(R)||El(h.current,{select:!0}))},S=function(T){if(document.activeElement===document.body)for(const j of T)j.removedNodes.length>0&&El(l)};document.addEventListener("focusin",x),document.addEventListener("focusout",E);const k=new MutationObserver(S);return l&&k.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",E),k.disconnect()}}},[r,l,v.paused]),w.useEffect(()=>{if(l){MP.add(v);const x=document.activeElement;if(!l.contains(x)){const S=new CustomEvent(xS,RP);l.addEventListener(xS,d),l.dispatchEvent(S),S.defaultPrevented||(pQ(bQ(Kz(l)),{select:!0}),document.activeElement===x&&El(l))}return()=>{l.removeEventListener(xS,d),setTimeout(()=>{const S=new CustomEvent(_S,RP);l.addEventListener(_S,p),l.dispatchEvent(S),S.defaultPrevented||El(x??document.body,{select:!0}),l.removeEventListener(_S,p),MP.remove(v)},0)}}},[l,d,p,v]);const b=w.useCallback(x=>{if(!n&&!r||v.paused)return;const E=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,S=document.activeElement;if(E&&S){const k=x.currentTarget,[T,R]=mQ(k);T&&R?!x.shiftKey&&S===R?(x.preventDefault(),n&&El(T,{select:!0})):x.shiftKey&&S===T&&(x.preventDefault(),n&&El(R,{select:!0})):S===k&&x.preventDefault()}},[n,r,v.paused]);return f.jsx(ut.div,{tabIndex:-1,...a,ref:g,onKeyDown:b})});Hx.displayName=hQ;function pQ(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(El(r,{select:e}),document.activeElement!==n)return}function mQ(t){const e=Kz(t),n=jP(e,t),r=jP(e.reverse(),t);return[n,r]}function Kz(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function jP(t,e){for(const n of t)if(!gQ(n,{upTo:e}))return n}function gQ(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function vQ(t){return t instanceof HTMLInputElement&&"select"in t}function El(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&vQ(t)&&e&&t.select()}}var MP=yQ();function yQ(){let t=[];return{add(e){const n=t[0];e!==n&&n?.pause(),t=OP(t,e),t.unshift(e)},remove(e){t=OP(t,e),t[0]?.resume()}}}function OP(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function bQ(t){return t.filter(e=>e.tagName!=="A")}var xQ="Portal",cg=w.forwardRef((t,e)=>{const{container:n,...r}=t,[s,i]=w.useState(!1);yr(()=>i(!0),[]);const a=n||s&&globalThis?.document?.body;return a?Uz.createPortal(f.jsx(ut.div,{...r,ref:e}),a):null});cg.displayName=xQ;var wS=0;function dA(){w.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??PP()),document.body.insertAdjacentElement("beforeend",t[1]??PP()),wS++,()=>{wS===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),wS--}},[])}function PP(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var Sa=function(){return Sa=Object.assign||function(e){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Sa.apply(this,arguments)};function Xz(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(n[r[s]]=t[r[s]]);return n}function _Q(t,e,n){if(n||arguments.length===2)for(var r=0,s=e.length,i;r<s;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}var qy="right-scroll-bar-position",Vy="width-before-scroll-bar",wQ="with-scroll-bars-hidden",SQ="--removed-body-scroll-bar-size";function SS(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function EQ(t,e){var n=w.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=e,n.facade}var kQ=typeof window<"u"?w.useLayoutEffect:w.useEffect,IP=new WeakMap;function TQ(t,e){var n=EQ(null,function(r){return t.forEach(function(s){return SS(s,r)})});return kQ(function(){var r=IP.get(n);if(r){var s=new Set(r),i=new Set(t),a=n.current;s.forEach(function(l){i.has(l)||SS(l,null)}),i.forEach(function(l){s.has(l)||SS(l,a)})}IP.set(n,t)},[t]),n}function CQ(t){return t}function AQ(t,e){e===void 0&&(e=CQ);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(i){var a=e(i,r);return n.push(a),function(){n=n.filter(function(l){return l!==a})}},assignSyncMedium:function(i){for(r=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){r=!0;var a=[];if(n.length){var l=n;n=[],l.forEach(i),a=n}var u=function(){var p=a;a=[],p.forEach(i)},d=function(){return Promise.resolve().then(u)};d(),n={push:function(p){a.push(p),d()},filter:function(p){return a=a.filter(p),n}}}};return s}function NQ(t){t===void 0&&(t={});var e=AQ(null);return e.options=Sa({async:!0,ssr:!1},t),e}var Qz=function(t){var e=t.sideCar,n=Xz(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return w.createElement(r,Sa({},n))};Qz.isSideCarExport=!0;function RQ(t,e){return t.useMedium(e),Qz}var Jz=NQ(),ES=function(){},Gx=w.forwardRef(function(t,e){var n=w.useRef(null),r=w.useState({onScrollCapture:ES,onWheelCapture:ES,onTouchMoveCapture:ES}),s=r[0],i=r[1],a=t.forwardProps,l=t.children,u=t.className,d=t.removeScrollBar,p=t.enabled,h=t.shards,g=t.sideCar,v=t.noRelative,b=t.noIsolation,x=t.inert,E=t.allowPinchZoom,S=t.as,k=S===void 0?"div":S,T=t.gapMode,R=Xz(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=g,A=TQ([n,e]),N=Sa(Sa({},R),s);return w.createElement(w.Fragment,null,p&&w.createElement(j,{sideCar:Jz,removeScrollBar:d,shards:h,noRelative:v,noIsolation:b,inert:x,setCallbacks:i,allowPinchZoom:!!E,lockRef:n,gapMode:T}),a?w.cloneElement(w.Children.only(l),Sa(Sa({},N),{ref:A})):w.createElement(k,Sa({},N,{className:u,ref:A}),l))});Gx.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Gx.classNames={fullWidth:Vy,zeroRight:qy};var jQ=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function MQ(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=jQ();return e&&t.setAttribute("nonce",e),t}function OQ(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function PQ(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var IQ=function(){var t=0,e=null;return{add:function(n){t==0&&(e=MQ())&&(OQ(e,n),PQ(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},DQ=function(){var t=IQ();return function(e,n){w.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},Zz=function(){var t=DQ(),e=function(n){var r=n.styles,s=n.dynamic;return t(r,s),null};return e},LQ={left:0,top:0,right:0,gap:0},kS=function(t){return parseInt(t||"",10)||0},$Q=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],s=e[t==="padding"?"paddingRight":"marginRight"];return[kS(n),kS(r),kS(s)]},zQ=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return LQ;var e=$Q(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},FQ=Zz(),tf="data-scroll-locked",UQ=function(t,e,n,r){var s=t.left,i=t.top,a=t.right,l=t.gap;return n===void 0&&(n="margin"),`
|
|
50
50
|
.`.concat(wQ,` {
|
|
51
51
|
overflow: hidden `).concat(r,`;
|
|
52
52
|
padding-right: `).concat(l,"px ").concat(r,`;
|
|
@@ -1770,9 +1770,9 @@ For more information, see https://radix-ui.com/primitives/docs/components/alert-
|
|
|
1770
1770
|
|
|
1771
1771
|
<\/script>
|
|
1772
1772
|
</body>
|
|
1773
|
-
</html>`,Mq=1,FD=2,Oq=3,UD=4,Pq=5,BD=Symbol.for("quilt.threads.serialize"),Xde=Symbol.for("quilt.threads.transferable");class Qde extends AbortController{constructor(...e){super();const n=e.find(r=>r.aborted);if(n)this.abort(n.reason);else{const r=i=>this.abort(i.target.reason),s={signal:this.signal};for(const i of e)i.addEventListener("abort",r,s)}}}class qD extends Error{constructor(){super("You attempted to call a function on a closed thread.")}}let Jde="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";function Iq(t=21){let e="",n=crypto.getRandomValues(new Uint8Array(t));for(let r=0;r<t;r++)e+=Jde[63&n[r]];return e}var Up,Dd,Bp,Qy,NT,Dq;class Zde{constructor(){Zi(this,NT),Zi(this,Up,new Map),Zi(this,Dd,new Map),Zi(this,Bp,new Map),Zi(this,Qy,new WeakMap)}get(e){return Pn(this,Dd).get(e)}release(e){const n=Pn(this,Dd).get(e);return n&&(Pn(this,Dd).delete(e),Pn(this,Up).delete(n)),!!n}serialize(e){let n=Pn(this,Up).get(e);return n==null&&(n=Iq(),Pn(this,Up).set(e,n),Pn(this,Dd).set(n,e)),n}deserialize(e,n){var r,s;let i=(r=Pn(this,Bp).get(e))==null?void 0:r.deref();return i||(i=(...a)=>{if(!Pn(this,Bp).has(e))throw new Error("You attempted to call a function that was already revoked.");return n.call((l,u,d)=>{n.messages.send([Oq,l,e,u],d)},a)},(s=Yr(this,NT,Dq).call(this,n))==null||s.register(i,e),Pn(this,Bp).set(e,new WeakRef(i)),i)}}Up=new WeakMap,Dd=new WeakMap,Bp=new WeakMap,Qy=new WeakMap,NT=new WeakSet,Dq=function(t){let e=Pn(this,Qy).get(t);if(!(typeof FinalizationRegistry>"u"))return e||(e=new FinalizationRegistry(n=>{t.messages.send([Pq,n])}),Pn(this,Qy).set(t,e)),e};function efe(t){return t!=null&&(Symbol.asyncIterator in t||Symbol.iterator in t)&&typeof t.next=="function"}function VD(t){if(t==null||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e==null||e===Object.prototype}const aE="_@f",HD="_@i";var Jp,Zp,bi,Jy,Tl;class tfe{constructor(e){Zi(this,bi),Zi(this,Jp),Zi(this,Zp),TT(this,Jp,e?.serialize),TT(this,Zp,e?.deserialize)}serialize(e,n,r){return Yr(this,bi,Jy).call(this,e,n,r)}deserialize(e,n){return Yr(this,bi,Tl).call(this,e,n)}}Jp=new WeakMap,Zp=new WeakMap,bi=new WeakSet,Jy=function(t,e,n,r=new Map,s=!1){if(t==null)return t;if(r.has(t))return r.get(t);if(r.set(t,void 0),typeof t=="object"){if(Pn(this,Jp)&&!s){const l=Pn(this,Jp).call(this,t,u=>Yr(this,bi,Jy).call(this,u,e,n,r,!0),e,n);if(l!==void 0)return r.set(t,l),l}if(t[Xde])return n?.push(t),r.set(t,t),t;const i=l=>Yr(this,bi,Jy).call(this,l,e,n,r);if(typeof t[BD]=="function"){const l=t[BD]({serialize:i});return r.set(t,l),l}if(Array.isArray(t)){const l=t.map(u=>i(u));return r.set(t,l),l}if(t instanceof Map){const l=[...t.entries()].map(([d,p])=>[i(d),i(p)]),u=new Map(l);return r.set(t,u),u}if(t instanceof Set){const l=[...t].map(d=>i(d)),u=new Set(l);return r.set(t,u),u}const a=efe(t);if(VD(t)||a){const l={};for(const u of Object.keys(t))l[u]=i(t[u]);return a&&(l.next??(l.next=i(t.next.bind(t))),l.return??(l.return=i(t.return.bind(t))),l.throw??(l.throw=i(t.throw.bind(t))),l[HD]=!0),r.set(t,l),l}}if(typeof t=="function"){const i=e.functions.serialize(t,e,n),a={[aE]:i};return r.set(t,a),a}return r.set(t,t),t},Tl=function(t,e,n=!1){if(t==null)return t;if(typeof t=="object"){if(Pn(this,Zp)&&!n){const s=Pn(this,Zp).call(this,t,i=>Yr(this,bi,Tl).call(this,i,e,!0),e);if(s!==void 0)return s}if(t==null)return t;if(Array.isArray(t))return t.map(s=>Yr(this,bi,Tl).call(this,s,e));if(t instanceof Map)return new Map([...t].map(([s,i])=>[Yr(this,bi,Tl).call(this,s,e),Yr(this,bi,Tl).call(this,i,e)]));if(t instanceof Set)return new Set([...t].map(s=>Yr(this,bi,Tl).call(this,s,e)));if(aE in t)return e.functions.deserialize(t[aE],e);if(!VD(t))return t;const r={};for(const s of Object.keys(t))s===HD?r[Symbol.asyncIterator]=()=>r:r[s]=Yr(this,bi,Tl).call(this,t[s],e);return r}return t};var Ld,Gc,Cl,RT,Lq,jT,$q;class nfe{constructor(e,{imports:n,exports:r,functions:s=new Zde,serialization:i=new tfe,signal:a}={}){Zi(this,Cl),Zi(this,Ld),Zi(this,Gc,new Map);var l,u,d,p;this.messages=e,TT(this,Ld,a?new Qde(a):new AbortController),this.exports=r??{},this.imports=rfe(Yr(this,Cl,Lq).bind(this),n),this.functions=s,this.serialization=i,(u=(l=this.functions).start)==null||u.call(l,this),(p=(d=this.serialization).start)==null||p.call(d,this),this.signal.addEventListener("abort",()=>{for(const h of Pn(this,Gc).keys())Yr(this,Cl,jT).call(this,h,void 0,new qD);Pn(this,Gc).clear()},{once:!0}),e.listen(async h=>{if(!(Array.isArray(h)&&typeof h[0]=="number"))return;const g=h;switch(g[0]){case Mq:{const[,v,b,x]=g,E=this.exports[b]??(()=>{throw new Error(`No '${b}' method is exported from this thread`)});await Yr(this,Cl,RT).call(this,E,x,(S,k,T)=>{this.messages.send([FD,v,S,k],T)});break}case Oq:{const[,v,b,x]=g,E=this.functions.get(b,this)??sfe;await Yr(this,Cl,RT).call(this,E,x,(S,k,T)=>{this.messages.send([UD,v,S,k],T)});break}case FD:case UD:{Yr(this,Cl,jT).call(this,...g.slice(1));break}case Pq:{const v=g[1];this.functions.release(v,this);break}}},{signal:this.signal})}get signal(){return Pn(this,Ld).signal}get closed(){return Pn(this,Ld).signal.aborted}close(){Pn(this,Ld).abort()}call(e,n){if(this.closed)return Promise.reject(new qD);const r=[],s=this.serialization.serialize(n,this,r),i=Iq(),a=Yr(this,Cl,$q).call(this,i);return e(i,s,r),a}}Ld=new WeakMap,Gc=new WeakMap,Cl=new WeakSet,RT=async function(t,e,n){try{const r=this.functions.call?await this.functions.call(t,e,this):await t(...this.serialization.deserialize(e,this)),s=[],i=this.serialization.serialize(r,this,s);n(i,void 0,s)}catch(r){n(void 0,this.serialization.serialize(r,this))}},Lq=function(t){return(...e)=>{try{if(typeof t!="string"&&typeof t!="number")throw new Error(`Can’t call a symbol method on a thread: ${t.toString()}`);return this.call((n,r,s)=>{this.messages.send([Mq,n,t,r],s)},e)}catch(n){return Promise.reject(n)}}},jT=function(...t){const e=t[0],n=Pn(this,Gc).get(e);n&&(n(...t),Pn(this,Gc).delete(e))},$q=function(t){const e=new Promise((n,r)=>{Pn(this,Gc).set(t,(s,i,a)=>{a==null?n(this.serialization.deserialize(i,this)):r(this.serialization.deserialize(a,this))})});return Object.defineProperty(e,Symbol.asyncIterator,{async*value(){const n=await e;Object.defineProperty(n,Symbol.asyncIterator,{value:()=>n}),yield*n}}),e};function rfe(t,e){let n;if(e==null){if(typeof Proxy!="function")throw new Error("You must pass an array of callable methods in environments without Proxies.");const r=new Map;n=new Proxy({},{get(s,i){if(r.has(i))return r.get(i);const a=t(i);return r.set(i,a),a}})}else{n={};for(const r of e)Object.defineProperty(n,r,{value:t(r),writable:!1,configurable:!0,enumerable:!0})}return n}function sfe(){throw new Error("You attempted to call a function that is not stored. It may have already been released.")}const ife="quilt.threads.ping",GD="quilt.threads.pong";function afe(t,{targetOrigin:e="*"}={}){let n=!1;const r=function(i,a){t.postMessage(i,e,a)},s=new Promise(i=>{const a=new AbortController;globalThis.window.addEventListener("message",l=>{l.source===t&&l.data===GD&&(n=!0,a.abort(),i())},{signal:a.signal}),a.signal.addEventListener("abort",()=>i(),{once:!0}),r(ife)});return{send(i,a){return n?r(i,a):s.then(()=>{if(n)return r(i,a)})},listen(i,{signal:a}){self.addEventListener("message",l=>{l.source===t&&l.data!==GD&&i(l.data)},{signal:a})}}}class ofe extends nfe{constructor(e,{targetOrigin:n="*",...r}={}){super(afe(e.contentWindow,{targetOrigin:n}),r),this.iframe=e}}const zq=Ee.forwardRef(({content:t,children:e,...n},r)=>f.jsx("span",{ref:r,...n,children:t||e}));zq.displayName="UIText";const Fq=Ee.forwardRef(({label:t,onPress:e,onClick:n,children:r,...s},i)=>f.jsx("button",{ref:i,onClick:a=>{e&&e(),n&&n(a)},style:{padding:"8px 16px",backgroundColor:"#007bff",color:"white",border:"none",borderRadius:"4px",cursor:"pointer"},...s,children:t||r}));Fq.displayName="UIButton";const Uq=Ee.forwardRef(({direction:t="vertical",spacing:e="8",align:n="stretch",justify:r="flex-start",children:s,...i},a)=>f.jsx("div",{ref:a,style:{display:"flex",flexDirection:t==="horizontal"?"row":"column",gap:`${e}px`,alignItems:n,justifyContent:r},...i,children:s}));Uq.displayName="UIStack";const Bq=Ee.forwardRef(({src:t,alt:e,width:n,height:r,children:s,...i},a)=>f.jsx("img",{ref:a,src:t,alt:e,width:n,height:r,style:{maxWidth:"100%",height:"auto",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.1)"},...i}));Bq.displayName="UIImage";const qq={name:"basic",elements:[{tagName:"ui-text",component:zq,propMapping:{content:"content"},eventMapping:{}},{tagName:"ui-button",component:Fq,propMapping:{label:"label"},eventMapping:{press:"onPress"}},{tagName:"ui-stack",component:Uq,propMapping:{direction:"direction",spacing:"spacing",align:"align",justify:"justify"},eventMapping:{}},{tagName:"ui-image",component:Bq,propMapping:{src:"src",alt:"alt",width:"width",height:"height"},eventMapping:{}}]},lfe=({receiver:t})=>{const e=w.useRef(null);return w.useEffect(()=>{if(e.current)return t.connect(e.current),()=>{t.disconnect()}},[t]),f.jsx("div",{ref:e,"data-testid":"standard-dom-renderer-container"})},cfe=({resource:t,library:e,remoteElements:n=[],onUIAction:r})=>{const s=w.useRef(null),i=w.useRef(null),[a,l]=w.useState(null),u=w.useMemo(()=>(t.mimeType||"").includes("framework=react")?"react":"webcomponents",[t.mimeType]),d=`${e?.name}-${u}`,{receiver:p,components:h}=w.useMemo(()=>{switch(u){case"react":{const v=new Fde,b=e||qq,x=new Map;return b&&b.elements.forEach(E=>{const S=Gde(E.component);x.set(E.tagName,S)}),{receiver:v,components:x}}case"webcomponents":default:return{receiver:new Ude,components:null}}},[t,e,n]);w.useEffect(()=>{function v(b){var x;if(s.current&&b.source===s.current.contentWindow){const E=b.data;if(!E)return;(x=r?.(E))==null||x.catch(S=>{console.error("Error handling UI action result in RemoteDOMResourceRenderer:",S)})}}return window.addEventListener("message",v),()=>window.removeEventListener("message",v)},[r]),w.useEffect(()=>{const v=i.current;return i.current=null,()=>{v?.close()}},[d]);const g=()=>{const v=s.current;if(!v||i.current)return;const b=new ofe(v);i.current=b;const{code:x,error:E}=jde(t);if(E){l(E);return}if(x&&p!=null&&p.connection){const S={code:x,remoteElements:n,useReactRenderer:u==="react",componentLibrary:e?.name};b.imports.render(S,p.connection).catch(k=>console.error("Error calling remote render:",k))}};return a?f.jsx("p",{className:"text-red-500",children:a}):f.jsxs(f.Fragment,{children:[f.jsx("iframe",{ref:s,srcDoc:Kde,sandbox:"allow-scripts",style:{display:"none"},title:"Remote DOM Sandbox",onLoad:g},d),u==="react"&&h?f.jsx(Yde,{receiver:p,components:h}):f.jsx(lfe,{receiver:p})]})};function ufe(t){var e;if(t.contentType)return t.contentType;if(t.mimeType==="text/html")return"rawHtml";if(t.mimeType==="text/uri-list")return"externalUrl";if((e=t.mimeType)!=null&&e.startsWith("application/vnd.mcp-ui.remote-dom"))return"remoteDom"}const DN=t=>{const{resource:e,onUIAction:n,supportedContentTypes:r,htmlProps:s,remoteDomProps:i}=t,a=ufe(e);if(r&&a&&!r.includes(a))return f.jsxs("p",{className:"text-red-500",children:["Unsupported content type: ",a,"."]});switch(a){case"rawHtml":{const{proxy:l,...u}=s||{};return f.jsx(CT,{resource:e,onUIAction:n,...u})}case"externalUrl":return f.jsx(CT,{resource:e,onUIAction:n,...s});case"remoteDom":return f.jsx(cfe,{resource:e,onUIAction:n,library:i?.library||qq,...i});default:return f.jsx("p",{className:"text-red-500",children:"Unsupported resource type."})}};DN.displayName="UIResourceRenderer";function Vq({componentUrl:t,toolCall:e,toolResult:n,onCallTool:r,onSendFollowup:s,className:i,serverId:a,toolMeta:l}){const u=w.useRef(null),[d,p]=w.useState(!1),[h,g]=w.useState(null),[v,b]=w.useState(null),x=`openai-widget-state:${e.name}:${e.id}`;return w.useEffect(()=>{if(t.startsWith("ui://")&&a){let E=null;if(n?.result){const k=n.result;if(k.structuredContent)E=k.structuredContent;else if(Array.isArray(k)&&k[0]){const T=k[0];T.output?.value?.structuredContent?E=T.output.value.structuredContent:T.structuredContent?E=T.structuredContent:T.output?.value&&(E=T.output.value)}E||(E=k)}(async()=>{try{await fetch("/api/mcp/resources/widget/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({serverId:a,uri:t,toolInput:e.parameters,toolOutput:E,toolId:e.id})});const k=`/api/mcp/resources/widget/${e.id}`;b(k)}catch(k){console.error("Error storing widget data:",k),g(k instanceof Error?k.message:"Failed to prepare widget")}})()}else(t.startsWith("http://")||t.startsWith("https://"))&&b(t)},[t,a,e.parameters,e.id,n?.result]),w.useEffect(()=>{if(!v)return;const E=async T=>{if(!(!u.current||T.source!==u.current.contentWindow))switch(T.data.type){case"openai:setWidgetState":try{localStorage.setItem(x,JSON.stringify(T.data.state))}catch(R){throw R}break;case"openai:callTool":if(r)try{const R=await r(T.data.toolName,T.data.params||{});u.current?.contentWindow?.postMessage({type:"openai:callTool:response",requestId:T.data.requestId,result:R},"*")}catch(R){u.current?.contentWindow?.postMessage({type:"openai:callTool:response",requestId:T.data.requestId,error:R instanceof Error?R.message:"Unknown error"},"*")}break;case"openai:sendFollowup":s&&s(T.data.message);break}};window.addEventListener("message",E);const S=()=>{p(!0),g(null)},k=T=>{g("Failed to load component")};return u.current?.addEventListener("load",S),u.current?.addEventListener("error",k),()=>{window.removeEventListener("message",E),u.current?.removeEventListener("load",S),u.current?.removeEventListener("error",k)}},[v,x,r,s]),f.jsxs("div",{className:i,children:[h&&f.jsx("div",{className:"bg-red-50/30 dark:bg-red-950/20 border border-red-200/50 dark:border-red-800/50 rounded-lg p-4 mb-2",children:f.jsxs("p",{className:"text-sm text-red-600 dark:text-red-400",children:["Failed to load component: ",h]})}),!d&&v&&f.jsx("div",{className:"bg-blue-50/30 dark:bg-blue-950/20 border border-blue-200/50 dark:border-blue-800/50 rounded-lg p-4 mb-2",children:f.jsx("p",{className:"text-sm text-blue-600 dark:text-blue-400",children:"Loading component..."})}),v?f.jsx("iframe",{ref:u,src:v,className:"w-full border rounded-md bg-white dark:bg-gray-900",style:{minHeight:"400px",height:"600px",maxHeight:"80vh",border:"1px solid rgba(128, 128, 128, 0.3)"},sandbox:"allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox",title:`OpenAI Component: ${e.name}`,allow:"web-share"}):f.jsx("div",{className:"bg-yellow-50/30 dark:bg-yellow-950/20 border border-yellow-200/50 dark:border-yellow-800/50 rounded-lg p-4",children:f.jsx("p",{className:"text-sm text-yellow-600 dark:text-yellow-400",children:"Preparing component URL..."})})]})}function dfe(t,e,n,r){function s(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function l(p){try{d(r.next(p))}catch(h){a(h)}}function u(p){try{d(r.throw(p))}catch(h){a(h)}}function d(p){p.done?i(p.value):s(p.value).then(l,u)}d((r=r.apply(t,[])).next())})}var ffe=function(){var t=document.getSelection();if(!t.rangeCount)return function(){};for(var e=document.activeElement,n=[],r=0;r<t.rangeCount;r++)n.push(t.getRangeAt(r));switch(e.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":e.blur();break;default:e=null;break}return t.removeAllRanges(),function(){t.type==="Caret"&&t.removeAllRanges(),t.rangeCount||n.forEach(function(s){t.addRange(s)}),e&&e.focus()}},hfe=ffe,WD={"text/plain":"Text","text/html":"Url",default:"Text"},pfe="Copy to clipboard: #{key}, Enter";function mfe(t){var e=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return t.replace(/#{\s*key\s*}/g,e)}function gfe(t,e){var n,r,s,i,a,l,u=!1;e||(e={}),n=e.debug||!1;try{s=hfe(),i=document.createRange(),a=document.getSelection(),l=document.createElement("span"),l.textContent=t,l.ariaHidden="true",l.style.all="unset",l.style.position="fixed",l.style.top=0,l.style.clip="rect(0, 0, 0, 0)",l.style.whiteSpace="pre",l.style.webkitUserSelect="text",l.style.MozUserSelect="text",l.style.msUserSelect="text",l.style.userSelect="text",l.addEventListener("copy",function(p){if(p.stopPropagation(),e.format)if(p.preventDefault(),typeof p.clipboardData>"u"){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var h=WD[e.format]||WD.default;window.clipboardData.setData(h,t)}else p.clipboardData.clearData(),p.clipboardData.setData(e.format,t);e.onCopy&&(p.preventDefault(),e.onCopy(p.clipboardData))}),document.body.appendChild(l),i.selectNodeContents(l),a.addRange(i);var d=document.execCommand("copy");if(!d)throw new Error("copy command was unsuccessful");u=!0}catch(p){n&&console.error("unable to copy using execCommand: ",p),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(e.format||"text",t),e.onCopy&&e.onCopy(window.clipboardData),u=!0}catch(h){n&&console.error("unable to copy using clipboardData: ",h),n&&console.error("falling back to prompt"),r=mfe("message"in e?e.message:pfe),window.prompt(r,t)}}finally{a&&(typeof a.removeRange=="function"?a.removeRange(i):a.removeAllRanges()),l&&document.body.removeChild(l),s()}return u}var vfe=gfe;function ac(t){return Object.prototype.toString.call(t)==="[object Object]"}function em(t){return Array.isArray(t)?t.length:ac(t)?Object.keys(t).length:0}function yfe(t,e){if(typeof t=="string")return t;try{return JSON.stringify(t,(n,r)=>{switch(typeof r){case"bigint":return String(r)+"n";case"number":case"boolean":case"object":case"string":return r;default:return String(r)}},e)}catch(n){return`${n.name}: ${n.message}`||"JSON.stringify failed"}}function bfe(t){return dfe(this,void 0,void 0,function*(){try{yield navigator.clipboard.writeText(t)}catch{vfe(t)}})}function YD(t,e,n,r,s,i){if(i&&i.collapsed!==void 0)return!!i.collapsed;if(typeof r=="boolean")return r;if(typeof r=="number"&&e>r)return!0;const a=em(t);if(typeof r=="function"){const l=LN(r,[{node:t,depth:e,indexOrName:n,size:a}]);if(typeof l=="boolean")return l}return!!(Array.isArray(t)&&a>s||ac(t)&&a>s)}function KD(t,e,n,r,s,i){if(i&&i.collapsed!==void 0)return!!i.collapsed;if(typeof r=="boolean")return r;if(typeof r=="number"&&e>r)return!0;const a=Math.ceil(t.length/100);if(typeof r=="function"){const l=LN(r,[{node:t,depth:e,indexOrName:n,size:a}]);if(typeof l=="boolean")return l}return!!(Array.isArray(t)&&a>s||ac(t)&&a>s)}function df(t,e,n){return typeof t=="boolean"?t:!!(typeof t=="number"&&e>t||t==="collapsed"&&n||t==="expanded"&&!n)}function LN(t,e){try{return t(...e)}catch(n){reportError(n)}}function Hq(t){if(t===!0||ac(t)&&t.add===!0)return!0}function XD(t){if(t===!0||ac(t)&&t.edit===!0)return!0}function $N(t){if(t===!0||ac(t)&&t.delete===!0)return!0}function xfe(t){return typeof t=="function"}function Gq(t){return!t||t.add===void 0||!!t.add}function QD(t){return!t||t.edit===void 0||!!t.edit}function zN(t){return!t||t.delete===void 0||!!t.delete}function P0(t){return!t||t.enableClipboard===void 0||!!t.enableClipboard}function _fe(t){return!t||t.matchesURL===void 0||!!t.matchesURL}function wfe(t,e){return t==="string"?e.trim().replace(/^\"([\s\S]+?)\"$/,"$1"):e}var JD;function MT(){return MT=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},MT.apply(this,arguments)}var FN=function(e){return w.createElement("svg",MT({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},e),JD||(JD=w.createElement("path",{fill:"currentColor",d:"M12.473 5.806a.666.666 0 0 0-.946 0L8.473 8.86a.667.667 0 0 1-.946 0L4.473 5.806a.667.667 0 1 0-.946.94l3.06 3.06a2 2 0 0 0 2.826 0l3.06-3.06a.667.667 0 0 0 0-.94Z"})))},ZD;function OT(){return OT=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},OT.apply(this,arguments)}var Sfe=function(e){return w.createElement("svg",OT({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},e),ZD||(ZD=w.createElement("path",{fill:"currentColor",d:"M17.542 2.5h-4.75a3.963 3.963 0 0 0-3.959 3.958v4.75a3.963 3.963 0 0 0 3.959 3.959h4.75a3.963 3.963 0 0 0 3.958-3.959v-4.75A3.963 3.963 0 0 0 17.542 2.5Zm2.375 8.708a2.378 2.378 0 0 1-2.375 2.375h-4.75a2.378 2.378 0 0 1-2.375-2.375v-4.75a2.378 2.378 0 0 1 2.375-2.375h4.75a2.378 2.378 0 0 1 2.375 2.375v4.75Zm-4.75 6.334a3.963 3.963 0 0 1-3.959 3.958h-4.75A3.963 3.963 0 0 1 2.5 17.542v-4.75a3.963 3.963 0 0 1 3.958-3.959.791.791 0 1 1 0 1.584 2.378 2.378 0 0 0-2.375 2.375v4.75a2.378 2.378 0 0 0 2.375 2.375h4.75a2.378 2.378 0 0 0 2.375-2.375.792.792 0 1 1 1.584 0Z"})))},eL,tL;function PT(){return PT=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},PT.apply(this,arguments)}var Efe=function(e){return w.createElement("svg",PT({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},e),eL||(eL=w.createElement("path",{fill:"currentColor",d:"M17.25 3H6.75A3.755 3.755 0 0 0 3 6.75v10.5A3.754 3.754 0 0 0 6.75 21h10.5A3.754 3.754 0 0 0 21 17.25V6.75A3.755 3.755 0 0 0 17.25 3Zm2.25 14.25a2.25 2.25 0 0 1-2.25 2.25H6.75a2.25 2.25 0 0 1-2.25-2.25V6.75A2.25 2.25 0 0 1 6.75 4.5h10.5a2.25 2.25 0 0 1 2.25 2.25v10.5Z"})),tL||(tL=w.createElement("path",{fill:"#14C786",d:"M10.312 14.45 7.83 11.906a.625.625 0 0 0-.896 0 .659.659 0 0 0 0 .918l2.481 2.546a1.264 1.264 0 0 0 .896.381 1.237 1.237 0 0 0 .895-.38l5.858-6.011a.658.658 0 0 0 0-.919.625.625 0 0 0-.896 0l-5.857 6.01Z"})))};function I0({node:t,nodeMeta:e}){const{customizeCopy:n,CopyComponent:r,CopiedComponent:s}=w.useContext(oc),[i,a]=w.useState(!1),l=u=>{u.stopPropagation();const d=n(t,e);typeof d=="string"&&d&&bfe(d),a(!0),setTimeout(()=>a(!1),3e3)};return i?typeof s=="function"?f.jsx(s,{className:"json-view--copy",style:{display:"inline-block"}}):f.jsx(Efe,{className:"json-view--copy",style:{display:"inline-block"}}):typeof r=="function"?f.jsx(r,{onClick:l,className:"json-view--copy"}):f.jsx(Sfe,{onClick:l,className:"json-view--copy"})}function IT({indexOrName:t,value:e,depth:n,deleteHandle:r,editHandle:s,parent:i,parentPath:a}){const{displayArrayIndex:l}=w.useContext(oc),u=Array.isArray(i);return f.jsxs("div",Object.assign({className:"json-view--pair"},{children:[!u||u&&l?f.jsxs(f.Fragment,{children:[f.jsx("span",Object.assign({className:typeof t=="number"?"json-view--index":"json-view--property"},{children:t})),":"," "]}):f.jsx(f.Fragment,{}),f.jsx(Yq,{node:e,depth:n+1,deleteHandle:(d,p)=>r(d,p),editHandle:(d,p,h,g)=>s(d,p,h,g),parent:i,indexOrName:t,parentPath:a})]}))}var nL,rL;function DT(){return DT=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},DT.apply(this,arguments)}var UN=function(e){return w.createElement("svg",DT({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},e),nL||(nL=w.createElement("path",{fill:"currentColor",d:"M18.75 6h-2.325a3.757 3.757 0 0 0-3.675-3h-1.5a3.757 3.757 0 0 0-3.675 3H5.25a.75.75 0 0 0 0 1.5H6v9.75A3.754 3.754 0 0 0 9.75 21h4.5A3.754 3.754 0 0 0 18 17.25V7.5h.75a.75.75 0 1 0 0-1.5Zm-7.5-1.5h1.5A2.255 2.255 0 0 1 14.872 6H9.128a2.255 2.255 0 0 1 2.122-1.5Zm5.25 12.75a2.25 2.25 0 0 1-2.25 2.25h-4.5a2.25 2.25 0 0 1-2.25-2.25V7.5h9v9.75Z"})),rL||(rL=w.createElement("path",{fill:"#DA0000",d:"M10.5 16.5a.75.75 0 0 0 .75-.75v-4.5a.75.75 0 1 0-1.5 0v4.5a.75.75 0 0 0 .75.75ZM13.5 16.5a.75.75 0 0 0 .75-.75v-4.5a.75.75 0 1 0-1.5 0v4.5a.75.75 0 0 0 .75.75Z"})))},sL,iL;function LT(){return LT=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},LT.apply(this,arguments)}var Wq=function(e){return w.createElement("svg",LT({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},e),sL||(sL=w.createElement("path",{fill:"currentColor",d:"M21 6.75v10.5A3.754 3.754 0 0 1 17.25 21H6.75A3.754 3.754 0 0 1 3 17.25V6.75A3.754 3.754 0 0 1 6.75 3h10.5A3.754 3.754 0 0 1 21 6.75Zm-1.5 0c0-1.24-1.01-2.25-2.25-2.25H6.75C5.51 4.5 4.5 5.51 4.5 6.75v10.5c0 1.24 1.01 2.25 2.25 2.25h10.5c1.24 0 2.25-1.01 2.25-2.25V6.75Z"})),iL||(iL=w.createElement("path",{fill:"#14C786",d:"M15 12.75a.75.75 0 1 0 0-1.5h-2.25V9a.75.75 0 1 0-1.5 0v2.25H9a.75.75 0 1 0 0 1.5h2.25V15a.75.75 0 1 0 1.5 0v-2.25H15Z"})))},aL,oL;function $T(){return $T=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},$T.apply(this,arguments)}var BN=function(e){return w.createElement("svg",$T({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},e),aL||(aL=w.createElement("path",{fill:"currentColor",d:"M12 3a9 9 0 1 0 9 9 9.01 9.01 0 0 0-9-9Zm0 16.5a7.5 7.5 0 1 1 7.5-7.5 7.509 7.509 0 0 1-7.5 7.5Z"})),oL||(oL=w.createElement("path",{fill:"#14C786",d:"m10.85 13.96-1.986-2.036a.5.5 0 0 0-.716 0 .527.527 0 0 0 0 .735l1.985 2.036a1.01 1.01 0 0 0 .717.305.99.99 0 0 0 .716-.305l4.686-4.808a.526.526 0 0 0 0-.735.5.5 0 0 0-.716 0l-4.687 4.809Z"})))},lL,cL;function zT(){return zT=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},zT.apply(this,arguments)}var qN=function(e){return w.createElement("svg",zT({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},e),lL||(lL=w.createElement("path",{fill:"#DA0000",d:"M15 9a.75.75 0 0 0-1.06 0L12 10.94 10.06 9A.75.75 0 0 0 9 10.06L10.94 12 9 13.94A.75.75 0 0 0 10.06 15L12 13.06 13.94 15A.75.75 0 0 0 15 13.94L13.06 12 15 10.06A.75.75 0 0 0 15 9Z"})),cL||(cL=w.createElement("path",{fill:"currentColor",d:"M12 3a9 9 0 1 0 9 9 9.01 9.01 0 0 0-9-9Zm0 16.5a7.5 7.5 0 1 1 7.5-7.5 7.509 7.509 0 0 1-7.5 7.5Z"})))};function kfe({originNode:t,node:e,depth:n,index:r,deleteHandle:s,customOptions:i,startIndex:a,parent:l,parentPath:u}){const{enableClipboard:d,src:p,onEdit:h,onChange:g,forceUpdate:v,displaySize:b,CustomOperation:x}=w.useContext(oc),E=[...u,String(r)],[S,k]=w.useState(!0),T=w.useCallback((A,N,M)=>{t[A]=N,h&&h({newValue:N,oldValue:M,depth:n,src:p,indexOrName:A,parentType:"array",parentPath:u}),g&&g({type:"edit",depth:n,src:p,indexOrName:A,parentType:"array",parentPath:u}),v()},[e,h,g,v]),R=A=>{t.splice(A,1),s&&s(A,u),v()},j=f.jsxs(f.Fragment,{children:[!S&&f.jsxs("span",Object.assign({onClick:()=>k(!0),className:"jv-size-chevron"},{children:[df(b,n,S)&&f.jsxs("span",Object.assign({className:"jv-size"},{children:[em(e)," Items"]})),f.jsx(FN,{className:"jv-chevron"})]})),!S&&d&&P0(i)&&f.jsx(I0,{node:e,nodeMeta:{depth:n,indexOrName:r,parent:l,parentPath:u,currentPath:E}}),typeof x=="function"?f.jsx(x,{node:e}):null]});return f.jsxs("div",{children:[f.jsx("span",{children:"["}),j,S?f.jsxs("button",Object.assign({onClick:()=>k(!1),className:"jv-button"},{children:[a," ... ",a+e.length-1]})):f.jsx("div",Object.assign({className:"jv-indent"},{children:e.map((A,N)=>f.jsx(IT,{indexOrName:N+a,value:A,depth:n,parent:e,deleteHandle:R,editHandle:T,parentPath:u},String(r)+String(N)))})),f.jsx("span",{children:"]"})]})}function Tfe({node:t,depth:e,deleteHandle:n,indexOrName:r,customOptions:s,parent:i,parentPath:a}){const l=typeof r<"u"?[...a,String(r)]:a,u=[];for(let X=0;X<t.length;X+=100)u.push(t.slice(X,X+100));const{collapsed:d,enableClipboard:p,collapseObjectsAfterLength:h,editable:g,onDelete:v,src:b,onAdd:x,CustomOperation:E,onChange:S,forceUpdate:k,displaySize:T}=w.useContext(oc),[R,j]=w.useState(KD(t,e,r,d,h,s));w.useEffect(()=>{j(KD(t,e,r,d,h,s))},[d,h]);const[A,N]=w.useState(!1),M=()=>{N(!1),n&&n(r,a),v&&v({value:t,depth:e,src:b,indexOrName:r,parentType:"array",parentPath:a}),S&&S({type:"delete",depth:e,src:b,indexOrName:r,parentType:"array",parentPath:a})},[I,O]=w.useState(!1),L=()=>{const X=t;X.push(null),x&&x({indexOrName:X.length-1,depth:e,src:b,parentType:"array",parentPath:a}),S&&S({type:"add",indexOrName:X.length-1,depth:e,src:b,parentType:"array",parentPath:a}),k()},z=A||I,G=()=>{N(!1),O(!1)},W=f.jsxs(f.Fragment,{children:[!R&&!z&&f.jsxs("span",Object.assign({onClick:()=>j(!0),className:"jv-size-chevron"},{children:[df(T,e,R)&&f.jsxs("span",Object.assign({className:"jv-size"},{children:[t.length," Items"]})),f.jsx(FN,{className:"jv-chevron"})]})),z&&f.jsx(BN,{className:"json-view--edit",style:{display:"inline-block"},onClick:I?L:M}),z&&f.jsx(qN,{className:"json-view--edit",style:{display:"inline-block"},onClick:G}),!R&&!z&&p&&P0(s)&&f.jsx(I0,{node:t,nodeMeta:{depth:e,indexOrName:r,parent:i,parentPath:a,currentPath:l}}),!R&&!z&&Hq(g)&&Gq(s)&&f.jsx(Wq,{className:"json-view--edit",onClick:()=>{L()}}),!R&&!z&&$N(g)&&zN(s)&&n&&f.jsx(UN,{className:"json-view--edit",onClick:()=>N(!0)}),typeof E=="function"?f.jsx(E,{node:t}):null]});return f.jsxs(f.Fragment,{children:[f.jsx("span",{children:"["}),W,R?f.jsx("button",Object.assign({onClick:()=>j(!1),className:"jv-button"},{children:"..."})):f.jsx("div",Object.assign({className:"jv-indent"},{children:u.map((X,F)=>f.jsx(kfe,{originNode:t,node:X,depth:e,index:F,startIndex:F*100,deleteHandle:n,customOptions:s,parentPath:a},String(r)+String(F)))})),f.jsx("span",{children:"]"}),R&&df(T,e,R)&&f.jsxs("span",Object.assign({onClick:()=>j(!1),className:"jv-size"},{children:[t.length," Items"]}))]})}function Cfe({node:t,depth:e,indexOrName:n,deleteHandle:r,customOptions:s,parent:i,parentPath:a}){const{collapsed:l,onCollapse:u,enableClipboard:d,ignoreLargeArray:p,collapseObjectsAfterLength:h,editable:g,onDelete:v,src:b,onAdd:x,onEdit:E,onChange:S,forceUpdate:k,displaySize:T,CustomOperation:R}=w.useContext(oc),j=typeof n<"u"?[...a,String(n)]:a;if(!p&&Array.isArray(t)&&t.length>100)return f.jsx(Tfe,{node:t,depth:e,indexOrName:n,deleteHandle:r,customOptions:s,parentPath:j});const A=ac(t),[N,M]=w.useState(YD(t,e,n,l,h,s)),I=D=>{u?.({isCollapsing:!D,node:t,depth:e,indexOrName:n}),M(D)};w.useEffect(()=>{I(YD(t,e,n,l,h,s))},[l,h]);const O=w.useCallback((D,Z,he)=>{Array.isArray(t)?t[+D]=Z:t&&(t[D]=Z),E&&E({newValue:Z,oldValue:he,depth:e,src:b,indexOrName:D,parentType:A?"object":"array",parentPath:j}),S&&S({type:"edit",depth:e,src:b,indexOrName:D,parentType:A?"object":"array",parentPath:j}),k()},[t,E,S,k]),L=D=>{Array.isArray(t)?t.splice(+D,1):t&&delete t[D],k()},[z,G]=w.useState(!1),W=()=>{G(!1),r&&r(n,j),v&&v({value:t,depth:e,src:b,indexOrName:n,parentType:A?"object":"array",parentPath:j}),S&&S({type:"delete",depth:e,src:b,indexOrName:n,parentType:A?"object":"array",parentPath:j})},[X,F]=w.useState(!1),Y=w.useRef(null),H=()=>{var D;if(A){const Z=(D=Y.current)===null||D===void 0?void 0:D.value;Z&&(t[Z]=null,Y.current&&(Y.current.value=""),F(!1),x&&x({indexOrName:Z,depth:e,src:b,parentType:"object",parentPath:j}),S&&S({type:"add",indexOrName:Z,depth:e,src:b,parentType:"object",parentPath:j}))}else if(Array.isArray(t)){const Z=t;Z.push(null),x&&x({indexOrName:Z.length-1,depth:e,src:b,parentType:"array",parentPath:j}),S&&S({type:"add",indexOrName:Z.length-1,depth:e,src:b,parentType:"array",parentPath:j})}k()},te=D=>{D.key==="Enter"?(D.preventDefault(),H()):D.key==="Escape"&&re()},P=z||X,re=()=>{G(!1),F(!1)},ue=f.jsxs(f.Fragment,{children:[!N&&!P&&f.jsxs("span",Object.assign({onClick:()=>I(!0),className:"jv-size-chevron"},{children:[df(T,e,N)&&f.jsxs("span",Object.assign({className:"jv-size"},{children:[em(t)," Items"]})),f.jsx(FN,{className:"jv-chevron"})]})),X&&A&&f.jsx("input",{className:"json-view--input",placeholder:"property",ref:Y,onKeyDown:te}),P&&f.jsx(BN,{className:"json-view--edit",style:{display:"inline-block"},onClick:X?H:W}),P&&f.jsx(qN,{className:"json-view--edit",style:{display:"inline-block"},onClick:re}),!N&&!P&&d&&P0(s)&&f.jsx(I0,{node:t,nodeMeta:{depth:e,indexOrName:n,parent:i,parentPath:a,currentPath:j}}),!N&&!P&&Hq(g)&&Gq(s)&&f.jsx(Wq,{className:"json-view--edit",onClick:()=>{A?(F(!0),setTimeout(()=>{var D;return(D=Y.current)===null||D===void 0?void 0:D.focus()})):H()}}),!N&&!P&&$N(g)&&zN(s)&&r&&f.jsx(UN,{className:"json-view--edit",onClick:()=>G(!0)}),typeof R=="function"?f.jsx(R,{node:t}):null]});return Array.isArray(t)?f.jsxs(f.Fragment,{children:[f.jsx("span",{children:"["}),ue,N?f.jsx("button",Object.assign({onClick:()=>I(!1),className:"jv-button"},{children:"..."})):f.jsx("div",Object.assign({className:"jv-indent"},{children:t.map((D,Z)=>f.jsx(IT,{indexOrName:Z,value:D,depth:e,parent:t,deleteHandle:L,editHandle:O,parentPath:j},String(n)+String(Z)))})),f.jsx("span",{children:"]"}),N&&df(T,e,N)&&f.jsxs("span",Object.assign({onClick:()=>I(!1),className:"jv-size"},{children:[em(t)," Items"]}))]}):A?f.jsxs(f.Fragment,{children:[f.jsx("span",{children:"{"}),ue,N?f.jsx("button",Object.assign({onClick:()=>I(!1),className:"jv-button"},{children:"..."})):f.jsx("div",Object.assign({className:"jv-indent"},{children:Object.entries(t).map(([D,Z])=>f.jsx(IT,{indexOrName:D,value:Z,depth:e,parent:t,deleteHandle:L,editHandle:O,parentPath:j},String(n)+String(D)))})),f.jsx("span",{children:"}"}),N&&df(T,e,N)&&f.jsxs("span",Object.assign({onClick:()=>I(!1),className:"jv-size"},{children:[em(t)," Items"]}))]}):f.jsx("span",{children:String(t)})}const Afe=Ee.forwardRef(({str:t,className:e,ctrlClick:n},r)=>{let{collapseStringMode:s,collapseStringsAfterLength:i,customizeCollapseStringUI:a}=w.useContext(oc);const[l,u]=w.useState(!0),d=w.useRef(null);i=i>0?i:0;const p=t.replace(/\s+/g," "),h=typeof a=="function"?a(p,l):typeof a=="string"?a:"...",g=v=>{var b;if((v.ctrlKey||v.metaKey)&&n)n(v);else{const x=window.getSelection();if(x&&x.anchorOffset!==x.focusOffset&&((b=x.anchorNode)===null||b===void 0?void 0:b.parentElement)===d.current)return;u(!l)}};if(t.length<=i)return f.jsxs("span",Object.assign({ref:d,className:e,onClick:n},{children:['"',t,'"']}));if(s==="address")return t.length<=10?f.jsxs("span",Object.assign({ref:d,className:e,onClick:n},{children:['"',t,'"']})):f.jsxs("span",Object.assign({ref:d,onClick:g,className:e+" cursor-pointer"},{children:['"',l?[p.slice(0,6),h,p.slice(-4)]:t,'"']}));if(s==="directly")return f.jsxs("span",Object.assign({ref:d,onClick:g,className:e+" cursor-pointer"},{children:['"',l?[p.slice(0,i),h]:t,'"']}));if(s==="word"){let v=i,b=i+1,x=p,E=1;for(;;){if(/\W/.test(t[v])){x=t.slice(0,v);break}if(/\W/.test(t[b])){x=t.slice(0,b);break}if(E===6){x=t.slice(0,i);break}E++,v--,b++}return f.jsxs("span",Object.assign({ref:d,onClick:g,className:e+" cursor-pointer"},{children:['"',l?[x,h]:t,'"']}))}return f.jsxs("span",Object.assign({ref:d,className:e},{children:['"',t,'"']}))});var uL;function FT(){return FT=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},FT.apply(this,arguments)}var Nfe=function(e){return w.createElement("svg",FT({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},e),uL||(uL=w.createElement("path",{fill:"currentColor",d:"M17.25 3H6.75A3.754 3.754 0 0 0 3 6.75v10.5A3.754 3.754 0 0 0 6.75 21h10.5A3.754 3.754 0 0 0 21 17.25V6.75A3.754 3.754 0 0 0 17.25 3Zm2.25 14.25c0 1.24-1.01 2.25-2.25 2.25H6.75c-1.24 0-2.25-1.01-2.25-2.25V6.75c0-1.24 1.01-2.25 2.25-2.25h10.5c1.24 0 2.25 1.01 2.25 2.25v10.5Zm-6.09-9.466-5.031 5.03a2.981 2.981 0 0 0-.879 2.121v1.19c0 .415.336.75.75.75h1.19c.8 0 1.554-.312 2.12-.879l5.03-5.03a2.252 2.252 0 0 0 0-3.182c-.85-.85-2.331-.85-3.18 0Zm-2.91 7.151c-.28.28-.666.44-1.06.44H9v-.44c0-.4.156-.777.44-1.06l3.187-3.188 1.06 1.061-3.187 3.188Zm5.03-5.03-.782.783-1.06-1.061.782-.782a.766.766 0 0 1 1.06 0 .75.75 0 0 1 0 1.06Z"})))},dL,fL;function UT(){return UT=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},UT.apply(this,arguments)}var Rfe=function(e){return w.createElement("svg",UT({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},e),dL||(dL=w.createElement("path",{fill:"currentColor",d:"M6.75 3h5.5v1.5h-5.5C5.51 4.5 4.5 5.51 4.5 6.75v10.5c0 1.24 1.01 2.25 2.25 2.25h10.5c1.24 0 2.25-1.01 2.25-2.25v-5.5H21v5.5A3.754 3.754 0 0 1 17.25 21H6.75A3.754 3.754 0 0 1 3 17.25V6.75A3.754 3.754 0 0 1 6.75 3Z"})),fL||(fL=w.createElement("path",{fill:"currentColor",d:"M20.013 3h-3.946a.987.987 0 0 0 0 1.973h1.564l-6.342 6.342a1.004 1.004 0 0 0 0 1.396 1.004 1.004 0 0 0 1.396 0l6.342-6.342v1.564a.987.987 0 0 0 1.973 0V3.987A.987.987 0 0 0 20.013 3Z"})))};function Yq({node:t,depth:e,deleteHandle:n,indexOrName:r,parent:s,editHandle:i,parentPath:a}){const{collapseStringsAfterLength:l,enableClipboard:u,editable:d,src:p,onDelete:h,onChange:g,customizeNode:v,matchesURL:b,urlRegExp:x,EditComponent:E,DoneComponent:S,CancelComponent:k,CustomOperation:T}=w.useContext(oc);let R;if(typeof v=="function"&&(R=LN(v,[{node:t,depth:e,indexOrName:r}])),R){if(w.isValidElement(R))return R;if(xfe(R)){const j=R;return f.jsx(j,{node:t,depth:e,indexOrName:r})}}if(Array.isArray(t)||ac(t))return f.jsx(Cfe,{parent:s,node:t,depth:e,indexOrName:r,deleteHandle:n,parentPath:a,customOptions:typeof R=="object"?R:void 0});{const j=typeof t,A=typeof r<"u"?[...a,String(r)]:a,[N,M]=w.useState(!1),[I,O]=w.useState(!1),L=w.useRef(null),z=()=>{M(!0),setTimeout(()=>{var D,Z;(D=window.getSelection())===null||D===void 0||D.selectAllChildren(L.current),(Z=L.current)===null||Z===void 0||Z.focus()})},G=w.useCallback(()=>{let D=L.current.innerText;try{const Z=JSON.parse(D);i&&i(r,Z,t,a)}catch{const he=wfe(j,D);i&&i(r,he,t,a)}M(!1)},[i,r,t,a,j]),W=()=>{M(!1),O(!1)},X=()=>{O(!1),n&&n(r,a),h&&h({value:t,depth:e,src:p,indexOrName:r,parentType:Array.isArray(s)?"array":"object",parentPath:a}),g&&g({depth:e,src:p,indexOrName:r,parentType:Array.isArray(s)?"array":"object",type:"delete",parentPath:a})},F=w.useCallback(D=>{D.key==="Enter"?(D.preventDefault(),G()):D.key==="Escape"&&W()},[G]),Y=N||I,H=!Y&&XD(d)&&QD(R)&&i?D=>{(D.ctrlKey||D.metaKey)&&z()}:void 0,te=f.jsxs(f.Fragment,{children:[Y&&(typeof S=="function"?f.jsx(S,{className:"json-view--edit",style:{display:"inline-block"},onClick:I?X:G}):f.jsx(BN,{className:"json-view--edit",style:{display:"inline-block"},onClick:I?X:G})),Y&&(typeof k=="function"?f.jsx(k,{className:"json-view--edit",style:{display:"inline-block"},onClick:W}):f.jsx(qN,{className:"json-view--edit",style:{display:"inline-block"},onClick:W})),!Y&&u&&P0(R)&&f.jsx(I0,{node:t,nodeMeta:{depth:e,indexOrName:r,parent:s,parentPath:a,currentPath:A}}),!Y&&b&&j==="string"&&x.test(t)&&_fe(R)&&f.jsx("a",Object.assign({href:t,target:"_blank",className:"json-view--link"},{children:f.jsx(Rfe,{})})),!Y&&XD(d)&&QD(R)&&i&&(typeof E=="function"?f.jsx(E,{className:"json-view--edit",onClick:z}):f.jsx(Nfe,{className:"json-view--edit",onClick:z})),!Y&&$N(d)&&zN(R)&&n&&f.jsx(UN,{className:"json-view--edit",onClick:()=>O(!0)}),typeof T=="function"?f.jsx(T,{node:t}):null]});let P="json-view--string";switch(j){case"number":case"bigint":P="json-view--number";break;case"boolean":P="json-view--boolean";break;case"object":P="json-view--null";break}typeof R?.className=="string"&&(P+=" "+R.className),I&&(P+=" json-view--deleting");let re=String(t);j==="bigint"&&(re+="n");const ue=w.useMemo(()=>f.jsx("span",{contentEditable:!0,className:P,dangerouslySetInnerHTML:{__html:j==="string"?`"${re}"`:re},ref:L,onKeyDown:F}),[re,j,F]);return j==="string"?f.jsxs(f.Fragment,{children:[N?ue:t.length>l?f.jsx(Afe,{str:t,ref:L,className:P,ctrlClick:H}):f.jsxs("span",Object.assign({className:P,onClick:H},{children:['"',re,'"']})),te]}):f.jsxs(f.Fragment,{children:[N?ue:f.jsx("span",Object.assign({className:P,onClick:H},{children:re})),te]})}}const Kq=/^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-]([^!@#$%^&*?.\s]{0,63}[^!@#$%^&*?.\s])?\.)+[a-z]{2,6}\/?/,oc=w.createContext({src:void 0,collapseStringsAfterLength:99,collapseStringMode:"directly",customizeCollapseStringUI:void 0,collapseObjectsAfterLength:20,collapsed:!1,onCollapse:void 0,enableClipboard:!0,editable:!1,onEdit:void 0,onDelete:void 0,onAdd:void 0,onChange:void 0,forceUpdate:()=>{},customizeNode:void 0,customizeCopy:()=>{},displaySize:void 0,displayArrayIndex:!0,matchesURL:!1,urlRegExp:Kq,ignoreLargeArray:!1,CopyComponent:void 0,CopiedComponent:void 0,EditComponent:void 0,CancelComponent:void 0,DoneComponent:void 0,CustomOperation:void 0});function zl({src:t,collapseStringsAfterLength:e=99,collapseStringMode:n="directly",customizeCollapseStringUI:r,collapseObjectsAfterLength:s=99,collapsed:i,onCollapse:a,enableClipboard:l=!0,editable:u=!1,onEdit:d,onDelete:p,onAdd:h,onChange:g,dark:v=!1,theme:b="default",customizeNode:x,customizeCopy:E=W=>yfe(W),displaySize:S,displayArrayIndex:k=!0,style:T,className:R,matchesURL:j=!1,urlRegExp:A=Kq,ignoreLargeArray:N=!1,CopyComponent:M,CopiedComponent:I,EditComponent:O,CancelComponent:L,DoneComponent:z,CustomOperation:G}){const[W,X]=w.useState(0),F=w.useCallback(()=>X(te=>++te),[]),[Y,H]=w.useState(t);return w.useEffect(()=>H(t),[t]),f.jsx(oc.Provider,Object.assign({value:{src:Y,collapseStringsAfterLength:e,collapseStringMode:n,customizeCollapseStringUI:r,collapseObjectsAfterLength:s,collapsed:i,onCollapse:a,enableClipboard:l,editable:u,onEdit:d,onDelete:p,onAdd:h,onChange:g,forceUpdate:F,customizeNode:x,customizeCopy:E,displaySize:S,displayArrayIndex:k,matchesURL:j,urlRegExp:A,ignoreLargeArray:N,CopyComponent:M,CopiedComponent:I,EditComponent:O,CancelComponent:L,DoneComponent:z,CustomOperation:G}},{children:f.jsx("code",Object.assign({className:"json-view"+(v?" dark":"")+(b&&b!=="default"?" json-view_"+b:"")+(R?" "+R:""),style:T},{children:f.jsx(Yq,{node:Y,depth:1,editHandle:(te,P,re,ue)=>{H(P),d&&d({newValue:P,oldValue:re,depth:1,src:Y,indexOrName:te,parentType:null,parentPath:ue}),g&&g({type:"edit",depth:1,src:Y,indexOrName:te,parentType:null,parentPath:ue})},deleteHandle:(te,P)=>{H(void 0),p&&p({value:Y,depth:1,src:Y,indexOrName:te,parentType:null,parentPath:P}),g&&g({depth:1,src:Y,indexOrName:te,parentType:null,type:"delete",parentPath:P})},parentPath:[]})}))}))}function jfe(t){if(!t)return null;const e=t,n=e?.resource;if(n&&typeof n=="object"&&typeof n.uri=="string"&&n.uri.startsWith("ui://"))return n;const r=e?.content;if(Array.isArray(r)){for(const s of r)if(s&&s.type==="resource"&&s.resource&&typeof s.resource.uri=="string"&&s.resource.uri.startsWith("ui://"))return s.resource}return null}function Mfe({error:t,showStructured:e,onToggleStructured:n,structuredResult:r,result:s,validationErrors:i,unstructuredValidationResult:a,onExecuteFromUI:l,onHandleIntent:u,onSendFollowup:d,serverId:p,toolCallId:h,toolName:g,toolParameters:v,toolCallTimestamp:b,toolMeta:x}){const E=s,S=x?.["openai/outputTemplate"],k=S&&typeof S=="string",T=jfe(s);return f.jsxs("div",{className:"h-full flex flex-col border-t border-border bg-background",children:[f.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[f.jsxs("div",{className:"flex items-center gap-4",children:[f.jsx("h2",{className:"text-xs font-semibold text-foreground",children:"Response"}),e&&i!==void 0&&(i===null?f.jsxs(vr,{variant:"default",className:"bg-green-600 hover:bg-green-700",children:[f.jsx(sf,{className:"h-3 w-3 mr-1.5"}),"Valid"]}):f.jsxs(vr,{variant:"destructive",children:[f.jsx(af,{className:"h-3 w-3 mr-1.5"}),"Invalid"]}))]}),E&&(r||k)&&f.jsxs("div",{className:"flex gap-2",children:[f.jsx(Ie,{size:"sm",variant:e?"outline":"default",onClick:()=>n(!1),children:k?"Component":"Raw Output"}),f.jsx(Ie,{size:"sm",variant:e?"default":"outline",onClick:()=>n(!0),children:k?"Raw JSON":"Structured Output"})]})]}),f.jsx("div",{className:"flex-1 overflow-hidden",children:t?f.jsx("div",{className:"p-4",children:f.jsx("div",{className:"p-3 bg-destructive/10 border border-destructive/20 rounded text-destructive text-xs font-medium",children:t})}):e&&i?f.jsxs("div",{className:"p-4",children:[f.jsx("h3",{className:"text-sm font-semibold text-destructive mb-2",children:"Validation Errors"}),f.jsxs("div",{className:"p-3 bg-destructive/10 border border-destructive/20 rounded-md",children:[f.jsx(zl,{src:i,theme:"atom",dark:!0,enableClipboard:!0,displaySize:!1,collapseStringsAfterLength:100,style:{fontSize:"12px",fontFamily:"ui-monospace, SFMono-Regular, 'SF Mono', monospace",backgroundColor:"hsl(var(--background))",padding:"16px",borderRadius:"8px",border:"1px solid hsl(var(--border))"}}),Array.isArray(i)&&i.length>0&&f.jsx("span",{className:"text-sm font-semibold text-destructive mb-2",children:`${i[0].instancePath?.slice(1)??""} ${i[0].message??""}`})]})]}):e&&E&&k?f.jsx(La,{className:"h-full",children:f.jsx("div",{className:"p-4",children:f.jsx(zl,{src:E,dark:!0,theme:"atom",enableClipboard:!0,displaySize:!1,collapseStringsAfterLength:100,style:{fontSize:"12px",fontFamily:"ui-monospace, SFMono-Regular, 'SF Mono', monospace",backgroundColor:"hsl(var(--background))",padding:"16px",borderRadius:"8px",border:"1px solid hsl(var(--border))"}})})}):e&&r&&i===null?f.jsx(La,{className:"h-full",children:f.jsx("div",{className:"p-4",children:f.jsx(zl,{src:r,dark:!0,theme:"atom",enableClipboard:!0,displaySize:!1,collapseStringsAfterLength:100,style:{fontSize:"12px",fontFamily:"ui-monospace, SFMono-Regular, 'SF Mono', monospace",backgroundColor:"hsl(var(--background))",padding:"16px",borderRadius:"8px",border:"1px solid hsl(var(--border))"}})})}):E?!e&&k&&S?f.jsx(Vq,{componentUrl:S,toolCall:{id:h||"tool-result",name:g||"tool",parameters:v||{},timestamp:b||new Date,status:"completed"},toolResult:{id:`${h||"tool-result"}-result`,toolCallId:h||"tool-result",result:E,timestamp:new Date},onCallTool:async(R,j)=>(await l(R,j),{}),onSendFollowup:d,serverId:p,toolMeta:x}):!e&&T?f.jsx(DN,{resource:T,htmlProps:{autoResizeIframe:!0,style:{width:"100%",minHeight:"500px",height:"auto",overflow:"visible"}},onUIAction:async R=>(R.type==="tool"&&R.payload?.toolName?await l(R.payload.toolName,R.payload.params||{}):R.type==="intent"&&R.payload?.intent?await u(R.payload.intent,R.payload.params||{}):R.type==="link"&&R.payload?.url&&window.open(R.payload.url,"_blank","noopener,noreferrer"),{status:"handled"})}):f.jsxs("div",{className:"p-4",children:[a==="valid"&&f.jsxs(vr,{variant:"default",className:"bg-green-600 hover:bg-green-700 mb-4",children:[f.jsx(sf,{className:"h-3 w-3 mr-1.5"}),"Success: Content matches the output schema."]}),a==="schema_mismatch"&&f.jsxs(vr,{variant:"destructive",className:"mb-4",children:[f.jsx(af,{className:"h-3 w-3 mr-1.5"}),"Error: Content does not match the output schema."]}),a==="invalid_json"&&f.jsxs(vr,{variant:"destructive",className:"bg-amber-600 hover:bg-amber-700 mb-4",children:[f.jsx(af,{className:"h-3 w-3 mr-1.5"}),"Warning: Output schema provided by the tool is invalid."]}),f.jsx(zl,{src:E,dark:!0,theme:"atom",enableClipboard:!0,displaySize:!1,collapseStringsAfterLength:100,style:{fontSize:"12px",fontFamily:"ui-monospace, SFMono-Regular, 'SF Mono', monospace",backgroundColor:"hsl(var(--background))",padding:"16px",borderRadius:"8px",border:"1px solid hsl(var(--border))",width:"calc(100vw - var(--sidebar-width) - 16px - 16px)"}})]}):f.jsx("div",{className:"flex items-center justify-center h-full",children:f.jsx("p",{className:"text-xs text-muted-foreground font-medium",children:"Execute a tool to see results here"})})})]})}const Xq=w.forwardRef(({value:t,onValueChange:e,placeholder:n="Search…",className:r,clearable:s=!0,iconClassName:i,...a},l)=>f.jsxs("div",{className:"relative",children:[f.jsx(vB,{className:Me("absolute left-2.5 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground",i)}),f.jsx(Un,{ref:l,value:t,onChange:u=>e(u.target.value),placeholder:n,type:"search",role:"searchbox","aria-label":n,autoComplete:"off",spellCheck:!1,className:Me("pl-7 h-8 bg-background border-border hover:border-border/80 text-xs md:text-xs leading-4 text-foreground placeholder:text-muted-foreground/70",r),...a}),s&&t&&f.jsx("button",{type:"button",onClick:()=>e(""),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors","aria-label":"Clear search",children:f.jsx(Nu,{className:"h-3 w-3"})})]}));Xq.displayName="SearchInput";function Ofe({tool:t,name:e,isSelected:n,onClick:r}){return f.jsx("div",{className:`cursor-pointer transition-all duration-200 hover:bg-muted/30 dark:hover:bg-muted/50 p-3 rounded-md mx-2 ${n?"bg-muted/50 dark:bg-muted/50 shadow-sm border border-border ring-1 ring-ring/20":"hover:shadow-sm"}`,onClick:r,children:f.jsxs("div",{className:"flex items-start gap-3",children:[f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("div",{className:"flex items-center gap-2 mb-1",children:f.jsx("code",{className:"font-mono text-xs font-medium text-foreground bg-muted px-1.5 py-0.5 rounded border border-border",children:e})}),t.description&&f.jsx("p",{className:"text-xs mt-2 line-clamp-2 leading-relaxed text-muted-foreground",children:t.description})]}),f.jsx(Ba,{className:"h-3 w-3 text-muted-foreground flex-shrink-0 mt-1"})]})})}function Pfe({request:t,isHighlighted:e,onLoad:n,onRename:r,onDuplicate:s,onDelete:i}){return f.jsx("div",{className:`group p-2 rounded mx-2 cursor-pointer transition-all duration-200 ${e?"bg-primary/20 border border-primary/30 shadow-sm":"hover:bg-muted/40"}`,onClick:()=>n(t),children:f.jsxs("div",{className:"flex items-start justify-between",children:[f.jsxs("div",{className:"min-w-0 pr-2",children:[f.jsx("div",{className:"flex items-center gap-2",children:f.jsx("code",{className:"font-mono text-[10px] bg-muted px-1.5 py-0.5 rounded border border-border",children:t.toolName})}),f.jsxs("div",{children:[f.jsx("div",{className:"text-xs font-medium truncate",children:t.title}),t.description&&f.jsx("div",{className:"text-[10px] text-muted-foreground truncate",children:t.description})]})]}),f.jsxs("div",{className:"flex gap-1",children:[f.jsx(Ie,{onClick:a=>{a.stopPropagation(),r(t)},size:"sm",variant:"ghost",className:"h-6 w-6 p-0 opacity-0 group-hover:opacity-100",children:f.jsx(Jse,{className:"w-3 h-3"})}),f.jsx(Ie,{onClick:a=>{a.stopPropagation(),s(t)},size:"sm",variant:"ghost",className:"h-6 w-6 p-0 opacity-0 group-hover:opacity-100",children:f.jsx(Po,{className:"w-3 h-3"})}),f.jsx(Ie,{onClick:a=>{a.stopPropagation(),i(t.id)},size:"sm",variant:"ghost",className:"h-6 w-6 p-0 opacity-0 group-hover:opacity-100",children:f.jsx(wie,{className:"w-3 h-3"})})]})]})})}function Ife({activeTab:t,onChangeTab:e,tools:n,toolNames:r,filteredToolNames:s,selectedToolName:i,fetchingTools:a,searchQuery:l,onSearchQueryChange:u,onRefresh:d,onSelectTool:p,savedRequests:h,highlightedRequestId:g,onLoadRequest:v,onRenameRequest:b,onDuplicateRequest:x,onDeleteRequest:E}){return f.jsx(ni,{defaultSize:35,minSize:20,maxSize:55,children:f.jsxs("div",{className:"h-full border-r border-border bg-background",children:[f.jsx("div",{className:"border-b border-border",children:f.jsxs("div",{className:"flex",children:[f.jsx("button",{onClick:()=>e("tools"),className:`px-4 py-3 text-xs font-medium border-b-2 transition-colors ${t==="tools"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"}`,children:"Tools"}),f.jsxs("button",{onClick:()=>e("saved"),className:`px-4 py-3 text-xs font-medium border-b-2 transition-colors ${t==="saved"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"}`,children:["Saved Requests",h.length>0&&f.jsx("span",{className:"ml-2 bg-muted text-muted-foreground rounded px-1.5 py-0.5 text-xs font-mono",children:h.length})]})]})}),f.jsxs("div",{className:"px-4 py-4 border-b border-border bg-background space-y-3",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(kk,{className:"h-3 w-3 text-muted-foreground"}),f.jsx("h2",{className:"text-xs font-semibold text-foreground",children:"Tools"}),f.jsx(vr,{variant:"secondary",className:"text-xs font-mono",children:t==="tools"?r.length:h.length})]}),f.jsx(Ie,{onClick:d,variant:"ghost",size:"sm",disabled:a,children:t==="tools"&&f.jsx(ir,{className:`h-3 w-3 ${a?"animate-spin":""} cursor-pointer`})})]}),f.jsx(Xq,{value:l,onValueChange:u,placeholder:"Search tools by name or description"})]}),t==="tools"?f.jsx("div",{className:"h-[calc(100%-49px)] flex flex-col",children:f.jsx("div",{className:"flex-1 overflow-hidden",children:f.jsx(La,{className:"h-full",children:f.jsx("div",{className:"p-2",children:a?f.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[f.jsx("div",{className:"w-8 h-8 bg-muted rounded-full flex items-center justify-center mb-3",children:f.jsx(ir,{className:"h-4 w-4 text-muted-foreground animate-spin cursor-pointer"})}),f.jsx("p",{className:"text-xs text-muted-foreground font-semibold mb-1",children:"Loading tools..."}),f.jsx("p",{className:"text-xs text-muted-foreground/70",children:"Fetching available tools from server"})]}):s.length===0?f.jsx("div",{className:"text-center py-8",children:f.jsx("p",{className:"text-sm text-muted-foreground",children:n&&r.length===0?"No tools were found. Try refreshing. Make sure you selected the correct server and the server is running.":"No tools match your search."})}):f.jsx("div",{className:"grid grid-cols-1 gap-2",children:s.map(S=>f.jsx(Ofe,{tool:n[S],name:S,isSelected:i===S,onClick:()=>p(S)},S))})})})})}):f.jsx("div",{className:"h-full",children:f.jsx(La,{className:"h-full",children:f.jsx("div",{className:"p-3 space-y-1",children:h.length===0?f.jsx("div",{className:"text-center py-8",children:f.jsx("p",{className:"text-sm text-muted-foreground",children:"No saved requests yet."})}):h.map(S=>f.jsx(Pfe,{request:S,isHighlighted:g===S.id,onLoad:v,onRename:b,onDuplicate:x,onDelete:E},S.id))})})})]})})}function Dfe({open:t,defaultTitle:e="",defaultDescription:n="",onCancel:r,onSave:s}){const[i,a]=w.useState(e),[l,u]=w.useState(n);return w.useEffect(()=>{t&&(a(e||""),u(n||""))},[t,e,n]),f.jsx(aa,{open:t,children:f.jsxs(oa,{className:"sm:max-w-md",onEscapeKeyDown:r,onPointerDownOutside:r,children:[f.jsxs(la,{children:[f.jsx(ca,{children:"Save request"}),f.jsx(Jf,{children:"Give this request a memorable name and optional description."})]}),f.jsxs("div",{className:"space-y-3 py-2",children:[f.jsxs("div",{className:"space-y-1",children:[f.jsx("label",{className:"text-xs font-medium",children:"Name"}),f.jsx(Un,{value:i,onChange:d=>a(d.target.value),placeholder:"My saved request",className:"text-sm"})]}),f.jsxs("div",{className:"space-y-1",children:[f.jsx("label",{className:"text-xs font-medium",children:"Description"}),f.jsx(Ho,{value:l,onChange:d=>u(d.target.value),placeholder:"Optional description",className:"text-sm h-20"})]})]}),f.jsxs(v0,{children:[f.jsx(Ie,{variant:"ghost",onClick:r,size:"sm",children:"Cancel"}),f.jsx(Ie,{onClick:()=>{const d=(i||"").trim();d&&s({title:d,description:l?.trim()||void 0})},size:"sm",children:"Save"})]})]})})}function Lfe(t,e){switch(t){case"enum":return e?.[0]||"";case"string":return"";case"number":case"integer":return"";case"boolean":return!1;case"array":return[];case"object":return{};default:return""}}function $fe(t){if(!t||!t.properties)return[];const e=[],n=t.required||[];return Object.entries(t.properties).forEach(([r,s])=>{const i=s.enum?"enum":s.type||"string";e.push({name:r,type:i,description:s.description,required:n.includes(r),value:Lfe(i,s.enum),enum:s.enum,minimum:s.minimum,maximum:s.maximum,pattern:s.pattern})}),e}function zfe(t,e){return t.map(n=>{if(Object.prototype.hasOwnProperty.call(e,n.name)){const r=e[n.name];return n.type==="array"||n.type==="object"?{...n,value:JSON.stringify(r,null,2)}:{...n,value:r}}return n})}function Ffe(t,e){const n={};return t.forEach(r=>{if(!(r.required||r.value!==""&&r.value!==null&&r.value!==void 0))return;let i=r.value;try{r.type==="number"||r.type==="integer"?(i=Number(r.value),isNaN(i)&&e?.("Invalid number value for field",{fieldName:r.name,value:r.value})):r.type==="boolean"?i=!!r.value:(r.type==="array"||r.type==="object")&&(i=JSON.parse(r.value)),n[r.name]=i}catch(a){e?.("Failed to process field value",{fieldName:r.name,type:r.type,value:r.value,error:a}),n[r.name]=r.value}}),n}const Ufe="mcp-inspector.saved-requests";function VN(t){return`${Ufe}:${t}`}function Ll(t){try{const e=localStorage.getItem(VN(t));if(!e)return[];const n=JSON.parse(e);return Array.isArray(n)?n:[]}catch{return[]}}function HN(t,e){const n=new Date().toISOString(),r=Ll(t);let s;if(e.id){s={id:e.id,title:e.title,description:e.description,toolName:e.toolName,parameters:e.parameters,isFavorite:e.isFavorite,serverKey:t,createdAt:r.find(a=>a.id===e.id)?.createdAt||n,updatedAt:n};const i=r.findIndex(a=>a.id===s.id);i>=0?r[i]=s:r.push(s)}else s={id:crypto.randomUUID(),title:e.title,description:e.description,toolName:e.toolName,parameters:e.parameters,isFavorite:e.isFavorite,serverKey:t,createdAt:n,updatedAt:n},r.unshift(s);return localStorage.setItem(VN(t),JSON.stringify(r)),s}function Bfe(t,e){const n=Ll(t).filter(r=>r.id!==e);localStorage.setItem(VN(t),JSON.stringify(n))}function Qq(t,e){return Ll(t).find(n=>n.id===e)}function qfe(t,e){const n=Qq(t,e);if(n)return HN(t,{title:`${n.title} (copy)`,description:n.description,toolName:n.toolName,parameters:n.parameters,isFavorite:n.isFavorite})}function Vfe(t,e,n){const r=Qq(t,e);if(r)return HN(t,{id:e,title:n.title??r.title,description:n.description??r.description,toolName:r.toolName,parameters:r.parameters,isFavorite:n.isFavorite??r.isFavorite})}var oE,hL;function Hfe(){if(hL)return oE;hL=1;function t(e,r){var r=r||{};this._capacity=r.capacity,this._head=0,this._tail=0,Array.isArray(e)?this._fromArray(e):(this._capacityMask=3,this._list=new Array(4))}return t.prototype.peekAt=function(n){var r=n;if(r===(r|0)){var s=this.size();if(!(r>=s||r<-s))return r<0&&(r+=s),r=this._head+r&this._capacityMask,this._list[r]}},t.prototype.get=function(n){return this.peekAt(n)},t.prototype.peek=function(){if(this._head!==this._tail)return this._list[this._head]},t.prototype.peekFront=function(){return this.peek()},t.prototype.peekBack=function(){return this.peekAt(-1)},Object.defineProperty(t.prototype,"length",{get:function(){return this.size()}}),t.prototype.size=function(){return this._head===this._tail?0:this._head<this._tail?this._tail-this._head:this._capacityMask+1-(this._head-this._tail)},t.prototype.unshift=function(n){if(arguments.length===0)return this.size();var r=this._list.length;return this._head=this._head-1+r&this._capacityMask,this._list[this._head]=n,this._tail===this._head&&this._growArray(),this._capacity&&this.size()>this._capacity&&this.pop(),this._head<this._tail?this._tail-this._head:this._capacityMask+1-(this._head-this._tail)},t.prototype.shift=function(){var n=this._head;if(n!==this._tail){var r=this._list[n];return this._list[n]=void 0,this._head=n+1&this._capacityMask,n<2&&this._tail>1e4&&this._tail<=this._list.length>>>2&&this._shrinkArray(),r}},t.prototype.push=function(n){if(arguments.length===0)return this.size();var r=this._tail;return this._list[r]=n,this._tail=r+1&this._capacityMask,this._tail===this._head&&this._growArray(),this._capacity&&this.size()>this._capacity&&this.shift(),this._head<this._tail?this._tail-this._head:this._capacityMask+1-(this._head-this._tail)},t.prototype.pop=function(){var n=this._tail;if(n!==this._head){var r=this._list.length;this._tail=n-1+r&this._capacityMask;var s=this._list[this._tail];return this._list[this._tail]=void 0,this._head<2&&n>1e4&&n<=r>>>2&&this._shrinkArray(),s}},t.prototype.removeOne=function(n){var r=n;if(r===(r|0)&&this._head!==this._tail){var s=this.size(),i=this._list.length;if(!(r>=s||r<-s)){r<0&&(r+=s),r=this._head+r&this._capacityMask;var a=this._list[r],l;if(n<s/2){for(l=n;l>0;l--)this._list[r]=this._list[r=r-1+i&this._capacityMask];this._list[r]=void 0,this._head=this._head+1+i&this._capacityMask}else{for(l=s-1-n;l>0;l--)this._list[r]=this._list[r=r+1+i&this._capacityMask];this._list[r]=void 0,this._tail=this._tail-1+i&this._capacityMask}return a}}},t.prototype.remove=function(n,r){var s=n,i,a=r;if(s===(s|0)&&this._head!==this._tail){var l=this.size(),u=this._list.length;if(!(s>=l||s<-l||r<1)){if(s<0&&(s+=l),r===1||!r)return i=new Array(1),i[0]=this.removeOne(s),i;if(s===0&&s+r>=l)return i=this.toArray(),this.clear(),i;s+r>l&&(r=l-s);var d;for(i=new Array(r),d=0;d<r;d++)i[d]=this._list[this._head+s+d&this._capacityMask];if(s=this._head+s&this._capacityMask,n+r===l){for(this._tail=this._tail-r+u&this._capacityMask,d=r;d>0;d--)this._list[s=s+1+u&this._capacityMask]=void 0;return i}if(n===0){for(this._head=this._head+r+u&this._capacityMask,d=r-1;d>0;d--)this._list[s=s+1+u&this._capacityMask]=void 0;return i}if(s<l/2){for(this._head=this._head+n+r+u&this._capacityMask,d=n;d>0;d--)this.unshift(this._list[s=s-1+u&this._capacityMask]);for(s=this._head-1+u&this._capacityMask;a>0;)this._list[s=s-1+u&this._capacityMask]=void 0,a--;n<0&&(this._tail=s)}else{for(this._tail=s,s=s+r+u&this._capacityMask,d=l-(r+n);d>0;d--)this.push(this._list[s++]);for(s=this._tail;a>0;)this._list[s=s+1+u&this._capacityMask]=void 0,a--}return this._head<2&&this._tail>1e4&&this._tail<=u>>>2&&this._shrinkArray(),i}}},t.prototype.splice=function(n,r){var s=n;if(s===(s|0)){var i=this.size();if(s<0&&(s+=i),!(s>i))if(arguments.length>2){var a,l,u,d=arguments.length,p=this._list.length,h=2;if(!i||s<i/2){for(l=new Array(s),a=0;a<s;a++)l[a]=this._list[this._head+a&this._capacityMask];for(r===0?(u=[],s>0&&(this._head=this._head+s+p&this._capacityMask)):(u=this.remove(s,r),this._head=this._head+s+p&this._capacityMask);d>h;)this.unshift(arguments[--d]);for(a=s;a>0;a--)this.unshift(l[a-1])}else{l=new Array(i-(s+r));var g=l.length;for(a=0;a<g;a++)l[a]=this._list[this._head+s+r+a&this._capacityMask];for(r===0?(u=[],s!=i&&(this._tail=this._head+s+p&this._capacityMask)):(u=this.remove(s,r),this._tail=this._tail-g+p&this._capacityMask);h<d;)this.push(arguments[h++]);for(a=0;a<g;a++)this.push(l[a])}return u}else return this.remove(s,r)}},t.prototype.clear=function(){this._list=new Array(this._list.length),this._head=0,this._tail=0},t.prototype.isEmpty=function(){return this._head===this._tail},t.prototype.toArray=function(){return this._copyArray(!1)},t.prototype._fromArray=function(n){var r=n.length,s=this._nextPowerOf2(r);this._list=new Array(s),this._capacityMask=s-1,this._tail=r;for(var i=0;i<r;i++)this._list[i]=n[i]},t.prototype._copyArray=function(n,r){var s=this._list,i=s.length,a=this.length;if(r=r|a,r==a&&this._head<this._tail)return this._list.slice(this._head,this._tail);var l=new Array(r),u=0,d;if(n||this._head>this._tail){for(d=this._head;d<i;d++)l[u++]=s[d];for(d=0;d<this._tail;d++)l[u++]=s[d]}else for(d=this._head;d<this._tail;d++)l[u++]=s[d];return l},t.prototype._growArray=function(){if(this._head!=0){var n=this._copyArray(!0,this._list.length<<1);this._tail=this._list.length,this._head=0,this._list=n}else this._tail=this._list.length,this._list.length<<=1;this._capacityMask=this._capacityMask<<1|1},t.prototype._shrinkArray=function(){this._list.length>>>=1,this._capacityMask>>>=1},t.prototype._nextPowerOf2=function(n){var r=Math.log(n)/Math.log(2),s=1<<r+1;return Math.max(s,4)},oE=t,oE}var Gfe=Hfe();const Wfe=Vf(Gfe),pL={error:0,warn:1,info:2,debug:3,trace:4},Yfe={error:"#ef4444",warn:"#f59e0b",info:"#3b82f6",debug:"#8b5cf6",trace:"#6b7280"};class Kfe{config={level:"info",enableConsole:!0,maxBufferSize:1e3};buffer=new Wfe([],{capacity:this.config.maxBufferSize});listeners=new Set;setConfig(e){this.config={...this.config,...e},this.notifyListeners()}getConfig(){return{...this.config}}addEntry(e){this.buffer.unshift(e),this.notifyListeners()}getEntries(){return this.buffer.toArray()}clearBuffer(){this.buffer.clear(),this.notifyListeners()}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}notifyListeners(){this.listeners.forEach(e=>e())}shouldLog(e){return pL[e]<=pL[this.config.level]}}const Yi=new Kfe;typeof window<"u"&&Yi.setConfig({level:"info",enableConsole:!0});function GN(t="Unknown"){const e=w.useCallback(r=>(s,i,a)=>{if(!Yi.shouldLog(r))return;const u={timestamp:new Date().toISOString(),level:r,context:t,message:s,data:i,error:a};Yi.addEntry(u),Yi.getConfig().enableConsole&&Xfe(u)},[t]);return w.useMemo(()=>({error:e("error"),warn:e("warn"),info:e("info"),debug:e("debug"),trace:e("trace"),context:t}),[e,t])}function Xfe(t){const{timestamp:e,level:n,context:r,message:s,data:i,error:a}=t,l=new Date(e).toLocaleTimeString(),u=Yfe[n],d=`color: ${u}; font-weight: bold;`,p=`color: ${u};`,h=[`%c[${l}] %c${n.toUpperCase()} %c[${r}] %c${s}`,"color: #6b7280;",d,"color: #6b7280;",p];i!==void 0&&h.push(`
|
|
1773
|
+
</html>`,Mq=1,FD=2,Oq=3,UD=4,Pq=5,BD=Symbol.for("quilt.threads.serialize"),Xde=Symbol.for("quilt.threads.transferable");class Qde extends AbortController{constructor(...e){super();const n=e.find(r=>r.aborted);if(n)this.abort(n.reason);else{const r=i=>this.abort(i.target.reason),s={signal:this.signal};for(const i of e)i.addEventListener("abort",r,s)}}}class qD extends Error{constructor(){super("You attempted to call a function on a closed thread.")}}let Jde="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";function Iq(t=21){let e="",n=crypto.getRandomValues(new Uint8Array(t));for(let r=0;r<t;r++)e+=Jde[63&n[r]];return e}var Up,Dd,Bp,Qy,NT,Dq;class Zde{constructor(){Zi(this,NT),Zi(this,Up,new Map),Zi(this,Dd,new Map),Zi(this,Bp,new Map),Zi(this,Qy,new WeakMap)}get(e){return Pn(this,Dd).get(e)}release(e){const n=Pn(this,Dd).get(e);return n&&(Pn(this,Dd).delete(e),Pn(this,Up).delete(n)),!!n}serialize(e){let n=Pn(this,Up).get(e);return n==null&&(n=Iq(),Pn(this,Up).set(e,n),Pn(this,Dd).set(n,e)),n}deserialize(e,n){var r,s;let i=(r=Pn(this,Bp).get(e))==null?void 0:r.deref();return i||(i=(...a)=>{if(!Pn(this,Bp).has(e))throw new Error("You attempted to call a function that was already revoked.");return n.call((l,u,d)=>{n.messages.send([Oq,l,e,u],d)},a)},(s=Yr(this,NT,Dq).call(this,n))==null||s.register(i,e),Pn(this,Bp).set(e,new WeakRef(i)),i)}}Up=new WeakMap,Dd=new WeakMap,Bp=new WeakMap,Qy=new WeakMap,NT=new WeakSet,Dq=function(t){let e=Pn(this,Qy).get(t);if(!(typeof FinalizationRegistry>"u"))return e||(e=new FinalizationRegistry(n=>{t.messages.send([Pq,n])}),Pn(this,Qy).set(t,e)),e};function efe(t){return t!=null&&(Symbol.asyncIterator in t||Symbol.iterator in t)&&typeof t.next=="function"}function VD(t){if(t==null||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e==null||e===Object.prototype}const aE="_@f",HD="_@i";var Jp,Zp,bi,Jy,Tl;class tfe{constructor(e){Zi(this,bi),Zi(this,Jp),Zi(this,Zp),TT(this,Jp,e?.serialize),TT(this,Zp,e?.deserialize)}serialize(e,n,r){return Yr(this,bi,Jy).call(this,e,n,r)}deserialize(e,n){return Yr(this,bi,Tl).call(this,e,n)}}Jp=new WeakMap,Zp=new WeakMap,bi=new WeakSet,Jy=function(t,e,n,r=new Map,s=!1){if(t==null)return t;if(r.has(t))return r.get(t);if(r.set(t,void 0),typeof t=="object"){if(Pn(this,Jp)&&!s){const l=Pn(this,Jp).call(this,t,u=>Yr(this,bi,Jy).call(this,u,e,n,r,!0),e,n);if(l!==void 0)return r.set(t,l),l}if(t[Xde])return n?.push(t),r.set(t,t),t;const i=l=>Yr(this,bi,Jy).call(this,l,e,n,r);if(typeof t[BD]=="function"){const l=t[BD]({serialize:i});return r.set(t,l),l}if(Array.isArray(t)){const l=t.map(u=>i(u));return r.set(t,l),l}if(t instanceof Map){const l=[...t.entries()].map(([d,p])=>[i(d),i(p)]),u=new Map(l);return r.set(t,u),u}if(t instanceof Set){const l=[...t].map(d=>i(d)),u=new Set(l);return r.set(t,u),u}const a=efe(t);if(VD(t)||a){const l={};for(const u of Object.keys(t))l[u]=i(t[u]);return a&&(l.next??(l.next=i(t.next.bind(t))),l.return??(l.return=i(t.return.bind(t))),l.throw??(l.throw=i(t.throw.bind(t))),l[HD]=!0),r.set(t,l),l}}if(typeof t=="function"){const i=e.functions.serialize(t,e,n),a={[aE]:i};return r.set(t,a),a}return r.set(t,t),t},Tl=function(t,e,n=!1){if(t==null)return t;if(typeof t=="object"){if(Pn(this,Zp)&&!n){const s=Pn(this,Zp).call(this,t,i=>Yr(this,bi,Tl).call(this,i,e,!0),e);if(s!==void 0)return s}if(t==null)return t;if(Array.isArray(t))return t.map(s=>Yr(this,bi,Tl).call(this,s,e));if(t instanceof Map)return new Map([...t].map(([s,i])=>[Yr(this,bi,Tl).call(this,s,e),Yr(this,bi,Tl).call(this,i,e)]));if(t instanceof Set)return new Set([...t].map(s=>Yr(this,bi,Tl).call(this,s,e)));if(aE in t)return e.functions.deserialize(t[aE],e);if(!VD(t))return t;const r={};for(const s of Object.keys(t))s===HD?r[Symbol.asyncIterator]=()=>r:r[s]=Yr(this,bi,Tl).call(this,t[s],e);return r}return t};var Ld,Gc,Cl,RT,Lq,jT,$q;class nfe{constructor(e,{imports:n,exports:r,functions:s=new Zde,serialization:i=new tfe,signal:a}={}){Zi(this,Cl),Zi(this,Ld),Zi(this,Gc,new Map);var l,u,d,p;this.messages=e,TT(this,Ld,a?new Qde(a):new AbortController),this.exports=r??{},this.imports=rfe(Yr(this,Cl,Lq).bind(this),n),this.functions=s,this.serialization=i,(u=(l=this.functions).start)==null||u.call(l,this),(p=(d=this.serialization).start)==null||p.call(d,this),this.signal.addEventListener("abort",()=>{for(const h of Pn(this,Gc).keys())Yr(this,Cl,jT).call(this,h,void 0,new qD);Pn(this,Gc).clear()},{once:!0}),e.listen(async h=>{if(!(Array.isArray(h)&&typeof h[0]=="number"))return;const g=h;switch(g[0]){case Mq:{const[,v,b,x]=g,E=this.exports[b]??(()=>{throw new Error(`No '${b}' method is exported from this thread`)});await Yr(this,Cl,RT).call(this,E,x,(S,k,T)=>{this.messages.send([FD,v,S,k],T)});break}case Oq:{const[,v,b,x]=g,E=this.functions.get(b,this)??sfe;await Yr(this,Cl,RT).call(this,E,x,(S,k,T)=>{this.messages.send([UD,v,S,k],T)});break}case FD:case UD:{Yr(this,Cl,jT).call(this,...g.slice(1));break}case Pq:{const v=g[1];this.functions.release(v,this);break}}},{signal:this.signal})}get signal(){return Pn(this,Ld).signal}get closed(){return Pn(this,Ld).signal.aborted}close(){Pn(this,Ld).abort()}call(e,n){if(this.closed)return Promise.reject(new qD);const r=[],s=this.serialization.serialize(n,this,r),i=Iq(),a=Yr(this,Cl,$q).call(this,i);return e(i,s,r),a}}Ld=new WeakMap,Gc=new WeakMap,Cl=new WeakSet,RT=async function(t,e,n){try{const r=this.functions.call?await this.functions.call(t,e,this):await t(...this.serialization.deserialize(e,this)),s=[],i=this.serialization.serialize(r,this,s);n(i,void 0,s)}catch(r){n(void 0,this.serialization.serialize(r,this))}},Lq=function(t){return(...e)=>{try{if(typeof t!="string"&&typeof t!="number")throw new Error(`Can’t call a symbol method on a thread: ${t.toString()}`);return this.call((n,r,s)=>{this.messages.send([Mq,n,t,r],s)},e)}catch(n){return Promise.reject(n)}}},jT=function(...t){const e=t[0],n=Pn(this,Gc).get(e);n&&(n(...t),Pn(this,Gc).delete(e))},$q=function(t){const e=new Promise((n,r)=>{Pn(this,Gc).set(t,(s,i,a)=>{a==null?n(this.serialization.deserialize(i,this)):r(this.serialization.deserialize(a,this))})});return Object.defineProperty(e,Symbol.asyncIterator,{async*value(){const n=await e;Object.defineProperty(n,Symbol.asyncIterator,{value:()=>n}),yield*n}}),e};function rfe(t,e){let n;if(e==null){if(typeof Proxy!="function")throw new Error("You must pass an array of callable methods in environments without Proxies.");const r=new Map;n=new Proxy({},{get(s,i){if(r.has(i))return r.get(i);const a=t(i);return r.set(i,a),a}})}else{n={};for(const r of e)Object.defineProperty(n,r,{value:t(r),writable:!1,configurable:!0,enumerable:!0})}return n}function sfe(){throw new Error("You attempted to call a function that is not stored. It may have already been released.")}const ife="quilt.threads.ping",GD="quilt.threads.pong";function afe(t,{targetOrigin:e="*"}={}){let n=!1;const r=function(i,a){t.postMessage(i,e,a)},s=new Promise(i=>{const a=new AbortController;globalThis.window.addEventListener("message",l=>{l.source===t&&l.data===GD&&(n=!0,a.abort(),i())},{signal:a.signal}),a.signal.addEventListener("abort",()=>i(),{once:!0}),r(ife)});return{send(i,a){return n?r(i,a):s.then(()=>{if(n)return r(i,a)})},listen(i,{signal:a}){self.addEventListener("message",l=>{l.source===t&&l.data!==GD&&i(l.data)},{signal:a})}}}class ofe extends nfe{constructor(e,{targetOrigin:n="*",...r}={}){super(afe(e.contentWindow,{targetOrigin:n}),r),this.iframe=e}}const zq=Ee.forwardRef(({content:t,children:e,...n},r)=>f.jsx("span",{ref:r,...n,children:t||e}));zq.displayName="UIText";const Fq=Ee.forwardRef(({label:t,onPress:e,onClick:n,children:r,...s},i)=>f.jsx("button",{ref:i,onClick:a=>{e&&e(),n&&n(a)},style:{padding:"8px 16px",backgroundColor:"#007bff",color:"white",border:"none",borderRadius:"4px",cursor:"pointer"},...s,children:t||r}));Fq.displayName="UIButton";const Uq=Ee.forwardRef(({direction:t="vertical",spacing:e="8",align:n="stretch",justify:r="flex-start",children:s,...i},a)=>f.jsx("div",{ref:a,style:{display:"flex",flexDirection:t==="horizontal"?"row":"column",gap:`${e}px`,alignItems:n,justifyContent:r},...i,children:s}));Uq.displayName="UIStack";const Bq=Ee.forwardRef(({src:t,alt:e,width:n,height:r,children:s,...i},a)=>f.jsx("img",{ref:a,src:t,alt:e,width:n,height:r,style:{maxWidth:"100%",height:"auto",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.1)"},...i}));Bq.displayName="UIImage";const qq={name:"basic",elements:[{tagName:"ui-text",component:zq,propMapping:{content:"content"},eventMapping:{}},{tagName:"ui-button",component:Fq,propMapping:{label:"label"},eventMapping:{press:"onPress"}},{tagName:"ui-stack",component:Uq,propMapping:{direction:"direction",spacing:"spacing",align:"align",justify:"justify"},eventMapping:{}},{tagName:"ui-image",component:Bq,propMapping:{src:"src",alt:"alt",width:"width",height:"height"},eventMapping:{}}]},lfe=({receiver:t})=>{const e=w.useRef(null);return w.useEffect(()=>{if(e.current)return t.connect(e.current),()=>{t.disconnect()}},[t]),f.jsx("div",{ref:e,"data-testid":"standard-dom-renderer-container"})},cfe=({resource:t,library:e,remoteElements:n=[],onUIAction:r})=>{const s=w.useRef(null),i=w.useRef(null),[a,l]=w.useState(null),u=w.useMemo(()=>(t.mimeType||"").includes("framework=react")?"react":"webcomponents",[t.mimeType]),d=`${e?.name}-${u}`,{receiver:p,components:h}=w.useMemo(()=>{switch(u){case"react":{const v=new Fde,b=e||qq,x=new Map;return b&&b.elements.forEach(E=>{const S=Gde(E.component);x.set(E.tagName,S)}),{receiver:v,components:x}}case"webcomponents":default:return{receiver:new Ude,components:null}}},[t,e,n]);w.useEffect(()=>{function v(b){var x;if(s.current&&b.source===s.current.contentWindow){const E=b.data;if(!E)return;(x=r?.(E))==null||x.catch(S=>{console.error("Error handling UI action result in RemoteDOMResourceRenderer:",S)})}}return window.addEventListener("message",v),()=>window.removeEventListener("message",v)},[r]),w.useEffect(()=>{const v=i.current;return i.current=null,()=>{v?.close()}},[d]);const g=()=>{const v=s.current;if(!v||i.current)return;const b=new ofe(v);i.current=b;const{code:x,error:E}=jde(t);if(E){l(E);return}if(x&&p!=null&&p.connection){const S={code:x,remoteElements:n,useReactRenderer:u==="react",componentLibrary:e?.name};b.imports.render(S,p.connection).catch(k=>console.error("Error calling remote render:",k))}};return a?f.jsx("p",{className:"text-red-500",children:a}):f.jsxs(f.Fragment,{children:[f.jsx("iframe",{ref:s,srcDoc:Kde,sandbox:"allow-scripts",style:{display:"none"},title:"Remote DOM Sandbox",onLoad:g},d),u==="react"&&h?f.jsx(Yde,{receiver:p,components:h}):f.jsx(lfe,{receiver:p})]})};function ufe(t){var e;if(t.contentType)return t.contentType;if(t.mimeType==="text/html")return"rawHtml";if(t.mimeType==="text/uri-list")return"externalUrl";if((e=t.mimeType)!=null&&e.startsWith("application/vnd.mcp-ui.remote-dom"))return"remoteDom"}const DN=t=>{const{resource:e,onUIAction:n,supportedContentTypes:r,htmlProps:s,remoteDomProps:i}=t,a=ufe(e);if(r&&a&&!r.includes(a))return f.jsxs("p",{className:"text-red-500",children:["Unsupported content type: ",a,"."]});switch(a){case"rawHtml":{const{proxy:l,...u}=s||{};return f.jsx(CT,{resource:e,onUIAction:n,...u})}case"externalUrl":return f.jsx(CT,{resource:e,onUIAction:n,...s});case"remoteDom":return f.jsx(cfe,{resource:e,onUIAction:n,library:i?.library||qq,...i});default:return f.jsx("p",{className:"text-red-500",children:"Unsupported resource type."})}};DN.displayName="UIResourceRenderer";function Vq({componentUrl:t,toolCall:e,toolResult:n,onCallTool:r,onSendFollowup:s,className:i,serverId:a,toolMeta:l}){const u=w.useRef(null),[d,p]=w.useState(!1),[h,g]=w.useState(null),[v,b]=w.useState(null),x=`openai-widget-state:${e.name}:${e.id}`;return w.useEffect(()=>{if(t.startsWith("ui://")&&a){let E=null;if(n?.result){const k=n.result;if(k.structuredContent)E=k.structuredContent;else if(Array.isArray(k)&&k[0]){const T=k[0];T.output?.value?.structuredContent?E=T.output.value.structuredContent:T.structuredContent?E=T.structuredContent:T.output?.value&&(E=T.output.value)}E||(E=k)}(async()=>{try{await fetch("/api/mcp/resources/widget/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({serverId:a,uri:t,toolInput:e.parameters,toolOutput:E,toolId:e.id})});const k=`/api/mcp/resources/widget/${e.id}`;b(k)}catch(k){console.error("Error storing widget data:",k),g(k instanceof Error?k.message:"Failed to prepare widget")}})()}else(t.startsWith("http://")||t.startsWith("https://"))&&b(t)},[t,a,e.parameters,e.id,n?.result]),w.useEffect(()=>{if(!v)return;const E=async T=>{if(!(!u.current||T.source!==u.current.contentWindow))switch(T.data.type){case"openai:setWidgetState":try{localStorage.setItem(x,JSON.stringify(T.data.state))}catch(R){throw R}break;case"openai:callTool":if(r)try{const R=await r(T.data.toolName,T.data.params||{});u.current?.contentWindow?.postMessage({type:"openai:callTool:response",requestId:T.data.requestId,result:R},"*")}catch(R){u.current?.contentWindow?.postMessage({type:"openai:callTool:response",requestId:T.data.requestId,error:R instanceof Error?R.message:"Unknown error"},"*")}break;case"openai:sendFollowup":s&&s(T.data.message);break}};window.addEventListener("message",E);const S=()=>{p(!0),g(null)},k=T=>{g("Failed to load component")};return u.current?.addEventListener("load",S),u.current?.addEventListener("error",k),()=>{window.removeEventListener("message",E),u.current?.removeEventListener("load",S),u.current?.removeEventListener("error",k)}},[v,x,r,s]),f.jsxs("div",{className:i,children:[h&&f.jsx("div",{className:"bg-red-50/30 dark:bg-red-950/20 border border-red-200/50 dark:border-red-800/50 rounded-lg p-4 mb-2",children:f.jsxs("p",{className:"text-sm text-red-600 dark:text-red-400",children:["Failed to load component: ",h]})}),!d&&v&&f.jsx("div",{className:"bg-blue-50/30 dark:bg-blue-950/20 border border-blue-200/50 dark:border-blue-800/50 rounded-lg p-4 mb-2",children:f.jsx("p",{className:"text-sm text-blue-600 dark:text-blue-400",children:"Loading component..."})}),v?f.jsx("iframe",{ref:u,src:v,className:"w-full border rounded-md bg-white dark:bg-gray-900",style:{minHeight:"400px",height:"600px",maxHeight:"80vh",border:"1px solid rgba(128, 128, 128, 0.3)"},sandbox:"allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox",title:`OpenAI Component: ${e.name}`,allow:"web-share"}):f.jsx("div",{className:"bg-yellow-50/30 dark:bg-yellow-950/20 border border-yellow-200/50 dark:border-yellow-800/50 rounded-lg p-4",children:f.jsx("p",{className:"text-sm text-yellow-600 dark:text-yellow-400",children:"Preparing component URL..."})})]})}function dfe(t,e,n,r){function s(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function l(p){try{d(r.next(p))}catch(h){a(h)}}function u(p){try{d(r.throw(p))}catch(h){a(h)}}function d(p){p.done?i(p.value):s(p.value).then(l,u)}d((r=r.apply(t,[])).next())})}var ffe=function(){var t=document.getSelection();if(!t.rangeCount)return function(){};for(var e=document.activeElement,n=[],r=0;r<t.rangeCount;r++)n.push(t.getRangeAt(r));switch(e.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":e.blur();break;default:e=null;break}return t.removeAllRanges(),function(){t.type==="Caret"&&t.removeAllRanges(),t.rangeCount||n.forEach(function(s){t.addRange(s)}),e&&e.focus()}},hfe=ffe,WD={"text/plain":"Text","text/html":"Url",default:"Text"},pfe="Copy to clipboard: #{key}, Enter";function mfe(t){var e=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return t.replace(/#{\s*key\s*}/g,e)}function gfe(t,e){var n,r,s,i,a,l,u=!1;e||(e={}),n=e.debug||!1;try{s=hfe(),i=document.createRange(),a=document.getSelection(),l=document.createElement("span"),l.textContent=t,l.ariaHidden="true",l.style.all="unset",l.style.position="fixed",l.style.top=0,l.style.clip="rect(0, 0, 0, 0)",l.style.whiteSpace="pre",l.style.webkitUserSelect="text",l.style.MozUserSelect="text",l.style.msUserSelect="text",l.style.userSelect="text",l.addEventListener("copy",function(p){if(p.stopPropagation(),e.format)if(p.preventDefault(),typeof p.clipboardData>"u"){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var h=WD[e.format]||WD.default;window.clipboardData.setData(h,t)}else p.clipboardData.clearData(),p.clipboardData.setData(e.format,t);e.onCopy&&(p.preventDefault(),e.onCopy(p.clipboardData))}),document.body.appendChild(l),i.selectNodeContents(l),a.addRange(i);var d=document.execCommand("copy");if(!d)throw new Error("copy command was unsuccessful");u=!0}catch(p){n&&console.error("unable to copy using execCommand: ",p),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(e.format||"text",t),e.onCopy&&e.onCopy(window.clipboardData),u=!0}catch(h){n&&console.error("unable to copy using clipboardData: ",h),n&&console.error("falling back to prompt"),r=mfe("message"in e?e.message:pfe),window.prompt(r,t)}}finally{a&&(typeof a.removeRange=="function"?a.removeRange(i):a.removeAllRanges()),l&&document.body.removeChild(l),s()}return u}var vfe=gfe;function ac(t){return Object.prototype.toString.call(t)==="[object Object]"}function em(t){return Array.isArray(t)?t.length:ac(t)?Object.keys(t).length:0}function yfe(t,e){if(typeof t=="string")return t;try{return JSON.stringify(t,(n,r)=>{switch(typeof r){case"bigint":return String(r)+"n";case"number":case"boolean":case"object":case"string":return r;default:return String(r)}},e)}catch(n){return`${n.name}: ${n.message}`||"JSON.stringify failed"}}function bfe(t){return dfe(this,void 0,void 0,function*(){try{yield navigator.clipboard.writeText(t)}catch{vfe(t)}})}function YD(t,e,n,r,s,i){if(i&&i.collapsed!==void 0)return!!i.collapsed;if(typeof r=="boolean")return r;if(typeof r=="number"&&e>r)return!0;const a=em(t);if(typeof r=="function"){const l=LN(r,[{node:t,depth:e,indexOrName:n,size:a}]);if(typeof l=="boolean")return l}return!!(Array.isArray(t)&&a>s||ac(t)&&a>s)}function KD(t,e,n,r,s,i){if(i&&i.collapsed!==void 0)return!!i.collapsed;if(typeof r=="boolean")return r;if(typeof r=="number"&&e>r)return!0;const a=Math.ceil(t.length/100);if(typeof r=="function"){const l=LN(r,[{node:t,depth:e,indexOrName:n,size:a}]);if(typeof l=="boolean")return l}return!!(Array.isArray(t)&&a>s||ac(t)&&a>s)}function df(t,e,n){return typeof t=="boolean"?t:!!(typeof t=="number"&&e>t||t==="collapsed"&&n||t==="expanded"&&!n)}function LN(t,e){try{return t(...e)}catch(n){reportError(n)}}function Hq(t){if(t===!0||ac(t)&&t.add===!0)return!0}function XD(t){if(t===!0||ac(t)&&t.edit===!0)return!0}function $N(t){if(t===!0||ac(t)&&t.delete===!0)return!0}function xfe(t){return typeof t=="function"}function Gq(t){return!t||t.add===void 0||!!t.add}function QD(t){return!t||t.edit===void 0||!!t.edit}function zN(t){return!t||t.delete===void 0||!!t.delete}function P0(t){return!t||t.enableClipboard===void 0||!!t.enableClipboard}function _fe(t){return!t||t.matchesURL===void 0||!!t.matchesURL}function wfe(t,e){return t==="string"?e.trim().replace(/^\"([\s\S]+?)\"$/,"$1"):e}var JD;function MT(){return MT=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},MT.apply(this,arguments)}var FN=function(e){return w.createElement("svg",MT({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},e),JD||(JD=w.createElement("path",{fill:"currentColor",d:"M12.473 5.806a.666.666 0 0 0-.946 0L8.473 8.86a.667.667 0 0 1-.946 0L4.473 5.806a.667.667 0 1 0-.946.94l3.06 3.06a2 2 0 0 0 2.826 0l3.06-3.06a.667.667 0 0 0 0-.94Z"})))},ZD;function OT(){return OT=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},OT.apply(this,arguments)}var Sfe=function(e){return w.createElement("svg",OT({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},e),ZD||(ZD=w.createElement("path",{fill:"currentColor",d:"M17.542 2.5h-4.75a3.963 3.963 0 0 0-3.959 3.958v4.75a3.963 3.963 0 0 0 3.959 3.959h4.75a3.963 3.963 0 0 0 3.958-3.959v-4.75A3.963 3.963 0 0 0 17.542 2.5Zm2.375 8.708a2.378 2.378 0 0 1-2.375 2.375h-4.75a2.378 2.378 0 0 1-2.375-2.375v-4.75a2.378 2.378 0 0 1 2.375-2.375h4.75a2.378 2.378 0 0 1 2.375 2.375v4.75Zm-4.75 6.334a3.963 3.963 0 0 1-3.959 3.958h-4.75A3.963 3.963 0 0 1 2.5 17.542v-4.75a3.963 3.963 0 0 1 3.958-3.959.791.791 0 1 1 0 1.584 2.378 2.378 0 0 0-2.375 2.375v4.75a2.378 2.378 0 0 0 2.375 2.375h4.75a2.378 2.378 0 0 0 2.375-2.375.792.792 0 1 1 1.584 0Z"})))},eL,tL;function PT(){return PT=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},PT.apply(this,arguments)}var Efe=function(e){return w.createElement("svg",PT({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},e),eL||(eL=w.createElement("path",{fill:"currentColor",d:"M17.25 3H6.75A3.755 3.755 0 0 0 3 6.75v10.5A3.754 3.754 0 0 0 6.75 21h10.5A3.754 3.754 0 0 0 21 17.25V6.75A3.755 3.755 0 0 0 17.25 3Zm2.25 14.25a2.25 2.25 0 0 1-2.25 2.25H6.75a2.25 2.25 0 0 1-2.25-2.25V6.75A2.25 2.25 0 0 1 6.75 4.5h10.5a2.25 2.25 0 0 1 2.25 2.25v10.5Z"})),tL||(tL=w.createElement("path",{fill:"#14C786",d:"M10.312 14.45 7.83 11.906a.625.625 0 0 0-.896 0 .659.659 0 0 0 0 .918l2.481 2.546a1.264 1.264 0 0 0 .896.381 1.237 1.237 0 0 0 .895-.38l5.858-6.011a.658.658 0 0 0 0-.919.625.625 0 0 0-.896 0l-5.857 6.01Z"})))};function I0({node:t,nodeMeta:e}){const{customizeCopy:n,CopyComponent:r,CopiedComponent:s}=w.useContext(oc),[i,a]=w.useState(!1),l=u=>{u.stopPropagation();const d=n(t,e);typeof d=="string"&&d&&bfe(d),a(!0),setTimeout(()=>a(!1),3e3)};return i?typeof s=="function"?f.jsx(s,{className:"json-view--copy",style:{display:"inline-block"}}):f.jsx(Efe,{className:"json-view--copy",style:{display:"inline-block"}}):typeof r=="function"?f.jsx(r,{onClick:l,className:"json-view--copy"}):f.jsx(Sfe,{onClick:l,className:"json-view--copy"})}function IT({indexOrName:t,value:e,depth:n,deleteHandle:r,editHandle:s,parent:i,parentPath:a}){const{displayArrayIndex:l}=w.useContext(oc),u=Array.isArray(i);return f.jsxs("div",Object.assign({className:"json-view--pair"},{children:[!u||u&&l?f.jsxs(f.Fragment,{children:[f.jsx("span",Object.assign({className:typeof t=="number"?"json-view--index":"json-view--property"},{children:t})),":"," "]}):f.jsx(f.Fragment,{}),f.jsx(Yq,{node:e,depth:n+1,deleteHandle:(d,p)=>r(d,p),editHandle:(d,p,h,g)=>s(d,p,h,g),parent:i,indexOrName:t,parentPath:a})]}))}var nL,rL;function DT(){return DT=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},DT.apply(this,arguments)}var UN=function(e){return w.createElement("svg",DT({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},e),nL||(nL=w.createElement("path",{fill:"currentColor",d:"M18.75 6h-2.325a3.757 3.757 0 0 0-3.675-3h-1.5a3.757 3.757 0 0 0-3.675 3H5.25a.75.75 0 0 0 0 1.5H6v9.75A3.754 3.754 0 0 0 9.75 21h4.5A3.754 3.754 0 0 0 18 17.25V7.5h.75a.75.75 0 1 0 0-1.5Zm-7.5-1.5h1.5A2.255 2.255 0 0 1 14.872 6H9.128a2.255 2.255 0 0 1 2.122-1.5Zm5.25 12.75a2.25 2.25 0 0 1-2.25 2.25h-4.5a2.25 2.25 0 0 1-2.25-2.25V7.5h9v9.75Z"})),rL||(rL=w.createElement("path",{fill:"#DA0000",d:"M10.5 16.5a.75.75 0 0 0 .75-.75v-4.5a.75.75 0 1 0-1.5 0v4.5a.75.75 0 0 0 .75.75ZM13.5 16.5a.75.75 0 0 0 .75-.75v-4.5a.75.75 0 1 0-1.5 0v4.5a.75.75 0 0 0 .75.75Z"})))},sL,iL;function LT(){return LT=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},LT.apply(this,arguments)}var Wq=function(e){return w.createElement("svg",LT({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},e),sL||(sL=w.createElement("path",{fill:"currentColor",d:"M21 6.75v10.5A3.754 3.754 0 0 1 17.25 21H6.75A3.754 3.754 0 0 1 3 17.25V6.75A3.754 3.754 0 0 1 6.75 3h10.5A3.754 3.754 0 0 1 21 6.75Zm-1.5 0c0-1.24-1.01-2.25-2.25-2.25H6.75C5.51 4.5 4.5 5.51 4.5 6.75v10.5c0 1.24 1.01 2.25 2.25 2.25h10.5c1.24 0 2.25-1.01 2.25-2.25V6.75Z"})),iL||(iL=w.createElement("path",{fill:"#14C786",d:"M15 12.75a.75.75 0 1 0 0-1.5h-2.25V9a.75.75 0 1 0-1.5 0v2.25H9a.75.75 0 1 0 0 1.5h2.25V15a.75.75 0 1 0 1.5 0v-2.25H15Z"})))},aL,oL;function $T(){return $T=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},$T.apply(this,arguments)}var BN=function(e){return w.createElement("svg",$T({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},e),aL||(aL=w.createElement("path",{fill:"currentColor",d:"M12 3a9 9 0 1 0 9 9 9.01 9.01 0 0 0-9-9Zm0 16.5a7.5 7.5 0 1 1 7.5-7.5 7.509 7.509 0 0 1-7.5 7.5Z"})),oL||(oL=w.createElement("path",{fill:"#14C786",d:"m10.85 13.96-1.986-2.036a.5.5 0 0 0-.716 0 .527.527 0 0 0 0 .735l1.985 2.036a1.01 1.01 0 0 0 .717.305.99.99 0 0 0 .716-.305l4.686-4.808a.526.526 0 0 0 0-.735.5.5 0 0 0-.716 0l-4.687 4.809Z"})))},lL,cL;function zT(){return zT=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},zT.apply(this,arguments)}var qN=function(e){return w.createElement("svg",zT({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},e),lL||(lL=w.createElement("path",{fill:"#DA0000",d:"M15 9a.75.75 0 0 0-1.06 0L12 10.94 10.06 9A.75.75 0 0 0 9 10.06L10.94 12 9 13.94A.75.75 0 0 0 10.06 15L12 13.06 13.94 15A.75.75 0 0 0 15 13.94L13.06 12 15 10.06A.75.75 0 0 0 15 9Z"})),cL||(cL=w.createElement("path",{fill:"currentColor",d:"M12 3a9 9 0 1 0 9 9 9.01 9.01 0 0 0-9-9Zm0 16.5a7.5 7.5 0 1 1 7.5-7.5 7.509 7.509 0 0 1-7.5 7.5Z"})))};function kfe({originNode:t,node:e,depth:n,index:r,deleteHandle:s,customOptions:i,startIndex:a,parent:l,parentPath:u}){const{enableClipboard:d,src:p,onEdit:h,onChange:g,forceUpdate:v,displaySize:b,CustomOperation:x}=w.useContext(oc),E=[...u,String(r)],[S,k]=w.useState(!0),T=w.useCallback((A,N,M)=>{t[A]=N,h&&h({newValue:N,oldValue:M,depth:n,src:p,indexOrName:A,parentType:"array",parentPath:u}),g&&g({type:"edit",depth:n,src:p,indexOrName:A,parentType:"array",parentPath:u}),v()},[e,h,g,v]),R=A=>{t.splice(A,1),s&&s(A,u),v()},j=f.jsxs(f.Fragment,{children:[!S&&f.jsxs("span",Object.assign({onClick:()=>k(!0),className:"jv-size-chevron"},{children:[df(b,n,S)&&f.jsxs("span",Object.assign({className:"jv-size"},{children:[em(e)," Items"]})),f.jsx(FN,{className:"jv-chevron"})]})),!S&&d&&P0(i)&&f.jsx(I0,{node:e,nodeMeta:{depth:n,indexOrName:r,parent:l,parentPath:u,currentPath:E}}),typeof x=="function"?f.jsx(x,{node:e}):null]});return f.jsxs("div",{children:[f.jsx("span",{children:"["}),j,S?f.jsxs("button",Object.assign({onClick:()=>k(!1),className:"jv-button"},{children:[a," ... ",a+e.length-1]})):f.jsx("div",Object.assign({className:"jv-indent"},{children:e.map((A,N)=>f.jsx(IT,{indexOrName:N+a,value:A,depth:n,parent:e,deleteHandle:R,editHandle:T,parentPath:u},String(r)+String(N)))})),f.jsx("span",{children:"]"})]})}function Tfe({node:t,depth:e,deleteHandle:n,indexOrName:r,customOptions:s,parent:i,parentPath:a}){const l=typeof r<"u"?[...a,String(r)]:a,u=[];for(let X=0;X<t.length;X+=100)u.push(t.slice(X,X+100));const{collapsed:d,enableClipboard:p,collapseObjectsAfterLength:h,editable:g,onDelete:v,src:b,onAdd:x,CustomOperation:E,onChange:S,forceUpdate:k,displaySize:T}=w.useContext(oc),[R,j]=w.useState(KD(t,e,r,d,h,s));w.useEffect(()=>{j(KD(t,e,r,d,h,s))},[d,h]);const[A,N]=w.useState(!1),M=()=>{N(!1),n&&n(r,a),v&&v({value:t,depth:e,src:b,indexOrName:r,parentType:"array",parentPath:a}),S&&S({type:"delete",depth:e,src:b,indexOrName:r,parentType:"array",parentPath:a})},[I,O]=w.useState(!1),L=()=>{const X=t;X.push(null),x&&x({indexOrName:X.length-1,depth:e,src:b,parentType:"array",parentPath:a}),S&&S({type:"add",indexOrName:X.length-1,depth:e,src:b,parentType:"array",parentPath:a}),k()},z=A||I,G=()=>{N(!1),O(!1)},W=f.jsxs(f.Fragment,{children:[!R&&!z&&f.jsxs("span",Object.assign({onClick:()=>j(!0),className:"jv-size-chevron"},{children:[df(T,e,R)&&f.jsxs("span",Object.assign({className:"jv-size"},{children:[t.length," Items"]})),f.jsx(FN,{className:"jv-chevron"})]})),z&&f.jsx(BN,{className:"json-view--edit",style:{display:"inline-block"},onClick:I?L:M}),z&&f.jsx(qN,{className:"json-view--edit",style:{display:"inline-block"},onClick:G}),!R&&!z&&p&&P0(s)&&f.jsx(I0,{node:t,nodeMeta:{depth:e,indexOrName:r,parent:i,parentPath:a,currentPath:l}}),!R&&!z&&Hq(g)&&Gq(s)&&f.jsx(Wq,{className:"json-view--edit",onClick:()=>{L()}}),!R&&!z&&$N(g)&&zN(s)&&n&&f.jsx(UN,{className:"json-view--edit",onClick:()=>N(!0)}),typeof E=="function"?f.jsx(E,{node:t}):null]});return f.jsxs(f.Fragment,{children:[f.jsx("span",{children:"["}),W,R?f.jsx("button",Object.assign({onClick:()=>j(!1),className:"jv-button"},{children:"..."})):f.jsx("div",Object.assign({className:"jv-indent"},{children:u.map((X,F)=>f.jsx(kfe,{originNode:t,node:X,depth:e,index:F,startIndex:F*100,deleteHandle:n,customOptions:s,parentPath:a},String(r)+String(F)))})),f.jsx("span",{children:"]"}),R&&df(T,e,R)&&f.jsxs("span",Object.assign({onClick:()=>j(!1),className:"jv-size"},{children:[t.length," Items"]}))]})}function Cfe({node:t,depth:e,indexOrName:n,deleteHandle:r,customOptions:s,parent:i,parentPath:a}){const{collapsed:l,onCollapse:u,enableClipboard:d,ignoreLargeArray:p,collapseObjectsAfterLength:h,editable:g,onDelete:v,src:b,onAdd:x,onEdit:E,onChange:S,forceUpdate:k,displaySize:T,CustomOperation:R}=w.useContext(oc),j=typeof n<"u"?[...a,String(n)]:a;if(!p&&Array.isArray(t)&&t.length>100)return f.jsx(Tfe,{node:t,depth:e,indexOrName:n,deleteHandle:r,customOptions:s,parentPath:j});const A=ac(t),[N,M]=w.useState(YD(t,e,n,l,h,s)),I=D=>{u?.({isCollapsing:!D,node:t,depth:e,indexOrName:n}),M(D)};w.useEffect(()=>{I(YD(t,e,n,l,h,s))},[l,h]);const O=w.useCallback((D,Z,he)=>{Array.isArray(t)?t[+D]=Z:t&&(t[D]=Z),E&&E({newValue:Z,oldValue:he,depth:e,src:b,indexOrName:D,parentType:A?"object":"array",parentPath:j}),S&&S({type:"edit",depth:e,src:b,indexOrName:D,parentType:A?"object":"array",parentPath:j}),k()},[t,E,S,k]),L=D=>{Array.isArray(t)?t.splice(+D,1):t&&delete t[D],k()},[z,G]=w.useState(!1),W=()=>{G(!1),r&&r(n,j),v&&v({value:t,depth:e,src:b,indexOrName:n,parentType:A?"object":"array",parentPath:j}),S&&S({type:"delete",depth:e,src:b,indexOrName:n,parentType:A?"object":"array",parentPath:j})},[X,F]=w.useState(!1),Y=w.useRef(null),H=()=>{var D;if(A){const Z=(D=Y.current)===null||D===void 0?void 0:D.value;Z&&(t[Z]=null,Y.current&&(Y.current.value=""),F(!1),x&&x({indexOrName:Z,depth:e,src:b,parentType:"object",parentPath:j}),S&&S({type:"add",indexOrName:Z,depth:e,src:b,parentType:"object",parentPath:j}))}else if(Array.isArray(t)){const Z=t;Z.push(null),x&&x({indexOrName:Z.length-1,depth:e,src:b,parentType:"array",parentPath:j}),S&&S({type:"add",indexOrName:Z.length-1,depth:e,src:b,parentType:"array",parentPath:j})}k()},te=D=>{D.key==="Enter"?(D.preventDefault(),H()):D.key==="Escape"&&re()},P=z||X,re=()=>{G(!1),F(!1)},ue=f.jsxs(f.Fragment,{children:[!N&&!P&&f.jsxs("span",Object.assign({onClick:()=>I(!0),className:"jv-size-chevron"},{children:[df(T,e,N)&&f.jsxs("span",Object.assign({className:"jv-size"},{children:[em(t)," Items"]})),f.jsx(FN,{className:"jv-chevron"})]})),X&&A&&f.jsx("input",{className:"json-view--input",placeholder:"property",ref:Y,onKeyDown:te}),P&&f.jsx(BN,{className:"json-view--edit",style:{display:"inline-block"},onClick:X?H:W}),P&&f.jsx(qN,{className:"json-view--edit",style:{display:"inline-block"},onClick:re}),!N&&!P&&d&&P0(s)&&f.jsx(I0,{node:t,nodeMeta:{depth:e,indexOrName:n,parent:i,parentPath:a,currentPath:j}}),!N&&!P&&Hq(g)&&Gq(s)&&f.jsx(Wq,{className:"json-view--edit",onClick:()=>{A?(F(!0),setTimeout(()=>{var D;return(D=Y.current)===null||D===void 0?void 0:D.focus()})):H()}}),!N&&!P&&$N(g)&&zN(s)&&r&&f.jsx(UN,{className:"json-view--edit",onClick:()=>G(!0)}),typeof R=="function"?f.jsx(R,{node:t}):null]});return Array.isArray(t)?f.jsxs(f.Fragment,{children:[f.jsx("span",{children:"["}),ue,N?f.jsx("button",Object.assign({onClick:()=>I(!1),className:"jv-button"},{children:"..."})):f.jsx("div",Object.assign({className:"jv-indent"},{children:t.map((D,Z)=>f.jsx(IT,{indexOrName:Z,value:D,depth:e,parent:t,deleteHandle:L,editHandle:O,parentPath:j},String(n)+String(Z)))})),f.jsx("span",{children:"]"}),N&&df(T,e,N)&&f.jsxs("span",Object.assign({onClick:()=>I(!1),className:"jv-size"},{children:[em(t)," Items"]}))]}):A?f.jsxs(f.Fragment,{children:[f.jsx("span",{children:"{"}),ue,N?f.jsx("button",Object.assign({onClick:()=>I(!1),className:"jv-button"},{children:"..."})):f.jsx("div",Object.assign({className:"jv-indent"},{children:Object.entries(t).map(([D,Z])=>f.jsx(IT,{indexOrName:D,value:Z,depth:e,parent:t,deleteHandle:L,editHandle:O,parentPath:j},String(n)+String(D)))})),f.jsx("span",{children:"}"}),N&&df(T,e,N)&&f.jsxs("span",Object.assign({onClick:()=>I(!1),className:"jv-size"},{children:[em(t)," Items"]}))]}):f.jsx("span",{children:String(t)})}const Afe=Ee.forwardRef(({str:t,className:e,ctrlClick:n},r)=>{let{collapseStringMode:s,collapseStringsAfterLength:i,customizeCollapseStringUI:a}=w.useContext(oc);const[l,u]=w.useState(!0),d=w.useRef(null);i=i>0?i:0;const p=t.replace(/\s+/g," "),h=typeof a=="function"?a(p,l):typeof a=="string"?a:"...",g=v=>{var b;if((v.ctrlKey||v.metaKey)&&n)n(v);else{const x=window.getSelection();if(x&&x.anchorOffset!==x.focusOffset&&((b=x.anchorNode)===null||b===void 0?void 0:b.parentElement)===d.current)return;u(!l)}};if(t.length<=i)return f.jsxs("span",Object.assign({ref:d,className:e,onClick:n},{children:['"',t,'"']}));if(s==="address")return t.length<=10?f.jsxs("span",Object.assign({ref:d,className:e,onClick:n},{children:['"',t,'"']})):f.jsxs("span",Object.assign({ref:d,onClick:g,className:e+" cursor-pointer"},{children:['"',l?[p.slice(0,6),h,p.slice(-4)]:t,'"']}));if(s==="directly")return f.jsxs("span",Object.assign({ref:d,onClick:g,className:e+" cursor-pointer"},{children:['"',l?[p.slice(0,i),h]:t,'"']}));if(s==="word"){let v=i,b=i+1,x=p,E=1;for(;;){if(/\W/.test(t[v])){x=t.slice(0,v);break}if(/\W/.test(t[b])){x=t.slice(0,b);break}if(E===6){x=t.slice(0,i);break}E++,v--,b++}return f.jsxs("span",Object.assign({ref:d,onClick:g,className:e+" cursor-pointer"},{children:['"',l?[x,h]:t,'"']}))}return f.jsxs("span",Object.assign({ref:d,className:e},{children:['"',t,'"']}))});var uL;function FT(){return FT=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},FT.apply(this,arguments)}var Nfe=function(e){return w.createElement("svg",FT({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},e),uL||(uL=w.createElement("path",{fill:"currentColor",d:"M17.25 3H6.75A3.754 3.754 0 0 0 3 6.75v10.5A3.754 3.754 0 0 0 6.75 21h10.5A3.754 3.754 0 0 0 21 17.25V6.75A3.754 3.754 0 0 0 17.25 3Zm2.25 14.25c0 1.24-1.01 2.25-2.25 2.25H6.75c-1.24 0-2.25-1.01-2.25-2.25V6.75c0-1.24 1.01-2.25 2.25-2.25h10.5c1.24 0 2.25 1.01 2.25 2.25v10.5Zm-6.09-9.466-5.031 5.03a2.981 2.981 0 0 0-.879 2.121v1.19c0 .415.336.75.75.75h1.19c.8 0 1.554-.312 2.12-.879l5.03-5.03a2.252 2.252 0 0 0 0-3.182c-.85-.85-2.331-.85-3.18 0Zm-2.91 7.151c-.28.28-.666.44-1.06.44H9v-.44c0-.4.156-.777.44-1.06l3.187-3.188 1.06 1.061-3.187 3.188Zm5.03-5.03-.782.783-1.06-1.061.782-.782a.766.766 0 0 1 1.06 0 .75.75 0 0 1 0 1.06Z"})))},dL,fL;function UT(){return UT=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},UT.apply(this,arguments)}var Rfe=function(e){return w.createElement("svg",UT({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},e),dL||(dL=w.createElement("path",{fill:"currentColor",d:"M6.75 3h5.5v1.5h-5.5C5.51 4.5 4.5 5.51 4.5 6.75v10.5c0 1.24 1.01 2.25 2.25 2.25h10.5c1.24 0 2.25-1.01 2.25-2.25v-5.5H21v5.5A3.754 3.754 0 0 1 17.25 21H6.75A3.754 3.754 0 0 1 3 17.25V6.75A3.754 3.754 0 0 1 6.75 3Z"})),fL||(fL=w.createElement("path",{fill:"currentColor",d:"M20.013 3h-3.946a.987.987 0 0 0 0 1.973h1.564l-6.342 6.342a1.004 1.004 0 0 0 0 1.396 1.004 1.004 0 0 0 1.396 0l6.342-6.342v1.564a.987.987 0 0 0 1.973 0V3.987A.987.987 0 0 0 20.013 3Z"})))};function Yq({node:t,depth:e,deleteHandle:n,indexOrName:r,parent:s,editHandle:i,parentPath:a}){const{collapseStringsAfterLength:l,enableClipboard:u,editable:d,src:p,onDelete:h,onChange:g,customizeNode:v,matchesURL:b,urlRegExp:x,EditComponent:E,DoneComponent:S,CancelComponent:k,CustomOperation:T}=w.useContext(oc);let R;if(typeof v=="function"&&(R=LN(v,[{node:t,depth:e,indexOrName:r}])),R){if(w.isValidElement(R))return R;if(xfe(R)){const j=R;return f.jsx(j,{node:t,depth:e,indexOrName:r})}}if(Array.isArray(t)||ac(t))return f.jsx(Cfe,{parent:s,node:t,depth:e,indexOrName:r,deleteHandle:n,parentPath:a,customOptions:typeof R=="object"?R:void 0});{const j=typeof t,A=typeof r<"u"?[...a,String(r)]:a,[N,M]=w.useState(!1),[I,O]=w.useState(!1),L=w.useRef(null),z=()=>{M(!0),setTimeout(()=>{var D,Z;(D=window.getSelection())===null||D===void 0||D.selectAllChildren(L.current),(Z=L.current)===null||Z===void 0||Z.focus()})},G=w.useCallback(()=>{let D=L.current.innerText;try{const Z=JSON.parse(D);i&&i(r,Z,t,a)}catch{const he=wfe(j,D);i&&i(r,he,t,a)}M(!1)},[i,r,t,a,j]),W=()=>{M(!1),O(!1)},X=()=>{O(!1),n&&n(r,a),h&&h({value:t,depth:e,src:p,indexOrName:r,parentType:Array.isArray(s)?"array":"object",parentPath:a}),g&&g({depth:e,src:p,indexOrName:r,parentType:Array.isArray(s)?"array":"object",type:"delete",parentPath:a})},F=w.useCallback(D=>{D.key==="Enter"?(D.preventDefault(),G()):D.key==="Escape"&&W()},[G]),Y=N||I,H=!Y&&XD(d)&&QD(R)&&i?D=>{(D.ctrlKey||D.metaKey)&&z()}:void 0,te=f.jsxs(f.Fragment,{children:[Y&&(typeof S=="function"?f.jsx(S,{className:"json-view--edit",style:{display:"inline-block"},onClick:I?X:G}):f.jsx(BN,{className:"json-view--edit",style:{display:"inline-block"},onClick:I?X:G})),Y&&(typeof k=="function"?f.jsx(k,{className:"json-view--edit",style:{display:"inline-block"},onClick:W}):f.jsx(qN,{className:"json-view--edit",style:{display:"inline-block"},onClick:W})),!Y&&u&&P0(R)&&f.jsx(I0,{node:t,nodeMeta:{depth:e,indexOrName:r,parent:s,parentPath:a,currentPath:A}}),!Y&&b&&j==="string"&&x.test(t)&&_fe(R)&&f.jsx("a",Object.assign({href:t,target:"_blank",className:"json-view--link"},{children:f.jsx(Rfe,{})})),!Y&&XD(d)&&QD(R)&&i&&(typeof E=="function"?f.jsx(E,{className:"json-view--edit",onClick:z}):f.jsx(Nfe,{className:"json-view--edit",onClick:z})),!Y&&$N(d)&&zN(R)&&n&&f.jsx(UN,{className:"json-view--edit",onClick:()=>O(!0)}),typeof T=="function"?f.jsx(T,{node:t}):null]});let P="json-view--string";switch(j){case"number":case"bigint":P="json-view--number";break;case"boolean":P="json-view--boolean";break;case"object":P="json-view--null";break}typeof R?.className=="string"&&(P+=" "+R.className),I&&(P+=" json-view--deleting");let re=String(t);j==="bigint"&&(re+="n");const ue=w.useMemo(()=>f.jsx("span",{contentEditable:!0,className:P,dangerouslySetInnerHTML:{__html:j==="string"?`"${re}"`:re},ref:L,onKeyDown:F}),[re,j,F]);return j==="string"?f.jsxs(f.Fragment,{children:[N?ue:t.length>l?f.jsx(Afe,{str:t,ref:L,className:P,ctrlClick:H}):f.jsxs("span",Object.assign({className:P,onClick:H},{children:['"',re,'"']})),te]}):f.jsxs(f.Fragment,{children:[N?ue:f.jsx("span",Object.assign({className:P,onClick:H},{children:re})),te]})}}const Kq=/^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-]([^!@#$%^&*?.\s]{0,63}[^!@#$%^&*?.\s])?\.)+[a-z]{2,6}\/?/,oc=w.createContext({src:void 0,collapseStringsAfterLength:99,collapseStringMode:"directly",customizeCollapseStringUI:void 0,collapseObjectsAfterLength:20,collapsed:!1,onCollapse:void 0,enableClipboard:!0,editable:!1,onEdit:void 0,onDelete:void 0,onAdd:void 0,onChange:void 0,forceUpdate:()=>{},customizeNode:void 0,customizeCopy:()=>{},displaySize:void 0,displayArrayIndex:!0,matchesURL:!1,urlRegExp:Kq,ignoreLargeArray:!1,CopyComponent:void 0,CopiedComponent:void 0,EditComponent:void 0,CancelComponent:void 0,DoneComponent:void 0,CustomOperation:void 0});function zl({src:t,collapseStringsAfterLength:e=99,collapseStringMode:n="directly",customizeCollapseStringUI:r,collapseObjectsAfterLength:s=99,collapsed:i,onCollapse:a,enableClipboard:l=!0,editable:u=!1,onEdit:d,onDelete:p,onAdd:h,onChange:g,dark:v=!1,theme:b="default",customizeNode:x,customizeCopy:E=W=>yfe(W),displaySize:S,displayArrayIndex:k=!0,style:T,className:R,matchesURL:j=!1,urlRegExp:A=Kq,ignoreLargeArray:N=!1,CopyComponent:M,CopiedComponent:I,EditComponent:O,CancelComponent:L,DoneComponent:z,CustomOperation:G}){const[W,X]=w.useState(0),F=w.useCallback(()=>X(te=>++te),[]),[Y,H]=w.useState(t);return w.useEffect(()=>H(t),[t]),f.jsx(oc.Provider,Object.assign({value:{src:Y,collapseStringsAfterLength:e,collapseStringMode:n,customizeCollapseStringUI:r,collapseObjectsAfterLength:s,collapsed:i,onCollapse:a,enableClipboard:l,editable:u,onEdit:d,onDelete:p,onAdd:h,onChange:g,forceUpdate:F,customizeNode:x,customizeCopy:E,displaySize:S,displayArrayIndex:k,matchesURL:j,urlRegExp:A,ignoreLargeArray:N,CopyComponent:M,CopiedComponent:I,EditComponent:O,CancelComponent:L,DoneComponent:z,CustomOperation:G}},{children:f.jsx("code",Object.assign({className:"json-view"+(v?" dark":"")+(b&&b!=="default"?" json-view_"+b:"")+(R?" "+R:""),style:T},{children:f.jsx(Yq,{node:Y,depth:1,editHandle:(te,P,re,ue)=>{H(P),d&&d({newValue:P,oldValue:re,depth:1,src:Y,indexOrName:te,parentType:null,parentPath:ue}),g&&g({type:"edit",depth:1,src:Y,indexOrName:te,parentType:null,parentPath:ue})},deleteHandle:(te,P)=>{H(void 0),p&&p({value:Y,depth:1,src:Y,indexOrName:te,parentType:null,parentPath:P}),g&&g({depth:1,src:Y,indexOrName:te,parentType:null,type:"delete",parentPath:P})},parentPath:[]})}))}))}function jfe(t){if(!t)return null;const e=t,n=e?.resource;if(n&&typeof n=="object"&&typeof n.uri=="string"&&n.uri.startsWith("ui://"))return n;const r=e?.content;if(Array.isArray(r)){for(const s of r)if(s&&s.type==="resource"&&s.resource&&typeof s.resource.uri=="string"&&s.resource.uri.startsWith("ui://"))return s.resource}return null}function Mfe({error:t,showStructured:e,onToggleStructured:n,structuredResult:r,result:s,validationErrors:i,unstructuredValidationResult:a,onExecuteFromUI:l,onHandleIntent:u,onSendFollowup:d,serverId:p,toolCallId:h,toolName:g,toolParameters:v,toolCallTimestamp:b,toolMeta:x}){const E=s,S=x?.["openai/outputTemplate"],k=S&&typeof S=="string",T=jfe(s);return f.jsxs("div",{className:"h-full flex flex-col border-t border-border bg-background",children:[f.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[f.jsxs("div",{className:"flex items-center gap-4",children:[f.jsx("h2",{className:"text-xs font-semibold text-foreground",children:"Response"}),e&&i!==void 0&&(i===null?f.jsxs(vr,{variant:"default",className:"bg-green-600 hover:bg-green-700",children:[f.jsx(sf,{className:"h-3 w-3 mr-1.5"}),"Valid"]}):f.jsxs(vr,{variant:"destructive",children:[f.jsx(af,{className:"h-3 w-3 mr-1.5"}),"Invalid"]}))]}),E&&(r||k)&&f.jsxs("div",{className:"flex gap-2",children:[f.jsx(Ie,{size:"sm",variant:e?"outline":"default",onClick:()=>n(!1),children:k?"Component":"Raw Output"}),f.jsx(Ie,{size:"sm",variant:e?"default":"outline",onClick:()=>n(!0),children:k?"Raw JSON":"Structured Output"})]})]}),f.jsx("div",{className:"flex-1 overflow-hidden",children:t?f.jsx("div",{className:"p-4",children:f.jsx("div",{className:"p-3 bg-destructive/10 border border-destructive/20 rounded text-destructive text-xs font-medium",children:t})}):e&&i?f.jsxs("div",{className:"p-4",children:[f.jsx("h3",{className:"text-sm font-semibold text-destructive mb-2",children:"Validation Errors"}),f.jsxs("div",{className:"p-3 bg-destructive/10 border border-destructive/20 rounded-md",children:[f.jsx(zl,{src:i,theme:"atom",dark:!0,enableClipboard:!0,displaySize:!1,collapseStringsAfterLength:100,style:{fontSize:"12px",fontFamily:"ui-monospace, SFMono-Regular, 'SF Mono', monospace",backgroundColor:"hsl(var(--background))",padding:"16px",borderRadius:"8px",border:"1px solid hsl(var(--border))"}}),Array.isArray(i)&&i.length>0&&f.jsx("span",{className:"text-sm font-semibold text-destructive mb-2",children:`${i[0].instancePath?.slice(1)??""} ${i[0].message??""}`})]})]}):e&&E&&k?f.jsx(La,{className:"h-full",children:f.jsx("div",{className:"p-4",children:f.jsx(zl,{src:E,dark:!0,theme:"atom",enableClipboard:!0,displaySize:!1,collapseStringsAfterLength:100,style:{fontSize:"12px",fontFamily:"ui-monospace, SFMono-Regular, 'SF Mono', monospace",backgroundColor:"hsl(var(--background))",padding:"16px",borderRadius:"8px",border:"1px solid hsl(var(--border))"}})})}):e&&r&&i===null?f.jsx(La,{className:"h-full",children:f.jsx("div",{className:"p-4",children:f.jsx(zl,{src:r,dark:!0,theme:"atom",enableClipboard:!0,displaySize:!1,collapseStringsAfterLength:100,style:{fontSize:"12px",fontFamily:"ui-monospace, SFMono-Regular, 'SF Mono', monospace",backgroundColor:"hsl(var(--background))",padding:"16px",borderRadius:"8px",border:"1px solid hsl(var(--border))"}})})}):E?!e&&k&&S?f.jsx(Vq,{componentUrl:S,toolCall:{id:h||"tool-result",name:g||"tool",parameters:v||{},timestamp:b||new Date,status:"completed"},toolResult:{id:`${h||"tool-result"}-result`,toolCallId:h||"tool-result",result:E,timestamp:new Date},onCallTool:async(R,j)=>{const A=await l(R,j);if("error"in A)return{isError:!0,error:A.error};if(A.status==="completed"){const N=A.result,M=N?.structuredContent||N;return{_meta:null,content:N?.content||[],structuredContent:M,isError:!1,result:JSON.stringify(M),meta:{}}}return{isError:!0,error:"Elicitation not supported in this context"}},onSendFollowup:d,serverId:p,toolMeta:x}):!e&&T?f.jsx(DN,{resource:T,htmlProps:{autoResizeIframe:!0,style:{width:"100%",minHeight:"500px",height:"auto",overflow:"visible"}},onUIAction:async R=>(R.type==="tool"&&R.payload?.toolName?await l(R.payload.toolName,R.payload.params||{}):R.type==="intent"&&R.payload?.intent?await u(R.payload.intent,R.payload.params||{}):R.type==="link"&&R.payload?.url&&window.open(R.payload.url,"_blank","noopener,noreferrer"),{status:"handled"})}):f.jsxs("div",{className:"p-4",children:[a==="valid"&&f.jsxs(vr,{variant:"default",className:"bg-green-600 hover:bg-green-700 mb-4",children:[f.jsx(sf,{className:"h-3 w-3 mr-1.5"}),"Success: Content matches the output schema."]}),a==="schema_mismatch"&&f.jsxs(vr,{variant:"destructive",className:"mb-4",children:[f.jsx(af,{className:"h-3 w-3 mr-1.5"}),"Error: Content does not match the output schema."]}),a==="invalid_json"&&f.jsxs(vr,{variant:"destructive",className:"bg-amber-600 hover:bg-amber-700 mb-4",children:[f.jsx(af,{className:"h-3 w-3 mr-1.5"}),"Warning: Output schema provided by the tool is invalid."]}),f.jsx(zl,{src:E,dark:!0,theme:"atom",enableClipboard:!0,displaySize:!1,collapseStringsAfterLength:100,style:{fontSize:"12px",fontFamily:"ui-monospace, SFMono-Regular, 'SF Mono', monospace",backgroundColor:"hsl(var(--background))",padding:"16px",borderRadius:"8px",border:"1px solid hsl(var(--border))",width:"calc(100vw - var(--sidebar-width) - 16px - 16px)"}})]}):f.jsx("div",{className:"flex items-center justify-center h-full",children:f.jsx("p",{className:"text-xs text-muted-foreground font-medium",children:"Execute a tool to see results here"})})})]})}const Xq=w.forwardRef(({value:t,onValueChange:e,placeholder:n="Search…",className:r,clearable:s=!0,iconClassName:i,...a},l)=>f.jsxs("div",{className:"relative",children:[f.jsx(vB,{className:Me("absolute left-2.5 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground",i)}),f.jsx(Un,{ref:l,value:t,onChange:u=>e(u.target.value),placeholder:n,type:"search",role:"searchbox","aria-label":n,autoComplete:"off",spellCheck:!1,className:Me("pl-7 h-8 bg-background border-border hover:border-border/80 text-xs md:text-xs leading-4 text-foreground placeholder:text-muted-foreground/70",r),...a}),s&&t&&f.jsx("button",{type:"button",onClick:()=>e(""),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors","aria-label":"Clear search",children:f.jsx(Nu,{className:"h-3 w-3"})})]}));Xq.displayName="SearchInput";function Ofe({tool:t,name:e,isSelected:n,onClick:r}){return f.jsx("div",{className:`cursor-pointer transition-all duration-200 hover:bg-muted/30 dark:hover:bg-muted/50 p-3 rounded-md mx-2 ${n?"bg-muted/50 dark:bg-muted/50 shadow-sm border border-border ring-1 ring-ring/20":"hover:shadow-sm"}`,onClick:r,children:f.jsxs("div",{className:"flex items-start gap-3",children:[f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("div",{className:"flex items-center gap-2 mb-1",children:f.jsx("code",{className:"font-mono text-xs font-medium text-foreground bg-muted px-1.5 py-0.5 rounded border border-border",children:e})}),t.description&&f.jsx("p",{className:"text-xs mt-2 line-clamp-2 leading-relaxed text-muted-foreground",children:t.description})]}),f.jsx(Ba,{className:"h-3 w-3 text-muted-foreground flex-shrink-0 mt-1"})]})})}function Pfe({request:t,isHighlighted:e,onLoad:n,onRename:r,onDuplicate:s,onDelete:i}){return f.jsx("div",{className:`group p-2 rounded mx-2 cursor-pointer transition-all duration-200 ${e?"bg-primary/20 border border-primary/30 shadow-sm":"hover:bg-muted/40"}`,onClick:()=>n(t),children:f.jsxs("div",{className:"flex items-start justify-between",children:[f.jsxs("div",{className:"min-w-0 pr-2",children:[f.jsx("div",{className:"flex items-center gap-2",children:f.jsx("code",{className:"font-mono text-[10px] bg-muted px-1.5 py-0.5 rounded border border-border",children:t.toolName})}),f.jsxs("div",{children:[f.jsx("div",{className:"text-xs font-medium truncate",children:t.title}),t.description&&f.jsx("div",{className:"text-[10px] text-muted-foreground truncate",children:t.description})]})]}),f.jsxs("div",{className:"flex gap-1",children:[f.jsx(Ie,{onClick:a=>{a.stopPropagation(),r(t)},size:"sm",variant:"ghost",className:"h-6 w-6 p-0 opacity-0 group-hover:opacity-100",children:f.jsx(Jse,{className:"w-3 h-3"})}),f.jsx(Ie,{onClick:a=>{a.stopPropagation(),s(t)},size:"sm",variant:"ghost",className:"h-6 w-6 p-0 opacity-0 group-hover:opacity-100",children:f.jsx(Po,{className:"w-3 h-3"})}),f.jsx(Ie,{onClick:a=>{a.stopPropagation(),i(t.id)},size:"sm",variant:"ghost",className:"h-6 w-6 p-0 opacity-0 group-hover:opacity-100",children:f.jsx(wie,{className:"w-3 h-3"})})]})]})})}function Ife({activeTab:t,onChangeTab:e,tools:n,toolNames:r,filteredToolNames:s,selectedToolName:i,fetchingTools:a,searchQuery:l,onSearchQueryChange:u,onRefresh:d,onSelectTool:p,savedRequests:h,highlightedRequestId:g,onLoadRequest:v,onRenameRequest:b,onDuplicateRequest:x,onDeleteRequest:E}){return f.jsx(ni,{defaultSize:35,minSize:20,maxSize:55,children:f.jsxs("div",{className:"h-full border-r border-border bg-background",children:[f.jsx("div",{className:"border-b border-border",children:f.jsxs("div",{className:"flex",children:[f.jsx("button",{onClick:()=>e("tools"),className:`px-4 py-3 text-xs font-medium border-b-2 transition-colors ${t==="tools"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"}`,children:"Tools"}),f.jsxs("button",{onClick:()=>e("saved"),className:`px-4 py-3 text-xs font-medium border-b-2 transition-colors ${t==="saved"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"}`,children:["Saved Requests",h.length>0&&f.jsx("span",{className:"ml-2 bg-muted text-muted-foreground rounded px-1.5 py-0.5 text-xs font-mono",children:h.length})]})]})}),f.jsxs("div",{className:"px-4 py-4 border-b border-border bg-background space-y-3",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(kk,{className:"h-3 w-3 text-muted-foreground"}),f.jsx("h2",{className:"text-xs font-semibold text-foreground",children:"Tools"}),f.jsx(vr,{variant:"secondary",className:"text-xs font-mono",children:t==="tools"?r.length:h.length})]}),f.jsx(Ie,{onClick:d,variant:"ghost",size:"sm",disabled:a,children:t==="tools"&&f.jsx(ir,{className:`h-3 w-3 ${a?"animate-spin":""} cursor-pointer`})})]}),f.jsx(Xq,{value:l,onValueChange:u,placeholder:"Search tools by name or description"})]}),t==="tools"?f.jsx("div",{className:"h-[calc(100%-49px)] flex flex-col",children:f.jsx("div",{className:"flex-1 overflow-hidden",children:f.jsx(La,{className:"h-full",children:f.jsx("div",{className:"p-2",children:a?f.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[f.jsx("div",{className:"w-8 h-8 bg-muted rounded-full flex items-center justify-center mb-3",children:f.jsx(ir,{className:"h-4 w-4 text-muted-foreground animate-spin cursor-pointer"})}),f.jsx("p",{className:"text-xs text-muted-foreground font-semibold mb-1",children:"Loading tools..."}),f.jsx("p",{className:"text-xs text-muted-foreground/70",children:"Fetching available tools from server"})]}):s.length===0?f.jsx("div",{className:"text-center py-8",children:f.jsx("p",{className:"text-sm text-muted-foreground",children:n&&r.length===0?"No tools were found. Try refreshing. Make sure you selected the correct server and the server is running.":"No tools match your search."})}):f.jsx("div",{className:"grid grid-cols-1 gap-2",children:s.map(S=>f.jsx(Ofe,{tool:n[S],name:S,isSelected:i===S,onClick:()=>p(S)},S))})})})})}):f.jsx("div",{className:"h-full",children:f.jsx(La,{className:"h-full",children:f.jsx("div",{className:"p-3 space-y-1",children:h.length===0?f.jsx("div",{className:"text-center py-8",children:f.jsx("p",{className:"text-sm text-muted-foreground",children:"No saved requests yet."})}):h.map(S=>f.jsx(Pfe,{request:S,isHighlighted:g===S.id,onLoad:v,onRename:b,onDuplicate:x,onDelete:E},S.id))})})})]})})}function Dfe({open:t,defaultTitle:e="",defaultDescription:n="",onCancel:r,onSave:s}){const[i,a]=w.useState(e),[l,u]=w.useState(n);return w.useEffect(()=>{t&&(a(e||""),u(n||""))},[t,e,n]),f.jsx(aa,{open:t,children:f.jsxs(oa,{className:"sm:max-w-md",onEscapeKeyDown:r,onPointerDownOutside:r,children:[f.jsxs(la,{children:[f.jsx(ca,{children:"Save request"}),f.jsx(Jf,{children:"Give this request a memorable name and optional description."})]}),f.jsxs("div",{className:"space-y-3 py-2",children:[f.jsxs("div",{className:"space-y-1",children:[f.jsx("label",{className:"text-xs font-medium",children:"Name"}),f.jsx(Un,{value:i,onChange:d=>a(d.target.value),placeholder:"My saved request",className:"text-sm"})]}),f.jsxs("div",{className:"space-y-1",children:[f.jsx("label",{className:"text-xs font-medium",children:"Description"}),f.jsx(Ho,{value:l,onChange:d=>u(d.target.value),placeholder:"Optional description",className:"text-sm h-20"})]})]}),f.jsxs(v0,{children:[f.jsx(Ie,{variant:"ghost",onClick:r,size:"sm",children:"Cancel"}),f.jsx(Ie,{onClick:()=>{const d=(i||"").trim();d&&s({title:d,description:l?.trim()||void 0})},size:"sm",children:"Save"})]})]})})}function Lfe(t,e){switch(t){case"enum":return e?.[0]||"";case"string":return"";case"number":case"integer":return"";case"boolean":return!1;case"array":return[];case"object":return{};default:return""}}function $fe(t){if(!t||!t.properties)return[];const e=[],n=t.required||[];return Object.entries(t.properties).forEach(([r,s])=>{const i=s.enum?"enum":s.type||"string";e.push({name:r,type:i,description:s.description,required:n.includes(r),value:Lfe(i,s.enum),enum:s.enum,minimum:s.minimum,maximum:s.maximum,pattern:s.pattern})}),e}function zfe(t,e){return t.map(n=>{if(Object.prototype.hasOwnProperty.call(e,n.name)){const r=e[n.name];return n.type==="array"||n.type==="object"?{...n,value:JSON.stringify(r,null,2)}:{...n,value:r}}return n})}function Ffe(t,e){const n={};return t.forEach(r=>{if(!(r.required||r.value!==""&&r.value!==null&&r.value!==void 0))return;let i=r.value;try{r.type==="number"||r.type==="integer"?(i=Number(r.value),isNaN(i)&&e?.("Invalid number value for field",{fieldName:r.name,value:r.value})):r.type==="boolean"?i=!!r.value:(r.type==="array"||r.type==="object")&&(i=JSON.parse(r.value)),n[r.name]=i}catch(a){e?.("Failed to process field value",{fieldName:r.name,type:r.type,value:r.value,error:a}),n[r.name]=r.value}}),n}const Ufe="mcp-inspector.saved-requests";function VN(t){return`${Ufe}:${t}`}function Ll(t){try{const e=localStorage.getItem(VN(t));if(!e)return[];const n=JSON.parse(e);return Array.isArray(n)?n:[]}catch{return[]}}function HN(t,e){const n=new Date().toISOString(),r=Ll(t);let s;if(e.id){s={id:e.id,title:e.title,description:e.description,toolName:e.toolName,parameters:e.parameters,isFavorite:e.isFavorite,serverKey:t,createdAt:r.find(a=>a.id===e.id)?.createdAt||n,updatedAt:n};const i=r.findIndex(a=>a.id===s.id);i>=0?r[i]=s:r.push(s)}else s={id:crypto.randomUUID(),title:e.title,description:e.description,toolName:e.toolName,parameters:e.parameters,isFavorite:e.isFavorite,serverKey:t,createdAt:n,updatedAt:n},r.unshift(s);return localStorage.setItem(VN(t),JSON.stringify(r)),s}function Bfe(t,e){const n=Ll(t).filter(r=>r.id!==e);localStorage.setItem(VN(t),JSON.stringify(n))}function Qq(t,e){return Ll(t).find(n=>n.id===e)}function qfe(t,e){const n=Qq(t,e);if(n)return HN(t,{title:`${n.title} (copy)`,description:n.description,toolName:n.toolName,parameters:n.parameters,isFavorite:n.isFavorite})}function Vfe(t,e,n){const r=Qq(t,e);if(r)return HN(t,{id:e,title:n.title??r.title,description:n.description??r.description,toolName:r.toolName,parameters:r.parameters,isFavorite:n.isFavorite??r.isFavorite})}var oE,hL;function Hfe(){if(hL)return oE;hL=1;function t(e,r){var r=r||{};this._capacity=r.capacity,this._head=0,this._tail=0,Array.isArray(e)?this._fromArray(e):(this._capacityMask=3,this._list=new Array(4))}return t.prototype.peekAt=function(n){var r=n;if(r===(r|0)){var s=this.size();if(!(r>=s||r<-s))return r<0&&(r+=s),r=this._head+r&this._capacityMask,this._list[r]}},t.prototype.get=function(n){return this.peekAt(n)},t.prototype.peek=function(){if(this._head!==this._tail)return this._list[this._head]},t.prototype.peekFront=function(){return this.peek()},t.prototype.peekBack=function(){return this.peekAt(-1)},Object.defineProperty(t.prototype,"length",{get:function(){return this.size()}}),t.prototype.size=function(){return this._head===this._tail?0:this._head<this._tail?this._tail-this._head:this._capacityMask+1-(this._head-this._tail)},t.prototype.unshift=function(n){if(arguments.length===0)return this.size();var r=this._list.length;return this._head=this._head-1+r&this._capacityMask,this._list[this._head]=n,this._tail===this._head&&this._growArray(),this._capacity&&this.size()>this._capacity&&this.pop(),this._head<this._tail?this._tail-this._head:this._capacityMask+1-(this._head-this._tail)},t.prototype.shift=function(){var n=this._head;if(n!==this._tail){var r=this._list[n];return this._list[n]=void 0,this._head=n+1&this._capacityMask,n<2&&this._tail>1e4&&this._tail<=this._list.length>>>2&&this._shrinkArray(),r}},t.prototype.push=function(n){if(arguments.length===0)return this.size();var r=this._tail;return this._list[r]=n,this._tail=r+1&this._capacityMask,this._tail===this._head&&this._growArray(),this._capacity&&this.size()>this._capacity&&this.shift(),this._head<this._tail?this._tail-this._head:this._capacityMask+1-(this._head-this._tail)},t.prototype.pop=function(){var n=this._tail;if(n!==this._head){var r=this._list.length;this._tail=n-1+r&this._capacityMask;var s=this._list[this._tail];return this._list[this._tail]=void 0,this._head<2&&n>1e4&&n<=r>>>2&&this._shrinkArray(),s}},t.prototype.removeOne=function(n){var r=n;if(r===(r|0)&&this._head!==this._tail){var s=this.size(),i=this._list.length;if(!(r>=s||r<-s)){r<0&&(r+=s),r=this._head+r&this._capacityMask;var a=this._list[r],l;if(n<s/2){for(l=n;l>0;l--)this._list[r]=this._list[r=r-1+i&this._capacityMask];this._list[r]=void 0,this._head=this._head+1+i&this._capacityMask}else{for(l=s-1-n;l>0;l--)this._list[r]=this._list[r=r+1+i&this._capacityMask];this._list[r]=void 0,this._tail=this._tail-1+i&this._capacityMask}return a}}},t.prototype.remove=function(n,r){var s=n,i,a=r;if(s===(s|0)&&this._head!==this._tail){var l=this.size(),u=this._list.length;if(!(s>=l||s<-l||r<1)){if(s<0&&(s+=l),r===1||!r)return i=new Array(1),i[0]=this.removeOne(s),i;if(s===0&&s+r>=l)return i=this.toArray(),this.clear(),i;s+r>l&&(r=l-s);var d;for(i=new Array(r),d=0;d<r;d++)i[d]=this._list[this._head+s+d&this._capacityMask];if(s=this._head+s&this._capacityMask,n+r===l){for(this._tail=this._tail-r+u&this._capacityMask,d=r;d>0;d--)this._list[s=s+1+u&this._capacityMask]=void 0;return i}if(n===0){for(this._head=this._head+r+u&this._capacityMask,d=r-1;d>0;d--)this._list[s=s+1+u&this._capacityMask]=void 0;return i}if(s<l/2){for(this._head=this._head+n+r+u&this._capacityMask,d=n;d>0;d--)this.unshift(this._list[s=s-1+u&this._capacityMask]);for(s=this._head-1+u&this._capacityMask;a>0;)this._list[s=s-1+u&this._capacityMask]=void 0,a--;n<0&&(this._tail=s)}else{for(this._tail=s,s=s+r+u&this._capacityMask,d=l-(r+n);d>0;d--)this.push(this._list[s++]);for(s=this._tail;a>0;)this._list[s=s+1+u&this._capacityMask]=void 0,a--}return this._head<2&&this._tail>1e4&&this._tail<=u>>>2&&this._shrinkArray(),i}}},t.prototype.splice=function(n,r){var s=n;if(s===(s|0)){var i=this.size();if(s<0&&(s+=i),!(s>i))if(arguments.length>2){var a,l,u,d=arguments.length,p=this._list.length,h=2;if(!i||s<i/2){for(l=new Array(s),a=0;a<s;a++)l[a]=this._list[this._head+a&this._capacityMask];for(r===0?(u=[],s>0&&(this._head=this._head+s+p&this._capacityMask)):(u=this.remove(s,r),this._head=this._head+s+p&this._capacityMask);d>h;)this.unshift(arguments[--d]);for(a=s;a>0;a--)this.unshift(l[a-1])}else{l=new Array(i-(s+r));var g=l.length;for(a=0;a<g;a++)l[a]=this._list[this._head+s+r+a&this._capacityMask];for(r===0?(u=[],s!=i&&(this._tail=this._head+s+p&this._capacityMask)):(u=this.remove(s,r),this._tail=this._tail-g+p&this._capacityMask);h<d;)this.push(arguments[h++]);for(a=0;a<g;a++)this.push(l[a])}return u}else return this.remove(s,r)}},t.prototype.clear=function(){this._list=new Array(this._list.length),this._head=0,this._tail=0},t.prototype.isEmpty=function(){return this._head===this._tail},t.prototype.toArray=function(){return this._copyArray(!1)},t.prototype._fromArray=function(n){var r=n.length,s=this._nextPowerOf2(r);this._list=new Array(s),this._capacityMask=s-1,this._tail=r;for(var i=0;i<r;i++)this._list[i]=n[i]},t.prototype._copyArray=function(n,r){var s=this._list,i=s.length,a=this.length;if(r=r|a,r==a&&this._head<this._tail)return this._list.slice(this._head,this._tail);var l=new Array(r),u=0,d;if(n||this._head>this._tail){for(d=this._head;d<i;d++)l[u++]=s[d];for(d=0;d<this._tail;d++)l[u++]=s[d]}else for(d=this._head;d<this._tail;d++)l[u++]=s[d];return l},t.prototype._growArray=function(){if(this._head!=0){var n=this._copyArray(!0,this._list.length<<1);this._tail=this._list.length,this._head=0,this._list=n}else this._tail=this._list.length,this._list.length<<=1;this._capacityMask=this._capacityMask<<1|1},t.prototype._shrinkArray=function(){this._list.length>>>=1,this._capacityMask>>>=1},t.prototype._nextPowerOf2=function(n){var r=Math.log(n)/Math.log(2),s=1<<r+1;return Math.max(s,4)},oE=t,oE}var Gfe=Hfe();const Wfe=Vf(Gfe),pL={error:0,warn:1,info:2,debug:3,trace:4},Yfe={error:"#ef4444",warn:"#f59e0b",info:"#3b82f6",debug:"#8b5cf6",trace:"#6b7280"};class Kfe{config={level:"info",enableConsole:!0,maxBufferSize:1e3};buffer=new Wfe([],{capacity:this.config.maxBufferSize});listeners=new Set;setConfig(e){this.config={...this.config,...e},this.notifyListeners()}getConfig(){return{...this.config}}addEntry(e){this.buffer.unshift(e),this.notifyListeners()}getEntries(){return this.buffer.toArray()}clearBuffer(){this.buffer.clear(),this.notifyListeners()}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}notifyListeners(){this.listeners.forEach(e=>e())}shouldLog(e){return pL[e]<=pL[this.config.level]}}const Yi=new Kfe;typeof window<"u"&&Yi.setConfig({level:"info",enableConsole:!0});function GN(t="Unknown"){const e=w.useCallback(r=>(s,i,a)=>{if(!Yi.shouldLog(r))return;const u={timestamp:new Date().toISOString(),level:r,context:t,message:s,data:i,error:a};Yi.addEntry(u),Yi.getConfig().enableConsole&&Xfe(u)},[t]);return w.useMemo(()=>({error:e("error"),warn:e("warn"),info:e("info"),debug:e("debug"),trace:e("trace"),context:t}),[e,t])}function Xfe(t){const{timestamp:e,level:n,context:r,message:s,data:i,error:a}=t,l=new Date(e).toLocaleTimeString(),u=Yfe[n],d=`color: ${u}; font-weight: bold;`,p=`color: ${u};`,h=[`%c[${l}] %c${n.toUpperCase()} %c[${r}] %c${s}`,"color: #6b7280;",d,"color: #6b7280;",p];i!==void 0&&h.push(`
|
|
1774
1774
|
Data:`,i),a&&h.push(`
|
|
1775
|
-
Error:`,a),(n==="error"?console.error:n==="warn"?console.warn:n==="debug"?console.debug:console.log)(...h)}function Qfe(){const[,t]=w.useState({});return w.useEffect(()=>{const e=Yi.subscribe(()=>{t({})});return()=>{e()}},[]),{entries:Yi.getEntries(),config:Yi.getConfig(),setConfig:Yi.setConfig.bind(Yi),clearBuffer:Yi.clearBuffer.bind(Yi)}}var qp={exports:{}};/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */var Jfe=qp.exports,mL;function Zfe(){return mL||(mL=1,function(t,e){(function(n,r){r(e)})(Jfe,function(n){function r(){for(var ne=arguments.length,Q=Array(ne),se=0;se<ne;se++)Q[se]=arguments[se];if(Q.length>1){Q[0]=Q[0].slice(0,-1);for(var ye=Q.length-1,me=1;me<ye;++me)Q[me]=Q[me].slice(1,-1);return Q[ye]=Q[ye].slice(1),Q.join("")}else return Q[0]}function s(ne){return"(?:"+ne+")"}function i(ne){return ne===void 0?"undefined":ne===null?"null":Object.prototype.toString.call(ne).split(" ").pop().split("]").shift().toLowerCase()}function a(ne){return ne.toUpperCase()}function l(ne){return ne!=null?ne instanceof Array?ne:typeof ne.length!="number"||ne.split||ne.setInterval||ne.call?[ne]:Array.prototype.slice.call(ne):[]}function u(ne,Q){var se=ne;if(Q)for(var ye in Q)se[ye]=Q[ye];return se}function d(ne){var Q="[A-Za-z]",se="[0-9]",ye=r(se,"[A-Fa-f]"),me=s(s("%[EFef]"+ye+"%"+ye+ye+"%"+ye+ye)+"|"+s("%[89A-Fa-f]"+ye+"%"+ye+ye)+"|"+s("%"+ye+ye)),nt="[\\:\\/\\?\\#\\[\\]\\@]",tt="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",Mt=r(nt,tt),sn=ne?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",hn=ne?"[\\uE000-\\uF8FF]":"[]",at=r(Q,se,"[\\-\\.\\_\\~]",sn);s(Q+r(Q,se,"[\\+\\-\\.]")+"*"),s(s(me+"|"+r(at,tt,"[\\:]"))+"*");var ln=s(s("25[0-5]")+"|"+s("2[0-4]"+se)+"|"+s("1"+se+se)+"|"+s("0?[1-9]"+se)+"|0?0?"+se),jn=s(ln+"\\."+ln+"\\."+ln+"\\."+ln),lt=s(ye+"{1,4}"),an=s(s(lt+"\\:"+lt)+"|"+jn),Hn=s(s(lt+"\\:")+"{6}"+an),yn=s("\\:\\:"+s(lt+"\\:")+"{5}"+an),zi=s(s(lt)+"?\\:\\:"+s(lt+"\\:")+"{4}"+an),oi=s(s(s(lt+"\\:")+"{0,1}"+lt)+"?\\:\\:"+s(lt+"\\:")+"{3}"+an),as=s(s(s(lt+"\\:")+"{0,2}"+lt)+"?\\:\\:"+s(lt+"\\:")+"{2}"+an),Fi=s(s(s(lt+"\\:")+"{0,3}"+lt)+"?\\:\\:"+lt+"\\:"+an),zr=s(s(s(lt+"\\:")+"{0,4}"+lt)+"?\\:\\:"+an),Qr=s(s(s(lt+"\\:")+"{0,5}"+lt)+"?\\:\\:"+lt),zs=s(s(s(lt+"\\:")+"{0,6}"+lt)+"?\\:\\:"),bs=s([Hn,yn,zi,oi,as,Fi,zr,Qr,zs].join("|")),Fs=s(s(at+"|"+me)+"+");s("[vV]"+ye+"+\\."+r(at,tt,"[\\:]")+"+"),s(s(me+"|"+r(at,tt))+"*");var Qa=s(me+"|"+r(at,tt,"[\\:\\@]"));return s(s(me+"|"+r(at,tt,"[\\@]"))+"+"),s(s(Qa+"|"+r("[\\/\\?]",hn))+"*"),{NOT_SCHEME:new RegExp(r("[^]",Q,se,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(r("[^\\%\\:]",at,tt),"g"),NOT_HOST:new RegExp(r("[^\\%\\[\\]\\:]",at,tt),"g"),NOT_PATH:new RegExp(r("[^\\%\\/\\:\\@]",at,tt),"g"),NOT_PATH_NOSCHEME:new RegExp(r("[^\\%\\/\\@]",at,tt),"g"),NOT_QUERY:new RegExp(r("[^\\%]",at,tt,"[\\:\\@\\/\\?]",hn),"g"),NOT_FRAGMENT:new RegExp(r("[^\\%]",at,tt,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(r("[^]",at,tt),"g"),UNRESERVED:new RegExp(at,"g"),OTHER_CHARS:new RegExp(r("[^\\%]",at,Mt),"g"),PCT_ENCODED:new RegExp(me,"g"),IPV4ADDRESS:new RegExp("^("+jn+")$"),IPV6ADDRESS:new RegExp("^\\[?("+bs+")"+s(s("\\%25|\\%(?!"+ye+"{2})")+"("+Fs+")")+"?\\]?$")}}var p=d(!1),h=d(!0),g=function(){function ne(Q,se){var ye=[],me=!0,nt=!1,tt=void 0;try{for(var Mt=Q[Symbol.iterator](),sn;!(me=(sn=Mt.next()).done)&&(ye.push(sn.value),!(se&&ye.length===se));me=!0);}catch(hn){nt=!0,tt=hn}finally{try{!me&&Mt.return&&Mt.return()}finally{if(nt)throw tt}}return ye}return function(Q,se){if(Array.isArray(Q))return Q;if(Symbol.iterator in Object(Q))return ne(Q,se);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),v=function(ne){if(Array.isArray(ne)){for(var Q=0,se=Array(ne.length);Q<ne.length;Q++)se[Q]=ne[Q];return se}else return Array.from(ne)},b=2147483647,x=36,E=1,S=26,k=38,T=700,R=72,j=128,A="-",N=/^xn--/,M=/[^\0-\x7E]/,I=/[\x2E\u3002\uFF0E\uFF61]/g,O={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},L=x-E,z=Math.floor,G=String.fromCharCode;function W(ne){throw new RangeError(O[ne])}function X(ne,Q){for(var se=[],ye=ne.length;ye--;)se[ye]=Q(ne[ye]);return se}function F(ne,Q){var se=ne.split("@"),ye="";se.length>1&&(ye=se[0]+"@",ne=se[1]),ne=ne.replace(I,".");var me=ne.split("."),nt=X(me,Q).join(".");return ye+nt}function Y(ne){for(var Q=[],se=0,ye=ne.length;se<ye;){var me=ne.charCodeAt(se++);if(me>=55296&&me<=56319&&se<ye){var nt=ne.charCodeAt(se++);(nt&64512)==56320?Q.push(((me&1023)<<10)+(nt&1023)+65536):(Q.push(me),se--)}else Q.push(me)}return Q}var H=function(Q){return String.fromCodePoint.apply(String,v(Q))},te=function(Q){return Q-48<10?Q-22:Q-65<26?Q-65:Q-97<26?Q-97:x},P=function(Q,se){return Q+22+75*(Q<26)-((se!=0)<<5)},re=function(Q,se,ye){var me=0;for(Q=ye?z(Q/T):Q>>1,Q+=z(Q/se);Q>L*S>>1;me+=x)Q=z(Q/L);return z(me+(L+1)*Q/(Q+k))},ue=function(Q){var se=[],ye=Q.length,me=0,nt=j,tt=R,Mt=Q.lastIndexOf(A);Mt<0&&(Mt=0);for(var sn=0;sn<Mt;++sn)Q.charCodeAt(sn)>=128&&W("not-basic"),se.push(Q.charCodeAt(sn));for(var hn=Mt>0?Mt+1:0;hn<ye;){for(var at=me,ln=1,jn=x;;jn+=x){hn>=ye&&W("invalid-input");var lt=te(Q.charCodeAt(hn++));(lt>=x||lt>z((b-me)/ln))&&W("overflow"),me+=lt*ln;var an=jn<=tt?E:jn>=tt+S?S:jn-tt;if(lt<an)break;var Hn=x-an;ln>z(b/Hn)&&W("overflow"),ln*=Hn}var yn=se.length+1;tt=re(me-at,yn,at==0),z(me/yn)>b-nt&&W("overflow"),nt+=z(me/yn),me%=yn,se.splice(me++,0,nt)}return String.fromCodePoint.apply(String,se)},D=function(Q){var se=[];Q=Y(Q);var ye=Q.length,me=j,nt=0,tt=R,Mt=!0,sn=!1,hn=void 0;try{for(var at=Q[Symbol.iterator](),ln;!(Mt=(ln=at.next()).done);Mt=!0){var jn=ln.value;jn<128&&se.push(G(jn))}}catch(ha){sn=!0,hn=ha}finally{try{!Mt&&at.return&&at.return()}finally{if(sn)throw hn}}var lt=se.length,an=lt;for(lt&&se.push(A);an<ye;){var Hn=b,yn=!0,zi=!1,oi=void 0;try{for(var as=Q[Symbol.iterator](),Fi;!(yn=(Fi=as.next()).done);yn=!0){var zr=Fi.value;zr>=me&&zr<Hn&&(Hn=zr)}}catch(ha){zi=!0,oi=ha}finally{try{!yn&&as.return&&as.return()}finally{if(zi)throw oi}}var Qr=an+1;Hn-me>z((b-nt)/Qr)&&W("overflow"),nt+=(Hn-me)*Qr,me=Hn;var zs=!0,bs=!1,Fs=void 0;try{for(var Qa=Q[Symbol.iterator](),Fg;!(zs=(Fg=Qa.next()).done);zs=!0){var mh=Fg.value;if(mh<me&&++nt>b&&W("overflow"),mh==me){for(var Fr=nt,mc=x;;mc+=x){var Lu=mc<=tt?E:mc>=tt+S?S:mc-tt;if(Fr<Lu)break;var gc=Fr-Lu,gh=x-Lu;se.push(G(P(Lu+gc%gh,0))),Fr=z(gc/gh)}se.push(G(P(Fr,0))),tt=re(nt,Qr,an==lt),nt=0,++an}}}catch(ha){bs=!0,Fs=ha}finally{try{!zs&&Qa.return&&Qa.return()}finally{if(bs)throw Fs}}++nt,++me}return se.join("")},Z=function(Q){return F(Q,function(se){return N.test(se)?ue(se.slice(4).toLowerCase()):se})},he=function(Q){return F(Q,function(se){return M.test(se)?"xn--"+D(se):se})},V={version:"2.1.0",ucs2:{decode:Y,encode:H},decode:ue,encode:D,toASCII:he,toUnicode:Z},U={};function K(ne){var Q=ne.charCodeAt(0),se=void 0;return Q<16?se="%0"+Q.toString(16).toUpperCase():Q<128?se="%"+Q.toString(16).toUpperCase():Q<2048?se="%"+(Q>>6|192).toString(16).toUpperCase()+"%"+(Q&63|128).toString(16).toUpperCase():se="%"+(Q>>12|224).toString(16).toUpperCase()+"%"+(Q>>6&63|128).toString(16).toUpperCase()+"%"+(Q&63|128).toString(16).toUpperCase(),se}function ae(ne){for(var Q="",se=0,ye=ne.length;se<ye;){var me=parseInt(ne.substr(se+1,2),16);if(me<128)Q+=String.fromCharCode(me),se+=3;else if(me>=194&&me<224){if(ye-se>=6){var nt=parseInt(ne.substr(se+4,2),16);Q+=String.fromCharCode((me&31)<<6|nt&63)}else Q+=ne.substr(se,6);se+=6}else if(me>=224){if(ye-se>=9){var tt=parseInt(ne.substr(se+4,2),16),Mt=parseInt(ne.substr(se+7,2),16);Q+=String.fromCharCode((me&15)<<12|(tt&63)<<6|Mt&63)}else Q+=ne.substr(se,9);se+=9}else Q+=ne.substr(se,3),se+=3}return Q}function B(ne,Q){function se(ye){var me=ae(ye);return me.match(Q.UNRESERVED)?me:ye}return ne.scheme&&(ne.scheme=String(ne.scheme).replace(Q.PCT_ENCODED,se).toLowerCase().replace(Q.NOT_SCHEME,"")),ne.userinfo!==void 0&&(ne.userinfo=String(ne.userinfo).replace(Q.PCT_ENCODED,se).replace(Q.NOT_USERINFO,K).replace(Q.PCT_ENCODED,a)),ne.host!==void 0&&(ne.host=String(ne.host).replace(Q.PCT_ENCODED,se).toLowerCase().replace(Q.NOT_HOST,K).replace(Q.PCT_ENCODED,a)),ne.path!==void 0&&(ne.path=String(ne.path).replace(Q.PCT_ENCODED,se).replace(ne.scheme?Q.NOT_PATH:Q.NOT_PATH_NOSCHEME,K).replace(Q.PCT_ENCODED,a)),ne.query!==void 0&&(ne.query=String(ne.query).replace(Q.PCT_ENCODED,se).replace(Q.NOT_QUERY,K).replace(Q.PCT_ENCODED,a)),ne.fragment!==void 0&&(ne.fragment=String(ne.fragment).replace(Q.PCT_ENCODED,se).replace(Q.NOT_FRAGMENT,K).replace(Q.PCT_ENCODED,a)),ne}function J(ne){return ne.replace(/^0*(.*)/,"$1")||"0"}function oe(ne,Q){var se=ne.match(Q.IPV4ADDRESS)||[],ye=g(se,2),me=ye[1];return me?me.split(".").map(J).join("."):ne}function fe(ne,Q){var se=ne.match(Q.IPV6ADDRESS)||[],ye=g(se,3),me=ye[1],nt=ye[2];if(me){for(var tt=me.toLowerCase().split("::").reverse(),Mt=g(tt,2),sn=Mt[0],hn=Mt[1],at=hn?hn.split(":").map(J):[],ln=sn.split(":").map(J),jn=Q.IPV4ADDRESS.test(ln[ln.length-1]),lt=jn?7:8,an=ln.length-lt,Hn=Array(lt),yn=0;yn<lt;++yn)Hn[yn]=at[yn]||ln[an+yn]||"";jn&&(Hn[lt-1]=oe(Hn[lt-1],Q));var zi=Hn.reduce(function(Qr,zs,bs){if(!zs||zs==="0"){var Fs=Qr[Qr.length-1];Fs&&Fs.index+Fs.length===bs?Fs.length++:Qr.push({index:bs,length:1})}return Qr},[]),oi=zi.sort(function(Qr,zs){return zs.length-Qr.length})[0],as=void 0;if(oi&&oi.length>1){var Fi=Hn.slice(0,oi.index),zr=Hn.slice(oi.index+oi.length);as=Fi.join(":")+"::"+zr.join(":")}else as=Hn.join(":");return nt&&(as+="%"+nt),as}else return ne}var be=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,Ae="".match(/(){0}/)[1]===void 0;function Oe(ne){var Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},se={},ye=Q.iri!==!1?h:p;Q.reference==="suffix"&&(ne=(Q.scheme?Q.scheme+":":"")+"//"+ne);var me=ne.match(be);if(me){Ae?(se.scheme=me[1],se.userinfo=me[3],se.host=me[4],se.port=parseInt(me[5],10),se.path=me[6]||"",se.query=me[7],se.fragment=me[8],isNaN(se.port)&&(se.port=me[5])):(se.scheme=me[1]||void 0,se.userinfo=ne.indexOf("@")!==-1?me[3]:void 0,se.host=ne.indexOf("//")!==-1?me[4]:void 0,se.port=parseInt(me[5],10),se.path=me[6]||"",se.query=ne.indexOf("?")!==-1?me[7]:void 0,se.fragment=ne.indexOf("#")!==-1?me[8]:void 0,isNaN(se.port)&&(se.port=ne.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?me[4]:void 0)),se.host&&(se.host=fe(oe(se.host,ye),ye)),se.scheme===void 0&&se.userinfo===void 0&&se.host===void 0&&se.port===void 0&&!se.path&&se.query===void 0?se.reference="same-document":se.scheme===void 0?se.reference="relative":se.fragment===void 0?se.reference="absolute":se.reference="uri",Q.reference&&Q.reference!=="suffix"&&Q.reference!==se.reference&&(se.error=se.error||"URI is not a "+Q.reference+" reference.");var nt=U[(Q.scheme||se.scheme||"").toLowerCase()];if(!Q.unicodeSupport&&(!nt||!nt.unicodeSupport)){if(se.host&&(Q.domainHost||nt&&nt.domainHost))try{se.host=V.toASCII(se.host.replace(ye.PCT_ENCODED,ae).toLowerCase())}catch(tt){se.error=se.error||"Host's domain name can not be converted to ASCII via punycode: "+tt}B(se,p)}else B(se,ye);nt&&nt.parse&&nt.parse(se,Q)}else se.error=se.error||"URI can not be parsed.";return se}function Ne(ne,Q){var se=Q.iri!==!1?h:p,ye=[];return ne.userinfo!==void 0&&(ye.push(ne.userinfo),ye.push("@")),ne.host!==void 0&&ye.push(fe(oe(String(ne.host),se),se).replace(se.IPV6ADDRESS,function(me,nt,tt){return"["+nt+(tt?"%25"+tt:"")+"]"})),(typeof ne.port=="number"||typeof ne.port=="string")&&(ye.push(":"),ye.push(String(ne.port))),ye.length?ye.join(""):void 0}var Qe=/^\.\.?\//,dt=/^\/\.(\/|$)/,Be=/^\/\.\.(\/|$)/,pt=/^\/?(?:.|\n)*?(?=\/|$)/;function De(ne){for(var Q=[];ne.length;)if(ne.match(Qe))ne=ne.replace(Qe,"");else if(ne.match(dt))ne=ne.replace(dt,"/");else if(ne.match(Be))ne=ne.replace(Be,"/"),Q.pop();else if(ne==="."||ne==="..")ne="";else{var se=ne.match(pt);if(se){var ye=se[0];ne=ne.slice(ye.length),Q.push(ye)}else throw new Error("Unexpected dot segment condition")}return Q.join("")}function et(ne){var Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},se=Q.iri?h:p,ye=[],me=U[(Q.scheme||ne.scheme||"").toLowerCase()];if(me&&me.serialize&&me.serialize(ne,Q),ne.host&&!se.IPV6ADDRESS.test(ne.host)){if(Q.domainHost||me&&me.domainHost)try{ne.host=Q.iri?V.toUnicode(ne.host):V.toASCII(ne.host.replace(se.PCT_ENCODED,ae).toLowerCase())}catch(Mt){ne.error=ne.error||"Host's domain name can not be converted to "+(Q.iri?"Unicode":"ASCII")+" via punycode: "+Mt}}B(ne,se),Q.reference!=="suffix"&&ne.scheme&&(ye.push(ne.scheme),ye.push(":"));var nt=Ne(ne,Q);if(nt!==void 0&&(Q.reference!=="suffix"&&ye.push("//"),ye.push(nt),ne.path&&ne.path.charAt(0)!=="/"&&ye.push("/")),ne.path!==void 0){var tt=ne.path;!Q.absolutePath&&(!me||!me.absolutePath)&&(tt=De(tt)),nt===void 0&&(tt=tt.replace(/^\/\//,"/%2F")),ye.push(tt)}return ne.query!==void 0&&(ye.push("?"),ye.push(ne.query)),ne.fragment!==void 0&&(ye.push("#"),ye.push(ne.fragment)),ye.join("")}function ot(ne,Q){var se=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},ye=arguments[3],me={};return ye||(ne=Oe(et(ne,se),se),Q=Oe(et(Q,se),se)),se=se||{},!se.tolerant&&Q.scheme?(me.scheme=Q.scheme,me.userinfo=Q.userinfo,me.host=Q.host,me.port=Q.port,me.path=De(Q.path||""),me.query=Q.query):(Q.userinfo!==void 0||Q.host!==void 0||Q.port!==void 0?(me.userinfo=Q.userinfo,me.host=Q.host,me.port=Q.port,me.path=De(Q.path||""),me.query=Q.query):(Q.path?(Q.path.charAt(0)==="/"?me.path=De(Q.path):((ne.userinfo!==void 0||ne.host!==void 0||ne.port!==void 0)&&!ne.path?me.path="/"+Q.path:ne.path?me.path=ne.path.slice(0,ne.path.lastIndexOf("/")+1)+Q.path:me.path=Q.path,me.path=De(me.path)),me.query=Q.query):(me.path=ne.path,Q.query!==void 0?me.query=Q.query:me.query=ne.query),me.userinfo=ne.userinfo,me.host=ne.host,me.port=ne.port),me.scheme=ne.scheme),me.fragment=Q.fragment,me}function lr(ne,Q,se){var ye=u({scheme:"null"},se);return et(ot(Oe(ne,ye),Oe(Q,ye),ye,!0),ye)}function xe(ne,Q){return typeof ne=="string"?ne=et(Oe(ne,Q),Q):i(ne)==="object"&&(ne=Oe(et(ne,Q),Q)),ne}function Te(ne,Q,se){return typeof ne=="string"?ne=et(Oe(ne,se),se):i(ne)==="object"&&(ne=et(ne,se)),typeof Q=="string"?Q=et(Oe(Q,se),se):i(Q)==="object"&&(Q=et(Q,se)),ne===Q}function st(ne,Q){return ne&&ne.toString().replace(!Q||!Q.iri?p.ESCAPE:h.ESCAPE,K)}function qe(ne,Q){return ne&&ne.toString().replace(!Q||!Q.iri?p.PCT_ENCODED:h.PCT_ENCODED,ae)}var At={scheme:"http",domainHost:!0,parse:function(Q,se){return Q.host||(Q.error=Q.error||"HTTP URIs must have a host."),Q},serialize:function(Q,se){var ye=String(Q.scheme).toLowerCase()==="https";return(Q.port===(ye?443:80)||Q.port==="")&&(Q.port=void 0),Q.path||(Q.path="/"),Q}},Jn={scheme:"https",domainHost:At.domainHost,parse:At.parse,serialize:At.serialize};function Zn(ne){return typeof ne.secure=="boolean"?ne.secure:String(ne.scheme).toLowerCase()==="wss"}var Pe={scheme:"ws",domainHost:!0,parse:function(Q,se){var ye=Q;return ye.secure=Zn(ye),ye.resourceName=(ye.path||"/")+(ye.query?"?"+ye.query:""),ye.path=void 0,ye.query=void 0,ye},serialize:function(Q,se){if((Q.port===(Zn(Q)?443:80)||Q.port==="")&&(Q.port=void 0),typeof Q.secure=="boolean"&&(Q.scheme=Q.secure?"wss":"ws",Q.secure=void 0),Q.resourceName){var ye=Q.resourceName.split("?"),me=g(ye,2),nt=me[0],tt=me[1];Q.path=nt&&nt!=="/"?nt:void 0,Q.query=tt,Q.resourceName=void 0}return Q.fragment=void 0,Q}},bt={scheme:"wss",domainHost:Pe.domainHost,parse:Pe.parse,serialize:Pe.serialize},Xt={},vt="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Qt="[0-9A-Fa-f]",cr=s(s("%[EFef]"+Qt+"%"+Qt+Qt+"%"+Qt+Qt)+"|"+s("%[89A-Fa-f]"+Qt+"%"+Qt+Qt)+"|"+s("%"+Qt+Qt)),br="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",Yo="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",pc=r(Yo,'[\\"\\\\]'),fa="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Du=new RegExp(vt,"g"),ft=new RegExp(cr,"g"),Ln=new RegExp(r("[^]",br,"[\\.]",'[\\"]',pc),"g"),$n=new RegExp(r("[^]",vt,fa),"g"),xr=$n;function $i(ne){var Q=ae(ne);return Q.match(Du)?Q:ne}var Vn={scheme:"mailto",parse:function(Q,se){var ye=Q,me=ye.to=ye.path?ye.path.split(","):[];if(ye.path=void 0,ye.query){for(var nt=!1,tt={},Mt=ye.query.split("&"),sn=0,hn=Mt.length;sn<hn;++sn){var at=Mt[sn].split("=");switch(at[0]){case"to":for(var ln=at[1].split(","),jn=0,lt=ln.length;jn<lt;++jn)me.push(ln[jn]);break;case"subject":ye.subject=qe(at[1],se);break;case"body":ye.body=qe(at[1],se);break;default:nt=!0,tt[qe(at[0],se)]=qe(at[1],se);break}}nt&&(ye.headers=tt)}ye.query=void 0;for(var an=0,Hn=me.length;an<Hn;++an){var yn=me[an].split("@");if(yn[0]=qe(yn[0]),se.unicodeSupport)yn[1]=qe(yn[1],se).toLowerCase();else try{yn[1]=V.toASCII(qe(yn[1],se).toLowerCase())}catch(zi){ye.error=ye.error||"Email address's domain name can not be converted to ASCII via punycode: "+zi}me[an]=yn.join("@")}return ye},serialize:function(Q,se){var ye=Q,me=l(Q.to);if(me){for(var nt=0,tt=me.length;nt<tt;++nt){var Mt=String(me[nt]),sn=Mt.lastIndexOf("@"),hn=Mt.slice(0,sn).replace(ft,$i).replace(ft,a).replace(Ln,K),at=Mt.slice(sn+1);try{at=se.iri?V.toUnicode(at):V.toASCII(qe(at,se).toLowerCase())}catch(an){ye.error=ye.error||"Email address's domain name can not be converted to "+(se.iri?"Unicode":"ASCII")+" via punycode: "+an}me[nt]=hn+"@"+at}ye.path=me.join(",")}var ln=Q.headers=Q.headers||{};Q.subject&&(ln.subject=Q.subject),Q.body&&(ln.body=Q.body);var jn=[];for(var lt in ln)ln[lt]!==Xt[lt]&&jn.push(lt.replace(ft,$i).replace(ft,a).replace($n,K)+"="+ln[lt].replace(ft,$i).replace(ft,a).replace(xr,K));return jn.length&&(ye.query=jn.join("&")),ye}},zn=/^([^\:]+)\:(.*)/,Rn={scheme:"urn",parse:function(Q,se){var ye=Q.path&&Q.path.match(zn),me=Q;if(ye){var nt=se.scheme||me.scheme||"urn",tt=ye[1].toLowerCase(),Mt=ye[2],sn=nt+":"+(se.nid||tt),hn=U[sn];me.nid=tt,me.nss=Mt,me.path=void 0,hn&&(me=hn.parse(me,se))}else me.error=me.error||"URN can not be parsed.";return me},serialize:function(Q,se){var ye=se.scheme||Q.scheme||"urn",me=Q.nid,nt=ye+":"+(se.nid||me),tt=U[nt];tt&&(Q=tt.serialize(Q,se));var Mt=Q,sn=Q.nss;return Mt.path=(me||se.nid)+":"+sn,Mt}},fn=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,er={scheme:"urn:uuid",parse:function(Q,se){var ye=Q;return ye.uuid=ye.nss,ye.nss=void 0,!se.tolerant&&(!ye.uuid||!ye.uuid.match(fn))&&(ye.error=ye.error||"UUID is not valid."),ye},serialize:function(Q,se){var ye=Q;return ye.nss=(Q.uuid||"").toLowerCase(),ye}};U[At.scheme]=At,U[Jn.scheme]=Jn,U[Pe.scheme]=Pe,U[bt.scheme]=bt,U[Vn.scheme]=Vn,U[Rn.scheme]=Rn,U[er.scheme]=er,n.SCHEMES=U,n.pctEncChar=K,n.pctDecChars=ae,n.parse=Oe,n.removeDotSegments=De,n.serialize=et,n.resolveComponents=ot,n.resolve=lr,n.normalize=xe,n.equal=Te,n.escapeComponent=st,n.unescapeComponent=qe,Object.defineProperty(n,"__esModule",{value:!0})})}(qp,qp.exports)),qp.exports}var lE,gL;function WN(){return gL||(gL=1,lE=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,s,i;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(s=r;s--!==0;)if(!t(e[s],n[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(i=Object.keys(e),r=i.length,r!==Object.keys(n).length)return!1;for(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[s]))return!1;for(s=r;s--!==0;){var a=i[s];if(!t(e[a],n[a]))return!1}return!0}return e!==e&&n!==n}),lE}var cE,vL;function ehe(){return vL||(vL=1,cE=function(e){for(var n=0,r=e.length,s=0,i;s<r;)n++,i=e.charCodeAt(s++),i>=55296&&i<=56319&&s<r&&(i=e.charCodeAt(s),(i&64512)==56320&&s++);return n}),cE}var uE,yL;function nh(){if(yL)return uE;yL=1,uE={copy:t,checkDataType:e,checkDataTypes:n,coerceToTypes:s,toHash:i,getProperty:u,escapeQuotes:d,equal:WN(),ucs2length:ehe(),varOccurences:p,varReplace:h,schemaHasRules:g,schemaHasRulesExcept:v,schemaUnknownRules:b,toQuotedString:x,getPathExpr:E,getPath:S,getData:R,unescapeFragment:A,unescapeJsonPointer:I,escapeFragment:N,escapeJsonPointer:M};function t(O,L){L=L||{};for(var z in O)L[z]=O[z];return L}function e(O,L,z,G){var W=G?" !== ":" === ",X=G?" || ":" && ",F=G?"!":"",Y=G?"":"!";switch(O){case"null":return L+W+"null";case"array":return F+"Array.isArray("+L+")";case"object":return"("+F+L+X+"typeof "+L+W+'"object"'+X+Y+"Array.isArray("+L+"))";case"integer":return"(typeof "+L+W+'"number"'+X+Y+"("+L+" % 1)"+X+L+W+L+(z?X+F+"isFinite("+L+")":"")+")";case"number":return"(typeof "+L+W+'"'+O+'"'+(z?X+F+"isFinite("+L+")":"")+")";default:return"typeof "+L+W+'"'+O+'"'}}function n(O,L,z){switch(O.length){case 1:return e(O[0],L,z,!0);default:var G="",W=i(O);W.array&&W.object&&(G=W.null?"(":"(!"+L+" || ",G+="typeof "+L+' !== "object")',delete W.null,delete W.array,delete W.object),W.number&&delete W.integer;for(var X in W)G+=(G?" && ":"")+e(X,L,z,!0);return G}}var r=i(["string","number","integer","boolean","null"]);function s(O,L){if(Array.isArray(L)){for(var z=[],G=0;G<L.length;G++){var W=L[G];(r[W]||O==="array"&&W==="array")&&(z[z.length]=W)}if(z.length)return z}else{if(r[L])return[L];if(O==="array"&&L==="array")return["array"]}}function i(O){for(var L={},z=0;z<O.length;z++)L[O[z]]=!0;return L}var a=/^[a-z$_][a-z$_0-9]*$/i,l=/'|\\/g;function u(O){return typeof O=="number"?"["+O+"]":a.test(O)?"."+O:"['"+d(O)+"']"}function d(O){return O.replace(l,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function p(O,L){L+="[^0-9]";var z=O.match(new RegExp(L,"g"));return z?z.length:0}function h(O,L,z){return L+="([^0-9])",z=z.replace(/\$/g,"$$$$"),O.replace(new RegExp(L,"g"),z+"$1")}function g(O,L){if(typeof O=="boolean")return!O;for(var z in O)if(L[z])return!0}function v(O,L,z){if(typeof O=="boolean")return!O&&z!="not";for(var G in O)if(G!=z&&L[G])return!0}function b(O,L){if(typeof O!="boolean"){for(var z in O)if(!L[z])return z}}function x(O){return"'"+d(O)+"'"}function E(O,L,z,G){var W=z?"'/' + "+L+(G?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):G?"'[' + "+L+" + ']'":"'[\\'' + "+L+" + '\\']'";return j(O,W)}function S(O,L,z){var G=x(z?"/"+M(L):u(L));return j(O,G)}var k=/^\/(?:[^~]|~0|~1)*$/,T=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function R(O,L,z){var G,W,X,F;if(O==="")return"rootData";if(O[0]=="/"){if(!k.test(O))throw new Error("Invalid JSON-pointer: "+O);W=O,X="rootData"}else{if(F=O.match(T),!F)throw new Error("Invalid JSON-pointer: "+O);if(G=+F[1],W=F[2],W=="#"){if(G>=L)throw new Error("Cannot access property/index "+G+" levels up, current level is "+L);return z[L-G]}if(G>L)throw new Error("Cannot access data "+G+" levels up, current level is "+L);if(X="data"+(L-G||""),!W)return X}for(var Y=X,H=W.split("/"),te=0;te<H.length;te++){var P=H[te];P&&(X+=u(I(P)),Y+=" && "+X)}return Y}function j(O,L){return O=='""'?L:(O+" + "+L).replace(/([^\\])' \+ '/g,"$1")}function A(O){return I(decodeURIComponent(O))}function N(O){return encodeURIComponent(M(O))}function M(O){return O.replace(/~/g,"~0").replace(/\//g,"~1")}function I(O){return O.replace(/~1/g,"/").replace(/~0/g,"~")}return uE}var dE,bL;function Jq(){if(bL)return dE;bL=1;var t=nh();dE=e;function e(n){t.copy(n,this)}return dE}var fE={exports:{}},xL;function the(){if(xL)return fE.exports;xL=1;var t=fE.exports=function(r,s,i){typeof s=="function"&&(i=s,s={}),i=s.cb||i;var a=typeof i=="function"?i:i.pre||function(){},l=i.post||function(){};e(s,a,l,r,"",r)};t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0},t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},t.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},t.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function e(r,s,i,a,l,u,d,p,h,g){if(a&&typeof a=="object"&&!Array.isArray(a)){s(a,l,u,d,p,h,g);for(var v in a){var b=a[v];if(Array.isArray(b)){if(v in t.arrayKeywords)for(var x=0;x<b.length;x++)e(r,s,i,b[x],l+"/"+v+"/"+x,u,l,v,a,x)}else if(v in t.propsKeywords){if(b&&typeof b=="object")for(var E in b)e(r,s,i,b[E],l+"/"+v+"/"+n(E),u,l,v,a,E)}else(v in t.keywords||r.allKeys&&!(v in t.skipKeywords))&&e(r,s,i,b,l+"/"+v,u,l,v,a)}i(a,l,u,d,p,h,g)}}function n(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}return fE.exports}var hE,_L;function YN(){if(_L)return hE;_L=1;var t=Zfe(),e=WN(),n=nh(),r=Jq(),s=the();hE=i,i.normalizeId=S,i.fullPath=b,i.url=k,i.ids=T,i.inlineRef=h,i.schema=a;function i(R,j,A){var N=this._refs[A];if(typeof N=="string")if(this._refs[N])N=this._refs[N];else return i.call(this,R,j,N);if(N=N||this._schemas[A],N instanceof r)return h(N.schema,this._opts.inlineRefs)?N.schema:N.validate||this._compile(N);var M=a.call(this,j,A),I,O,L;return M&&(I=M.schema,j=M.root,L=M.baseId),I instanceof r?O=I.validate||R.call(this,I.schema,j,void 0,L):I!==void 0&&(O=h(I,this._opts.inlineRefs)?I:R.call(this,I,j,void 0,L)),O}function a(R,j){var A=t.parse(j),N=x(A),M=b(this._getId(R.schema));if(Object.keys(R.schema).length===0||N!==M){var I=S(N),O=this._refs[I];if(typeof O=="string")return l.call(this,R,O,A);if(O instanceof r)O.validate||this._compile(O),R=O;else if(O=this._schemas[I],O instanceof r){if(O.validate||this._compile(O),I==S(j))return{schema:O,root:R,baseId:M};R=O}else return;if(!R.schema)return;M=b(this._getId(R.schema))}return d.call(this,A,M,R.schema,R)}function l(R,j,A){var N=a.call(this,R,j);if(N){var M=N.schema,I=N.baseId;R=N.root;var O=this._getId(M);return O&&(I=k(I,O)),d.call(this,A,I,M,R)}}var u=n.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function d(R,j,A,N){if(R.fragment=R.fragment||"",R.fragment.slice(0,1)=="/"){for(var M=R.fragment.split("/"),I=1;I<M.length;I++){var O=M[I];if(O){if(O=n.unescapeFragment(O),A=A[O],A===void 0)break;var L;if(!u[O]&&(L=this._getId(A),L&&(j=k(j,L)),A.$ref)){var z=k(j,A.$ref),G=a.call(this,N,z);G&&(A=G.schema,N=G.root,j=G.baseId)}}}if(A!==void 0&&A!==N.schema)return{schema:A,root:N,baseId:j}}}var p=n.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function h(R,j){if(j===!1)return!1;if(j===void 0||j===!0)return g(R);if(j)return v(R)<=j}function g(R){var j;if(Array.isArray(R)){for(var A=0;A<R.length;A++)if(j=R[A],typeof j=="object"&&!g(j))return!1}else for(var N in R)if(N=="$ref"||(j=R[N],typeof j=="object"&&!g(j)))return!1;return!0}function v(R){var j=0,A;if(Array.isArray(R)){for(var N=0;N<R.length;N++)if(A=R[N],typeof A=="object"&&(j+=v(A)),j==1/0)return 1/0}else for(var M in R){if(M=="$ref")return 1/0;if(p[M])j++;else if(A=R[M],typeof A=="object"&&(j+=v(A)+1),j==1/0)return 1/0}return j}function b(R,j){j!==!1&&(R=S(R));var A=t.parse(R);return x(A)}function x(R){return t.serialize(R).split("#")[0]+"#"}var E=/#\/?$/;function S(R){return R?R.replace(E,""):""}function k(R,j){return j=S(j),t.resolve(R,j)}function T(R){var j=S(this._getId(R)),A={"":j},N={"":b(j,!1)},M={},I=this;return s(R,{allKeys:!0},function(O,L,z,G,W,X,F){if(L!==""){var Y=I._getId(O),H=A[G],te=N[G]+"/"+W;if(F!==void 0&&(te+="/"+(typeof F=="number"?F:n.escapeFragment(F))),typeof Y=="string"){Y=H=S(H?t.resolve(H,Y):Y);var P=I._refs[Y];if(typeof P=="string"&&(P=I._refs[P]),P&&P.schema){if(!e(O,P.schema))throw new Error('id "'+Y+'" resolves to more than one schema')}else if(Y!=S(te))if(Y[0]=="#"){if(M[Y]&&!e(O,M[Y]))throw new Error('id "'+Y+'" resolves to more than one schema');M[Y]=O}else I._refs[Y]=te}A[L]=H,N[L]=te}}),M}return hE}var pE,wL;function KN(){if(wL)return pE;wL=1;var t=YN();pE={Validation:r(e),MissingRef:r(n)};function e(s){this.message="validation failed",this.errors=s,this.ajv=this.validation=!0}n.message=function(s,i){return"can't resolve reference "+i+" from id "+s};function n(s,i,a){this.message=a||n.message(s,i),this.missingRef=t.url(s,i),this.missingSchema=t.normalizeId(t.fullPath(this.missingRef))}function r(s){return s.prototype=Object.create(Error.prototype),s.prototype.constructor=s,s}return pE}var mE,SL;function Zq(){return SL||(SL=1,mE=function(t,e){e||(e={}),typeof e=="function"&&(e={cmp:e});var n=typeof e.cycles=="boolean"?e.cycles:!1,r=e.cmp&&function(i){return function(a){return function(l,u){var d={key:l,value:a[l]},p={key:u,value:a[u]};return i(d,p)}}}(e.cmp),s=[];return function i(a){if(a&&a.toJSON&&typeof a.toJSON=="function"&&(a=a.toJSON()),a!==void 0){if(typeof a=="number")return isFinite(a)?""+a:"null";if(typeof a!="object")return JSON.stringify(a);var l,u;if(Array.isArray(a)){for(u="[",l=0;l<a.length;l++)l&&(u+=","),u+=i(a[l])||"null";return u+"]"}if(a===null)return"null";if(s.indexOf(a)!==-1){if(n)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var d=s.push(a)-1,p=Object.keys(a).sort(r&&r(a));for(u="",l=0;l<p.length;l++){var h=p[l],g=i(a[h]);g&&(u&&(u+=","),u+=JSON.stringify(h)+":"+g)}return s.splice(d,1),"{"+u+"}"}}(t)}),mE}var gE,EL;function eV(){return EL||(EL=1,gE=function(e,n,r){var s="",i=e.schema.$async===!0,a=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),l=e.self._getId(e.schema);if(e.opts.strictKeywords){var u=e.util.schemaUnknownRules(e.schema,e.RULES.keywords);if(u){var d="unknown keyword: "+u;if(e.opts.strictKeywords==="log")e.logger.warn(d);else throw new Error(d)}}if(e.isTop&&(s+=" var validate = ",i&&(e.async=!0,s+="async "),s+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",l&&(e.opts.sourceCode||e.opts.processCode)&&(s+=" "+("/*# sourceURL="+l+" */")+" ")),typeof e.schema=="boolean"||!(a||e.schema.$ref)){var n="false schema",p=e.level,h=e.dataLevel,g=e.schema[n],v=e.schemaPath+e.util.getProperty(n),b=e.errSchemaPath+"/"+n,j=!e.opts.allErrors,M,x="data"+(h||""),R="valid"+p;if(e.schema===!1){e.isTop?j=!0:s+=" var "+R+" = false; ";var E=E||[];E.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+(M||"false schema")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(b)+" , params: {} ",e.opts.messages!==!1&&(s+=" , message: 'boolean schema is false' "),e.opts.verbose&&(s+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+x+" "),s+=" } "):s+=" {} ";var S=s;s=E.pop(),!e.compositeRule&&j?e.async?s+=" throw new ValidationError(["+S+"]); ":s+=" validate.errors = ["+S+"]; return false; ":s+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else e.isTop?i?s+=" return data; ":s+=" validate.errors = null; return true; ":s+=" var "+R+" = true; ";return e.isTop&&(s+=" }; return validate; "),s}if(e.isTop){var k=e.isTop,p=e.level=0,h=e.dataLevel=0,x="data";if(e.rootId=e.resolve.fullPath(e.self._getId(e.root.schema)),e.baseId=e.baseId||e.rootId,delete e.isTop,e.dataPathArr=[""],e.schema.default!==void 0&&e.opts.useDefaults&&e.opts.strictDefaults){var T="default is ignored in the schema root";if(e.opts.strictDefaults==="log")e.logger.warn(T);else throw new Error(T)}s+=" var vErrors = null; ",s+=" var errors = 0; ",s+=" if (rootData === undefined) rootData = data; "}else{var p=e.level,h=e.dataLevel,x="data"+(h||"");if(l&&(e.baseId=e.resolve.url(e.baseId,l)),i&&!e.async)throw new Error("async schema in sync schema");s+=" var errs_"+p+" = errors;"}var R="valid"+p,j=!e.opts.allErrors,A="",N="",M,I=e.schema.type,O=Array.isArray(I);if(I&&e.opts.nullable&&e.schema.nullable===!0&&(O?I.indexOf("null")==-1&&(I=I.concat("null")):I!="null"&&(I=[I,"null"],O=!0)),O&&I.length==1&&(I=I[0],O=!1),e.schema.$ref&&a){if(e.opts.extendRefs=="fail")throw new Error('$ref: validation keywords used in schema at path "'+e.errSchemaPath+'" (see option extendRefs)');e.opts.extendRefs!==!0&&(a=!1,e.logger.warn('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"'))}if(e.schema.$comment&&e.opts.$comment&&(s+=" "+e.RULES.all.$comment.code(e,"$comment")),I){if(e.opts.coerceTypes)var L=e.util.coerceToTypes(e.opts.coerceTypes,I);var z=e.RULES.types[I];if(L||O||z===!0||z&&!dt(z)){var v=e.schemaPath+".type",b=e.errSchemaPath+"/type",v=e.schemaPath+".type",b=e.errSchemaPath+"/type",G=O?"checkDataTypes":"checkDataType";if(s+=" if ("+e.util[G](I,x,e.opts.strictNumbers,!0)+") { ",L){var W="dataType"+p,X="coerced"+p;s+=" var "+W+" = typeof "+x+"; var "+X+" = undefined; ",e.opts.coerceTypes=="array"&&(s+=" if ("+W+" == 'object' && Array.isArray("+x+") && "+x+".length == 1) { "+x+" = "+x+"[0]; "+W+" = typeof "+x+"; if ("+e.util.checkDataType(e.schema.type,x,e.opts.strictNumbers)+") "+X+" = "+x+"; } "),s+=" if ("+X+" !== undefined) ; ";var F=L;if(F)for(var Y,H=-1,te=F.length-1;H<te;)Y=F[H+=1],Y=="string"?s+=" else if ("+W+" == 'number' || "+W+" == 'boolean') "+X+" = '' + "+x+"; else if ("+x+" === null) "+X+" = ''; ":Y=="number"||Y=="integer"?(s+=" else if ("+W+" == 'boolean' || "+x+" === null || ("+W+" == 'string' && "+x+" && "+x+" == +"+x+" ",Y=="integer"&&(s+=" && !("+x+" % 1)"),s+=")) "+X+" = +"+x+"; "):Y=="boolean"?s+=" else if ("+x+" === 'false' || "+x+" === 0 || "+x+" === null) "+X+" = false; else if ("+x+" === 'true' || "+x+" === 1) "+X+" = true; ":Y=="null"?s+=" else if ("+x+" === '' || "+x+" === 0 || "+x+" === false) "+X+" = null; ":e.opts.coerceTypes=="array"&&Y=="array"&&(s+=" else if ("+W+" == 'string' || "+W+" == 'number' || "+W+" == 'boolean' || "+x+" == null) "+X+" = ["+x+"]; ");s+=" else { ";var E=E||[];E.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+(M||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(b)+" , params: { type: '",O?s+=""+I.join(","):s+=""+I,s+="' } ",e.opts.messages!==!1&&(s+=" , message: 'should be ",O?s+=""+I.join(","):s+=""+I,s+="' "),e.opts.verbose&&(s+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+x+" "),s+=" } "):s+=" {} ";var S=s;s=E.pop(),!e.compositeRule&&j?e.async?s+=" throw new ValidationError(["+S+"]); ":s+=" validate.errors = ["+S+"]; return false; ":s+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } if ("+X+" !== undefined) { ";var P=h?"data"+(h-1||""):"parentData",re=h?e.dataPathArr[h]:"parentDataProperty";s+=" "+x+" = "+X+"; ",h||(s+="if ("+P+" !== undefined)"),s+=" "+P+"["+re+"] = "+X+"; } "}else{var E=E||[];E.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+(M||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(b)+" , params: { type: '",O?s+=""+I.join(","):s+=""+I,s+="' } ",e.opts.messages!==!1&&(s+=" , message: 'should be ",O?s+=""+I.join(","):s+=""+I,s+="' "),e.opts.verbose&&(s+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+x+" "),s+=" } "):s+=" {} ";var S=s;s=E.pop(),!e.compositeRule&&j?e.async?s+=" throw new ValidationError(["+S+"]); ":s+=" validate.errors = ["+S+"]; return false; ":s+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}s+=" } "}}if(e.schema.$ref&&!a)s+=" "+e.RULES.all.$ref.code(e,"$ref")+" ",j&&(s+=" } if (errors === ",k?s+="0":s+="errs_"+p,s+=") { ",N+="}");else{var ue=e.RULES;if(ue){for(var z,D=-1,Z=ue.length-1;D<Z;)if(z=ue[D+=1],dt(z)){if(z.type&&(s+=" if ("+e.util.checkDataType(z.type,x,e.opts.strictNumbers)+") { "),e.opts.useDefaults){if(z.type=="object"&&e.schema.properties){var g=e.schema.properties,he=Object.keys(g),V=he;if(V)for(var U,K=-1,ae=V.length-1;K<ae;){U=V[K+=1];var B=g[U];if(B.default!==void 0){var J=x+e.util.getProperty(U);if(e.compositeRule){if(e.opts.strictDefaults){var T="default is ignored for: "+J;if(e.opts.strictDefaults==="log")e.logger.warn(T);else throw new Error(T)}}else s+=" if ("+J+" === undefined ",e.opts.useDefaults=="empty"&&(s+=" || "+J+" === null || "+J+" === '' "),s+=" ) "+J+" = ",e.opts.useDefaults=="shared"?s+=" "+e.useDefault(B.default)+" ":s+=" "+JSON.stringify(B.default)+" ",s+="; "}}}else if(z.type=="array"&&Array.isArray(e.schema.items)){var oe=e.schema.items;if(oe){for(var B,H=-1,fe=oe.length-1;H<fe;)if(B=oe[H+=1],B.default!==void 0){var J=x+"["+H+"]";if(e.compositeRule){if(e.opts.strictDefaults){var T="default is ignored for: "+J;if(e.opts.strictDefaults==="log")e.logger.warn(T);else throw new Error(T)}}else s+=" if ("+J+" === undefined ",e.opts.useDefaults=="empty"&&(s+=" || "+J+" === null || "+J+" === '' "),s+=" ) "+J+" = ",e.opts.useDefaults=="shared"?s+=" "+e.useDefault(B.default)+" ":s+=" "+JSON.stringify(B.default)+" ",s+="; "}}}}var be=z.rules;if(be){for(var Ae,Oe=-1,Ne=be.length-1;Oe<Ne;)if(Ae=be[Oe+=1],Be(Ae)){var Qe=Ae.code(e,Ae.keyword,z.type);Qe&&(s+=" "+Qe+" ",j&&(A+="}"))}}if(j&&(s+=" "+A+" ",A=""),z.type&&(s+=" } ",I&&I===z.type&&!L)){s+=" else { ";var v=e.schemaPath+".type",b=e.errSchemaPath+"/type",E=E||[];E.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+(M||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(b)+" , params: { type: '",O?s+=""+I.join(","):s+=""+I,s+="' } ",e.opts.messages!==!1&&(s+=" , message: 'should be ",O?s+=""+I.join(","):s+=""+I,s+="' "),e.opts.verbose&&(s+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+x+" "),s+=" } "):s+=" {} ";var S=s;s=E.pop(),!e.compositeRule&&j?e.async?s+=" throw new ValidationError(["+S+"]); ":s+=" validate.errors = ["+S+"]; return false; ":s+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } "}j&&(s+=" if (errors === ",k?s+="0":s+="errs_"+p,s+=") { ",N+="}")}}}j&&(s+=" "+N+" "),k?(i?(s+=" if (errors === 0) return data; ",s+=" else throw new ValidationError(vErrors); "):(s+=" validate.errors = vErrors; ",s+=" return errors === 0; "),s+=" }; return validate;"):s+=" var "+R+" = errors === errs_"+p+";";function dt(De){for(var et=De.rules,ot=0;ot<et.length;ot++)if(Be(et[ot]))return!0}function Be(De){return e.schema[De.keyword]!==void 0||De.implements&&pt(De)}function pt(De){for(var et=De.implements,ot=0;ot<et.length;ot++)if(e.schema[et[ot]]!==void 0)return!0}return s}),gE}var vE,kL;function nhe(){if(kL)return vE;kL=1;var t=YN(),e=nh(),n=KN(),r=Zq(),s=eV(),i=e.ucs2length,a=WN(),l=n.Validation;vE=u;function u(S,k,T,R){var j=this,A=this._opts,N=[void 0],M={},I=[],O={},L=[],z={},G=[];k=k||{schema:S,refVal:N,refs:M};var W=d.call(this,S,k,R),X=this._compilations[W.index];if(W.compiling)return X.callValidate=P;var F=this._formats,Y=this.RULES;try{var H=re(S,k,T,R);X.validate=H;var te=X.callValidate;return te&&(te.schema=H.schema,te.errors=null,te.refs=H.refs,te.refVal=H.refVal,te.root=H.root,te.$async=H.$async,A.sourceCode&&(te.source=H.source)),H}finally{p.call(this,S,k,R)}function P(){var B=X.validate,J=B.apply(this,arguments);return P.errors=B.errors,J}function re(B,J,oe,fe){var be=!J||J&&J.schema==B;if(J.schema!=k.schema)return u.call(j,B,J,oe,fe);var Ae=B.$async===!0,Oe=s({isTop:!0,schema:B,isRoot:be,baseId:fe,root:J,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:n.MissingRef,RULES:Y,validate:s,util:e,resolve:t,resolveRef:ue,usePattern:U,useDefault:K,useCustomRule:ae,opts:A,formats:F,logger:j.logger,self:j});Oe=E(N,b)+E(I,g)+E(L,v)+E(G,x)+Oe,A.processCode&&(Oe=A.processCode(Oe,B));var Ne;try{var Qe=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",Oe);Ne=Qe(j,Y,F,k,N,L,G,a,i,l),N[0]=Ne}catch(dt){throw j.logger.error("Error compiling schema, function code:",Oe),dt}return Ne.schema=B,Ne.errors=null,Ne.refs=M,Ne.refVal=N,Ne.root=be?Ne:J,Ae&&(Ne.$async=!0),A.sourceCode===!0&&(Ne.source={code:Oe,patterns:I,defaults:L}),Ne}function ue(B,J,oe){J=t.url(B,J);var fe=M[J],be,Ae;if(fe!==void 0)return be=N[fe],Ae="refVal["+fe+"]",V(be,Ae);if(!oe&&k.refs){var Oe=k.refs[J];if(Oe!==void 0)return be=k.refVal[Oe],Ae=D(J,be),V(be,Ae)}Ae=D(J);var Ne=t.call(j,re,k,J);if(Ne===void 0){var Qe=T&&T[J];Qe&&(Ne=t.inlineRef(Qe,A.inlineRefs)?Qe:u.call(j,Qe,k,T,B))}if(Ne===void 0)Z(J);else return he(J,Ne),V(Ne,Ae)}function D(B,J){var oe=N.length;return N[oe]=J,M[B]=oe,"refVal"+oe}function Z(B){delete M[B]}function he(B,J){var oe=M[B];N[oe]=J}function V(B,J){return typeof B=="object"||typeof B=="boolean"?{code:J,schema:B,inline:!0}:{code:J,$async:B&&!!B.$async}}function U(B){var J=O[B];return J===void 0&&(J=O[B]=I.length,I[J]=B),"pattern"+J}function K(B){switch(typeof B){case"boolean":case"number":return""+B;case"string":return e.toQuotedString(B);case"object":if(B===null)return"null";var J=r(B),oe=z[J];return oe===void 0&&(oe=z[J]=L.length,L[oe]=B),"default"+oe}}function ae(B,J,oe,fe){if(j._opts.validateSchema!==!1){var be=B.definition.dependencies;if(be&&!be.every(function(et){return Object.prototype.hasOwnProperty.call(oe,et)}))throw new Error("parent schema must have all required keywords: "+be.join(","));var Ae=B.definition.validateSchema;if(Ae){var Oe=Ae(J);if(!Oe){var Ne="keyword schema is invalid: "+j.errorsText(Ae.errors);if(j._opts.validateSchema=="log")j.logger.error(Ne);else throw new Error(Ne)}}}var Qe=B.definition.compile,dt=B.definition.inline,Be=B.definition.macro,pt;if(Qe)pt=Qe.call(j,J,oe,fe);else if(Be)pt=Be.call(j,J,oe,fe),A.validateSchema!==!1&&j.validateSchema(pt,!0);else if(dt)pt=dt.call(j,fe,B.keyword,J,oe);else if(pt=B.definition.validate,!pt)return;if(pt===void 0)throw new Error('custom keyword "'+B.keyword+'"failed to compile');var De=G.length;return G[De]=pt,{code:"customRule"+De,validate:pt}}}function d(S,k,T){var R=h.call(this,S,k,T);return R>=0?{index:R,compiling:!0}:(R=this._compilations.length,this._compilations[R]={schema:S,root:k,baseId:T},{index:R,compiling:!1})}function p(S,k,T){var R=h.call(this,S,k,T);R>=0&&this._compilations.splice(R,1)}function h(S,k,T){for(var R=0;R<this._compilations.length;R++){var j=this._compilations[R];if(j.schema==S&&j.root==k&&j.baseId==T)return R}return-1}function g(S,k){return"var pattern"+S+" = new RegExp("+e.toQuotedString(k[S])+");"}function v(S){return"var default"+S+" = defaults["+S+"];"}function b(S,k){return k[S]===void 0?"":"var refVal"+S+" = refVal["+S+"];"}function x(S){return"var customRule"+S+" = customRules["+S+"];"}function E(S,k){if(!S.length)return"";for(var T="",R=0;R<S.length;R++)T+=k(R,S);return T}return vE}var yE={exports:{}},TL;function rhe(){if(TL)return yE.exports;TL=1;var t=yE.exports=function(){this._cache={}};return t.prototype.put=function(n,r){this._cache[n]=r},t.prototype.get=function(n){return this._cache[n]},t.prototype.del=function(n){delete this._cache[n]},t.prototype.clear=function(){this._cache={}},yE.exports}var bE,CL;function she(){if(CL)return bE;CL=1;var t=nh(),e=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,n=[0,31,28,31,30,31,30,31,31,30,31,30,31],r=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,s=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,i=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,a=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,l=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,u=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,d=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,p=/^(?:\/(?:[^~/]|~0|~1)*)*$/,h=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,g=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;bE=v;function v(N){return N=N=="full"?"full":"fast",t.copy(v[N])}v.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":l,url:u,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:s,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:A,uuid:d,"json-pointer":p,"json-pointer-uri-fragment":h,"relative-json-pointer":g},v.full={date:x,time:E,"date-time":k,uri:R,"uri-reference":a,"uri-template":l,url:u,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:s,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:A,uuid:d,"json-pointer":p,"json-pointer-uri-fragment":h,"relative-json-pointer":g};function b(N){return N%4===0&&(N%100!==0||N%400===0)}function x(N){var M=N.match(e);if(!M)return!1;var I=+M[1],O=+M[2],L=+M[3];return O>=1&&O<=12&&L>=1&&L<=(O==2&&b(I)?29:n[O])}function E(N,M){var I=N.match(r);if(!I)return!1;var O=I[1],L=I[2],z=I[3],G=I[5];return(O<=23&&L<=59&&z<=59||O==23&&L==59&&z==60)&&(!M||G)}var S=/t|\s/i;function k(N){var M=N.split(S);return M.length==2&&x(M[0])&&E(M[1],!0)}var T=/\/|:/;function R(N){return T.test(N)&&i.test(N)}var j=/[^\\]\\Z/;function A(N){if(j.test(N))return!1;try{return new RegExp(N),!0}catch{return!1}}return bE}var xE,AL;function ihe(){return AL||(AL=1,xE=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.errSchemaPath+"/"+n,d=!e.opts.allErrors,p="data"+(a||""),h="valid"+i,g,v;if(l=="#"||l=="#/")e.isRoot?(g=e.async,v="validate"):(g=e.root.schema.$async===!0,v="root.refVal[0]");else{var b=e.resolveRef(e.baseId,l,e.isRoot);if(b===void 0){var x=e.MissingRefError.message(e.baseId,l);if(e.opts.missingRefs=="fail"){e.logger.error(x);var E=E||[];E.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { ref: '"+e.util.escapeQuotes(l)+"' } ",e.opts.messages!==!1&&(s+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(l)+"' "),e.opts.verbose&&(s+=" , schema: "+e.util.toQuotedString(l)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ";var S=s;s=E.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+S+"]); ":s+=" validate.errors = ["+S+"]; return false; ":s+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",d&&(s+=" if (false) { ")}else if(e.opts.missingRefs=="ignore")e.logger.warn(x),d&&(s+=" if (true) { ");else throw new e.MissingRefError(e.baseId,l,x)}else if(b.inline){var k=e.util.copy(e);k.level++;var T="valid"+k.level;k.schema=b.schema,k.schemaPath="",k.errSchemaPath=l;var R=e.validate(k).replace(/validate\.schema/g,b.code);s+=" "+R+" ",d&&(s+=" if ("+T+") { ")}else g=b.$async===!0||e.async&&b.$async!==!1,v=b.code}if(v){var E=E||[];E.push(s),s="",e.opts.passContext?s+=" "+v+".call(this, ":s+=" "+v+"( ",s+=" "+p+", (dataPath || '')",e.errorPath!='""'&&(s+=" + "+e.errorPath);var j=a?"data"+(a-1||""):"parentData",A=a?e.dataPathArr[a]:"parentDataProperty";s+=" , "+j+" , "+A+", rootData) ";var N=s;if(s=E.pop(),g){if(!e.async)throw new Error("async schema referenced by sync schema");d&&(s+=" var "+h+"; "),s+=" try { await "+N+"; ",d&&(s+=" "+h+" = true; "),s+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",d&&(s+=" "+h+" = false; "),s+=" } ",d&&(s+=" if ("+h+") { ")}else s+=" if (!"+N+") { if (vErrors === null) vErrors = "+v+".errors; else vErrors = vErrors.concat("+v+".errors); errors = vErrors.length; } ",d&&(s+=" else { ")}return s}),xE}var _E,NL;function ahe(){return NL||(NL=1,_E=function(e,n,r){var s=" ",i=e.schema[n],a=e.schemaPath+e.util.getProperty(n),l=e.errSchemaPath+"/"+n,u=!e.opts.allErrors,d=e.util.copy(e),p="";d.level++;var h="valid"+d.level,g=d.baseId,v=!0,b=i;if(b)for(var x,E=-1,S=b.length-1;E<S;)x=b[E+=1],(e.opts.strictKeywords?typeof x=="object"&&Object.keys(x).length>0||x===!1:e.util.schemaHasRules(x,e.RULES.all))&&(v=!1,d.schema=x,d.schemaPath=a+"["+E+"]",d.errSchemaPath=l+"/"+E,s+=" "+e.validate(d)+" ",d.baseId=g,u&&(s+=" if ("+h+") { ",p+="}"));return u&&(v?s+=" if (true) { ":s+=" "+p.slice(0,-1)+" "),s}),_E}var wE,RL;function ohe(){return RL||(RL=1,wE=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,h="data"+(a||""),g="valid"+i,v="errs__"+i,b=e.util.copy(e),x="";b.level++;var E="valid"+b.level,S=l.every(function(M){return e.opts.strictKeywords?typeof M=="object"&&Object.keys(M).length>0||M===!1:e.util.schemaHasRules(M,e.RULES.all)});if(S){var k=b.baseId;s+=" var "+v+" = errors; var "+g+" = false; ";var T=e.compositeRule;e.compositeRule=b.compositeRule=!0;var R=l;if(R)for(var j,A=-1,N=R.length-1;A<N;)j=R[A+=1],b.schema=j,b.schemaPath=u+"["+A+"]",b.errSchemaPath=d+"/"+A,s+=" "+e.validate(b)+" ",b.baseId=k,s+=" "+g+" = "+g+" || "+E+"; if (!"+g+") { ",x+="}";e.compositeRule=b.compositeRule=T,s+=" "+x+" if (!"+g+") { var err = ",e.createErrors!==!1?(s+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: {} ",e.opts.messages!==!1&&(s+=" , message: 'should match some schema in anyOf' "),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ",s+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&p&&(e.async?s+=" throw new ValidationError(vErrors); ":s+=" validate.errors = vErrors; return false; "),s+=" } else { errors = "+v+"; if (vErrors !== null) { if ("+v+") vErrors.length = "+v+"; else vErrors = null; } ",e.opts.allErrors&&(s+=" } ")}else p&&(s+=" if (true) { ");return s}),wE}var SE,jL;function lhe(){return jL||(jL=1,SE=function(e,n,r){var s=" ",i=e.schema[n],a=e.errSchemaPath+"/"+n;e.opts.allErrors;var l=e.util.toQuotedString(i);return e.opts.$comment===!0?s+=" console.log("+l+");":typeof e.opts.$comment=="function"&&(s+=" self._opts.$comment("+l+", "+e.util.toQuotedString(a)+", validate.root.schema);"),s}),SE}var EE,ML;function che(){return ML||(ML=1,EE=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,h="data"+(a||""),g="valid"+i,v=e.opts.$data&&l&&l.$data;v&&(s+=" var schema"+i+" = "+e.util.getData(l.$data,a,e.dataPathArr)+"; "),v||(s+=" var schema"+i+" = validate.schema"+u+";"),s+="var "+g+" = equal("+h+", schema"+i+"); if (!"+g+") { ";var b=b||[];b.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'const' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { allowedValue: schema"+i+" } ",e.opts.messages!==!1&&(s+=" , message: 'should be equal to constant' "),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var x=s;return s=b.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+x+"]); ":s+=" validate.errors = ["+x+"]; return false; ":s+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" }",p&&(s+=" else { "),s}),EE}var kE,OL;function uhe(){return OL||(OL=1,kE=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,h="data"+(a||""),g="valid"+i,v="errs__"+i,b=e.util.copy(e),x="";b.level++;var E="valid"+b.level,S="i"+i,k=b.dataLevel=e.dataLevel+1,T="data"+k,R=e.baseId,j=e.opts.strictKeywords?typeof l=="object"&&Object.keys(l).length>0||l===!1:e.util.schemaHasRules(l,e.RULES.all);if(s+="var "+v+" = errors;var "+g+";",j){var A=e.compositeRule;e.compositeRule=b.compositeRule=!0,b.schema=l,b.schemaPath=u,b.errSchemaPath=d,s+=" var "+E+" = false; for (var "+S+" = 0; "+S+" < "+h+".length; "+S+"++) { ",b.errorPath=e.util.getPathExpr(e.errorPath,S,e.opts.jsonPointers,!0);var N=h+"["+S+"]";b.dataPathArr[k]=S;var M=e.validate(b);b.baseId=R,e.util.varOccurences(M,T)<2?s+=" "+e.util.varReplace(M,T,N)+" ":s+=" var "+T+" = "+N+"; "+M+" ",s+=" if ("+E+") break; } ",e.compositeRule=b.compositeRule=A,s+=" "+x+" if (!"+E+") {"}else s+=" if ("+h+".length == 0) {";var I=I||[];I.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: {} ",e.opts.messages!==!1&&(s+=" , message: 'should contain a valid item' "),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var O=s;return s=I.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+O+"]); ":s+=" validate.errors = ["+O+"]; return false; ":s+=" var err = "+O+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } else { ",j&&(s+=" errors = "+v+"; if (vErrors !== null) { if ("+v+") vErrors.length = "+v+"; else vErrors = null; } "),e.opts.allErrors&&(s+=" } "),s}),kE}var TE,PL;function dhe(){return PL||(PL=1,TE=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,h="data"+(a||""),g="errs__"+i,v=e.util.copy(e),b="";v.level++;var x="valid"+v.level,E={},S={},k=e.opts.ownProperties;for(A in l)if(A!="__proto__"){var T=l[A],R=Array.isArray(T)?S:E;R[A]=T}s+="var "+g+" = errors;";var j=e.errorPath;s+="var missing"+i+";";for(var A in S)if(R=S[A],R.length){if(s+=" if ( "+h+e.util.getProperty(A)+" !== undefined ",k&&(s+=" && Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(A)+"') "),p){s+=" && ( ";var N=R;if(N)for(var M,I=-1,O=N.length-1;I<O;){M=N[I+=1],I&&(s+=" || ");var L=e.util.getProperty(M),z=h+L;s+=" ( ( "+z+" === undefined ",k&&(s+=" || ! Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(M)+"') "),s+=") && (missing"+i+" = "+e.util.toQuotedString(e.opts.jsonPointers?M:L)+") ) "}s+=")) { ";var G="missing"+i,W="' + "+G+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(j,G,!0):j+" + "+G);var X=X||[];X.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { property: '"+e.util.escapeQuotes(A)+"', missingProperty: '"+W+"', depsCount: "+R.length+", deps: '"+e.util.escapeQuotes(R.length==1?R[0]:R.join(", "))+"' } ",e.opts.messages!==!1&&(s+=" , message: 'should have ",R.length==1?s+="property "+e.util.escapeQuotes(R[0]):s+="properties "+e.util.escapeQuotes(R.join(", ")),s+=" when property "+e.util.escapeQuotes(A)+" is present' "),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var F=s;s=X.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+F+"]); ":s+=" validate.errors = ["+F+"]; return false; ":s+=" var err = "+F+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{s+=" ) { ";var Y=R;if(Y)for(var M,H=-1,te=Y.length-1;H<te;){M=Y[H+=1];var L=e.util.getProperty(M),W=e.util.escapeQuotes(M),z=h+L;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(j,M,e.opts.jsonPointers)),s+=" if ( "+z+" === undefined ",k&&(s+=" || ! Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(M)+"') "),s+=") { var err = ",e.createErrors!==!1?(s+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { property: '"+e.util.escapeQuotes(A)+"', missingProperty: '"+W+"', depsCount: "+R.length+", deps: '"+e.util.escapeQuotes(R.length==1?R[0]:R.join(", "))+"' } ",e.opts.messages!==!1&&(s+=" , message: 'should have ",R.length==1?s+="property "+e.util.escapeQuotes(R[0]):s+="properties "+e.util.escapeQuotes(R.join(", ")),s+=" when property "+e.util.escapeQuotes(A)+" is present' "),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ",s+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}s+=" } ",p&&(b+="}",s+=" else { ")}e.errorPath=j;var P=v.baseId;for(var A in E){var T=E[A];(e.opts.strictKeywords?typeof T=="object"&&Object.keys(T).length>0||T===!1:e.util.schemaHasRules(T,e.RULES.all))&&(s+=" "+x+" = true; if ( "+h+e.util.getProperty(A)+" !== undefined ",k&&(s+=" && Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(A)+"') "),s+=") { ",v.schema=T,v.schemaPath=u+e.util.getProperty(A),v.errSchemaPath=d+"/"+e.util.escapeFragment(A),s+=" "+e.validate(v)+" ",v.baseId=P,s+=" } ",p&&(s+=" if ("+x+") { ",b+="}"))}return p&&(s+=" "+b+" if ("+g+" == errors) {"),s}),TE}var CE,IL;function fhe(){return IL||(IL=1,CE=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,h="data"+(a||""),g="valid"+i,v=e.opts.$data&&l&&l.$data;v&&(s+=" var schema"+i+" = "+e.util.getData(l.$data,a,e.dataPathArr)+"; ");var b="i"+i,x="schema"+i;v||(s+=" var "+x+" = validate.schema"+u+";"),s+="var "+g+";",v&&(s+=" if (schema"+i+" === undefined) "+g+" = true; else if (!Array.isArray(schema"+i+")) "+g+" = false; else {"),s+=""+g+" = false;for (var "+b+"=0; "+b+"<"+x+".length; "+b+"++) if (equal("+h+", "+x+"["+b+"])) { "+g+" = true; break; }",v&&(s+=" } "),s+=" if (!"+g+") { ";var E=E||[];E.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { allowedValues: schema"+i+" } ",e.opts.messages!==!1&&(s+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var S=s;return s=E.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+S+"]); ":s+=" validate.errors = ["+S+"]; return false; ":s+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" }",p&&(s+=" else { "),s}),CE}var AE,DL;function hhe(){return DL||(DL=1,AE=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,h="data"+(a||"");if(e.opts.format===!1)return p&&(s+=" if (true) { "),s;var g=e.opts.$data&&l&&l.$data,v;g?(s+=" var schema"+i+" = "+e.util.getData(l.$data,a,e.dataPathArr)+"; ",v="schema"+i):v=l;var b=e.opts.unknownFormats,x=Array.isArray(b);if(g){var E="format"+i,S="isObject"+i,k="formatType"+i;s+=" var "+E+" = formats["+v+"]; var "+S+" = typeof "+E+" == 'object' && !("+E+" instanceof RegExp) && "+E+".validate; var "+k+" = "+S+" && "+E+".type || 'string'; if ("+S+") { ",e.async&&(s+=" var async"+i+" = "+E+".async; "),s+=" "+E+" = "+E+".validate; } if ( ",g&&(s+=" ("+v+" !== undefined && typeof "+v+" != 'string') || "),s+=" (",b!="ignore"&&(s+=" ("+v+" && !"+E+" ",x&&(s+=" && self._opts.unknownFormats.indexOf("+v+") == -1 "),s+=") || "),s+=" ("+E+" && "+k+" == '"+r+"' && !(typeof "+E+" == 'function' ? ",e.async?s+=" (async"+i+" ? await "+E+"("+h+") : "+E+"("+h+")) ":s+=" "+E+"("+h+") ",s+=" : "+E+".test("+h+"))))) {"}else{var E=e.formats[l];if(!E){if(b=="ignore")return e.logger.warn('unknown format "'+l+'" ignored in schema at path "'+e.errSchemaPath+'"'),p&&(s+=" if (true) { "),s;if(x&&b.indexOf(l)>=0)return p&&(s+=" if (true) { "),s;throw new Error('unknown format "'+l+'" is used in schema at path "'+e.errSchemaPath+'"')}var S=typeof E=="object"&&!(E instanceof RegExp)&&E.validate,k=S&&E.type||"string";if(S){var T=E.async===!0;E=E.validate}if(k!=r)return p&&(s+=" if (true) { "),s;if(T){if(!e.async)throw new Error("async format in sync schema");var R="formats"+e.util.getProperty(l)+".validate";s+=" if (!(await "+R+"("+h+"))) { "}else{s+=" if (! ";var R="formats"+e.util.getProperty(l);S&&(R+=".validate"),typeof E=="function"?s+=" "+R+"("+h+") ":s+=" "+R+".test("+h+") ",s+=") { "}}var j=j||[];j.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { format: ",g?s+=""+v:s+=""+e.util.toQuotedString(l),s+=" } ",e.opts.messages!==!1&&(s+=` , message: 'should match format "`,g?s+="' + "+v+" + '":s+=""+e.util.escapeQuotes(l),s+=`"' `),e.opts.verbose&&(s+=" , schema: ",g?s+="validate.schema"+u:s+=""+e.util.toQuotedString(l),s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var A=s;return s=j.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+A+"]); ":s+=" validate.errors = ["+A+"]; return false; ":s+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",p&&(s+=" else { "),s}),AE}var NE,LL;function phe(){return LL||(LL=1,NE=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,h="data"+(a||""),g="valid"+i,v="errs__"+i,b=e.util.copy(e);b.level++;var x="valid"+b.level,E=e.schema.then,S=e.schema.else,k=E!==void 0&&(e.opts.strictKeywords?typeof E=="object"&&Object.keys(E).length>0||E===!1:e.util.schemaHasRules(E,e.RULES.all)),T=S!==void 0&&(e.opts.strictKeywords?typeof S=="object"&&Object.keys(S).length>0||S===!1:e.util.schemaHasRules(S,e.RULES.all)),R=b.baseId;if(k||T){var j;b.createErrors=!1,b.schema=l,b.schemaPath=u,b.errSchemaPath=d,s+=" var "+v+" = errors; var "+g+" = true; ";var A=e.compositeRule;e.compositeRule=b.compositeRule=!0,s+=" "+e.validate(b)+" ",b.baseId=R,b.createErrors=!0,s+=" errors = "+v+"; if (vErrors !== null) { if ("+v+") vErrors.length = "+v+"; else vErrors = null; } ",e.compositeRule=b.compositeRule=A,k?(s+=" if ("+x+") { ",b.schema=e.schema.then,b.schemaPath=e.schemaPath+".then",b.errSchemaPath=e.errSchemaPath+"/then",s+=" "+e.validate(b)+" ",b.baseId=R,s+=" "+g+" = "+x+"; ",k&&T?(j="ifClause"+i,s+=" var "+j+" = 'then'; "):j="'then'",s+=" } ",T&&(s+=" else { ")):s+=" if (!"+x+") { ",T&&(b.schema=e.schema.else,b.schemaPath=e.schemaPath+".else",b.errSchemaPath=e.errSchemaPath+"/else",s+=" "+e.validate(b)+" ",b.baseId=R,s+=" "+g+" = "+x+"; ",k&&T?(j="ifClause"+i,s+=" var "+j+" = 'else'; "):j="'else'",s+=" } "),s+=" if (!"+g+") { var err = ",e.createErrors!==!1?(s+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { failingKeyword: "+j+" } ",e.opts.messages!==!1&&(s+=` , message: 'should match "' + `+j+` + '" schema' `),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ",s+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&p&&(e.async?s+=" throw new ValidationError(vErrors); ":s+=" validate.errors = vErrors; return false; "),s+=" } ",p&&(s+=" else { ")}else p&&(s+=" if (true) { ");return s}),NE}var RE,$L;function mhe(){return $L||($L=1,RE=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,h="data"+(a||""),g="valid"+i,v="errs__"+i,b=e.util.copy(e),x="";b.level++;var E="valid"+b.level,S="i"+i,k=b.dataLevel=e.dataLevel+1,T="data"+k,R=e.baseId;if(s+="var "+v+" = errors;var "+g+";",Array.isArray(l)){var j=e.schema.additionalItems;if(j===!1){s+=" "+g+" = "+h+".length <= "+l.length+"; ";var A=d;d=e.errSchemaPath+"/additionalItems",s+=" if (!"+g+") { ";var N=N||[];N.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { limit: "+l.length+" } ",e.opts.messages!==!1&&(s+=" , message: 'should NOT have more than "+l.length+" items' "),e.opts.verbose&&(s+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var M=s;s=N.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+M+"]); ":s+=" validate.errors = ["+M+"]; return false; ":s+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",d=A,p&&(x+="}",s+=" else { ")}var I=l;if(I){for(var O,L=-1,z=I.length-1;L<z;)if(O=I[L+=1],e.opts.strictKeywords?typeof O=="object"&&Object.keys(O).length>0||O===!1:e.util.schemaHasRules(O,e.RULES.all)){s+=" "+E+" = true; if ("+h+".length > "+L+") { ";var G=h+"["+L+"]";b.schema=O,b.schemaPath=u+"["+L+"]",b.errSchemaPath=d+"/"+L,b.errorPath=e.util.getPathExpr(e.errorPath,L,e.opts.jsonPointers,!0),b.dataPathArr[k]=L;var W=e.validate(b);b.baseId=R,e.util.varOccurences(W,T)<2?s+=" "+e.util.varReplace(W,T,G)+" ":s+=" var "+T+" = "+G+"; "+W+" ",s+=" } ",p&&(s+=" if ("+E+") { ",x+="}")}}if(typeof j=="object"&&(e.opts.strictKeywords?typeof j=="object"&&Object.keys(j).length>0||j===!1:e.util.schemaHasRules(j,e.RULES.all))){b.schema=j,b.schemaPath=e.schemaPath+".additionalItems",b.errSchemaPath=e.errSchemaPath+"/additionalItems",s+=" "+E+" = true; if ("+h+".length > "+l.length+") { for (var "+S+" = "+l.length+"; "+S+" < "+h+".length; "+S+"++) { ",b.errorPath=e.util.getPathExpr(e.errorPath,S,e.opts.jsonPointers,!0);var G=h+"["+S+"]";b.dataPathArr[k]=S;var W=e.validate(b);b.baseId=R,e.util.varOccurences(W,T)<2?s+=" "+e.util.varReplace(W,T,G)+" ":s+=" var "+T+" = "+G+"; "+W+" ",p&&(s+=" if (!"+E+") break; "),s+=" } } ",p&&(s+=" if ("+E+") { ",x+="}")}}else if(e.opts.strictKeywords?typeof l=="object"&&Object.keys(l).length>0||l===!1:e.util.schemaHasRules(l,e.RULES.all)){b.schema=l,b.schemaPath=u,b.errSchemaPath=d,s+=" for (var "+S+" = 0; "+S+" < "+h+".length; "+S+"++) { ",b.errorPath=e.util.getPathExpr(e.errorPath,S,e.opts.jsonPointers,!0);var G=h+"["+S+"]";b.dataPathArr[k]=S;var W=e.validate(b);b.baseId=R,e.util.varOccurences(W,T)<2?s+=" "+e.util.varReplace(W,T,G)+" ":s+=" var "+T+" = "+G+"; "+W+" ",p&&(s+=" if (!"+E+") break; "),s+=" }"}return p&&(s+=" "+x+" if ("+v+" == errors) {"),s}),RE}var jE,zL;function FL(){return zL||(zL=1,jE=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,R,h="data"+(a||""),g=e.opts.$data&&l&&l.$data,v;g?(s+=" var schema"+i+" = "+e.util.getData(l.$data,a,e.dataPathArr)+"; ",v="schema"+i):v=l;var b=n=="maximum",x=b?"exclusiveMaximum":"exclusiveMinimum",E=e.schema[x],S=e.opts.$data&&E&&E.$data,k=b?"<":">",T=b?">":"<",R=void 0;if(!(g||typeof l=="number"||l===void 0))throw new Error(n+" must be number");if(!(S||E===void 0||typeof E=="number"||typeof E=="boolean"))throw new Error(x+" must be number or boolean");if(S){var j=e.util.getData(E.$data,a,e.dataPathArr),A="exclusive"+i,N="exclType"+i,M="exclIsNumber"+i,I="op"+i,O="' + "+I+" + '";s+=" var schemaExcl"+i+" = "+j+"; ",j="schemaExcl"+i,s+=" var "+A+"; var "+N+" = typeof "+j+"; if ("+N+" != 'boolean' && "+N+" != 'undefined' && "+N+" != 'number') { ";var R=x,L=L||[];L.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+(R||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: {} ",e.opts.messages!==!1&&(s+=" , message: '"+x+" should be boolean' "),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var z=s;s=L.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+z+"]); ":s+=" validate.errors = ["+z+"]; return false; ":s+=" var err = "+z+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } else if ( ",g&&(s+=" ("+v+" !== undefined && typeof "+v+" != 'number') || "),s+=" "+N+" == 'number' ? ( ("+A+" = "+v+" === undefined || "+j+" "+k+"= "+v+") ? "+h+" "+T+"= "+j+" : "+h+" "+T+" "+v+" ) : ( ("+A+" = "+j+" === true) ? "+h+" "+T+"= "+v+" : "+h+" "+T+" "+v+" ) || "+h+" !== "+h+") { var op"+i+" = "+A+" ? '"+k+"' : '"+k+"='; ",l===void 0&&(R=x,d=e.errSchemaPath+"/"+x,v=j,g=S)}else{var M=typeof E=="number",O=k;if(M&&g){var I="'"+O+"'";s+=" if ( ",g&&(s+=" ("+v+" !== undefined && typeof "+v+" != 'number') || "),s+=" ( "+v+" === undefined || "+E+" "+k+"= "+v+" ? "+h+" "+T+"= "+E+" : "+h+" "+T+" "+v+" ) || "+h+" !== "+h+") { "}else{M&&l===void 0?(A=!0,R=x,d=e.errSchemaPath+"/"+x,v=E,T+="="):(M&&(v=Math[b?"min":"max"](E,l)),E===(M?v:!0)?(A=!0,R=x,d=e.errSchemaPath+"/"+x,T+="="):(A=!1,O+="="));var I="'"+O+"'";s+=" if ( ",g&&(s+=" ("+v+" !== undefined && typeof "+v+" != 'number') || "),s+=" "+h+" "+T+" "+v+" || "+h+" !== "+h+") { "}}R=R||n;var L=L||[];L.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+(R||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { comparison: "+I+", limit: "+v+", exclusive: "+A+" } ",e.opts.messages!==!1&&(s+=" , message: 'should be "+O+" ",g?s+="' + "+v:s+=""+v+"'"),e.opts.verbose&&(s+=" , schema: ",g?s+="validate.schema"+u:s+=""+l,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var z=s;return s=L.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+z+"]); ":s+=" validate.errors = ["+z+"]; return false; ":s+=" var err = "+z+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",p&&(s+=" else { "),s}),jE}var ME,UL;function BL(){return UL||(UL=1,ME=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,x,h="data"+(a||""),g=e.opts.$data&&l&&l.$data,v;if(g?(s+=" var schema"+i+" = "+e.util.getData(l.$data,a,e.dataPathArr)+"; ",v="schema"+i):v=l,!(g||typeof l=="number"))throw new Error(n+" must be number");var b=n=="maxItems"?">":"<";s+="if ( ",g&&(s+=" ("+v+" !== undefined && typeof "+v+" != 'number') || "),s+=" "+h+".length "+b+" "+v+") { ";var x=n,E=E||[];E.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+(x||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { limit: "+v+" } ",e.opts.messages!==!1&&(s+=" , message: 'should NOT have ",n=="maxItems"?s+="more":s+="fewer",s+=" than ",g?s+="' + "+v+" + '":s+=""+l,s+=" items' "),e.opts.verbose&&(s+=" , schema: ",g?s+="validate.schema"+u:s+=""+l,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var S=s;return s=E.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+S+"]); ":s+=" validate.errors = ["+S+"]; return false; ":s+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",p&&(s+=" else { "),s}),ME}var OE,qL;function VL(){return qL||(qL=1,OE=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,x,h="data"+(a||""),g=e.opts.$data&&l&&l.$data,v;if(g?(s+=" var schema"+i+" = "+e.util.getData(l.$data,a,e.dataPathArr)+"; ",v="schema"+i):v=l,!(g||typeof l=="number"))throw new Error(n+" must be number");var b=n=="maxLength"?">":"<";s+="if ( ",g&&(s+=" ("+v+" !== undefined && typeof "+v+" != 'number') || "),e.opts.unicode===!1?s+=" "+h+".length ":s+=" ucs2length("+h+") ",s+=" "+b+" "+v+") { ";var x=n,E=E||[];E.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+(x||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { limit: "+v+" } ",e.opts.messages!==!1&&(s+=" , message: 'should NOT be ",n=="maxLength"?s+="longer":s+="shorter",s+=" than ",g?s+="' + "+v+" + '":s+=""+l,s+=" characters' "),e.opts.verbose&&(s+=" , schema: ",g?s+="validate.schema"+u:s+=""+l,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var S=s;return s=E.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+S+"]); ":s+=" validate.errors = ["+S+"]; return false; ":s+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",p&&(s+=" else { "),s}),OE}var PE,HL;function GL(){return HL||(HL=1,PE=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,x,h="data"+(a||""),g=e.opts.$data&&l&&l.$data,v;if(g?(s+=" var schema"+i+" = "+e.util.getData(l.$data,a,e.dataPathArr)+"; ",v="schema"+i):v=l,!(g||typeof l=="number"))throw new Error(n+" must be number");var b=n=="maxProperties"?">":"<";s+="if ( ",g&&(s+=" ("+v+" !== undefined && typeof "+v+" != 'number') || "),s+=" Object.keys("+h+").length "+b+" "+v+") { ";var x=n,E=E||[];E.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+(x||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { limit: "+v+" } ",e.opts.messages!==!1&&(s+=" , message: 'should NOT have ",n=="maxProperties"?s+="more":s+="fewer",s+=" than ",g?s+="' + "+v+" + '":s+=""+l,s+=" properties' "),e.opts.verbose&&(s+=" , schema: ",g?s+="validate.schema"+u:s+=""+l,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var S=s;return s=E.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+S+"]); ":s+=" validate.errors = ["+S+"]; return false; ":s+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",p&&(s+=" else { "),s}),PE}var IE,WL;function ghe(){return WL||(WL=1,IE=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,h="data"+(a||""),g=e.opts.$data&&l&&l.$data,v;if(g?(s+=" var schema"+i+" = "+e.util.getData(l.$data,a,e.dataPathArr)+"; ",v="schema"+i):v=l,!(g||typeof l=="number"))throw new Error(n+" must be number");s+="var division"+i+";if (",g&&(s+=" "+v+" !== undefined && ( typeof "+v+" != 'number' || "),s+=" (division"+i+" = "+h+" / "+v+", ",e.opts.multipleOfPrecision?s+=" Math.abs(Math.round(division"+i+") - division"+i+") > 1e-"+e.opts.multipleOfPrecision+" ":s+=" division"+i+" !== parseInt(division"+i+") ",s+=" ) ",g&&(s+=" ) "),s+=" ) { ";var b=b||[];b.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { multipleOf: "+v+" } ",e.opts.messages!==!1&&(s+=" , message: 'should be multiple of ",g?s+="' + "+v:s+=""+v+"'"),e.opts.verbose&&(s+=" , schema: ",g?s+="validate.schema"+u:s+=""+l,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var x=s;return s=b.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+x+"]); ":s+=" validate.errors = ["+x+"]; return false; ":s+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",p&&(s+=" else { "),s}),IE}var DE,YL;function vhe(){return YL||(YL=1,DE=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,h="data"+(a||""),g="errs__"+i,v=e.util.copy(e);v.level++;var b="valid"+v.level;if(e.opts.strictKeywords?typeof l=="object"&&Object.keys(l).length>0||l===!1:e.util.schemaHasRules(l,e.RULES.all)){v.schema=l,v.schemaPath=u,v.errSchemaPath=d,s+=" var "+g+" = errors; ";var x=e.compositeRule;e.compositeRule=v.compositeRule=!0,v.createErrors=!1;var E;v.opts.allErrors&&(E=v.opts.allErrors,v.opts.allErrors=!1),s+=" "+e.validate(v)+" ",v.createErrors=!0,E&&(v.opts.allErrors=E),e.compositeRule=v.compositeRule=x,s+=" if ("+b+") { ";var S=S||[];S.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: {} ",e.opts.messages!==!1&&(s+=" , message: 'should NOT be valid' "),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var k=s;s=S.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+k+"]); ":s+=" validate.errors = ["+k+"]; return false; ":s+=" var err = "+k+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } else { errors = "+g+"; if (vErrors !== null) { if ("+g+") vErrors.length = "+g+"; else vErrors = null; } ",e.opts.allErrors&&(s+=" } ")}else s+=" var err = ",e.createErrors!==!1?(s+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: {} ",e.opts.messages!==!1&&(s+=" , message: 'should NOT be valid' "),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ",s+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",p&&(s+=" if (false) { ");return s}),DE}var LE,KL;function yhe(){return KL||(KL=1,LE=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,h="data"+(a||""),g="valid"+i,v="errs__"+i,b=e.util.copy(e),x="";b.level++;var E="valid"+b.level,S=b.baseId,k="prevValid"+i,T="passingSchemas"+i;s+="var "+v+" = errors , "+k+" = false , "+g+" = false , "+T+" = null; ";var R=e.compositeRule;e.compositeRule=b.compositeRule=!0;var j=l;if(j)for(var A,N=-1,M=j.length-1;N<M;)A=j[N+=1],(e.opts.strictKeywords?typeof A=="object"&&Object.keys(A).length>0||A===!1:e.util.schemaHasRules(A,e.RULES.all))?(b.schema=A,b.schemaPath=u+"["+N+"]",b.errSchemaPath=d+"/"+N,s+=" "+e.validate(b)+" ",b.baseId=S):s+=" var "+E+" = true; ",N&&(s+=" if ("+E+" && "+k+") { "+g+" = false; "+T+" = ["+T+", "+N+"]; } else { ",x+="}"),s+=" if ("+E+") { "+g+" = "+k+" = true; "+T+" = "+N+"; }";return e.compositeRule=b.compositeRule=R,s+=""+x+"if (!"+g+") { var err = ",e.createErrors!==!1?(s+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { passingSchemas: "+T+" } ",e.opts.messages!==!1&&(s+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ",s+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&p&&(e.async?s+=" throw new ValidationError(vErrors); ":s+=" validate.errors = vErrors; return false; "),s+="} else { errors = "+v+"; if (vErrors !== null) { if ("+v+") vErrors.length = "+v+"; else vErrors = null; }",e.opts.allErrors&&(s+=" } "),s}),LE}var $E,XL;function bhe(){return XL||(XL=1,$E=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,h="data"+(a||""),g=e.opts.$data&&l&&l.$data,v;g?(s+=" var schema"+i+" = "+e.util.getData(l.$data,a,e.dataPathArr)+"; ",v="schema"+i):v=l;var b=g?"(new RegExp("+v+"))":e.usePattern(l);s+="if ( ",g&&(s+=" ("+v+" !== undefined && typeof "+v+" != 'string') || "),s+=" !"+b+".test("+h+") ) { ";var x=x||[];x.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { pattern: ",g?s+=""+v:s+=""+e.util.toQuotedString(l),s+=" } ",e.opts.messages!==!1&&(s+=` , message: 'should match pattern "`,g?s+="' + "+v+" + '":s+=""+e.util.escapeQuotes(l),s+=`"' `),e.opts.verbose&&(s+=" , schema: ",g?s+="validate.schema"+u:s+=""+e.util.toQuotedString(l),s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var E=s;return s=x.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+E+"]); ":s+=" validate.errors = ["+E+"]; return false; ":s+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",p&&(s+=" else { "),s}),$E}var zE,QL;function xhe(){return QL||(QL=1,zE=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,h="data"+(a||""),g="errs__"+i,v=e.util.copy(e),b="";v.level++;var x="valid"+v.level,E="key"+i,S="idx"+i,k=v.dataLevel=e.dataLevel+1,T="data"+k,R="dataProperties"+i,j=Object.keys(l||{}).filter(H),A=e.schema.patternProperties||{},N=Object.keys(A).filter(H),M=e.schema.additionalProperties,I=j.length||N.length,O=M===!1,L=typeof M=="object"&&Object.keys(M).length,z=e.opts.removeAdditional,G=O||L||z,W=e.opts.ownProperties,X=e.baseId,F=e.schema.required;if(F&&!(e.opts.$data&&F.$data)&&F.length<e.opts.loopRequired)var Y=e.util.toHash(F);function H(Te){return Te!=="__proto__"}if(s+="var "+g+" = errors;var "+x+" = true;",W&&(s+=" var "+R+" = undefined;"),G){if(W?s+=" "+R+" = "+R+" || Object.keys("+h+"); for (var "+S+"=0; "+S+"<"+R+".length; "+S+"++) { var "+E+" = "+R+"["+S+"]; ":s+=" for (var "+E+" in "+h+") { ",I){if(s+=" var isAdditional"+i+" = !(false ",j.length)if(j.length>8)s+=" || validate.schema"+u+".hasOwnProperty("+E+") ";else{var te=j;if(te)for(var P,re=-1,ue=te.length-1;re<ue;)P=te[re+=1],s+=" || "+E+" == "+e.util.toQuotedString(P)+" "}if(N.length){var D=N;if(D)for(var Z,he=-1,V=D.length-1;he<V;)Z=D[he+=1],s+=" || "+e.usePattern(Z)+".test("+E+") "}s+=" ); if (isAdditional"+i+") { "}if(z=="all")s+=" delete "+h+"["+E+"]; ";else{var U=e.errorPath,K="' + "+E+" + '";if(e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(e.errorPath,E,e.opts.jsonPointers)),O)if(z)s+=" delete "+h+"["+E+"]; ";else{s+=" "+x+" = false; ";var ae=d;d=e.errSchemaPath+"/additionalProperties";var B=B||[];B.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { additionalProperty: '"+K+"' } ",e.opts.messages!==!1&&(s+=" , message: '",e.opts._errorDataPathProperty?s+="is an invalid additional property":s+="should NOT have additional properties",s+="' "),e.opts.verbose&&(s+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var J=s;s=B.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+J+"]); ":s+=" validate.errors = ["+J+"]; return false; ":s+=" var err = "+J+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",d=ae,p&&(s+=" break; ")}else if(L)if(z=="failing"){s+=" var "+g+" = errors; ";var oe=e.compositeRule;e.compositeRule=v.compositeRule=!0,v.schema=M,v.schemaPath=e.schemaPath+".additionalProperties",v.errSchemaPath=e.errSchemaPath+"/additionalProperties",v.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,E,e.opts.jsonPointers);var fe=h+"["+E+"]";v.dataPathArr[k]=E;var be=e.validate(v);v.baseId=X,e.util.varOccurences(be,T)<2?s+=" "+e.util.varReplace(be,T,fe)+" ":s+=" var "+T+" = "+fe+"; "+be+" ",s+=" if (!"+x+") { errors = "+g+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+h+"["+E+"]; } ",e.compositeRule=v.compositeRule=oe}else{v.schema=M,v.schemaPath=e.schemaPath+".additionalProperties",v.errSchemaPath=e.errSchemaPath+"/additionalProperties",v.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,E,e.opts.jsonPointers);var fe=h+"["+E+"]";v.dataPathArr[k]=E;var be=e.validate(v);v.baseId=X,e.util.varOccurences(be,T)<2?s+=" "+e.util.varReplace(be,T,fe)+" ":s+=" var "+T+" = "+fe+"; "+be+" ",p&&(s+=" if (!"+x+") break; ")}e.errorPath=U}I&&(s+=" } "),s+=" } ",p&&(s+=" if ("+x+") { ",b+="}")}var Ae=e.opts.useDefaults&&!e.compositeRule;if(j.length){var Oe=j;if(Oe)for(var P,Ne=-1,Qe=Oe.length-1;Ne<Qe;){P=Oe[Ne+=1];var dt=l[P];if(e.opts.strictKeywords?typeof dt=="object"&&Object.keys(dt).length>0||dt===!1:e.util.schemaHasRules(dt,e.RULES.all)){var Be=e.util.getProperty(P),fe=h+Be,pt=Ae&&dt.default!==void 0;v.schema=dt,v.schemaPath=u+Be,v.errSchemaPath=d+"/"+e.util.escapeFragment(P),v.errorPath=e.util.getPath(e.errorPath,P,e.opts.jsonPointers),v.dataPathArr[k]=e.util.toQuotedString(P);var be=e.validate(v);if(v.baseId=X,e.util.varOccurences(be,T)<2){be=e.util.varReplace(be,T,fe);var De=fe}else{var De=T;s+=" var "+T+" = "+fe+"; "}if(pt)s+=" "+be+" ";else{if(Y&&Y[P]){s+=" if ( "+De+" === undefined ",W&&(s+=" || ! Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(P)+"') "),s+=") { "+x+" = false; ";var U=e.errorPath,ae=d,et=e.util.escapeQuotes(P);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(U,P,e.opts.jsonPointers)),d=e.errSchemaPath+"/required";var B=B||[];B.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { missingProperty: '"+et+"' } ",e.opts.messages!==!1&&(s+=" , message: '",e.opts._errorDataPathProperty?s+="is a required property":s+="should have required property \\'"+et+"\\'",s+="' "),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var J=s;s=B.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+J+"]); ":s+=" validate.errors = ["+J+"]; return false; ":s+=" var err = "+J+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",d=ae,e.errorPath=U,s+=" } else { "}else p?(s+=" if ( "+De+" === undefined ",W&&(s+=" || ! Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(P)+"') "),s+=") { "+x+" = true; } else { "):(s+=" if ("+De+" !== undefined ",W&&(s+=" && Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(P)+"') "),s+=" ) { ");s+=" "+be+" } "}}p&&(s+=" if ("+x+") { ",b+="}")}}if(N.length){var ot=N;if(ot)for(var Z,lr=-1,xe=ot.length-1;lr<xe;){Z=ot[lr+=1];var dt=A[Z];if(e.opts.strictKeywords?typeof dt=="object"&&Object.keys(dt).length>0||dt===!1:e.util.schemaHasRules(dt,e.RULES.all)){v.schema=dt,v.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(Z),v.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(Z),W?s+=" "+R+" = "+R+" || Object.keys("+h+"); for (var "+S+"=0; "+S+"<"+R+".length; "+S+"++) { var "+E+" = "+R+"["+S+"]; ":s+=" for (var "+E+" in "+h+") { ",s+=" if ("+e.usePattern(Z)+".test("+E+")) { ",v.errorPath=e.util.getPathExpr(e.errorPath,E,e.opts.jsonPointers);var fe=h+"["+E+"]";v.dataPathArr[k]=E;var be=e.validate(v);v.baseId=X,e.util.varOccurences(be,T)<2?s+=" "+e.util.varReplace(be,T,fe)+" ":s+=" var "+T+" = "+fe+"; "+be+" ",p&&(s+=" if (!"+x+") break; "),s+=" } ",p&&(s+=" else "+x+" = true; "),s+=" } ",p&&(s+=" if ("+x+") { ",b+="}")}}}return p&&(s+=" "+b+" if ("+g+" == errors) {"),s}),zE}var FE,JL;function _he(){return JL||(JL=1,FE=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,h="data"+(a||""),g="errs__"+i,v=e.util.copy(e),b="";v.level++;var x="valid"+v.level;if(s+="var "+g+" = errors;",e.opts.strictKeywords?typeof l=="object"&&Object.keys(l).length>0||l===!1:e.util.schemaHasRules(l,e.RULES.all)){v.schema=l,v.schemaPath=u,v.errSchemaPath=d;var E="key"+i,S="idx"+i,k="i"+i,T="' + "+E+" + '",R=v.dataLevel=e.dataLevel+1,j="data"+R,A="dataProperties"+i,N=e.opts.ownProperties,M=e.baseId;N&&(s+=" var "+A+" = undefined; "),N?s+=" "+A+" = "+A+" || Object.keys("+h+"); for (var "+S+"=0; "+S+"<"+A+".length; "+S+"++) { var "+E+" = "+A+"["+S+"]; ":s+=" for (var "+E+" in "+h+") { ",s+=" var startErrs"+i+" = errors; ";var I=E,O=e.compositeRule;e.compositeRule=v.compositeRule=!0;var L=e.validate(v);v.baseId=M,e.util.varOccurences(L,j)<2?s+=" "+e.util.varReplace(L,j,I)+" ":s+=" var "+j+" = "+I+"; "+L+" ",e.compositeRule=v.compositeRule=O,s+=" if (!"+x+") { for (var "+k+"=startErrs"+i+"; "+k+"<errors; "+k+"++) { vErrors["+k+"].propertyName = "+E+"; } var err = ",e.createErrors!==!1?(s+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { propertyName: '"+T+"' } ",e.opts.messages!==!1&&(s+=" , message: 'property name \\'"+T+"\\' is invalid' "),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ",s+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&p&&(e.async?s+=" throw new ValidationError(vErrors); ":s+=" validate.errors = vErrors; return false; "),p&&(s+=" break; "),s+=" } }"}return p&&(s+=" "+b+" if ("+g+" == errors) {"),s}),FE}var UE,ZL;function whe(){return ZL||(ZL=1,UE=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,h="data"+(a||""),g="valid"+i,v=e.opts.$data&&l&&l.$data;v&&(s+=" var schema"+i+" = "+e.util.getData(l.$data,a,e.dataPathArr)+"; ");var b="schema"+i;if(!v)if(l.length<e.opts.loopRequired&&e.schema.properties&&Object.keys(e.schema.properties).length){var x=[],E=l;if(E)for(var S,k=-1,T=E.length-1;k<T;){S=E[k+=1];var R=e.schema.properties[S];R&&(e.opts.strictKeywords?typeof R=="object"&&Object.keys(R).length>0||R===!1:e.util.schemaHasRules(R,e.RULES.all))||(x[x.length]=S)}}else var x=l;if(v||x.length){var j=e.errorPath,A=v||x.length>=e.opts.loopRequired,N=e.opts.ownProperties;if(p)if(s+=" var missing"+i+"; ",A){v||(s+=" var "+b+" = validate.schema"+u+"; ");var M="i"+i,I="schema"+i+"["+M+"]",O="' + "+I+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(j,I,e.opts.jsonPointers)),s+=" var "+g+" = true; ",v&&(s+=" if (schema"+i+" === undefined) "+g+" = true; else if (!Array.isArray(schema"+i+")) "+g+" = false; else {"),s+=" for (var "+M+" = 0; "+M+" < "+b+".length; "+M+"++) { "+g+" = "+h+"["+b+"["+M+"]] !== undefined ",N&&(s+=" && Object.prototype.hasOwnProperty.call("+h+", "+b+"["+M+"]) "),s+="; if (!"+g+") break; } ",v&&(s+=" } "),s+=" if (!"+g+") { ";var L=L||[];L.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { missingProperty: '"+O+"' } ",e.opts.messages!==!1&&(s+=" , message: '",e.opts._errorDataPathProperty?s+="is a required property":s+="should have required property \\'"+O+"\\'",s+="' "),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var z=s;s=L.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+z+"]); ":s+=" validate.errors = ["+z+"]; return false; ":s+=" var err = "+z+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } else { "}else{s+=" if ( ";var G=x;if(G)for(var W,M=-1,X=G.length-1;M<X;){W=G[M+=1],M&&(s+=" || ");var F=e.util.getProperty(W),Y=h+F;s+=" ( ( "+Y+" === undefined ",N&&(s+=" || ! Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(W)+"') "),s+=") && (missing"+i+" = "+e.util.toQuotedString(e.opts.jsonPointers?W:F)+") ) "}s+=") { ";var I="missing"+i,O="' + "+I+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(j,I,!0):j+" + "+I);var L=L||[];L.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { missingProperty: '"+O+"' } ",e.opts.messages!==!1&&(s+=" , message: '",e.opts._errorDataPathProperty?s+="is a required property":s+="should have required property \\'"+O+"\\'",s+="' "),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var z=s;s=L.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+z+"]); ":s+=" validate.errors = ["+z+"]; return false; ":s+=" var err = "+z+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } else { "}else if(A){v||(s+=" var "+b+" = validate.schema"+u+"; ");var M="i"+i,I="schema"+i+"["+M+"]",O="' + "+I+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(j,I,e.opts.jsonPointers)),v&&(s+=" if ("+b+" && !Array.isArray("+b+")) { var err = ",e.createErrors!==!1?(s+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { missingProperty: '"+O+"' } ",e.opts.messages!==!1&&(s+=" , message: '",e.opts._errorDataPathProperty?s+="is a required property":s+="should have required property \\'"+O+"\\'",s+="' "),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ",s+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+b+" !== undefined) { "),s+=" for (var "+M+" = 0; "+M+" < "+b+".length; "+M+"++) { if ("+h+"["+b+"["+M+"]] === undefined ",N&&(s+=" || ! Object.prototype.hasOwnProperty.call("+h+", "+b+"["+M+"]) "),s+=") { var err = ",e.createErrors!==!1?(s+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { missingProperty: '"+O+"' } ",e.opts.messages!==!1&&(s+=" , message: '",e.opts._errorDataPathProperty?s+="is a required property":s+="should have required property \\'"+O+"\\'",s+="' "),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ",s+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",v&&(s+=" } ")}else{var H=x;if(H)for(var W,te=-1,P=H.length-1;te<P;){W=H[te+=1];var F=e.util.getProperty(W),O=e.util.escapeQuotes(W),Y=h+F;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(j,W,e.opts.jsonPointers)),s+=" if ( "+Y+" === undefined ",N&&(s+=" || ! Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(W)+"') "),s+=") { var err = ",e.createErrors!==!1?(s+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { missingProperty: '"+O+"' } ",e.opts.messages!==!1&&(s+=" , message: '",e.opts._errorDataPathProperty?s+="is a required property":s+="should have required property \\'"+O+"\\'",s+="' "),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ",s+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}e.errorPath=j}else p&&(s+=" if (true) {");return s}),UE}var BE,e3;function She(){return e3||(e3=1,BE=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,h="data"+(a||""),g="valid"+i,v=e.opts.$data&&l&&l.$data,b;if(v?(s+=" var schema"+i+" = "+e.util.getData(l.$data,a,e.dataPathArr)+"; ",b="schema"+i):b=l,(l||v)&&e.opts.uniqueItems!==!1){v&&(s+=" var "+g+"; if ("+b+" === false || "+b+" === undefined) "+g+" = true; else if (typeof "+b+" != 'boolean') "+g+" = false; else { "),s+=" var i = "+h+".length , "+g+" = true , j; if (i > 1) { ";var x=e.schema.items&&e.schema.items.type,E=Array.isArray(x);if(!x||x=="object"||x=="array"||E&&(x.indexOf("object")>=0||x.indexOf("array")>=0))s+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+h+"[i], "+h+"[j])) { "+g+" = false; break outer; } } } ";else{s+=" var itemIndices = {}, item; for (;i--;) { var item = "+h+"[i]; ";var S="checkDataType"+(E?"s":"");s+=" if ("+e.util[S](x,"item",e.opts.strictNumbers,!0)+") continue; ",E&&(s+=` if (typeof item == 'string') item = '"' + item; `),s+=" if (typeof itemIndices[item] == 'number') { "+g+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}s+=" } ",v&&(s+=" } "),s+=" if (!"+g+") { ";var k=k||[];k.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { i: i, j: j } ",e.opts.messages!==!1&&(s+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(s+=" , schema: ",v?s+="validate.schema"+u:s+=""+l,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var T=s;s=k.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+T+"]); ":s+=" validate.errors = ["+T+"]; return false; ":s+=" var err = "+T+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",p&&(s+=" else { ")}else p&&(s+=" if (true) { ");return s}),BE}var qE,t3;function Ehe(){return t3||(t3=1,qE={$ref:ihe(),allOf:ahe(),anyOf:ohe(),$comment:lhe(),const:che(),contains:uhe(),dependencies:dhe(),enum:fhe(),format:hhe(),if:phe(),items:mhe(),maximum:FL(),minimum:FL(),maxItems:BL(),minItems:BL(),maxLength:VL(),minLength:VL(),maxProperties:GL(),minProperties:GL(),multipleOf:ghe(),not:vhe(),oneOf:yhe(),pattern:bhe(),properties:xhe(),propertyNames:_he(),required:whe(),uniqueItems:She(),validate:eV()}),qE}var VE,n3;function khe(){if(n3)return VE;n3=1;var t=Ehe(),e=nh().toHash;return VE=function(){var r=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],s=["type","$comment"],i=["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"],a=["number","integer","string","array","object","boolean","null"];return r.all=e(s),r.types=e(a),r.forEach(function(l){l.rules=l.rules.map(function(u){var d;if(typeof u=="object"){var p=Object.keys(u)[0];d=u[p],u=p,d.forEach(function(g){s.push(g),r.all[g]=!0})}s.push(u);var h=r.all[u]={keyword:u,code:t[u],implements:d};return h}),r.all.$comment={keyword:"$comment",code:t.$comment},l.type&&(r.types[l.type]=l)}),r.keywords=e(s.concat(i)),r.custom={},r},VE}var HE,r3;function The(){if(r3)return HE;r3=1;var t=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];return HE=function(e,n){for(var r=0;r<n.length;r++){e=JSON.parse(JSON.stringify(e));var s=n[r].split("/"),i=e,a;for(a=1;a<s.length;a++)i=i[s[a]];for(a=0;a<t.length;a++){var l=t[a],u=i[l];u&&(i[l]={anyOf:[u,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]})}}return e},HE}var GE,s3;function Che(){if(s3)return GE;s3=1;var t=KN().MissingRef;GE=e;function e(n,r,s){var i=this;if(typeof this._opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");typeof r=="function"&&(s=r,r=void 0);var a=l(n).then(function(){var d=i._addSchema(n,void 0,r);return d.validate||u(d)});return s&&a.then(function(d){s(null,d)},s),a;function l(d){var p=d.$schema;return p&&!i.getSchema(p)?e.call(i,{$ref:p},!0):Promise.resolve()}function u(d){try{return i._compile(d)}catch(h){if(h instanceof t)return p(h);throw h}function p(h){var g=h.missingSchema;if(x(g))throw new Error("Schema "+g+" is loaded but "+h.missingRef+" cannot be resolved");var v=i._loadingSchemas[g];return v||(v=i._loadingSchemas[g]=i._opts.loadSchema(g),v.then(b,b)),v.then(function(E){if(!x(g))return l(E).then(function(){x(g)||i.addSchema(E,g,void 0,r)})}).then(function(){return u(d)});function b(){delete i._loadingSchemas[g]}function x(E){return i._refs[E]||i._schemas[E]}}}}return GE}var WE,i3;function Ahe(){return i3||(i3=1,WE=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,h,g="data"+(a||""),v="valid"+i,b="errs__"+i,x=e.opts.$data&&l&&l.$data,E;x?(s+=" var schema"+i+" = "+e.util.getData(l.$data,a,e.dataPathArr)+"; ",E="schema"+i):E=l;var S=this,k="definition"+i,T=S.definition,R="",j,A,N,M,I;if(x&&T.$data){I="keywordValidate"+i;var O=T.validateSchema;s+=" var "+k+" = RULES.custom['"+n+"'].definition; var "+I+" = "+k+".validate;"}else{if(M=e.useCustomRule(S,l,e.schema,e),!M)return;E="validate.schema"+u,I=M.code,j=T.compile,A=T.inline,N=T.macro}var L=I+".errors",z="i"+i,G="ruleErr"+i,W=T.async;if(W&&!e.async)throw new Error("async keyword in sync schema");if(A||N||(s+=""+L+" = null;"),s+="var "+b+" = errors;var "+v+";",x&&T.$data&&(R+="}",s+=" if ("+E+" === undefined) { "+v+" = true; } else { ",O&&(R+="}",s+=" "+v+" = "+k+".validateSchema("+E+"); if ("+v+") { ")),A)T.statements?s+=" "+M.validate+" ":s+=" "+v+" = "+M.validate+"; ";else if(N){var X=e.util.copy(e),R="";X.level++;var F="valid"+X.level;X.schema=M.validate,X.schemaPath="";var Y=e.compositeRule;e.compositeRule=X.compositeRule=!0;var H=e.validate(X).replace(/validate\.schema/g,I);e.compositeRule=X.compositeRule=Y,s+=" "+H}else{var te=te||[];te.push(s),s="",s+=" "+I+".call( ",e.opts.passContext?s+="this":s+="self",j||T.schema===!1?s+=" , "+g+" ":s+=" , "+E+" , "+g+" , validate.schema"+e.schemaPath+" ",s+=" , (dataPath || '')",e.errorPath!='""'&&(s+=" + "+e.errorPath);var P=a?"data"+(a-1||""):"parentData",re=a?e.dataPathArr[a]:"parentDataProperty";s+=" , "+P+" , "+re+" , rootData ) ";var ue=s;s=te.pop(),T.errors===!1?(s+=" "+v+" = ",W&&(s+="await "),s+=""+ue+"; "):W?(L="customErrors"+i,s+=" var "+L+" = null; try { "+v+" = await "+ue+"; } catch (e) { "+v+" = false; if (e instanceof ValidationError) "+L+" = e.errors; else throw e; } "):s+=" "+L+" = null; "+v+" = "+ue+"; "}if(T.modifying&&(s+=" if ("+P+") "+g+" = "+P+"["+re+"];"),s+=""+R,T.valid)p&&(s+=" if (true) { ");else{s+=" if ( ",T.valid===void 0?(s+=" !",N?s+=""+F:s+=""+v):s+=" "+!T.valid+" ",s+=") { ",h=S.keyword;var te=te||[];te.push(s),s="";var te=te||[];te.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+(h||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { keyword: '"+S.keyword+"' } ",e.opts.messages!==!1&&(s+=` , message: 'should pass "`+S.keyword+`" keyword validation' `),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+g+" "),s+=" } "):s+=" {} ";var D=s;s=te.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+D+"]); ":s+=" validate.errors = ["+D+"]; return false; ":s+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var Z=s;s=te.pop(),A?T.errors?T.errors!="full"&&(s+=" for (var "+z+"="+b+"; "+z+"<errors; "+z+"++) { var "+G+" = vErrors["+z+"]; if ("+G+".dataPath === undefined) "+G+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+G+".schemaPath === undefined) { "+G+'.schemaPath = "'+d+'"; } ',e.opts.verbose&&(s+=" "+G+".schema = "+E+"; "+G+".data = "+g+"; "),s+=" } "):T.errors===!1?s+=" "+Z+" ":(s+=" if ("+b+" == errors) { "+Z+" } else { for (var "+z+"="+b+"; "+z+"<errors; "+z+"++) { var "+G+" = vErrors["+z+"]; if ("+G+".dataPath === undefined) "+G+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+G+".schemaPath === undefined) { "+G+'.schemaPath = "'+d+'"; } ',e.opts.verbose&&(s+=" "+G+".schema = "+E+"; "+G+".data = "+g+"; "),s+=" } } "):N?(s+=" var err = ",e.createErrors!==!1?(s+=" { keyword: '"+(h||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { keyword: '"+S.keyword+"' } ",e.opts.messages!==!1&&(s+=` , message: 'should pass "`+S.keyword+`" keyword validation' `),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+g+" "),s+=" } "):s+=" {} ",s+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&p&&(e.async?s+=" throw new ValidationError(vErrors); ":s+=" validate.errors = vErrors; return false; ")):T.errors===!1?s+=" "+Z+" ":(s+=" if (Array.isArray("+L+")) { if (vErrors === null) vErrors = "+L+"; else vErrors = vErrors.concat("+L+"); errors = vErrors.length; for (var "+z+"="+b+"; "+z+"<errors; "+z+"++) { var "+G+" = vErrors["+z+"]; if ("+G+".dataPath === undefined) "+G+".dataPath = (dataPath || '') + "+e.errorPath+"; "+G+'.schemaPath = "'+d+'"; ',e.opts.verbose&&(s+=" "+G+".schema = "+E+"; "+G+".data = "+g+"; "),s+=" } } else { "+Z+" } "),s+=" } ",p&&(s+=" else { ")}return s}),WE}const Nhe="http://json-schema.org/draft-07/schema#",Rhe="http://json-schema.org/draft-07/schema#",jhe="Core schema meta-schema",Mhe={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},Ohe=["object","boolean"],Phe={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},tV={$schema:Nhe,$id:Rhe,title:jhe,definitions:Mhe,type:Ohe,properties:Phe,default:!0};var YE,a3;function Ihe(){if(a3)return YE;a3=1;var t=tV;return YE={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:t.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:t.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}},YE}var KE,o3;function Dhe(){if(o3)return KE;o3=1;var t=/^[a-z_$][a-z0-9_$-]*$/i,e=Ahe(),n=Ihe();KE={add:r,get:s,remove:i,validate:a};function r(l,u){var d=this.RULES;if(d.keywords[l])throw new Error("Keyword "+l+" is already defined");if(!t.test(l))throw new Error("Keyword "+l+" is not a valid identifier");if(u){this.validateKeyword(u,!0);var p=u.type;if(Array.isArray(p))for(var h=0;h<p.length;h++)v(l,p[h],u);else v(l,p,u);var g=u.metaSchema;g&&(u.$data&&this._opts.$data&&(g={anyOf:[g,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]}),u.validateSchema=this.compile(g,!0))}d.keywords[l]=d.all[l]=!0;function v(b,x,E){for(var S,k=0;k<d.length;k++){var T=d[k];if(T.type==x){S=T;break}}S||(S={type:x,rules:[]},d.push(S));var R={keyword:b,definition:E,custom:!0,code:e,implements:E.implements};S.rules.push(R),d.custom[b]=R}return this}function s(l){var u=this.RULES.custom[l];return u?u.definition:this.RULES.keywords[l]||!1}function i(l){var u=this.RULES;delete u.keywords[l],delete u.all[l],delete u.custom[l];for(var d=0;d<u.length;d++)for(var p=u[d].rules,h=0;h<p.length;h++)if(p[h].keyword==l){p.splice(h,1);break}return this}function a(l,u){a.errors=null;var d=this._validateKeyword=this._validateKeyword||this.compile(n,!0);if(d(l))return!0;if(a.errors=d.errors,u)throw new Error("custom keyword definition is invalid: "+this.errorsText(d.errors));return!1}return KE}const Lhe="http://json-schema.org/draft-07/schema#",$he="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",zhe="Meta-schema for $data reference (JSON Schema extension proposal)",Fhe="object",Uhe=["$data"],Bhe={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},qhe=!1,Vhe={$schema:Lhe,$id:$he,description:zhe,type:Fhe,required:Uhe,properties:Bhe,additionalProperties:qhe};var XE,l3;function Hhe(){if(l3)return XE;l3=1;var t=nhe(),e=YN(),n=rhe(),r=Jq(),s=Zq(),i=she(),a=khe(),l=The(),u=nh();XE=b,b.prototype.validate=x,b.prototype.compile=E,b.prototype.addSchema=S,b.prototype.addMetaSchema=k,b.prototype.validateSchema=T,b.prototype.getSchema=j,b.prototype.removeSchema=M,b.prototype.addFormat=Y,b.prototype.errorsText=F,b.prototype._addSchema=O,b.prototype._compile=L,b.prototype.compileAsync=Che();var d=Dhe();b.prototype.addKeyword=d.add,b.prototype.getKeyword=d.get,b.prototype.removeKeyword=d.remove,b.prototype.validateKeyword=d.validate;var p=KN();b.ValidationError=p.Validation,b.MissingRefError=p.MissingRef,b.$dataMetaSchema=l;var h="http://json-schema.org/draft-07/schema",g=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],v=["/properties"];function b(V){if(!(this instanceof b))return new b(V);V=this._opts=u.copy(V)||{},Z(this),this._schemas={},this._refs={},this._fragments={},this._formats=i(V.format),this._cache=V.cache||new n,this._loadingSchemas={},this._compilations=[],this.RULES=a(),this._getId=z(V),V.loopRequired=V.loopRequired||1/0,V.errorDataPath=="property"&&(V._errorDataPathProperty=!0),V.serialize===void 0&&(V.serialize=s),this._metaOpts=D(this),V.formats&&P(this),V.keywords&&re(this),H(this),typeof V.meta=="object"&&this.addMetaSchema(V.meta),V.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),te(this)}function x(V,U){var K;if(typeof V=="string"){if(K=this.getSchema(V),!K)throw new Error('no schema with key or ref "'+V+'"')}else{var ae=this._addSchema(V);K=ae.validate||this._compile(ae)}var B=K(U);return K.$async!==!0&&(this.errors=K.errors),B}function E(V,U){var K=this._addSchema(V,void 0,U);return K.validate||this._compile(K)}function S(V,U,K,ae){if(Array.isArray(V)){for(var B=0;B<V.length;B++)this.addSchema(V[B],void 0,K,ae);return this}var J=this._getId(V);if(J!==void 0&&typeof J!="string")throw new Error("schema id must be string");return U=e.normalizeId(U||J),ue(this,U),this._schemas[U]=this._addSchema(V,K,ae,!0),this}function k(V,U,K){return this.addSchema(V,U,K,!0),this}function T(V,U){var K=V.$schema;if(K!==void 0&&typeof K!="string")throw new Error("$schema must be a string");if(K=K||this._opts.defaultMeta||R(this),!K)return this.logger.warn("meta-schema not available"),this.errors=null,!0;var ae=this.validate(K,V);if(!ae&&U){var B="schema is invalid: "+this.errorsText();if(this._opts.validateSchema=="log")this.logger.error(B);else throw new Error(B)}return ae}function R(V){var U=V._opts.meta;return V._opts.defaultMeta=typeof U=="object"?V._getId(U)||U:V.getSchema(h)?h:void 0,V._opts.defaultMeta}function j(V){var U=N(this,V);switch(typeof U){case"object":return U.validate||this._compile(U);case"string":return this.getSchema(U);case"undefined":return A(this,V)}}function A(V,U){var K=e.schema.call(V,{schema:{}},U);if(K){var ae=K.schema,B=K.root,J=K.baseId,oe=t.call(V,ae,B,void 0,J);return V._fragments[U]=new r({ref:U,fragment:!0,schema:ae,root:B,baseId:J,validate:oe}),oe}}function N(V,U){return U=e.normalizeId(U),V._schemas[U]||V._refs[U]||V._fragments[U]}function M(V){if(V instanceof RegExp)return I(this,this._schemas,V),I(this,this._refs,V),this;switch(typeof V){case"undefined":return I(this,this._schemas),I(this,this._refs),this._cache.clear(),this;case"string":var U=N(this,V);return U&&this._cache.del(U.cacheKey),delete this._schemas[V],delete this._refs[V],this;case"object":var K=this._opts.serialize,ae=K?K(V):V;this._cache.del(ae);var B=this._getId(V);B&&(B=e.normalizeId(B),delete this._schemas[B],delete this._refs[B])}return this}function I(V,U,K){for(var ae in U){var B=U[ae];!B.meta&&(!K||K.test(ae))&&(V._cache.del(B.cacheKey),delete U[ae])}}function O(V,U,K,ae){if(typeof V!="object"&&typeof V!="boolean")throw new Error("schema should be object or boolean");var B=this._opts.serialize,J=B?B(V):V,oe=this._cache.get(J);if(oe)return oe;ae=ae||this._opts.addUsedSchema!==!1;var fe=e.normalizeId(this._getId(V));fe&&ae&&ue(this,fe);var be=this._opts.validateSchema!==!1&&!U,Ae;be&&!(Ae=fe&&fe==e.normalizeId(V.$schema))&&this.validateSchema(V,!0);var Oe=e.ids.call(this,V),Ne=new r({id:fe,schema:V,localRefs:Oe,cacheKey:J,meta:K});return fe[0]!="#"&&ae&&(this._refs[fe]=Ne),this._cache.put(J,Ne),be&&Ae&&this.validateSchema(V,!0),Ne}function L(V,U){if(V.compiling)return V.validate=B,B.schema=V.schema,B.errors=null,B.root=U||B,V.schema.$async===!0&&(B.$async=!0),B;V.compiling=!0;var K;V.meta&&(K=this._opts,this._opts=this._metaOpts);var ae;try{ae=t.call(this,V.schema,U,V.localRefs)}catch(J){throw delete V.validate,J}finally{V.compiling=!1,V.meta&&(this._opts=K)}return V.validate=ae,V.refs=ae.refs,V.refVal=ae.refVal,V.root=ae.root,ae;function B(){var J=V.validate,oe=J.apply(this,arguments);return B.errors=J.errors,oe}}function z(V){switch(V.schemaId){case"auto":return X;case"id":return G;default:return W}}function G(V){return V.$id&&this.logger.warn("schema $id ignored",V.$id),V.id}function W(V){return V.id&&this.logger.warn("schema id ignored",V.id),V.$id}function X(V){if(V.$id&&V.id&&V.$id!=V.id)throw new Error("schema $id is different from id");return V.$id||V.id}function F(V,U){if(V=V||this.errors,!V)return"No errors";U=U||{};for(var K=U.separator===void 0?", ":U.separator,ae=U.dataVar===void 0?"data":U.dataVar,B="",J=0;J<V.length;J++){var oe=V[J];oe&&(B+=ae+oe.dataPath+" "+oe.message+K)}return B.slice(0,-K.length)}function Y(V,U){return typeof U=="string"&&(U=new RegExp(U)),this._formats[V]=U,this}function H(V){var U;if(V._opts.$data&&(U=Vhe,V.addMetaSchema(U,U.$id,!0)),V._opts.meta!==!1){var K=tV;V._opts.$data&&(K=l(K,v)),V.addMetaSchema(K,h,!0),V._refs["http://json-schema.org/schema"]=h}}function te(V){var U=V._opts.schemas;if(U)if(Array.isArray(U))V.addSchema(U);else for(var K in U)V.addSchema(U[K],K)}function P(V){for(var U in V._opts.formats){var K=V._opts.formats[U];V.addFormat(U,K)}}function re(V){for(var U in V._opts.keywords){var K=V._opts.keywords[U];V.addKeyword(U,K)}}function ue(V,U){if(V._schemas[U]||V._refs[U])throw new Error('schema with key or id "'+U+'" already exists')}function D(V){for(var U=u.copy(V._opts),K=0;K<g.length;K++)delete U[g[K]];return U}function Z(V){var U=V._opts.logger;if(U===!1)V.logger={log:he,warn:he,error:he};else{if(U===void 0&&(U=console),!(typeof U=="object"&&U.log&&U.warn&&U.error))throw new Error("logger must implement log, warn and error methods");V.logger=U}}function he(){}return XE}var Ghe=Hhe();const Whe=Vf(Ghe),c3=new Whe;function Yhe(t,e){const n={structuredErrors:void 0,unstructuredStatus:"not_applicable"};if(!e)return n;if(t.structuredContent)try{const r=c3.compile(e),s=r(t.structuredContent);n.structuredErrors=s?null:r.errors||[]}catch{n.structuredErrors=n.structuredErrors=[{keyword:"schema-compilation",instancePath:"",schemaPath:"",params:{},message:"The provided outputSchema is invalid and could not be compiled."}]}if(typeof t.content[0].text=="string")try{const r=JSON.parse(t.content[0].text),i=c3.compile(e)(r);n.unstructuredStatus=i?"valid":"schema_mismatch"}catch{n.unstructuredStatus="invalid_json"}return n}function Khe({serverConfig:t,serverName:e}){const n=GN("ToolsTab"),[r,s]=w.useState({}),[i,a]=w.useState(""),[l,u]=w.useState([]),[d,p]=w.useState(null),[h,g]=w.useState(null),[v,b]=w.useState(!1),[x,E]=w.useState(void 0),[S,k]=w.useState("not_applicable"),[T,R]=w.useState(!1),[j,A]=w.useState(!1),[N,M]=w.useState(""),[I,O]=w.useState(null),[L,z]=w.useState(!1),[G,W]=w.useState(""),[X,F]=w.useState("tools"),[Y,H]=w.useState(null),[te,P]=w.useState(null),[re,ue]=w.useState(null),[D,Z]=w.useState(null),[he,V]=w.useState(null),[U,K]=w.useState([]),[ae,B]=w.useState(!1),[J,oe]=w.useState(null),[fe,be]=w.useState({title:""}),Ae=w.useMemo(()=>{if(!t)return"none";try{if(t.url)return`http:${t.url}`;if(t.command){const Pe=(t.args||[]).join(" ");return`stdio:${t.command} ${Pe}`.trim()}return JSON.stringify(t)}catch{return"unknown"}},[t]);w.useEffect(()=>{if(!t||!e){s({}),a(""),u([]),p(null),g(null),b(!1),E(void 0),k("not_applicable"),M(""),O(null);return}Oe()},[t,e]),w.useEffect(()=>{t&&K(Ll(Ae))},[t,Ae]),w.useEffect(()=>{i&&r[i]&&u($fe(r[i].inputSchema))},[i,r]);const Oe=async()=>{if(!e){n.warn("Cannot fetch tools: no serverId available");return}A(!0),M(""),s({}),a(""),u([]),p(null),g(null),b(!1),E(void 0),k("not_applicable");try{const bt=(await AN(e)).tools??[],Xt=Object.fromEntries(bt.map(vt=>[vt.name,vt]));s(Xt),n.info("Tools fetched",{serverId:e,toolCount:bt.length})}catch(Pe){const bt=Pe instanceof Error?Pe.message:"Unknown error";n.error("Failed to fetch tools",{error:bt}),M(bt)}finally{A(!1)}},Ne=(Pe,bt)=>{u(Xt=>Xt.map(vt=>vt.name===Pe?{...vt,value:bt}:vt))},Qe=Pe=>{u(bt=>zfe(bt,Pe))},dt=()=>Ffe(l,(Pe,bt)=>n.warn(Pe,bt)),Be=Pe=>Pe?r[Pe]?._meta:void 0,pt=(Pe,bt,Xt)=>{if("result"in Pe&&Pe.status==="completed"){O(null);const vt=Pe.result;p(vt);const Qt=vt;if(Qt?.structuredContent){g(Qt.structuredContent);const Yo=Be(bt)?.["openai/outputTemplate"];b(!Yo)}else g(null),b(!1);const cr=r[bt];if(cr?.outputSchema){const br=Yhe(Qt,cr.outputSchema);E(br.structuredErrors),k(br.unstructuredStatus),br.structuredErrors&&n.warn("Schema validation failed",{errors:br.structuredErrors})}else E(void 0),k("not_applicable");n.info("Tool execution completed",{toolName:bt,duration:Date.now()-Xt});return}if("status"in Pe&&Pe.status==="elicitation_required"){O({executionId:Pe.executionId,requestId:Pe.requestId,request:Pe.request,timestamp:Pe.timestamp});return}"error"in Pe&&Pe.error&&M(Pe.error)},De=async()=>{if(!i){n.warn("Cannot execute tool: no tool selected");return}if(!e){n.warn("Cannot execute tool: no serverId available");return}R(!0),M(""),p(null),g(null),b(!1),E(void 0),k("not_applicable");const Pe=Date.now(),bt=`tool-${Pe}`,Xt=new Date;try{const vt=dt();P(bt),ue(i),Z(vt),V(Xt);const Qt=await ZS(e,i,vt);pt(Qt,i,Pe)}catch(vt){console.error("executeTool",vt);const Qt=vt instanceof Error?vt.message:"Unknown error";n.error("Tool execution network error",{toolName:i,error:Qt}),M(Qt)}finally{R(!1)}},et=async(Pe,bt)=>{if(!I){n.warn("Cannot handle elicitation response: no active request");return}z(!0);try{const Xt=Pe==="accept"?{action:"accept",content:bt??{}}:{action:Pe},vt=await Bue(I.requestId,Xt);pt(vt,i,Date.now())}catch(Xt){const vt=Xt instanceof Error?Xt.message:"Unknown error";n.error("Error responding to elicitation",{requestId:I.requestId,action:Pe,error:vt}),M(vt)}finally{z(!1)}},ot=()=>{i&&(oe(null),be({title:i,description:""}),B(!0))},lr=Pe=>{a(Pe.toolName),setTimeout(()=>Qe(Pe.parameters),50)},xe=Pe=>{Bfe(Ae,Pe),K(Ll(Ae))},Te=Pe=>{const bt=qfe(Ae,Pe.id);K(Ll(Ae)),bt?.id&&(H(bt.id),setTimeout(()=>H(null),2e3))},st=Pe=>{oe(Pe.id),be({title:Pe.title,description:Pe.description}),B(!0)},qe=Object.keys(r),At=G.trim()?qe.filter(Pe=>{const bt=r[Pe];return`${Pe} ${bt?.description??""}`.toLowerCase().includes(G.trim().toLowerCase())}):qe,Jn=G.trim()?U.filter(Pe=>`${Pe.title} ${Pe.description??""}`.toLowerCase().includes(G.trim().toLowerCase())):U,Zn=I?{requestId:I.requestId,message:I.request.message,schema:I.request.requestedSchema,timestamp:I.timestamp}:null;return t?f.jsxs("div",{className:"h-[calc(100vh-120px)] flex flex-col",children:[f.jsxs(Tf,{direction:"vertical",className:"flex-1",children:[f.jsx(ni,{defaultSize:70,minSize:30,children:f.jsxs(Tf,{direction:"horizontal",className:"h-full",children:[f.jsx(Ife,{activeTab:X,onChangeTab:F,tools:r,toolNames:qe,filteredToolNames:At,selectedToolName:i,fetchingTools:j,searchQuery:G,onSearchQueryChange:W,onRefresh:Oe,onSelectTool:a,savedRequests:Jn,highlightedRequestId:Y,onLoadRequest:lr,onRenameRequest:st,onDuplicateRequest:Te,onDeleteRequest:xe}),f.jsx(Cf,{withHandle:!0}),i?f.jsx(Tde,{selectedTool:i,toolDescription:r[i]?.description,formFields:l,loading:T,waitingOnElicitation:!!I,onExecute:De,onSave:ot,onFieldChange:Ne}):f.jsx(ni,{defaultSize:70,minSize:50,children:f.jsx("div",{className:"h-full flex items-center justify-center",children:f.jsxs("div",{className:"text-center",children:[f.jsx("div",{className:"w-12 h-12 bg-muted rounded-full flex items-center justify-center mx-auto mb-3",children:f.jsx(kk,{className:"h-5 w-5 text-muted-foreground"})}),f.jsx("p",{className:"text-xs font-semibold text-foreground mb-1",children:"Select a tool"}),f.jsx("p",{className:"text-xs text-muted-foreground font-medium",children:"Choose a tool from the left to configure parameters"})]})})})]})}),f.jsx(Cf,{withHandle:!0}),f.jsx(ni,{defaultSize:40,minSize:15,maxSize:85,children:f.jsx(Mfe,{error:N,showStructured:v,onToggleStructured:b,structuredResult:h,result:d,validationErrors:x,unstructuredValidationResult:S,serverId:e,toolCallId:te??void 0,toolName:re??void 0,toolParameters:D??void 0,toolCallTimestamp:he??void 0,toolMeta:Be(re),onExecuteFromUI:async(Pe,bt)=>{e&&await ZS(e,Pe,bt||{})},onHandleIntent:async(Pe,bt)=>{e&&await ZS(e,"handleIntent",{intent:Pe,params:bt||{}})},onSendFollowup:Pe=>{n.info("OpenAI component requested follow-up",{message:Pe})}})})]}),f.jsx(ST,{elicitationRequest:Zn,onResponse:et,loading:L}),f.jsx(Dfe,{open:ae,defaultTitle:fe.title,defaultDescription:fe.description,onCancel:()=>B(!1),onSave:({title:Pe,description:bt})=>{if(J){Vfe(Ae,J,{title:Pe,description:bt}),K(Ll(Ae)),oe(null),B(!1),F("saved"),H(J),setTimeout(()=>H(null),2e3);return}const Xt=dt(),vt=HN(Ae,{title:Pe,description:bt,toolName:i,parameters:Xt});K(Ll(Ae)),B(!1),F("saved"),vt?.id&&(H(vt.id),setTimeout(()=>H(null),2e3))}})]}):f.jsx(th,{icon:kk,title:"No Server Selected",description:"Connect to an MCP server to explore and test its available tools."})}function Xhe({serverConfig:t,serverName:e}){const[n,r]=w.useState([]),[s,i]=w.useState(""),[a,l]=w.useState(null),[u,d]=w.useState(!1),[p,h]=w.useState(!1),[g,v]=w.useState(""),b=w.useMemo(()=>n.find(S=>S.uri===s)??null,[n,s]);w.useEffect(()=>{t&&e&&x()},[t,e]);const x=async()=>{if(e){h(!0),v(""),r([]);try{const S=await fetch("/api/mcp/resources/list",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({serverId:e})}),k=await S.json();if(S.ok){const T=Array.isArray(k.resources)?k.resources:[];r(T),T.length===0?(i(""),l(null)):T.some(R=>R.uri===s)||(i(T[0].uri),l(null))}else v(k.error||"Failed to fetch resources")}catch(S){v(`Network error fetching resources: ${S}`)}finally{h(!1)}}},E=async S=>{if(e){d(!0),v("");try{const k=await fetch("/api/mcp/resources/read",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({serverId:e,uri:S})}),T=await k.json();k.ok?l(T.content??null):v(T.error||"Failed to read resource")}catch(k){v(`Network error reading resource: ${k}`)}finally{d(!1)}}};return!t||!e?f.jsx(th,{icon:MS,title:"No Server Selected",description:"Connect to an MCP server to browse and explore its available resources."}):f.jsx("div",{className:"h-[calc(100vh-120px)] flex flex-col",children:f.jsxs(Tf,{direction:"vertical",className:"flex-1",children:[f.jsx(ni,{defaultSize:70,minSize:30,children:f.jsxs(Tf,{direction:"horizontal",className:"h-full",children:[f.jsx(ni,{defaultSize:30,minSize:20,maxSize:50,children:f.jsxs("div",{className:"h-full flex flex-col border-r border-border bg-background",children:[f.jsxs("div",{className:"flex items-center justify-between px-4 py-4 border-b border-border bg-background",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(MS,{className:"h-3 w-3 text-muted-foreground"}),f.jsx("h2",{className:"text-xs font-semibold text-foreground",children:"Resources"}),f.jsx(vr,{variant:"secondary",className:"text-xs font-mono",children:n.length})]}),f.jsx(Ie,{onClick:x,variant:"ghost",size:"sm",disabled:p,children:f.jsx(ir,{className:`h-3 w-3 ${p?"animate-spin":""} cursor-pointer`})})]}),f.jsx("div",{className:"flex-1 overflow-hidden",children:f.jsx(La,{className:"h-full",children:f.jsx("div",{className:"p-2",children:p?f.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[f.jsx("div",{className:"w-8 h-8 bg-muted rounded-full flex items-center justify-center mb-3",children:f.jsx(ir,{className:"h-4 w-4 text-muted-foreground animate-spin cursor-pointer"})}),f.jsx("p",{className:"text-xs text-muted-foreground font-semibold mb-1",children:"Loading resources..."}),f.jsx("p",{className:"text-xs text-muted-foreground/70",children:"Fetching available resources from server"})]}):n.length===0?f.jsx("div",{className:"text-center py-8",children:f.jsx("p",{className:"text-sm text-muted-foreground",children:"No resources available"})}):f.jsx("div",{className:"space-y-1",children:n.map(S=>f.jsx("div",{className:`cursor-pointer transition-all duration-200 hover:bg-muted/30 dark:hover:bg-muted/50 p-3 rounded-md mx-2 ${s===S.uri?"bg-muted/50 dark:bg-muted/50 shadow-sm border border-border ring-1 ring-ring/20":"hover:shadow-sm"}`,onClick:()=>i(S.uri),children:f.jsxs("div",{className:"flex items-start gap-3",children:[f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[f.jsx(kse,{className:"h-3 w-3 text-muted-foreground flex-shrink-0"}),f.jsx("code",{className:"font-mono text-xs font-medium text-foreground bg-muted px-1.5 py-0.5 rounded border border-border",children:S.name})]}),S.description&&f.jsx("p",{className:"text-xs mt-2 line-clamp-2 leading-relaxed text-muted-foreground",children:S.description}),f.jsx("p",{className:"text-xs text-muted-foreground/70 mt-1 font-mono truncate",children:S.uri}),S.mimeType&&f.jsx(vr,{variant:"outline",className:"text-xs mt-2 font-mono",children:S.mimeType})]}),f.jsx(Ba,{className:"h-3 w-3 text-muted-foreground flex-shrink-0 mt-1"})]})},S.uri))})})})})]})}),f.jsx(Cf,{withHandle:!0}),f.jsx(ni,{defaultSize:70,minSize:50,children:f.jsx("div",{className:"h-full flex flex-col bg-background",children:s?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"flex items-center justify-between px-6 py-5 border-b border-border bg-background",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx("div",{className:"flex items-center gap-3",children:f.jsx("code",{className:"font-mono font-semibold text-foreground bg-muted px-2 py-1 rounded-md border border-border text-xs",children:b?.name||s})}),f.jsx("p",{className:"text-xs text-muted-foreground font-mono truncate max-w-md",children:s})]}),f.jsx(Ie,{onClick:()=>E(s),disabled:u,className:"bg-primary hover:bg-primary/90 text-primary-foreground shadow-sm transition-all duration-200 cursor-pointer",size:"sm",children:u?f.jsxs(f.Fragment,{children:[f.jsx(ir,{className:"h-3 w-3 mr-1.5 animate-spin cursor-pointer"}),f.jsx("span",{className:"font-mono text-xs",children:"Reading"})]}):f.jsxs(f.Fragment,{children:[f.jsx(lI,{className:"h-3 w-3 mr-1.5 cursor-pointer"}),f.jsx("span",{className:"font-mono text-xs",children:"Read"})]})})]}),b?.description&&f.jsx("div",{className:"px-6 py-4 bg-muted/50 border-b border-border",children:f.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed font-medium",children:b.description})}),f.jsx("div",{className:"flex-1 overflow-hidden",children:f.jsx(La,{className:"h-full",children:f.jsx("div",{className:"px-6 py-6",children:a?f.jsx("div",{className:"space-y-4",children:a?.contents?.map((S,k)=>f.jsxs("div",{className:"group",children:[f.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[f.jsx(vr,{variant:"secondary",className:"text-xs font-mono font-medium",children:S.type}),S.mimeType&&f.jsx(vr,{variant:"outline",className:"text-xs font-mono",children:S.mimeType})]}),f.jsx("div",{className:"border border-border rounded-md overflow-hidden",children:S.type==="text"?f.jsx("pre",{className:"text-xs font-mono whitespace-pre-wrap p-4 bg-background overflow-auto max-h-96",children:S.text}):f.jsx("div",{className:"p-4",children:f.jsx(zl,{src:S,dark:!0,theme:"atom",enableClipboard:!0,displaySize:!1,collapseStringsAfterLength:100,style:{fontSize:"12px",fontFamily:"ui-monospace, SFMono-Regular, 'SF Mono', monospace",backgroundColor:"hsl(var(--background))",padding:"0",borderRadius:"0",border:"none"}})})})]},k))}):f.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[f.jsx("div",{className:"w-10 h-10 bg-muted rounded-full flex items-center justify-center mb-3",children:f.jsx(lI,{className:"h-4 w-4 text-muted-foreground"})}),f.jsx("p",{className:"text-xs text-muted-foreground font-semibold mb-1",children:"Ready to read resource"}),f.jsx("p",{className:"text-xs text-muted-foreground/70",children:"Click the Read button to view resource content"})]})})})})]}):f.jsx("div",{className:"h-full flex items-center justify-center",children:f.jsxs("div",{className:"text-center",children:[f.jsx("div",{className:"w-12 h-12 bg-muted rounded-full flex items-center justify-center mx-auto mb-3",children:f.jsx(MS,{className:"h-5 w-5 text-muted-foreground"})}),f.jsx("p",{className:"text-xs font-semibold text-foreground mb-1",children:"Select a resource"}),f.jsx("p",{className:"text-xs text-muted-foreground font-medium",children:"Choose a resource from the left to preview its content"})]})})})})]})}),f.jsx(Cf,{withHandle:!0}),f.jsx(ni,{defaultSize:30,minSize:15,maxSize:70,children:f.jsxs("div",{className:"h-full flex flex-col border-t border-border bg-background",children:[f.jsx("div",{className:"flex items-center justify-between p-4 border-b border-border",children:f.jsx("h2",{className:"text-xs font-semibold text-foreground",children:"Status"})}),f.jsx("div",{className:"flex-1 overflow-hidden",children:g?f.jsx("div",{className:"p-4",children:f.jsx("div",{className:"p-3 bg-destructive/10 border border-destructive/20 rounded text-destructive text-xs font-medium",children:g})}):f.jsx("div",{className:"flex items-center justify-center h-full",children:f.jsx("p",{className:"text-xs text-muted-foreground font-medium",children:"Resource operations status will appear here"})})})]})})]})})}function Qhe({serverConfig:t,serverName:e}){const[n,r]=w.useState([]),[s,i]=w.useState(""),[a,l]=w.useState([]),[u,d]=w.useState(null),[p,h]=w.useState(!1),[g,v]=w.useState(!1),[b,x]=w.useState(""),E=w.useMemo(()=>n.find(N=>N.name===s)??null,[n,s]);w.useEffect(()=>{t&&e&&S()},[t,e]),w.useEffect(()=>{E?.arguments?k(E.arguments):l([])},[E]);const S=async()=>{if(e){v(!0),x("");try{const N=await fetch("/api/mcp/prompts/list",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({serverId:e})}),M=await N.json();if(N.ok){const I=Array.isArray(M.prompts)?M.prompts:[];r(I),I.length===0?(i(""),d(null)):I.some(O=>O.name===s)||(i(I[0].name),d(null))}else x(M.error||"Could not fetch prompts")}catch(N){x(`Could not fetch prompts: ${N}`)}finally{v(!1)}}},k=N=>{if(!N||N.length===0){l([]);return}const M=N.map(I=>({name:I.name,type:"string",description:I.description,required:!!I.required,value:""}));l(M)},T=(N,M)=>{l(I=>I.map(O=>O.name===N?{...O,value:M}:O))},R=()=>{const N={};return a.forEach(M=>{if(M.value!==""&&M.value!==null&&M.value!==void 0){let I;M.type==="array"||M.type==="object"?I=typeof M.value=="string"?M.value:JSON.stringify(M.value):M.type==="boolean"?I=M.value?"true":"false":(M.type==="number"||M.type,I=String(M.value)),N[M.name]=I}}),N},j=async()=>{if(!(!s||!e)){h(!0),x("");try{const N=R(),M=await fetch("/api/mcp/prompts/get",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({serverId:e,name:s,args:N})}),I=await M.json();M.ok?d(I.content):x(I.error||"Failed to get prompt")}catch(N){x(`Error getting prompt: ${N}`)}finally{h(!1)}}},A=n.map(N=>N.name);return!t||!e?f.jsx(th,{icon:Gy,title:"No Server Selected",description:"Connect to an MCP server to explore and test its available prompts."}):f.jsx("div",{className:"h-[calc(100vh-120px)] flex flex-col",children:f.jsxs(Tf,{direction:"vertical",className:"flex-1",children:[f.jsx(ni,{defaultSize:70,minSize:30,children:f.jsxs(Tf,{direction:"horizontal",className:"h-full",children:[f.jsx(ni,{defaultSize:30,minSize:20,maxSize:50,children:f.jsxs("div",{className:"h-full flex flex-col border-r border-border bg-background",children:[f.jsxs("div",{className:"flex items-center justify-between px-4 py-4 border-b border-border bg-background",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(Gy,{className:"h-3 w-3 text-muted-foreground"}),f.jsx("h2",{className:"text-xs font-semibold text-foreground",children:"Prompts"}),f.jsx(vr,{variant:"secondary",className:"text-xs font-mono",children:A.length})]}),f.jsx(Ie,{onClick:S,variant:"ghost",size:"sm",disabled:g,children:f.jsx(ir,{className:`h-3 w-3 ${g?"animate-spin":""} cursor-pointer`})})]}),f.jsx("div",{className:"flex-1 overflow-hidden",children:f.jsx(La,{className:"h-full",children:f.jsx("div",{className:"p-2",children:g?f.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[f.jsx("div",{className:"w-8 h-8 bg-muted rounded-full flex items-center justify-center mb-3",children:f.jsx(ir,{className:"h-4 w-4 text-muted-foreground animate-spin cursor-pointer"})}),f.jsx("p",{className:"text-xs text-muted-foreground font-semibold mb-1",children:"Loading prompts..."}),f.jsx("p",{className:"text-xs text-muted-foreground/70",children:"Fetching available prompts from server"})]}):A.length===0?f.jsx("div",{className:"text-center py-8",children:f.jsx("p",{className:"text-sm text-muted-foreground",children:"No prompts available"})}):f.jsx("div",{className:"space-y-1",children:n.map(N=>{const M=s===N.name,I=N.title??N.name;return f.jsx("div",{className:`cursor-pointer transition-all duration-200 hover:bg-muted/30 dark:hover:bg-muted/50 p-3 rounded-md mx-2 ${M?"bg-muted/50 dark:bg-muted/50 shadow-sm border border-border ring-1 ring-ring/20":"hover:shadow-sm"}`,onClick:()=>{i(N.name)},children:f.jsxs("div",{className:"flex items-start gap-3",children:[f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[f.jsx("code",{className:"font-mono text-xs font-medium text-foreground bg-muted px-1.5 py-0.5 rounded border border-border",children:N.name}),N.title&&f.jsx("span",{className:"text-xs font-semibold text-foreground",children:I})]}),N.description&&f.jsx("p",{className:"text-xs mt-2 line-clamp-2 leading-relaxed text-muted-foreground",children:N.description})]}),f.jsx(Ba,{className:"h-3 w-3 text-muted-foreground flex-shrink-0 mt-1"})]})},N.name)})})})})})]})}),f.jsx(Cf,{withHandle:!0}),f.jsx(ni,{defaultSize:70,minSize:50,children:f.jsx("div",{className:"h-full flex flex-col bg-background",children:s?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"flex items-center justify-between px-6 py-5 border-b border-border bg-background",children:[f.jsx("div",{className:"space-y-2",children:f.jsx("div",{className:"flex items-center gap-3",children:f.jsx("code",{className:"font-mono font-semibold text-foreground bg-muted px-2 py-1 rounded-md border border-border text-xs",children:s})})}),f.jsx(Ie,{onClick:j,disabled:p||!s,className:"bg-primary hover:bg-primary/90 text-primary-foreground shadow-sm transition-all duration-200 cursor-pointer",size:"sm",children:p?f.jsxs(f.Fragment,{children:[f.jsx(ir,{className:"h-3 w-3 mr-1.5 animate-spin cursor-pointer"}),f.jsx("span",{className:"font-mono text-xs",children:"Loading"})]}):f.jsxs(f.Fragment,{children:[f.jsx(Cb,{className:"h-3 w-3 mr-1.5 cursor-pointer"}),f.jsx("span",{className:"font-mono text-xs",children:"Get Prompt"})]})})]}),E?.description&&f.jsx("div",{className:"px-6 py-4 bg-muted/50 border-b border-border",children:f.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed font-medium",children:E.description})}),f.jsx("div",{className:"flex-1 overflow-hidden",children:f.jsx(La,{className:"h-full",children:f.jsx("div",{className:"px-6 py-6",children:a.length===0?f.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[f.jsx("div",{className:"w-10 h-10 bg-muted rounded-full flex items-center justify-center mb-3",children:f.jsx(Cb,{className:"h-4 w-4 text-muted-foreground"})}),f.jsx("p",{className:"text-xs text-muted-foreground font-semibold mb-1",children:"No parameters required"}),f.jsx("p",{className:"text-xs text-muted-foreground/70",children:"This prompt can be retrieved directly"})]}):f.jsx("div",{className:"space-y-8",children:a.map(N=>f.jsxs("div",{className:"group",children:[f.jsxs("div",{className:"flex items-start justify-between mb-3",children:[f.jsxs("div",{className:"space-y-1",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("code",{className:"font-mono text-xs font-semibold text-foreground bg-muted px-1.5 py-0.5 rounded border border-border",children:N.name}),N.required&&f.jsx("div",{className:"w-1.5 h-1.5 bg-amber-400 dark:bg-amber-500 rounded-full",title:"Required field"})]}),N.description&&f.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed max-w-md font-medium",children:N.description})]}),f.jsx(vr,{variant:"secondary",className:"text-xs font-mono font-medium",children:N.type})]}),f.jsx("div",{className:"space-y-2",children:N.type==="enum"?f.jsxs(Qc,{value:String(N.value),onValueChange:M=>T(N.name,M),children:[f.jsx(Zc,{className:"w-full bg-background border-border hover:border-border/80 focus:border-ring focus:ring-0 font-medium text-xs",children:f.jsx(Jc,{placeholder:"Select an option",className:"font-mono text-xs"})}),f.jsx(eu,{children:N.enum?.map(M=>f.jsx(Qs,{value:M,className:"font-mono text-xs",children:M},M))})]}):N.type==="boolean"?f.jsxs("div",{className:"flex items-center space-x-3 py-2",children:[f.jsx("input",{type:"checkbox",checked:N.value===!0,onChange:M=>T(N.name,M.target.checked),className:"w-4 h-4 text-primary bg-background border-border rounded focus:ring-ring focus:ring-2"}),f.jsx("span",{className:"text-xs text-foreground font-medium",children:N.value===!0?"Enabled":"Disabled"})]}):N.type==="array"||N.type==="object"?f.jsx(Ho,{value:typeof N.value=="string"?N.value:JSON.stringify(N.value,null,2),onChange:M=>T(N.name,M.target.value),placeholder:`Enter ${N.type} as JSON`,className:"font-mono text-xs h-20 bg-background border-border hover:border-border/80 focus:border-ring focus:ring-0 resize-none"}):f.jsx(Un,{type:N.type==="number"||N.type==="integer"?"number":"text",value:String(N.value),onChange:M=>T(N.name,M.target.value),placeholder:`Enter ${N.name}`,className:"bg-background border-border hover:border-border/80 focus:border-ring focus:ring-0 font-medium text-xs"})})]},N.name))})})})})]}):f.jsx("div",{className:"h-full flex items-center justify-center",children:f.jsxs("div",{className:"text-center",children:[f.jsx("div",{className:"w-12 h-12 bg-muted rounded-full flex items-center justify-center mx-auto mb-3",children:f.jsx(Gy,{className:"h-5 w-5 text-muted-foreground"})}),f.jsx("p",{className:"text-xs font-semibold text-foreground mb-1",children:"Select a prompt"}),f.jsx("p",{className:"text-xs text-muted-foreground font-medium",children:"Choose a prompt from the left to view details"})]})})})})]})}),f.jsx(Cf,{withHandle:!0}),f.jsx(ni,{defaultSize:30,minSize:15,maxSize:70,children:f.jsxs("div",{className:"h-full flex flex-col border-t border-border bg-background",children:[f.jsx("div",{className:"flex items-center justify-between p-4 border-b border-border",children:f.jsx("h2",{className:"text-xs font-semibold text-foreground",children:"Prompt Content"})}),f.jsx("div",{className:"flex-1 overflow-hidden",children:b?f.jsx("div",{className:"p-4",children:f.jsx("div",{className:"p-3 bg-destructive/10 border border-destructive/20 rounded text-destructive text-xs font-medium",children:b})}):u?f.jsx(La,{className:"h-full",children:f.jsx("div",{className:"p-4",children:typeof u=="string"?f.jsx("pre",{className:"whitespace-pre-wrap text-xs font-mono bg-muted p-4 rounded-md border border-border",children:u}):f.jsx(zl,{src:u,dark:!0,theme:"atom",enableClipboard:!0,displaySize:!1,collapseStringsAfterLength:100,style:{fontSize:"12px",fontFamily:"ui-monospace, SFMono-Regular, 'SF Mono', monospace",backgroundColor:"hsl(var(--background))",padding:"16px",borderRadius:"8px",border:"1px solid hsl(var(--border))"}})})}):f.jsx("div",{className:"flex items-center justify-center h-full",children:f.jsx("p",{className:"text-xs text-muted-foreground font-medium",children:"Get a prompt to see its content here"})})})]})})]})})}var nV=t=>{throw TypeError(t)},XN=(t,e,n)=>e.has(t)||nV("Cannot "+n),Ht=(t,e,n)=>(XN(t,e,"read from private field"),n?n.call(t):e.get(t)),Ts=(t,e,n)=>e.has(t)?nV("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),sr=(t,e,n,r)=>(XN(t,e,"write to private field"),e.set(t,n),n),Kn=(t,e,n)=>(XN(t,e,"access private method"),n),Jhe=class extends Error{constructor(){super(...arguments),this.status=500,this.name="NoClientIdProvidedException",this.message='Missing Client ID. Pass it to the constructor (createClient("client_01HXRMBQ9BJ3E7QSTQ9X2PHVB7"))'}};function Zhe(t,e){if(!e.has("code"))return!1;const{pathname:r}=window.location,s=new URL(t).pathname;return r===s||r===`${s}/`}function epe(){let t={};function e(i,a){t[i]=a}function n(i){return t[i]}function r(i){delete t[i]}function s(){t={}}return{setItem:e,getItem:n,removeItem:r,reset:s}}var Ms=epe();async function tpe(){const t=npe(),e=await rpe(t);return{codeVerifier:t,codeChallenge:e}}function npe(){const t=crypto.getRandomValues(new Uint32Array(96));return rV(t)}async function rpe(t){const e=await spe(t);return rV(e)}function rV(t){return btoa(Array.from(new Uint8Array(t),e=>String.fromCharCode(e)).join("")).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function spe(t){const n=new TextEncoder().encode(t);return crypto.subtle.digest("SHA-256",n)}function u3(t){const e=t.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-e.length%4)%4);return atob(e+n)}function ipe(t){const e=t.split(".");if(e.length!==3)throw new Error("Invalid JWT format");try{const n=JSON.parse(u3(e[0])),r=JSON.parse(u3(e[1]));return{header:n,payload:r}}catch(n){throw new Error(`Failed to decode JWT: ${n instanceof Error?n.message:String(n)}`)}}var ts={codeVerifier:"workos:code-verifier",user:"workos:user",accessToken:"workos:access-token",refreshToken:"workos:refresh-token",expiresAt:"workos:expires-at"};function D0(t){return ipe(t).payload}function sV(t,{devMode:e=!1}={}){const{user:n,accessToken:r,refreshToken:s}=t;Ms.setItem(ts.user,n),Ms.setItem(ts.accessToken,r),(e?window.localStorage:Ms).setItem(ts.refreshToken,s);const{exp:i,iat:a}=D0(r),l=i-a,u=Date.now()+l*1e3;Ms.setItem(ts.expiresAt,u)}function iV({devMode:t=!1}={}){Ms.removeItem(ts.user),Ms.removeItem(ts.accessToken),(t?window.localStorage:Ms).removeItem(ts.refreshToken)}function aV({devMode:t=!1}={}){return(t?window.localStorage:Ms).getItem(ts.refreshToken)}function ape(t){const e=new URLSearchParams,n=Object.keys(t).sort();for(const r of n){const s=t[r];s&&e.append(r,s)}return e.toString()}var QN=class extends Error{},sx=class extends QN{},ope=class extends QN{},BT=class extends QN{constructor(){super(...arguments),this.message="No access token available"}},lpe=class Vp{constructor(){this.locked=new Map,this.addToLocked=(e,n)=>{let r=this.locked.get(e);r===void 0?n===void 0?this.locked.set(e,[]):this.locked.set(e,[n]):n!==void 0&&(r.unshift(n),this.locked.set(e,r))},this.isLocked=e=>this.locked.has(e),this.lock=e=>new Promise((n,r)=>{this.isLocked(e)?this.addToLocked(e,n):(this.addToLocked(e),n())}),this.unlock=e=>{let n=this.locked.get(e);if(n===void 0||n.length===0){this.locked.delete(e);return}let r=n.pop();this.locked.set(e,n),r!==void 0&&setTimeout(r,0)}}static getInstance(){return Vp.instance===void 0&&(Vp.instance=new Vp),Vp.instance}};function Ed(){return lpe.getInstance()}var QE="browser-tabs-lock-key",fy={key:async t=>{throw new Error("Unsupported")},getItem:async t=>{throw new Error("Unsupported")},clear:async()=>window.localStorage.clear(),removeItem:async t=>{throw new Error("Unsupported")},setItem:async(t,e)=>{throw new Error("Unsupported")},keySync:t=>window.localStorage.key(t),getItemSync:t=>window.localStorage.getItem(t),clearSync:()=>window.localStorage.clear(),removeItemSync:t=>window.localStorage.removeItem(t),setItemSync:(t,e)=>window.localStorage.setItem(t,e)};function JE(t){return new Promise(e=>setTimeout(e,t))}function qT(t){const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";let n="";for(let r=0;r<t;r++){const s=Math.floor(Math.random()*e.length);n+=e[s]}return n}function cpe(){return Date.now().toString()+qT(15)}var oV=class us{constructor(e){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=cpe(),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),this.storageHandler=e,us.waiters===void 0&&(us.waiters=[])}async acquireLock(e,n=5e3){let r=Date.now()+qT(4);const s=Date.now()+n,i=`${QE}-${e}`,a=this.storageHandler===void 0?fy:this.storageHandler;for(;Date.now()<s;){if(await JE(30),a.getItemSync(i)===null){const u=`${this.id}-${e}-${r}`;await JE(Math.floor(Math.random()*25)),a.setItemSync(i,JSON.stringify({id:this.id,iat:r,timeoutKey:u,timeAcquired:Date.now(),timeRefreshed:Date.now()})),await JE(30);let d=a.getItemSync(i);if(d!==null){let p=JSON.parse(d);if(p.id===this.id&&p.iat===r)return this.acquiredIatSet.add(r),this.refreshLockWhileAcquired(i,r),!0}}else us.lockCorrector(this.storageHandler===void 0?fy:this.storageHandler),await this.waitForSomethingToChange(s);r=Date.now()+qT(4)}return!1}async refreshLockWhileAcquired(e,n){setTimeout(async()=>{if(await Ed().lock(n),!this.acquiredIatSet.has(n)){Ed().unlock(n);return}const r=this.storageHandler===void 0?fy:this.storageHandler;let s=r.getItemSync(e);if(s!==null){let i=JSON.parse(s);i.timeRefreshed=Date.now(),r.setItemSync(e,JSON.stringify(i)),Ed().unlock(n)}else{Ed().unlock(n);return}this.refreshLockWhileAcquired(e,n)},1e3)}async waitForSomethingToChange(e){await new Promise(n=>{let r=!1,s=Date.now();const i=50;let a=!1;function l(){if(a||(window.removeEventListener("storage",l),us.removeFromWaiting(l),clearTimeout(u),a=!0),!r){r=!0;let d=i-(Date.now()-s);d>0?setTimeout(n,d):n(null)}}window.addEventListener("storage",l),us.addToWaiting(l);let u=setTimeout(l,Math.max(0,e-Date.now()))})}static addToWaiting(e){this.removeFromWaiting(e),us.waiters!==void 0&&us.waiters.push(e)}static removeFromWaiting(e){us.waiters!==void 0&&(us.waiters=us.waiters.filter(n=>n!==e))}static notifyWaiters(){if(us.waiters===void 0)return;[...us.waiters].forEach(n=>n())}async releaseLock(e){return await this.releaseLock__private__(e)}async releaseLock__private__(e){const n=this.storageHandler===void 0?fy:this.storageHandler,r=`${QE}-${e}`;let s=n.getItemSync(r);if(s===null)return;let i=JSON.parse(s);i.id===this.id&&(await Ed().lock(i.iat),this.acquiredIatSet.delete(i.iat),n.removeItemSync(r),Ed().unlock(i.iat),us.notifyWaiters())}static lockCorrector(e){const n=Date.now()-5e3,r=e,s=[];let i=0;for(;;){let l=r.keySync(i);if(l===null)break;s.push(l),i++}let a=!1;for(let l=0;l<s.length;l++){const u=s[l];if(u.includes(QE)){let d=r.getItemSync(u);if(d!==null){let p=JSON.parse(d);(p.timeRefreshed===void 0&&p.timeAcquired<n||p.timeRefreshed!==void 0&&p.timeRefreshed<n)&&(r.removeItemSync(u),a=!0)}}}a&&us.notifyWaiters()}};oV.waiters=void 0;var upe=oV,dpe=1e4;function fpe(t,e,{timeout:n=dpe}={}){return"locks"in navigator?hpe(t,e,n):ppe(t,e,n)}async function hpe(t,e,n){try{return await navigator.locks.request(t,{signal:AbortSignal.timeout(n)},e)}catch(r){if(r instanceof DOMException)switch(r.name){case"AbortError":throw new JN("AcquisitionTimeoutError",t,"Native")}throw r}}async function ppe(t,e,n){const r=new upe;try{if(await r.acquireLock(t,n))return await e();throw new JN("AcquisitionTimeoutError",t,"Vendor")}finally{await r.releaseLock(t)}}var JN=class extends Error{constructor(t,e,n){super(`Lock acquisition timed out for "${e}" (${n})`),this.name=t,this.lockName=e}},mpe=t=>({object:t.object,id:t.id,email:t.email,emailVerified:t.email_verified,firstName:t.first_name,profilePictureUrl:t.profile_picture_url,lastName:t.last_name,lastSignInAt:t.last_sign_in_at,externalId:t.external_id,createdAt:t.created_at,updatedAt:t.updated_at}),d3=t=>{const{user:e,organization_id:n,access_token:r,refresh_token:s,impersonator:i,...a}=t;return{user:mpe(e),organizationId:n,accessToken:r,refreshToken:s,impersonator:i,...a}},gpe="api.workos.com",Vd,$d,Zy,VT,vpe=class{constructor({clientId:t,hostname:e=gpe,port:n,https:r=!0}){Ts(this,Zy),Ts(this,Vd),Ts(this,$d),sr(this,Vd,`${r?"https":"http"}://${e}${n?`:${n}`:""}`),sr(this,$d,t)}async authenticateWithRefreshToken({refreshToken:t,organizationId:e,useCookie:n}){const r=await Kn(this,Zy,VT).call(this,"/user_management/authenticate",{useCookie:n,body:{client_id:Ht(this,$d),grant_type:"refresh_token",...!n&&{refresh_token:t},organization_id:e}});if(r.ok){const s=await r.json();return d3(s)}else{const s=await r.json();throw new sx(s.error_description)}}async authenticateWithCode({code:t,codeVerifier:e,useCookie:n}){const r=await Kn(this,Zy,VT).call(this,"/user_management/authenticate",{useCookie:n,body:{code:t,client_id:Ht(this,$d),grant_type:"authorization_code",code_verifier:e}});if(r.ok){const i=await r.json();return d3(i)}const s=await r.json();throw new ope(s.error_description)}getAuthorizationUrl({connectionId:t,context:e,domainHint:n,loginHint:r,organizationId:s,provider:i="authkit",redirectUri:a,state:l,screenHint:u,passwordResetToken:d,invitationToken:p,codeChallenge:h,codeChallengeMethod:g}){if(!i&&!t&&!s)throw new TypeError("Incomplete arguments. Need to specify either a 'connectionId', 'organizationId', or 'provider'.");if(i!=="authkit"&&u)throw new TypeError("'screenHint' is only supported for 'authkit' provider");e&&console.warn("`context` is deprecated. We previously required initiate login endpoints to return the\n`context` query parameter when getting the authorization URL. This is no longer necessary.");const v=ape({connection_id:t,organization_id:s,domain_hint:n,login_hint:r,provider:i,client_id:Ht(this,$d),redirect_uri:a,response_type:"code",state:l,screen_hint:u,invitation_token:p,password_reset_token:d,code_challenge:h,code_challenge_method:g});return`${Ht(this,Vd)}/user_management/authorize?${v}`}getLogoutUrl({sessionId:t,returnTo:e}){const n=new URL("/user_management/sessions/logout",Ht(this,Vd));return n.searchParams.set("session_id",t),e&&n.searchParams.set("return_to",e),n}};Vd=new WeakMap;$d=new WeakMap;Zy=new WeakSet;VT=function(t,{body:e,useCookie:n}){return fetch(new URL(t,Ht(this,Vd)),{method:"POST",...n&&{credentials:"include"},headers:{Accept:"application/json, text/plain, */*","Content-Type":"application/json"},body:JSON.stringify(e)})};var f3="workos_organization_id",ype="WORKOS_REFRESH_SESSION",gr,ix,nu,tm,Aa,ax,ox,$m,zm,lx,On,lV,nm,rm,cV,ZN,Hp,eR,tR,nR,bpe=class{constructor(t,{apiHostname:e,https:n,port:r,redirectUri:s=window.origin,devMode:i=location.hostname==="localhost"||location.hostname==="127.0.0.1",onBeforeAutoRefresh:a=()=>!document.hidden,onRedirectCallback:l=h=>{},onRefresh:u,onRefreshFailure:d,refreshBufferInterval:p=10}={}){if(Ts(this,On),Ts(this,gr),Ts(this,ix),Ts(this,nu),Ts(this,tm),Ts(this,Aa),Ts(this,ax),Ts(this,ox),Ts(this,$m),Ts(this,zm),Ts(this,lx),!t)throw new Jhe;sr(this,nu,new vpe({clientId:t,hostname:e,port:r,https:n})),sr(this,Aa,i),sr(this,tm,s),sr(this,gr,{tag:"INITIAL"}),sr(this,ax,a),sr(this,ox,l),sr(this,$m,u),sr(this,zm,d),sr(this,lx,p)}async initialize(){if(Ht(this,gr).tag!=="INITIAL")return;const t=new URLSearchParams(window.location.search);if(Zhe(Ht(this,tm),t))await Kn(this,On,lV).call(this);else if(document.cookie.includes("workos-has-session=")||aV({devMode:Ht(this,Aa)}))try{await Kn(this,On,rm).call(this),Kn(this,On,nm).call(this)}catch{}}async getSignInUrl(t={}){return await Kn(this,On,Hp).call(this,{...t,type:"sign-in"})}async getSignUpUrl(t={}){return await Kn(this,On,Hp).call(this,{...t,type:"sign-up"})}async signIn(t={}){const e=await Kn(this,On,Hp).call(this,{...t,type:"sign-in"});window.location.assign(e)}async signUp(t={}){const e=await Kn(this,On,Hp).call(this,{...t,type:"sign-up"});window.location.assign(e)}signOut(t={navigate:!0}){const e=t.navigate??!0,n=Ms.getItem(ts.accessToken);if(typeof n!="string")return;const{sid:r}=D0(n),s=Ht(this,nu).getLogoutUrl({sessionId:r,returnTo:t?.returnTo});if(s)if(iV({devMode:Ht(this,Aa)}),e)window.location.assign(s);else return new Promise(async i=>{fetch(s,{mode:"no-cors",credentials:"include"}).catch(a=>{console.warn("AuthKit: Failed to send logout request",a)}).finally(i)})}async getAccessToken(t){if(t?.forceRefresh||Kn(this,On,ZN).call(this))try{await Kn(this,On,rm).call(this)}catch(n){throw n instanceof sx?new BT:n}const e=Kn(this,On,eR).call(this);if(!e)throw new BT;return e}getUser(){const t=Ms.getItem(ts.user);return t||null}dispose(){clearTimeout(Ht(this,ix)),Ms.reset()}async switchToOrganization({organizationId:t,signInOpts:e={}}){try{await Kn(this,On,rm).call(this,{organizationId:t})}catch(n){if(n instanceof sx)this.signIn({...e,organizationId:t});else throw n}}};gr=new WeakMap;ix=new WeakMap;nu=new WeakMap;tm=new WeakMap;Aa=new WeakMap;ax=new WeakMap;ox=new WeakMap;$m=new WeakMap;zm=new WeakMap;lx=new WeakMap;On=new WeakSet;lV=async function(){if(Ht(this,gr).tag!=="INITIAL")return;const t=new URL(window.location.href),e=t.searchParams.get("code"),n=t.searchParams.get("state"),r=n?JSON.parse(n):void 0,s=window.sessionStorage.getItem(ts.codeVerifier);if(e)if(s)try{sr(this,gr,{tag:"AUTHENTICATING",response:Ht(this,nu).authenticateWithCode({code:e,codeVerifier:s,useCookie:Ht(this,On,tR)})});const a=await Ht(this,gr).response;a&&(sr(this,gr,{tag:"AUTHENTICATED"}),Kn(this,On,nm).call(this),sV(a,{devMode:Ht(this,Aa)}),Kn(this,On,nR).call(this,a),Ht(this,ox).call(this,{state:r,...a}))}catch(a){sr(this,gr,{tag:"ERROR"}),console.error(a)}else sr(this,gr,{tag:"ERROR"}),console.error(`Couldn't exchange code.
|
|
1775
|
+
Error:`,a),(n==="error"?console.error:n==="warn"?console.warn:n==="debug"?console.debug:console.log)(...h)}function Qfe(){const[,t]=w.useState({});return w.useEffect(()=>{const e=Yi.subscribe(()=>{t({})});return()=>{e()}},[]),{entries:Yi.getEntries(),config:Yi.getConfig(),setConfig:Yi.setConfig.bind(Yi),clearBuffer:Yi.clearBuffer.bind(Yi)}}var qp={exports:{}};/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */var Jfe=qp.exports,mL;function Zfe(){return mL||(mL=1,function(t,e){(function(n,r){r(e)})(Jfe,function(n){function r(){for(var ne=arguments.length,Q=Array(ne),se=0;se<ne;se++)Q[se]=arguments[se];if(Q.length>1){Q[0]=Q[0].slice(0,-1);for(var ye=Q.length-1,me=1;me<ye;++me)Q[me]=Q[me].slice(1,-1);return Q[ye]=Q[ye].slice(1),Q.join("")}else return Q[0]}function s(ne){return"(?:"+ne+")"}function i(ne){return ne===void 0?"undefined":ne===null?"null":Object.prototype.toString.call(ne).split(" ").pop().split("]").shift().toLowerCase()}function a(ne){return ne.toUpperCase()}function l(ne){return ne!=null?ne instanceof Array?ne:typeof ne.length!="number"||ne.split||ne.setInterval||ne.call?[ne]:Array.prototype.slice.call(ne):[]}function u(ne,Q){var se=ne;if(Q)for(var ye in Q)se[ye]=Q[ye];return se}function d(ne){var Q="[A-Za-z]",se="[0-9]",ye=r(se,"[A-Fa-f]"),me=s(s("%[EFef]"+ye+"%"+ye+ye+"%"+ye+ye)+"|"+s("%[89A-Fa-f]"+ye+"%"+ye+ye)+"|"+s("%"+ye+ye)),nt="[\\:\\/\\?\\#\\[\\]\\@]",tt="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",Mt=r(nt,tt),sn=ne?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",hn=ne?"[\\uE000-\\uF8FF]":"[]",at=r(Q,se,"[\\-\\.\\_\\~]",sn);s(Q+r(Q,se,"[\\+\\-\\.]")+"*"),s(s(me+"|"+r(at,tt,"[\\:]"))+"*");var ln=s(s("25[0-5]")+"|"+s("2[0-4]"+se)+"|"+s("1"+se+se)+"|"+s("0?[1-9]"+se)+"|0?0?"+se),jn=s(ln+"\\."+ln+"\\."+ln+"\\."+ln),lt=s(ye+"{1,4}"),an=s(s(lt+"\\:"+lt)+"|"+jn),Hn=s(s(lt+"\\:")+"{6}"+an),yn=s("\\:\\:"+s(lt+"\\:")+"{5}"+an),zi=s(s(lt)+"?\\:\\:"+s(lt+"\\:")+"{4}"+an),oi=s(s(s(lt+"\\:")+"{0,1}"+lt)+"?\\:\\:"+s(lt+"\\:")+"{3}"+an),as=s(s(s(lt+"\\:")+"{0,2}"+lt)+"?\\:\\:"+s(lt+"\\:")+"{2}"+an),Fi=s(s(s(lt+"\\:")+"{0,3}"+lt)+"?\\:\\:"+lt+"\\:"+an),zr=s(s(s(lt+"\\:")+"{0,4}"+lt)+"?\\:\\:"+an),Qr=s(s(s(lt+"\\:")+"{0,5}"+lt)+"?\\:\\:"+lt),zs=s(s(s(lt+"\\:")+"{0,6}"+lt)+"?\\:\\:"),bs=s([Hn,yn,zi,oi,as,Fi,zr,Qr,zs].join("|")),Fs=s(s(at+"|"+me)+"+");s("[vV]"+ye+"+\\."+r(at,tt,"[\\:]")+"+"),s(s(me+"|"+r(at,tt))+"*");var Qa=s(me+"|"+r(at,tt,"[\\:\\@]"));return s(s(me+"|"+r(at,tt,"[\\@]"))+"+"),s(s(Qa+"|"+r("[\\/\\?]",hn))+"*"),{NOT_SCHEME:new RegExp(r("[^]",Q,se,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(r("[^\\%\\:]",at,tt),"g"),NOT_HOST:new RegExp(r("[^\\%\\[\\]\\:]",at,tt),"g"),NOT_PATH:new RegExp(r("[^\\%\\/\\:\\@]",at,tt),"g"),NOT_PATH_NOSCHEME:new RegExp(r("[^\\%\\/\\@]",at,tt),"g"),NOT_QUERY:new RegExp(r("[^\\%]",at,tt,"[\\:\\@\\/\\?]",hn),"g"),NOT_FRAGMENT:new RegExp(r("[^\\%]",at,tt,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(r("[^]",at,tt),"g"),UNRESERVED:new RegExp(at,"g"),OTHER_CHARS:new RegExp(r("[^\\%]",at,Mt),"g"),PCT_ENCODED:new RegExp(me,"g"),IPV4ADDRESS:new RegExp("^("+jn+")$"),IPV6ADDRESS:new RegExp("^\\[?("+bs+")"+s(s("\\%25|\\%(?!"+ye+"{2})")+"("+Fs+")")+"?\\]?$")}}var p=d(!1),h=d(!0),g=function(){function ne(Q,se){var ye=[],me=!0,nt=!1,tt=void 0;try{for(var Mt=Q[Symbol.iterator](),sn;!(me=(sn=Mt.next()).done)&&(ye.push(sn.value),!(se&&ye.length===se));me=!0);}catch(hn){nt=!0,tt=hn}finally{try{!me&&Mt.return&&Mt.return()}finally{if(nt)throw tt}}return ye}return function(Q,se){if(Array.isArray(Q))return Q;if(Symbol.iterator in Object(Q))return ne(Q,se);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),v=function(ne){if(Array.isArray(ne)){for(var Q=0,se=Array(ne.length);Q<ne.length;Q++)se[Q]=ne[Q];return se}else return Array.from(ne)},b=2147483647,x=36,E=1,S=26,k=38,T=700,R=72,j=128,A="-",N=/^xn--/,M=/[^\0-\x7E]/,I=/[\x2E\u3002\uFF0E\uFF61]/g,O={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},L=x-E,z=Math.floor,G=String.fromCharCode;function W(ne){throw new RangeError(O[ne])}function X(ne,Q){for(var se=[],ye=ne.length;ye--;)se[ye]=Q(ne[ye]);return se}function F(ne,Q){var se=ne.split("@"),ye="";se.length>1&&(ye=se[0]+"@",ne=se[1]),ne=ne.replace(I,".");var me=ne.split("."),nt=X(me,Q).join(".");return ye+nt}function Y(ne){for(var Q=[],se=0,ye=ne.length;se<ye;){var me=ne.charCodeAt(se++);if(me>=55296&&me<=56319&&se<ye){var nt=ne.charCodeAt(se++);(nt&64512)==56320?Q.push(((me&1023)<<10)+(nt&1023)+65536):(Q.push(me),se--)}else Q.push(me)}return Q}var H=function(Q){return String.fromCodePoint.apply(String,v(Q))},te=function(Q){return Q-48<10?Q-22:Q-65<26?Q-65:Q-97<26?Q-97:x},P=function(Q,se){return Q+22+75*(Q<26)-((se!=0)<<5)},re=function(Q,se,ye){var me=0;for(Q=ye?z(Q/T):Q>>1,Q+=z(Q/se);Q>L*S>>1;me+=x)Q=z(Q/L);return z(me+(L+1)*Q/(Q+k))},ue=function(Q){var se=[],ye=Q.length,me=0,nt=j,tt=R,Mt=Q.lastIndexOf(A);Mt<0&&(Mt=0);for(var sn=0;sn<Mt;++sn)Q.charCodeAt(sn)>=128&&W("not-basic"),se.push(Q.charCodeAt(sn));for(var hn=Mt>0?Mt+1:0;hn<ye;){for(var at=me,ln=1,jn=x;;jn+=x){hn>=ye&&W("invalid-input");var lt=te(Q.charCodeAt(hn++));(lt>=x||lt>z((b-me)/ln))&&W("overflow"),me+=lt*ln;var an=jn<=tt?E:jn>=tt+S?S:jn-tt;if(lt<an)break;var Hn=x-an;ln>z(b/Hn)&&W("overflow"),ln*=Hn}var yn=se.length+1;tt=re(me-at,yn,at==0),z(me/yn)>b-nt&&W("overflow"),nt+=z(me/yn),me%=yn,se.splice(me++,0,nt)}return String.fromCodePoint.apply(String,se)},D=function(Q){var se=[];Q=Y(Q);var ye=Q.length,me=j,nt=0,tt=R,Mt=!0,sn=!1,hn=void 0;try{for(var at=Q[Symbol.iterator](),ln;!(Mt=(ln=at.next()).done);Mt=!0){var jn=ln.value;jn<128&&se.push(G(jn))}}catch(ha){sn=!0,hn=ha}finally{try{!Mt&&at.return&&at.return()}finally{if(sn)throw hn}}var lt=se.length,an=lt;for(lt&&se.push(A);an<ye;){var Hn=b,yn=!0,zi=!1,oi=void 0;try{for(var as=Q[Symbol.iterator](),Fi;!(yn=(Fi=as.next()).done);yn=!0){var zr=Fi.value;zr>=me&&zr<Hn&&(Hn=zr)}}catch(ha){zi=!0,oi=ha}finally{try{!yn&&as.return&&as.return()}finally{if(zi)throw oi}}var Qr=an+1;Hn-me>z((b-nt)/Qr)&&W("overflow"),nt+=(Hn-me)*Qr,me=Hn;var zs=!0,bs=!1,Fs=void 0;try{for(var Qa=Q[Symbol.iterator](),Fg;!(zs=(Fg=Qa.next()).done);zs=!0){var mh=Fg.value;if(mh<me&&++nt>b&&W("overflow"),mh==me){for(var Fr=nt,mc=x;;mc+=x){var Lu=mc<=tt?E:mc>=tt+S?S:mc-tt;if(Fr<Lu)break;var gc=Fr-Lu,gh=x-Lu;se.push(G(P(Lu+gc%gh,0))),Fr=z(gc/gh)}se.push(G(P(Fr,0))),tt=re(nt,Qr,an==lt),nt=0,++an}}}catch(ha){bs=!0,Fs=ha}finally{try{!zs&&Qa.return&&Qa.return()}finally{if(bs)throw Fs}}++nt,++me}return se.join("")},Z=function(Q){return F(Q,function(se){return N.test(se)?ue(se.slice(4).toLowerCase()):se})},he=function(Q){return F(Q,function(se){return M.test(se)?"xn--"+D(se):se})},V={version:"2.1.0",ucs2:{decode:Y,encode:H},decode:ue,encode:D,toASCII:he,toUnicode:Z},U={};function K(ne){var Q=ne.charCodeAt(0),se=void 0;return Q<16?se="%0"+Q.toString(16).toUpperCase():Q<128?se="%"+Q.toString(16).toUpperCase():Q<2048?se="%"+(Q>>6|192).toString(16).toUpperCase()+"%"+(Q&63|128).toString(16).toUpperCase():se="%"+(Q>>12|224).toString(16).toUpperCase()+"%"+(Q>>6&63|128).toString(16).toUpperCase()+"%"+(Q&63|128).toString(16).toUpperCase(),se}function ae(ne){for(var Q="",se=0,ye=ne.length;se<ye;){var me=parseInt(ne.substr(se+1,2),16);if(me<128)Q+=String.fromCharCode(me),se+=3;else if(me>=194&&me<224){if(ye-se>=6){var nt=parseInt(ne.substr(se+4,2),16);Q+=String.fromCharCode((me&31)<<6|nt&63)}else Q+=ne.substr(se,6);se+=6}else if(me>=224){if(ye-se>=9){var tt=parseInt(ne.substr(se+4,2),16),Mt=parseInt(ne.substr(se+7,2),16);Q+=String.fromCharCode((me&15)<<12|(tt&63)<<6|Mt&63)}else Q+=ne.substr(se,9);se+=9}else Q+=ne.substr(se,3),se+=3}return Q}function B(ne,Q){function se(ye){var me=ae(ye);return me.match(Q.UNRESERVED)?me:ye}return ne.scheme&&(ne.scheme=String(ne.scheme).replace(Q.PCT_ENCODED,se).toLowerCase().replace(Q.NOT_SCHEME,"")),ne.userinfo!==void 0&&(ne.userinfo=String(ne.userinfo).replace(Q.PCT_ENCODED,se).replace(Q.NOT_USERINFO,K).replace(Q.PCT_ENCODED,a)),ne.host!==void 0&&(ne.host=String(ne.host).replace(Q.PCT_ENCODED,se).toLowerCase().replace(Q.NOT_HOST,K).replace(Q.PCT_ENCODED,a)),ne.path!==void 0&&(ne.path=String(ne.path).replace(Q.PCT_ENCODED,se).replace(ne.scheme?Q.NOT_PATH:Q.NOT_PATH_NOSCHEME,K).replace(Q.PCT_ENCODED,a)),ne.query!==void 0&&(ne.query=String(ne.query).replace(Q.PCT_ENCODED,se).replace(Q.NOT_QUERY,K).replace(Q.PCT_ENCODED,a)),ne.fragment!==void 0&&(ne.fragment=String(ne.fragment).replace(Q.PCT_ENCODED,se).replace(Q.NOT_FRAGMENT,K).replace(Q.PCT_ENCODED,a)),ne}function J(ne){return ne.replace(/^0*(.*)/,"$1")||"0"}function oe(ne,Q){var se=ne.match(Q.IPV4ADDRESS)||[],ye=g(se,2),me=ye[1];return me?me.split(".").map(J).join("."):ne}function fe(ne,Q){var se=ne.match(Q.IPV6ADDRESS)||[],ye=g(se,3),me=ye[1],nt=ye[2];if(me){for(var tt=me.toLowerCase().split("::").reverse(),Mt=g(tt,2),sn=Mt[0],hn=Mt[1],at=hn?hn.split(":").map(J):[],ln=sn.split(":").map(J),jn=Q.IPV4ADDRESS.test(ln[ln.length-1]),lt=jn?7:8,an=ln.length-lt,Hn=Array(lt),yn=0;yn<lt;++yn)Hn[yn]=at[yn]||ln[an+yn]||"";jn&&(Hn[lt-1]=oe(Hn[lt-1],Q));var zi=Hn.reduce(function(Qr,zs,bs){if(!zs||zs==="0"){var Fs=Qr[Qr.length-1];Fs&&Fs.index+Fs.length===bs?Fs.length++:Qr.push({index:bs,length:1})}return Qr},[]),oi=zi.sort(function(Qr,zs){return zs.length-Qr.length})[0],as=void 0;if(oi&&oi.length>1){var Fi=Hn.slice(0,oi.index),zr=Hn.slice(oi.index+oi.length);as=Fi.join(":")+"::"+zr.join(":")}else as=Hn.join(":");return nt&&(as+="%"+nt),as}else return ne}var be=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,Ae="".match(/(){0}/)[1]===void 0;function Oe(ne){var Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},se={},ye=Q.iri!==!1?h:p;Q.reference==="suffix"&&(ne=(Q.scheme?Q.scheme+":":"")+"//"+ne);var me=ne.match(be);if(me){Ae?(se.scheme=me[1],se.userinfo=me[3],se.host=me[4],se.port=parseInt(me[5],10),se.path=me[6]||"",se.query=me[7],se.fragment=me[8],isNaN(se.port)&&(se.port=me[5])):(se.scheme=me[1]||void 0,se.userinfo=ne.indexOf("@")!==-1?me[3]:void 0,se.host=ne.indexOf("//")!==-1?me[4]:void 0,se.port=parseInt(me[5],10),se.path=me[6]||"",se.query=ne.indexOf("?")!==-1?me[7]:void 0,se.fragment=ne.indexOf("#")!==-1?me[8]:void 0,isNaN(se.port)&&(se.port=ne.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?me[4]:void 0)),se.host&&(se.host=fe(oe(se.host,ye),ye)),se.scheme===void 0&&se.userinfo===void 0&&se.host===void 0&&se.port===void 0&&!se.path&&se.query===void 0?se.reference="same-document":se.scheme===void 0?se.reference="relative":se.fragment===void 0?se.reference="absolute":se.reference="uri",Q.reference&&Q.reference!=="suffix"&&Q.reference!==se.reference&&(se.error=se.error||"URI is not a "+Q.reference+" reference.");var nt=U[(Q.scheme||se.scheme||"").toLowerCase()];if(!Q.unicodeSupport&&(!nt||!nt.unicodeSupport)){if(se.host&&(Q.domainHost||nt&&nt.domainHost))try{se.host=V.toASCII(se.host.replace(ye.PCT_ENCODED,ae).toLowerCase())}catch(tt){se.error=se.error||"Host's domain name can not be converted to ASCII via punycode: "+tt}B(se,p)}else B(se,ye);nt&&nt.parse&&nt.parse(se,Q)}else se.error=se.error||"URI can not be parsed.";return se}function Ne(ne,Q){var se=Q.iri!==!1?h:p,ye=[];return ne.userinfo!==void 0&&(ye.push(ne.userinfo),ye.push("@")),ne.host!==void 0&&ye.push(fe(oe(String(ne.host),se),se).replace(se.IPV6ADDRESS,function(me,nt,tt){return"["+nt+(tt?"%25"+tt:"")+"]"})),(typeof ne.port=="number"||typeof ne.port=="string")&&(ye.push(":"),ye.push(String(ne.port))),ye.length?ye.join(""):void 0}var Qe=/^\.\.?\//,dt=/^\/\.(\/|$)/,Be=/^\/\.\.(\/|$)/,pt=/^\/?(?:.|\n)*?(?=\/|$)/;function De(ne){for(var Q=[];ne.length;)if(ne.match(Qe))ne=ne.replace(Qe,"");else if(ne.match(dt))ne=ne.replace(dt,"/");else if(ne.match(Be))ne=ne.replace(Be,"/"),Q.pop();else if(ne==="."||ne==="..")ne="";else{var se=ne.match(pt);if(se){var ye=se[0];ne=ne.slice(ye.length),Q.push(ye)}else throw new Error("Unexpected dot segment condition")}return Q.join("")}function et(ne){var Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},se=Q.iri?h:p,ye=[],me=U[(Q.scheme||ne.scheme||"").toLowerCase()];if(me&&me.serialize&&me.serialize(ne,Q),ne.host&&!se.IPV6ADDRESS.test(ne.host)){if(Q.domainHost||me&&me.domainHost)try{ne.host=Q.iri?V.toUnicode(ne.host):V.toASCII(ne.host.replace(se.PCT_ENCODED,ae).toLowerCase())}catch(Mt){ne.error=ne.error||"Host's domain name can not be converted to "+(Q.iri?"Unicode":"ASCII")+" via punycode: "+Mt}}B(ne,se),Q.reference!=="suffix"&&ne.scheme&&(ye.push(ne.scheme),ye.push(":"));var nt=Ne(ne,Q);if(nt!==void 0&&(Q.reference!=="suffix"&&ye.push("//"),ye.push(nt),ne.path&&ne.path.charAt(0)!=="/"&&ye.push("/")),ne.path!==void 0){var tt=ne.path;!Q.absolutePath&&(!me||!me.absolutePath)&&(tt=De(tt)),nt===void 0&&(tt=tt.replace(/^\/\//,"/%2F")),ye.push(tt)}return ne.query!==void 0&&(ye.push("?"),ye.push(ne.query)),ne.fragment!==void 0&&(ye.push("#"),ye.push(ne.fragment)),ye.join("")}function ot(ne,Q){var se=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},ye=arguments[3],me={};return ye||(ne=Oe(et(ne,se),se),Q=Oe(et(Q,se),se)),se=se||{},!se.tolerant&&Q.scheme?(me.scheme=Q.scheme,me.userinfo=Q.userinfo,me.host=Q.host,me.port=Q.port,me.path=De(Q.path||""),me.query=Q.query):(Q.userinfo!==void 0||Q.host!==void 0||Q.port!==void 0?(me.userinfo=Q.userinfo,me.host=Q.host,me.port=Q.port,me.path=De(Q.path||""),me.query=Q.query):(Q.path?(Q.path.charAt(0)==="/"?me.path=De(Q.path):((ne.userinfo!==void 0||ne.host!==void 0||ne.port!==void 0)&&!ne.path?me.path="/"+Q.path:ne.path?me.path=ne.path.slice(0,ne.path.lastIndexOf("/")+1)+Q.path:me.path=Q.path,me.path=De(me.path)),me.query=Q.query):(me.path=ne.path,Q.query!==void 0?me.query=Q.query:me.query=ne.query),me.userinfo=ne.userinfo,me.host=ne.host,me.port=ne.port),me.scheme=ne.scheme),me.fragment=Q.fragment,me}function lr(ne,Q,se){var ye=u({scheme:"null"},se);return et(ot(Oe(ne,ye),Oe(Q,ye),ye,!0),ye)}function xe(ne,Q){return typeof ne=="string"?ne=et(Oe(ne,Q),Q):i(ne)==="object"&&(ne=Oe(et(ne,Q),Q)),ne}function Te(ne,Q,se){return typeof ne=="string"?ne=et(Oe(ne,se),se):i(ne)==="object"&&(ne=et(ne,se)),typeof Q=="string"?Q=et(Oe(Q,se),se):i(Q)==="object"&&(Q=et(Q,se)),ne===Q}function st(ne,Q){return ne&&ne.toString().replace(!Q||!Q.iri?p.ESCAPE:h.ESCAPE,K)}function qe(ne,Q){return ne&&ne.toString().replace(!Q||!Q.iri?p.PCT_ENCODED:h.PCT_ENCODED,ae)}var At={scheme:"http",domainHost:!0,parse:function(Q,se){return Q.host||(Q.error=Q.error||"HTTP URIs must have a host."),Q},serialize:function(Q,se){var ye=String(Q.scheme).toLowerCase()==="https";return(Q.port===(ye?443:80)||Q.port==="")&&(Q.port=void 0),Q.path||(Q.path="/"),Q}},Jn={scheme:"https",domainHost:At.domainHost,parse:At.parse,serialize:At.serialize};function Zn(ne){return typeof ne.secure=="boolean"?ne.secure:String(ne.scheme).toLowerCase()==="wss"}var Pe={scheme:"ws",domainHost:!0,parse:function(Q,se){var ye=Q;return ye.secure=Zn(ye),ye.resourceName=(ye.path||"/")+(ye.query?"?"+ye.query:""),ye.path=void 0,ye.query=void 0,ye},serialize:function(Q,se){if((Q.port===(Zn(Q)?443:80)||Q.port==="")&&(Q.port=void 0),typeof Q.secure=="boolean"&&(Q.scheme=Q.secure?"wss":"ws",Q.secure=void 0),Q.resourceName){var ye=Q.resourceName.split("?"),me=g(ye,2),nt=me[0],tt=me[1];Q.path=nt&&nt!=="/"?nt:void 0,Q.query=tt,Q.resourceName=void 0}return Q.fragment=void 0,Q}},bt={scheme:"wss",domainHost:Pe.domainHost,parse:Pe.parse,serialize:Pe.serialize},Xt={},vt="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Qt="[0-9A-Fa-f]",cr=s(s("%[EFef]"+Qt+"%"+Qt+Qt+"%"+Qt+Qt)+"|"+s("%[89A-Fa-f]"+Qt+"%"+Qt+Qt)+"|"+s("%"+Qt+Qt)),br="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",Yo="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",pc=r(Yo,'[\\"\\\\]'),fa="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Du=new RegExp(vt,"g"),ft=new RegExp(cr,"g"),Ln=new RegExp(r("[^]",br,"[\\.]",'[\\"]',pc),"g"),$n=new RegExp(r("[^]",vt,fa),"g"),xr=$n;function $i(ne){var Q=ae(ne);return Q.match(Du)?Q:ne}var Vn={scheme:"mailto",parse:function(Q,se){var ye=Q,me=ye.to=ye.path?ye.path.split(","):[];if(ye.path=void 0,ye.query){for(var nt=!1,tt={},Mt=ye.query.split("&"),sn=0,hn=Mt.length;sn<hn;++sn){var at=Mt[sn].split("=");switch(at[0]){case"to":for(var ln=at[1].split(","),jn=0,lt=ln.length;jn<lt;++jn)me.push(ln[jn]);break;case"subject":ye.subject=qe(at[1],se);break;case"body":ye.body=qe(at[1],se);break;default:nt=!0,tt[qe(at[0],se)]=qe(at[1],se);break}}nt&&(ye.headers=tt)}ye.query=void 0;for(var an=0,Hn=me.length;an<Hn;++an){var yn=me[an].split("@");if(yn[0]=qe(yn[0]),se.unicodeSupport)yn[1]=qe(yn[1],se).toLowerCase();else try{yn[1]=V.toASCII(qe(yn[1],se).toLowerCase())}catch(zi){ye.error=ye.error||"Email address's domain name can not be converted to ASCII via punycode: "+zi}me[an]=yn.join("@")}return ye},serialize:function(Q,se){var ye=Q,me=l(Q.to);if(me){for(var nt=0,tt=me.length;nt<tt;++nt){var Mt=String(me[nt]),sn=Mt.lastIndexOf("@"),hn=Mt.slice(0,sn).replace(ft,$i).replace(ft,a).replace(Ln,K),at=Mt.slice(sn+1);try{at=se.iri?V.toUnicode(at):V.toASCII(qe(at,se).toLowerCase())}catch(an){ye.error=ye.error||"Email address's domain name can not be converted to "+(se.iri?"Unicode":"ASCII")+" via punycode: "+an}me[nt]=hn+"@"+at}ye.path=me.join(",")}var ln=Q.headers=Q.headers||{};Q.subject&&(ln.subject=Q.subject),Q.body&&(ln.body=Q.body);var jn=[];for(var lt in ln)ln[lt]!==Xt[lt]&&jn.push(lt.replace(ft,$i).replace(ft,a).replace($n,K)+"="+ln[lt].replace(ft,$i).replace(ft,a).replace(xr,K));return jn.length&&(ye.query=jn.join("&")),ye}},zn=/^([^\:]+)\:(.*)/,Rn={scheme:"urn",parse:function(Q,se){var ye=Q.path&&Q.path.match(zn),me=Q;if(ye){var nt=se.scheme||me.scheme||"urn",tt=ye[1].toLowerCase(),Mt=ye[2],sn=nt+":"+(se.nid||tt),hn=U[sn];me.nid=tt,me.nss=Mt,me.path=void 0,hn&&(me=hn.parse(me,se))}else me.error=me.error||"URN can not be parsed.";return me},serialize:function(Q,se){var ye=se.scheme||Q.scheme||"urn",me=Q.nid,nt=ye+":"+(se.nid||me),tt=U[nt];tt&&(Q=tt.serialize(Q,se));var Mt=Q,sn=Q.nss;return Mt.path=(me||se.nid)+":"+sn,Mt}},fn=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,er={scheme:"urn:uuid",parse:function(Q,se){var ye=Q;return ye.uuid=ye.nss,ye.nss=void 0,!se.tolerant&&(!ye.uuid||!ye.uuid.match(fn))&&(ye.error=ye.error||"UUID is not valid."),ye},serialize:function(Q,se){var ye=Q;return ye.nss=(Q.uuid||"").toLowerCase(),ye}};U[At.scheme]=At,U[Jn.scheme]=Jn,U[Pe.scheme]=Pe,U[bt.scheme]=bt,U[Vn.scheme]=Vn,U[Rn.scheme]=Rn,U[er.scheme]=er,n.SCHEMES=U,n.pctEncChar=K,n.pctDecChars=ae,n.parse=Oe,n.removeDotSegments=De,n.serialize=et,n.resolveComponents=ot,n.resolve=lr,n.normalize=xe,n.equal=Te,n.escapeComponent=st,n.unescapeComponent=qe,Object.defineProperty(n,"__esModule",{value:!0})})}(qp,qp.exports)),qp.exports}var lE,gL;function WN(){return gL||(gL=1,lE=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,s,i;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(s=r;s--!==0;)if(!t(e[s],n[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(i=Object.keys(e),r=i.length,r!==Object.keys(n).length)return!1;for(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[s]))return!1;for(s=r;s--!==0;){var a=i[s];if(!t(e[a],n[a]))return!1}return!0}return e!==e&&n!==n}),lE}var cE,vL;function ehe(){return vL||(vL=1,cE=function(e){for(var n=0,r=e.length,s=0,i;s<r;)n++,i=e.charCodeAt(s++),i>=55296&&i<=56319&&s<r&&(i=e.charCodeAt(s),(i&64512)==56320&&s++);return n}),cE}var uE,yL;function nh(){if(yL)return uE;yL=1,uE={copy:t,checkDataType:e,checkDataTypes:n,coerceToTypes:s,toHash:i,getProperty:u,escapeQuotes:d,equal:WN(),ucs2length:ehe(),varOccurences:p,varReplace:h,schemaHasRules:g,schemaHasRulesExcept:v,schemaUnknownRules:b,toQuotedString:x,getPathExpr:E,getPath:S,getData:R,unescapeFragment:A,unescapeJsonPointer:I,escapeFragment:N,escapeJsonPointer:M};function t(O,L){L=L||{};for(var z in O)L[z]=O[z];return L}function e(O,L,z,G){var W=G?" !== ":" === ",X=G?" || ":" && ",F=G?"!":"",Y=G?"":"!";switch(O){case"null":return L+W+"null";case"array":return F+"Array.isArray("+L+")";case"object":return"("+F+L+X+"typeof "+L+W+'"object"'+X+Y+"Array.isArray("+L+"))";case"integer":return"(typeof "+L+W+'"number"'+X+Y+"("+L+" % 1)"+X+L+W+L+(z?X+F+"isFinite("+L+")":"")+")";case"number":return"(typeof "+L+W+'"'+O+'"'+(z?X+F+"isFinite("+L+")":"")+")";default:return"typeof "+L+W+'"'+O+'"'}}function n(O,L,z){switch(O.length){case 1:return e(O[0],L,z,!0);default:var G="",W=i(O);W.array&&W.object&&(G=W.null?"(":"(!"+L+" || ",G+="typeof "+L+' !== "object")',delete W.null,delete W.array,delete W.object),W.number&&delete W.integer;for(var X in W)G+=(G?" && ":"")+e(X,L,z,!0);return G}}var r=i(["string","number","integer","boolean","null"]);function s(O,L){if(Array.isArray(L)){for(var z=[],G=0;G<L.length;G++){var W=L[G];(r[W]||O==="array"&&W==="array")&&(z[z.length]=W)}if(z.length)return z}else{if(r[L])return[L];if(O==="array"&&L==="array")return["array"]}}function i(O){for(var L={},z=0;z<O.length;z++)L[O[z]]=!0;return L}var a=/^[a-z$_][a-z$_0-9]*$/i,l=/'|\\/g;function u(O){return typeof O=="number"?"["+O+"]":a.test(O)?"."+O:"['"+d(O)+"']"}function d(O){return O.replace(l,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function p(O,L){L+="[^0-9]";var z=O.match(new RegExp(L,"g"));return z?z.length:0}function h(O,L,z){return L+="([^0-9])",z=z.replace(/\$/g,"$$$$"),O.replace(new RegExp(L,"g"),z+"$1")}function g(O,L){if(typeof O=="boolean")return!O;for(var z in O)if(L[z])return!0}function v(O,L,z){if(typeof O=="boolean")return!O&&z!="not";for(var G in O)if(G!=z&&L[G])return!0}function b(O,L){if(typeof O!="boolean"){for(var z in O)if(!L[z])return z}}function x(O){return"'"+d(O)+"'"}function E(O,L,z,G){var W=z?"'/' + "+L+(G?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):G?"'[' + "+L+" + ']'":"'[\\'' + "+L+" + '\\']'";return j(O,W)}function S(O,L,z){var G=x(z?"/"+M(L):u(L));return j(O,G)}var k=/^\/(?:[^~]|~0|~1)*$/,T=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function R(O,L,z){var G,W,X,F;if(O==="")return"rootData";if(O[0]=="/"){if(!k.test(O))throw new Error("Invalid JSON-pointer: "+O);W=O,X="rootData"}else{if(F=O.match(T),!F)throw new Error("Invalid JSON-pointer: "+O);if(G=+F[1],W=F[2],W=="#"){if(G>=L)throw new Error("Cannot access property/index "+G+" levels up, current level is "+L);return z[L-G]}if(G>L)throw new Error("Cannot access data "+G+" levels up, current level is "+L);if(X="data"+(L-G||""),!W)return X}for(var Y=X,H=W.split("/"),te=0;te<H.length;te++){var P=H[te];P&&(X+=u(I(P)),Y+=" && "+X)}return Y}function j(O,L){return O=='""'?L:(O+" + "+L).replace(/([^\\])' \+ '/g,"$1")}function A(O){return I(decodeURIComponent(O))}function N(O){return encodeURIComponent(M(O))}function M(O){return O.replace(/~/g,"~0").replace(/\//g,"~1")}function I(O){return O.replace(/~1/g,"/").replace(/~0/g,"~")}return uE}var dE,bL;function Jq(){if(bL)return dE;bL=1;var t=nh();dE=e;function e(n){t.copy(n,this)}return dE}var fE={exports:{}},xL;function the(){if(xL)return fE.exports;xL=1;var t=fE.exports=function(r,s,i){typeof s=="function"&&(i=s,s={}),i=s.cb||i;var a=typeof i=="function"?i:i.pre||function(){},l=i.post||function(){};e(s,a,l,r,"",r)};t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0},t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},t.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},t.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function e(r,s,i,a,l,u,d,p,h,g){if(a&&typeof a=="object"&&!Array.isArray(a)){s(a,l,u,d,p,h,g);for(var v in a){var b=a[v];if(Array.isArray(b)){if(v in t.arrayKeywords)for(var x=0;x<b.length;x++)e(r,s,i,b[x],l+"/"+v+"/"+x,u,l,v,a,x)}else if(v in t.propsKeywords){if(b&&typeof b=="object")for(var E in b)e(r,s,i,b[E],l+"/"+v+"/"+n(E),u,l,v,a,E)}else(v in t.keywords||r.allKeys&&!(v in t.skipKeywords))&&e(r,s,i,b,l+"/"+v,u,l,v,a)}i(a,l,u,d,p,h,g)}}function n(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}return fE.exports}var hE,_L;function YN(){if(_L)return hE;_L=1;var t=Zfe(),e=WN(),n=nh(),r=Jq(),s=the();hE=i,i.normalizeId=S,i.fullPath=b,i.url=k,i.ids=T,i.inlineRef=h,i.schema=a;function i(R,j,A){var N=this._refs[A];if(typeof N=="string")if(this._refs[N])N=this._refs[N];else return i.call(this,R,j,N);if(N=N||this._schemas[A],N instanceof r)return h(N.schema,this._opts.inlineRefs)?N.schema:N.validate||this._compile(N);var M=a.call(this,j,A),I,O,L;return M&&(I=M.schema,j=M.root,L=M.baseId),I instanceof r?O=I.validate||R.call(this,I.schema,j,void 0,L):I!==void 0&&(O=h(I,this._opts.inlineRefs)?I:R.call(this,I,j,void 0,L)),O}function a(R,j){var A=t.parse(j),N=x(A),M=b(this._getId(R.schema));if(Object.keys(R.schema).length===0||N!==M){var I=S(N),O=this._refs[I];if(typeof O=="string")return l.call(this,R,O,A);if(O instanceof r)O.validate||this._compile(O),R=O;else if(O=this._schemas[I],O instanceof r){if(O.validate||this._compile(O),I==S(j))return{schema:O,root:R,baseId:M};R=O}else return;if(!R.schema)return;M=b(this._getId(R.schema))}return d.call(this,A,M,R.schema,R)}function l(R,j,A){var N=a.call(this,R,j);if(N){var M=N.schema,I=N.baseId;R=N.root;var O=this._getId(M);return O&&(I=k(I,O)),d.call(this,A,I,M,R)}}var u=n.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function d(R,j,A,N){if(R.fragment=R.fragment||"",R.fragment.slice(0,1)=="/"){for(var M=R.fragment.split("/"),I=1;I<M.length;I++){var O=M[I];if(O){if(O=n.unescapeFragment(O),A=A[O],A===void 0)break;var L;if(!u[O]&&(L=this._getId(A),L&&(j=k(j,L)),A.$ref)){var z=k(j,A.$ref),G=a.call(this,N,z);G&&(A=G.schema,N=G.root,j=G.baseId)}}}if(A!==void 0&&A!==N.schema)return{schema:A,root:N,baseId:j}}}var p=n.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function h(R,j){if(j===!1)return!1;if(j===void 0||j===!0)return g(R);if(j)return v(R)<=j}function g(R){var j;if(Array.isArray(R)){for(var A=0;A<R.length;A++)if(j=R[A],typeof j=="object"&&!g(j))return!1}else for(var N in R)if(N=="$ref"||(j=R[N],typeof j=="object"&&!g(j)))return!1;return!0}function v(R){var j=0,A;if(Array.isArray(R)){for(var N=0;N<R.length;N++)if(A=R[N],typeof A=="object"&&(j+=v(A)),j==1/0)return 1/0}else for(var M in R){if(M=="$ref")return 1/0;if(p[M])j++;else if(A=R[M],typeof A=="object"&&(j+=v(A)+1),j==1/0)return 1/0}return j}function b(R,j){j!==!1&&(R=S(R));var A=t.parse(R);return x(A)}function x(R){return t.serialize(R).split("#")[0]+"#"}var E=/#\/?$/;function S(R){return R?R.replace(E,""):""}function k(R,j){return j=S(j),t.resolve(R,j)}function T(R){var j=S(this._getId(R)),A={"":j},N={"":b(j,!1)},M={},I=this;return s(R,{allKeys:!0},function(O,L,z,G,W,X,F){if(L!==""){var Y=I._getId(O),H=A[G],te=N[G]+"/"+W;if(F!==void 0&&(te+="/"+(typeof F=="number"?F:n.escapeFragment(F))),typeof Y=="string"){Y=H=S(H?t.resolve(H,Y):Y);var P=I._refs[Y];if(typeof P=="string"&&(P=I._refs[P]),P&&P.schema){if(!e(O,P.schema))throw new Error('id "'+Y+'" resolves to more than one schema')}else if(Y!=S(te))if(Y[0]=="#"){if(M[Y]&&!e(O,M[Y]))throw new Error('id "'+Y+'" resolves to more than one schema');M[Y]=O}else I._refs[Y]=te}A[L]=H,N[L]=te}}),M}return hE}var pE,wL;function KN(){if(wL)return pE;wL=1;var t=YN();pE={Validation:r(e),MissingRef:r(n)};function e(s){this.message="validation failed",this.errors=s,this.ajv=this.validation=!0}n.message=function(s,i){return"can't resolve reference "+i+" from id "+s};function n(s,i,a){this.message=a||n.message(s,i),this.missingRef=t.url(s,i),this.missingSchema=t.normalizeId(t.fullPath(this.missingRef))}function r(s){return s.prototype=Object.create(Error.prototype),s.prototype.constructor=s,s}return pE}var mE,SL;function Zq(){return SL||(SL=1,mE=function(t,e){e||(e={}),typeof e=="function"&&(e={cmp:e});var n=typeof e.cycles=="boolean"?e.cycles:!1,r=e.cmp&&function(i){return function(a){return function(l,u){var d={key:l,value:a[l]},p={key:u,value:a[u]};return i(d,p)}}}(e.cmp),s=[];return function i(a){if(a&&a.toJSON&&typeof a.toJSON=="function"&&(a=a.toJSON()),a!==void 0){if(typeof a=="number")return isFinite(a)?""+a:"null";if(typeof a!="object")return JSON.stringify(a);var l,u;if(Array.isArray(a)){for(u="[",l=0;l<a.length;l++)l&&(u+=","),u+=i(a[l])||"null";return u+"]"}if(a===null)return"null";if(s.indexOf(a)!==-1){if(n)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var d=s.push(a)-1,p=Object.keys(a).sort(r&&r(a));for(u="",l=0;l<p.length;l++){var h=p[l],g=i(a[h]);g&&(u&&(u+=","),u+=JSON.stringify(h)+":"+g)}return s.splice(d,1),"{"+u+"}"}}(t)}),mE}var gE,EL;function eV(){return EL||(EL=1,gE=function(e,n,r){var s="",i=e.schema.$async===!0,a=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),l=e.self._getId(e.schema);if(e.opts.strictKeywords){var u=e.util.schemaUnknownRules(e.schema,e.RULES.keywords);if(u){var d="unknown keyword: "+u;if(e.opts.strictKeywords==="log")e.logger.warn(d);else throw new Error(d)}}if(e.isTop&&(s+=" var validate = ",i&&(e.async=!0,s+="async "),s+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",l&&(e.opts.sourceCode||e.opts.processCode)&&(s+=" "+("/*# sourceURL="+l+" */")+" ")),typeof e.schema=="boolean"||!(a||e.schema.$ref)){var n="false schema",p=e.level,h=e.dataLevel,g=e.schema[n],v=e.schemaPath+e.util.getProperty(n),b=e.errSchemaPath+"/"+n,j=!e.opts.allErrors,M,x="data"+(h||""),R="valid"+p;if(e.schema===!1){e.isTop?j=!0:s+=" var "+R+" = false; ";var E=E||[];E.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+(M||"false schema")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(b)+" , params: {} ",e.opts.messages!==!1&&(s+=" , message: 'boolean schema is false' "),e.opts.verbose&&(s+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+x+" "),s+=" } "):s+=" {} ";var S=s;s=E.pop(),!e.compositeRule&&j?e.async?s+=" throw new ValidationError(["+S+"]); ":s+=" validate.errors = ["+S+"]; return false; ":s+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else e.isTop?i?s+=" return data; ":s+=" validate.errors = null; return true; ":s+=" var "+R+" = true; ";return e.isTop&&(s+=" }; return validate; "),s}if(e.isTop){var k=e.isTop,p=e.level=0,h=e.dataLevel=0,x="data";if(e.rootId=e.resolve.fullPath(e.self._getId(e.root.schema)),e.baseId=e.baseId||e.rootId,delete e.isTop,e.dataPathArr=[""],e.schema.default!==void 0&&e.opts.useDefaults&&e.opts.strictDefaults){var T="default is ignored in the schema root";if(e.opts.strictDefaults==="log")e.logger.warn(T);else throw new Error(T)}s+=" var vErrors = null; ",s+=" var errors = 0; ",s+=" if (rootData === undefined) rootData = data; "}else{var p=e.level,h=e.dataLevel,x="data"+(h||"");if(l&&(e.baseId=e.resolve.url(e.baseId,l)),i&&!e.async)throw new Error("async schema in sync schema");s+=" var errs_"+p+" = errors;"}var R="valid"+p,j=!e.opts.allErrors,A="",N="",M,I=e.schema.type,O=Array.isArray(I);if(I&&e.opts.nullable&&e.schema.nullable===!0&&(O?I.indexOf("null")==-1&&(I=I.concat("null")):I!="null"&&(I=[I,"null"],O=!0)),O&&I.length==1&&(I=I[0],O=!1),e.schema.$ref&&a){if(e.opts.extendRefs=="fail")throw new Error('$ref: validation keywords used in schema at path "'+e.errSchemaPath+'" (see option extendRefs)');e.opts.extendRefs!==!0&&(a=!1,e.logger.warn('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"'))}if(e.schema.$comment&&e.opts.$comment&&(s+=" "+e.RULES.all.$comment.code(e,"$comment")),I){if(e.opts.coerceTypes)var L=e.util.coerceToTypes(e.opts.coerceTypes,I);var z=e.RULES.types[I];if(L||O||z===!0||z&&!dt(z)){var v=e.schemaPath+".type",b=e.errSchemaPath+"/type",v=e.schemaPath+".type",b=e.errSchemaPath+"/type",G=O?"checkDataTypes":"checkDataType";if(s+=" if ("+e.util[G](I,x,e.opts.strictNumbers,!0)+") { ",L){var W="dataType"+p,X="coerced"+p;s+=" var "+W+" = typeof "+x+"; var "+X+" = undefined; ",e.opts.coerceTypes=="array"&&(s+=" if ("+W+" == 'object' && Array.isArray("+x+") && "+x+".length == 1) { "+x+" = "+x+"[0]; "+W+" = typeof "+x+"; if ("+e.util.checkDataType(e.schema.type,x,e.opts.strictNumbers)+") "+X+" = "+x+"; } "),s+=" if ("+X+" !== undefined) ; ";var F=L;if(F)for(var Y,H=-1,te=F.length-1;H<te;)Y=F[H+=1],Y=="string"?s+=" else if ("+W+" == 'number' || "+W+" == 'boolean') "+X+" = '' + "+x+"; else if ("+x+" === null) "+X+" = ''; ":Y=="number"||Y=="integer"?(s+=" else if ("+W+" == 'boolean' || "+x+" === null || ("+W+" == 'string' && "+x+" && "+x+" == +"+x+" ",Y=="integer"&&(s+=" && !("+x+" % 1)"),s+=")) "+X+" = +"+x+"; "):Y=="boolean"?s+=" else if ("+x+" === 'false' || "+x+" === 0 || "+x+" === null) "+X+" = false; else if ("+x+" === 'true' || "+x+" === 1) "+X+" = true; ":Y=="null"?s+=" else if ("+x+" === '' || "+x+" === 0 || "+x+" === false) "+X+" = null; ":e.opts.coerceTypes=="array"&&Y=="array"&&(s+=" else if ("+W+" == 'string' || "+W+" == 'number' || "+W+" == 'boolean' || "+x+" == null) "+X+" = ["+x+"]; ");s+=" else { ";var E=E||[];E.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+(M||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(b)+" , params: { type: '",O?s+=""+I.join(","):s+=""+I,s+="' } ",e.opts.messages!==!1&&(s+=" , message: 'should be ",O?s+=""+I.join(","):s+=""+I,s+="' "),e.opts.verbose&&(s+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+x+" "),s+=" } "):s+=" {} ";var S=s;s=E.pop(),!e.compositeRule&&j?e.async?s+=" throw new ValidationError(["+S+"]); ":s+=" validate.errors = ["+S+"]; return false; ":s+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } if ("+X+" !== undefined) { ";var P=h?"data"+(h-1||""):"parentData",re=h?e.dataPathArr[h]:"parentDataProperty";s+=" "+x+" = "+X+"; ",h||(s+="if ("+P+" !== undefined)"),s+=" "+P+"["+re+"] = "+X+"; } "}else{var E=E||[];E.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+(M||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(b)+" , params: { type: '",O?s+=""+I.join(","):s+=""+I,s+="' } ",e.opts.messages!==!1&&(s+=" , message: 'should be ",O?s+=""+I.join(","):s+=""+I,s+="' "),e.opts.verbose&&(s+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+x+" "),s+=" } "):s+=" {} ";var S=s;s=E.pop(),!e.compositeRule&&j?e.async?s+=" throw new ValidationError(["+S+"]); ":s+=" validate.errors = ["+S+"]; return false; ":s+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}s+=" } "}}if(e.schema.$ref&&!a)s+=" "+e.RULES.all.$ref.code(e,"$ref")+" ",j&&(s+=" } if (errors === ",k?s+="0":s+="errs_"+p,s+=") { ",N+="}");else{var ue=e.RULES;if(ue){for(var z,D=-1,Z=ue.length-1;D<Z;)if(z=ue[D+=1],dt(z)){if(z.type&&(s+=" if ("+e.util.checkDataType(z.type,x,e.opts.strictNumbers)+") { "),e.opts.useDefaults){if(z.type=="object"&&e.schema.properties){var g=e.schema.properties,he=Object.keys(g),V=he;if(V)for(var U,K=-1,ae=V.length-1;K<ae;){U=V[K+=1];var B=g[U];if(B.default!==void 0){var J=x+e.util.getProperty(U);if(e.compositeRule){if(e.opts.strictDefaults){var T="default is ignored for: "+J;if(e.opts.strictDefaults==="log")e.logger.warn(T);else throw new Error(T)}}else s+=" if ("+J+" === undefined ",e.opts.useDefaults=="empty"&&(s+=" || "+J+" === null || "+J+" === '' "),s+=" ) "+J+" = ",e.opts.useDefaults=="shared"?s+=" "+e.useDefault(B.default)+" ":s+=" "+JSON.stringify(B.default)+" ",s+="; "}}}else if(z.type=="array"&&Array.isArray(e.schema.items)){var oe=e.schema.items;if(oe){for(var B,H=-1,fe=oe.length-1;H<fe;)if(B=oe[H+=1],B.default!==void 0){var J=x+"["+H+"]";if(e.compositeRule){if(e.opts.strictDefaults){var T="default is ignored for: "+J;if(e.opts.strictDefaults==="log")e.logger.warn(T);else throw new Error(T)}}else s+=" if ("+J+" === undefined ",e.opts.useDefaults=="empty"&&(s+=" || "+J+" === null || "+J+" === '' "),s+=" ) "+J+" = ",e.opts.useDefaults=="shared"?s+=" "+e.useDefault(B.default)+" ":s+=" "+JSON.stringify(B.default)+" ",s+="; "}}}}var be=z.rules;if(be){for(var Ae,Oe=-1,Ne=be.length-1;Oe<Ne;)if(Ae=be[Oe+=1],Be(Ae)){var Qe=Ae.code(e,Ae.keyword,z.type);Qe&&(s+=" "+Qe+" ",j&&(A+="}"))}}if(j&&(s+=" "+A+" ",A=""),z.type&&(s+=" } ",I&&I===z.type&&!L)){s+=" else { ";var v=e.schemaPath+".type",b=e.errSchemaPath+"/type",E=E||[];E.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+(M||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(b)+" , params: { type: '",O?s+=""+I.join(","):s+=""+I,s+="' } ",e.opts.messages!==!1&&(s+=" , message: 'should be ",O?s+=""+I.join(","):s+=""+I,s+="' "),e.opts.verbose&&(s+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+x+" "),s+=" } "):s+=" {} ";var S=s;s=E.pop(),!e.compositeRule&&j?e.async?s+=" throw new ValidationError(["+S+"]); ":s+=" validate.errors = ["+S+"]; return false; ":s+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } "}j&&(s+=" if (errors === ",k?s+="0":s+="errs_"+p,s+=") { ",N+="}")}}}j&&(s+=" "+N+" "),k?(i?(s+=" if (errors === 0) return data; ",s+=" else throw new ValidationError(vErrors); "):(s+=" validate.errors = vErrors; ",s+=" return errors === 0; "),s+=" }; return validate;"):s+=" var "+R+" = errors === errs_"+p+";";function dt(De){for(var et=De.rules,ot=0;ot<et.length;ot++)if(Be(et[ot]))return!0}function Be(De){return e.schema[De.keyword]!==void 0||De.implements&&pt(De)}function pt(De){for(var et=De.implements,ot=0;ot<et.length;ot++)if(e.schema[et[ot]]!==void 0)return!0}return s}),gE}var vE,kL;function nhe(){if(kL)return vE;kL=1;var t=YN(),e=nh(),n=KN(),r=Zq(),s=eV(),i=e.ucs2length,a=WN(),l=n.Validation;vE=u;function u(S,k,T,R){var j=this,A=this._opts,N=[void 0],M={},I=[],O={},L=[],z={},G=[];k=k||{schema:S,refVal:N,refs:M};var W=d.call(this,S,k,R),X=this._compilations[W.index];if(W.compiling)return X.callValidate=P;var F=this._formats,Y=this.RULES;try{var H=re(S,k,T,R);X.validate=H;var te=X.callValidate;return te&&(te.schema=H.schema,te.errors=null,te.refs=H.refs,te.refVal=H.refVal,te.root=H.root,te.$async=H.$async,A.sourceCode&&(te.source=H.source)),H}finally{p.call(this,S,k,R)}function P(){var B=X.validate,J=B.apply(this,arguments);return P.errors=B.errors,J}function re(B,J,oe,fe){var be=!J||J&&J.schema==B;if(J.schema!=k.schema)return u.call(j,B,J,oe,fe);var Ae=B.$async===!0,Oe=s({isTop:!0,schema:B,isRoot:be,baseId:fe,root:J,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:n.MissingRef,RULES:Y,validate:s,util:e,resolve:t,resolveRef:ue,usePattern:U,useDefault:K,useCustomRule:ae,opts:A,formats:F,logger:j.logger,self:j});Oe=E(N,b)+E(I,g)+E(L,v)+E(G,x)+Oe,A.processCode&&(Oe=A.processCode(Oe,B));var Ne;try{var Qe=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",Oe);Ne=Qe(j,Y,F,k,N,L,G,a,i,l),N[0]=Ne}catch(dt){throw j.logger.error("Error compiling schema, function code:",Oe),dt}return Ne.schema=B,Ne.errors=null,Ne.refs=M,Ne.refVal=N,Ne.root=be?Ne:J,Ae&&(Ne.$async=!0),A.sourceCode===!0&&(Ne.source={code:Oe,patterns:I,defaults:L}),Ne}function ue(B,J,oe){J=t.url(B,J);var fe=M[J],be,Ae;if(fe!==void 0)return be=N[fe],Ae="refVal["+fe+"]",V(be,Ae);if(!oe&&k.refs){var Oe=k.refs[J];if(Oe!==void 0)return be=k.refVal[Oe],Ae=D(J,be),V(be,Ae)}Ae=D(J);var Ne=t.call(j,re,k,J);if(Ne===void 0){var Qe=T&&T[J];Qe&&(Ne=t.inlineRef(Qe,A.inlineRefs)?Qe:u.call(j,Qe,k,T,B))}if(Ne===void 0)Z(J);else return he(J,Ne),V(Ne,Ae)}function D(B,J){var oe=N.length;return N[oe]=J,M[B]=oe,"refVal"+oe}function Z(B){delete M[B]}function he(B,J){var oe=M[B];N[oe]=J}function V(B,J){return typeof B=="object"||typeof B=="boolean"?{code:J,schema:B,inline:!0}:{code:J,$async:B&&!!B.$async}}function U(B){var J=O[B];return J===void 0&&(J=O[B]=I.length,I[J]=B),"pattern"+J}function K(B){switch(typeof B){case"boolean":case"number":return""+B;case"string":return e.toQuotedString(B);case"object":if(B===null)return"null";var J=r(B),oe=z[J];return oe===void 0&&(oe=z[J]=L.length,L[oe]=B),"default"+oe}}function ae(B,J,oe,fe){if(j._opts.validateSchema!==!1){var be=B.definition.dependencies;if(be&&!be.every(function(et){return Object.prototype.hasOwnProperty.call(oe,et)}))throw new Error("parent schema must have all required keywords: "+be.join(","));var Ae=B.definition.validateSchema;if(Ae){var Oe=Ae(J);if(!Oe){var Ne="keyword schema is invalid: "+j.errorsText(Ae.errors);if(j._opts.validateSchema=="log")j.logger.error(Ne);else throw new Error(Ne)}}}var Qe=B.definition.compile,dt=B.definition.inline,Be=B.definition.macro,pt;if(Qe)pt=Qe.call(j,J,oe,fe);else if(Be)pt=Be.call(j,J,oe,fe),A.validateSchema!==!1&&j.validateSchema(pt,!0);else if(dt)pt=dt.call(j,fe,B.keyword,J,oe);else if(pt=B.definition.validate,!pt)return;if(pt===void 0)throw new Error('custom keyword "'+B.keyword+'"failed to compile');var De=G.length;return G[De]=pt,{code:"customRule"+De,validate:pt}}}function d(S,k,T){var R=h.call(this,S,k,T);return R>=0?{index:R,compiling:!0}:(R=this._compilations.length,this._compilations[R]={schema:S,root:k,baseId:T},{index:R,compiling:!1})}function p(S,k,T){var R=h.call(this,S,k,T);R>=0&&this._compilations.splice(R,1)}function h(S,k,T){for(var R=0;R<this._compilations.length;R++){var j=this._compilations[R];if(j.schema==S&&j.root==k&&j.baseId==T)return R}return-1}function g(S,k){return"var pattern"+S+" = new RegExp("+e.toQuotedString(k[S])+");"}function v(S){return"var default"+S+" = defaults["+S+"];"}function b(S,k){return k[S]===void 0?"":"var refVal"+S+" = refVal["+S+"];"}function x(S){return"var customRule"+S+" = customRules["+S+"];"}function E(S,k){if(!S.length)return"";for(var T="",R=0;R<S.length;R++)T+=k(R,S);return T}return vE}var yE={exports:{}},TL;function rhe(){if(TL)return yE.exports;TL=1;var t=yE.exports=function(){this._cache={}};return t.prototype.put=function(n,r){this._cache[n]=r},t.prototype.get=function(n){return this._cache[n]},t.prototype.del=function(n){delete this._cache[n]},t.prototype.clear=function(){this._cache={}},yE.exports}var bE,CL;function she(){if(CL)return bE;CL=1;var t=nh(),e=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,n=[0,31,28,31,30,31,30,31,31,30,31,30,31],r=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,s=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,i=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,a=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,l=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,u=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,d=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,p=/^(?:\/(?:[^~/]|~0|~1)*)*$/,h=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,g=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;bE=v;function v(N){return N=N=="full"?"full":"fast",t.copy(v[N])}v.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":l,url:u,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:s,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:A,uuid:d,"json-pointer":p,"json-pointer-uri-fragment":h,"relative-json-pointer":g},v.full={date:x,time:E,"date-time":k,uri:R,"uri-reference":a,"uri-template":l,url:u,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:s,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:A,uuid:d,"json-pointer":p,"json-pointer-uri-fragment":h,"relative-json-pointer":g};function b(N){return N%4===0&&(N%100!==0||N%400===0)}function x(N){var M=N.match(e);if(!M)return!1;var I=+M[1],O=+M[2],L=+M[3];return O>=1&&O<=12&&L>=1&&L<=(O==2&&b(I)?29:n[O])}function E(N,M){var I=N.match(r);if(!I)return!1;var O=I[1],L=I[2],z=I[3],G=I[5];return(O<=23&&L<=59&&z<=59||O==23&&L==59&&z==60)&&(!M||G)}var S=/t|\s/i;function k(N){var M=N.split(S);return M.length==2&&x(M[0])&&E(M[1],!0)}var T=/\/|:/;function R(N){return T.test(N)&&i.test(N)}var j=/[^\\]\\Z/;function A(N){if(j.test(N))return!1;try{return new RegExp(N),!0}catch{return!1}}return bE}var xE,AL;function ihe(){return AL||(AL=1,xE=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.errSchemaPath+"/"+n,d=!e.opts.allErrors,p="data"+(a||""),h="valid"+i,g,v;if(l=="#"||l=="#/")e.isRoot?(g=e.async,v="validate"):(g=e.root.schema.$async===!0,v="root.refVal[0]");else{var b=e.resolveRef(e.baseId,l,e.isRoot);if(b===void 0){var x=e.MissingRefError.message(e.baseId,l);if(e.opts.missingRefs=="fail"){e.logger.error(x);var E=E||[];E.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { ref: '"+e.util.escapeQuotes(l)+"' } ",e.opts.messages!==!1&&(s+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(l)+"' "),e.opts.verbose&&(s+=" , schema: "+e.util.toQuotedString(l)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ";var S=s;s=E.pop(),!e.compositeRule&&d?e.async?s+=" throw new ValidationError(["+S+"]); ":s+=" validate.errors = ["+S+"]; return false; ":s+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",d&&(s+=" if (false) { ")}else if(e.opts.missingRefs=="ignore")e.logger.warn(x),d&&(s+=" if (true) { ");else throw new e.MissingRefError(e.baseId,l,x)}else if(b.inline){var k=e.util.copy(e);k.level++;var T="valid"+k.level;k.schema=b.schema,k.schemaPath="",k.errSchemaPath=l;var R=e.validate(k).replace(/validate\.schema/g,b.code);s+=" "+R+" ",d&&(s+=" if ("+T+") { ")}else g=b.$async===!0||e.async&&b.$async!==!1,v=b.code}if(v){var E=E||[];E.push(s),s="",e.opts.passContext?s+=" "+v+".call(this, ":s+=" "+v+"( ",s+=" "+p+", (dataPath || '')",e.errorPath!='""'&&(s+=" + "+e.errorPath);var j=a?"data"+(a-1||""):"parentData",A=a?e.dataPathArr[a]:"parentDataProperty";s+=" , "+j+" , "+A+", rootData) ";var N=s;if(s=E.pop(),g){if(!e.async)throw new Error("async schema referenced by sync schema");d&&(s+=" var "+h+"; "),s+=" try { await "+N+"; ",d&&(s+=" "+h+" = true; "),s+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",d&&(s+=" "+h+" = false; "),s+=" } ",d&&(s+=" if ("+h+") { ")}else s+=" if (!"+N+") { if (vErrors === null) vErrors = "+v+".errors; else vErrors = vErrors.concat("+v+".errors); errors = vErrors.length; } ",d&&(s+=" else { ")}return s}),xE}var _E,NL;function ahe(){return NL||(NL=1,_E=function(e,n,r){var s=" ",i=e.schema[n],a=e.schemaPath+e.util.getProperty(n),l=e.errSchemaPath+"/"+n,u=!e.opts.allErrors,d=e.util.copy(e),p="";d.level++;var h="valid"+d.level,g=d.baseId,v=!0,b=i;if(b)for(var x,E=-1,S=b.length-1;E<S;)x=b[E+=1],(e.opts.strictKeywords?typeof x=="object"&&Object.keys(x).length>0||x===!1:e.util.schemaHasRules(x,e.RULES.all))&&(v=!1,d.schema=x,d.schemaPath=a+"["+E+"]",d.errSchemaPath=l+"/"+E,s+=" "+e.validate(d)+" ",d.baseId=g,u&&(s+=" if ("+h+") { ",p+="}"));return u&&(v?s+=" if (true) { ":s+=" "+p.slice(0,-1)+" "),s}),_E}var wE,RL;function ohe(){return RL||(RL=1,wE=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,h="data"+(a||""),g="valid"+i,v="errs__"+i,b=e.util.copy(e),x="";b.level++;var E="valid"+b.level,S=l.every(function(M){return e.opts.strictKeywords?typeof M=="object"&&Object.keys(M).length>0||M===!1:e.util.schemaHasRules(M,e.RULES.all)});if(S){var k=b.baseId;s+=" var "+v+" = errors; var "+g+" = false; ";var T=e.compositeRule;e.compositeRule=b.compositeRule=!0;var R=l;if(R)for(var j,A=-1,N=R.length-1;A<N;)j=R[A+=1],b.schema=j,b.schemaPath=u+"["+A+"]",b.errSchemaPath=d+"/"+A,s+=" "+e.validate(b)+" ",b.baseId=k,s+=" "+g+" = "+g+" || "+E+"; if (!"+g+") { ",x+="}";e.compositeRule=b.compositeRule=T,s+=" "+x+" if (!"+g+") { var err = ",e.createErrors!==!1?(s+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: {} ",e.opts.messages!==!1&&(s+=" , message: 'should match some schema in anyOf' "),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ",s+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&p&&(e.async?s+=" throw new ValidationError(vErrors); ":s+=" validate.errors = vErrors; return false; "),s+=" } else { errors = "+v+"; if (vErrors !== null) { if ("+v+") vErrors.length = "+v+"; else vErrors = null; } ",e.opts.allErrors&&(s+=" } ")}else p&&(s+=" if (true) { ");return s}),wE}var SE,jL;function lhe(){return jL||(jL=1,SE=function(e,n,r){var s=" ",i=e.schema[n],a=e.errSchemaPath+"/"+n;e.opts.allErrors;var l=e.util.toQuotedString(i);return e.opts.$comment===!0?s+=" console.log("+l+");":typeof e.opts.$comment=="function"&&(s+=" self._opts.$comment("+l+", "+e.util.toQuotedString(a)+", validate.root.schema);"),s}),SE}var EE,ML;function che(){return ML||(ML=1,EE=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,h="data"+(a||""),g="valid"+i,v=e.opts.$data&&l&&l.$data;v&&(s+=" var schema"+i+" = "+e.util.getData(l.$data,a,e.dataPathArr)+"; "),v||(s+=" var schema"+i+" = validate.schema"+u+";"),s+="var "+g+" = equal("+h+", schema"+i+"); if (!"+g+") { ";var b=b||[];b.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'const' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { allowedValue: schema"+i+" } ",e.opts.messages!==!1&&(s+=" , message: 'should be equal to constant' "),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var x=s;return s=b.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+x+"]); ":s+=" validate.errors = ["+x+"]; return false; ":s+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" }",p&&(s+=" else { "),s}),EE}var kE,OL;function uhe(){return OL||(OL=1,kE=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,h="data"+(a||""),g="valid"+i,v="errs__"+i,b=e.util.copy(e),x="";b.level++;var E="valid"+b.level,S="i"+i,k=b.dataLevel=e.dataLevel+1,T="data"+k,R=e.baseId,j=e.opts.strictKeywords?typeof l=="object"&&Object.keys(l).length>0||l===!1:e.util.schemaHasRules(l,e.RULES.all);if(s+="var "+v+" = errors;var "+g+";",j){var A=e.compositeRule;e.compositeRule=b.compositeRule=!0,b.schema=l,b.schemaPath=u,b.errSchemaPath=d,s+=" var "+E+" = false; for (var "+S+" = 0; "+S+" < "+h+".length; "+S+"++) { ",b.errorPath=e.util.getPathExpr(e.errorPath,S,e.opts.jsonPointers,!0);var N=h+"["+S+"]";b.dataPathArr[k]=S;var M=e.validate(b);b.baseId=R,e.util.varOccurences(M,T)<2?s+=" "+e.util.varReplace(M,T,N)+" ":s+=" var "+T+" = "+N+"; "+M+" ",s+=" if ("+E+") break; } ",e.compositeRule=b.compositeRule=A,s+=" "+x+" if (!"+E+") {"}else s+=" if ("+h+".length == 0) {";var I=I||[];I.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: {} ",e.opts.messages!==!1&&(s+=" , message: 'should contain a valid item' "),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var O=s;return s=I.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+O+"]); ":s+=" validate.errors = ["+O+"]; return false; ":s+=" var err = "+O+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } else { ",j&&(s+=" errors = "+v+"; if (vErrors !== null) { if ("+v+") vErrors.length = "+v+"; else vErrors = null; } "),e.opts.allErrors&&(s+=" } "),s}),kE}var TE,PL;function dhe(){return PL||(PL=1,TE=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,h="data"+(a||""),g="errs__"+i,v=e.util.copy(e),b="";v.level++;var x="valid"+v.level,E={},S={},k=e.opts.ownProperties;for(A in l)if(A!="__proto__"){var T=l[A],R=Array.isArray(T)?S:E;R[A]=T}s+="var "+g+" = errors;";var j=e.errorPath;s+="var missing"+i+";";for(var A in S)if(R=S[A],R.length){if(s+=" if ( "+h+e.util.getProperty(A)+" !== undefined ",k&&(s+=" && Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(A)+"') "),p){s+=" && ( ";var N=R;if(N)for(var M,I=-1,O=N.length-1;I<O;){M=N[I+=1],I&&(s+=" || ");var L=e.util.getProperty(M),z=h+L;s+=" ( ( "+z+" === undefined ",k&&(s+=" || ! Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(M)+"') "),s+=") && (missing"+i+" = "+e.util.toQuotedString(e.opts.jsonPointers?M:L)+") ) "}s+=")) { ";var G="missing"+i,W="' + "+G+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(j,G,!0):j+" + "+G);var X=X||[];X.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { property: '"+e.util.escapeQuotes(A)+"', missingProperty: '"+W+"', depsCount: "+R.length+", deps: '"+e.util.escapeQuotes(R.length==1?R[0]:R.join(", "))+"' } ",e.opts.messages!==!1&&(s+=" , message: 'should have ",R.length==1?s+="property "+e.util.escapeQuotes(R[0]):s+="properties "+e.util.escapeQuotes(R.join(", ")),s+=" when property "+e.util.escapeQuotes(A)+" is present' "),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var F=s;s=X.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+F+"]); ":s+=" validate.errors = ["+F+"]; return false; ":s+=" var err = "+F+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{s+=" ) { ";var Y=R;if(Y)for(var M,H=-1,te=Y.length-1;H<te;){M=Y[H+=1];var L=e.util.getProperty(M),W=e.util.escapeQuotes(M),z=h+L;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(j,M,e.opts.jsonPointers)),s+=" if ( "+z+" === undefined ",k&&(s+=" || ! Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(M)+"') "),s+=") { var err = ",e.createErrors!==!1?(s+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { property: '"+e.util.escapeQuotes(A)+"', missingProperty: '"+W+"', depsCount: "+R.length+", deps: '"+e.util.escapeQuotes(R.length==1?R[0]:R.join(", "))+"' } ",e.opts.messages!==!1&&(s+=" , message: 'should have ",R.length==1?s+="property "+e.util.escapeQuotes(R[0]):s+="properties "+e.util.escapeQuotes(R.join(", ")),s+=" when property "+e.util.escapeQuotes(A)+" is present' "),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ",s+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}s+=" } ",p&&(b+="}",s+=" else { ")}e.errorPath=j;var P=v.baseId;for(var A in E){var T=E[A];(e.opts.strictKeywords?typeof T=="object"&&Object.keys(T).length>0||T===!1:e.util.schemaHasRules(T,e.RULES.all))&&(s+=" "+x+" = true; if ( "+h+e.util.getProperty(A)+" !== undefined ",k&&(s+=" && Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(A)+"') "),s+=") { ",v.schema=T,v.schemaPath=u+e.util.getProperty(A),v.errSchemaPath=d+"/"+e.util.escapeFragment(A),s+=" "+e.validate(v)+" ",v.baseId=P,s+=" } ",p&&(s+=" if ("+x+") { ",b+="}"))}return p&&(s+=" "+b+" if ("+g+" == errors) {"),s}),TE}var CE,IL;function fhe(){return IL||(IL=1,CE=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,h="data"+(a||""),g="valid"+i,v=e.opts.$data&&l&&l.$data;v&&(s+=" var schema"+i+" = "+e.util.getData(l.$data,a,e.dataPathArr)+"; ");var b="i"+i,x="schema"+i;v||(s+=" var "+x+" = validate.schema"+u+";"),s+="var "+g+";",v&&(s+=" if (schema"+i+" === undefined) "+g+" = true; else if (!Array.isArray(schema"+i+")) "+g+" = false; else {"),s+=""+g+" = false;for (var "+b+"=0; "+b+"<"+x+".length; "+b+"++) if (equal("+h+", "+x+"["+b+"])) { "+g+" = true; break; }",v&&(s+=" } "),s+=" if (!"+g+") { ";var E=E||[];E.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { allowedValues: schema"+i+" } ",e.opts.messages!==!1&&(s+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var S=s;return s=E.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+S+"]); ":s+=" validate.errors = ["+S+"]; return false; ":s+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" }",p&&(s+=" else { "),s}),CE}var AE,DL;function hhe(){return DL||(DL=1,AE=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,h="data"+(a||"");if(e.opts.format===!1)return p&&(s+=" if (true) { "),s;var g=e.opts.$data&&l&&l.$data,v;g?(s+=" var schema"+i+" = "+e.util.getData(l.$data,a,e.dataPathArr)+"; ",v="schema"+i):v=l;var b=e.opts.unknownFormats,x=Array.isArray(b);if(g){var E="format"+i,S="isObject"+i,k="formatType"+i;s+=" var "+E+" = formats["+v+"]; var "+S+" = typeof "+E+" == 'object' && !("+E+" instanceof RegExp) && "+E+".validate; var "+k+" = "+S+" && "+E+".type || 'string'; if ("+S+") { ",e.async&&(s+=" var async"+i+" = "+E+".async; "),s+=" "+E+" = "+E+".validate; } if ( ",g&&(s+=" ("+v+" !== undefined && typeof "+v+" != 'string') || "),s+=" (",b!="ignore"&&(s+=" ("+v+" && !"+E+" ",x&&(s+=" && self._opts.unknownFormats.indexOf("+v+") == -1 "),s+=") || "),s+=" ("+E+" && "+k+" == '"+r+"' && !(typeof "+E+" == 'function' ? ",e.async?s+=" (async"+i+" ? await "+E+"("+h+") : "+E+"("+h+")) ":s+=" "+E+"("+h+") ",s+=" : "+E+".test("+h+"))))) {"}else{var E=e.formats[l];if(!E){if(b=="ignore")return e.logger.warn('unknown format "'+l+'" ignored in schema at path "'+e.errSchemaPath+'"'),p&&(s+=" if (true) { "),s;if(x&&b.indexOf(l)>=0)return p&&(s+=" if (true) { "),s;throw new Error('unknown format "'+l+'" is used in schema at path "'+e.errSchemaPath+'"')}var S=typeof E=="object"&&!(E instanceof RegExp)&&E.validate,k=S&&E.type||"string";if(S){var T=E.async===!0;E=E.validate}if(k!=r)return p&&(s+=" if (true) { "),s;if(T){if(!e.async)throw new Error("async format in sync schema");var R="formats"+e.util.getProperty(l)+".validate";s+=" if (!(await "+R+"("+h+"))) { "}else{s+=" if (! ";var R="formats"+e.util.getProperty(l);S&&(R+=".validate"),typeof E=="function"?s+=" "+R+"("+h+") ":s+=" "+R+".test("+h+") ",s+=") { "}}var j=j||[];j.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { format: ",g?s+=""+v:s+=""+e.util.toQuotedString(l),s+=" } ",e.opts.messages!==!1&&(s+=` , message: 'should match format "`,g?s+="' + "+v+" + '":s+=""+e.util.escapeQuotes(l),s+=`"' `),e.opts.verbose&&(s+=" , schema: ",g?s+="validate.schema"+u:s+=""+e.util.toQuotedString(l),s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var A=s;return s=j.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+A+"]); ":s+=" validate.errors = ["+A+"]; return false; ":s+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",p&&(s+=" else { "),s}),AE}var NE,LL;function phe(){return LL||(LL=1,NE=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,h="data"+(a||""),g="valid"+i,v="errs__"+i,b=e.util.copy(e);b.level++;var x="valid"+b.level,E=e.schema.then,S=e.schema.else,k=E!==void 0&&(e.opts.strictKeywords?typeof E=="object"&&Object.keys(E).length>0||E===!1:e.util.schemaHasRules(E,e.RULES.all)),T=S!==void 0&&(e.opts.strictKeywords?typeof S=="object"&&Object.keys(S).length>0||S===!1:e.util.schemaHasRules(S,e.RULES.all)),R=b.baseId;if(k||T){var j;b.createErrors=!1,b.schema=l,b.schemaPath=u,b.errSchemaPath=d,s+=" var "+v+" = errors; var "+g+" = true; ";var A=e.compositeRule;e.compositeRule=b.compositeRule=!0,s+=" "+e.validate(b)+" ",b.baseId=R,b.createErrors=!0,s+=" errors = "+v+"; if (vErrors !== null) { if ("+v+") vErrors.length = "+v+"; else vErrors = null; } ",e.compositeRule=b.compositeRule=A,k?(s+=" if ("+x+") { ",b.schema=e.schema.then,b.schemaPath=e.schemaPath+".then",b.errSchemaPath=e.errSchemaPath+"/then",s+=" "+e.validate(b)+" ",b.baseId=R,s+=" "+g+" = "+x+"; ",k&&T?(j="ifClause"+i,s+=" var "+j+" = 'then'; "):j="'then'",s+=" } ",T&&(s+=" else { ")):s+=" if (!"+x+") { ",T&&(b.schema=e.schema.else,b.schemaPath=e.schemaPath+".else",b.errSchemaPath=e.errSchemaPath+"/else",s+=" "+e.validate(b)+" ",b.baseId=R,s+=" "+g+" = "+x+"; ",k&&T?(j="ifClause"+i,s+=" var "+j+" = 'else'; "):j="'else'",s+=" } "),s+=" if (!"+g+") { var err = ",e.createErrors!==!1?(s+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { failingKeyword: "+j+" } ",e.opts.messages!==!1&&(s+=` , message: 'should match "' + `+j+` + '" schema' `),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ",s+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&p&&(e.async?s+=" throw new ValidationError(vErrors); ":s+=" validate.errors = vErrors; return false; "),s+=" } ",p&&(s+=" else { ")}else p&&(s+=" if (true) { ");return s}),NE}var RE,$L;function mhe(){return $L||($L=1,RE=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,h="data"+(a||""),g="valid"+i,v="errs__"+i,b=e.util.copy(e),x="";b.level++;var E="valid"+b.level,S="i"+i,k=b.dataLevel=e.dataLevel+1,T="data"+k,R=e.baseId;if(s+="var "+v+" = errors;var "+g+";",Array.isArray(l)){var j=e.schema.additionalItems;if(j===!1){s+=" "+g+" = "+h+".length <= "+l.length+"; ";var A=d;d=e.errSchemaPath+"/additionalItems",s+=" if (!"+g+") { ";var N=N||[];N.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { limit: "+l.length+" } ",e.opts.messages!==!1&&(s+=" , message: 'should NOT have more than "+l.length+" items' "),e.opts.verbose&&(s+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var M=s;s=N.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+M+"]); ":s+=" validate.errors = ["+M+"]; return false; ":s+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",d=A,p&&(x+="}",s+=" else { ")}var I=l;if(I){for(var O,L=-1,z=I.length-1;L<z;)if(O=I[L+=1],e.opts.strictKeywords?typeof O=="object"&&Object.keys(O).length>0||O===!1:e.util.schemaHasRules(O,e.RULES.all)){s+=" "+E+" = true; if ("+h+".length > "+L+") { ";var G=h+"["+L+"]";b.schema=O,b.schemaPath=u+"["+L+"]",b.errSchemaPath=d+"/"+L,b.errorPath=e.util.getPathExpr(e.errorPath,L,e.opts.jsonPointers,!0),b.dataPathArr[k]=L;var W=e.validate(b);b.baseId=R,e.util.varOccurences(W,T)<2?s+=" "+e.util.varReplace(W,T,G)+" ":s+=" var "+T+" = "+G+"; "+W+" ",s+=" } ",p&&(s+=" if ("+E+") { ",x+="}")}}if(typeof j=="object"&&(e.opts.strictKeywords?typeof j=="object"&&Object.keys(j).length>0||j===!1:e.util.schemaHasRules(j,e.RULES.all))){b.schema=j,b.schemaPath=e.schemaPath+".additionalItems",b.errSchemaPath=e.errSchemaPath+"/additionalItems",s+=" "+E+" = true; if ("+h+".length > "+l.length+") { for (var "+S+" = "+l.length+"; "+S+" < "+h+".length; "+S+"++) { ",b.errorPath=e.util.getPathExpr(e.errorPath,S,e.opts.jsonPointers,!0);var G=h+"["+S+"]";b.dataPathArr[k]=S;var W=e.validate(b);b.baseId=R,e.util.varOccurences(W,T)<2?s+=" "+e.util.varReplace(W,T,G)+" ":s+=" var "+T+" = "+G+"; "+W+" ",p&&(s+=" if (!"+E+") break; "),s+=" } } ",p&&(s+=" if ("+E+") { ",x+="}")}}else if(e.opts.strictKeywords?typeof l=="object"&&Object.keys(l).length>0||l===!1:e.util.schemaHasRules(l,e.RULES.all)){b.schema=l,b.schemaPath=u,b.errSchemaPath=d,s+=" for (var "+S+" = 0; "+S+" < "+h+".length; "+S+"++) { ",b.errorPath=e.util.getPathExpr(e.errorPath,S,e.opts.jsonPointers,!0);var G=h+"["+S+"]";b.dataPathArr[k]=S;var W=e.validate(b);b.baseId=R,e.util.varOccurences(W,T)<2?s+=" "+e.util.varReplace(W,T,G)+" ":s+=" var "+T+" = "+G+"; "+W+" ",p&&(s+=" if (!"+E+") break; "),s+=" }"}return p&&(s+=" "+x+" if ("+v+" == errors) {"),s}),RE}var jE,zL;function FL(){return zL||(zL=1,jE=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,R,h="data"+(a||""),g=e.opts.$data&&l&&l.$data,v;g?(s+=" var schema"+i+" = "+e.util.getData(l.$data,a,e.dataPathArr)+"; ",v="schema"+i):v=l;var b=n=="maximum",x=b?"exclusiveMaximum":"exclusiveMinimum",E=e.schema[x],S=e.opts.$data&&E&&E.$data,k=b?"<":">",T=b?">":"<",R=void 0;if(!(g||typeof l=="number"||l===void 0))throw new Error(n+" must be number");if(!(S||E===void 0||typeof E=="number"||typeof E=="boolean"))throw new Error(x+" must be number or boolean");if(S){var j=e.util.getData(E.$data,a,e.dataPathArr),A="exclusive"+i,N="exclType"+i,M="exclIsNumber"+i,I="op"+i,O="' + "+I+" + '";s+=" var schemaExcl"+i+" = "+j+"; ",j="schemaExcl"+i,s+=" var "+A+"; var "+N+" = typeof "+j+"; if ("+N+" != 'boolean' && "+N+" != 'undefined' && "+N+" != 'number') { ";var R=x,L=L||[];L.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+(R||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: {} ",e.opts.messages!==!1&&(s+=" , message: '"+x+" should be boolean' "),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var z=s;s=L.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+z+"]); ":s+=" validate.errors = ["+z+"]; return false; ":s+=" var err = "+z+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } else if ( ",g&&(s+=" ("+v+" !== undefined && typeof "+v+" != 'number') || "),s+=" "+N+" == 'number' ? ( ("+A+" = "+v+" === undefined || "+j+" "+k+"= "+v+") ? "+h+" "+T+"= "+j+" : "+h+" "+T+" "+v+" ) : ( ("+A+" = "+j+" === true) ? "+h+" "+T+"= "+v+" : "+h+" "+T+" "+v+" ) || "+h+" !== "+h+") { var op"+i+" = "+A+" ? '"+k+"' : '"+k+"='; ",l===void 0&&(R=x,d=e.errSchemaPath+"/"+x,v=j,g=S)}else{var M=typeof E=="number",O=k;if(M&&g){var I="'"+O+"'";s+=" if ( ",g&&(s+=" ("+v+" !== undefined && typeof "+v+" != 'number') || "),s+=" ( "+v+" === undefined || "+E+" "+k+"= "+v+" ? "+h+" "+T+"= "+E+" : "+h+" "+T+" "+v+" ) || "+h+" !== "+h+") { "}else{M&&l===void 0?(A=!0,R=x,d=e.errSchemaPath+"/"+x,v=E,T+="="):(M&&(v=Math[b?"min":"max"](E,l)),E===(M?v:!0)?(A=!0,R=x,d=e.errSchemaPath+"/"+x,T+="="):(A=!1,O+="="));var I="'"+O+"'";s+=" if ( ",g&&(s+=" ("+v+" !== undefined && typeof "+v+" != 'number') || "),s+=" "+h+" "+T+" "+v+" || "+h+" !== "+h+") { "}}R=R||n;var L=L||[];L.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+(R||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { comparison: "+I+", limit: "+v+", exclusive: "+A+" } ",e.opts.messages!==!1&&(s+=" , message: 'should be "+O+" ",g?s+="' + "+v:s+=""+v+"'"),e.opts.verbose&&(s+=" , schema: ",g?s+="validate.schema"+u:s+=""+l,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var z=s;return s=L.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+z+"]); ":s+=" validate.errors = ["+z+"]; return false; ":s+=" var err = "+z+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",p&&(s+=" else { "),s}),jE}var ME,UL;function BL(){return UL||(UL=1,ME=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,x,h="data"+(a||""),g=e.opts.$data&&l&&l.$data,v;if(g?(s+=" var schema"+i+" = "+e.util.getData(l.$data,a,e.dataPathArr)+"; ",v="schema"+i):v=l,!(g||typeof l=="number"))throw new Error(n+" must be number");var b=n=="maxItems"?">":"<";s+="if ( ",g&&(s+=" ("+v+" !== undefined && typeof "+v+" != 'number') || "),s+=" "+h+".length "+b+" "+v+") { ";var x=n,E=E||[];E.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+(x||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { limit: "+v+" } ",e.opts.messages!==!1&&(s+=" , message: 'should NOT have ",n=="maxItems"?s+="more":s+="fewer",s+=" than ",g?s+="' + "+v+" + '":s+=""+l,s+=" items' "),e.opts.verbose&&(s+=" , schema: ",g?s+="validate.schema"+u:s+=""+l,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var S=s;return s=E.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+S+"]); ":s+=" validate.errors = ["+S+"]; return false; ":s+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",p&&(s+=" else { "),s}),ME}var OE,qL;function VL(){return qL||(qL=1,OE=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,x,h="data"+(a||""),g=e.opts.$data&&l&&l.$data,v;if(g?(s+=" var schema"+i+" = "+e.util.getData(l.$data,a,e.dataPathArr)+"; ",v="schema"+i):v=l,!(g||typeof l=="number"))throw new Error(n+" must be number");var b=n=="maxLength"?">":"<";s+="if ( ",g&&(s+=" ("+v+" !== undefined && typeof "+v+" != 'number') || "),e.opts.unicode===!1?s+=" "+h+".length ":s+=" ucs2length("+h+") ",s+=" "+b+" "+v+") { ";var x=n,E=E||[];E.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+(x||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { limit: "+v+" } ",e.opts.messages!==!1&&(s+=" , message: 'should NOT be ",n=="maxLength"?s+="longer":s+="shorter",s+=" than ",g?s+="' + "+v+" + '":s+=""+l,s+=" characters' "),e.opts.verbose&&(s+=" , schema: ",g?s+="validate.schema"+u:s+=""+l,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var S=s;return s=E.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+S+"]); ":s+=" validate.errors = ["+S+"]; return false; ":s+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",p&&(s+=" else { "),s}),OE}var PE,HL;function GL(){return HL||(HL=1,PE=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,x,h="data"+(a||""),g=e.opts.$data&&l&&l.$data,v;if(g?(s+=" var schema"+i+" = "+e.util.getData(l.$data,a,e.dataPathArr)+"; ",v="schema"+i):v=l,!(g||typeof l=="number"))throw new Error(n+" must be number");var b=n=="maxProperties"?">":"<";s+="if ( ",g&&(s+=" ("+v+" !== undefined && typeof "+v+" != 'number') || "),s+=" Object.keys("+h+").length "+b+" "+v+") { ";var x=n,E=E||[];E.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+(x||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { limit: "+v+" } ",e.opts.messages!==!1&&(s+=" , message: 'should NOT have ",n=="maxProperties"?s+="more":s+="fewer",s+=" than ",g?s+="' + "+v+" + '":s+=""+l,s+=" properties' "),e.opts.verbose&&(s+=" , schema: ",g?s+="validate.schema"+u:s+=""+l,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var S=s;return s=E.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+S+"]); ":s+=" validate.errors = ["+S+"]; return false; ":s+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",p&&(s+=" else { "),s}),PE}var IE,WL;function ghe(){return WL||(WL=1,IE=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,h="data"+(a||""),g=e.opts.$data&&l&&l.$data,v;if(g?(s+=" var schema"+i+" = "+e.util.getData(l.$data,a,e.dataPathArr)+"; ",v="schema"+i):v=l,!(g||typeof l=="number"))throw new Error(n+" must be number");s+="var division"+i+";if (",g&&(s+=" "+v+" !== undefined && ( typeof "+v+" != 'number' || "),s+=" (division"+i+" = "+h+" / "+v+", ",e.opts.multipleOfPrecision?s+=" Math.abs(Math.round(division"+i+") - division"+i+") > 1e-"+e.opts.multipleOfPrecision+" ":s+=" division"+i+" !== parseInt(division"+i+") ",s+=" ) ",g&&(s+=" ) "),s+=" ) { ";var b=b||[];b.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { multipleOf: "+v+" } ",e.opts.messages!==!1&&(s+=" , message: 'should be multiple of ",g?s+="' + "+v:s+=""+v+"'"),e.opts.verbose&&(s+=" , schema: ",g?s+="validate.schema"+u:s+=""+l,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var x=s;return s=b.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+x+"]); ":s+=" validate.errors = ["+x+"]; return false; ":s+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",p&&(s+=" else { "),s}),IE}var DE,YL;function vhe(){return YL||(YL=1,DE=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,h="data"+(a||""),g="errs__"+i,v=e.util.copy(e);v.level++;var b="valid"+v.level;if(e.opts.strictKeywords?typeof l=="object"&&Object.keys(l).length>0||l===!1:e.util.schemaHasRules(l,e.RULES.all)){v.schema=l,v.schemaPath=u,v.errSchemaPath=d,s+=" var "+g+" = errors; ";var x=e.compositeRule;e.compositeRule=v.compositeRule=!0,v.createErrors=!1;var E;v.opts.allErrors&&(E=v.opts.allErrors,v.opts.allErrors=!1),s+=" "+e.validate(v)+" ",v.createErrors=!0,E&&(v.opts.allErrors=E),e.compositeRule=v.compositeRule=x,s+=" if ("+b+") { ";var S=S||[];S.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: {} ",e.opts.messages!==!1&&(s+=" , message: 'should NOT be valid' "),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var k=s;s=S.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+k+"]); ":s+=" validate.errors = ["+k+"]; return false; ":s+=" var err = "+k+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } else { errors = "+g+"; if (vErrors !== null) { if ("+g+") vErrors.length = "+g+"; else vErrors = null; } ",e.opts.allErrors&&(s+=" } ")}else s+=" var err = ",e.createErrors!==!1?(s+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: {} ",e.opts.messages!==!1&&(s+=" , message: 'should NOT be valid' "),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ",s+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",p&&(s+=" if (false) { ");return s}),DE}var LE,KL;function yhe(){return KL||(KL=1,LE=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,h="data"+(a||""),g="valid"+i,v="errs__"+i,b=e.util.copy(e),x="";b.level++;var E="valid"+b.level,S=b.baseId,k="prevValid"+i,T="passingSchemas"+i;s+="var "+v+" = errors , "+k+" = false , "+g+" = false , "+T+" = null; ";var R=e.compositeRule;e.compositeRule=b.compositeRule=!0;var j=l;if(j)for(var A,N=-1,M=j.length-1;N<M;)A=j[N+=1],(e.opts.strictKeywords?typeof A=="object"&&Object.keys(A).length>0||A===!1:e.util.schemaHasRules(A,e.RULES.all))?(b.schema=A,b.schemaPath=u+"["+N+"]",b.errSchemaPath=d+"/"+N,s+=" "+e.validate(b)+" ",b.baseId=S):s+=" var "+E+" = true; ",N&&(s+=" if ("+E+" && "+k+") { "+g+" = false; "+T+" = ["+T+", "+N+"]; } else { ",x+="}"),s+=" if ("+E+") { "+g+" = "+k+" = true; "+T+" = "+N+"; }";return e.compositeRule=b.compositeRule=R,s+=""+x+"if (!"+g+") { var err = ",e.createErrors!==!1?(s+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { passingSchemas: "+T+" } ",e.opts.messages!==!1&&(s+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ",s+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&p&&(e.async?s+=" throw new ValidationError(vErrors); ":s+=" validate.errors = vErrors; return false; "),s+="} else { errors = "+v+"; if (vErrors !== null) { if ("+v+") vErrors.length = "+v+"; else vErrors = null; }",e.opts.allErrors&&(s+=" } "),s}),LE}var $E,XL;function bhe(){return XL||(XL=1,$E=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,h="data"+(a||""),g=e.opts.$data&&l&&l.$data,v;g?(s+=" var schema"+i+" = "+e.util.getData(l.$data,a,e.dataPathArr)+"; ",v="schema"+i):v=l;var b=g?"(new RegExp("+v+"))":e.usePattern(l);s+="if ( ",g&&(s+=" ("+v+" !== undefined && typeof "+v+" != 'string') || "),s+=" !"+b+".test("+h+") ) { ";var x=x||[];x.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { pattern: ",g?s+=""+v:s+=""+e.util.toQuotedString(l),s+=" } ",e.opts.messages!==!1&&(s+=` , message: 'should match pattern "`,g?s+="' + "+v+" + '":s+=""+e.util.escapeQuotes(l),s+=`"' `),e.opts.verbose&&(s+=" , schema: ",g?s+="validate.schema"+u:s+=""+e.util.toQuotedString(l),s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var E=s;return s=x.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+E+"]); ":s+=" validate.errors = ["+E+"]; return false; ":s+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",p&&(s+=" else { "),s}),$E}var zE,QL;function xhe(){return QL||(QL=1,zE=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,h="data"+(a||""),g="errs__"+i,v=e.util.copy(e),b="";v.level++;var x="valid"+v.level,E="key"+i,S="idx"+i,k=v.dataLevel=e.dataLevel+1,T="data"+k,R="dataProperties"+i,j=Object.keys(l||{}).filter(H),A=e.schema.patternProperties||{},N=Object.keys(A).filter(H),M=e.schema.additionalProperties,I=j.length||N.length,O=M===!1,L=typeof M=="object"&&Object.keys(M).length,z=e.opts.removeAdditional,G=O||L||z,W=e.opts.ownProperties,X=e.baseId,F=e.schema.required;if(F&&!(e.opts.$data&&F.$data)&&F.length<e.opts.loopRequired)var Y=e.util.toHash(F);function H(Te){return Te!=="__proto__"}if(s+="var "+g+" = errors;var "+x+" = true;",W&&(s+=" var "+R+" = undefined;"),G){if(W?s+=" "+R+" = "+R+" || Object.keys("+h+"); for (var "+S+"=0; "+S+"<"+R+".length; "+S+"++) { var "+E+" = "+R+"["+S+"]; ":s+=" for (var "+E+" in "+h+") { ",I){if(s+=" var isAdditional"+i+" = !(false ",j.length)if(j.length>8)s+=" || validate.schema"+u+".hasOwnProperty("+E+") ";else{var te=j;if(te)for(var P,re=-1,ue=te.length-1;re<ue;)P=te[re+=1],s+=" || "+E+" == "+e.util.toQuotedString(P)+" "}if(N.length){var D=N;if(D)for(var Z,he=-1,V=D.length-1;he<V;)Z=D[he+=1],s+=" || "+e.usePattern(Z)+".test("+E+") "}s+=" ); if (isAdditional"+i+") { "}if(z=="all")s+=" delete "+h+"["+E+"]; ";else{var U=e.errorPath,K="' + "+E+" + '";if(e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(e.errorPath,E,e.opts.jsonPointers)),O)if(z)s+=" delete "+h+"["+E+"]; ";else{s+=" "+x+" = false; ";var ae=d;d=e.errSchemaPath+"/additionalProperties";var B=B||[];B.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { additionalProperty: '"+K+"' } ",e.opts.messages!==!1&&(s+=" , message: '",e.opts._errorDataPathProperty?s+="is an invalid additional property":s+="should NOT have additional properties",s+="' "),e.opts.verbose&&(s+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var J=s;s=B.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+J+"]); ":s+=" validate.errors = ["+J+"]; return false; ":s+=" var err = "+J+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",d=ae,p&&(s+=" break; ")}else if(L)if(z=="failing"){s+=" var "+g+" = errors; ";var oe=e.compositeRule;e.compositeRule=v.compositeRule=!0,v.schema=M,v.schemaPath=e.schemaPath+".additionalProperties",v.errSchemaPath=e.errSchemaPath+"/additionalProperties",v.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,E,e.opts.jsonPointers);var fe=h+"["+E+"]";v.dataPathArr[k]=E;var be=e.validate(v);v.baseId=X,e.util.varOccurences(be,T)<2?s+=" "+e.util.varReplace(be,T,fe)+" ":s+=" var "+T+" = "+fe+"; "+be+" ",s+=" if (!"+x+") { errors = "+g+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+h+"["+E+"]; } ",e.compositeRule=v.compositeRule=oe}else{v.schema=M,v.schemaPath=e.schemaPath+".additionalProperties",v.errSchemaPath=e.errSchemaPath+"/additionalProperties",v.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,E,e.opts.jsonPointers);var fe=h+"["+E+"]";v.dataPathArr[k]=E;var be=e.validate(v);v.baseId=X,e.util.varOccurences(be,T)<2?s+=" "+e.util.varReplace(be,T,fe)+" ":s+=" var "+T+" = "+fe+"; "+be+" ",p&&(s+=" if (!"+x+") break; ")}e.errorPath=U}I&&(s+=" } "),s+=" } ",p&&(s+=" if ("+x+") { ",b+="}")}var Ae=e.opts.useDefaults&&!e.compositeRule;if(j.length){var Oe=j;if(Oe)for(var P,Ne=-1,Qe=Oe.length-1;Ne<Qe;){P=Oe[Ne+=1];var dt=l[P];if(e.opts.strictKeywords?typeof dt=="object"&&Object.keys(dt).length>0||dt===!1:e.util.schemaHasRules(dt,e.RULES.all)){var Be=e.util.getProperty(P),fe=h+Be,pt=Ae&&dt.default!==void 0;v.schema=dt,v.schemaPath=u+Be,v.errSchemaPath=d+"/"+e.util.escapeFragment(P),v.errorPath=e.util.getPath(e.errorPath,P,e.opts.jsonPointers),v.dataPathArr[k]=e.util.toQuotedString(P);var be=e.validate(v);if(v.baseId=X,e.util.varOccurences(be,T)<2){be=e.util.varReplace(be,T,fe);var De=fe}else{var De=T;s+=" var "+T+" = "+fe+"; "}if(pt)s+=" "+be+" ";else{if(Y&&Y[P]){s+=" if ( "+De+" === undefined ",W&&(s+=" || ! Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(P)+"') "),s+=") { "+x+" = false; ";var U=e.errorPath,ae=d,et=e.util.escapeQuotes(P);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(U,P,e.opts.jsonPointers)),d=e.errSchemaPath+"/required";var B=B||[];B.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { missingProperty: '"+et+"' } ",e.opts.messages!==!1&&(s+=" , message: '",e.opts._errorDataPathProperty?s+="is a required property":s+="should have required property \\'"+et+"\\'",s+="' "),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var J=s;s=B.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+J+"]); ":s+=" validate.errors = ["+J+"]; return false; ":s+=" var err = "+J+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",d=ae,e.errorPath=U,s+=" } else { "}else p?(s+=" if ( "+De+" === undefined ",W&&(s+=" || ! Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(P)+"') "),s+=") { "+x+" = true; } else { "):(s+=" if ("+De+" !== undefined ",W&&(s+=" && Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(P)+"') "),s+=" ) { ");s+=" "+be+" } "}}p&&(s+=" if ("+x+") { ",b+="}")}}if(N.length){var ot=N;if(ot)for(var Z,lr=-1,xe=ot.length-1;lr<xe;){Z=ot[lr+=1];var dt=A[Z];if(e.opts.strictKeywords?typeof dt=="object"&&Object.keys(dt).length>0||dt===!1:e.util.schemaHasRules(dt,e.RULES.all)){v.schema=dt,v.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(Z),v.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(Z),W?s+=" "+R+" = "+R+" || Object.keys("+h+"); for (var "+S+"=0; "+S+"<"+R+".length; "+S+"++) { var "+E+" = "+R+"["+S+"]; ":s+=" for (var "+E+" in "+h+") { ",s+=" if ("+e.usePattern(Z)+".test("+E+")) { ",v.errorPath=e.util.getPathExpr(e.errorPath,E,e.opts.jsonPointers);var fe=h+"["+E+"]";v.dataPathArr[k]=E;var be=e.validate(v);v.baseId=X,e.util.varOccurences(be,T)<2?s+=" "+e.util.varReplace(be,T,fe)+" ":s+=" var "+T+" = "+fe+"; "+be+" ",p&&(s+=" if (!"+x+") break; "),s+=" } ",p&&(s+=" else "+x+" = true; "),s+=" } ",p&&(s+=" if ("+x+") { ",b+="}")}}}return p&&(s+=" "+b+" if ("+g+" == errors) {"),s}),zE}var FE,JL;function _he(){return JL||(JL=1,FE=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,h="data"+(a||""),g="errs__"+i,v=e.util.copy(e),b="";v.level++;var x="valid"+v.level;if(s+="var "+g+" = errors;",e.opts.strictKeywords?typeof l=="object"&&Object.keys(l).length>0||l===!1:e.util.schemaHasRules(l,e.RULES.all)){v.schema=l,v.schemaPath=u,v.errSchemaPath=d;var E="key"+i,S="idx"+i,k="i"+i,T="' + "+E+" + '",R=v.dataLevel=e.dataLevel+1,j="data"+R,A="dataProperties"+i,N=e.opts.ownProperties,M=e.baseId;N&&(s+=" var "+A+" = undefined; "),N?s+=" "+A+" = "+A+" || Object.keys("+h+"); for (var "+S+"=0; "+S+"<"+A+".length; "+S+"++) { var "+E+" = "+A+"["+S+"]; ":s+=" for (var "+E+" in "+h+") { ",s+=" var startErrs"+i+" = errors; ";var I=E,O=e.compositeRule;e.compositeRule=v.compositeRule=!0;var L=e.validate(v);v.baseId=M,e.util.varOccurences(L,j)<2?s+=" "+e.util.varReplace(L,j,I)+" ":s+=" var "+j+" = "+I+"; "+L+" ",e.compositeRule=v.compositeRule=O,s+=" if (!"+x+") { for (var "+k+"=startErrs"+i+"; "+k+"<errors; "+k+"++) { vErrors["+k+"].propertyName = "+E+"; } var err = ",e.createErrors!==!1?(s+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { propertyName: '"+T+"' } ",e.opts.messages!==!1&&(s+=" , message: 'property name \\'"+T+"\\' is invalid' "),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ",s+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&p&&(e.async?s+=" throw new ValidationError(vErrors); ":s+=" validate.errors = vErrors; return false; "),p&&(s+=" break; "),s+=" } }"}return p&&(s+=" "+b+" if ("+g+" == errors) {"),s}),FE}var UE,ZL;function whe(){return ZL||(ZL=1,UE=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,h="data"+(a||""),g="valid"+i,v=e.opts.$data&&l&&l.$data;v&&(s+=" var schema"+i+" = "+e.util.getData(l.$data,a,e.dataPathArr)+"; ");var b="schema"+i;if(!v)if(l.length<e.opts.loopRequired&&e.schema.properties&&Object.keys(e.schema.properties).length){var x=[],E=l;if(E)for(var S,k=-1,T=E.length-1;k<T;){S=E[k+=1];var R=e.schema.properties[S];R&&(e.opts.strictKeywords?typeof R=="object"&&Object.keys(R).length>0||R===!1:e.util.schemaHasRules(R,e.RULES.all))||(x[x.length]=S)}}else var x=l;if(v||x.length){var j=e.errorPath,A=v||x.length>=e.opts.loopRequired,N=e.opts.ownProperties;if(p)if(s+=" var missing"+i+"; ",A){v||(s+=" var "+b+" = validate.schema"+u+"; ");var M="i"+i,I="schema"+i+"["+M+"]",O="' + "+I+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(j,I,e.opts.jsonPointers)),s+=" var "+g+" = true; ",v&&(s+=" if (schema"+i+" === undefined) "+g+" = true; else if (!Array.isArray(schema"+i+")) "+g+" = false; else {"),s+=" for (var "+M+" = 0; "+M+" < "+b+".length; "+M+"++) { "+g+" = "+h+"["+b+"["+M+"]] !== undefined ",N&&(s+=" && Object.prototype.hasOwnProperty.call("+h+", "+b+"["+M+"]) "),s+="; if (!"+g+") break; } ",v&&(s+=" } "),s+=" if (!"+g+") { ";var L=L||[];L.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { missingProperty: '"+O+"' } ",e.opts.messages!==!1&&(s+=" , message: '",e.opts._errorDataPathProperty?s+="is a required property":s+="should have required property \\'"+O+"\\'",s+="' "),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var z=s;s=L.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+z+"]); ":s+=" validate.errors = ["+z+"]; return false; ":s+=" var err = "+z+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } else { "}else{s+=" if ( ";var G=x;if(G)for(var W,M=-1,X=G.length-1;M<X;){W=G[M+=1],M&&(s+=" || ");var F=e.util.getProperty(W),Y=h+F;s+=" ( ( "+Y+" === undefined ",N&&(s+=" || ! Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(W)+"') "),s+=") && (missing"+i+" = "+e.util.toQuotedString(e.opts.jsonPointers?W:F)+") ) "}s+=") { ";var I="missing"+i,O="' + "+I+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(j,I,!0):j+" + "+I);var L=L||[];L.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { missingProperty: '"+O+"' } ",e.opts.messages!==!1&&(s+=" , message: '",e.opts._errorDataPathProperty?s+="is a required property":s+="should have required property \\'"+O+"\\'",s+="' "),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var z=s;s=L.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+z+"]); ":s+=" validate.errors = ["+z+"]; return false; ":s+=" var err = "+z+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } else { "}else if(A){v||(s+=" var "+b+" = validate.schema"+u+"; ");var M="i"+i,I="schema"+i+"["+M+"]",O="' + "+I+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(j,I,e.opts.jsonPointers)),v&&(s+=" if ("+b+" && !Array.isArray("+b+")) { var err = ",e.createErrors!==!1?(s+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { missingProperty: '"+O+"' } ",e.opts.messages!==!1&&(s+=" , message: '",e.opts._errorDataPathProperty?s+="is a required property":s+="should have required property \\'"+O+"\\'",s+="' "),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ",s+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+b+" !== undefined) { "),s+=" for (var "+M+" = 0; "+M+" < "+b+".length; "+M+"++) { if ("+h+"["+b+"["+M+"]] === undefined ",N&&(s+=" || ! Object.prototype.hasOwnProperty.call("+h+", "+b+"["+M+"]) "),s+=") { var err = ",e.createErrors!==!1?(s+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { missingProperty: '"+O+"' } ",e.opts.messages!==!1&&(s+=" , message: '",e.opts._errorDataPathProperty?s+="is a required property":s+="should have required property \\'"+O+"\\'",s+="' "),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ",s+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",v&&(s+=" } ")}else{var H=x;if(H)for(var W,te=-1,P=H.length-1;te<P;){W=H[te+=1];var F=e.util.getProperty(W),O=e.util.escapeQuotes(W),Y=h+F;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(j,W,e.opts.jsonPointers)),s+=" if ( "+Y+" === undefined ",N&&(s+=" || ! Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(W)+"') "),s+=") { var err = ",e.createErrors!==!1?(s+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { missingProperty: '"+O+"' } ",e.opts.messages!==!1&&(s+=" , message: '",e.opts._errorDataPathProperty?s+="is a required property":s+="should have required property \\'"+O+"\\'",s+="' "),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ",s+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}e.errorPath=j}else p&&(s+=" if (true) {");return s}),UE}var BE,e3;function She(){return e3||(e3=1,BE=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,h="data"+(a||""),g="valid"+i,v=e.opts.$data&&l&&l.$data,b;if(v?(s+=" var schema"+i+" = "+e.util.getData(l.$data,a,e.dataPathArr)+"; ",b="schema"+i):b=l,(l||v)&&e.opts.uniqueItems!==!1){v&&(s+=" var "+g+"; if ("+b+" === false || "+b+" === undefined) "+g+" = true; else if (typeof "+b+" != 'boolean') "+g+" = false; else { "),s+=" var i = "+h+".length , "+g+" = true , j; if (i > 1) { ";var x=e.schema.items&&e.schema.items.type,E=Array.isArray(x);if(!x||x=="object"||x=="array"||E&&(x.indexOf("object")>=0||x.indexOf("array")>=0))s+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+h+"[i], "+h+"[j])) { "+g+" = false; break outer; } } } ";else{s+=" var itemIndices = {}, item; for (;i--;) { var item = "+h+"[i]; ";var S="checkDataType"+(E?"s":"");s+=" if ("+e.util[S](x,"item",e.opts.strictNumbers,!0)+") continue; ",E&&(s+=` if (typeof item == 'string') item = '"' + item; `),s+=" if (typeof itemIndices[item] == 'number') { "+g+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}s+=" } ",v&&(s+=" } "),s+=" if (!"+g+") { ";var k=k||[];k.push(s),s="",e.createErrors!==!1?(s+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { i: i, j: j } ",e.opts.messages!==!1&&(s+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(s+=" , schema: ",v?s+="validate.schema"+u:s+=""+l,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var T=s;s=k.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+T+"]); ":s+=" validate.errors = ["+T+"]; return false; ":s+=" var err = "+T+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",p&&(s+=" else { ")}else p&&(s+=" if (true) { ");return s}),BE}var qE,t3;function Ehe(){return t3||(t3=1,qE={$ref:ihe(),allOf:ahe(),anyOf:ohe(),$comment:lhe(),const:che(),contains:uhe(),dependencies:dhe(),enum:fhe(),format:hhe(),if:phe(),items:mhe(),maximum:FL(),minimum:FL(),maxItems:BL(),minItems:BL(),maxLength:VL(),minLength:VL(),maxProperties:GL(),minProperties:GL(),multipleOf:ghe(),not:vhe(),oneOf:yhe(),pattern:bhe(),properties:xhe(),propertyNames:_he(),required:whe(),uniqueItems:She(),validate:eV()}),qE}var VE,n3;function khe(){if(n3)return VE;n3=1;var t=Ehe(),e=nh().toHash;return VE=function(){var r=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],s=["type","$comment"],i=["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"],a=["number","integer","string","array","object","boolean","null"];return r.all=e(s),r.types=e(a),r.forEach(function(l){l.rules=l.rules.map(function(u){var d;if(typeof u=="object"){var p=Object.keys(u)[0];d=u[p],u=p,d.forEach(function(g){s.push(g),r.all[g]=!0})}s.push(u);var h=r.all[u]={keyword:u,code:t[u],implements:d};return h}),r.all.$comment={keyword:"$comment",code:t.$comment},l.type&&(r.types[l.type]=l)}),r.keywords=e(s.concat(i)),r.custom={},r},VE}var HE,r3;function The(){if(r3)return HE;r3=1;var t=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];return HE=function(e,n){for(var r=0;r<n.length;r++){e=JSON.parse(JSON.stringify(e));var s=n[r].split("/"),i=e,a;for(a=1;a<s.length;a++)i=i[s[a]];for(a=0;a<t.length;a++){var l=t[a],u=i[l];u&&(i[l]={anyOf:[u,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]})}}return e},HE}var GE,s3;function Che(){if(s3)return GE;s3=1;var t=KN().MissingRef;GE=e;function e(n,r,s){var i=this;if(typeof this._opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");typeof r=="function"&&(s=r,r=void 0);var a=l(n).then(function(){var d=i._addSchema(n,void 0,r);return d.validate||u(d)});return s&&a.then(function(d){s(null,d)},s),a;function l(d){var p=d.$schema;return p&&!i.getSchema(p)?e.call(i,{$ref:p},!0):Promise.resolve()}function u(d){try{return i._compile(d)}catch(h){if(h instanceof t)return p(h);throw h}function p(h){var g=h.missingSchema;if(x(g))throw new Error("Schema "+g+" is loaded but "+h.missingRef+" cannot be resolved");var v=i._loadingSchemas[g];return v||(v=i._loadingSchemas[g]=i._opts.loadSchema(g),v.then(b,b)),v.then(function(E){if(!x(g))return l(E).then(function(){x(g)||i.addSchema(E,g,void 0,r)})}).then(function(){return u(d)});function b(){delete i._loadingSchemas[g]}function x(E){return i._refs[E]||i._schemas[E]}}}}return GE}var WE,i3;function Ahe(){return i3||(i3=1,WE=function(e,n,r){var s=" ",i=e.level,a=e.dataLevel,l=e.schema[n],u=e.schemaPath+e.util.getProperty(n),d=e.errSchemaPath+"/"+n,p=!e.opts.allErrors,h,g="data"+(a||""),v="valid"+i,b="errs__"+i,x=e.opts.$data&&l&&l.$data,E;x?(s+=" var schema"+i+" = "+e.util.getData(l.$data,a,e.dataPathArr)+"; ",E="schema"+i):E=l;var S=this,k="definition"+i,T=S.definition,R="",j,A,N,M,I;if(x&&T.$data){I="keywordValidate"+i;var O=T.validateSchema;s+=" var "+k+" = RULES.custom['"+n+"'].definition; var "+I+" = "+k+".validate;"}else{if(M=e.useCustomRule(S,l,e.schema,e),!M)return;E="validate.schema"+u,I=M.code,j=T.compile,A=T.inline,N=T.macro}var L=I+".errors",z="i"+i,G="ruleErr"+i,W=T.async;if(W&&!e.async)throw new Error("async keyword in sync schema");if(A||N||(s+=""+L+" = null;"),s+="var "+b+" = errors;var "+v+";",x&&T.$data&&(R+="}",s+=" if ("+E+" === undefined) { "+v+" = true; } else { ",O&&(R+="}",s+=" "+v+" = "+k+".validateSchema("+E+"); if ("+v+") { ")),A)T.statements?s+=" "+M.validate+" ":s+=" "+v+" = "+M.validate+"; ";else if(N){var X=e.util.copy(e),R="";X.level++;var F="valid"+X.level;X.schema=M.validate,X.schemaPath="";var Y=e.compositeRule;e.compositeRule=X.compositeRule=!0;var H=e.validate(X).replace(/validate\.schema/g,I);e.compositeRule=X.compositeRule=Y,s+=" "+H}else{var te=te||[];te.push(s),s="",s+=" "+I+".call( ",e.opts.passContext?s+="this":s+="self",j||T.schema===!1?s+=" , "+g+" ":s+=" , "+E+" , "+g+" , validate.schema"+e.schemaPath+" ",s+=" , (dataPath || '')",e.errorPath!='""'&&(s+=" + "+e.errorPath);var P=a?"data"+(a-1||""):"parentData",re=a?e.dataPathArr[a]:"parentDataProperty";s+=" , "+P+" , "+re+" , rootData ) ";var ue=s;s=te.pop(),T.errors===!1?(s+=" "+v+" = ",W&&(s+="await "),s+=""+ue+"; "):W?(L="customErrors"+i,s+=" var "+L+" = null; try { "+v+" = await "+ue+"; } catch (e) { "+v+" = false; if (e instanceof ValidationError) "+L+" = e.errors; else throw e; } "):s+=" "+L+" = null; "+v+" = "+ue+"; "}if(T.modifying&&(s+=" if ("+P+") "+g+" = "+P+"["+re+"];"),s+=""+R,T.valid)p&&(s+=" if (true) { ");else{s+=" if ( ",T.valid===void 0?(s+=" !",N?s+=""+F:s+=""+v):s+=" "+!T.valid+" ",s+=") { ",h=S.keyword;var te=te||[];te.push(s),s="";var te=te||[];te.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+(h||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { keyword: '"+S.keyword+"' } ",e.opts.messages!==!1&&(s+=` , message: 'should pass "`+S.keyword+`" keyword validation' `),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+g+" "),s+=" } "):s+=" {} ";var D=s;s=te.pop(),!e.compositeRule&&p?e.async?s+=" throw new ValidationError(["+D+"]); ":s+=" validate.errors = ["+D+"]; return false; ":s+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var Z=s;s=te.pop(),A?T.errors?T.errors!="full"&&(s+=" for (var "+z+"="+b+"; "+z+"<errors; "+z+"++) { var "+G+" = vErrors["+z+"]; if ("+G+".dataPath === undefined) "+G+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+G+".schemaPath === undefined) { "+G+'.schemaPath = "'+d+'"; } ',e.opts.verbose&&(s+=" "+G+".schema = "+E+"; "+G+".data = "+g+"; "),s+=" } "):T.errors===!1?s+=" "+Z+" ":(s+=" if ("+b+" == errors) { "+Z+" } else { for (var "+z+"="+b+"; "+z+"<errors; "+z+"++) { var "+G+" = vErrors["+z+"]; if ("+G+".dataPath === undefined) "+G+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+G+".schemaPath === undefined) { "+G+'.schemaPath = "'+d+'"; } ',e.opts.verbose&&(s+=" "+G+".schema = "+E+"; "+G+".data = "+g+"; "),s+=" } } "):N?(s+=" var err = ",e.createErrors!==!1?(s+=" { keyword: '"+(h||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { keyword: '"+S.keyword+"' } ",e.opts.messages!==!1&&(s+=` , message: 'should pass "`+S.keyword+`" keyword validation' `),e.opts.verbose&&(s+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+g+" "),s+=" } "):s+=" {} ",s+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&p&&(e.async?s+=" throw new ValidationError(vErrors); ":s+=" validate.errors = vErrors; return false; ")):T.errors===!1?s+=" "+Z+" ":(s+=" if (Array.isArray("+L+")) { if (vErrors === null) vErrors = "+L+"; else vErrors = vErrors.concat("+L+"); errors = vErrors.length; for (var "+z+"="+b+"; "+z+"<errors; "+z+"++) { var "+G+" = vErrors["+z+"]; if ("+G+".dataPath === undefined) "+G+".dataPath = (dataPath || '') + "+e.errorPath+"; "+G+'.schemaPath = "'+d+'"; ',e.opts.verbose&&(s+=" "+G+".schema = "+E+"; "+G+".data = "+g+"; "),s+=" } } else { "+Z+" } "),s+=" } ",p&&(s+=" else { ")}return s}),WE}const Nhe="http://json-schema.org/draft-07/schema#",Rhe="http://json-schema.org/draft-07/schema#",jhe="Core schema meta-schema",Mhe={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},Ohe=["object","boolean"],Phe={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},tV={$schema:Nhe,$id:Rhe,title:jhe,definitions:Mhe,type:Ohe,properties:Phe,default:!0};var YE,a3;function Ihe(){if(a3)return YE;a3=1;var t=tV;return YE={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:t.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:t.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}},YE}var KE,o3;function Dhe(){if(o3)return KE;o3=1;var t=/^[a-z_$][a-z0-9_$-]*$/i,e=Ahe(),n=Ihe();KE={add:r,get:s,remove:i,validate:a};function r(l,u){var d=this.RULES;if(d.keywords[l])throw new Error("Keyword "+l+" is already defined");if(!t.test(l))throw new Error("Keyword "+l+" is not a valid identifier");if(u){this.validateKeyword(u,!0);var p=u.type;if(Array.isArray(p))for(var h=0;h<p.length;h++)v(l,p[h],u);else v(l,p,u);var g=u.metaSchema;g&&(u.$data&&this._opts.$data&&(g={anyOf:[g,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]}),u.validateSchema=this.compile(g,!0))}d.keywords[l]=d.all[l]=!0;function v(b,x,E){for(var S,k=0;k<d.length;k++){var T=d[k];if(T.type==x){S=T;break}}S||(S={type:x,rules:[]},d.push(S));var R={keyword:b,definition:E,custom:!0,code:e,implements:E.implements};S.rules.push(R),d.custom[b]=R}return this}function s(l){var u=this.RULES.custom[l];return u?u.definition:this.RULES.keywords[l]||!1}function i(l){var u=this.RULES;delete u.keywords[l],delete u.all[l],delete u.custom[l];for(var d=0;d<u.length;d++)for(var p=u[d].rules,h=0;h<p.length;h++)if(p[h].keyword==l){p.splice(h,1);break}return this}function a(l,u){a.errors=null;var d=this._validateKeyword=this._validateKeyword||this.compile(n,!0);if(d(l))return!0;if(a.errors=d.errors,u)throw new Error("custom keyword definition is invalid: "+this.errorsText(d.errors));return!1}return KE}const Lhe="http://json-schema.org/draft-07/schema#",$he="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",zhe="Meta-schema for $data reference (JSON Schema extension proposal)",Fhe="object",Uhe=["$data"],Bhe={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},qhe=!1,Vhe={$schema:Lhe,$id:$he,description:zhe,type:Fhe,required:Uhe,properties:Bhe,additionalProperties:qhe};var XE,l3;function Hhe(){if(l3)return XE;l3=1;var t=nhe(),e=YN(),n=rhe(),r=Jq(),s=Zq(),i=she(),a=khe(),l=The(),u=nh();XE=b,b.prototype.validate=x,b.prototype.compile=E,b.prototype.addSchema=S,b.prototype.addMetaSchema=k,b.prototype.validateSchema=T,b.prototype.getSchema=j,b.prototype.removeSchema=M,b.prototype.addFormat=Y,b.prototype.errorsText=F,b.prototype._addSchema=O,b.prototype._compile=L,b.prototype.compileAsync=Che();var d=Dhe();b.prototype.addKeyword=d.add,b.prototype.getKeyword=d.get,b.prototype.removeKeyword=d.remove,b.prototype.validateKeyword=d.validate;var p=KN();b.ValidationError=p.Validation,b.MissingRefError=p.MissingRef,b.$dataMetaSchema=l;var h="http://json-schema.org/draft-07/schema",g=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],v=["/properties"];function b(V){if(!(this instanceof b))return new b(V);V=this._opts=u.copy(V)||{},Z(this),this._schemas={},this._refs={},this._fragments={},this._formats=i(V.format),this._cache=V.cache||new n,this._loadingSchemas={},this._compilations=[],this.RULES=a(),this._getId=z(V),V.loopRequired=V.loopRequired||1/0,V.errorDataPath=="property"&&(V._errorDataPathProperty=!0),V.serialize===void 0&&(V.serialize=s),this._metaOpts=D(this),V.formats&&P(this),V.keywords&&re(this),H(this),typeof V.meta=="object"&&this.addMetaSchema(V.meta),V.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),te(this)}function x(V,U){var K;if(typeof V=="string"){if(K=this.getSchema(V),!K)throw new Error('no schema with key or ref "'+V+'"')}else{var ae=this._addSchema(V);K=ae.validate||this._compile(ae)}var B=K(U);return K.$async!==!0&&(this.errors=K.errors),B}function E(V,U){var K=this._addSchema(V,void 0,U);return K.validate||this._compile(K)}function S(V,U,K,ae){if(Array.isArray(V)){for(var B=0;B<V.length;B++)this.addSchema(V[B],void 0,K,ae);return this}var J=this._getId(V);if(J!==void 0&&typeof J!="string")throw new Error("schema id must be string");return U=e.normalizeId(U||J),ue(this,U),this._schemas[U]=this._addSchema(V,K,ae,!0),this}function k(V,U,K){return this.addSchema(V,U,K,!0),this}function T(V,U){var K=V.$schema;if(K!==void 0&&typeof K!="string")throw new Error("$schema must be a string");if(K=K||this._opts.defaultMeta||R(this),!K)return this.logger.warn("meta-schema not available"),this.errors=null,!0;var ae=this.validate(K,V);if(!ae&&U){var B="schema is invalid: "+this.errorsText();if(this._opts.validateSchema=="log")this.logger.error(B);else throw new Error(B)}return ae}function R(V){var U=V._opts.meta;return V._opts.defaultMeta=typeof U=="object"?V._getId(U)||U:V.getSchema(h)?h:void 0,V._opts.defaultMeta}function j(V){var U=N(this,V);switch(typeof U){case"object":return U.validate||this._compile(U);case"string":return this.getSchema(U);case"undefined":return A(this,V)}}function A(V,U){var K=e.schema.call(V,{schema:{}},U);if(K){var ae=K.schema,B=K.root,J=K.baseId,oe=t.call(V,ae,B,void 0,J);return V._fragments[U]=new r({ref:U,fragment:!0,schema:ae,root:B,baseId:J,validate:oe}),oe}}function N(V,U){return U=e.normalizeId(U),V._schemas[U]||V._refs[U]||V._fragments[U]}function M(V){if(V instanceof RegExp)return I(this,this._schemas,V),I(this,this._refs,V),this;switch(typeof V){case"undefined":return I(this,this._schemas),I(this,this._refs),this._cache.clear(),this;case"string":var U=N(this,V);return U&&this._cache.del(U.cacheKey),delete this._schemas[V],delete this._refs[V],this;case"object":var K=this._opts.serialize,ae=K?K(V):V;this._cache.del(ae);var B=this._getId(V);B&&(B=e.normalizeId(B),delete this._schemas[B],delete this._refs[B])}return this}function I(V,U,K){for(var ae in U){var B=U[ae];!B.meta&&(!K||K.test(ae))&&(V._cache.del(B.cacheKey),delete U[ae])}}function O(V,U,K,ae){if(typeof V!="object"&&typeof V!="boolean")throw new Error("schema should be object or boolean");var B=this._opts.serialize,J=B?B(V):V,oe=this._cache.get(J);if(oe)return oe;ae=ae||this._opts.addUsedSchema!==!1;var fe=e.normalizeId(this._getId(V));fe&&ae&&ue(this,fe);var be=this._opts.validateSchema!==!1&&!U,Ae;be&&!(Ae=fe&&fe==e.normalizeId(V.$schema))&&this.validateSchema(V,!0);var Oe=e.ids.call(this,V),Ne=new r({id:fe,schema:V,localRefs:Oe,cacheKey:J,meta:K});return fe[0]!="#"&&ae&&(this._refs[fe]=Ne),this._cache.put(J,Ne),be&&Ae&&this.validateSchema(V,!0),Ne}function L(V,U){if(V.compiling)return V.validate=B,B.schema=V.schema,B.errors=null,B.root=U||B,V.schema.$async===!0&&(B.$async=!0),B;V.compiling=!0;var K;V.meta&&(K=this._opts,this._opts=this._metaOpts);var ae;try{ae=t.call(this,V.schema,U,V.localRefs)}catch(J){throw delete V.validate,J}finally{V.compiling=!1,V.meta&&(this._opts=K)}return V.validate=ae,V.refs=ae.refs,V.refVal=ae.refVal,V.root=ae.root,ae;function B(){var J=V.validate,oe=J.apply(this,arguments);return B.errors=J.errors,oe}}function z(V){switch(V.schemaId){case"auto":return X;case"id":return G;default:return W}}function G(V){return V.$id&&this.logger.warn("schema $id ignored",V.$id),V.id}function W(V){return V.id&&this.logger.warn("schema id ignored",V.id),V.$id}function X(V){if(V.$id&&V.id&&V.$id!=V.id)throw new Error("schema $id is different from id");return V.$id||V.id}function F(V,U){if(V=V||this.errors,!V)return"No errors";U=U||{};for(var K=U.separator===void 0?", ":U.separator,ae=U.dataVar===void 0?"data":U.dataVar,B="",J=0;J<V.length;J++){var oe=V[J];oe&&(B+=ae+oe.dataPath+" "+oe.message+K)}return B.slice(0,-K.length)}function Y(V,U){return typeof U=="string"&&(U=new RegExp(U)),this._formats[V]=U,this}function H(V){var U;if(V._opts.$data&&(U=Vhe,V.addMetaSchema(U,U.$id,!0)),V._opts.meta!==!1){var K=tV;V._opts.$data&&(K=l(K,v)),V.addMetaSchema(K,h,!0),V._refs["http://json-schema.org/schema"]=h}}function te(V){var U=V._opts.schemas;if(U)if(Array.isArray(U))V.addSchema(U);else for(var K in U)V.addSchema(U[K],K)}function P(V){for(var U in V._opts.formats){var K=V._opts.formats[U];V.addFormat(U,K)}}function re(V){for(var U in V._opts.keywords){var K=V._opts.keywords[U];V.addKeyword(U,K)}}function ue(V,U){if(V._schemas[U]||V._refs[U])throw new Error('schema with key or id "'+U+'" already exists')}function D(V){for(var U=u.copy(V._opts),K=0;K<g.length;K++)delete U[g[K]];return U}function Z(V){var U=V._opts.logger;if(U===!1)V.logger={log:he,warn:he,error:he};else{if(U===void 0&&(U=console),!(typeof U=="object"&&U.log&&U.warn&&U.error))throw new Error("logger must implement log, warn and error methods");V.logger=U}}function he(){}return XE}var Ghe=Hhe();const Whe=Vf(Ghe),c3=new Whe;function Yhe(t,e){const n={structuredErrors:void 0,unstructuredStatus:"not_applicable"};if(!e)return n;if(t.structuredContent)try{const r=c3.compile(e),s=r(t.structuredContent);n.structuredErrors=s?null:r.errors||[]}catch{n.structuredErrors=n.structuredErrors=[{keyword:"schema-compilation",instancePath:"",schemaPath:"",params:{},message:"The provided outputSchema is invalid and could not be compiled."}]}if(typeof t.content[0].text=="string")try{const r=JSON.parse(t.content[0].text),i=c3.compile(e)(r);n.unstructuredStatus=i?"valid":"schema_mismatch"}catch{n.unstructuredStatus="invalid_json"}return n}function Khe({serverConfig:t,serverName:e}){const n=GN("ToolsTab"),[r,s]=w.useState({}),[i,a]=w.useState(""),[l,u]=w.useState([]),[d,p]=w.useState(null),[h,g]=w.useState(null),[v,b]=w.useState(!1),[x,E]=w.useState(void 0),[S,k]=w.useState("not_applicable"),[T,R]=w.useState(!1),[j,A]=w.useState(!1),[N,M]=w.useState(""),[I,O]=w.useState(null),[L,z]=w.useState(!1),[G,W]=w.useState(""),[X,F]=w.useState("tools"),[Y,H]=w.useState(null),[te,P]=w.useState(null),[re,ue]=w.useState(null),[D,Z]=w.useState(null),[he,V]=w.useState(null),[U,K]=w.useState([]),[ae,B]=w.useState(!1),[J,oe]=w.useState(null),[fe,be]=w.useState({title:""}),Ae=w.useMemo(()=>{if(!t)return"none";try{if(t.url)return`http:${t.url}`;if(t.command){const Pe=(t.args||[]).join(" ");return`stdio:${t.command} ${Pe}`.trim()}return JSON.stringify(t)}catch{return"unknown"}},[t]);w.useEffect(()=>{if(!t||!e){s({}),a(""),u([]),p(null),g(null),b(!1),E(void 0),k("not_applicable"),M(""),O(null);return}Oe()},[t,e]),w.useEffect(()=>{t&&K(Ll(Ae))},[t,Ae]),w.useEffect(()=>{i&&r[i]&&u($fe(r[i].inputSchema))},[i,r]);const Oe=async()=>{if(!e){n.warn("Cannot fetch tools: no serverId available");return}A(!0),M(""),s({}),a(""),u([]),p(null),g(null),b(!1),E(void 0),k("not_applicable");try{const bt=(await AN(e)).tools??[],Xt=Object.fromEntries(bt.map(vt=>[vt.name,vt]));s(Xt),n.info("Tools fetched",{serverId:e,toolCount:bt.length})}catch(Pe){const bt=Pe instanceof Error?Pe.message:"Unknown error";n.error("Failed to fetch tools",{error:bt}),M(bt)}finally{A(!1)}},Ne=(Pe,bt)=>{u(Xt=>Xt.map(vt=>vt.name===Pe?{...vt,value:bt}:vt))},Qe=Pe=>{u(bt=>zfe(bt,Pe))},dt=()=>Ffe(l,(Pe,bt)=>n.warn(Pe,bt)),Be=Pe=>Pe?r[Pe]?._meta:void 0,pt=(Pe,bt,Xt)=>{if("result"in Pe&&Pe.status==="completed"){O(null);const vt=Pe.result;p(vt);const Qt=vt;if(Qt?.structuredContent){g(Qt.structuredContent);const Yo=Be(bt)?.["openai/outputTemplate"];b(!Yo)}else g(null),b(!1);const cr=r[bt];if(cr?.outputSchema){const br=Yhe(Qt,cr.outputSchema);E(br.structuredErrors),k(br.unstructuredStatus),br.structuredErrors&&n.warn("Schema validation failed",{errors:br.structuredErrors})}else E(void 0),k("not_applicable");n.info("Tool execution completed",{toolName:bt,duration:Date.now()-Xt});return}if("status"in Pe&&Pe.status==="elicitation_required"){O({executionId:Pe.executionId,requestId:Pe.requestId,request:Pe.request,timestamp:Pe.timestamp});return}"error"in Pe&&Pe.error&&M(Pe.error)},De=async()=>{if(!i){n.warn("Cannot execute tool: no tool selected");return}if(!e){n.warn("Cannot execute tool: no serverId available");return}R(!0),M(""),p(null),g(null),b(!1),E(void 0),k("not_applicable");const Pe=Date.now(),bt=`tool-${Pe}`,Xt=new Date;try{const vt=dt();P(bt),ue(i),Z(vt),V(Xt);const Qt=await ZS(e,i,vt);pt(Qt,i,Pe)}catch(vt){console.error("executeTool",vt);const Qt=vt instanceof Error?vt.message:"Unknown error";n.error("Tool execution network error",{toolName:i,error:Qt}),M(Qt)}finally{R(!1)}},et=async(Pe,bt)=>{if(!I){n.warn("Cannot handle elicitation response: no active request");return}z(!0);try{const Xt=Pe==="accept"?{action:"accept",content:bt??{}}:{action:Pe},vt=await Bue(I.requestId,Xt);pt(vt,i,Date.now())}catch(Xt){const vt=Xt instanceof Error?Xt.message:"Unknown error";n.error("Error responding to elicitation",{requestId:I.requestId,action:Pe,error:vt}),M(vt)}finally{z(!1)}},ot=()=>{i&&(oe(null),be({title:i,description:""}),B(!0))},lr=Pe=>{a(Pe.toolName),setTimeout(()=>Qe(Pe.parameters),50)},xe=Pe=>{Bfe(Ae,Pe),K(Ll(Ae))},Te=Pe=>{const bt=qfe(Ae,Pe.id);K(Ll(Ae)),bt?.id&&(H(bt.id),setTimeout(()=>H(null),2e3))},st=Pe=>{oe(Pe.id),be({title:Pe.title,description:Pe.description}),B(!0)},qe=Object.keys(r),At=G.trim()?qe.filter(Pe=>{const bt=r[Pe];return`${Pe} ${bt?.description??""}`.toLowerCase().includes(G.trim().toLowerCase())}):qe,Jn=G.trim()?U.filter(Pe=>`${Pe.title} ${Pe.description??""}`.toLowerCase().includes(G.trim().toLowerCase())):U,Zn=I?{requestId:I.requestId,message:I.request.message,schema:I.request.requestedSchema,timestamp:I.timestamp}:null;return t?f.jsxs("div",{className:"h-[calc(100vh-120px)] flex flex-col",children:[f.jsxs(Tf,{direction:"vertical",className:"flex-1",children:[f.jsx(ni,{defaultSize:70,minSize:30,children:f.jsxs(Tf,{direction:"horizontal",className:"h-full",children:[f.jsx(Ife,{activeTab:X,onChangeTab:F,tools:r,toolNames:qe,filteredToolNames:At,selectedToolName:i,fetchingTools:j,searchQuery:G,onSearchQueryChange:W,onRefresh:Oe,onSelectTool:a,savedRequests:Jn,highlightedRequestId:Y,onLoadRequest:lr,onRenameRequest:st,onDuplicateRequest:Te,onDeleteRequest:xe}),f.jsx(Cf,{withHandle:!0}),i?f.jsx(Tde,{selectedTool:i,toolDescription:r[i]?.description,formFields:l,loading:T,waitingOnElicitation:!!I,onExecute:De,onSave:ot,onFieldChange:Ne}):f.jsx(ni,{defaultSize:70,minSize:50,children:f.jsx("div",{className:"h-full flex items-center justify-center",children:f.jsxs("div",{className:"text-center",children:[f.jsx("div",{className:"w-12 h-12 bg-muted rounded-full flex items-center justify-center mx-auto mb-3",children:f.jsx(kk,{className:"h-5 w-5 text-muted-foreground"})}),f.jsx("p",{className:"text-xs font-semibold text-foreground mb-1",children:"Select a tool"}),f.jsx("p",{className:"text-xs text-muted-foreground font-medium",children:"Choose a tool from the left to configure parameters"})]})})})]})}),f.jsx(Cf,{withHandle:!0}),f.jsx(ni,{defaultSize:40,minSize:15,maxSize:85,children:f.jsx(Mfe,{error:N,showStructured:v,onToggleStructured:b,structuredResult:h,result:d,validationErrors:x,unstructuredValidationResult:S,serverId:e,toolCallId:te??void 0,toolName:re??void 0,toolParameters:D??void 0,toolCallTimestamp:he??void 0,toolMeta:Be(re),onExecuteFromUI:async(Pe,bt)=>e?await ZS(e,Pe,bt||{}):{error:"No server selected"},onHandleIntent:async(Pe,bt)=>{e&&await ZS(e,"handleIntent",{intent:Pe,params:bt||{}})},onSendFollowup:Pe=>{n.info("OpenAI component requested follow-up",{message:Pe})}})})]}),f.jsx(ST,{elicitationRequest:Zn,onResponse:et,loading:L}),f.jsx(Dfe,{open:ae,defaultTitle:fe.title,defaultDescription:fe.description,onCancel:()=>B(!1),onSave:({title:Pe,description:bt})=>{if(J){Vfe(Ae,J,{title:Pe,description:bt}),K(Ll(Ae)),oe(null),B(!1),F("saved"),H(J),setTimeout(()=>H(null),2e3);return}const Xt=dt(),vt=HN(Ae,{title:Pe,description:bt,toolName:i,parameters:Xt});K(Ll(Ae)),B(!1),F("saved"),vt?.id&&(H(vt.id),setTimeout(()=>H(null),2e3))}})]}):f.jsx(th,{icon:kk,title:"No Server Selected",description:"Connect to an MCP server to explore and test its available tools."})}function Xhe({serverConfig:t,serverName:e}){const[n,r]=w.useState([]),[s,i]=w.useState(""),[a,l]=w.useState(null),[u,d]=w.useState(!1),[p,h]=w.useState(!1),[g,v]=w.useState(""),b=w.useMemo(()=>n.find(S=>S.uri===s)??null,[n,s]);w.useEffect(()=>{t&&e&&x()},[t,e]);const x=async()=>{if(e){h(!0),v(""),r([]);try{const S=await fetch("/api/mcp/resources/list",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({serverId:e})}),k=await S.json();if(S.ok){const T=Array.isArray(k.resources)?k.resources:[];r(T),T.length===0?(i(""),l(null)):T.some(R=>R.uri===s)||(i(T[0].uri),l(null))}else v(k.error||"Failed to fetch resources")}catch(S){v(`Network error fetching resources: ${S}`)}finally{h(!1)}}},E=async S=>{if(e){d(!0),v("");try{const k=await fetch("/api/mcp/resources/read",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({serverId:e,uri:S})}),T=await k.json();k.ok?l(T.content??null):v(T.error||"Failed to read resource")}catch(k){v(`Network error reading resource: ${k}`)}finally{d(!1)}}};return!t||!e?f.jsx(th,{icon:MS,title:"No Server Selected",description:"Connect to an MCP server to browse and explore its available resources."}):f.jsx("div",{className:"h-[calc(100vh-120px)] flex flex-col",children:f.jsxs(Tf,{direction:"vertical",className:"flex-1",children:[f.jsx(ni,{defaultSize:70,minSize:30,children:f.jsxs(Tf,{direction:"horizontal",className:"h-full",children:[f.jsx(ni,{defaultSize:30,minSize:20,maxSize:50,children:f.jsxs("div",{className:"h-full flex flex-col border-r border-border bg-background",children:[f.jsxs("div",{className:"flex items-center justify-between px-4 py-4 border-b border-border bg-background",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(MS,{className:"h-3 w-3 text-muted-foreground"}),f.jsx("h2",{className:"text-xs font-semibold text-foreground",children:"Resources"}),f.jsx(vr,{variant:"secondary",className:"text-xs font-mono",children:n.length})]}),f.jsx(Ie,{onClick:x,variant:"ghost",size:"sm",disabled:p,children:f.jsx(ir,{className:`h-3 w-3 ${p?"animate-spin":""} cursor-pointer`})})]}),f.jsx("div",{className:"flex-1 overflow-hidden",children:f.jsx(La,{className:"h-full",children:f.jsx("div",{className:"p-2",children:p?f.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[f.jsx("div",{className:"w-8 h-8 bg-muted rounded-full flex items-center justify-center mb-3",children:f.jsx(ir,{className:"h-4 w-4 text-muted-foreground animate-spin cursor-pointer"})}),f.jsx("p",{className:"text-xs text-muted-foreground font-semibold mb-1",children:"Loading resources..."}),f.jsx("p",{className:"text-xs text-muted-foreground/70",children:"Fetching available resources from server"})]}):n.length===0?f.jsx("div",{className:"text-center py-8",children:f.jsx("p",{className:"text-sm text-muted-foreground",children:"No resources available"})}):f.jsx("div",{className:"space-y-1",children:n.map(S=>f.jsx("div",{className:`cursor-pointer transition-all duration-200 hover:bg-muted/30 dark:hover:bg-muted/50 p-3 rounded-md mx-2 ${s===S.uri?"bg-muted/50 dark:bg-muted/50 shadow-sm border border-border ring-1 ring-ring/20":"hover:shadow-sm"}`,onClick:()=>i(S.uri),children:f.jsxs("div",{className:"flex items-start gap-3",children:[f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[f.jsx(kse,{className:"h-3 w-3 text-muted-foreground flex-shrink-0"}),f.jsx("code",{className:"font-mono text-xs font-medium text-foreground bg-muted px-1.5 py-0.5 rounded border border-border",children:S.name})]}),S.description&&f.jsx("p",{className:"text-xs mt-2 line-clamp-2 leading-relaxed text-muted-foreground",children:S.description}),f.jsx("p",{className:"text-xs text-muted-foreground/70 mt-1 font-mono truncate",children:S.uri}),S.mimeType&&f.jsx(vr,{variant:"outline",className:"text-xs mt-2 font-mono",children:S.mimeType})]}),f.jsx(Ba,{className:"h-3 w-3 text-muted-foreground flex-shrink-0 mt-1"})]})},S.uri))})})})})]})}),f.jsx(Cf,{withHandle:!0}),f.jsx(ni,{defaultSize:70,minSize:50,children:f.jsx("div",{className:"h-full flex flex-col bg-background",children:s?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"flex items-center justify-between px-6 py-5 border-b border-border bg-background",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx("div",{className:"flex items-center gap-3",children:f.jsx("code",{className:"font-mono font-semibold text-foreground bg-muted px-2 py-1 rounded-md border border-border text-xs",children:b?.name||s})}),f.jsx("p",{className:"text-xs text-muted-foreground font-mono truncate max-w-md",children:s})]}),f.jsx(Ie,{onClick:()=>E(s),disabled:u,className:"bg-primary hover:bg-primary/90 text-primary-foreground shadow-sm transition-all duration-200 cursor-pointer",size:"sm",children:u?f.jsxs(f.Fragment,{children:[f.jsx(ir,{className:"h-3 w-3 mr-1.5 animate-spin cursor-pointer"}),f.jsx("span",{className:"font-mono text-xs",children:"Reading"})]}):f.jsxs(f.Fragment,{children:[f.jsx(lI,{className:"h-3 w-3 mr-1.5 cursor-pointer"}),f.jsx("span",{className:"font-mono text-xs",children:"Read"})]})})]}),b?.description&&f.jsx("div",{className:"px-6 py-4 bg-muted/50 border-b border-border",children:f.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed font-medium",children:b.description})}),f.jsx("div",{className:"flex-1 overflow-hidden",children:f.jsx(La,{className:"h-full",children:f.jsx("div",{className:"px-6 py-6",children:a?f.jsx("div",{className:"space-y-4",children:a?.contents?.map((S,k)=>f.jsxs("div",{className:"group",children:[f.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[f.jsx(vr,{variant:"secondary",className:"text-xs font-mono font-medium",children:S.type}),S.mimeType&&f.jsx(vr,{variant:"outline",className:"text-xs font-mono",children:S.mimeType})]}),f.jsx("div",{className:"border border-border rounded-md overflow-hidden",children:S.type==="text"?f.jsx("pre",{className:"text-xs font-mono whitespace-pre-wrap p-4 bg-background overflow-auto max-h-96",children:S.text}):f.jsx("div",{className:"p-4",children:f.jsx(zl,{src:S,dark:!0,theme:"atom",enableClipboard:!0,displaySize:!1,collapseStringsAfterLength:100,style:{fontSize:"12px",fontFamily:"ui-monospace, SFMono-Regular, 'SF Mono', monospace",backgroundColor:"hsl(var(--background))",padding:"0",borderRadius:"0",border:"none"}})})})]},k))}):f.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[f.jsx("div",{className:"w-10 h-10 bg-muted rounded-full flex items-center justify-center mb-3",children:f.jsx(lI,{className:"h-4 w-4 text-muted-foreground"})}),f.jsx("p",{className:"text-xs text-muted-foreground font-semibold mb-1",children:"Ready to read resource"}),f.jsx("p",{className:"text-xs text-muted-foreground/70",children:"Click the Read button to view resource content"})]})})})})]}):f.jsx("div",{className:"h-full flex items-center justify-center",children:f.jsxs("div",{className:"text-center",children:[f.jsx("div",{className:"w-12 h-12 bg-muted rounded-full flex items-center justify-center mx-auto mb-3",children:f.jsx(MS,{className:"h-5 w-5 text-muted-foreground"})}),f.jsx("p",{className:"text-xs font-semibold text-foreground mb-1",children:"Select a resource"}),f.jsx("p",{className:"text-xs text-muted-foreground font-medium",children:"Choose a resource from the left to preview its content"})]})})})})]})}),f.jsx(Cf,{withHandle:!0}),f.jsx(ni,{defaultSize:30,minSize:15,maxSize:70,children:f.jsxs("div",{className:"h-full flex flex-col border-t border-border bg-background",children:[f.jsx("div",{className:"flex items-center justify-between p-4 border-b border-border",children:f.jsx("h2",{className:"text-xs font-semibold text-foreground",children:"Status"})}),f.jsx("div",{className:"flex-1 overflow-hidden",children:g?f.jsx("div",{className:"p-4",children:f.jsx("div",{className:"p-3 bg-destructive/10 border border-destructive/20 rounded text-destructive text-xs font-medium",children:g})}):f.jsx("div",{className:"flex items-center justify-center h-full",children:f.jsx("p",{className:"text-xs text-muted-foreground font-medium",children:"Resource operations status will appear here"})})})]})})]})})}function Qhe({serverConfig:t,serverName:e}){const[n,r]=w.useState([]),[s,i]=w.useState(""),[a,l]=w.useState([]),[u,d]=w.useState(null),[p,h]=w.useState(!1),[g,v]=w.useState(!1),[b,x]=w.useState(""),E=w.useMemo(()=>n.find(N=>N.name===s)??null,[n,s]);w.useEffect(()=>{t&&e&&S()},[t,e]),w.useEffect(()=>{E?.arguments?k(E.arguments):l([])},[E]);const S=async()=>{if(e){v(!0),x("");try{const N=await fetch("/api/mcp/prompts/list",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({serverId:e})}),M=await N.json();if(N.ok){const I=Array.isArray(M.prompts)?M.prompts:[];r(I),I.length===0?(i(""),d(null)):I.some(O=>O.name===s)||(i(I[0].name),d(null))}else x(M.error||"Could not fetch prompts")}catch(N){x(`Could not fetch prompts: ${N}`)}finally{v(!1)}}},k=N=>{if(!N||N.length===0){l([]);return}const M=N.map(I=>({name:I.name,type:"string",description:I.description,required:!!I.required,value:""}));l(M)},T=(N,M)=>{l(I=>I.map(O=>O.name===N?{...O,value:M}:O))},R=()=>{const N={};return a.forEach(M=>{if(M.value!==""&&M.value!==null&&M.value!==void 0){let I;M.type==="array"||M.type==="object"?I=typeof M.value=="string"?M.value:JSON.stringify(M.value):M.type==="boolean"?I=M.value?"true":"false":(M.type==="number"||M.type,I=String(M.value)),N[M.name]=I}}),N},j=async()=>{if(!(!s||!e)){h(!0),x("");try{const N=R(),M=await fetch("/api/mcp/prompts/get",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({serverId:e,name:s,args:N})}),I=await M.json();M.ok?d(I.content):x(I.error||"Failed to get prompt")}catch(N){x(`Error getting prompt: ${N}`)}finally{h(!1)}}},A=n.map(N=>N.name);return!t||!e?f.jsx(th,{icon:Gy,title:"No Server Selected",description:"Connect to an MCP server to explore and test its available prompts."}):f.jsx("div",{className:"h-[calc(100vh-120px)] flex flex-col",children:f.jsxs(Tf,{direction:"vertical",className:"flex-1",children:[f.jsx(ni,{defaultSize:70,minSize:30,children:f.jsxs(Tf,{direction:"horizontal",className:"h-full",children:[f.jsx(ni,{defaultSize:30,minSize:20,maxSize:50,children:f.jsxs("div",{className:"h-full flex flex-col border-r border-border bg-background",children:[f.jsxs("div",{className:"flex items-center justify-between px-4 py-4 border-b border-border bg-background",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(Gy,{className:"h-3 w-3 text-muted-foreground"}),f.jsx("h2",{className:"text-xs font-semibold text-foreground",children:"Prompts"}),f.jsx(vr,{variant:"secondary",className:"text-xs font-mono",children:A.length})]}),f.jsx(Ie,{onClick:S,variant:"ghost",size:"sm",disabled:g,children:f.jsx(ir,{className:`h-3 w-3 ${g?"animate-spin":""} cursor-pointer`})})]}),f.jsx("div",{className:"flex-1 overflow-hidden",children:f.jsx(La,{className:"h-full",children:f.jsx("div",{className:"p-2",children:g?f.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[f.jsx("div",{className:"w-8 h-8 bg-muted rounded-full flex items-center justify-center mb-3",children:f.jsx(ir,{className:"h-4 w-4 text-muted-foreground animate-spin cursor-pointer"})}),f.jsx("p",{className:"text-xs text-muted-foreground font-semibold mb-1",children:"Loading prompts..."}),f.jsx("p",{className:"text-xs text-muted-foreground/70",children:"Fetching available prompts from server"})]}):A.length===0?f.jsx("div",{className:"text-center py-8",children:f.jsx("p",{className:"text-sm text-muted-foreground",children:"No prompts available"})}):f.jsx("div",{className:"space-y-1",children:n.map(N=>{const M=s===N.name,I=N.title??N.name;return f.jsx("div",{className:`cursor-pointer transition-all duration-200 hover:bg-muted/30 dark:hover:bg-muted/50 p-3 rounded-md mx-2 ${M?"bg-muted/50 dark:bg-muted/50 shadow-sm border border-border ring-1 ring-ring/20":"hover:shadow-sm"}`,onClick:()=>{i(N.name)},children:f.jsxs("div",{className:"flex items-start gap-3",children:[f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[f.jsx("code",{className:"font-mono text-xs font-medium text-foreground bg-muted px-1.5 py-0.5 rounded border border-border",children:N.name}),N.title&&f.jsx("span",{className:"text-xs font-semibold text-foreground",children:I})]}),N.description&&f.jsx("p",{className:"text-xs mt-2 line-clamp-2 leading-relaxed text-muted-foreground",children:N.description})]}),f.jsx(Ba,{className:"h-3 w-3 text-muted-foreground flex-shrink-0 mt-1"})]})},N.name)})})})})})]})}),f.jsx(Cf,{withHandle:!0}),f.jsx(ni,{defaultSize:70,minSize:50,children:f.jsx("div",{className:"h-full flex flex-col bg-background",children:s?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"flex items-center justify-between px-6 py-5 border-b border-border bg-background",children:[f.jsx("div",{className:"space-y-2",children:f.jsx("div",{className:"flex items-center gap-3",children:f.jsx("code",{className:"font-mono font-semibold text-foreground bg-muted px-2 py-1 rounded-md border border-border text-xs",children:s})})}),f.jsx(Ie,{onClick:j,disabled:p||!s,className:"bg-primary hover:bg-primary/90 text-primary-foreground shadow-sm transition-all duration-200 cursor-pointer",size:"sm",children:p?f.jsxs(f.Fragment,{children:[f.jsx(ir,{className:"h-3 w-3 mr-1.5 animate-spin cursor-pointer"}),f.jsx("span",{className:"font-mono text-xs",children:"Loading"})]}):f.jsxs(f.Fragment,{children:[f.jsx(Cb,{className:"h-3 w-3 mr-1.5 cursor-pointer"}),f.jsx("span",{className:"font-mono text-xs",children:"Get Prompt"})]})})]}),E?.description&&f.jsx("div",{className:"px-6 py-4 bg-muted/50 border-b border-border",children:f.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed font-medium",children:E.description})}),f.jsx("div",{className:"flex-1 overflow-hidden",children:f.jsx(La,{className:"h-full",children:f.jsx("div",{className:"px-6 py-6",children:a.length===0?f.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[f.jsx("div",{className:"w-10 h-10 bg-muted rounded-full flex items-center justify-center mb-3",children:f.jsx(Cb,{className:"h-4 w-4 text-muted-foreground"})}),f.jsx("p",{className:"text-xs text-muted-foreground font-semibold mb-1",children:"No parameters required"}),f.jsx("p",{className:"text-xs text-muted-foreground/70",children:"This prompt can be retrieved directly"})]}):f.jsx("div",{className:"space-y-8",children:a.map(N=>f.jsxs("div",{className:"group",children:[f.jsxs("div",{className:"flex items-start justify-between mb-3",children:[f.jsxs("div",{className:"space-y-1",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("code",{className:"font-mono text-xs font-semibold text-foreground bg-muted px-1.5 py-0.5 rounded border border-border",children:N.name}),N.required&&f.jsx("div",{className:"w-1.5 h-1.5 bg-amber-400 dark:bg-amber-500 rounded-full",title:"Required field"})]}),N.description&&f.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed max-w-md font-medium",children:N.description})]}),f.jsx(vr,{variant:"secondary",className:"text-xs font-mono font-medium",children:N.type})]}),f.jsx("div",{className:"space-y-2",children:N.type==="enum"?f.jsxs(Qc,{value:String(N.value),onValueChange:M=>T(N.name,M),children:[f.jsx(Zc,{className:"w-full bg-background border-border hover:border-border/80 focus:border-ring focus:ring-0 font-medium text-xs",children:f.jsx(Jc,{placeholder:"Select an option",className:"font-mono text-xs"})}),f.jsx(eu,{children:N.enum?.map(M=>f.jsx(Qs,{value:M,className:"font-mono text-xs",children:M},M))})]}):N.type==="boolean"?f.jsxs("div",{className:"flex items-center space-x-3 py-2",children:[f.jsx("input",{type:"checkbox",checked:N.value===!0,onChange:M=>T(N.name,M.target.checked),className:"w-4 h-4 text-primary bg-background border-border rounded focus:ring-ring focus:ring-2"}),f.jsx("span",{className:"text-xs text-foreground font-medium",children:N.value===!0?"Enabled":"Disabled"})]}):N.type==="array"||N.type==="object"?f.jsx(Ho,{value:typeof N.value=="string"?N.value:JSON.stringify(N.value,null,2),onChange:M=>T(N.name,M.target.value),placeholder:`Enter ${N.type} as JSON`,className:"font-mono text-xs h-20 bg-background border-border hover:border-border/80 focus:border-ring focus:ring-0 resize-none"}):f.jsx(Un,{type:N.type==="number"||N.type==="integer"?"number":"text",value:String(N.value),onChange:M=>T(N.name,M.target.value),placeholder:`Enter ${N.name}`,className:"bg-background border-border hover:border-border/80 focus:border-ring focus:ring-0 font-medium text-xs"})})]},N.name))})})})})]}):f.jsx("div",{className:"h-full flex items-center justify-center",children:f.jsxs("div",{className:"text-center",children:[f.jsx("div",{className:"w-12 h-12 bg-muted rounded-full flex items-center justify-center mx-auto mb-3",children:f.jsx(Gy,{className:"h-5 w-5 text-muted-foreground"})}),f.jsx("p",{className:"text-xs font-semibold text-foreground mb-1",children:"Select a prompt"}),f.jsx("p",{className:"text-xs text-muted-foreground font-medium",children:"Choose a prompt from the left to view details"})]})})})})]})}),f.jsx(Cf,{withHandle:!0}),f.jsx(ni,{defaultSize:30,minSize:15,maxSize:70,children:f.jsxs("div",{className:"h-full flex flex-col border-t border-border bg-background",children:[f.jsx("div",{className:"flex items-center justify-between p-4 border-b border-border",children:f.jsx("h2",{className:"text-xs font-semibold text-foreground",children:"Prompt Content"})}),f.jsx("div",{className:"flex-1 overflow-hidden",children:b?f.jsx("div",{className:"p-4",children:f.jsx("div",{className:"p-3 bg-destructive/10 border border-destructive/20 rounded text-destructive text-xs font-medium",children:b})}):u?f.jsx(La,{className:"h-full",children:f.jsx("div",{className:"p-4",children:typeof u=="string"?f.jsx("pre",{className:"whitespace-pre-wrap text-xs font-mono bg-muted p-4 rounded-md border border-border",children:u}):f.jsx(zl,{src:u,dark:!0,theme:"atom",enableClipboard:!0,displaySize:!1,collapseStringsAfterLength:100,style:{fontSize:"12px",fontFamily:"ui-monospace, SFMono-Regular, 'SF Mono', monospace",backgroundColor:"hsl(var(--background))",padding:"16px",borderRadius:"8px",border:"1px solid hsl(var(--border))"}})})}):f.jsx("div",{className:"flex items-center justify-center h-full",children:f.jsx("p",{className:"text-xs text-muted-foreground font-medium",children:"Get a prompt to see its content here"})})})]})})]})})}var nV=t=>{throw TypeError(t)},XN=(t,e,n)=>e.has(t)||nV("Cannot "+n),Ht=(t,e,n)=>(XN(t,e,"read from private field"),n?n.call(t):e.get(t)),Ts=(t,e,n)=>e.has(t)?nV("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),sr=(t,e,n,r)=>(XN(t,e,"write to private field"),e.set(t,n),n),Kn=(t,e,n)=>(XN(t,e,"access private method"),n),Jhe=class extends Error{constructor(){super(...arguments),this.status=500,this.name="NoClientIdProvidedException",this.message='Missing Client ID. Pass it to the constructor (createClient("client_01HXRMBQ9BJ3E7QSTQ9X2PHVB7"))'}};function Zhe(t,e){if(!e.has("code"))return!1;const{pathname:r}=window.location,s=new URL(t).pathname;return r===s||r===`${s}/`}function epe(){let t={};function e(i,a){t[i]=a}function n(i){return t[i]}function r(i){delete t[i]}function s(){t={}}return{setItem:e,getItem:n,removeItem:r,reset:s}}var Ms=epe();async function tpe(){const t=npe(),e=await rpe(t);return{codeVerifier:t,codeChallenge:e}}function npe(){const t=crypto.getRandomValues(new Uint32Array(96));return rV(t)}async function rpe(t){const e=await spe(t);return rV(e)}function rV(t){return btoa(Array.from(new Uint8Array(t),e=>String.fromCharCode(e)).join("")).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function spe(t){const n=new TextEncoder().encode(t);return crypto.subtle.digest("SHA-256",n)}function u3(t){const e=t.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-e.length%4)%4);return atob(e+n)}function ipe(t){const e=t.split(".");if(e.length!==3)throw new Error("Invalid JWT format");try{const n=JSON.parse(u3(e[0])),r=JSON.parse(u3(e[1]));return{header:n,payload:r}}catch(n){throw new Error(`Failed to decode JWT: ${n instanceof Error?n.message:String(n)}`)}}var ts={codeVerifier:"workos:code-verifier",user:"workos:user",accessToken:"workos:access-token",refreshToken:"workos:refresh-token",expiresAt:"workos:expires-at"};function D0(t){return ipe(t).payload}function sV(t,{devMode:e=!1}={}){const{user:n,accessToken:r,refreshToken:s}=t;Ms.setItem(ts.user,n),Ms.setItem(ts.accessToken,r),(e?window.localStorage:Ms).setItem(ts.refreshToken,s);const{exp:i,iat:a}=D0(r),l=i-a,u=Date.now()+l*1e3;Ms.setItem(ts.expiresAt,u)}function iV({devMode:t=!1}={}){Ms.removeItem(ts.user),Ms.removeItem(ts.accessToken),(t?window.localStorage:Ms).removeItem(ts.refreshToken)}function aV({devMode:t=!1}={}){return(t?window.localStorage:Ms).getItem(ts.refreshToken)}function ape(t){const e=new URLSearchParams,n=Object.keys(t).sort();for(const r of n){const s=t[r];s&&e.append(r,s)}return e.toString()}var QN=class extends Error{},sx=class extends QN{},ope=class extends QN{},BT=class extends QN{constructor(){super(...arguments),this.message="No access token available"}},lpe=class Vp{constructor(){this.locked=new Map,this.addToLocked=(e,n)=>{let r=this.locked.get(e);r===void 0?n===void 0?this.locked.set(e,[]):this.locked.set(e,[n]):n!==void 0&&(r.unshift(n),this.locked.set(e,r))},this.isLocked=e=>this.locked.has(e),this.lock=e=>new Promise((n,r)=>{this.isLocked(e)?this.addToLocked(e,n):(this.addToLocked(e),n())}),this.unlock=e=>{let n=this.locked.get(e);if(n===void 0||n.length===0){this.locked.delete(e);return}let r=n.pop();this.locked.set(e,n),r!==void 0&&setTimeout(r,0)}}static getInstance(){return Vp.instance===void 0&&(Vp.instance=new Vp),Vp.instance}};function Ed(){return lpe.getInstance()}var QE="browser-tabs-lock-key",fy={key:async t=>{throw new Error("Unsupported")},getItem:async t=>{throw new Error("Unsupported")},clear:async()=>window.localStorage.clear(),removeItem:async t=>{throw new Error("Unsupported")},setItem:async(t,e)=>{throw new Error("Unsupported")},keySync:t=>window.localStorage.key(t),getItemSync:t=>window.localStorage.getItem(t),clearSync:()=>window.localStorage.clear(),removeItemSync:t=>window.localStorage.removeItem(t),setItemSync:(t,e)=>window.localStorage.setItem(t,e)};function JE(t){return new Promise(e=>setTimeout(e,t))}function qT(t){const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";let n="";for(let r=0;r<t;r++){const s=Math.floor(Math.random()*e.length);n+=e[s]}return n}function cpe(){return Date.now().toString()+qT(15)}var oV=class us{constructor(e){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=cpe(),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),this.storageHandler=e,us.waiters===void 0&&(us.waiters=[])}async acquireLock(e,n=5e3){let r=Date.now()+qT(4);const s=Date.now()+n,i=`${QE}-${e}`,a=this.storageHandler===void 0?fy:this.storageHandler;for(;Date.now()<s;){if(await JE(30),a.getItemSync(i)===null){const u=`${this.id}-${e}-${r}`;await JE(Math.floor(Math.random()*25)),a.setItemSync(i,JSON.stringify({id:this.id,iat:r,timeoutKey:u,timeAcquired:Date.now(),timeRefreshed:Date.now()})),await JE(30);let d=a.getItemSync(i);if(d!==null){let p=JSON.parse(d);if(p.id===this.id&&p.iat===r)return this.acquiredIatSet.add(r),this.refreshLockWhileAcquired(i,r),!0}}else us.lockCorrector(this.storageHandler===void 0?fy:this.storageHandler),await this.waitForSomethingToChange(s);r=Date.now()+qT(4)}return!1}async refreshLockWhileAcquired(e,n){setTimeout(async()=>{if(await Ed().lock(n),!this.acquiredIatSet.has(n)){Ed().unlock(n);return}const r=this.storageHandler===void 0?fy:this.storageHandler;let s=r.getItemSync(e);if(s!==null){let i=JSON.parse(s);i.timeRefreshed=Date.now(),r.setItemSync(e,JSON.stringify(i)),Ed().unlock(n)}else{Ed().unlock(n);return}this.refreshLockWhileAcquired(e,n)},1e3)}async waitForSomethingToChange(e){await new Promise(n=>{let r=!1,s=Date.now();const i=50;let a=!1;function l(){if(a||(window.removeEventListener("storage",l),us.removeFromWaiting(l),clearTimeout(u),a=!0),!r){r=!0;let d=i-(Date.now()-s);d>0?setTimeout(n,d):n(null)}}window.addEventListener("storage",l),us.addToWaiting(l);let u=setTimeout(l,Math.max(0,e-Date.now()))})}static addToWaiting(e){this.removeFromWaiting(e),us.waiters!==void 0&&us.waiters.push(e)}static removeFromWaiting(e){us.waiters!==void 0&&(us.waiters=us.waiters.filter(n=>n!==e))}static notifyWaiters(){if(us.waiters===void 0)return;[...us.waiters].forEach(n=>n())}async releaseLock(e){return await this.releaseLock__private__(e)}async releaseLock__private__(e){const n=this.storageHandler===void 0?fy:this.storageHandler,r=`${QE}-${e}`;let s=n.getItemSync(r);if(s===null)return;let i=JSON.parse(s);i.id===this.id&&(await Ed().lock(i.iat),this.acquiredIatSet.delete(i.iat),n.removeItemSync(r),Ed().unlock(i.iat),us.notifyWaiters())}static lockCorrector(e){const n=Date.now()-5e3,r=e,s=[];let i=0;for(;;){let l=r.keySync(i);if(l===null)break;s.push(l),i++}let a=!1;for(let l=0;l<s.length;l++){const u=s[l];if(u.includes(QE)){let d=r.getItemSync(u);if(d!==null){let p=JSON.parse(d);(p.timeRefreshed===void 0&&p.timeAcquired<n||p.timeRefreshed!==void 0&&p.timeRefreshed<n)&&(r.removeItemSync(u),a=!0)}}}a&&us.notifyWaiters()}};oV.waiters=void 0;var upe=oV,dpe=1e4;function fpe(t,e,{timeout:n=dpe}={}){return"locks"in navigator?hpe(t,e,n):ppe(t,e,n)}async function hpe(t,e,n){try{return await navigator.locks.request(t,{signal:AbortSignal.timeout(n)},e)}catch(r){if(r instanceof DOMException)switch(r.name){case"AbortError":throw new JN("AcquisitionTimeoutError",t,"Native")}throw r}}async function ppe(t,e,n){const r=new upe;try{if(await r.acquireLock(t,n))return await e();throw new JN("AcquisitionTimeoutError",t,"Vendor")}finally{await r.releaseLock(t)}}var JN=class extends Error{constructor(t,e,n){super(`Lock acquisition timed out for "${e}" (${n})`),this.name=t,this.lockName=e}},mpe=t=>({object:t.object,id:t.id,email:t.email,emailVerified:t.email_verified,firstName:t.first_name,profilePictureUrl:t.profile_picture_url,lastName:t.last_name,lastSignInAt:t.last_sign_in_at,externalId:t.external_id,createdAt:t.created_at,updatedAt:t.updated_at}),d3=t=>{const{user:e,organization_id:n,access_token:r,refresh_token:s,impersonator:i,...a}=t;return{user:mpe(e),organizationId:n,accessToken:r,refreshToken:s,impersonator:i,...a}},gpe="api.workos.com",Vd,$d,Zy,VT,vpe=class{constructor({clientId:t,hostname:e=gpe,port:n,https:r=!0}){Ts(this,Zy),Ts(this,Vd),Ts(this,$d),sr(this,Vd,`${r?"https":"http"}://${e}${n?`:${n}`:""}`),sr(this,$d,t)}async authenticateWithRefreshToken({refreshToken:t,organizationId:e,useCookie:n}){const r=await Kn(this,Zy,VT).call(this,"/user_management/authenticate",{useCookie:n,body:{client_id:Ht(this,$d),grant_type:"refresh_token",...!n&&{refresh_token:t},organization_id:e}});if(r.ok){const s=await r.json();return d3(s)}else{const s=await r.json();throw new sx(s.error_description)}}async authenticateWithCode({code:t,codeVerifier:e,useCookie:n}){const r=await Kn(this,Zy,VT).call(this,"/user_management/authenticate",{useCookie:n,body:{code:t,client_id:Ht(this,$d),grant_type:"authorization_code",code_verifier:e}});if(r.ok){const i=await r.json();return d3(i)}const s=await r.json();throw new ope(s.error_description)}getAuthorizationUrl({connectionId:t,context:e,domainHint:n,loginHint:r,organizationId:s,provider:i="authkit",redirectUri:a,state:l,screenHint:u,passwordResetToken:d,invitationToken:p,codeChallenge:h,codeChallengeMethod:g}){if(!i&&!t&&!s)throw new TypeError("Incomplete arguments. Need to specify either a 'connectionId', 'organizationId', or 'provider'.");if(i!=="authkit"&&u)throw new TypeError("'screenHint' is only supported for 'authkit' provider");e&&console.warn("`context` is deprecated. We previously required initiate login endpoints to return the\n`context` query parameter when getting the authorization URL. This is no longer necessary.");const v=ape({connection_id:t,organization_id:s,domain_hint:n,login_hint:r,provider:i,client_id:Ht(this,$d),redirect_uri:a,response_type:"code",state:l,screen_hint:u,invitation_token:p,password_reset_token:d,code_challenge:h,code_challenge_method:g});return`${Ht(this,Vd)}/user_management/authorize?${v}`}getLogoutUrl({sessionId:t,returnTo:e}){const n=new URL("/user_management/sessions/logout",Ht(this,Vd));return n.searchParams.set("session_id",t),e&&n.searchParams.set("return_to",e),n}};Vd=new WeakMap;$d=new WeakMap;Zy=new WeakSet;VT=function(t,{body:e,useCookie:n}){return fetch(new URL(t,Ht(this,Vd)),{method:"POST",...n&&{credentials:"include"},headers:{Accept:"application/json, text/plain, */*","Content-Type":"application/json"},body:JSON.stringify(e)})};var f3="workos_organization_id",ype="WORKOS_REFRESH_SESSION",gr,ix,nu,tm,Aa,ax,ox,$m,zm,lx,On,lV,nm,rm,cV,ZN,Hp,eR,tR,nR,bpe=class{constructor(t,{apiHostname:e,https:n,port:r,redirectUri:s=window.origin,devMode:i=location.hostname==="localhost"||location.hostname==="127.0.0.1",onBeforeAutoRefresh:a=()=>!document.hidden,onRedirectCallback:l=h=>{},onRefresh:u,onRefreshFailure:d,refreshBufferInterval:p=10}={}){if(Ts(this,On),Ts(this,gr),Ts(this,ix),Ts(this,nu),Ts(this,tm),Ts(this,Aa),Ts(this,ax),Ts(this,ox),Ts(this,$m),Ts(this,zm),Ts(this,lx),!t)throw new Jhe;sr(this,nu,new vpe({clientId:t,hostname:e,port:r,https:n})),sr(this,Aa,i),sr(this,tm,s),sr(this,gr,{tag:"INITIAL"}),sr(this,ax,a),sr(this,ox,l),sr(this,$m,u),sr(this,zm,d),sr(this,lx,p)}async initialize(){if(Ht(this,gr).tag!=="INITIAL")return;const t=new URLSearchParams(window.location.search);if(Zhe(Ht(this,tm),t))await Kn(this,On,lV).call(this);else if(document.cookie.includes("workos-has-session=")||aV({devMode:Ht(this,Aa)}))try{await Kn(this,On,rm).call(this),Kn(this,On,nm).call(this)}catch{}}async getSignInUrl(t={}){return await Kn(this,On,Hp).call(this,{...t,type:"sign-in"})}async getSignUpUrl(t={}){return await Kn(this,On,Hp).call(this,{...t,type:"sign-up"})}async signIn(t={}){const e=await Kn(this,On,Hp).call(this,{...t,type:"sign-in"});window.location.assign(e)}async signUp(t={}){const e=await Kn(this,On,Hp).call(this,{...t,type:"sign-up"});window.location.assign(e)}signOut(t={navigate:!0}){const e=t.navigate??!0,n=Ms.getItem(ts.accessToken);if(typeof n!="string")return;const{sid:r}=D0(n),s=Ht(this,nu).getLogoutUrl({sessionId:r,returnTo:t?.returnTo});if(s)if(iV({devMode:Ht(this,Aa)}),e)window.location.assign(s);else return new Promise(async i=>{fetch(s,{mode:"no-cors",credentials:"include"}).catch(a=>{console.warn("AuthKit: Failed to send logout request",a)}).finally(i)})}async getAccessToken(t){if(t?.forceRefresh||Kn(this,On,ZN).call(this))try{await Kn(this,On,rm).call(this)}catch(n){throw n instanceof sx?new BT:n}const e=Kn(this,On,eR).call(this);if(!e)throw new BT;return e}getUser(){const t=Ms.getItem(ts.user);return t||null}dispose(){clearTimeout(Ht(this,ix)),Ms.reset()}async switchToOrganization({organizationId:t,signInOpts:e={}}){try{await Kn(this,On,rm).call(this,{organizationId:t})}catch(n){if(n instanceof sx)this.signIn({...e,organizationId:t});else throw n}}};gr=new WeakMap;ix=new WeakMap;nu=new WeakMap;tm=new WeakMap;Aa=new WeakMap;ax=new WeakMap;ox=new WeakMap;$m=new WeakMap;zm=new WeakMap;lx=new WeakMap;On=new WeakSet;lV=async function(){if(Ht(this,gr).tag!=="INITIAL")return;const t=new URL(window.location.href),e=t.searchParams.get("code"),n=t.searchParams.get("state"),r=n?JSON.parse(n):void 0,s=window.sessionStorage.getItem(ts.codeVerifier);if(e)if(s)try{sr(this,gr,{tag:"AUTHENTICATING",response:Ht(this,nu).authenticateWithCode({code:e,codeVerifier:s,useCookie:Ht(this,On,tR)})});const a=await Ht(this,gr).response;a&&(sr(this,gr,{tag:"AUTHENTICATED"}),Kn(this,On,nm).call(this),sV(a,{devMode:Ht(this,Aa)}),Kn(this,On,nR).call(this,a),Ht(this,ox).call(this,{state:r,...a}))}catch(a){sr(this,gr,{tag:"ERROR"}),console.error(a)}else sr(this,gr,{tag:"ERROR"}),console.error(`Couldn't exchange code.
|
|
1776
1776
|
|
|
1777
1777
|
An authorization_code was supplied for a login which did not originate at the application. This could happen for various reasons:
|
|
1778
1778
|
|
|
@@ -1814,10 +1814,10 @@ An authorization_code was supplied for a login which did not originate at the ap
|
|
|
1814
1814
|
`))+1))}const a="#".repeat(s),l=n.enter("headingAtx"),u=n.enter("phrasing");i.move(a+" ");let d=n.containerPhrasing(t,{before:"# ",after:`
|
|
1815
1815
|
`,...i.current()});return/^[\t ]/.test(d)&&(d=Wm(d.charCodeAt(0))+d.slice(1)),d=d?a+" "+d:a,n.options.closeAtx&&(d+=" "+a),u(),l(),d}j8.peek=TSe;function j8(t){return t.value||""}function TSe(){return"<"}M8.peek=CSe;function M8(t,e,n,r){const s=ZR(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("image");let l=n.enter("label");const u=n.createTracker(r);let d=u.move("![");return d+=u.move(n.safe(t.alt,{before:d,after:"]",...u.current()})),d+=u.move("]("),l(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(l=n.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(n.safe(t.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(l=n.enter("destinationRaw"),d+=u.move(n.safe(t.url,{before:d,after:t.title?" ":")",...u.current()}))),l(),t.title&&(l=n.enter(`title${i}`),d+=u.move(" "+s),d+=u.move(n.safe(t.title,{before:d,after:s,...u.current()})),d+=u.move(s),l()),d+=u.move(")"),a(),d}function CSe(){return"!"}O8.peek=ASe;function O8(t,e,n,r){const s=t.referenceType,i=n.enter("imageReference");let a=n.enter("label");const l=n.createTracker(r);let u=l.move("![");const d=n.safe(t.alt,{before:u,after:"]",...l.current()});u+=l.move(d+"]["),a();const p=n.stack;n.stack=[],a=n.enter("reference");const h=n.safe(n.associationId(t),{before:u,after:"]",...l.current()});return a(),n.stack=p,i(),s==="full"||!d||d!==h?u+=l.move(h+"]"):s==="shortcut"?u=u.slice(0,-1):u+=l.move("]"),u}function ASe(){return"!"}P8.peek=NSe;function P8(t,e,n){let r=t.value||"",s="`",i=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i<n.unsafe.length;){const a=n.unsafe[i],l=n.compilePattern(a);let u;if(a.atBreak)for(;u=l.exec(r);){let d=u.index;r.charCodeAt(d)===10&&r.charCodeAt(d-1)===13&&d--,r=r.slice(0,d)+" "+r.slice(u.index+1)}}return s+r+s}function NSe(){return"`"}function I8(t,e){const n=VR(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(n===t.url||"mailto:"+n===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}D8.peek=RSe;function D8(t,e,n,r){const s=ZR(n),i=s==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let l,u;if(I8(t,n)){const p=n.stack;n.stack=[],l=n.enter("autolink");let h=a.move("<");return h+=a.move(n.containerPhrasing(t,{before:h,after:">",...a.current()})),h+=a.move(">"),l(),n.stack=p,h}l=n.enter("link"),u=n.enter("label");let d=a.move("[");return d+=a.move(n.containerPhrasing(t,{before:d,after:"](",...a.current()})),d+=a.move("]("),u(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(u=n.enter("destinationLiteral"),d+=a.move("<"),d+=a.move(n.safe(t.url,{before:d,after:">",...a.current()})),d+=a.move(">")):(u=n.enter("destinationRaw"),d+=a.move(n.safe(t.url,{before:d,after:t.title?" ":")",...a.current()}))),u(),t.title&&(u=n.enter(`title${i}`),d+=a.move(" "+s),d+=a.move(n.safe(t.title,{before:d,after:s,...a.current()})),d+=a.move(s),u()),d+=a.move(")"),l(),d}function RSe(t,e,n){return I8(t,n)?"<":"["}L8.peek=jSe;function L8(t,e,n,r){const s=t.referenceType,i=n.enter("linkReference");let a=n.enter("label");const l=n.createTracker(r);let u=l.move("[");const d=n.containerPhrasing(t,{before:u,after:"]",...l.current()});u+=l.move(d+"]["),a();const p=n.stack;n.stack=[],a=n.enter("reference");const h=n.safe(n.associationId(t),{before:u,after:"]",...l.current()});return a(),n.stack=p,i(),s==="full"||!d||d!==h?u+=l.move(h+"]"):s==="shortcut"?u=u.slice(0,-1):u+=l.move("]"),u}function jSe(){return"["}function ej(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function MSe(t){const e=ej(t),n=t.options.bulletOther;if(!n)return e==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+n+"`) to be different");return n}function OSe(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function $8(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function PSe(t,e,n,r){const s=n.enter("list"),i=n.bulletCurrent;let a=t.ordered?OSe(n):ej(n);const l=t.ordered?a==="."?")":".":MSe(n);let u=e&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!t.ordered){const p=t.children?t.children[0]:void 0;if((a==="*"||a==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),$8(n)===a&&p){let h=-1;for(;++h<t.children.length;){const g=t.children[h];if(g&&g.type==="listItem"&&g.children&&g.children[0]&&g.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(a=l),n.bulletCurrent=a;const d=n.containerFlow(t,r);return n.bulletLastUsed=a,n.bulletCurrent=i,s(),d}function ISe(t){const e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function DSe(t,e,n,r){const s=ISe(n);let i=n.bulletCurrent||ej(n);e&&e.type==="list"&&e.ordered&&(i=(typeof e.start=="number"&&e.start>-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+i);let a=i.length+1;(s==="tab"||s==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(a=Math.ceil(a/4)*4);const l=n.createTracker(r);l.move(i+" ".repeat(a-i.length)),l.shift(a);const u=n.enter("listItem"),d=n.indentLines(n.containerFlow(t,l.current()),p);return u(),d;function p(h,g,v){return g?(v?"":" ".repeat(a))+h:(v?i:i+" ".repeat(a-i.length))+h}}function LSe(t,e,n,r){const s=n.enter("paragraph"),i=n.enter("phrasing"),a=n.containerPhrasing(t,r);return i(),s(),a}const $Se=V0(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function zSe(t,e,n,r){return(t.children.some(function(a){return $Se(a)})?n.containerPhrasing:n.containerFlow).call(n,t,r)}function FSe(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}z8.peek=USe;function z8(t,e,n,r){const s=FSe(n),i=n.enter("strong"),a=n.createTracker(r),l=a.move(s+s);let u=a.move(n.containerPhrasing(t,{after:s,before:l,...a.current()}));const d=u.charCodeAt(0),p=bx(r.before.charCodeAt(r.before.length-1),d,s);p.inside&&(u=Wm(d)+u.slice(1));const h=u.charCodeAt(u.length-1),g=bx(r.after.charCodeAt(0),h,s);g.inside&&(u=u.slice(0,-1)+Wm(h));const v=a.move(s+s);return i(),n.attentionEncodeSurroundingInfo={after:g.outside,before:p.outside},l+u+v}function USe(t,e,n){return n.options.strong||"*"}function BSe(t,e,n,r){return n.safe(t.value,r)}function qSe(t){const e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function VSe(t,e,n){const r=($8(n)+(n.options.ruleSpaces?" ":"")).repeat(qSe(n));return n.options.ruleSpaces?r.slice(0,-1):r}const F8={blockquote:hSe,break:v4,code:bSe,definition:_Se,emphasis:R8,hardBreak:v4,heading:kSe,html:j8,image:M8,imageReference:O8,inlineCode:P8,link:D8,linkReference:L8,list:PSe,listItem:DSe,paragraph:LSe,root:zSe,strong:z8,text:BSe,thematicBreak:VSe};function HSe(){return{enter:{table:GSe,tableData:y4,tableHeader:y4,tableRow:YSe},exit:{codeText:KSe,table:WSe,tableData:j1,tableHeader:j1,tableRow:j1}}}function GSe(t){const e=t._align;this.enter({type:"table",align:e.map(function(n){return n==="none"?null:n}),children:[]},t),this.data.inTable=!0}function WSe(t){this.exit(t),this.data.inTable=void 0}function YSe(t){this.enter({type:"tableRow",children:[]},t)}function j1(t){this.exit(t)}function y4(t){this.enter({type:"tableCell",children:[]},t)}function KSe(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,XSe));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function XSe(t,e){return e==="|"?e:t}function QSe(t){const e=t||{},n=e.tableCellPadding,r=e.tablePipeAlign,s=e.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
1816
1816
|
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:g,table:a,tableCell:u,tableRow:l}};function a(v,b,x,E){return d(p(v,x,E),v.align)}function l(v,b,x,E){const S=h(v,x,E),k=d([S]);return k.slice(0,k.indexOf(`
|
|
1817
|
-
`))}function u(v,b,x,E){const S=x.enter("tableCell"),k=x.enter("phrasing"),T=x.containerPhrasing(v,{...E,before:i,after:i});return k(),S(),T}function d(v,b){return dSe(v,{align:b,alignDelimiters:r,padding:n,stringLength:s})}function p(v,b,x){const E=v.children;let S=-1;const k=[],T=b.enter("table");for(;++S<E.length;)k[S]=h(E[S],b,x);return T(),k}function h(v,b,x){const E=v.children;let S=-1;const k=[],T=b.enter("tableRow");for(;++S<E.length;)k[S]=u(E[S],v,b,x);return T(),k}function g(v,b,x){let E=F8.inlineCode(v,b,x);return x.stack.includes("tableCell")&&(E=E.replace(/\|/g,"\\$&")),E}}function JSe(){return{exit:{taskListCheckValueChecked:b4,taskListCheckValueUnchecked:b4,paragraph:eEe}}}function ZSe(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:tEe}}}function b4(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function eEe(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const s=e.children;let i=-1,a;for(;++i<s.length;){const l=s[i];if(l.type==="paragraph"){a=l;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(t)}function tEe(t,e,n,r){const s=t.children[0],i=typeof t.checked=="boolean"&&s&&s.type==="paragraph",a="["+(t.checked?"x":" ")+"] ",l=n.createTracker(r);i&&l.move(a);let u=F8.listItem(t,e,n,{...r,...l.current()});return i&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),u;function d(p){return p+a}}function nEe(){return[Pwe(),tSe(),iSe(),HSe(),JSe()]}function rEe(t){return{extensions:[Iwe(),nSe(t),aSe(),QSe(t),ZSe()]}}const sEe={tokenize:uEe,partial:!0},U8={tokenize:dEe,partial:!0},B8={tokenize:fEe,partial:!0},q8={tokenize:hEe,partial:!0},iEe={tokenize:pEe,partial:!0},V8={name:"wwwAutolink",tokenize:lEe,previous:G8},H8={name:"protocolAutolink",tokenize:cEe,previous:W8},Wo={name:"emailAutolink",tokenize:oEe,previous:Y8},Ka={};function aEe(){return{text:Ka}}let zc=48;for(;zc<123;)Ka[zc]=Wo,zc++,zc===58?zc=65:zc===91&&(zc=97);Ka[43]=Wo;Ka[45]=Wo;Ka[46]=Wo;Ka[95]=Wo;Ka[72]=[Wo,H8];Ka[104]=[Wo,H8];Ka[87]=[Wo,V8];Ka[119]=[Wo,V8];function oEe(t,e,n){const r=this;let s,i;return a;function a(h){return!wC(h)||!Y8.call(r,r.previous)||tj(r.events)?n(h):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),l(h))}function l(h){return wC(h)?(t.consume(h),l):h===64?(t.consume(h),u):n(h)}function u(h){return h===46?t.check(iEe,p,d)(h):h===45||h===95||rs(h)?(i=!0,t.consume(h),u):p(h)}function d(h){return t.consume(h),s=!0,u}function p(h){return i&&s&&fs(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(h)):n(h)}}function lEe(t,e,n){const r=this;return s;function s(a){return a!==87&&a!==119||!G8.call(r,r.previous)||tj(r.events)?n(a):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(sEe,t.attempt(U8,t.attempt(B8,i),n),n)(a))}function i(a){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(a)}}function cEe(t,e,n){const r=this;let s="",i=!1;return a;function a(h){return(h===72||h===104)&&W8.call(r,r.previous)&&!tj(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),s+=String.fromCodePoint(h),t.consume(h),l):n(h)}function l(h){if(fs(h)&&s.length<5)return s+=String.fromCodePoint(h),t.consume(h),l;if(h===58){const g=s.toLowerCase();if(g==="http"||g==="https")return t.consume(h),u}return n(h)}function u(h){return h===47?(t.consume(h),i?d:(i=!0,u)):n(h)}function d(h){return h===null||gx(h)||_n(h)||Su(h)||U0(h)?n(h):t.attempt(U8,t.attempt(B8,p),n)(h)}function p(h){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(h)}}function uEe(t,e,n){let r=0;return s;function s(a){return(a===87||a===119)&&r<3?(r++,t.consume(a),s):a===46&&r===3?(t.consume(a),i):n(a)}function i(a){return a===null?n(a):e(a)}}function dEe(t,e,n){let r,s,i;return a;function a(d){return d===46||d===95?t.check(q8,u,l)(d):d===null||_n(d)||Su(d)||d!==45&&U0(d)?u(d):(i=!0,t.consume(d),a)}function l(d){return d===95?r=!0:(s=r,r=void 0),t.consume(d),a}function u(d){return s||r||!i?n(d):e(d)}}function fEe(t,e){let n=0,r=0;return s;function s(a){return a===40?(n++,t.consume(a),s):a===41&&r<n?i(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?t.check(q8,e,i)(a):a===null||_n(a)||Su(a)?e(a):(t.consume(a),s)}function i(a){return a===41&&r++,t.consume(a),s}}function hEe(t,e,n){return r;function r(l){return l===33||l===34||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===63||l===95||l===126?(t.consume(l),r):l===38?(t.consume(l),i):l===93?(t.consume(l),s):l===60||l===null||_n(l)||Su(l)?e(l):n(l)}function s(l){return l===null||l===40||l===91||_n(l)||Su(l)?e(l):r(l)}function i(l){return fs(l)?a(l):n(l)}function a(l){return l===59?(t.consume(l),r):fs(l)?(t.consume(l),a):n(l)}}function pEe(t,e,n){return r;function r(i){return t.consume(i),s}function s(i){return rs(i)?n(i):e(i)}}function G8(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||_n(t)}function W8(t){return!fs(t)}function Y8(t){return!(t===47||wC(t))}function wC(t){return t===43||t===45||t===46||t===95||rs(t)}function tj(t){let e=t.length,n=!1;for(;e--;){const r=t[e][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const mEe={tokenize:SEe,partial:!0};function gEe(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:xEe,continuation:{tokenize:_Ee},exit:wEe}},text:{91:{name:"gfmFootnoteCall",tokenize:bEe},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:vEe,resolveTo:yEe}}}}function vEe(t,e,n){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const u=r.events[s][1];if(u.type==="labelImage"){a=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return l;function l(u){if(!a||!a._balanced)return n(u);const d=na(r.sliceSerialize({start:a.end,end:r.now()}));return d.codePointAt(0)!==94||!i.includes(d.slice(1))?n(u):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(u),t.exit("gfmFootnoteCallLabelMarker"),e(u))}}function yEe(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},t[t.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},l=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",s,e],["exit",s,e],["enter",i,e],["enter",a,e],["exit",a,e],["exit",i,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...l),t}function bEe(t,e,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return l;function l(h){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(h),t.exit("gfmFootnoteCallLabelMarker"),u}function u(h){return h!==94?n(h):(t.enter("gfmFootnoteCallMarker"),t.consume(h),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",d)}function d(h){if(i>999||h===93&&!a||h===null||h===91||_n(h))return n(h);if(h===93){t.exit("chunkString");const g=t.exit("gfmFootnoteCallString");return s.includes(na(r.sliceSerialize(g)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(h),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(h)}return _n(h)||(a=!0),i++,t.consume(h),h===92?p:d}function p(h){return h===91||h===92||h===93?(t.consume(h),i++,d):d(h)}}function xEe(t,e,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,l;return u;function u(b){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(b),t.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(b){return b===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(b),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",p):n(b)}function p(b){if(a>999||b===93&&!l||b===null||b===91||_n(b))return n(b);if(b===93){t.exit("chunkString");const x=t.exit("gfmFootnoteDefinitionLabelString");return i=na(r.sliceSerialize(x)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(b),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),g}return _n(b)||(l=!0),a++,t.consume(b),b===92?h:p}function h(b){return b===91||b===92||b===93?(t.consume(b),a++,p):p(b)}function g(b){return b===58?(t.enter("definitionMarker"),t.consume(b),t.exit("definitionMarker"),s.includes(i)||s.push(i),en(t,v,"gfmFootnoteDefinitionWhitespace")):n(b)}function v(b){return e(b)}}function _Ee(t,e,n){return t.check(Ag,e,t.attempt(mEe,e,n))}function wEe(t){t.exit("gfmFootnoteDefinition")}function SEe(t,e,n){const r=this;return en(t,s,"gfmFootnoteDefinitionIndent",5);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?e(i):n(i)}}function EEe(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,l){let u=-1;for(;++u<a.length;)if(a[u][0]==="enter"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._close){let d=u;for(;d--;)if(a[d][0]==="exit"&&a[d][1].type==="strikethroughSequenceTemporary"&&a[d][1]._open&&a[u][1].end.offset-a[u][1].start.offset===a[d][1].end.offset-a[d][1].start.offset){a[u][1].type="strikethroughSequence",a[d][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},a[d][1].start),end:Object.assign({},a[u][1].end)},h={type:"strikethroughText",start:Object.assign({},a[d][1].end),end:Object.assign({},a[u][1].start)},g=[["enter",p,l],["enter",a[d][1],l],["exit",a[d][1],l],["enter",h,l]],v=l.parser.constructs.insideSpan.null;v&&si(g,g.length,0,B0(v,a.slice(d+1,u),l)),si(g,g.length,0,[["exit",h,l],["enter",a[u][1],l],["exit",a[u][1],l],["exit",p,l]]),si(a,d-1,u-d+3,g),u=d+g.length-2;break}}for(u=-1;++u<a.length;)a[u][1].type==="strikethroughSequenceTemporary"&&(a[u][1].type="data");return a}function i(a,l,u){const d=this.previous,p=this.events;let h=0;return g;function g(b){return d===126&&p[p.length-1][1].type!=="characterEscape"?u(b):(a.enter("strikethroughSequenceTemporary"),v(b))}function v(b){const x=jf(d);if(b===126)return h>1?u(b):(a.consume(b),h++,v);if(h<2&&!n)return u(b);const E=a.exit("strikethroughSequenceTemporary"),S=jf(b);return E._open=!S||S===2&&!!x,E._close=!x||x===2&&!!S,l(b)}}}class kEe{constructor(){this.map=[]}add(e,n,r){TEe(this,e,n,r)}consume(e){if(this.map.sort(function(i,a){return i[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];r.push(e.slice()),e.length=0;let s=r.pop();for(;s;){for(const i of s)e.push(i);s=r.pop()}this.map.length=0}}function TEe(t,e,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s<t.map.length;){if(t.map[s][0]===e){t.map[s][1]+=n,t.map[s][2].push(...r);return}s+=1}t.map.push([e,n,r])}}function CEe(t,e){let n=!1;const r=[];for(;e<t.length;){const s=t[e];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const i=r.length-1;r[i]=r[i]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return r}function AEe(){return{flow:{null:{name:"table",tokenize:NEe,resolveAll:REe}}}}function NEe(t,e,n){const r=this;let s=0,i=0,a;return l;function l(O){let L=r.events.length-1;for(;L>-1;){const W=r.events[L][1].type;if(W==="lineEnding"||W==="linePrefix")L--;else break}const z=L>-1?r.events[L][1].type:null,G=z==="tableHead"||z==="tableRow"?A:u;return G===A&&r.parser.lazy[r.now().line]?n(O):G(O)}function u(O){return t.enter("tableHead"),t.enter("tableRow"),d(O)}function d(O){return O===124||(a=!0,i+=1),p(O)}function p(O){return O===null?n(O):ct(O)?i>1?(i=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(O),t.exit("lineEnding"),v):n(O):Gt(O)?en(t,p,"whitespace")(O):(i+=1,a&&(a=!1,s+=1),O===124?(t.enter("tableCellDivider"),t.consume(O),t.exit("tableCellDivider"),a=!0,p):(t.enter("data"),h(O)))}function h(O){return O===null||O===124||_n(O)?(t.exit("data"),p(O)):(t.consume(O),O===92?g:h)}function g(O){return O===92||O===124?(t.consume(O),h):h(O)}function v(O){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(O):(t.enter("tableDelimiterRow"),a=!1,Gt(O)?en(t,b,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):b(O))}function b(O){return O===45||O===58?E(O):O===124?(a=!0,t.enter("tableCellDivider"),t.consume(O),t.exit("tableCellDivider"),x):j(O)}function x(O){return Gt(O)?en(t,E,"whitespace")(O):E(O)}function E(O){return O===58?(i+=1,a=!0,t.enter("tableDelimiterMarker"),t.consume(O),t.exit("tableDelimiterMarker"),S):O===45?(i+=1,S(O)):O===null||ct(O)?R(O):j(O)}function S(O){return O===45?(t.enter("tableDelimiterFiller"),k(O)):j(O)}function k(O){return O===45?(t.consume(O),k):O===58?(a=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(O),t.exit("tableDelimiterMarker"),T):(t.exit("tableDelimiterFiller"),T(O))}function T(O){return Gt(O)?en(t,R,"whitespace")(O):R(O)}function R(O){return O===124?b(O):O===null||ct(O)?!a||s!==i?j(O):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(O)):j(O)}function j(O){return n(O)}function A(O){return t.enter("tableRow"),N(O)}function N(O){return O===124?(t.enter("tableCellDivider"),t.consume(O),t.exit("tableCellDivider"),N):O===null||ct(O)?(t.exit("tableRow"),e(O)):Gt(O)?en(t,N,"whitespace")(O):(t.enter("data"),M(O))}function M(O){return O===null||O===124||_n(O)?(t.exit("data"),N(O)):(t.consume(O),O===92?I:M)}function I(O){return O===92||O===124?(t.consume(O),M):M(O)}}function REe(t,e){let n=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],l=!1,u=0,d,p,h;const g=new kEe;for(;++n<t.length;){const v=t[n],b=v[1];v[0]==="enter"?b.type==="tableHead"?(l=!1,u!==0&&(x4(g,e,u,d,p),p=void 0,u=0),d={type:"table",start:Object.assign({},b.start),end:Object.assign({},b.end)},g.add(n,0,[["enter",d,e]])):b.type==="tableRow"||b.type==="tableDelimiterRow"?(r=!0,h=void 0,i=[0,0,0,0],a=[0,n+1,0,0],l&&(l=!1,p={type:"tableBody",start:Object.assign({},b.start),end:Object.assign({},b.end)},g.add(n,0,[["enter",p,e]])),s=b.type==="tableDelimiterRow"?2:p?3:1):s&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(i[1]!==0&&(a[0]=a[1],h=_y(g,e,i,s,void 0,h),i=[0,0,0,0]),a[2]=n)):b.type==="tableCellDivider"&&(r?r=!1:(i[1]!==0&&(a[0]=a[1],h=_y(g,e,i,s,void 0,h)),i=a,a=[i[1],n,0,0])):b.type==="tableHead"?(l=!0,u=n):b.type==="tableRow"||b.type==="tableDelimiterRow"?(u=n,i[1]!==0?(a[0]=a[1],h=_y(g,e,i,s,n,h)):a[1]!==0&&(h=_y(g,e,a,s,n,h)),s=0):s&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")&&(a[3]=n)}for(u!==0&&x4(g,e,u,d,p),g.consume(e.events),n=-1;++n<e.events.length;){const v=e.events[n];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=CEe(e.events,n))}return t}function _y(t,e,n,r,s,i){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(i.end=Object.assign({},zd(e.events,n[0])),t.add(n[0],0,[["exit",i,e]]));const u=zd(e.events,n[1]);if(i={type:a,start:Object.assign({},u),end:Object.assign({},u)},t.add(n[1],0,[["enter",i,e]]),n[2]!==0){const d=zd(e.events,n[2]),p=zd(e.events,n[3]),h={type:l,start:Object.assign({},d),end:Object.assign({},p)};if(t.add(n[2],0,[["enter",h,e]]),r!==2){const g=e.events[n[2]],v=e.events[n[3]];if(g[1].end=Object.assign({},v[1].end),g[1].type="chunkText",g[1].contentType="text",n[3]>n[2]+1){const b=n[2]+1,x=n[3]-n[2]-1;t.add(b,x,[])}}t.add(n[3]+1,0,[["exit",h,e]])}return s!==void 0&&(i.end=Object.assign({},zd(e.events,s)),t.add(s,0,[["exit",i,e]]),i=void 0),i}function x4(t,e,n,r,s){const i=[],a=zd(e.events,n);s&&(s.end=Object.assign({},a),i.push(["exit",s,e])),r.end=Object.assign({},a),i.push(["exit",r,e]),t.add(n+1,0,i)}function zd(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const jEe={name:"tasklistCheck",tokenize:OEe};function MEe(){return{text:{91:jEe}}}function OEe(t,e,n){const r=this;return s;function s(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(u),t.exit("taskListCheckMarker"),i)}function i(u){return _n(u)?(t.enter("taskListCheckValueUnchecked"),t.consume(u),t.exit("taskListCheckValueUnchecked"),a):u===88||u===120?(t.enter("taskListCheckValueChecked"),t.consume(u),t.exit("taskListCheckValueChecked"),a):n(u)}function a(u){return u===93?(t.enter("taskListCheckMarker"),t.consume(u),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),l):n(u)}function l(u){return ct(u)?e(u):Gt(u)?t.check({tokenize:PEe},e,n)(u):n(u)}}function PEe(t,e,n){return en(t,r,"whitespace");function r(s){return s===null?n(s):e(s)}}function IEe(t){return i8([aEe(),gEe(),EEe(t),AEe(),MEe()])}const DEe={};function LEe(t){const e=this,n=t||DEe,r=e.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(IEe(n)),i.push(nEe()),a.push(rEe(n))}function $Ee({node:t,inline:e,className:n,children:r,...s}){return e?f.jsx("code",{className:`${n} text-sm bg-zinc-100 dark:bg-zinc-800 py-0.5 px-1 rounded-md`,...s,children:r}):f.jsx("div",{className:"not-prose flex flex-col",children:f.jsx("div",{...s,className:"text-sm w-full overflow-x-auto dark:bg-zinc-900 p-4 border border-zinc-200 dark:border-zinc-700 rounded-xl dark:text-zinc-50 text-zinc-900 font-mono whitespace-pre-wrap break-words",children:r})})}const zEe={code:$Ee,pre:({children:t})=>f.jsx(f.Fragment,{children:t}),img:({src:t,alt:e,...n})=>{if(!t)return null;const[r,s]=w.useState(!1),[i,a]=w.useState(!1);return i?f.jsxs("div",{className:"my-4 p-4 bg-muted/50 rounded-lg border border-border/30 text-center text-muted-foreground",children:["Failed to load image: ",e||"Image"]}):f.jsx("div",{className:"my-4 flex justify-center",children:f.jsx("img",{src:t,alt:e||"Image",className:`max-w-full h-auto rounded-lg border border-border/30 shadow-sm cursor-pointer transition-all hover:shadow-md ${r?"max-h-none":"max-h-96"}`,loading:"lazy",onClick:()=>s(!r),onError:()=>a(!0),title:r?"Click to collapse":"Click to expand",...n})})},ol:({children:t,...e})=>f.jsx("ol",{className:"list-decimal list-outside ml-4",...e,children:t}),li:({children:t,...e})=>f.jsx("li",{className:"py-1",...e,children:t}),ul:({children:t,...e})=>f.jsx("ul",{className:"list-decimal list-outside ml-4",...e,children:t}),strong:({children:t,...e})=>f.jsx("span",{className:"font-semibold",...e,children:t}),a:({children:t,...e})=>f.jsx("a",{className:"text-blue-500 hover:underline",target:"_blank",rel:"noreferrer",...e,children:t}),h1:({children:t,...e})=>f.jsx("h1",{className:"text-3xl font-semibold mt-6 mb-2",...e,children:t}),h2:({children:t,...e})=>f.jsx("h2",{className:"text-2xl font-semibold mt-6 mb-2",...e,children:t}),h3:({children:t,...e})=>f.jsx("h3",{className:"text-xl font-semibold mt-6 mb-2",...e,children:t}),h4:({children:t,...e})=>f.jsx("h4",{className:"text-lg font-semibold mt-6 mb-2",...e,children:t}),h5:({children:t,...e})=>f.jsx("h5",{className:"text-base font-semibold mt-6 mb-2",...e,children:t}),h6:({children:t,...e})=>f.jsx("h6",{className:"text-sm font-semibold mt-6 mb-2",...e,children:t})},FEe=[LEe],UEe=({children:t})=>f.jsx(Ewe,{remarkPlugins:FEe,components:zEe,children:t}),_4=UEe;function w4({message:t,onSave:e,onCancel:n}){const[r,s]=w.useState(t.content),i=w.useRef(null);w.useEffect(()=>{i.current&&(i.current.focus(),i.current.select(),a())},[]);const a=()=>{i.current&&(i.current.style.height="auto",i.current.style.height=`${i.current.scrollHeight}px`)},l=()=>{r.trim()!==t.content.trim()?e(r.trim()):n()},u=d=>{d.key==="Enter"&&(d.metaKey||d.ctrlKey)&&(d.preventDefault(),l()),d.key==="Escape"&&(d.preventDefault(),n())};return f.jsxs("div",{className:"w-full space-y-3",children:[f.jsx(Ho,{ref:i,value:r,onChange:d=>{s(d.target.value),a()},onKeyDown:u,className:"min-h-[100px] resize-none",placeholder:"Edit your message..."}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(Ie,{variant:"outline",size:"sm",onClick:n,children:"Cancel"}),f.jsx(Ie,{size:"sm",onClick:l,disabled:!r.trim(),children:"Save"})]})]})}function S4({data:t,className:e}){const[n,r]=w.useState(!1),s=JSON.stringify(t,null,2),i=async()=>{try{await navigator.clipboard.writeText(s),r(!0),setTimeout(()=>r(!1),2e3)}catch(l){console.error("Failed to copy:",l)}},a=l=>l.replace(/"([^"]+)":/g,'<span class="text-blue-600/70 dark:text-blue-400/70">"$1"</span>:').replace(/: "([^"]*)"/g,': <span class="text-foreground">"$1"</span>').replace(/: (true|false)/g,': <span class="text-purple-600/70 dark:text-purple-400/70">$1</span>').replace(/: (null)/g,': <span class="text-muted-foreground/60">$1</span>').replace(/: (-?\d+(?:\.\d+)?)/g,': <span class="text-orange-600/70 dark:text-orange-400/70">$1</span>');return f.jsxs("div",{className:Me("relative group",e),children:[f.jsx("button",{onClick:i,className:"absolute top-2 right-2 p-1.5 rounded-md bg-background/80 backdrop-blur-sm border opacity-0 group-hover:opacity-100 transition-opacity hover:bg-muted",title:"Copy JSON",children:n?f.jsx(Ti,{className:"h-3 w-3 text-green-600/70 dark:text-green-400/70"}):f.jsx(Po,{className:"h-3 w-3"})}),f.jsx("pre",{className:"text-xs font-mono whitespace-pre-wrap overflow-x-auto p-3 bg-muted/20 rounded-md border",children:f.jsx("code",{dangerouslySetInnerHTML:{__html:a(s)}})})]})}function K8({data:t,depth:e=0}){const[n,r]=w.useState(e<2);if(typeof t!="object"||t===null)return f.jsx("span",{className:Me("text-sm",typeof t=="string"&&"text-foreground",typeof t=="number"&&"text-orange-600/70 dark:text-orange-400/70",typeof t=="boolean"&&"text-purple-600/70 dark:text-purple-400/70",t===null&&"text-muted-foreground/60"),children:typeof t=="string"?`"${t}"`:String(t)});const s=Array.isArray(t),i=s?t.map((u,d)=>[d,u]):Object.entries(t),a=s?"[":"{",l=s?"]":"}";return i.length===0?f.jsxs("span",{className:"text-sm text-muted-foreground",children:[a,l]}):f.jsxs("div",{className:"text-sm",children:[f.jsxs("button",{onClick:()=>r(!n),className:"flex items-center gap-1 hover:bg-muted/50 rounded px-1 transition-colors",children:[n?f.jsx(Au,{className:"h-3 w-3"}):f.jsx(Ba,{className:"h-3 w-3"}),f.jsxs("span",{className:"text-muted-foreground",children:[a," ",!n&&`${i.length} items`]})]}),n&&f.jsx("div",{className:"ml-4 border-l border-border pl-2 space-y-1",children:i.map(([u,d])=>f.jsxs("div",{className:"flex gap-2",children:[f.jsxs("span",{className:"text-blue-600/70 dark:text-blue-400/70 font-medium min-w-0 flex-shrink-0",children:[s?`[${u}]`:`"${u}"`,":"]}),f.jsx("div",{className:"min-w-0 flex-1",children:f.jsx(K8,{data:d,depth:e+1})})]},u))}),n&&f.jsx("span",{className:"text-muted-foreground ml-4",children:l})]})}function E4({toolCall:t,toolResult:e,className:n,serverConfigs:r,onCallTool:s,onSendFollowup:i,toolMeta:a,serverId:l}){const[u,d]=w.useState(!1),[p,h]=w.useState(!1),v=e?e.error?"error":"completed":t.status,b=()=>{switch(v){case"completed":return f.jsxs("div",{className:"relative",children:[f.jsx(sf,{className:"h-4 w-4 text-green-600/70 dark:text-green-400/70"}),f.jsx("div",{className:"absolute inset-0 animate-ping",children:f.jsx(sf,{className:"h-4 w-4 text-green-600/70 dark:text-green-400/70 opacity-20"})})]});case"error":return f.jsxs("div",{className:"relative",children:[f.jsx(af,{className:"h-4 w-4 text-red-600/70 dark:text-red-400/70"}),f.jsx("div",{className:"absolute inset-0 animate-pulse",children:f.jsx(af,{className:"h-4 w-4 text-red-600/70 dark:text-red-400/70 opacity-30"})})]});case"executing":return f.jsxs("div",{className:"relative",children:[f.jsx(oI,{className:"h-4 w-4 text-blue-600/70 dark:text-blue-400/70 animate-spin"}),f.jsx("div",{className:"absolute inset-0 animate-ping",children:f.jsx("div",{className:"h-4 w-4 bg-blue-600/30 dark:bg-blue-400/30 rounded-full"})})]});default:return f.jsx(oI,{className:"h-4 w-4 text-muted-foreground/60"})}};return f.jsxs("div",{className:Me("border rounded-lg bg-gradient-to-br from-muted/20 to-muted/40 backdrop-blur-sm shadow-sm hover:shadow-md transition-all duration-200",v==="completed"&&"border-green-200/50 dark:border-green-800/50",v==="error"&&"border-red-200/50 dark:border-red-800/50",v==="executing"&&"border-blue-200/50 dark:border-blue-800/50 shadow-md animate-pulse",n),children:[f.jsxs("button",{onClick:()=>d(!u),className:"w-full flex items-center justify-between p-4 hover:bg-muted/30 transition-all duration-200 rounded-t-lg",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("div",{className:"p-2 rounded-md bg-background/50 border",children:f.jsx(A0,{className:"h-4 w-4 text-muted-foreground"})}),f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("span",{className:"font-semibold text-sm",children:t.name}),v==="executing"&&f.jsx("span",{className:"text-xs text-blue-600/70 dark:text-blue-400/70 font-medium",children:"Running..."}),b()]})]}),f.jsx("div",{className:"flex items-center gap-2",children:u?f.jsx(Au,{className:"h-4 w-4 text-muted-foreground"}):f.jsx(Ba,{className:"h-4 w-4 text-muted-foreground"})})]}),u&&f.jsxs("div",{className:"border-t bg-background/30 backdrop-blur-sm",children:[Object.keys(t.parameters).length>0&&f.jsxs("div",{className:"p-4 border-b border-border/50",children:[f.jsxs("div",{className:"flex items-center justify-between mb-3",children:[f.jsxs("h4",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider flex items-center gap-2",children:[f.jsx("div",{className:"w-2 h-2 rounded-full bg-blue-600/70 dark:bg-blue-400/70"}),"Parameters"]}),f.jsx("button",{onClick:()=>h(!p),className:"text-xs text-muted-foreground hover:text-foreground transition-colors px-2 py-1 rounded bg-muted/50 hover:bg-muted",children:p?"Raw JSON":"Tree View"})]}),p?f.jsx(K8,{data:t.parameters}):f.jsx(S4,{data:t.parameters})]}),e&&f.jsxs("div",{className:"p-4",children:[f.jsxs("h4",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-3 flex items-center gap-2",children:[f.jsx("div",{className:Me("w-2 h-2 rounded-full",e.error?"bg-red-600/70 dark:bg-red-400/70":"bg-green-600/70 dark:bg-green-400/70")}),e.error?"Error":"Result"]}),f.jsx("div",{children:e.error?f.jsx("div",{className:"bg-red-50/30 dark:bg-red-950/20 border border-red-200/50 dark:border-red-800/50 rounded-lg p-4",children:f.jsxs("div",{className:"flex items-start gap-3",children:[f.jsx(af,{className:"h-5 w-5 text-red-600/70 dark:text-red-400/70 flex-shrink-0 mt-0.5"}),f.jsxs("div",{children:[f.jsx("p",{className:"font-medium text-foreground mb-1",children:"Tool execution failed"}),f.jsx("p",{className:"text-muted-foreground text-sm",children:e.error})]})]})}):f.jsxs("div",{className:"bg-green-50/30 dark:bg-green-950/20 border border-green-200/50 dark:border-green-800/50 rounded-lg",children:[f.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 bg-green-100/30 dark:bg-green-900/20 border-b border-green-200/50 dark:border-green-800/50",children:[f.jsx(sf,{className:"h-4 w-4 text-green-600/70 dark:text-green-400/70"}),f.jsx("span",{className:"text-sm font-medium text-foreground",children:"Tool executed successfully"})]}),f.jsx("div",{className:"p-4",children:(()=>{const x=R=>{if(!R)return null;const j=Array.isArray(R)?R[0]:R;if(!j)return null;const A=j?.resource;if(A&&typeof A=="object"&&typeof A.uri=="string"&&A.uri.startsWith("ui://"))return A;const N=j?.content;if(Array.isArray(N)){for(const M of N)if(M?.type==="resource"&&M?.resource?.uri&&typeof M.resource.uri=="string"&&M.resource.uri.startsWith("ui://"))return M.resource}return null},E=e?.result,S=a?.["openai/outputTemplate"];if(S&&typeof S=="string"){const R=l||e.serverId;return f.jsx(Vq,{componentUrl:S,toolCall:t,toolResult:e,onCallTool:s,onSendFollowup:i,serverId:R,toolMeta:a})}const k=x(E);if(k)return f.jsx(DN,{resource:k,htmlProps:{autoResizeIframe:!0,style:{width:"100%",overflow:"visible"}},onUIAction:async R=>{if(R.type==="tool"&&R.payload?.toolName){const j=(()=>{if(r&&typeof r=="object"&&Object.keys(r).length===1)return Object.keys(r)[0]})();fetch("/api/mcp/tools/execute",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({toolName:R.payload.toolName,parameters:R.payload.params||{},...j?{serverId:j}:{}})}).catch(()=>{})}else R.type==="link"&&R.payload?.url&&window.open(R.payload.url,"_blank","noopener,noreferrer");return{status:"handled"}}});const T=E?.result||E;return typeof T=="object"?f.jsx(S4,{data:T}):f.jsx("div",{className:"text-sm text-foreground bg-muted/30 p-3 rounded border",children:String(T)})})()})]})})]})]})]})}const BEe="/claude_logo.png",qEe="/openai_logo.png",VEe="/deepseek_logo.svg",HEe="/google_logo.png",GEe="/meta_logo.svg",k4="/ollama_logo.svg",T4="/ollama_dark.png",C4="/grok_light.svg",A4="/grok_dark.png",X8=(t,e)=>{switch(t){case"anthropic":return BEe;case"openai":return qEe;case"deepseek":return VEe;case"google":return HEe;case"ollama":return e==="dark"||e==="system"&&typeof document<"u"&&document.documentElement.classList.contains("dark")?T4:k4;case"meta":return GEe;case"x-ai":return e==="dark"||e==="system"&&typeof document<"u"&&document.documentElement.classList.contains("dark")?A4:C4;default:return null}},WEe=(t,e)=>X8(t.provider,e),YEe=t=>{switch(t){case"anthropic":return"text-orange-600 dark:text-orange-400";case"openai":return"text-green-600 dark:text-green-400";case"deepseek":return"text-blue-600 dark:text-blue-400";case"google":return"text-red-600 dark:text-red-400";case"ollama":return"text-gray-600 dark:text-gray-400";case"x-ai":return"text-purple-600 dark:text-purple-400";default:return"text-blue-600 dark:text-blue-400"}},N4=t=>{let e;const n=new Set,r=(d,p)=>{const h=typeof d=="function"?d(e):d;if(!Object.is(h,e)){const g=e;e=p??(typeof h!="object"||h===null)?h:Object.assign({},e,h),n.forEach(v=>v(e,g))}},s=()=>e,l={setState:r,getState:s,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d))},u=e=t(r,s,l);return l},KEe=t=>t?N4(t):N4,XEe=t=>t;function QEe(t,e=XEe){const n=Ee.useSyncExternalStore(t.subscribe,Ee.useCallback(()=>e(t.getState()),[t,e]),Ee.useCallback(()=>e(t.getInitialState()),[t,e]));return Ee.useDebugValue(n),n}const JEe=t=>KEe()(e=>({themeMode:t?.themeMode??"light",themePreset:t?.themePreset??"default",setThemeMode:n=>e({themeMode:n}),setThemePreset:n=>e({themePreset:n})})),Q8=w.createContext(null),ZEe=({children:t,themeMode:e,themePreset:n})=>{const r=w.useRef(null);return r.current??=JEe({themeMode:e,themePreset:n}),f.jsx(Q8.Provider,{value:r.current,children:t})},Ym=t=>{const e=w.useContext(Q8);if(!e)throw new Error("Missing PreferencesStoreProvider");return QEe(e,t)},R4=({attachment:t,align:e="left"})=>{const[n,r]=w.useState(!1),[s,i]=w.useState(!1);return n?f.jsxs("div",{className:`px-3 py-2 bg-muted rounded-lg text-sm text-muted-foreground ${e==="right"?"text-right":""}`,children:["Failed to load image: ",t.name]}):f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx("div",{className:`text-xs text-muted-foreground font-medium ${e==="right"?"text-right":""}`,children:t.name}),f.jsx("div",{className:"flex justify-center",children:f.jsx("img",{src:t.url,alt:t.name,className:`max-w-full h-auto rounded-lg border border-border/30 shadow-sm cursor-pointer transition-all hover:shadow-md ${s?"max-h-none":"max-h-96"}`,loading:"lazy",onClick:()=>i(!s),onError:()=>r(!0),title:s?"Click to collapse":"Click to expand"})})]})},j4=()=>f.jsxs("div",{className:"flex items-center gap-2 py-2",children:[f.jsx("span",{className:"text-sm text-muted-foreground",children:"Thinking"}),f.jsxs("div",{className:"flex space-x-1",children:[f.jsx("div",{className:"w-1.5 h-1.5 bg-muted-foreground/60 rounded-full animate-bounce"}),f.jsx("div",{className:"w-1.5 h-1.5 bg-muted-foreground/60 rounded-full animate-bounce [animation-delay:-0.2s]"}),f.jsx("div",{className:"w-1.5 h-1.5 bg-muted-foreground/60 rounded-full animate-bounce [animation-delay:-0.4s]"})]})]}),e1e=({message:t,isLoading:e=!1,onEdit:n,onRegenerate:r,onCopy:s,isReadonly:i=!1,showActions:a=!0,model:l,serverConfigs:u,onCallTool:d,onSendFollowup:p,toolsMetadata:h,serverId:g})=>{const[v,b]=w.useState("view"),[x,E]=w.useState(!1),[S,k]=w.useState(!1),T=Ym(I=>I.themeMode),R=()=>{s?s(t.content):navigator.clipboard.writeText(t.content),k(!0),setTimeout(()=>k(!1),2e3)},j=I=>{n&&n(t.id,I),b("view")},A=()=>{b("view")},N=()=>{r&&r(t.id)},M=t.role==="assistant"&&e&&(!t.content||t.content.trim()==="");return f.jsx(hx,{children:f.jsxs(ei.div,{"data-testid":`message-${t.role}`,className:"w-full mx-auto max-w-4xl px-4 group/message",initial:{y:5,opacity:0},animate:{y:0,opacity:1},"data-role":t.role,onMouseEnter:()=>E(!0),onMouseLeave:()=>E(!1),children:[t.role==="assistant"&&f.jsxs("div",{className:"flex gap-4 w-full",children:[f.jsx("div",{className:"size-8 flex items-center rounded-full justify-center shrink-0 bg-muted/50",children:f.jsx("img",{src:WEe(l,T),alt:`${l?.id} logo`,className:"h-4 w-4 object-contain"})}),f.jsxs("div",{className:"flex flex-col gap-4 w-full min-w-0",children:[t.attachments&&t.attachments.length>0&&f.jsx("div",{className:"flex flex-col gap-3",children:t.attachments.map(I=>PD({type:I.contentType})?f.jsx(R4,{attachment:I},I.id):f.jsxs("div",{className:"px-3 py-2 bg-muted rounded-lg text-sm flex items-center gap-2",children:[f.jsx("span",{children:"📎"}),f.jsx("span",{children:I.name}),I.size&&f.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",(I.size/1024).toFixed(1)," KB)"]})]},I.id))}),t.contentBlocks&&t.contentBlocks.length>0?f.jsx("div",{className:"space-y-4",children:t.contentBlocks.map((I,O)=>I.type==="text"&&I.content?f.jsx(ei.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.3,delay:O*.05},className:"prose prose-sm max-w-none dark:prose-invert prose-p:leading-relaxed prose-pre:bg-muted/50 prose-pre:border prose-pre:border-border/30 flex-1 min-w-0",children:f.jsx(_4,{children:iE(I.content)})},I.id):I.type==="tool_call"&&I.toolCall?f.jsx(ei.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.3,delay:O*.05},children:f.jsx(E4,{toolCall:I.toolCall,toolResult:I.toolResult,serverConfigs:u,onCallTool:d,onSendFollowup:p,toolMeta:h?.[I.toolCall.name],serverId:g})},I.id):null)}):f.jsxs(f.Fragment,{children:[t.toolCalls&&t.toolCalls.length>0&&f.jsx("div",{className:"space-y-2",children:t.toolCalls.map((I,O)=>{const L=t.toolResults?.find(z=>z.toolCallId===I.id);return f.jsx(ei.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.3,delay:O*.1},children:f.jsx(E4,{toolCall:I,toolResult:L,serverConfigs:u,onCallTool:d,onSendFollowup:p,toolMeta:h?.[I.name],serverId:g})},I.id)})}),M?f.jsx(ei.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.3},children:f.jsx(j4,{})}):v==="view"&&t.content?f.jsx("div",{className:"prose prose-sm max-w-none dark:prose-invert prose-p:leading-relaxed prose-pre:bg-muted/50 prose-pre:border prose-pre:border-border/30 flex-1 min-w-0",children:f.jsx(_4,{children:iE(t.content)})}):null]}),M&&t.contentBlocks&&f.jsx(ei.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.3},children:f.jsx(j4,{})}),v==="view"&&x&&f.jsxs("div",{className:"flex items-center justify-between mt-4",children:[f.jsx("div",{className:"text-xs text-muted-foreground/60",children:MD(t.timestamp)}),a&&!i&&f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsxs(Ma,{children:[f.jsx(Oa,{asChild:!0,children:f.jsx(Ie,{variant:"ghost",size:"sm",className:"px-2 h-7 rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-all",onClick:R,children:S?f.jsx(Ti,{size:14}):f.jsx(Po,{size:14})})}),f.jsx(Pa,{children:"Copy"})]}),r&&f.jsxs(Ma,{children:[f.jsx(Oa,{asChild:!0,children:f.jsx(Ie,{variant:"ghost",size:"sm",className:"px-2 h-7 rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-all",onClick:N,children:f.jsx(rie,{size:14})})}),f.jsx(Pa,{children:"Regenerate"})]})]})]}),v==="edit"&&f.jsx("div",{className:"flex flex-row gap-2 items-start",children:f.jsx(w4,{message:t,onSave:j,onCancel:A})})]})]}),t.role==="user"&&f.jsx("div",{className:"flex justify-end w-full",children:f.jsxs("div",{className:"flex flex-col gap-2 max-w-2xl",children:[t.attachments&&t.attachments.length>0&&f.jsx("div",{className:"flex flex-col gap-3",children:t.attachments.map(I=>PD({type:I.contentType})?f.jsx(R4,{attachment:I,align:"right"},I.id):f.jsxs("div",{className:"px-3 py-2 bg-muted rounded-lg text-sm flex items-center gap-2 justify-end",children:[f.jsx("span",{children:I.name}),f.jsx("span",{children:"📎"}),I.size&&f.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",(I.size/1024).toFixed(1)," KB)"]})]},I.id))}),v==="view"?f.jsxs("div",{className:"flex items-start gap-2 justify-end",children:[a&&!i&&x&&f.jsx("div",{className:"flex items-center gap-1 mt-1",children:f.jsxs(Ma,{children:[f.jsx(Oa,{asChild:!0,children:f.jsx(Ie,{variant:"ghost",size:"sm",className:"px-2 h-7 rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-all",onClick:R,children:f.jsx(Po,{size:14})})}),f.jsx(Pa,{children:"Copy"})]})}),f.jsxs("div",{className:"relative",children:[f.jsx("div",{"data-testid":"message-content",className:"bg-primary text-primary-foreground px-4 py-3 rounded-2xl max-w-fit",children:f.jsx("div",{className:"whitespace-pre-wrap break-words font-medium",children:iE(t.content)})}),x&&f.jsx("div",{className:"absolute -bottom-6 right-0 text-xs text-muted-foreground/60",children:MD(t.timestamp)})]})]}):f.jsx("div",{className:"w-full",children:f.jsx(w4,{message:t,onSave:j,onCancel:A})})]})})]})})},t1e=w.memo(e1e,(t,e)=>t.message.id===e.message.id&&t.message.content===e.message.content&&t.isLoading===e.isLoading&&JSON.stringify(t.message.toolCalls)===JSON.stringify(e.message.toolCalls)&&JSON.stringify(t.message.toolResults)===JSON.stringify(e.message.toolResults));function M1({provider:t}){const e=Ym(r=>r.themeMode),n=X8(t,e);return n?f.jsx("img",{src:n,width:12,height:12,alt:`${t} logo`,className:"h-3 w-3 object-contain"}):f.jsx("div",{className:kT("h-3 w-3 rounded-sm",YEe(t))})}var Ea=[],xi=[],n1e=Uint8Array,O1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var Cd=0,r1e=O1.length;Cd<r1e;++Cd)Ea[Cd]=O1[Cd],xi[O1.charCodeAt(Cd)]=Cd;xi[45]=62;xi[95]=63;function s1e(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");n===-1&&(n=e);var r=n===e?0:4-n%4;return[n,r]}function i1e(t,e,n){return(e+n)*3/4-n}function Km(t){var e,n=s1e(t),r=n[0],s=n[1],i=new n1e(i1e(t,r,s)),a=0,l=s>0?r-4:r,u;for(u=0;u<l;u+=4)e=xi[t.charCodeAt(u)]<<18|xi[t.charCodeAt(u+1)]<<12|xi[t.charCodeAt(u+2)]<<6|xi[t.charCodeAt(u+3)],i[a++]=e>>16&255,i[a++]=e>>8&255,i[a++]=e&255;return s===2&&(e=xi[t.charCodeAt(u)]<<2|xi[t.charCodeAt(u+1)]>>4,i[a++]=e&255),s===1&&(e=xi[t.charCodeAt(u)]<<10|xi[t.charCodeAt(u+1)]<<4|xi[t.charCodeAt(u+2)]>>2,i[a++]=e>>8&255,i[a++]=e&255),i}function a1e(t){return Ea[t>>18&63]+Ea[t>>12&63]+Ea[t>>6&63]+Ea[t&63]}function o1e(t,e,n){for(var r,s=[],i=e;i<n;i+=3)r=(t[i]<<16&16711680)+(t[i+1]<<8&65280)+(t[i+2]&255),s.push(a1e(r));return s.join("")}function Xm(t){for(var e,n=t.length,r=n%3,s=[],i=16383,a=0,l=n-r;a<l;a+=i)s.push(o1e(t,a,a+i>l?l:a+i));return r===1?(e=t[n-1],s.push(Ea[e>>2]+Ea[e<<4&63]+"==")):r===2&&(e=(t[n-2]<<8)+t[n-1],s.push(Ea[e>>10]+Ea[e>>4&63]+Ea[e<<2&63]+"=")),s.join("")}function So(t){if(t===void 0)return{};if(!J8(t))throw new Error(`The arguments to a Convex function must be an object. Received: ${t}`);return t}function l1e(t){if(typeof t>"u")throw new Error("Client created with undefined deployment address. If you used an environment variable, check that it's set.");if(typeof t!="string")throw new Error(`Invalid deployment address: found ${t}".`);if(!(t.startsWith("http:")||t.startsWith("https:")))throw new Error(`Invalid deployment address: Must start with "https://" or "http://". Found "${t}".`);try{new URL(t)}catch{throw new Error(`Invalid deployment address: "${t}" is not a valid URL. If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`)}if(t.endsWith(".convex.site"))throw new Error(`Invalid deployment address: "${t}" ends with .convex.site, which is used for HTTP Actions. Convex deployment URLs typically end with .convex.cloud? If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`)}function J8(t){const e=typeof t=="object",n=Object.getPrototypeOf(t),r=n===null||n===Object.prototype||n?.constructor?.name==="Object";return e&&r}const Z8=!0,Mf=BigInt("-9223372036854775808"),nj=BigInt("9223372036854775807"),SC=BigInt("0"),c1e=BigInt("8"),u1e=BigInt("256");function e7(t){return Number.isNaN(t)||!Number.isFinite(t)||Object.is(t,-0)}function d1e(t){t<SC&&(t-=Mf+Mf);let e=t.toString(16);e.length%2===1&&(e="0"+e);const n=new Uint8Array(new ArrayBuffer(8));let r=0;for(const s of e.match(/.{2}/g).reverse())n.set([parseInt(s,16)],r++),t>>=c1e;return Xm(n)}function f1e(t){const e=Km(t);if(e.byteLength!==8)throw new Error(`Received ${e.byteLength} bytes, expected 8 for $integer`);let n=SC,r=SC;for(const s of e)n+=BigInt(s)*u1e**r,r++;return n>nj&&(n+=Mf+Mf),n}function h1e(t){if(t<Mf||nj<t)throw new Error(`BigInt ${t} does not fit into a 64-bit signed integer.`);const e=new ArrayBuffer(8);return new DataView(e).setBigInt64(0,t,!0),Xm(new Uint8Array(e))}function p1e(t){const e=Km(t);if(e.byteLength!==8)throw new Error(`Received ${e.byteLength} bytes, expected 8 for $integer`);return new DataView(e.buffer).getBigInt64(0,!0)}const m1e=DataView.prototype.setBigInt64?h1e:d1e,g1e=DataView.prototype.getBigInt64?p1e:f1e,M4=1024;function t7(t){if(t.length>M4)throw new Error(`Field name ${t} exceeds maximum field name length ${M4}.`);if(t.startsWith("$"))throw new Error(`Field name ${t} starts with a '$', which is reserved.`);for(let e=0;e<t.length;e+=1){const n=t.charCodeAt(e);if(n<32||n>=127)throw new Error(`Field name ${t} has invalid character '${t[e]}': Field names can only contain non-control ASCII characters`)}}function Of(t){if(t===null||typeof t=="boolean"||typeof t=="number"||typeof t=="string")return t;if(Array.isArray(t))return t.map(r=>Of(r));if(typeof t!="object")throw new Error(`Unexpected type of ${t}`);const e=Object.entries(t);if(e.length===1){const r=e[0][0];if(r==="$bytes"){if(typeof t.$bytes!="string")throw new Error(`Malformed $bytes field on ${t}`);return Km(t.$bytes).buffer}if(r==="$integer"){if(typeof t.$integer!="string")throw new Error(`Malformed $integer field on ${t}`);return g1e(t.$integer)}if(r==="$float"){if(typeof t.$float!="string")throw new Error(`Malformed $float field on ${t}`);const s=Km(t.$float);if(s.byteLength!==8)throw new Error(`Received ${s.byteLength} bytes, expected 8 for $float`);const a=new DataView(s.buffer).getFloat64(0,Z8);if(!e7(a))throw new Error(`Float ${a} should be encoded as a number`);return a}if(r==="$set")throw new Error("Received a Set which is no longer supported as a Convex type.");if(r==="$map")throw new Error("Received a Map which is no longer supported as a Convex type.")}const n={};for(const[r,s]of Object.entries(t))t7(r),n[r]=Of(s);return n}function fm(t){return JSON.stringify(t,(e,n)=>n===void 0?"undefined":typeof n=="bigint"?`${n.toString()}n`:n)}function EC(t,e,n,r){if(t===void 0){const a=n&&` (present at path ${n} in original object ${fm(e)})`;throw new Error(`undefined is not a valid Convex value${a}. To learn about Convex's supported types, see https://docs.convex.dev/using/types.`)}if(t===null)return t;if(typeof t=="bigint"){if(t<Mf||nj<t)throw new Error(`BigInt ${t} does not fit into a 64-bit signed integer.`);return{$integer:m1e(t)}}if(typeof t=="number")if(e7(t)){const a=new ArrayBuffer(8);return new DataView(a).setFloat64(0,t,Z8),{$float:Xm(new Uint8Array(a))}}else return t;if(typeof t=="boolean"||typeof t=="string")return t;if(t instanceof ArrayBuffer)return{$bytes:Xm(new Uint8Array(t))};if(Array.isArray(t))return t.map((a,l)=>EC(a,e,n+`[${l}]`));if(t instanceof Set)throw new Error(P1(n,"Set",[...t],e));if(t instanceof Map)throw new Error(P1(n,"Map",[...t],e));if(!J8(t)){const a=t?.constructor?.name,l=a?`${a} `:"";throw new Error(P1(n,l,t,e))}const s={},i=Object.entries(t);i.sort(([a,l],[u,d])=>a===u?0:a<u?-1:1);for(const[a,l]of i)l!==void 0&&(t7(a),s[a]=EC(l,e,n+`.${a}`));return s}function P1(t,e,n,r){return t?`${e}${fm(n)} is not a supported Convex type (present at path ${t} in original object ${fm(r)}). To learn about Convex's supported types, see https://docs.convex.dev/using/types.`:`${e}${fm(n)} is not a supported Convex type.`}function Ql(t){return EC(t,t,"")}var v1e=Object.defineProperty,y1e=(t,e,n)=>e in t?v1e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,I1=(t,e,n)=>y1e(t,typeof e!="symbol"?e+"":e,n),O4,P4;const b1e=Symbol.for("ConvexError");class kC extends(P4=Error,O4=b1e,P4){constructor(e){super(typeof e=="string"?e:fm(e)),I1(this,"name","ConvexError"),I1(this,"data"),I1(this,O4,!0),this.data=e}}const n7=()=>Array.from({length:4},()=>0);n7();n7();const I4="1.27.5";var x1e=Object.defineProperty,_1e=(t,e,n)=>e in t?x1e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,D4=(t,e,n)=>_1e(t,typeof e!="symbol"?e+"":e,n);const w1e="color:rgb(0, 145, 255)";function r7(t){switch(t){case"query":return"Q";case"mutation":return"M";case"action":return"A";case"any":return"?"}}class s7{constructor(e){D4(this,"_onLogLineFuncs"),D4(this,"_verbose"),this._onLogLineFuncs={},this._verbose=e.verbose}addLogLineListener(e){let n=Math.random().toString(36).substring(2,15);for(let r=0;r<10&&this._onLogLineFuncs[n]!==void 0;r++)n=Math.random().toString(36).substring(2,15);return this._onLogLineFuncs[n]=e,()=>{delete this._onLogLineFuncs[n]}}logVerbose(...e){if(this._verbose)for(const n of Object.values(this._onLogLineFuncs))n("debug",`${new Date().toISOString()}`,...e)}log(...e){for(const n of Object.values(this._onLogLineFuncs))n("info",...e)}warn(...e){for(const n of Object.values(this._onLogLineFuncs))n("warn",...e)}error(...e){for(const n of Object.values(this._onLogLineFuncs))n("error",...e)}}function i7(t){const e=new s7(t);return e.addLogLineListener((n,...r)=>{switch(n){case"debug":console.debug(...r);break;case"info":console.log(...r);break;case"warn":console.warn(...r);break;case"error":console.error(...r);break;default:console.log(...r)}}),e}function a7(t){return new s7(t)}function xx(t,e,n,r,s){const i=r7(n);if(typeof s=="object"&&(s=`ConvexError ${JSON.stringify(s.errorData,null,2)}`),e==="info"){const a=s.match(/^\[.*?\] /);if(a===null){t.error(`[CONVEX ${i}(${r})] Could not parse console.log`);return}const l=s.slice(1,a[0].length-2),u=s.slice(a[0].length);t.log(`%c[CONVEX ${i}(${r})] [${l}]`,w1e,u)}else t.error(`[CONVEX ${i}(${r})] ${s}`)}function S1e(t,e){const n=`[CONVEX FATAL ERROR] ${e}`;return t.error(n),new Error(n)}function Xd(t,e,n){return`[CONVEX ${r7(t)}(${e})] ${n.errorMessage}
|
|
1818
|
-
Called by client`}function TC(t,e){return e.data=t.errorData,e}function _x(t){const e=t.split(":");let n,r;return e.length===1?(n=e[0],r="default"):(n=e.slice(0,e.length-1).join(":"),r=e[e.length-1]),n.endsWith(".js")&&(n=n.slice(0,-3)),`${n}:${r}`}function iu(t,e){return JSON.stringify({udfPath:_x(t),args:Ql(e)})}var E1e=Object.defineProperty,k1e=(t,e,n)=>e in t?E1e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,xa=(t,e,n)=>k1e(t,typeof e!="symbol"?e+"":e,n);class T1e{constructor(){xa(this,"nextQueryId"),xa(this,"querySetVersion"),xa(this,"querySet"),xa(this,"queryIdToToken"),xa(this,"identityVersion"),xa(this,"auth"),xa(this,"outstandingQueriesOlderThanRestart"),xa(this,"outstandingAuthOlderThanRestart"),xa(this,"paused"),xa(this,"pendingQuerySetModifications"),this.nextQueryId=0,this.querySetVersion=0,this.identityVersion=0,this.querySet=new Map,this.queryIdToToken=new Map,this.outstandingQueriesOlderThanRestart=new Set,this.outstandingAuthOlderThanRestart=!1,this.paused=!1,this.pendingQuerySetModifications=new Map}hasSyncedPastLastReconnect(){return this.outstandingQueriesOlderThanRestart.size===0&&!this.outstandingAuthOlderThanRestart}markAuthCompletion(){this.outstandingAuthOlderThanRestart=!1}subscribe(e,n,r,s){const i=_x(e),a=iu(i,n),l=this.querySet.get(a);if(l!==void 0)return l.numSubscribers+=1,{queryToken:a,modification:null,unsubscribe:()=>this.removeSubscriber(a)};{const u=this.nextQueryId++,d={id:u,canonicalizedUdfPath:i,args:n,numSubscribers:1,journal:r,componentPath:s};this.querySet.set(a,d),this.queryIdToToken.set(u,a);const p=this.querySetVersion,h=this.querySetVersion+1,g={type:"Add",queryId:u,udfPath:i,args:[Ql(n)],journal:r,componentPath:s};return this.paused?this.pendingQuerySetModifications.set(u,g):this.querySetVersion=h,{queryToken:a,modification:{type:"ModifyQuerySet",baseVersion:p,newVersion:h,modifications:[g]},unsubscribe:()=>this.removeSubscriber(a)}}}transition(e){for(const n of e.modifications)switch(n.type){case"QueryUpdated":case"QueryFailed":{this.outstandingQueriesOlderThanRestart.delete(n.queryId);const r=n.journal;if(r!==void 0){const s=this.queryIdToToken.get(n.queryId);s!==void 0&&(this.querySet.get(s).journal=r)}break}case"QueryRemoved":{this.outstandingQueriesOlderThanRestart.delete(n.queryId);break}default:throw new Error(`Invalid modification ${n.type}`)}}queryId(e,n){const r=_x(e),s=iu(r,n),i=this.querySet.get(s);return i!==void 0?i.id:null}isCurrentOrNewerAuthVersion(e){return e>=this.identityVersion}getAuth(){return this.auth}setAuth(e){this.auth={tokenType:"User",value:e};const n=this.identityVersion;return this.paused||(this.identityVersion=n+1),{type:"Authenticate",baseVersion:n,...this.auth}}setAdminAuth(e,n){const r={tokenType:"Admin",value:e,impersonating:n};this.auth=r;const s=this.identityVersion;return this.paused||(this.identityVersion=s+1),{type:"Authenticate",baseVersion:s,...r}}clearAuth(){this.auth=void 0,this.markAuthCompletion();const e=this.identityVersion;return this.paused||(this.identityVersion=e+1),{type:"Authenticate",tokenType:"None",baseVersion:e}}hasAuth(){return!!this.auth}isNewAuth(e){return this.auth?.value!==e}queryPath(e){const n=this.queryIdToToken.get(e);return n?this.querySet.get(n).canonicalizedUdfPath:null}queryArgs(e){const n=this.queryIdToToken.get(e);return n?this.querySet.get(n).args:null}queryToken(e){return this.queryIdToToken.get(e)??null}queryJournal(e){return this.querySet.get(e)?.journal}restart(e){this.unpause(),this.outstandingQueriesOlderThanRestart.clear();const n=[];for(const i of this.querySet.values()){const a={type:"Add",queryId:i.id,udfPath:i.canonicalizedUdfPath,args:[Ql(i.args)],journal:i.journal,componentPath:i.componentPath};n.push(a),e.has(i.id)||this.outstandingQueriesOlderThanRestart.add(i.id)}this.querySetVersion=1;const r={type:"ModifyQuerySet",baseVersion:0,newVersion:1,modifications:n};if(!this.auth)return this.identityVersion=0,[r,void 0];this.outstandingAuthOlderThanRestart=!0;const s={type:"Authenticate",baseVersion:0,...this.auth};return this.identityVersion=1,[r,s]}pause(){this.paused=!0}resume(){const e=this.pendingQuerySetModifications.size>0?{type:"ModifyQuerySet",baseVersion:this.querySetVersion,newVersion:++this.querySetVersion,modifications:Array.from(this.pendingQuerySetModifications.values())}:void 0,n=this.auth!==void 0?{type:"Authenticate",baseVersion:this.identityVersion++,...this.auth}:void 0;return this.unpause(),[e,n]}unpause(){this.paused=!1,this.pendingQuerySetModifications.clear()}removeSubscriber(e){const n=this.querySet.get(e);if(n.numSubscribers>1)return n.numSubscribers-=1,null;{this.querySet.delete(e),this.queryIdToToken.delete(n.id),this.outstandingQueriesOlderThanRestart.delete(n.id);const r=this.querySetVersion,s=this.querySetVersion+1,i={type:"Remove",queryId:n.id};return this.paused?this.pendingQuerySetModifications.has(n.id)?this.pendingQuerySetModifications.delete(n.id):this.pendingQuerySetModifications.set(n.id,i):this.querySetVersion=s,{type:"ModifyQuerySet",baseVersion:r,newVersion:s,modifications:[i]}}}}var C1e=Object.defineProperty,A1e=(t,e,n)=>e in t?C1e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,wy=(t,e,n)=>A1e(t,typeof e!="symbol"?e+"":e,n);class N1e{constructor(e,n){this.logger=e,this.markConnectionStateDirty=n,wy(this,"inflightRequests"),wy(this,"requestsOlderThanRestart"),wy(this,"inflightMutationsCount",0),wy(this,"inflightActionsCount",0),this.inflightRequests=new Map,this.requestsOlderThanRestart=new Set}request(e,n){const r=new Promise(s=>{const i=n?"Requested":"NotSent";this.inflightRequests.set(e.requestId,{message:e,status:{status:i,requestedAt:new Date,onResult:s}}),e.type==="Mutation"?this.inflightMutationsCount++:e.type==="Action"&&this.inflightActionsCount++});return this.markConnectionStateDirty(),r}onResponse(e){const n=this.inflightRequests.get(e.requestId);if(n===void 0||n.status.status==="Completed")return null;const r=n.message.type==="Mutation"?"mutation":"action",s=n.message.udfPath;for(const u of e.logLines)xx(this.logger,"info",r,s,u);const i=n.status;let a,l;if(e.success)a={success:!0,logLines:e.logLines,value:Of(e.result)},l=()=>i.onResult(a);else{const u=e.result,{errorData:d}=e;xx(this.logger,"error",r,s,u),a={success:!1,errorMessage:u,errorData:d!==void 0?Of(d):void 0,logLines:e.logLines},l=()=>i.onResult(a)}return e.type==="ActionResponse"||!e.success?(l(),this.inflightRequests.delete(e.requestId),this.requestsOlderThanRestart.delete(e.requestId),n.message.type==="Action"?this.inflightActionsCount--:n.message.type==="Mutation"&&this.inflightMutationsCount--,this.markConnectionStateDirty(),{requestId:e.requestId,result:a}):(n.status={status:"Completed",result:a,ts:e.ts,onResolve:l},null)}removeCompleted(e){const n=new Map;for(const[r,s]of this.inflightRequests.entries()){const i=s.status;i.status==="Completed"&&i.ts.lessThanOrEqual(e)&&(i.onResolve(),n.set(r,i.result),s.message.type==="Mutation"?this.inflightMutationsCount--:s.message.type==="Action"&&this.inflightActionsCount--,this.inflightRequests.delete(r),this.requestsOlderThanRestart.delete(r))}return n.size>0&&this.markConnectionStateDirty(),n}restart(){this.requestsOlderThanRestart=new Set(this.inflightRequests.keys());const e=[];for(const[n,r]of this.inflightRequests){if(r.status.status==="NotSent"){r.status.status="Requested",e.push(r.message);continue}if(r.message.type==="Mutation")e.push(r.message);else if(r.message.type==="Action"){if(this.inflightRequests.delete(n),this.requestsOlderThanRestart.delete(n),this.inflightActionsCount--,r.status.status==="Completed")throw new Error("Action should never be in 'Completed' state");r.status.onResult({success:!1,errorMessage:"Connection lost while action was in flight",logLines:[]})}}return this.markConnectionStateDirty(),e}resume(){const e=[];for(const[,n]of this.inflightRequests)if(n.status.status==="NotSent"){n.status.status="Requested",e.push(n.message);continue}return e}hasIncompleteRequests(){for(const e of this.inflightRequests.values())if(e.status.status==="Requested")return!0;return!1}hasInflightRequests(){return this.inflightRequests.size>0}hasSyncedPastLastReconnect(){return this.requestsOlderThanRestart.size===0}timeOfOldestInflightRequest(){if(this.inflightRequests.size===0)return null;let e=Date.now();for(const n of this.inflightRequests.values())n.status.status!=="Completed"&&n.status.requestedAt.getTime()<e&&(e=n.status.requestedAt.getTime());return new Date(e)}inflightMutations(){return this.inflightMutationsCount}inflightActions(){return this.inflightActionsCount}}const Qm=Symbol.for("functionName"),R1e=Symbol.for("toReferencePath");function j1e(t){return t[R1e]??null}function M1e(t){return t.startsWith("function://")}function O1e(t){let e;if(typeof t=="string")M1e(t)?e={functionHandle:t}:e={name:t};else if(t[Qm])e={name:t[Qm]};else{const n=j1e(t);if(!n)throw new Error(`${t} is not a functionReference`);e={reference:n}}return e}function Ps(t){const e=O1e(t);if(e.name===void 0)throw e.functionHandle!==void 0?new Error(`Expected function reference like "api.file.func" or "internal.file.func", but received function handle ${e.functionHandle}`):e.reference!==void 0?new Error(`Expected function reference in the current component like "api.file.func" or "internal.file.func", but received reference ${e.reference}`):new Error(`Expected function reference like "api.file.func" or "internal.file.func", but received ${JSON.stringify(e)}`);if(typeof t=="string")return t;const n=t[Qm];if(!n)throw new Error(`${t} is not a functionReference`);return n}function rj(t){return{[Qm]:t}}function o7(t=[]){const e={get(n,r){if(typeof r=="string"){const s=[...t,r];return o7(s)}else if(r===Qm){if(t.length<2){const a=["api",...t].join(".");throw new Error(`API path is expected to be of the form \`api.moduleName.functionName\`. Found: \`${a}\``)}const s=t.slice(0,-1).join("/"),i=t[t.length-1];return i==="default"?s:s+":"+i}else return r===Symbol.toStringTag?"FunctionReference":void 0}};return new Proxy({},e)}o7();var P1e=Object.defineProperty,I1e=(t,e,n)=>e in t?P1e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,wx=(t,e,n)=>I1e(t,typeof e!="symbol"?e+"":e,n);class Jm{constructor(e){wx(this,"queryResults"),wx(this,"modifiedQueries"),this.queryResults=e,this.modifiedQueries=[]}getQuery(e,...n){const r=So(n[0]),s=Ps(e),i=this.queryResults.get(iu(s,r));if(i!==void 0)return Jm.queryValue(i.result)}getAllQueries(e){const n=[],r=Ps(e);for(const s of this.queryResults.values())s.udfPath===_x(r)&&n.push({args:s.args,value:Jm.queryValue(s.result)});return n}setQuery(e,n,r){const s=So(n),i=Ps(e),a=iu(i,s);let l;r===void 0?l=void 0:l={success:!0,value:r,logLines:[]};const u={udfPath:i,args:s,result:l};this.queryResults.set(a,u),this.modifiedQueries.push(a)}static queryValue(e){if(e!==void 0)return e.success?e.value:void 0}}class D1e{constructor(){wx(this,"queryResults"),wx(this,"optimisticUpdates"),this.queryResults=new Map,this.optimisticUpdates=[]}ingestQueryResultsFromServer(e,n){this.optimisticUpdates=this.optimisticUpdates.filter(a=>!n.has(a.mutationId));const r=this.queryResults;this.queryResults=new Map(e);const s=new Jm(this.queryResults);for(const a of this.optimisticUpdates)a.update(s);const i=[];for(const[a,l]of this.queryResults){const u=r.get(a);(u===void 0||u.result!==l.result)&&i.push(a)}return i}applyOptimisticUpdate(e,n){this.optimisticUpdates.push({update:e,mutationId:n});const r=new Jm(this.queryResults);return e(r),r.modifiedQueries}rawQueryResult(e){return this.queryResults.get(e)}queryResult(e){const n=this.queryResults.get(e);if(n===void 0)return;const r=n.result;if(r!==void 0){if(r.success)return r.value;throw r.errorData!==void 0?TC(r,new kC(Xd("query",n.udfPath,r))):new Error(Xd("query",n.udfPath,r))}}hasQueryResult(e){return this.queryResults.get(e)!==void 0}queryLogs(e){return this.queryResults.get(e)?.result?.logLines}}var L1e=Object.defineProperty,$1e=(t,e,n)=>e in t?L1e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,D1=(t,e,n)=>$1e(t,typeof e!="symbol"?e+"":e,n);class Xs{constructor(e,n){D1(this,"low"),D1(this,"high"),D1(this,"__isUnsignedLong__"),this.low=e|0,this.high=n|0,this.__isUnsignedLong__=!0}static isLong(e){return(e&&e.__isUnsignedLong__)===!0}static fromBytesLE(e){return new Xs(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24)}toBytesLE(){const e=this.high,n=this.low;return[n&255,n>>>8&255,n>>>16&255,n>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]}static fromNumber(e){return isNaN(e)||e<0?L4:e>=z1e?F1e:new Xs(e%hm|0,e/hm|0)}toString(){return(BigInt(this.high)*BigInt(hm)+BigInt(this.low)).toString()}equals(e){return Xs.isLong(e)||(e=Xs.fromValue(e)),this.high>>>31===1&&e.high>>>31===1?!1:this.high===e.high&&this.low===e.low}notEquals(e){return!this.equals(e)}comp(e){return Xs.isLong(e)||(e=Xs.fromValue(e)),this.equals(e)?0:e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1}lessThanOrEqual(e){return this.comp(e)<=0}static fromValue(e){return typeof e=="number"?Xs.fromNumber(e):new Xs(e.low,e.high)}}const L4=new Xs(0,0),$4=65536,hm=$4*$4,z1e=hm*hm,F1e=new Xs(-1,-1);var U1e=Object.defineProperty,B1e=(t,e,n)=>e in t?U1e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Sy=(t,e,n)=>B1e(t,typeof e!="symbol"?e+"":e,n);class z4{constructor(e,n){Sy(this,"version"),Sy(this,"remoteQuerySet"),Sy(this,"queryPath"),Sy(this,"logger"),this.version={querySet:0,ts:Xs.fromNumber(0),identity:0},this.remoteQuerySet=new Map,this.queryPath=e,this.logger=n}transition(e){const n=e.startVersion;if(this.version.querySet!==n.querySet||this.version.ts.notEquals(n.ts)||this.version.identity!==n.identity)throw new Error(`Invalid start version: ${n.ts.toString()}:${n.querySet}`);for(const r of e.modifications)switch(r.type){case"QueryUpdated":{const s=this.queryPath(r.queryId);if(s)for(const a of r.logLines)xx(this.logger,"info","query",s,a);const i=Of(r.value??null);this.remoteQuerySet.set(r.queryId,{success:!0,value:i,logLines:r.logLines});break}case"QueryFailed":{const s=this.queryPath(r.queryId);if(s)for(const a of r.logLines)xx(this.logger,"info","query",s,a);const{errorData:i}=r;this.remoteQuerySet.set(r.queryId,{success:!1,errorMessage:r.errorMessage,errorData:i!==void 0?Of(i):void 0,logLines:r.logLines});break}case"QueryRemoved":{this.remoteQuerySet.delete(r.queryId);break}default:throw new Error(`Invalid modification ${r.type}`)}this.version=e.endVersion}remoteQueryResults(){return this.remoteQuerySet}timestamp(){return this.version.ts}}function L1(t){const e=Km(t);return Xs.fromBytesLE(Array.from(e))}function q1e(t){const e=new Uint8Array(t.toBytesLE());return Xm(e)}function F4(t){switch(t.type){case"FatalError":case"AuthError":case"ActionResponse":case"TransitionChunk":case"Ping":return{...t};case"MutationResponse":return t.success?{...t,ts:L1(t.ts)}:{...t};case"Transition":return{...t,startVersion:{...t.startVersion,ts:L1(t.startVersion.ts)},endVersion:{...t.endVersion,ts:L1(t.endVersion.ts)}}}}function V1e(t){switch(t.type){case"Authenticate":case"ModifyQuerySet":case"Mutation":case"Action":case"Event":return{...t};case"Connect":return t.maxObservedTimestamp!==void 0?{...t,maxObservedTimestamp:q1e(t.maxObservedTimestamp)}:{...t,maxObservedTimestamp:void 0}}}var H1e=Object.defineProperty,G1e=(t,e,n)=>e in t?H1e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Vr=(t,e,n)=>G1e(t,typeof e!="symbol"?e+"":e,n);const W1e=1e3,Y1e=1001,K1e=1005,X1e=4040;let ab;function ob(){return ab===void 0&&(ab=Date.now()),typeof performance>"u"||!performance.now?Date.now():Math.round(ab+performance.now())}function U4(){return`t=${Math.round((ob()-ab)/100)/10}s`}const l7={InternalServerError:{timeout:1e3},SubscriptionsWorkerFullError:{timeout:3e3},TooManyConcurrentRequests:{timeout:3e3},CommitterFullError:{timeout:3e3},AwsTooManyRequestsException:{timeout:3e3},ExecuteFullError:{timeout:3e3},SystemTimeoutError:{timeout:3e3},ExpiredInQueue:{timeout:3e3},VectorIndexesUnavailable:{timeout:1e3},SearchIndexesUnavailable:{timeout:1e3},TableSummariesUnavailable:{timeout:1e3},VectorIndexTooLarge:{timeout:3e3},SearchIndexTooLarge:{timeout:3e3},TooManyWritesInTimePeriod:{timeout:3e3}};function Q1e(t){if(t===void 0)return"Unknown";for(const e of Object.keys(l7))if(t.startsWith(e))return e;return"Unknown"}class J1e{constructor(e,n,r,s,i,a){this.markConnectionStateDirty=i,this.debug=a,Vr(this,"socket"),Vr(this,"connectionCount"),Vr(this,"_hasEverConnected",!1),Vr(this,"lastCloseReason"),Vr(this,"transitionChunkBuffer",null),Vr(this,"defaultInitialBackoff"),Vr(this,"maxBackoff"),Vr(this,"retries"),Vr(this,"serverInactivityThreshold"),Vr(this,"reconnectDueToServerInactivityTimeout"),Vr(this,"uri"),Vr(this,"onOpen"),Vr(this,"onResume"),Vr(this,"onMessage"),Vr(this,"webSocketConstructor"),Vr(this,"logger"),Vr(this,"onServerDisconnectError"),this.webSocketConstructor=r,this.socket={state:"disconnected"},this.connectionCount=0,this.lastCloseReason="InitialConnect",this.defaultInitialBackoff=1e3,this.maxBackoff=16e3,this.retries=0,this.serverInactivityThreshold=6e4,this.reconnectDueToServerInactivityTimeout=null,this.uri=e,this.onOpen=n.onOpen,this.onResume=n.onResume,this.onMessage=n.onMessage,this.onServerDisconnectError=n.onServerDisconnectError,this.logger=s,this.connect()}setSocketState(e){this.socket=e,this._logVerbose(`socket state changed: ${this.socket.state}, paused: ${"paused"in this.socket?this.socket.paused:void 0}`),this.markConnectionStateDirty()}assembleTransition(e){if(e.partNumber<0||e.partNumber>=e.totalParts||e.totalParts===0||this.transitionChunkBuffer&&(this.transitionChunkBuffer.totalParts!==e.totalParts||this.transitionChunkBuffer.messageLength!==e.messageLength))throw this.transitionChunkBuffer=null,new Error("Invalid TransitionChunk");if(this.transitionChunkBuffer===null&&(this.transitionChunkBuffer={chunks:[],totalParts:e.totalParts,messageLength:e.messageLength}),e.partNumber!==this.transitionChunkBuffer.chunks.length){const n=this.transitionChunkBuffer.chunks.length;throw this.transitionChunkBuffer=null,new Error(`TransitionChunk received out of order: expected part ${n}, got ${e.partNumber}`)}if(this.transitionChunkBuffer.chunks.push(e.chunk),this.transitionChunkBuffer.chunks.length===e.totalParts){const n=this.transitionChunkBuffer.chunks.join("");if(this.transitionChunkBuffer=null,n.length!==e.messageLength)throw new Error(`Assembled Transition length mismatch: expected ${e.messageLength}, got ${n.length}`);const r=F4(JSON.parse(n));if(r.type!=="Transition")throw new Error(`Expected Transition, got ${r.type} after assembling chunks`);return r}return null}connect(){if(this.socket.state==="terminated")return;if(this.socket.state!=="disconnected"&&this.socket.state!=="stopped")throw new Error("Didn't start connection from disconnected state: "+this.socket.state);const e=new this.webSocketConstructor(this.uri);this._logVerbose("constructed WebSocket"),this.setSocketState({state:"connecting",ws:e,paused:"no"}),this.resetServerInactivityTimeout(),e.onopen=()=>{if(this.logger.logVerbose("begin ws.onopen"),this.socket.state!=="connecting")throw new Error("onopen called with socket not in connecting state");this.setSocketState({state:"ready",ws:e,paused:this.socket.paused==="yes"?"uninitialized":"no"}),this.resetServerInactivityTimeout(),this.socket.paused==="no"&&(this._hasEverConnected=!0,this.onOpen({connectionCount:this.connectionCount,lastCloseReason:this.lastCloseReason,clientTs:ob()})),this.lastCloseReason!=="InitialConnect"&&(this.lastCloseReason?this.logger.log("WebSocket reconnected at",U4(),"after disconnect due to",this.lastCloseReason):this.logger.log("WebSocket reconnected at",U4())),this.connectionCount+=1,this.lastCloseReason=null},e.onerror=n=>{this.transitionChunkBuffer=null;const r=n.message;r&&this.logger.log(`WebSocket error message: ${r}`)},e.onmessage=n=>{this.resetServerInactivityTimeout();const r=n.data.length;let s=F4(JSON.parse(n.data));if(this._logVerbose(`received ws message with type ${s.type}`),s.type==="Ping")return;if(s.type==="TransitionChunk"){const a=this.assembleTransition(s);if(!a)return;s=a,this._logVerbose(`assembled full ws message of type ${s.type}`)}if(this.transitionChunkBuffer!==null)throw new Error(`Received unexpected ${s.type} while buffering TransitionChunks`);s.type==="Transition"&&this.reportLargeTransition({messageLength:r,transition:s}),this.onMessage(s).hasSyncedPastLastReconnect&&(this.retries=0,this.markConnectionStateDirty())},e.onclose=n=>{if(this._logVerbose("begin ws.onclose"),this.transitionChunkBuffer=null,this.lastCloseReason===null&&(this.lastCloseReason=n.reason||`closed with code ${n.code}`),n.code!==W1e&&n.code!==Y1e&&n.code!==K1e&&n.code!==X1e){let s=`WebSocket closed with code ${n.code}`;n.reason&&(s+=`: ${n.reason}`),this.logger.log(s),this.onServerDisconnectError&&n.reason&&this.onServerDisconnectError(s)}const r=Q1e(n.reason);this.scheduleReconnect(r)}}socketState(){return this.socket.state}sendMessage(e){const n={type:e.type,...e.type==="Authenticate"&&e.tokenType==="User"?{value:`...${e.value.slice(-7)}`}:{}};if(this.socket.state==="ready"&&this.socket.paused==="no"){const r=V1e(e),s=JSON.stringify(r);let i=!1;try{this.socket.ws.send(s),i=!0}catch(a){this.logger.log(`Failed to send message on WebSocket, reconnecting: ${a}`),this.closeAndReconnect("FailedToSendMessage")}return this._logVerbose(`${i?"sent":"failed to send"} message with type ${e.type}: ${JSON.stringify(n)}`),!0}return this._logVerbose(`message not sent (socket state: ${this.socket.state}, paused: ${"paused"in this.socket?this.socket.paused:void 0}): ${JSON.stringify(n)}`),!1}resetServerInactivityTimeout(){this.socket.state!=="terminated"&&(this.reconnectDueToServerInactivityTimeout!==null&&(clearTimeout(this.reconnectDueToServerInactivityTimeout),this.reconnectDueToServerInactivityTimeout=null),this.reconnectDueToServerInactivityTimeout=setTimeout(()=>{this.closeAndReconnect("InactiveServer")},this.serverInactivityThreshold))}scheduleReconnect(e){this.socket={state:"disconnected"};const n=this.nextBackoff(e);this.markConnectionStateDirty(),this.logger.log(`Attempting reconnect in ${Math.round(n)}ms`),setTimeout(()=>this.connect(),n)}closeAndReconnect(e){switch(this._logVerbose(`begin closeAndReconnect with reason ${e}`),this.socket.state){case"disconnected":case"terminated":case"stopped":return;case"connecting":case"ready":{this.lastCloseReason=e,this.close(),this.scheduleReconnect("client");return}default:this.socket}}close(){switch(this.socket.state){case"disconnected":case"terminated":case"stopped":return Promise.resolve();case"connecting":{const e=this.socket.ws;return new Promise(n=>{e.onclose=()=>{this._logVerbose("Closed after connecting"),n()},e.onopen=()=>{this._logVerbose("Opened after connecting"),e.close()}})}case"ready":{this._logVerbose("ws.close called");const e=this.socket.ws,n=new Promise(r=>{e.onclose=()=>{r()}});return e.close(),n}default:return this.socket,Promise.resolve()}}terminate(){switch(this.reconnectDueToServerInactivityTimeout&&clearTimeout(this.reconnectDueToServerInactivityTimeout),this.socket.state){case"terminated":case"stopped":case"disconnected":case"connecting":case"ready":{const e=this.close();return this.setSocketState({state:"terminated"}),e}default:throw this.socket,new Error(`Invalid websocket state: ${this.socket.state}`)}}stop(){switch(this.socket.state){case"terminated":return Promise.resolve();case"connecting":case"stopped":case"disconnected":case"ready":{const e=this.close();return this.socket={state:"stopped"},e}default:return this.socket,Promise.resolve()}}tryRestart(){switch(this.socket.state){case"stopped":break;case"terminated":case"connecting":case"ready":case"disconnected":this.logger.logVerbose("Restart called without stopping first");return;default:this.socket}this.connect()}pause(){switch(this.socket.state){case"disconnected":case"stopped":case"terminated":return;case"connecting":case"ready":{this.socket={...this.socket,paused:"yes"};return}default:{this.socket;return}}}resume(){switch(this.socket.state){case"connecting":this.socket={...this.socket,paused:"no"};return;case"ready":this.socket.paused==="uninitialized"?(this.socket={...this.socket,paused:"no"},this.onOpen({connectionCount:this.connectionCount,lastCloseReason:this.lastCloseReason,clientTs:ob()})):this.socket.paused==="yes"&&(this.socket={...this.socket,paused:"no"},this.onResume());return;case"terminated":case"stopped":case"disconnected":return;default:this.socket}this.connect()}connectionState(){return{isConnected:this.socket.state==="ready",hasEverConnected:this._hasEverConnected,connectionCount:this.connectionCount,connectionRetries:this.retries}}_logVerbose(e){this.logger.logVerbose(e)}nextBackoff(e){const r=(e==="client"?100:e==="Unknown"?this.defaultInitialBackoff:l7[e].timeout)*Math.pow(2,this.retries);this.retries+=1;const s=Math.min(r,this.maxBackoff),i=s*(Math.random()-.5);return s+i}reportLargeTransition({transition:e,messageLength:n}){if(e.clientClockSkew===void 0||e.serverTs===void 0)return;const r=ob()-e.clientClockSkew-e.serverTs/1e6,s=`${Math.round(r)}ms`,i=`${Math.round(n/1e4)/100}MB`,a=n/(r/1e3),l=`${Math.round(a/1e4)/100}MB per second`;this._logVerbose(`received ${i} transition in ${s} at ${l}`),n>2e7?this.logger.log(`received query results totaling more that 20MB (${i}) which will take a long time to download on slower connections`):r>2e4&&this.logger.log(`received query results totaling ${i} which took more than 20s to arrive (${s})`),this.debug&&this.sendMessage({type:"Event",eventType:"ClientReceivedTransition",event:{transitionTransitTime:r,messageLength:n}})}}function Z1e(){return eke()}function eke(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}class Yp extends Error{}Yp.prototype.name="InvalidTokenError";function tke(t){return decodeURIComponent(atob(t).replace(/(.)/g,(e,n)=>{let r=n.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}function nke(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return tke(e)}catch{return atob(e)}}function c7(t,e){if(typeof t!="string")throw new Yp("Invalid token specified: must be a string");e||(e={});const n=e.header===!0?0:1,r=t.split(".")[n];if(typeof r!="string")throw new Yp(`Invalid token specified: missing part #${n+1}`);let s;try{s=nke(r)}catch(i){throw new Yp(`Invalid token specified: invalid base64 for part #${n+1} (${i.message})`)}try{return JSON.parse(s)}catch(i){throw new Yp(`Invalid token specified: invalid json for part #${n+1} (${i.message})`)}}var rke=Object.defineProperty,ske=(t,e,n)=>e in t?rke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,vi=(t,e,n)=>ske(t,typeof e!="symbol"?e+"":e,n);const ike=20*24*60*60*1e3,B4=2;class ake{constructor(e,n,r){vi(this,"authState",{state:"noAuth"}),vi(this,"configVersion",0),vi(this,"syncState"),vi(this,"authenticate"),vi(this,"stopSocket"),vi(this,"tryRestartSocket"),vi(this,"pauseSocket"),vi(this,"resumeSocket"),vi(this,"clearAuth"),vi(this,"logger"),vi(this,"refreshTokenLeewaySeconds"),vi(this,"tokenConfirmationAttempts",0),this.syncState=e,this.authenticate=n.authenticate,this.stopSocket=n.stopSocket,this.tryRestartSocket=n.tryRestartSocket,this.pauseSocket=n.pauseSocket,this.resumeSocket=n.resumeSocket,this.clearAuth=n.clearAuth,this.logger=r.logger,this.refreshTokenLeewaySeconds=r.refreshTokenLeewaySeconds}async setConfig(e,n){this.resetAuthState(),this._logVerbose("pausing WS for auth token fetch"),this.pauseSocket();const r=await this.fetchTokenAndGuardAgainstRace(e,{forceRefreshToken:!1});r.isFromOutdatedConfig||(r.value?(this.setAuthState({state:"waitingForServerConfirmationOfCachedToken",config:{fetchToken:e,onAuthChange:n},hasRetried:!1}),this.authenticate(r.value)):(this.setAuthState({state:"initialRefetch",config:{fetchToken:e,onAuthChange:n}}),await this.refetchToken()),this._logVerbose("resuming WS after auth token fetch"),this.resumeSocket())}onTransition(e){if(this.syncState.isCurrentOrNewerAuthVersion(e.endVersion.identity)&&!(e.endVersion.identity<=e.startVersion.identity)){if(this.authState.state==="waitingForServerConfirmationOfCachedToken"){this._logVerbose("server confirmed auth token is valid"),this.refetchToken(),this.authState.config.onAuthChange(!0);return}this.authState.state==="waitingForServerConfirmationOfFreshToken"&&(this._logVerbose("server confirmed new auth token is valid"),this.scheduleTokenRefetch(this.authState.token),this.tokenConfirmationAttempts=0,this.authState.hadAuth||this.authState.config.onAuthChange(!0))}}onAuthError(e){if(e.authUpdateAttempted===!1&&(this.authState.state==="waitingForServerConfirmationOfFreshToken"||this.authState.state==="waitingForServerConfirmationOfCachedToken")){this._logVerbose("ignoring non-auth token expired error");return}const{baseVersion:n}=e;if(!this.syncState.isCurrentOrNewerAuthVersion(n+1)){this._logVerbose("ignoring auth error for previous auth attempt");return}this.tryToReauthenticate(e)}async tryToReauthenticate(e){if(this._logVerbose(`attempting to reauthenticate: ${e.error}`),this.authState.state==="noAuth"||this.authState.state==="waitingForServerConfirmationOfFreshToken"&&this.tokenConfirmationAttempts>=B4){this.logger.error(`Failed to authenticate: "${e.error}", check your server auth config`),this.syncState.hasAuth()&&this.syncState.clearAuth(),this.authState.state!=="noAuth"&&this.setAndReportAuthFailed(this.authState.config.onAuthChange);return}this.authState.state==="waitingForServerConfirmationOfFreshToken"&&(this.tokenConfirmationAttempts++,this._logVerbose(`retrying reauthentication, ${B4-this.tokenConfirmationAttempts} attempts remaining`)),await this.stopSocket();const n=await this.fetchTokenAndGuardAgainstRace(this.authState.config.fetchToken,{forceRefreshToken:!0});n.isFromOutdatedConfig||(n.value&&this.syncState.isNewAuth(n.value)?(this.authenticate(n.value),this.setAuthState({state:"waitingForServerConfirmationOfFreshToken",config:this.authState.config,token:n.value,hadAuth:this.authState.state==="notRefetching"||this.authState.state==="waitingForScheduledRefetch"})):(this._logVerbose("reauthentication failed, could not fetch a new token"),this.syncState.hasAuth()&&this.syncState.clearAuth(),this.setAndReportAuthFailed(this.authState.config.onAuthChange)),this.tryRestartSocket())}async refetchToken(){if(this.authState.state==="noAuth")return;this._logVerbose("refetching auth token");const e=await this.fetchTokenAndGuardAgainstRace(this.authState.config.fetchToken,{forceRefreshToken:!0});e.isFromOutdatedConfig||(e.value?this.syncState.isNewAuth(e.value)?(this.setAuthState({state:"waitingForServerConfirmationOfFreshToken",hadAuth:this.syncState.hasAuth(),token:e.value,config:this.authState.config}),this.authenticate(e.value)):this.setAuthState({state:"notRefetching",config:this.authState.config}):(this._logVerbose("refetching token failed"),this.syncState.hasAuth()&&this.clearAuth(),this.setAndReportAuthFailed(this.authState.config.onAuthChange)),this._logVerbose("restarting WS after auth token fetch (if currently stopped)"),this.tryRestartSocket())}scheduleTokenRefetch(e){if(this.authState.state==="noAuth")return;const n=this.decodeToken(e);if(!n){this.logger.error("Auth token is not a valid JWT, cannot refetch the token");return}const{iat:r,exp:s}=n;if(!r||!s){this.logger.error("Auth token does not have required fields, cannot refetch the token");return}const i=s-r;if(i<=2){this.logger.error("Auth token does not live long enough, cannot refetch the token");return}let a=Math.min(ike,(i-this.refreshTokenLeewaySeconds)*1e3);a<=0&&(this.logger.warn(`Refetching auth token immediately, configured leeway ${this.refreshTokenLeewaySeconds}s is larger than the token's lifetime ${i}s`),a=0);const l=setTimeout(()=>{this._logVerbose("running scheduled token refetch"),this.refetchToken()},a);this.setAuthState({state:"waitingForScheduledRefetch",refetchTokenTimeoutId:l,config:this.authState.config}),this._logVerbose(`scheduled preemptive auth token refetching in ${a}ms`)}async fetchTokenAndGuardAgainstRace(e,n){const r=++this.configVersion;this._logVerbose(`fetching token with config version ${r}`);const s=await e(n);return this.configVersion!==r?(this._logVerbose(`stale config version, expected ${r}, got ${this.configVersion}`),{isFromOutdatedConfig:!0}):{isFromOutdatedConfig:!1,value:s}}stop(){this.resetAuthState(),this.configVersion++,this._logVerbose(`config version bumped to ${this.configVersion}`)}setAndReportAuthFailed(e){e(!1),this.resetAuthState()}resetAuthState(){this.setAuthState({state:"noAuth"})}setAuthState(e){const n=e.state==="waitingForServerConfirmationOfFreshToken"?{hadAuth:e.hadAuth,state:e.state,token:`...${e.token.slice(-7)}`}:{state:e.state};switch(this._logVerbose(`setting auth state to ${JSON.stringify(n)}`),e.state){case"waitingForScheduledRefetch":case"notRefetching":case"noAuth":this.tokenConfirmationAttempts=0;break}this.authState.state==="waitingForScheduledRefetch"&&(clearTimeout(this.authState.refetchTokenTimeoutId),this.syncState.markAuthCompletion()),this.authState=e}decodeToken(e){try{return c7(e)}catch(n){return this._logVerbose(`Error decoding token: ${n instanceof Error?n.message:"Unknown error"}`),null}}_logVerbose(e){this.logger.logVerbose(`${e} [v${this.configVersion}]`)}}const oke=["convexClientConstructed","convexWebSocketOpen","convexFirstMessageReceived"];function lke(t,e){const n={sessionId:e};typeof performance>"u"||!performance.mark||performance.mark(t,{detail:n})}function cke(t){let e=t.name.slice(6);return e=e.charAt(0).toLowerCase()+e.slice(1),{name:e,startTime:t.startTime}}function uke(t){if(typeof performance>"u"||!performance.getEntriesByName)return[];const e=[];for(const n of oke){const r=performance.getEntriesByName(n).filter(s=>s.entryType==="mark").filter(s=>s.detail.sessionId===t);e.push(...r)}return e.map(cke)}var dke=Object.defineProperty,fke=(t,e,n)=>e in t?dke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,fr=(t,e,n)=>fke(t,typeof e!="symbol"?e+"":e,n);class hke{constructor(e,n,r){if(fr(this,"address"),fr(this,"state"),fr(this,"requestManager"),fr(this,"webSocketManager"),fr(this,"authenticationManager"),fr(this,"remoteQuerySet"),fr(this,"optimisticQueryResults"),fr(this,"_transitionHandlerCounter",0),fr(this,"_nextRequestId"),fr(this,"_onTransitionFns",new Map),fr(this,"_sessionId"),fr(this,"firstMessageReceived",!1),fr(this,"debug"),fr(this,"logger"),fr(this,"maxObservedTimestamp"),fr(this,"connectionStateSubscribers",new Map),fr(this,"nextConnectionStateSubscriberId",0),fr(this,"_lastPublishedConnectionState"),fr(this,"markConnectionStateDirty",()=>{Promise.resolve().then(()=>{const v=this.connectionState();if(JSON.stringify(v)!==JSON.stringify(this._lastPublishedConnectionState)){this._lastPublishedConnectionState=v;for(const b of this.connectionStateSubscribers.values())b(v)}})}),fr(this,"mark",v=>{this.debug&&lke(v,this.sessionId)}),typeof e=="object")throw new Error("Passing a ClientConfig object is no longer supported. Pass the URL of the Convex deployment as a string directly.");r?.skipConvexDeploymentUrlCheck!==!0&&l1e(e),r={...r};const s=r.authRefreshTokenLeewaySeconds??2;let i=r.webSocketConstructor;if(!i&&typeof WebSocket>"u")throw new Error("No WebSocket global variable defined! To use Convex in an environment without WebSocket try the HTTP client: https://docs.convex.dev/api/classes/browser.ConvexHttpClient");i=i||WebSocket,this.debug=r.reportDebugInfoToConvex??!1,this.address=e,this.logger=r.logger===!1?a7({verbose:r.verbose??!1}):r.logger!==!0&&r.logger?r.logger:i7({verbose:r.verbose??!1});const a=e.search("://");if(a===-1)throw new Error("Provided address was not an absolute URL.");const l=e.substring(a+3),u=e.substring(0,a);let d;if(u==="http")d="ws";else if(u==="https")d="wss";else throw new Error(`Unknown parent protocol ${u}`);const p=`${d}://${l}/api/${I4}/sync`;this.state=new T1e,this.remoteQuerySet=new z4(v=>this.state.queryPath(v),this.logger),this.requestManager=new N1e(this.logger,this.markConnectionStateDirty);const h=()=>{this.webSocketManager.pause(),this.state.pause()};this.authenticationManager=new ake(this.state,{authenticate:v=>{const b=this.state.setAuth(v);return this.webSocketManager.sendMessage(b),b.baseVersion},stopSocket:()=>this.webSocketManager.stop(),tryRestartSocket:()=>this.webSocketManager.tryRestart(),pauseSocket:h,resumeSocket:()=>this.webSocketManager.resume(),clearAuth:()=>{this.clearAuth()}},{logger:this.logger,refreshTokenLeewaySeconds:s}),this.optimisticQueryResults=new D1e,this.addOnTransitionHandler(v=>{n(v.queries.map(b=>b.token))}),this._nextRequestId=0,this._sessionId=Z1e();const{unsavedChangesWarning:g}=r;if(typeof window>"u"||typeof window.addEventListener>"u"){if(g===!0)throw new Error("unsavedChangesWarning requested, but window.addEventListener not found! Remove {unsavedChangesWarning: true} from Convex client options.")}else g!==!1&&window.addEventListener("beforeunload",v=>{if(this.requestManager.hasIncompleteRequests()){v.preventDefault();const b="Are you sure you want to leave? Your changes may not be saved.";return(v||window.event).returnValue=b,b}});this.webSocketManager=new J1e(p,{onOpen:v=>{this.mark("convexWebSocketOpen"),this.webSocketManager.sendMessage({...v,type:"Connect",sessionId:this._sessionId,maxObservedTimestamp:this.maxObservedTimestamp});const b=new Set(this.remoteQuerySet.remoteQueryResults().keys());this.remoteQuerySet=new z4(S=>this.state.queryPath(S),this.logger);const[x,E]=this.state.restart(b);E&&this.webSocketManager.sendMessage(E),this.webSocketManager.sendMessage(x);for(const S of this.requestManager.restart())this.webSocketManager.sendMessage(S)},onResume:()=>{const[v,b]=this.state.resume();b&&this.webSocketManager.sendMessage(b),v&&this.webSocketManager.sendMessage(v);for(const x of this.requestManager.resume())this.webSocketManager.sendMessage(x)},onMessage:v=>{switch(this.firstMessageReceived||(this.firstMessageReceived=!0,this.mark("convexFirstMessageReceived"),this.reportMarks()),v.type){case"Transition":{this.observedTimestamp(v.endVersion.ts),this.authenticationManager.onTransition(v),this.remoteQuerySet.transition(v),this.state.transition(v);const b=this.requestManager.removeCompleted(this.remoteQuerySet.timestamp());this.notifyOnQueryResultChanges(b);break}case"MutationResponse":{v.success&&this.observedTimestamp(v.ts);const b=this.requestManager.onResponse(v);b!==null&&this.notifyOnQueryResultChanges(new Map([[b.requestId,b.result]]));break}case"ActionResponse":{this.requestManager.onResponse(v);break}case"AuthError":{this.authenticationManager.onAuthError(v);break}case"FatalError":{const b=S1e(this.logger,v.error);throw this.webSocketManager.terminate(),b}}return{hasSyncedPastLastReconnect:this.hasSyncedPastLastReconnect()}},onServerDisconnectError:r.onServerDisconnectError},i,this.logger,this.markConnectionStateDirty,this.debug),this.mark("convexClientConstructed"),r.expectAuth&&h()}hasSyncedPastLastReconnect(){return this.requestManager.hasSyncedPastLastReconnect()||this.state.hasSyncedPastLastReconnect()}observedTimestamp(e){(this.maxObservedTimestamp===void 0||this.maxObservedTimestamp.lessThanOrEqual(e))&&(this.maxObservedTimestamp=e)}getMaxObservedTimestamp(){return this.maxObservedTimestamp}notifyOnQueryResultChanges(e){const n=this.remoteQuerySet.remoteQueryResults(),r=new Map;for(const[i,a]of n){const l=this.state.queryToken(i);if(l!==null){const u={result:a,udfPath:this.state.queryPath(i),args:this.state.queryArgs(i)};r.set(l,u)}}const s=this.optimisticQueryResults.ingestQueryResultsFromServer(r,new Set(e.keys()));this.handleTransition({queries:s.map(i=>{const a=this.optimisticQueryResults.rawQueryResult(i);return{token:i,modification:{kind:"Updated",result:a.result}}}),reflectedMutations:Array.from(e).map(([i,a])=>({requestId:i,result:a})),timestamp:this.remoteQuerySet.timestamp()})}handleTransition(e){for(const n of this._onTransitionFns.values())n(e)}addOnTransitionHandler(e){const n=this._transitionHandlerCounter++;return this._onTransitionFns.set(n,e),()=>this._onTransitionFns.delete(n)}getCurrentAuthClaims(){const e=this.state.getAuth();let n={};if(e&&e.tokenType==="User")try{n=e?c7(e.value):{}}catch{n={}}else return;return{token:e.value,decoded:n}}setAuth(e,n){this.authenticationManager.setConfig(e,n)}hasAuth(){return this.state.hasAuth()}setAdminAuth(e,n){const r=this.state.setAdminAuth(e,n);this.webSocketManager.sendMessage(r)}clearAuth(){const e=this.state.clearAuth();this.webSocketManager.sendMessage(e)}subscribe(e,n,r){const s=So(n),{modification:i,queryToken:a,unsubscribe:l}=this.state.subscribe(e,s,r?.journal,r?.componentPath);return i!==null&&this.webSocketManager.sendMessage(i),{queryToken:a,unsubscribe:()=>{const u=l();u&&this.webSocketManager.sendMessage(u)}}}localQueryResult(e,n){const r=So(n),s=iu(e,r);return this.optimisticQueryResults.queryResult(s)}localQueryResultByToken(e){return this.optimisticQueryResults.queryResult(e)}hasLocalQueryResultByToken(e){return this.optimisticQueryResults.hasQueryResult(e)}localQueryLogs(e,n){const r=So(n),s=iu(e,r);return this.optimisticQueryResults.queryLogs(s)}queryJournal(e,n){const r=So(n),s=iu(e,r);return this.state.queryJournal(s)}connectionState(){const e=this.webSocketManager.connectionState();return{hasInflightRequests:this.requestManager.hasInflightRequests(),isWebSocketConnected:e.isConnected,hasEverConnected:e.hasEverConnected,connectionCount:e.connectionCount,connectionRetries:e.connectionRetries,timeOfOldestInflightRequest:this.requestManager.timeOfOldestInflightRequest(),inflightMutations:this.requestManager.inflightMutations(),inflightActions:this.requestManager.inflightActions()}}subscribeToConnectionState(e){const n=this.nextConnectionStateSubscriberId++;return this.connectionStateSubscribers.set(n,e),()=>{this.connectionStateSubscribers.delete(n)}}async mutation(e,n,r){const s=await this.mutationInternal(e,n,r);if(!s.success)throw s.errorData!==void 0?TC(s,new kC(Xd("mutation",e,s))):new Error(Xd("mutation",e,s));return s.value}async mutationInternal(e,n,r,s){const{mutationPromise:i}=this.enqueueMutation(e,n,r,s);return i}enqueueMutation(e,n,r,s){const i=So(n);this.tryReportLongDisconnect();const a=this.nextRequestId;if(this._nextRequestId++,r!==void 0){const p=r.optimisticUpdate;if(p!==void 0){const h=b=>{p(b,i)instanceof Promise&&this.logger.warn("Optimistic update handler returned a Promise. Optimistic updates should be synchronous.")},v=this.optimisticQueryResults.applyOptimisticUpdate(h,a).map(b=>{const x=this.localQueryResultByToken(b);return{token:b,modification:{kind:"Updated",result:x===void 0?void 0:{success:!0,value:x,logLines:[]}}}});this.handleTransition({queries:v,reflectedMutations:[],timestamp:this.remoteQuerySet.timestamp()})}}const l={type:"Mutation",requestId:a,udfPath:e,componentPath:s,args:[Ql(i)]},u=this.webSocketManager.sendMessage(l),d=this.requestManager.request(l,u);return{requestId:a,mutationPromise:d}}async action(e,n){const r=await this.actionInternal(e,n);if(!r.success)throw r.errorData!==void 0?TC(r,new kC(Xd("action",e,r))):new Error(Xd("action",e,r));return r.value}async actionInternal(e,n,r){const s=So(n),i=this.nextRequestId;this._nextRequestId++,this.tryReportLongDisconnect();const a={type:"Action",requestId:i,udfPath:e,componentPath:r,args:[Ql(s)]},l=this.webSocketManager.sendMessage(a);return this.requestManager.request(a,l)}async close(){return this.authenticationManager.stop(),this.webSocketManager.terminate()}get url(){return this.address}get nextRequestId(){return this._nextRequestId}get sessionId(){return this._sessionId}reportMarks(){if(this.debug){const e=uke(this.sessionId);this.webSocketManager.sendMessage({type:"Event",eventType:"ClientConnect",event:e})}}tryReportLongDisconnect(){if(!this.debug)return;const e=this.connectionState().timeOfOldestInflightRequest;if(e===null||Date.now()-e.getTime()<=60*1e3)return;const n=`${this.address}/api/debug_event`;fetch(n,{method:"POST",headers:{"Content-Type":"application/json","Convex-Client":`npm-${I4}`},body:JSON.stringify({event:"LongWebsocketDisconnect"})}).then(r=>{r.ok||this.logger.warn("Analytics request failed with response:",r.body)}).catch(r=>{this.logger.warn("Analytics response failed with error:",r)})}}function pke({getCurrentValue:t,subscribe:e}){const[n,r]=w.useState(()=>({getCurrentValue:t,subscribe:e,value:t()}));let s=n.value;return(n.getCurrentValue!==t||n.subscribe!==e)&&(s=t(),r({getCurrentValue:t,subscribe:e,value:s})),w.useEffect(()=>{let i=!1;const a=()=>{i||r(u=>{if(u.getCurrentValue!==t||u.subscribe!==e)return u;const d=t();return u.value===d?u:{...u,value:d}})},l=e(a);return a(),()=>{i=!0,l()}},[t,e]),s}var mke=Object.defineProperty,gke=(t,e,n)=>e in t?mke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,_l=(t,e,n)=>gke(t,typeof e!="symbol"?e+"":e,n);const vke=5e3;if(typeof Ee>"u")throw new Error("Required dependency 'react' not found");function u7(t,e,n){function r(s){return Ske(s),e.mutation(t,s,{optimisticUpdate:n})}return r.withOptimisticUpdate=function(i){if(n!==void 0)throw new Error(`Already specified optimistic update for mutation ${Ps(t)}`);return u7(t,e,i)},r}function yke(t,e){return function(n){return e.action(t,n)}}class bke{constructor(e,n){if(_l(this,"address"),_l(this,"cachedSync"),_l(this,"listeners"),_l(this,"options"),_l(this,"closed",!1),_l(this,"_logger"),_l(this,"adminAuth"),_l(this,"fakeUserIdentity"),e===void 0)throw new Error("No address provided to ConvexReactClient.\nIf trying to deploy to production, make sure to follow all the instructions found at https://docs.convex.dev/production/hosting/\nIf running locally, make sure to run `convex dev` and ensure the .env.local file is populated.");if(typeof e!="string")throw new Error(`ConvexReactClient requires a URL like 'https://happy-otter-123.convex.cloud', received something of type ${typeof e} instead.`);if(!e.includes("://"))throw new Error("Provided address was not an absolute URL.");this.address=e,this.listeners=new Map,this._logger=n?.logger===!1?a7({verbose:n?.verbose??!1}):n?.logger!==!0&&n?.logger?n.logger:i7({verbose:n?.verbose??!1}),this.options={...n,logger:this._logger}}get url(){return this.address}get sync(){if(this.closed)throw new Error("ConvexReactClient has already been closed.");return this.cachedSync?this.cachedSync:(this.cachedSync=new hke(this.address,e=>this.transition(e),this.options),this.adminAuth&&this.cachedSync.setAdminAuth(this.adminAuth,this.fakeUserIdentity),this.cachedSync)}setAuth(e,n){if(typeof e=="string")throw new Error("Passing a string to ConvexReactClient.setAuth is no longer supported, please upgrade to passing in an async function to handle reauthentication.");this.sync.setAuth(e,n??(()=>{}))}clearAuth(){this.sync.clearAuth()}setAdminAuth(e,n){if(this.adminAuth=e,this.fakeUserIdentity=n,this.closed)throw new Error("ConvexReactClient has already been closed.");this.cachedSync&&this.sync.setAdminAuth(e,n)}watchQuery(e,...n){const[r,s]=n,i=Ps(e);return{onUpdate:a=>{const{queryToken:l,unsubscribe:u}=this.sync.subscribe(i,r,s),d=this.listeners.get(l);return d!==void 0?d.add(a):this.listeners.set(l,new Set([a])),()=>{if(this.closed)return;const p=this.listeners.get(l);p.delete(a),p.size===0&&this.listeners.delete(l),u()}},localQueryResult:()=>{if(this.cachedSync)return this.cachedSync.localQueryResult(i,r)},localQueryLogs:()=>{if(this.cachedSync)return this.cachedSync.localQueryLogs(i,r)},journal:()=>{if(this.cachedSync)return this.cachedSync.queryJournal(i,r)}}}prewarmQuery(e){const n=e.extendSubscriptionFor??vke,s=this.watchQuery(e.query,e.args||{}).onUpdate(()=>{});setTimeout(s,n)}mutation(e,...n){const[r,s]=n,i=Ps(e);return this.sync.mutation(i,r,s)}action(e,...n){const r=Ps(e);return this.sync.action(r,...n)}query(e,...n){const r=this.watchQuery(e,...n),s=r.localQueryResult();return s!==void 0?Promise.resolve(s):new Promise((i,a)=>{const l=r.onUpdate(()=>{l();try{i(r.localQueryResult())}catch(u){a(u)}})})}connectionState(){return this.sync.connectionState()}subscribeToConnectionState(e){return this.sync.subscribeToConnectionState(e)}get logger(){return this._logger}async close(){if(this.closed=!0,this.listeners=new Map,this.cachedSync){const e=this.cachedSync;this.cachedSync=void 0,await e.close()}}transition(e){for(const n of e){const r=this.listeners.get(n);if(r)for(const s of r)s()}}}const G0=Ee.createContext(void 0);function xke(){return w.useContext(G0)}const _ke=({client:t,children:e})=>Ee.createElement(G0.Provider,{value:t},e);function Sx(t,...e){const n=e[0]==="skip",r=e[0]==="skip"?{}:So(e[0]),s=typeof t=="string"?rj(t):t,i=Ps(s),a=w.useMemo(()=>n?{}:{query:{query:s,args:r}},[JSON.stringify(Ql(r)),i,n]),u=Cke(a).query;if(u instanceof Error)throw u;return u}function d7(t){const e=typeof t=="string"?rj(t):t,n=w.useContext(G0);if(n===void 0)throw new Error("Could not find Convex client! `useMutation` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app");return w.useMemo(()=>u7(e,n),[n,Ps(e)])}function wke(t){const e=w.useContext(G0),n=rj(t);if(e===void 0)throw new Error("Could not find Convex client! `useAction` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app");return w.useMemo(()=>yke(n,e),[e,Ps(n)])}function Ske(t){if(typeof t=="object"&&t!==null&&"bubbles"in t&&"persist"in t&&"isDefaultPrevented"in t)throw new Error("Convex function called with SyntheticEvent object. Did you use a Convex function as an event handler directly? Event handlers like onClick receive an event object as their first argument. These SyntheticEvent objects are not valid Convex values. Try wrapping the function like `const handler = () => myMutation();` and using `handler` in the event handler.")}var Eke=Object.defineProperty,kke=(t,e,n)=>e in t?Eke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,$1=(t,e,n)=>kke(t,typeof e!="symbol"?e+"":e,n);class Tke{constructor(e){$1(this,"createWatch"),$1(this,"queries"),$1(this,"listeners"),this.createWatch=e,this.queries={},this.listeners=new Set}setQueries(e){for(const n of Object.keys(e)){const{query:r,args:s}=e[n];if(Ps(r),this.queries[n]===void 0)this.addQuery(n,r,s);else{const i=this.queries[n];(Ps(r)!==Ps(i.query)||JSON.stringify(Ql(s))!==JSON.stringify(Ql(i.args)))&&(this.removeQuery(n),this.addQuery(n,r,s))}}for(const n of Object.keys(this.queries))e[n]===void 0&&this.removeQuery(n)}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}getLocalResults(e){const n={};for(const r of Object.keys(e)){const{query:s,args:i}=e[r];Ps(s);const a=this.createWatch(s,i);let l;try{l=a.localQueryResult()}catch(u){if(u instanceof Error)l=u;else throw u}n[r]=l}return n}setCreateWatch(e){this.createWatch=e;for(const n of Object.keys(this.queries)){const{query:r,args:s,watch:i}=this.queries[n],a=i.journal();this.removeQuery(n),this.addQuery(n,r,s,a)}}destroy(){for(const e of Object.keys(this.queries))this.removeQuery(e);this.listeners=new Set}addQuery(e,n,r,s){if(this.queries[e]!==void 0)throw new Error(`Tried to add a new query with identifier ${e} when it already exists.`);const i=this.createWatch(n,r,s),a=i.onUpdate(()=>this.notifyListeners());this.queries[e]={query:n,args:r,watch:i,unsubscribe:a}}removeQuery(e){const n=this.queries[e];if(n===void 0)throw new Error(`No query found with identifier ${e}.`);n.unsubscribe(),delete this.queries[e]}notifyListeners(){for(const e of this.listeners)e()}}function Cke(t){const e=xke();if(e===void 0)throw new Error("Could not find Convex client! `useQuery` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app");const n=w.useMemo(()=>(r,s,i)=>e.watchQuery(r,s,i?{journal:i}:{}),[e]);return Ake(t,n)}function Ake(t,e){const[n]=w.useState(()=>new Tke(e));n.createWatch!==e&&n.setCreateWatch(e),w.useEffect(()=>()=>n.destroy(),[n]);const r=w.useMemo(()=>({getCurrentValue:()=>n.getLocalResults(t),subscribe:s=>(n.setQueries(t),n.subscribe(s))}),[n,t]);return pke(r)}const f7=w.createContext(void 0);function Xa(){const t=w.useContext(f7);if(t===void 0)throw new Error("Could not find `ConvexProviderWithAuth` (or `ConvexProviderWithClerk` or `ConvexProviderWithAuth0`) as an ancestor component. This component may be missing, or you might have two instances of the `convex/react` module loaded in your project.");return t}function Nke({children:t,client:e,useAuth:n}){const{isLoading:r,isAuthenticated:s,fetchAccessToken:i}=n(),[a,l]=w.useState(null);return r&&a!==null&&l(null),!r&&!s&&a!==!1&&l(!1),Ee.createElement(f7.Provider,{value:{isLoading:a===null,isAuthenticated:s&&(a??!1)}},Ee.createElement(Rke,{authProviderAuthenticated:s,fetchAccessToken:i,authProviderLoading:r,client:e,setIsConvexAuthenticated:l}),Ee.createElement(_ke,{client:e},t),Ee.createElement(jke,{authProviderAuthenticated:s,fetchAccessToken:i,authProviderLoading:r,client:e,setIsConvexAuthenticated:l}))}function Rke({authProviderAuthenticated:t,fetchAccessToken:e,authProviderLoading:n,client:r,setIsConvexAuthenticated:s}){return w.useEffect(()=>{let i=!0;if(t)return r.setAuth(e,a=>{i&&s(()=>a)}),()=>{i=!1,s(a=>a?!1:null)}},[t,e,n,r,s]),null}function jke({authProviderAuthenticated:t,fetchAccessToken:e,authProviderLoading:n,client:r,setIsConvexAuthenticated:s}){return w.useEffect(()=>{if(t)return()=>{r.clearAuth(),s(()=>null)}},[t,e,n,r,s]),null}const Mke=t=>{const e=new Map;return t.forEach(n=>{const r=e.get(n.provider)||[];e.set(n.provider,[...r,n])}),e},q4=t=>{switch(t){case"anthropic":return"Anthropic";case"openai":return"OpenAI";case"deepseek":return"DeepSeek";case"google":return"Google AI";case"ollama":return"Ollama";case"meta":return"Meta";case"x-ai":return"xAI";default:return t}};function h7({currentModel:t,availableModels:e,onModelChange:n,disabled:r,isLoading:s,hideProvidedModels:i=!1}){const[a,l]=w.useState(!1),u=t,{isAuthenticated:d}=Xa(),p=Mke(e),h=Array.from(p.keys()).sort(),g=i?[]:h.filter(b=>(p.get(b)||[]).some(E=>ea(E.id))),v=h.filter(b=>(p.get(b)||[]).some(E=>!ea(E.id)));return f.jsxs(p0,{open:a,onOpenChange:l,children:[f.jsx(m0,{asChild:!0,children:f.jsx(Ie,{variant:"ghost",size:"sm",disabled:r||s,className:"h-8 px-2 rounded-full hover:bg-muted/80 transition-colors text-xs cursor-pointer",children:f.jsxs(f.Fragment,{children:[f.jsx(M1,{provider:u.provider}),f.jsx("span",{className:"text-[10px] font-medium",children:u.name})]})})}),f.jsxs(g0,{align:"start",className:"min-w-[200px]",children:[g.length>0&&f.jsx("div",{className:"px-2 py-1 text-[10px] uppercase tracking-wide text-muted-foreground",children:"MCPJam Provided Models"}),g.map(b=>{const E=(p.get(b)||[]).filter(k=>ea(k.id)),S=E.length;return f.jsxs(fI,{children:[f.jsxs(hI,{className:"flex items-center gap-3 text-sm cursor-pointer",children:[f.jsx(M1,{provider:b}),f.jsxs("div",{className:"flex flex-col flex-1",children:[f.jsx("span",{className:"font-medium",children:q4(b)}),f.jsxs("span",{className:"text-xs text-muted-foreground",children:[S," model",S!==1?"s":""]})]})]}),f.jsx(pI,{className:"min-w-[200px] max-h-[180px] overflow-y-auto",avoidCollisions:!0,collisionPadding:8,children:E.map(k=>{const T=ea(k.id),R=!!k.disabled||T&&!d,j=T&&!d?"Sign in to use MCPJam provided models":k.disabledReason,A=f.jsxs(To,{onSelect:()=>{n(k),l(!1)},className:"flex items-center gap-3 text-sm cursor-pointer",disabled:R,children:[f.jsx("div",{className:"flex flex-col flex-1",children:f.jsx("span",{className:"font-medium",children:k.name})}),k.id===t.id&&f.jsx("div",{className:"ml-auto w-2 h-2 bg-primary rounded-full"})]},k.id);return R?f.jsxs(Ma,{children:[f.jsx(Oa,{asChild:!0,children:f.jsx("div",{className:"pointer-events-auto",children:A})}),f.jsx(Pa,{side:"right",children:j})]},k.id):A})})]},b)}),g.length>0&&v.length>0&&f.jsx("div",{className:"my-1 h-px bg-muted/50"}),v.length>0&&f.jsx("div",{className:"px-2 py-1 text-[10px] uppercase tracking-wide text-muted-foreground",children:"Your providers"}),v.map(b=>{const E=(p.get(b)||[]).filter(k=>!ea(k.id)),S=E.length;return f.jsxs(fI,{children:[f.jsxs(hI,{className:"flex items-center gap-3 text-sm cursor-pointer",children:[f.jsx(M1,{provider:b}),f.jsxs("div",{className:"flex flex-col flex-1",children:[f.jsx("span",{className:"font-medium",children:q4(b)}),f.jsxs("span",{className:"text-xs text-muted-foreground",children:[S," model",S!==1?"s":""]})]})]}),f.jsx(pI,{className:"min-w-[200px] max-h-[180px] overflow-y-auto",avoidCollisions:!0,collisionPadding:8,children:E.map(k=>{const T=!!k.disabled,R=f.jsxs(To,{onSelect:()=>{n(k),l(!1)},className:"flex items-center gap-3 text-sm cursor-pointer",disabled:T,children:[f.jsx("div",{className:"flex flex-col flex-1",children:f.jsx("span",{className:"font-medium",children:k.name})}),k.id===t.id&&f.jsx("div",{className:"ml-auto w-2 h-2 bg-primary rounded-full"})]},k.id);return T?f.jsxs(Ma,{children:[f.jsx(Oa,{asChild:!0,children:f.jsx("div",{className:"pointer-events-auto",children:R})}),f.jsx(Pa,{side:"right",children:k.disabledReason})]},k.id):R})})]},b)})]})]})}function Oke({className:t,defaultValue:e,value:n,min:r=0,max:s=100,...i}){const a=w.useMemo(()=>Array.isArray(n)?n:Array.isArray(e)?e:[r,s],[n,e,r,s]);return f.jsxs(rre,{"data-slot":"slider",defaultValue:e,value:n,min:r,max:s,className:Me("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",t),...i,children:[f.jsx(sre,{"data-slot":"slider-track",className:Me("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:f.jsx(ire,{"data-slot":"slider-range",className:Me("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:a.length},(l,u)=>f.jsx(are,{"data-slot":"slider-thumb",className:"border-primary bg-background ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},u))]})}function Pke({systemPrompt:t,onSystemPromptChange:e,temperature:n,onTemperatureChange:r,disabled:s,isLoading:i}){const[a,l]=w.useState(!1),[u,d]=w.useState(t),[p,h]=w.useState(n),g=x=>{l(x),x&&(d(t),h(n))},v=()=>{e(u),r(p),l(!1),It.success("System prompt and temperature updated")},b=()=>{d(t),h(n),l(!1)};return f.jsxs(aa,{open:a,onOpenChange:g,children:[f.jsx(eN,{asChild:!0,children:f.jsxs(Ie,{variant:"ghost",size:"sm",disabled:s||i,className:"h-8 px-2 rounded-full hover:bg-muted/80 transition-colors text-xs cursor-pointer",children:[f.jsx(lie,{className:"h-2 w-2 mr-1"}),f.jsx("span",{className:"text-[10px] font-medium",children:"System Prompt & Temperature"})]})}),f.jsxs(oa,{className:"sm:max-w-md",children:[f.jsx(la,{children:f.jsx(ca,{children:"System Prompt & Temperature"})}),f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx("label",{className:"text-sm font-medium",children:"System Prompt"}),f.jsx(Ho,{value:u,onChange:x=>d(x.target.value),placeholder:"You are a helpful assistant with access to MCP tools.",className:"h-[140px] resize-none"})]}),f.jsxs("div",{className:"space-y-3",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("label",{className:"text-sm font-medium",children:"Temperature"}),f.jsx("span",{className:"text-sm text-muted-foreground",children:p.toFixed(1)})]}),f.jsx(Oke,{value:[p],onValueChange:x=>h(x[0]),min:0,max:2,step:.1,className:"w-full"}),f.jsx("p",{className:"text-xs text-muted-foreground",children:"Lower values (0-0.3) for focused tasks, higher values (0.7-2.0) for creative tasks"})]}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(Ie,{variant:"ghost",onClick:b,className:"cursor-pointer",children:"Cancel"}),f.jsx(Ie,{onClick:v,className:"cursor-pointer",children:"Save"})]})]})]})]})}function V4({value:t,onChange:e,onSubmit:n,onStop:r,disabled:s=!1,isLoading:i=!1,placeholder:a="Type your message...",className:l,showScrollToBottom:u=!1,onScrollToBottom:d,currentModel:p,availableModels:h,onModelChange:g,systemPrompt:v,onSystemPromptChange:b,temperature:x,onTemperatureChange:E,isSendBlocked:S=!1}){const k=w.useRef(null),T=w.useRef(null),[R,j]=w.useState([]),[A,N]=w.useState([]),M=p;w.useEffect(()=>{I()},[t]);const I=()=>{k.current&&(k.current.style.height="auto",k.current.style.height=`${Math.min(k.current.scrollHeight,120)}px`)},O=()=>{k.current&&(k.current.style.height="auto")},L=w.useCallback(()=>{!t.trim()||s||i||A.length>0||S||(n(t.trim(),R.length>0?R:void 0),e(""),j([]),O(),setTimeout(()=>{k.current?.focus()},0))},[t,s,i,A.length,n,R,e,S]),z=X=>{X.key==="Enter"&&!X.shiftKey&&!X.nativeEvent.isComposing&&(X.preventDefault(),L())},G=w.useCallback(async X=>{const F=Array.from(X.target.files||[]);if(F.length!==0){N(F.map(Y=>Y.name));try{const Y=await Promise.all(F.map(async H=>(await new Promise(te=>setTimeout(te,1e3)),{id:Math.random().toString(36).substr(2,9),name:H.name,url:URL.createObjectURL(H),contentType:H.type,size:H.size})));j(H=>[...H,...Y])}catch(Y){console.error("Error uploading files:",Y)}finally{N([]),T.current&&(T.current.value="")}}},[]),W=X=>{j(F=>F.filter(Y=>Y.id!==X))};return f.jsxs("div",{className:"relative w-full",children:[f.jsx(hx,{children:u&&f.jsx(ei.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},className:"absolute left-1/2 bottom-full mb-4 -translate-x-1/2 z-50",children:f.jsx(Ie,{size:"sm",variant:"outline",className:"rounded-full shadow-lg cursor-pointer",onClick:d,children:f.jsx(Bre,{className:"h-4 w-4"})})})}),f.jsx("input",{ref:T,type:"file",multiple:!0,className:"hidden",onChange:G,accept:"image/*,.pdf,.txt,.json,.csv"}),(R.length>0||A.length>0)&&f.jsxs("div",{className:"mb-3 flex flex-wrap gap-2",children:[R.map(X=>f.jsxs("div",{className:"flex items-center gap-2 bg-muted px-3 py-2 rounded-lg text-sm",children:[f.jsx("span",{className:"truncate max-w-[200px]",children:X.name}),f.jsx("button",{onClick:()=>W(X.id),className:"text-muted-foreground hover:text-foreground cursor-pointer",children:"×"})]},X.id)),A.map(X=>f.jsxs("div",{className:"flex items-center gap-2 bg-muted/50 px-3 py-2 rounded-lg text-sm animate-pulse",children:[f.jsx("span",{className:"truncate max-w-[200px]",children:X}),f.jsx("div",{className:"w-3 h-3 border-2 border-current border-t-transparent rounded-full animate-spin"})]},X))]}),f.jsxs("div",{className:"relative",children:[f.jsx(Ho,{ref:k,value:t,onChange:X=>{S||e(X.target.value)},onKeyDown:z,placeholder:a,disabled:s,readOnly:s||S,className:kT("min-h-[56px] max-h-[120px] resize-none pl-16 pr-14 py-4 rounded-3xl","border-border/30 bg-background/50 focus-visible:border-border/50","focus-visible:ring-0 focus-visible:ring-offset-0","transition-all duration-200 ease-in-out overflow-y-auto","text-base placeholder:text-muted-foreground/60",S?"cursor-not-allowed bg-muted/30 text-muted-foreground":"",l),rows:1,autoFocus:!S}),f.jsx("div",{className:"absolute bottom-3 left-4 flex items-center gap-1",children:f.jsxs(Ma,{children:[f.jsx(Oa,{asChild:!0,children:f.jsx(Ie,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0 rounded-full hover:bg-muted/80 transition-colors cursor-pointer",onClick:()=>T.current?.click(),disabled:s||i||S,children:f.jsx(Xse,{size:16})})}),f.jsx(Pa,{children:"Add files"})]})}),f.jsx("div",{className:"absolute bottom-3 right-4 flex items-center gap-1",children:i?f.jsxs(Ma,{children:[f.jsx(Oa,{asChild:!0,children:f.jsx(Ie,{type:"button",size:"sm",variant:"outline",className:"h-8 w-8 p-0 rounded-full border-border/30 hover:border-border/50 transition-colors cursor-pointer",onClick:r,children:f.jsx(yie,{size:16})})}),f.jsx(Pa,{children:"Stop generating"})]}):f.jsxs(Ma,{children:[f.jsx(Oa,{asChild:!0,children:f.jsx(Ie,{type:"button",size:"sm",className:kT("h-8 w-8 p-0 rounded-full transition-all duration-200 cursor-pointer",t.trim()&&!s&&A.length===0&&!S?"bg-primary text-primary-foreground hover:bg-primary/90 shadow-sm":"bg-muted text-muted-foreground cursor-not-allowed"),onClick:L,disabled:!t.trim()||s||A.length>0||S,children:f.jsx(hB,{size:16})})}),f.jsx(Pa,{children:"Send message"})]})})]}),f.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[h.length>0&&M&&f.jsx(h7,{currentModel:M,availableModels:h,onModelChange:g,disabled:!1,isLoading:i}),b&&E&&f.jsx(Pke,{systemPrompt:v||"You are a helpful assistant with access to MCP tools.",onSystemPromptChange:b,temperature:x||0,onTemperatureChange:E,disabled:s,isLoading:i})]})]})}function Ike({serverConfigs:t,connectedServerConfigs:e,systemPrompt:n=""}){const r=w.useRef(null),[s,i]=w.useState(!0),{isAuthenticated:a}=Xa(),{signUp:l}=da(),u=ua(),[d,p]=w.useState(n||"You are a helpful assistant with access to MCP tools."),[h,g]=w.useState(1),[v,b]=w.useState({}),E=Object.keys(t||{}).filter(ae=>e?.[ae]?.connectionStatus==="connected"),S=E.length===0,{messages:k,isLoading:T,error:R,input:j,setInput:A,sendMessage:N,stopGeneration:M,regenerateMessage:I,clearChat:O,model:L,availableModels:z,setModel:G,elicitationRequest:W,elicitationLoading:X,handleElicitationResponse:F}=fV({systemPrompt:d,temperature:h,selectedServers:E,onError:ae=>{It.error(ae)}}),H=(L?ea(L.id):!1)&&!a,te="Sign in to use MCPJam provided models";w.useEffect(()=>{H&&A("")},[H,A]),w.useEffect(()=>{const ae=localStorage.getItem("chat-selected-model");if(ae&&z.length>0){const B=z.find(J=>J.id===ae);B&&(!L||L.id!==ae)&&G(B)}},[z]),w.useEffect(()=>{L&&localStorage.setItem("chat-selected-model",L.id)},[L]),w.useEffect(()=>{L&&g(Ede(L))},[L]),w.useEffect(()=>{const ae=async()=>{const B={};for(const J of E)try{const oe=await AN(J);oe.toolsMetadata&&Object.assign(B,oe.toolsMetadata)}catch(oe){console.error(`Failed to fetch tools for server ${J}:`,oe)}b(B)};E&&E.length>0?ae():b({})},[JSON.stringify(E)]);const P=k.length>0,re=H||S,ue=H?"Sign in to use free chat":"Connect an MCP server to send your first message",D=[{label:"Available tools",value:"What tools are available?",icon:yB}];w.useEffect(()=>{s&&r.current&&(r.current.scrollTop=r.current.scrollHeight)},[k,s]);const Z=()=>{if(!r.current)return;const{scrollTop:ae,scrollHeight:B,clientHeight:J}=r.current,fe=B-ae-J<100;i(fe)},he=ae=>{navigator.clipboard.writeText(ae)},V=async(ae,B)=>{try{const oe=await(await fetch("/api/mcp/tools/execute",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({toolName:ae,parameters:B,...E.length===1?{serverId:E[0]}:{}})})).json();return console.log("handleCallTool",oe),oe.result}catch(J){throw console.error("handleCallTool",J),J}},U=ae=>{A(ae),N(ae)},K=(ae,B)=>f.jsxs("div",{className:"flex flex-col h-screen",children:[f.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-4",children:[f.jsx(ei.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.35},className:"w-full max-w-xl space-y-6 text-center",children:ae}),f.jsxs(ei.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.35,delay:.05},className:"w-full max-w-2xl pt-10",children:[f.jsx(V4,{value:j,onChange:A,onSubmit:()=>{u.capture("send_message",{location:"chat_tab",platform:Ni(),environment:void 0,model_id:L?.id??null,model_name:L?.name??null,model_provider:L?.provider??null}),N(j)},onStop:M,disabled:z.length===0||B.disabled,isLoading:T,placeholder:B.placeholder,className:"border shadow-sm",currentModel:L||null,availableModels:z,onModelChange:G,onClearChat:O,hasMessages:!1,systemPrompt:d,onSystemPromptChange:p,temperature:h,onTemperatureChange:g,isSendBlocked:H}),z.length===0&&f.jsx(ei.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.25},className:"mt-3 text-center text-xs text-muted-foreground",children:"Configure API keys in Settings or start Ollama to enable chat"})]})]}),f.jsx(ST,{elicitationRequest:W,onResponse:F,loading:X})]});if(!P&&re)return K(H?f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{className:"space-y-1",children:[f.jsx("h2",{className:"text-base font-medium",children:"Create an account to use free models"}),f.jsx("p",{className:"text-sm text-muted-foreground",children:"or bring your own API key in the settings tab"})]}),f.jsx("div",{className:"flex justify-center gap-2",children:f.jsx(Ie,{onClick:()=>{u.capture("create_account",{location:"chat_tab",platform:Ni(),environment:void 0}),l()},style:{backgroundColor:"#E55A3A"},className:"hover:opacity-90 cursor-pointer",children:"Create account"})})]}):f.jsxs("div",{className:"space-y-4",children:[f.jsx("div",{className:"space-y-1",children:f.jsx("h2",{className:"text-base font-medium",children:"You must connect to an MCP server"})}),f.jsxs("div",{className:"flex justify-center gap-2 text-xs text-muted-foreground",children:[f.jsxs("a",{href:"#servers",className:"inline-flex items-center gap-1 rounded-full border px-3 py-1 transition hover:bg-muted/30",children:[f.jsx(ise,{className:"h-3 w-3"})," Add server"]}),f.jsxs("a",{href:"#settings",className:"inline-flex items-center gap-1 rounded-full border px-3 py-1 transition hover:bg-muted/30",children:[f.jsx(ZA,{className:"h-3 w-3"})," Settings"]})]})]}),{placeholder:ue,disabled:!0});if(!P){const ae=f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{className:"space-y-1",children:[f.jsx("h2",{className:"text-base font-medium",children:"Test your servers"}),f.jsx("p",{className:"text-sm text-muted-foreground",children:"Start typing or choose a quick suggestion to begin."})]}),f.jsx("div",{className:"flex flex-wrap justify-center gap-2",children:D.map(({label:B,value:J,icon:oe})=>f.jsxs("button",{type:"button",onClick:()=>A(J),className:"inline-flex items-center gap-2 rounded-full border border-border/60 px-3 py-1.5 text-xs transition hover:border-border hover:bg-muted/40 cursor-pointer",children:[f.jsx(oe,{className:"h-3.5 w-3.5 text-muted-foreground"}),B]},B))})]});return K(ae,{placeholder:"Send a message...",disabled:!1})}return f.jsx(h0,{children:f.jsxs("div",{className:"relative bg-background h-screen overflow-hidden",children:[f.jsx("div",{ref:r,onScroll:Z,className:"h-full overflow-y-auto pb-40",children:f.jsx("div",{className:"max-w-4xl mx-auto px-4 pt-8 pb-8",children:f.jsxs(hx,{mode:"popLayout",children:[k.map((ae,B)=>f.jsx(ei.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3,delay:B*.05},className:"mb-8",children:f.jsx(t1e,{message:ae,model:L||null,isLoading:T&&B===k.length-1,onEdit:()=>{},onRegenerate:I,onCopy:he,showActions:!0,serverConfigs:t,onCallTool:V,onSendFollowup:U,toolsMetadata:v,serverId:E.length===1?E[0]:void 0})},ae.id)),T&&k.length>0&&k[k.length-1].role==="user"&&f.jsx(ei.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"mb-8",children:f.jsxs("div",{className:"flex gap-4 items-start",children:[f.jsx("div",{className:"w-8 h-8 flex items-center rounded-full justify-center bg-muted/50 shrink-0",children:f.jsx(gB,{className:"h-4 w-4 text-muted-foreground"})}),f.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[f.jsx("span",{className:"text-sm text-muted-foreground",children:"Thinking"}),f.jsxs("div",{className:"flex space-x-1",children:[f.jsx("div",{className:"w-1.5 h-1.5 bg-muted-foreground/60 rounded-full animate-bounce"}),f.jsx("div",{className:"w-1.5 h-1.5 bg-muted-foreground/60 rounded-full animate-bounce delay-100"}),f.jsx("div",{className:"w-1.5 h-1.5 bg-muted-foreground/60 rounded-full animate-bounce delay-200"})]})]})]})})]})})}),f.jsx(hx,{children:R&&f.jsx(ei.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},className:"absolute bottom-40 left-0 right-0 px-4 py-3 bg-destructive/5 border-t border-destructive/10 z-10",children:f.jsx("div",{className:"max-w-4xl mx-auto",children:f.jsx("p",{className:"text-sm text-destructive",children:R})})})}),f.jsx("div",{className:"absolute bottom-0 left-0 right-0 border-t border-border/50 bg-background/80 backdrop-blur-sm",children:f.jsx("div",{className:"max-w-4xl mx-auto p-4",children:f.jsx("div",{children:f.jsx(V4,{value:j,onChange:A,onSubmit:(ae,B)=>{u.capture("send_message",{location:"chat_tab",platform:Ni(),environment:void 0,model_id:L?.id??null,model_name:L?.name??null,model_provider:L?.provider??null}),N(ae,B)},onStop:M,disabled:z.length===0||S||H,isLoading:T,placeholder:H?te:"Send a message...",className:"border-2 shadow-sm",currentModel:L,availableModels:z,onModelChange:G,onClearChat:O,hasMessages:P,systemPrompt:d,onSystemPromptChange:p,temperature:h,onTemperatureChange:g,isSendBlocked:H})})})}),f.jsx(ST,{elicitationRequest:W,onResponse:F,loading:X})]})})}function p7(t,e,n){const r=n.reduce((i,a)=>(a.status==="pending"||a.status==="running"||a.result==="pending"?i.pending+=1:a.result==="passed"?i.passed+=1:a.result==="failed"?i.failed+=1:a.result==="cancelled"&&(i.cancelled+=1),i.tokens+=a.tokensUsed||0,i),{passed:0,failed:0,cancelled:0,pending:0,tokens:0}),s=new Map;for(const i of n){const a=i.testCaseId;if(!a)continue;if(!s.has(a)){const u=e.find(p=>p._id===a),d=n.filter(p=>p.testCaseId===a).length;s.set(a,{testCaseId:a,title:u?.title||"Untitled",provider:u?.provider||"",model:u?.model||"",runs:d,passed:0,failed:0,cancelled:0,tokens:0})}const l=s.get(a);i.status==="pending"||i.status==="running"||i.result==="pending"||(i.result==="passed"?l.passed+=1:i.result==="failed"?l.failed+=1:i.result==="cancelled"&&(l.cancelled+=1)),l.tokens+=i.tokensUsed||0}return{filteredIterations:n,totals:r,byCase:Array.from(s.values())}}function Dke(t,e,n,r){const s=[];return t>0&&s.push(`${t} passed`),e>0&&s.push(`${e} failed`),n>0&&s.push(`${n} cancelled`),r>0&&s.push(`${r} pending`),s.join(" · ")||"No results"}function Lke({suite:t,onSelectSuite:e}){const{isAuthenticated:n}=Xa(),{user:r}=da(),s=t.config?.environment.servers,a=Sx("evals:getAllTestCasesAndIterationsBySuite",n&&!!r?{suiteId:t._id}:"skip"),l=w.useMemo(()=>a?p7(t,a.testCases,a.iterations):null,[t,a]),u=Array.isArray(t.config?.tests)?t.config.tests.length:0,d=w.useMemo(()=>{if(!Array.isArray(s))return[];const g=s.filter(b=>typeof b=="string").map(b=>b.trim()).filter(Boolean);if(g.length<=2)return g;const v=g.length-2;return[...g.slice(0,2),`+${v} more`]},[s]),p=l?.filteredIterations.length??0,h=()=>{if(!l)return"bg-zinc-300/50";const{passed:g,failed:v,cancelled:b,pending:x}=l.totals;if(g+v+b+x===0)return"bg-zinc-300/50";const S=g+v;if(S===0)return"bg-zinc-300/50";const k=v/S*100;return k===0?"bg-emerald-500/50":k<=30?"bg-amber-500/50":"bg-red-500/50"};return f.jsxs("button",{onClick:()=>e(t._id),className:"group relative flex w-full items-center gap-4 py-3 pl-4 pr-4 text-left transition-colors hover:bg-muted/50 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/60 cursor-pointer",children:[f.jsx("div",{className:`absolute left-0 top-0 h-full w-1 ${h()}`}),f.jsxs("div",{className:"grid min-w-0 flex-1 grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)] items-center gap-4",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"text-sm font-medium text-foreground",children:new Date(t._creationTime||0).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0})}),f.jsx("div",{className:"text-xs text-muted-foreground",children:d.length>0?d.join(", "):"No servers"})]}),f.jsxs("div",{className:"text-sm text-muted-foreground",children:[u," test",u!==1?"s":""," · ",p," ","iteration",p!==1?"s":""]}),f.jsx("div",{className:"text-sm text-muted-foreground",children:l?Dke(l.totals.passed,l.totals.failed,l.totals.cancelled,l.totals.pending):"Loading..."})]})]})}function $ke({suites:t,onSelectSuite:e}){if(t.length===0)return f.jsx("div",{className:"h-[calc(100vh-220px)] flex items-center justify-center rounded-xl border border-dashed",children:f.jsxs("div",{className:"text-center space-y-2",children:[f.jsx("div",{className:"text-lg font-semibold",children:"No evaluation suites yet"}),f.jsx("p",{className:"text-sm text-muted-foreground",children:"Trigger a test run to see your evaluation history here."})]})});const n=[...t].sort((r,s)=>(s._creationTime||0)-(r._creationTime||0));return f.jsx("div",{className:"space-y-4",children:f.jsxs("div",{className:"overflow-hidden rounded-xl border",children:[f.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)] items-center gap-4 border-b bg-muted/50 px-4 py-2 text-xs font-semibold text-muted-foreground",children:[f.jsx("div",{children:"Created"}),f.jsx("div",{children:"Tests"}),f.jsx("div",{children:"Results"})]}),f.jsx("div",{className:"divide-y",children:n.map(r=>f.jsx(Lke,{suite:r,onSelectSuite:e},r._id))})]})})}function zke({iteration:t,testCase:e}){const n=wke("evals:getEvalTestBlob"),[r,s]=w.useState(null),[i,a]=w.useState(!1),[l,u]=w.useState(null);return w.useEffect(()=>{let d=!1;async function p(){if(!t.blob){s(null),a(!1),u(null);return}a(!0),u(null);try{const h=await n({blobId:t.blob});d||s(h)}catch(h){d||(u(h?.message||"Failed to load blob"),console.error("Blob load error:",h))}finally{d||a(!1)}}return p(),()=>{d=!0}},[t.blob,n]),f.jsxs("div",{className:"space-y-3 py-2",children:[(e?.expectedToolCalls.length||0)>0&&f.jsxs("div",{className:"space-y-1.5",children:[f.jsx("div",{className:"text-xs font-semibold",children:"Expected tools"}),f.jsx("div",{className:"flex flex-wrap gap-1.5",children:e?.expectedToolCalls.map((d,p)=>f.jsx(vr,{variant:"outline",className:"font-mono text-xs",children:d},p))})]}),t.actualToolCalls.length>0&&f.jsxs("div",{className:"space-y-1.5",children:[f.jsx("div",{className:"text-xs font-semibold",children:"Actual tools called"}),f.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.actualToolCalls.map((d,p)=>f.jsx(vr,{variant:"outline",className:"font-mono text-xs",children:d},p))})]}),t.blob&&f.jsxs("div",{className:"space-y-1.5",children:[f.jsx("div",{className:"text-xs font-semibold",children:"Trace"}),f.jsx("div",{className:"rounded-md bg-muted/20 p-3",children:i?f.jsx("div",{className:"text-xs text-muted-foreground",children:"Loading trace"}):l?f.jsx("div",{className:"text-xs text-red-600",children:l}):f.jsx("pre",{className:"max-h-[360px] overflow-auto whitespace-pre-wrap break-words text-xs",children:JSON.stringify(r,null,2)})})]})]})}function Fke({suite:t,cases:e,iterations:n,aggregate:r,onBack:s}){const[i,a]=w.useState(null),[l,u]=w.useState(new Set),d=w.useMemo(()=>{const h=new Map,g=x=>{const E={runs:x.length,passed:0,failed:0,cancelled:0,pending:0,tokens:0,avgDuration:null};let S=0,k=0;return x.forEach(T=>{T.result==="passed"?E.passed+=1:T.result==="failed"?E.failed+=1:T.result==="cancelled"?E.cancelled+=1:E.pending+=1,E.tokens+=T.tokensUsed||0;const R=T.startedAt??T.createdAt,j=T.updatedAt??T.createdAt;if(R&&j){const A=Math.max(j-R,0);S+=A,k+=1}}),k>0&&(E.avgDuration=S/k),E};e.forEach(x=>{h.set(x._id,{testCase:x,iterations:[],summary:{runs:0,passed:0,failed:0,cancelled:0,pending:0,tokens:0,avgDuration:null}})});const v={testCase:null,iterations:[],summary:{runs:0,passed:0,failed:0,cancelled:0,pending:0,tokens:0,avgDuration:null}};n.forEach(x=>{const E=x.testCaseId?h.get(x.testCaseId):void 0;E?E.iterations.push(x):v.iterations.push(x)});const b=e.map(x=>{const E=h.get(x._id),S=[...E.iterations].sort((k,T)=>k.iterationNumber!=null&&T.iterationNumber!=null?k.iterationNumber-T.iterationNumber:(k.createdAt??0)-(T.createdAt??0));return{...E,iterations:S,summary:g(S)}});if(v.iterations.length>0){const x=[...v.iterations].sort((E,S)=>E.iterationNumber!=null&&S.iterationNumber!=null?E.iterationNumber-S.iterationNumber:(E.createdAt??0)-(S.createdAt??0));b.push({...v,iterations:x,summary:g(x)})}return b},[e,n]),p=h=>h==="passed"?"bg-emerald-500/50":h==="failed"?"bg-red-500/50":h==="cancelled"?"bg-zinc-300/50":"bg-amber-500/50";return f.jsxs("div",{className:"space-y-4",children:[f.jsx("div",{children:f.jsx(Ie,{variant:"ghost",size:"sm",onClick:s,children:"← Back to suites"})}),f.jsx("div",{className:"space-y-4",children:d.map((h,g)=>{const{testCase:v,iterations:b}=h,x=b.length>0,E=v?._id??`unassigned-${g}`,S=l.has(E),k=100,T=v?.query&&v.query.length>k,R=T&&!S?v.query.slice(0,k)+"...":v?.query,j=()=>{u(A=>{const N=new Set(A);return N.has(E)?N.delete(E):N.add(E),N})};return f.jsxs("div",{className:"overflow-hidden rounded-xl border",children:[f.jsx("div",{className:"border-b bg-muted/50 px-4 py-2.5",children:f.jsxs("div",{className:"space-y-2",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("h3",{className:"text-sm font-semibold pr-2",children:v?v.title:"Unassigned iterations"}),v?.provider?f.jsx(f.Fragment,{children:f.jsx("span",{className:"text-xs text-muted-foreground",children:v.provider})}):null,v?.model?f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"text-muted-foreground",children:"•"}),f.jsx("span",{className:"text-xs text-muted-foreground",children:v.model})]}):null]}),v?.query?f.jsxs("div",{className:"flex items-start gap-2",children:[f.jsxs("p",{className:"text-xs text-muted-foreground italic flex-1",children:['"',R,'"']}),T?f.jsx("button",{onClick:j,className:"text-xs text-primary hover:underline focus:outline-none whitespace-nowrap",children:S?"Show less":"Show more"}):null]}):null]})}),x?f.jsx("div",{className:"divide-y",children:b.map(A=>{const N=i===A._id,M=A.startedAt??A.createdAt,I=A.updatedAt??A.createdAt,O=M&&I?Math.max(I-M,0):null,L=A.result==="pending";return f.jsxs("div",{className:`relative ${L?"opacity-60":""}`,children:[f.jsx("div",{className:`absolute left-0 top-0 h-full w-1 ${p(A.result)}`}),f.jsx("button",{onClick:()=>{L||a(z=>z===A._id?null:A._id)},disabled:L,className:`flex w-full items-center gap-4 px-4 py-3 text-left transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/60 ${L?"cursor-not-allowed":"cursor-pointer hover:bg-muted/50"}`,children:f.jsxs("div",{className:"grid min-w-0 flex-1 grid-cols-[auto_1fr_auto_auto] items-center gap-4 pl-3",children:[f.jsx("div",{className:"text-muted-foreground",children:L?f.jsx(Ba,{className:"h-4 w-4"}):N?f.jsx(Au,{className:"h-4 w-4"}):f.jsx(Ba,{className:"h-4 w-4"})}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs("span",{className:"text-sm font-medium",children:["Iteration #",A.iterationNumber]}),L?f.jsx(mu,{className:"h-4 w-4 animate-spin text-amber-600"}):null]}),f.jsx("div",{className:"text-sm text-muted-foreground",children:L?"—":`${Number(A.tokensUsed||0).toLocaleString()} tokens`}),f.jsx("div",{className:"text-sm text-muted-foreground",children:L?"—":O!==null?Uke(O):"—"})]})}),N&&!L?f.jsx("div",{className:"border-t bg-muted/20 px-4 pb-4 pt-3 pl-8",children:f.jsx(zke,{iteration:A,testCase:v})}):null]},A._id)})}):f.jsx("div",{className:"px-4 py-6 text-center text-sm text-muted-foreground",children:"No iterations recorded for this test case yet."})]},E)})})]})}function Uke(t){if(t<1e3)return`${t}ms`;const e=Math.round(t/1e3);if(e<60)return`${e}s`;const n=Math.floor(e/60),r=e%60;if(n<60)return r?`${n}m ${r}s`:`${n}m`;const s=Math.floor(n/60),i=n%60;return i?`${s}h ${i}m`:`${s}h`}function Bke(){const{isAuthenticated:t,isLoading:e}=Xa(),{user:n}=da(),[r,s]=w.useState(null),i=t&&!!n,a=Sx("evals:getCurrentUserEvalTestSuitesWithMetadata",i?{}:"skip"),l=t&&!!n&&!!r,u=Sx("evals:getAllTestCasesAndIterationsBySuite",l?{suiteId:r}:"skip"),d=a?.testSuites,p=a===void 0,h=l&&u===void 0,g=w.useMemo(()=>!r||!d?null:d.find(x=>x._id===r)??null,[r,d]),v=w.useMemo(()=>u?[...u.iterations].sort((x,E)=>(E.startedAt||E.createdAt)-(x.startedAt||x.createdAt)):[],[u]),b=w.useMemo(()=>!g||!u?null:p7(g,u.testCases,u.iterations),[g,u]);return e?f.jsx("div",{className:"p-6",children:f.jsx("div",{className:"flex h-64 items-center justify-center",children:f.jsxs("div",{className:"text-center",children:[f.jsx("div",{className:"mx-auto h-8 w-8 animate-spin rounded-full border-b-2 border-primary"}),f.jsx("p",{className:"mt-4 text-muted-foreground",children:"Loading..."})]})})}):!t||!n?f.jsx("div",{className:"p-6",children:f.jsx(th,{icon:mB,title:"Sign in to view your evals",description:"Create an account or sign in to see previous runs and metrics.",className:"h-[calc(100vh-200px)]"})}):p&&i?f.jsx("div",{className:"p-6",children:f.jsx("div",{className:"flex h-64 items-center justify-center",children:f.jsxs("div",{className:"text-center",children:[f.jsx("div",{className:"mx-auto h-8 w-8 animate-spin rounded-full border-b-2 border-primary"}),f.jsx("p",{className:"mt-4 text-muted-foreground",children:"Loading your eval data..."})]})})}):f.jsxs("div",{className:"space-y-6 p-6",children:[f.jsx("div",{className:"flex items-center justify-between",children:f.jsx("h1",{className:"text-2xl font-semibold",children:"Evaluation results"})}),g?h?f.jsx("div",{className:"flex h-64 items-center justify-center",children:f.jsxs("div",{className:"text-center",children:[f.jsx("div",{className:"mx-auto h-8 w-8 animate-spin rounded-full border-b-2 border-primary"}),f.jsx("p",{className:"mt-4 text-muted-foreground",children:"Loading suite details..."})]})}):f.jsx(Fke,{suite:g,cases:u?.testCases||[],iterations:v,aggregate:b,onBack:()=>s(null)}):f.jsx($ke,{suites:d||[],onSelectSuite:s})]})}const qke="modulepreload",Vke=function(t){return"/"+t},H4={},Hke=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){let d=function(p){return Promise.all(p.map(h=>Promise.resolve(h).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};var a=d;document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),u=l?.nonce||l?.getAttribute("nonce");s=d(n.map(p=>{if(p=Vke(p),p in H4)return;H4[p]=!0;const h=p.endsWith(".css"),g=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${g}`))return;const v=document.createElement("link");if(v.rel=h?"stylesheet":qke,h||(v.as="script"),v.crossOrigin="",v.href=p,u&&v.setAttribute("nonce",u),document.head.appendChild(v),h)return new Promise((b,x)=>{v.addEventListener("load",b),v.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${p}`)))})}))}function i(l){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=l,window.dispatchEvent(u),!u.defaultPrevented)throw l}return s.then(l=>{for(const u of l||[])u.status==="rejected"&&i(u.reason);return e().catch(i)})},CC={servers:{},selectedServer:"none",selectedMultipleServers:[],isMultiSelectMode:!1},Ep=(t,e,n={})=>({...t,connectionStatus:e,...n});function Gke(t,e){switch(e.type){case"HYDRATE_STATE":return e.payload;case"UPSERT_SERVER":return{...t,servers:{...t.servers,[e.name]:e.server}};case"CONNECT_REQUEST":{const n=t.servers[e.name],r=n?Ep(n,"connecting",{enabled:!0}):{name:e.name,config:e.config,lastConnectionTime:new Date,connectionStatus:"connecting",retryCount:0,enabled:!0};return{...t,servers:{...t.servers,[e.name]:{...r,config:e.config}},selectedServer:e.select?e.name:t.selectedServer}}case"CONNECT_SUCCESS":{const n=t.servers[e.name];return n?{...t,servers:{...t.servers,[e.name]:Ep(n,"connected",{config:e.config,lastConnectionTime:new Date,retryCount:0,lastError:void 0,oauthTokens:e.tokens??n.oauthTokens,enabled:!0})}}:t}case"CONNECT_FAILURE":{const n=t.servers[e.name];return n?{...t,servers:{...t.servers,[e.name]:Ep(n,"failed",{retryCount:n.retryCount,lastError:e.error})}}:t}case"RECONNECT_REQUEST":{const n=t.servers[e.name];return n?{...t,servers:{...t.servers,[e.name]:Ep(n,"connecting",{enabled:!0})}}:t}case"DISCONNECT":{const n=t.servers[e.name];if(!n)return t;const r=t.selectedServer===e.name?"none":t.selectedServer;return{...t,servers:{...t.servers,[e.name]:Ep(n,"disconnected",{enabled:!1,lastError:e.error??n.lastError})},selectedServer:r,selectedMultipleServers:t.selectedMultipleServers.filter(s=>s!==e.name)}}case"REMOVE_SERVER":{const{[e.name]:n,...r}=t.servers;return{...t,servers:r,selectedServer:t.selectedServer===e.name?"none":t.selectedServer,selectedMultipleServers:t.selectedMultipleServers.filter(s=>s!==e.name)}}case"SYNC_AGENT_STATUS":{const n=new Map(e.servers.map(s=>[s.id,s.status])),r={};for(const[s,i]of Object.entries(t.servers)){if(i.connectionStatus==="connecting"||i.connectionStatus==="oauth-flow"){r[s]=i;continue}const l=n.get(s);l?r[s]={...i,connectionStatus:l}:r[s]={...i,connectionStatus:"disconnected"}}return{...t,servers:r}}case"SELECT_SERVER":return{...t,selectedServer:e.name};case"SET_MULTI_SELECTED":return{...t,selectedMultipleServers:e.names};case"SET_MULTI_MODE":return{...t,isMultiSelectMode:e.enabled,selectedMultipleServers:e.enabled?[]:t.selectedMultipleServers};default:return t}}const m7="mcp-inspector-state";function Wke(t){const e=t.config;let n=e;if(e&&typeof e.url=="string")try{n={...e,url:new URL(e.url)}}catch{}return{...t,config:n,connectionStatus:t.connectionStatus||"disconnected",retryCount:t.retryCount||0,lastConnectionTime:t.lastConnectionTime?new Date(t.lastConnectionTime):new Date,enabled:t.enabled!==!1}}function Yke(){try{const t=localStorage.getItem(m7);if(!t)return CC;const e=JSON.parse(t);return{servers:Object.fromEntries(Object.entries(e.servers||{}).map(([r,s])=>[r,Wke(s)])),selectedServer:e.selectedServer||"none",selectedMultipleServers:e.selectedMultipleServers||[],isMultiSelectMode:e.isMultiSelectMode||!1}}catch{return CC}}function Kke(t){const e={...t,servers:Object.fromEntries(Object.entries(t.servers).map(([n,r])=>{const s=r.config,i=s&&s.url instanceof URL?{...s,url:s.url.toString()}:s;return[n,{...r,config:i}]}))};localStorage.setItem(m7,JSON.stringify(e))}async function Ey(t,e){return(await fetch("/api/mcp/connect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({serverConfig:t,serverId:e})})).json()}async function Xke(t){return(await fetch(`/api/mcp/servers/${encodeURIComponent(t)}`,{method:"DELETE"})).json()}async function Qke(){return(await fetch("/api/mcp/servers")).json()}async function Jke(t,e){return(await fetch("/api/mcp/servers/reconnect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({serverId:t,serverConfig:e})})).json()}async function Zke(t){if(!t.oauthTokens)return{kind:"ready",serverConfig:t.config,tokens:void 0};const e=await pN(t.name);if(e.success&&e.serverConfig)return{kind:"ready",serverConfig:e.serverConfig,tokens:Ji(t.name)};const n=t.config?.url?.toString?.();if(n){Nm(t.name);const r={serverName:t.name,serverUrl:n,clientId:t.oauthTokens?.client_id,clientSecret:t.oauthTokens?.client_secret},s=await Bb(r);return s.success&&s.serverConfig?{kind:"ready",serverConfig:s.serverConfig,tokens:Ji(t.name)}:s.success&&!s.serverConfig?{kind:"redirect"}:{kind:"error",error:s.error||"OAuth init failed"}}return{kind:"error",error:"OAuth refresh failed and no URL present"}}function z1(t){return t.type==="stdio"?{command:t.command,args:t.args,env:t.env}:{url:new URL(t.url),requestInit:{headers:t.headers||{}}}}function g7(){const t=GN("Connections"),[e,n]=w.useReducer(Gke,CC),[r,s]=w.useState(!0),i=w.useRef(new Map),a=A=>{const M=(i.current.get(A)??0)+1;return i.current.set(A,M),M},l=(A,N)=>(i.current.get(A)??0)!==N;w.useEffect(()=>{try{const A=Yke();n({type:"HYDRATE_STATE",payload:A})}catch(A){t.error("Failed to load saved state",{error:A instanceof Error?A.message:"Unknown error"})}finally{s(!1)}},[t]),w.useEffect(()=>{r||Kke(e)},[e,r]);const u=A=>{if(A.type==="stdio")return!A.command||A.command.trim()===""?"Command is required for STDIO connections":null;if(!A.url||A.url.trim()==="")return"URL is required for HTTP connections";try{new URL(A.url)}catch(N){return`Invalid URL format: ${A.url} ${N}`}return null},d=w.useCallback(()=>{const A=Object.entries(e.servers).filter(([,N])=>N.connectionStatus==="connected").map(([N])=>N);n({type:"SET_MULTI_SELECTED",names:A})},[e.servers]),p=w.useCallback(async A=>{window.history.replaceState({},document.title,window.location.pathname);try{const N=await KB(A);if(N.success&&N.serverConfig&&N.serverName){const M=N.serverName;n({type:"CONNECT_REQUEST",name:M,config:N.serverConfig,select:!0});try{const I=await Ey(N.serverConfig,M);I.success?(n({type:"CONNECT_SUCCESS",name:M,config:N.serverConfig,tokens:Ji(M)}),t.info("OAuth connection successful",{serverName:M}),It.success(`OAuth connection successful! Connected to ${M}.`)):(n({type:"CONNECT_FAILURE",name:M,error:I.error||"Connection test failed after OAuth"}),t.error("OAuth connection test failed",{serverName:M,error:I.error}),It.error(`OAuth succeeded but connection test failed: ${I.error}`))}catch(I){const O=I instanceof Error?I.message:"Unknown connection error";n({type:"CONNECT_FAILURE",name:M,error:O}),t.error("OAuth connection test error",{serverName:M,error:O}),It.error(`OAuth succeeded but connection test failed: ${O}`)}}else throw new Error(N.error||"OAuth callback failed")}catch(N){const M=N instanceof Error?N.message:"Unknown error";It.error(`Error completing OAuth flow: ${M}`),t.error("OAuth callback failed",{error:M})}},[t]);w.useEffect(()=>{if(!r){const A=new URLSearchParams(window.location.search),N=A.get("code"),M=A.get("error");N?p(N):M&&(It.error(`OAuth authorization failed: ${M}`),localStorage.removeItem("mcp-oauth-pending"),window.history.replaceState({},document.title,window.location.pathname))}},[r,p]);const h=w.useCallback(async A=>{const N=u(A);if(N){It.error(N);return}const M=z1(A);n({type:"CONNECT_REQUEST",name:A.name,config:M,select:!0});const I=a(A.name);try{if(A.type==="http"&&A.useOAuth&&A.url){n({type:"UPSERT_SERVER",name:A.name,server:{name:A.name,config:M,lastConnectionTime:new Date,connectionStatus:"oauth-flow",retryCount:0,enabled:!0}});const{initiateOAuth:L}=await Hke(async()=>{const{initiateOAuth:W}=await Promise.resolve().then(()=>mle);return{initiateOAuth:W}},void 0),z={serverName:A.name,serverUrl:A.url,clientId:A.clientId,clientSecret:A.clientSecret};A.oauthScopes&&A.oauthScopes.length>0&&(z.scopes=A.oauthScopes);const G=await L(z);if(G.success){if(G.serverConfig){const W=await Ey(G.serverConfig,A.name);if(l(A.name,I))return;W.success?(n({type:"CONNECT_SUCCESS",name:A.name,config:G.serverConfig,tokens:Ji(A.name)}),It.success("Connected successfully with OAuth!")):(n({type:"CONNECT_FAILURE",name:A.name,error:W.error||"OAuth connection test failed"}),It.error(`OAuth succeeded but connection failed: ${W.error}`))}else It.success("OAuth flow initiated. You will be redirected to authorize access.");return}else{if(l(A.name,I))return;n({type:"CONNECT_FAILURE",name:A.name,error:G.error||"OAuth initialization failed"}),It.error(`OAuth initialization failed: ${G.error}`);return}}const O=await Ey(M,A.name);if(l(A.name,I))return;O.success?(n({type:"CONNECT_SUCCESS",name:A.name,config:M}),t.info("Connection successful",{serverName:A.name}),It.success("Connected successfully!")):(n({type:"CONNECT_FAILURE",name:A.name,error:O.error||"Connection test failed"}),t.error("Connection failed",{serverName:A.name,error:O.error}),It.error(`Failed to connect to ${A.name}`))}catch(O){const L=O instanceof Error?O.message:"Unknown error";if(l(A.name,I))return;n({type:"CONNECT_FAILURE",name:A.name,error:L}),t.error("Connection failed",{serverName:A.name,error:L}),It.error(`Network error: ${L}`)}},[e.servers,t]),g=w.useRef(!1);w.useEffect(()=>{!r&&!g.current&&(g.current=!0,fetch("/api/mcp-cli-config").then(A=>A.json()).then(A=>{const N=A.config;if(N){if(N.servers&&Array.isArray(N.servers)){const M=N.autoConnectServer;t.info("Processing CLI-provided MCP servers (from config file)",{serverCount:N.servers.length,autoConnectServer:M||"all",cliConfig:N}),N.servers.forEach(I=>{const O={name:I.name||"CLI Server",type:I.type==="sse"?"http":I.type||"stdio",command:I.command,args:I.args||[],url:I.url,env:I.env||{}},L=z1(O);n({type:"UPSERT_SERVER",name:O.name,server:{name:O.name,config:L,lastConnectionTime:new Date,connectionStatus:"disconnected",retryCount:0,enabled:!1}}),!M||I.name===M?(t.info("Auto-connecting to server",{serverName:I.name}),h(O)):t.info("Skipping auto-connect for server",{serverName:I.name,reason:"filtered out"})});return}if(N.command){t.info("Auto-connecting to CLI-provided MCP server",{cliConfig:N});const M={name:N.name||"CLI Server",type:"stdio",command:N.command,args:N.args||[],env:N.env||{}};h(M)}}}).catch(A=>{t.debug("Could not fetch CLI config from API",{error:A})}))},[r,h,t,e.servers]);const v=w.useCallback(async A=>{const N=e.servers[A];return N?.oauthTokens&&N.oauthTokens.access_token||null},[e.servers]),b=w.useCallback(async A=>{t.info("Disconnecting from server",{serverName:A}),n({type:"DISCONNECT",name:A});try{const N=await Xke(A);N.success||n({type:"DISCONNECT",name:A,error:N.error})}catch(N){n({type:"DISCONNECT",name:A,error:N instanceof Error?N.message:"Unknown error"})}},[]),x=w.useCallback(async A=>{t.info("Removing server",{serverName:A}),Nm(A),n({type:"REMOVE_SERVER",name:A})},[]),E=w.useCallback(async A=>{t.info("Reconnecting to server",{serverName:A});const N=e.servers[A];if(!N)throw new Error(`Server ${A} not found`);n({type:"RECONNECT_REQUEST",name:A});const M=a(A);try{const I=await Zke(N);if(I.kind==="redirect")return;if(I.kind==="error"){if(l(A,M))return;n({type:"CONNECT_FAILURE",name:A,error:I.error}),It.error(`Failed to connect: ${A}`);return}const O=await Jke(A,I.serverConfig);if(l(A,M))return;if(O.success)return n({type:"CONNECT_SUCCESS",name:A,config:I.serverConfig,tokens:I.tokens}),t.info("Reconnection successful",{serverName:A,result:O}),{success:!0};{n({type:"CONNECT_FAILURE",name:A,error:O.error||"Reconnection failed"}),t.error("Reconnection failed",{serverName:A,result:O});const L=O.error||`Failed to reconnect: ${A}`;It.error(L)}}catch(I){const O=I instanceof Error?I.message:"Unknown error";if(l(A,M))return;throw n({type:"CONNECT_FAILURE",name:A,error:O}),t.error("Reconnection failed",{serverName:A,error:O}),I}},[e.servers]);w.useEffect(()=>{if(r)return;(async()=>{try{const N=await Qke();N?.success&&N.servers&&n({type:"SYNC_AGENT_STATUS",servers:N.servers})}catch(N){t.debug("Failed to sync server status on startup",{error:N instanceof Error?N.message:"Unknown error"})}})()},[r,t]);const S=w.useCallback(A=>{n({type:"SELECT_SERVER",name:A})},[]),k=w.useCallback(A=>{n({type:"SET_MULTI_SELECTED",names:A})},[]),T=w.useCallback(A=>{n({type:"SET_MULTI_MODE",enabled:A})},[]),R=w.useCallback(A=>{const N=e.selectedMultipleServers,M=N.includes(A)?N.filter(I=>I!==A):[...N,A];n({type:"SET_MULTI_SELECTED",names:M})},[e.selectedMultipleServers]),j=w.useCallback(async(A,N)=>{const M=e.servers[A];if(M?.oauthTokens!=null&&N.useOAuth&&N.name===A&&N.type==="http"&&N.url===(M?.config).url?.toString()&&M){const L=z1(N);n({type:"CONNECT_REQUEST",name:A,config:L});try{if((await Ey(M.config,A)).success){n({type:"CONNECT_SUCCESS",name:A,config:L}),It.success("Server configuration updated successfully!");return}else console.warn("OAuth connection test failed, falling back to full reconnect")}catch(z){console.warn("OAuth connection test error, falling back to full reconnect",z)}}await b(A),await h(N),e.selectedServer===A&&N.name!==A&&S(N.name)},[e.servers,e.selectedServer,b,h]);return{appState:e,isLoading:r,connectedServerConfigs:e.servers,selectedServerEntry:e.servers[e.selectedServer],selectedMCPConfig:e.servers[e.selectedServer]?.config,selectedMCPConfigs:e.selectedMultipleServers.map(A=>e.servers[A]).filter(Boolean),selectedMCPConfigsMap:e.selectedMultipleServers.reduce((A,N)=>(e.servers[N]&&(A[N]=e.servers[N].config),A),{}),isMultiSelectMode:e.isMultiSelectMode,handleConnect:h,handleDisconnect:b,handleReconnect:E,handleUpdate:j,handleRemoveServer:x,setSelectedServer:S,setSelectedMCPConfigs:k,toggleMultiSelectMode:T,toggleServerSelection:R,getValidAccessToken:v,setSelectedMultipleServersToAllServers:d}}function eTe({server:t,selected:e,onToggle:n}){const[r,s]=w.useState(null),[i,a]=w.useState(!1),{label:l,Icon:u,iconClassName:d,indicatorColor:p}=bB(t.connectionStatus),h=_B(t.config),g=xB(t.config),v=JSON.stringify(t.config,null,2),b=()=>{n(t.name)},x=k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),b())},E=async(k,T,R)=>{k.stopPropagation();try{await navigator.clipboard.writeText(T),s(R),setTimeout(()=>s(null),2e3)}catch(j){console.error("Failed to copy text:",j)}},S=t.connectionStatus==="failed"?`${l} (${t.retryCount} retries)`:l;return f.jsxs(Fa,{role:"button",tabIndex:0,onClick:b,onKeyDown:x,className:Me("relative gap-3 p-3 border border-border/40 bg-card/40 transition-colors","hover:border-border cursor-pointer",e&&"border-primary/60 ring-2 ring-primary/30"),children:[f.jsxs("div",{className:"flex items-start justify-between gap-2",children:[f.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[f.jsx("span",{"aria-hidden":!0,className:"h-2 w-2 flex-shrink-0 rounded-full",style:{backgroundColor:p}}),f.jsx("div",{className:"min-w-0",children:f.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[f.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:t.name}),f.jsxs("div",{className:"flex items-center gap-1 text-[11px] text-muted-foreground",children:[f.jsx(u,{className:d}),f.jsx("span",{children:S})]})]})})]}),e&&f.jsxs(vr,{variant:"secondary",className:"h-5 px-1 text-[11px]",children:[f.jsx(Ti,{className:"mr-1 h-3 w-3"}),"Selected"]})]}),f.jsx("p",{className:"mt-0.5 text-[11px] uppercase tracking-wide text-muted-foreground",children:h}),f.jsxs("div",{className:"relative break-all rounded border border-border/30 bg-muted/30 p-1.5 font-mono text-[11px] text-muted-foreground",children:[f.jsx("div",{className:"pr-6",children:g}),f.jsx("button",{type:"button",onClick:k=>E(k,g,"command"),className:"absolute right-1 top-1 cursor-pointer p-1 text-muted-foreground/60 transition-colors hover:text-foreground",children:r==="command"?f.jsx(Ti,{className:"h-3 w-3 text-green-500"}):f.jsx(Po,{className:"h-3 w-3"})})]}),i&&f.jsxs("div",{className:"relative rounded border border-border/20 bg-muted/20 p-1.5 font-mono text-[11px] text-muted-foreground",children:[f.jsx("pre",{className:"max-h-40 overflow-auto pr-6 whitespace-pre-wrap",children:v}),f.jsx("button",{type:"button",onClick:k=>E(k,v,"config"),className:"absolute right-1 top-1 cursor-pointer p-1 text-muted-foreground/60 transition-colors hover:text-foreground",children:r==="config"?f.jsx(Ti,{className:"h-3 w-3 text-green-500"}):f.jsx(Po,{className:"h-3 w-3"})})]}),f.jsx("div",{className:"flex justify-end pt-0.5",children:f.jsx("button",{type:"button",onClick:k=>{k.stopPropagation(),a(T=>!T)},"aria-label":i?"Hide config":"Show config",className:"rounded-full border border-border/50 bg-background/70 p-1 text-muted-foreground transition-colors hover:text-foreground",children:i?f.jsx(pB,{className:"h-3 w-3"}):f.jsx(Au,{className:"h-3 w-3"})})})]})}const G4="mcp-inspector-eval-runner-preferences",wl=[{key:"servers",title:"Select Servers",description:"Choose the MCP servers to evaluate."},{key:"model",title:"Choose Model",description:"Pick the model and ensure credentials are ready."},{key:"tests",title:"Define Tests",description:"Author the scenarios you want to run or generate them with AI."},{key:"review",title:"Review & Run",description:"Confirm the configuration before launching the run."}],F1=(t,e)=>({title:"",query:"",runs:1,model:e?.id??"",provider:e?.provider??"",expectedToolCalls:[]});function tTe({availableModels:t,inline:e=!1}){const[n,r]=w.useState(!1),[s,i]=w.useState(!1),[a,l]=w.useState(!1),[u,d]=w.useState(0),[p,h]=w.useState(null),{isAuthenticated:g}=Xa(),{getAccessToken:v}=da(),{appState:b}=g7(),{getToken:x,hasToken:E}=rR(),[S,k]=w.useState([]),[T,R]=w.useState(null),[j,A]=w.useState([F1(1,null)]),N=w.useMemo(()=>Object.entries(b.servers).filter(([,B])=>B.connectionStatus==="connected"),[b.servers]),M=w.useMemo(()=>new Set(N.map(([B])=>B)),[N]);w.useEffect(()=>{if(!(typeof window>"u"))try{const B=localStorage.getItem(G4);if(!B)return;const J=JSON.parse(B);h({servers:J.servers??[],modelId:J.modelId??null})}catch(B){console.warn("Failed to load eval runner preferences",B)}},[]),w.useEffect(()=>{if(p&&p.servers?.length){const B=p.servers.filter(J=>M.has(J));B.length&&k(B)}},[p,M]),w.useEffect(()=>{if(t.length===0){R(null);return}if(p?.modelId){const B=t.find(J=>J.id===p.modelId);if(B){R(B);return}}R(B=>B&&t.some(oe=>oe.id===B.id)?B:t[0])},[t,p]),w.useEffect(()=>{if(!(typeof window>"u"))try{const B={servers:S,modelId:T?.id??null};localStorage.setItem(G4,JSON.stringify(B))}catch(B){console.warn("Failed to persist eval runner preferences",B)}},[S,T]),w.useEffect(()=>{A(B=>T?B.map((J,oe)=>J.model===T.id&&J.provider===T.provider?J:{...J,model:T.id,provider:T.provider}):B)},[T]),w.useEffect(()=>{!e&&!n&&d(0)},[e,n]);const I=T?ea(T.id):!1,O=T?.provider,L=O?E(O):!1,z=w.useMemo(()=>j.filter(B=>B.query.trim().length>0),[j]),G=w.useMemo(()=>({servers:S.length>0,model:!!T&&(I||O&&L),tests:z.length>0}),[z.length,T,I,O,L,S.length]),W=w.useMemo(()=>G.servers?G.model?G.tests?3:2:1:0,[G]),X=w.useMemo(()=>{switch(u){case 0:return G.servers;case 1:return G.model;case 2:return G.tests;case 3:return G.tests&&G.servers&&G.model;default:return!1}},[u,G]),F=B=>{k(J=>J.includes(B)?J.filter(oe=>oe!==B):[...J,B])},Y=B=>{A(J=>{const oe=J.length,fe=Array.from({length:B},(be,Ae)=>F1(oe+Ae+1,T));return[...J,...fe]})},H=()=>{Y(1)},te=B=>{A(J=>J.filter((oe,fe)=>fe!==B))},P=(B,J,oe)=>{A(fe=>{const be=[...fe];return be[B]={...be[B],[J]:oe},be})},re=async()=>{if(!g){It.error("Please sign in to generate tests");return}if(S.length===0){It.error("Please select at least one server");return}l(!0);try{const B=await v(),J=await fetch("/api/mcp/evals/generate-tests",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({serverIds:S,convexAuthToken:B})}),oe=await J.json();if(!J.ok)throw new Error(oe.error||"Failed to generate tests");if(oe.tests&&oe.tests.length>0){const fe=oe.tests.map((be,Ae)=>({title:be.title||`Generated test ${Ae+1}`,query:be.query||"",runs:Number(be.runs)>0?Number(be.runs):1,model:T?.id||"",provider:T?.provider||"",expectedToolCalls:Array.isArray(be.expectedToolCalls)?be.expectedToolCalls:[]}));A(fe),d(2),It.success(`Generated ${fe.length} test case(s).`)}}catch(B){console.error("Failed to generate tests:",B),It.error(B instanceof Error?B.message:"Failed to generate test cases")}finally{l(!1)}},ue=()=>{u>=wl.length-1||X&&d(B=>Math.min(B+1,wl.length-1))},D=()=>{u!==0&&d(B=>Math.max(B-1,0))},Z=async()=>{if(!g){It.error("Please sign in to run evals");return}if(S.length===0){It.error("Please select at least one server"),d(0);return}if(!T){It.error("Please select a model"),d(1);return}const B=ea(T.id),J=!B&&O?x(O):"";if(!B&&(!O||!J)){It.error(`Please configure your ${T.provider} API key in Settings`),d(1);return}if(z.length===0){It.error("Please add at least one test case with a query"),d(2);return}i(!0);try{const oe=await v(),fe=z.map(Oe=>({...Oe,model:T.id,provider:T.provider})),be=await fetch("/api/mcp/evals/run",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tests:fe,serverIds:S,llmConfig:{provider:T.provider,apiKey:B?"router":J||"router"},convexAuthToken:oe})}),Ae=await be.json();if(!be.ok)throw new Error(Ae.error||"Failed to start evals");It.success(Ae.message||"Evals started successfully!"),A([F1(1,T)]),d(3),e||r(!1),window.location.hash="eval-results"}catch(oe){It.error(oe instanceof Error?oe.message:"Failed to start evals")}finally{i(!1)}},he=()=>{switch(wl[u].key){case"servers":return f.jsxs("div",{className:"space-y-4",children:[f.jsx("div",{className:"flex items-center justify-between",children:f.jsxs("div",{children:[f.jsx("h3",{className:"text-lg pb-2",children:"Select servers to test"}),f.jsx("p",{className:"text-sm text-muted-foreground pb-2",children:"Choose at least one connected MCP server. You can evaluate multiple servers in the same run."})]})}),N.length>0?f.jsx("div",{className:"grid grid-cols-1 gap-3 lg:grid-cols-2 xl:grid-cols-3",children:N.map(([B,J])=>{const oe=S.includes(B);return f.jsx(eTe,{server:J,selected:oe,onToggle:F},B)})}):f.jsxs("div",{className:"rounded-lg border border-dashed p-6 text-sm text-muted-foreground",children:[f.jsx("p",{className:"font-medium text-foreground",children:"No connected servers yet"}),f.jsx("p",{className:"mt-2",children:"Launch a server from the Servers tab to make it available here. Once connected, it will appear instantly."})]})]});case"model":return f.jsxs("div",{className:"space-y-4",children:[f.jsx("div",{className:"flex items-center justify-between",children:f.jsxs("div",{children:[f.jsx("h3",{className:"text-lg pb-2",children:"Choose your evaluation model"}),f.jsx("p",{className:"text-sm text-muted-foreground",children:"For example, if you want to simulate using your server with Claude Desktop, select an Anthropic model."})]})}),t.length===0?f.jsxs("div",{className:"rounded-lg border border-dashed p-6 text-sm text-muted-foreground",children:[f.jsx("p",{className:"font-medium text-foreground",children:"No models available"}),f.jsx("p",{className:"mt-2",children:"Connect a provider or enable MCPJam provided models in Settings to unlock model selection."})]}):T?f.jsxs("div",{className:"space-y-3",children:[f.jsx("div",{className:"flex items-center gap-3",children:f.jsx(h7,{currentModel:T,availableModels:t,onModelChange:R})}),!I&&!L&&O&&f.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-destructive/50 bg-destructive/5 p-3 text-sm",children:[f.jsx(Tm,{className:"mt-0.5 h-4 w-4 text-destructive"}),f.jsxs("div",{children:[f.jsxs("p",{className:"font-medium text-destructive",children:["Add your ",T.provider," API key"]}),f.jsx("p",{className:"text-muted-foreground",children:"Configure credentials in Settings to run this model. Keys are stored locally and never sent to our servers."})]})]})]}):null]});case"tests":return f.jsxs("div",{className:"space-y-6",children:[f.jsx("div",{className:"flex items-center justify-between",children:f.jsxs("div",{children:[f.jsx("h3",{className:"text-lg pb-2",children:"Define your test cases"}),f.jsx("p",{className:"text-sm text-muted-foreground",children:"Create testing scenarios that simulate how real users would use your server."})]})}),!G.servers||!G.model?f.jsxs("div",{className:"rounded-lg border border-dashed p-6 text-sm text-muted-foreground",children:[f.jsx("p",{className:"font-medium text-foreground",children:"Finish previous steps first"}),f.jsx("p",{className:"mt-2",children:"Select at least one server and choose a model to unlock test authoring. That ensures generated tests know which stack to target."})]}):f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"flex flex-wrap items-center justify-between gap-2",children:f.jsx("div",{className:"flex items-center gap-2",children:f.jsxs(Ie,{type:"button",variant:"outline",size:"lg",onClick:re,disabled:a,children:[f.jsx("span",{className:"bg-gradient-to-r from-purple-600 via-violet-600 to-indigo-600 bg-clip-text text-transparent",children:a?"Generating...":"Generate tests"}),f.jsx(yB,{className:"h-4 w-4 ml-2 fill-purple-600"})]})})}),a&&f.jsx("div",{className:"flex items-center justify-center rounded-lg border p-6",children:f.jsx("div",{className:"text-center text-sm text-muted-foreground",children:"Generating test cases..."})}),!a&&f.jsxs("div",{className:"space-y-12",children:[j.map((B,J)=>f.jsxs("div",{className:"space-y-3 rounded-lg border bg-background p-4",children:[f.jsxs("div",{className:"flex items-start justify-between gap-3",children:[f.jsxs("div",{className:"flex flex-col flex-1 space-y-2",children:[f.jsx(Hc,{className:"text-xs uppercase text-muted-foreground",children:"Title"}),f.jsx(Un,{className:"w-full",value:B.title,onChange:oe=>P(J,"title",oe.target.value),placeholder:"(Paypal) List transactions"})]}),j.length>1&&f.jsx(Ie,{type:"button",variant:"ghost",size:"sm",onClick:()=>te(J),children:f.jsx(Nu,{className:"h-4 w-4"})})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(Hc,{className:"text-xs uppercase text-muted-foreground",children:"Query"}),f.jsx(Ho,{value:B.query,onChange:oe=>P(J,"query",oe.target.value),placeholder:"Can you find the most recent Paypal transactions, then create an invoice?",rows:3})]}),f.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx(Hc,{className:"text-xs uppercase text-muted-foreground",children:"Runs"}),f.jsx(Un,{type:"number",min:1,value:B.runs,onChange:oe=>P(J,"runs",Number(oe.target.value)>0?Number(oe.target.value):1)})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(Hc,{className:"text-xs uppercase text-muted-foreground",children:"Expected tools (comma separated)"}),f.jsx(Un,{value:B.expectedToolCalls.join(", "),onChange:oe=>P(J,"expectedToolCalls",oe.target.value.split(",").map(fe=>fe.trim()).filter(Boolean)),placeholder:"paypal_list_transactions, paypal_create_invoice"})]})]})]},J)),f.jsxs(Ie,{type:"button",variant:"outline",onClick:H,"aria-label":"Add test",className:"w-full",children:[f.jsx(Ab,{className:"h-4 w-4 mr-2"}),"Add test case"]})]})]})]});case"review":return f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx("h3",{className:"text-lg",children:"Review your tests"}),f.jsx("p",{className:"text-sm text-muted-foreground",children:"After confirming the run, you will see your run begin in the eval results tab."})]}),f.jsxs("div",{className:"space-y-4 rounded-lg border bg-background p-4",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{children:[f.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Servers"}),f.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:S.map(B=>f.jsx(vr,{variant:"outline",children:B},B))})]}),f.jsx(Ie,{type:"button",variant:"ghost",size:"sm",onClick:()=>d(0),children:"Edit"})]}),f.jsx(Ck,{}),f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{children:[f.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Model"}),T?f.jsx("div",{className:"mt-2 flex items-center gap-2",children:f.jsx(vr,{variant:"outline",children:T.name})}):f.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"No model selected"})]}),f.jsx(Ie,{type:"button",variant:"ghost",size:"sm",onClick:()=>d(1),children:"Edit"})]}),f.jsx(Ck,{}),f.jsxs("div",{className:"flex items-start justify-between gap-6",children:[f.jsxs("div",{className:"flex-1",children:[f.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Tests"}),f.jsx("div",{className:"mt-3 space-y-3",children:z.map((B,J)=>f.jsxs("div",{className:"rounded-md border bg-muted/30 p-3",children:[f.jsx("p",{className:"text-sm font-semibold text-foreground",children:B.title}),f.jsx("p",{className:"mt-1 line-clamp-2 text-sm text-muted-foreground",children:B.query}),f.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-3 text-xs text-muted-foreground",children:[f.jsxs("span",{children:[B.runs," run",B.runs===1?"":"s"]}),B.expectedToolCalls.length>0&&f.jsxs("span",{children:["Tools: ",B.expectedToolCalls.join(", ")]})]})]},J))})]}),f.jsx(Ie,{type:"button",variant:"ghost",size:"sm",onClick:()=>d(2),children:"Edit"})]})]})]});default:return null}},V=f.jsx("ol",{className:"flex flex-col items-center gap-4 text-center md:flex-row md:gap-6",children:wl.map((B,J)=>{const oe=u===J,fe=J<u&&J<=W,be=J<=Math.max(W,u);return f.jsx("li",{className:"flex flex-col items-center gap-2",children:f.jsxs("button",{type:"button",onClick:()=>be?d(J):void 0,disabled:!be,className:Me("flex flex-col items-center gap-2 transition",!be&&"cursor-not-allowed opacity-60"),children:[f.jsx("span",{className:Me("flex h-8 w-8 items-center justify-center rounded-full border text-sm font-medium",fe&&"border-primary bg-primary text-primary-foreground",oe&&!fe&&"border-primary bg-primary/10 text-primary",!oe&&!fe&&"border-border text-muted-foreground"),children:J+1}),f.jsx("span",{className:Me("text-xs leading-tight",oe?"text-foreground":"text-muted-foreground"),children:B.title})]})},B.key)})}),U=u<wl.length-1?!X:s||!X,K=U?"secondary":"default",ae=f.jsxs("div",{className:Me("mx-auto flex w-full flex-col gap-8 pb-10 pt-4",e?"max-w-none px-4 sm:px-6 md:px-12 lg:px-32":"max-w-3xl px-4"),children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[f.jsxs(Ie,{type:"button",variant:"outline",onClick:D,disabled:u===0,"aria-label":"Back",className:"justify-center gap-2",children:[f.jsx(Kre,{className:"h-4 w-4"}),"Back"]}),f.jsx("div",{className:"flex flex-1 justify-center",children:f.jsx("div",{className:"max-w-xl",children:V})}),f.jsxs(Ie,{type:"button",variant:K,onClick:()=>{u<wl.length-1?ue():Z()},disabled:U,"aria-label":u===wl.length-1?"Start":"Next",className:Me("justify-center gap-2",!U&&"shadow-sm"),children:[u===wl.length-1?"Start":"Next",f.jsx(Ba,{className:"h-4 w-4"})]})]}),f.jsx("div",{className:"space-y-6",children:he()})]});return e?ae:f.jsxs(aa,{open:n,onOpenChange:r,children:[f.jsx(eN,{asChild:!0,children:f.jsxs(Ie,{children:[f.jsx(Ab,{className:"mr-2 h-4 w-4"}),"New eval run"]})}),f.jsxs(oa,{className:"max-h-[80vh] w-full max-w-4xl overflow-y-auto sm:max-w-4xl",children:[f.jsxs(la,{className:"mx-auto w-full max-w-3xl gap-1 text-left",children:[f.jsx(ca,{children:"Create eval run"}),f.jsx(Jf,{children:"Follow the guided steps to configure your evaluation and run it with confidence."})]}),ae]})]})}function nTe(){const{isAuthenticated:t,isLoading:e}=Xa(),{user:n}=da(),{availableModels:r}=fV({systemPrompt:"",temperature:1,selectedServers:[]});return e?f.jsx("div",{className:"p-6",children:f.jsx("div",{className:"flex h-64 items-center justify-center",children:f.jsxs("div",{className:"text-center",children:[f.jsx("div",{className:"mx-auto h-8 w-8 animate-spin rounded-full border-b-2 border-primary"}),f.jsx("p",{className:"mt-4 text-muted-foreground",children:"Loading..."})]})})}):!t||!n?f.jsx("div",{className:"p-6",children:f.jsx(th,{icon:mB,title:"Sign in to run evals",description:"Create an account or sign in to generate and launch evaluation runs.",className:"h-[calc(100vh-200px)]"})}):f.jsxs("div",{className:"space-y-6 p-6",children:[f.jsx("div",{className:"space-y-2",children:f.jsx("h1",{className:"text-2xl font-semibold",children:"Evaluation runner"})}),f.jsx("div",{className:"w-full",children:f.jsx(tTe,{availableModels:r,inline:!0})})]})}function rTe({config:t,isConfigured:e,onEdit:n,onDelete:r}){const s=t.description?.trim();return f.jsxs(Fa,{className:Me("group h-full gap-4 border bg-card px-6 py-6 transition-all hover:border-primary/40 hover:shadow-md dark:hover:shadow-xl",e?"border-green-200/80 dark:border-green-400/30":"border-border/60"),children:[f.jsxs("div",{className:"flex items-start justify-between gap-6",children:[f.jsxs("div",{className:"flex items-center gap-4",children:[f.jsx("img",{src:t.logo,alt:t.logoAlt,className:"size-6 object-contain"}),f.jsxs("div",{className:"",children:[f.jsxs("h3",{className:"text-md font-semibold text-foreground pb-1",children:[t.name," ",e&&f.jsx("span",{className:"text-md",children:"✔️"})]}),s?f.jsx("p",{className:"line-clamp-2 text-xs leading-relaxed text-muted-foreground",children:s}):null]})]}),e?f.jsxs(p0,{children:[f.jsx(m0,{asChild:!0,children:f.jsx(Ie,{size:"icon",variant:"ghost",className:"size-8 rounded-md border border-transparent hover:bg-muted/50",children:f.jsx(bse,{className:"size-4"})})}),f.jsx(g0,{align:"end",className:"w-44",children:f.jsx(To,{variant:"destructive",onClick:()=>r(t.id),children:"Remove provider"})})]}):null]}),f.jsx("div",{className:"space-y-4",children:f.jsx(Ie,{size:"sm",variant:e?"outline":"secondary",className:"w-full",onClick:()=>n(t.id),children:e?"Manage":"Configure"})})]})}function sTe({baseUrl:t,onEdit:e}){const n=!!t;return f.jsxs(Fa,{className:Me("group h-full gap-4 border bg-card px-6 py-6 transition-all hover:border-primary/40 hover:shadow-md dark:hover:shadow-xl",n?"border-green-200/80 dark:border-green-400/30":"border-border/60"),children:[f.jsx("div",{className:"flex items-start justify-between gap-6",children:f.jsxs("div",{className:"flex items-center gap-4",children:[f.jsx("img",{src:"/ollama_logo.svg",alt:"Ollama",className:"size-6 object-contain"}),f.jsxs("div",{className:"",children:[f.jsxs("h3",{className:"text-md font-semibold text-foreground pb-1",children:["Ollama ",n&&f.jsx("span",{className:"text-md",children:"✔️"})]}),f.jsx("p",{className:"line-clamp-2 text-xs leading-relaxed text-muted-foreground",children:n?"Local models available":"Install and connect Ollama locally"})]})]})}),f.jsx("div",{className:"space-y-4",children:f.jsx(Ie,{size:"sm",variant:n?"outline":"secondary",className:"w-full",onClick:e,children:n?"Manage":"Configure"})})]})}function iTe({providerConfigs:t,hasToken:e,onEditProvider:n,onDeleteProvider:r,ollamaBaseUrl:s,onEditOllama:i}){return f.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-4",children:[t.map(a=>{const l=e(a.id);return f.jsx(rTe,{config:a,isConfigured:l,onEdit:n,onDelete:r},a.id)}),f.jsx(sTe,{baseUrl:s,onEdit:i})]})}function aTe({open:t,onOpenChange:e,provider:n,value:r,onValueChange:s,onSave:i,onCancel:a}){const l=ua();return f.jsx(aa,{open:t,onOpenChange:e,children:f.jsxs(oa,{className:"max-w-md",children:[f.jsx(la,{children:f.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[n&&f.jsx("div",{className:"w-12 h-12 rounded-lg bg-white p-2 border",children:f.jsx("img",{src:n.logo,alt:n.logoAlt,className:"w-full h-full object-contain"})}),f.jsxs("div",{children:[f.jsxs(ca,{className:"text-left",children:["Configure ",n?.name]}),f.jsx(Jf,{className:"text-left",children:n?.description})]})]})}),f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{children:[f.jsx("label",{htmlFor:"api-key",className:"text-sm font-medium",children:"API Key"}),f.jsx(Un,{id:"api-key",type:"password",value:r,onChange:u=>s(u.target.value),placeholder:n?.placeholder,className:"mt-1"})]}),f.jsxs("div",{className:"flex items-center gap-2 p-3 bg-blue-50 dark:bg-blue-950/20 rounded-lg",children:[f.jsx(JA,{className:"w-4 h-4 text-blue-600"}),f.jsxs("span",{className:"text-sm text-blue-600",children:["Need an API key?"," ",f.jsx("button",{onClick:()=>n&&window.open(n.getApiKeyUrl,"_blank"),className:"underline hover:no-underline",children:"Get one here"})]})]})]}),f.jsxs(v0,{children:[f.jsx(Ie,{variant:"outline",onClick:a,children:"Cancel"}),f.jsx(Ie,{onClick:()=>{l.capture("save_api_key",{location:"provider_config_dialog",platform:Ni(),environment:void 0}),i()},disabled:!r.trim(),children:"Save API Key"})]})]})})}function oTe({open:t,onOpenChange:e,value:n,onValueChange:r,onSave:s,onCancel:i}){return f.jsx(aa,{open:t,onOpenChange:e,children:f.jsxs(oa,{className:"max-w-md",children:[f.jsx(la,{children:f.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[f.jsx("div",{className:"w-12 h-12 rounded-lg bg-white p-2 border",children:f.jsx("img",{src:"/ollama_logo.svg",alt:"Ollama",className:"w-full h-full object-contain"})}),f.jsxs("div",{children:[f.jsx(ca,{className:"text-left pb-2",children:"Configure Ollama URL"}),f.jsx(Jf,{className:"text-left",children:"Set the base URL for your Ollama instance"})]})]})}),f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{children:[f.jsx("label",{htmlFor:"ollama-url",className:"text-sm font-medium",children:"Base URL"}),f.jsx(Un,{id:"ollama-url",type:"url",value:n,onChange:a=>r(a.target.value),placeholder:"http://localhost:11434/api",className:"mt-1"})]}),f.jsxs("div",{className:"flex items-center gap-2 p-3 bg-blue-50 dark:bg-blue-950/20 rounded-lg",children:[f.jsx(JA,{className:"w-4 h-4 text-blue-600"}),f.jsxs("span",{className:"text-sm text-blue-600",children:["Need help?"," ",f.jsx("button",{onClick:()=>window.open("https://ollama.ai/download","_blank"),className:"underline hover:no-underline",children:"Download Ollama"})]})]})]}),f.jsxs(v0,{children:[f.jsx(Ie,{variant:"outline",onClick:i,children:"Cancel"}),f.jsx(Ie,{onClick:s,disabled:!n.trim(),children:"Save URL"})]})]})})}function lTe({...t}){return f.jsx(kJ,{"data-slot":"alert-dialog",...t})}function cTe({...t}){return f.jsx(TJ,{"data-slot":"alert-dialog-trigger",...t})}function uTe({...t}){return f.jsx(CJ,{"data-slot":"alert-dialog-portal",...t})}function dTe({className:t,...e}){return f.jsx(AJ,{"data-slot":"alert-dialog-overlay",className:Me("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...e})}function fTe({className:t,...e}){return f.jsxs(uTe,{children:[f.jsx(dTe,{}),f.jsx(NJ,{"data-slot":"alert-dialog-content",className:Me("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...e})]})}function hTe({className:t,...e}){return f.jsx("div",{"data-slot":"alert-dialog-header",className:Me("flex flex-col gap-2 text-center sm:text-left",t),...e})}function pTe({className:t,...e}){return f.jsx("div",{"data-slot":"alert-dialog-footer",className:Me("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...e})}function mTe({className:t,...e}){return f.jsx(MJ,{"data-slot":"alert-dialog-title",className:Me("text-lg font-semibold",t),...e})}function gTe({className:t,...e}){return f.jsx(OJ,{"data-slot":"alert-dialog-description",className:Me("text-muted-foreground text-sm",t),...e})}function vTe({className:t,...e}){return f.jsx(RJ,{className:Me(QA(),t),...e})}function yTe({className:t,...e}){return f.jsx(jJ,{className:Me(QA({variant:"outline"}),t),...e})}function xn(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function Jl(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}const v7=6048e5,bTe=864e5,y7=6e4,b7=36e5,ky=43200,W4=1440;let xTe={};function Rg(){return xTe}function Zm(t,e){const n=Rg(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=xn(t),i=s.getDay(),a=(i<r?7:0)+i-r;return s.setDate(s.getDate()-a),s.setHours(0,0,0,0),s}function Ex(t){return Zm(t,{weekStartsOn:1})}function x7(t){const e=xn(t),n=e.getFullYear(),r=Jl(t,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const s=Ex(r),i=Jl(t,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const a=Ex(i);return e.getTime()>=s.getTime()?n+1:e.getTime()>=a.getTime()?n:n-1}function Y4(t){const e=xn(t);return e.setHours(0,0,0,0),e}function kx(t){const e=xn(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function _Te(t,e){const n=Y4(t),r=Y4(e),s=+n-kx(n),i=+r-kx(r);return Math.round((s-i)/bTe)}function wTe(t){const e=x7(t),n=Jl(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),Ex(n)}function lb(t,e){const n=xn(t),r=xn(e),s=n.getTime()-r.getTime();return s<0?-1:s>0?1:s}function STe(t){return Jl(t,Date.now())}function ETe(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function kTe(t){if(!ETe(t)&&typeof t!="number")return!1;const e=xn(t);return!isNaN(Number(e))}function TTe(t,e){const n=xn(t),r=xn(e),s=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return s*12+i}function CTe(t){return e=>{const r=(t?Math[t]:Math.trunc)(e);return r===0?0:r}}function ATe(t,e){return+xn(t)-+xn(e)}function NTe(t){const e=xn(t);return e.setHours(23,59,59,999),e}function RTe(t){const e=xn(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(23,59,59,999),e}function jTe(t){const e=xn(t);return+NTe(e)==+RTe(e)}function MTe(t,e){const n=xn(t),r=xn(e),s=lb(n,r),i=Math.abs(TTe(n,r));let a;if(i<1)a=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-s*i);let l=lb(n,r)===-s;jTe(xn(t))&&i===1&&lb(t,r)===1&&(l=!1),a=s*(i-Number(l))}return a===0?0:a}function OTe(t,e,n){const r=ATe(t,e)/1e3;return CTe(n?.roundingMethod)(r)}function PTe(t){const e=xn(t),n=Jl(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}const ITe={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},DTe=(t,e,n)=>{let r;const s=ITe[t];return typeof s=="string"?r=s:e===1?r=s.one:r=s.other.replace("{{count}}",e.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function U1(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const LTe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},$Te={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},zTe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},FTe={date:U1({formats:LTe,defaultWidth:"full"}),time:U1({formats:$Te,defaultWidth:"full"}),dateTime:U1({formats:zTe,defaultWidth:"full"})},UTe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},BTe=(t,e,n,r)=>UTe[t];function kp(t){return(e,n)=>{const r=n?.context?String(n.context):"standalone";let s;if(r==="formatting"&&t.formattingValues){const a=t.defaultFormattingWidth||t.defaultWidth,l=n?.width?String(n.width):a;s=t.formattingValues[l]||t.formattingValues[a]}else{const a=t.defaultWidth,l=n?.width?String(n.width):t.defaultWidth;s=t.values[l]||t.values[a]}const i=t.argumentCallback?t.argumentCallback(e):e;return s[i]}}const qTe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},VTe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},HTe={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},GTe={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},WTe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},YTe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},KTe=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},XTe={ordinalNumber:KTe,era:kp({values:qTe,defaultWidth:"wide"}),quarter:kp({values:VTe,defaultWidth:"wide",argumentCallback:t=>t-1}),month:kp({values:HTe,defaultWidth:"wide"}),day:kp({values:GTe,defaultWidth:"wide"}),dayPeriod:kp({values:WTe,defaultWidth:"wide",formattingValues:YTe,defaultFormattingWidth:"wide"})};function Tp(t){return(e,n={})=>{const r=n.width,s=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(s);if(!i)return null;const a=i[0],l=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(l)?JTe(l,h=>h.test(a)):QTe(l,h=>h.test(a));let d;d=t.valueCallback?t.valueCallback(u):u,d=n.valueCallback?n.valueCallback(d):d;const p=e.slice(a.length);return{value:d,rest:p}}}function QTe(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function JTe(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function ZTe(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const s=r[0],i=e.match(t.parsePattern);if(!i)return null;let a=t.valueCallback?t.valueCallback(i[0]):i[0];a=n.valueCallback?n.valueCallback(a):a;const l=e.slice(s.length);return{value:a,rest:l}}}const eCe=/^(\d+)(th|st|nd|rd)?/i,tCe=/\d+/i,nCe={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},rCe={any:[/^b/i,/^(a|c)/i]},sCe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},iCe={any:[/1/i,/2/i,/3/i,/4/i]},aCe={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},oCe={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},lCe={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},cCe={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},uCe={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},dCe={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},fCe={ordinalNumber:ZTe({matchPattern:eCe,parsePattern:tCe,valueCallback:t=>parseInt(t,10)}),era:Tp({matchPatterns:nCe,defaultMatchWidth:"wide",parsePatterns:rCe,defaultParseWidth:"any"}),quarter:Tp({matchPatterns:sCe,defaultMatchWidth:"wide",parsePatterns:iCe,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Tp({matchPatterns:aCe,defaultMatchWidth:"wide",parsePatterns:oCe,defaultParseWidth:"any"}),day:Tp({matchPatterns:lCe,defaultMatchWidth:"wide",parsePatterns:cCe,defaultParseWidth:"any"}),dayPeriod:Tp({matchPatterns:uCe,defaultMatchWidth:"any",parsePatterns:dCe,defaultParseWidth:"any"})},_7={code:"en-US",formatDistance:DTe,formatLong:FTe,formatRelative:BTe,localize:XTe,match:fCe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function hCe(t){const e=xn(t);return _Te(e,PTe(e))+1}function pCe(t){const e=xn(t),n=+Ex(e)-+wTe(e);return Math.round(n/v7)+1}function w7(t,e){const n=xn(t),r=n.getFullYear(),s=Rg(),i=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,a=Jl(t,0);a.setFullYear(r+1,0,i),a.setHours(0,0,0,0);const l=Zm(a,e),u=Jl(t,0);u.setFullYear(r,0,i),u.setHours(0,0,0,0);const d=Zm(u,e);return n.getTime()>=l.getTime()?r+1:n.getTime()>=d.getTime()?r:r-1}function mCe(t,e){const n=Rg(),r=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=w7(t,e),i=Jl(t,0);return i.setFullYear(s,0,r),i.setHours(0,0,0,0),Zm(i,e)}function gCe(t,e){const n=xn(t),r=+Zm(n,e)-+mCe(n,e);return Math.round(r/v7)+1}function dn(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const Sl={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return dn(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):dn(n+1,2)},d(t,e){return dn(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return dn(t.getHours()%12||12,e.length)},H(t,e){return dn(t.getHours(),e.length)},m(t,e){return dn(t.getMinutes(),e.length)},s(t,e){return dn(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),s=Math.trunc(r*Math.pow(10,n-3));return dn(s,e.length)}},Ad={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},K4={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),s=r>0?r:1-r;return n.ordinalNumber(s,{unit:"year"})}return Sl.y(t,e)},Y:function(t,e,n,r){const s=w7(t,r),i=s>0?s:1-s;if(e==="YY"){const a=i%100;return dn(a,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):dn(i,e.length)},R:function(t,e){const n=x7(t);return dn(n,e.length)},u:function(t,e){const n=t.getFullYear();return dn(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return dn(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return dn(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return Sl.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return dn(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const s=gCe(t,r);return e==="wo"?n.ordinalNumber(s,{unit:"week"}):dn(s,e.length)},I:function(t,e,n){const r=pCe(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):dn(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):Sl.d(t,e)},D:function(t,e,n){const r=hCe(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):dn(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const s=t.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return dn(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const s=t.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return dn(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),s=r===0?7:r;switch(e){case"i":return String(s);case"ii":return dn(s,e.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const s=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let s;switch(r===12?s=Ad.noon:r===0?s=Ad.midnight:s=r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let s;switch(r>=17?s=Ad.evening:r>=12?s=Ad.afternoon:r>=4?s=Ad.morning:s=Ad.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Sl.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):Sl.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):dn(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):dn(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):Sl.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):Sl.s(t,e)},S:function(t,e){return Sl.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return Q4(r);case"XXXX":case"XX":return qc(r);case"XXXXX":case"XXX":default:return qc(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return Q4(r);case"xxxx":case"xx":return qc(r);case"xxxxx":case"xxx":default:return qc(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+X4(r,":");case"OOOO":default:return"GMT"+qc(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+X4(r,":");case"zzzz":default:return"GMT"+qc(r,":")}},t:function(t,e,n){const r=Math.trunc(t.getTime()/1e3);return dn(r,e.length)},T:function(t,e,n){const r=t.getTime();return dn(r,e.length)}};function X4(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),s=Math.trunc(r/60),i=r%60;return i===0?n+String(s):n+String(s)+e+dn(i,2)}function Q4(t,e){return t%60===0?(t>0?"-":"+")+dn(Math.abs(t)/60,2):qc(t,e)}function qc(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),s=dn(Math.trunc(r/60),2),i=dn(r%60,2);return n+s+e+i}const J4=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},S7=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},vCe=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return J4(t,e);let i;switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",J4(r,e)).replace("{{time}}",S7(s,e))},yCe={p:S7,P:vCe},bCe=/^D+$/,xCe=/^Y+$/,_Ce=["D","DD","YY","YYYY"];function wCe(t){return bCe.test(t)}function SCe(t){return xCe.test(t)}function ECe(t,e,n){const r=kCe(t,e,n);if(console.warn(r),_Ce.includes(t))throw new RangeError(r)}function kCe(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const TCe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,CCe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ACe=/^'([^]*?)'?$/,NCe=/''/g,RCe=/[a-zA-Z]/;function E7(t,e,n){const r=Rg(),s=r.locale??_7,i=r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=r.weekStartsOn??r.locale?.options?.weekStartsOn??0,l=xn(t);if(!kTe(l))throw new RangeError("Invalid time value");let u=e.match(CCe).map(p=>{const h=p[0];if(h==="p"||h==="P"){const g=yCe[h];return g(p,s.formatLong)}return p}).join("").match(TCe).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const h=p[0];if(h==="'")return{isToken:!1,value:jCe(p)};if(K4[h])return{isToken:!0,value:p};if(h.match(RCe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");return{isToken:!1,value:p}});s.localize.preprocessor&&(u=s.localize.preprocessor(l,u));const d={firstWeekContainsDate:i,weekStartsOn:a,locale:s};return u.map(p=>{if(!p.isToken)return p.value;const h=p.value;(SCe(h)||wCe(h))&&ECe(h,e,String(t));const g=K4[h[0]];return g(l,h,s.localize,d)}).join("")}function jCe(t){const e=t.match(ACe);return e?e[1].replace(NCe,"'"):t}function MCe(t,e,n){const r=Rg(),s=n?.locale??r.locale??_7,i=2520,a=lb(t,e);if(isNaN(a))throw new RangeError("Invalid time value");const l=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:a});let u,d;a>0?(u=xn(e),d=xn(t)):(u=xn(t),d=xn(e));const p=OTe(d,u),h=(kx(d)-kx(u))/1e3,g=Math.round((p-h)/60);let v;if(g<2)return n?.includeSeconds?p<5?s.formatDistance("lessThanXSeconds",5,l):p<10?s.formatDistance("lessThanXSeconds",10,l):p<20?s.formatDistance("lessThanXSeconds",20,l):p<40?s.formatDistance("halfAMinute",0,l):p<60?s.formatDistance("lessThanXMinutes",1,l):s.formatDistance("xMinutes",1,l):g===0?s.formatDistance("lessThanXMinutes",1,l):s.formatDistance("xMinutes",g,l);if(g<45)return s.formatDistance("xMinutes",g,l);if(g<90)return s.formatDistance("aboutXHours",1,l);if(g<W4){const b=Math.round(g/60);return s.formatDistance("aboutXHours",b,l)}else{if(g<i)return s.formatDistance("xDays",1,l);if(g<ky){const b=Math.round(g/W4);return s.formatDistance("xDays",b,l)}else if(g<ky*2)return v=Math.round(g/ky),s.formatDistance("aboutXMonths",v,l)}if(v=MTe(d,u),v<12){const b=Math.round(g/ky);return s.formatDistance("xMonths",b,l)}else{const b=v%12,x=Math.trunc(v/12);return b<3?s.formatDistance("aboutXYears",x,l):b<9?s.formatDistance("overXYears",x,l):s.formatDistance("almostXYears",x+1,l)}}function OCe(t,e){return MCe(t,STe(t),e)}function PCe(t,e){const r=$Ce(t);let s;if(r.date){const u=zCe(r.date,2);s=FCe(u.restDateString,u.year)}if(!s||isNaN(s.getTime()))return new Date(NaN);const i=s.getTime();let a=0,l;if(r.time&&(a=UCe(r.time),isNaN(a)))return new Date(NaN);if(r.timezone){if(l=BCe(r.timezone),isNaN(l))return new Date(NaN)}else{const u=new Date(i+a),d=new Date(0);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return new Date(i+a+l)}const Ty={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ICe=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,DCe=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,LCe=/^([+-])(\d{2})(?::?(\d{2}))?$/;function $Ce(t){const e={},n=t.split(Ty.dateTimeDelimiter);let r;if(n.length>2)return e;if(/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],Ty.timeZoneDelimiter.test(e.date)&&(e.date=t.split(Ty.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length))),r){const s=Ty.timezone.exec(r);s?(e.time=r.replace(s[1],""),e.timezone=s[1]):e.time=r}return e}function zCe(t,e){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=t.match(n);if(!r)return{year:NaN,restDateString:""};const s=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:i===null?s:i*100,restDateString:t.slice((r[1]||r[2]).length)}}function FCe(t,e){if(e===null)return new Date(NaN);const n=t.match(ICe);if(!n)return new Date(NaN);const r=!!n[4],s=Cp(n[1]),i=Cp(n[2])-1,a=Cp(n[3]),l=Cp(n[4]),u=Cp(n[5])-1;if(r)return WCe(e,l,u)?qCe(e,l,u):new Date(NaN);{const d=new Date(0);return!HCe(e,i,a)||!GCe(e,s)?new Date(NaN):(d.setUTCFullYear(e,i,Math.max(s,a)),d)}}function Cp(t){return t?parseInt(t):1}function UCe(t){const e=t.match(DCe);if(!e)return NaN;const n=B1(e[1]),r=B1(e[2]),s=B1(e[3]);return YCe(n,r,s)?n*b7+r*y7+s*1e3:NaN}function B1(t){return t&&parseFloat(t.replace(",","."))||0}function BCe(t){if(t==="Z")return 0;const e=t.match(LCe);if(!e)return 0;const n=e[1]==="+"?-1:1,r=parseInt(e[2]),s=e[3]&&parseInt(e[3])||0;return KCe(r,s)?n*(r*b7+s*y7):NaN}function qCe(t,e,n){const r=new Date(0);r.setUTCFullYear(t,0,4);const s=r.getUTCDay()||7,i=(e-1)*7+n+1-s;return r.setUTCDate(r.getUTCDate()+i),r}const VCe=[31,null,31,30,31,30,31,31,30,31,30,31];function k7(t){return t%400===0||t%4===0&&t%100!==0}function HCe(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(VCe[e]||(k7(t)?29:28))}function GCe(t,e){return e>=1&&e<=(k7(t)?366:365)}function WCe(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function YCe(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function KCe(t,e){return e>=0&&e<=59}function Z4({value:t,isCopied:e,onCopy:n,copyLabel:r,tooltip:s="Copy to clipboard"}){return f.jsxs("div",{className:"relative w-full",children:[f.jsx(Un,{readOnly:!0,value:t,className:"h-12 w-full rounded-lg border border-border/40 bg-background/50 font-mono text-sm tracking-wide text-foreground pr-16 shadow-sm focus-visible:border-primary focus-visible:ring-1 focus-visible:ring-primary/20",style:{fontFamily:'ui-monospace, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace'}}),f.jsxs(Ma,{children:[f.jsx(Oa,{asChild:!0,children:f.jsx(Ie,{type:"button",variant:"ghost",onClick:n,className:"absolute right-3 top-3 h-6 w-6 p-0 rounded-md border-0 bg-transparent text-foreground/60 hover:text-foreground hover:bg-foreground/10 transition-all duration-200",children:e?f.jsx(Ti,{className:"h-4 w-4"}):f.jsx(Po,{className:"h-4 w-4"})})}),f.jsx(Pa,{side:"bottom",children:s})]})]})}function XCe(){const[t,e]=w.useState(null),[n,r]=w.useState(!1),[s,i]=w.useState(!1),[a,l]=w.useState(!1),[u,d]=w.useState(!1),{isAuthenticated:p,isLoading:h}=Xa(),{signIn:g}=da(),v=ua(),b=Sx("apiKeys:list"),x=d7("apiKeys:regenerateAndGet"),E=async()=>{if(t)try{await navigator.clipboard.writeText(t),i(!0),setTimeout(()=>i(!1),2e3)}catch(R){console.error("Clipboard error",R)}},S=async()=>{if(!p)return!1;try{r(!0),i(!1);const R=await x();return e(R.apiKey),d(!0),!0}catch(R){return console.error("Failed to generate key",R),!1}finally{r(!1)}};if(h)return f.jsx("div",{className:"rounded-md border p-3 text-sm text-muted-foreground",children:"Checking authentication…"});if(!p)return f.jsxs("div",{className:"space-y-3 rounded-md border p-4",children:[f.jsx("div",{className:"flex items-center gap-2",children:f.jsx("h3",{className:"text-lg font-semibold",children:"MCPJam API Key"})}),f.jsx("p",{className:"text-sm text-muted-foreground",children:"Sign in to view and manage your API key."}),f.jsx(Ie,{type:"button",onClick:()=>{v.capture("sign_in",{location:"account_api_key_section",platform:Ni(),environment:void 0}),g()},size:"sm",children:"Sign in"})]});const k=b&&b.length>0?b[0]:null,T=(R,j="Never")=>{if(!R)return j;const A=new Date(R),N=OCe(A,{addSuffix:!0});return`${E7(A,"PP p")} · ${N}`};return f.jsxs("div",{className:"space-y-4",children:[f.jsx("div",{className:"flex items-center gap-2",children:f.jsx("h3",{className:"text-lg font-semibold",children:"MCPJam API Key"})}),b===void 0?f.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading API key status…"}):t?f.jsxs("div",{className:"space-y-4",children:[f.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:"Copy and save this key now. You won't be able to view it again later."}),f.jsx(Z4,{value:t,isCopied:s,onCopy:E,copyLabel:"Copy key"})]}):(b?.length??0)===0?f.jsx("div",{className:"space-y-4",children:f.jsx(Ie,{type:"button",onClick:()=>{S()},disabled:n,children:n?"Generating…":"Generate API key"})}):f.jsxs("div",{className:"space-y-4",children:[f.jsx("div",{className:"flex items-center justify-between",children:f.jsxs(lTe,{open:a,onOpenChange:l,children:[f.jsx(cTe,{asChild:!0,children:f.jsxs(Ie,{type:"button",variant:"outline",disabled:n,className:"inline-flex items-center gap-2.5 rounded-lg border border-border/50 bg-background px-4 py-2.5 text-sm font-medium text-foreground/80 hover:border-border hover:bg-background/80 hover:text-foreground transition-all duration-200",children:[f.jsx(ir,{className:`h-4 w-4 ${n?"animate-spin":""} text-foreground/60`}),f.jsx("span",{children:n?"Regenerating…":"Regenerate"})]})}),f.jsxs(fTe,{children:[f.jsxs(hTe,{children:[f.jsx(mTe,{className:"text-lg font-semibold",children:"Confirm"}),f.jsx(gTe,{className:"text-sm text-muted-foreground leading-relaxed",children:"Regenerating an API key will replace your previous API key."})]}),f.jsxs(pTe,{className:"gap-3",children:[f.jsx(yTe,{disabled:n,className:"font-medium",children:"Cancel"}),f.jsx(vTe,{onClick:async R=>{R.preventDefault(),await S()&&l(!1)},disabled:n,className:"font-medium",children:n?"Regenerating…":"Regenerate"})]})]})]})}),k?f.jsx("div",{className:"rounded-lg border border-border/30 bg-background/50 p-4",children:f.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[f.jsxs("div",{className:"flex flex-col gap-0.5",children:[f.jsx("span",{className:"text-xs font-medium text-foreground/50 uppercase tracking-wide",children:"Created"}),f.jsx("span",{className:"text-xs text-foreground/70",children:T(k.createdAt)})]}),f.jsxs("div",{className:"flex flex-col gap-0.5",children:[f.jsx("span",{className:"text-xs font-medium text-foreground/50 uppercase tracking-wide",children:"Last Used"}),f.jsx("span",{className:"text-xs text-foreground/70",children:T(k.lastUsedAt,"Never used")})]})]})}):null]}),f.jsx(aa,{open:!!t&&u,onOpenChange:R=>{R||i(!1),d(R)},children:f.jsxs(oa,{children:[f.jsxs(la,{children:[f.jsx(ca,{children:"API Key"}),f.jsx(Jf,{children:"Copy and store this key securely. You will not be able to view it again."})]}),f.jsx(Z4,{value:t??"",isCopied:s,onCopy:E,copyLabel:"Copy"})]})})]})}function QCe(){const{tokens:t,setToken:e,clearToken:n,hasToken:r,getOllamaBaseUrl:s,setOllamaBaseUrl:i}=rR(),[a,l]=w.useState(""),[u,d]=w.useState(!1),[p,h]=w.useState(null),[g,v]=w.useState(!1),[b,x]=w.useState(""),E=[{id:"openai",name:"OpenAI",logo:"/openai_logo.png",logoAlt:"OpenAI",description:"GPT-4, GPT-4o, GPT-4o-mini, GPT-4.1, GPT-5, etc.",placeholder:"sk-...",getApiKeyUrl:"https://platform.openai.com/api-keys"},{id:"anthropic",name:"Anthropic",logo:"/claude_logo.png",logoAlt:"Claude",description:"Claude 3.5, Claude 3.7, Claude Opus 4, etc.",placeholder:"sk-ant-...",getApiKeyUrl:"https://console.anthropic.com/"},{id:"deepseek",name:"DeepSeek",logo:"/deepseek_logo.svg",logoAlt:"DeepSeek",description:"DeepSeek Chat, DeepSeek Reasoner, etc.",placeholder:"sk-...",getApiKeyUrl:"https://platform.deepseek.com/api_keys"},{id:"google",name:"Google AI",logo:"/google_logo.png",logoAlt:"Google AI",description:"Gemini 2.5, Gemini 2.5 Flash, Gemini 2.5 Flash Lite",placeholder:"AI...",getApiKeyUrl:"https://aistudio.google.com/app/apikey"}],S=M=>{const I=E.find(O=>O.id===M);I&&(h(I),l(t[M]||""),d(!0))},k=()=>{p&&(e(p.id,a),d(!1),h(null),l(""))},T=()=>{d(!1),h(null),l("")},R=M=>{n(M)},j=()=>{x(s()),v(!0)},A=()=>{i(b),v(!1),x("")},N=()=>{v(!1),x("")};return f.jsxs("div",{className:"container mx-auto p-6 max-w-6xl space-y-8",children:[f.jsx("div",{className:"flex items-center gap-3 mb-6",children:f.jsx("h1",{className:"text-2xl font-bold",children:"Settings"})}),f.jsx(XCe,{}),f.jsxs("div",{className:"space-y-4",children:[f.jsx("div",{children:f.jsx("h3",{className:"text-lg font-semibold",children:"LLM Provider API Keys"})}),f.jsx(iTe,{providerConfigs:E,hasToken:M=>r(M),onEditProvider:S,onDeleteProvider:R,ollamaBaseUrl:s(),onEditOllama:j})]}),f.jsx(aTe,{open:u,onOpenChange:d,provider:p,value:a,onValueChange:l,onSave:k,onCancel:T}),f.jsx(oTe,{open:g,onOpenChange:v,value:b,onValueChange:x,onSave:A,onCancel:N})]})}const JCe=(t,e="HH:mm:ss.SSS")=>{const n=typeof t=="string"?PCe(t):t;return E7(n,e)},ZCe={error:"bg-red-500/10 text-red-700 border-red-200 dark:text-red-400 dark:border-red-800",warn:"bg-yellow-500/10 text-yellow-700 border-yellow-200 dark:text-yellow-400 dark:border-yellow-800",info:"bg-blue-500/10 text-blue-700 border-blue-200 dark:text-blue-400 dark:border-blue-800",debug:"bg-purple-500/10 text-purple-700 border-purple-200 dark:text-purple-400 dark:border-purple-800",trace:"bg-gray-500/10 text-gray-700 border-gray-200 dark:text-gray-400 dark:border-gray-800"};function T7({level:t}){return f.jsx(vr,{variant:"outline",className:Me("font-mono",ZCe[t]),children:t.toUpperCase()})}function eAe({entry:t,isExpanded:e,onToggleExpand:n}){const r=t.data!==void 0||t.error!==void 0;return f.jsxs("div",{className:"border rounded-lg font-mono",children:[f.jsx("div",{className:`p-3 cursor-pointer hover:bg-muted/50 ${r?"":"cursor-default"}`,onClick:r?n:void 0,children:f.jsxs("div",{className:"flex items-start gap-3",children:[r&&f.jsx("div",{className:"mt-0.5",children:e?f.jsx(Au,{className:"h-4 w-4 text-muted-foreground"}):f.jsx(Ba,{className:"h-4 w-4 text-muted-foreground"})}),f.jsx("div",{className:"flex-1 min-w-0",children:f.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[f.jsx("span",{className:"text-muted-foreground font-mono text-xs",children:`[${JCe(t.timestamp)}]`}),f.jsx(T7,{level:t.level}),f.jsx(vr,{variant:"secondary",children:t.context}),f.jsx("span",{className:"flex-1 break-words",children:t.message})]})})]})}),e&&r&&f.jsxs("div",{className:"border-t bg-muted/20 p-3 space-y-3",children:[t.data!==void 0&&f.jsxs("div",{children:[f.jsx("div",{className:"text-xs font-semibold text-muted-foreground mb-1",children:"DATA:"}),f.jsx("div",{className:"text-xs bg-background border rounded overflow-auto max-h-60",children:f.jsx(zl,{src:t.data,dark:!0,theme:"atom",enableClipboard:!0,displaySize:!1,collapseStringsAfterLength:100,style:{fontSize:"12px",fontFamily:"ui-monospace, SFMono-Regular, 'SF Mono', monospace",backgroundColor:"hsl(var(--background))",padding:"0",borderRadius:"0",border:"none"}})})]}),t.error&&f.jsxs("div",{children:[f.jsx("div",{className:"text-xs font-semibold text-muted-foreground mb-1",children:"ERROR:"}),f.jsxs("pre",{className:"text-xs bg-red-50 dark:bg-red-950/20 border border-red-200 dark:border-red-800 rounded p-2 overflow-auto max-h-40 text-red-700 dark:text-red-400",children:[t.error.message,t.error.stack&&`
|
|
1817
|
+
`))}function u(v,b,x,E){const S=x.enter("tableCell"),k=x.enter("phrasing"),T=x.containerPhrasing(v,{...E,before:i,after:i});return k(),S(),T}function d(v,b){return dSe(v,{align:b,alignDelimiters:r,padding:n,stringLength:s})}function p(v,b,x){const E=v.children;let S=-1;const k=[],T=b.enter("table");for(;++S<E.length;)k[S]=h(E[S],b,x);return T(),k}function h(v,b,x){const E=v.children;let S=-1;const k=[],T=b.enter("tableRow");for(;++S<E.length;)k[S]=u(E[S],v,b,x);return T(),k}function g(v,b,x){let E=F8.inlineCode(v,b,x);return x.stack.includes("tableCell")&&(E=E.replace(/\|/g,"\\$&")),E}}function JSe(){return{exit:{taskListCheckValueChecked:b4,taskListCheckValueUnchecked:b4,paragraph:eEe}}}function ZSe(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:tEe}}}function b4(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function eEe(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const s=e.children;let i=-1,a;for(;++i<s.length;){const l=s[i];if(l.type==="paragraph"){a=l;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(t)}function tEe(t,e,n,r){const s=t.children[0],i=typeof t.checked=="boolean"&&s&&s.type==="paragraph",a="["+(t.checked?"x":" ")+"] ",l=n.createTracker(r);i&&l.move(a);let u=F8.listItem(t,e,n,{...r,...l.current()});return i&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),u;function d(p){return p+a}}function nEe(){return[Pwe(),tSe(),iSe(),HSe(),JSe()]}function rEe(t){return{extensions:[Iwe(),nSe(t),aSe(),QSe(t),ZSe()]}}const sEe={tokenize:uEe,partial:!0},U8={tokenize:dEe,partial:!0},B8={tokenize:fEe,partial:!0},q8={tokenize:hEe,partial:!0},iEe={tokenize:pEe,partial:!0},V8={name:"wwwAutolink",tokenize:lEe,previous:G8},H8={name:"protocolAutolink",tokenize:cEe,previous:W8},Wo={name:"emailAutolink",tokenize:oEe,previous:Y8},Ka={};function aEe(){return{text:Ka}}let zc=48;for(;zc<123;)Ka[zc]=Wo,zc++,zc===58?zc=65:zc===91&&(zc=97);Ka[43]=Wo;Ka[45]=Wo;Ka[46]=Wo;Ka[95]=Wo;Ka[72]=[Wo,H8];Ka[104]=[Wo,H8];Ka[87]=[Wo,V8];Ka[119]=[Wo,V8];function oEe(t,e,n){const r=this;let s,i;return a;function a(h){return!wC(h)||!Y8.call(r,r.previous)||tj(r.events)?n(h):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),l(h))}function l(h){return wC(h)?(t.consume(h),l):h===64?(t.consume(h),u):n(h)}function u(h){return h===46?t.check(iEe,p,d)(h):h===45||h===95||rs(h)?(i=!0,t.consume(h),u):p(h)}function d(h){return t.consume(h),s=!0,u}function p(h){return i&&s&&fs(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(h)):n(h)}}function lEe(t,e,n){const r=this;return s;function s(a){return a!==87&&a!==119||!G8.call(r,r.previous)||tj(r.events)?n(a):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(sEe,t.attempt(U8,t.attempt(B8,i),n),n)(a))}function i(a){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(a)}}function cEe(t,e,n){const r=this;let s="",i=!1;return a;function a(h){return(h===72||h===104)&&W8.call(r,r.previous)&&!tj(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),s+=String.fromCodePoint(h),t.consume(h),l):n(h)}function l(h){if(fs(h)&&s.length<5)return s+=String.fromCodePoint(h),t.consume(h),l;if(h===58){const g=s.toLowerCase();if(g==="http"||g==="https")return t.consume(h),u}return n(h)}function u(h){return h===47?(t.consume(h),i?d:(i=!0,u)):n(h)}function d(h){return h===null||gx(h)||_n(h)||Su(h)||U0(h)?n(h):t.attempt(U8,t.attempt(B8,p),n)(h)}function p(h){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(h)}}function uEe(t,e,n){let r=0;return s;function s(a){return(a===87||a===119)&&r<3?(r++,t.consume(a),s):a===46&&r===3?(t.consume(a),i):n(a)}function i(a){return a===null?n(a):e(a)}}function dEe(t,e,n){let r,s,i;return a;function a(d){return d===46||d===95?t.check(q8,u,l)(d):d===null||_n(d)||Su(d)||d!==45&&U0(d)?u(d):(i=!0,t.consume(d),a)}function l(d){return d===95?r=!0:(s=r,r=void 0),t.consume(d),a}function u(d){return s||r||!i?n(d):e(d)}}function fEe(t,e){let n=0,r=0;return s;function s(a){return a===40?(n++,t.consume(a),s):a===41&&r<n?i(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?t.check(q8,e,i)(a):a===null||_n(a)||Su(a)?e(a):(t.consume(a),s)}function i(a){return a===41&&r++,t.consume(a),s}}function hEe(t,e,n){return r;function r(l){return l===33||l===34||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===63||l===95||l===126?(t.consume(l),r):l===38?(t.consume(l),i):l===93?(t.consume(l),s):l===60||l===null||_n(l)||Su(l)?e(l):n(l)}function s(l){return l===null||l===40||l===91||_n(l)||Su(l)?e(l):r(l)}function i(l){return fs(l)?a(l):n(l)}function a(l){return l===59?(t.consume(l),r):fs(l)?(t.consume(l),a):n(l)}}function pEe(t,e,n){return r;function r(i){return t.consume(i),s}function s(i){return rs(i)?n(i):e(i)}}function G8(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||_n(t)}function W8(t){return!fs(t)}function Y8(t){return!(t===47||wC(t))}function wC(t){return t===43||t===45||t===46||t===95||rs(t)}function tj(t){let e=t.length,n=!1;for(;e--;){const r=t[e][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const mEe={tokenize:SEe,partial:!0};function gEe(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:xEe,continuation:{tokenize:_Ee},exit:wEe}},text:{91:{name:"gfmFootnoteCall",tokenize:bEe},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:vEe,resolveTo:yEe}}}}function vEe(t,e,n){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const u=r.events[s][1];if(u.type==="labelImage"){a=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return l;function l(u){if(!a||!a._balanced)return n(u);const d=na(r.sliceSerialize({start:a.end,end:r.now()}));return d.codePointAt(0)!==94||!i.includes(d.slice(1))?n(u):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(u),t.exit("gfmFootnoteCallLabelMarker"),e(u))}}function yEe(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},t[t.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},l=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",s,e],["exit",s,e],["enter",i,e],["enter",a,e],["exit",a,e],["exit",i,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...l),t}function bEe(t,e,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return l;function l(h){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(h),t.exit("gfmFootnoteCallLabelMarker"),u}function u(h){return h!==94?n(h):(t.enter("gfmFootnoteCallMarker"),t.consume(h),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",d)}function d(h){if(i>999||h===93&&!a||h===null||h===91||_n(h))return n(h);if(h===93){t.exit("chunkString");const g=t.exit("gfmFootnoteCallString");return s.includes(na(r.sliceSerialize(g)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(h),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(h)}return _n(h)||(a=!0),i++,t.consume(h),h===92?p:d}function p(h){return h===91||h===92||h===93?(t.consume(h),i++,d):d(h)}}function xEe(t,e,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,l;return u;function u(b){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(b),t.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(b){return b===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(b),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",p):n(b)}function p(b){if(a>999||b===93&&!l||b===null||b===91||_n(b))return n(b);if(b===93){t.exit("chunkString");const x=t.exit("gfmFootnoteDefinitionLabelString");return i=na(r.sliceSerialize(x)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(b),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),g}return _n(b)||(l=!0),a++,t.consume(b),b===92?h:p}function h(b){return b===91||b===92||b===93?(t.consume(b),a++,p):p(b)}function g(b){return b===58?(t.enter("definitionMarker"),t.consume(b),t.exit("definitionMarker"),s.includes(i)||s.push(i),en(t,v,"gfmFootnoteDefinitionWhitespace")):n(b)}function v(b){return e(b)}}function _Ee(t,e,n){return t.check(Ag,e,t.attempt(mEe,e,n))}function wEe(t){t.exit("gfmFootnoteDefinition")}function SEe(t,e,n){const r=this;return en(t,s,"gfmFootnoteDefinitionIndent",5);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?e(i):n(i)}}function EEe(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,l){let u=-1;for(;++u<a.length;)if(a[u][0]==="enter"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._close){let d=u;for(;d--;)if(a[d][0]==="exit"&&a[d][1].type==="strikethroughSequenceTemporary"&&a[d][1]._open&&a[u][1].end.offset-a[u][1].start.offset===a[d][1].end.offset-a[d][1].start.offset){a[u][1].type="strikethroughSequence",a[d][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},a[d][1].start),end:Object.assign({},a[u][1].end)},h={type:"strikethroughText",start:Object.assign({},a[d][1].end),end:Object.assign({},a[u][1].start)},g=[["enter",p,l],["enter",a[d][1],l],["exit",a[d][1],l],["enter",h,l]],v=l.parser.constructs.insideSpan.null;v&&si(g,g.length,0,B0(v,a.slice(d+1,u),l)),si(g,g.length,0,[["exit",h,l],["enter",a[u][1],l],["exit",a[u][1],l],["exit",p,l]]),si(a,d-1,u-d+3,g),u=d+g.length-2;break}}for(u=-1;++u<a.length;)a[u][1].type==="strikethroughSequenceTemporary"&&(a[u][1].type="data");return a}function i(a,l,u){const d=this.previous,p=this.events;let h=0;return g;function g(b){return d===126&&p[p.length-1][1].type!=="characterEscape"?u(b):(a.enter("strikethroughSequenceTemporary"),v(b))}function v(b){const x=jf(d);if(b===126)return h>1?u(b):(a.consume(b),h++,v);if(h<2&&!n)return u(b);const E=a.exit("strikethroughSequenceTemporary"),S=jf(b);return E._open=!S||S===2&&!!x,E._close=!x||x===2&&!!S,l(b)}}}class kEe{constructor(){this.map=[]}add(e,n,r){TEe(this,e,n,r)}consume(e){if(this.map.sort(function(i,a){return i[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];r.push(e.slice()),e.length=0;let s=r.pop();for(;s;){for(const i of s)e.push(i);s=r.pop()}this.map.length=0}}function TEe(t,e,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s<t.map.length;){if(t.map[s][0]===e){t.map[s][1]+=n,t.map[s][2].push(...r);return}s+=1}t.map.push([e,n,r])}}function CEe(t,e){let n=!1;const r=[];for(;e<t.length;){const s=t[e];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const i=r.length-1;r[i]=r[i]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return r}function AEe(){return{flow:{null:{name:"table",tokenize:NEe,resolveAll:REe}}}}function NEe(t,e,n){const r=this;let s=0,i=0,a;return l;function l(O){let L=r.events.length-1;for(;L>-1;){const W=r.events[L][1].type;if(W==="lineEnding"||W==="linePrefix")L--;else break}const z=L>-1?r.events[L][1].type:null,G=z==="tableHead"||z==="tableRow"?A:u;return G===A&&r.parser.lazy[r.now().line]?n(O):G(O)}function u(O){return t.enter("tableHead"),t.enter("tableRow"),d(O)}function d(O){return O===124||(a=!0,i+=1),p(O)}function p(O){return O===null?n(O):ct(O)?i>1?(i=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(O),t.exit("lineEnding"),v):n(O):Gt(O)?en(t,p,"whitespace")(O):(i+=1,a&&(a=!1,s+=1),O===124?(t.enter("tableCellDivider"),t.consume(O),t.exit("tableCellDivider"),a=!0,p):(t.enter("data"),h(O)))}function h(O){return O===null||O===124||_n(O)?(t.exit("data"),p(O)):(t.consume(O),O===92?g:h)}function g(O){return O===92||O===124?(t.consume(O),h):h(O)}function v(O){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(O):(t.enter("tableDelimiterRow"),a=!1,Gt(O)?en(t,b,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):b(O))}function b(O){return O===45||O===58?E(O):O===124?(a=!0,t.enter("tableCellDivider"),t.consume(O),t.exit("tableCellDivider"),x):j(O)}function x(O){return Gt(O)?en(t,E,"whitespace")(O):E(O)}function E(O){return O===58?(i+=1,a=!0,t.enter("tableDelimiterMarker"),t.consume(O),t.exit("tableDelimiterMarker"),S):O===45?(i+=1,S(O)):O===null||ct(O)?R(O):j(O)}function S(O){return O===45?(t.enter("tableDelimiterFiller"),k(O)):j(O)}function k(O){return O===45?(t.consume(O),k):O===58?(a=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(O),t.exit("tableDelimiterMarker"),T):(t.exit("tableDelimiterFiller"),T(O))}function T(O){return Gt(O)?en(t,R,"whitespace")(O):R(O)}function R(O){return O===124?b(O):O===null||ct(O)?!a||s!==i?j(O):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(O)):j(O)}function j(O){return n(O)}function A(O){return t.enter("tableRow"),N(O)}function N(O){return O===124?(t.enter("tableCellDivider"),t.consume(O),t.exit("tableCellDivider"),N):O===null||ct(O)?(t.exit("tableRow"),e(O)):Gt(O)?en(t,N,"whitespace")(O):(t.enter("data"),M(O))}function M(O){return O===null||O===124||_n(O)?(t.exit("data"),N(O)):(t.consume(O),O===92?I:M)}function I(O){return O===92||O===124?(t.consume(O),M):M(O)}}function REe(t,e){let n=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],l=!1,u=0,d,p,h;const g=new kEe;for(;++n<t.length;){const v=t[n],b=v[1];v[0]==="enter"?b.type==="tableHead"?(l=!1,u!==0&&(x4(g,e,u,d,p),p=void 0,u=0),d={type:"table",start:Object.assign({},b.start),end:Object.assign({},b.end)},g.add(n,0,[["enter",d,e]])):b.type==="tableRow"||b.type==="tableDelimiterRow"?(r=!0,h=void 0,i=[0,0,0,0],a=[0,n+1,0,0],l&&(l=!1,p={type:"tableBody",start:Object.assign({},b.start),end:Object.assign({},b.end)},g.add(n,0,[["enter",p,e]])),s=b.type==="tableDelimiterRow"?2:p?3:1):s&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(i[1]!==0&&(a[0]=a[1],h=_y(g,e,i,s,void 0,h),i=[0,0,0,0]),a[2]=n)):b.type==="tableCellDivider"&&(r?r=!1:(i[1]!==0&&(a[0]=a[1],h=_y(g,e,i,s,void 0,h)),i=a,a=[i[1],n,0,0])):b.type==="tableHead"?(l=!0,u=n):b.type==="tableRow"||b.type==="tableDelimiterRow"?(u=n,i[1]!==0?(a[0]=a[1],h=_y(g,e,i,s,n,h)):a[1]!==0&&(h=_y(g,e,a,s,n,h)),s=0):s&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")&&(a[3]=n)}for(u!==0&&x4(g,e,u,d,p),g.consume(e.events),n=-1;++n<e.events.length;){const v=e.events[n];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=CEe(e.events,n))}return t}function _y(t,e,n,r,s,i){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(i.end=Object.assign({},zd(e.events,n[0])),t.add(n[0],0,[["exit",i,e]]));const u=zd(e.events,n[1]);if(i={type:a,start:Object.assign({},u),end:Object.assign({},u)},t.add(n[1],0,[["enter",i,e]]),n[2]!==0){const d=zd(e.events,n[2]),p=zd(e.events,n[3]),h={type:l,start:Object.assign({},d),end:Object.assign({},p)};if(t.add(n[2],0,[["enter",h,e]]),r!==2){const g=e.events[n[2]],v=e.events[n[3]];if(g[1].end=Object.assign({},v[1].end),g[1].type="chunkText",g[1].contentType="text",n[3]>n[2]+1){const b=n[2]+1,x=n[3]-n[2]-1;t.add(b,x,[])}}t.add(n[3]+1,0,[["exit",h,e]])}return s!==void 0&&(i.end=Object.assign({},zd(e.events,s)),t.add(s,0,[["exit",i,e]]),i=void 0),i}function x4(t,e,n,r,s){const i=[],a=zd(e.events,n);s&&(s.end=Object.assign({},a),i.push(["exit",s,e])),r.end=Object.assign({},a),i.push(["exit",r,e]),t.add(n+1,0,i)}function zd(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const jEe={name:"tasklistCheck",tokenize:OEe};function MEe(){return{text:{91:jEe}}}function OEe(t,e,n){const r=this;return s;function s(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(u),t.exit("taskListCheckMarker"),i)}function i(u){return _n(u)?(t.enter("taskListCheckValueUnchecked"),t.consume(u),t.exit("taskListCheckValueUnchecked"),a):u===88||u===120?(t.enter("taskListCheckValueChecked"),t.consume(u),t.exit("taskListCheckValueChecked"),a):n(u)}function a(u){return u===93?(t.enter("taskListCheckMarker"),t.consume(u),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),l):n(u)}function l(u){return ct(u)?e(u):Gt(u)?t.check({tokenize:PEe},e,n)(u):n(u)}}function PEe(t,e,n){return en(t,r,"whitespace");function r(s){return s===null?n(s):e(s)}}function IEe(t){return i8([aEe(),gEe(),EEe(t),AEe(),MEe()])}const DEe={};function LEe(t){const e=this,n=t||DEe,r=e.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(IEe(n)),i.push(nEe()),a.push(rEe(n))}function $Ee({node:t,inline:e,className:n,children:r,...s}){return e?f.jsx("code",{className:`${n} text-sm bg-zinc-100 dark:bg-zinc-800 py-0.5 px-1 rounded-md`,...s,children:r}):f.jsx("div",{className:"not-prose flex flex-col",children:f.jsx("div",{...s,className:"text-sm w-full overflow-x-auto dark:bg-zinc-900 p-4 border border-zinc-200 dark:border-zinc-700 rounded-xl dark:text-zinc-50 text-zinc-900 font-mono whitespace-pre-wrap break-words",children:r})})}const zEe={code:$Ee,pre:({children:t})=>f.jsx(f.Fragment,{children:t}),img:({src:t,alt:e,...n})=>{if(!t)return null;const[r,s]=w.useState(!1),[i,a]=w.useState(!1);return i?f.jsxs("div",{className:"my-4 p-4 bg-muted/50 rounded-lg border border-border/30 text-center text-muted-foreground",children:["Failed to load image: ",e||"Image"]}):f.jsx("div",{className:"my-4 flex justify-center",children:f.jsx("img",{src:t,alt:e||"Image",className:`max-w-full h-auto rounded-lg border border-border/30 shadow-sm cursor-pointer transition-all hover:shadow-md ${r?"max-h-none":"max-h-96"}`,loading:"lazy",onClick:()=>s(!r),onError:()=>a(!0),title:r?"Click to collapse":"Click to expand",...n})})},ol:({children:t,...e})=>f.jsx("ol",{className:"list-decimal list-outside ml-4",...e,children:t}),li:({children:t,...e})=>f.jsx("li",{className:"py-1",...e,children:t}),ul:({children:t,...e})=>f.jsx("ul",{className:"list-decimal list-outside ml-4",...e,children:t}),strong:({children:t,...e})=>f.jsx("span",{className:"font-semibold",...e,children:t}),a:({children:t,...e})=>f.jsx("a",{className:"text-blue-500 hover:underline",target:"_blank",rel:"noreferrer",...e,children:t}),h1:({children:t,...e})=>f.jsx("h1",{className:"text-3xl font-semibold mt-6 mb-2",...e,children:t}),h2:({children:t,...e})=>f.jsx("h2",{className:"text-2xl font-semibold mt-6 mb-2",...e,children:t}),h3:({children:t,...e})=>f.jsx("h3",{className:"text-xl font-semibold mt-6 mb-2",...e,children:t}),h4:({children:t,...e})=>f.jsx("h4",{className:"text-lg font-semibold mt-6 mb-2",...e,children:t}),h5:({children:t,...e})=>f.jsx("h5",{className:"text-base font-semibold mt-6 mb-2",...e,children:t}),h6:({children:t,...e})=>f.jsx("h6",{className:"text-sm font-semibold mt-6 mb-2",...e,children:t})},FEe=[LEe],UEe=({children:t})=>f.jsx(Ewe,{remarkPlugins:FEe,components:zEe,children:t}),_4=UEe;function w4({message:t,onSave:e,onCancel:n}){const[r,s]=w.useState(t.content),i=w.useRef(null);w.useEffect(()=>{i.current&&(i.current.focus(),i.current.select(),a())},[]);const a=()=>{i.current&&(i.current.style.height="auto",i.current.style.height=`${i.current.scrollHeight}px`)},l=()=>{r.trim()!==t.content.trim()?e(r.trim()):n()},u=d=>{d.key==="Enter"&&(d.metaKey||d.ctrlKey)&&(d.preventDefault(),l()),d.key==="Escape"&&(d.preventDefault(),n())};return f.jsxs("div",{className:"w-full space-y-3",children:[f.jsx(Ho,{ref:i,value:r,onChange:d=>{s(d.target.value),a()},onKeyDown:u,className:"min-h-[100px] resize-none",placeholder:"Edit your message..."}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(Ie,{variant:"outline",size:"sm",onClick:n,children:"Cancel"}),f.jsx(Ie,{size:"sm",onClick:l,disabled:!r.trim(),children:"Save"})]})]})}function S4({data:t,className:e}){const[n,r]=w.useState(!1),s=JSON.stringify(t,null,2),i=async()=>{try{await navigator.clipboard.writeText(s),r(!0),setTimeout(()=>r(!1),2e3)}catch(l){console.error("Failed to copy:",l)}},a=l=>l.replace(/"([^"]+)":/g,'<span class="text-blue-600/70 dark:text-blue-400/70">"$1"</span>:').replace(/: "([^"]*)"/g,': <span class="text-foreground">"$1"</span>').replace(/: (true|false)/g,': <span class="text-purple-600/70 dark:text-purple-400/70">$1</span>').replace(/: (null)/g,': <span class="text-muted-foreground/60">$1</span>').replace(/: (-?\d+(?:\.\d+)?)/g,': <span class="text-orange-600/70 dark:text-orange-400/70">$1</span>');return f.jsxs("div",{className:Me("relative group",e),children:[f.jsx("button",{onClick:i,className:"absolute top-2 right-2 p-1.5 rounded-md bg-background/80 backdrop-blur-sm border opacity-0 group-hover:opacity-100 transition-opacity hover:bg-muted",title:"Copy JSON",children:n?f.jsx(Ti,{className:"h-3 w-3 text-green-600/70 dark:text-green-400/70"}):f.jsx(Po,{className:"h-3 w-3"})}),f.jsx("pre",{className:"text-xs font-mono whitespace-pre-wrap overflow-x-auto p-3 bg-muted/20 rounded-md border",children:f.jsx("code",{dangerouslySetInnerHTML:{__html:a(s)}})})]})}function K8({data:t,depth:e=0}){const[n,r]=w.useState(e<2);if(typeof t!="object"||t===null)return f.jsx("span",{className:Me("text-sm",typeof t=="string"&&"text-foreground",typeof t=="number"&&"text-orange-600/70 dark:text-orange-400/70",typeof t=="boolean"&&"text-purple-600/70 dark:text-purple-400/70",t===null&&"text-muted-foreground/60"),children:typeof t=="string"?`"${t}"`:String(t)});const s=Array.isArray(t),i=s?t.map((u,d)=>[d,u]):Object.entries(t),a=s?"[":"{",l=s?"]":"}";return i.length===0?f.jsxs("span",{className:"text-sm text-muted-foreground",children:[a,l]}):f.jsxs("div",{className:"text-sm",children:[f.jsxs("button",{onClick:()=>r(!n),className:"flex items-center gap-1 hover:bg-muted/50 rounded px-1 transition-colors",children:[n?f.jsx(Au,{className:"h-3 w-3"}):f.jsx(Ba,{className:"h-3 w-3"}),f.jsxs("span",{className:"text-muted-foreground",children:[a," ",!n&&`${i.length} items`]})]}),n&&f.jsx("div",{className:"ml-4 border-l border-border pl-2 space-y-1",children:i.map(([u,d])=>f.jsxs("div",{className:"flex gap-2",children:[f.jsxs("span",{className:"text-blue-600/70 dark:text-blue-400/70 font-medium min-w-0 flex-shrink-0",children:[s?`[${u}]`:`"${u}"`,":"]}),f.jsx("div",{className:"min-w-0 flex-1",children:f.jsx(K8,{data:d,depth:e+1})})]},u))}),n&&f.jsx("span",{className:"text-muted-foreground ml-4",children:l})]})}function E4({toolCall:t,toolResult:e,className:n,serverConfigs:r,onCallTool:s,onSendFollowup:i,toolMeta:a,serverId:l}){const[u,d]=w.useState(!1),[p,h]=w.useState(!1),v=e?e.error?"error":"completed":t.status,b=()=>{switch(v){case"completed":return f.jsxs("div",{className:"relative",children:[f.jsx(sf,{className:"h-4 w-4 text-green-600/70 dark:text-green-400/70"}),f.jsx("div",{className:"absolute inset-0 animate-ping",children:f.jsx(sf,{className:"h-4 w-4 text-green-600/70 dark:text-green-400/70 opacity-20"})})]});case"error":return f.jsxs("div",{className:"relative",children:[f.jsx(af,{className:"h-4 w-4 text-red-600/70 dark:text-red-400/70"}),f.jsx("div",{className:"absolute inset-0 animate-pulse",children:f.jsx(af,{className:"h-4 w-4 text-red-600/70 dark:text-red-400/70 opacity-30"})})]});case"executing":return f.jsxs("div",{className:"relative",children:[f.jsx(oI,{className:"h-4 w-4 text-blue-600/70 dark:text-blue-400/70 animate-spin"}),f.jsx("div",{className:"absolute inset-0 animate-ping",children:f.jsx("div",{className:"h-4 w-4 bg-blue-600/30 dark:bg-blue-400/30 rounded-full"})})]});default:return f.jsx(oI,{className:"h-4 w-4 text-muted-foreground/60"})}};return f.jsxs("div",{className:Me("border rounded-lg bg-gradient-to-br from-muted/20 to-muted/40 backdrop-blur-sm shadow-sm hover:shadow-md transition-all duration-200",v==="completed"&&"border-green-200/50 dark:border-green-800/50",v==="error"&&"border-red-200/50 dark:border-red-800/50",v==="executing"&&"border-blue-200/50 dark:border-blue-800/50 shadow-md animate-pulse",n),children:[f.jsxs("button",{onClick:()=>d(!u),className:"w-full flex items-center justify-between p-4 hover:bg-muted/30 transition-all duration-200 rounded-t-lg",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("div",{className:"p-2 rounded-md bg-background/50 border",children:f.jsx(A0,{className:"h-4 w-4 text-muted-foreground"})}),f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("span",{className:"font-semibold text-sm",children:t.name}),v==="executing"&&f.jsx("span",{className:"text-xs text-blue-600/70 dark:text-blue-400/70 font-medium",children:"Running..."}),b()]})]}),f.jsx("div",{className:"flex items-center gap-2",children:u?f.jsx(Au,{className:"h-4 w-4 text-muted-foreground"}):f.jsx(Ba,{className:"h-4 w-4 text-muted-foreground"})})]}),u&&f.jsxs("div",{className:"border-t bg-background/30 backdrop-blur-sm",children:[Object.keys(t.parameters).length>0&&f.jsxs("div",{className:"p-4 border-b border-border/50",children:[f.jsxs("div",{className:"flex items-center justify-between mb-3",children:[f.jsxs("h4",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider flex items-center gap-2",children:[f.jsx("div",{className:"w-2 h-2 rounded-full bg-blue-600/70 dark:bg-blue-400/70"}),"Parameters"]}),f.jsx("button",{onClick:()=>h(!p),className:"text-xs text-muted-foreground hover:text-foreground transition-colors px-2 py-1 rounded bg-muted/50 hover:bg-muted",children:p?"Raw JSON":"Tree View"})]}),p?f.jsx(K8,{data:t.parameters}):f.jsx(S4,{data:t.parameters})]}),e&&f.jsxs("div",{className:"p-4",children:[f.jsxs("h4",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-3 flex items-center gap-2",children:[f.jsx("div",{className:Me("w-2 h-2 rounded-full",e.error?"bg-red-600/70 dark:bg-red-400/70":"bg-green-600/70 dark:bg-green-400/70")}),e.error?"Error":"Result"]}),f.jsx("div",{children:e.error?f.jsx("div",{className:"bg-red-50/30 dark:bg-red-950/20 border border-red-200/50 dark:border-red-800/50 rounded-lg p-4",children:f.jsxs("div",{className:"flex items-start gap-3",children:[f.jsx(af,{className:"h-5 w-5 text-red-600/70 dark:text-red-400/70 flex-shrink-0 mt-0.5"}),f.jsxs("div",{children:[f.jsx("p",{className:"font-medium text-foreground mb-1",children:"Tool execution failed"}),f.jsx("p",{className:"text-muted-foreground text-sm",children:e.error})]})]})}):f.jsxs("div",{className:"bg-green-50/30 dark:bg-green-950/20 border border-green-200/50 dark:border-green-800/50 rounded-lg",children:[f.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 bg-green-100/30 dark:bg-green-900/20 border-b border-green-200/50 dark:border-green-800/50",children:[f.jsx(sf,{className:"h-4 w-4 text-green-600/70 dark:text-green-400/70"}),f.jsx("span",{className:"text-sm font-medium text-foreground",children:"Tool executed successfully"})]}),f.jsx("div",{className:"p-4",children:(()=>{const x=R=>{if(!R)return null;const j=Array.isArray(R)?R[0]:R;if(!j)return null;const A=j?.resource;if(A&&typeof A=="object"&&typeof A.uri=="string"&&A.uri.startsWith("ui://"))return A;const N=j?.content;if(Array.isArray(N)){for(const M of N)if(M?.type==="resource"&&M?.resource?.uri&&typeof M.resource.uri=="string"&&M.resource.uri.startsWith("ui://"))return M.resource}return null},E=e?.result,S=a?.["openai/outputTemplate"];if(S&&typeof S=="string"){const R=l||e.serverId;return f.jsx(Vq,{componentUrl:S,toolCall:t,toolResult:e,onCallTool:s,onSendFollowup:i,serverId:R,toolMeta:a})}const k=x(E);if(k)return f.jsx(DN,{resource:k,htmlProps:{autoResizeIframe:!0,style:{width:"100%",overflow:"visible"}},onUIAction:async R=>{if(R.type==="tool"&&R.payload?.toolName){const j=(()=>{if(r&&typeof r=="object"&&Object.keys(r).length===1)return Object.keys(r)[0]})();fetch("/api/mcp/tools/execute",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({toolName:R.payload.toolName,parameters:R.payload.params||{},...j?{serverId:j}:{}})}).catch(()=>{})}else R.type==="link"&&R.payload?.url&&window.open(R.payload.url,"_blank","noopener,noreferrer");return{status:"handled"}}});const T=E?.result||E;return typeof T=="object"?f.jsx(S4,{data:T}):f.jsx("div",{className:"text-sm text-foreground bg-muted/30 p-3 rounded border",children:String(T)})})()})]})})]})]})]})}const BEe="/claude_logo.png",qEe="/openai_logo.png",VEe="/deepseek_logo.svg",HEe="/google_logo.png",GEe="/meta_logo.svg",k4="/ollama_logo.svg",T4="/ollama_dark.png",C4="/grok_light.svg",A4="/grok_dark.png",X8=(t,e)=>{switch(t){case"anthropic":return BEe;case"openai":return qEe;case"deepseek":return VEe;case"google":return HEe;case"ollama":return e==="dark"||e==="system"&&typeof document<"u"&&document.documentElement.classList.contains("dark")?T4:k4;case"meta":return GEe;case"x-ai":return e==="dark"||e==="system"&&typeof document<"u"&&document.documentElement.classList.contains("dark")?A4:C4;default:return null}},WEe=(t,e)=>X8(t.provider,e),YEe=t=>{switch(t){case"anthropic":return"text-orange-600 dark:text-orange-400";case"openai":return"text-green-600 dark:text-green-400";case"deepseek":return"text-blue-600 dark:text-blue-400";case"google":return"text-red-600 dark:text-red-400";case"ollama":return"text-gray-600 dark:text-gray-400";case"x-ai":return"text-purple-600 dark:text-purple-400";default:return"text-blue-600 dark:text-blue-400"}},N4=t=>{let e;const n=new Set,r=(d,p)=>{const h=typeof d=="function"?d(e):d;if(!Object.is(h,e)){const g=e;e=p??(typeof h!="object"||h===null)?h:Object.assign({},e,h),n.forEach(v=>v(e,g))}},s=()=>e,l={setState:r,getState:s,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d))},u=e=t(r,s,l);return l},KEe=t=>t?N4(t):N4,XEe=t=>t;function QEe(t,e=XEe){const n=Ee.useSyncExternalStore(t.subscribe,Ee.useCallback(()=>e(t.getState()),[t,e]),Ee.useCallback(()=>e(t.getInitialState()),[t,e]));return Ee.useDebugValue(n),n}const JEe=t=>KEe()(e=>({themeMode:t?.themeMode??"light",themePreset:t?.themePreset??"default",setThemeMode:n=>e({themeMode:n}),setThemePreset:n=>e({themePreset:n})})),Q8=w.createContext(null),ZEe=({children:t,themeMode:e,themePreset:n})=>{const r=w.useRef(null);return r.current??=JEe({themeMode:e,themePreset:n}),f.jsx(Q8.Provider,{value:r.current,children:t})},Ym=t=>{const e=w.useContext(Q8);if(!e)throw new Error("Missing PreferencesStoreProvider");return QEe(e,t)},R4=({attachment:t,align:e="left"})=>{const[n,r]=w.useState(!1),[s,i]=w.useState(!1);return n?f.jsxs("div",{className:`px-3 py-2 bg-muted rounded-lg text-sm text-muted-foreground ${e==="right"?"text-right":""}`,children:["Failed to load image: ",t.name]}):f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx("div",{className:`text-xs text-muted-foreground font-medium ${e==="right"?"text-right":""}`,children:t.name}),f.jsx("div",{className:"flex justify-center",children:f.jsx("img",{src:t.url,alt:t.name,className:`max-w-full h-auto rounded-lg border border-border/30 shadow-sm cursor-pointer transition-all hover:shadow-md ${s?"max-h-none":"max-h-96"}`,loading:"lazy",onClick:()=>i(!s),onError:()=>r(!0),title:s?"Click to collapse":"Click to expand"})})]})},j4=()=>f.jsxs("div",{className:"flex items-center gap-2 py-2",children:[f.jsx("span",{className:"text-sm text-muted-foreground",children:"Thinking"}),f.jsxs("div",{className:"flex space-x-1",children:[f.jsx("div",{className:"w-1.5 h-1.5 bg-muted-foreground/60 rounded-full animate-bounce"}),f.jsx("div",{className:"w-1.5 h-1.5 bg-muted-foreground/60 rounded-full animate-bounce [animation-delay:-0.2s]"}),f.jsx("div",{className:"w-1.5 h-1.5 bg-muted-foreground/60 rounded-full animate-bounce [animation-delay:-0.4s]"})]})]}),e1e=({message:t,isLoading:e=!1,onEdit:n,onRegenerate:r,onCopy:s,isReadonly:i=!1,showActions:a=!0,model:l,serverConfigs:u,onCallTool:d,onSendFollowup:p,toolsMetadata:h,serverId:g})=>{const[v,b]=w.useState("view"),[x,E]=w.useState(!1),[S,k]=w.useState(!1),T=Ym(I=>I.themeMode),R=()=>{s?s(t.content):navigator.clipboard.writeText(t.content),k(!0),setTimeout(()=>k(!1),2e3)},j=I=>{n&&n(t.id,I),b("view")},A=()=>{b("view")},N=()=>{r&&r(t.id)},M=t.role==="assistant"&&e&&(!t.content||t.content.trim()==="");return f.jsx(hx,{children:f.jsxs(ei.div,{"data-testid":`message-${t.role}`,className:"w-full mx-auto max-w-4xl px-4 group/message",initial:{y:5,opacity:0},animate:{y:0,opacity:1},"data-role":t.role,onMouseEnter:()=>E(!0),onMouseLeave:()=>E(!1),children:[t.role==="assistant"&&f.jsxs("div",{className:"flex gap-4 w-full",children:[f.jsx("div",{className:"size-8 flex items-center rounded-full justify-center shrink-0 bg-muted/50",children:f.jsx("img",{src:WEe(l,T),alt:`${l?.id} logo`,className:"h-4 w-4 object-contain"})}),f.jsxs("div",{className:"flex flex-col gap-4 w-full min-w-0",children:[t.attachments&&t.attachments.length>0&&f.jsx("div",{className:"flex flex-col gap-3",children:t.attachments.map(I=>PD({type:I.contentType})?f.jsx(R4,{attachment:I},I.id):f.jsxs("div",{className:"px-3 py-2 bg-muted rounded-lg text-sm flex items-center gap-2",children:[f.jsx("span",{children:"📎"}),f.jsx("span",{children:I.name}),I.size&&f.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",(I.size/1024).toFixed(1)," KB)"]})]},I.id))}),t.contentBlocks&&t.contentBlocks.length>0?f.jsx("div",{className:"space-y-4",children:t.contentBlocks.map((I,O)=>I.type==="text"&&I.content?f.jsx(ei.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.3,delay:O*.05},className:"prose prose-sm max-w-none dark:prose-invert prose-p:leading-relaxed prose-pre:bg-muted/50 prose-pre:border prose-pre:border-border/30 flex-1 min-w-0",children:f.jsx(_4,{children:iE(I.content)})},I.id):I.type==="tool_call"&&I.toolCall?f.jsx(ei.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.3,delay:O*.05},children:f.jsx(E4,{toolCall:I.toolCall,toolResult:I.toolResult,serverConfigs:u,onCallTool:d,onSendFollowup:p,toolMeta:h?.[I.toolCall.name],serverId:g})},I.id):null)}):f.jsxs(f.Fragment,{children:[t.toolCalls&&t.toolCalls.length>0&&f.jsx("div",{className:"space-y-2",children:t.toolCalls.map((I,O)=>{const L=t.toolResults?.find(z=>z.toolCallId===I.id);return f.jsx(ei.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.3,delay:O*.1},children:f.jsx(E4,{toolCall:I,toolResult:L,serverConfigs:u,onCallTool:d,onSendFollowup:p,toolMeta:h?.[I.name],serverId:g})},I.id)})}),M?f.jsx(ei.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.3},children:f.jsx(j4,{})}):v==="view"&&t.content?f.jsx("div",{className:"prose prose-sm max-w-none dark:prose-invert prose-p:leading-relaxed prose-pre:bg-muted/50 prose-pre:border prose-pre:border-border/30 flex-1 min-w-0",children:f.jsx(_4,{children:iE(t.content)})}):null]}),M&&t.contentBlocks&&f.jsx(ei.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.3},children:f.jsx(j4,{})}),v==="view"&&x&&f.jsxs("div",{className:"flex items-center justify-between mt-4",children:[f.jsx("div",{className:"text-xs text-muted-foreground/60",children:MD(t.timestamp)}),a&&!i&&f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsxs(Ma,{children:[f.jsx(Oa,{asChild:!0,children:f.jsx(Ie,{variant:"ghost",size:"sm",className:"px-2 h-7 rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-all",onClick:R,children:S?f.jsx(Ti,{size:14}):f.jsx(Po,{size:14})})}),f.jsx(Pa,{children:"Copy"})]}),r&&f.jsxs(Ma,{children:[f.jsx(Oa,{asChild:!0,children:f.jsx(Ie,{variant:"ghost",size:"sm",className:"px-2 h-7 rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-all",onClick:N,children:f.jsx(rie,{size:14})})}),f.jsx(Pa,{children:"Regenerate"})]})]})]}),v==="edit"&&f.jsx("div",{className:"flex flex-row gap-2 items-start",children:f.jsx(w4,{message:t,onSave:j,onCancel:A})})]})]}),t.role==="user"&&f.jsx("div",{className:"flex justify-end w-full",children:f.jsxs("div",{className:"flex flex-col gap-2 max-w-2xl",children:[t.attachments&&t.attachments.length>0&&f.jsx("div",{className:"flex flex-col gap-3",children:t.attachments.map(I=>PD({type:I.contentType})?f.jsx(R4,{attachment:I,align:"right"},I.id):f.jsxs("div",{className:"px-3 py-2 bg-muted rounded-lg text-sm flex items-center gap-2 justify-end",children:[f.jsx("span",{children:I.name}),f.jsx("span",{children:"📎"}),I.size&&f.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",(I.size/1024).toFixed(1)," KB)"]})]},I.id))}),v==="view"?f.jsxs("div",{className:"flex items-start gap-2 justify-end",children:[a&&!i&&x&&f.jsx("div",{className:"flex items-center gap-1 mt-1",children:f.jsxs(Ma,{children:[f.jsx(Oa,{asChild:!0,children:f.jsx(Ie,{variant:"ghost",size:"sm",className:"px-2 h-7 rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-all",onClick:R,children:f.jsx(Po,{size:14})})}),f.jsx(Pa,{children:"Copy"})]})}),f.jsxs("div",{className:"relative",children:[f.jsx("div",{"data-testid":"message-content",className:"bg-primary text-primary-foreground px-4 py-3 rounded-2xl max-w-fit",children:f.jsx("div",{className:"whitespace-pre-wrap break-words font-medium",children:iE(t.content)})}),x&&f.jsx("div",{className:"absolute -bottom-6 right-0 text-xs text-muted-foreground/60",children:MD(t.timestamp)})]})]}):f.jsx("div",{className:"w-full",children:f.jsx(w4,{message:t,onSave:j,onCancel:A})})]})})]})})},t1e=w.memo(e1e,(t,e)=>t.message.id===e.message.id&&t.message.content===e.message.content&&t.isLoading===e.isLoading&&JSON.stringify(t.message.toolCalls)===JSON.stringify(e.message.toolCalls)&&JSON.stringify(t.message.toolResults)===JSON.stringify(e.message.toolResults));function M1({provider:t}){const e=Ym(r=>r.themeMode),n=X8(t,e);return n?f.jsx("img",{src:n,width:12,height:12,alt:`${t} logo`,className:"h-3 w-3 object-contain"}):f.jsx("div",{className:kT("h-3 w-3 rounded-sm",YEe(t))})}var Ea=[],xi=[],n1e=Uint8Array,O1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var Cd=0,r1e=O1.length;Cd<r1e;++Cd)Ea[Cd]=O1[Cd],xi[O1.charCodeAt(Cd)]=Cd;xi[45]=62;xi[95]=63;function s1e(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");n===-1&&(n=e);var r=n===e?0:4-n%4;return[n,r]}function i1e(t,e,n){return(e+n)*3/4-n}function Km(t){var e,n=s1e(t),r=n[0],s=n[1],i=new n1e(i1e(t,r,s)),a=0,l=s>0?r-4:r,u;for(u=0;u<l;u+=4)e=xi[t.charCodeAt(u)]<<18|xi[t.charCodeAt(u+1)]<<12|xi[t.charCodeAt(u+2)]<<6|xi[t.charCodeAt(u+3)],i[a++]=e>>16&255,i[a++]=e>>8&255,i[a++]=e&255;return s===2&&(e=xi[t.charCodeAt(u)]<<2|xi[t.charCodeAt(u+1)]>>4,i[a++]=e&255),s===1&&(e=xi[t.charCodeAt(u)]<<10|xi[t.charCodeAt(u+1)]<<4|xi[t.charCodeAt(u+2)]>>2,i[a++]=e>>8&255,i[a++]=e&255),i}function a1e(t){return Ea[t>>18&63]+Ea[t>>12&63]+Ea[t>>6&63]+Ea[t&63]}function o1e(t,e,n){for(var r,s=[],i=e;i<n;i+=3)r=(t[i]<<16&16711680)+(t[i+1]<<8&65280)+(t[i+2]&255),s.push(a1e(r));return s.join("")}function Xm(t){for(var e,n=t.length,r=n%3,s=[],i=16383,a=0,l=n-r;a<l;a+=i)s.push(o1e(t,a,a+i>l?l:a+i));return r===1?(e=t[n-1],s.push(Ea[e>>2]+Ea[e<<4&63]+"==")):r===2&&(e=(t[n-2]<<8)+t[n-1],s.push(Ea[e>>10]+Ea[e>>4&63]+Ea[e<<2&63]+"=")),s.join("")}function So(t){if(t===void 0)return{};if(!J8(t))throw new Error(`The arguments to a Convex function must be an object. Received: ${t}`);return t}function l1e(t){if(typeof t>"u")throw new Error("Client created with undefined deployment address. If you used an environment variable, check that it's set.");if(typeof t!="string")throw new Error(`Invalid deployment address: found ${t}".`);if(!(t.startsWith("http:")||t.startsWith("https:")))throw new Error(`Invalid deployment address: Must start with "https://" or "http://". Found "${t}".`);try{new URL(t)}catch{throw new Error(`Invalid deployment address: "${t}" is not a valid URL. If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`)}if(t.endsWith(".convex.site"))throw new Error(`Invalid deployment address: "${t}" ends with .convex.site, which is used for HTTP Actions. Convex deployment URLs typically end with .convex.cloud? If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`)}function J8(t){const e=typeof t=="object",n=Object.getPrototypeOf(t),r=n===null||n===Object.prototype||n?.constructor?.name==="Object";return e&&r}const Z8=!0,Mf=BigInt("-9223372036854775808"),nj=BigInt("9223372036854775807"),SC=BigInt("0"),c1e=BigInt("8"),u1e=BigInt("256");function e7(t){return Number.isNaN(t)||!Number.isFinite(t)||Object.is(t,-0)}function d1e(t){t<SC&&(t-=Mf+Mf);let e=t.toString(16);e.length%2===1&&(e="0"+e);const n=new Uint8Array(new ArrayBuffer(8));let r=0;for(const s of e.match(/.{2}/g).reverse())n.set([parseInt(s,16)],r++),t>>=c1e;return Xm(n)}function f1e(t){const e=Km(t);if(e.byteLength!==8)throw new Error(`Received ${e.byteLength} bytes, expected 8 for $integer`);let n=SC,r=SC;for(const s of e)n+=BigInt(s)*u1e**r,r++;return n>nj&&(n+=Mf+Mf),n}function h1e(t){if(t<Mf||nj<t)throw new Error(`BigInt ${t} does not fit into a 64-bit signed integer.`);const e=new ArrayBuffer(8);return new DataView(e).setBigInt64(0,t,!0),Xm(new Uint8Array(e))}function p1e(t){const e=Km(t);if(e.byteLength!==8)throw new Error(`Received ${e.byteLength} bytes, expected 8 for $integer`);return new DataView(e.buffer).getBigInt64(0,!0)}const m1e=DataView.prototype.setBigInt64?h1e:d1e,g1e=DataView.prototype.getBigInt64?p1e:f1e,M4=1024;function t7(t){if(t.length>M4)throw new Error(`Field name ${t} exceeds maximum field name length ${M4}.`);if(t.startsWith("$"))throw new Error(`Field name ${t} starts with a '$', which is reserved.`);for(let e=0;e<t.length;e+=1){const n=t.charCodeAt(e);if(n<32||n>=127)throw new Error(`Field name ${t} has invalid character '${t[e]}': Field names can only contain non-control ASCII characters`)}}function Of(t){if(t===null||typeof t=="boolean"||typeof t=="number"||typeof t=="string")return t;if(Array.isArray(t))return t.map(r=>Of(r));if(typeof t!="object")throw new Error(`Unexpected type of ${t}`);const e=Object.entries(t);if(e.length===1){const r=e[0][0];if(r==="$bytes"){if(typeof t.$bytes!="string")throw new Error(`Malformed $bytes field on ${t}`);return Km(t.$bytes).buffer}if(r==="$integer"){if(typeof t.$integer!="string")throw new Error(`Malformed $integer field on ${t}`);return g1e(t.$integer)}if(r==="$float"){if(typeof t.$float!="string")throw new Error(`Malformed $float field on ${t}`);const s=Km(t.$float);if(s.byteLength!==8)throw new Error(`Received ${s.byteLength} bytes, expected 8 for $float`);const a=new DataView(s.buffer).getFloat64(0,Z8);if(!e7(a))throw new Error(`Float ${a} should be encoded as a number`);return a}if(r==="$set")throw new Error("Received a Set which is no longer supported as a Convex type.");if(r==="$map")throw new Error("Received a Map which is no longer supported as a Convex type.")}const n={};for(const[r,s]of Object.entries(t))t7(r),n[r]=Of(s);return n}function fm(t){return JSON.stringify(t,(e,n)=>n===void 0?"undefined":typeof n=="bigint"?`${n.toString()}n`:n)}function EC(t,e,n,r){if(t===void 0){const a=n&&` (present at path ${n} in original object ${fm(e)})`;throw new Error(`undefined is not a valid Convex value${a}. To learn about Convex's supported types, see https://docs.convex.dev/using/types.`)}if(t===null)return t;if(typeof t=="bigint"){if(t<Mf||nj<t)throw new Error(`BigInt ${t} does not fit into a 64-bit signed integer.`);return{$integer:m1e(t)}}if(typeof t=="number")if(e7(t)){const a=new ArrayBuffer(8);return new DataView(a).setFloat64(0,t,Z8),{$float:Xm(new Uint8Array(a))}}else return t;if(typeof t=="boolean"||typeof t=="string")return t;if(t instanceof ArrayBuffer)return{$bytes:Xm(new Uint8Array(t))};if(Array.isArray(t))return t.map((a,l)=>EC(a,e,n+`[${l}]`));if(t instanceof Set)throw new Error(P1(n,"Set",[...t],e));if(t instanceof Map)throw new Error(P1(n,"Map",[...t],e));if(!J8(t)){const a=t?.constructor?.name,l=a?`${a} `:"";throw new Error(P1(n,l,t,e))}const s={},i=Object.entries(t);i.sort(([a,l],[u,d])=>a===u?0:a<u?-1:1);for(const[a,l]of i)l!==void 0&&(t7(a),s[a]=EC(l,e,n+`.${a}`));return s}function P1(t,e,n,r){return t?`${e}${fm(n)} is not a supported Convex type (present at path ${t} in original object ${fm(r)}). To learn about Convex's supported types, see https://docs.convex.dev/using/types.`:`${e}${fm(n)} is not a supported Convex type.`}function Ql(t){return EC(t,t,"")}var v1e=Object.defineProperty,y1e=(t,e,n)=>e in t?v1e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,I1=(t,e,n)=>y1e(t,typeof e!="symbol"?e+"":e,n),O4,P4;const b1e=Symbol.for("ConvexError");class kC extends(P4=Error,O4=b1e,P4){constructor(e){super(typeof e=="string"?e:fm(e)),I1(this,"name","ConvexError"),I1(this,"data"),I1(this,O4,!0),this.data=e}}const n7=()=>Array.from({length:4},()=>0);n7();n7();const I4="1.28.0";var x1e=Object.defineProperty,_1e=(t,e,n)=>e in t?x1e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,D4=(t,e,n)=>_1e(t,typeof e!="symbol"?e+"":e,n);const w1e="color:rgb(0, 145, 255)";function r7(t){switch(t){case"query":return"Q";case"mutation":return"M";case"action":return"A";case"any":return"?"}}class s7{constructor(e){D4(this,"_onLogLineFuncs"),D4(this,"_verbose"),this._onLogLineFuncs={},this._verbose=e.verbose}addLogLineListener(e){let n=Math.random().toString(36).substring(2,15);for(let r=0;r<10&&this._onLogLineFuncs[n]!==void 0;r++)n=Math.random().toString(36).substring(2,15);return this._onLogLineFuncs[n]=e,()=>{delete this._onLogLineFuncs[n]}}logVerbose(...e){if(this._verbose)for(const n of Object.values(this._onLogLineFuncs))n("debug",`${new Date().toISOString()}`,...e)}log(...e){for(const n of Object.values(this._onLogLineFuncs))n("info",...e)}warn(...e){for(const n of Object.values(this._onLogLineFuncs))n("warn",...e)}error(...e){for(const n of Object.values(this._onLogLineFuncs))n("error",...e)}}function i7(t){const e=new s7(t);return e.addLogLineListener((n,...r)=>{switch(n){case"debug":console.debug(...r);break;case"info":console.log(...r);break;case"warn":console.warn(...r);break;case"error":console.error(...r);break;default:console.log(...r)}}),e}function a7(t){return new s7(t)}function xx(t,e,n,r,s){const i=r7(n);if(typeof s=="object"&&(s=`ConvexError ${JSON.stringify(s.errorData,null,2)}`),e==="info"){const a=s.match(/^\[.*?\] /);if(a===null){t.error(`[CONVEX ${i}(${r})] Could not parse console.log`);return}const l=s.slice(1,a[0].length-2),u=s.slice(a[0].length);t.log(`%c[CONVEX ${i}(${r})] [${l}]`,w1e,u)}else t.error(`[CONVEX ${i}(${r})] ${s}`)}function S1e(t,e){const n=`[CONVEX FATAL ERROR] ${e}`;return t.error(n),new Error(n)}function Xd(t,e,n){return`[CONVEX ${r7(t)}(${e})] ${n.errorMessage}
|
|
1818
|
+
Called by client`}function TC(t,e){return e.data=t.errorData,e}function _x(t){const e=t.split(":");let n,r;return e.length===1?(n=e[0],r="default"):(n=e.slice(0,e.length-1).join(":"),r=e[e.length-1]),n.endsWith(".js")&&(n=n.slice(0,-3)),`${n}:${r}`}function iu(t,e){return JSON.stringify({udfPath:_x(t),args:Ql(e)})}var E1e=Object.defineProperty,k1e=(t,e,n)=>e in t?E1e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,xa=(t,e,n)=>k1e(t,typeof e!="symbol"?e+"":e,n);class T1e{constructor(){xa(this,"nextQueryId"),xa(this,"querySetVersion"),xa(this,"querySet"),xa(this,"queryIdToToken"),xa(this,"identityVersion"),xa(this,"auth"),xa(this,"outstandingQueriesOlderThanRestart"),xa(this,"outstandingAuthOlderThanRestart"),xa(this,"paused"),xa(this,"pendingQuerySetModifications"),this.nextQueryId=0,this.querySetVersion=0,this.identityVersion=0,this.querySet=new Map,this.queryIdToToken=new Map,this.outstandingQueriesOlderThanRestart=new Set,this.outstandingAuthOlderThanRestart=!1,this.paused=!1,this.pendingQuerySetModifications=new Map}hasSyncedPastLastReconnect(){return this.outstandingQueriesOlderThanRestart.size===0&&!this.outstandingAuthOlderThanRestart}markAuthCompletion(){this.outstandingAuthOlderThanRestart=!1}subscribe(e,n,r,s){const i=_x(e),a=iu(i,n),l=this.querySet.get(a);if(l!==void 0)return l.numSubscribers+=1,{queryToken:a,modification:null,unsubscribe:()=>this.removeSubscriber(a)};{const u=this.nextQueryId++,d={id:u,canonicalizedUdfPath:i,args:n,numSubscribers:1,journal:r,componentPath:s};this.querySet.set(a,d),this.queryIdToToken.set(u,a);const p=this.querySetVersion,h=this.querySetVersion+1,g={type:"Add",queryId:u,udfPath:i,args:[Ql(n)],journal:r,componentPath:s};return this.paused?this.pendingQuerySetModifications.set(u,g):this.querySetVersion=h,{queryToken:a,modification:{type:"ModifyQuerySet",baseVersion:p,newVersion:h,modifications:[g]},unsubscribe:()=>this.removeSubscriber(a)}}}transition(e){for(const n of e.modifications)switch(n.type){case"QueryUpdated":case"QueryFailed":{this.outstandingQueriesOlderThanRestart.delete(n.queryId);const r=n.journal;if(r!==void 0){const s=this.queryIdToToken.get(n.queryId);s!==void 0&&(this.querySet.get(s).journal=r)}break}case"QueryRemoved":{this.outstandingQueriesOlderThanRestart.delete(n.queryId);break}default:throw new Error(`Invalid modification ${n.type}`)}}queryId(e,n){const r=_x(e),s=iu(r,n),i=this.querySet.get(s);return i!==void 0?i.id:null}isCurrentOrNewerAuthVersion(e){return e>=this.identityVersion}getAuth(){return this.auth}setAuth(e){this.auth={tokenType:"User",value:e};const n=this.identityVersion;return this.paused||(this.identityVersion=n+1),{type:"Authenticate",baseVersion:n,...this.auth}}setAdminAuth(e,n){const r={tokenType:"Admin",value:e,impersonating:n};this.auth=r;const s=this.identityVersion;return this.paused||(this.identityVersion=s+1),{type:"Authenticate",baseVersion:s,...r}}clearAuth(){this.auth=void 0,this.markAuthCompletion();const e=this.identityVersion;return this.paused||(this.identityVersion=e+1),{type:"Authenticate",tokenType:"None",baseVersion:e}}hasAuth(){return!!this.auth}isNewAuth(e){return this.auth?.value!==e}queryPath(e){const n=this.queryIdToToken.get(e);return n?this.querySet.get(n).canonicalizedUdfPath:null}queryArgs(e){const n=this.queryIdToToken.get(e);return n?this.querySet.get(n).args:null}queryToken(e){return this.queryIdToToken.get(e)??null}queryJournal(e){return this.querySet.get(e)?.journal}restart(e){this.unpause(),this.outstandingQueriesOlderThanRestart.clear();const n=[];for(const i of this.querySet.values()){const a={type:"Add",queryId:i.id,udfPath:i.canonicalizedUdfPath,args:[Ql(i.args)],journal:i.journal,componentPath:i.componentPath};n.push(a),e.has(i.id)||this.outstandingQueriesOlderThanRestart.add(i.id)}this.querySetVersion=1;const r={type:"ModifyQuerySet",baseVersion:0,newVersion:1,modifications:n};if(!this.auth)return this.identityVersion=0,[r,void 0];this.outstandingAuthOlderThanRestart=!0;const s={type:"Authenticate",baseVersion:0,...this.auth};return this.identityVersion=1,[r,s]}pause(){this.paused=!0}resume(){const e=this.pendingQuerySetModifications.size>0?{type:"ModifyQuerySet",baseVersion:this.querySetVersion,newVersion:++this.querySetVersion,modifications:Array.from(this.pendingQuerySetModifications.values())}:void 0,n=this.auth!==void 0?{type:"Authenticate",baseVersion:this.identityVersion++,...this.auth}:void 0;return this.unpause(),[e,n]}unpause(){this.paused=!1,this.pendingQuerySetModifications.clear()}removeSubscriber(e){const n=this.querySet.get(e);if(n.numSubscribers>1)return n.numSubscribers-=1,null;{this.querySet.delete(e),this.queryIdToToken.delete(n.id),this.outstandingQueriesOlderThanRestart.delete(n.id);const r=this.querySetVersion,s=this.querySetVersion+1,i={type:"Remove",queryId:n.id};return this.paused?this.pendingQuerySetModifications.has(n.id)?this.pendingQuerySetModifications.delete(n.id):this.pendingQuerySetModifications.set(n.id,i):this.querySetVersion=s,{type:"ModifyQuerySet",baseVersion:r,newVersion:s,modifications:[i]}}}}var C1e=Object.defineProperty,A1e=(t,e,n)=>e in t?C1e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,wy=(t,e,n)=>A1e(t,typeof e!="symbol"?e+"":e,n);class N1e{constructor(e,n){this.logger=e,this.markConnectionStateDirty=n,wy(this,"inflightRequests"),wy(this,"requestsOlderThanRestart"),wy(this,"inflightMutationsCount",0),wy(this,"inflightActionsCount",0),this.inflightRequests=new Map,this.requestsOlderThanRestart=new Set}request(e,n){const r=new Promise(s=>{const i=n?"Requested":"NotSent";this.inflightRequests.set(e.requestId,{message:e,status:{status:i,requestedAt:new Date,onResult:s}}),e.type==="Mutation"?this.inflightMutationsCount++:e.type==="Action"&&this.inflightActionsCount++});return this.markConnectionStateDirty(),r}onResponse(e){const n=this.inflightRequests.get(e.requestId);if(n===void 0||n.status.status==="Completed")return null;const r=n.message.type==="Mutation"?"mutation":"action",s=n.message.udfPath;for(const u of e.logLines)xx(this.logger,"info",r,s,u);const i=n.status;let a,l;if(e.success)a={success:!0,logLines:e.logLines,value:Of(e.result)},l=()=>i.onResult(a);else{const u=e.result,{errorData:d}=e;xx(this.logger,"error",r,s,u),a={success:!1,errorMessage:u,errorData:d!==void 0?Of(d):void 0,logLines:e.logLines},l=()=>i.onResult(a)}return e.type==="ActionResponse"||!e.success?(l(),this.inflightRequests.delete(e.requestId),this.requestsOlderThanRestart.delete(e.requestId),n.message.type==="Action"?this.inflightActionsCount--:n.message.type==="Mutation"&&this.inflightMutationsCount--,this.markConnectionStateDirty(),{requestId:e.requestId,result:a}):(n.status={status:"Completed",result:a,ts:e.ts,onResolve:l},null)}removeCompleted(e){const n=new Map;for(const[r,s]of this.inflightRequests.entries()){const i=s.status;i.status==="Completed"&&i.ts.lessThanOrEqual(e)&&(i.onResolve(),n.set(r,i.result),s.message.type==="Mutation"?this.inflightMutationsCount--:s.message.type==="Action"&&this.inflightActionsCount--,this.inflightRequests.delete(r),this.requestsOlderThanRestart.delete(r))}return n.size>0&&this.markConnectionStateDirty(),n}restart(){this.requestsOlderThanRestart=new Set(this.inflightRequests.keys());const e=[];for(const[n,r]of this.inflightRequests){if(r.status.status==="NotSent"){r.status.status="Requested",e.push(r.message);continue}if(r.message.type==="Mutation")e.push(r.message);else if(r.message.type==="Action"){if(this.inflightRequests.delete(n),this.requestsOlderThanRestart.delete(n),this.inflightActionsCount--,r.status.status==="Completed")throw new Error("Action should never be in 'Completed' state");r.status.onResult({success:!1,errorMessage:"Connection lost while action was in flight",logLines:[]})}}return this.markConnectionStateDirty(),e}resume(){const e=[];for(const[,n]of this.inflightRequests)if(n.status.status==="NotSent"){n.status.status="Requested",e.push(n.message);continue}return e}hasIncompleteRequests(){for(const e of this.inflightRequests.values())if(e.status.status==="Requested")return!0;return!1}hasInflightRequests(){return this.inflightRequests.size>0}hasSyncedPastLastReconnect(){return this.requestsOlderThanRestart.size===0}timeOfOldestInflightRequest(){if(this.inflightRequests.size===0)return null;let e=Date.now();for(const n of this.inflightRequests.values())n.status.status!=="Completed"&&n.status.requestedAt.getTime()<e&&(e=n.status.requestedAt.getTime());return new Date(e)}inflightMutations(){return this.inflightMutationsCount}inflightActions(){return this.inflightActionsCount}}const Qm=Symbol.for("functionName"),R1e=Symbol.for("toReferencePath");function j1e(t){return t[R1e]??null}function M1e(t){return t.startsWith("function://")}function O1e(t){let e;if(typeof t=="string")M1e(t)?e={functionHandle:t}:e={name:t};else if(t[Qm])e={name:t[Qm]};else{const n=j1e(t);if(!n)throw new Error(`${t} is not a functionReference`);e={reference:n}}return e}function Ps(t){const e=O1e(t);if(e.name===void 0)throw e.functionHandle!==void 0?new Error(`Expected function reference like "api.file.func" or "internal.file.func", but received function handle ${e.functionHandle}`):e.reference!==void 0?new Error(`Expected function reference in the current component like "api.file.func" or "internal.file.func", but received reference ${e.reference}`):new Error(`Expected function reference like "api.file.func" or "internal.file.func", but received ${JSON.stringify(e)}`);if(typeof t=="string")return t;const n=t[Qm];if(!n)throw new Error(`${t} is not a functionReference`);return n}function rj(t){return{[Qm]:t}}function o7(t=[]){const e={get(n,r){if(typeof r=="string"){const s=[...t,r];return o7(s)}else if(r===Qm){if(t.length<2){const a=["api",...t].join(".");throw new Error(`API path is expected to be of the form \`api.moduleName.functionName\`. Found: \`${a}\``)}const s=t.slice(0,-1).join("/"),i=t[t.length-1];return i==="default"?s:s+":"+i}else return r===Symbol.toStringTag?"FunctionReference":void 0}};return new Proxy({},e)}o7();var P1e=Object.defineProperty,I1e=(t,e,n)=>e in t?P1e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,wx=(t,e,n)=>I1e(t,typeof e!="symbol"?e+"":e,n);class Jm{constructor(e){wx(this,"queryResults"),wx(this,"modifiedQueries"),this.queryResults=e,this.modifiedQueries=[]}getQuery(e,...n){const r=So(n[0]),s=Ps(e),i=this.queryResults.get(iu(s,r));if(i!==void 0)return Jm.queryValue(i.result)}getAllQueries(e){const n=[],r=Ps(e);for(const s of this.queryResults.values())s.udfPath===_x(r)&&n.push({args:s.args,value:Jm.queryValue(s.result)});return n}setQuery(e,n,r){const s=So(n),i=Ps(e),a=iu(i,s);let l;r===void 0?l=void 0:l={success:!0,value:r,logLines:[]};const u={udfPath:i,args:s,result:l};this.queryResults.set(a,u),this.modifiedQueries.push(a)}static queryValue(e){if(e!==void 0)return e.success?e.value:void 0}}class D1e{constructor(){wx(this,"queryResults"),wx(this,"optimisticUpdates"),this.queryResults=new Map,this.optimisticUpdates=[]}ingestQueryResultsFromServer(e,n){this.optimisticUpdates=this.optimisticUpdates.filter(a=>!n.has(a.mutationId));const r=this.queryResults;this.queryResults=new Map(e);const s=new Jm(this.queryResults);for(const a of this.optimisticUpdates)a.update(s);const i=[];for(const[a,l]of this.queryResults){const u=r.get(a);(u===void 0||u.result!==l.result)&&i.push(a)}return i}applyOptimisticUpdate(e,n){this.optimisticUpdates.push({update:e,mutationId:n});const r=new Jm(this.queryResults);return e(r),r.modifiedQueries}rawQueryResult(e){return this.queryResults.get(e)}queryResult(e){const n=this.queryResults.get(e);if(n===void 0)return;const r=n.result;if(r!==void 0){if(r.success)return r.value;throw r.errorData!==void 0?TC(r,new kC(Xd("query",n.udfPath,r))):new Error(Xd("query",n.udfPath,r))}}hasQueryResult(e){return this.queryResults.get(e)!==void 0}queryLogs(e){return this.queryResults.get(e)?.result?.logLines}}var L1e=Object.defineProperty,$1e=(t,e,n)=>e in t?L1e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,D1=(t,e,n)=>$1e(t,typeof e!="symbol"?e+"":e,n);class Xs{constructor(e,n){D1(this,"low"),D1(this,"high"),D1(this,"__isUnsignedLong__"),this.low=e|0,this.high=n|0,this.__isUnsignedLong__=!0}static isLong(e){return(e&&e.__isUnsignedLong__)===!0}static fromBytesLE(e){return new Xs(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24)}toBytesLE(){const e=this.high,n=this.low;return[n&255,n>>>8&255,n>>>16&255,n>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]}static fromNumber(e){return isNaN(e)||e<0?L4:e>=z1e?F1e:new Xs(e%hm|0,e/hm|0)}toString(){return(BigInt(this.high)*BigInt(hm)+BigInt(this.low)).toString()}equals(e){return Xs.isLong(e)||(e=Xs.fromValue(e)),this.high>>>31===1&&e.high>>>31===1?!1:this.high===e.high&&this.low===e.low}notEquals(e){return!this.equals(e)}comp(e){return Xs.isLong(e)||(e=Xs.fromValue(e)),this.equals(e)?0:e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1}lessThanOrEqual(e){return this.comp(e)<=0}static fromValue(e){return typeof e=="number"?Xs.fromNumber(e):new Xs(e.low,e.high)}}const L4=new Xs(0,0),$4=65536,hm=$4*$4,z1e=hm*hm,F1e=new Xs(-1,-1);var U1e=Object.defineProperty,B1e=(t,e,n)=>e in t?U1e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Sy=(t,e,n)=>B1e(t,typeof e!="symbol"?e+"":e,n);class z4{constructor(e,n){Sy(this,"version"),Sy(this,"remoteQuerySet"),Sy(this,"queryPath"),Sy(this,"logger"),this.version={querySet:0,ts:Xs.fromNumber(0),identity:0},this.remoteQuerySet=new Map,this.queryPath=e,this.logger=n}transition(e){const n=e.startVersion;if(this.version.querySet!==n.querySet||this.version.ts.notEquals(n.ts)||this.version.identity!==n.identity)throw new Error(`Invalid start version: ${n.ts.toString()}:${n.querySet}:${n.identity}, transitioning from ${this.version.ts.toString()}:${this.version.querySet}:${this.version.identity}`);for(const r of e.modifications)switch(r.type){case"QueryUpdated":{const s=this.queryPath(r.queryId);if(s)for(const a of r.logLines)xx(this.logger,"info","query",s,a);const i=Of(r.value??null);this.remoteQuerySet.set(r.queryId,{success:!0,value:i,logLines:r.logLines});break}case"QueryFailed":{const s=this.queryPath(r.queryId);if(s)for(const a of r.logLines)xx(this.logger,"info","query",s,a);const{errorData:i}=r;this.remoteQuerySet.set(r.queryId,{success:!1,errorMessage:r.errorMessage,errorData:i!==void 0?Of(i):void 0,logLines:r.logLines});break}case"QueryRemoved":{this.remoteQuerySet.delete(r.queryId);break}default:throw new Error(`Invalid modification ${r.type}`)}this.version=e.endVersion}remoteQueryResults(){return this.remoteQuerySet}timestamp(){return this.version.ts}}function L1(t){const e=Km(t);return Xs.fromBytesLE(Array.from(e))}function q1e(t){const e=new Uint8Array(t.toBytesLE());return Xm(e)}function F4(t){switch(t.type){case"FatalError":case"AuthError":case"ActionResponse":case"TransitionChunk":case"Ping":return{...t};case"MutationResponse":return t.success?{...t,ts:L1(t.ts)}:{...t};case"Transition":return{...t,startVersion:{...t.startVersion,ts:L1(t.startVersion.ts)},endVersion:{...t.endVersion,ts:L1(t.endVersion.ts)}}}}function V1e(t){switch(t.type){case"Authenticate":case"ModifyQuerySet":case"Mutation":case"Action":case"Event":return{...t};case"Connect":return t.maxObservedTimestamp!==void 0?{...t,maxObservedTimestamp:q1e(t.maxObservedTimestamp)}:{...t,maxObservedTimestamp:void 0}}}var H1e=Object.defineProperty,G1e=(t,e,n)=>e in t?H1e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Vr=(t,e,n)=>G1e(t,typeof e!="symbol"?e+"":e,n);const W1e=1e3,Y1e=1001,K1e=1005,X1e=4040;let ab;function ob(){return ab===void 0&&(ab=Date.now()),typeof performance>"u"||!performance.now?Date.now():Math.round(ab+performance.now())}function U4(){return`t=${Math.round((ob()-ab)/100)/10}s`}const l7={InternalServerError:{timeout:1e3},SubscriptionsWorkerFullError:{timeout:3e3},TooManyConcurrentRequests:{timeout:3e3},CommitterFullError:{timeout:3e3},AwsTooManyRequestsException:{timeout:3e3},ExecuteFullError:{timeout:3e3},SystemTimeoutError:{timeout:3e3},ExpiredInQueue:{timeout:3e3},VectorIndexesUnavailable:{timeout:1e3},SearchIndexesUnavailable:{timeout:1e3},TableSummariesUnavailable:{timeout:1e3},VectorIndexTooLarge:{timeout:3e3},SearchIndexTooLarge:{timeout:3e3},TooManyWritesInTimePeriod:{timeout:3e3}};function Q1e(t){if(t===void 0)return"Unknown";for(const e of Object.keys(l7))if(t.startsWith(e))return e;return"Unknown"}class J1e{constructor(e,n,r,s,i,a){this.markConnectionStateDirty=i,this.debug=a,Vr(this,"socket"),Vr(this,"connectionCount"),Vr(this,"_hasEverConnected",!1),Vr(this,"lastCloseReason"),Vr(this,"transitionChunkBuffer",null),Vr(this,"defaultInitialBackoff"),Vr(this,"maxBackoff"),Vr(this,"retries"),Vr(this,"serverInactivityThreshold"),Vr(this,"reconnectDueToServerInactivityTimeout"),Vr(this,"uri"),Vr(this,"onOpen"),Vr(this,"onResume"),Vr(this,"onMessage"),Vr(this,"webSocketConstructor"),Vr(this,"logger"),Vr(this,"onServerDisconnectError"),this.webSocketConstructor=r,this.socket={state:"disconnected"},this.connectionCount=0,this.lastCloseReason="InitialConnect",this.defaultInitialBackoff=1e3,this.maxBackoff=16e3,this.retries=0,this.serverInactivityThreshold=6e4,this.reconnectDueToServerInactivityTimeout=null,this.uri=e,this.onOpen=n.onOpen,this.onResume=n.onResume,this.onMessage=n.onMessage,this.onServerDisconnectError=n.onServerDisconnectError,this.logger=s,this.connect()}setSocketState(e){this.socket=e,this._logVerbose(`socket state changed: ${this.socket.state}, paused: ${"paused"in this.socket?this.socket.paused:void 0}`),this.markConnectionStateDirty()}assembleTransition(e){if(e.partNumber<0||e.partNumber>=e.totalParts||e.totalParts===0||this.transitionChunkBuffer&&(this.transitionChunkBuffer.totalParts!==e.totalParts||this.transitionChunkBuffer.transitionId!==e.transitionId))throw this.transitionChunkBuffer=null,new Error("Invalid TransitionChunk");if(this.transitionChunkBuffer===null&&(this.transitionChunkBuffer={chunks:[],totalParts:e.totalParts,transitionId:e.transitionId}),e.partNumber!==this.transitionChunkBuffer.chunks.length){const n=this.transitionChunkBuffer.chunks.length;throw this.transitionChunkBuffer=null,new Error(`TransitionChunk received out of order: expected part ${n}, got ${e.partNumber}`)}if(this.transitionChunkBuffer.chunks.push(e.chunk),this.transitionChunkBuffer.chunks.length===e.totalParts){const n=this.transitionChunkBuffer.chunks.join("");this.transitionChunkBuffer=null;const r=F4(JSON.parse(n));if(r.type!=="Transition")throw new Error(`Expected Transition, got ${r.type} after assembling chunks`);return r}return null}connect(){if(this.socket.state==="terminated")return;if(this.socket.state!=="disconnected"&&this.socket.state!=="stopped")throw new Error("Didn't start connection from disconnected state: "+this.socket.state);const e=new this.webSocketConstructor(this.uri);this._logVerbose("constructed WebSocket"),this.setSocketState({state:"connecting",ws:e,paused:"no"}),this.resetServerInactivityTimeout(),e.onopen=()=>{if(this.logger.logVerbose("begin ws.onopen"),this.socket.state!=="connecting")throw new Error("onopen called with socket not in connecting state");this.setSocketState({state:"ready",ws:e,paused:this.socket.paused==="yes"?"uninitialized":"no"}),this.resetServerInactivityTimeout(),this.socket.paused==="no"&&(this._hasEverConnected=!0,this.onOpen({connectionCount:this.connectionCount,lastCloseReason:this.lastCloseReason,clientTs:ob()})),this.lastCloseReason!=="InitialConnect"&&(this.lastCloseReason?this.logger.log("WebSocket reconnected at",U4(),"after disconnect due to",this.lastCloseReason):this.logger.log("WebSocket reconnected at",U4())),this.connectionCount+=1,this.lastCloseReason=null},e.onerror=n=>{this.transitionChunkBuffer=null;const r=n.message;r&&this.logger.log(`WebSocket error message: ${r}`)},e.onmessage=n=>{this.resetServerInactivityTimeout();const r=n.data.length;let s=F4(JSON.parse(n.data));if(this._logVerbose(`received ws message with type ${s.type}`),s.type==="Ping")return;if(s.type==="TransitionChunk"){const a=this.assembleTransition(s);if(!a)return;s=a,this._logVerbose(`assembled full ws message of type ${s.type}`)}this.transitionChunkBuffer!==null&&(this.transitionChunkBuffer=null,this.logger.log(`Received unexpected ${s.type} while buffering TransitionChunks`)),s.type==="Transition"&&this.reportLargeTransition({messageLength:r,transition:s}),this.onMessage(s).hasSyncedPastLastReconnect&&(this.retries=0,this.markConnectionStateDirty())},e.onclose=n=>{if(this._logVerbose("begin ws.onclose"),this.transitionChunkBuffer=null,this.lastCloseReason===null&&(this.lastCloseReason=n.reason||`closed with code ${n.code}`),n.code!==W1e&&n.code!==Y1e&&n.code!==K1e&&n.code!==X1e){let s=`WebSocket closed with code ${n.code}`;n.reason&&(s+=`: ${n.reason}`),this.logger.log(s),this.onServerDisconnectError&&n.reason&&this.onServerDisconnectError(s)}const r=Q1e(n.reason);this.scheduleReconnect(r)}}socketState(){return this.socket.state}sendMessage(e){const n={type:e.type,...e.type==="Authenticate"&&e.tokenType==="User"?{value:`...${e.value.slice(-7)}`}:{}};if(this.socket.state==="ready"&&this.socket.paused==="no"){const r=V1e(e),s=JSON.stringify(r);let i=!1;try{this.socket.ws.send(s),i=!0}catch(a){this.logger.log(`Failed to send message on WebSocket, reconnecting: ${a}`),this.closeAndReconnect("FailedToSendMessage")}return this._logVerbose(`${i?"sent":"failed to send"} message with type ${e.type}: ${JSON.stringify(n)}`),!0}return this._logVerbose(`message not sent (socket state: ${this.socket.state}, paused: ${"paused"in this.socket?this.socket.paused:void 0}): ${JSON.stringify(n)}`),!1}resetServerInactivityTimeout(){this.socket.state!=="terminated"&&(this.reconnectDueToServerInactivityTimeout!==null&&(clearTimeout(this.reconnectDueToServerInactivityTimeout),this.reconnectDueToServerInactivityTimeout=null),this.reconnectDueToServerInactivityTimeout=setTimeout(()=>{this.closeAndReconnect("InactiveServer")},this.serverInactivityThreshold))}scheduleReconnect(e){this.socket={state:"disconnected"};const n=this.nextBackoff(e);this.markConnectionStateDirty(),this.logger.log(`Attempting reconnect in ${Math.round(n)}ms`),setTimeout(()=>this.connect(),n)}closeAndReconnect(e){switch(this._logVerbose(`begin closeAndReconnect with reason ${e}`),this.socket.state){case"disconnected":case"terminated":case"stopped":return;case"connecting":case"ready":{this.lastCloseReason=e,this.close(),this.scheduleReconnect("client");return}default:this.socket}}close(){switch(this.transitionChunkBuffer=null,this.socket.state){case"disconnected":case"terminated":case"stopped":return Promise.resolve();case"connecting":{const e=this.socket.ws;return e.onmessage=n=>{this._logVerbose("Ignoring message received after close")},new Promise(n=>{e.onclose=()=>{this._logVerbose("Closed after connecting"),n()},e.onopen=()=>{this._logVerbose("Opened after connecting"),e.close()}})}case"ready":{this._logVerbose("ws.close called");const e=this.socket.ws;e.onmessage=r=>{this._logVerbose("Ignoring message received after close")};const n=new Promise(r=>{e.onclose=()=>{r()}});return e.close(),n}default:return this.socket,Promise.resolve()}}terminate(){switch(this.reconnectDueToServerInactivityTimeout&&clearTimeout(this.reconnectDueToServerInactivityTimeout),this.socket.state){case"terminated":case"stopped":case"disconnected":case"connecting":case"ready":{const e=this.close();return this.setSocketState({state:"terminated"}),e}default:throw this.socket,new Error(`Invalid websocket state: ${this.socket.state}`)}}stop(){switch(this.socket.state){case"terminated":return Promise.resolve();case"connecting":case"stopped":case"disconnected":case"ready":{const e=this.close();return this.socket={state:"stopped"},e}default:return this.socket,Promise.resolve()}}tryRestart(){switch(this.socket.state){case"stopped":break;case"terminated":case"connecting":case"ready":case"disconnected":this.logger.logVerbose("Restart called without stopping first");return;default:this.socket}this.connect()}pause(){switch(this.socket.state){case"disconnected":case"stopped":case"terminated":return;case"connecting":case"ready":{this.socket={...this.socket,paused:"yes"};return}default:{this.socket;return}}}resume(){switch(this.socket.state){case"connecting":this.socket={...this.socket,paused:"no"};return;case"ready":this.socket.paused==="uninitialized"?(this.socket={...this.socket,paused:"no"},this.onOpen({connectionCount:this.connectionCount,lastCloseReason:this.lastCloseReason,clientTs:ob()})):this.socket.paused==="yes"&&(this.socket={...this.socket,paused:"no"},this.onResume());return;case"terminated":case"stopped":case"disconnected":return;default:this.socket}this.connect()}connectionState(){return{isConnected:this.socket.state==="ready",hasEverConnected:this._hasEverConnected,connectionCount:this.connectionCount,connectionRetries:this.retries}}_logVerbose(e){this.logger.logVerbose(e)}nextBackoff(e){const r=(e==="client"?100:e==="Unknown"?this.defaultInitialBackoff:l7[e].timeout)*Math.pow(2,this.retries);this.retries+=1;const s=Math.min(r,this.maxBackoff),i=s*(Math.random()-.5);return s+i}reportLargeTransition({transition:e,messageLength:n}){if(e.clientClockSkew===void 0||e.serverTs===void 0)return;const r=ob()-e.clientClockSkew-e.serverTs/1e6,s=`${Math.round(r)}ms`,i=`${Math.round(n/1e4)/100}MB`,a=n/(r/1e3),l=`${Math.round(a/1e4)/100}MB per second`;this._logVerbose(`received ${i} transition in ${s} at ${l}`),n>2e7?this.logger.log(`received query results totaling more that 20MB (${i}) which will take a long time to download on slower connections`):r>2e4&&this.logger.log(`received query results totaling ${i} which took more than 20s to arrive (${s})`),this.debug&&this.sendMessage({type:"Event",eventType:"ClientReceivedTransition",event:{transitionTransitTime:r,messageLength:n}})}}function Z1e(){return eke()}function eke(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}class Yp extends Error{}Yp.prototype.name="InvalidTokenError";function tke(t){return decodeURIComponent(atob(t).replace(/(.)/g,(e,n)=>{let r=n.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}function nke(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return tke(e)}catch{return atob(e)}}function c7(t,e){if(typeof t!="string")throw new Yp("Invalid token specified: must be a string");e||(e={});const n=e.header===!0?0:1,r=t.split(".")[n];if(typeof r!="string")throw new Yp(`Invalid token specified: missing part #${n+1}`);let s;try{s=nke(r)}catch(i){throw new Yp(`Invalid token specified: invalid base64 for part #${n+1} (${i.message})`)}try{return JSON.parse(s)}catch(i){throw new Yp(`Invalid token specified: invalid json for part #${n+1} (${i.message})`)}}var rke=Object.defineProperty,ske=(t,e,n)=>e in t?rke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,vi=(t,e,n)=>ske(t,typeof e!="symbol"?e+"":e,n);const ike=20*24*60*60*1e3,B4=2;class ake{constructor(e,n,r){vi(this,"authState",{state:"noAuth"}),vi(this,"configVersion",0),vi(this,"syncState"),vi(this,"authenticate"),vi(this,"stopSocket"),vi(this,"tryRestartSocket"),vi(this,"pauseSocket"),vi(this,"resumeSocket"),vi(this,"clearAuth"),vi(this,"logger"),vi(this,"refreshTokenLeewaySeconds"),vi(this,"tokenConfirmationAttempts",0),this.syncState=e,this.authenticate=n.authenticate,this.stopSocket=n.stopSocket,this.tryRestartSocket=n.tryRestartSocket,this.pauseSocket=n.pauseSocket,this.resumeSocket=n.resumeSocket,this.clearAuth=n.clearAuth,this.logger=r.logger,this.refreshTokenLeewaySeconds=r.refreshTokenLeewaySeconds}async setConfig(e,n){this.resetAuthState(),this._logVerbose("pausing WS for auth token fetch"),this.pauseSocket();const r=await this.fetchTokenAndGuardAgainstRace(e,{forceRefreshToken:!1});r.isFromOutdatedConfig||(r.value?(this.setAuthState({state:"waitingForServerConfirmationOfCachedToken",config:{fetchToken:e,onAuthChange:n},hasRetried:!1}),this.authenticate(r.value)):(this.setAuthState({state:"initialRefetch",config:{fetchToken:e,onAuthChange:n}}),await this.refetchToken()),this._logVerbose("resuming WS after auth token fetch"),this.resumeSocket())}onTransition(e){if(this.syncState.isCurrentOrNewerAuthVersion(e.endVersion.identity)&&!(e.endVersion.identity<=e.startVersion.identity)){if(this.authState.state==="waitingForServerConfirmationOfCachedToken"){this._logVerbose("server confirmed auth token is valid"),this.refetchToken(),this.authState.config.onAuthChange(!0);return}this.authState.state==="waitingForServerConfirmationOfFreshToken"&&(this._logVerbose("server confirmed new auth token is valid"),this.scheduleTokenRefetch(this.authState.token),this.tokenConfirmationAttempts=0,this.authState.hadAuth||this.authState.config.onAuthChange(!0))}}onAuthError(e){if(e.authUpdateAttempted===!1&&(this.authState.state==="waitingForServerConfirmationOfFreshToken"||this.authState.state==="waitingForServerConfirmationOfCachedToken")){this._logVerbose("ignoring non-auth token expired error");return}const{baseVersion:n}=e;if(!this.syncState.isCurrentOrNewerAuthVersion(n+1)){this._logVerbose("ignoring auth error for previous auth attempt");return}this.tryToReauthenticate(e)}async tryToReauthenticate(e){if(this._logVerbose(`attempting to reauthenticate: ${e.error}`),this.authState.state==="noAuth"||this.authState.state==="waitingForServerConfirmationOfFreshToken"&&this.tokenConfirmationAttempts>=B4){this.logger.error(`Failed to authenticate: "${e.error}", check your server auth config`),this.syncState.hasAuth()&&this.syncState.clearAuth(),this.authState.state!=="noAuth"&&this.setAndReportAuthFailed(this.authState.config.onAuthChange);return}this.authState.state==="waitingForServerConfirmationOfFreshToken"&&(this.tokenConfirmationAttempts++,this._logVerbose(`retrying reauthentication, ${B4-this.tokenConfirmationAttempts} attempts remaining`)),await this.stopSocket();const n=await this.fetchTokenAndGuardAgainstRace(this.authState.config.fetchToken,{forceRefreshToken:!0});n.isFromOutdatedConfig||(n.value&&this.syncState.isNewAuth(n.value)?(this.authenticate(n.value),this.setAuthState({state:"waitingForServerConfirmationOfFreshToken",config:this.authState.config,token:n.value,hadAuth:this.authState.state==="notRefetching"||this.authState.state==="waitingForScheduledRefetch"})):(this._logVerbose("reauthentication failed, could not fetch a new token"),this.syncState.hasAuth()&&this.syncState.clearAuth(),this.setAndReportAuthFailed(this.authState.config.onAuthChange)),this.tryRestartSocket())}async refetchToken(){if(this.authState.state==="noAuth")return;this._logVerbose("refetching auth token");const e=await this.fetchTokenAndGuardAgainstRace(this.authState.config.fetchToken,{forceRefreshToken:!0});e.isFromOutdatedConfig||(e.value?this.syncState.isNewAuth(e.value)?(this.setAuthState({state:"waitingForServerConfirmationOfFreshToken",hadAuth:this.syncState.hasAuth(),token:e.value,config:this.authState.config}),this.authenticate(e.value)):this.setAuthState({state:"notRefetching",config:this.authState.config}):(this._logVerbose("refetching token failed"),this.syncState.hasAuth()&&this.clearAuth(),this.setAndReportAuthFailed(this.authState.config.onAuthChange)),this._logVerbose("restarting WS after auth token fetch (if currently stopped)"),this.tryRestartSocket())}scheduleTokenRefetch(e){if(this.authState.state==="noAuth")return;const n=this.decodeToken(e);if(!n){this.logger.error("Auth token is not a valid JWT, cannot refetch the token");return}const{iat:r,exp:s}=n;if(!r||!s){this.logger.error("Auth token does not have required fields, cannot refetch the token");return}const i=s-r;if(i<=2){this.logger.error("Auth token does not live long enough, cannot refetch the token");return}let a=Math.min(ike,(i-this.refreshTokenLeewaySeconds)*1e3);a<=0&&(this.logger.warn(`Refetching auth token immediately, configured leeway ${this.refreshTokenLeewaySeconds}s is larger than the token's lifetime ${i}s`),a=0);const l=setTimeout(()=>{this._logVerbose("running scheduled token refetch"),this.refetchToken()},a);this.setAuthState({state:"waitingForScheduledRefetch",refetchTokenTimeoutId:l,config:this.authState.config}),this._logVerbose(`scheduled preemptive auth token refetching in ${a}ms`)}async fetchTokenAndGuardAgainstRace(e,n){const r=++this.configVersion;this._logVerbose(`fetching token with config version ${r}`);const s=await e(n);return this.configVersion!==r?(this._logVerbose(`stale config version, expected ${r}, got ${this.configVersion}`),{isFromOutdatedConfig:!0}):{isFromOutdatedConfig:!1,value:s}}stop(){this.resetAuthState(),this.configVersion++,this._logVerbose(`config version bumped to ${this.configVersion}`)}setAndReportAuthFailed(e){e(!1),this.resetAuthState()}resetAuthState(){this.setAuthState({state:"noAuth"})}setAuthState(e){const n=e.state==="waitingForServerConfirmationOfFreshToken"?{hadAuth:e.hadAuth,state:e.state,token:`...${e.token.slice(-7)}`}:{state:e.state};switch(this._logVerbose(`setting auth state to ${JSON.stringify(n)}`),e.state){case"waitingForScheduledRefetch":case"notRefetching":case"noAuth":this.tokenConfirmationAttempts=0;break}this.authState.state==="waitingForScheduledRefetch"&&(clearTimeout(this.authState.refetchTokenTimeoutId),this.syncState.markAuthCompletion()),this.authState=e}decodeToken(e){try{return c7(e)}catch(n){return this._logVerbose(`Error decoding token: ${n instanceof Error?n.message:"Unknown error"}`),null}}_logVerbose(e){this.logger.logVerbose(`${e} [v${this.configVersion}]`)}}const oke=["convexClientConstructed","convexWebSocketOpen","convexFirstMessageReceived"];function lke(t,e){const n={sessionId:e};typeof performance>"u"||!performance.mark||performance.mark(t,{detail:n})}function cke(t){let e=t.name.slice(6);return e=e.charAt(0).toLowerCase()+e.slice(1),{name:e,startTime:t.startTime}}function uke(t){if(typeof performance>"u"||!performance.getEntriesByName)return[];const e=[];for(const n of oke){const r=performance.getEntriesByName(n).filter(s=>s.entryType==="mark").filter(s=>s.detail.sessionId===t);e.push(...r)}return e.map(cke)}var dke=Object.defineProperty,fke=(t,e,n)=>e in t?dke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,fr=(t,e,n)=>fke(t,typeof e!="symbol"?e+"":e,n);class hke{constructor(e,n,r){if(fr(this,"address"),fr(this,"state"),fr(this,"requestManager"),fr(this,"webSocketManager"),fr(this,"authenticationManager"),fr(this,"remoteQuerySet"),fr(this,"optimisticQueryResults"),fr(this,"_transitionHandlerCounter",0),fr(this,"_nextRequestId"),fr(this,"_onTransitionFns",new Map),fr(this,"_sessionId"),fr(this,"firstMessageReceived",!1),fr(this,"debug"),fr(this,"logger"),fr(this,"maxObservedTimestamp"),fr(this,"connectionStateSubscribers",new Map),fr(this,"nextConnectionStateSubscriberId",0),fr(this,"_lastPublishedConnectionState"),fr(this,"markConnectionStateDirty",()=>{Promise.resolve().then(()=>{const v=this.connectionState();if(JSON.stringify(v)!==JSON.stringify(this._lastPublishedConnectionState)){this._lastPublishedConnectionState=v;for(const b of this.connectionStateSubscribers.values())b(v)}})}),fr(this,"mark",v=>{this.debug&&lke(v,this.sessionId)}),typeof e=="object")throw new Error("Passing a ClientConfig object is no longer supported. Pass the URL of the Convex deployment as a string directly.");r?.skipConvexDeploymentUrlCheck!==!0&&l1e(e),r={...r};const s=r.authRefreshTokenLeewaySeconds??2;let i=r.webSocketConstructor;if(!i&&typeof WebSocket>"u")throw new Error("No WebSocket global variable defined! To use Convex in an environment without WebSocket try the HTTP client: https://docs.convex.dev/api/classes/browser.ConvexHttpClient");i=i||WebSocket,this.debug=r.reportDebugInfoToConvex??!1,this.address=e,this.logger=r.logger===!1?a7({verbose:r.verbose??!1}):r.logger!==!0&&r.logger?r.logger:i7({verbose:r.verbose??!1});const a=e.search("://");if(a===-1)throw new Error("Provided address was not an absolute URL.");const l=e.substring(a+3),u=e.substring(0,a);let d;if(u==="http")d="ws";else if(u==="https")d="wss";else throw new Error(`Unknown parent protocol ${u}`);const p=`${d}://${l}/api/${I4}/sync`;this.state=new T1e,this.remoteQuerySet=new z4(v=>this.state.queryPath(v),this.logger),this.requestManager=new N1e(this.logger,this.markConnectionStateDirty);const h=()=>{this.webSocketManager.pause(),this.state.pause()};this.authenticationManager=new ake(this.state,{authenticate:v=>{const b=this.state.setAuth(v);return this.webSocketManager.sendMessage(b),b.baseVersion},stopSocket:()=>this.webSocketManager.stop(),tryRestartSocket:()=>this.webSocketManager.tryRestart(),pauseSocket:h,resumeSocket:()=>this.webSocketManager.resume(),clearAuth:()=>{this.clearAuth()}},{logger:this.logger,refreshTokenLeewaySeconds:s}),this.optimisticQueryResults=new D1e,this.addOnTransitionHandler(v=>{n(v.queries.map(b=>b.token))}),this._nextRequestId=0,this._sessionId=Z1e();const{unsavedChangesWarning:g}=r;if(typeof window>"u"||typeof window.addEventListener>"u"){if(g===!0)throw new Error("unsavedChangesWarning requested, but window.addEventListener not found! Remove {unsavedChangesWarning: true} from Convex client options.")}else g!==!1&&window.addEventListener("beforeunload",v=>{if(this.requestManager.hasIncompleteRequests()){v.preventDefault();const b="Are you sure you want to leave? Your changes may not be saved.";return(v||window.event).returnValue=b,b}});this.webSocketManager=new J1e(p,{onOpen:v=>{this.mark("convexWebSocketOpen"),this.webSocketManager.sendMessage({...v,type:"Connect",sessionId:this._sessionId,maxObservedTimestamp:this.maxObservedTimestamp});const b=new Set(this.remoteQuerySet.remoteQueryResults().keys());this.remoteQuerySet=new z4(S=>this.state.queryPath(S),this.logger);const[x,E]=this.state.restart(b);E&&this.webSocketManager.sendMessage(E),this.webSocketManager.sendMessage(x);for(const S of this.requestManager.restart())this.webSocketManager.sendMessage(S)},onResume:()=>{const[v,b]=this.state.resume();b&&this.webSocketManager.sendMessage(b),v&&this.webSocketManager.sendMessage(v);for(const x of this.requestManager.resume())this.webSocketManager.sendMessage(x)},onMessage:v=>{switch(this.firstMessageReceived||(this.firstMessageReceived=!0,this.mark("convexFirstMessageReceived"),this.reportMarks()),v.type){case"Transition":{this.observedTimestamp(v.endVersion.ts),this.authenticationManager.onTransition(v),this.remoteQuerySet.transition(v),this.state.transition(v);const b=this.requestManager.removeCompleted(this.remoteQuerySet.timestamp());this.notifyOnQueryResultChanges(b);break}case"MutationResponse":{v.success&&this.observedTimestamp(v.ts);const b=this.requestManager.onResponse(v);b!==null&&this.notifyOnQueryResultChanges(new Map([[b.requestId,b.result]]));break}case"ActionResponse":{this.requestManager.onResponse(v);break}case"AuthError":{this.authenticationManager.onAuthError(v);break}case"FatalError":{const b=S1e(this.logger,v.error);throw this.webSocketManager.terminate(),b}}return{hasSyncedPastLastReconnect:this.hasSyncedPastLastReconnect()}},onServerDisconnectError:r.onServerDisconnectError},i,this.logger,this.markConnectionStateDirty,this.debug),this.mark("convexClientConstructed"),r.expectAuth&&h()}hasSyncedPastLastReconnect(){return this.requestManager.hasSyncedPastLastReconnect()||this.state.hasSyncedPastLastReconnect()}observedTimestamp(e){(this.maxObservedTimestamp===void 0||this.maxObservedTimestamp.lessThanOrEqual(e))&&(this.maxObservedTimestamp=e)}getMaxObservedTimestamp(){return this.maxObservedTimestamp}notifyOnQueryResultChanges(e){const n=this.remoteQuerySet.remoteQueryResults(),r=new Map;for(const[i,a]of n){const l=this.state.queryToken(i);if(l!==null){const u={result:a,udfPath:this.state.queryPath(i),args:this.state.queryArgs(i)};r.set(l,u)}}const s=this.optimisticQueryResults.ingestQueryResultsFromServer(r,new Set(e.keys()));this.handleTransition({queries:s.map(i=>{const a=this.optimisticQueryResults.rawQueryResult(i);return{token:i,modification:{kind:"Updated",result:a.result}}}),reflectedMutations:Array.from(e).map(([i,a])=>({requestId:i,result:a})),timestamp:this.remoteQuerySet.timestamp()})}handleTransition(e){for(const n of this._onTransitionFns.values())n(e)}addOnTransitionHandler(e){const n=this._transitionHandlerCounter++;return this._onTransitionFns.set(n,e),()=>this._onTransitionFns.delete(n)}getCurrentAuthClaims(){const e=this.state.getAuth();let n={};if(e&&e.tokenType==="User")try{n=e?c7(e.value):{}}catch{n={}}else return;return{token:e.value,decoded:n}}setAuth(e,n){this.authenticationManager.setConfig(e,n)}hasAuth(){return this.state.hasAuth()}setAdminAuth(e,n){const r=this.state.setAdminAuth(e,n);this.webSocketManager.sendMessage(r)}clearAuth(){const e=this.state.clearAuth();this.webSocketManager.sendMessage(e)}subscribe(e,n,r){const s=So(n),{modification:i,queryToken:a,unsubscribe:l}=this.state.subscribe(e,s,r?.journal,r?.componentPath);return i!==null&&this.webSocketManager.sendMessage(i),{queryToken:a,unsubscribe:()=>{const u=l();u&&this.webSocketManager.sendMessage(u)}}}localQueryResult(e,n){const r=So(n),s=iu(e,r);return this.optimisticQueryResults.queryResult(s)}localQueryResultByToken(e){return this.optimisticQueryResults.queryResult(e)}hasLocalQueryResultByToken(e){return this.optimisticQueryResults.hasQueryResult(e)}localQueryLogs(e,n){const r=So(n),s=iu(e,r);return this.optimisticQueryResults.queryLogs(s)}queryJournal(e,n){const r=So(n),s=iu(e,r);return this.state.queryJournal(s)}connectionState(){const e=this.webSocketManager.connectionState();return{hasInflightRequests:this.requestManager.hasInflightRequests(),isWebSocketConnected:e.isConnected,hasEverConnected:e.hasEverConnected,connectionCount:e.connectionCount,connectionRetries:e.connectionRetries,timeOfOldestInflightRequest:this.requestManager.timeOfOldestInflightRequest(),inflightMutations:this.requestManager.inflightMutations(),inflightActions:this.requestManager.inflightActions()}}subscribeToConnectionState(e){const n=this.nextConnectionStateSubscriberId++;return this.connectionStateSubscribers.set(n,e),()=>{this.connectionStateSubscribers.delete(n)}}async mutation(e,n,r){const s=await this.mutationInternal(e,n,r);if(!s.success)throw s.errorData!==void 0?TC(s,new kC(Xd("mutation",e,s))):new Error(Xd("mutation",e,s));return s.value}async mutationInternal(e,n,r,s){const{mutationPromise:i}=this.enqueueMutation(e,n,r,s);return i}enqueueMutation(e,n,r,s){const i=So(n);this.tryReportLongDisconnect();const a=this.nextRequestId;if(this._nextRequestId++,r!==void 0){const p=r.optimisticUpdate;if(p!==void 0){const h=b=>{p(b,i)instanceof Promise&&this.logger.warn("Optimistic update handler returned a Promise. Optimistic updates should be synchronous.")},v=this.optimisticQueryResults.applyOptimisticUpdate(h,a).map(b=>{const x=this.localQueryResultByToken(b);return{token:b,modification:{kind:"Updated",result:x===void 0?void 0:{success:!0,value:x,logLines:[]}}}});this.handleTransition({queries:v,reflectedMutations:[],timestamp:this.remoteQuerySet.timestamp()})}}const l={type:"Mutation",requestId:a,udfPath:e,componentPath:s,args:[Ql(i)]},u=this.webSocketManager.sendMessage(l),d=this.requestManager.request(l,u);return{requestId:a,mutationPromise:d}}async action(e,n){const r=await this.actionInternal(e,n);if(!r.success)throw r.errorData!==void 0?TC(r,new kC(Xd("action",e,r))):new Error(Xd("action",e,r));return r.value}async actionInternal(e,n,r){const s=So(n),i=this.nextRequestId;this._nextRequestId++,this.tryReportLongDisconnect();const a={type:"Action",requestId:i,udfPath:e,componentPath:r,args:[Ql(s)]},l=this.webSocketManager.sendMessage(a);return this.requestManager.request(a,l)}async close(){return this.authenticationManager.stop(),this.webSocketManager.terminate()}get url(){return this.address}get nextRequestId(){return this._nextRequestId}get sessionId(){return this._sessionId}reportMarks(){if(this.debug){const e=uke(this.sessionId);this.webSocketManager.sendMessage({type:"Event",eventType:"ClientConnect",event:e})}}tryReportLongDisconnect(){if(!this.debug)return;const e=this.connectionState().timeOfOldestInflightRequest;if(e===null||Date.now()-e.getTime()<=60*1e3)return;const n=`${this.address}/api/debug_event`;fetch(n,{method:"POST",headers:{"Content-Type":"application/json","Convex-Client":`npm-${I4}`},body:JSON.stringify({event:"LongWebsocketDisconnect"})}).then(r=>{r.ok||this.logger.warn("Analytics request failed with response:",r.body)}).catch(r=>{this.logger.warn("Analytics response failed with error:",r)})}}function pke({getCurrentValue:t,subscribe:e}){const[n,r]=w.useState(()=>({getCurrentValue:t,subscribe:e,value:t()}));let s=n.value;return(n.getCurrentValue!==t||n.subscribe!==e)&&(s=t(),r({getCurrentValue:t,subscribe:e,value:s})),w.useEffect(()=>{let i=!1;const a=()=>{i||r(u=>{if(u.getCurrentValue!==t||u.subscribe!==e)return u;const d=t();return u.value===d?u:{...u,value:d}})},l=e(a);return a(),()=>{i=!0,l()}},[t,e]),s}var mke=Object.defineProperty,gke=(t,e,n)=>e in t?mke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,_l=(t,e,n)=>gke(t,typeof e!="symbol"?e+"":e,n);const vke=5e3;if(typeof Ee>"u")throw new Error("Required dependency 'react' not found");function u7(t,e,n){function r(s){return Ske(s),e.mutation(t,s,{optimisticUpdate:n})}return r.withOptimisticUpdate=function(i){if(n!==void 0)throw new Error(`Already specified optimistic update for mutation ${Ps(t)}`);return u7(t,e,i)},r}function yke(t,e){return function(n){return e.action(t,n)}}class bke{constructor(e,n){if(_l(this,"address"),_l(this,"cachedSync"),_l(this,"listeners"),_l(this,"options"),_l(this,"closed",!1),_l(this,"_logger"),_l(this,"adminAuth"),_l(this,"fakeUserIdentity"),e===void 0)throw new Error("No address provided to ConvexReactClient.\nIf trying to deploy to production, make sure to follow all the instructions found at https://docs.convex.dev/production/hosting/\nIf running locally, make sure to run `convex dev` and ensure the .env.local file is populated.");if(typeof e!="string")throw new Error(`ConvexReactClient requires a URL like 'https://happy-otter-123.convex.cloud', received something of type ${typeof e} instead.`);if(!e.includes("://"))throw new Error("Provided address was not an absolute URL.");this.address=e,this.listeners=new Map,this._logger=n?.logger===!1?a7({verbose:n?.verbose??!1}):n?.logger!==!0&&n?.logger?n.logger:i7({verbose:n?.verbose??!1}),this.options={...n,logger:this._logger}}get url(){return this.address}get sync(){if(this.closed)throw new Error("ConvexReactClient has already been closed.");return this.cachedSync?this.cachedSync:(this.cachedSync=new hke(this.address,e=>this.transition(e),this.options),this.adminAuth&&this.cachedSync.setAdminAuth(this.adminAuth,this.fakeUserIdentity),this.cachedSync)}setAuth(e,n){if(typeof e=="string")throw new Error("Passing a string to ConvexReactClient.setAuth is no longer supported, please upgrade to passing in an async function to handle reauthentication.");this.sync.setAuth(e,n??(()=>{}))}clearAuth(){this.sync.clearAuth()}setAdminAuth(e,n){if(this.adminAuth=e,this.fakeUserIdentity=n,this.closed)throw new Error("ConvexReactClient has already been closed.");this.cachedSync&&this.sync.setAdminAuth(e,n)}watchQuery(e,...n){const[r,s]=n,i=Ps(e);return{onUpdate:a=>{const{queryToken:l,unsubscribe:u}=this.sync.subscribe(i,r,s),d=this.listeners.get(l);return d!==void 0?d.add(a):this.listeners.set(l,new Set([a])),()=>{if(this.closed)return;const p=this.listeners.get(l);p.delete(a),p.size===0&&this.listeners.delete(l),u()}},localQueryResult:()=>{if(this.cachedSync)return this.cachedSync.localQueryResult(i,r)},localQueryLogs:()=>{if(this.cachedSync)return this.cachedSync.localQueryLogs(i,r)},journal:()=>{if(this.cachedSync)return this.cachedSync.queryJournal(i,r)}}}prewarmQuery(e){const n=e.extendSubscriptionFor??vke,s=this.watchQuery(e.query,e.args||{}).onUpdate(()=>{});setTimeout(s,n)}mutation(e,...n){const[r,s]=n,i=Ps(e);return this.sync.mutation(i,r,s)}action(e,...n){const r=Ps(e);return this.sync.action(r,...n)}query(e,...n){const r=this.watchQuery(e,...n),s=r.localQueryResult();return s!==void 0?Promise.resolve(s):new Promise((i,a)=>{const l=r.onUpdate(()=>{l();try{i(r.localQueryResult())}catch(u){a(u)}})})}connectionState(){return this.sync.connectionState()}subscribeToConnectionState(e){return this.sync.subscribeToConnectionState(e)}get logger(){return this._logger}async close(){if(this.closed=!0,this.listeners=new Map,this.cachedSync){const e=this.cachedSync;this.cachedSync=void 0,await e.close()}}transition(e){for(const n of e){const r=this.listeners.get(n);if(r)for(const s of r)s()}}}const G0=Ee.createContext(void 0);function xke(){return w.useContext(G0)}const _ke=({client:t,children:e})=>Ee.createElement(G0.Provider,{value:t},e);function Sx(t,...e){const n=e[0]==="skip",r=e[0]==="skip"?{}:So(e[0]),s=typeof t=="string"?rj(t):t,i=Ps(s),a=w.useMemo(()=>n?{}:{query:{query:s,args:r}},[JSON.stringify(Ql(r)),i,n]),u=Cke(a).query;if(u instanceof Error)throw u;return u}function d7(t){const e=typeof t=="string"?rj(t):t,n=w.useContext(G0);if(n===void 0)throw new Error("Could not find Convex client! `useMutation` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app");return w.useMemo(()=>u7(e,n),[n,Ps(e)])}function wke(t){const e=w.useContext(G0),n=rj(t);if(e===void 0)throw new Error("Could not find Convex client! `useAction` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app");return w.useMemo(()=>yke(n,e),[e,Ps(n)])}function Ske(t){if(typeof t=="object"&&t!==null&&"bubbles"in t&&"persist"in t&&"isDefaultPrevented"in t)throw new Error("Convex function called with SyntheticEvent object. Did you use a Convex function as an event handler directly? Event handlers like onClick receive an event object as their first argument. These SyntheticEvent objects are not valid Convex values. Try wrapping the function like `const handler = () => myMutation();` and using `handler` in the event handler.")}var Eke=Object.defineProperty,kke=(t,e,n)=>e in t?Eke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,$1=(t,e,n)=>kke(t,typeof e!="symbol"?e+"":e,n);class Tke{constructor(e){$1(this,"createWatch"),$1(this,"queries"),$1(this,"listeners"),this.createWatch=e,this.queries={},this.listeners=new Set}setQueries(e){for(const n of Object.keys(e)){const{query:r,args:s}=e[n];if(Ps(r),this.queries[n]===void 0)this.addQuery(n,r,s);else{const i=this.queries[n];(Ps(r)!==Ps(i.query)||JSON.stringify(Ql(s))!==JSON.stringify(Ql(i.args)))&&(this.removeQuery(n),this.addQuery(n,r,s))}}for(const n of Object.keys(this.queries))e[n]===void 0&&this.removeQuery(n)}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}getLocalResults(e){const n={};for(const r of Object.keys(e)){const{query:s,args:i}=e[r];Ps(s);const a=this.createWatch(s,i);let l;try{l=a.localQueryResult()}catch(u){if(u instanceof Error)l=u;else throw u}n[r]=l}return n}setCreateWatch(e){this.createWatch=e;for(const n of Object.keys(this.queries)){const{query:r,args:s,watch:i}=this.queries[n],a=i.journal();this.removeQuery(n),this.addQuery(n,r,s,a)}}destroy(){for(const e of Object.keys(this.queries))this.removeQuery(e);this.listeners=new Set}addQuery(e,n,r,s){if(this.queries[e]!==void 0)throw new Error(`Tried to add a new query with identifier ${e} when it already exists.`);const i=this.createWatch(n,r,s),a=i.onUpdate(()=>this.notifyListeners());this.queries[e]={query:n,args:r,watch:i,unsubscribe:a}}removeQuery(e){const n=this.queries[e];if(n===void 0)throw new Error(`No query found with identifier ${e}.`);n.unsubscribe(),delete this.queries[e]}notifyListeners(){for(const e of this.listeners)e()}}function Cke(t){const e=xke();if(e===void 0)throw new Error("Could not find Convex client! `useQuery` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app");const n=w.useMemo(()=>(r,s,i)=>e.watchQuery(r,s,i?{journal:i}:{}),[e]);return Ake(t,n)}function Ake(t,e){const[n]=w.useState(()=>new Tke(e));n.createWatch!==e&&n.setCreateWatch(e),w.useEffect(()=>()=>n.destroy(),[n]);const r=w.useMemo(()=>({getCurrentValue:()=>n.getLocalResults(t),subscribe:s=>(n.setQueries(t),n.subscribe(s))}),[n,t]);return pke(r)}const f7=w.createContext(void 0);function Xa(){const t=w.useContext(f7);if(t===void 0)throw new Error("Could not find `ConvexProviderWithAuth` (or `ConvexProviderWithClerk` or `ConvexProviderWithAuth0`) as an ancestor component. This component may be missing, or you might have two instances of the `convex/react` module loaded in your project.");return t}function Nke({children:t,client:e,useAuth:n}){const{isLoading:r,isAuthenticated:s,fetchAccessToken:i}=n(),[a,l]=w.useState(null);return r&&a!==null&&l(null),!r&&!s&&a!==!1&&l(!1),Ee.createElement(f7.Provider,{value:{isLoading:a===null,isAuthenticated:s&&(a??!1)}},Ee.createElement(Rke,{authProviderAuthenticated:s,fetchAccessToken:i,authProviderLoading:r,client:e,setIsConvexAuthenticated:l}),Ee.createElement(_ke,{client:e},t),Ee.createElement(jke,{authProviderAuthenticated:s,fetchAccessToken:i,authProviderLoading:r,client:e,setIsConvexAuthenticated:l}))}function Rke({authProviderAuthenticated:t,fetchAccessToken:e,authProviderLoading:n,client:r,setIsConvexAuthenticated:s}){return w.useEffect(()=>{let i=!0;if(t)return r.setAuth(e,a=>{i&&s(()=>a)}),()=>{i=!1,s(a=>a?!1:null)}},[t,e,n,r,s]),null}function jke({authProviderAuthenticated:t,fetchAccessToken:e,authProviderLoading:n,client:r,setIsConvexAuthenticated:s}){return w.useEffect(()=>{if(t)return()=>{r.clearAuth(),s(()=>null)}},[t,e,n,r,s]),null}const Mke=t=>{const e=new Map;return t.forEach(n=>{const r=e.get(n.provider)||[];e.set(n.provider,[...r,n])}),e},q4=t=>{switch(t){case"anthropic":return"Anthropic";case"openai":return"OpenAI";case"deepseek":return"DeepSeek";case"google":return"Google AI";case"ollama":return"Ollama";case"meta":return"Meta";case"x-ai":return"xAI";default:return t}};function h7({currentModel:t,availableModels:e,onModelChange:n,disabled:r,isLoading:s,hideProvidedModels:i=!1}){const[a,l]=w.useState(!1),u=t,{isAuthenticated:d}=Xa(),p=Mke(e),h=Array.from(p.keys()).sort(),g=i?[]:h.filter(b=>(p.get(b)||[]).some(E=>ea(E.id))),v=h.filter(b=>(p.get(b)||[]).some(E=>!ea(E.id)));return f.jsxs(p0,{open:a,onOpenChange:l,children:[f.jsx(m0,{asChild:!0,children:f.jsx(Ie,{variant:"ghost",size:"sm",disabled:r||s,className:"h-8 px-2 rounded-full hover:bg-muted/80 transition-colors text-xs cursor-pointer",children:f.jsxs(f.Fragment,{children:[f.jsx(M1,{provider:u.provider}),f.jsx("span",{className:"text-[10px] font-medium",children:u.name})]})})}),f.jsxs(g0,{align:"start",className:"min-w-[200px]",children:[g.length>0&&f.jsx("div",{className:"px-2 py-1 text-[10px] uppercase tracking-wide text-muted-foreground",children:"MCPJam Provided Models"}),g.map(b=>{const E=(p.get(b)||[]).filter(k=>ea(k.id)),S=E.length;return f.jsxs(fI,{children:[f.jsxs(hI,{className:"flex items-center gap-3 text-sm cursor-pointer",children:[f.jsx(M1,{provider:b}),f.jsxs("div",{className:"flex flex-col flex-1",children:[f.jsx("span",{className:"font-medium",children:q4(b)}),f.jsxs("span",{className:"text-xs text-muted-foreground",children:[S," model",S!==1?"s":""]})]})]}),f.jsx(pI,{className:"min-w-[200px] max-h-[180px] overflow-y-auto",avoidCollisions:!0,collisionPadding:8,children:E.map(k=>{const T=ea(k.id),R=!!k.disabled||T&&!d,j=T&&!d?"Sign in to use MCPJam provided models":k.disabledReason,A=f.jsxs(To,{onSelect:()=>{n(k),l(!1)},className:"flex items-center gap-3 text-sm cursor-pointer",disabled:R,children:[f.jsx("div",{className:"flex flex-col flex-1",children:f.jsx("span",{className:"font-medium",children:k.name})}),k.id===t.id&&f.jsx("div",{className:"ml-auto w-2 h-2 bg-primary rounded-full"})]},k.id);return R?f.jsxs(Ma,{children:[f.jsx(Oa,{asChild:!0,children:f.jsx("div",{className:"pointer-events-auto",children:A})}),f.jsx(Pa,{side:"right",children:j})]},k.id):A})})]},b)}),g.length>0&&v.length>0&&f.jsx("div",{className:"my-1 h-px bg-muted/50"}),v.length>0&&f.jsx("div",{className:"px-2 py-1 text-[10px] uppercase tracking-wide text-muted-foreground",children:"Your providers"}),v.map(b=>{const E=(p.get(b)||[]).filter(k=>!ea(k.id)),S=E.length;return f.jsxs(fI,{children:[f.jsxs(hI,{className:"flex items-center gap-3 text-sm cursor-pointer",children:[f.jsx(M1,{provider:b}),f.jsxs("div",{className:"flex flex-col flex-1",children:[f.jsx("span",{className:"font-medium",children:q4(b)}),f.jsxs("span",{className:"text-xs text-muted-foreground",children:[S," model",S!==1?"s":""]})]})]}),f.jsx(pI,{className:"min-w-[200px] max-h-[180px] overflow-y-auto",avoidCollisions:!0,collisionPadding:8,children:E.map(k=>{const T=!!k.disabled,R=f.jsxs(To,{onSelect:()=>{n(k),l(!1)},className:"flex items-center gap-3 text-sm cursor-pointer",disabled:T,children:[f.jsx("div",{className:"flex flex-col flex-1",children:f.jsx("span",{className:"font-medium",children:k.name})}),k.id===t.id&&f.jsx("div",{className:"ml-auto w-2 h-2 bg-primary rounded-full"})]},k.id);return T?f.jsxs(Ma,{children:[f.jsx(Oa,{asChild:!0,children:f.jsx("div",{className:"pointer-events-auto",children:R})}),f.jsx(Pa,{side:"right",children:k.disabledReason})]},k.id):R})})]},b)})]})]})}function Oke({className:t,defaultValue:e,value:n,min:r=0,max:s=100,...i}){const a=w.useMemo(()=>Array.isArray(n)?n:Array.isArray(e)?e:[r,s],[n,e,r,s]);return f.jsxs(rre,{"data-slot":"slider",defaultValue:e,value:n,min:r,max:s,className:Me("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",t),...i,children:[f.jsx(sre,{"data-slot":"slider-track",className:Me("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:f.jsx(ire,{"data-slot":"slider-range",className:Me("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:a.length},(l,u)=>f.jsx(are,{"data-slot":"slider-thumb",className:"border-primary bg-background ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},u))]})}function Pke({systemPrompt:t,onSystemPromptChange:e,temperature:n,onTemperatureChange:r,disabled:s,isLoading:i}){const[a,l]=w.useState(!1),[u,d]=w.useState(t),[p,h]=w.useState(n),g=x=>{l(x),x&&(d(t),h(n))},v=()=>{e(u),r(p),l(!1),It.success("System prompt and temperature updated")},b=()=>{d(t),h(n),l(!1)};return f.jsxs(aa,{open:a,onOpenChange:g,children:[f.jsx(eN,{asChild:!0,children:f.jsxs(Ie,{variant:"ghost",size:"sm",disabled:s||i,className:"h-8 px-2 rounded-full hover:bg-muted/80 transition-colors text-xs cursor-pointer",children:[f.jsx(lie,{className:"h-2 w-2 mr-1"}),f.jsx("span",{className:"text-[10px] font-medium",children:"System Prompt & Temperature"})]})}),f.jsxs(oa,{className:"sm:max-w-md",children:[f.jsx(la,{children:f.jsx(ca,{children:"System Prompt & Temperature"})}),f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx("label",{className:"text-sm font-medium",children:"System Prompt"}),f.jsx(Ho,{value:u,onChange:x=>d(x.target.value),placeholder:"You are a helpful assistant with access to MCP tools.",className:"h-[140px] resize-none"})]}),f.jsxs("div",{className:"space-y-3",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("label",{className:"text-sm font-medium",children:"Temperature"}),f.jsx("span",{className:"text-sm text-muted-foreground",children:p.toFixed(1)})]}),f.jsx(Oke,{value:[p],onValueChange:x=>h(x[0]),min:0,max:2,step:.1,className:"w-full"}),f.jsx("p",{className:"text-xs text-muted-foreground",children:"Lower values (0-0.3) for focused tasks, higher values (0.7-2.0) for creative tasks"})]}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(Ie,{variant:"ghost",onClick:b,className:"cursor-pointer",children:"Cancel"}),f.jsx(Ie,{onClick:v,className:"cursor-pointer",children:"Save"})]})]})]})]})}function V4({value:t,onChange:e,onSubmit:n,onStop:r,disabled:s=!1,isLoading:i=!1,placeholder:a="Type your message...",className:l,showScrollToBottom:u=!1,onScrollToBottom:d,currentModel:p,availableModels:h,onModelChange:g,systemPrompt:v,onSystemPromptChange:b,temperature:x,onTemperatureChange:E,isSendBlocked:S=!1}){const k=w.useRef(null),T=w.useRef(null),[R,j]=w.useState([]),[A,N]=w.useState([]),M=p;w.useEffect(()=>{I()},[t]);const I=()=>{k.current&&(k.current.style.height="auto",k.current.style.height=`${Math.min(k.current.scrollHeight,120)}px`)},O=()=>{k.current&&(k.current.style.height="auto")},L=w.useCallback(()=>{!t.trim()||s||i||A.length>0||S||(n(t.trim(),R.length>0?R:void 0),e(""),j([]),O(),setTimeout(()=>{k.current?.focus()},0))},[t,s,i,A.length,n,R,e,S]),z=X=>{X.key==="Enter"&&!X.shiftKey&&!X.nativeEvent.isComposing&&(X.preventDefault(),L())},G=w.useCallback(async X=>{const F=Array.from(X.target.files||[]);if(F.length!==0){N(F.map(Y=>Y.name));try{const Y=await Promise.all(F.map(async H=>(await new Promise(te=>setTimeout(te,1e3)),{id:Math.random().toString(36).substr(2,9),name:H.name,url:URL.createObjectURL(H),contentType:H.type,size:H.size})));j(H=>[...H,...Y])}catch(Y){console.error("Error uploading files:",Y)}finally{N([]),T.current&&(T.current.value="")}}},[]),W=X=>{j(F=>F.filter(Y=>Y.id!==X))};return f.jsxs("div",{className:"relative w-full",children:[f.jsx(hx,{children:u&&f.jsx(ei.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},className:"absolute left-1/2 bottom-full mb-4 -translate-x-1/2 z-50",children:f.jsx(Ie,{size:"sm",variant:"outline",className:"rounded-full shadow-lg cursor-pointer",onClick:d,children:f.jsx(Bre,{className:"h-4 w-4"})})})}),f.jsx("input",{ref:T,type:"file",multiple:!0,className:"hidden",onChange:G,accept:"image/*,.pdf,.txt,.json,.csv"}),(R.length>0||A.length>0)&&f.jsxs("div",{className:"mb-3 flex flex-wrap gap-2",children:[R.map(X=>f.jsxs("div",{className:"flex items-center gap-2 bg-muted px-3 py-2 rounded-lg text-sm",children:[f.jsx("span",{className:"truncate max-w-[200px]",children:X.name}),f.jsx("button",{onClick:()=>W(X.id),className:"text-muted-foreground hover:text-foreground cursor-pointer",children:"×"})]},X.id)),A.map(X=>f.jsxs("div",{className:"flex items-center gap-2 bg-muted/50 px-3 py-2 rounded-lg text-sm animate-pulse",children:[f.jsx("span",{className:"truncate max-w-[200px]",children:X}),f.jsx("div",{className:"w-3 h-3 border-2 border-current border-t-transparent rounded-full animate-spin"})]},X))]}),f.jsxs("div",{className:"relative",children:[f.jsx(Ho,{ref:k,value:t,onChange:X=>{S||e(X.target.value)},onKeyDown:z,placeholder:a,disabled:s,readOnly:s||S,className:kT("min-h-[56px] max-h-[120px] resize-none pl-16 pr-14 py-4 rounded-3xl","border-border/30 bg-background/50 focus-visible:border-border/50","focus-visible:ring-0 focus-visible:ring-offset-0","transition-all duration-200 ease-in-out overflow-y-auto","text-base placeholder:text-muted-foreground/60",S?"cursor-not-allowed bg-muted/30 text-muted-foreground":"",l),rows:1,autoFocus:!S}),f.jsx("div",{className:"absolute bottom-3 left-4 flex items-center gap-1",children:f.jsxs(Ma,{children:[f.jsx(Oa,{asChild:!0,children:f.jsx(Ie,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0 rounded-full hover:bg-muted/80 transition-colors cursor-pointer",onClick:()=>T.current?.click(),disabled:s||i||S,children:f.jsx(Xse,{size:16})})}),f.jsx(Pa,{children:"Add files"})]})}),f.jsx("div",{className:"absolute bottom-3 right-4 flex items-center gap-1",children:i?f.jsxs(Ma,{children:[f.jsx(Oa,{asChild:!0,children:f.jsx(Ie,{type:"button",size:"sm",variant:"outline",className:"h-8 w-8 p-0 rounded-full border-border/30 hover:border-border/50 transition-colors cursor-pointer",onClick:r,children:f.jsx(yie,{size:16})})}),f.jsx(Pa,{children:"Stop generating"})]}):f.jsxs(Ma,{children:[f.jsx(Oa,{asChild:!0,children:f.jsx(Ie,{type:"button",size:"sm",className:kT("h-8 w-8 p-0 rounded-full transition-all duration-200 cursor-pointer",t.trim()&&!s&&A.length===0&&!S?"bg-primary text-primary-foreground hover:bg-primary/90 shadow-sm":"bg-muted text-muted-foreground cursor-not-allowed"),onClick:L,disabled:!t.trim()||s||A.length>0||S,children:f.jsx(hB,{size:16})})}),f.jsx(Pa,{children:"Send message"})]})})]}),f.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[h.length>0&&M&&f.jsx(h7,{currentModel:M,availableModels:h,onModelChange:g,disabled:!1,isLoading:i}),b&&E&&f.jsx(Pke,{systemPrompt:v||"You are a helpful assistant with access to MCP tools.",onSystemPromptChange:b,temperature:x||0,onTemperatureChange:E,disabled:s,isLoading:i})]})]})}function Ike({serverConfigs:t,connectedServerConfigs:e,systemPrompt:n=""}){const r=w.useRef(null),[s,i]=w.useState(!0),{isAuthenticated:a}=Xa(),{signUp:l}=da(),u=ua(),[d,p]=w.useState(n||"You are a helpful assistant with access to MCP tools."),[h,g]=w.useState(1),[v,b]=w.useState({}),E=Object.keys(t||{}).filter(ae=>e?.[ae]?.connectionStatus==="connected"),S=E.length===0,{messages:k,isLoading:T,error:R,input:j,setInput:A,sendMessage:N,stopGeneration:M,regenerateMessage:I,clearChat:O,model:L,availableModels:z,setModel:G,elicitationRequest:W,elicitationLoading:X,handleElicitationResponse:F}=fV({systemPrompt:d,temperature:h,selectedServers:E,onError:ae=>{It.error(ae)}}),H=(L?ea(L.id):!1)&&!a,te="Sign in to use MCPJam provided models";w.useEffect(()=>{H&&A("")},[H,A]),w.useEffect(()=>{const ae=localStorage.getItem("chat-selected-model");if(ae&&z.length>0){const B=z.find(J=>J.id===ae);B&&(!L||L.id!==ae)&&G(B)}},[z]),w.useEffect(()=>{L&&localStorage.setItem("chat-selected-model",L.id)},[L]),w.useEffect(()=>{L&&g(Ede(L))},[L]),w.useEffect(()=>{const ae=async()=>{const B={};for(const J of E)try{const oe=await AN(J);oe.toolsMetadata&&Object.assign(B,oe.toolsMetadata)}catch(oe){console.error(`Failed to fetch tools for server ${J}:`,oe)}b(B)};E&&E.length>0?ae():b({})},[JSON.stringify(E)]);const P=k.length>0,re=H||S,ue=H?"Sign in to use free chat":"Connect an MCP server to send your first message",D=[{label:"Available tools",value:"What tools are available?",icon:yB}];w.useEffect(()=>{s&&r.current&&(r.current.scrollTop=r.current.scrollHeight)},[k,s]);const Z=()=>{if(!r.current)return;const{scrollTop:ae,scrollHeight:B,clientHeight:J}=r.current,fe=B-ae-J<100;i(fe)},he=ae=>{navigator.clipboard.writeText(ae)},V=async(ae,B)=>{try{const oe=await(await fetch("/api/mcp/tools/execute",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({toolName:ae,parameters:B,...E.length===1?{serverId:E[0]}:{}})})).json();return console.log("handleCallTool",oe),oe.result}catch(J){throw console.error("handleCallTool",J),J}},U=ae=>{A(ae),N(ae)},K=(ae,B)=>f.jsxs("div",{className:"flex flex-col h-screen",children:[f.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-4",children:[f.jsx(ei.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.35},className:"w-full max-w-xl space-y-6 text-center",children:ae}),f.jsxs(ei.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.35,delay:.05},className:"w-full max-w-2xl pt-10",children:[f.jsx(V4,{value:j,onChange:A,onSubmit:()=>{u.capture("send_message",{location:"chat_tab",platform:Ni(),environment:void 0,model_id:L?.id??null,model_name:L?.name??null,model_provider:L?.provider??null}),N(j)},onStop:M,disabled:z.length===0||B.disabled,isLoading:T,placeholder:B.placeholder,className:"border shadow-sm",currentModel:L||null,availableModels:z,onModelChange:G,onClearChat:O,hasMessages:!1,systemPrompt:d,onSystemPromptChange:p,temperature:h,onTemperatureChange:g,isSendBlocked:H}),z.length===0&&f.jsx(ei.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.25},className:"mt-3 text-center text-xs text-muted-foreground",children:"Configure API keys in Settings or start Ollama to enable chat"})]})]}),f.jsx(ST,{elicitationRequest:W,onResponse:F,loading:X})]});if(!P&&re)return K(H?f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{className:"space-y-1",children:[f.jsx("h2",{className:"text-base font-medium",children:"Create an account to use free models"}),f.jsx("p",{className:"text-sm text-muted-foreground",children:"or bring your own API key in the settings tab"})]}),f.jsx("div",{className:"flex justify-center gap-2",children:f.jsx(Ie,{onClick:()=>{u.capture("create_account",{location:"chat_tab",platform:Ni(),environment:void 0}),l()},style:{backgroundColor:"#E55A3A"},className:"hover:opacity-90 cursor-pointer",children:"Create account"})})]}):f.jsxs("div",{className:"space-y-4",children:[f.jsx("div",{className:"space-y-1",children:f.jsx("h2",{className:"text-base font-medium",children:"You must connect to an MCP server"})}),f.jsxs("div",{className:"flex justify-center gap-2 text-xs text-muted-foreground",children:[f.jsxs("a",{href:"#servers",className:"inline-flex items-center gap-1 rounded-full border px-3 py-1 transition hover:bg-muted/30",children:[f.jsx(ise,{className:"h-3 w-3"})," Add server"]}),f.jsxs("a",{href:"#settings",className:"inline-flex items-center gap-1 rounded-full border px-3 py-1 transition hover:bg-muted/30",children:[f.jsx(ZA,{className:"h-3 w-3"})," Settings"]})]})]}),{placeholder:ue,disabled:!0});if(!P){const ae=f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{className:"space-y-1",children:[f.jsx("h2",{className:"text-base font-medium",children:"Test your servers"}),f.jsx("p",{className:"text-sm text-muted-foreground",children:"Start typing or choose a quick suggestion to begin."})]}),f.jsx("div",{className:"flex flex-wrap justify-center gap-2",children:D.map(({label:B,value:J,icon:oe})=>f.jsxs("button",{type:"button",onClick:()=>A(J),className:"inline-flex items-center gap-2 rounded-full border border-border/60 px-3 py-1.5 text-xs transition hover:border-border hover:bg-muted/40 cursor-pointer",children:[f.jsx(oe,{className:"h-3.5 w-3.5 text-muted-foreground"}),B]},B))})]});return K(ae,{placeholder:"Send a message...",disabled:!1})}return f.jsx(h0,{children:f.jsxs("div",{className:"relative bg-background h-screen overflow-hidden",children:[f.jsx("div",{ref:r,onScroll:Z,className:"h-full overflow-y-auto pb-40",children:f.jsx("div",{className:"max-w-4xl mx-auto px-4 pt-8 pb-8",children:f.jsxs(hx,{mode:"popLayout",children:[k.map((ae,B)=>f.jsx(ei.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3,delay:B*.05},className:"mb-8",children:f.jsx(t1e,{message:ae,model:L||null,isLoading:T&&B===k.length-1,onEdit:()=>{},onRegenerate:I,onCopy:he,showActions:!0,serverConfigs:t,onCallTool:V,onSendFollowup:U,toolsMetadata:v,serverId:E.length===1?E[0]:void 0})},ae.id)),T&&k.length>0&&k[k.length-1].role==="user"&&f.jsx(ei.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"mb-8",children:f.jsxs("div",{className:"flex gap-4 items-start",children:[f.jsx("div",{className:"w-8 h-8 flex items-center rounded-full justify-center bg-muted/50 shrink-0",children:f.jsx(gB,{className:"h-4 w-4 text-muted-foreground"})}),f.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[f.jsx("span",{className:"text-sm text-muted-foreground",children:"Thinking"}),f.jsxs("div",{className:"flex space-x-1",children:[f.jsx("div",{className:"w-1.5 h-1.5 bg-muted-foreground/60 rounded-full animate-bounce"}),f.jsx("div",{className:"w-1.5 h-1.5 bg-muted-foreground/60 rounded-full animate-bounce delay-100"}),f.jsx("div",{className:"w-1.5 h-1.5 bg-muted-foreground/60 rounded-full animate-bounce delay-200"})]})]})]})})]})})}),f.jsx(hx,{children:R&&f.jsx(ei.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},className:"absolute bottom-40 left-0 right-0 px-4 py-3 bg-destructive/5 border-t border-destructive/10 z-10",children:f.jsx("div",{className:"max-w-4xl mx-auto",children:f.jsx("p",{className:"text-sm text-destructive",children:R})})})}),f.jsx("div",{className:"absolute bottom-0 left-0 right-0 border-t border-border/50 bg-background/80 backdrop-blur-sm",children:f.jsx("div",{className:"max-w-4xl mx-auto p-4",children:f.jsx("div",{children:f.jsx(V4,{value:j,onChange:A,onSubmit:(ae,B)=>{u.capture("send_message",{location:"chat_tab",platform:Ni(),environment:void 0,model_id:L?.id??null,model_name:L?.name??null,model_provider:L?.provider??null}),N(ae,B)},onStop:M,disabled:z.length===0||S||H,isLoading:T,placeholder:H?te:"Send a message...",className:"border-2 shadow-sm",currentModel:L,availableModels:z,onModelChange:G,onClearChat:O,hasMessages:P,systemPrompt:d,onSystemPromptChange:p,temperature:h,onTemperatureChange:g,isSendBlocked:H})})})}),f.jsx(ST,{elicitationRequest:W,onResponse:F,loading:X})]})})}function p7(t,e,n){const r=n.reduce((i,a)=>(a.status==="pending"||a.status==="running"||a.result==="pending"?i.pending+=1:a.result==="passed"?i.passed+=1:a.result==="failed"?i.failed+=1:a.result==="cancelled"&&(i.cancelled+=1),i.tokens+=a.tokensUsed||0,i),{passed:0,failed:0,cancelled:0,pending:0,tokens:0}),s=new Map;for(const i of n){const a=i.testCaseId;if(!a)continue;if(!s.has(a)){const u=e.find(p=>p._id===a),d=n.filter(p=>p.testCaseId===a).length;s.set(a,{testCaseId:a,title:u?.title||"Untitled",provider:u?.provider||"",model:u?.model||"",runs:d,passed:0,failed:0,cancelled:0,tokens:0})}const l=s.get(a);i.status==="pending"||i.status==="running"||i.result==="pending"||(i.result==="passed"?l.passed+=1:i.result==="failed"?l.failed+=1:i.result==="cancelled"&&(l.cancelled+=1)),l.tokens+=i.tokensUsed||0}return{filteredIterations:n,totals:r,byCase:Array.from(s.values())}}function Dke(t,e,n,r){const s=[];return t>0&&s.push(`${t} passed`),e>0&&s.push(`${e} failed`),n>0&&s.push(`${n} cancelled`),r>0&&s.push(`${r} pending`),s.join(" · ")||"No results"}function Lke({suite:t,onSelectSuite:e}){const{isAuthenticated:n}=Xa(),{user:r}=da(),s=t.config?.environment.servers,a=Sx("evals:getAllTestCasesAndIterationsBySuite",n&&!!r?{suiteId:t._id}:"skip"),l=w.useMemo(()=>a?p7(t,a.testCases,a.iterations):null,[t,a]),u=Array.isArray(t.config?.tests)?t.config.tests.length:0,d=w.useMemo(()=>{if(!Array.isArray(s))return[];const g=s.filter(b=>typeof b=="string").map(b=>b.trim()).filter(Boolean);if(g.length<=2)return g;const v=g.length-2;return[...g.slice(0,2),`+${v} more`]},[s]),p=l?.filteredIterations.length??0,h=()=>{if(!l)return"bg-zinc-300/50";const{passed:g,failed:v,cancelled:b,pending:x}=l.totals;if(g+v+b+x===0)return"bg-zinc-300/50";const S=g+v;if(S===0)return"bg-zinc-300/50";const k=v/S*100;return k===0?"bg-emerald-500/50":k<=30?"bg-amber-500/50":"bg-red-500/50"};return f.jsxs("button",{onClick:()=>e(t._id),className:"group relative flex w-full items-center gap-4 py-3 pl-4 pr-4 text-left transition-colors hover:bg-muted/50 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/60 cursor-pointer",children:[f.jsx("div",{className:`absolute left-0 top-0 h-full w-1 ${h()}`}),f.jsxs("div",{className:"grid min-w-0 flex-1 grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)] items-center gap-4",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"text-sm font-medium text-foreground",children:new Date(t._creationTime||0).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0})}),f.jsx("div",{className:"text-xs text-muted-foreground",children:d.length>0?d.join(", "):"No servers"})]}),f.jsxs("div",{className:"text-sm text-muted-foreground",children:[u," test",u!==1?"s":""," · ",p," ","iteration",p!==1?"s":""]}),f.jsx("div",{className:"text-sm text-muted-foreground",children:l?Dke(l.totals.passed,l.totals.failed,l.totals.cancelled,l.totals.pending):"Loading..."})]})]})}function $ke({suites:t,onSelectSuite:e}){if(t.length===0)return f.jsx("div",{className:"h-[calc(100vh-220px)] flex items-center justify-center rounded-xl border border-dashed",children:f.jsxs("div",{className:"text-center space-y-2",children:[f.jsx("div",{className:"text-lg font-semibold",children:"No evaluation suites yet"}),f.jsx("p",{className:"text-sm text-muted-foreground",children:"Trigger a test run to see your evaluation history here."})]})});const n=[...t].sort((r,s)=>(s._creationTime||0)-(r._creationTime||0));return f.jsx("div",{className:"space-y-4",children:f.jsxs("div",{className:"overflow-hidden rounded-xl border",children:[f.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)] items-center gap-4 border-b bg-muted/50 px-4 py-2 text-xs font-semibold text-muted-foreground",children:[f.jsx("div",{children:"Created"}),f.jsx("div",{children:"Tests"}),f.jsx("div",{children:"Results"})]}),f.jsx("div",{className:"divide-y",children:n.map(r=>f.jsx(Lke,{suite:r,onSelectSuite:e},r._id))})]})})}function zke({iteration:t,testCase:e}){const n=wke("evals:getEvalTestBlob"),[r,s]=w.useState(null),[i,a]=w.useState(!1),[l,u]=w.useState(null);return w.useEffect(()=>{let d=!1;async function p(){if(!t.blob){s(null),a(!1),u(null);return}a(!0),u(null);try{const h=await n({blobId:t.blob});d||s(h)}catch(h){d||(u(h?.message||"Failed to load blob"),console.error("Blob load error:",h))}finally{d||a(!1)}}return p(),()=>{d=!0}},[t.blob,n]),f.jsxs("div",{className:"space-y-3 py-2",children:[(e?.expectedToolCalls.length||0)>0&&f.jsxs("div",{className:"space-y-1.5",children:[f.jsx("div",{className:"text-xs font-semibold",children:"Expected tools"}),f.jsx("div",{className:"flex flex-wrap gap-1.5",children:e?.expectedToolCalls.map((d,p)=>f.jsx(vr,{variant:"outline",className:"font-mono text-xs",children:d},p))})]}),t.actualToolCalls.length>0&&f.jsxs("div",{className:"space-y-1.5",children:[f.jsx("div",{className:"text-xs font-semibold",children:"Actual tools called"}),f.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.actualToolCalls.map((d,p)=>f.jsx(vr,{variant:"outline",className:"font-mono text-xs",children:d},p))})]}),t.blob&&f.jsxs("div",{className:"space-y-1.5",children:[f.jsx("div",{className:"text-xs font-semibold",children:"Trace"}),f.jsx("div",{className:"rounded-md bg-muted/20 p-3",children:i?f.jsx("div",{className:"text-xs text-muted-foreground",children:"Loading trace"}):l?f.jsx("div",{className:"text-xs text-red-600",children:l}):f.jsx("pre",{className:"max-h-[360px] overflow-auto whitespace-pre-wrap break-words text-xs",children:JSON.stringify(r,null,2)})})]})]})}function Fke({suite:t,cases:e,iterations:n,aggregate:r,onBack:s}){const[i,a]=w.useState(null),[l,u]=w.useState(new Set),d=w.useMemo(()=>{const h=new Map,g=x=>{const E={runs:x.length,passed:0,failed:0,cancelled:0,pending:0,tokens:0,avgDuration:null};let S=0,k=0;return x.forEach(T=>{T.result==="passed"?E.passed+=1:T.result==="failed"?E.failed+=1:T.result==="cancelled"?E.cancelled+=1:E.pending+=1,E.tokens+=T.tokensUsed||0;const R=T.startedAt??T.createdAt,j=T.updatedAt??T.createdAt;if(R&&j){const A=Math.max(j-R,0);S+=A,k+=1}}),k>0&&(E.avgDuration=S/k),E};e.forEach(x=>{h.set(x._id,{testCase:x,iterations:[],summary:{runs:0,passed:0,failed:0,cancelled:0,pending:0,tokens:0,avgDuration:null}})});const v={testCase:null,iterations:[],summary:{runs:0,passed:0,failed:0,cancelled:0,pending:0,tokens:0,avgDuration:null}};n.forEach(x=>{const E=x.testCaseId?h.get(x.testCaseId):void 0;E?E.iterations.push(x):v.iterations.push(x)});const b=e.map(x=>{const E=h.get(x._id),S=[...E.iterations].sort((k,T)=>k.iterationNumber!=null&&T.iterationNumber!=null?k.iterationNumber-T.iterationNumber:(k.createdAt??0)-(T.createdAt??0));return{...E,iterations:S,summary:g(S)}});if(v.iterations.length>0){const x=[...v.iterations].sort((E,S)=>E.iterationNumber!=null&&S.iterationNumber!=null?E.iterationNumber-S.iterationNumber:(E.createdAt??0)-(S.createdAt??0));b.push({...v,iterations:x,summary:g(x)})}return b},[e,n]),p=h=>h==="passed"?"bg-emerald-500/50":h==="failed"?"bg-red-500/50":h==="cancelled"?"bg-zinc-300/50":"bg-amber-500/50";return f.jsxs("div",{className:"space-y-4",children:[f.jsx("div",{children:f.jsx(Ie,{variant:"ghost",size:"sm",onClick:s,children:"← Back to suites"})}),f.jsx("div",{className:"space-y-4",children:d.map((h,g)=>{const{testCase:v,iterations:b}=h,x=b.length>0,E=v?._id??`unassigned-${g}`,S=l.has(E),k=100,T=v?.query&&v.query.length>k,R=T&&!S?v.query.slice(0,k)+"...":v?.query,j=()=>{u(A=>{const N=new Set(A);return N.has(E)?N.delete(E):N.add(E),N})};return f.jsxs("div",{className:"overflow-hidden rounded-xl border",children:[f.jsx("div",{className:"border-b bg-muted/50 px-4 py-2.5",children:f.jsxs("div",{className:"space-y-2",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("h3",{className:"text-sm font-semibold pr-2",children:v?v.title:"Unassigned iterations"}),v?.provider?f.jsx(f.Fragment,{children:f.jsx("span",{className:"text-xs text-muted-foreground",children:v.provider})}):null,v?.model?f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"text-muted-foreground",children:"•"}),f.jsx("span",{className:"text-xs text-muted-foreground",children:v.model})]}):null]}),v?.query?f.jsxs("div",{className:"flex items-start gap-2",children:[f.jsxs("p",{className:"text-xs text-muted-foreground italic flex-1",children:['"',R,'"']}),T?f.jsx("button",{onClick:j,className:"text-xs text-primary hover:underline focus:outline-none whitespace-nowrap",children:S?"Show less":"Show more"}):null]}):null]})}),x?f.jsx("div",{className:"divide-y",children:b.map(A=>{const N=i===A._id,M=A.startedAt??A.createdAt,I=A.updatedAt??A.createdAt,O=M&&I?Math.max(I-M,0):null,L=A.result==="pending";return f.jsxs("div",{className:`relative ${L?"opacity-60":""}`,children:[f.jsx("div",{className:`absolute left-0 top-0 h-full w-1 ${p(A.result)}`}),f.jsx("button",{onClick:()=>{L||a(z=>z===A._id?null:A._id)},disabled:L,className:`flex w-full items-center gap-4 px-4 py-3 text-left transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/60 ${L?"cursor-not-allowed":"cursor-pointer hover:bg-muted/50"}`,children:f.jsxs("div",{className:"grid min-w-0 flex-1 grid-cols-[auto_1fr_auto_auto] items-center gap-4 pl-3",children:[f.jsx("div",{className:"text-muted-foreground",children:L?f.jsx(Ba,{className:"h-4 w-4"}):N?f.jsx(Au,{className:"h-4 w-4"}):f.jsx(Ba,{className:"h-4 w-4"})}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs("span",{className:"text-sm font-medium",children:["Iteration #",A.iterationNumber]}),L?f.jsx(mu,{className:"h-4 w-4 animate-spin text-amber-600"}):null]}),f.jsx("div",{className:"text-sm text-muted-foreground",children:L?"—":`${Number(A.tokensUsed||0).toLocaleString()} tokens`}),f.jsx("div",{className:"text-sm text-muted-foreground",children:L?"—":O!==null?Uke(O):"—"})]})}),N&&!L?f.jsx("div",{className:"border-t bg-muted/20 px-4 pb-4 pt-3 pl-8",children:f.jsx(zke,{iteration:A,testCase:v})}):null]},A._id)})}):f.jsx("div",{className:"px-4 py-6 text-center text-sm text-muted-foreground",children:"No iterations recorded for this test case yet."})]},E)})})]})}function Uke(t){if(t<1e3)return`${t}ms`;const e=Math.round(t/1e3);if(e<60)return`${e}s`;const n=Math.floor(e/60),r=e%60;if(n<60)return r?`${n}m ${r}s`:`${n}m`;const s=Math.floor(n/60),i=n%60;return i?`${s}h ${i}m`:`${s}h`}function Bke(){const{isAuthenticated:t,isLoading:e}=Xa(),{user:n}=da(),[r,s]=w.useState(null),i=t&&!!n,a=Sx("evals:getCurrentUserEvalTestSuitesWithMetadata",i?{}:"skip"),l=t&&!!n&&!!r,u=Sx("evals:getAllTestCasesAndIterationsBySuite",l?{suiteId:r}:"skip"),d=a?.testSuites,p=a===void 0,h=l&&u===void 0,g=w.useMemo(()=>!r||!d?null:d.find(x=>x._id===r)??null,[r,d]),v=w.useMemo(()=>u?[...u.iterations].sort((x,E)=>(E.startedAt||E.createdAt)-(x.startedAt||x.createdAt)):[],[u]),b=w.useMemo(()=>!g||!u?null:p7(g,u.testCases,u.iterations),[g,u]);return e?f.jsx("div",{className:"p-6",children:f.jsx("div",{className:"flex h-64 items-center justify-center",children:f.jsxs("div",{className:"text-center",children:[f.jsx("div",{className:"mx-auto h-8 w-8 animate-spin rounded-full border-b-2 border-primary"}),f.jsx("p",{className:"mt-4 text-muted-foreground",children:"Loading..."})]})})}):!t||!n?f.jsx("div",{className:"p-6",children:f.jsx(th,{icon:mB,title:"Sign in to view your evals",description:"Create an account or sign in to see previous runs and metrics.",className:"h-[calc(100vh-200px)]"})}):p&&i?f.jsx("div",{className:"p-6",children:f.jsx("div",{className:"flex h-64 items-center justify-center",children:f.jsxs("div",{className:"text-center",children:[f.jsx("div",{className:"mx-auto h-8 w-8 animate-spin rounded-full border-b-2 border-primary"}),f.jsx("p",{className:"mt-4 text-muted-foreground",children:"Loading your eval data..."})]})})}):f.jsxs("div",{className:"space-y-6 p-6",children:[f.jsx("div",{className:"flex items-center justify-between",children:f.jsx("h1",{className:"text-2xl font-semibold",children:"Evaluation results"})}),g?h?f.jsx("div",{className:"flex h-64 items-center justify-center",children:f.jsxs("div",{className:"text-center",children:[f.jsx("div",{className:"mx-auto h-8 w-8 animate-spin rounded-full border-b-2 border-primary"}),f.jsx("p",{className:"mt-4 text-muted-foreground",children:"Loading suite details..."})]})}):f.jsx(Fke,{suite:g,cases:u?.testCases||[],iterations:v,aggregate:b,onBack:()=>s(null)}):f.jsx($ke,{suites:d||[],onSelectSuite:s})]})}const qke="modulepreload",Vke=function(t){return"/"+t},H4={},Hke=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){let d=function(p){return Promise.all(p.map(h=>Promise.resolve(h).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};var a=d;document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),u=l?.nonce||l?.getAttribute("nonce");s=d(n.map(p=>{if(p=Vke(p),p in H4)return;H4[p]=!0;const h=p.endsWith(".css"),g=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${g}`))return;const v=document.createElement("link");if(v.rel=h?"stylesheet":qke,h||(v.as="script"),v.crossOrigin="",v.href=p,u&&v.setAttribute("nonce",u),document.head.appendChild(v),h)return new Promise((b,x)=>{v.addEventListener("load",b),v.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${p}`)))})}))}function i(l){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=l,window.dispatchEvent(u),!u.defaultPrevented)throw l}return s.then(l=>{for(const u of l||[])u.status==="rejected"&&i(u.reason);return e().catch(i)})},CC={servers:{},selectedServer:"none",selectedMultipleServers:[],isMultiSelectMode:!1},Ep=(t,e,n={})=>({...t,connectionStatus:e,...n});function Gke(t,e){switch(e.type){case"HYDRATE_STATE":return e.payload;case"UPSERT_SERVER":return{...t,servers:{...t.servers,[e.name]:e.server}};case"CONNECT_REQUEST":{const n=t.servers[e.name],r=n?Ep(n,"connecting",{enabled:!0}):{name:e.name,config:e.config,lastConnectionTime:new Date,connectionStatus:"connecting",retryCount:0,enabled:!0};return{...t,servers:{...t.servers,[e.name]:{...r,config:e.config}},selectedServer:e.select?e.name:t.selectedServer}}case"CONNECT_SUCCESS":{const n=t.servers[e.name];return n?{...t,servers:{...t.servers,[e.name]:Ep(n,"connected",{config:e.config,lastConnectionTime:new Date,retryCount:0,lastError:void 0,oauthTokens:e.tokens??n.oauthTokens,enabled:!0})}}:t}case"CONNECT_FAILURE":{const n=t.servers[e.name];return n?{...t,servers:{...t.servers,[e.name]:Ep(n,"failed",{retryCount:n.retryCount,lastError:e.error})}}:t}case"RECONNECT_REQUEST":{const n=t.servers[e.name];return n?{...t,servers:{...t.servers,[e.name]:Ep(n,"connecting",{enabled:!0})}}:t}case"DISCONNECT":{const n=t.servers[e.name];if(!n)return t;const r=t.selectedServer===e.name?"none":t.selectedServer;return{...t,servers:{...t.servers,[e.name]:Ep(n,"disconnected",{enabled:!1,lastError:e.error??n.lastError})},selectedServer:r,selectedMultipleServers:t.selectedMultipleServers.filter(s=>s!==e.name)}}case"REMOVE_SERVER":{const{[e.name]:n,...r}=t.servers;return{...t,servers:r,selectedServer:t.selectedServer===e.name?"none":t.selectedServer,selectedMultipleServers:t.selectedMultipleServers.filter(s=>s!==e.name)}}case"SYNC_AGENT_STATUS":{const n=new Map(e.servers.map(s=>[s.id,s.status])),r={};for(const[s,i]of Object.entries(t.servers)){if(i.connectionStatus==="connecting"||i.connectionStatus==="oauth-flow"){r[s]=i;continue}const l=n.get(s);l?r[s]={...i,connectionStatus:l}:r[s]={...i,connectionStatus:"disconnected"}}return{...t,servers:r}}case"SELECT_SERVER":return{...t,selectedServer:e.name};case"SET_MULTI_SELECTED":return{...t,selectedMultipleServers:e.names};case"SET_MULTI_MODE":return{...t,isMultiSelectMode:e.enabled,selectedMultipleServers:e.enabled?[]:t.selectedMultipleServers};default:return t}}const m7="mcp-inspector-state";function Wke(t){const e=t.config;let n=e;if(e&&typeof e.url=="string")try{n={...e,url:new URL(e.url)}}catch{}return{...t,config:n,connectionStatus:t.connectionStatus||"disconnected",retryCount:t.retryCount||0,lastConnectionTime:t.lastConnectionTime?new Date(t.lastConnectionTime):new Date,enabled:t.enabled!==!1}}function Yke(){try{const t=localStorage.getItem(m7);if(!t)return CC;const e=JSON.parse(t);return{servers:Object.fromEntries(Object.entries(e.servers||{}).map(([r,s])=>[r,Wke(s)])),selectedServer:e.selectedServer||"none",selectedMultipleServers:e.selectedMultipleServers||[],isMultiSelectMode:e.isMultiSelectMode||!1}}catch{return CC}}function Kke(t){const e={...t,servers:Object.fromEntries(Object.entries(t.servers).map(([n,r])=>{const s=r.config,i=s&&s.url instanceof URL?{...s,url:s.url.toString()}:s;return[n,{...r,config:i}]}))};localStorage.setItem(m7,JSON.stringify(e))}async function Ey(t,e){return(await fetch("/api/mcp/connect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({serverConfig:t,serverId:e})})).json()}async function Xke(t){return(await fetch(`/api/mcp/servers/${encodeURIComponent(t)}`,{method:"DELETE"})).json()}async function Qke(){return(await fetch("/api/mcp/servers")).json()}async function Jke(t,e){return(await fetch("/api/mcp/servers/reconnect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({serverId:t,serverConfig:e})})).json()}async function Zke(t){if(!t.oauthTokens)return{kind:"ready",serverConfig:t.config,tokens:void 0};const e=await pN(t.name);if(e.success&&e.serverConfig)return{kind:"ready",serverConfig:e.serverConfig,tokens:Ji(t.name)};const n=t.config?.url?.toString?.();if(n){Nm(t.name);const r={serverName:t.name,serverUrl:n,clientId:t.oauthTokens?.client_id,clientSecret:t.oauthTokens?.client_secret},s=await Bb(r);return s.success&&s.serverConfig?{kind:"ready",serverConfig:s.serverConfig,tokens:Ji(t.name)}:s.success&&!s.serverConfig?{kind:"redirect"}:{kind:"error",error:s.error||"OAuth init failed"}}return{kind:"error",error:"OAuth refresh failed and no URL present"}}function z1(t){return t.type==="stdio"?{command:t.command,args:t.args,env:t.env}:{url:new URL(t.url),requestInit:{headers:t.headers||{}}}}function g7(){const t=GN("Connections"),[e,n]=w.useReducer(Gke,CC),[r,s]=w.useState(!0),i=w.useRef(new Map),a=A=>{const M=(i.current.get(A)??0)+1;return i.current.set(A,M),M},l=(A,N)=>(i.current.get(A)??0)!==N;w.useEffect(()=>{try{const A=Yke();n({type:"HYDRATE_STATE",payload:A})}catch(A){t.error("Failed to load saved state",{error:A instanceof Error?A.message:"Unknown error"})}finally{s(!1)}},[t]),w.useEffect(()=>{r||Kke(e)},[e,r]);const u=A=>{if(A.type==="stdio")return!A.command||A.command.trim()===""?"Command is required for STDIO connections":null;if(!A.url||A.url.trim()==="")return"URL is required for HTTP connections";try{new URL(A.url)}catch(N){return`Invalid URL format: ${A.url} ${N}`}return null},d=w.useCallback(()=>{const A=Object.entries(e.servers).filter(([,N])=>N.connectionStatus==="connected").map(([N])=>N);n({type:"SET_MULTI_SELECTED",names:A})},[e.servers]),p=w.useCallback(async A=>{window.history.replaceState({},document.title,window.location.pathname);try{const N=await KB(A);if(N.success&&N.serverConfig&&N.serverName){const M=N.serverName;n({type:"CONNECT_REQUEST",name:M,config:N.serverConfig,select:!0});try{const I=await Ey(N.serverConfig,M);I.success?(n({type:"CONNECT_SUCCESS",name:M,config:N.serverConfig,tokens:Ji(M)}),t.info("OAuth connection successful",{serverName:M}),It.success(`OAuth connection successful! Connected to ${M}.`)):(n({type:"CONNECT_FAILURE",name:M,error:I.error||"Connection test failed after OAuth"}),t.error("OAuth connection test failed",{serverName:M,error:I.error}),It.error(`OAuth succeeded but connection test failed: ${I.error}`))}catch(I){const O=I instanceof Error?I.message:"Unknown connection error";n({type:"CONNECT_FAILURE",name:M,error:O}),t.error("OAuth connection test error",{serverName:M,error:O}),It.error(`OAuth succeeded but connection test failed: ${O}`)}}else throw new Error(N.error||"OAuth callback failed")}catch(N){const M=N instanceof Error?N.message:"Unknown error";It.error(`Error completing OAuth flow: ${M}`),t.error("OAuth callback failed",{error:M})}},[t]);w.useEffect(()=>{if(!r){const A=new URLSearchParams(window.location.search),N=A.get("code"),M=A.get("error");N?p(N):M&&(It.error(`OAuth authorization failed: ${M}`),localStorage.removeItem("mcp-oauth-pending"),window.history.replaceState({},document.title,window.location.pathname))}},[r,p]);const h=w.useCallback(async A=>{const N=u(A);if(N){It.error(N);return}const M=z1(A);n({type:"CONNECT_REQUEST",name:A.name,config:M,select:!0});const I=a(A.name);try{if(A.type==="http"&&A.useOAuth&&A.url){n({type:"UPSERT_SERVER",name:A.name,server:{name:A.name,config:M,lastConnectionTime:new Date,connectionStatus:"oauth-flow",retryCount:0,enabled:!0}});const{initiateOAuth:L}=await Hke(async()=>{const{initiateOAuth:W}=await Promise.resolve().then(()=>mle);return{initiateOAuth:W}},void 0),z={serverName:A.name,serverUrl:A.url,clientId:A.clientId,clientSecret:A.clientSecret};A.oauthScopes&&A.oauthScopes.length>0&&(z.scopes=A.oauthScopes);const G=await L(z);if(G.success){if(G.serverConfig){const W=await Ey(G.serverConfig,A.name);if(l(A.name,I))return;W.success?(n({type:"CONNECT_SUCCESS",name:A.name,config:G.serverConfig,tokens:Ji(A.name)}),It.success("Connected successfully with OAuth!")):(n({type:"CONNECT_FAILURE",name:A.name,error:W.error||"OAuth connection test failed"}),It.error(`OAuth succeeded but connection failed: ${W.error}`))}else It.success("OAuth flow initiated. You will be redirected to authorize access.");return}else{if(l(A.name,I))return;n({type:"CONNECT_FAILURE",name:A.name,error:G.error||"OAuth initialization failed"}),It.error(`OAuth initialization failed: ${G.error}`);return}}const O=await Ey(M,A.name);if(l(A.name,I))return;O.success?(n({type:"CONNECT_SUCCESS",name:A.name,config:M}),t.info("Connection successful",{serverName:A.name}),It.success("Connected successfully!")):(n({type:"CONNECT_FAILURE",name:A.name,error:O.error||"Connection test failed"}),t.error("Connection failed",{serverName:A.name,error:O.error}),It.error(`Failed to connect to ${A.name}`))}catch(O){const L=O instanceof Error?O.message:"Unknown error";if(l(A.name,I))return;n({type:"CONNECT_FAILURE",name:A.name,error:L}),t.error("Connection failed",{serverName:A.name,error:L}),It.error(`Network error: ${L}`)}},[e.servers,t]),g=w.useRef(!1);w.useEffect(()=>{!r&&!g.current&&(g.current=!0,fetch("/api/mcp-cli-config").then(A=>A.json()).then(A=>{const N=A.config;if(N){if(N.servers&&Array.isArray(N.servers)){const M=N.autoConnectServer;t.info("Processing CLI-provided MCP servers (from config file)",{serverCount:N.servers.length,autoConnectServer:M||"all",cliConfig:N}),N.servers.forEach(I=>{const O={name:I.name||"CLI Server",type:I.type==="sse"?"http":I.type||"stdio",command:I.command,args:I.args||[],url:I.url,env:I.env||{}},L=z1(O);n({type:"UPSERT_SERVER",name:O.name,server:{name:O.name,config:L,lastConnectionTime:new Date,connectionStatus:"disconnected",retryCount:0,enabled:!1}}),!M||I.name===M?(t.info("Auto-connecting to server",{serverName:I.name}),h(O)):t.info("Skipping auto-connect for server",{serverName:I.name,reason:"filtered out"})});return}if(N.command){t.info("Auto-connecting to CLI-provided MCP server",{cliConfig:N});const M={name:N.name||"CLI Server",type:"stdio",command:N.command,args:N.args||[],env:N.env||{}};h(M)}}}).catch(A=>{t.debug("Could not fetch CLI config from API",{error:A})}))},[r,h,t,e.servers]);const v=w.useCallback(async A=>{const N=e.servers[A];return N?.oauthTokens&&N.oauthTokens.access_token||null},[e.servers]),b=w.useCallback(async A=>{t.info("Disconnecting from server",{serverName:A}),n({type:"DISCONNECT",name:A});try{const N=await Xke(A);N.success||n({type:"DISCONNECT",name:A,error:N.error})}catch(N){n({type:"DISCONNECT",name:A,error:N instanceof Error?N.message:"Unknown error"})}},[]),x=w.useCallback(async A=>{t.info("Removing server",{serverName:A}),Nm(A),n({type:"REMOVE_SERVER",name:A})},[]),E=w.useCallback(async A=>{t.info("Reconnecting to server",{serverName:A});const N=e.servers[A];if(!N)throw new Error(`Server ${A} not found`);n({type:"RECONNECT_REQUEST",name:A});const M=a(A);try{const I=await Zke(N);if(I.kind==="redirect")return;if(I.kind==="error"){if(l(A,M))return;n({type:"CONNECT_FAILURE",name:A,error:I.error}),It.error(`Failed to connect: ${A}`);return}const O=await Jke(A,I.serverConfig);if(l(A,M))return;if(O.success)return n({type:"CONNECT_SUCCESS",name:A,config:I.serverConfig,tokens:I.tokens}),t.info("Reconnection successful",{serverName:A,result:O}),{success:!0};{n({type:"CONNECT_FAILURE",name:A,error:O.error||"Reconnection failed"}),t.error("Reconnection failed",{serverName:A,result:O});const L=O.error||`Failed to reconnect: ${A}`;It.error(L)}}catch(I){const O=I instanceof Error?I.message:"Unknown error";if(l(A,M))return;throw n({type:"CONNECT_FAILURE",name:A,error:O}),t.error("Reconnection failed",{serverName:A,error:O}),I}},[e.servers]);w.useEffect(()=>{if(r)return;(async()=>{try{const N=await Qke();N?.success&&N.servers&&n({type:"SYNC_AGENT_STATUS",servers:N.servers})}catch(N){t.debug("Failed to sync server status on startup",{error:N instanceof Error?N.message:"Unknown error"})}})()},[r,t]);const S=w.useCallback(A=>{n({type:"SELECT_SERVER",name:A})},[]),k=w.useCallback(A=>{n({type:"SET_MULTI_SELECTED",names:A})},[]),T=w.useCallback(A=>{n({type:"SET_MULTI_MODE",enabled:A})},[]),R=w.useCallback(A=>{const N=e.selectedMultipleServers,M=N.includes(A)?N.filter(I=>I!==A):[...N,A];n({type:"SET_MULTI_SELECTED",names:M})},[e.selectedMultipleServers]),j=w.useCallback(async(A,N)=>{const M=e.servers[A];if(M?.oauthTokens!=null&&N.useOAuth&&N.name===A&&N.type==="http"&&N.url===(M?.config).url?.toString()&&M){const L=z1(N);n({type:"CONNECT_REQUEST",name:A,config:L});try{if((await Ey(M.config,A)).success){n({type:"CONNECT_SUCCESS",name:A,config:L}),It.success("Server configuration updated successfully!");return}else console.warn("OAuth connection test failed, falling back to full reconnect")}catch(z){console.warn("OAuth connection test error, falling back to full reconnect",z)}}await b(A),await h(N),e.selectedServer===A&&N.name!==A&&S(N.name)},[e.servers,e.selectedServer,b,h]);return{appState:e,isLoading:r,connectedServerConfigs:e.servers,selectedServerEntry:e.servers[e.selectedServer],selectedMCPConfig:e.servers[e.selectedServer]?.config,selectedMCPConfigs:e.selectedMultipleServers.map(A=>e.servers[A]).filter(Boolean),selectedMCPConfigsMap:e.selectedMultipleServers.reduce((A,N)=>(e.servers[N]&&(A[N]=e.servers[N].config),A),{}),isMultiSelectMode:e.isMultiSelectMode,handleConnect:h,handleDisconnect:b,handleReconnect:E,handleUpdate:j,handleRemoveServer:x,setSelectedServer:S,setSelectedMCPConfigs:k,toggleMultiSelectMode:T,toggleServerSelection:R,getValidAccessToken:v,setSelectedMultipleServersToAllServers:d}}function eTe({server:t,selected:e,onToggle:n}){const[r,s]=w.useState(null),[i,a]=w.useState(!1),{label:l,Icon:u,iconClassName:d,indicatorColor:p}=bB(t.connectionStatus),h=_B(t.config),g=xB(t.config),v=JSON.stringify(t.config,null,2),b=()=>{n(t.name)},x=k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),b())},E=async(k,T,R)=>{k.stopPropagation();try{await navigator.clipboard.writeText(T),s(R),setTimeout(()=>s(null),2e3)}catch(j){console.error("Failed to copy text:",j)}},S=t.connectionStatus==="failed"?`${l} (${t.retryCount} retries)`:l;return f.jsxs(Fa,{role:"button",tabIndex:0,onClick:b,onKeyDown:x,className:Me("relative gap-3 p-3 border border-border/40 bg-card/40 transition-colors","hover:border-border cursor-pointer",e&&"border-primary/60 ring-2 ring-primary/30"),children:[f.jsxs("div",{className:"flex items-start justify-between gap-2",children:[f.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[f.jsx("span",{"aria-hidden":!0,className:"h-2 w-2 flex-shrink-0 rounded-full",style:{backgroundColor:p}}),f.jsx("div",{className:"min-w-0",children:f.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[f.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:t.name}),f.jsxs("div",{className:"flex items-center gap-1 text-[11px] text-muted-foreground",children:[f.jsx(u,{className:d}),f.jsx("span",{children:S})]})]})})]}),e&&f.jsxs(vr,{variant:"secondary",className:"h-5 px-1 text-[11px]",children:[f.jsx(Ti,{className:"mr-1 h-3 w-3"}),"Selected"]})]}),f.jsx("p",{className:"mt-0.5 text-[11px] uppercase tracking-wide text-muted-foreground",children:h}),f.jsxs("div",{className:"relative break-all rounded border border-border/30 bg-muted/30 p-1.5 font-mono text-[11px] text-muted-foreground",children:[f.jsx("div",{className:"pr-6",children:g}),f.jsx("button",{type:"button",onClick:k=>E(k,g,"command"),className:"absolute right-1 top-1 cursor-pointer p-1 text-muted-foreground/60 transition-colors hover:text-foreground",children:r==="command"?f.jsx(Ti,{className:"h-3 w-3 text-green-500"}):f.jsx(Po,{className:"h-3 w-3"})})]}),i&&f.jsxs("div",{className:"relative rounded border border-border/20 bg-muted/20 p-1.5 font-mono text-[11px] text-muted-foreground",children:[f.jsx("pre",{className:"max-h-40 overflow-auto pr-6 whitespace-pre-wrap",children:v}),f.jsx("button",{type:"button",onClick:k=>E(k,v,"config"),className:"absolute right-1 top-1 cursor-pointer p-1 text-muted-foreground/60 transition-colors hover:text-foreground",children:r==="config"?f.jsx(Ti,{className:"h-3 w-3 text-green-500"}):f.jsx(Po,{className:"h-3 w-3"})})]}),f.jsx("div",{className:"flex justify-end pt-0.5",children:f.jsx("button",{type:"button",onClick:k=>{k.stopPropagation(),a(T=>!T)},"aria-label":i?"Hide config":"Show config",className:"rounded-full border border-border/50 bg-background/70 p-1 text-muted-foreground transition-colors hover:text-foreground",children:i?f.jsx(pB,{className:"h-3 w-3"}):f.jsx(Au,{className:"h-3 w-3"})})})]})}const G4="mcp-inspector-eval-runner-preferences",wl=[{key:"servers",title:"Select Servers",description:"Choose the MCP servers to evaluate."},{key:"model",title:"Choose Model",description:"Pick the model and ensure credentials are ready."},{key:"tests",title:"Define Tests",description:"Author the scenarios you want to run or generate them with AI."},{key:"review",title:"Review & Run",description:"Confirm the configuration before launching the run."}],F1=(t,e)=>({title:"",query:"",runs:1,model:e?.id??"",provider:e?.provider??"",expectedToolCalls:[]});function tTe({availableModels:t,inline:e=!1}){const[n,r]=w.useState(!1),[s,i]=w.useState(!1),[a,l]=w.useState(!1),[u,d]=w.useState(0),[p,h]=w.useState(null),{isAuthenticated:g}=Xa(),{getAccessToken:v}=da(),{appState:b}=g7(),{getToken:x,hasToken:E}=rR(),[S,k]=w.useState([]),[T,R]=w.useState(null),[j,A]=w.useState([F1(1,null)]),N=w.useMemo(()=>Object.entries(b.servers).filter(([,B])=>B.connectionStatus==="connected"),[b.servers]),M=w.useMemo(()=>new Set(N.map(([B])=>B)),[N]);w.useEffect(()=>{if(!(typeof window>"u"))try{const B=localStorage.getItem(G4);if(!B)return;const J=JSON.parse(B);h({servers:J.servers??[],modelId:J.modelId??null})}catch(B){console.warn("Failed to load eval runner preferences",B)}},[]),w.useEffect(()=>{if(p&&p.servers?.length){const B=p.servers.filter(J=>M.has(J));B.length&&k(B)}},[p,M]),w.useEffect(()=>{if(t.length===0){R(null);return}if(p?.modelId){const B=t.find(J=>J.id===p.modelId);if(B){R(B);return}}R(B=>B&&t.some(oe=>oe.id===B.id)?B:t[0])},[t,p]),w.useEffect(()=>{if(!(typeof window>"u"))try{const B={servers:S,modelId:T?.id??null};localStorage.setItem(G4,JSON.stringify(B))}catch(B){console.warn("Failed to persist eval runner preferences",B)}},[S,T]),w.useEffect(()=>{A(B=>T?B.map((J,oe)=>J.model===T.id&&J.provider===T.provider?J:{...J,model:T.id,provider:T.provider}):B)},[T]),w.useEffect(()=>{!e&&!n&&d(0)},[e,n]);const I=T?ea(T.id):!1,O=T?.provider,L=O?E(O):!1,z=w.useMemo(()=>j.filter(B=>B.query.trim().length>0),[j]),G=w.useMemo(()=>({servers:S.length>0,model:!!T&&(I||O&&L),tests:z.length>0}),[z.length,T,I,O,L,S.length]),W=w.useMemo(()=>G.servers?G.model?G.tests?3:2:1:0,[G]),X=w.useMemo(()=>{switch(u){case 0:return G.servers;case 1:return G.model;case 2:return G.tests;case 3:return G.tests&&G.servers&&G.model;default:return!1}},[u,G]),F=B=>{k(J=>J.includes(B)?J.filter(oe=>oe!==B):[...J,B])},Y=B=>{A(J=>{const oe=J.length,fe=Array.from({length:B},(be,Ae)=>F1(oe+Ae+1,T));return[...J,...fe]})},H=()=>{Y(1)},te=B=>{A(J=>J.filter((oe,fe)=>fe!==B))},P=(B,J,oe)=>{A(fe=>{const be=[...fe];return be[B]={...be[B],[J]:oe},be})},re=async()=>{if(!g){It.error("Please sign in to generate tests");return}if(S.length===0){It.error("Please select at least one server");return}l(!0);try{const B=await v(),J=await fetch("/api/mcp/evals/generate-tests",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({serverIds:S,convexAuthToken:B})}),oe=await J.json();if(!J.ok)throw new Error(oe.error||"Failed to generate tests");if(oe.tests&&oe.tests.length>0){const fe=oe.tests.map((be,Ae)=>({title:be.title||`Generated test ${Ae+1}`,query:be.query||"",runs:Number(be.runs)>0?Number(be.runs):1,model:T?.id||"",provider:T?.provider||"",expectedToolCalls:Array.isArray(be.expectedToolCalls)?be.expectedToolCalls:[]}));A(fe),d(2),It.success(`Generated ${fe.length} test case(s).`)}}catch(B){console.error("Failed to generate tests:",B),It.error(B instanceof Error?B.message:"Failed to generate test cases")}finally{l(!1)}},ue=()=>{u>=wl.length-1||X&&d(B=>Math.min(B+1,wl.length-1))},D=()=>{u!==0&&d(B=>Math.max(B-1,0))},Z=async()=>{if(!g){It.error("Please sign in to run evals");return}if(S.length===0){It.error("Please select at least one server"),d(0);return}if(!T){It.error("Please select a model"),d(1);return}const B=ea(T.id),J=!B&&O?x(O):"";if(!B&&(!O||!J)){It.error(`Please configure your ${T.provider} API key in Settings`),d(1);return}if(z.length===0){It.error("Please add at least one test case with a query"),d(2);return}i(!0);try{const oe=await v(),fe=z.map(Oe=>({...Oe,model:T.id,provider:T.provider})),be=await fetch("/api/mcp/evals/run",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tests:fe,serverIds:S,llmConfig:{provider:T.provider,apiKey:B?"router":J||"router"},convexAuthToken:oe})}),Ae=await be.json();if(!be.ok)throw new Error(Ae.error||"Failed to start evals");It.success(Ae.message||"Evals started successfully!"),A([F1(1,T)]),d(3),e||r(!1),window.location.hash="eval-results"}catch(oe){It.error(oe instanceof Error?oe.message:"Failed to start evals")}finally{i(!1)}},he=()=>{switch(wl[u].key){case"servers":return f.jsxs("div",{className:"space-y-4",children:[f.jsx("div",{className:"flex items-center justify-between",children:f.jsxs("div",{children:[f.jsx("h3",{className:"text-lg pb-2",children:"Select servers to test"}),f.jsx("p",{className:"text-sm text-muted-foreground pb-2",children:"Choose at least one connected MCP server. You can evaluate multiple servers in the same run."})]})}),N.length>0?f.jsx("div",{className:"grid grid-cols-1 gap-3 lg:grid-cols-2 xl:grid-cols-3",children:N.map(([B,J])=>{const oe=S.includes(B);return f.jsx(eTe,{server:J,selected:oe,onToggle:F},B)})}):f.jsxs("div",{className:"rounded-lg border border-dashed p-6 text-sm text-muted-foreground",children:[f.jsx("p",{className:"font-medium text-foreground",children:"No connected servers yet"}),f.jsx("p",{className:"mt-2",children:"Launch a server from the Servers tab to make it available here. Once connected, it will appear instantly."})]})]});case"model":return f.jsxs("div",{className:"space-y-4",children:[f.jsx("div",{className:"flex items-center justify-between",children:f.jsxs("div",{children:[f.jsx("h3",{className:"text-lg pb-2",children:"Choose your evaluation model"}),f.jsx("p",{className:"text-sm text-muted-foreground",children:"For example, if you want to simulate using your server with Claude Desktop, select an Anthropic model."})]})}),t.length===0?f.jsxs("div",{className:"rounded-lg border border-dashed p-6 text-sm text-muted-foreground",children:[f.jsx("p",{className:"font-medium text-foreground",children:"No models available"}),f.jsx("p",{className:"mt-2",children:"Connect a provider or enable MCPJam provided models in Settings to unlock model selection."})]}):T?f.jsxs("div",{className:"space-y-3",children:[f.jsx("div",{className:"flex items-center gap-3",children:f.jsx(h7,{currentModel:T,availableModels:t,onModelChange:R})}),!I&&!L&&O&&f.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-destructive/50 bg-destructive/5 p-3 text-sm",children:[f.jsx(Tm,{className:"mt-0.5 h-4 w-4 text-destructive"}),f.jsxs("div",{children:[f.jsxs("p",{className:"font-medium text-destructive",children:["Add your ",T.provider," API key"]}),f.jsx("p",{className:"text-muted-foreground",children:"Configure credentials in Settings to run this model. Keys are stored locally and never sent to our servers."})]})]})]}):null]});case"tests":return f.jsxs("div",{className:"space-y-6",children:[f.jsx("div",{className:"flex items-center justify-between",children:f.jsxs("div",{children:[f.jsx("h3",{className:"text-lg pb-2",children:"Define your test cases"}),f.jsx("p",{className:"text-sm text-muted-foreground",children:"Create testing scenarios that simulate how real users would use your server."})]})}),!G.servers||!G.model?f.jsxs("div",{className:"rounded-lg border border-dashed p-6 text-sm text-muted-foreground",children:[f.jsx("p",{className:"font-medium text-foreground",children:"Finish previous steps first"}),f.jsx("p",{className:"mt-2",children:"Select at least one server and choose a model to unlock test authoring. That ensures generated tests know which stack to target."})]}):f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"flex flex-wrap items-center justify-between gap-2",children:f.jsx("div",{className:"flex items-center gap-2",children:f.jsxs(Ie,{type:"button",variant:"outline",size:"lg",onClick:re,disabled:a,children:[f.jsx("span",{className:"bg-gradient-to-r from-purple-600 via-violet-600 to-indigo-600 bg-clip-text text-transparent",children:a?"Generating...":"Generate tests"}),f.jsx(yB,{className:"h-4 w-4 ml-2 fill-purple-600"})]})})}),a&&f.jsx("div",{className:"flex items-center justify-center rounded-lg border p-6",children:f.jsx("div",{className:"text-center text-sm text-muted-foreground",children:"Generating test cases..."})}),!a&&f.jsxs("div",{className:"space-y-12",children:[j.map((B,J)=>f.jsxs("div",{className:"space-y-3 rounded-lg border bg-background p-4",children:[f.jsxs("div",{className:"flex items-start justify-between gap-3",children:[f.jsxs("div",{className:"flex flex-col flex-1 space-y-2",children:[f.jsx(Hc,{className:"text-xs uppercase text-muted-foreground",children:"Title"}),f.jsx(Un,{className:"w-full",value:B.title,onChange:oe=>P(J,"title",oe.target.value),placeholder:"(Paypal) List transactions"})]}),j.length>1&&f.jsx(Ie,{type:"button",variant:"ghost",size:"sm",onClick:()=>te(J),children:f.jsx(Nu,{className:"h-4 w-4"})})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(Hc,{className:"text-xs uppercase text-muted-foreground",children:"Query"}),f.jsx(Ho,{value:B.query,onChange:oe=>P(J,"query",oe.target.value),placeholder:"Can you find the most recent Paypal transactions, then create an invoice?",rows:3})]}),f.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx(Hc,{className:"text-xs uppercase text-muted-foreground",children:"Runs"}),f.jsx(Un,{type:"number",min:1,value:B.runs,onChange:oe=>P(J,"runs",Number(oe.target.value)>0?Number(oe.target.value):1)})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(Hc,{className:"text-xs uppercase text-muted-foreground",children:"Expected tools (comma separated)"}),f.jsx(Un,{value:B.expectedToolCalls.join(", "),onChange:oe=>P(J,"expectedToolCalls",oe.target.value.split(",").map(fe=>fe.trim()).filter(Boolean)),placeholder:"paypal_list_transactions, paypal_create_invoice"})]})]})]},J)),f.jsxs(Ie,{type:"button",variant:"outline",onClick:H,"aria-label":"Add test",className:"w-full",children:[f.jsx(Ab,{className:"h-4 w-4 mr-2"}),"Add test case"]})]})]})]});case"review":return f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx("h3",{className:"text-lg",children:"Review your tests"}),f.jsx("p",{className:"text-sm text-muted-foreground",children:"After confirming the run, you will see your run begin in the eval results tab."})]}),f.jsxs("div",{className:"space-y-4 rounded-lg border bg-background p-4",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{children:[f.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Servers"}),f.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:S.map(B=>f.jsx(vr,{variant:"outline",children:B},B))})]}),f.jsx(Ie,{type:"button",variant:"ghost",size:"sm",onClick:()=>d(0),children:"Edit"})]}),f.jsx(Ck,{}),f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{children:[f.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Model"}),T?f.jsx("div",{className:"mt-2 flex items-center gap-2",children:f.jsx(vr,{variant:"outline",children:T.name})}):f.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"No model selected"})]}),f.jsx(Ie,{type:"button",variant:"ghost",size:"sm",onClick:()=>d(1),children:"Edit"})]}),f.jsx(Ck,{}),f.jsxs("div",{className:"flex items-start justify-between gap-6",children:[f.jsxs("div",{className:"flex-1",children:[f.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Tests"}),f.jsx("div",{className:"mt-3 space-y-3",children:z.map((B,J)=>f.jsxs("div",{className:"rounded-md border bg-muted/30 p-3",children:[f.jsx("p",{className:"text-sm font-semibold text-foreground",children:B.title}),f.jsx("p",{className:"mt-1 line-clamp-2 text-sm text-muted-foreground",children:B.query}),f.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-3 text-xs text-muted-foreground",children:[f.jsxs("span",{children:[B.runs," run",B.runs===1?"":"s"]}),B.expectedToolCalls.length>0&&f.jsxs("span",{children:["Tools: ",B.expectedToolCalls.join(", ")]})]})]},J))})]}),f.jsx(Ie,{type:"button",variant:"ghost",size:"sm",onClick:()=>d(2),children:"Edit"})]})]})]});default:return null}},V=f.jsx("ol",{className:"flex flex-col items-center gap-4 text-center md:flex-row md:gap-6",children:wl.map((B,J)=>{const oe=u===J,fe=J<u&&J<=W,be=J<=Math.max(W,u);return f.jsx("li",{className:"flex flex-col items-center gap-2",children:f.jsxs("button",{type:"button",onClick:()=>be?d(J):void 0,disabled:!be,className:Me("flex flex-col items-center gap-2 transition",!be&&"cursor-not-allowed opacity-60"),children:[f.jsx("span",{className:Me("flex h-8 w-8 items-center justify-center rounded-full border text-sm font-medium",fe&&"border-primary bg-primary text-primary-foreground",oe&&!fe&&"border-primary bg-primary/10 text-primary",!oe&&!fe&&"border-border text-muted-foreground"),children:J+1}),f.jsx("span",{className:Me("text-xs leading-tight",oe?"text-foreground":"text-muted-foreground"),children:B.title})]})},B.key)})}),U=u<wl.length-1?!X:s||!X,K=U?"secondary":"default",ae=f.jsxs("div",{className:Me("mx-auto flex w-full flex-col gap-8 pb-10 pt-4",e?"max-w-none px-4 sm:px-6 md:px-12 lg:px-32":"max-w-3xl px-4"),children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[f.jsxs(Ie,{type:"button",variant:"outline",onClick:D,disabled:u===0,"aria-label":"Back",className:"justify-center gap-2",children:[f.jsx(Kre,{className:"h-4 w-4"}),"Back"]}),f.jsx("div",{className:"flex flex-1 justify-center",children:f.jsx("div",{className:"max-w-xl",children:V})}),f.jsxs(Ie,{type:"button",variant:K,onClick:()=>{u<wl.length-1?ue():Z()},disabled:U,"aria-label":u===wl.length-1?"Start":"Next",className:Me("justify-center gap-2",!U&&"shadow-sm"),children:[u===wl.length-1?"Start":"Next",f.jsx(Ba,{className:"h-4 w-4"})]})]}),f.jsx("div",{className:"space-y-6",children:he()})]});return e?ae:f.jsxs(aa,{open:n,onOpenChange:r,children:[f.jsx(eN,{asChild:!0,children:f.jsxs(Ie,{children:[f.jsx(Ab,{className:"mr-2 h-4 w-4"}),"New eval run"]})}),f.jsxs(oa,{className:"max-h-[80vh] w-full max-w-4xl overflow-y-auto sm:max-w-4xl",children:[f.jsxs(la,{className:"mx-auto w-full max-w-3xl gap-1 text-left",children:[f.jsx(ca,{children:"Create eval run"}),f.jsx(Jf,{children:"Follow the guided steps to configure your evaluation and run it with confidence."})]}),ae]})]})}function nTe(){const{isAuthenticated:t,isLoading:e}=Xa(),{user:n}=da(),{availableModels:r}=fV({systemPrompt:"",temperature:1,selectedServers:[]});return e?f.jsx("div",{className:"p-6",children:f.jsx("div",{className:"flex h-64 items-center justify-center",children:f.jsxs("div",{className:"text-center",children:[f.jsx("div",{className:"mx-auto h-8 w-8 animate-spin rounded-full border-b-2 border-primary"}),f.jsx("p",{className:"mt-4 text-muted-foreground",children:"Loading..."})]})})}):!t||!n?f.jsx("div",{className:"p-6",children:f.jsx(th,{icon:mB,title:"Sign in to run evals",description:"Create an account or sign in to generate and launch evaluation runs.",className:"h-[calc(100vh-200px)]"})}):f.jsxs("div",{className:"space-y-6 p-6",children:[f.jsx("div",{className:"space-y-2",children:f.jsx("h1",{className:"text-2xl font-semibold",children:"Evaluation runner"})}),f.jsx("div",{className:"w-full",children:f.jsx(tTe,{availableModels:r,inline:!0})})]})}function rTe({config:t,isConfigured:e,onEdit:n,onDelete:r}){const s=t.description?.trim();return f.jsxs(Fa,{className:Me("group h-full gap-4 border bg-card px-6 py-6 transition-all hover:border-primary/40 hover:shadow-md dark:hover:shadow-xl",e?"border-green-200/80 dark:border-green-400/30":"border-border/60"),children:[f.jsxs("div",{className:"flex items-start justify-between gap-6",children:[f.jsxs("div",{className:"flex items-center gap-4",children:[f.jsx("img",{src:t.logo,alt:t.logoAlt,className:"size-6 object-contain"}),f.jsxs("div",{className:"",children:[f.jsxs("h3",{className:"text-md font-semibold text-foreground pb-1",children:[t.name," ",e&&f.jsx("span",{className:"text-md",children:"✔️"})]}),s?f.jsx("p",{className:"line-clamp-2 text-xs leading-relaxed text-muted-foreground",children:s}):null]})]}),e?f.jsxs(p0,{children:[f.jsx(m0,{asChild:!0,children:f.jsx(Ie,{size:"icon",variant:"ghost",className:"size-8 rounded-md border border-transparent hover:bg-muted/50",children:f.jsx(bse,{className:"size-4"})})}),f.jsx(g0,{align:"end",className:"w-44",children:f.jsx(To,{variant:"destructive",onClick:()=>r(t.id),children:"Remove provider"})})]}):null]}),f.jsx("div",{className:"space-y-4",children:f.jsx(Ie,{size:"sm",variant:e?"outline":"secondary",className:"w-full",onClick:()=>n(t.id),children:e?"Manage":"Configure"})})]})}function sTe({baseUrl:t,onEdit:e}){const n=!!t;return f.jsxs(Fa,{className:Me("group h-full gap-4 border bg-card px-6 py-6 transition-all hover:border-primary/40 hover:shadow-md dark:hover:shadow-xl",n?"border-green-200/80 dark:border-green-400/30":"border-border/60"),children:[f.jsx("div",{className:"flex items-start justify-between gap-6",children:f.jsxs("div",{className:"flex items-center gap-4",children:[f.jsx("img",{src:"/ollama_logo.svg",alt:"Ollama",className:"size-6 object-contain"}),f.jsxs("div",{className:"",children:[f.jsxs("h3",{className:"text-md font-semibold text-foreground pb-1",children:["Ollama ",n&&f.jsx("span",{className:"text-md",children:"✔️"})]}),f.jsx("p",{className:"line-clamp-2 text-xs leading-relaxed text-muted-foreground",children:n?"Local models available":"Install and connect Ollama locally"})]})]})}),f.jsx("div",{className:"space-y-4",children:f.jsx(Ie,{size:"sm",variant:n?"outline":"secondary",className:"w-full",onClick:e,children:n?"Manage":"Configure"})})]})}function iTe({providerConfigs:t,hasToken:e,onEditProvider:n,onDeleteProvider:r,ollamaBaseUrl:s,onEditOllama:i}){return f.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-4",children:[t.map(a=>{const l=e(a.id);return f.jsx(rTe,{config:a,isConfigured:l,onEdit:n,onDelete:r},a.id)}),f.jsx(sTe,{baseUrl:s,onEdit:i})]})}function aTe({open:t,onOpenChange:e,provider:n,value:r,onValueChange:s,onSave:i,onCancel:a}){const l=ua();return f.jsx(aa,{open:t,onOpenChange:e,children:f.jsxs(oa,{className:"max-w-md",children:[f.jsx(la,{children:f.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[n&&f.jsx("div",{className:"w-12 h-12 rounded-lg bg-white p-2 border",children:f.jsx("img",{src:n.logo,alt:n.logoAlt,className:"w-full h-full object-contain"})}),f.jsxs("div",{children:[f.jsxs(ca,{className:"text-left",children:["Configure ",n?.name]}),f.jsx(Jf,{className:"text-left",children:n?.description})]})]})}),f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{children:[f.jsx("label",{htmlFor:"api-key",className:"text-sm font-medium",children:"API Key"}),f.jsx(Un,{id:"api-key",type:"password",value:r,onChange:u=>s(u.target.value),placeholder:n?.placeholder,className:"mt-1"})]}),f.jsxs("div",{className:"flex items-center gap-2 p-3 bg-blue-50 dark:bg-blue-950/20 rounded-lg",children:[f.jsx(JA,{className:"w-4 h-4 text-blue-600"}),f.jsxs("span",{className:"text-sm text-blue-600",children:["Need an API key?"," ",f.jsx("button",{onClick:()=>n&&window.open(n.getApiKeyUrl,"_blank"),className:"underline hover:no-underline",children:"Get one here"})]})]})]}),f.jsxs(v0,{children:[f.jsx(Ie,{variant:"outline",onClick:a,children:"Cancel"}),f.jsx(Ie,{onClick:()=>{l.capture("save_api_key",{location:"provider_config_dialog",platform:Ni(),environment:void 0}),i()},disabled:!r.trim(),children:"Save API Key"})]})]})})}function oTe({open:t,onOpenChange:e,value:n,onValueChange:r,onSave:s,onCancel:i}){return f.jsx(aa,{open:t,onOpenChange:e,children:f.jsxs(oa,{className:"max-w-md",children:[f.jsx(la,{children:f.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[f.jsx("div",{className:"w-12 h-12 rounded-lg bg-white p-2 border",children:f.jsx("img",{src:"/ollama_logo.svg",alt:"Ollama",className:"w-full h-full object-contain"})}),f.jsxs("div",{children:[f.jsx(ca,{className:"text-left pb-2",children:"Configure Ollama URL"}),f.jsx(Jf,{className:"text-left",children:"Set the base URL for your Ollama instance"})]})]})}),f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{children:[f.jsx("label",{htmlFor:"ollama-url",className:"text-sm font-medium",children:"Base URL"}),f.jsx(Un,{id:"ollama-url",type:"url",value:n,onChange:a=>r(a.target.value),placeholder:"http://localhost:11434/api",className:"mt-1"})]}),f.jsxs("div",{className:"flex items-center gap-2 p-3 bg-blue-50 dark:bg-blue-950/20 rounded-lg",children:[f.jsx(JA,{className:"w-4 h-4 text-blue-600"}),f.jsxs("span",{className:"text-sm text-blue-600",children:["Need help?"," ",f.jsx("button",{onClick:()=>window.open("https://ollama.ai/download","_blank"),className:"underline hover:no-underline",children:"Download Ollama"})]})]})]}),f.jsxs(v0,{children:[f.jsx(Ie,{variant:"outline",onClick:i,children:"Cancel"}),f.jsx(Ie,{onClick:s,disabled:!n.trim(),children:"Save URL"})]})]})})}function lTe({...t}){return f.jsx(kJ,{"data-slot":"alert-dialog",...t})}function cTe({...t}){return f.jsx(TJ,{"data-slot":"alert-dialog-trigger",...t})}function uTe({...t}){return f.jsx(CJ,{"data-slot":"alert-dialog-portal",...t})}function dTe({className:t,...e}){return f.jsx(AJ,{"data-slot":"alert-dialog-overlay",className:Me("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...e})}function fTe({className:t,...e}){return f.jsxs(uTe,{children:[f.jsx(dTe,{}),f.jsx(NJ,{"data-slot":"alert-dialog-content",className:Me("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...e})]})}function hTe({className:t,...e}){return f.jsx("div",{"data-slot":"alert-dialog-header",className:Me("flex flex-col gap-2 text-center sm:text-left",t),...e})}function pTe({className:t,...e}){return f.jsx("div",{"data-slot":"alert-dialog-footer",className:Me("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...e})}function mTe({className:t,...e}){return f.jsx(MJ,{"data-slot":"alert-dialog-title",className:Me("text-lg font-semibold",t),...e})}function gTe({className:t,...e}){return f.jsx(OJ,{"data-slot":"alert-dialog-description",className:Me("text-muted-foreground text-sm",t),...e})}function vTe({className:t,...e}){return f.jsx(RJ,{className:Me(QA(),t),...e})}function yTe({className:t,...e}){return f.jsx(jJ,{className:Me(QA({variant:"outline"}),t),...e})}function xn(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function Jl(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}const v7=6048e5,bTe=864e5,y7=6e4,b7=36e5,ky=43200,W4=1440;let xTe={};function Rg(){return xTe}function Zm(t,e){const n=Rg(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=xn(t),i=s.getDay(),a=(i<r?7:0)+i-r;return s.setDate(s.getDate()-a),s.setHours(0,0,0,0),s}function Ex(t){return Zm(t,{weekStartsOn:1})}function x7(t){const e=xn(t),n=e.getFullYear(),r=Jl(t,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const s=Ex(r),i=Jl(t,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const a=Ex(i);return e.getTime()>=s.getTime()?n+1:e.getTime()>=a.getTime()?n:n-1}function Y4(t){const e=xn(t);return e.setHours(0,0,0,0),e}function kx(t){const e=xn(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function _Te(t,e){const n=Y4(t),r=Y4(e),s=+n-kx(n),i=+r-kx(r);return Math.round((s-i)/bTe)}function wTe(t){const e=x7(t),n=Jl(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),Ex(n)}function lb(t,e){const n=xn(t),r=xn(e),s=n.getTime()-r.getTime();return s<0?-1:s>0?1:s}function STe(t){return Jl(t,Date.now())}function ETe(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function kTe(t){if(!ETe(t)&&typeof t!="number")return!1;const e=xn(t);return!isNaN(Number(e))}function TTe(t,e){const n=xn(t),r=xn(e),s=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return s*12+i}function CTe(t){return e=>{const r=(t?Math[t]:Math.trunc)(e);return r===0?0:r}}function ATe(t,e){return+xn(t)-+xn(e)}function NTe(t){const e=xn(t);return e.setHours(23,59,59,999),e}function RTe(t){const e=xn(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(23,59,59,999),e}function jTe(t){const e=xn(t);return+NTe(e)==+RTe(e)}function MTe(t,e){const n=xn(t),r=xn(e),s=lb(n,r),i=Math.abs(TTe(n,r));let a;if(i<1)a=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-s*i);let l=lb(n,r)===-s;jTe(xn(t))&&i===1&&lb(t,r)===1&&(l=!1),a=s*(i-Number(l))}return a===0?0:a}function OTe(t,e,n){const r=ATe(t,e)/1e3;return CTe(n?.roundingMethod)(r)}function PTe(t){const e=xn(t),n=Jl(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}const ITe={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},DTe=(t,e,n)=>{let r;const s=ITe[t];return typeof s=="string"?r=s:e===1?r=s.one:r=s.other.replace("{{count}}",e.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function U1(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const LTe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},$Te={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},zTe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},FTe={date:U1({formats:LTe,defaultWidth:"full"}),time:U1({formats:$Te,defaultWidth:"full"}),dateTime:U1({formats:zTe,defaultWidth:"full"})},UTe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},BTe=(t,e,n,r)=>UTe[t];function kp(t){return(e,n)=>{const r=n?.context?String(n.context):"standalone";let s;if(r==="formatting"&&t.formattingValues){const a=t.defaultFormattingWidth||t.defaultWidth,l=n?.width?String(n.width):a;s=t.formattingValues[l]||t.formattingValues[a]}else{const a=t.defaultWidth,l=n?.width?String(n.width):t.defaultWidth;s=t.values[l]||t.values[a]}const i=t.argumentCallback?t.argumentCallback(e):e;return s[i]}}const qTe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},VTe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},HTe={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},GTe={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},WTe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},YTe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},KTe=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},XTe={ordinalNumber:KTe,era:kp({values:qTe,defaultWidth:"wide"}),quarter:kp({values:VTe,defaultWidth:"wide",argumentCallback:t=>t-1}),month:kp({values:HTe,defaultWidth:"wide"}),day:kp({values:GTe,defaultWidth:"wide"}),dayPeriod:kp({values:WTe,defaultWidth:"wide",formattingValues:YTe,defaultFormattingWidth:"wide"})};function Tp(t){return(e,n={})=>{const r=n.width,s=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(s);if(!i)return null;const a=i[0],l=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(l)?JTe(l,h=>h.test(a)):QTe(l,h=>h.test(a));let d;d=t.valueCallback?t.valueCallback(u):u,d=n.valueCallback?n.valueCallback(d):d;const p=e.slice(a.length);return{value:d,rest:p}}}function QTe(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function JTe(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function ZTe(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const s=r[0],i=e.match(t.parsePattern);if(!i)return null;let a=t.valueCallback?t.valueCallback(i[0]):i[0];a=n.valueCallback?n.valueCallback(a):a;const l=e.slice(s.length);return{value:a,rest:l}}}const eCe=/^(\d+)(th|st|nd|rd)?/i,tCe=/\d+/i,nCe={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},rCe={any:[/^b/i,/^(a|c)/i]},sCe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},iCe={any:[/1/i,/2/i,/3/i,/4/i]},aCe={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},oCe={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},lCe={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},cCe={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},uCe={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},dCe={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},fCe={ordinalNumber:ZTe({matchPattern:eCe,parsePattern:tCe,valueCallback:t=>parseInt(t,10)}),era:Tp({matchPatterns:nCe,defaultMatchWidth:"wide",parsePatterns:rCe,defaultParseWidth:"any"}),quarter:Tp({matchPatterns:sCe,defaultMatchWidth:"wide",parsePatterns:iCe,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Tp({matchPatterns:aCe,defaultMatchWidth:"wide",parsePatterns:oCe,defaultParseWidth:"any"}),day:Tp({matchPatterns:lCe,defaultMatchWidth:"wide",parsePatterns:cCe,defaultParseWidth:"any"}),dayPeriod:Tp({matchPatterns:uCe,defaultMatchWidth:"any",parsePatterns:dCe,defaultParseWidth:"any"})},_7={code:"en-US",formatDistance:DTe,formatLong:FTe,formatRelative:BTe,localize:XTe,match:fCe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function hCe(t){const e=xn(t);return _Te(e,PTe(e))+1}function pCe(t){const e=xn(t),n=+Ex(e)-+wTe(e);return Math.round(n/v7)+1}function w7(t,e){const n=xn(t),r=n.getFullYear(),s=Rg(),i=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,a=Jl(t,0);a.setFullYear(r+1,0,i),a.setHours(0,0,0,0);const l=Zm(a,e),u=Jl(t,0);u.setFullYear(r,0,i),u.setHours(0,0,0,0);const d=Zm(u,e);return n.getTime()>=l.getTime()?r+1:n.getTime()>=d.getTime()?r:r-1}function mCe(t,e){const n=Rg(),r=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=w7(t,e),i=Jl(t,0);return i.setFullYear(s,0,r),i.setHours(0,0,0,0),Zm(i,e)}function gCe(t,e){const n=xn(t),r=+Zm(n,e)-+mCe(n,e);return Math.round(r/v7)+1}function dn(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const Sl={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return dn(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):dn(n+1,2)},d(t,e){return dn(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return dn(t.getHours()%12||12,e.length)},H(t,e){return dn(t.getHours(),e.length)},m(t,e){return dn(t.getMinutes(),e.length)},s(t,e){return dn(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),s=Math.trunc(r*Math.pow(10,n-3));return dn(s,e.length)}},Ad={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},K4={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),s=r>0?r:1-r;return n.ordinalNumber(s,{unit:"year"})}return Sl.y(t,e)},Y:function(t,e,n,r){const s=w7(t,r),i=s>0?s:1-s;if(e==="YY"){const a=i%100;return dn(a,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):dn(i,e.length)},R:function(t,e){const n=x7(t);return dn(n,e.length)},u:function(t,e){const n=t.getFullYear();return dn(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return dn(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return dn(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return Sl.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return dn(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const s=gCe(t,r);return e==="wo"?n.ordinalNumber(s,{unit:"week"}):dn(s,e.length)},I:function(t,e,n){const r=pCe(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):dn(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):Sl.d(t,e)},D:function(t,e,n){const r=hCe(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):dn(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const s=t.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return dn(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const s=t.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return dn(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),s=r===0?7:r;switch(e){case"i":return String(s);case"ii":return dn(s,e.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const s=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let s;switch(r===12?s=Ad.noon:r===0?s=Ad.midnight:s=r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let s;switch(r>=17?s=Ad.evening:r>=12?s=Ad.afternoon:r>=4?s=Ad.morning:s=Ad.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Sl.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):Sl.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):dn(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):dn(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):Sl.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):Sl.s(t,e)},S:function(t,e){return Sl.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return Q4(r);case"XXXX":case"XX":return qc(r);case"XXXXX":case"XXX":default:return qc(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return Q4(r);case"xxxx":case"xx":return qc(r);case"xxxxx":case"xxx":default:return qc(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+X4(r,":");case"OOOO":default:return"GMT"+qc(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+X4(r,":");case"zzzz":default:return"GMT"+qc(r,":")}},t:function(t,e,n){const r=Math.trunc(t.getTime()/1e3);return dn(r,e.length)},T:function(t,e,n){const r=t.getTime();return dn(r,e.length)}};function X4(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),s=Math.trunc(r/60),i=r%60;return i===0?n+String(s):n+String(s)+e+dn(i,2)}function Q4(t,e){return t%60===0?(t>0?"-":"+")+dn(Math.abs(t)/60,2):qc(t,e)}function qc(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),s=dn(Math.trunc(r/60),2),i=dn(r%60,2);return n+s+e+i}const J4=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},S7=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},vCe=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return J4(t,e);let i;switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",J4(r,e)).replace("{{time}}",S7(s,e))},yCe={p:S7,P:vCe},bCe=/^D+$/,xCe=/^Y+$/,_Ce=["D","DD","YY","YYYY"];function wCe(t){return bCe.test(t)}function SCe(t){return xCe.test(t)}function ECe(t,e,n){const r=kCe(t,e,n);if(console.warn(r),_Ce.includes(t))throw new RangeError(r)}function kCe(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const TCe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,CCe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ACe=/^'([^]*?)'?$/,NCe=/''/g,RCe=/[a-zA-Z]/;function E7(t,e,n){const r=Rg(),s=r.locale??_7,i=r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=r.weekStartsOn??r.locale?.options?.weekStartsOn??0,l=xn(t);if(!kTe(l))throw new RangeError("Invalid time value");let u=e.match(CCe).map(p=>{const h=p[0];if(h==="p"||h==="P"){const g=yCe[h];return g(p,s.formatLong)}return p}).join("").match(TCe).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const h=p[0];if(h==="'")return{isToken:!1,value:jCe(p)};if(K4[h])return{isToken:!0,value:p};if(h.match(RCe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");return{isToken:!1,value:p}});s.localize.preprocessor&&(u=s.localize.preprocessor(l,u));const d={firstWeekContainsDate:i,weekStartsOn:a,locale:s};return u.map(p=>{if(!p.isToken)return p.value;const h=p.value;(SCe(h)||wCe(h))&&ECe(h,e,String(t));const g=K4[h[0]];return g(l,h,s.localize,d)}).join("")}function jCe(t){const e=t.match(ACe);return e?e[1].replace(NCe,"'"):t}function MCe(t,e,n){const r=Rg(),s=n?.locale??r.locale??_7,i=2520,a=lb(t,e);if(isNaN(a))throw new RangeError("Invalid time value");const l=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:a});let u,d;a>0?(u=xn(e),d=xn(t)):(u=xn(t),d=xn(e));const p=OTe(d,u),h=(kx(d)-kx(u))/1e3,g=Math.round((p-h)/60);let v;if(g<2)return n?.includeSeconds?p<5?s.formatDistance("lessThanXSeconds",5,l):p<10?s.formatDistance("lessThanXSeconds",10,l):p<20?s.formatDistance("lessThanXSeconds",20,l):p<40?s.formatDistance("halfAMinute",0,l):p<60?s.formatDistance("lessThanXMinutes",1,l):s.formatDistance("xMinutes",1,l):g===0?s.formatDistance("lessThanXMinutes",1,l):s.formatDistance("xMinutes",g,l);if(g<45)return s.formatDistance("xMinutes",g,l);if(g<90)return s.formatDistance("aboutXHours",1,l);if(g<W4){const b=Math.round(g/60);return s.formatDistance("aboutXHours",b,l)}else{if(g<i)return s.formatDistance("xDays",1,l);if(g<ky){const b=Math.round(g/W4);return s.formatDistance("xDays",b,l)}else if(g<ky*2)return v=Math.round(g/ky),s.formatDistance("aboutXMonths",v,l)}if(v=MTe(d,u),v<12){const b=Math.round(g/ky);return s.formatDistance("xMonths",b,l)}else{const b=v%12,x=Math.trunc(v/12);return b<3?s.formatDistance("aboutXYears",x,l):b<9?s.formatDistance("overXYears",x,l):s.formatDistance("almostXYears",x+1,l)}}function OCe(t,e){return MCe(t,STe(t),e)}function PCe(t,e){const r=$Ce(t);let s;if(r.date){const u=zCe(r.date,2);s=FCe(u.restDateString,u.year)}if(!s||isNaN(s.getTime()))return new Date(NaN);const i=s.getTime();let a=0,l;if(r.time&&(a=UCe(r.time),isNaN(a)))return new Date(NaN);if(r.timezone){if(l=BCe(r.timezone),isNaN(l))return new Date(NaN)}else{const u=new Date(i+a),d=new Date(0);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return new Date(i+a+l)}const Ty={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ICe=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,DCe=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,LCe=/^([+-])(\d{2})(?::?(\d{2}))?$/;function $Ce(t){const e={},n=t.split(Ty.dateTimeDelimiter);let r;if(n.length>2)return e;if(/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],Ty.timeZoneDelimiter.test(e.date)&&(e.date=t.split(Ty.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length))),r){const s=Ty.timezone.exec(r);s?(e.time=r.replace(s[1],""),e.timezone=s[1]):e.time=r}return e}function zCe(t,e){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=t.match(n);if(!r)return{year:NaN,restDateString:""};const s=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:i===null?s:i*100,restDateString:t.slice((r[1]||r[2]).length)}}function FCe(t,e){if(e===null)return new Date(NaN);const n=t.match(ICe);if(!n)return new Date(NaN);const r=!!n[4],s=Cp(n[1]),i=Cp(n[2])-1,a=Cp(n[3]),l=Cp(n[4]),u=Cp(n[5])-1;if(r)return WCe(e,l,u)?qCe(e,l,u):new Date(NaN);{const d=new Date(0);return!HCe(e,i,a)||!GCe(e,s)?new Date(NaN):(d.setUTCFullYear(e,i,Math.max(s,a)),d)}}function Cp(t){return t?parseInt(t):1}function UCe(t){const e=t.match(DCe);if(!e)return NaN;const n=B1(e[1]),r=B1(e[2]),s=B1(e[3]);return YCe(n,r,s)?n*b7+r*y7+s*1e3:NaN}function B1(t){return t&&parseFloat(t.replace(",","."))||0}function BCe(t){if(t==="Z")return 0;const e=t.match(LCe);if(!e)return 0;const n=e[1]==="+"?-1:1,r=parseInt(e[2]),s=e[3]&&parseInt(e[3])||0;return KCe(r,s)?n*(r*b7+s*y7):NaN}function qCe(t,e,n){const r=new Date(0);r.setUTCFullYear(t,0,4);const s=r.getUTCDay()||7,i=(e-1)*7+n+1-s;return r.setUTCDate(r.getUTCDate()+i),r}const VCe=[31,null,31,30,31,30,31,31,30,31,30,31];function k7(t){return t%400===0||t%4===0&&t%100!==0}function HCe(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(VCe[e]||(k7(t)?29:28))}function GCe(t,e){return e>=1&&e<=(k7(t)?366:365)}function WCe(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function YCe(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function KCe(t,e){return e>=0&&e<=59}function Z4({value:t,isCopied:e,onCopy:n,copyLabel:r,tooltip:s="Copy to clipboard"}){return f.jsxs("div",{className:"relative w-full",children:[f.jsx(Un,{readOnly:!0,value:t,className:"h-12 w-full rounded-lg border border-border/40 bg-background/50 font-mono text-sm tracking-wide text-foreground pr-16 shadow-sm focus-visible:border-primary focus-visible:ring-1 focus-visible:ring-primary/20",style:{fontFamily:'ui-monospace, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace'}}),f.jsxs(Ma,{children:[f.jsx(Oa,{asChild:!0,children:f.jsx(Ie,{type:"button",variant:"ghost",onClick:n,className:"absolute right-3 top-3 h-6 w-6 p-0 rounded-md border-0 bg-transparent text-foreground/60 hover:text-foreground hover:bg-foreground/10 transition-all duration-200",children:e?f.jsx(Ti,{className:"h-4 w-4"}):f.jsx(Po,{className:"h-4 w-4"})})}),f.jsx(Pa,{side:"bottom",children:s})]})]})}function XCe(){const[t,e]=w.useState(null),[n,r]=w.useState(!1),[s,i]=w.useState(!1),[a,l]=w.useState(!1),[u,d]=w.useState(!1),{isAuthenticated:p,isLoading:h}=Xa(),{signIn:g}=da(),v=ua(),b=Sx("apiKeys:list"),x=d7("apiKeys:regenerateAndGet"),E=async()=>{if(t)try{await navigator.clipboard.writeText(t),i(!0),setTimeout(()=>i(!1),2e3)}catch(R){console.error("Clipboard error",R)}},S=async()=>{if(!p)return!1;try{r(!0),i(!1);const R=await x();return e(R.apiKey),d(!0),!0}catch(R){return console.error("Failed to generate key",R),!1}finally{r(!1)}};if(h)return f.jsx("div",{className:"rounded-md border p-3 text-sm text-muted-foreground",children:"Checking authentication…"});if(!p)return f.jsxs("div",{className:"space-y-3 rounded-md border p-4",children:[f.jsx("div",{className:"flex items-center gap-2",children:f.jsx("h3",{className:"text-lg font-semibold",children:"MCPJam API Key"})}),f.jsx("p",{className:"text-sm text-muted-foreground",children:"Sign in to view and manage your API key."}),f.jsx(Ie,{type:"button",onClick:()=>{v.capture("sign_in",{location:"account_api_key_section",platform:Ni(),environment:void 0}),g()},size:"sm",children:"Sign in"})]});const k=b&&b.length>0?b[0]:null,T=(R,j="Never")=>{if(!R)return j;const A=new Date(R),N=OCe(A,{addSuffix:!0});return`${E7(A,"PP p")} · ${N}`};return f.jsxs("div",{className:"space-y-4",children:[f.jsx("div",{className:"flex items-center gap-2",children:f.jsx("h3",{className:"text-lg font-semibold",children:"MCPJam API Key"})}),b===void 0?f.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading API key status…"}):t?f.jsxs("div",{className:"space-y-4",children:[f.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:"Copy and save this key now. You won't be able to view it again later."}),f.jsx(Z4,{value:t,isCopied:s,onCopy:E,copyLabel:"Copy key"})]}):(b?.length??0)===0?f.jsx("div",{className:"space-y-4",children:f.jsx(Ie,{type:"button",onClick:()=>{S()},disabled:n,children:n?"Generating…":"Generate API key"})}):f.jsxs("div",{className:"space-y-4",children:[f.jsx("div",{className:"flex items-center justify-between",children:f.jsxs(lTe,{open:a,onOpenChange:l,children:[f.jsx(cTe,{asChild:!0,children:f.jsxs(Ie,{type:"button",variant:"outline",disabled:n,className:"inline-flex items-center gap-2.5 rounded-lg border border-border/50 bg-background px-4 py-2.5 text-sm font-medium text-foreground/80 hover:border-border hover:bg-background/80 hover:text-foreground transition-all duration-200",children:[f.jsx(ir,{className:`h-4 w-4 ${n?"animate-spin":""} text-foreground/60`}),f.jsx("span",{children:n?"Regenerating…":"Regenerate"})]})}),f.jsxs(fTe,{children:[f.jsxs(hTe,{children:[f.jsx(mTe,{className:"text-lg font-semibold",children:"Confirm"}),f.jsx(gTe,{className:"text-sm text-muted-foreground leading-relaxed",children:"Regenerating an API key will replace your previous API key."})]}),f.jsxs(pTe,{className:"gap-3",children:[f.jsx(yTe,{disabled:n,className:"font-medium",children:"Cancel"}),f.jsx(vTe,{onClick:async R=>{R.preventDefault(),await S()&&l(!1)},disabled:n,className:"font-medium",children:n?"Regenerating…":"Regenerate"})]})]})]})}),k?f.jsx("div",{className:"rounded-lg border border-border/30 bg-background/50 p-4",children:f.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[f.jsxs("div",{className:"flex flex-col gap-0.5",children:[f.jsx("span",{className:"text-xs font-medium text-foreground/50 uppercase tracking-wide",children:"Created"}),f.jsx("span",{className:"text-xs text-foreground/70",children:T(k.createdAt)})]}),f.jsxs("div",{className:"flex flex-col gap-0.5",children:[f.jsx("span",{className:"text-xs font-medium text-foreground/50 uppercase tracking-wide",children:"Last Used"}),f.jsx("span",{className:"text-xs text-foreground/70",children:T(k.lastUsedAt,"Never used")})]})]})}):null]}),f.jsx(aa,{open:!!t&&u,onOpenChange:R=>{R||i(!1),d(R)},children:f.jsxs(oa,{children:[f.jsxs(la,{children:[f.jsx(ca,{children:"API Key"}),f.jsx(Jf,{children:"Copy and store this key securely. You will not be able to view it again."})]}),f.jsx(Z4,{value:t??"",isCopied:s,onCopy:E,copyLabel:"Copy"})]})})]})}function QCe(){const{tokens:t,setToken:e,clearToken:n,hasToken:r,getOllamaBaseUrl:s,setOllamaBaseUrl:i}=rR(),[a,l]=w.useState(""),[u,d]=w.useState(!1),[p,h]=w.useState(null),[g,v]=w.useState(!1),[b,x]=w.useState(""),E=[{id:"openai",name:"OpenAI",logo:"/openai_logo.png",logoAlt:"OpenAI",description:"GPT-4, GPT-4o, GPT-4o-mini, GPT-4.1, GPT-5, etc.",placeholder:"sk-...",getApiKeyUrl:"https://platform.openai.com/api-keys"},{id:"anthropic",name:"Anthropic",logo:"/claude_logo.png",logoAlt:"Claude",description:"Claude 3.5, Claude 3.7, Claude Opus 4, etc.",placeholder:"sk-ant-...",getApiKeyUrl:"https://console.anthropic.com/"},{id:"deepseek",name:"DeepSeek",logo:"/deepseek_logo.svg",logoAlt:"DeepSeek",description:"DeepSeek Chat, DeepSeek Reasoner, etc.",placeholder:"sk-...",getApiKeyUrl:"https://platform.deepseek.com/api_keys"},{id:"google",name:"Google AI",logo:"/google_logo.png",logoAlt:"Google AI",description:"Gemini 2.5, Gemini 2.5 Flash, Gemini 2.5 Flash Lite",placeholder:"AI...",getApiKeyUrl:"https://aistudio.google.com/app/apikey"}],S=M=>{const I=E.find(O=>O.id===M);I&&(h(I),l(t[M]||""),d(!0))},k=()=>{p&&(e(p.id,a),d(!1),h(null),l(""))},T=()=>{d(!1),h(null),l("")},R=M=>{n(M)},j=()=>{x(s()),v(!0)},A=()=>{i(b),v(!1),x("")},N=()=>{v(!1),x("")};return f.jsxs("div",{className:"container mx-auto p-6 max-w-6xl space-y-8",children:[f.jsx("div",{className:"flex items-center gap-3 mb-6",children:f.jsx("h1",{className:"text-2xl font-bold",children:"Settings"})}),f.jsx(XCe,{}),f.jsxs("div",{className:"space-y-4",children:[f.jsx("div",{children:f.jsx("h3",{className:"text-lg font-semibold",children:"LLM Provider API Keys"})}),f.jsx(iTe,{providerConfigs:E,hasToken:M=>r(M),onEditProvider:S,onDeleteProvider:R,ollamaBaseUrl:s(),onEditOllama:j})]}),f.jsx(aTe,{open:u,onOpenChange:d,provider:p,value:a,onValueChange:l,onSave:k,onCancel:T}),f.jsx(oTe,{open:g,onOpenChange:v,value:b,onValueChange:x,onSave:A,onCancel:N})]})}const JCe=(t,e="HH:mm:ss.SSS")=>{const n=typeof t=="string"?PCe(t):t;return E7(n,e)},ZCe={error:"bg-red-500/10 text-red-700 border-red-200 dark:text-red-400 dark:border-red-800",warn:"bg-yellow-500/10 text-yellow-700 border-yellow-200 dark:text-yellow-400 dark:border-yellow-800",info:"bg-blue-500/10 text-blue-700 border-blue-200 dark:text-blue-400 dark:border-blue-800",debug:"bg-purple-500/10 text-purple-700 border-purple-200 dark:text-purple-400 dark:border-purple-800",trace:"bg-gray-500/10 text-gray-700 border-gray-200 dark:text-gray-400 dark:border-gray-800"};function T7({level:t}){return f.jsx(vr,{variant:"outline",className:Me("font-mono",ZCe[t]),children:t.toUpperCase()})}function eAe({entry:t,isExpanded:e,onToggleExpand:n}){const r=t.data!==void 0||t.error!==void 0;return f.jsxs("div",{className:"border rounded-lg font-mono",children:[f.jsx("div",{className:`p-3 cursor-pointer hover:bg-muted/50 ${r?"":"cursor-default"}`,onClick:r?n:void 0,children:f.jsxs("div",{className:"flex items-start gap-3",children:[r&&f.jsx("div",{className:"mt-0.5",children:e?f.jsx(Au,{className:"h-4 w-4 text-muted-foreground"}):f.jsx(Ba,{className:"h-4 w-4 text-muted-foreground"})}),f.jsx("div",{className:"flex-1 min-w-0",children:f.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[f.jsx("span",{className:"text-muted-foreground font-mono text-xs",children:`[${JCe(t.timestamp)}]`}),f.jsx(T7,{level:t.level}),f.jsx(vr,{variant:"secondary",children:t.context}),f.jsx("span",{className:"flex-1 break-words",children:t.message})]})})]})}),e&&r&&f.jsxs("div",{className:"border-t bg-muted/20 p-3 space-y-3",children:[t.data!==void 0&&f.jsxs("div",{children:[f.jsx("div",{className:"text-xs font-semibold text-muted-foreground mb-1",children:"DATA:"}),f.jsx("div",{className:"text-xs bg-background border rounded overflow-auto max-h-60",children:f.jsx(zl,{src:t.data,dark:!0,theme:"atom",enableClipboard:!0,displaySize:!1,collapseStringsAfterLength:100,style:{fontSize:"12px",fontFamily:"ui-monospace, SFMono-Regular, 'SF Mono', monospace",backgroundColor:"hsl(var(--background))",padding:"0",borderRadius:"0",border:"none"}})})]}),t.error&&f.jsxs("div",{children:[f.jsx("div",{className:"text-xs font-semibold text-muted-foreground mb-1",children:"ERROR:"}),f.jsxs("pre",{className:"text-xs bg-red-50 dark:bg-red-950/20 border border-red-200 dark:border-red-800 rounded p-2 overflow-auto max-h-40 text-red-700 dark:text-red-400",children:[t.error.message,t.error.stack&&`
|
|
1819
1819
|
|
|
1820
|
-
${t.error.stack}`]})]})]})]})}const tAe=["error","warn","info","debug","trace"];function nAe(){const{entries:t}=Qfe(),e=GN("JSON-RPC"),[n,r]=w.useState(new Set),[s,i]=w.useState("all"),[a,l]=w.useState("all"),[u,d]=w.useState(""),[p,h]=w.useState(!1),g=w.useRef(null),v=w.useRef(null),b=w.useMemo(()=>{const k=new Set;for(const T of t){const R=T?.data?.serverId;typeof R=="string"&&R.length>0&&k.add(R)}return Array.from(k).sort()},[t]),x=w.useMemo(()=>{let k=s==="all"?t:t.filter(R=>R.level===s);if(a!=="all"&&(k=k.filter(R=>R?.data?.serverId===a)),!u.trim())return k;const T=u.toLowerCase();return k.filter(R=>R.message.toLowerCase().includes(T)||R.context.toLowerCase().includes(T)||R.data&&JSON.stringify(R.data).toLowerCase().includes(T))},[t,s,a,u]);w.useEffect(()=>{const k=()=>{if(g.current){const{scrollTop:R}=g.current;h(R>200)}},T=g.current;if(T)return T.addEventListener("scroll",k),()=>T.removeEventListener("scroll",k)},[]);const E=()=>{g.current&&g.current.scrollTo({top:0,behavior:"smooth"})};w.useEffect(()=>{let k=null;try{const T=new URLSearchParams;T.set("replay","200"),k=new EventSource(`/api/mcp/servers/rpc/stream?${T.toString()}`),k.onmessage=R=>{try{const j=JSON.parse(R.data);if(j&&j.type==="rpc"){const A=j.serverId,N=j.direction,M=j.message,I=j.timestamp,O=typeof N=="string"?N.toUpperCase():"",L=M,z=typeof L?.method=="string"?L.method:L?.result!==void 0?"result":L?.error!==void 0?"error":"unknown",G=`[${A}] ${O} - ${z}`;e.
|
|
1820
|
+
${t.error.stack}`]})]})]})]})}const tAe=["error","warn","info","debug","trace"];function nAe(){const{entries:t}=Qfe(),e=GN("JSON-RPC"),[n,r]=w.useState(new Set),[s,i]=w.useState("all"),[a,l]=w.useState("all"),[u,d]=w.useState(""),[p,h]=w.useState(!1),g=w.useRef(null),v=w.useRef(null),b=w.useMemo(()=>{const k=new Set;for(const T of t){const R=T?.data?.serverId;typeof R=="string"&&R.length>0&&k.add(R)}return Array.from(k).sort()},[t]),x=w.useMemo(()=>{let k=s==="all"?t:t.filter(R=>R.level===s);if(a!=="all"&&(k=k.filter(R=>R?.data?.serverId===a)),!u.trim())return k;const T=u.toLowerCase();return k.filter(R=>R.message.toLowerCase().includes(T)||R.context.toLowerCase().includes(T)||R.data&&JSON.stringify(R.data).toLowerCase().includes(T))},[t,s,a,u]);w.useEffect(()=>{const k=()=>{if(g.current){const{scrollTop:R}=g.current;h(R>200)}},T=g.current;if(T)return T.addEventListener("scroll",k),()=>T.removeEventListener("scroll",k)},[]);const E=()=>{g.current&&g.current.scrollTo({top:0,behavior:"smooth"})};w.useEffect(()=>{let k=null;try{const T=new URLSearchParams;T.set("replay","200"),k=new EventSource(`/api/mcp/servers/rpc/stream?${T.toString()}`),k.onmessage=R=>{try{const j=JSON.parse(R.data);if(j&&j.type==="rpc"){const A=j.serverId,N=j.direction,M=j.message,I=j.timestamp,O=typeof N=="string"?N.toUpperCase():"",L=M,z=typeof L?.method=="string"?L.method:L?.result!==void 0?"result":L?.error!==void 0?"error":"unknown",G=`[${A}] ${O} - ${z}`;e.info(G,{serverId:A,direction:N,method:z,timestamp:I,message:M})}}catch{}},k.onerror=()=>{try{k?.close()}catch{}}}catch{}return()=>{try{k?.close()}catch{}}},[e]);const S=k=>{const T=new Set(n);T.has(k)?T.delete(k):T.add(k),r(T)};return f.jsxs("div",{className:"flex flex-col h-full",children:[f.jsxs("div",{className:"border-b bg-background p-4 space-y-4 flex-shrink-0 sticky top-0 z-10",children:[f.jsx("h2",{className:"text-lg font-semibold",children:"Tracing"}),f.jsxs("div",{className:"flex items-center gap-4",children:[f.jsxs(Qc,{value:s,onValueChange:k=>i(k),children:[f.jsx(Zc,{className:"w-32",children:f.jsx(Jc,{})}),f.jsxs(eu,{children:[f.jsx(Qs,{value:"all",children:"All Levels"}),tAe.map(k=>f.jsx(Qs,{value:k,children:f.jsx(T7,{level:k})},k))]})]}),f.jsxs(Qc,{value:a,onValueChange:k=>l(k),children:[f.jsx(Zc,{className:"w-56",children:f.jsx(Jc,{placeholder:"All Servers"})}),f.jsxs(eu,{children:[f.jsx(Qs,{value:"all",children:"All Servers"}),b.map(k=>f.jsx(Qs,{value:k,children:k},k))]})]}),f.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[f.jsx(vB,{className:"h-4 w-4"}),f.jsx(Un,{placeholder:"Search logs...",value:u,onChange:k=>d(k.target.value),className:"h-8"})]})]}),f.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[f.jsxs("span",{children:["Total: ",t.length]}),f.jsxs("span",{children:["Filtered: ",x.length]})]})]}),f.jsxs("div",{ref:g,className:"flex-1 overflow-y-auto p-4 space-y-2 font-mono text-sm min-h-0",children:[x.length===0?f.jsx("div",{className:"text-center text-muted-foreground py-8",children:t.length===0?"No logs yet":"No logs match current filters"}):x.map((k,T)=>{const R=n.has(T);return f.jsx(eAe,{entry:k,isExpanded:R,onToggleExpand:()=>S(T)},`${k.timestamp}-${T}`)}),f.jsx("div",{ref:v})]}),p&&f.jsxs(Ie,{onClick:E,size:"sm",className:"fixed bottom-4 right-4 z-20 shadow-lg",variant:"secondary",children:[f.jsx(hB,{className:"h-4 w-4 mr-1"}),"Top"]})]})}const e$="mcpjam-interceptor-proxies";function rAe({connectedServerConfigs:t,selectedServer:e}){const[n,r]=w.useState({}),s=w.useRef({}),[i,a]=w.useState(!1),l=e&&e!=="none"?n[e]:null,u=k=>{try{localStorage.setItem(e$,JSON.stringify(k))}catch(T){console.error("Failed to save proxy state to localStorage:",T)}},d=w.useMemo(()=>`${new URL(window.location.href).origin}/api/mcp/interceptor`,[]),p=(k,T)=>{s.current[T]&&(s.current[T].close(),delete s.current[T]);const R=new EventSource(`${d}/${k}/stream`);R.onmessage=j=>{try{if(j.data==="[DONE]")return;const A=JSON.parse(j.data);console.log(`Stream message for ${T}:`,A),A.type==="log"&&A.log?r(N=>{const M={...N,[T]:{...N[T],logs:[...N[T]?.logs||[],A.log]}};return u(M),M}):A.type==="cleared"&&r(N=>{const M={...N,[T]:{...N[T],logs:[]}};return u(M),M})}catch(A){console.error("Error parsing stream message:",A)}},R.onopen=()=>{console.log(`Stream connected for ${T} interceptor:`,k)},R.onerror=j=>{console.error(`Stream error for ${T}:`,j)},s.current[T]=R};w.useEffect(()=>{let k=!1;return(async()=>{try{const T=localStorage.getItem(e$);if(!T)return;const R=JSON.parse(T),j=Object.entries(R).filter(([N])=>t[N]?.connectionStatus==="connected"),A={};await Promise.all(j.map(async([N,M])=>{try{const I=await fetch(`${d}/${M.interceptorId}`);!k&&I.ok&&(A[N]=M,p(M.interceptorId,N))}catch{}})),k||(r(A),u(A))}catch(T){console.error("Failed to load proxy state from localStorage:",T)}})(),()=>{k=!0,Object.values(s.current).forEach(T=>T.close()),s.current={}}},[t,d]),w.useEffect(()=>{const k=Object.keys(n).filter(T=>{const R=t[T];return!R||R.connectionStatus!=="connected"});if(k.length>0){const T={...n};let R=!1;k.forEach(j=>{console.log(`Server ${j} disconnected, cleaning up proxy`),T[j]?.interceptorId&&fetch(`${d}/${T[j].interceptorId}`,{method:"DELETE"}).catch(()=>{}),s.current[j]&&(s.current[j].close(),delete s.current[j]),delete T[j],R=!0}),R&&(r(T),u(T))}},[t,n,d]);const h=async()=>{if(!e||e==="none"){alert("Please select a connected server");return}const k=e;if(!t[k]){alert("Selected server is not connected");return}a(!0);try{const R=await(await fetch(`${d}/create`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({serverId:k})})).json();if(!R.success){alert(R.error||"Failed to create interceptor");return}const j=R.id,A=R.publicProxyUrl||R.proxyUrl,N={...n,[k]:{interceptorId:j,proxyUrl:A||`${d}/${j}/proxy`,logs:[]}};r(N),u(N),p(j,k)}catch(T){console.error("Failed to create proxy:",T),alert("Failed to create interceptor")}finally{a(!1)}},g=async()=>{if(!e||e==="none"||!l)return;try{await fetch(`${d}/${l.interceptorId}`,{method:"DELETE"})}catch{}s.current[e]&&(s.current[e].close(),delete s.current[e]);const k={...n};delete k[e],r(k),u(k)},v=async()=>{if(!e||e==="none"||!l)return;try{await fetch(`${d}/${l.interceptorId}/clear`,{method:"POST"})}catch{}const k={...n,[e]:{...n[e],logs:[]}};r(k),u(k)},[b,x]=w.useState(!1),E=()=>{const k=t[e]?.name||e||"server",T=l?.proxyUrl||"";return[`"${k}": {`,' "type": "http",',` "url": "${T}",`,' "headers": {}',"}"].join(`
|
|
1821
1821
|
`)},S=async()=>{try{await navigator.clipboard.writeText(E()),x(!0),setTimeout(()=>x(!1),1e3)}catch(k){console.error("Failed to copy config JSON:",k)}};return f.jsxs("div",{className:"p-4 space-y-4",children:[f.jsxs(Fa,{className:"p-4",children:[f.jsx("h2",{className:"text-lg font-semibold mb-3",children:"Proxy Configuration"}),f.jsx("div",{className:"space-y-3",children:l?f.jsxs("div",{className:"p-3 rounded border",children:[f.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs("div",{className:"text-sm font-medium",children:["Active Proxy for"," ",t[e]?.name||e]}),f.jsx("span",{className:"mr-1 inline-block size-1.5 rounded-full bg-orange-500"})]}),f.jsx("div",{className:"flex gap-2 ml-auto",children:f.jsx(Ie,{variant:"outline",size:"sm",onClick:g,children:"Stop Proxy"})})]}),f.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 items-start",children:[f.jsxs("div",{className:"text-sm text-muted-foreground leading-relaxed",children:[f.jsx("div",{className:"mb-2 font-medium text-foreground",children:"How this proxy works"}),f.jsx("p",{children:"This creates a HTTP proxy that forwards requests to your connected MCP server. Add the JSON entry on the right in your client’s configuration. Auth credentials are the same as your server's and are injected automatically."})]}),f.jsxs("div",{className:"sm:col-start-2",children:[f.jsx("label",{className:"text-xs font-medium mb-1 block text-muted-foreground",children:"MCP HTTP config entry (no outer braces)"}),f.jsxs("div",{className:"relative",children:[f.jsx("pre",{className:"block p-2 pr-10 bg-transparent border rounded text-xs whitespace-pre leading-relaxed font-mono",children:E()}),f.jsx("button",{onClick:S,title:"Copy config entry",className:`absolute top-2 right-2 p-1 rounded transition-all duration-200 ${b?"text-foreground scale-110":"text-muted-foreground hover:text-foreground hover:bg-muted"}`,children:b?f.jsx(Ti,{className:"h-3 w-3"}):f.jsx(Po,{className:"h-3 w-3"})})]})]})]})]}):f.jsx("div",{className:"p-3 bg-muted rounded border",children:f.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"text-sm font-medium mb-1 truncate",children:e!=="none"?`Create proxy for ${t[e]?.name}`:"No server selected"}),f.jsx("div",{className:"text-xs text-muted-foreground",children:e?"Create a local HTTP proxy URL to your connected server":"Select a server above to create a proxy"})]}),f.jsx("div",{className:"shrink-0 self-start sm:self-auto",children:f.jsx(Ie,{onClick:h,disabled:!e||e==="none"||i,children:i?f.jsxs(f.Fragment,{children:[f.jsx(mu,{className:"animate-spin"}),"Creating..."]}):f.jsx(f.Fragment,{children:"Create Proxy"})})})]})})})]}),f.jsxs(Fa,{className:"p-4",children:[f.jsxs("div",{className:"flex items-center justify-between mb-3",children:[f.jsx("h2",{className:"text-lg font-semibold",children:"Request Logs"}),f.jsx(Ie,{variant:"outline",size:"sm",onClick:v,disabled:!l,children:"Clear Logs"})]}),f.jsx("div",{className:"border rounded-md bg-muted/30 max-h-[60vh] overflow-auto",children:!l?.logs||l.logs.length===0?f.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"No requests logged yet"}):f.jsx("div",{className:"divide-y",children:l.logs.map(k=>f.jsxs("div",{className:"p-3 text-sm",children:[f.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[f.jsx("span",{className:`text-xs px-2 py-0.5 rounded font-mono ${k.direction==="request"?"bg-orange-100 text-orange-800 dark:bg-orange-900/30 dark:text-orange-300":"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-300"}`,children:k.direction}),"method"in k?f.jsxs("span",{className:"font-mono",children:[f.jsx("span",{className:"font-semibold text-orange-600 dark:text-orange-400",children:k.method}),(()=>{try{const T=JSON.parse(k.body||"{}");return T.method?f.jsxs("span",{className:"font-semibold text-foreground",children:[" ",T.method]}):null}catch{return null}})()]}):f.jsxs("span",{className:"font-mono font-semibold text-gray-600 dark:text-gray-400",children:[k.status," ",k.statusText]}),f.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:new Date(k.timestamp).toLocaleTimeString()})]}),"url"in k&&f.jsx("div",{className:"text-xs text-muted-foreground font-mono mb-1",children:k.url}),k.body&&(()=>{let T=null;try{const R=k.body.trim();(R.startsWith("{")||R.startsWith("["))&&(T=JSON.parse(R))}catch{}return T?f.jsxs("div",{className:"text-xs bg-background p-2 rounded border mt-1 overflow-auto",children:[f.jsx("style",{children:`
|
|
1822
1822
|
/*
|
|
1823
1823
|
* react18-json-view uses CSS variables on the root
|
|
@@ -1867,9 +1867,9 @@ Event: ${Rl(t)}.
|
|
|
1867
1867
|
Url: ${Rx(t)}`),!0)}function yje(t,e){return t.type||!e||!e.length?!1:wje(t).some(n=>Vl(n,e))}function bje(t,e){if(t.type!=="transaction"||!e||!e.length)return!1;const n=t.transaction;return n?Vl(n,e):!1}function xje(t,e){if(!e||!e.length)return!1;const n=Rx(t);return n?Vl(n,e):!1}function _je(t,e){if(!e||!e.length)return!0;const n=Rx(t);return n?Vl(n,e):!0}function wje(t){const e=[];t.message&&e.push(t.message);let n;try{n=t.exception.values[t.exception.values.length-1]}catch{}return n&&n.value&&(e.push(n.value),n.type&&e.push(`${n.type}: ${n.value}`)),e}function Sje(t){try{return t.exception.values[0].type==="SentryError"}catch{}return!1}function Eje(t=[]){for(let e=t.length-1;e>=0;e--){const n=t[e];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function Rx(t){try{let e;try{e=t.exception.values[0].stacktrace.frames}catch{}return e?Eje(e):null}catch{return Rt&&ze.error(`Cannot extract url for event ${Rl(t)}`),null}}function kje(t){return t.type||!t.exception||!t.exception.values||t.exception.values.length===0?!1:!t.message&&!t.exception.values.some(e=>e.stacktrace||e.type&&e.type!=="Error"||e.value)}function Tje(t,e,n=250,r,s,i,a){if(!i.exception||!i.exception.values||!a||!Fo(a.originalException,Error))return;const l=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;l&&(i.exception.values=Cje(FC(t,e,s,a.originalException,r,i.exception.values,l,0),n))}function FC(t,e,n,r,s,i,a,l){if(i.length>=n+1)return i;let u=[...i];if(Fo(r[s],Error)){$$(a,l);const d=t(e,r[s]),p=u.length;z$(d,s,p,l),u=FC(t,e,n,r[s],s,[d,...u],d,p)}return Array.isArray(r.errors)&&r.errors.forEach((d,p)=>{if(Fo(d,Error)){$$(a,l);const h=t(e,d),g=u.length;z$(h,`errors[${p}]`,g,l),u=FC(t,e,n,d,s,[h,...u],h,g)}}),u}function $$(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,...t.type==="AggregateError"&&{is_exception_group:!0},exception_id:e}}function z$(t,e,n,r){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,type:"chained",source:e,exception_id:n,parent_id:r}}function Cje(t,e){return t.map(n=>(n.value&&(n.value=mf(n.value,e)),n))}function cu(t){if(!t)return{};const e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};const n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:n,hash:r,relative:e[5]+n+r}}function Aje(t){const e="console";fc(e,t),hc(e,Nje)}function Nje(){"console"in Kt&&NC.forEach(function(t){t in Kt.console&&Is(Kt.console,t,function(e){return Tx[t]=e,function(...n){ji("console",{args:n,level:t});const s=Tx[t];s&&s.apply(Kt.console,n)}})})}function TG(t){return t==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(t)?t:"log"}const Rje="Dedupe",jje=()=>{let t;return{name:Rje,processEvent(e){if(e.type)return e;try{if(Oje(e,t))return Rt&&ze.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return t=e}}},Mje=jje;function Oje(t,e){return e?!!(Pje(t,e)||Ije(t,e)):!1}function Pje(t,e){const n=t.message,r=e.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!AG(t,e)||!CG(t,e))}function Ije(t,e){const n=F$(e),r=F$(t);return!(!n||!r||n.type!==r.type||n.value!==r.value||!AG(t,e)||!CG(t,e))}function CG(t,e){let n=s$(t),r=s$(e);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let s=0;s<r.length;s++){const i=r[s],a=n[s];if(i.filename!==a.filename||i.lineno!==a.lineno||i.colno!==a.colno||i.function!==a.function)return!1}return!0}function AG(t,e){let n=t.fingerprint,r=e.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join("")===r.join("")}catch{return!1}}function F$(t){return t.exception&&t.exception.values&&t.exception.values[0]}function Dje(t,e,n,r,s="auto.http.browser"){if(!t.fetchData)return;const i=tc()&&e(t.fetchData.url);if(t.endTimestamp&&i){const g=t.fetchData.__span;if(!g)return;const v=r[g];v&&(zje(v,t),delete r[g]);return}const{method:a,url:l}=t.fetchData,u=$je(l),d=u?cu(u).host:void 0,p=!!$r(),h=i&&p?Og({name:`${a} ${l}`,attributes:{url:l,type:"fetch","http.method":a,"http.url":u,"server.address":d,[Dr]:s,[Tu]:"http.client"}}):new uh;if(t.fetchData.__span=h.spanContext().spanId,r[h.spanContext().spanId]=h,n(t.fetchData.url)){const g=t.args[0],v=t.args[1]||{},b=Lje(g,v,tc()&&p?h:void 0);b&&(t.args[1]=v,v.headers=b)}return h}function Lje(t,e,n){const r=kG({span:n}),s=r["sentry-trace"],i=r.baggage;if(!s)return;const a=e.headers||(Fje(t)?t.headers:void 0);if(a)if(Uje(a)){const l=new Headers(a);if(l.set("sentry-trace",s),i){const u=l.get("baggage");if(u){const d=Oy(u);l.set("baggage",d?`${d},${i}`:i)}else l.set("baggage",i)}return l}else if(Array.isArray(a)){const l=[...a.filter(u=>!(Array.isArray(u)&&u[0]==="sentry-trace")).map(u=>{if(Array.isArray(u)&&u[0]==="baggage"&&typeof u[1]=="string"){const[d,p,...h]=u;return[d,Oy(p),...h]}else return u}),["sentry-trace",s]];return i&&l.push(["baggage",i]),l}else{const l="baggage"in a?a.baggage:void 0;let u=[];return Array.isArray(l)?u=l.map(d=>typeof d=="string"?Oy(d):d).filter(d=>d===""):l&&u.push(Oy(l)),i&&u.push(i),{...a,"sentry-trace":s,baggage:u.length>0?u.join(","):void 0}}else return{...r}}function $je(t){try{return new URL(t).href}catch{return}}function zje(t,e){if(e.response){G7(t,e.response.status);const n=e.response&&e.response.headers&&e.response.headers.get("content-length");if(n){const r=parseInt(n);r>0&&t.setAttribute("http.response_content_length",r)}}else e.error&&t.setStatus({code:Or,message:"internal_error"});t.end()}function Oy(t){return t.split(",").filter(e=>!e.split("=")[0].startsWith(hj)).join(",")}function Fje(t){return typeof Request<"u"&&Fo(t,Request)}function Uje(t){return typeof Headers<"u"&&Fo(t,Headers)}function NG(t){if(t!==void 0)return t>=400&&t<500?"warning":t>=500?"error":void 0}const UC=Kt;function RG(){if(!("fetch"in UC))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function BC(t){return t&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function Bje(){if(typeof EdgeRuntime=="string")return!0;if(!RG())return!1;if(BC(UC.fetch))return!0;let t=!1;const e=UC.document;if(e&&typeof e.createElement=="function")try{const n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(t=BC(n.contentWindow.fetch)),e.head.removeChild(n)}catch(n){uc&&ze.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return t}function jG(t,e){const n="fetch";fc(n,t),hc(n,()=>MG(void 0,e))}function qje(t){const e="fetch-body-resolved";fc(e,t),hc(e,()=>MG(Hje))}function MG(t,e=!1){e&&!Bje()||Is(Kt,"fetch",function(n){return function(...r){const s=new Error,{method:i,url:a}=Gje(r),l={args:r,fetchData:{method:i,url:a},startTimestamp:ms()*1e3,virtualError:s};return t||ji("fetch",{...l}),n.apply(Kt,r).then(async u=>(t?t(u):ji("fetch",{...l,endTimestamp:ms()*1e3,response:u}),u),u=>{throw ji("fetch",{...l,endTimestamp:ms()*1e3,error:u}),aj(u)&&u.stack===void 0&&(u.stack=s.stack,Mi(u,"framesToPop",1)),u})}})}async function Vje(t,e){if(t&&t.body){const n=t.body,r=n.getReader(),s=setTimeout(()=>{n.cancel().then(null,()=>{})},90*1e3);let i=!0;for(;i;){let a;try{a=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);const{done:l}=await r.read();clearTimeout(a),l&&(e(),i=!1)}catch{i=!1}finally{clearTimeout(a)}}clearTimeout(s),r.releaseLock(),n.cancel().then(null,()=>{})}}function Hje(t){let e;try{e=t.clone()}catch{return}Vje(e,()=>{ji("fetch-body-resolved",{endTimestamp:ms()*1e3,response:t})})}function qC(t,e){return!!t&&typeof t=="object"&&!!t[e]}function U$(t){return typeof t=="string"?t:t?qC(t,"url")?t.url:t.toString?t.toString():"":""}function Gje(t){if(t.length===0)return{method:"GET",url:""};if(t.length===2){const[n,r]=t;return{url:U$(n),method:qC(r,"method")?String(r.method).toUpperCase():"GET"}}const e=t[0];return{url:U$(e),method:qC(e,"method")?String(e.method).toUpperCase():"GET"}}function Wje(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function Yje(){return"npm"}function Kje(){return!Wje()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function B$(){return typeof window<"u"&&(!Kje()||Xje())}function Xje(){const t=Kt.process;return!!t&&t.type==="renderer"}const Py=Kt;function Qje(){const t=Py.chrome,e=t&&t.app&&t.app.runtime,n="history"in Py&&!!Py.history.pushState&&!!Py.history.replaceState;return!e&&n}function Jje(t,e){return t??e()}function fb(t){let e,n=t[0],r=1;for(;r<t.length;){const s=t[r],i=t[r+1];if(r+=2,(s==="optionalAccess"||s==="optionalCall")&&n==null)return;s==="access"||s==="optionalAccess"?(e=n,n=i(n)):(s==="call"||s==="optionalCall")&&(n=i((...a)=>n.call(e,...a)),e=void 0)}return n}const Nt=Kt;let VC=0;function OG(){return VC>0}function Zje(){VC++,setTimeout(()=>{VC--})}function $f(t,e={}){function n(s){return typeof s=="function"}if(!n(t))return t;try{const s=t.__sentry_wrapped__;if(s)return typeof s=="function"?s:t;if(cj(t))return t}catch{return t}const r=function(...s){try{const i=s.map(a=>$f(a,e));return t.apply(this,i)}catch(i){throw Zje(),dj(a=>{a.addEventProcessor(l=>(e.mechanism&&(jC(l,void 0),If(l,e.mechanism)),l.extra={...l.extra,arguments:s},l)),pG(i)}),i}};try{for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[s]=t[s])}catch{}F7(r,t),Mi(t,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return t.name}})}catch{}return r}const Ha=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function vj(t,e){const n=yj(t,e),r={type:sMe(e),value:iMe(e)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function eMe(t,e,n,r){const s=Yt(),i=s&&s.getOptions().normalizeDepth,a=uMe(e),l={__serialized__:oG(e,i)};if(a)return{exception:{values:[vj(t,a)]},extra:l};const u={exception:{values:[{type:Y0(e)?e.constructor.name:r?"UnhandledRejection":"Error",value:lMe(e,{isUnhandledRejection:r})}]},extra:l};if(n){const d=yj(t,n);d.length&&(u.exception.values[0].stacktrace={frames:d})}return u}function W1(t,e){return{exception:{values:[vj(t,e)]}}}function yj(t,e){const n=e.stacktrace||e.stack||"",r=nMe(e),s=rMe(e);try{return t(n,r,s)}catch{}return[]}const tMe=/Minified React error #\d+;/i;function nMe(t){return t&&tMe.test(t.message)?1:0}function rMe(t){return typeof t.framesToPop=="number"?t.framesToPop:0}function PG(t){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?t instanceof WebAssembly.Exception:!1}function sMe(t){const e=t&&t.name;return!e&&PG(t)?t.message&&Array.isArray(t.message)&&t.message.length==2?t.message[0]:"WebAssembly.Exception":e}function iMe(t){const e=t&&t.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:PG(t)&&Array.isArray(t.message)&&t.message.length==2?t.message[1]:e:"No error message"}function aMe(t,e,n,r){const s=n&&n.syntheticException||void 0,i=bj(t,e,s,r);return If(i),i.level="error",n&&n.event_id&&(i.event_id=n.event_id),Bo(i)}function oMe(t,e,n="info",r,s){const i=r&&r.syntheticException||void 0,a=HC(t,e,i,s);return a.level=n,r&&r.event_id&&(a.event_id=r.event_id),Bo(a)}function bj(t,e,n,r,s){let i;if(D7(e)&&e.error)return W1(t,e.error);if(a$(e)||ZAe(e)){const a=e;if("stack"in e)i=W1(t,e);else{const l=a.name||(a$(a)?"DOMError":"DOMException"),u=a.message?`${l}: ${a.message}`:l;i=HC(t,u,n,r),jC(i,u)}return"code"in a&&(i.tags={...i.tags,"DOMException.code":`${a.code}`}),i}return aj(e)?W1(t,e):Pf(e)||Y0(e)?(i=eMe(t,e,n,s),If(i,{synthetic:!0}),i):(i=HC(t,e,n,r),jC(i,`${e}`),If(i,{synthetic:!0}),i)}function HC(t,e,n,r){const s={};if(r&&n){const i=yj(t,n);i.length&&(s.exception={values:[{value:e,stacktrace:{frames:i}}]}),If(s,{synthetic:!0})}if(oj(e)){const{__sentry_template_string__:i,__sentry_template_values__:a}=e;return s.logentry={message:i,params:a},s}return s.message=e,s}function lMe(t,{isUnhandledRejection:e}){const n=oNe(t),r=e?"promise rejection":"exception";return D7(t)?`Event \`ErrorEvent\` captured as ${r} with message \`${t.message}\``:Y0(t)?`Event \`${cMe(t)}\` (type=${t.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function cMe(t){try{const e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{}}function uMe(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)){const n=t[e];if(n instanceof Error)return n}}function dMe(t,{metadata:e,tunnel:n,dsn:r}){const s={event_id:t.event_id,sent_at:new Date().toISOString(),...e&&e.sdk&&{sdk:{name:e.sdk.name,version:e.sdk.version}},...!!n&&!!r&&{dsn:Mg(r)}},i=fMe(t);return Pu(s,[i])}function fMe(t){return[{type:"user_report"},t]}class hMe extends WRe{constructor(e){const n={parentSpanIsAlwaysRootSpan:!0,...e},r=Nt.SENTRY_SDK_SOURCE||Yje();EG(n,"browser",["browser"],r),super(n),n.sendClientReports&&Nt.document&&Nt.document.addEventListener("visibilitychange",()=>{Nt.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(e,n){return aMe(this._options.stackParser,e,n,this._options.attachStacktrace)}eventFromMessage(e,n="info",r){return oMe(this._options.stackParser,e,n,r,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled()){Ha&&ze.warn("SDK not enabled, will not capture user feedback.");return}const n=dMe(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this.sendEnvelope(n)}_prepareEvent(e,n,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,n,r)}}const xj=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,pMe=(t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good",dh=(t,e,n,r)=>{let s,i;return a=>{e.value>=0&&(a||r)&&(i=e.value-(s||0),(i||s===void 0)&&(s=e.value,e.delta=i,e.rating=pMe(e.value,n),t(e)))}},gt=Kt,mMe=()=>`v4-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,Pg=(t=!0)=>{const e=gt.performance&>.performance.getEntriesByType&>.performance.getEntriesByType("navigation")[0];if(!t||e&&e.responseStart>0&&e.responseStart<performance.now())return e},Ig=()=>{const t=Pg();return t&&t.activationStart||0},fh=(t,e)=>{const n=Pg();let r="navigate";return n&&(gt.document&>.document.prerendering||Ig()>0?r="prerender":gt.document&>.document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:t,value:typeof e>"u"?-1:e,rating:"good",delta:0,entries:[],id:mMe(),navigationType:r}},Iu=(t,e,n)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){const r=new PerformanceObserver(s=>{Promise.resolve().then(()=>{e(s.getEntries())})});return r.observe(Object.assign({type:t,buffered:!0},n||{})),r}}catch{}},hh=t=>{const e=n=>{(n.type==="pagehide"||gt.document&>.document.visibilityState==="hidden")&&t(n)};gt.document&&(addEventListener("visibilitychange",e,!0),addEventListener("pagehide",e,!0))},Z0=t=>{let e=!1;return()=>{e||(t(),e=!0)}};let pm=-1;const gMe=()=>gt.document.visibilityState==="hidden"&&!gt.document.prerendering?0:1/0,jx=t=>{gt.document.visibilityState==="hidden"&&pm>-1&&(pm=t.type==="visibilitychange"?t.timeStamp:0,yMe())},vMe=()=>{addEventListener("visibilitychange",jx,!0),addEventListener("prerenderingchange",jx,!0)},yMe=()=>{removeEventListener("visibilitychange",jx,!0),removeEventListener("prerenderingchange",jx,!0)},e_=()=>(gt.document&&pm<0&&(pm=gMe(),vMe()),{get firstHiddenTime(){return pm}}),Dg=t=>{gt.document&>.document.prerendering?addEventListener("prerenderingchange",()=>t(),!0):t()},bMe=[1800,3e3],xMe=(t,e={})=>{Dg(()=>{const n=e_(),r=fh("FCP");let s;const a=Iu("paint",l=>{l.forEach(u=>{u.name==="first-contentful-paint"&&(a.disconnect(),u.startTime<n.firstHiddenTime&&(r.value=Math.max(u.startTime-Ig(),0),r.entries.push(u),s(!0)))})});a&&(s=dh(t,r,bMe,e.reportAllChanges))})},_Me=[.1,.25],wMe=(t,e={})=>{xMe(Z0(()=>{const n=fh("CLS",0);let r,s=0,i=[];const a=u=>{u.forEach(d=>{if(!d.hadRecentInput){const p=i[0],h=i[i.length-1];s&&p&&h&&d.startTime-h.startTime<1e3&&d.startTime-p.startTime<5e3?(s+=d.value,i.push(d)):(s=d.value,i=[d])}}),s>n.value&&(n.value=s,n.entries=i,r())},l=Iu("layout-shift",a);l&&(r=dh(t,n,_Me,e.reportAllChanges),hh(()=>{a(l.takeRecords()),r(!0)}),setTimeout(r,0))}))},SMe=[100,300],EMe=(t,e={})=>{Dg(()=>{const n=e_(),r=fh("FID");let s;const i=u=>{u.startTime<n.firstHiddenTime&&(r.value=u.processingStart-u.startTime,r.entries.push(u),s(!0))},a=u=>{u.forEach(i)},l=Iu("first-input",a);s=dh(t,r,SMe,e.reportAllChanges),l&&hh(Z0(()=>{a(l.takeRecords()),l.disconnect()}))})};let IG=0,Y1=1/0,Iy=0;const kMe=t=>{t.forEach(e=>{e.interactionId&&(Y1=Math.min(Y1,e.interactionId),Iy=Math.max(Iy,e.interactionId),IG=Iy?(Iy-Y1)/7+1:0)})};let GC;const TMe=()=>GC?IG:performance.interactionCount||0,CMe=()=>{"interactionCount"in performance||GC||(GC=Iu("event",kMe,{type:"event",buffered:!0,durationThreshold:0}))},wo=[],K1=new Map,AMe=40;let NMe=0;const RMe=()=>TMe()-NMe,jMe=()=>{const t=Math.min(wo.length-1,Math.floor(RMe()/50));return wo[t]},X1=10,MMe=[],OMe=t=>{if(MMe.forEach(r=>r(t)),!(t.interactionId||t.entryType==="first-input"))return;const e=wo[wo.length-1],n=K1.get(t.interactionId);if(n||wo.length<X1||e&&t.duration>e.latency){if(n)t.duration>n.latency?(n.entries=[t],n.latency=t.duration):t.duration===n.latency&&t.startTime===(n.entries[0]&&n.entries[0].startTime)&&n.entries.push(t);else{const r={id:t.interactionId,latency:t.duration,entries:[t]};K1.set(r.id,r),wo.push(r)}wo.sort((r,s)=>s.latency-r.latency),wo.length>X1&&wo.splice(X1).forEach(r=>K1.delete(r.id))}},DG=t=>{const e=gt.requestIdleCallback||gt.setTimeout;let n=-1;return t=Z0(t),gt.document&>.document.visibilityState==="hidden"?t():(n=e(t),hh(t)),n},PMe=[200,500],IMe=(t,e={})=>{"PerformanceEventTiming"in gt&&"interactionId"in PerformanceEventTiming.prototype&&Dg(()=>{CMe();const n=fh("INP");let r;const s=a=>{DG(()=>{a.forEach(OMe);const l=jMe();l&&l.latency!==n.value&&(n.value=l.latency,n.entries=l.entries,r())})},i=Iu("event",s,{durationThreshold:e.durationThreshold!=null?e.durationThreshold:AMe});r=dh(t,n,PMe,e.reportAllChanges),i&&(i.observe({type:"first-input",buffered:!0}),hh(()=>{s(i.takeRecords()),r(!0)}))})},DMe=[2500,4e3],q$={},LMe=(t,e={})=>{Dg(()=>{const n=e_(),r=fh("LCP");let s;const i=l=>{e.reportAllChanges||(l=l.slice(-1)),l.forEach(u=>{u.startTime<n.firstHiddenTime&&(r.value=Math.max(u.startTime-Ig(),0),r.entries=[u],s())})},a=Iu("largest-contentful-paint",i);if(a){s=dh(t,r,DMe,e.reportAllChanges);const l=Z0(()=>{q$[r.id]||(i(a.takeRecords()),a.disconnect(),q$[r.id]=!0,s(!0))});["keydown","click"].forEach(u=>{gt.document&&addEventListener(u,()=>DG(l),{once:!0,capture:!0})}),hh(l)}})},$Me=[800,1800],WC=t=>{gt.document&>.document.prerendering?Dg(()=>WC(t)):gt.document&>.document.readyState!=="complete"?addEventListener("load",()=>WC(t),!0):setTimeout(t,0)},zMe=(t,e={})=>{const n=fh("TTFB"),r=dh(t,n,$Me,e.reportAllChanges);WC(()=>{const s=Pg();s&&(n.value=Math.max(s.responseStart-Ig(),0),n.entries=[s],r(!0))})},mm={},Mx={};let LG,$G,zG,FG,UG;function _j(t,e=!1){return Lg("cls",t,UMe,LG,e)}function BG(t,e=!1){return Lg("lcp",t,qMe,zG,e)}function qG(t){return Lg("fid",t,BMe,$G)}function FMe(t){return Lg("ttfb",t,VMe,FG)}function VG(t){return Lg("inp",t,HMe,UG)}function zf(t,e){return HG(t,e),Mx[t]||(GMe(t),Mx[t]=!0),GG(t,e)}function ph(t,e){const n=mm[t];if(!(!n||!n.length))for(const r of n)try{r(e)}catch(s){xj&&ze.error(`Error while triggering instrumentation handler.
|
|
1868
1868
|
Type: ${t}
|
|
1869
1869
|
Name: ${zo(r)}
|
|
1870
|
-
Error:`,s)}}function UMe(){return wMe(t=>{ph("cls",{metric:t}),LG=t},{reportAllChanges:!0})}function BMe(){return EMe(t=>{ph("fid",{metric:t}),$G=t})}function qMe(){return LMe(t=>{ph("lcp",{metric:t}),zG=t},{reportAllChanges:!0})}function VMe(){return zMe(t=>{ph("ttfb",{metric:t}),FG=t})}function HMe(){return IMe(t=>{ph("inp",{metric:t}),UG=t})}function Lg(t,e,n,r,s=!1){HG(t,e);let i;return Mx[t]||(i=n(),Mx[t]=!0),r&&e({metric:r}),GG(t,e,s?i:void 0)}function GMe(t){const e={};t==="event"&&(e.durationThreshold=0),Iu(t,n=>{ph(t,{entries:n})},e)}function HG(t,e){mm[t]=mm[t]||[],mm[t].push(e)}function GG(t,e,n){return()=>{n&&n();const r=mm[t];if(!r)return;const s=r.indexOf(e);s!==-1&&r.splice(s,1)}}function WMe(t){return"duration"in t}function Q1(t){return typeof t=="number"&&isFinite(t)}function qo(t,e,n,{...r}){const s=rn(t).start_timestamp;return s&&s>e&&typeof t.updateStartTime=="function"&&t.updateStartTime(e),uG(t,()=>{const i=Og({startTime:e,...r});return i&&i.end(n),i})}function WG(t){const e=Yt();if(!e)return;const{name:n,transaction:r,attributes:s,startTime:i}=t,{release:a,environment:l}=e.getOptions(),u=e.getIntegrationByName("Replay"),d=u&&u.getReplayId(),p=An(),h=p.getUser(),g=h!==void 0?h.email||h.id||h.ip_address:void 0;let v;try{v=p.getScopeData().contexts.profile.profile_id}catch{}const b={release:a,environment:l,user:g||void 0,profile_id:v||void 0,replay_id:d||void 0,transaction:r,"user_agent.original":gt.navigator&>.navigator.userAgent,...s};return Og({name:n,attributes:b,startTime:i,experimental:{standalone:!0}})}function wj(){return gt&>.addEventListener&>.performance}function or(t){return t/1e3}function YG(t){let e="unknown",n="unknown",r="";for(const s of t){if(s==="/"){[e,n]=t.split("/");break}if(!isNaN(Number(s))){e=r==="h"?"http":r,n=t.split(r)[1];break}r+=s}return r===t&&(e=r),{name:e,version:n}}function YMe(){let t=0,e,n;if(!XMe())return;let r=!1;function s(){r||(r=!0,n&&KMe(t,e,n),i())}const i=_j(({metric:a})=>{const l=a.entries[a.entries.length-1];l&&(t=a.value,e=l)},!0);hh(()=>{s()}),setTimeout(()=>{const a=Yt();if(!a)return;const l=a.on("startNavigationSpan",()=>{s(),l&&l()}),u=$r(),d=u&&Kr(u),p=d&&rn(d);p&&p.op==="pageload"&&(n=d.spanContext().spanId)},0)}function KMe(t,e,n){xj&&ze.log(`Sending CLS span (${t})`);const r=or((vs||0)+(e&&e.startTime||0)),s=An().getScopeData().transactionName,i=e?Uo(e.sources[0]&&e.sources[0].node):"Layout shift",a=Nr({[Dr]:"auto.http.browser.cls",[Tu]:"ui.webvital.cls",[fj]:e&&e.duration||0,"sentry.pageload.span_id":n}),l=WG({name:i,transaction:s,attributes:a,startTime:r});l&&(l.addEvent("cls",{[Q0]:"",[J0]:t}),l.end(r))}function XMe(){try{return PerformanceObserver.supportedEntryTypes.includes("layout-shift")}catch{return!1}}const QMe=2147483647;let V$=0,Gr={},ks,gm;function JMe({recordClsStandaloneSpans:t}){const e=wj();if(e&&vs){e.mark&>.performance.mark("sentry-tracing-init");const n=s2e(),r=r2e(),s=i2e(),i=t?YMe():n2e();return()=>{n(),r(),s(),i&&i()}}return()=>{}}function ZMe(){zf("longtask",({entries:t})=>{const e=$r();if(!e)return;const{op:n,start_timestamp:r}=rn(e);for(const s of t){const i=or(vs+s.startTime),a=or(s.duration);n==="navigation"&&r&&i<r||qo(e,i,i+a,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[Dr]:"auto.ui.browser.metrics"}})}})}function e2e(){new PerformanceObserver(e=>{const n=$r();if(n)for(const r of e.getEntries()){if(!r.scripts[0])continue;const s=or(vs+r.startTime),{start_timestamp:i,op:a}=rn(n);if(a==="navigation"&&i&&s<i)continue;const l=or(r.duration),u={[Dr]:"auto.ui.browser.metrics"},d=r.scripts[0],{invoker:p,invokerType:h,sourceURL:g,sourceFunctionName:v,sourceCharPosition:b}=d;u["browser.script.invoker"]=p,u["browser.script.invoker_type"]=h,g&&(u["code.filepath"]=g),v&&(u["code.function"]=v),b!==-1&&(u["browser.script.source_char_position"]=b),qo(n,s,s+l,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:u})}}).observe({type:"long-animation-frame",buffered:!0})}function t2e(){zf("event",({entries:t})=>{const e=$r();if(e){for(const n of t)if(n.name==="click"){const r=or(vs+n.startTime),s=or(n.duration),i={name:Uo(n.target),op:`ui.interaction.${n.name}`,startTime:r,attributes:{[Dr]:"auto.ui.browser.metrics"}},a=z7(n.target);a&&(i.attributes["ui.component_name"]=a),qo(e,r,r+s,i)}}})}function n2e(){return _j(({metric:t})=>{const e=t.entries[t.entries.length-1];e&&(Gr.cls={value:t.value,unit:""},gm=e)},!0)}function r2e(){return BG(({metric:t})=>{const e=t.entries[t.entries.length-1];e&&(Gr.lcp={value:t.value,unit:"millisecond"},ks=e)},!0)}function s2e(){return qG(({metric:t})=>{const e=t.entries[t.entries.length-1];if(!e)return;const n=or(vs),r=or(e.startTime);Gr.fid={value:t.value,unit:"millisecond"},Gr["mark.fid"]={value:n+r,unit:"second"}})}function i2e(){return FMe(({metric:t})=>{t.entries[t.entries.length-1]&&(Gr.ttfb={value:t.value,unit:"millisecond"})})}function a2e(t,e){const n=wj();if(!n||!n.getEntries||!vs)return;const r=or(vs),s=n.getEntries(),{op:i,start_timestamp:a}=rn(t);if(s.slice(V$).forEach(l=>{const u=or(l.startTime),d=or(Math.max(0,l.duration));if(!(i==="navigation"&&a&&r+u<a))switch(l.entryType){case"navigation":{l2e(t,l,r);break}case"mark":case"paint":case"measure":{o2e(t,l,u,d,r);const p=e_(),h=l.startTime<p.firstHiddenTime;l.name==="first-paint"&&h&&(Gr.fp={value:l.startTime,unit:"millisecond"}),l.name==="first-contentful-paint"&&h&&(Gr.fcp={value:l.startTime,unit:"millisecond"});break}case"resource":{d2e(t,l,l.name,u,d,r);break}}}),V$=Math.max(s.length-1,0),f2e(t),i==="pageload"){p2e(Gr);const l=Gr["mark.fid"];l&&Gr.fid&&(qo(t,l.value,l.value+or(Gr.fid.value),{name:"first input delay",op:"ui.action",attributes:{[Dr]:"auto.ui.browser.metrics"}}),delete Gr["mark.fid"]),(!("fcp"in Gr)||!e.recordClsOnPageloadSpan)&&delete Gr.cls,Object.entries(Gr).forEach(([u,d])=>{dRe(u,d.value,d.unit)}),t.setAttribute("performance.timeOrigin",r),t.setAttribute("performance.activationStart",Ig()),h2e(t)}ks=void 0,gm=void 0,Gr={}}function o2e(t,e,n,r,s){const i=Pg(!1),a=or(i?i.requestStart:0),l=s+Math.max(n,a),u=s+n,d=u+r,p={[Dr]:"auto.resource.browser.metrics"};return l!==u&&(p["sentry.browser.measure_happened_before_request"]=!0,p["sentry.browser.measure_start_time"]=l),qo(t,l,d,{name:e.name,op:e.entryType,attributes:p}),l}function l2e(t,e,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{Dy(t,e,r,n)}),Dy(t,e,"secureConnection",n,"TLS/SSL"),Dy(t,e,"fetch",n,"cache"),Dy(t,e,"domainLookup",n,"DNS"),u2e(t,e,n)}function Dy(t,e,n,r,s=n){const i=c2e(n),a=e[i],l=e[`${n}Start`];!l||!a||qo(t,r+or(l),r+or(a),{op:`browser.${s}`,name:e.name,attributes:{[Dr]:"auto.ui.browser.metrics"}})}function c2e(t){return t==="secureConnection"?"connectEnd":t==="fetch"?"domainLookupStart":`${t}End`}function u2e(t,e,n){const r=n+or(e.requestStart),s=n+or(e.responseEnd),i=n+or(e.responseStart);e.responseEnd&&(qo(t,r,s,{op:"browser.request",name:e.name,attributes:{[Dr]:"auto.ui.browser.metrics"}}),qo(t,i,s,{op:"browser.response",name:e.name,attributes:{[Dr]:"auto.ui.browser.metrics"}}))}function d2e(t,e,n,r,s,i){if(e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch")return;const a=cu(n),l={[Dr]:"auto.resource.browser.metrics"};J1(l,e,"transferSize","http.response_transfer_size"),J1(l,e,"encodedBodySize","http.response_content_length"),J1(l,e,"decodedBodySize","http.decoded_response_content_length");const u=e.deliveryType;u!=null&&(l["http.response_delivery_type"]=u);const d=e.renderBlockingStatus;d&&(l["resource.render_blocking_status"]=d),a.protocol&&(l["url.scheme"]=a.protocol.split(":").pop()),a.host&&(l["server.address"]=a.host),l["url.same_origin"]=n.includes(gt.location.origin);const{name:p,version:h}=YG(e.nextHopProtocol);l["network.protocol.name"]=p,l["network.protocol.version"]=h;const g=i+r,v=g+s;qo(t,g,v,{name:n.replace(gt.location.origin,""),op:e.initiatorType?`resource.${e.initiatorType}`:"resource.other",attributes:l})}function f2e(t){const e=gt.navigator;if(!e)return;const n=e.connection;n&&(n.effectiveType&&t.setAttribute("effectiveConnectionType",n.effectiveType),n.type&&t.setAttribute("connectionType",n.type),Q1(n.rtt)&&(Gr["connection.rtt"]={value:n.rtt,unit:"millisecond"})),Q1(e.deviceMemory)&&t.setAttribute("deviceMemory",`${e.deviceMemory} GB`),Q1(e.hardwareConcurrency)&&t.setAttribute("hardwareConcurrency",String(e.hardwareConcurrency))}function h2e(t){ks&&(ks.element&&t.setAttribute("lcp.element",Uo(ks.element)),ks.id&&t.setAttribute("lcp.id",ks.id),ks.url&&t.setAttribute("lcp.url",ks.url.trim().slice(0,200)),ks.loadTime!=null&&t.setAttribute("lcp.loadTime",ks.loadTime),ks.renderTime!=null&&t.setAttribute("lcp.renderTime",ks.renderTime),t.setAttribute("lcp.size",ks.size)),gm&&gm.sources&&gm.sources.forEach((e,n)=>t.setAttribute(`cls.source.${n+1}`,Uo(e.node)))}function J1(t,e,n,r){const s=e[n];s!=null&&s<QMe&&(t[r]=s)}function p2e(t){const e=Pg(!1);if(!e)return;const{responseStart:n,requestStart:r}=e;r<=n&&(t["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}const m2e=1e3;let H$,YC,KC;function KG(t){const e="dom";fc(e,t),hc(e,g2e)}function g2e(){if(!gt.document)return;const t=ji.bind(null,"dom"),e=G$(t,!0);gt.document.addEventListener("click",e,!1),gt.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(n=>{const s=gt[n],i=s&&s.prototype;!i||!i.hasOwnProperty||!i.hasOwnProperty("addEventListener")||(Is(i,"addEventListener",function(a){return function(l,u,d){if(l==="click"||l=="keypress")try{const p=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},h=p[l]=p[l]||{refCount:0};if(!h.handler){const g=G$(t);h.handler=g,a.call(this,l,g,d)}h.refCount++}catch{}return a.call(this,l,u,d)}}),Is(i,"removeEventListener",function(a){return function(l,u,d){if(l==="click"||l=="keypress")try{const p=this.__sentry_instrumentation_handlers__||{},h=p[l];h&&(h.refCount--,h.refCount<=0&&(a.call(this,l,h.handler,d),h.handler=void 0,delete p[l]),Object.keys(p).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return a.call(this,l,u,d)}}))})}function v2e(t){if(t.type!==YC)return!1;try{if(!t.target||t.target._sentryId!==KC)return!1}catch{}return!0}function y2e(t,e){return t!=="keypress"?!1:!e||!e.tagName?!0:!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable)}function G$(t,e=!1){return n=>{if(!n||n._sentryCaptured)return;const r=b2e(n);if(y2e(n.type,r))return;Mi(n,"_sentryCaptured",!0),r&&!r._sentryId&&Mi(r,"_sentryId",ii());const s=n.type==="keypress"?"input":n.type;v2e(n)||(t({event:n,name:s,global:e}),YC=n.type,KC=r?r._sentryId:void 0),clearTimeout(H$),H$=gt.setTimeout(()=>{KC=void 0,YC=void 0},m2e)}}function b2e(t){try{return t.target}catch{return null}}let Ly;function t_(t){const e="history";fc(e,t),hc(e,x2e)}function x2e(){if(!Qje())return;const t=gt.onpopstate;gt.onpopstate=function(...n){const r=gt.location.href,s=Ly;if(Ly=r,ji("history",{from:s,to:r}),t)try{return t.apply(this,n)}catch{}};function e(n){return function(...r){const s=r.length>2?r[2]:void 0;if(s){const i=Ly,a=String(s);Ly=a,ji("history",{from:i,to:a})}return n.apply(this,r)}}Is(gt.history,"pushState",e),Is(gt.history,"replaceState",e)}const hb={};function XG(t){const e=hb[t];if(e)return e;let n=gt[t];if(BC(n))return hb[t]=n.bind(gt);const r=gt.document;if(r&&typeof r.createElement=="function")try{const s=r.createElement("iframe");s.hidden=!0,r.head.appendChild(s);const i=s.contentWindow;i&&i[t]&&(n=i[t]),r.head.removeChild(s)}catch(s){xj&&ze.warn(`Could not create sandbox iframe for ${t} check, bailing to window.${t}: `,s)}return n&&(hb[t]=n.bind(gt))}function W$(t){hb[t]=void 0}function Ff(...t){return XG("setTimeout")(...t)}const Kc="__sentry_xhr_v3__";function QG(t){const e="xhr";fc(e,t),hc(e,_2e)}function _2e(){if(!gt.XMLHttpRequest)return;const t=XMLHttpRequest.prototype;t.open=new Proxy(t.open,{apply(e,n,r){const s=new Error,i=ms()*1e3,a=No(r[0])?r[0].toUpperCase():void 0,l=w2e(r[1]);if(!a||!l)return e.apply(n,r);n[Kc]={method:a,url:l,request_headers:{}},a==="POST"&&l.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const u=()=>{const d=n[Kc];if(d&&n.readyState===4){try{d.status_code=n.status}catch{}const p={endTimestamp:ms()*1e3,startTimestamp:i,xhr:n,virtualError:s};ji("xhr",p)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(d,p,h){return u(),d.apply(p,h)}}):n.addEventListener("readystatechange",u),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(d,p,h){const[g,v]=h,b=p[Kc];return b&&No(g)&&No(v)&&(b.request_headers[g.toLowerCase()]=v),d.apply(p,h)}}),e.apply(n,r)}}),t.send=new Proxy(t.send,{apply(e,n,r){const s=n[Kc];if(!s)return e.apply(n,r);r[0]!==void 0&&(s.body=r[0]);const i={startTimestamp:ms()*1e3,xhr:n};return ji("xhr",i),e.apply(n,r)}})}function w2e(t){if(No(t))return t;try{return t.toString()}catch{}}const Z1=[],pb=new Map;function S2e(){if(wj()&&vs){const e=E2e();return()=>{e()}}return()=>{}}const Y$={click:"click",pointerdown:"click",pointerup:"click",mousedown:"click",mouseup:"click",touchstart:"click",touchend:"click",mouseover:"hover",mouseout:"hover",mouseenter:"hover",mouseleave:"hover",pointerover:"hover",pointerout:"hover",pointerenter:"hover",pointerleave:"hover",dragstart:"drag",dragend:"drag",drag:"drag",dragenter:"drag",dragleave:"drag",dragover:"drag",drop:"drag",keydown:"press",keyup:"press",keypress:"press",input:"press"};function E2e(){return VG(({metric:t})=>{if(t.value==null)return;const e=t.entries.find(b=>b.duration===t.value&&Y$[b.name]);if(!e)return;const{interactionId:n}=e,r=Y$[e.name],s=or(vs+e.startTime),i=or(t.value),a=$r(),l=a?Kr(a):void 0,d=(n!=null?pb.get(n):void 0)||l,p=d?rn(d).description:An().getScopeData().transactionName,h=Uo(e.target),g=Nr({[Dr]:"auto.http.browser.inp",[Tu]:`ui.interaction.${r}`,[fj]:e.duration}),v=WG({name:h,transaction:p,attributes:g,startTime:s});v&&(v.addEvent("inp",{[Q0]:"millisecond",[J0]:t.value}),v.end(s+i))})}function k2e(t){const e=({entries:n})=>{const r=$r(),s=r&&Kr(r);n.forEach(i=>{if(!WMe(i)||!s)return;const a=i.interactionId;if(a!=null&&!pb.has(a)){if(Z1.length>10){const l=Z1.shift();pb.delete(l)}Z1.push(a),pb.set(a,s)}})};zf("event",e),zf("first-input",e)}function T2e(t,e=XG("fetch")){let n=0,r=0;function s(i){const a=i.body.length;n+=a,r++;const l={body:i.body,method:"POST",referrerPolicy:"origin",headers:t.headers,keepalive:n<=6e4&&r<15,...t.fetchOptions};if(!e)return W$("fetch"),Cx("No fetch implementation available");try{return e(t.url,l).then(u=>(n-=a,r--,{statusCode:u.status,headers:{"x-sentry-rate-limits":u.headers.get("X-Sentry-Rate-Limits"),"retry-after":u.headers.get("Retry-After")}}))}catch(u){return W$("fetch"),n-=a,r--,Cx(u)}}return rje(t,s)}const C2e=30,A2e=50;function XC(t,e,n,r){const s={filename:t,function:e==="<anonymous>"?Eu:e,in_app:!0};return n!==void 0&&(s.lineno=n),r!==void 0&&(s.colno=r),s}const N2e=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,R2e=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,j2e=/\((\S*)(?::(\d+))(?::(\d+))\)/,M2e=t=>{const e=N2e.exec(t);if(e){const[,r,s,i]=e;return XC(r,Eu,+s,+i)}const n=R2e.exec(t);if(n){if(n[2]&&n[2].indexOf("eval")===0){const a=j2e.exec(n[2]);a&&(n[2]=a[1],n[3]=a[2],n[4]=a[3])}const[s,i]=JG(n[1]||Eu,n[2]);return XC(i,s,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}},O2e=[C2e,M2e],P2e=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,I2e=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,D2e=t=>{const e=P2e.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){const i=I2e.exec(e[3]);i&&(e[1]=e[1]||"eval",e[3]=i[1],e[4]=i[2],e[5]="")}let r=e[3],s=e[1]||Eu;return[s,r]=JG(s,r),XC(r,s,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},L2e=[A2e,D2e],$2e=[O2e,L2e],z2e=M7(...$2e),JG=(t,e)=>{const n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:Eu,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},$y=1024,F2e="Breadcrumbs",U2e=(t={})=>{const e={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...t};return{name:F2e,setup(n){e.console&&Aje(H2e(n)),e.dom&&KG(V2e(n,e.dom)),e.xhr&&QG(G2e(n)),e.fetch&&jG(W2e(n)),e.history&&t_(Y2e(n)),e.sentry&&n.on("beforeSendEvent",q2e(n))}}},B2e=U2e;function q2e(t){return function(n){Yt()===t&&nc({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:Rl(n)},{event:n})}}function V2e(t,e){return function(r){if(Yt()!==t)return;let s,i,a=typeof e=="object"?e.serializeAttribute:void 0,l=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;l&&l>$y&&(Ha&&ze.warn(`\`dom.maxStringLength\` cannot exceed ${$y}, but a value of ${l} was configured. Sentry will use ${$y} instead.`),l=$y),typeof a=="string"&&(a=[a]);try{const d=r.event,p=K2e(d)?d.target:d;s=Uo(p,{keyAttrs:a,maxStringLength:l}),i=z7(p)}catch{s="<unknown>"}if(s.length===0)return;const u={category:`ui.${r.name}`,message:s};i&&(u.data={"ui.component_name":i}),nc(u,{event:r.event,name:r.name,global:r.global})}}function H2e(t){return function(n){if(Yt()!==t)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:TG(n.level),message:o$(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${o$(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;nc(r,{input:n.args,level:n.level})}}function G2e(t){return function(n){if(Yt()!==t)return;const{startTimestamp:r,endTimestamp:s}=n,i=n.xhr[Kc];if(!r||!s||!i)return;const{method:a,url:l,status_code:u,body:d}=i,p={method:a,url:l,status_code:u},h={xhr:n.xhr,input:d,startTimestamp:r,endTimestamp:s},g=NG(u);nc({category:"xhr",data:p,type:"http",level:g},h)}}function W2e(t){return function(n){if(Yt()!==t)return;const{startTimestamp:r,endTimestamp:s}=n;if(s&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.error){const i=n.fetchData,a={data:n.error,input:n.args,startTimestamp:r,endTimestamp:s};nc({category:"fetch",data:i,level:"error",type:"http"},a)}else{const i=n.response,a={...n.fetchData,status_code:i&&i.status},l={input:n.args,response:i,startTimestamp:r,endTimestamp:s},u=NG(a.status_code);nc({category:"fetch",data:a,type:"http",level:u},l)}}}function Y2e(t){return function(n){if(Yt()!==t)return;let r=n.from,s=n.to;const i=cu(Nt.location.href);let a=r?cu(r):void 0;const l=cu(s);(!a||!a.path)&&(a=i),i.protocol===l.protocol&&i.host===l.host&&(s=l.relative),i.protocol===a.protocol&&i.host===a.host&&(r=a.relative),nc({category:"navigation",data:{from:r,to:s}})}}function K2e(t){return!!t&&!!t.target}const X2e=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],Q2e="BrowserApiErrors",J2e=(t={})=>{const e={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...t};return{name:Q2e,setupOnce(){e.setTimeout&&Is(Nt,"setTimeout",K$),e.setInterval&&Is(Nt,"setInterval",K$),e.requestAnimationFrame&&Is(Nt,"requestAnimationFrame",eOe),e.XMLHttpRequest&&"XMLHttpRequest"in Nt&&Is(XMLHttpRequest.prototype,"send",tOe);const n=e.eventTarget;n&&(Array.isArray(n)?n:X2e).forEach(nOe)}}},Z2e=J2e;function K$(t){return function(...e){const n=e[0];return e[0]=$f(n,{mechanism:{data:{function:zo(t)},handled:!1,type:"instrument"}}),t.apply(this,e)}}function eOe(t){return function(e){return t.apply(this,[$f(e,{mechanism:{data:{function:"requestAnimationFrame",handler:zo(t)},handled:!1,type:"instrument"}})])}}function tOe(t){return function(...e){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(s=>{s in n&&typeof n[s]=="function"&&Is(n,s,function(i){const a={mechanism:{data:{function:s,handler:zo(i)},handled:!1,type:"instrument"}},l=cj(i);return l&&(a.mechanism.data.handler=zo(l)),$f(i,a)})}),t.apply(this,e)}}function nOe(t){const n=Nt[t],r=n&&n.prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(Is(r,"addEventListener",function(s){return function(i,a,l){try{rOe(a)&&(a.handleEvent=$f(a.handleEvent,{mechanism:{data:{function:"handleEvent",handler:zo(a),target:t},handled:!1,type:"instrument"}}))}catch{}return s.apply(this,[i,$f(a,{mechanism:{data:{function:"addEventListener",handler:zo(a),target:t},handled:!1,type:"instrument"}}),l])}}),Is(r,"removeEventListener",function(s){return function(i,a,l){try{const u=a.__sentry_wrapped__;u&&s.call(this,i,u,l)}catch{}return s.call(this,i,a,l)}}))}function rOe(t){return typeof t.handleEvent=="function"}const sOe=()=>({name:"BrowserSession",setupOnce(){if(typeof Nt.document>"u"){Ha&&ze.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}N$({ignoreDuration:!0}),R$(),t_(({from:t,to:e})=>{t!==void 0&&t!==e&&(N$({ignoreDuration:!0}),R$())})}}),iOe="GlobalHandlers",aOe=(t={})=>{const e={onerror:!0,onunhandledrejection:!0,...t};return{name:iOe,setupOnce(){Error.stackTraceLimit=50},setup(n){e.onerror&&(lOe(n),X$("onerror")),e.onunhandledrejection&&(cOe(n),X$("onunhandledrejection"))}}},oOe=aOe;function lOe(t){O7(e=>{const{stackParser:n,attachStacktrace:r}=ZG();if(Yt()!==t||OG())return;const{msg:s,url:i,line:a,column:l,error:u}=e,d=fOe(bj(n,u||s,void 0,r,!1),i,a,l);d.level="error",mG(d,{originalException:u,mechanism:{handled:!1,type:"onerror"}})})}function cOe(t){P7(e=>{const{stackParser:n,attachStacktrace:r}=ZG();if(Yt()!==t||OG())return;const s=uOe(e),i=lj(s)?dOe(s):bj(n,s,void 0,r,!0);i.level="error",mG(i,{originalException:s,mechanism:{handled:!1,type:"onunhandledrejection"}})})}function uOe(t){if(lj(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch{}return t}function dOe(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function fOe(t,e,n,r){const s=t.exception=t.exception||{},i=s.values=s.values||[],a=i[0]=i[0]||{},l=a.stacktrace=a.stacktrace||{},u=l.frames=l.frames||[],d=r,p=n,h=No(e)&&e.length>0?e:$7();return u.length===0&&u.push({colno:d,filename:h,function:Eu,in_app:!0,lineno:p}),t}function X$(t){Ha&&ze.log(`Global Handler attached: ${t}`)}function ZG(){const t=Yt();return t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}const hOe=()=>({name:"HttpContext",preprocessEvent(t){if(!Nt.navigator&&!Nt.location&&!Nt.document)return;const e=t.request&&t.request.url||Nt.location&&Nt.location.href,{referrer:n}=Nt.document||{},{userAgent:r}=Nt.navigator||{},s={...t.request&&t.request.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},i={...t.request,...e&&{url:e},headers:s};t.request=i}}),pOe="cause",mOe=5,gOe="LinkedErrors",vOe=(t={})=>{const e=t.limit||mOe,n=t.key||pOe;return{name:gOe,preprocessEvent(r,s,i){const a=i.getOptions();Tje(vj,a.stackParser,a.maxValueLength,n,e,r,s)}}},yOe=vOe;function bOe(t){const e=[mje(),dje(),Z2e(),B2e(),oOe(),yOe(),Mje(),hOe()];return t.autoSessionTracking!==!1&&e.push(sOe()),e}function xOe(t={}){const e={defaultIntegrations:bOe(t),release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:Nt.SENTRY_RELEASE&&Nt.SENTRY_RELEASE.id?Nt.SENTRY_RELEASE.id:void 0,autoSessionTracking:!0,sendClientReports:!0};return t.defaultIntegrations==null&&delete t.defaultIntegrations,{...e,...t}}function _Oe(){const t=typeof Nt.window<"u"&&Nt;if(!t)return!1;const e=t.chrome?"chrome":"browser",n=t[e],r=n&&n.runtime&&n.runtime.id,s=Nt.location&&Nt.location.href||"",i=["chrome-extension:","moz-extension:","ms-browser-extension:","safari-web-extension:"],a=!!r&&Nt===Nt.top&&i.some(u=>s.startsWith(`${u}//`)),l=typeof t.nw<"u";return!!r&&!a&&!l}function wOe(t={}){const e=xOe(t);if(!e.skipBrowserExtensionCheck&&_Oe()){dc(()=>{console.error("[Sentry] You cannot run Sentry this way in a browser extension, check: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")});return}Ha&&(RG()||ze.warn("No Fetch API detected. The Sentry SDK requires a Fetch API compatible environment to send events. Please add a Fetch API polyfill."));const n={...e,stackParser:KAe(e.stackParser||z2e),integrations:VRe(e),transport:e.transport||T2e};return XRe(hMe,n)}const kn=Kt,Sj="sentryReplaySession",SOe="replay_event",Ej="Unable to send Replay",EOe=3e5,kOe=9e5,TOe=5e3,COe=5500,AOe=6e4,NOe=5e3,ROe=3,Q$=15e4,zy=5e3,jOe=3e3,MOe=300,kj=2e7,OOe=4999,POe=15e3,J$=36e5;function QC(t,e){return t??e()}function tg(t){let e,n=t[0],r=1;for(;r<t.length;){const s=t[r],i=t[r+1];if(r+=2,(s==="optionalAccess"||s==="optionalCall")&&n==null)return;s==="access"||s==="optionalAccess"?(e=n,n=i(n)):(s==="call"||s==="optionalCall")&&(n=i((...a)=>n.call(e,...a)),e=void 0)}return n}var Er;(function(t){t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment"})(Er||(Er={}));function IOe(t){return t.nodeType===t.ELEMENT_NODE}function vm(t){const e=tg([t,"optionalAccess",n=>n.host]);return tg([e,"optionalAccess",n=>n.shadowRoot])===t}function ym(t){return Object.prototype.toString.call(t)==="[object ShadowRoot]"}function DOe(t){return t.includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}function LOe(t){const{cssText:e}=t;if(e.split('"').length<3)return e;const n=["@import",`url(${JSON.stringify(t.href)})`];return t.layerName===""?n.push("layer"):t.layerName&&n.push(`layer(${t.layerName})`),t.supportsText&&n.push(`supports(${t.supportsText})`),t.media.length&&n.push(t.media.mediaText),n.join(" ")+";"}function Ox(t){try{const e=t.rules||t.cssRules;return e?DOe(Array.from(e,eW).join("")):null}catch{return null}}function $Oe(t){let e="";for(let n=0;n<t.style.length;n++){const r=t.style,s=r[n],i=r.getPropertyPriority(s);e+=`${s}:${r.getPropertyValue(s)}${i?" !important":""};`}return`${t.selectorText} { ${e} }`}function eW(t){let e;if(FOe(t))try{e=Ox(t.styleSheet)||LOe(t)}catch{}else if(UOe(t)){let n=t.cssText;const r=t.selectorText.includes(":"),s=typeof t.style.all=="string"&&t.style.all;if(s&&(n=$Oe(t)),r&&(n=zOe(n)),r||s)return n}return e||t.cssText}function zOe(t){const e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return t.replace(e,"$1\\$2")}function FOe(t){return"styleSheet"in t}function UOe(t){return"selectorText"in t}class tW{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){if(!e)return-1;const n=tg([this,"access",r=>r.getMeta,"call",r=>r(e),"optionalAccess",r=>r.id]);return QC(n,()=>-1)}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,n){const r=n.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,n)}replace(e,n){const r=this.getNode(e);if(r){const s=this.nodeMetaMap.get(r);s&&this.nodeMetaMap.set(n,s)}this.idNodeMap.set(e,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function BOe(){return new tW}function n_({maskInputOptions:t,tagName:e,type:n}){return e==="OPTION"&&(e="SELECT"),!!(t[e.toLowerCase()]||n&&t[n]||n==="password"||e==="INPUT"&&!n&&t.text)}function ng({isMasked:t,element:e,value:n,maskInputFn:r}){let s=n||"";return t?(r&&(s=r(s,e)),"*".repeat(s.length)):s}function Uf(t){return t.toLowerCase()}function JC(t){return t.toUpperCase()}const Z$="__rrweb_original__";function qOe(t){const e=t.getContext("2d");if(!e)return!0;const n=50;for(let r=0;r<t.width;r+=n)for(let s=0;s<t.height;s+=n){const i=e.getImageData,a=Z$ in i?i[Z$]:i;if(new Uint32Array(a.call(e,r,s,Math.min(n,t.width-r),Math.min(n,t.height-s)).data.buffer).some(u=>u!==0))return!1}return!0}function Tj(t){const e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?Uf(e):null}function Px(t,e,n){return e==="INPUT"&&(n==="radio"||n==="checkbox")?t.getAttribute("value")||"":t.value}function nW(t,e){let n;try{n=new URL(t,QC(e,()=>window.location.href))}catch{return null}const r=/\.([0-9a-z]+)(?:$)/i,s=n.pathname.match(r);return QC(tg([s,"optionalAccess",i=>i[1]]),()=>null)}const ez={};function rW(t){const e=ez[t];if(e)return e;const n=window.document;let r=window[t];if(n&&typeof n.createElement=="function")try{const s=n.createElement("iframe");s.hidden=!0,n.head.appendChild(s);const i=s.contentWindow;i&&i[t]&&(r=i[t]),n.head.removeChild(s)}catch{}return ez[t]=r.bind(window)}function ZC(...t){return rW("setTimeout")(...t)}function sW(...t){return rW("clearTimeout")(...t)}function iW(t){try{return t.contentDocument}catch{}}let VOe=1;const HOe=new RegExp("[^a-z0-9-_:]"),rg=-2;function Cj(){return VOe++}function GOe(t){if(t instanceof HTMLFormElement)return"form";const e=Uf(t.tagName);return HOe.test(e)?"div":e}function WOe(t){let e="";return t.indexOf("//")>-1?e=t.split("/").slice(0,3).join("/"):e=t.split("/")[0],e=e.split("?")[0],e}let Rd,tz;const YOe=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,KOe=/^(?:[a-z+]+:)?\/\//i,XOe=/^www\..*/i,QOe=/^(data:)([^,]*),(.*)/i;function Ix(t,e){return(t||"").replace(YOe,(n,r,s,i,a,l)=>{const u=s||a||l,d=r||i||"";if(!u)return n;if(KOe.test(u)||XOe.test(u))return`url(${d}${u}${d})`;if(QOe.test(u))return`url(${d}${u}${d})`;if(u[0]==="/")return`url(${d}${WOe(e)+u}${d})`;const p=e.split("/"),h=u.split("/");p.pop();for(const g of h)g!=="."&&(g===".."?p.pop():p.push(g));return`url(${d}${p.join("/")}${d})`})}const JOe=/^[^ \t\n\r\u000c]+/,ZOe=/^[, \t\n\r\u000c]+/;function ePe(t,e){if(e.trim()==="")return e;let n=0;function r(i){let a;const l=i.exec(e.substring(n));return l?(a=l[0],n+=a.length,a):""}const s=[];for(;r(ZOe),!(n>=e.length);){let i=r(JOe);if(i.slice(-1)===",")i=Qd(t,i.substring(0,i.length-1)),s.push(i);else{let a="";i=Qd(t,i);let l=!1;for(;;){const u=e.charAt(n);if(u===""){s.push((i+a).trim());break}else if(l)u===")"&&(l=!1);else if(u===","){n+=1,s.push((i+a).trim());break}else u==="("&&(l=!0);a+=u,n+=1}}}return s.join(", ")}const nz=new WeakMap;function Qd(t,e){return!e||e.trim()===""?e:r_(t,e)}function tPe(t){return!!(t.tagName==="svg"||t.ownerSVGElement)}function r_(t,e){let n=nz.get(t);if(n||(n=t.createElement("a"),nz.set(t,n)),!e)e="";else if(e.startsWith("blob:")||e.startsWith("data:"))return e;return n.setAttribute("href",e),n.href}function aW(t,e,n,r,s,i){return r&&(n==="src"||n==="href"&&!(e==="use"&&r[0]==="#")||n==="xlink:href"&&r[0]!=="#"||n==="background"&&(e==="table"||e==="td"||e==="th")?Qd(t,r):n==="srcset"?ePe(t,r):n==="style"?Ix(r,r_(t)):e==="object"&&n==="data"?Qd(t,r):typeof i=="function"?i(n,r,s):r)}function oW(t,e,n){return(t==="video"||t==="audio")&&e==="autoplay"}function nPe(t,e,n,r){try{if(r&&t.matches(r))return!1;if(typeof e=="string"){if(t.classList.contains(e))return!0}else for(let s=t.classList.length;s--;){const i=t.classList[s];if(e.test(i))return!0}if(n)return t.matches(n)}catch{}return!1}function rPe(t,e){for(let n=t.classList.length;n--;){const r=t.classList[n];if(e.test(r))return!0}return!1}function Xc(t,e,n=1/0,r=0){return!t||t.nodeType!==t.ELEMENT_NODE||r>n?-1:e(t)?r:Xc(t.parentNode,e,n,r+1)}function Jd(t,e){return n=>{const r=n;if(r===null)return!1;try{if(t){if(typeof t=="string"){if(r.matches(`.${t}`))return!0}else if(rPe(r,t))return!0}return!!(e&&r.matches(e))}catch{return!1}}}function Bf(t,e,n,r,s,i){try{const a=t.nodeType===t.ELEMENT_NODE?t:t.parentElement;if(a===null)return!1;if(a.tagName==="INPUT"){const d=a.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(d))return!0}let l=-1,u=-1;if(i){if(u=Xc(a,Jd(r,s)),u<0)return!0;l=Xc(a,Jd(e,n),u>=0?u:1/0)}else{if(l=Xc(a,Jd(e,n)),l<0)return!1;u=Xc(a,Jd(r,s),l>=0?l:1/0)}return l>=0?u>=0?l<=u:!0:u>=0?!1:!!i}catch{}return!!i}function sPe(t,e,n){const r=t.contentWindow;if(!r)return;let s=!1,i;try{i=r.document.readyState}catch{return}if(i!=="complete"){const l=ZC(()=>{s||(e(),s=!0)},n);t.addEventListener("load",()=>{sW(l),s=!0,e()});return}const a="about:blank";if(r.location.href!==a||t.src===a||t.src==="")return ZC(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}function iPe(t,e,n){let r=!1,s;try{s=t.sheet}catch{return}if(s)return;const i=ZC(()=>{r||(e(),r=!0)},n);t.addEventListener("load",()=>{sW(i),r=!0,e()})}function aPe(t,e){const{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:a,maskAllText:l,maskAttributeFn:u,maskTextClass:d,unmaskTextClass:p,maskTextSelector:h,unmaskTextSelector:g,inlineStylesheet:v,maskInputOptions:b={},maskTextFn:x,maskInputFn:E,dataURLOptions:S={},inlineImages:k,recordCanvas:T,keepIframeSrcFn:R,newlyAddedElement:j=!1}=e,A=oPe(n,r);switch(t.nodeType){case t.DOCUMENT_NODE:return t.compatMode!=="CSS1Compat"?{type:Er.Document,childNodes:[],compatMode:t.compatMode}:{type:Er.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:Er.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:A};case t.ELEMENT_NODE:return cPe(t,{doc:n,blockClass:s,blockSelector:i,unblockSelector:a,inlineStylesheet:v,maskAttributeFn:u,maskInputOptions:b,maskInputFn:E,dataURLOptions:S,inlineImages:k,recordCanvas:T,keepIframeSrcFn:R,newlyAddedElement:j,rootId:A,maskTextClass:d,unmaskTextClass:p,maskTextSelector:h,unmaskTextSelector:g});case t.TEXT_NODE:return lPe(t,{doc:n,maskAllText:l,maskTextClass:d,unmaskTextClass:p,maskTextSelector:h,unmaskTextSelector:g,maskTextFn:x,maskInputOptions:b,maskInputFn:E,rootId:A});case t.CDATA_SECTION_NODE:return{type:Er.CDATA,textContent:"",rootId:A};case t.COMMENT_NODE:return{type:Er.Comment,textContent:t.textContent||"",rootId:A};default:return!1}}function oPe(t,e){if(!e.hasNode(t))return;const n=e.getId(t);return n===1?void 0:n}function lPe(t,e){const{maskAllText:n,maskTextClass:r,unmaskTextClass:s,maskTextSelector:i,unmaskTextSelector:a,maskTextFn:l,maskInputOptions:u,maskInputFn:d,rootId:p}=e,h=t.parentNode&&t.parentNode.tagName;let g=t.textContent;const v=h==="STYLE"?!0:void 0,b=h==="SCRIPT"?!0:void 0,x=h==="TEXTAREA"?!0:void 0;if(v&&g){try{t.nextSibling||t.previousSibling||tg([t,"access",S=>S.parentNode,"access",S=>S.sheet,"optionalAccess",S=>S.cssRules])&&(g=Ox(t.parentNode.sheet))}catch(S){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${S}`,t)}g=Ix(g,r_(e.doc))}b&&(g="SCRIPT_PLACEHOLDER");const E=Bf(t,r,i,s,a,n);if(!v&&!b&&!x&&g&&E&&(g=l?l(g,t.parentElement):g.replace(/[\S]/g,"*")),x&&g&&(u.textarea||E)&&(g=d?d(g,t.parentNode):g.replace(/[\S]/g,"*")),h==="OPTION"&&g){const S=n_({type:null,tagName:h,maskInputOptions:u});g=ng({isMasked:Bf(t,r,i,s,a,S),element:t,value:g,maskInputFn:d})}return{type:Er.Text,textContent:g||"",isStyle:v,rootId:p}}function cPe(t,e){const{doc:n,blockClass:r,blockSelector:s,unblockSelector:i,inlineStylesheet:a,maskInputOptions:l={},maskAttributeFn:u,maskInputFn:d,dataURLOptions:p={},inlineImages:h,recordCanvas:g,keepIframeSrcFn:v,newlyAddedElement:b=!1,rootId:x,maskTextClass:E,unmaskTextClass:S,maskTextSelector:k,unmaskTextSelector:T}=e,R=nPe(t,r,s,i),j=GOe(t);let A={};const N=t.attributes.length;for(let I=0;I<N;I++){const O=t.attributes[I];O.name&&!oW(j,O.name,O.value)&&(A[O.name]=aW(n,j,Uf(O.name),O.value,t,u))}if(j==="link"&&a){const I=Array.from(n.styleSheets).find(L=>L.href===t.href);let O=null;I&&(O=Ox(I)),O&&(A.rel=null,A.href=null,A.crossorigin=null,A._cssText=Ix(O,I.href))}if(j==="style"&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){const I=Ox(t.sheet);I&&(A._cssText=Ix(I,r_(n)))}if(j==="input"||j==="textarea"||j==="select"||j==="option"){const I=t,O=Tj(I),L=Px(I,JC(j),O),z=I.checked;if(O!=="submit"&&O!=="button"&&L){const G=Bf(I,E,k,S,T,n_({type:O,tagName:JC(j),maskInputOptions:l}));A.value=ng({isMasked:G,element:I,value:L,maskInputFn:d})}z&&(A.checked=z)}if(j==="option"&&(t.selected&&!l.select?A.selected=!0:delete A.selected),j==="canvas"&&g){if(t.__context==="2d")qOe(t)||(A.rr_dataURL=t.toDataURL(p.type,p.quality));else if(!("__context"in t)){const I=t.toDataURL(p.type,p.quality),O=n.createElement("canvas");O.width=t.width,O.height=t.height;const L=O.toDataURL(p.type,p.quality);I!==L&&(A.rr_dataURL=I)}}if(j==="img"&&h){Rd||(Rd=n.createElement("canvas"),tz=Rd.getContext("2d"));const I=t,O=I.currentSrc||I.getAttribute("src")||"<unknown-src>",L=I.crossOrigin,z=()=>{I.removeEventListener("load",z);try{Rd.width=I.naturalWidth,Rd.height=I.naturalHeight,tz.drawImage(I,0,0),A.rr_dataURL=Rd.toDataURL(p.type,p.quality)}catch(G){if(I.crossOrigin!=="anonymous"){I.crossOrigin="anonymous",I.complete&&I.naturalWidth!==0?z():I.addEventListener("load",z);return}else console.warn(`Cannot inline img src=${O}! Error: ${G}`)}I.crossOrigin==="anonymous"&&(L?A.crossOrigin=L:I.removeAttribute("crossorigin"))};I.complete&&I.naturalWidth!==0?z():I.addEventListener("load",z)}if((j==="audio"||j==="video")&&(A.rr_mediaState=t.paused?"paused":"played",A.rr_mediaCurrentTime=t.currentTime),b||(t.scrollLeft&&(A.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(A.rr_scrollTop=t.scrollTop)),R){const{width:I,height:O}=t.getBoundingClientRect();A={class:A.class,rr_width:`${I}px`,rr_height:`${O}px`}}j==="iframe"&&!v(A.src)&&(!R&&!iW(t)&&(A.rr_src=A.src),delete A.src);let M;try{customElements.get(j)&&(M=!0)}catch{}return{type:Er.Element,tagName:j,attributes:A,childNodes:[],isSVG:tPe(t)||void 0,needBlock:R,rootId:x,isCustom:M}}function Sn(t){return t==null?"":t.toLowerCase()}function uPe(t,e){if(e.comment&&t.type===Er.Comment)return!0;if(t.type===Er.Element){if(e.script&&(t.tagName==="script"||t.tagName==="link"&&(t.attributes.rel==="preload"||t.attributes.rel==="modulepreload")||t.tagName==="link"&&t.attributes.rel==="prefetch"&&typeof t.attributes.href=="string"&&nW(t.attributes.href)==="js"))return!0;if(e.headFavicon&&(t.tagName==="link"&&t.attributes.rel==="shortcut icon"||t.tagName==="meta"&&(Sn(t.attributes.name).match(/^msapplication-tile(image|color)$/)||Sn(t.attributes.name)==="application-name"||Sn(t.attributes.rel)==="icon"||Sn(t.attributes.rel)==="apple-touch-icon"||Sn(t.attributes.rel)==="shortcut icon")))return!0;if(t.tagName==="meta"){if(e.headMetaDescKeywords&&Sn(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Sn(t.attributes.property).match(/^(og|twitter|fb):/)||Sn(t.attributes.name).match(/^(og|twitter):/)||Sn(t.attributes.name)==="pinterest"))return!0;if(e.headMetaRobots&&(Sn(t.attributes.name)==="robots"||Sn(t.attributes.name)==="googlebot"||Sn(t.attributes.name)==="bingbot"))return!0;if(e.headMetaHttpEquiv&&t.attributes["http-equiv"]!==void 0)return!0;if(e.headMetaAuthorship&&(Sn(t.attributes.name)==="author"||Sn(t.attributes.name)==="generator"||Sn(t.attributes.name)==="framework"||Sn(t.attributes.name)==="publisher"||Sn(t.attributes.name)==="progid"||Sn(t.attributes.property).match(/^article:/)||Sn(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&(Sn(t.attributes.name)==="google-site-verification"||Sn(t.attributes.name)==="yandex-verification"||Sn(t.attributes.name)==="csrf-token"||Sn(t.attributes.name)==="p:domain_verify"||Sn(t.attributes.name)==="verify-v1"||Sn(t.attributes.name)==="verification"||Sn(t.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Zd(t,e){const{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:a,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:p,unmaskTextSelector:h,skipChild:g=!1,inlineStylesheet:v=!0,maskInputOptions:b={},maskAttributeFn:x,maskTextFn:E,maskInputFn:S,slimDOMOptions:k,dataURLOptions:T={},inlineImages:R=!1,recordCanvas:j=!1,onSerialize:A,onIframeLoad:N,iframeLoadTimeout:M=5e3,onStylesheetLoad:I,stylesheetLoadTimeout:O=5e3,keepIframeSrcFn:L=()=>!1,newlyAddedElement:z=!1}=e;let{preserveWhiteSpace:G=!0}=e;const W=aPe(t,{doc:n,mirror:r,blockClass:s,blockSelector:i,maskAllText:l,unblockSelector:a,maskTextClass:u,unmaskTextClass:d,maskTextSelector:p,unmaskTextSelector:h,inlineStylesheet:v,maskInputOptions:b,maskAttributeFn:x,maskTextFn:E,maskInputFn:S,dataURLOptions:T,inlineImages:R,recordCanvas:j,keepIframeSrcFn:L,newlyAddedElement:z});if(!W)return console.warn(t,"not serialized"),null;let X;r.hasNode(t)?X=r.getId(t):uPe(W,k)||!G&&W.type===Er.Text&&!W.isStyle&&!W.textContent.replace(/^\s+|\s+$/gm,"").length?X=rg:X=Cj();const F=Object.assign(W,{id:X});if(r.add(t,F),X===rg)return null;A&&A(t);let Y=!g;if(F.type===Er.Element){Y=Y&&!F.needBlock,delete F.needBlock;const H=t.shadowRoot;H&&ym(H)&&(F.isShadowHost=!0)}if((F.type===Er.Document||F.type===Er.Element)&&Y){k.headWhitespace&&F.type===Er.Element&&F.tagName==="head"&&(G=!1);const H={doc:n,mirror:r,blockClass:s,blockSelector:i,maskAllText:l,unblockSelector:a,maskTextClass:u,unmaskTextClass:d,maskTextSelector:p,unmaskTextSelector:h,skipChild:g,inlineStylesheet:v,maskInputOptions:b,maskAttributeFn:x,maskTextFn:E,maskInputFn:S,slimDOMOptions:k,dataURLOptions:T,inlineImages:R,recordCanvas:j,preserveWhiteSpace:G,onSerialize:A,onIframeLoad:N,iframeLoadTimeout:M,onStylesheetLoad:I,stylesheetLoadTimeout:O,keepIframeSrcFn:L};for(const te of Array.from(t.childNodes)){const P=Zd(te,H);P&&F.childNodes.push(P)}if(IOe(t)&&t.shadowRoot)for(const te of Array.from(t.shadowRoot.childNodes)){const P=Zd(te,H);P&&(ym(t.shadowRoot)&&(P.isShadow=!0),F.childNodes.push(P))}}return t.parentNode&&vm(t.parentNode)&&ym(t.parentNode)&&(F.isShadow=!0),F.type===Er.Element&&F.tagName==="iframe"&&sPe(t,()=>{const H=iW(t);if(H&&N){const te=Zd(H,{doc:H,mirror:r,blockClass:s,blockSelector:i,unblockSelector:a,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:p,unmaskTextSelector:h,skipChild:!1,inlineStylesheet:v,maskInputOptions:b,maskAttributeFn:x,maskTextFn:E,maskInputFn:S,slimDOMOptions:k,dataURLOptions:T,inlineImages:R,recordCanvas:j,preserveWhiteSpace:G,onSerialize:A,onIframeLoad:N,iframeLoadTimeout:M,onStylesheetLoad:I,stylesheetLoadTimeout:O,keepIframeSrcFn:L});te&&N(t,te)}},M),F.type===Er.Element&&F.tagName==="link"&&typeof F.attributes.rel=="string"&&(F.attributes.rel==="stylesheet"||F.attributes.rel==="preload"&&typeof F.attributes.href=="string"&&nW(F.attributes.href)==="css")&&iPe(t,()=>{if(I){const H=Zd(t,{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:a,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:p,unmaskTextSelector:h,skipChild:!1,inlineStylesheet:v,maskInputOptions:b,maskAttributeFn:x,maskTextFn:E,maskInputFn:S,slimDOMOptions:k,dataURLOptions:T,inlineImages:R,recordCanvas:j,preserveWhiteSpace:G,onSerialize:A,onIframeLoad:N,iframeLoadTimeout:M,onStylesheetLoad:I,stylesheetLoadTimeout:O,keepIframeSrcFn:L});H&&I(t,H)}},O),F}function dPe(t,e){const{mirror:n=new tW,blockClass:r="rr-block",blockSelector:s=null,unblockSelector:i=null,maskAllText:a=!1,maskTextClass:l="rr-mask",unmaskTextClass:u=null,maskTextSelector:d=null,unmaskTextSelector:p=null,inlineStylesheet:h=!0,inlineImages:g=!1,recordCanvas:v=!1,maskAllInputs:b=!1,maskAttributeFn:x,maskTextFn:E,maskInputFn:S,slimDOM:k=!1,dataURLOptions:T,preserveWhiteSpace:R,onSerialize:j,onIframeLoad:A,iframeLoadTimeout:N,onStylesheetLoad:M,stylesheetLoadTimeout:I,keepIframeSrcFn:O=()=>!1}=e||{};return Zd(t,{doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,maskAllText:a,maskTextClass:l,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:p,skipChild:!1,inlineStylesheet:h,maskInputOptions:b===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:b===!1?{}:b,maskAttributeFn:x,maskTextFn:E,maskInputFn:S,slimDOMOptions:k===!0||k==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:k==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:k===!1?{}:k,dataURLOptions:T,inlineImages:g,recordCanvas:v,preserveWhiteSpace:R,onSerialize:j,onIframeLoad:A,iframeLoadTimeout:N,onStylesheetLoad:M,stylesheetLoadTimeout:I,keepIframeSrcFn:O,newlyAddedElement:!1})}function jl(t){let e,n=t[0],r=1;for(;r<t.length;){const s=t[r],i=t[r+1];if(r+=2,(s==="optionalAccess"||s==="optionalCall")&&n==null)return;s==="access"||s==="optionalAccess"?(e=n,n=i(n)):(s==="call"||s==="optionalCall")&&(n=i((...a)=>n.call(e,...a)),e=void 0)}return n}function hs(t,e,n=document){const r={capture:!0,passive:!0};return n.addEventListener(t,e,r),()=>n.removeEventListener(t,e,r)}const Fd=`Please stop import mirror directly. Instead of that,\r
|
|
1870
|
+
Error:`,s)}}function UMe(){return wMe(t=>{ph("cls",{metric:t}),LG=t},{reportAllChanges:!0})}function BMe(){return EMe(t=>{ph("fid",{metric:t}),$G=t})}function qMe(){return LMe(t=>{ph("lcp",{metric:t}),zG=t},{reportAllChanges:!0})}function VMe(){return zMe(t=>{ph("ttfb",{metric:t}),FG=t})}function HMe(){return IMe(t=>{ph("inp",{metric:t}),UG=t})}function Lg(t,e,n,r,s=!1){HG(t,e);let i;return Mx[t]||(i=n(),Mx[t]=!0),r&&e({metric:r}),GG(t,e,s?i:void 0)}function GMe(t){const e={};t==="event"&&(e.durationThreshold=0),Iu(t,n=>{ph(t,{entries:n})},e)}function HG(t,e){mm[t]=mm[t]||[],mm[t].push(e)}function GG(t,e,n){return()=>{n&&n();const r=mm[t];if(!r)return;const s=r.indexOf(e);s!==-1&&r.splice(s,1)}}function WMe(t){return"duration"in t}function Q1(t){return typeof t=="number"&&isFinite(t)}function qo(t,e,n,{...r}){const s=rn(t).start_timestamp;return s&&s>e&&typeof t.updateStartTime=="function"&&t.updateStartTime(e),uG(t,()=>{const i=Og({startTime:e,...r});return i&&i.end(n),i})}function WG(t){const e=Yt();if(!e)return;const{name:n,transaction:r,attributes:s,startTime:i}=t,{release:a,environment:l}=e.getOptions(),u=e.getIntegrationByName("Replay"),d=u&&u.getReplayId(),p=An(),h=p.getUser(),g=h!==void 0?h.email||h.id||h.ip_address:void 0;let v;try{v=p.getScopeData().contexts.profile.profile_id}catch{}const b={release:a,environment:l,user:g||void 0,profile_id:v||void 0,replay_id:d||void 0,transaction:r,"user_agent.original":gt.navigator&>.navigator.userAgent,...s};return Og({name:n,attributes:b,startTime:i,experimental:{standalone:!0}})}function wj(){return gt&>.addEventListener&>.performance}function or(t){return t/1e3}function YG(t){let e="unknown",n="unknown",r="";for(const s of t){if(s==="/"){[e,n]=t.split("/");break}if(!isNaN(Number(s))){e=r==="h"?"http":r,n=t.split(r)[1];break}r+=s}return r===t&&(e=r),{name:e,version:n}}function YMe(){let t=0,e,n;if(!XMe())return;let r=!1;function s(){r||(r=!0,n&&KMe(t,e,n),i())}const i=_j(({metric:a})=>{const l=a.entries[a.entries.length-1];l&&(t=a.value,e=l)},!0);hh(()=>{s()}),setTimeout(()=>{const a=Yt();if(!a)return;const l=a.on("startNavigationSpan",()=>{s(),l&&l()}),u=$r(),d=u&&Kr(u),p=d&&rn(d);p&&p.op==="pageload"&&(n=d.spanContext().spanId)},0)}function KMe(t,e,n){xj&&ze.log(`Sending CLS span (${t})`);const r=or((vs||0)+(e&&e.startTime||0)),s=An().getScopeData().transactionName,i=e?Uo(e.sources[0]&&e.sources[0].node):"Layout shift",a=Nr({[Dr]:"auto.http.browser.cls",[Tu]:"ui.webvital.cls",[fj]:e&&e.duration||0,"sentry.pageload.span_id":n}),l=WG({name:i,transaction:s,attributes:a,startTime:r});l&&(l.addEvent("cls",{[Q0]:"",[J0]:t}),l.end(r))}function XMe(){try{return PerformanceObserver.supportedEntryTypes.includes("layout-shift")}catch{return!1}}const QMe=2147483647;let V$=0,Gr={},ks,gm;function JMe({recordClsStandaloneSpans:t}){const e=wj();if(e&&vs){e.mark&>.performance.mark("sentry-tracing-init");const n=sOe(),r=rOe(),s=iOe(),i=t?YMe():nOe();return()=>{n(),r(),s(),i&&i()}}return()=>{}}function ZMe(){zf("longtask",({entries:t})=>{const e=$r();if(!e)return;const{op:n,start_timestamp:r}=rn(e);for(const s of t){const i=or(vs+s.startTime),a=or(s.duration);n==="navigation"&&r&&i<r||qo(e,i,i+a,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[Dr]:"auto.ui.browser.metrics"}})}})}function eOe(){new PerformanceObserver(e=>{const n=$r();if(n)for(const r of e.getEntries()){if(!r.scripts[0])continue;const s=or(vs+r.startTime),{start_timestamp:i,op:a}=rn(n);if(a==="navigation"&&i&&s<i)continue;const l=or(r.duration),u={[Dr]:"auto.ui.browser.metrics"},d=r.scripts[0],{invoker:p,invokerType:h,sourceURL:g,sourceFunctionName:v,sourceCharPosition:b}=d;u["browser.script.invoker"]=p,u["browser.script.invoker_type"]=h,g&&(u["code.filepath"]=g),v&&(u["code.function"]=v),b!==-1&&(u["browser.script.source_char_position"]=b),qo(n,s,s+l,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:u})}}).observe({type:"long-animation-frame",buffered:!0})}function tOe(){zf("event",({entries:t})=>{const e=$r();if(e){for(const n of t)if(n.name==="click"){const r=or(vs+n.startTime),s=or(n.duration),i={name:Uo(n.target),op:`ui.interaction.${n.name}`,startTime:r,attributes:{[Dr]:"auto.ui.browser.metrics"}},a=z7(n.target);a&&(i.attributes["ui.component_name"]=a),qo(e,r,r+s,i)}}})}function nOe(){return _j(({metric:t})=>{const e=t.entries[t.entries.length-1];e&&(Gr.cls={value:t.value,unit:""},gm=e)},!0)}function rOe(){return BG(({metric:t})=>{const e=t.entries[t.entries.length-1];e&&(Gr.lcp={value:t.value,unit:"millisecond"},ks=e)},!0)}function sOe(){return qG(({metric:t})=>{const e=t.entries[t.entries.length-1];if(!e)return;const n=or(vs),r=or(e.startTime);Gr.fid={value:t.value,unit:"millisecond"},Gr["mark.fid"]={value:n+r,unit:"second"}})}function iOe(){return FMe(({metric:t})=>{t.entries[t.entries.length-1]&&(Gr.ttfb={value:t.value,unit:"millisecond"})})}function aOe(t,e){const n=wj();if(!n||!n.getEntries||!vs)return;const r=or(vs),s=n.getEntries(),{op:i,start_timestamp:a}=rn(t);if(s.slice(V$).forEach(l=>{const u=or(l.startTime),d=or(Math.max(0,l.duration));if(!(i==="navigation"&&a&&r+u<a))switch(l.entryType){case"navigation":{lOe(t,l,r);break}case"mark":case"paint":case"measure":{oOe(t,l,u,d,r);const p=e_(),h=l.startTime<p.firstHiddenTime;l.name==="first-paint"&&h&&(Gr.fp={value:l.startTime,unit:"millisecond"}),l.name==="first-contentful-paint"&&h&&(Gr.fcp={value:l.startTime,unit:"millisecond"});break}case"resource":{dOe(t,l,l.name,u,d,r);break}}}),V$=Math.max(s.length-1,0),fOe(t),i==="pageload"){pOe(Gr);const l=Gr["mark.fid"];l&&Gr.fid&&(qo(t,l.value,l.value+or(Gr.fid.value),{name:"first input delay",op:"ui.action",attributes:{[Dr]:"auto.ui.browser.metrics"}}),delete Gr["mark.fid"]),(!("fcp"in Gr)||!e.recordClsOnPageloadSpan)&&delete Gr.cls,Object.entries(Gr).forEach(([u,d])=>{dRe(u,d.value,d.unit)}),t.setAttribute("performance.timeOrigin",r),t.setAttribute("performance.activationStart",Ig()),hOe(t)}ks=void 0,gm=void 0,Gr={}}function oOe(t,e,n,r,s){const i=Pg(!1),a=or(i?i.requestStart:0),l=s+Math.max(n,a),u=s+n,d=u+r,p={[Dr]:"auto.resource.browser.metrics"};return l!==u&&(p["sentry.browser.measure_happened_before_request"]=!0,p["sentry.browser.measure_start_time"]=l),qo(t,l,d,{name:e.name,op:e.entryType,attributes:p}),l}function lOe(t,e,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{Dy(t,e,r,n)}),Dy(t,e,"secureConnection",n,"TLS/SSL"),Dy(t,e,"fetch",n,"cache"),Dy(t,e,"domainLookup",n,"DNS"),uOe(t,e,n)}function Dy(t,e,n,r,s=n){const i=cOe(n),a=e[i],l=e[`${n}Start`];!l||!a||qo(t,r+or(l),r+or(a),{op:`browser.${s}`,name:e.name,attributes:{[Dr]:"auto.ui.browser.metrics"}})}function cOe(t){return t==="secureConnection"?"connectEnd":t==="fetch"?"domainLookupStart":`${t}End`}function uOe(t,e,n){const r=n+or(e.requestStart),s=n+or(e.responseEnd),i=n+or(e.responseStart);e.responseEnd&&(qo(t,r,s,{op:"browser.request",name:e.name,attributes:{[Dr]:"auto.ui.browser.metrics"}}),qo(t,i,s,{op:"browser.response",name:e.name,attributes:{[Dr]:"auto.ui.browser.metrics"}}))}function dOe(t,e,n,r,s,i){if(e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch")return;const a=cu(n),l={[Dr]:"auto.resource.browser.metrics"};J1(l,e,"transferSize","http.response_transfer_size"),J1(l,e,"encodedBodySize","http.response_content_length"),J1(l,e,"decodedBodySize","http.decoded_response_content_length");const u=e.deliveryType;u!=null&&(l["http.response_delivery_type"]=u);const d=e.renderBlockingStatus;d&&(l["resource.render_blocking_status"]=d),a.protocol&&(l["url.scheme"]=a.protocol.split(":").pop()),a.host&&(l["server.address"]=a.host),l["url.same_origin"]=n.includes(gt.location.origin);const{name:p,version:h}=YG(e.nextHopProtocol);l["network.protocol.name"]=p,l["network.protocol.version"]=h;const g=i+r,v=g+s;qo(t,g,v,{name:n.replace(gt.location.origin,""),op:e.initiatorType?`resource.${e.initiatorType}`:"resource.other",attributes:l})}function fOe(t){const e=gt.navigator;if(!e)return;const n=e.connection;n&&(n.effectiveType&&t.setAttribute("effectiveConnectionType",n.effectiveType),n.type&&t.setAttribute("connectionType",n.type),Q1(n.rtt)&&(Gr["connection.rtt"]={value:n.rtt,unit:"millisecond"})),Q1(e.deviceMemory)&&t.setAttribute("deviceMemory",`${e.deviceMemory} GB`),Q1(e.hardwareConcurrency)&&t.setAttribute("hardwareConcurrency",String(e.hardwareConcurrency))}function hOe(t){ks&&(ks.element&&t.setAttribute("lcp.element",Uo(ks.element)),ks.id&&t.setAttribute("lcp.id",ks.id),ks.url&&t.setAttribute("lcp.url",ks.url.trim().slice(0,200)),ks.loadTime!=null&&t.setAttribute("lcp.loadTime",ks.loadTime),ks.renderTime!=null&&t.setAttribute("lcp.renderTime",ks.renderTime),t.setAttribute("lcp.size",ks.size)),gm&&gm.sources&&gm.sources.forEach((e,n)=>t.setAttribute(`cls.source.${n+1}`,Uo(e.node)))}function J1(t,e,n,r){const s=e[n];s!=null&&s<QMe&&(t[r]=s)}function pOe(t){const e=Pg(!1);if(!e)return;const{responseStart:n,requestStart:r}=e;r<=n&&(t["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}const mOe=1e3;let H$,YC,KC;function KG(t){const e="dom";fc(e,t),hc(e,gOe)}function gOe(){if(!gt.document)return;const t=ji.bind(null,"dom"),e=G$(t,!0);gt.document.addEventListener("click",e,!1),gt.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(n=>{const s=gt[n],i=s&&s.prototype;!i||!i.hasOwnProperty||!i.hasOwnProperty("addEventListener")||(Is(i,"addEventListener",function(a){return function(l,u,d){if(l==="click"||l=="keypress")try{const p=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},h=p[l]=p[l]||{refCount:0};if(!h.handler){const g=G$(t);h.handler=g,a.call(this,l,g,d)}h.refCount++}catch{}return a.call(this,l,u,d)}}),Is(i,"removeEventListener",function(a){return function(l,u,d){if(l==="click"||l=="keypress")try{const p=this.__sentry_instrumentation_handlers__||{},h=p[l];h&&(h.refCount--,h.refCount<=0&&(a.call(this,l,h.handler,d),h.handler=void 0,delete p[l]),Object.keys(p).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return a.call(this,l,u,d)}}))})}function vOe(t){if(t.type!==YC)return!1;try{if(!t.target||t.target._sentryId!==KC)return!1}catch{}return!0}function yOe(t,e){return t!=="keypress"?!1:!e||!e.tagName?!0:!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable)}function G$(t,e=!1){return n=>{if(!n||n._sentryCaptured)return;const r=bOe(n);if(yOe(n.type,r))return;Mi(n,"_sentryCaptured",!0),r&&!r._sentryId&&Mi(r,"_sentryId",ii());const s=n.type==="keypress"?"input":n.type;vOe(n)||(t({event:n,name:s,global:e}),YC=n.type,KC=r?r._sentryId:void 0),clearTimeout(H$),H$=gt.setTimeout(()=>{KC=void 0,YC=void 0},mOe)}}function bOe(t){try{return t.target}catch{return null}}let Ly;function t_(t){const e="history";fc(e,t),hc(e,xOe)}function xOe(){if(!Qje())return;const t=gt.onpopstate;gt.onpopstate=function(...n){const r=gt.location.href,s=Ly;if(Ly=r,ji("history",{from:s,to:r}),t)try{return t.apply(this,n)}catch{}};function e(n){return function(...r){const s=r.length>2?r[2]:void 0;if(s){const i=Ly,a=String(s);Ly=a,ji("history",{from:i,to:a})}return n.apply(this,r)}}Is(gt.history,"pushState",e),Is(gt.history,"replaceState",e)}const hb={};function XG(t){const e=hb[t];if(e)return e;let n=gt[t];if(BC(n))return hb[t]=n.bind(gt);const r=gt.document;if(r&&typeof r.createElement=="function")try{const s=r.createElement("iframe");s.hidden=!0,r.head.appendChild(s);const i=s.contentWindow;i&&i[t]&&(n=i[t]),r.head.removeChild(s)}catch(s){xj&&ze.warn(`Could not create sandbox iframe for ${t} check, bailing to window.${t}: `,s)}return n&&(hb[t]=n.bind(gt))}function W$(t){hb[t]=void 0}function Ff(...t){return XG("setTimeout")(...t)}const Kc="__sentry_xhr_v3__";function QG(t){const e="xhr";fc(e,t),hc(e,_Oe)}function _Oe(){if(!gt.XMLHttpRequest)return;const t=XMLHttpRequest.prototype;t.open=new Proxy(t.open,{apply(e,n,r){const s=new Error,i=ms()*1e3,a=No(r[0])?r[0].toUpperCase():void 0,l=wOe(r[1]);if(!a||!l)return e.apply(n,r);n[Kc]={method:a,url:l,request_headers:{}},a==="POST"&&l.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const u=()=>{const d=n[Kc];if(d&&n.readyState===4){try{d.status_code=n.status}catch{}const p={endTimestamp:ms()*1e3,startTimestamp:i,xhr:n,virtualError:s};ji("xhr",p)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(d,p,h){return u(),d.apply(p,h)}}):n.addEventListener("readystatechange",u),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(d,p,h){const[g,v]=h,b=p[Kc];return b&&No(g)&&No(v)&&(b.request_headers[g.toLowerCase()]=v),d.apply(p,h)}}),e.apply(n,r)}}),t.send=new Proxy(t.send,{apply(e,n,r){const s=n[Kc];if(!s)return e.apply(n,r);r[0]!==void 0&&(s.body=r[0]);const i={startTimestamp:ms()*1e3,xhr:n};return ji("xhr",i),e.apply(n,r)}})}function wOe(t){if(No(t))return t;try{return t.toString()}catch{}}const Z1=[],pb=new Map;function SOe(){if(wj()&&vs){const e=EOe();return()=>{e()}}return()=>{}}const Y$={click:"click",pointerdown:"click",pointerup:"click",mousedown:"click",mouseup:"click",touchstart:"click",touchend:"click",mouseover:"hover",mouseout:"hover",mouseenter:"hover",mouseleave:"hover",pointerover:"hover",pointerout:"hover",pointerenter:"hover",pointerleave:"hover",dragstart:"drag",dragend:"drag",drag:"drag",dragenter:"drag",dragleave:"drag",dragover:"drag",drop:"drag",keydown:"press",keyup:"press",keypress:"press",input:"press"};function EOe(){return VG(({metric:t})=>{if(t.value==null)return;const e=t.entries.find(b=>b.duration===t.value&&Y$[b.name]);if(!e)return;const{interactionId:n}=e,r=Y$[e.name],s=or(vs+e.startTime),i=or(t.value),a=$r(),l=a?Kr(a):void 0,d=(n!=null?pb.get(n):void 0)||l,p=d?rn(d).description:An().getScopeData().transactionName,h=Uo(e.target),g=Nr({[Dr]:"auto.http.browser.inp",[Tu]:`ui.interaction.${r}`,[fj]:e.duration}),v=WG({name:h,transaction:p,attributes:g,startTime:s});v&&(v.addEvent("inp",{[Q0]:"millisecond",[J0]:t.value}),v.end(s+i))})}function kOe(t){const e=({entries:n})=>{const r=$r(),s=r&&Kr(r);n.forEach(i=>{if(!WMe(i)||!s)return;const a=i.interactionId;if(a!=null&&!pb.has(a)){if(Z1.length>10){const l=Z1.shift();pb.delete(l)}Z1.push(a),pb.set(a,s)}})};zf("event",e),zf("first-input",e)}function TOe(t,e=XG("fetch")){let n=0,r=0;function s(i){const a=i.body.length;n+=a,r++;const l={body:i.body,method:"POST",referrerPolicy:"origin",headers:t.headers,keepalive:n<=6e4&&r<15,...t.fetchOptions};if(!e)return W$("fetch"),Cx("No fetch implementation available");try{return e(t.url,l).then(u=>(n-=a,r--,{statusCode:u.status,headers:{"x-sentry-rate-limits":u.headers.get("X-Sentry-Rate-Limits"),"retry-after":u.headers.get("Retry-After")}}))}catch(u){return W$("fetch"),n-=a,r--,Cx(u)}}return rje(t,s)}const COe=30,AOe=50;function XC(t,e,n,r){const s={filename:t,function:e==="<anonymous>"?Eu:e,in_app:!0};return n!==void 0&&(s.lineno=n),r!==void 0&&(s.colno=r),s}const NOe=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,ROe=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,jOe=/\((\S*)(?::(\d+))(?::(\d+))\)/,MOe=t=>{const e=NOe.exec(t);if(e){const[,r,s,i]=e;return XC(r,Eu,+s,+i)}const n=ROe.exec(t);if(n){if(n[2]&&n[2].indexOf("eval")===0){const a=jOe.exec(n[2]);a&&(n[2]=a[1],n[3]=a[2],n[4]=a[3])}const[s,i]=JG(n[1]||Eu,n[2]);return XC(i,s,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}},OOe=[COe,MOe],POe=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,IOe=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,DOe=t=>{const e=POe.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){const i=IOe.exec(e[3]);i&&(e[1]=e[1]||"eval",e[3]=i[1],e[4]=i[2],e[5]="")}let r=e[3],s=e[1]||Eu;return[s,r]=JG(s,r),XC(r,s,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},LOe=[AOe,DOe],$Oe=[OOe,LOe],zOe=M7(...$Oe),JG=(t,e)=>{const n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:Eu,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},$y=1024,FOe="Breadcrumbs",UOe=(t={})=>{const e={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...t};return{name:FOe,setup(n){e.console&&Aje(HOe(n)),e.dom&&KG(VOe(n,e.dom)),e.xhr&&QG(GOe(n)),e.fetch&&jG(WOe(n)),e.history&&t_(YOe(n)),e.sentry&&n.on("beforeSendEvent",qOe(n))}}},BOe=UOe;function qOe(t){return function(n){Yt()===t&&nc({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:Rl(n)},{event:n})}}function VOe(t,e){return function(r){if(Yt()!==t)return;let s,i,a=typeof e=="object"?e.serializeAttribute:void 0,l=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;l&&l>$y&&(Ha&&ze.warn(`\`dom.maxStringLength\` cannot exceed ${$y}, but a value of ${l} was configured. Sentry will use ${$y} instead.`),l=$y),typeof a=="string"&&(a=[a]);try{const d=r.event,p=KOe(d)?d.target:d;s=Uo(p,{keyAttrs:a,maxStringLength:l}),i=z7(p)}catch{s="<unknown>"}if(s.length===0)return;const u={category:`ui.${r.name}`,message:s};i&&(u.data={"ui.component_name":i}),nc(u,{event:r.event,name:r.name,global:r.global})}}function HOe(t){return function(n){if(Yt()!==t)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:TG(n.level),message:o$(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${o$(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;nc(r,{input:n.args,level:n.level})}}function GOe(t){return function(n){if(Yt()!==t)return;const{startTimestamp:r,endTimestamp:s}=n,i=n.xhr[Kc];if(!r||!s||!i)return;const{method:a,url:l,status_code:u,body:d}=i,p={method:a,url:l,status_code:u},h={xhr:n.xhr,input:d,startTimestamp:r,endTimestamp:s},g=NG(u);nc({category:"xhr",data:p,type:"http",level:g},h)}}function WOe(t){return function(n){if(Yt()!==t)return;const{startTimestamp:r,endTimestamp:s}=n;if(s&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.error){const i=n.fetchData,a={data:n.error,input:n.args,startTimestamp:r,endTimestamp:s};nc({category:"fetch",data:i,level:"error",type:"http"},a)}else{const i=n.response,a={...n.fetchData,status_code:i&&i.status},l={input:n.args,response:i,startTimestamp:r,endTimestamp:s},u=NG(a.status_code);nc({category:"fetch",data:a,type:"http",level:u},l)}}}function YOe(t){return function(n){if(Yt()!==t)return;let r=n.from,s=n.to;const i=cu(Nt.location.href);let a=r?cu(r):void 0;const l=cu(s);(!a||!a.path)&&(a=i),i.protocol===l.protocol&&i.host===l.host&&(s=l.relative),i.protocol===a.protocol&&i.host===a.host&&(r=a.relative),nc({category:"navigation",data:{from:r,to:s}})}}function KOe(t){return!!t&&!!t.target}const XOe=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],QOe="BrowserApiErrors",JOe=(t={})=>{const e={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...t};return{name:QOe,setupOnce(){e.setTimeout&&Is(Nt,"setTimeout",K$),e.setInterval&&Is(Nt,"setInterval",K$),e.requestAnimationFrame&&Is(Nt,"requestAnimationFrame",e2e),e.XMLHttpRequest&&"XMLHttpRequest"in Nt&&Is(XMLHttpRequest.prototype,"send",t2e);const n=e.eventTarget;n&&(Array.isArray(n)?n:XOe).forEach(n2e)}}},ZOe=JOe;function K$(t){return function(...e){const n=e[0];return e[0]=$f(n,{mechanism:{data:{function:zo(t)},handled:!1,type:"instrument"}}),t.apply(this,e)}}function e2e(t){return function(e){return t.apply(this,[$f(e,{mechanism:{data:{function:"requestAnimationFrame",handler:zo(t)},handled:!1,type:"instrument"}})])}}function t2e(t){return function(...e){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(s=>{s in n&&typeof n[s]=="function"&&Is(n,s,function(i){const a={mechanism:{data:{function:s,handler:zo(i)},handled:!1,type:"instrument"}},l=cj(i);return l&&(a.mechanism.data.handler=zo(l)),$f(i,a)})}),t.apply(this,e)}}function n2e(t){const n=Nt[t],r=n&&n.prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(Is(r,"addEventListener",function(s){return function(i,a,l){try{r2e(a)&&(a.handleEvent=$f(a.handleEvent,{mechanism:{data:{function:"handleEvent",handler:zo(a),target:t},handled:!1,type:"instrument"}}))}catch{}return s.apply(this,[i,$f(a,{mechanism:{data:{function:"addEventListener",handler:zo(a),target:t},handled:!1,type:"instrument"}}),l])}}),Is(r,"removeEventListener",function(s){return function(i,a,l){try{const u=a.__sentry_wrapped__;u&&s.call(this,i,u,l)}catch{}return s.call(this,i,a,l)}}))}function r2e(t){return typeof t.handleEvent=="function"}const s2e=()=>({name:"BrowserSession",setupOnce(){if(typeof Nt.document>"u"){Ha&&ze.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}N$({ignoreDuration:!0}),R$(),t_(({from:t,to:e})=>{t!==void 0&&t!==e&&(N$({ignoreDuration:!0}),R$())})}}),i2e="GlobalHandlers",a2e=(t={})=>{const e={onerror:!0,onunhandledrejection:!0,...t};return{name:i2e,setupOnce(){Error.stackTraceLimit=50},setup(n){e.onerror&&(l2e(n),X$("onerror")),e.onunhandledrejection&&(c2e(n),X$("onunhandledrejection"))}}},o2e=a2e;function l2e(t){O7(e=>{const{stackParser:n,attachStacktrace:r}=ZG();if(Yt()!==t||OG())return;const{msg:s,url:i,line:a,column:l,error:u}=e,d=f2e(bj(n,u||s,void 0,r,!1),i,a,l);d.level="error",mG(d,{originalException:u,mechanism:{handled:!1,type:"onerror"}})})}function c2e(t){P7(e=>{const{stackParser:n,attachStacktrace:r}=ZG();if(Yt()!==t||OG())return;const s=u2e(e),i=lj(s)?d2e(s):bj(n,s,void 0,r,!0);i.level="error",mG(i,{originalException:s,mechanism:{handled:!1,type:"onunhandledrejection"}})})}function u2e(t){if(lj(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch{}return t}function d2e(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function f2e(t,e,n,r){const s=t.exception=t.exception||{},i=s.values=s.values||[],a=i[0]=i[0]||{},l=a.stacktrace=a.stacktrace||{},u=l.frames=l.frames||[],d=r,p=n,h=No(e)&&e.length>0?e:$7();return u.length===0&&u.push({colno:d,filename:h,function:Eu,in_app:!0,lineno:p}),t}function X$(t){Ha&&ze.log(`Global Handler attached: ${t}`)}function ZG(){const t=Yt();return t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}const h2e=()=>({name:"HttpContext",preprocessEvent(t){if(!Nt.navigator&&!Nt.location&&!Nt.document)return;const e=t.request&&t.request.url||Nt.location&&Nt.location.href,{referrer:n}=Nt.document||{},{userAgent:r}=Nt.navigator||{},s={...t.request&&t.request.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},i={...t.request,...e&&{url:e},headers:s};t.request=i}}),p2e="cause",m2e=5,g2e="LinkedErrors",v2e=(t={})=>{const e=t.limit||m2e,n=t.key||p2e;return{name:g2e,preprocessEvent(r,s,i){const a=i.getOptions();Tje(vj,a.stackParser,a.maxValueLength,n,e,r,s)}}},y2e=v2e;function b2e(t){const e=[mje(),dje(),ZOe(),BOe(),o2e(),y2e(),Mje(),h2e()];return t.autoSessionTracking!==!1&&e.push(s2e()),e}function x2e(t={}){const e={defaultIntegrations:b2e(t),release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:Nt.SENTRY_RELEASE&&Nt.SENTRY_RELEASE.id?Nt.SENTRY_RELEASE.id:void 0,autoSessionTracking:!0,sendClientReports:!0};return t.defaultIntegrations==null&&delete t.defaultIntegrations,{...e,...t}}function _2e(){const t=typeof Nt.window<"u"&&Nt;if(!t)return!1;const e=t.chrome?"chrome":"browser",n=t[e],r=n&&n.runtime&&n.runtime.id,s=Nt.location&&Nt.location.href||"",i=["chrome-extension:","moz-extension:","ms-browser-extension:","safari-web-extension:"],a=!!r&&Nt===Nt.top&&i.some(u=>s.startsWith(`${u}//`)),l=typeof t.nw<"u";return!!r&&!a&&!l}function w2e(t={}){const e=x2e(t);if(!e.skipBrowserExtensionCheck&&_2e()){dc(()=>{console.error("[Sentry] You cannot run Sentry this way in a browser extension, check: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")});return}Ha&&(RG()||ze.warn("No Fetch API detected. The Sentry SDK requires a Fetch API compatible environment to send events. Please add a Fetch API polyfill."));const n={...e,stackParser:KAe(e.stackParser||zOe),integrations:VRe(e),transport:e.transport||TOe};return XRe(hMe,n)}const kn=Kt,Sj="sentryReplaySession",S2e="replay_event",Ej="Unable to send Replay",E2e=3e5,k2e=9e5,T2e=5e3,C2e=5500,A2e=6e4,N2e=5e3,R2e=3,Q$=15e4,zy=5e3,j2e=3e3,M2e=300,kj=2e7,O2e=4999,P2e=15e3,J$=36e5;function QC(t,e){return t??e()}function tg(t){let e,n=t[0],r=1;for(;r<t.length;){const s=t[r],i=t[r+1];if(r+=2,(s==="optionalAccess"||s==="optionalCall")&&n==null)return;s==="access"||s==="optionalAccess"?(e=n,n=i(n)):(s==="call"||s==="optionalCall")&&(n=i((...a)=>n.call(e,...a)),e=void 0)}return n}var Er;(function(t){t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment"})(Er||(Er={}));function I2e(t){return t.nodeType===t.ELEMENT_NODE}function vm(t){const e=tg([t,"optionalAccess",n=>n.host]);return tg([e,"optionalAccess",n=>n.shadowRoot])===t}function ym(t){return Object.prototype.toString.call(t)==="[object ShadowRoot]"}function D2e(t){return t.includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}function L2e(t){const{cssText:e}=t;if(e.split('"').length<3)return e;const n=["@import",`url(${JSON.stringify(t.href)})`];return t.layerName===""?n.push("layer"):t.layerName&&n.push(`layer(${t.layerName})`),t.supportsText&&n.push(`supports(${t.supportsText})`),t.media.length&&n.push(t.media.mediaText),n.join(" ")+";"}function Ox(t){try{const e=t.rules||t.cssRules;return e?D2e(Array.from(e,eW).join("")):null}catch{return null}}function $2e(t){let e="";for(let n=0;n<t.style.length;n++){const r=t.style,s=r[n],i=r.getPropertyPriority(s);e+=`${s}:${r.getPropertyValue(s)}${i?" !important":""};`}return`${t.selectorText} { ${e} }`}function eW(t){let e;if(F2e(t))try{e=Ox(t.styleSheet)||L2e(t)}catch{}else if(U2e(t)){let n=t.cssText;const r=t.selectorText.includes(":"),s=typeof t.style.all=="string"&&t.style.all;if(s&&(n=$2e(t)),r&&(n=z2e(n)),r||s)return n}return e||t.cssText}function z2e(t){const e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return t.replace(e,"$1\\$2")}function F2e(t){return"styleSheet"in t}function U2e(t){return"selectorText"in t}class tW{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){if(!e)return-1;const n=tg([this,"access",r=>r.getMeta,"call",r=>r(e),"optionalAccess",r=>r.id]);return QC(n,()=>-1)}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,n){const r=n.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,n)}replace(e,n){const r=this.getNode(e);if(r){const s=this.nodeMetaMap.get(r);s&&this.nodeMetaMap.set(n,s)}this.idNodeMap.set(e,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function B2e(){return new tW}function n_({maskInputOptions:t,tagName:e,type:n}){return e==="OPTION"&&(e="SELECT"),!!(t[e.toLowerCase()]||n&&t[n]||n==="password"||e==="INPUT"&&!n&&t.text)}function ng({isMasked:t,element:e,value:n,maskInputFn:r}){let s=n||"";return t?(r&&(s=r(s,e)),"*".repeat(s.length)):s}function Uf(t){return t.toLowerCase()}function JC(t){return t.toUpperCase()}const Z$="__rrweb_original__";function q2e(t){const e=t.getContext("2d");if(!e)return!0;const n=50;for(let r=0;r<t.width;r+=n)for(let s=0;s<t.height;s+=n){const i=e.getImageData,a=Z$ in i?i[Z$]:i;if(new Uint32Array(a.call(e,r,s,Math.min(n,t.width-r),Math.min(n,t.height-s)).data.buffer).some(u=>u!==0))return!1}return!0}function Tj(t){const e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?Uf(e):null}function Px(t,e,n){return e==="INPUT"&&(n==="radio"||n==="checkbox")?t.getAttribute("value")||"":t.value}function nW(t,e){let n;try{n=new URL(t,QC(e,()=>window.location.href))}catch{return null}const r=/\.([0-9a-z]+)(?:$)/i,s=n.pathname.match(r);return QC(tg([s,"optionalAccess",i=>i[1]]),()=>null)}const ez={};function rW(t){const e=ez[t];if(e)return e;const n=window.document;let r=window[t];if(n&&typeof n.createElement=="function")try{const s=n.createElement("iframe");s.hidden=!0,n.head.appendChild(s);const i=s.contentWindow;i&&i[t]&&(r=i[t]),n.head.removeChild(s)}catch{}return ez[t]=r.bind(window)}function ZC(...t){return rW("setTimeout")(...t)}function sW(...t){return rW("clearTimeout")(...t)}function iW(t){try{return t.contentDocument}catch{}}let V2e=1;const H2e=new RegExp("[^a-z0-9-_:]"),rg=-2;function Cj(){return V2e++}function G2e(t){if(t instanceof HTMLFormElement)return"form";const e=Uf(t.tagName);return H2e.test(e)?"div":e}function W2e(t){let e="";return t.indexOf("//")>-1?e=t.split("/").slice(0,3).join("/"):e=t.split("/")[0],e=e.split("?")[0],e}let Rd,tz;const Y2e=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,K2e=/^(?:[a-z+]+:)?\/\//i,X2e=/^www\..*/i,Q2e=/^(data:)([^,]*),(.*)/i;function Ix(t,e){return(t||"").replace(Y2e,(n,r,s,i,a,l)=>{const u=s||a||l,d=r||i||"";if(!u)return n;if(K2e.test(u)||X2e.test(u))return`url(${d}${u}${d})`;if(Q2e.test(u))return`url(${d}${u}${d})`;if(u[0]==="/")return`url(${d}${W2e(e)+u}${d})`;const p=e.split("/"),h=u.split("/");p.pop();for(const g of h)g!=="."&&(g===".."?p.pop():p.push(g));return`url(${d}${p.join("/")}${d})`})}const J2e=/^[^ \t\n\r\u000c]+/,Z2e=/^[, \t\n\r\u000c]+/;function ePe(t,e){if(e.trim()==="")return e;let n=0;function r(i){let a;const l=i.exec(e.substring(n));return l?(a=l[0],n+=a.length,a):""}const s=[];for(;r(Z2e),!(n>=e.length);){let i=r(J2e);if(i.slice(-1)===",")i=Qd(t,i.substring(0,i.length-1)),s.push(i);else{let a="";i=Qd(t,i);let l=!1;for(;;){const u=e.charAt(n);if(u===""){s.push((i+a).trim());break}else if(l)u===")"&&(l=!1);else if(u===","){n+=1,s.push((i+a).trim());break}else u==="("&&(l=!0);a+=u,n+=1}}}return s.join(", ")}const nz=new WeakMap;function Qd(t,e){return!e||e.trim()===""?e:r_(t,e)}function tPe(t){return!!(t.tagName==="svg"||t.ownerSVGElement)}function r_(t,e){let n=nz.get(t);if(n||(n=t.createElement("a"),nz.set(t,n)),!e)e="";else if(e.startsWith("blob:")||e.startsWith("data:"))return e;return n.setAttribute("href",e),n.href}function aW(t,e,n,r,s,i){return r&&(n==="src"||n==="href"&&!(e==="use"&&r[0]==="#")||n==="xlink:href"&&r[0]!=="#"||n==="background"&&(e==="table"||e==="td"||e==="th")?Qd(t,r):n==="srcset"?ePe(t,r):n==="style"?Ix(r,r_(t)):e==="object"&&n==="data"?Qd(t,r):typeof i=="function"?i(n,r,s):r)}function oW(t,e,n){return(t==="video"||t==="audio")&&e==="autoplay"}function nPe(t,e,n,r){try{if(r&&t.matches(r))return!1;if(typeof e=="string"){if(t.classList.contains(e))return!0}else for(let s=t.classList.length;s--;){const i=t.classList[s];if(e.test(i))return!0}if(n)return t.matches(n)}catch{}return!1}function rPe(t,e){for(let n=t.classList.length;n--;){const r=t.classList[n];if(e.test(r))return!0}return!1}function Xc(t,e,n=1/0,r=0){return!t||t.nodeType!==t.ELEMENT_NODE||r>n?-1:e(t)?r:Xc(t.parentNode,e,n,r+1)}function Jd(t,e){return n=>{const r=n;if(r===null)return!1;try{if(t){if(typeof t=="string"){if(r.matches(`.${t}`))return!0}else if(rPe(r,t))return!0}return!!(e&&r.matches(e))}catch{return!1}}}function Bf(t,e,n,r,s,i){try{const a=t.nodeType===t.ELEMENT_NODE?t:t.parentElement;if(a===null)return!1;if(a.tagName==="INPUT"){const d=a.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(d))return!0}let l=-1,u=-1;if(i){if(u=Xc(a,Jd(r,s)),u<0)return!0;l=Xc(a,Jd(e,n),u>=0?u:1/0)}else{if(l=Xc(a,Jd(e,n)),l<0)return!1;u=Xc(a,Jd(r,s),l>=0?l:1/0)}return l>=0?u>=0?l<=u:!0:u>=0?!1:!!i}catch{}return!!i}function sPe(t,e,n){const r=t.contentWindow;if(!r)return;let s=!1,i;try{i=r.document.readyState}catch{return}if(i!=="complete"){const l=ZC(()=>{s||(e(),s=!0)},n);t.addEventListener("load",()=>{sW(l),s=!0,e()});return}const a="about:blank";if(r.location.href!==a||t.src===a||t.src==="")return ZC(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}function iPe(t,e,n){let r=!1,s;try{s=t.sheet}catch{return}if(s)return;const i=ZC(()=>{r||(e(),r=!0)},n);t.addEventListener("load",()=>{sW(i),r=!0,e()})}function aPe(t,e){const{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:a,maskAllText:l,maskAttributeFn:u,maskTextClass:d,unmaskTextClass:p,maskTextSelector:h,unmaskTextSelector:g,inlineStylesheet:v,maskInputOptions:b={},maskTextFn:x,maskInputFn:E,dataURLOptions:S={},inlineImages:k,recordCanvas:T,keepIframeSrcFn:R,newlyAddedElement:j=!1}=e,A=oPe(n,r);switch(t.nodeType){case t.DOCUMENT_NODE:return t.compatMode!=="CSS1Compat"?{type:Er.Document,childNodes:[],compatMode:t.compatMode}:{type:Er.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:Er.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:A};case t.ELEMENT_NODE:return cPe(t,{doc:n,blockClass:s,blockSelector:i,unblockSelector:a,inlineStylesheet:v,maskAttributeFn:u,maskInputOptions:b,maskInputFn:E,dataURLOptions:S,inlineImages:k,recordCanvas:T,keepIframeSrcFn:R,newlyAddedElement:j,rootId:A,maskTextClass:d,unmaskTextClass:p,maskTextSelector:h,unmaskTextSelector:g});case t.TEXT_NODE:return lPe(t,{doc:n,maskAllText:l,maskTextClass:d,unmaskTextClass:p,maskTextSelector:h,unmaskTextSelector:g,maskTextFn:x,maskInputOptions:b,maskInputFn:E,rootId:A});case t.CDATA_SECTION_NODE:return{type:Er.CDATA,textContent:"",rootId:A};case t.COMMENT_NODE:return{type:Er.Comment,textContent:t.textContent||"",rootId:A};default:return!1}}function oPe(t,e){if(!e.hasNode(t))return;const n=e.getId(t);return n===1?void 0:n}function lPe(t,e){const{maskAllText:n,maskTextClass:r,unmaskTextClass:s,maskTextSelector:i,unmaskTextSelector:a,maskTextFn:l,maskInputOptions:u,maskInputFn:d,rootId:p}=e,h=t.parentNode&&t.parentNode.tagName;let g=t.textContent;const v=h==="STYLE"?!0:void 0,b=h==="SCRIPT"?!0:void 0,x=h==="TEXTAREA"?!0:void 0;if(v&&g){try{t.nextSibling||t.previousSibling||tg([t,"access",S=>S.parentNode,"access",S=>S.sheet,"optionalAccess",S=>S.cssRules])&&(g=Ox(t.parentNode.sheet))}catch(S){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${S}`,t)}g=Ix(g,r_(e.doc))}b&&(g="SCRIPT_PLACEHOLDER");const E=Bf(t,r,i,s,a,n);if(!v&&!b&&!x&&g&&E&&(g=l?l(g,t.parentElement):g.replace(/[\S]/g,"*")),x&&g&&(u.textarea||E)&&(g=d?d(g,t.parentNode):g.replace(/[\S]/g,"*")),h==="OPTION"&&g){const S=n_({type:null,tagName:h,maskInputOptions:u});g=ng({isMasked:Bf(t,r,i,s,a,S),element:t,value:g,maskInputFn:d})}return{type:Er.Text,textContent:g||"",isStyle:v,rootId:p}}function cPe(t,e){const{doc:n,blockClass:r,blockSelector:s,unblockSelector:i,inlineStylesheet:a,maskInputOptions:l={},maskAttributeFn:u,maskInputFn:d,dataURLOptions:p={},inlineImages:h,recordCanvas:g,keepIframeSrcFn:v,newlyAddedElement:b=!1,rootId:x,maskTextClass:E,unmaskTextClass:S,maskTextSelector:k,unmaskTextSelector:T}=e,R=nPe(t,r,s,i),j=G2e(t);let A={};const N=t.attributes.length;for(let I=0;I<N;I++){const O=t.attributes[I];O.name&&!oW(j,O.name,O.value)&&(A[O.name]=aW(n,j,Uf(O.name),O.value,t,u))}if(j==="link"&&a){const I=Array.from(n.styleSheets).find(L=>L.href===t.href);let O=null;I&&(O=Ox(I)),O&&(A.rel=null,A.href=null,A.crossorigin=null,A._cssText=Ix(O,I.href))}if(j==="style"&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){const I=Ox(t.sheet);I&&(A._cssText=Ix(I,r_(n)))}if(j==="input"||j==="textarea"||j==="select"||j==="option"){const I=t,O=Tj(I),L=Px(I,JC(j),O),z=I.checked;if(O!=="submit"&&O!=="button"&&L){const G=Bf(I,E,k,S,T,n_({type:O,tagName:JC(j),maskInputOptions:l}));A.value=ng({isMasked:G,element:I,value:L,maskInputFn:d})}z&&(A.checked=z)}if(j==="option"&&(t.selected&&!l.select?A.selected=!0:delete A.selected),j==="canvas"&&g){if(t.__context==="2d")q2e(t)||(A.rr_dataURL=t.toDataURL(p.type,p.quality));else if(!("__context"in t)){const I=t.toDataURL(p.type,p.quality),O=n.createElement("canvas");O.width=t.width,O.height=t.height;const L=O.toDataURL(p.type,p.quality);I!==L&&(A.rr_dataURL=I)}}if(j==="img"&&h){Rd||(Rd=n.createElement("canvas"),tz=Rd.getContext("2d"));const I=t,O=I.currentSrc||I.getAttribute("src")||"<unknown-src>",L=I.crossOrigin,z=()=>{I.removeEventListener("load",z);try{Rd.width=I.naturalWidth,Rd.height=I.naturalHeight,tz.drawImage(I,0,0),A.rr_dataURL=Rd.toDataURL(p.type,p.quality)}catch(G){if(I.crossOrigin!=="anonymous"){I.crossOrigin="anonymous",I.complete&&I.naturalWidth!==0?z():I.addEventListener("load",z);return}else console.warn(`Cannot inline img src=${O}! Error: ${G}`)}I.crossOrigin==="anonymous"&&(L?A.crossOrigin=L:I.removeAttribute("crossorigin"))};I.complete&&I.naturalWidth!==0?z():I.addEventListener("load",z)}if((j==="audio"||j==="video")&&(A.rr_mediaState=t.paused?"paused":"played",A.rr_mediaCurrentTime=t.currentTime),b||(t.scrollLeft&&(A.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(A.rr_scrollTop=t.scrollTop)),R){const{width:I,height:O}=t.getBoundingClientRect();A={class:A.class,rr_width:`${I}px`,rr_height:`${O}px`}}j==="iframe"&&!v(A.src)&&(!R&&!iW(t)&&(A.rr_src=A.src),delete A.src);let M;try{customElements.get(j)&&(M=!0)}catch{}return{type:Er.Element,tagName:j,attributes:A,childNodes:[],isSVG:tPe(t)||void 0,needBlock:R,rootId:x,isCustom:M}}function Sn(t){return t==null?"":t.toLowerCase()}function uPe(t,e){if(e.comment&&t.type===Er.Comment)return!0;if(t.type===Er.Element){if(e.script&&(t.tagName==="script"||t.tagName==="link"&&(t.attributes.rel==="preload"||t.attributes.rel==="modulepreload")||t.tagName==="link"&&t.attributes.rel==="prefetch"&&typeof t.attributes.href=="string"&&nW(t.attributes.href)==="js"))return!0;if(e.headFavicon&&(t.tagName==="link"&&t.attributes.rel==="shortcut icon"||t.tagName==="meta"&&(Sn(t.attributes.name).match(/^msapplication-tile(image|color)$/)||Sn(t.attributes.name)==="application-name"||Sn(t.attributes.rel)==="icon"||Sn(t.attributes.rel)==="apple-touch-icon"||Sn(t.attributes.rel)==="shortcut icon")))return!0;if(t.tagName==="meta"){if(e.headMetaDescKeywords&&Sn(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Sn(t.attributes.property).match(/^(og|twitter|fb):/)||Sn(t.attributes.name).match(/^(og|twitter):/)||Sn(t.attributes.name)==="pinterest"))return!0;if(e.headMetaRobots&&(Sn(t.attributes.name)==="robots"||Sn(t.attributes.name)==="googlebot"||Sn(t.attributes.name)==="bingbot"))return!0;if(e.headMetaHttpEquiv&&t.attributes["http-equiv"]!==void 0)return!0;if(e.headMetaAuthorship&&(Sn(t.attributes.name)==="author"||Sn(t.attributes.name)==="generator"||Sn(t.attributes.name)==="framework"||Sn(t.attributes.name)==="publisher"||Sn(t.attributes.name)==="progid"||Sn(t.attributes.property).match(/^article:/)||Sn(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&(Sn(t.attributes.name)==="google-site-verification"||Sn(t.attributes.name)==="yandex-verification"||Sn(t.attributes.name)==="csrf-token"||Sn(t.attributes.name)==="p:domain_verify"||Sn(t.attributes.name)==="verify-v1"||Sn(t.attributes.name)==="verification"||Sn(t.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Zd(t,e){const{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:a,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:p,unmaskTextSelector:h,skipChild:g=!1,inlineStylesheet:v=!0,maskInputOptions:b={},maskAttributeFn:x,maskTextFn:E,maskInputFn:S,slimDOMOptions:k,dataURLOptions:T={},inlineImages:R=!1,recordCanvas:j=!1,onSerialize:A,onIframeLoad:N,iframeLoadTimeout:M=5e3,onStylesheetLoad:I,stylesheetLoadTimeout:O=5e3,keepIframeSrcFn:L=()=>!1,newlyAddedElement:z=!1}=e;let{preserveWhiteSpace:G=!0}=e;const W=aPe(t,{doc:n,mirror:r,blockClass:s,blockSelector:i,maskAllText:l,unblockSelector:a,maskTextClass:u,unmaskTextClass:d,maskTextSelector:p,unmaskTextSelector:h,inlineStylesheet:v,maskInputOptions:b,maskAttributeFn:x,maskTextFn:E,maskInputFn:S,dataURLOptions:T,inlineImages:R,recordCanvas:j,keepIframeSrcFn:L,newlyAddedElement:z});if(!W)return console.warn(t,"not serialized"),null;let X;r.hasNode(t)?X=r.getId(t):uPe(W,k)||!G&&W.type===Er.Text&&!W.isStyle&&!W.textContent.replace(/^\s+|\s+$/gm,"").length?X=rg:X=Cj();const F=Object.assign(W,{id:X});if(r.add(t,F),X===rg)return null;A&&A(t);let Y=!g;if(F.type===Er.Element){Y=Y&&!F.needBlock,delete F.needBlock;const H=t.shadowRoot;H&&ym(H)&&(F.isShadowHost=!0)}if((F.type===Er.Document||F.type===Er.Element)&&Y){k.headWhitespace&&F.type===Er.Element&&F.tagName==="head"&&(G=!1);const H={doc:n,mirror:r,blockClass:s,blockSelector:i,maskAllText:l,unblockSelector:a,maskTextClass:u,unmaskTextClass:d,maskTextSelector:p,unmaskTextSelector:h,skipChild:g,inlineStylesheet:v,maskInputOptions:b,maskAttributeFn:x,maskTextFn:E,maskInputFn:S,slimDOMOptions:k,dataURLOptions:T,inlineImages:R,recordCanvas:j,preserveWhiteSpace:G,onSerialize:A,onIframeLoad:N,iframeLoadTimeout:M,onStylesheetLoad:I,stylesheetLoadTimeout:O,keepIframeSrcFn:L};for(const te of Array.from(t.childNodes)){const P=Zd(te,H);P&&F.childNodes.push(P)}if(I2e(t)&&t.shadowRoot)for(const te of Array.from(t.shadowRoot.childNodes)){const P=Zd(te,H);P&&(ym(t.shadowRoot)&&(P.isShadow=!0),F.childNodes.push(P))}}return t.parentNode&&vm(t.parentNode)&&ym(t.parentNode)&&(F.isShadow=!0),F.type===Er.Element&&F.tagName==="iframe"&&sPe(t,()=>{const H=iW(t);if(H&&N){const te=Zd(H,{doc:H,mirror:r,blockClass:s,blockSelector:i,unblockSelector:a,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:p,unmaskTextSelector:h,skipChild:!1,inlineStylesheet:v,maskInputOptions:b,maskAttributeFn:x,maskTextFn:E,maskInputFn:S,slimDOMOptions:k,dataURLOptions:T,inlineImages:R,recordCanvas:j,preserveWhiteSpace:G,onSerialize:A,onIframeLoad:N,iframeLoadTimeout:M,onStylesheetLoad:I,stylesheetLoadTimeout:O,keepIframeSrcFn:L});te&&N(t,te)}},M),F.type===Er.Element&&F.tagName==="link"&&typeof F.attributes.rel=="string"&&(F.attributes.rel==="stylesheet"||F.attributes.rel==="preload"&&typeof F.attributes.href=="string"&&nW(F.attributes.href)==="css")&&iPe(t,()=>{if(I){const H=Zd(t,{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:a,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:p,unmaskTextSelector:h,skipChild:!1,inlineStylesheet:v,maskInputOptions:b,maskAttributeFn:x,maskTextFn:E,maskInputFn:S,slimDOMOptions:k,dataURLOptions:T,inlineImages:R,recordCanvas:j,preserveWhiteSpace:G,onSerialize:A,onIframeLoad:N,iframeLoadTimeout:M,onStylesheetLoad:I,stylesheetLoadTimeout:O,keepIframeSrcFn:L});H&&I(t,H)}},O),F}function dPe(t,e){const{mirror:n=new tW,blockClass:r="rr-block",blockSelector:s=null,unblockSelector:i=null,maskAllText:a=!1,maskTextClass:l="rr-mask",unmaskTextClass:u=null,maskTextSelector:d=null,unmaskTextSelector:p=null,inlineStylesheet:h=!0,inlineImages:g=!1,recordCanvas:v=!1,maskAllInputs:b=!1,maskAttributeFn:x,maskTextFn:E,maskInputFn:S,slimDOM:k=!1,dataURLOptions:T,preserveWhiteSpace:R,onSerialize:j,onIframeLoad:A,iframeLoadTimeout:N,onStylesheetLoad:M,stylesheetLoadTimeout:I,keepIframeSrcFn:O=()=>!1}=e||{};return Zd(t,{doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,maskAllText:a,maskTextClass:l,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:p,skipChild:!1,inlineStylesheet:h,maskInputOptions:b===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:b===!1?{}:b,maskAttributeFn:x,maskTextFn:E,maskInputFn:S,slimDOMOptions:k===!0||k==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:k==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:k===!1?{}:k,dataURLOptions:T,inlineImages:g,recordCanvas:v,preserveWhiteSpace:R,onSerialize:j,onIframeLoad:A,iframeLoadTimeout:N,onStylesheetLoad:M,stylesheetLoadTimeout:I,keepIframeSrcFn:O,newlyAddedElement:!1})}function jl(t){let e,n=t[0],r=1;for(;r<t.length;){const s=t[r],i=t[r+1];if(r+=2,(s==="optionalAccess"||s==="optionalCall")&&n==null)return;s==="access"||s==="optionalAccess"?(e=n,n=i(n)):(s==="call"||s==="optionalCall")&&(n=i((...a)=>n.call(e,...a)),e=void 0)}return n}function hs(t,e,n=document){const r={capture:!0,passive:!0};return n.addEventListener(t,e,r),()=>n.removeEventListener(t,e,r)}const Fd=`Please stop import mirror directly. Instead of that,\r
|
|
1871
1871
|
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
1872
|
-
or you can use record.mirror to access the mirror instance during recording.`;let rz={map:{},getId(){return console.error(Fd),-1},getNode(){return console.error(Fd),null},removeNodeFromMap(){console.error(Fd)},has(){return console.error(Fd),!1},reset(){console.error(Fd)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(rz=new Proxy(rz,{get(t,e,n){return e==="map"&&console.error(Fd),Reflect.get(t,e,n)}}));function sg(t,e,n={}){let r=null,s=0;return function(...i){const a=Date.now();!s&&n.leading===!1&&(s=a);const l=e-(a-s),u=this;l<=0||l>e?(r&&(yPe(r),r=null),s=a,t.apply(u,i)):!r&&n.trailing!==!1&&(r=s_(()=>{s=n.leading===!1?0:Date.now(),r=null,t.apply(u,i)},l))}}function lW(t,e,n,r,s=window){const i=s.Object.getOwnPropertyDescriptor(t,e);return s.Object.defineProperty(t,e,r?n:{set(a){s_(()=>{n.set.call(this,a)},0),i&&i.set&&i.set.call(this,a)}}),()=>lW(t,e,i||{},!0)}function Aj(t,e,n){try{if(!(e in t))return()=>{};const r=t[e],s=n(r);return typeof s=="function"&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:r}})),t[e]=s,()=>{t[e]=r}}catch{return()=>{}}}let Dx=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Dx=()=>new Date().getTime());function cW(t){const e=t.document;return{left:e.scrollingElement?e.scrollingElement.scrollLeft:t.pageXOffset!==void 0?t.pageXOffset:jl([e,"optionalAccess",n=>n.documentElement,"access",n=>n.scrollLeft])||jl([e,"optionalAccess",n=>n.body,"optionalAccess",n=>n.parentElement,"optionalAccess",n=>n.scrollLeft])||jl([e,"optionalAccess",n=>n.body,"optionalAccess",n=>n.scrollLeft])||0,top:e.scrollingElement?e.scrollingElement.scrollTop:t.pageYOffset!==void 0?t.pageYOffset:jl([e,"optionalAccess",n=>n.documentElement,"access",n=>n.scrollTop])||jl([e,"optionalAccess",n=>n.body,"optionalAccess",n=>n.parentElement,"optionalAccess",n=>n.scrollTop])||jl([e,"optionalAccess",n=>n.body,"optionalAccess",n=>n.scrollTop])||0}}function uW(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function dW(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function fW(t){return t?t.nodeType===t.ELEMENT_NODE?t:t.parentElement:null}function Js(t,e,n,r,s){if(!t)return!1;const i=fW(t);if(!i)return!1;const a=Jd(e,n);if(!s){const d=r&&i.matches(r);return a(i)&&!d}const l=Xc(i,a);let u=-1;return l<0?!1:(r&&(u=Xc(i,Jd(null,r))),l>-1&&u<0?!0:l<u)}function fPe(t,e){return e.getId(t)!==-1}function ek(t,e){return e.getId(t)===rg}function hW(t,e){if(vm(t))return!1;const n=e.getId(t);return e.has(n)?t.parentNode&&t.parentNode.nodeType===t.DOCUMENT_NODE?!1:t.parentNode?hW(t.parentNode,e):!0:!0}function eA(t){return!!t.changedTouches}function hPe(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let n=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function pW(t,e){return!!(t.nodeName==="IFRAME"&&e.getMeta(t))}function mW(t,e){return!!(t.nodeName==="LINK"&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&t.getAttribute("rel")==="stylesheet"&&e.getMeta(t))}function tA(t){return!!jl([t,"optionalAccess",e=>e.shadowRoot])}class pPe{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){return Jje(this.styleIDMap.get(e),()=>-1)}has(e){return this.styleIDMap.has(e)}add(e,n){if(this.has(e))return this.getId(e);let r;return n===void 0?r=this.id++:r=n,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function gW(t){let e=null;return jl([t,"access",n=>n.getRootNode,"optionalCall",n=>n(),"optionalAccess",n=>n.nodeType])===Node.DOCUMENT_FRAGMENT_NODE&&t.getRootNode().host&&(e=t.getRootNode().host),e}function mPe(t){let e=t,n;for(;n=gW(e);)e=n;return e}function gPe(t){const e=t.ownerDocument;if(!e)return!1;const n=mPe(t);return e.contains(n)}function vW(t){const e=t.ownerDocument;return e?e.contains(t)||gPe(t):!1}const sz={};function Nj(t){const e=sz[t];if(e)return e;const n=window.document;let r=window[t];if(n&&typeof n.createElement=="function")try{const s=n.createElement("iframe");s.hidden=!0,n.head.appendChild(s);const i=s.contentWindow;i&&i[t]&&(r=i[t]),n.head.removeChild(s)}catch{}return sz[t]=r.bind(window)}function vPe(...t){return Nj("requestAnimationFrame")(...t)}function s_(...t){return Nj("setTimeout")(...t)}function yPe(...t){return Nj("clearTimeout")(...t)}var Ft=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(Ft||{}),Tt=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(Tt||{}),ds=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(ds||{}),vo=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(vo||{}),iz;(function(t){t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment"})(iz||(iz={}));var az;(function(t){t[t.PLACEHOLDER=0]="PLACEHOLDER",t[t.ELEMENT_NODE=1]="ELEMENT_NODE",t[t.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",t[t.TEXT_NODE=3]="TEXT_NODE",t[t.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",t[t.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",t[t.ENTITY_NODE=6]="ENTITY_NODE",t[t.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",t[t.COMMENT_NODE=8]="COMMENT_NODE",t[t.DOCUMENT_NODE=9]="DOCUMENT_NODE",t[t.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",t[t.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE"})(az||(az={}));function Rj(t){try{return t.contentDocument}catch{}}function bPe(t){try{return t.contentWindow}catch{}}function xPe(t){let e,n=t[0],r=1;for(;r<t.length;){const s=t[r],i=t[r+1];if(r+=2,(s==="optionalAccess"||s==="optionalCall")&&n==null)return;s==="access"||s==="optionalAccess"?(e=n,n=i(n)):(s==="call"||s==="optionalCall")&&(n=i((...a)=>n.call(e,...a)),e=void 0)}return n}function oz(t){return"__ln"in t}class _Pe{constructor(){this.length=0,this.head=null,this.tail=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<e;r++)n=xPe([n,"optionalAccess",s=>s.next])||null;return n}addNode(e){const n={value:e,previous:null,next:null};if(e.__ln=n,e.previousSibling&&oz(e.previousSibling)){const r=e.previousSibling.__ln.next;n.next=r,n.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(e.nextSibling&&oz(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;n.previous=r,n.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;n.next===null&&(this.tail=n),this.length++}removeNode(e){const n=e.__ln;this.head&&(n.previous?(n.previous.next=n.next,n.next?n.next.previous=n.previous:this.tail=n.previous):(this.head=n.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const lz=(t,e)=>`${t}@${e}`;class wPe{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],n=new Set,r=new _Pe,s=u=>{let d=u,p=rg;for(;p===rg;)d=d&&d.nextSibling,p=d&&this.mirror.getId(d);return p},i=u=>{if(!u.parentNode||!vW(u))return;const d=vm(u.parentNode)?this.mirror.getId(gW(u)):this.mirror.getId(u.parentNode),p=s(u);if(d===-1||p===-1)return r.addNode(u);const h=Zd(u,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskAllText:this.maskAllText,unblockSelector:this.unblockSelector,maskTextClass:this.maskTextClass,unmaskTextClass:this.unmaskTextClass,maskTextSelector:this.maskTextSelector,unmaskTextSelector:this.unmaskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskAttributeFn:this.maskAttributeFn,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:g=>{pW(g,this.mirror)&&!Js(g,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(g),mW(g,this.mirror)&&this.stylesheetManager.trackLinkElement(g),tA(u)&&this.shadowDomManager.addShadowRoot(u.shadowRoot,this.doc)},onIframeLoad:(g,v)=>{Js(g,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(this.iframeManager.attachIframe(g,v),g.contentWindow&&this.canvasManager.addWindow(g.contentWindow),this.shadowDomManager.observeAttachShadow(g))},onStylesheetLoad:(g,v)=>{this.stylesheetManager.attachLinkElement(g,v)}});h&&(e.push({parentId:d,nextId:p,node:h}),n.add(h.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const u of this.movedSet)cz(this.removes,u,this.mirror)&&!this.movedSet.has(u.parentNode)||i(u);for(const u of this.addedSet)!uz(this.droppedSet,u)&&!cz(this.removes,u,this.mirror)||uz(this.movedSet,u)?i(u):this.droppedSet.add(u);let a=null;for(;r.length;){let u=null;if(a){const d=this.mirror.getId(a.value.parentNode),p=s(a.value);d!==-1&&p!==-1&&(u=a)}if(!u){let d=r.tail;for(;d;){const p=d;if(d=d.previous,p){const h=this.mirror.getId(p.value.parentNode);if(s(p.value)===-1)continue;if(h!==-1){u=p;break}else{const v=p.value;if(v.parentNode&&v.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const b=v.parentNode.host;if(this.mirror.getId(b)!==-1){u=p;break}}}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}a=u.previous,r.removeNode(u.value),i(u.value)}const l={texts:this.texts.map(u=>({id:this.mirror.getId(u.node),value:u.value})).filter(u=>!n.has(u.id)).filter(u=>this.mirror.has(u.id)),attributes:this.attributes.map(u=>{const{attributes:d}=u;if(typeof d.style=="string"){const p=JSON.stringify(u.styleDiff),h=JSON.stringify(u._unchangedStyles);p.length<d.style.length&&(p+h).split("var(").length===d.style.split("var(").length&&(d.style=u.styleDiff)}return{id:this.mirror.getId(u.node),attributes:d}}).filter(u=>!n.has(u.id)).filter(u=>this.mirror.has(u.id)),removes:this.removes,adds:e};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(l))},this.processMutation=e=>{if(!ek(e.target,this.mirror))switch(e.type){case"characterData":{const n=e.target.textContent;!Js(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&n!==e.oldValue&&this.texts.push({value:Bf(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&n?this.maskTextFn?this.maskTextFn(n,fW(e.target)):n.replace(/[\S]/g,"*"):n,node:e.target});break}case"attributes":{const n=e.target;let r=e.attributeName,s=e.target.getAttribute(r);if(r==="value"){const a=Tj(n),l=n.tagName;s=Px(n,l,a);const u=n_({maskInputOptions:this.maskInputOptions,tagName:l,type:a}),d=Bf(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,u);s=ng({isMasked:d,element:n,value:s,maskInputFn:this.maskInputFn})}if(Js(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||s===e.oldValue)return;let i=this.attributeMap.get(e.target);if(n.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(s))if(!Rj(n))r="rr_src";else return;if(i||(i={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(e.target,i)),r==="type"&&n.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&n.setAttribute("data-rr-is-password","true"),!oW(n.tagName,r)&&(i.attributes[r]=aW(this.doc,Uf(n.tagName),Uf(r),s,n,this.maskAttributeFn),r==="style")){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const a=this.unattachedDoc.createElement("span");e.oldValue&&a.setAttribute("style",e.oldValue);for(const l of Array.from(n.style)){const u=n.style.getPropertyValue(l),d=n.style.getPropertyPriority(l);u!==a.style.getPropertyValue(l)||d!==a.style.getPropertyPriority(l)?d===""?i.styleDiff[l]=u:i.styleDiff[l]=[u,d]:i._unchangedStyles[l]=[u,d]}for(const l of Array.from(a.style))n.style.getPropertyValue(l)===""&&(i.styleDiff[l]=!1)}break}case"childList":{if(Js(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;e.addedNodes.forEach(n=>this.genAdds(n,e.target)),e.removedNodes.forEach(n=>{const r=this.mirror.getId(n),s=vm(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);Js(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||ek(n,this.mirror)||!fPe(n,this.mirror)||(this.addedSet.has(n)?(nA(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(e.target)&&r===-1||hW(e.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[lz(r,s)]?nA(this.movedSet,n):this.removes.push({parentId:s,id:r,isShadow:vm(e.target)&&ym(e.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(e,n)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(ek(e,this.mirror))return;this.movedSet.add(e);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[lz(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Js(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(e.childNodes.forEach(r=>this.genAdds(r)),tA(e)&&e.shadowRoot.childNodes.forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}}}init(e){["mutationCb","blockClass","blockSelector","unblockSelector","maskAllText","maskTextClass","unmaskTextClass","maskTextSelector","unmaskTextSelector","inlineStylesheet","maskInputOptions","maskAttributeFn","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(n=>{this[n]=e[n]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function nA(t,e){t.delete(e),e.childNodes.forEach(n=>nA(t,n))}function cz(t,e,n){return t.length===0?!1:SPe(t,e,n)}function SPe(t,e,n){let r=e.parentNode;for(;r;){const s=n.getId(r);if(t.some(i=>i.id===s))return!0;r=r.parentNode}return!1}function uz(t,e){return t.size===0?!1:yW(t,e)}function yW(t,e){const{parentNode:n}=e;return n?t.has(n)?!0:yW(t,n):!1}let bm;function EPe(t){bm=t}function kPe(){bm=void 0}const Zt=t=>bm?(...n)=>{try{return t(...n)}catch(r){if(bm&&bm(r)===!0)return()=>{};throw r}}:t;function Qi(t){let e,n=t[0],r=1;for(;r<t.length;){const s=t[r],i=t[r+1];if(r+=2,(s==="optionalAccess"||s==="optionalCall")&&n==null)return;s==="access"||s==="optionalAccess"?(e=n,n=i(n)):(s==="call"||s==="optionalCall")&&(n=i((...a)=>n.call(e,...a)),e=void 0)}return n}const ef=[];function $g(t){try{if("composedPath"in t){const e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch{}return t&&t.target}function bW(t,e){const n=new wPe;ef.push(n),n.init(t);let r=window.MutationObserver||window.__rrMutationObserver;const s=Qi([window,"optionalAccess",a=>a.Zone,"optionalAccess",a=>a.__symbol__,"optionalCall",a=>a("MutationObserver")]);s&&window[s]&&(r=window[s]);const i=new r(Zt(a=>{t.onMutation&&t.onMutation(a)===!1||n.processMutations.bind(n)(a)}));return i.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function TPe({mousemoveCb:t,sampling:e,doc:n,mirror:r}){if(e.mousemove===!1)return()=>{};const s=typeof e.mousemove=="number"?e.mousemove:50,i=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500;let a=[],l;const u=sg(Zt(h=>{const g=Date.now()-l;t(a.map(v=>(v.timeOffset-=g,v)),h),a=[],l=null}),i),d=Zt(sg(Zt(h=>{const g=$g(h),{clientX:v,clientY:b}=eA(h)?h.changedTouches[0]:h;l||(l=Dx()),a.push({x:v,y:b,id:r.getId(g),timeOffset:Dx()-l}),u(typeof DragEvent<"u"&&h instanceof DragEvent?Tt.Drag:h instanceof MouseEvent?Tt.MouseMove:Tt.TouchMove)}),s,{trailing:!1})),p=[hs("mousemove",d,n),hs("touchmove",d,n),hs("drag",d,n)];return Zt(()=>{p.forEach(h=>h())})}function CPe({mouseInteractionCb:t,doc:e,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,sampling:a}){if(a.mouseInteraction===!1)return()=>{};const l=a.mouseInteraction===!0||a.mouseInteraction===void 0?{}:a.mouseInteraction,u=[];let d=null;const p=h=>g=>{const v=$g(g);if(Js(v,r,s,i,!0))return;let b=null,x=h;if("pointerType"in g){switch(g.pointerType){case"mouse":b=vo.Mouse;break;case"touch":b=vo.Touch;break;case"pen":b=vo.Pen;break}b===vo.Touch?ds[h]===ds.MouseDown?x="TouchStart":ds[h]===ds.MouseUp&&(x="TouchEnd"):vo.Pen}else eA(g)&&(b=vo.Touch);b!==null?(d=b,(x.startsWith("Touch")&&b===vo.Touch||x.startsWith("Mouse")&&b===vo.Mouse)&&(b=null)):ds[h]===ds.Click&&(b=d,d=null);const E=eA(g)?g.changedTouches[0]:g;if(!E)return;const S=n.getId(v),{clientX:k,clientY:T}=E;Zt(t)({type:ds[x],id:S,x:k,y:T,...b!==null&&{pointerType:b}})};return Object.keys(ds).filter(h=>Number.isNaN(Number(h))&&!h.endsWith("_Departed")&&l[h]!==!1).forEach(h=>{let g=Uf(h);const v=p(h);if(window.PointerEvent)switch(ds[h]){case ds.MouseDown:case ds.MouseUp:g=g.replace("mouse","pointer");break;case ds.TouchStart:case ds.TouchEnd:return}u.push(hs(g,v,e))}),Zt(()=>{u.forEach(h=>h())})}function xW({scrollCb:t,doc:e,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,sampling:a}){const l=Zt(sg(Zt(u=>{const d=$g(u);if(!d||Js(d,r,s,i,!0))return;const p=n.getId(d);if(d===e&&e.defaultView){const h=cW(e.defaultView);t({id:p,x:h.left,y:h.top})}else t({id:p,x:d.scrollLeft,y:d.scrollTop})}),a.scroll||100));return hs("scroll",l,e)}function APe({viewportResizeCb:t},{win:e}){let n=-1,r=-1;const s=Zt(sg(Zt(()=>{const i=uW(),a=dW();(n!==i||r!==a)&&(t({width:Number(a),height:Number(i)}),n=i,r=a)}),200));return hs("resize",s,e)}const NPe=["INPUT","TEXTAREA","SELECT"],dz=new WeakMap;function RPe({inputCb:t,doc:e,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,ignoreClass:a,ignoreSelector:l,maskInputOptions:u,maskInputFn:d,sampling:p,userTriggeredOnInput:h,maskTextClass:g,unmaskTextClass:v,maskTextSelector:b,unmaskTextSelector:x}){function E(N){let M=$g(N);const I=N.isTrusted,O=M&&JC(M.tagName);if(O==="OPTION"&&(M=M.parentElement),!M||!O||NPe.indexOf(O)<0||Js(M,r,s,i,!0))return;const L=M;if(L.classList.contains(a)||l&&L.matches(l))return;const z=Tj(M);let G=Px(L,O,z),W=!1;const X=n_({maskInputOptions:u,tagName:O,type:z}),F=Bf(M,g,b,v,x,X);(z==="radio"||z==="checkbox")&&(W=M.checked),G=ng({isMasked:F,element:M,value:G,maskInputFn:d}),S(M,h?{text:G,isChecked:W,userTriggered:I}:{text:G,isChecked:W});const Y=M.name;z==="radio"&&Y&&W&&e.querySelectorAll(`input[type="radio"][name="${Y}"]`).forEach(H=>{if(H!==M){const te=ng({isMasked:F,element:H,value:Px(H,O,z),maskInputFn:d});S(H,h?{text:te,isChecked:!W,userTriggered:!1}:{text:te,isChecked:!W})}})}function S(N,M){const I=dz.get(N);if(!I||I.text!==M.text||I.isChecked!==M.isChecked){dz.set(N,M);const O=n.getId(N);Zt(t)({...M,id:O})}}const T=(p.input==="last"?["change"]:["input","change"]).map(N=>hs(N,Zt(E),e)),R=e.defaultView;if(!R)return()=>{T.forEach(N=>N())};const j=R.Object.getOwnPropertyDescriptor(R.HTMLInputElement.prototype,"value"),A=[[R.HTMLInputElement.prototype,"value"],[R.HTMLInputElement.prototype,"checked"],[R.HTMLSelectElement.prototype,"value"],[R.HTMLTextAreaElement.prototype,"value"],[R.HTMLSelectElement.prototype,"selectedIndex"],[R.HTMLOptionElement.prototype,"selected"]];return j&&j.set&&T.push(...A.map(N=>lW(N[0],N[1],{set(){Zt(E)({target:this,isTrusted:!1})}},!1,R))),Zt(()=>{T.forEach(N=>N())})}function Lx(t){const e=[];function n(r,s){if(Fy("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Fy("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Fy("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Fy("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const a=Array.from(r.parentRule.cssRules).indexOf(r);s.unshift(a)}else if(r.parentStyleSheet){const a=Array.from(r.parentStyleSheet.cssRules).indexOf(r);s.unshift(a)}return s}return n(t,e)}function Ml(t,e,n){let r,s;return t?(t.ownerNode?r=e.getId(t.ownerNode):s=n.getId(t),{styleId:s,id:r}):{}}function jPe({styleSheetRuleCb:t,mirror:e,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const s=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:Zt((p,h,g)=>{const[v,b]=g,{id:x,styleId:E}=Ml(h,e,n.styleMirror);return(x&&x!==-1||E&&E!==-1)&&t({id:x,styleId:E,adds:[{rule:v,index:b}]}),p.apply(h,g)})});const i=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:Zt((p,h,g)=>{const[v]=g,{id:b,styleId:x}=Ml(h,e,n.styleMirror);return(b&&b!==-1||x&&x!==-1)&&t({id:b,styleId:x,removes:[{index:v}]}),p.apply(h,g)})});let a;r.CSSStyleSheet.prototype.replace&&(a=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Zt((p,h,g)=>{const[v]=g,{id:b,styleId:x}=Ml(h,e,n.styleMirror);return(b&&b!==-1||x&&x!==-1)&&t({id:b,styleId:x,replace:v}),p.apply(h,g)})}));let l;r.CSSStyleSheet.prototype.replaceSync&&(l=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Zt((p,h,g)=>{const[v]=g,{id:b,styleId:x}=Ml(h,e,n.styleMirror);return(b&&b!==-1||x&&x!==-1)&&t({id:b,styleId:x,replaceSync:v}),p.apply(h,g)})}));const u={};Uy("CSSGroupingRule")?u.CSSGroupingRule=r.CSSGroupingRule:(Uy("CSSMediaRule")&&(u.CSSMediaRule=r.CSSMediaRule),Uy("CSSConditionRule")&&(u.CSSConditionRule=r.CSSConditionRule),Uy("CSSSupportsRule")&&(u.CSSSupportsRule=r.CSSSupportsRule));const d={};return Object.entries(u).forEach(([p,h])=>{d[p]={insertRule:h.prototype.insertRule,deleteRule:h.prototype.deleteRule},h.prototype.insertRule=new Proxy(d[p].insertRule,{apply:Zt((g,v,b)=>{const[x,E]=b,{id:S,styleId:k}=Ml(v.parentStyleSheet,e,n.styleMirror);return(S&&S!==-1||k&&k!==-1)&&t({id:S,styleId:k,adds:[{rule:x,index:[...Lx(v),E||0]}]}),g.apply(v,b)})}),h.prototype.deleteRule=new Proxy(d[p].deleteRule,{apply:Zt((g,v,b)=>{const[x]=b,{id:E,styleId:S}=Ml(v.parentStyleSheet,e,n.styleMirror);return(E&&E!==-1||S&&S!==-1)&&t({id:E,styleId:S,removes:[{index:[...Lx(v),x]}]}),g.apply(v,b)})})}),Zt(()=>{r.CSSStyleSheet.prototype.insertRule=s,r.CSSStyleSheet.prototype.deleteRule=i,a&&(r.CSSStyleSheet.prototype.replace=a),l&&(r.CSSStyleSheet.prototype.replaceSync=l),Object.entries(u).forEach(([p,h])=>{h.prototype.insertRule=d[p].insertRule,h.prototype.deleteRule=d[p].deleteRule})})}function _W({mirror:t,stylesheetManager:e},n){let r=null;n.nodeName==="#document"?r=t.getId(n):r=t.getId(n.host);const s=n.nodeName==="#document"?Qi([n,"access",a=>a.defaultView,"optionalAccess",a=>a.Document]):Qi([n,"access",a=>a.ownerDocument,"optionalAccess",a=>a.defaultView,"optionalAccess",a=>a.ShadowRoot]),i=Qi([s,"optionalAccess",a=>a.prototype])?Object.getOwnPropertyDescriptor(Qi([s,"optionalAccess",a=>a.prototype]),"adoptedStyleSheets"):void 0;return r===null||r===-1||!s||!i?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get(){return Qi([i,"access",a=>a.get,"optionalAccess",a=>a.call,"call",a=>a(this)])},set(a){const l=Qi([i,"access",u=>u.set,"optionalAccess",u=>u.call,"call",u=>u(this,a)]);if(r!==null&&r!==-1)try{e.adoptStyleSheets(a,r)}catch{}return l}}),Zt(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get:i.get,set:i.set})}))}function MPe({styleDeclarationCb:t,mirror:e,ignoreCSSAttributes:n,stylesheetManager:r},{win:s}){const i=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:Zt((l,u,d)=>{const[p,h,g]=d;if(n.has(p))return i.apply(u,[p,h,g]);const{id:v,styleId:b}=Ml(Qi([u,"access",x=>x.parentRule,"optionalAccess",x=>x.parentStyleSheet]),e,r.styleMirror);return(v&&v!==-1||b&&b!==-1)&&t({id:v,styleId:b,set:{property:p,value:h,priority:g},index:Lx(u.parentRule)}),l.apply(u,d)})});const a=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:Zt((l,u,d)=>{const[p]=d;if(n.has(p))return a.apply(u,[p]);const{id:h,styleId:g}=Ml(Qi([u,"access",v=>v.parentRule,"optionalAccess",v=>v.parentStyleSheet]),e,r.styleMirror);return(h&&h!==-1||g&&g!==-1)&&t({id:h,styleId:g,remove:{property:p},index:Lx(u.parentRule)}),l.apply(u,d)})}),Zt(()=>{s.CSSStyleDeclaration.prototype.setProperty=i,s.CSSStyleDeclaration.prototype.removeProperty=a})}function OPe({mediaInteractionCb:t,blockClass:e,blockSelector:n,unblockSelector:r,mirror:s,sampling:i,doc:a}){const l=Zt(d=>sg(Zt(p=>{const h=$g(p);if(!h||Js(h,e,n,r,!0))return;const{currentTime:g,volume:v,muted:b,playbackRate:x}=h;t({type:d,id:s.getId(h),currentTime:g,volume:v,muted:b,playbackRate:x})}),i.media||500)),u=[hs("play",l(0),a),hs("pause",l(1),a),hs("seeked",l(2),a),hs("volumechange",l(3),a),hs("ratechange",l(4),a)];return Zt(()=>{u.forEach(d=>d())})}function PPe({fontCb:t,doc:e}){const n=e.defaultView;if(!n)return()=>{};const r=[],s=new WeakMap,i=n.FontFace;n.FontFace=function(u,d,p){const h=new i(u,d,p);return s.set(h,{family:u,buffer:typeof d!="string",descriptors:p,fontSource:typeof d=="string"?d:JSON.stringify(Array.from(new Uint8Array(d)))}),h};const a=Aj(e.fonts,"add",function(l){return function(u){return s_(Zt(()=>{const d=s.get(u);d&&(t(d),s.delete(u))}),0),l.apply(this,[u])}});return r.push(()=>{n.FontFace=i}),r.push(a),Zt(()=>{r.forEach(l=>l())})}function IPe(t){const{doc:e,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,selectionCb:a}=t;let l=!0;const u=Zt(()=>{const d=e.getSelection();if(!d||l&&Qi([d,"optionalAccess",g=>g.isCollapsed]))return;l=d.isCollapsed||!1;const p=[],h=d.rangeCount||0;for(let g=0;g<h;g++){const v=d.getRangeAt(g),{startContainer:b,startOffset:x,endContainer:E,endOffset:S}=v;Js(b,r,s,i,!0)||Js(E,r,s,i,!0)||p.push({start:n.getId(b),startOffset:x,end:n.getId(E),endOffset:S})}a({ranges:p})});return u(),hs("selectionchange",u)}function DPe({doc:t,customElementCb:e}){const n=t.defaultView;return!n||!n.customElements?()=>{}:Aj(n.customElements,"define",function(s){return function(i,a,l){try{e({define:{name:i}})}catch{}return s.apply(this,[i,a,l])}})}function LPe(t,e={}){const n=t.doc.defaultView;if(!n)return()=>{};let r;t.recordDOM&&(r=bW(t,t.doc));const s=TPe(t),i=CPe(t),a=xW(t),l=APe(t,{win:n}),u=RPe(t),d=OPe(t);let p=()=>{},h=()=>{},g=()=>{},v=()=>{};t.recordDOM&&(p=jPe(t,{win:n}),h=_W(t,t.doc),g=MPe(t,{win:n}),t.collectFonts&&(v=PPe(t)));const b=IPe(t),x=DPe(t),E=[];for(const S of t.plugins)E.push(S.observer(S.callback,n,S.options));return Zt(()=>{ef.forEach(S=>S.reset()),Qi([r,"optionalAccess",S=>S.disconnect,"call",S=>S()]),s(),i(),a(),l(),u(),d(),p(),h(),g(),v(),b(),x(),E.forEach(S=>S())})}function Fy(t){return typeof window[t]<"u"}function Uy(t){return!!(typeof window[t]<"u"&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class rA{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,n,r,s){const i=r||this.getIdToRemoteIdMap(e),a=s||this.getRemoteIdToIdMap(e);let l=i.get(n);return l||(l=this.generateIdFn(),i.set(n,l),a.set(l,n)),l}getIds(e,n){const r=this.getIdToRemoteIdMap(e),s=this.getRemoteIdToIdMap(e);return n.map(i=>this.getId(e,i,r,s))}getRemoteId(e,n,r){const s=r||this.getRemoteIdToIdMap(e);if(typeof n!="number")return n;const i=s.get(n);return i||-1}getRemoteIds(e,n){const r=this.getRemoteIdToIdMap(e);return n.map(s=>this.getRemoteId(e,s,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let n=this.iframeIdToRemoteIdMap.get(e);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(e,n)),n}getRemoteIdToIdMap(e){let n=this.iframeRemoteIdToIdMap.get(e);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(e,n)),n}}function fz(t){let e,n=t[0],r=1;for(;r<t.length;){const s=t[r],i=t[r+1];if(r+=2,(s==="optionalAccess"||s==="optionalCall")&&n==null)return;s==="access"||s==="optionalAccess"?(e=n,n=i(n)):(s==="call"||s==="optionalCall")&&(n=i((...a)=>n.call(e,...a)),e=void 0)}return n}class $Pe{constructor(){this.crossOriginIframeMirror=new rA(Cj),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}}class zPe{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new rA(Cj),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new rA(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,n){this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),fz([this,"access",s=>s.loadListener,"optionalCall",s=>s(e)]);const r=Rj(e);r&&r.adoptedStyleSheets&&r.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(r.adoptedStyleSheets,this.mirror.getId(r))}handleMessage(e){const n=e;if(n.data.type!=="rrweb"||n.origin!==n.data.origin||!e.source)return;const s=this.crossOriginIframeMap.get(e.source);if(!s)return;const i=this.transformCrossOriginEvent(s,n.data.event);i&&this.wrappedEmit(i,n.data.isCheckout)}transformCrossOriginEvent(e,n){switch(n.type){case Ft.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(n.data.node,e);const r=n.data.node.id;return this.crossOriginIframeRootIdMap.set(e,r),this.patchRootIdOnNode(n.data.node,r),{timestamp:n.timestamp,type:Ft.IncrementalSnapshot,data:{source:Tt.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Ft.Meta:case Ft.Load:case Ft.DomContentLoaded:return!1;case Ft.Plugin:return n;case Ft.Custom:return this.replaceIds(n.data.payload,e,["id","parentId","previousId","nextId"]),n;case Ft.IncrementalSnapshot:switch(n.data.source){case Tt.Mutation:return n.data.adds.forEach(r=>{this.replaceIds(r,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(r.node,e);const s=this.crossOriginIframeRootIdMap.get(e);s&&this.patchRootIdOnNode(r.node,s)}),n.data.removes.forEach(r=>{this.replaceIds(r,e,["parentId","id"])}),n.data.attributes.forEach(r=>{this.replaceIds(r,e,["id"])}),n.data.texts.forEach(r=>{this.replaceIds(r,e,["id"])}),n;case Tt.Drag:case Tt.TouchMove:case Tt.MouseMove:return n.data.positions.forEach(r=>{this.replaceIds(r,e,["id"])}),n;case Tt.ViewportResize:return!1;case Tt.MediaInteraction:case Tt.MouseInteraction:case Tt.Scroll:case Tt.CanvasMutation:case Tt.Input:return this.replaceIds(n.data,e,["id"]),n;case Tt.StyleSheetRule:case Tt.StyleDeclaration:return this.replaceIds(n.data,e,["id"]),this.replaceStyleIds(n.data,e,["styleId"]),n;case Tt.Font:return n;case Tt.Selection:return n.data.ranges.forEach(r=>{this.replaceIds(r,e,["start","end"])}),n;case Tt.AdoptedStyleSheet:return this.replaceIds(n.data,e,["id"]),this.replaceStyleIds(n.data,e,["styleIds"]),fz([n,"access",r=>r.data,"access",r=>r.styles,"optionalAccess",r=>r.forEach,"call",r=>r(s=>{this.replaceStyleIds(s,e,["styleId"])})]),n}}return!1}replace(e,n,r,s){for(const i of s)!Array.isArray(n[i])&&typeof n[i]!="number"||(Array.isArray(n[i])?n[i]=e.getIds(r,n[i]):n[i]=e.getId(r,n[i]));return n}replaceIds(e,n,r){return this.replace(this.crossOriginIframeMirror,e,n,r)}replaceStyleIds(e,n,r){return this.replace(this.crossOriginIframeStyleMirror,e,n,r)}replaceIdOnNode(e,n){this.replaceIds(e,n,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}patchRootIdOnNode(e,n){e.type!==Er.Document&&!e.rootId&&(e.rootId=n),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}}class FPe{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}}class UPe{constructor(e){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,n){if(!ym(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e),this.bypassOptions.canvasManager.addShadowRoot(e);const r=bW({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(xW({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),s_(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),this.restoreHandlers.push(_W({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){const n=Rj(e),r=bPe(e);!n||!r||this.patchAttachShadow(r.Element,n)}patchAttachShadow(e,n){const r=this;this.restoreHandlers.push(Aj(e.prototype,"attachShadow",function(s){return function(i){const a=s.call(this,i);return this.shadowRoot&&vW(this)&&r.addShadowRoot(this.shadowRoot,n),a}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet,this.bypassOptions.canvasManager.resetShadowRoots()}}class hz{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}}class BPe{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new pPe,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,n){if(e.length===0)return;const r={id:n,styleIds:[]},s=[];for(const i of e){let a;this.styleMirror.has(i)?a=this.styleMirror.getId(i):(a=this.styleMirror.add(i),s.push({styleId:a,rules:Array.from(i.rules||CSSRule,(l,u)=>({rule:eW(l),index:u}))})),r.styleIds.push(a)}s.length>0&&(r.styles=s),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class qPe{constructor(){this.nodeMap=new WeakMap,this.active=!1}inOtherBuffer(e,n){const r=this.nodeMap.get(e);return r&&Array.from(r).some(s=>s!==n)}add(e,n){this.active||(this.active=!0,vPe(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(n))}destroy(){}}let Yn,$x;try{if(Array.from([1],t=>t*2)[0]!==2){const t=document.createElement("iframe");document.body.appendChild(t),Array.from=fb([t,"access",e=>e.contentWindow,"optionalAccess",e=>e.Array,"access",e=>e.from])||Array.from,document.body.removeChild(t)}}catch(t){console.debug("Unable to override Array.from",t)}const Hi=BOe();function Ro(t={}){const{emit:e,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:s="rr-block",blockSelector:i=null,unblockSelector:a=null,ignoreClass:l="rr-ignore",ignoreSelector:u=null,maskAllText:d=!1,maskTextClass:p="rr-mask",unmaskTextClass:h=null,maskTextSelector:g=null,unmaskTextSelector:v=null,inlineStylesheet:b=!0,maskAllInputs:x,maskInputOptions:E,slimDOMOptions:S,maskAttributeFn:k,maskInputFn:T,maskTextFn:R,maxCanvasSize:j=null,packFn:A,sampling:N={},dataURLOptions:M={},mousemoveWait:I,recordDOM:O=!0,recordCanvas:L=!1,recordCrossOriginIframes:z=!1,recordAfter:G=t.recordAfter==="DOMContentLoaded"?t.recordAfter:"load",userTriggeredOnInput:W=!1,collectFonts:X=!1,inlineImages:F=!1,plugins:Y,keepIframeSrcFn:H=()=>!1,ignoreCSSAttributes:te=new Set([]),errorHandler:P,onMutation:re,getCanvasManager:ue}=t;EPe(P);const D=z?window.parent===window:!0;let Z=!1;if(!D)try{window.parent.document&&(Z=!1)}catch{Z=!0}if(D&&!e)throw new Error("emit function is required");if(!D&&!Z)return()=>{};I!==void 0&&N.mousemove===void 0&&(N.mousemove=I),Hi.reset();const he=x===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,radio:!0,checkbox:!0}:E!==void 0?E:{},V=S===!0||S==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:S==="all",headMetaDescKeywords:S==="all"}:S||{};hPe();let U,K=0;const ae=Be=>{for(const pt of Y||[])pt.eventProcessor&&(Be=pt.eventProcessor(Be));return A&&!Z&&(Be=A(Be)),Be};Yn=(Be,pt)=>{const De=Be;if(De.timestamp=Dx(),fb([ef,"access",et=>et[0],"optionalAccess",et=>et.isFrozen,"call",et=>et()])&&De.type!==Ft.FullSnapshot&&!(De.type===Ft.IncrementalSnapshot&&De.data.source===Tt.Mutation)&&ef.forEach(et=>et.unfreeze()),D)fb([e,"optionalCall",et=>et(ae(De),pt)]);else if(Z){const et={type:"rrweb",event:ae(De),origin:window.location.origin,isCheckout:pt};window.parent.postMessage(et,"*")}if(De.type===Ft.FullSnapshot)U=De,K=0;else if(De.type===Ft.IncrementalSnapshot){if(De.data.source===Tt.Mutation&&De.data.isAttachIframe)return;K++;const et=r&&K>=r,ot=n&&U&&De.timestamp-U.timestamp>n;(et||ot)&&dt(!0)}};const B=Be=>{Yn({type:Ft.IncrementalSnapshot,data:{source:Tt.Mutation,...Be}})},J=Be=>Yn({type:Ft.IncrementalSnapshot,data:{source:Tt.Scroll,...Be}}),oe=Be=>Yn({type:Ft.IncrementalSnapshot,data:{source:Tt.CanvasMutation,...Be}}),fe=Be=>Yn({type:Ft.IncrementalSnapshot,data:{source:Tt.AdoptedStyleSheet,...Be}}),be=new BPe({mutationCb:B,adoptedStyleSheetCb:fe}),Ae=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new $Pe:new zPe({mirror:Hi,mutationCb:B,stylesheetManager:be,recordCrossOriginIframes:z,wrappedEmit:Yn});for(const Be of Y||[])Be.getMirror&&Be.getMirror({nodeMirror:Hi,crossOriginIframeMirror:Ae.crossOriginIframeMirror,crossOriginIframeStyleMirror:Ae.crossOriginIframeStyleMirror});const Oe=new qPe,Ne=HPe(ue,{mirror:Hi,win:window,mutationCb:Be=>Yn({type:Ft.IncrementalSnapshot,data:{source:Tt.CanvasMutation,...Be}}),recordCanvas:L,blockClass:s,blockSelector:i,unblockSelector:a,maxCanvasSize:j,sampling:N.canvas,dataURLOptions:M,errorHandler:P}),Qe=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new FPe:new UPe({mutationCb:B,scrollCb:J,bypassOptions:{onMutation:re,blockClass:s,blockSelector:i,unblockSelector:a,maskAllText:d,maskTextClass:p,unmaskTextClass:h,maskTextSelector:g,unmaskTextSelector:v,inlineStylesheet:b,maskInputOptions:he,dataURLOptions:M,maskAttributeFn:k,maskTextFn:R,maskInputFn:T,recordCanvas:L,inlineImages:F,sampling:N,slimDOMOptions:V,iframeManager:Ae,stylesheetManager:be,canvasManager:Ne,keepIframeSrcFn:H,processedNodeManager:Oe},mirror:Hi}),dt=(Be=!1)=>{if(!O)return;Yn({type:Ft.Meta,data:{href:window.location.href,width:dW(),height:uW()}},Be),be.reset(),Qe.init(),ef.forEach(De=>De.lock());const pt=dPe(document,{mirror:Hi,blockClass:s,blockSelector:i,unblockSelector:a,maskAllText:d,maskTextClass:p,unmaskTextClass:h,maskTextSelector:g,unmaskTextSelector:v,inlineStylesheet:b,maskAllInputs:he,maskAttributeFn:k,maskInputFn:T,maskTextFn:R,slimDOM:V,dataURLOptions:M,recordCanvas:L,inlineImages:F,onSerialize:De=>{pW(De,Hi)&&Ae.addIframe(De),mW(De,Hi)&&be.trackLinkElement(De),tA(De)&&Qe.addShadowRoot(De.shadowRoot,document)},onIframeLoad:(De,et)=>{Ae.attachIframe(De,et),De.contentWindow&&Ne.addWindow(De.contentWindow),Qe.observeAttachShadow(De)},onStylesheetLoad:(De,et)=>{be.attachLinkElement(De,et)},keepIframeSrcFn:H});if(!pt)return console.warn("Failed to snapshot the document");Yn({type:Ft.FullSnapshot,data:{node:pt,initialOffset:cW(window)}}),ef.forEach(De=>De.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&be.adoptStyleSheets(document.adoptedStyleSheets,Hi.getId(document))};$x=dt;try{const Be=[],pt=et=>Zt(LPe)({onMutation:re,mutationCb:B,mousemoveCb:(ot,lr)=>Yn({type:Ft.IncrementalSnapshot,data:{source:lr,positions:ot}}),mouseInteractionCb:ot=>Yn({type:Ft.IncrementalSnapshot,data:{source:Tt.MouseInteraction,...ot}}),scrollCb:J,viewportResizeCb:ot=>Yn({type:Ft.IncrementalSnapshot,data:{source:Tt.ViewportResize,...ot}}),inputCb:ot=>Yn({type:Ft.IncrementalSnapshot,data:{source:Tt.Input,...ot}}),mediaInteractionCb:ot=>Yn({type:Ft.IncrementalSnapshot,data:{source:Tt.MediaInteraction,...ot}}),styleSheetRuleCb:ot=>Yn({type:Ft.IncrementalSnapshot,data:{source:Tt.StyleSheetRule,...ot}}),styleDeclarationCb:ot=>Yn({type:Ft.IncrementalSnapshot,data:{source:Tt.StyleDeclaration,...ot}}),canvasMutationCb:oe,fontCb:ot=>Yn({type:Ft.IncrementalSnapshot,data:{source:Tt.Font,...ot}}),selectionCb:ot=>{Yn({type:Ft.IncrementalSnapshot,data:{source:Tt.Selection,...ot}})},customElementCb:ot=>{Yn({type:Ft.IncrementalSnapshot,data:{source:Tt.CustomElement,...ot}})},blockClass:s,ignoreClass:l,ignoreSelector:u,maskAllText:d,maskTextClass:p,unmaskTextClass:h,maskTextSelector:g,unmaskTextSelector:v,maskInputOptions:he,inlineStylesheet:b,sampling:N,recordDOM:O,recordCanvas:L,inlineImages:F,userTriggeredOnInput:W,collectFonts:X,doc:et,maskAttributeFn:k,maskInputFn:T,maskTextFn:R,keepIframeSrcFn:H,blockSelector:i,unblockSelector:a,slimDOMOptions:V,dataURLOptions:M,mirror:Hi,iframeManager:Ae,stylesheetManager:be,shadowDomManager:Qe,processedNodeManager:Oe,canvasManager:Ne,ignoreCSSAttributes:te,plugins:fb([Y,"optionalAccess",ot=>ot.filter,"call",ot=>ot(lr=>lr.observer),"optionalAccess",ot=>ot.map,"call",ot=>ot(lr=>({observer:lr.observer,options:lr.options,callback:xe=>Yn({type:Ft.Plugin,data:{plugin:lr.name,payload:xe}})}))])||[]},{});Ae.addLoadListener(et=>{try{Be.push(pt(et.contentDocument))}catch(ot){console.warn(ot)}});const De=()=>{dt(),Be.push(pt(document))};return document.readyState==="interactive"||document.readyState==="complete"?De():(Be.push(hs("DOMContentLoaded",()=>{Yn({type:Ft.DomContentLoaded,data:{}}),G==="DOMContentLoaded"&&De()})),Be.push(hs("load",()=>{Yn({type:Ft.Load,data:{}}),G==="load"&&De()},window))),()=>{Be.forEach(et=>et()),Oe.destroy(),$x=void 0,kPe()}}catch(Be){console.warn(Be)}}function VPe(t){if(!$x)throw new Error("please take full snapshot after start recording");$x(t)}Ro.mirror=Hi;Ro.takeFullSnapshot=VPe;function HPe(t,e){try{return t?t(e):new hz}catch{return console.warn("Unable to initialize CanvasManager"),new hz}}const GPe=3,WPe=5;function jj(t){return t>9999999999?t:t*1e3}function tk(t){return t>9999999999?t/1e3:t}function zg(t,e){e.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(e.category)?t.triggerUserActivity():t.checkAndHandleExpiredSession(),t.addUpdate(()=>(t.throttledAddEvent({type:Ft.Custom,timestamp:(e.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:Ki(e,10,1e3)}}),e.category==="console")))}const YPe="button,a";function wW(t){return t.closest(YPe)||t}function SW(t){const e=EW(t);return!e||!(e instanceof Element)?e:wW(e)}function EW(t){return KPe(t)?t.target:t}function KPe(t){return typeof t=="object"&&!!t&&"target"in t}let Ol;function XPe(t){return Ol||(Ol=[],QPe()),Ol.push(t),()=>{const e=Ol?Ol.indexOf(t):-1;e>-1&&Ol.splice(e,1)}}function QPe(){Is(kn,"open",function(t){return function(...e){if(Ol)try{Ol.forEach(n=>n())}catch{}return t.apply(kn,e)}})}const JPe=new Set([Tt.Mutation,Tt.StyleSheetRule,Tt.StyleDeclaration,Tt.AdoptedStyleSheet,Tt.CanvasMutation,Tt.Selection,Tt.MediaInteraction]);function ZPe(t,e,n){t.handleClick(e,n)}class eIe{constructor(e,n,r=zg){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=n.timeout/1e3,this._threshold=n.threshold/1e3,this._scrollTimeout=n.scrollTimeout/1e3,this._replay=e,this._ignoreSelector=n.ignoreSelector,this._addBreadcrumbEvent=r}addListeners(){const e=XPe(()=>{this._lastMutation=pz()});this._teardown=()=>{e(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(e,n){if(nIe(n,this._ignoreSelector)||!rIe(e))return;const r={timestamp:tk(e.timestamp),clickBreadcrumb:e,clickCount:0,node:n};this._clicks.some(s=>s.node===r.node&&Math.abs(s.timestamp-r.timestamp)<1)||(this._clicks.push(r),this._clicks.length===1&&this._scheduleCheckClicks())}registerMutation(e=Date.now()){this._lastMutation=tk(e)}registerScroll(e=Date.now()){this._lastScroll=tk(e)}registerClick(e){const n=wW(e);this._handleMultiClick(n)}_handleMultiClick(e){this._getClicks(e).forEach(n=>{n.clickCount++})}_getClicks(e){return this._clicks.filter(n=>n.node===e)}_checkClicks(){const e=[],n=pz();this._clicks.forEach(r=>{!r.mutationAfter&&this._lastMutation&&(r.mutationAfter=r.timestamp<=this._lastMutation?this._lastMutation-r.timestamp:void 0),!r.scrollAfter&&this._lastScroll&&(r.scrollAfter=r.timestamp<=this._lastScroll?this._lastScroll-r.timestamp:void 0),r.timestamp+this._timeout<=n&&e.push(r)});for(const r of e){const s=this._clicks.indexOf(r);s>-1&&(this._generateBreadcrumbs(r),this._clicks.splice(s,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(e){const n=this._replay,r=e.scrollAfter&&e.scrollAfter<=this._scrollTimeout,s=e.mutationAfter&&e.mutationAfter<=this._threshold,i=!r&&!s,{clickCount:a,clickBreadcrumb:l}=e;if(i){const u=Math.min(e.mutationAfter||this._timeout,this._timeout)*1e3,d=u<this._timeout*1e3?"mutation":"timeout",p={type:"default",message:l.message,timestamp:l.timestamp,category:"ui.slowClickDetected",data:{...l.data,url:kn.location.href,route:n.getCurrentRoute(),timeAfterClickMs:u,endReason:d,clickCount:a||1}};this._addBreadcrumbEvent(n,p);return}if(a>1){const u={type:"default",message:l.message,timestamp:l.timestamp,category:"ui.multiClick",data:{...l.data,url:kn.location.href,route:n.getCurrentRoute(),clickCount:a,metric:!0}};this._addBreadcrumbEvent(n,u)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=Ff(()=>this._checkClicks(),1e3)}}const tIe=["A","BUTTON","INPUT"];function nIe(t,e){return!!(!tIe.includes(t.tagName)||t.tagName==="INPUT"&&!["submit","button"].includes(t.getAttribute("type")||"")||t.tagName==="A"&&(t.hasAttribute("download")||t.hasAttribute("target")&&t.getAttribute("target")!=="_self")||e&&t.matches(e))}function rIe(t){return!!(t.data&&typeof t.data.nodeId=="number"&&t.timestamp)}function pz(){return Date.now()/1e3}function sIe(t,e){try{if(!iIe(e))return;const{source:n}=e.data;if(JPe.has(n)&&t.registerMutation(e.timestamp),n===Tt.Scroll&&t.registerScroll(e.timestamp),aIe(e)){const{type:r,id:s}=e.data,i=Ro.mirror.getNode(s);i instanceof HTMLElement&&r===ds.Click&&t.registerClick(i)}}catch{}}function iIe(t){return t.type===GPe}function aIe(t){return t.data.source===Tt.MouseInteraction}function Ra(t){return{timestamp:Date.now()/1e3,type:"default",...t}}var zx;(function(t){t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment"})(zx||(zx={}));const oIe=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function lIe(t){const e={};!t["data-sentry-component"]&&t["data-sentry-element"]&&(t["data-sentry-component"]=t["data-sentry-element"]);for(const n in t)if(oIe.has(n)){let r=n;(n==="data-testid"||n==="data-test-id")&&(r="testId"),e[r]=t[n]}return e}const cIe=t=>e=>{if(!t.isEnabled())return;const n=uIe(e);if(!n)return;const r=e.name==="click",s=r?e.event:void 0;r&&t.clickDetector&&s&&s.target&&!s.altKey&&!s.metaKey&&!s.ctrlKey&&!s.shiftKey&&ZPe(t.clickDetector,n,SW(e.event)),zg(t,n)};function kW(t,e){const n=Ro.mirror.getId(t),r=n&&Ro.mirror.getNode(n),s=r&&Ro.mirror.getMeta(r),i=s&&fIe(s)?s:null;return{message:e,data:i?{nodeId:n,node:{id:n,tagName:i.tagName,textContent:Array.from(i.childNodes).map(a=>a.type===zx.Text&&a.textContent).filter(Boolean).map(a=>a.trim()).join(""),attributes:lIe(i.attributes)}}:{}}}function uIe(t){const{target:e,message:n}=dIe(t);return Ra({category:`ui.${t.name}`,...kW(e,n)})}function dIe(t){const e=t.name==="click";let n,r=null;try{r=e?SW(t.event):EW(t.event),n=Uo(r,{maxStringLength:200})||"<unknown>"}catch{n="<unknown>"}return{target:r,message:n}}function fIe(t){return t.type===zx.Element}function hIe(t,e){if(!t.isEnabled())return;t.updateUserActivity();const n=pIe(e);n&&zg(t,n)}function pIe(t){const{metaKey:e,shiftKey:n,ctrlKey:r,altKey:s,key:i,target:a}=t;if(!a||mIe(a)||!i)return null;const l=e||r||s,u=i.length===1;if(!l&&u)return null;const d=Uo(a,{maxStringLength:200})||"<unknown>",p=kW(a,d);return Ra({category:"ui.keyDown",message:d,data:{...p.data,metaKey:e,shiftKey:n,ctrlKey:r,altKey:s,key:i}})}function mIe(t){return t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable}const gIe={resource:_Ie,paint:bIe,navigation:xIe};function By(t,e){return({metric:n})=>void e.replayPerformanceEntries.push(t(n))}function vIe(t){return t.map(yIe).filter(Boolean)}function yIe(t){const e=gIe[t.entryType];return e?e(t):null}function qf(t){return((vs||kn.performance.timeOrigin)+t)/1e3}function bIe(t){const{duration:e,entryType:n,name:r,startTime:s}=t,i=qf(s);return{type:n,name:r,start:i,end:i+e,data:void 0}}function xIe(t){const{entryType:e,name:n,decodedBodySize:r,duration:s,domComplete:i,encodedBodySize:a,domContentLoadedEventStart:l,domContentLoadedEventEnd:u,domInteractive:d,loadEventStart:p,loadEventEnd:h,redirectCount:g,startTime:v,transferSize:b,type:x}=t;return s===0?null:{type:`${e}.${x}`,start:qf(v),end:qf(i),name:n,data:{size:b,decodedBodySize:r,encodedBodySize:a,duration:s,domInteractive:d,domContentLoadedEventStart:l,domContentLoadedEventEnd:u,loadEventStart:p,loadEventEnd:h,domComplete:i,redirectCount:g}}}function _Ie(t){const{entryType:e,initiatorType:n,name:r,responseEnd:s,startTime:i,decodedBodySize:a,encodedBodySize:l,responseStatus:u,transferSize:d}=t;return["fetch","xmlhttprequest"].includes(n)?null:{type:`${e}.${n}`,start:qf(i),end:qf(s),name:r,data:{size:d,statusCode:u,decodedBodySize:a,encodedBodySize:l}}}function wIe(t){const e=t.entries[t.entries.length-1],n=e&&e.element?[e.element]:void 0;return i_(t,"largest-contentful-paint",n)}function SIe(t){return t.sources!==void 0}function EIe(t){const e=[],n=[];for(const r of t.entries)if(SIe(r)){const s=[];for(const i of r.sources)if(i.node){n.push(i.node);const a=Ro.mirror.getId(i.node);a&&s.push(a)}e.push({value:r.value,nodeIds:s.length?s:void 0})}return i_(t,"cumulative-layout-shift",n,e)}function kIe(t){const e=t.entries[t.entries.length-1],n=e&&e.target?[e.target]:void 0;return i_(t,"first-input-delay",n)}function TIe(t){const e=t.entries[t.entries.length-1],n=e&&e.target?[e.target]:void 0;return i_(t,"interaction-to-next-paint",n)}function i_(t,e,n,r){const s=t.value,i=t.rating,a=qf(s);return{type:"web-vital",name:e,start:a,end:a,data:{value:s,size:s,rating:i,nodeIds:n?n.map(l=>Ro.mirror.getId(l)):void 0,attributions:r}}}function CIe(t){function e(s){t.performanceEntries.includes(s)||t.performanceEntries.push(s)}function n({entries:s}){s.forEach(e)}const r=[];return["navigation","paint","resource"].forEach(s=>{r.push(zf(s,n))}),r.push(BG(By(wIe,t)),_j(By(EIe,t)),qG(By(kIe,t)),VG(By(TIe,t))),()=>{r.forEach(s=>s())}}const yt=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,AIe='var t=Uint8Array,n=Uint16Array,r=Int32Array,e=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),a=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=function(t,e){for(var i=new n(31),a=0;a<31;++a)i[a]=e+=1<<t[a-1];var s=new r(i[30]);for(a=1;a<30;++a)for(var o=i[a];o<i[a+1];++o)s[o]=o-i[a]<<5|a;return{b:i,r:s}},o=s(e,2),f=o.b,h=o.r;f[28]=258,h[258]=28;for(var l=s(i,0).r,u=new n(32768),c=0;c<32768;++c){var v=(43690&c)>>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,u[c]=((65280&v)>>8|(255&v)<<8)>>1}var d=function(t,r,e){for(var i=t.length,a=0,s=new n(r);a<i;++a)t[a]&&++s[t[a]-1];var o,f=new n(r);for(a=1;a<r;++a)f[a]=f[a-1]+s[a-1]<<1;if(e){o=new n(1<<r);var h=15-r;for(a=0;a<i;++a)if(t[a])for(var l=a<<4|t[a],c=r-t[a],v=f[t[a]-1]++<<c,d=v|(1<<c)-1;v<=d;++v)o[u[v]>>h]=l}else for(o=new n(i),a=0;a<i;++a)t[a]&&(o[a]=u[f[t[a]-1]++]>>15-t[a]);return o},g=new t(288);for(c=0;c<144;++c)g[c]=8;for(c=144;c<256;++c)g[c]=9;for(c=256;c<280;++c)g[c]=7;for(c=280;c<288;++c)g[c]=8;var w=new t(32);for(c=0;c<32;++c)w[c]=5;var p=d(g,9,0),y=d(w,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(null==e||e>n.length)&&(e=n.length),new t(n.subarray(r,e))},M=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],E=function(t,n,r){var e=new Error(n||M[t]);if(e.code=t,Error.captureStackTrace&&Error.captureStackTrace(e,E),!r)throw e;return e},z=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8},_=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8,t[e+2]|=r>>16},x=function(r,e){for(var i=[],a=0;a<r.length;++a)r[a]&&i.push({s:a,f:r[a]});var s=i.length,o=i.slice();if(!s)return{t:F,l:0};if(1==s){var f=new t(i[0].s+1);return f[i[0].s]=1,{t:f,l:1}}i.sort((function(t,n){return t.f-n.f})),i.push({s:-1,f:25001});var h=i[0],l=i[1],u=0,c=1,v=2;for(i[0]={s:-1,f:h.f+l.f,l:h,r:l};c!=s-1;)h=i[i[u].f<i[v].f?u++:v++],l=i[u!=c&&i[u].f<i[v].f?u++:v++],i[c++]={s:-1,f:h.f+l.f,l:h,r:l};var d=o[0].s;for(a=1;a<s;++a)o[a].s>d&&(d=o[a].s);var g=new n(d+1),w=A(i[c-1],g,0);if(w>e){a=0;var p=0,y=w-e,m=1<<y;for(o.sort((function(t,n){return g[n.s]-g[t.s]||t.f-n.f}));a<s;++a){var b=o[a].s;if(!(g[b]>e))break;p+=m-(1<<w-g[b]),g[b]=e}for(p>>=y;p>0;){var M=o[a].s;g[M]<e?p-=1<<e-g[M]++-1:++a}for(;a>=0&&p;--a){var E=o[a].s;g[E]==e&&(--g[E],++p)}w=e}return{t:new t(g),l:w}},A=function(t,n,r){return-1==t.s?Math.max(A(t.l,n,r+1),A(t.r,n,r+1)):n[t.s]=r},D=function(t){for(var r=t.length;r&&!t[--r];);for(var e=new n(++r),i=0,a=t[0],s=1,o=function(t){e[i++]=t},f=1;f<=r;++f)if(t[f]==a&&f!=r)++s;else{if(!a&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(a),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(a);s=1,a=t[f]}return{c:e.subarray(0,i),n:r}},T=function(t,n){for(var r=0,e=0;e<n.length;++e)r+=t[e]*n[e];return r},k=function(t,n,r){var e=r.length,i=m(n+2);t[i]=255&e,t[i+1]=e>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var a=0;a<e;++a)t[i+a+4]=r[a];return 8*(i+4+e)},U=function(t,r,s,o,f,h,l,u,c,v,m){z(r,m++,s),++f[256];for(var b=x(f,15),M=b.t,E=b.l,A=x(h,15),U=A.t,C=A.l,F=D(M),I=F.c,S=F.n,L=D(U),O=L.c,j=L.n,q=new n(19),B=0;B<I.length;++B)++q[31&I[B]];for(B=0;B<O.length;++B)++q[31&O[B]];for(var G=x(q,7),H=G.t,J=G.l,K=19;K>4&&!H[a[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(f,g)+T(h,w)+l,X=T(f,M)+T(h,U)+l+14+3*K+T(q,H)+2*q[16]+3*q[17]+7*q[18];if(c>=0&&V<=W&&V<=X)return k(r,m,t.subarray(c,c+v));if(z(r,m,1+(X<W)),m+=2,X<W){N=d(M,E,0),P=M,Q=d(U,C,0),R=U;var Y=d(H,J,0);z(r,m,S-257),z(r,m+5,j-1),z(r,m+10,K-4),m+=14;for(B=0;B<K;++B)z(r,m+3*B,H[a[B]]);m+=3*K;for(var Z=[I,O],$=0;$<2;++$){var tt=Z[$];for(B=0;B<tt.length;++B){var nt=31&tt[B];z(r,m,Y[nt]),m+=H[nt],nt>15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=p,P=g,Q=y,R=w;for(B=0;B<u;++B){var rt=o[B];if(rt>255){_(r,m,N[(nt=rt>>18&31)+257]),m+=P[nt+257],nt>7&&(z(r,m,rt>>23&31),m+=e[nt]);var et=31&rt;_(r,m,Q[et]),m+=R[et],et>3&&(_(r,m,rt>>5&8191),m+=i[et])}else _(r,m,N[rt]),m+=P[rt]}return _(r,m,N[256]),m+P[256]},C=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F=new t(0),I=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var r=n,e=9;--e;)r=(1&r&&-306674912)^r>>>1;t[n]=r}return t}(),S=function(){var t=-1;return{p:function(n){for(var r=t,e=0;e<n.length;++e)r=I[255&r^n[e]]^r>>>8;t=r},d:function(){return~t}}},L=function(){var t=1,n=0;return{p:function(r){for(var e=t,i=n,a=0|r.length,s=0;s!=a;){for(var o=Math.min(s+2655,a);s<o;++s)i+=e+=r[s];e=(65535&e)+15*(e>>16),i=(65535&i)+15*(i>>16)}t=e,n=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},O=function(a,s,o,f,u){if(!u&&(u={l:1},s.dictionary)){var c=s.dictionary.subarray(-32768),v=new t(c.length+a.length);v.set(c),v.set(a,c.length),a=v,u.w=c.length}return function(a,s,o,f,u,c){var v=c.z||a.length,d=new t(f+v+5*(1+Math.ceil(v/7e3))+u),g=d.subarray(f,d.length-u),w=c.l,p=7&(c.r||0);if(s){p&&(g[0]=c.r>>3);for(var y=C[s-1],M=y>>13,E=8191&y,z=(1<<o)-1,_=c.p||new n(32768),x=c.h||new n(z+1),A=Math.ceil(o/3),D=2*A,T=function(t){return(a[t]^a[t+1]<<A^a[t+2]<<D)&z},F=new r(25e3),I=new n(288),S=new n(32),L=0,O=0,j=c.i||0,q=0,B=c.w||0,G=0;j+2<v;++j){var H=T(j),J=32767&j,K=x[H];if(_[J]=K,x[H]=J,B<=j){var N=v-j;if((L>7e3||q>24576)&&(N>423||!w)){p=U(a,g,0,F,I,S,O,q,G,j-G,p),q=L=O=0,G=j;for(var P=0;P<286;++P)I[P]=0;for(P=0;P<30;++P)S[P]=0}var Q=2,R=0,V=E,W=J-K&32767;if(N>2&&H==T(j-W))for(var X=Math.min(M,N)-1,Y=Math.min(32767,j),Z=Math.min(258,N);W<=Y&&--V&&J!=K;){if(a[j+Q]==a[j+Q-W]){for(var $=0;$<Z&&a[j+$]==a[j+$-W];++$);if($>Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;P<tt;++P){var rt=j-W+P&32767,et=rt-_[rt]&32767;et>nt&&(nt=et,K=rt)}}}W+=(J=K)-(K=_[J])&32767}if(R){F[q++]=268435456|h[Q]<<18|l[R];var it=31&h[Q],at=31&l[R];O+=e[it]+i[at],++I[257+it],++S[at],B=j+Q,++L}else F[q++]=a[j],++I[a[j]]}}for(j=Math.max(j,B);j<v;++j)F[q++]=a[j],++I[a[j]];p=U(a,g,w,F,I,S,O,q,G,j-G,p),w||(c.r=7&p|g[p/8|0]<<3,p-=7,c.h=x,c.p=_,c.i=j,c.w=B)}else{for(j=c.w||0;j<v+w;j+=65535){var st=j+65535;st>=v&&(g[p/8|0]=w,st=v),p=k(g,p+1,a.subarray(j,st))}c.i=v}return b(d,0,f+m(p)+u)}(a,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(a.length)))):12+s.mem,o,f,u)},j=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8},q=function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&j(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var e=0;e<=r.length;++e)t[e+10]=r.charCodeAt(e)}},B=function(t){return 10+(t.filename?t.filename.length+1:0)},G=function(){function n(n,r){if("function"==typeof n&&(r=n,n={}),this.ondata=r,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return n.prototype.p=function(t,n){this.ondata(O(t,this.o,0,0,this.s),n)},n.prototype.push=function(n,r){this.ondata||E(5),this.s.l&&E(4);var e=n.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new t(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i}var a=this.b.length-this.s.z;a&&(this.b.set(n.subarray(0,a),this.s.z),this.s.z=this.b.length,this.p(this.b,!1)),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(a),32768),this.s.z=n.length-a+32768,this.s.i=32766,this.s.w=32768}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2)},n}();var H=function(){function t(t,n){this.c=L(),this.v=1,G.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),G.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var r=O(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(function(t,n){var r=n.level,e=0==r?0:r<6?1:9==r?3:2;if(t[0]=120,t[1]=e<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var i=L();i.p(n.dictionary),j(t,2,i.d())}}(r,this.o),this.v=0),n&&j(r,r.length-4,this.c.d()),this.ondata(r,n)},t}(),J="undefined"!=typeof TextEncoder&&new TextEncoder,K="undefined"!=typeof TextDecoder&&new TextDecoder;try{K.decode(F,{stream:!0})}catch(t){}var N=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(P(t),this.d=n||!1)},t}();function P(n,r){if(J)return J.encode(n);for(var e=n.length,i=new t(n.length+(n.length>>1)),a=0,s=function(t){i[a++]=t},o=0;o<e;++o){if(a+5>i.length){var f=new t(a+8+(e-o<<1));f.set(i),i=f}var h=n.charCodeAt(o);h<128||r?s(h):h<2048?(s(192|h>>6),s(128|63&h)):h>55295&&h<57344?(s(240|(h=65536+(1047552&h)|1023&n.charCodeAt(++o))>>18),s(128|h>>12&63),s(128|h>>6&63),s(128|63&h)):(s(224|h>>12),s(128|h>>6&63),s(128|63&h))}return b(i,0,a)}function Q(t){return function(t,n){n||(n={});var r=S(),e=t.length;r.p(t);var i=O(t,n,B(n),8),a=i.length;return q(i,n),j(i,a-8,r.d()),j(i,a-4,e),i}(P(t))}const R=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const n=this._hasEvents?",":"";this.stream.push(n+t),this._hasEvents=!0}finish(){this.stream.push("]",!0);const t=function(t){let n=0;for(const r of t)n+=r.length;const r=new Uint8Array(n);for(let n=0,e=0,i=t.length;n<i;n++){const i=t[n];r.set(i,e),e+=i.length}return r}(this._deflatedData);return this._init(),t}_init(){this._hasEvents=!1,this._deflatedData=[],this.deflate=new H,this.deflate.ondata=(t,n)=>{this._deflatedData.push(t)},this.stream=new N(((t,n)=>{this.deflate.push(t,n)})),this.stream.push("[")}},V={clear:()=>{R.clear()},addEvent:t=>R.addEvent(t),finish:()=>R.finish(),compress:t=>Q(t)};addEventListener("message",(function(t){const n=t.data.method,r=t.data.id,e=t.data.arg;if(n in V&&"function"==typeof V[n])try{const t=V[n](e);postMessage({id:r,method:n,success:!0,response:t})}catch(t){postMessage({id:r,method:n,success:!1,response:t.message}),console.error(t)}})),postMessage({id:void 0,method:"init",success:!0,response:void 0});';function NIe(){const t=new Blob([AIe]);return URL.createObjectURL(t)}const mz=["info","warn","error","log"],mb="[Replay] ";function nk(t,e="info"){nc({category:"console",data:{logger:"replay"},level:e,message:`${mb}${t}`},{level:e})}function RIe(){let t=!1,e=!1;const n={exception:()=>{},infoTick:()=>{},setConfig:r=>{t=r.captureExceptions,e=r.traceInternals}};return yt?(mz.forEach(r=>{n[r]=(...s)=>{ze[r](mb,...s),e&&nk(s.join(""),TG(r))}}),n.exception=(r,...s)=>{s.length&&n.error&&n.error(...s),ze.error(mb,r),t?pG(r):e&&nk(r,"error")},n.infoTick=(...r)=>{ze.info(mb,...r),e&&setTimeout(()=>nk(r[0]),0)}):mz.forEach(r=>{n[r]=()=>{}}),n}const St=RIe();class Mj extends Error{constructor(){super(`Event buffer exceeded maximum size of ${kj}.`)}}class TW{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return"sync"}destroy(){this.events=[]}async addEvent(e){const n=JSON.stringify(e).length;if(this._totalSize+=n,this._totalSize>kj)throw new Mj;this.events.push(e)}finish(){return new Promise(e=>{const n=this.events;this.clear(),e(JSON.stringify(n))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){const e=this.events.map(n=>n.timestamp).sort()[0];return e?jj(e):null}}class jIe{constructor(e){this._worker=e,this._id=0}ensureReady(){return this._ensureReadyPromise?this._ensureReadyPromise:(this._ensureReadyPromise=new Promise((e,n)=>{this._worker.addEventListener("message",({data:r})=>{r.success?e():n()},{once:!0}),this._worker.addEventListener("error",r=>{n(r)},{once:!0})}),this._ensureReadyPromise)}destroy(){yt&&St.info("Destroying compression worker"),this._worker.terminate()}postMessage(e,n){const r=this._getAndIncrementId();return new Promise((s,i)=>{const a=({data:l})=>{const u=l;if(u.method===e&&u.id===r){if(this._worker.removeEventListener("message",a),!u.success){yt&&St.error("Error in compression worker: ",u.response),i(new Error("Error in compression worker"));return}s(u.response)}};this._worker.addEventListener("message",a),this._worker.postMessage({id:r,method:e,arg:n})})}_getAndIncrementId(){return this._id++}}class MIe{constructor(e){this._worker=new jIe(e),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return"worker"}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(e){const n=jj(e.timestamp);(!this._earliestTimestamp||n<this._earliestTimestamp)&&(this._earliestTimestamp=n);const r=JSON.stringify(e);return this._totalSize+=r.length,this._totalSize>kj?Promise.reject(new Mj):this._sendEventToWorker(r)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,e=>{yt&&St.exception(e,'Sending "clear" message to worker failed',e)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(e){return this._worker.postMessage("addEvent",e)}async _finishRequest(){const e=await this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,e}}class OIe{constructor(e){this._fallback=new TW,this._compression=new MIe(e),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=this._ensureWorkerIsLoaded()}get waitForCheckout(){return this._used.waitForCheckout}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(e){this._used.hasCheckout=e}set waitForCheckout(e){this._used.waitForCheckout=e}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(e){return this._used.addEvent(e)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch(e){yt&&St.exception(e,"Failed to load the compression worker, falling back to simple buffer");return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){const{events:e,hasCheckout:n,waitForCheckout:r}=this._fallback,s=[];for(const i of e)s.push(this._compression.addEvent(i));this._compression.hasCheckout=n,this._compression.waitForCheckout=r,this._used=this._compression;try{await Promise.all(s),this._fallback.clear()}catch(i){yt&&St.exception(i,"Failed to add events when switching buffers.")}}}function PIe({useCompression:t,workerUrl:e}){if(t&&window.Worker){const n=IIe(e);if(n)return n}return yt&&St.info("Using simple buffer"),new TW}function IIe(t){try{const e=t||DIe();if(!e)return;yt&&St.info(`Using compression worker${t?` from ${t}`:""}`);const n=new Worker(e);return new OIe(n)}catch(e){yt&&St.exception(e,"Failed to create compression worker")}}function DIe(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>"u"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?NIe():""}function Oj(){try{return"sessionStorage"in kn&&!!kn.sessionStorage}catch{return!1}}function LIe(t){$Ie(),t.session=void 0}function $Ie(){if(Oj())try{kn.sessionStorage.removeItem(Sj)}catch{}}function CW(t){return t===void 0?!1:Math.random()<t}function AW(t){const e=Date.now(),n=t.id||ii(),r=t.started||e,s=t.lastActivity||e,i=t.segmentId||0,a=t.sampled,l=t.previousSessionId;return{id:n,started:r,lastActivity:s,segmentId:i,sampled:a,previousSessionId:l}}function Pj(t){if(Oj())try{kn.sessionStorage.setItem(Sj,JSON.stringify(t))}catch{}}function zIe(t,e){return CW(t)?"session":e?"buffer":!1}function gz({sessionSampleRate:t,allowBuffering:e,stickySession:n=!1},{previousSessionId:r}={}){const s=zIe(t,e),i=AW({sampled:s,previousSessionId:r});return n&&Pj(i),i}function FIe(){if(!Oj())return null;try{const t=kn.sessionStorage.getItem(Sj);if(!t)return null;const e=JSON.parse(t);return yt&&St.infoTick("Loading existing session"),AW(e)}catch{return null}}function sA(t,e,n=+new Date){return t===null||e===void 0||e<0?!0:e===0?!1:t+e<=n}function NW(t,{maxReplayDuration:e,sessionIdleExpire:n,targetTime:r=Date.now()}){return sA(t.started,e,r)||sA(t.lastActivity,n,r)}function RW(t,{sessionIdleExpire:e,maxReplayDuration:n}){return!(!NW(t,{sessionIdleExpire:e,maxReplayDuration:n})||t.sampled==="buffer"&&t.segmentId===0)}function rk({sessionIdleExpire:t,maxReplayDuration:e,previousSessionId:n},r){const s=r.stickySession&&FIe();return s?RW(s,{sessionIdleExpire:t,maxReplayDuration:e})?(yt&&St.infoTick("Session in sessionStorage is expired, creating new one..."),gz(r,{previousSessionId:s.id})):s:(yt&&St.infoTick("Creating new session"),gz(r,{previousSessionId:n}))}function UIe(t){return t.type===Ft.Custom}function Ij(t,e,n){return MW(t,e)?(jW(t,e,n),!0):!1}function BIe(t,e,n){return MW(t,e)?jW(t,e,n):Promise.resolve(null)}async function jW(t,e,n){const{eventBuffer:r}=t;if(!r||r.waitForCheckout&&!n)return null;const s=t.recordingMode==="buffer";try{n&&s&&r.clear(),n&&(r.hasCheckout=!0,r.waitForCheckout=!1);const i=t.getOptions(),a=qIe(e,i.beforeAddRecordingEvent);return a?await r.addEvent(a):void 0}catch(i){const a=i&&i instanceof Mj,l=a?"addEventSizeExceeded":"addEvent";if(a&&s)return r.clear(),r.waitForCheckout=!0,null;t.handleException(i),await t.stop({reason:l});const u=Yt();u&&u.recordDroppedEvent("internal_sdk_error","replay")}}function MW(t,e){if(!t.eventBuffer||t.isPaused()||!t.isEnabled())return!1;const n=jj(e.timestamp);return n+t.timeouts.sessionIdlePause<Date.now()?!1:n>t.getContext().initialTimestamp+t.getOptions().maxReplayDuration?(yt&&St.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),!1):!0}function qIe(t,e){try{if(typeof e=="function"&&UIe(t))return e(t)}catch(n){return yt&&St.exception(n,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return t}function Dj(t){return!t.type}function iA(t){return t.type==="transaction"}function VIe(t){return t.type==="replay_event"}function vz(t){return t.type==="feedback"}function HIe(t){return(e,n)=>{if(!t.isEnabled()||!Dj(e)&&!iA(e))return;const r=n&&n.statusCode;if(!(!r||r<200||r>=300)){if(iA(e)){GIe(t,e);return}WIe(t,e)}}}function GIe(t,e){const n=t.getContext();e.contexts&&e.contexts.trace&&e.contexts.trace.trace_id&&n.traceIds.size<100&&n.traceIds.add(e.contexts.trace.trace_id)}function WIe(t,e){const n=t.getContext();if(e.event_id&&n.errorIds.size<100&&n.errorIds.add(e.event_id),t.recordingMode!=="buffer"||!e.tags||!e.tags.replayId)return;const{beforeErrorSampling:r}=t.getOptions();typeof r=="function"&&!r(e)||Ff(async()=>{try{await t.sendBufferedReplayOrFlush()}catch(s){t.handleException(s)}})}function YIe(t){return e=>{!t.isEnabled()||!Dj(e)||KIe(t,e)}}function KIe(t,e){const n=e.exception&&e.exception.values&&e.exception.values[0]&&e.exception.values[0].value;if(typeof n=="string"&&(n.match(/(reactjs\.org\/docs\/error-decoder\.html\?invariant=|react\.dev\/errors\/)(418|419|422|423|425)/)||n.match(/(does not match server-rendered HTML|Hydration failed because)/i))){const r=Ra({category:"replay.hydrate-error",data:{url:$7()}});zg(t,r)}}function XIe(t){const e=Yt();e&&e.on("beforeAddBreadcrumb",n=>QIe(t,n))}function QIe(t,e){if(!t.isEnabled()||!OW(e))return;const n=JIe(e);n&&zg(t,n)}function JIe(t){return!OW(t)||["fetch","xhr","sentry.event","sentry.transaction"].includes(t.category)||t.category.startsWith("ui.")?null:t.category==="console"?ZIe(t):Ra(t)}function ZIe(t){const e=t.data&&t.data.arguments;if(!Array.isArray(e)||e.length===0)return Ra(t);let n=!1;const r=e.map(s=>{if(!s)return s;if(typeof s=="string")return s.length>zy?(n=!0,`${s.slice(0,zy)}…`):s;if(typeof s=="object")try{const i=Ki(s,7);return JSON.stringify(i).length>zy?(n=!0,`${JSON.stringify(i,null,2).slice(0,zy)}…`):i}catch{}return s});return Ra({...t,data:{...t.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}function OW(t){return!!t.category}function eDe(t,e){return t.type||!t.exception||!t.exception.values||!t.exception.values.length?!1:!!(e.originalException&&e.originalException.__rrweb__)}function PW(){const t=An().getPropagationContext().dsc;t&&delete t.replay_id;const e=$r();if(e){const n=Ou(e);delete n.replay_id}}function tDe(t,e){t.triggerUserActivity(),t.addUpdate(()=>e.timestamp?(t.throttledAddEvent({type:Ft.Custom,timestamp:e.timestamp*1e3,data:{tag:"breadcrumb",payload:{timestamp:e.timestamp,type:"default",category:"sentry.feedback",data:{feedbackId:e.event_id}}}}),!1):!0)}function nDe(t,e){return t.recordingMode!=="buffer"||e.message===Ej||!e.exception||e.type?!1:CW(t.getOptions().errorSampleRate)}function rDe(t){return Object.assign((e,n)=>!t.isEnabled()||t.isPaused()?e:VIe(e)?(delete e.breadcrumbs,e):!Dj(e)&&!iA(e)&&!vz(e)?e:t.checkAndHandleExpiredSession()?vz(e)?(t.flush(),e.contexts.feedback.replay_id=t.getSessionId(),tDe(t,e),e):eDe(e,n)&&!t.getOptions()._experiments.captureExceptions?(yt&&St.log("Ignoring error from rrweb internals",e),null):((nDe(t,e)||t.recordingMode==="session")&&(e.tags={...e.tags,replayId:t.getSessionId()}),e):(PW(),e),{id:"Replay"})}function a_(t,e){return e.map(({type:n,start:r,end:s,name:i,data:a})=>{const l=t.throttledAddEvent({type:Ft.Custom,timestamp:r,data:{tag:"performanceSpan",payload:{op:n,description:i,startTimestamp:r,endTimestamp:s,data:a}}});return typeof l=="string"?Promise.resolve(null):l})}function sDe(t){const{from:e,to:n}=t,r=Date.now()/1e3;return{type:"navigation.push",start:r,end:r,name:n,data:{previous:e}}}function iDe(t){return e=>{if(!t.isEnabled())return;const n=sDe(e);n!==null&&(t.getContext().urls.push(n.name),t.triggerUserActivity(),t.addUpdate(()=>(a_(t,[n]),!1)))}}function aDe(t,e){return yt&&t.getOptions()._experiments.traceInternals?!1:sje(e,Yt())}function IW(t,e){t.isEnabled()&&e!==null&&(aDe(t,e.name)||t.addUpdate(()=>(a_(t,[e]),!0)))}function o_(t){if(!t)return;const e=new TextEncoder;try{if(typeof t=="string")return e.encode(t).length;if(t instanceof URLSearchParams)return e.encode(t.toString()).length;if(t instanceof FormData){const n=zW(t);return e.encode(n).length}if(t instanceof Blob)return t.size;if(t instanceof ArrayBuffer)return t.byteLength}catch{}}function DW(t){if(!t)return;const e=parseInt(t,10);return isNaN(e)?void 0:e}function LW(t){try{if(typeof t=="string")return[t];if(t instanceof URLSearchParams)return[t.toString()];if(t instanceof FormData)return[zW(t)];if(!t)return[void 0]}catch(e){return yt&&St.exception(e,"Failed to serialize body",t),[void 0,"BODY_PARSE_ERROR"]}return yt&&St.info("Skipping network body because of body type",t),[void 0,"UNPARSEABLE_BODY_TYPE"]}function Fx(t,e){if(!t)return{headers:{},size:void 0,_meta:{warnings:[e]}};const n={...t._meta},r=n.warnings||[];return n.warnings=[...r,e],t._meta=n,t}function $W(t,e){if(!e)return null;const{startTimestamp:n,endTimestamp:r,url:s,method:i,statusCode:a,request:l,response:u}=e;return{type:t,start:n/1e3,end:r/1e3,name:s,data:Nr({method:i,statusCode:a,request:l,response:u})}}function ig(t){return{headers:{},size:t,_meta:{warnings:["URL_SKIPPED"]}}}function Hl(t,e,n){if(!e&&Object.keys(t).length===0)return;if(!e)return{headers:t};if(!n)return{headers:t,size:e};const r={headers:t,size:e},{body:s,warnings:i}=oDe(n);return r.body=s,i&&i.length>0&&(r._meta={warnings:i}),r}function aA(t,e){return Object.entries(t).reduce((n,[r,s])=>{const i=r.toLowerCase();return e.includes(i)&&t[r]&&(n[i]=s),n},{})}function zW(t){return new URLSearchParams(t).toString()}function oDe(t){if(!t||typeof t!="string")return{body:t};const e=t.length>Q$,n=lDe(t);if(e){const r=t.slice(0,Q$);return n?{body:r,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${r}…`,warnings:["TEXT_TRUNCATED"]}}if(n)try{return{body:JSON.parse(t)}}catch{}return{body:t}}function lDe(t){const e=t[0],n=t[t.length-1];return e==="["&&n==="]"||e==="{"&&n==="}"}function Ux(t,e){const n=cDe(t);return Vl(n,e)}function cDe(t,e=kn.document.baseURI){if(t.startsWith("http://")||t.startsWith("https://")||t.startsWith(kn.location.origin))return t;const n=new URL(t,e);if(n.origin!==new URL(e).origin)return t;const r=n.href;return!t.endsWith("/")&&r.endsWith("/")?r.slice(0,-1):r}async function uDe(t,e,n){try{const r=await fDe(t,e,n),s=$W("resource.fetch",r);IW(n.replay,s)}catch(r){yt&&St.exception(r,"Failed to capture fetch breadcrumb")}}function dDe(t,e){const{input:n,response:r}=e,s=n?FW(n):void 0,i=o_(s),a=r?DW(r.headers.get("content-length")):void 0;i!==void 0&&(t.data.request_body_size=i),a!==void 0&&(t.data.response_body_size=a)}async function fDe(t,e,n){const r=Date.now(),{startTimestamp:s=r,endTimestamp:i=r}=e,{url:a,method:l,status_code:u=0,request_body_size:d,response_body_size:p}=t.data,h=Ux(a,n.networkDetailAllowUrls)&&!Ux(a,n.networkDetailDenyUrls),g=h?hDe(n,e.input,d):ig(d),v=await pDe(h,n,e.response,p);return{startTimestamp:s,endTimestamp:i,url:a,method:l,statusCode:u,request:g,response:v}}function hDe({networkCaptureBodies:t,networkRequestHeaders:e},n,r){const s=n?vDe(n,e):{};if(!t)return Hl(s,r,void 0);const i=FW(n),[a,l]=LW(i),u=Hl(s,r,a);return l?Fx(u,l):u}async function pDe(t,{networkCaptureBodies:e,networkResponseHeaders:n},r,s){if(!t&&s!==void 0)return ig(s);const i=r?UW(r.headers,n):{};if(!r||!e&&s!==void 0)return Hl(i,s,void 0);const[a,l]=await gDe(r),u=mDe(a,{networkCaptureBodies:e,responseBodySize:s,captureDetails:t,headers:i});return l?Fx(u,l):u}function mDe(t,{networkCaptureBodies:e,responseBodySize:n,captureDetails:r,headers:s}){try{const i=t&&t.length&&n===void 0?o_(t):n;return r?e?Hl(s,i,t):Hl(s,i,void 0):ig(i)}catch(i){return yt&&St.exception(i,"Failed to serialize response body"),Hl(s,n,void 0)}}async function gDe(t){const e=yDe(t);if(!e)return[void 0,"BODY_PARSE_ERROR"];try{return[await bDe(e)]}catch(n){return n instanceof Error&&n.message.indexOf("Timeout")>-1?(yt&&St.warn("Parsing text body from response timed out"),[void 0,"BODY_PARSE_TIMEOUT"]):(yt&&St.exception(n,"Failed to get text body from response"),[void 0,"BODY_PARSE_ERROR"])}}function FW(t=[]){if(!(t.length!==2||typeof t[1]!="object"))return t[1].body}function UW(t,e){const n={};return e.forEach(r=>{t.get(r)&&(n[r]=t.get(r))}),n}function vDe(t,e){return t.length===1&&typeof t[0]!="string"?yz(t[0],e):t.length===2?yz(t[1],e):{}}function yz(t,e){if(!t)return{};const n=t.headers;return n?n instanceof Headers?UW(n,e):Array.isArray(n)?{}:aA(n,e):{}}function yDe(t){try{return t.clone()}catch(e){yt&&St.exception(e,"Failed to clone response body")}}function bDe(t){return new Promise((e,n)=>{const r=Ff(()=>n(new Error("Timeout while trying to read response body")),500);xDe(t).then(s=>e(s),s=>n(s)).finally(()=>clearTimeout(r))})}async function xDe(t){return await t.text()}async function _De(t,e,n){try{const r=SDe(t,e,n),s=$W("resource.xhr",r);IW(n.replay,s)}catch(r){yt&&St.exception(r,"Failed to capture xhr breadcrumb")}}function wDe(t,e){const{xhr:n,input:r}=e;if(!n)return;const s=o_(r),i=n.getResponseHeader("content-length")?DW(n.getResponseHeader("content-length")):CDe(n.response,n.responseType);s!==void 0&&(t.data.request_body_size=s),i!==void 0&&(t.data.response_body_size=i)}function SDe(t,e,n){const r=Date.now(),{startTimestamp:s=r,endTimestamp:i=r,input:a,xhr:l}=e,{url:u,method:d,status_code:p=0,request_body_size:h,response_body_size:g}=t.data;if(!u)return null;if(!l||!Ux(u,n.networkDetailAllowUrls)||Ux(u,n.networkDetailDenyUrls)){const A=ig(h),N=ig(g);return{startTimestamp:s,endTimestamp:i,url:u,method:d,statusCode:p,request:A,response:N}}const v=l[Kc],b=v?aA(v.request_headers,n.networkRequestHeaders):{},x=aA(EDe(l),n.networkResponseHeaders),[E,S]=n.networkCaptureBodies?LW(a):[void 0],[k,T]=n.networkCaptureBodies?kDe(l):[void 0],R=Hl(b,h,E),j=Hl(x,g,k);return{startTimestamp:s,endTimestamp:i,url:u,method:d,statusCode:p,request:S?Fx(R,S):R,response:T?Fx(j,T):j}}function EDe(t){const e=t.getAllResponseHeaders();return e?e.split(`\r
|
|
1872
|
+
or you can use record.mirror to access the mirror instance during recording.`;let rz={map:{},getId(){return console.error(Fd),-1},getNode(){return console.error(Fd),null},removeNodeFromMap(){console.error(Fd)},has(){return console.error(Fd),!1},reset(){console.error(Fd)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(rz=new Proxy(rz,{get(t,e,n){return e==="map"&&console.error(Fd),Reflect.get(t,e,n)}}));function sg(t,e,n={}){let r=null,s=0;return function(...i){const a=Date.now();!s&&n.leading===!1&&(s=a);const l=e-(a-s),u=this;l<=0||l>e?(r&&(yPe(r),r=null),s=a,t.apply(u,i)):!r&&n.trailing!==!1&&(r=s_(()=>{s=n.leading===!1?0:Date.now(),r=null,t.apply(u,i)},l))}}function lW(t,e,n,r,s=window){const i=s.Object.getOwnPropertyDescriptor(t,e);return s.Object.defineProperty(t,e,r?n:{set(a){s_(()=>{n.set.call(this,a)},0),i&&i.set&&i.set.call(this,a)}}),()=>lW(t,e,i||{},!0)}function Aj(t,e,n){try{if(!(e in t))return()=>{};const r=t[e],s=n(r);return typeof s=="function"&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:r}})),t[e]=s,()=>{t[e]=r}}catch{return()=>{}}}let Dx=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Dx=()=>new Date().getTime());function cW(t){const e=t.document;return{left:e.scrollingElement?e.scrollingElement.scrollLeft:t.pageXOffset!==void 0?t.pageXOffset:jl([e,"optionalAccess",n=>n.documentElement,"access",n=>n.scrollLeft])||jl([e,"optionalAccess",n=>n.body,"optionalAccess",n=>n.parentElement,"optionalAccess",n=>n.scrollLeft])||jl([e,"optionalAccess",n=>n.body,"optionalAccess",n=>n.scrollLeft])||0,top:e.scrollingElement?e.scrollingElement.scrollTop:t.pageYOffset!==void 0?t.pageYOffset:jl([e,"optionalAccess",n=>n.documentElement,"access",n=>n.scrollTop])||jl([e,"optionalAccess",n=>n.body,"optionalAccess",n=>n.parentElement,"optionalAccess",n=>n.scrollTop])||jl([e,"optionalAccess",n=>n.body,"optionalAccess",n=>n.scrollTop])||0}}function uW(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function dW(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function fW(t){return t?t.nodeType===t.ELEMENT_NODE?t:t.parentElement:null}function Js(t,e,n,r,s){if(!t)return!1;const i=fW(t);if(!i)return!1;const a=Jd(e,n);if(!s){const d=r&&i.matches(r);return a(i)&&!d}const l=Xc(i,a);let u=-1;return l<0?!1:(r&&(u=Xc(i,Jd(null,r))),l>-1&&u<0?!0:l<u)}function fPe(t,e){return e.getId(t)!==-1}function ek(t,e){return e.getId(t)===rg}function hW(t,e){if(vm(t))return!1;const n=e.getId(t);return e.has(n)?t.parentNode&&t.parentNode.nodeType===t.DOCUMENT_NODE?!1:t.parentNode?hW(t.parentNode,e):!0:!0}function eA(t){return!!t.changedTouches}function hPe(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let n=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function pW(t,e){return!!(t.nodeName==="IFRAME"&&e.getMeta(t))}function mW(t,e){return!!(t.nodeName==="LINK"&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&t.getAttribute("rel")==="stylesheet"&&e.getMeta(t))}function tA(t){return!!jl([t,"optionalAccess",e=>e.shadowRoot])}class pPe{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){return Jje(this.styleIDMap.get(e),()=>-1)}has(e){return this.styleIDMap.has(e)}add(e,n){if(this.has(e))return this.getId(e);let r;return n===void 0?r=this.id++:r=n,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function gW(t){let e=null;return jl([t,"access",n=>n.getRootNode,"optionalCall",n=>n(),"optionalAccess",n=>n.nodeType])===Node.DOCUMENT_FRAGMENT_NODE&&t.getRootNode().host&&(e=t.getRootNode().host),e}function mPe(t){let e=t,n;for(;n=gW(e);)e=n;return e}function gPe(t){const e=t.ownerDocument;if(!e)return!1;const n=mPe(t);return e.contains(n)}function vW(t){const e=t.ownerDocument;return e?e.contains(t)||gPe(t):!1}const sz={};function Nj(t){const e=sz[t];if(e)return e;const n=window.document;let r=window[t];if(n&&typeof n.createElement=="function")try{const s=n.createElement("iframe");s.hidden=!0,n.head.appendChild(s);const i=s.contentWindow;i&&i[t]&&(r=i[t]),n.head.removeChild(s)}catch{}return sz[t]=r.bind(window)}function vPe(...t){return Nj("requestAnimationFrame")(...t)}function s_(...t){return Nj("setTimeout")(...t)}function yPe(...t){return Nj("clearTimeout")(...t)}var Ft=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(Ft||{}),Tt=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(Tt||{}),ds=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(ds||{}),vo=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(vo||{}),iz;(function(t){t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment"})(iz||(iz={}));var az;(function(t){t[t.PLACEHOLDER=0]="PLACEHOLDER",t[t.ELEMENT_NODE=1]="ELEMENT_NODE",t[t.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",t[t.TEXT_NODE=3]="TEXT_NODE",t[t.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",t[t.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",t[t.ENTITY_NODE=6]="ENTITY_NODE",t[t.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",t[t.COMMENT_NODE=8]="COMMENT_NODE",t[t.DOCUMENT_NODE=9]="DOCUMENT_NODE",t[t.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",t[t.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE"})(az||(az={}));function Rj(t){try{return t.contentDocument}catch{}}function bPe(t){try{return t.contentWindow}catch{}}function xPe(t){let e,n=t[0],r=1;for(;r<t.length;){const s=t[r],i=t[r+1];if(r+=2,(s==="optionalAccess"||s==="optionalCall")&&n==null)return;s==="access"||s==="optionalAccess"?(e=n,n=i(n)):(s==="call"||s==="optionalCall")&&(n=i((...a)=>n.call(e,...a)),e=void 0)}return n}function oz(t){return"__ln"in t}class _Pe{constructor(){this.length=0,this.head=null,this.tail=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<e;r++)n=xPe([n,"optionalAccess",s=>s.next])||null;return n}addNode(e){const n={value:e,previous:null,next:null};if(e.__ln=n,e.previousSibling&&oz(e.previousSibling)){const r=e.previousSibling.__ln.next;n.next=r,n.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(e.nextSibling&&oz(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;n.previous=r,n.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;n.next===null&&(this.tail=n),this.length++}removeNode(e){const n=e.__ln;this.head&&(n.previous?(n.previous.next=n.next,n.next?n.next.previous=n.previous:this.tail=n.previous):(this.head=n.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const lz=(t,e)=>`${t}@${e}`;class wPe{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],n=new Set,r=new _Pe,s=u=>{let d=u,p=rg;for(;p===rg;)d=d&&d.nextSibling,p=d&&this.mirror.getId(d);return p},i=u=>{if(!u.parentNode||!vW(u))return;const d=vm(u.parentNode)?this.mirror.getId(gW(u)):this.mirror.getId(u.parentNode),p=s(u);if(d===-1||p===-1)return r.addNode(u);const h=Zd(u,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskAllText:this.maskAllText,unblockSelector:this.unblockSelector,maskTextClass:this.maskTextClass,unmaskTextClass:this.unmaskTextClass,maskTextSelector:this.maskTextSelector,unmaskTextSelector:this.unmaskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskAttributeFn:this.maskAttributeFn,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:g=>{pW(g,this.mirror)&&!Js(g,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(g),mW(g,this.mirror)&&this.stylesheetManager.trackLinkElement(g),tA(u)&&this.shadowDomManager.addShadowRoot(u.shadowRoot,this.doc)},onIframeLoad:(g,v)=>{Js(g,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(this.iframeManager.attachIframe(g,v),g.contentWindow&&this.canvasManager.addWindow(g.contentWindow),this.shadowDomManager.observeAttachShadow(g))},onStylesheetLoad:(g,v)=>{this.stylesheetManager.attachLinkElement(g,v)}});h&&(e.push({parentId:d,nextId:p,node:h}),n.add(h.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const u of this.movedSet)cz(this.removes,u,this.mirror)&&!this.movedSet.has(u.parentNode)||i(u);for(const u of this.addedSet)!uz(this.droppedSet,u)&&!cz(this.removes,u,this.mirror)||uz(this.movedSet,u)?i(u):this.droppedSet.add(u);let a=null;for(;r.length;){let u=null;if(a){const d=this.mirror.getId(a.value.parentNode),p=s(a.value);d!==-1&&p!==-1&&(u=a)}if(!u){let d=r.tail;for(;d;){const p=d;if(d=d.previous,p){const h=this.mirror.getId(p.value.parentNode);if(s(p.value)===-1)continue;if(h!==-1){u=p;break}else{const v=p.value;if(v.parentNode&&v.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const b=v.parentNode.host;if(this.mirror.getId(b)!==-1){u=p;break}}}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}a=u.previous,r.removeNode(u.value),i(u.value)}const l={texts:this.texts.map(u=>({id:this.mirror.getId(u.node),value:u.value})).filter(u=>!n.has(u.id)).filter(u=>this.mirror.has(u.id)),attributes:this.attributes.map(u=>{const{attributes:d}=u;if(typeof d.style=="string"){const p=JSON.stringify(u.styleDiff),h=JSON.stringify(u._unchangedStyles);p.length<d.style.length&&(p+h).split("var(").length===d.style.split("var(").length&&(d.style=u.styleDiff)}return{id:this.mirror.getId(u.node),attributes:d}}).filter(u=>!n.has(u.id)).filter(u=>this.mirror.has(u.id)),removes:this.removes,adds:e};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(l))},this.processMutation=e=>{if(!ek(e.target,this.mirror))switch(e.type){case"characterData":{const n=e.target.textContent;!Js(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&n!==e.oldValue&&this.texts.push({value:Bf(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&n?this.maskTextFn?this.maskTextFn(n,fW(e.target)):n.replace(/[\S]/g,"*"):n,node:e.target});break}case"attributes":{const n=e.target;let r=e.attributeName,s=e.target.getAttribute(r);if(r==="value"){const a=Tj(n),l=n.tagName;s=Px(n,l,a);const u=n_({maskInputOptions:this.maskInputOptions,tagName:l,type:a}),d=Bf(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,u);s=ng({isMasked:d,element:n,value:s,maskInputFn:this.maskInputFn})}if(Js(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||s===e.oldValue)return;let i=this.attributeMap.get(e.target);if(n.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(s))if(!Rj(n))r="rr_src";else return;if(i||(i={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(e.target,i)),r==="type"&&n.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&n.setAttribute("data-rr-is-password","true"),!oW(n.tagName,r)&&(i.attributes[r]=aW(this.doc,Uf(n.tagName),Uf(r),s,n,this.maskAttributeFn),r==="style")){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const a=this.unattachedDoc.createElement("span");e.oldValue&&a.setAttribute("style",e.oldValue);for(const l of Array.from(n.style)){const u=n.style.getPropertyValue(l),d=n.style.getPropertyPriority(l);u!==a.style.getPropertyValue(l)||d!==a.style.getPropertyPriority(l)?d===""?i.styleDiff[l]=u:i.styleDiff[l]=[u,d]:i._unchangedStyles[l]=[u,d]}for(const l of Array.from(a.style))n.style.getPropertyValue(l)===""&&(i.styleDiff[l]=!1)}break}case"childList":{if(Js(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;e.addedNodes.forEach(n=>this.genAdds(n,e.target)),e.removedNodes.forEach(n=>{const r=this.mirror.getId(n),s=vm(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);Js(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||ek(n,this.mirror)||!fPe(n,this.mirror)||(this.addedSet.has(n)?(nA(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(e.target)&&r===-1||hW(e.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[lz(r,s)]?nA(this.movedSet,n):this.removes.push({parentId:s,id:r,isShadow:vm(e.target)&&ym(e.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(e,n)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(ek(e,this.mirror))return;this.movedSet.add(e);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[lz(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Js(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(e.childNodes.forEach(r=>this.genAdds(r)),tA(e)&&e.shadowRoot.childNodes.forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}}}init(e){["mutationCb","blockClass","blockSelector","unblockSelector","maskAllText","maskTextClass","unmaskTextClass","maskTextSelector","unmaskTextSelector","inlineStylesheet","maskInputOptions","maskAttributeFn","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(n=>{this[n]=e[n]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function nA(t,e){t.delete(e),e.childNodes.forEach(n=>nA(t,n))}function cz(t,e,n){return t.length===0?!1:SPe(t,e,n)}function SPe(t,e,n){let r=e.parentNode;for(;r;){const s=n.getId(r);if(t.some(i=>i.id===s))return!0;r=r.parentNode}return!1}function uz(t,e){return t.size===0?!1:yW(t,e)}function yW(t,e){const{parentNode:n}=e;return n?t.has(n)?!0:yW(t,n):!1}let bm;function EPe(t){bm=t}function kPe(){bm=void 0}const Zt=t=>bm?(...n)=>{try{return t(...n)}catch(r){if(bm&&bm(r)===!0)return()=>{};throw r}}:t;function Qi(t){let e,n=t[0],r=1;for(;r<t.length;){const s=t[r],i=t[r+1];if(r+=2,(s==="optionalAccess"||s==="optionalCall")&&n==null)return;s==="access"||s==="optionalAccess"?(e=n,n=i(n)):(s==="call"||s==="optionalCall")&&(n=i((...a)=>n.call(e,...a)),e=void 0)}return n}const ef=[];function $g(t){try{if("composedPath"in t){const e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch{}return t&&t.target}function bW(t,e){const n=new wPe;ef.push(n),n.init(t);let r=window.MutationObserver||window.__rrMutationObserver;const s=Qi([window,"optionalAccess",a=>a.Zone,"optionalAccess",a=>a.__symbol__,"optionalCall",a=>a("MutationObserver")]);s&&window[s]&&(r=window[s]);const i=new r(Zt(a=>{t.onMutation&&t.onMutation(a)===!1||n.processMutations.bind(n)(a)}));return i.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function TPe({mousemoveCb:t,sampling:e,doc:n,mirror:r}){if(e.mousemove===!1)return()=>{};const s=typeof e.mousemove=="number"?e.mousemove:50,i=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500;let a=[],l;const u=sg(Zt(h=>{const g=Date.now()-l;t(a.map(v=>(v.timeOffset-=g,v)),h),a=[],l=null}),i),d=Zt(sg(Zt(h=>{const g=$g(h),{clientX:v,clientY:b}=eA(h)?h.changedTouches[0]:h;l||(l=Dx()),a.push({x:v,y:b,id:r.getId(g),timeOffset:Dx()-l}),u(typeof DragEvent<"u"&&h instanceof DragEvent?Tt.Drag:h instanceof MouseEvent?Tt.MouseMove:Tt.TouchMove)}),s,{trailing:!1})),p=[hs("mousemove",d,n),hs("touchmove",d,n),hs("drag",d,n)];return Zt(()=>{p.forEach(h=>h())})}function CPe({mouseInteractionCb:t,doc:e,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,sampling:a}){if(a.mouseInteraction===!1)return()=>{};const l=a.mouseInteraction===!0||a.mouseInteraction===void 0?{}:a.mouseInteraction,u=[];let d=null;const p=h=>g=>{const v=$g(g);if(Js(v,r,s,i,!0))return;let b=null,x=h;if("pointerType"in g){switch(g.pointerType){case"mouse":b=vo.Mouse;break;case"touch":b=vo.Touch;break;case"pen":b=vo.Pen;break}b===vo.Touch?ds[h]===ds.MouseDown?x="TouchStart":ds[h]===ds.MouseUp&&(x="TouchEnd"):vo.Pen}else eA(g)&&(b=vo.Touch);b!==null?(d=b,(x.startsWith("Touch")&&b===vo.Touch||x.startsWith("Mouse")&&b===vo.Mouse)&&(b=null)):ds[h]===ds.Click&&(b=d,d=null);const E=eA(g)?g.changedTouches[0]:g;if(!E)return;const S=n.getId(v),{clientX:k,clientY:T}=E;Zt(t)({type:ds[x],id:S,x:k,y:T,...b!==null&&{pointerType:b}})};return Object.keys(ds).filter(h=>Number.isNaN(Number(h))&&!h.endsWith("_Departed")&&l[h]!==!1).forEach(h=>{let g=Uf(h);const v=p(h);if(window.PointerEvent)switch(ds[h]){case ds.MouseDown:case ds.MouseUp:g=g.replace("mouse","pointer");break;case ds.TouchStart:case ds.TouchEnd:return}u.push(hs(g,v,e))}),Zt(()=>{u.forEach(h=>h())})}function xW({scrollCb:t,doc:e,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,sampling:a}){const l=Zt(sg(Zt(u=>{const d=$g(u);if(!d||Js(d,r,s,i,!0))return;const p=n.getId(d);if(d===e&&e.defaultView){const h=cW(e.defaultView);t({id:p,x:h.left,y:h.top})}else t({id:p,x:d.scrollLeft,y:d.scrollTop})}),a.scroll||100));return hs("scroll",l,e)}function APe({viewportResizeCb:t},{win:e}){let n=-1,r=-1;const s=Zt(sg(Zt(()=>{const i=uW(),a=dW();(n!==i||r!==a)&&(t({width:Number(a),height:Number(i)}),n=i,r=a)}),200));return hs("resize",s,e)}const NPe=["INPUT","TEXTAREA","SELECT"],dz=new WeakMap;function RPe({inputCb:t,doc:e,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,ignoreClass:a,ignoreSelector:l,maskInputOptions:u,maskInputFn:d,sampling:p,userTriggeredOnInput:h,maskTextClass:g,unmaskTextClass:v,maskTextSelector:b,unmaskTextSelector:x}){function E(N){let M=$g(N);const I=N.isTrusted,O=M&&JC(M.tagName);if(O==="OPTION"&&(M=M.parentElement),!M||!O||NPe.indexOf(O)<0||Js(M,r,s,i,!0))return;const L=M;if(L.classList.contains(a)||l&&L.matches(l))return;const z=Tj(M);let G=Px(L,O,z),W=!1;const X=n_({maskInputOptions:u,tagName:O,type:z}),F=Bf(M,g,b,v,x,X);(z==="radio"||z==="checkbox")&&(W=M.checked),G=ng({isMasked:F,element:M,value:G,maskInputFn:d}),S(M,h?{text:G,isChecked:W,userTriggered:I}:{text:G,isChecked:W});const Y=M.name;z==="radio"&&Y&&W&&e.querySelectorAll(`input[type="radio"][name="${Y}"]`).forEach(H=>{if(H!==M){const te=ng({isMasked:F,element:H,value:Px(H,O,z),maskInputFn:d});S(H,h?{text:te,isChecked:!W,userTriggered:!1}:{text:te,isChecked:!W})}})}function S(N,M){const I=dz.get(N);if(!I||I.text!==M.text||I.isChecked!==M.isChecked){dz.set(N,M);const O=n.getId(N);Zt(t)({...M,id:O})}}const T=(p.input==="last"?["change"]:["input","change"]).map(N=>hs(N,Zt(E),e)),R=e.defaultView;if(!R)return()=>{T.forEach(N=>N())};const j=R.Object.getOwnPropertyDescriptor(R.HTMLInputElement.prototype,"value"),A=[[R.HTMLInputElement.prototype,"value"],[R.HTMLInputElement.prototype,"checked"],[R.HTMLSelectElement.prototype,"value"],[R.HTMLTextAreaElement.prototype,"value"],[R.HTMLSelectElement.prototype,"selectedIndex"],[R.HTMLOptionElement.prototype,"selected"]];return j&&j.set&&T.push(...A.map(N=>lW(N[0],N[1],{set(){Zt(E)({target:this,isTrusted:!1})}},!1,R))),Zt(()=>{T.forEach(N=>N())})}function Lx(t){const e=[];function n(r,s){if(Fy("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Fy("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Fy("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Fy("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const a=Array.from(r.parentRule.cssRules).indexOf(r);s.unshift(a)}else if(r.parentStyleSheet){const a=Array.from(r.parentStyleSheet.cssRules).indexOf(r);s.unshift(a)}return s}return n(t,e)}function Ml(t,e,n){let r,s;return t?(t.ownerNode?r=e.getId(t.ownerNode):s=n.getId(t),{styleId:s,id:r}):{}}function jPe({styleSheetRuleCb:t,mirror:e,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const s=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:Zt((p,h,g)=>{const[v,b]=g,{id:x,styleId:E}=Ml(h,e,n.styleMirror);return(x&&x!==-1||E&&E!==-1)&&t({id:x,styleId:E,adds:[{rule:v,index:b}]}),p.apply(h,g)})});const i=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:Zt((p,h,g)=>{const[v]=g,{id:b,styleId:x}=Ml(h,e,n.styleMirror);return(b&&b!==-1||x&&x!==-1)&&t({id:b,styleId:x,removes:[{index:v}]}),p.apply(h,g)})});let a;r.CSSStyleSheet.prototype.replace&&(a=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Zt((p,h,g)=>{const[v]=g,{id:b,styleId:x}=Ml(h,e,n.styleMirror);return(b&&b!==-1||x&&x!==-1)&&t({id:b,styleId:x,replace:v}),p.apply(h,g)})}));let l;r.CSSStyleSheet.prototype.replaceSync&&(l=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Zt((p,h,g)=>{const[v]=g,{id:b,styleId:x}=Ml(h,e,n.styleMirror);return(b&&b!==-1||x&&x!==-1)&&t({id:b,styleId:x,replaceSync:v}),p.apply(h,g)})}));const u={};Uy("CSSGroupingRule")?u.CSSGroupingRule=r.CSSGroupingRule:(Uy("CSSMediaRule")&&(u.CSSMediaRule=r.CSSMediaRule),Uy("CSSConditionRule")&&(u.CSSConditionRule=r.CSSConditionRule),Uy("CSSSupportsRule")&&(u.CSSSupportsRule=r.CSSSupportsRule));const d={};return Object.entries(u).forEach(([p,h])=>{d[p]={insertRule:h.prototype.insertRule,deleteRule:h.prototype.deleteRule},h.prototype.insertRule=new Proxy(d[p].insertRule,{apply:Zt((g,v,b)=>{const[x,E]=b,{id:S,styleId:k}=Ml(v.parentStyleSheet,e,n.styleMirror);return(S&&S!==-1||k&&k!==-1)&&t({id:S,styleId:k,adds:[{rule:x,index:[...Lx(v),E||0]}]}),g.apply(v,b)})}),h.prototype.deleteRule=new Proxy(d[p].deleteRule,{apply:Zt((g,v,b)=>{const[x]=b,{id:E,styleId:S}=Ml(v.parentStyleSheet,e,n.styleMirror);return(E&&E!==-1||S&&S!==-1)&&t({id:E,styleId:S,removes:[{index:[...Lx(v),x]}]}),g.apply(v,b)})})}),Zt(()=>{r.CSSStyleSheet.prototype.insertRule=s,r.CSSStyleSheet.prototype.deleteRule=i,a&&(r.CSSStyleSheet.prototype.replace=a),l&&(r.CSSStyleSheet.prototype.replaceSync=l),Object.entries(u).forEach(([p,h])=>{h.prototype.insertRule=d[p].insertRule,h.prototype.deleteRule=d[p].deleteRule})})}function _W({mirror:t,stylesheetManager:e},n){let r=null;n.nodeName==="#document"?r=t.getId(n):r=t.getId(n.host);const s=n.nodeName==="#document"?Qi([n,"access",a=>a.defaultView,"optionalAccess",a=>a.Document]):Qi([n,"access",a=>a.ownerDocument,"optionalAccess",a=>a.defaultView,"optionalAccess",a=>a.ShadowRoot]),i=Qi([s,"optionalAccess",a=>a.prototype])?Object.getOwnPropertyDescriptor(Qi([s,"optionalAccess",a=>a.prototype]),"adoptedStyleSheets"):void 0;return r===null||r===-1||!s||!i?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get(){return Qi([i,"access",a=>a.get,"optionalAccess",a=>a.call,"call",a=>a(this)])},set(a){const l=Qi([i,"access",u=>u.set,"optionalAccess",u=>u.call,"call",u=>u(this,a)]);if(r!==null&&r!==-1)try{e.adoptStyleSheets(a,r)}catch{}return l}}),Zt(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get:i.get,set:i.set})}))}function MPe({styleDeclarationCb:t,mirror:e,ignoreCSSAttributes:n,stylesheetManager:r},{win:s}){const i=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:Zt((l,u,d)=>{const[p,h,g]=d;if(n.has(p))return i.apply(u,[p,h,g]);const{id:v,styleId:b}=Ml(Qi([u,"access",x=>x.parentRule,"optionalAccess",x=>x.parentStyleSheet]),e,r.styleMirror);return(v&&v!==-1||b&&b!==-1)&&t({id:v,styleId:b,set:{property:p,value:h,priority:g},index:Lx(u.parentRule)}),l.apply(u,d)})});const a=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:Zt((l,u,d)=>{const[p]=d;if(n.has(p))return a.apply(u,[p]);const{id:h,styleId:g}=Ml(Qi([u,"access",v=>v.parentRule,"optionalAccess",v=>v.parentStyleSheet]),e,r.styleMirror);return(h&&h!==-1||g&&g!==-1)&&t({id:h,styleId:g,remove:{property:p},index:Lx(u.parentRule)}),l.apply(u,d)})}),Zt(()=>{s.CSSStyleDeclaration.prototype.setProperty=i,s.CSSStyleDeclaration.prototype.removeProperty=a})}function OPe({mediaInteractionCb:t,blockClass:e,blockSelector:n,unblockSelector:r,mirror:s,sampling:i,doc:a}){const l=Zt(d=>sg(Zt(p=>{const h=$g(p);if(!h||Js(h,e,n,r,!0))return;const{currentTime:g,volume:v,muted:b,playbackRate:x}=h;t({type:d,id:s.getId(h),currentTime:g,volume:v,muted:b,playbackRate:x})}),i.media||500)),u=[hs("play",l(0),a),hs("pause",l(1),a),hs("seeked",l(2),a),hs("volumechange",l(3),a),hs("ratechange",l(4),a)];return Zt(()=>{u.forEach(d=>d())})}function PPe({fontCb:t,doc:e}){const n=e.defaultView;if(!n)return()=>{};const r=[],s=new WeakMap,i=n.FontFace;n.FontFace=function(u,d,p){const h=new i(u,d,p);return s.set(h,{family:u,buffer:typeof d!="string",descriptors:p,fontSource:typeof d=="string"?d:JSON.stringify(Array.from(new Uint8Array(d)))}),h};const a=Aj(e.fonts,"add",function(l){return function(u){return s_(Zt(()=>{const d=s.get(u);d&&(t(d),s.delete(u))}),0),l.apply(this,[u])}});return r.push(()=>{n.FontFace=i}),r.push(a),Zt(()=>{r.forEach(l=>l())})}function IPe(t){const{doc:e,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,selectionCb:a}=t;let l=!0;const u=Zt(()=>{const d=e.getSelection();if(!d||l&&Qi([d,"optionalAccess",g=>g.isCollapsed]))return;l=d.isCollapsed||!1;const p=[],h=d.rangeCount||0;for(let g=0;g<h;g++){const v=d.getRangeAt(g),{startContainer:b,startOffset:x,endContainer:E,endOffset:S}=v;Js(b,r,s,i,!0)||Js(E,r,s,i,!0)||p.push({start:n.getId(b),startOffset:x,end:n.getId(E),endOffset:S})}a({ranges:p})});return u(),hs("selectionchange",u)}function DPe({doc:t,customElementCb:e}){const n=t.defaultView;return!n||!n.customElements?()=>{}:Aj(n.customElements,"define",function(s){return function(i,a,l){try{e({define:{name:i}})}catch{}return s.apply(this,[i,a,l])}})}function LPe(t,e={}){const n=t.doc.defaultView;if(!n)return()=>{};let r;t.recordDOM&&(r=bW(t,t.doc));const s=TPe(t),i=CPe(t),a=xW(t),l=APe(t,{win:n}),u=RPe(t),d=OPe(t);let p=()=>{},h=()=>{},g=()=>{},v=()=>{};t.recordDOM&&(p=jPe(t,{win:n}),h=_W(t,t.doc),g=MPe(t,{win:n}),t.collectFonts&&(v=PPe(t)));const b=IPe(t),x=DPe(t),E=[];for(const S of t.plugins)E.push(S.observer(S.callback,n,S.options));return Zt(()=>{ef.forEach(S=>S.reset()),Qi([r,"optionalAccess",S=>S.disconnect,"call",S=>S()]),s(),i(),a(),l(),u(),d(),p(),h(),g(),v(),b(),x(),E.forEach(S=>S())})}function Fy(t){return typeof window[t]<"u"}function Uy(t){return!!(typeof window[t]<"u"&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class rA{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,n,r,s){const i=r||this.getIdToRemoteIdMap(e),a=s||this.getRemoteIdToIdMap(e);let l=i.get(n);return l||(l=this.generateIdFn(),i.set(n,l),a.set(l,n)),l}getIds(e,n){const r=this.getIdToRemoteIdMap(e),s=this.getRemoteIdToIdMap(e);return n.map(i=>this.getId(e,i,r,s))}getRemoteId(e,n,r){const s=r||this.getRemoteIdToIdMap(e);if(typeof n!="number")return n;const i=s.get(n);return i||-1}getRemoteIds(e,n){const r=this.getRemoteIdToIdMap(e);return n.map(s=>this.getRemoteId(e,s,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let n=this.iframeIdToRemoteIdMap.get(e);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(e,n)),n}getRemoteIdToIdMap(e){let n=this.iframeRemoteIdToIdMap.get(e);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(e,n)),n}}function fz(t){let e,n=t[0],r=1;for(;r<t.length;){const s=t[r],i=t[r+1];if(r+=2,(s==="optionalAccess"||s==="optionalCall")&&n==null)return;s==="access"||s==="optionalAccess"?(e=n,n=i(n)):(s==="call"||s==="optionalCall")&&(n=i((...a)=>n.call(e,...a)),e=void 0)}return n}class $Pe{constructor(){this.crossOriginIframeMirror=new rA(Cj),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}}class zPe{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new rA(Cj),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new rA(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,n){this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),fz([this,"access",s=>s.loadListener,"optionalCall",s=>s(e)]);const r=Rj(e);r&&r.adoptedStyleSheets&&r.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(r.adoptedStyleSheets,this.mirror.getId(r))}handleMessage(e){const n=e;if(n.data.type!=="rrweb"||n.origin!==n.data.origin||!e.source)return;const s=this.crossOriginIframeMap.get(e.source);if(!s)return;const i=this.transformCrossOriginEvent(s,n.data.event);i&&this.wrappedEmit(i,n.data.isCheckout)}transformCrossOriginEvent(e,n){switch(n.type){case Ft.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(n.data.node,e);const r=n.data.node.id;return this.crossOriginIframeRootIdMap.set(e,r),this.patchRootIdOnNode(n.data.node,r),{timestamp:n.timestamp,type:Ft.IncrementalSnapshot,data:{source:Tt.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Ft.Meta:case Ft.Load:case Ft.DomContentLoaded:return!1;case Ft.Plugin:return n;case Ft.Custom:return this.replaceIds(n.data.payload,e,["id","parentId","previousId","nextId"]),n;case Ft.IncrementalSnapshot:switch(n.data.source){case Tt.Mutation:return n.data.adds.forEach(r=>{this.replaceIds(r,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(r.node,e);const s=this.crossOriginIframeRootIdMap.get(e);s&&this.patchRootIdOnNode(r.node,s)}),n.data.removes.forEach(r=>{this.replaceIds(r,e,["parentId","id"])}),n.data.attributes.forEach(r=>{this.replaceIds(r,e,["id"])}),n.data.texts.forEach(r=>{this.replaceIds(r,e,["id"])}),n;case Tt.Drag:case Tt.TouchMove:case Tt.MouseMove:return n.data.positions.forEach(r=>{this.replaceIds(r,e,["id"])}),n;case Tt.ViewportResize:return!1;case Tt.MediaInteraction:case Tt.MouseInteraction:case Tt.Scroll:case Tt.CanvasMutation:case Tt.Input:return this.replaceIds(n.data,e,["id"]),n;case Tt.StyleSheetRule:case Tt.StyleDeclaration:return this.replaceIds(n.data,e,["id"]),this.replaceStyleIds(n.data,e,["styleId"]),n;case Tt.Font:return n;case Tt.Selection:return n.data.ranges.forEach(r=>{this.replaceIds(r,e,["start","end"])}),n;case Tt.AdoptedStyleSheet:return this.replaceIds(n.data,e,["id"]),this.replaceStyleIds(n.data,e,["styleIds"]),fz([n,"access",r=>r.data,"access",r=>r.styles,"optionalAccess",r=>r.forEach,"call",r=>r(s=>{this.replaceStyleIds(s,e,["styleId"])})]),n}}return!1}replace(e,n,r,s){for(const i of s)!Array.isArray(n[i])&&typeof n[i]!="number"||(Array.isArray(n[i])?n[i]=e.getIds(r,n[i]):n[i]=e.getId(r,n[i]));return n}replaceIds(e,n,r){return this.replace(this.crossOriginIframeMirror,e,n,r)}replaceStyleIds(e,n,r){return this.replace(this.crossOriginIframeStyleMirror,e,n,r)}replaceIdOnNode(e,n){this.replaceIds(e,n,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}patchRootIdOnNode(e,n){e.type!==Er.Document&&!e.rootId&&(e.rootId=n),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}}class FPe{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}}class UPe{constructor(e){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,n){if(!ym(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e),this.bypassOptions.canvasManager.addShadowRoot(e);const r=bW({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(xW({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),s_(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),this.restoreHandlers.push(_W({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){const n=Rj(e),r=bPe(e);!n||!r||this.patchAttachShadow(r.Element,n)}patchAttachShadow(e,n){const r=this;this.restoreHandlers.push(Aj(e.prototype,"attachShadow",function(s){return function(i){const a=s.call(this,i);return this.shadowRoot&&vW(this)&&r.addShadowRoot(this.shadowRoot,n),a}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet,this.bypassOptions.canvasManager.resetShadowRoots()}}class hz{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}}class BPe{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new pPe,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,n){if(e.length===0)return;const r={id:n,styleIds:[]},s=[];for(const i of e){let a;this.styleMirror.has(i)?a=this.styleMirror.getId(i):(a=this.styleMirror.add(i),s.push({styleId:a,rules:Array.from(i.rules||CSSRule,(l,u)=>({rule:eW(l),index:u}))})),r.styleIds.push(a)}s.length>0&&(r.styles=s),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class qPe{constructor(){this.nodeMap=new WeakMap,this.active=!1}inOtherBuffer(e,n){const r=this.nodeMap.get(e);return r&&Array.from(r).some(s=>s!==n)}add(e,n){this.active||(this.active=!0,vPe(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(n))}destroy(){}}let Yn,$x;try{if(Array.from([1],t=>t*2)[0]!==2){const t=document.createElement("iframe");document.body.appendChild(t),Array.from=fb([t,"access",e=>e.contentWindow,"optionalAccess",e=>e.Array,"access",e=>e.from])||Array.from,document.body.removeChild(t)}}catch(t){console.debug("Unable to override Array.from",t)}const Hi=B2e();function Ro(t={}){const{emit:e,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:s="rr-block",blockSelector:i=null,unblockSelector:a=null,ignoreClass:l="rr-ignore",ignoreSelector:u=null,maskAllText:d=!1,maskTextClass:p="rr-mask",unmaskTextClass:h=null,maskTextSelector:g=null,unmaskTextSelector:v=null,inlineStylesheet:b=!0,maskAllInputs:x,maskInputOptions:E,slimDOMOptions:S,maskAttributeFn:k,maskInputFn:T,maskTextFn:R,maxCanvasSize:j=null,packFn:A,sampling:N={},dataURLOptions:M={},mousemoveWait:I,recordDOM:O=!0,recordCanvas:L=!1,recordCrossOriginIframes:z=!1,recordAfter:G=t.recordAfter==="DOMContentLoaded"?t.recordAfter:"load",userTriggeredOnInput:W=!1,collectFonts:X=!1,inlineImages:F=!1,plugins:Y,keepIframeSrcFn:H=()=>!1,ignoreCSSAttributes:te=new Set([]),errorHandler:P,onMutation:re,getCanvasManager:ue}=t;EPe(P);const D=z?window.parent===window:!0;let Z=!1;if(!D)try{window.parent.document&&(Z=!1)}catch{Z=!0}if(D&&!e)throw new Error("emit function is required");if(!D&&!Z)return()=>{};I!==void 0&&N.mousemove===void 0&&(N.mousemove=I),Hi.reset();const he=x===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,radio:!0,checkbox:!0}:E!==void 0?E:{},V=S===!0||S==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:S==="all",headMetaDescKeywords:S==="all"}:S||{};hPe();let U,K=0;const ae=Be=>{for(const pt of Y||[])pt.eventProcessor&&(Be=pt.eventProcessor(Be));return A&&!Z&&(Be=A(Be)),Be};Yn=(Be,pt)=>{const De=Be;if(De.timestamp=Dx(),fb([ef,"access",et=>et[0],"optionalAccess",et=>et.isFrozen,"call",et=>et()])&&De.type!==Ft.FullSnapshot&&!(De.type===Ft.IncrementalSnapshot&&De.data.source===Tt.Mutation)&&ef.forEach(et=>et.unfreeze()),D)fb([e,"optionalCall",et=>et(ae(De),pt)]);else if(Z){const et={type:"rrweb",event:ae(De),origin:window.location.origin,isCheckout:pt};window.parent.postMessage(et,"*")}if(De.type===Ft.FullSnapshot)U=De,K=0;else if(De.type===Ft.IncrementalSnapshot){if(De.data.source===Tt.Mutation&&De.data.isAttachIframe)return;K++;const et=r&&K>=r,ot=n&&U&&De.timestamp-U.timestamp>n;(et||ot)&&dt(!0)}};const B=Be=>{Yn({type:Ft.IncrementalSnapshot,data:{source:Tt.Mutation,...Be}})},J=Be=>Yn({type:Ft.IncrementalSnapshot,data:{source:Tt.Scroll,...Be}}),oe=Be=>Yn({type:Ft.IncrementalSnapshot,data:{source:Tt.CanvasMutation,...Be}}),fe=Be=>Yn({type:Ft.IncrementalSnapshot,data:{source:Tt.AdoptedStyleSheet,...Be}}),be=new BPe({mutationCb:B,adoptedStyleSheetCb:fe}),Ae=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new $Pe:new zPe({mirror:Hi,mutationCb:B,stylesheetManager:be,recordCrossOriginIframes:z,wrappedEmit:Yn});for(const Be of Y||[])Be.getMirror&&Be.getMirror({nodeMirror:Hi,crossOriginIframeMirror:Ae.crossOriginIframeMirror,crossOriginIframeStyleMirror:Ae.crossOriginIframeStyleMirror});const Oe=new qPe,Ne=HPe(ue,{mirror:Hi,win:window,mutationCb:Be=>Yn({type:Ft.IncrementalSnapshot,data:{source:Tt.CanvasMutation,...Be}}),recordCanvas:L,blockClass:s,blockSelector:i,unblockSelector:a,maxCanvasSize:j,sampling:N.canvas,dataURLOptions:M,errorHandler:P}),Qe=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new FPe:new UPe({mutationCb:B,scrollCb:J,bypassOptions:{onMutation:re,blockClass:s,blockSelector:i,unblockSelector:a,maskAllText:d,maskTextClass:p,unmaskTextClass:h,maskTextSelector:g,unmaskTextSelector:v,inlineStylesheet:b,maskInputOptions:he,dataURLOptions:M,maskAttributeFn:k,maskTextFn:R,maskInputFn:T,recordCanvas:L,inlineImages:F,sampling:N,slimDOMOptions:V,iframeManager:Ae,stylesheetManager:be,canvasManager:Ne,keepIframeSrcFn:H,processedNodeManager:Oe},mirror:Hi}),dt=(Be=!1)=>{if(!O)return;Yn({type:Ft.Meta,data:{href:window.location.href,width:dW(),height:uW()}},Be),be.reset(),Qe.init(),ef.forEach(De=>De.lock());const pt=dPe(document,{mirror:Hi,blockClass:s,blockSelector:i,unblockSelector:a,maskAllText:d,maskTextClass:p,unmaskTextClass:h,maskTextSelector:g,unmaskTextSelector:v,inlineStylesheet:b,maskAllInputs:he,maskAttributeFn:k,maskInputFn:T,maskTextFn:R,slimDOM:V,dataURLOptions:M,recordCanvas:L,inlineImages:F,onSerialize:De=>{pW(De,Hi)&&Ae.addIframe(De),mW(De,Hi)&&be.trackLinkElement(De),tA(De)&&Qe.addShadowRoot(De.shadowRoot,document)},onIframeLoad:(De,et)=>{Ae.attachIframe(De,et),De.contentWindow&&Ne.addWindow(De.contentWindow),Qe.observeAttachShadow(De)},onStylesheetLoad:(De,et)=>{be.attachLinkElement(De,et)},keepIframeSrcFn:H});if(!pt)return console.warn("Failed to snapshot the document");Yn({type:Ft.FullSnapshot,data:{node:pt,initialOffset:cW(window)}}),ef.forEach(De=>De.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&be.adoptStyleSheets(document.adoptedStyleSheets,Hi.getId(document))};$x=dt;try{const Be=[],pt=et=>Zt(LPe)({onMutation:re,mutationCb:B,mousemoveCb:(ot,lr)=>Yn({type:Ft.IncrementalSnapshot,data:{source:lr,positions:ot}}),mouseInteractionCb:ot=>Yn({type:Ft.IncrementalSnapshot,data:{source:Tt.MouseInteraction,...ot}}),scrollCb:J,viewportResizeCb:ot=>Yn({type:Ft.IncrementalSnapshot,data:{source:Tt.ViewportResize,...ot}}),inputCb:ot=>Yn({type:Ft.IncrementalSnapshot,data:{source:Tt.Input,...ot}}),mediaInteractionCb:ot=>Yn({type:Ft.IncrementalSnapshot,data:{source:Tt.MediaInteraction,...ot}}),styleSheetRuleCb:ot=>Yn({type:Ft.IncrementalSnapshot,data:{source:Tt.StyleSheetRule,...ot}}),styleDeclarationCb:ot=>Yn({type:Ft.IncrementalSnapshot,data:{source:Tt.StyleDeclaration,...ot}}),canvasMutationCb:oe,fontCb:ot=>Yn({type:Ft.IncrementalSnapshot,data:{source:Tt.Font,...ot}}),selectionCb:ot=>{Yn({type:Ft.IncrementalSnapshot,data:{source:Tt.Selection,...ot}})},customElementCb:ot=>{Yn({type:Ft.IncrementalSnapshot,data:{source:Tt.CustomElement,...ot}})},blockClass:s,ignoreClass:l,ignoreSelector:u,maskAllText:d,maskTextClass:p,unmaskTextClass:h,maskTextSelector:g,unmaskTextSelector:v,maskInputOptions:he,inlineStylesheet:b,sampling:N,recordDOM:O,recordCanvas:L,inlineImages:F,userTriggeredOnInput:W,collectFonts:X,doc:et,maskAttributeFn:k,maskInputFn:T,maskTextFn:R,keepIframeSrcFn:H,blockSelector:i,unblockSelector:a,slimDOMOptions:V,dataURLOptions:M,mirror:Hi,iframeManager:Ae,stylesheetManager:be,shadowDomManager:Qe,processedNodeManager:Oe,canvasManager:Ne,ignoreCSSAttributes:te,plugins:fb([Y,"optionalAccess",ot=>ot.filter,"call",ot=>ot(lr=>lr.observer),"optionalAccess",ot=>ot.map,"call",ot=>ot(lr=>({observer:lr.observer,options:lr.options,callback:xe=>Yn({type:Ft.Plugin,data:{plugin:lr.name,payload:xe}})}))])||[]},{});Ae.addLoadListener(et=>{try{Be.push(pt(et.contentDocument))}catch(ot){console.warn(ot)}});const De=()=>{dt(),Be.push(pt(document))};return document.readyState==="interactive"||document.readyState==="complete"?De():(Be.push(hs("DOMContentLoaded",()=>{Yn({type:Ft.DomContentLoaded,data:{}}),G==="DOMContentLoaded"&&De()})),Be.push(hs("load",()=>{Yn({type:Ft.Load,data:{}}),G==="load"&&De()},window))),()=>{Be.forEach(et=>et()),Oe.destroy(),$x=void 0,kPe()}}catch(Be){console.warn(Be)}}function VPe(t){if(!$x)throw new Error("please take full snapshot after start recording");$x(t)}Ro.mirror=Hi;Ro.takeFullSnapshot=VPe;function HPe(t,e){try{return t?t(e):new hz}catch{return console.warn("Unable to initialize CanvasManager"),new hz}}const GPe=3,WPe=5;function jj(t){return t>9999999999?t:t*1e3}function tk(t){return t>9999999999?t/1e3:t}function zg(t,e){e.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(e.category)?t.triggerUserActivity():t.checkAndHandleExpiredSession(),t.addUpdate(()=>(t.throttledAddEvent({type:Ft.Custom,timestamp:(e.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:Ki(e,10,1e3)}}),e.category==="console")))}const YPe="button,a";function wW(t){return t.closest(YPe)||t}function SW(t){const e=EW(t);return!e||!(e instanceof Element)?e:wW(e)}function EW(t){return KPe(t)?t.target:t}function KPe(t){return typeof t=="object"&&!!t&&"target"in t}let Ol;function XPe(t){return Ol||(Ol=[],QPe()),Ol.push(t),()=>{const e=Ol?Ol.indexOf(t):-1;e>-1&&Ol.splice(e,1)}}function QPe(){Is(kn,"open",function(t){return function(...e){if(Ol)try{Ol.forEach(n=>n())}catch{}return t.apply(kn,e)}})}const JPe=new Set([Tt.Mutation,Tt.StyleSheetRule,Tt.StyleDeclaration,Tt.AdoptedStyleSheet,Tt.CanvasMutation,Tt.Selection,Tt.MediaInteraction]);function ZPe(t,e,n){t.handleClick(e,n)}class eIe{constructor(e,n,r=zg){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=n.timeout/1e3,this._threshold=n.threshold/1e3,this._scrollTimeout=n.scrollTimeout/1e3,this._replay=e,this._ignoreSelector=n.ignoreSelector,this._addBreadcrumbEvent=r}addListeners(){const e=XPe(()=>{this._lastMutation=pz()});this._teardown=()=>{e(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(e,n){if(nIe(n,this._ignoreSelector)||!rIe(e))return;const r={timestamp:tk(e.timestamp),clickBreadcrumb:e,clickCount:0,node:n};this._clicks.some(s=>s.node===r.node&&Math.abs(s.timestamp-r.timestamp)<1)||(this._clicks.push(r),this._clicks.length===1&&this._scheduleCheckClicks())}registerMutation(e=Date.now()){this._lastMutation=tk(e)}registerScroll(e=Date.now()){this._lastScroll=tk(e)}registerClick(e){const n=wW(e);this._handleMultiClick(n)}_handleMultiClick(e){this._getClicks(e).forEach(n=>{n.clickCount++})}_getClicks(e){return this._clicks.filter(n=>n.node===e)}_checkClicks(){const e=[],n=pz();this._clicks.forEach(r=>{!r.mutationAfter&&this._lastMutation&&(r.mutationAfter=r.timestamp<=this._lastMutation?this._lastMutation-r.timestamp:void 0),!r.scrollAfter&&this._lastScroll&&(r.scrollAfter=r.timestamp<=this._lastScroll?this._lastScroll-r.timestamp:void 0),r.timestamp+this._timeout<=n&&e.push(r)});for(const r of e){const s=this._clicks.indexOf(r);s>-1&&(this._generateBreadcrumbs(r),this._clicks.splice(s,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(e){const n=this._replay,r=e.scrollAfter&&e.scrollAfter<=this._scrollTimeout,s=e.mutationAfter&&e.mutationAfter<=this._threshold,i=!r&&!s,{clickCount:a,clickBreadcrumb:l}=e;if(i){const u=Math.min(e.mutationAfter||this._timeout,this._timeout)*1e3,d=u<this._timeout*1e3?"mutation":"timeout",p={type:"default",message:l.message,timestamp:l.timestamp,category:"ui.slowClickDetected",data:{...l.data,url:kn.location.href,route:n.getCurrentRoute(),timeAfterClickMs:u,endReason:d,clickCount:a||1}};this._addBreadcrumbEvent(n,p);return}if(a>1){const u={type:"default",message:l.message,timestamp:l.timestamp,category:"ui.multiClick",data:{...l.data,url:kn.location.href,route:n.getCurrentRoute(),clickCount:a,metric:!0}};this._addBreadcrumbEvent(n,u)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=Ff(()=>this._checkClicks(),1e3)}}const tIe=["A","BUTTON","INPUT"];function nIe(t,e){return!!(!tIe.includes(t.tagName)||t.tagName==="INPUT"&&!["submit","button"].includes(t.getAttribute("type")||"")||t.tagName==="A"&&(t.hasAttribute("download")||t.hasAttribute("target")&&t.getAttribute("target")!=="_self")||e&&t.matches(e))}function rIe(t){return!!(t.data&&typeof t.data.nodeId=="number"&&t.timestamp)}function pz(){return Date.now()/1e3}function sIe(t,e){try{if(!iIe(e))return;const{source:n}=e.data;if(JPe.has(n)&&t.registerMutation(e.timestamp),n===Tt.Scroll&&t.registerScroll(e.timestamp),aIe(e)){const{type:r,id:s}=e.data,i=Ro.mirror.getNode(s);i instanceof HTMLElement&&r===ds.Click&&t.registerClick(i)}}catch{}}function iIe(t){return t.type===GPe}function aIe(t){return t.data.source===Tt.MouseInteraction}function Ra(t){return{timestamp:Date.now()/1e3,type:"default",...t}}var zx;(function(t){t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment"})(zx||(zx={}));const oIe=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function lIe(t){const e={};!t["data-sentry-component"]&&t["data-sentry-element"]&&(t["data-sentry-component"]=t["data-sentry-element"]);for(const n in t)if(oIe.has(n)){let r=n;(n==="data-testid"||n==="data-test-id")&&(r="testId"),e[r]=t[n]}return e}const cIe=t=>e=>{if(!t.isEnabled())return;const n=uIe(e);if(!n)return;const r=e.name==="click",s=r?e.event:void 0;r&&t.clickDetector&&s&&s.target&&!s.altKey&&!s.metaKey&&!s.ctrlKey&&!s.shiftKey&&ZPe(t.clickDetector,n,SW(e.event)),zg(t,n)};function kW(t,e){const n=Ro.mirror.getId(t),r=n&&Ro.mirror.getNode(n),s=r&&Ro.mirror.getMeta(r),i=s&&fIe(s)?s:null;return{message:e,data:i?{nodeId:n,node:{id:n,tagName:i.tagName,textContent:Array.from(i.childNodes).map(a=>a.type===zx.Text&&a.textContent).filter(Boolean).map(a=>a.trim()).join(""),attributes:lIe(i.attributes)}}:{}}}function uIe(t){const{target:e,message:n}=dIe(t);return Ra({category:`ui.${t.name}`,...kW(e,n)})}function dIe(t){const e=t.name==="click";let n,r=null;try{r=e?SW(t.event):EW(t.event),n=Uo(r,{maxStringLength:200})||"<unknown>"}catch{n="<unknown>"}return{target:r,message:n}}function fIe(t){return t.type===zx.Element}function hIe(t,e){if(!t.isEnabled())return;t.updateUserActivity();const n=pIe(e);n&&zg(t,n)}function pIe(t){const{metaKey:e,shiftKey:n,ctrlKey:r,altKey:s,key:i,target:a}=t;if(!a||mIe(a)||!i)return null;const l=e||r||s,u=i.length===1;if(!l&&u)return null;const d=Uo(a,{maxStringLength:200})||"<unknown>",p=kW(a,d);return Ra({category:"ui.keyDown",message:d,data:{...p.data,metaKey:e,shiftKey:n,ctrlKey:r,altKey:s,key:i}})}function mIe(t){return t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable}const gIe={resource:_Ie,paint:bIe,navigation:xIe};function By(t,e){return({metric:n})=>void e.replayPerformanceEntries.push(t(n))}function vIe(t){return t.map(yIe).filter(Boolean)}function yIe(t){const e=gIe[t.entryType];return e?e(t):null}function qf(t){return((vs||kn.performance.timeOrigin)+t)/1e3}function bIe(t){const{duration:e,entryType:n,name:r,startTime:s}=t,i=qf(s);return{type:n,name:r,start:i,end:i+e,data:void 0}}function xIe(t){const{entryType:e,name:n,decodedBodySize:r,duration:s,domComplete:i,encodedBodySize:a,domContentLoadedEventStart:l,domContentLoadedEventEnd:u,domInteractive:d,loadEventStart:p,loadEventEnd:h,redirectCount:g,startTime:v,transferSize:b,type:x}=t;return s===0?null:{type:`${e}.${x}`,start:qf(v),end:qf(i),name:n,data:{size:b,decodedBodySize:r,encodedBodySize:a,duration:s,domInteractive:d,domContentLoadedEventStart:l,domContentLoadedEventEnd:u,loadEventStart:p,loadEventEnd:h,domComplete:i,redirectCount:g}}}function _Ie(t){const{entryType:e,initiatorType:n,name:r,responseEnd:s,startTime:i,decodedBodySize:a,encodedBodySize:l,responseStatus:u,transferSize:d}=t;return["fetch","xmlhttprequest"].includes(n)?null:{type:`${e}.${n}`,start:qf(i),end:qf(s),name:r,data:{size:d,statusCode:u,decodedBodySize:a,encodedBodySize:l}}}function wIe(t){const e=t.entries[t.entries.length-1],n=e&&e.element?[e.element]:void 0;return i_(t,"largest-contentful-paint",n)}function SIe(t){return t.sources!==void 0}function EIe(t){const e=[],n=[];for(const r of t.entries)if(SIe(r)){const s=[];for(const i of r.sources)if(i.node){n.push(i.node);const a=Ro.mirror.getId(i.node);a&&s.push(a)}e.push({value:r.value,nodeIds:s.length?s:void 0})}return i_(t,"cumulative-layout-shift",n,e)}function kIe(t){const e=t.entries[t.entries.length-1],n=e&&e.target?[e.target]:void 0;return i_(t,"first-input-delay",n)}function TIe(t){const e=t.entries[t.entries.length-1],n=e&&e.target?[e.target]:void 0;return i_(t,"interaction-to-next-paint",n)}function i_(t,e,n,r){const s=t.value,i=t.rating,a=qf(s);return{type:"web-vital",name:e,start:a,end:a,data:{value:s,size:s,rating:i,nodeIds:n?n.map(l=>Ro.mirror.getId(l)):void 0,attributions:r}}}function CIe(t){function e(s){t.performanceEntries.includes(s)||t.performanceEntries.push(s)}function n({entries:s}){s.forEach(e)}const r=[];return["navigation","paint","resource"].forEach(s=>{r.push(zf(s,n))}),r.push(BG(By(wIe,t)),_j(By(EIe,t)),qG(By(kIe,t)),VG(By(TIe,t))),()=>{r.forEach(s=>s())}}const yt=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,AIe='var t=Uint8Array,n=Uint16Array,r=Int32Array,e=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),a=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=function(t,e){for(var i=new n(31),a=0;a<31;++a)i[a]=e+=1<<t[a-1];var s=new r(i[30]);for(a=1;a<30;++a)for(var o=i[a];o<i[a+1];++o)s[o]=o-i[a]<<5|a;return{b:i,r:s}},o=s(e,2),f=o.b,h=o.r;f[28]=258,h[258]=28;for(var l=s(i,0).r,u=new n(32768),c=0;c<32768;++c){var v=(43690&c)>>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,u[c]=((65280&v)>>8|(255&v)<<8)>>1}var d=function(t,r,e){for(var i=t.length,a=0,s=new n(r);a<i;++a)t[a]&&++s[t[a]-1];var o,f=new n(r);for(a=1;a<r;++a)f[a]=f[a-1]+s[a-1]<<1;if(e){o=new n(1<<r);var h=15-r;for(a=0;a<i;++a)if(t[a])for(var l=a<<4|t[a],c=r-t[a],v=f[t[a]-1]++<<c,d=v|(1<<c)-1;v<=d;++v)o[u[v]>>h]=l}else for(o=new n(i),a=0;a<i;++a)t[a]&&(o[a]=u[f[t[a]-1]++]>>15-t[a]);return o},g=new t(288);for(c=0;c<144;++c)g[c]=8;for(c=144;c<256;++c)g[c]=9;for(c=256;c<280;++c)g[c]=7;for(c=280;c<288;++c)g[c]=8;var w=new t(32);for(c=0;c<32;++c)w[c]=5;var p=d(g,9,0),y=d(w,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(null==e||e>n.length)&&(e=n.length),new t(n.subarray(r,e))},M=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],E=function(t,n,r){var e=new Error(n||M[t]);if(e.code=t,Error.captureStackTrace&&Error.captureStackTrace(e,E),!r)throw e;return e},z=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8},_=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8,t[e+2]|=r>>16},x=function(r,e){for(var i=[],a=0;a<r.length;++a)r[a]&&i.push({s:a,f:r[a]});var s=i.length,o=i.slice();if(!s)return{t:F,l:0};if(1==s){var f=new t(i[0].s+1);return f[i[0].s]=1,{t:f,l:1}}i.sort((function(t,n){return t.f-n.f})),i.push({s:-1,f:25001});var h=i[0],l=i[1],u=0,c=1,v=2;for(i[0]={s:-1,f:h.f+l.f,l:h,r:l};c!=s-1;)h=i[i[u].f<i[v].f?u++:v++],l=i[u!=c&&i[u].f<i[v].f?u++:v++],i[c++]={s:-1,f:h.f+l.f,l:h,r:l};var d=o[0].s;for(a=1;a<s;++a)o[a].s>d&&(d=o[a].s);var g=new n(d+1),w=A(i[c-1],g,0);if(w>e){a=0;var p=0,y=w-e,m=1<<y;for(o.sort((function(t,n){return g[n.s]-g[t.s]||t.f-n.f}));a<s;++a){var b=o[a].s;if(!(g[b]>e))break;p+=m-(1<<w-g[b]),g[b]=e}for(p>>=y;p>0;){var M=o[a].s;g[M]<e?p-=1<<e-g[M]++-1:++a}for(;a>=0&&p;--a){var E=o[a].s;g[E]==e&&(--g[E],++p)}w=e}return{t:new t(g),l:w}},A=function(t,n,r){return-1==t.s?Math.max(A(t.l,n,r+1),A(t.r,n,r+1)):n[t.s]=r},D=function(t){for(var r=t.length;r&&!t[--r];);for(var e=new n(++r),i=0,a=t[0],s=1,o=function(t){e[i++]=t},f=1;f<=r;++f)if(t[f]==a&&f!=r)++s;else{if(!a&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(a),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(a);s=1,a=t[f]}return{c:e.subarray(0,i),n:r}},T=function(t,n){for(var r=0,e=0;e<n.length;++e)r+=t[e]*n[e];return r},k=function(t,n,r){var e=r.length,i=m(n+2);t[i]=255&e,t[i+1]=e>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var a=0;a<e;++a)t[i+a+4]=r[a];return 8*(i+4+e)},U=function(t,r,s,o,f,h,l,u,c,v,m){z(r,m++,s),++f[256];for(var b=x(f,15),M=b.t,E=b.l,A=x(h,15),U=A.t,C=A.l,F=D(M),I=F.c,S=F.n,L=D(U),O=L.c,j=L.n,q=new n(19),B=0;B<I.length;++B)++q[31&I[B]];for(B=0;B<O.length;++B)++q[31&O[B]];for(var G=x(q,7),H=G.t,J=G.l,K=19;K>4&&!H[a[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(f,g)+T(h,w)+l,X=T(f,M)+T(h,U)+l+14+3*K+T(q,H)+2*q[16]+3*q[17]+7*q[18];if(c>=0&&V<=W&&V<=X)return k(r,m,t.subarray(c,c+v));if(z(r,m,1+(X<W)),m+=2,X<W){N=d(M,E,0),P=M,Q=d(U,C,0),R=U;var Y=d(H,J,0);z(r,m,S-257),z(r,m+5,j-1),z(r,m+10,K-4),m+=14;for(B=0;B<K;++B)z(r,m+3*B,H[a[B]]);m+=3*K;for(var Z=[I,O],$=0;$<2;++$){var tt=Z[$];for(B=0;B<tt.length;++B){var nt=31&tt[B];z(r,m,Y[nt]),m+=H[nt],nt>15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=p,P=g,Q=y,R=w;for(B=0;B<u;++B){var rt=o[B];if(rt>255){_(r,m,N[(nt=rt>>18&31)+257]),m+=P[nt+257],nt>7&&(z(r,m,rt>>23&31),m+=e[nt]);var et=31&rt;_(r,m,Q[et]),m+=R[et],et>3&&(_(r,m,rt>>5&8191),m+=i[et])}else _(r,m,N[rt]),m+=P[rt]}return _(r,m,N[256]),m+P[256]},C=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F=new t(0),I=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var r=n,e=9;--e;)r=(1&r&&-306674912)^r>>>1;t[n]=r}return t}(),S=function(){var t=-1;return{p:function(n){for(var r=t,e=0;e<n.length;++e)r=I[255&r^n[e]]^r>>>8;t=r},d:function(){return~t}}},L=function(){var t=1,n=0;return{p:function(r){for(var e=t,i=n,a=0|r.length,s=0;s!=a;){for(var o=Math.min(s+2655,a);s<o;++s)i+=e+=r[s];e=(65535&e)+15*(e>>16),i=(65535&i)+15*(i>>16)}t=e,n=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},O=function(a,s,o,f,u){if(!u&&(u={l:1},s.dictionary)){var c=s.dictionary.subarray(-32768),v=new t(c.length+a.length);v.set(c),v.set(a,c.length),a=v,u.w=c.length}return function(a,s,o,f,u,c){var v=c.z||a.length,d=new t(f+v+5*(1+Math.ceil(v/7e3))+u),g=d.subarray(f,d.length-u),w=c.l,p=7&(c.r||0);if(s){p&&(g[0]=c.r>>3);for(var y=C[s-1],M=y>>13,E=8191&y,z=(1<<o)-1,_=c.p||new n(32768),x=c.h||new n(z+1),A=Math.ceil(o/3),D=2*A,T=function(t){return(a[t]^a[t+1]<<A^a[t+2]<<D)&z},F=new r(25e3),I=new n(288),S=new n(32),L=0,O=0,j=c.i||0,q=0,B=c.w||0,G=0;j+2<v;++j){var H=T(j),J=32767&j,K=x[H];if(_[J]=K,x[H]=J,B<=j){var N=v-j;if((L>7e3||q>24576)&&(N>423||!w)){p=U(a,g,0,F,I,S,O,q,G,j-G,p),q=L=O=0,G=j;for(var P=0;P<286;++P)I[P]=0;for(P=0;P<30;++P)S[P]=0}var Q=2,R=0,V=E,W=J-K&32767;if(N>2&&H==T(j-W))for(var X=Math.min(M,N)-1,Y=Math.min(32767,j),Z=Math.min(258,N);W<=Y&&--V&&J!=K;){if(a[j+Q]==a[j+Q-W]){for(var $=0;$<Z&&a[j+$]==a[j+$-W];++$);if($>Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;P<tt;++P){var rt=j-W+P&32767,et=rt-_[rt]&32767;et>nt&&(nt=et,K=rt)}}}W+=(J=K)-(K=_[J])&32767}if(R){F[q++]=268435456|h[Q]<<18|l[R];var it=31&h[Q],at=31&l[R];O+=e[it]+i[at],++I[257+it],++S[at],B=j+Q,++L}else F[q++]=a[j],++I[a[j]]}}for(j=Math.max(j,B);j<v;++j)F[q++]=a[j],++I[a[j]];p=U(a,g,w,F,I,S,O,q,G,j-G,p),w||(c.r=7&p|g[p/8|0]<<3,p-=7,c.h=x,c.p=_,c.i=j,c.w=B)}else{for(j=c.w||0;j<v+w;j+=65535){var st=j+65535;st>=v&&(g[p/8|0]=w,st=v),p=k(g,p+1,a.subarray(j,st))}c.i=v}return b(d,0,f+m(p)+u)}(a,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(a.length)))):12+s.mem,o,f,u)},j=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8},q=function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&j(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var e=0;e<=r.length;++e)t[e+10]=r.charCodeAt(e)}},B=function(t){return 10+(t.filename?t.filename.length+1:0)},G=function(){function n(n,r){if("function"==typeof n&&(r=n,n={}),this.ondata=r,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return n.prototype.p=function(t,n){this.ondata(O(t,this.o,0,0,this.s),n)},n.prototype.push=function(n,r){this.ondata||E(5),this.s.l&&E(4);var e=n.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new t(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i}var a=this.b.length-this.s.z;a&&(this.b.set(n.subarray(0,a),this.s.z),this.s.z=this.b.length,this.p(this.b,!1)),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(a),32768),this.s.z=n.length-a+32768,this.s.i=32766,this.s.w=32768}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2)},n}();var H=function(){function t(t,n){this.c=L(),this.v=1,G.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),G.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var r=O(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(function(t,n){var r=n.level,e=0==r?0:r<6?1:9==r?3:2;if(t[0]=120,t[1]=e<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var i=L();i.p(n.dictionary),j(t,2,i.d())}}(r,this.o),this.v=0),n&&j(r,r.length-4,this.c.d()),this.ondata(r,n)},t}(),J="undefined"!=typeof TextEncoder&&new TextEncoder,K="undefined"!=typeof TextDecoder&&new TextDecoder;try{K.decode(F,{stream:!0})}catch(t){}var N=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(P(t),this.d=n||!1)},t}();function P(n,r){if(J)return J.encode(n);for(var e=n.length,i=new t(n.length+(n.length>>1)),a=0,s=function(t){i[a++]=t},o=0;o<e;++o){if(a+5>i.length){var f=new t(a+8+(e-o<<1));f.set(i),i=f}var h=n.charCodeAt(o);h<128||r?s(h):h<2048?(s(192|h>>6),s(128|63&h)):h>55295&&h<57344?(s(240|(h=65536+(1047552&h)|1023&n.charCodeAt(++o))>>18),s(128|h>>12&63),s(128|h>>6&63),s(128|63&h)):(s(224|h>>12),s(128|h>>6&63),s(128|63&h))}return b(i,0,a)}function Q(t){return function(t,n){n||(n={});var r=S(),e=t.length;r.p(t);var i=O(t,n,B(n),8),a=i.length;return q(i,n),j(i,a-8,r.d()),j(i,a-4,e),i}(P(t))}const R=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const n=this._hasEvents?",":"";this.stream.push(n+t),this._hasEvents=!0}finish(){this.stream.push("]",!0);const t=function(t){let n=0;for(const r of t)n+=r.length;const r=new Uint8Array(n);for(let n=0,e=0,i=t.length;n<i;n++){const i=t[n];r.set(i,e),e+=i.length}return r}(this._deflatedData);return this._init(),t}_init(){this._hasEvents=!1,this._deflatedData=[],this.deflate=new H,this.deflate.ondata=(t,n)=>{this._deflatedData.push(t)},this.stream=new N(((t,n)=>{this.deflate.push(t,n)})),this.stream.push("[")}},V={clear:()=>{R.clear()},addEvent:t=>R.addEvent(t),finish:()=>R.finish(),compress:t=>Q(t)};addEventListener("message",(function(t){const n=t.data.method,r=t.data.id,e=t.data.arg;if(n in V&&"function"==typeof V[n])try{const t=V[n](e);postMessage({id:r,method:n,success:!0,response:t})}catch(t){postMessage({id:r,method:n,success:!1,response:t.message}),console.error(t)}})),postMessage({id:void 0,method:"init",success:!0,response:void 0});';function NIe(){const t=new Blob([AIe]);return URL.createObjectURL(t)}const mz=["info","warn","error","log"],mb="[Replay] ";function nk(t,e="info"){nc({category:"console",data:{logger:"replay"},level:e,message:`${mb}${t}`},{level:e})}function RIe(){let t=!1,e=!1;const n={exception:()=>{},infoTick:()=>{},setConfig:r=>{t=r.captureExceptions,e=r.traceInternals}};return yt?(mz.forEach(r=>{n[r]=(...s)=>{ze[r](mb,...s),e&&nk(s.join(""),TG(r))}}),n.exception=(r,...s)=>{s.length&&n.error&&n.error(...s),ze.error(mb,r),t?pG(r):e&&nk(r,"error")},n.infoTick=(...r)=>{ze.info(mb,...r),e&&setTimeout(()=>nk(r[0]),0)}):mz.forEach(r=>{n[r]=()=>{}}),n}const St=RIe();class Mj extends Error{constructor(){super(`Event buffer exceeded maximum size of ${kj}.`)}}class TW{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return"sync"}destroy(){this.events=[]}async addEvent(e){const n=JSON.stringify(e).length;if(this._totalSize+=n,this._totalSize>kj)throw new Mj;this.events.push(e)}finish(){return new Promise(e=>{const n=this.events;this.clear(),e(JSON.stringify(n))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){const e=this.events.map(n=>n.timestamp).sort()[0];return e?jj(e):null}}class jIe{constructor(e){this._worker=e,this._id=0}ensureReady(){return this._ensureReadyPromise?this._ensureReadyPromise:(this._ensureReadyPromise=new Promise((e,n)=>{this._worker.addEventListener("message",({data:r})=>{r.success?e():n()},{once:!0}),this._worker.addEventListener("error",r=>{n(r)},{once:!0})}),this._ensureReadyPromise)}destroy(){yt&&St.info("Destroying compression worker"),this._worker.terminate()}postMessage(e,n){const r=this._getAndIncrementId();return new Promise((s,i)=>{const a=({data:l})=>{const u=l;if(u.method===e&&u.id===r){if(this._worker.removeEventListener("message",a),!u.success){yt&&St.error("Error in compression worker: ",u.response),i(new Error("Error in compression worker"));return}s(u.response)}};this._worker.addEventListener("message",a),this._worker.postMessage({id:r,method:e,arg:n})})}_getAndIncrementId(){return this._id++}}class MIe{constructor(e){this._worker=new jIe(e),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return"worker"}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(e){const n=jj(e.timestamp);(!this._earliestTimestamp||n<this._earliestTimestamp)&&(this._earliestTimestamp=n);const r=JSON.stringify(e);return this._totalSize+=r.length,this._totalSize>kj?Promise.reject(new Mj):this._sendEventToWorker(r)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,e=>{yt&&St.exception(e,'Sending "clear" message to worker failed',e)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(e){return this._worker.postMessage("addEvent",e)}async _finishRequest(){const e=await this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,e}}class OIe{constructor(e){this._fallback=new TW,this._compression=new MIe(e),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=this._ensureWorkerIsLoaded()}get waitForCheckout(){return this._used.waitForCheckout}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(e){this._used.hasCheckout=e}set waitForCheckout(e){this._used.waitForCheckout=e}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(e){return this._used.addEvent(e)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch(e){yt&&St.exception(e,"Failed to load the compression worker, falling back to simple buffer");return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){const{events:e,hasCheckout:n,waitForCheckout:r}=this._fallback,s=[];for(const i of e)s.push(this._compression.addEvent(i));this._compression.hasCheckout=n,this._compression.waitForCheckout=r,this._used=this._compression;try{await Promise.all(s),this._fallback.clear()}catch(i){yt&&St.exception(i,"Failed to add events when switching buffers.")}}}function PIe({useCompression:t,workerUrl:e}){if(t&&window.Worker){const n=IIe(e);if(n)return n}return yt&&St.info("Using simple buffer"),new TW}function IIe(t){try{const e=t||DIe();if(!e)return;yt&&St.info(`Using compression worker${t?` from ${t}`:""}`);const n=new Worker(e);return new OIe(n)}catch(e){yt&&St.exception(e,"Failed to create compression worker")}}function DIe(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>"u"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?NIe():""}function Oj(){try{return"sessionStorage"in kn&&!!kn.sessionStorage}catch{return!1}}function LIe(t){$Ie(),t.session=void 0}function $Ie(){if(Oj())try{kn.sessionStorage.removeItem(Sj)}catch{}}function CW(t){return t===void 0?!1:Math.random()<t}function AW(t){const e=Date.now(),n=t.id||ii(),r=t.started||e,s=t.lastActivity||e,i=t.segmentId||0,a=t.sampled,l=t.previousSessionId;return{id:n,started:r,lastActivity:s,segmentId:i,sampled:a,previousSessionId:l}}function Pj(t){if(Oj())try{kn.sessionStorage.setItem(Sj,JSON.stringify(t))}catch{}}function zIe(t,e){return CW(t)?"session":e?"buffer":!1}function gz({sessionSampleRate:t,allowBuffering:e,stickySession:n=!1},{previousSessionId:r}={}){const s=zIe(t,e),i=AW({sampled:s,previousSessionId:r});return n&&Pj(i),i}function FIe(){if(!Oj())return null;try{const t=kn.sessionStorage.getItem(Sj);if(!t)return null;const e=JSON.parse(t);return yt&&St.infoTick("Loading existing session"),AW(e)}catch{return null}}function sA(t,e,n=+new Date){return t===null||e===void 0||e<0?!0:e===0?!1:t+e<=n}function NW(t,{maxReplayDuration:e,sessionIdleExpire:n,targetTime:r=Date.now()}){return sA(t.started,e,r)||sA(t.lastActivity,n,r)}function RW(t,{sessionIdleExpire:e,maxReplayDuration:n}){return!(!NW(t,{sessionIdleExpire:e,maxReplayDuration:n})||t.sampled==="buffer"&&t.segmentId===0)}function rk({sessionIdleExpire:t,maxReplayDuration:e,previousSessionId:n},r){const s=r.stickySession&&FIe();return s?RW(s,{sessionIdleExpire:t,maxReplayDuration:e})?(yt&&St.infoTick("Session in sessionStorage is expired, creating new one..."),gz(r,{previousSessionId:s.id})):s:(yt&&St.infoTick("Creating new session"),gz(r,{previousSessionId:n}))}function UIe(t){return t.type===Ft.Custom}function Ij(t,e,n){return MW(t,e)?(jW(t,e,n),!0):!1}function BIe(t,e,n){return MW(t,e)?jW(t,e,n):Promise.resolve(null)}async function jW(t,e,n){const{eventBuffer:r}=t;if(!r||r.waitForCheckout&&!n)return null;const s=t.recordingMode==="buffer";try{n&&s&&r.clear(),n&&(r.hasCheckout=!0,r.waitForCheckout=!1);const i=t.getOptions(),a=qIe(e,i.beforeAddRecordingEvent);return a?await r.addEvent(a):void 0}catch(i){const a=i&&i instanceof Mj,l=a?"addEventSizeExceeded":"addEvent";if(a&&s)return r.clear(),r.waitForCheckout=!0,null;t.handleException(i),await t.stop({reason:l});const u=Yt();u&&u.recordDroppedEvent("internal_sdk_error","replay")}}function MW(t,e){if(!t.eventBuffer||t.isPaused()||!t.isEnabled())return!1;const n=jj(e.timestamp);return n+t.timeouts.sessionIdlePause<Date.now()?!1:n>t.getContext().initialTimestamp+t.getOptions().maxReplayDuration?(yt&&St.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),!1):!0}function qIe(t,e){try{if(typeof e=="function"&&UIe(t))return e(t)}catch(n){return yt&&St.exception(n,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return t}function Dj(t){return!t.type}function iA(t){return t.type==="transaction"}function VIe(t){return t.type==="replay_event"}function vz(t){return t.type==="feedback"}function HIe(t){return(e,n)=>{if(!t.isEnabled()||!Dj(e)&&!iA(e))return;const r=n&&n.statusCode;if(!(!r||r<200||r>=300)){if(iA(e)){GIe(t,e);return}WIe(t,e)}}}function GIe(t,e){const n=t.getContext();e.contexts&&e.contexts.trace&&e.contexts.trace.trace_id&&n.traceIds.size<100&&n.traceIds.add(e.contexts.trace.trace_id)}function WIe(t,e){const n=t.getContext();if(e.event_id&&n.errorIds.size<100&&n.errorIds.add(e.event_id),t.recordingMode!=="buffer"||!e.tags||!e.tags.replayId)return;const{beforeErrorSampling:r}=t.getOptions();typeof r=="function"&&!r(e)||Ff(async()=>{try{await t.sendBufferedReplayOrFlush()}catch(s){t.handleException(s)}})}function YIe(t){return e=>{!t.isEnabled()||!Dj(e)||KIe(t,e)}}function KIe(t,e){const n=e.exception&&e.exception.values&&e.exception.values[0]&&e.exception.values[0].value;if(typeof n=="string"&&(n.match(/(reactjs\.org\/docs\/error-decoder\.html\?invariant=|react\.dev\/errors\/)(418|419|422|423|425)/)||n.match(/(does not match server-rendered HTML|Hydration failed because)/i))){const r=Ra({category:"replay.hydrate-error",data:{url:$7()}});zg(t,r)}}function XIe(t){const e=Yt();e&&e.on("beforeAddBreadcrumb",n=>QIe(t,n))}function QIe(t,e){if(!t.isEnabled()||!OW(e))return;const n=JIe(e);n&&zg(t,n)}function JIe(t){return!OW(t)||["fetch","xhr","sentry.event","sentry.transaction"].includes(t.category)||t.category.startsWith("ui.")?null:t.category==="console"?ZIe(t):Ra(t)}function ZIe(t){const e=t.data&&t.data.arguments;if(!Array.isArray(e)||e.length===0)return Ra(t);let n=!1;const r=e.map(s=>{if(!s)return s;if(typeof s=="string")return s.length>zy?(n=!0,`${s.slice(0,zy)}…`):s;if(typeof s=="object")try{const i=Ki(s,7);return JSON.stringify(i).length>zy?(n=!0,`${JSON.stringify(i,null,2).slice(0,zy)}…`):i}catch{}return s});return Ra({...t,data:{...t.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}function OW(t){return!!t.category}function eDe(t,e){return t.type||!t.exception||!t.exception.values||!t.exception.values.length?!1:!!(e.originalException&&e.originalException.__rrweb__)}function PW(){const t=An().getPropagationContext().dsc;t&&delete t.replay_id;const e=$r();if(e){const n=Ou(e);delete n.replay_id}}function tDe(t,e){t.triggerUserActivity(),t.addUpdate(()=>e.timestamp?(t.throttledAddEvent({type:Ft.Custom,timestamp:e.timestamp*1e3,data:{tag:"breadcrumb",payload:{timestamp:e.timestamp,type:"default",category:"sentry.feedback",data:{feedbackId:e.event_id}}}}),!1):!0)}function nDe(t,e){return t.recordingMode!=="buffer"||e.message===Ej||!e.exception||e.type?!1:CW(t.getOptions().errorSampleRate)}function rDe(t){return Object.assign((e,n)=>!t.isEnabled()||t.isPaused()?e:VIe(e)?(delete e.breadcrumbs,e):!Dj(e)&&!iA(e)&&!vz(e)?e:t.checkAndHandleExpiredSession()?vz(e)?(t.flush(),e.contexts.feedback.replay_id=t.getSessionId(),tDe(t,e),e):eDe(e,n)&&!t.getOptions()._experiments.captureExceptions?(yt&&St.log("Ignoring error from rrweb internals",e),null):((nDe(t,e)||t.recordingMode==="session")&&(e.tags={...e.tags,replayId:t.getSessionId()}),e):(PW(),e),{id:"Replay"})}function a_(t,e){return e.map(({type:n,start:r,end:s,name:i,data:a})=>{const l=t.throttledAddEvent({type:Ft.Custom,timestamp:r,data:{tag:"performanceSpan",payload:{op:n,description:i,startTimestamp:r,endTimestamp:s,data:a}}});return typeof l=="string"?Promise.resolve(null):l})}function sDe(t){const{from:e,to:n}=t,r=Date.now()/1e3;return{type:"navigation.push",start:r,end:r,name:n,data:{previous:e}}}function iDe(t){return e=>{if(!t.isEnabled())return;const n=sDe(e);n!==null&&(t.getContext().urls.push(n.name),t.triggerUserActivity(),t.addUpdate(()=>(a_(t,[n]),!1)))}}function aDe(t,e){return yt&&t.getOptions()._experiments.traceInternals?!1:sje(e,Yt())}function IW(t,e){t.isEnabled()&&e!==null&&(aDe(t,e.name)||t.addUpdate(()=>(a_(t,[e]),!0)))}function o_(t){if(!t)return;const e=new TextEncoder;try{if(typeof t=="string")return e.encode(t).length;if(t instanceof URLSearchParams)return e.encode(t.toString()).length;if(t instanceof FormData){const n=zW(t);return e.encode(n).length}if(t instanceof Blob)return t.size;if(t instanceof ArrayBuffer)return t.byteLength}catch{}}function DW(t){if(!t)return;const e=parseInt(t,10);return isNaN(e)?void 0:e}function LW(t){try{if(typeof t=="string")return[t];if(t instanceof URLSearchParams)return[t.toString()];if(t instanceof FormData)return[zW(t)];if(!t)return[void 0]}catch(e){return yt&&St.exception(e,"Failed to serialize body",t),[void 0,"BODY_PARSE_ERROR"]}return yt&&St.info("Skipping network body because of body type",t),[void 0,"UNPARSEABLE_BODY_TYPE"]}function Fx(t,e){if(!t)return{headers:{},size:void 0,_meta:{warnings:[e]}};const n={...t._meta},r=n.warnings||[];return n.warnings=[...r,e],t._meta=n,t}function $W(t,e){if(!e)return null;const{startTimestamp:n,endTimestamp:r,url:s,method:i,statusCode:a,request:l,response:u}=e;return{type:t,start:n/1e3,end:r/1e3,name:s,data:Nr({method:i,statusCode:a,request:l,response:u})}}function ig(t){return{headers:{},size:t,_meta:{warnings:["URL_SKIPPED"]}}}function Hl(t,e,n){if(!e&&Object.keys(t).length===0)return;if(!e)return{headers:t};if(!n)return{headers:t,size:e};const r={headers:t,size:e},{body:s,warnings:i}=oDe(n);return r.body=s,i&&i.length>0&&(r._meta={warnings:i}),r}function aA(t,e){return Object.entries(t).reduce((n,[r,s])=>{const i=r.toLowerCase();return e.includes(i)&&t[r]&&(n[i]=s),n},{})}function zW(t){return new URLSearchParams(t).toString()}function oDe(t){if(!t||typeof t!="string")return{body:t};const e=t.length>Q$,n=lDe(t);if(e){const r=t.slice(0,Q$);return n?{body:r,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${r}…`,warnings:["TEXT_TRUNCATED"]}}if(n)try{return{body:JSON.parse(t)}}catch{}return{body:t}}function lDe(t){const e=t[0],n=t[t.length-1];return e==="["&&n==="]"||e==="{"&&n==="}"}function Ux(t,e){const n=cDe(t);return Vl(n,e)}function cDe(t,e=kn.document.baseURI){if(t.startsWith("http://")||t.startsWith("https://")||t.startsWith(kn.location.origin))return t;const n=new URL(t,e);if(n.origin!==new URL(e).origin)return t;const r=n.href;return!t.endsWith("/")&&r.endsWith("/")?r.slice(0,-1):r}async function uDe(t,e,n){try{const r=await fDe(t,e,n),s=$W("resource.fetch",r);IW(n.replay,s)}catch(r){yt&&St.exception(r,"Failed to capture fetch breadcrumb")}}function dDe(t,e){const{input:n,response:r}=e,s=n?FW(n):void 0,i=o_(s),a=r?DW(r.headers.get("content-length")):void 0;i!==void 0&&(t.data.request_body_size=i),a!==void 0&&(t.data.response_body_size=a)}async function fDe(t,e,n){const r=Date.now(),{startTimestamp:s=r,endTimestamp:i=r}=e,{url:a,method:l,status_code:u=0,request_body_size:d,response_body_size:p}=t.data,h=Ux(a,n.networkDetailAllowUrls)&&!Ux(a,n.networkDetailDenyUrls),g=h?hDe(n,e.input,d):ig(d),v=await pDe(h,n,e.response,p);return{startTimestamp:s,endTimestamp:i,url:a,method:l,statusCode:u,request:g,response:v}}function hDe({networkCaptureBodies:t,networkRequestHeaders:e},n,r){const s=n?vDe(n,e):{};if(!t)return Hl(s,r,void 0);const i=FW(n),[a,l]=LW(i),u=Hl(s,r,a);return l?Fx(u,l):u}async function pDe(t,{networkCaptureBodies:e,networkResponseHeaders:n},r,s){if(!t&&s!==void 0)return ig(s);const i=r?UW(r.headers,n):{};if(!r||!e&&s!==void 0)return Hl(i,s,void 0);const[a,l]=await gDe(r),u=mDe(a,{networkCaptureBodies:e,responseBodySize:s,captureDetails:t,headers:i});return l?Fx(u,l):u}function mDe(t,{networkCaptureBodies:e,responseBodySize:n,captureDetails:r,headers:s}){try{const i=t&&t.length&&n===void 0?o_(t):n;return r?e?Hl(s,i,t):Hl(s,i,void 0):ig(i)}catch(i){return yt&&St.exception(i,"Failed to serialize response body"),Hl(s,n,void 0)}}async function gDe(t){const e=yDe(t);if(!e)return[void 0,"BODY_PARSE_ERROR"];try{return[await bDe(e)]}catch(n){return n instanceof Error&&n.message.indexOf("Timeout")>-1?(yt&&St.warn("Parsing text body from response timed out"),[void 0,"BODY_PARSE_TIMEOUT"]):(yt&&St.exception(n,"Failed to get text body from response"),[void 0,"BODY_PARSE_ERROR"])}}function FW(t=[]){if(!(t.length!==2||typeof t[1]!="object"))return t[1].body}function UW(t,e){const n={};return e.forEach(r=>{t.get(r)&&(n[r]=t.get(r))}),n}function vDe(t,e){return t.length===1&&typeof t[0]!="string"?yz(t[0],e):t.length===2?yz(t[1],e):{}}function yz(t,e){if(!t)return{};const n=t.headers;return n?n instanceof Headers?UW(n,e):Array.isArray(n)?{}:aA(n,e):{}}function yDe(t){try{return t.clone()}catch(e){yt&&St.exception(e,"Failed to clone response body")}}function bDe(t){return new Promise((e,n)=>{const r=Ff(()=>n(new Error("Timeout while trying to read response body")),500);xDe(t).then(s=>e(s),s=>n(s)).finally(()=>clearTimeout(r))})}async function xDe(t){return await t.text()}async function _De(t,e,n){try{const r=SDe(t,e,n),s=$W("resource.xhr",r);IW(n.replay,s)}catch(r){yt&&St.exception(r,"Failed to capture xhr breadcrumb")}}function wDe(t,e){const{xhr:n,input:r}=e;if(!n)return;const s=o_(r),i=n.getResponseHeader("content-length")?DW(n.getResponseHeader("content-length")):CDe(n.response,n.responseType);s!==void 0&&(t.data.request_body_size=s),i!==void 0&&(t.data.response_body_size=i)}function SDe(t,e,n){const r=Date.now(),{startTimestamp:s=r,endTimestamp:i=r,input:a,xhr:l}=e,{url:u,method:d,status_code:p=0,request_body_size:h,response_body_size:g}=t.data;if(!u)return null;if(!l||!Ux(u,n.networkDetailAllowUrls)||Ux(u,n.networkDetailDenyUrls)){const A=ig(h),N=ig(g);return{startTimestamp:s,endTimestamp:i,url:u,method:d,statusCode:p,request:A,response:N}}const v=l[Kc],b=v?aA(v.request_headers,n.networkRequestHeaders):{},x=aA(EDe(l),n.networkResponseHeaders),[E,S]=n.networkCaptureBodies?LW(a):[void 0],[k,T]=n.networkCaptureBodies?kDe(l):[void 0],R=Hl(b,h,E),j=Hl(x,g,k);return{startTimestamp:s,endTimestamp:i,url:u,method:d,statusCode:p,request:S?Fx(R,S):R,response:T?Fx(j,T):j}}function EDe(t){const e=t.getAllResponseHeaders();return e?e.split(`\r
|
|
1873
1873
|
`).reduce((n,r)=>{const[s,i]=r.split(": ");return i&&(n[s.toLowerCase()]=i),n},{}):{}}function kDe(t){const e=[];try{return[t.responseText]}catch(n){e.push(n)}try{return TDe(t.response,t.responseType)}catch(n){e.push(n)}return yt&&St.warn("Failed to get xhr response body",...e),[void 0]}function TDe(t,e){try{if(typeof t=="string")return[t];if(t instanceof Document)return[t.body.outerHTML];if(e==="json"&&t&&typeof t=="object")return[JSON.stringify(t)];if(!t)return[void 0]}catch(n){return yt&&St.exception(n,"Failed to serialize body",t),[void 0,"BODY_PARSE_ERROR"]}return yt&&St.info("Skipping network body because of body type",t),[void 0,"UNPARSEABLE_BODY_TYPE"]}function CDe(t,e){try{const n=e==="json"&&t&&typeof t=="object"?JSON.stringify(t):t;return o_(n)}catch{return}}function ADe(t){const e=Yt();try{const{networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:s,networkRequestHeaders:i,networkResponseHeaders:a}=t.getOptions(),l={replay:t,networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:s,networkRequestHeaders:i,networkResponseHeaders:a};e&&e.on("beforeAddBreadcrumb",(u,d)=>NDe(l,u,d))}catch{}}function NDe(t,e,n){if(e.data)try{RDe(e)&&MDe(n)&&(wDe(e,n),_De(e,n,t)),jDe(e)&&ODe(n)&&(dDe(e,n),uDe(e,n,t))}catch(r){yt&&St.exception(r,"Error when enriching network breadcrumb")}}function RDe(t){return t.category==="xhr"}function jDe(t){return t.category==="fetch"}function MDe(t){return t&&t.xhr}function ODe(t){return t&&t.response}function PDe(t){const e=Yt();KG(cIe(t)),t_(iDe(t)),XIe(t),ADe(t);const n=rDe(t);LRe(n),e&&(e.on("beforeSendEvent",YIe(t)),e.on("afterSendEvent",HIe(t)),e.on("createDsc",r=>{const s=t.getSessionId();s&&t.isEnabled()&&t.recordingMode==="session"&&t.checkAndHandleExpiredSession()&&(r.replay_id=s)}),e.on("spanStart",r=>{t.lastActiveSpan=r}),e.on("spanEnd",r=>{t.lastActiveSpan=r}),e.on("beforeSendFeedback",(r,s)=>{const i=t.getSessionId();s&&s.includeReplay&&t.isEnabled()&&i&&r.contexts&&r.contexts.feedback&&(r.contexts.feedback.replay_id=i)}))}async function IDe(t){try{return Promise.all(a_(t,[DDe(kn.performance.memory)]))}catch{return[]}}function DDe(t){const{jsHeapSizeLimit:e,totalJSHeapSize:n,usedJSHeapSize:r}=t,s=Date.now()/1e3;return{type:"memory",name:"memory",start:s,end:s,data:{memory:{jsHeapSizeLimit:e,totalJSHeapSize:n,usedJSHeapSize:r}}}}function LDe(t,e,n){let r,s,i;const a=n&&n.maxWait?Math.max(n.maxWait,e):0;function l(){return u(),r=t(),r}function u(){s!==void 0&&clearTimeout(s),i!==void 0&&clearTimeout(i),s=i=void 0}function d(){return s!==void 0||i!==void 0?l():r}function p(){return s&&clearTimeout(s),s=Ff(l,e),a&&i===void 0&&(i=Ff(l,a)),r}return p.cancel=u,p.flush=d,p}const Fc=Kt.navigator;function $De(){return/iPhone|iPad|iPod/i.test(Fc&&Fc.userAgent||"")||/Macintosh/i.test(Fc&&Fc.userAgent||"")&&Fc&&Fc.maxTouchPoints&&Fc.maxTouchPoints>1?{sampling:{mousemove:!1}}:{}}function zDe(t){let e=!1;return(n,r)=>{if(!t.checkAndHandleExpiredSession()){yt&&St.warn("Received replay event after session expired.");return}const s=r||!e;e=!0,t.clickDetector&&sIe(t.clickDetector,n),t.addUpdate(()=>{if(t.recordingMode==="buffer"&&s&&t.setInitialState(),!Ij(t,n,s))return!0;if(!s)return!1;const i=t.session;if(UDe(t,s),t.recordingMode==="buffer"&&i&&t.eventBuffer){const a=t.eventBuffer.getEarliestTimestamp();a&&(yt&&St.info(`Updating session start time to earliest event in buffer to ${new Date(a)}`),i.started=a,t.getOptions().stickySession&&Pj(i))}return i&&i.previousSessionId||t.recordingMode==="session"&&t.flush(),!0})}}function FDe(t){const e=t.getOptions();return{type:Ft.Custom,timestamp:Date.now(),data:{tag:"options",payload:{shouldRecordCanvas:t.isRecordingCanvas(),sessionSampleRate:e.sessionSampleRate,errorSampleRate:e.errorSampleRate,useCompressionOption:e.useCompression,blockAllMedia:e.blockAllMedia,maskAllText:e.maskAllText,maskAllInputs:e.maskAllInputs,useCompression:t.eventBuffer?t.eventBuffer.type==="worker":!1,networkDetailHasUrls:e.networkDetailAllowUrls.length>0,networkCaptureBodies:e.networkCaptureBodies,networkRequestHasHeaders:e.networkRequestHeaders.length>0,networkResponseHasHeaders:e.networkResponseHeaders.length>0}}}}function UDe(t,e){!e||!t.session||t.session.segmentId!==0||Ij(t,FDe(t),!1)}function BDe(t,e,n,r){return Pu(lG(t,mj(t),r,n),[[{type:"replay_event"},t],[{type:"replay_recording",length:typeof e=="string"?new TextEncoder().encode(e).length:e.length},e]])}function qDe({recordingData:t,headers:e}){let n;const r=`${JSON.stringify(e)}
|
|
1874
|
-
`;if(typeof t=="string")n=`${r}${t}`;else{const i=new TextEncoder().encode(r);n=new Uint8Array(i.length+t.length),n.set(i),n.set(t,i.length)}return n}async function VDe({client:t,scope:e,replayId:n,event:r}){const s=typeof t._integrations=="object"&&t._integrations!==null&&!Array.isArray(t._integrations)?Object.keys(t._integrations):void 0,i={event_id:n,integrations:s};t.emit("preprocessEvent",r,i);const a=await hG(t.getOptions(),r,i,e,t,Li());if(!a)return null;a.platform=a.platform||"javascript";const l=t.getSdkMetadata(),{name:u,version:d}=l&&l.sdk||{};return a.sdk={...a.sdk,name:u||"sentry.javascript.unknown",version:d||"0.0.0"},a}async function HDe({recordingData:t,replayId:e,segmentId:n,eventContext:r,timestamp:s,session:i}){const a=qDe({recordingData:t,headers:{segment_id:n}}),{urls:l,errorIds:u,traceIds:d,initialTimestamp:p}=r,h=Yt(),g=An(),v=h&&h.getTransport(),b=h&&h.getDsn();if(!h||!v||!b||!i.sampled)return Bo({});const x={type:SOe,replay_start_timestamp:p/1e3,timestamp:s/1e3,error_ids:u,trace_ids:d,urls:l,replay_id:e,segment_id:n,replay_type:i.sampled},E=await VDe({scope:g,client:h,replayId:e,event:x});if(!E)return h.recordDroppedEvent("event_processor","replay",x),yt&&St.info("An event processor returned `null`, will not send event."),Bo({});delete E.sdkProcessingMetadata;const S=BDe(E,a,b,h.getOptions().tunnel);let k;try{k=await v.send(S)}catch(R){const j=new Error(Ej);try{j.cause=R}catch{}throw j}if(typeof k.statusCode=="number"&&(k.statusCode<200||k.statusCode>=300))throw new BW(k.statusCode);const T=SG({},k);if(wG(T,"replay"))throw new Lj(T);return k}class BW extends Error{constructor(e){super(`Transport returned status code ${e}`)}}class Lj extends Error{constructor(e){super("Rate limit hit"),this.rateLimits=e}}async function qW(t,e={count:0,interval:NOe}){const{recordingData:n,onError:r}=t;if(n.length)try{return await HDe(t),!0}catch(s){if(s instanceof BW||s instanceof Lj)throw s;if(gG("Replays",{_retryCount:e.count}),r&&r(s),e.count>=ROe){const i=new Error(`${Ej} - max retries exceeded`);try{i.cause=s}catch{}throw i}return e.interval*=++e.count,new Promise((i,a)=>{Ff(async()=>{try{await qW(t,e),i(!0)}catch(l){a(l)}},e.interval)})}}const VW="__THROTTLED",GDe="__SKIPPED";function WDe(t,e,n){const r=new Map,s=l=>{const u=l-n;r.forEach((d,p)=>{p<u&&r.delete(p)})},i=()=>[...r.values()].reduce((l,u)=>l+u,0);let a=!1;return(...l)=>{const u=Math.floor(Date.now()/1e3);if(s(u),i()>=e){const p=a;return a=!0,p?GDe:VW}a=!1;const d=r.get(u)||0;return r.set(u,d+1),t(...l)}}class Pl{constructor({options:e,recordingOptions:n}){Pl.prototype.__init.call(this),Pl.prototype.__init2.call(this),Pl.prototype.__init3.call(this),Pl.prototype.__init4.call(this),Pl.prototype.__init5.call(this),Pl.prototype.__init6.call(this),this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:EOe,sessionIdleExpire:kOe},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._requiresManualStart=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:""},this._recordingOptions=n,this._options=e,this._debouncedFlush=LDe(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=WDe((a,l)=>BIe(this,a,l),300,5);const{slowClickTimeout:r,slowClickIgnoreSelectors:s}=this.getOptions(),i=r?{threshold:Math.min(jOe,r),timeout:r,scrollTimeout:MOe,ignoreSelector:s?s.join(","):""}:void 0;if(i&&(this.clickDetector=new eIe(this,i)),yt){const a=e._experiments;St.setConfig({captureExceptions:!!a.captureExceptions,traceInternals:!!a.traceInternals})}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(e){yt&&St.exception(e),this._options.onError&&this._options.onError(e)}initializeSampling(e){const{errorSampleRate:n,sessionSampleRate:r}=this._options,s=n<=0&&r<=0;if(this._requiresManualStart=s,!s){if(this._initializeSessionForSampling(e),!this.session){yt&&St.exception(new Error("Unable to initialize and create session"));return}this.session.sampled!==!1&&(this.recordingMode=this.session.sampled==="buffer"&&this.session.segmentId===0?"buffer":"session",yt&&St.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session"){yt&&St.info("Recording is already in progress");return}if(this._isEnabled&&this.recordingMode==="buffer"){yt&&St.info("Buffering is in progress, call `flush()` to save the replay");return}yt&&St.infoTick("Starting replay in session mode"),this._updateUserActivity();const e=rk({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=e,this._initializeRecording()}startBuffering(){if(this._isEnabled){yt&&St.info("Buffering is in progress, call `flush()` to save the replay");return}yt&&St.infoTick("Starting replay in buffer mode");const e=rk({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=e,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{const e=this._canvas;this._stopRecording=Ro({...this._recordingOptions,...this.recordingMode==="buffer"?{checkoutEveryNms:AOe}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:zDe(this),...$De(),onMutation:this._onMutationHandler,...e?{recordCanvas:e.recordCanvas,getCanvasManager:e.getCanvasManager,sampling:e.sampling,dataURLOptions:e.dataURLOptions}:{}})}catch(e){this.handleException(e)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(e){return this.handleException(e),!1}}async stop({forceFlush:e=!1,reason:n}={}){if(this._isEnabled){this._isEnabled=!1;try{yt&&St.info(`Stopping Replay${n?` triggered by ${n}`:""}`),PW(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),e&&await this._flush({force:!0}),this.eventBuffer&&this.eventBuffer.destroy(),this.eventBuffer=null,LIe(this)}catch(r){this.handleException(r)}}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),yt&&St.info("Pausing replay"))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),yt&&St.info("Resuming replay"))}async sendBufferedReplayOrFlush({continueRecording:e=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();const n=Date.now();yt&&St.info("Converting buffer to session"),await this.flushImmediate();const r=this.stopRecording();!e||!r||this.recordingMode!=="session"&&(this.recordingMode="session",this.session&&(this._updateUserActivity(n),this._updateSessionActivity(n),this._maybeSaveSession()),this.startRecording())}addUpdate(e){const n=e();this.recordingMode!=="buffer"&&n!==!0&&this._debouncedFlush()}triggerUserActivity(){if(this._updateUserActivity(),!this._stopRecording){if(!this._checkSession())return;this.resume();return}this.checkAndHandleExpiredSession(),this._updateSessionActivity()}updateUserActivity(){this._updateUserActivity(),this._updateSessionActivity()}conditionalFlush(){return this.recordingMode==="buffer"?Promise.resolve():this.flushImmediate()}flush(){return this._debouncedFlush()}flushImmediate(){return this._debouncedFlush(),this._debouncedFlush.flush()}cancelFlush(){this._debouncedFlush.cancel()}getSessionId(){return this.session&&this.session.id}checkAndHandleExpiredSession(){if(this._lastActivity&&sA(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session&&this.session.sampled==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){const e=`${kn.location.pathname}${kn.location.hash}${kn.location.search}`,n=`${kn.location.origin}${e}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=n,this._context.initialTimestamp=Date.now(),this._context.urls.push(n)}throttledAddEvent(e,n){const r=this._throttledAddEvent(e,n);if(r===VW){const s=Ra({category:"replay.throttled"});this.addUpdate(()=>!Ij(this,{type:WPe,timestamp:s.timestamp||0,data:{tag:"breadcrumb",payload:s,metric:!0}}))}return r}getCurrentRoute(){const e=this.lastActiveSpan||$r(),n=e&&Kr(e),s=(n&&rn(n).data||{})[Na];if(!(!n||!s||!["route","custom"].includes(s)))return rn(n).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=PIe({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.startRecording()}_initializeSessionForSampling(e){const n=this._options.errorSampleRate>0,r=rk({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,previousSessionId:e},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:n});this.session=r}_checkSession(){if(!this.session)return!1;const e=this.session;return RW(e,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})?(this._refreshSession(e),!1):!0}async _refreshSession(e){this._isEnabled&&(await this.stop({reason:"refresh session"}),this.initializeSampling(e.id))}_addListeners(){try{kn.document.addEventListener("visibilitychange",this._handleVisibilityChange),kn.addEventListener("blur",this._handleWindowBlur),kn.addEventListener("focus",this._handleWindowFocus),kn.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(PDe(this),this._hasInitializedCoreListeners=!0)}catch(e){this.handleException(e)}this._performanceCleanupCallback=CIe(this)}_removeListeners(){try{kn.document.removeEventListener("visibilitychange",this._handleVisibilityChange),kn.removeEventListener("blur",this._handleWindowBlur),kn.removeEventListener("focus",this._handleWindowFocus),kn.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(e){this.handleException(e)}}__init(){this._handleVisibilityChange=()=>{kn.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()}}__init2(){this._handleWindowBlur=()=>{const e=Ra({category:"ui.blur"});this._doChangeToBackgroundTasks(e)}}__init3(){this._handleWindowFocus=()=>{const e=Ra({category:"ui.focus"});this._doChangeToForegroundTasks(e)}}__init4(){this._handleKeyboardEvent=e=>{hIe(this,e)}}_doChangeToBackgroundTasks(e){!this.session||NW(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})||(e&&this._createCustomBreadcrumb(e),this.conditionalFlush())}_doChangeToForegroundTasks(e){if(!this.session)return;if(!this.checkAndHandleExpiredSession()){yt&&St.info("Document has become active, but session has expired");return}e&&this._createCustomBreadcrumb(e)}_updateUserActivity(e=Date.now()){this._lastActivity=e}_updateSessionActivity(e=Date.now()){this.session&&(this.session.lastActivity=e,this._maybeSaveSession())}_createCustomBreadcrumb(e){this.addUpdate(()=>{this.throttledAddEvent({type:Ft.Custom,timestamp:e.timestamp||0,data:{tag:"breadcrumb",payload:e}})})}_addPerformanceEntries(){let e=vIe(this.performanceEntries).concat(this.replayPerformanceEntries);if(this.performanceEntries=[],this.replayPerformanceEntries=[],this._requiresManualStart){const n=this._context.initialTimestamp/1e3;e=e.filter(r=>r.start>=n)}return Promise.all(a_(this,e))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){const{session:e,eventBuffer:n}=this;if(!e||!n||this._requiresManualStart||e.segmentId)return;const r=n.getEarliestTimestamp();r&&r<this._context.initialTimestamp&&(this._context.initialTimestamp=r)}_popEventContext(){const e={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),urls:this._context.urls};return this._clearContext(),e}async _runFlush(){const e=this.getSessionId();if(!this.session||!this.eventBuffer||!e){yt&&St.error("No session or eventBuffer found to flush.");return}if(await this._addPerformanceEntries(),!(!this.eventBuffer||!this.eventBuffer.hasEvents)&&(await IDe(this),!!this.eventBuffer&&e===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();const n=Date.now();if(n-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new Error("Session is too long, not sending replay");const r=this._popEventContext(),s=this.session.segmentId++;this._maybeSaveSession();const i=await this.eventBuffer.finish();await qW({replayId:e,recordingData:i,segmentId:s,eventContext:r,session:this.session,timestamp:n,onError:a=>this.handleException(a)})}catch(n){this.handleException(n),this.stop({reason:"sendReplay"});const r=Yt();if(r){const s=n instanceof Lj?"ratelimit_backoff":"send_error";r.recordDroppedEvent(s,"replay")}}}__init5(){this._flush=async({force:e=!1}={})=>{if(!this._isEnabled&&!e)return;if(!this.checkAndHandleExpiredSession()){yt&&St.error("Attempting to finish replay event after session expired.");return}if(!this.session)return;const n=this.session.started,s=Date.now()-n;this._debouncedFlush.cancel();const i=s<this._options.minReplayDuration,a=s>this._options.maxReplayDuration+5e3;if(i||a){yt&&St.info(`Session duration (${Math.floor(s/1e3)}s) is too ${i?"short":"long"}, not sending replay.`),i&&this._debouncedFlush();return}const l=this.eventBuffer;l&&this.session.segmentId===0&&!l.hasCheckout&&yt&&St.info("Flushing initial segment without checkout.");const u=!!this._flushLock;this._flushLock||(this._flushLock=this._runFlush());try{await this._flushLock}catch(d){this.handleException(d)}finally{this._flushLock=void 0,u&&this._debouncedFlush()}}}_maybeSaveSession(){this.session&&this._options.stickySession&&Pj(this.session)}__init6(){this._onMutationHandler=e=>{const n=e.length,r=this._options.mutationLimit,s=this._options.mutationBreadcrumbLimit,i=r&&n>r;if(n>s||i){const a=Ra({category:"replay.mutations",data:{count:n,limit:i}});this._createCustomBreadcrumb(a)}return i?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}}}function Ap(t,e){return[...t,...e].join(",")}function YDe({mask:t,unmask:e,block:n,unblock:r,ignore:s}){const i=["base","iframe[srcdoc]:not([src])"],a=Ap(t,[".sentry-mask","[data-sentry-mask]"]),l=Ap(e,[]);return{maskTextSelector:a,unmaskTextSelector:l,blockSelector:Ap(n,[".sentry-block","[data-sentry-block]",...i]),unblockSelector:Ap(r,[]),ignoreSelector:Ap(s,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}function KDe({el:t,key:e,maskAttributes:n,maskAllText:r,privacyOptions:s,value:i}){return!r||s.unmaskTextSelector&&t.matches(s.unmaskTextSelector)?i:n.includes(e)||e==="value"&&t.tagName==="INPUT"&&["submit","button"].includes(t.getAttribute("type")||"")?i.replace(/[\S]/g,"*"):i}const bz='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',XDe=["content-length","content-type","accept"];let xz=!1;const QDe=t=>new l_(t);class l_{static __initStatic(){this.id="Replay"}constructor({flushMinDelay:e=TOe,flushMaxDelay:n=COe,minReplayDuration:r=OOe,maxReplayDuration:s=J$,stickySession:i=!0,useCompression:a=!0,workerUrl:l,_experiments:u={},maskAllText:d=!0,maskAllInputs:p=!0,blockAllMedia:h=!0,mutationBreadcrumbLimit:g=750,mutationLimit:v=1e4,slowClickTimeout:b=7e3,slowClickIgnoreSelectors:x=[],networkDetailAllowUrls:E=[],networkDetailDenyUrls:S=[],networkCaptureBodies:k=!0,networkRequestHeaders:T=[],networkResponseHeaders:R=[],mask:j=[],maskAttributes:A=["title","placeholder"],unmask:N=[],block:M=[],unblock:I=[],ignore:O=[],maskFn:L,beforeAddRecordingEvent:z,beforeErrorSampling:G,onError:W}={}){this.name=l_.id;const X=YDe({mask:j,unmask:N,block:M,unblock:I,ignore:O});if(this._recordingOptions={maskAllInputs:p,maskAllText:d,maskInputOptions:{password:!0},maskTextFn:L,maskInputFn:L,maskAttributeFn:(F,Y,H)=>KDe({maskAttributes:A,maskAllText:d,privacyOptions:X,key:F,value:Y,el:H}),...X,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:F=>{try{F.__rrweb__=!0}catch{}}},this._initialOptions={flushMinDelay:e,flushMaxDelay:n,minReplayDuration:Math.min(r,POe),maxReplayDuration:Math.min(s,J$),stickySession:i,useCompression:a,workerUrl:l,blockAllMedia:h,maskAllInputs:p,maskAllText:d,mutationBreadcrumbLimit:g,mutationLimit:v,slowClickTimeout:b,slowClickIgnoreSelectors:x,networkDetailAllowUrls:E,networkDetailDenyUrls:S,networkCaptureBodies:k,networkRequestHeaders:_z(T),networkResponseHeaders:_z(R),beforeAddRecordingEvent:z,beforeErrorSampling:G,onError:W,_experiments:u},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${bz}`:bz),this._isInitialized&&B$())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return xz}set _isInitialized(e){xz=e}afterAllSetup(e){!B$()||this._replay||(this._setup(e),this._initialize(e))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(){return this._replay?this._replay.stop({forceFlush:this._replay.recordingMode==="session"}):Promise.resolve()}flush(e){return this._replay?this._replay.isEnabled()?this._replay.sendBufferedReplayOrFlush(e):(this._replay.start(),Promise.resolve()):Promise.resolve()}getReplayId(){if(!(!this._replay||!this._replay.isEnabled()))return this._replay.getSessionId()}getRecordingMode(){if(!(!this._replay||!this._replay.isEnabled()))return this._replay.recordingMode}_initialize(e){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(e),this._replay.initializeSampling())}_setup(e){const n=JDe(this._initialOptions,e);this._replay=new Pl({options:n,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(e){try{const n=e.getIntegrationByName("ReplayCanvas");if(!n)return;this._replay._canvas=n.getOptions()}catch{}}}l_.__initStatic();function JDe(t,e){const n=e.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...Nr(t)},s=Nx(n.replaysSessionSampleRate),i=Nx(n.replaysOnErrorSampleRate);return s==null&&i==null&&dc(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),s!=null&&(r.sessionSampleRate=s),i!=null&&(r.errorSampleRate=i),r}function _z(t){return[...XDe,...t.map(e=>e.toLowerCase())]}const wz=new WeakMap,sk=new Map,gb={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function ZDe(t,e){const{traceFetch:n,traceXHR:r,trackFetchStreamPerformance:s,shouldCreateSpanForRequest:i,enableHTTPTimings:a,tracePropagationTargets:l}={traceFetch:gb.traceFetch,traceXHR:gb.traceXHR,trackFetchStreamPerformance:gb.trackFetchStreamPerformance,...e},u=typeof i=="function"?i:h=>!0,d=h=>nLe(h,l),p={};n&&(t.addEventProcessor(h=>(h.type==="transaction"&&h.spans&&h.spans.forEach(g=>{if(g.op==="http.client"){const v=sk.get(g.span_id);v&&(g.timestamp=v/1e3,sk.delete(g.span_id))}}),h)),s&&qje(h=>{if(h.response){const g=wz.get(h.response);g&&h.endTimestamp&&sk.set(g,h.endTimestamp)}}),jG(h=>{const g=Dje(h,u,d,p);if(h.response&&h.fetchData.__span&&wz.set(h.response,h.fetchData.__span),g){const v=HW(h.fetchData.url),b=v?cu(v).host:void 0;g.setAttributes({"http.url":v,"server.address":b})}a&&g&&Sz(g)})),r&&QG(h=>{const g=rLe(h,u,d,p);a&&g&&Sz(g)})}function eLe(t){return t.entryType==="resource"&&"initiatorType"in t&&typeof t.nextHopProtocol=="string"&&(t.initiatorType==="fetch"||t.initiatorType==="xmlhttprequest")}function Sz(t){const{url:e}=rn(t).data||{};if(!e||typeof e!="string")return;const n=zf("resource",({entries:r})=>{r.forEach(s=>{eLe(s)&&s.name.endsWith(e)&&(tLe(s).forEach(a=>t.setAttribute(...a)),setTimeout(n))})})}function _a(t=0){return((vs||performance.timeOrigin)+t)/1e3}function tLe(t){const{name:e,version:n}=YG(t.nextHopProtocol),r=[];return r.push(["network.protocol.version",n],["network.protocol.name",e]),vs?[...r,["http.request.redirect_start",_a(t.redirectStart)],["http.request.fetch_start",_a(t.fetchStart)],["http.request.domain_lookup_start",_a(t.domainLookupStart)],["http.request.domain_lookup_end",_a(t.domainLookupEnd)],["http.request.connect_start",_a(t.connectStart)],["http.request.secure_connection_start",_a(t.secureConnectionStart)],["http.request.connection_end",_a(t.connectEnd)],["http.request.request_start",_a(t.requestStart)],["http.request.response_start",_a(t.responseStart)],["http.request.response_end",_a(t.responseEnd)]]:r}function nLe(t,e){const n=Nt.location&&Nt.location.href;if(n){let r,s;try{r=new URL(t,n),s=new URL(n).origin}catch{return!1}const i=r.origin===s;return e?Vl(r.toString(),e)||i&&Vl(r.pathname,e):i}else{const r=!!t.match(/^\/(?!\/)/);return e?Vl(t,e):r}}function rLe(t,e,n,r){const s=t.xhr,i=s&&s[Kc];if(!s||s.__sentry_own_request__||!i)return;const a=tc()&&e(i.url);if(t.endTimestamp&&a){const h=s.__sentry_xhr_span_id__;if(!h)return;const g=r[h];g&&i.status_code!==void 0&&(G7(g,i.status_code),g.end(),delete r[h]);return}const l=HW(i.url),u=l?cu(l).host:void 0,d=!!$r(),p=a&&d?Og({name:`${i.method} ${i.url}`,attributes:{type:"xhr","http.method":i.method,"http.url":l,url:i.url,"server.address":u,[Dr]:"auto.http.browser",[Tu]:"http.client"}}):new uh;return s.__sentry_xhr_span_id__=p.spanContext().spanId,r[s.__sentry_xhr_span_id__]=p,n(i.url)&&sLe(s,tc()&&d?p:void 0),p}function sLe(t,e){const{"sentry-trace":n,baggage:r}=kG({span:e});n&&iLe(t,n,r)}function iLe(t,e,n){try{t.setRequestHeader("sentry-trace",e),n&&t.setRequestHeader("baggage",n)}catch{}}function HW(t){try{return new URL(t,Nt.location.origin).href}catch{return}}function aLe(){Nt&&Nt.document?Nt.document.addEventListener("visibilitychange",()=>{const t=$r();if(!t)return;const e=Kr(t);if(Nt.document.hidden&&e){const n="cancelled",{op:r,status:s}=rn(e);Ha&&ze.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),s||e.setStatus({code:Or,message:n}),e.setAttribute("sentry.cancellation_reason","document.hidden"),e.end()}}):Ha&&ze.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const oLe="BrowserTracing",lLe={...db,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,_experiments:{},...gb},cLe=(t={})=>{FNe();const{enableInp:e,enableLongTask:n,enableLongAnimationFrame:r,_experiments:{enableInteractions:s,enableStandaloneClsSpans:i},beforeStartSpan:a,idleTimeout:l,finalTimeout:u,childSpanTimeout:d,markBackgroundSpan:p,traceFetch:h,traceXHR:g,trackFetchStreamPerformance:v,shouldCreateSpanForRequest:b,enableHTTPTimings:x,instrumentPageLoad:E,instrumentNavigation:S}={...lLe,...t},k=JMe({recordClsStandaloneSpans:i||!1});e&&S2e(),r&&Kt.PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")?e2e():n&&ZMe(),s&&t2e();const T={name:void 0,source:void 0};function R(j,A){const N=A.op==="pageload",M=a?a(A):A,I=M.attributes||{};A.name!==M.name&&(I[Na]="custom",M.attributes=I),T.name=M.name,T.source=I[Na];const O=fG(M,{idleTimeout:l,finalTimeout:u,childSpanTimeout:d,disableAutoFinish:N,beforeSpanEnd:z=>{k(),a2e(z,{recordClsOnPageloadSpan:!i})}});function L(){["interactive","complete"].includes(Nt.document.readyState)&&j.emit("idleSpanEnableAutoFinish",O)}return N&&Nt.document&&(Nt.document.addEventListener("readystatechange",()=>{L()}),L()),O}return{name:oLe,afterAllSetup(j){let A,N=Nt.location&&Nt.location.href;function M(){A&&!rn(A).timestamp&&(Ha&&ze.log(`[Tracing] Finishing current active span with op: ${rn(A).op}`),A.end())}j.on("startNavigationSpan",I=>{Yt()===j&&(M(),A=R(j,{op:"navigation",...I}))}),j.on("startPageLoadSpan",(I,O={})=>{if(Yt()!==j)return;M();const L=O.sentryTrace||Ez("sentry-trace"),z=O.baggage||Ez("baggage"),G=ONe(L,z);An().setPropagationContext(G),A=R(j,{op:"pageload",...I})}),j.on("spanEnd",I=>{const O=rn(I).op;if(I!==Kr(I)||O!=="navigation"&&O!=="pageload")return;const L=An(),z=L.getPropagationContext();L.setPropagationContext({...z,sampled:z.sampled!==void 0?z.sampled:Mu(I),dsc:z.dsc||Ou(I)})}),Nt.location&&(E&&uLe(j,{name:Nt.location.pathname,startTime:vs?vs/1e3:void 0,attributes:{[Na]:"url",[Dr]:"auto.pageload.browser"}}),S&&t_(({to:I,from:O})=>{if(O===void 0&&N&&N.indexOf(I)!==-1){N=void 0;return}O!==I&&(N=void 0,dLe(j,{name:Nt.location.pathname,attributes:{[Na]:"url",[Dr]:"auto.navigation.browser"}}))})),p&&aLe(),s&&fLe(l,u,d,T),e&&k2e(),ZDe(j,{traceFetch:h,traceXHR:g,trackFetchStreamPerformance:v,tracePropagationTargets:j.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:b,enableHTTPTimings:x})}}};function uLe(t,e,n){t.emit("startPageLoadSpan",e,n),An().setTransactionName(e.name);const r=$r();return(r&&rn(r).op)==="pageload"?r:void 0}function dLe(t,e){Li().setPropagationContext({traceId:Zl()}),An().setPropagationContext({traceId:Zl()}),t.emit("startNavigationSpan",e),An().setTransactionName(e.name);const n=$r();return(n&&rn(n).op)==="navigation"?n:void 0}function Ez(t){const e=iNe(`meta[name=${t}]`);return e?e.getAttribute("content"):void 0}function fLe(t,e,n,r){let s;const i=()=>{const a="ui.action.click",l=$r(),u=l&&Kr(l);if(u){const d=rn(u).op;if(["navigation","pageload"].includes(d)){Ha&&ze.warn(`[Tracing] Did not create ${a} span because a pageload or navigation span is in progress.`);return}}if(s&&(s.setAttribute(PC,"interactionInterrupted"),s.end(),s=void 0),!r.name){Ha&&ze.warn(`[Tracing] Did not create ${a} transaction because _latestRouteName is missing.`);return}s=fG({name:r.name,op:a,attributes:{[Na]:r.source||"url"}},{idleTimeout:t,finalTimeout:e,childSpanTimeout:n})};Nt.document&&addEventListener("click",i,{once:!1,capture:!0})}function hLe(t){const e={...t};return EG(e,"react"),gG("react",{version:w.version}),wOe(e)}function pLe(){const{user:t}=da(),{isAuthenticated:e,isLoading:n}=Xa(),r=d7("users:ensureUser"),s=w.useRef(null);w.useEffect(()=>{e||(s.current=null,A$(null))},[e]),w.useEffect(()=>{if(!n){if(!e&&t)throw console.log("useEnsureDbUser: not authenticated"),new Error("Not authenticated");e&&t&&s.current!==t.id&&r().then(i=>{s.current=t.id,A$({id:t.id})}).catch(i=>{console.error("[auth] ensureUser failed",i),s.current=null})}},[e,n,t,r])}function mLe(){const t=ua(),{user:e}=da(),{isAuthenticated:n}=Xa();w.useEffect(()=>{t&&(n&&e?(t.identify(e.id,{email:e.email,name:e.firstName&&e.lastName?`${e.firstName} ${e.lastName}`:e.email,first_name:e.firstName,last_name:e.lastName}),t.register({user_id:e.id})):t.reset())},[t,n,e])}function kz({className:t,...e}){return f.jsx(BJ,{"data-slot":"avatar",className:Me("relative flex size-8 shrink-0 overflow-hidden rounded-full",t),...e})}function Tz({className:t,...e}){return f.jsx(qJ,{"data-slot":"avatar-image",className:Me("aspect-square size-full",t),...e})}function Cz({className:t,...e}){return f.jsx(VJ,{"data-slot":"avatar-fallback",className:Me("bg-muted flex size-full items-center justify-center rounded-full",t),...e})}function gLe(){const{isLoading:t}=Xa(),{user:e,signIn:n,signOut:r,signUp:s}=da(),i=ua();if(t)return f.jsx(Ie,{variant:"outline",size:"sm",disabled:!0,children:f.jsx(ir,{className:"h-3 w-3 mr-1.5 animate-spin"})});if(!e)return f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Ie,{variant:"outline",onClick:()=>{i.capture("sign_in",{location:"auth_upper_area",platform:Ni(),environment:void 0}),n()},children:"Sign in"}),f.jsx(Ie,{onClick:()=>{i.capture("create_account",{location:"auth_upper_area",platform:Ni(),environment:void 0}),s()},style:{backgroundColor:"#E55A3A"},children:"Create account"})]});const a=[e.firstName,e.lastName].filter(Boolean).join(" "),l=e.email,u=zX(a),d=()=>{const h=window.location.origin,v=h.includes("://localhost")?h.replace("://localhost","://127.0.0.1"):h;r({returnTo:v})},p=e.profilePictureUrl||void 0;return f.jsxs(p0,{children:[f.jsx(m0,{asChild:!0,children:f.jsx("button",{className:"flex size-10 items-center justify-center rounded-full border border-border/60 bg-background/80 shadow-sm outline-none transition hover:ring-2 hover:ring-ring/20 focus-visible:ring-2 focus-visible:ring-ring",children:f.jsxs(kz,{className:"size-9 cursor-pointer",children:[f.jsx(Tz,{src:p,alt:a}),f.jsx(Cz,{className:"bg-muted text-muted-foreground text-sm font-medium",children:u!=="?"?u:f.jsx(aI,{className:"size-4"})})]})})}),f.jsxs(g0,{className:"w-56",align:"end",children:[f.jsx(rae,{className:"pb-3",children:f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsxs(kz,{className:"size-10 cursor-pointer",children:[f.jsx(Tz,{src:p,alt:a}),f.jsx(Cz,{className:"bg-muted text-muted-foreground text-base font-semibold",children:u!=="?"?u:f.jsx(aI,{className:"size-5"})})]}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("p",{className:"text-sm font-medium leading-none truncate",children:a}),f.jsx("p",{className:"text-xs text-muted-foreground truncate",children:l})]})]})}),f.jsx(dI,{}),f.jsxs(To,{onClick:()=>window.location.hash="settings",className:"cursor-pointer",children:[f.jsx(ZA,{className:"size-4"}),"Settings"]}),f.jsx(dI,{}),f.jsxs(To,{variant:"destructive",onClick:d,className:"cursor-pointer",children:[f.jsx(Fse,{className:"size-4"}),"Log out"]})]})]})}function vLe(){const[t,e]=w.useState("servers"),n=ua();mLe(),w.useEffect(()=>{n.capture("app_launched",{platform:Ni(),environment:void 0,user_agent:navigator.userAgent})},[]),GAe(),pLe();const r=w.useMemo(()=>window.location.pathname.startsWith("/oauth/callback/debug"),[]),s=w.useMemo(()=>window.location.pathname==="/callback",[]),{appState:i,isLoading:a,connectedServerConfigs:l,selectedMCPConfig:u,handleConnect:d,handleDisconnect:p,handleReconnect:h,handleUpdate:g,handleRemoveServer:v,setSelectedServer:b,toggleServerSelection:x,selectedMCPConfigsMap:E,setSelectedMultipleServersToAllServers:S}=g7();w.useEffect(()=>{const T=()=>{const R=(window.location.hash||"#servers").replace("#","");e(R),R==="chat"&&S()};return T(),window.addEventListener("hashchange",T),()=>window.removeEventListener("hashchange",T)},[S]);const k=T=>{T==="chat"&&S(),window.location.hash=T,e(T)};return r?f.jsx(cAe,{}):s?(w.useEffect(()=>{const T=setTimeout(()=>{window.location.href="/"},5e3);return()=>clearTimeout(T)},[]),f.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:f.jsxs("div",{className:"text-center",children:[f.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto"}),f.jsx("p",{className:"mt-4 text-muted-foreground",children:"Completing sign in..."}),f.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:"If this takes too long, you'll be redirected automatically"})]})})):a?f.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:f.jsxs("div",{className:"text-center",children:[f.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto"}),f.jsx("p",{className:"mt-4 text-muted-foreground",children:"Loading..."})]})}):f.jsxs(ZEe,{themeMode:"light",themePreset:"default",children:[f.jsxs(EAe,{defaultOpen:!0,children:[f.jsx(LAe,{onNavigate:k,activeTab:t}),f.jsxs(CAe,{className:"flex flex-col",children:[f.jsx("header",{className:"flex h-12 shrink-0 items-center gap-2 border-b transition-[width,height] ease-linear drag",children:f.jsxs("div",{className:"flex w-full items-center justify-between px-4 lg:px-6",children:[f.jsx("div",{className:"flex items-center gap-1 lg:gap-2",children:f.jsx(TAe,{className:"-ml-1"})}),f.jsx("div",{className:"flex items-center gap-2",children:f.jsx(gLe,{})})]})}),f.jsxs("div",{className:"flex-1",children:[(t==="tools"||t==="resources"||t==="prompts"||t==="auth"||t==="chat"||t==="interceptor")&&f.jsx(FAe,{connectedServerConfigs:l,selectedServer:i.selectedServer,onServerChange:b,onConnect:d,isMultiSelectEnabled:t==="chat",onMultiServerToggle:x,selectedMultipleServers:i.selectedMultipleServers}),t==="servers"&&f.jsx(Vue,{connectedServerConfigs:l,onConnect:d,onDisconnect:p,onReconnect:h,onUpdate:g,onRemove:v}),t==="tools"&&f.jsx(Khe,{serverConfig:u,serverName:i.selectedServer}),t==="evals"&&f.jsx(nTe,{}),t==="eval-results"&&f.jsx(Bke,{}),t==="resources"&&f.jsx(Xhe,{serverConfig:u,serverName:i.selectedServer}),t==="prompts"&&f.jsx(Qhe,{serverConfig:u,serverName:i.selectedServer}),t==="auth"&&f.jsx(lAe,{serverConfig:u,serverEntry:i.servers[i.selectedServer],serverName:i.selectedServer}),t==="chat"&&f.jsx(Ike,{serverConfigs:E,connectedServerConfigs:l}),t==="interceptor"&&f.jsx(rAe,{connectedServerConfigs:l,selectedServer:i.selectedServer}),t==="tracing"&&f.jsx(nAe,{}),t==="settings"&&f.jsx(QCe,{})]})]})]}),f.jsx(HAe,{})]})}function yLe({children:t,client:e,useAuth:n}){const r=bLe(n);return f.jsx(Nke,{client:e,useAuth:r,children:t})}function bLe(t){return w.useMemo(()=>function(){const{isLoading:n,user:r,getAccessToken:s}=t(),i=w.useCallback(async()=>{try{return await s()}catch{return null}},[s]);return w.useMemo(()=>({isLoading:n,isAuthenticated:!!r,fetchAccessToken:i}),[n,r,i])},[t])}const xLe={environment:"prod",sendDefaultPii:!1,tracesSampleRate:.1,tracePropagationTargets:["localhost",/^\//,/^https?:\/\/[^/]*\.convex\.(cloud|site)/]},_Le={...xLe,dsn:"https://c9df3785c734acfe9dad2d0c1e963e28@o4510109778378752.ingest.us.sentry.io/4510111435063296",replaysSessionSampleRate:.1,replaysOnErrorSampleRate:1};function wLe(){hLe({..._Le,integrations:[QDe(),cLe()]})}wLe();const SLe="https://outstanding-fennec-304.convex.cloud",ELe="client_01K4C1TVPBE7JTBFQJF9SDW9P9",kLe=(()=>{const t="mcpjam://oauth/callback";return typeof window>"u"?t:window.location.protocol==="http:"||window.location.protocol==="https:"?`${window.location.origin}/callback`:t})(),TLe=new bke(SLe),CLe=iX.createRoot(document.getElementById("root")),ALe=f.jsx(Tpe,{clientId:ELe,redirectUri:kLe,children:f.jsx(yLe,{client:TLe,useAuth:da,children:f.jsx(vLe,{})})});CLe.render(f.jsx(w.StrictMode,{children:f.jsx(Mue,{apiKey:zue(),options:Fue(),children:ALe})}));
|
|
1875
|
-
//# sourceMappingURL=index-
|
|
1874
|
+
`;if(typeof t=="string")n=`${r}${t}`;else{const i=new TextEncoder().encode(r);n=new Uint8Array(i.length+t.length),n.set(i),n.set(t,i.length)}return n}async function VDe({client:t,scope:e,replayId:n,event:r}){const s=typeof t._integrations=="object"&&t._integrations!==null&&!Array.isArray(t._integrations)?Object.keys(t._integrations):void 0,i={event_id:n,integrations:s};t.emit("preprocessEvent",r,i);const a=await hG(t.getOptions(),r,i,e,t,Li());if(!a)return null;a.platform=a.platform||"javascript";const l=t.getSdkMetadata(),{name:u,version:d}=l&&l.sdk||{};return a.sdk={...a.sdk,name:u||"sentry.javascript.unknown",version:d||"0.0.0"},a}async function HDe({recordingData:t,replayId:e,segmentId:n,eventContext:r,timestamp:s,session:i}){const a=qDe({recordingData:t,headers:{segment_id:n}}),{urls:l,errorIds:u,traceIds:d,initialTimestamp:p}=r,h=Yt(),g=An(),v=h&&h.getTransport(),b=h&&h.getDsn();if(!h||!v||!b||!i.sampled)return Bo({});const x={type:S2e,replay_start_timestamp:p/1e3,timestamp:s/1e3,error_ids:u,trace_ids:d,urls:l,replay_id:e,segment_id:n,replay_type:i.sampled},E=await VDe({scope:g,client:h,replayId:e,event:x});if(!E)return h.recordDroppedEvent("event_processor","replay",x),yt&&St.info("An event processor returned `null`, will not send event."),Bo({});delete E.sdkProcessingMetadata;const S=BDe(E,a,b,h.getOptions().tunnel);let k;try{k=await v.send(S)}catch(R){const j=new Error(Ej);try{j.cause=R}catch{}throw j}if(typeof k.statusCode=="number"&&(k.statusCode<200||k.statusCode>=300))throw new BW(k.statusCode);const T=SG({},k);if(wG(T,"replay"))throw new Lj(T);return k}class BW extends Error{constructor(e){super(`Transport returned status code ${e}`)}}class Lj extends Error{constructor(e){super("Rate limit hit"),this.rateLimits=e}}async function qW(t,e={count:0,interval:N2e}){const{recordingData:n,onError:r}=t;if(n.length)try{return await HDe(t),!0}catch(s){if(s instanceof BW||s instanceof Lj)throw s;if(gG("Replays",{_retryCount:e.count}),r&&r(s),e.count>=R2e){const i=new Error(`${Ej} - max retries exceeded`);try{i.cause=s}catch{}throw i}return e.interval*=++e.count,new Promise((i,a)=>{Ff(async()=>{try{await qW(t,e),i(!0)}catch(l){a(l)}},e.interval)})}}const VW="__THROTTLED",GDe="__SKIPPED";function WDe(t,e,n){const r=new Map,s=l=>{const u=l-n;r.forEach((d,p)=>{p<u&&r.delete(p)})},i=()=>[...r.values()].reduce((l,u)=>l+u,0);let a=!1;return(...l)=>{const u=Math.floor(Date.now()/1e3);if(s(u),i()>=e){const p=a;return a=!0,p?GDe:VW}a=!1;const d=r.get(u)||0;return r.set(u,d+1),t(...l)}}class Pl{constructor({options:e,recordingOptions:n}){Pl.prototype.__init.call(this),Pl.prototype.__init2.call(this),Pl.prototype.__init3.call(this),Pl.prototype.__init4.call(this),Pl.prototype.__init5.call(this),Pl.prototype.__init6.call(this),this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:E2e,sessionIdleExpire:k2e},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._requiresManualStart=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:""},this._recordingOptions=n,this._options=e,this._debouncedFlush=LDe(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=WDe((a,l)=>BIe(this,a,l),300,5);const{slowClickTimeout:r,slowClickIgnoreSelectors:s}=this.getOptions(),i=r?{threshold:Math.min(j2e,r),timeout:r,scrollTimeout:M2e,ignoreSelector:s?s.join(","):""}:void 0;if(i&&(this.clickDetector=new eIe(this,i)),yt){const a=e._experiments;St.setConfig({captureExceptions:!!a.captureExceptions,traceInternals:!!a.traceInternals})}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(e){yt&&St.exception(e),this._options.onError&&this._options.onError(e)}initializeSampling(e){const{errorSampleRate:n,sessionSampleRate:r}=this._options,s=n<=0&&r<=0;if(this._requiresManualStart=s,!s){if(this._initializeSessionForSampling(e),!this.session){yt&&St.exception(new Error("Unable to initialize and create session"));return}this.session.sampled!==!1&&(this.recordingMode=this.session.sampled==="buffer"&&this.session.segmentId===0?"buffer":"session",yt&&St.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session"){yt&&St.info("Recording is already in progress");return}if(this._isEnabled&&this.recordingMode==="buffer"){yt&&St.info("Buffering is in progress, call `flush()` to save the replay");return}yt&&St.infoTick("Starting replay in session mode"),this._updateUserActivity();const e=rk({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=e,this._initializeRecording()}startBuffering(){if(this._isEnabled){yt&&St.info("Buffering is in progress, call `flush()` to save the replay");return}yt&&St.infoTick("Starting replay in buffer mode");const e=rk({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=e,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{const e=this._canvas;this._stopRecording=Ro({...this._recordingOptions,...this.recordingMode==="buffer"?{checkoutEveryNms:A2e}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:zDe(this),...$De(),onMutation:this._onMutationHandler,...e?{recordCanvas:e.recordCanvas,getCanvasManager:e.getCanvasManager,sampling:e.sampling,dataURLOptions:e.dataURLOptions}:{}})}catch(e){this.handleException(e)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(e){return this.handleException(e),!1}}async stop({forceFlush:e=!1,reason:n}={}){if(this._isEnabled){this._isEnabled=!1;try{yt&&St.info(`Stopping Replay${n?` triggered by ${n}`:""}`),PW(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),e&&await this._flush({force:!0}),this.eventBuffer&&this.eventBuffer.destroy(),this.eventBuffer=null,LIe(this)}catch(r){this.handleException(r)}}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),yt&&St.info("Pausing replay"))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),yt&&St.info("Resuming replay"))}async sendBufferedReplayOrFlush({continueRecording:e=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();const n=Date.now();yt&&St.info("Converting buffer to session"),await this.flushImmediate();const r=this.stopRecording();!e||!r||this.recordingMode!=="session"&&(this.recordingMode="session",this.session&&(this._updateUserActivity(n),this._updateSessionActivity(n),this._maybeSaveSession()),this.startRecording())}addUpdate(e){const n=e();this.recordingMode!=="buffer"&&n!==!0&&this._debouncedFlush()}triggerUserActivity(){if(this._updateUserActivity(),!this._stopRecording){if(!this._checkSession())return;this.resume();return}this.checkAndHandleExpiredSession(),this._updateSessionActivity()}updateUserActivity(){this._updateUserActivity(),this._updateSessionActivity()}conditionalFlush(){return this.recordingMode==="buffer"?Promise.resolve():this.flushImmediate()}flush(){return this._debouncedFlush()}flushImmediate(){return this._debouncedFlush(),this._debouncedFlush.flush()}cancelFlush(){this._debouncedFlush.cancel()}getSessionId(){return this.session&&this.session.id}checkAndHandleExpiredSession(){if(this._lastActivity&&sA(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session&&this.session.sampled==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){const e=`${kn.location.pathname}${kn.location.hash}${kn.location.search}`,n=`${kn.location.origin}${e}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=n,this._context.initialTimestamp=Date.now(),this._context.urls.push(n)}throttledAddEvent(e,n){const r=this._throttledAddEvent(e,n);if(r===VW){const s=Ra({category:"replay.throttled"});this.addUpdate(()=>!Ij(this,{type:WPe,timestamp:s.timestamp||0,data:{tag:"breadcrumb",payload:s,metric:!0}}))}return r}getCurrentRoute(){const e=this.lastActiveSpan||$r(),n=e&&Kr(e),s=(n&&rn(n).data||{})[Na];if(!(!n||!s||!["route","custom"].includes(s)))return rn(n).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=PIe({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.startRecording()}_initializeSessionForSampling(e){const n=this._options.errorSampleRate>0,r=rk({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,previousSessionId:e},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:n});this.session=r}_checkSession(){if(!this.session)return!1;const e=this.session;return RW(e,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})?(this._refreshSession(e),!1):!0}async _refreshSession(e){this._isEnabled&&(await this.stop({reason:"refresh session"}),this.initializeSampling(e.id))}_addListeners(){try{kn.document.addEventListener("visibilitychange",this._handleVisibilityChange),kn.addEventListener("blur",this._handleWindowBlur),kn.addEventListener("focus",this._handleWindowFocus),kn.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(PDe(this),this._hasInitializedCoreListeners=!0)}catch(e){this.handleException(e)}this._performanceCleanupCallback=CIe(this)}_removeListeners(){try{kn.document.removeEventListener("visibilitychange",this._handleVisibilityChange),kn.removeEventListener("blur",this._handleWindowBlur),kn.removeEventListener("focus",this._handleWindowFocus),kn.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(e){this.handleException(e)}}__init(){this._handleVisibilityChange=()=>{kn.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()}}__init2(){this._handleWindowBlur=()=>{const e=Ra({category:"ui.blur"});this._doChangeToBackgroundTasks(e)}}__init3(){this._handleWindowFocus=()=>{const e=Ra({category:"ui.focus"});this._doChangeToForegroundTasks(e)}}__init4(){this._handleKeyboardEvent=e=>{hIe(this,e)}}_doChangeToBackgroundTasks(e){!this.session||NW(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})||(e&&this._createCustomBreadcrumb(e),this.conditionalFlush())}_doChangeToForegroundTasks(e){if(!this.session)return;if(!this.checkAndHandleExpiredSession()){yt&&St.info("Document has become active, but session has expired");return}e&&this._createCustomBreadcrumb(e)}_updateUserActivity(e=Date.now()){this._lastActivity=e}_updateSessionActivity(e=Date.now()){this.session&&(this.session.lastActivity=e,this._maybeSaveSession())}_createCustomBreadcrumb(e){this.addUpdate(()=>{this.throttledAddEvent({type:Ft.Custom,timestamp:e.timestamp||0,data:{tag:"breadcrumb",payload:e}})})}_addPerformanceEntries(){let e=vIe(this.performanceEntries).concat(this.replayPerformanceEntries);if(this.performanceEntries=[],this.replayPerformanceEntries=[],this._requiresManualStart){const n=this._context.initialTimestamp/1e3;e=e.filter(r=>r.start>=n)}return Promise.all(a_(this,e))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){const{session:e,eventBuffer:n}=this;if(!e||!n||this._requiresManualStart||e.segmentId)return;const r=n.getEarliestTimestamp();r&&r<this._context.initialTimestamp&&(this._context.initialTimestamp=r)}_popEventContext(){const e={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),urls:this._context.urls};return this._clearContext(),e}async _runFlush(){const e=this.getSessionId();if(!this.session||!this.eventBuffer||!e){yt&&St.error("No session or eventBuffer found to flush.");return}if(await this._addPerformanceEntries(),!(!this.eventBuffer||!this.eventBuffer.hasEvents)&&(await IDe(this),!!this.eventBuffer&&e===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();const n=Date.now();if(n-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new Error("Session is too long, not sending replay");const r=this._popEventContext(),s=this.session.segmentId++;this._maybeSaveSession();const i=await this.eventBuffer.finish();await qW({replayId:e,recordingData:i,segmentId:s,eventContext:r,session:this.session,timestamp:n,onError:a=>this.handleException(a)})}catch(n){this.handleException(n),this.stop({reason:"sendReplay"});const r=Yt();if(r){const s=n instanceof Lj?"ratelimit_backoff":"send_error";r.recordDroppedEvent(s,"replay")}}}__init5(){this._flush=async({force:e=!1}={})=>{if(!this._isEnabled&&!e)return;if(!this.checkAndHandleExpiredSession()){yt&&St.error("Attempting to finish replay event after session expired.");return}if(!this.session)return;const n=this.session.started,s=Date.now()-n;this._debouncedFlush.cancel();const i=s<this._options.minReplayDuration,a=s>this._options.maxReplayDuration+5e3;if(i||a){yt&&St.info(`Session duration (${Math.floor(s/1e3)}s) is too ${i?"short":"long"}, not sending replay.`),i&&this._debouncedFlush();return}const l=this.eventBuffer;l&&this.session.segmentId===0&&!l.hasCheckout&&yt&&St.info("Flushing initial segment without checkout.");const u=!!this._flushLock;this._flushLock||(this._flushLock=this._runFlush());try{await this._flushLock}catch(d){this.handleException(d)}finally{this._flushLock=void 0,u&&this._debouncedFlush()}}}_maybeSaveSession(){this.session&&this._options.stickySession&&Pj(this.session)}__init6(){this._onMutationHandler=e=>{const n=e.length,r=this._options.mutationLimit,s=this._options.mutationBreadcrumbLimit,i=r&&n>r;if(n>s||i){const a=Ra({category:"replay.mutations",data:{count:n,limit:i}});this._createCustomBreadcrumb(a)}return i?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}}}function Ap(t,e){return[...t,...e].join(",")}function YDe({mask:t,unmask:e,block:n,unblock:r,ignore:s}){const i=["base","iframe[srcdoc]:not([src])"],a=Ap(t,[".sentry-mask","[data-sentry-mask]"]),l=Ap(e,[]);return{maskTextSelector:a,unmaskTextSelector:l,blockSelector:Ap(n,[".sentry-block","[data-sentry-block]",...i]),unblockSelector:Ap(r,[]),ignoreSelector:Ap(s,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}function KDe({el:t,key:e,maskAttributes:n,maskAllText:r,privacyOptions:s,value:i}){return!r||s.unmaskTextSelector&&t.matches(s.unmaskTextSelector)?i:n.includes(e)||e==="value"&&t.tagName==="INPUT"&&["submit","button"].includes(t.getAttribute("type")||"")?i.replace(/[\S]/g,"*"):i}const bz='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',XDe=["content-length","content-type","accept"];let xz=!1;const QDe=t=>new l_(t);class l_{static __initStatic(){this.id="Replay"}constructor({flushMinDelay:e=T2e,flushMaxDelay:n=C2e,minReplayDuration:r=O2e,maxReplayDuration:s=J$,stickySession:i=!0,useCompression:a=!0,workerUrl:l,_experiments:u={},maskAllText:d=!0,maskAllInputs:p=!0,blockAllMedia:h=!0,mutationBreadcrumbLimit:g=750,mutationLimit:v=1e4,slowClickTimeout:b=7e3,slowClickIgnoreSelectors:x=[],networkDetailAllowUrls:E=[],networkDetailDenyUrls:S=[],networkCaptureBodies:k=!0,networkRequestHeaders:T=[],networkResponseHeaders:R=[],mask:j=[],maskAttributes:A=["title","placeholder"],unmask:N=[],block:M=[],unblock:I=[],ignore:O=[],maskFn:L,beforeAddRecordingEvent:z,beforeErrorSampling:G,onError:W}={}){this.name=l_.id;const X=YDe({mask:j,unmask:N,block:M,unblock:I,ignore:O});if(this._recordingOptions={maskAllInputs:p,maskAllText:d,maskInputOptions:{password:!0},maskTextFn:L,maskInputFn:L,maskAttributeFn:(F,Y,H)=>KDe({maskAttributes:A,maskAllText:d,privacyOptions:X,key:F,value:Y,el:H}),...X,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:F=>{try{F.__rrweb__=!0}catch{}}},this._initialOptions={flushMinDelay:e,flushMaxDelay:n,minReplayDuration:Math.min(r,P2e),maxReplayDuration:Math.min(s,J$),stickySession:i,useCompression:a,workerUrl:l,blockAllMedia:h,maskAllInputs:p,maskAllText:d,mutationBreadcrumbLimit:g,mutationLimit:v,slowClickTimeout:b,slowClickIgnoreSelectors:x,networkDetailAllowUrls:E,networkDetailDenyUrls:S,networkCaptureBodies:k,networkRequestHeaders:_z(T),networkResponseHeaders:_z(R),beforeAddRecordingEvent:z,beforeErrorSampling:G,onError:W,_experiments:u},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${bz}`:bz),this._isInitialized&&B$())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return xz}set _isInitialized(e){xz=e}afterAllSetup(e){!B$()||this._replay||(this._setup(e),this._initialize(e))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(){return this._replay?this._replay.stop({forceFlush:this._replay.recordingMode==="session"}):Promise.resolve()}flush(e){return this._replay?this._replay.isEnabled()?this._replay.sendBufferedReplayOrFlush(e):(this._replay.start(),Promise.resolve()):Promise.resolve()}getReplayId(){if(!(!this._replay||!this._replay.isEnabled()))return this._replay.getSessionId()}getRecordingMode(){if(!(!this._replay||!this._replay.isEnabled()))return this._replay.recordingMode}_initialize(e){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(e),this._replay.initializeSampling())}_setup(e){const n=JDe(this._initialOptions,e);this._replay=new Pl({options:n,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(e){try{const n=e.getIntegrationByName("ReplayCanvas");if(!n)return;this._replay._canvas=n.getOptions()}catch{}}}l_.__initStatic();function JDe(t,e){const n=e.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...Nr(t)},s=Nx(n.replaysSessionSampleRate),i=Nx(n.replaysOnErrorSampleRate);return s==null&&i==null&&dc(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),s!=null&&(r.sessionSampleRate=s),i!=null&&(r.errorSampleRate=i),r}function _z(t){return[...XDe,...t.map(e=>e.toLowerCase())]}const wz=new WeakMap,sk=new Map,gb={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function ZDe(t,e){const{traceFetch:n,traceXHR:r,trackFetchStreamPerformance:s,shouldCreateSpanForRequest:i,enableHTTPTimings:a,tracePropagationTargets:l}={traceFetch:gb.traceFetch,traceXHR:gb.traceXHR,trackFetchStreamPerformance:gb.trackFetchStreamPerformance,...e},u=typeof i=="function"?i:h=>!0,d=h=>nLe(h,l),p={};n&&(t.addEventProcessor(h=>(h.type==="transaction"&&h.spans&&h.spans.forEach(g=>{if(g.op==="http.client"){const v=sk.get(g.span_id);v&&(g.timestamp=v/1e3,sk.delete(g.span_id))}}),h)),s&&qje(h=>{if(h.response){const g=wz.get(h.response);g&&h.endTimestamp&&sk.set(g,h.endTimestamp)}}),jG(h=>{const g=Dje(h,u,d,p);if(h.response&&h.fetchData.__span&&wz.set(h.response,h.fetchData.__span),g){const v=HW(h.fetchData.url),b=v?cu(v).host:void 0;g.setAttributes({"http.url":v,"server.address":b})}a&&g&&Sz(g)})),r&&QG(h=>{const g=rLe(h,u,d,p);a&&g&&Sz(g)})}function eLe(t){return t.entryType==="resource"&&"initiatorType"in t&&typeof t.nextHopProtocol=="string"&&(t.initiatorType==="fetch"||t.initiatorType==="xmlhttprequest")}function Sz(t){const{url:e}=rn(t).data||{};if(!e||typeof e!="string")return;const n=zf("resource",({entries:r})=>{r.forEach(s=>{eLe(s)&&s.name.endsWith(e)&&(tLe(s).forEach(a=>t.setAttribute(...a)),setTimeout(n))})})}function _a(t=0){return((vs||performance.timeOrigin)+t)/1e3}function tLe(t){const{name:e,version:n}=YG(t.nextHopProtocol),r=[];return r.push(["network.protocol.version",n],["network.protocol.name",e]),vs?[...r,["http.request.redirect_start",_a(t.redirectStart)],["http.request.fetch_start",_a(t.fetchStart)],["http.request.domain_lookup_start",_a(t.domainLookupStart)],["http.request.domain_lookup_end",_a(t.domainLookupEnd)],["http.request.connect_start",_a(t.connectStart)],["http.request.secure_connection_start",_a(t.secureConnectionStart)],["http.request.connection_end",_a(t.connectEnd)],["http.request.request_start",_a(t.requestStart)],["http.request.response_start",_a(t.responseStart)],["http.request.response_end",_a(t.responseEnd)]]:r}function nLe(t,e){const n=Nt.location&&Nt.location.href;if(n){let r,s;try{r=new URL(t,n),s=new URL(n).origin}catch{return!1}const i=r.origin===s;return e?Vl(r.toString(),e)||i&&Vl(r.pathname,e):i}else{const r=!!t.match(/^\/(?!\/)/);return e?Vl(t,e):r}}function rLe(t,e,n,r){const s=t.xhr,i=s&&s[Kc];if(!s||s.__sentry_own_request__||!i)return;const a=tc()&&e(i.url);if(t.endTimestamp&&a){const h=s.__sentry_xhr_span_id__;if(!h)return;const g=r[h];g&&i.status_code!==void 0&&(G7(g,i.status_code),g.end(),delete r[h]);return}const l=HW(i.url),u=l?cu(l).host:void 0,d=!!$r(),p=a&&d?Og({name:`${i.method} ${i.url}`,attributes:{type:"xhr","http.method":i.method,"http.url":l,url:i.url,"server.address":u,[Dr]:"auto.http.browser",[Tu]:"http.client"}}):new uh;return s.__sentry_xhr_span_id__=p.spanContext().spanId,r[s.__sentry_xhr_span_id__]=p,n(i.url)&&sLe(s,tc()&&d?p:void 0),p}function sLe(t,e){const{"sentry-trace":n,baggage:r}=kG({span:e});n&&iLe(t,n,r)}function iLe(t,e,n){try{t.setRequestHeader("sentry-trace",e),n&&t.setRequestHeader("baggage",n)}catch{}}function HW(t){try{return new URL(t,Nt.location.origin).href}catch{return}}function aLe(){Nt&&Nt.document?Nt.document.addEventListener("visibilitychange",()=>{const t=$r();if(!t)return;const e=Kr(t);if(Nt.document.hidden&&e){const n="cancelled",{op:r,status:s}=rn(e);Ha&&ze.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),s||e.setStatus({code:Or,message:n}),e.setAttribute("sentry.cancellation_reason","document.hidden"),e.end()}}):Ha&&ze.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const oLe="BrowserTracing",lLe={...db,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,_experiments:{},...gb},cLe=(t={})=>{FNe();const{enableInp:e,enableLongTask:n,enableLongAnimationFrame:r,_experiments:{enableInteractions:s,enableStandaloneClsSpans:i},beforeStartSpan:a,idleTimeout:l,finalTimeout:u,childSpanTimeout:d,markBackgroundSpan:p,traceFetch:h,traceXHR:g,trackFetchStreamPerformance:v,shouldCreateSpanForRequest:b,enableHTTPTimings:x,instrumentPageLoad:E,instrumentNavigation:S}={...lLe,...t},k=JMe({recordClsStandaloneSpans:i||!1});e&&SOe(),r&&Kt.PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")?eOe():n&&ZMe(),s&&tOe();const T={name:void 0,source:void 0};function R(j,A){const N=A.op==="pageload",M=a?a(A):A,I=M.attributes||{};A.name!==M.name&&(I[Na]="custom",M.attributes=I),T.name=M.name,T.source=I[Na];const O=fG(M,{idleTimeout:l,finalTimeout:u,childSpanTimeout:d,disableAutoFinish:N,beforeSpanEnd:z=>{k(),aOe(z,{recordClsOnPageloadSpan:!i})}});function L(){["interactive","complete"].includes(Nt.document.readyState)&&j.emit("idleSpanEnableAutoFinish",O)}return N&&Nt.document&&(Nt.document.addEventListener("readystatechange",()=>{L()}),L()),O}return{name:oLe,afterAllSetup(j){let A,N=Nt.location&&Nt.location.href;function M(){A&&!rn(A).timestamp&&(Ha&&ze.log(`[Tracing] Finishing current active span with op: ${rn(A).op}`),A.end())}j.on("startNavigationSpan",I=>{Yt()===j&&(M(),A=R(j,{op:"navigation",...I}))}),j.on("startPageLoadSpan",(I,O={})=>{if(Yt()!==j)return;M();const L=O.sentryTrace||Ez("sentry-trace"),z=O.baggage||Ez("baggage"),G=ONe(L,z);An().setPropagationContext(G),A=R(j,{op:"pageload",...I})}),j.on("spanEnd",I=>{const O=rn(I).op;if(I!==Kr(I)||O!=="navigation"&&O!=="pageload")return;const L=An(),z=L.getPropagationContext();L.setPropagationContext({...z,sampled:z.sampled!==void 0?z.sampled:Mu(I),dsc:z.dsc||Ou(I)})}),Nt.location&&(E&&uLe(j,{name:Nt.location.pathname,startTime:vs?vs/1e3:void 0,attributes:{[Na]:"url",[Dr]:"auto.pageload.browser"}}),S&&t_(({to:I,from:O})=>{if(O===void 0&&N&&N.indexOf(I)!==-1){N=void 0;return}O!==I&&(N=void 0,dLe(j,{name:Nt.location.pathname,attributes:{[Na]:"url",[Dr]:"auto.navigation.browser"}}))})),p&&aLe(),s&&fLe(l,u,d,T),e&&kOe(),ZDe(j,{traceFetch:h,traceXHR:g,trackFetchStreamPerformance:v,tracePropagationTargets:j.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:b,enableHTTPTimings:x})}}};function uLe(t,e,n){t.emit("startPageLoadSpan",e,n),An().setTransactionName(e.name);const r=$r();return(r&&rn(r).op)==="pageload"?r:void 0}function dLe(t,e){Li().setPropagationContext({traceId:Zl()}),An().setPropagationContext({traceId:Zl()}),t.emit("startNavigationSpan",e),An().setTransactionName(e.name);const n=$r();return(n&&rn(n).op)==="navigation"?n:void 0}function Ez(t){const e=iNe(`meta[name=${t}]`);return e?e.getAttribute("content"):void 0}function fLe(t,e,n,r){let s;const i=()=>{const a="ui.action.click",l=$r(),u=l&&Kr(l);if(u){const d=rn(u).op;if(["navigation","pageload"].includes(d)){Ha&&ze.warn(`[Tracing] Did not create ${a} span because a pageload or navigation span is in progress.`);return}}if(s&&(s.setAttribute(PC,"interactionInterrupted"),s.end(),s=void 0),!r.name){Ha&&ze.warn(`[Tracing] Did not create ${a} transaction because _latestRouteName is missing.`);return}s=fG({name:r.name,op:a,attributes:{[Na]:r.source||"url"}},{idleTimeout:t,finalTimeout:e,childSpanTimeout:n})};Nt.document&&addEventListener("click",i,{once:!1,capture:!0})}function hLe(t){const e={...t};return EG(e,"react"),gG("react",{version:w.version}),w2e(e)}function pLe(){const{user:t}=da(),{isAuthenticated:e,isLoading:n}=Xa(),r=d7("users:ensureUser"),s=w.useRef(null);w.useEffect(()=>{e||(s.current=null,A$(null))},[e]),w.useEffect(()=>{if(!n){if(!e&&t)throw console.log("useEnsureDbUser: not authenticated"),new Error("Not authenticated");e&&t&&s.current!==t.id&&r().then(i=>{s.current=t.id,A$({id:t.id})}).catch(i=>{console.error("[auth] ensureUser failed",i),s.current=null})}},[e,n,t,r])}function mLe(){const t=ua(),{user:e}=da(),{isAuthenticated:n}=Xa();w.useEffect(()=>{t&&(n&&e?(t.identify(e.id,{email:e.email,name:e.firstName&&e.lastName?`${e.firstName} ${e.lastName}`:e.email,first_name:e.firstName,last_name:e.lastName}),t.register({user_id:e.id})):t.reset())},[t,n,e])}function kz({className:t,...e}){return f.jsx(BJ,{"data-slot":"avatar",className:Me("relative flex size-8 shrink-0 overflow-hidden rounded-full",t),...e})}function Tz({className:t,...e}){return f.jsx(qJ,{"data-slot":"avatar-image",className:Me("aspect-square size-full",t),...e})}function Cz({className:t,...e}){return f.jsx(VJ,{"data-slot":"avatar-fallback",className:Me("bg-muted flex size-full items-center justify-center rounded-full",t),...e})}function gLe(){const{isLoading:t}=Xa(),{user:e,signIn:n,signOut:r,signUp:s}=da(),i=ua();if(t)return f.jsx(Ie,{variant:"outline",size:"sm",disabled:!0,children:f.jsx(ir,{className:"h-3 w-3 mr-1.5 animate-spin"})});if(!e)return f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Ie,{variant:"outline",onClick:()=>{i.capture("sign_in",{location:"auth_upper_area",platform:Ni(),environment:void 0}),n()},children:"Sign in"}),f.jsx(Ie,{onClick:()=>{i.capture("create_account",{location:"auth_upper_area",platform:Ni(),environment:void 0}),s()},style:{backgroundColor:"#E55A3A"},children:"Create account"})]});const a=[e.firstName,e.lastName].filter(Boolean).join(" "),l=e.email,u=zX(a),d=()=>{const h=window.location.origin,v=h.includes("://localhost")?h.replace("://localhost","://127.0.0.1"):h;r({returnTo:v})},p=e.profilePictureUrl||void 0;return f.jsxs(p0,{children:[f.jsx(m0,{asChild:!0,children:f.jsx("button",{className:"flex size-10 items-center justify-center rounded-full border border-border/60 bg-background/80 shadow-sm outline-none transition hover:ring-2 hover:ring-ring/20 focus-visible:ring-2 focus-visible:ring-ring",children:f.jsxs(kz,{className:"size-9 cursor-pointer",children:[f.jsx(Tz,{src:p,alt:a}),f.jsx(Cz,{className:"bg-muted text-muted-foreground text-sm font-medium",children:u!=="?"?u:f.jsx(aI,{className:"size-4"})})]})})}),f.jsxs(g0,{className:"w-56",align:"end",children:[f.jsx(rae,{className:"pb-3",children:f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsxs(kz,{className:"size-10 cursor-pointer",children:[f.jsx(Tz,{src:p,alt:a}),f.jsx(Cz,{className:"bg-muted text-muted-foreground text-base font-semibold",children:u!=="?"?u:f.jsx(aI,{className:"size-5"})})]}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("p",{className:"text-sm font-medium leading-none truncate",children:a}),f.jsx("p",{className:"text-xs text-muted-foreground truncate",children:l})]})]})}),f.jsx(dI,{}),f.jsxs(To,{onClick:()=>window.location.hash="settings",className:"cursor-pointer",children:[f.jsx(ZA,{className:"size-4"}),"Settings"]}),f.jsx(dI,{}),f.jsxs(To,{variant:"destructive",onClick:d,className:"cursor-pointer",children:[f.jsx(Fse,{className:"size-4"}),"Log out"]})]})]})}function vLe(){const[t,e]=w.useState("servers"),n=ua();mLe(),w.useEffect(()=>{n.capture("app_launched",{platform:Ni(),environment:void 0,user_agent:navigator.userAgent})},[]),GAe(),pLe();const r=w.useMemo(()=>window.location.pathname.startsWith("/oauth/callback/debug"),[]),s=w.useMemo(()=>window.location.pathname==="/callback",[]),{appState:i,isLoading:a,connectedServerConfigs:l,selectedMCPConfig:u,handleConnect:d,handleDisconnect:p,handleReconnect:h,handleUpdate:g,handleRemoveServer:v,setSelectedServer:b,toggleServerSelection:x,selectedMCPConfigsMap:E,setSelectedMultipleServersToAllServers:S}=g7();w.useEffect(()=>{const T=()=>{const R=(window.location.hash||"#servers").replace("#","");e(R),R==="chat"&&S()};return T(),window.addEventListener("hashchange",T),()=>window.removeEventListener("hashchange",T)},[S]);const k=T=>{T==="chat"&&S(),window.location.hash=T,e(T)};return r?f.jsx(cAe,{}):s?(w.useEffect(()=>{const T=setTimeout(()=>{window.location.href="/"},5e3);return()=>clearTimeout(T)},[]),f.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:f.jsxs("div",{className:"text-center",children:[f.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto"}),f.jsx("p",{className:"mt-4 text-muted-foreground",children:"Completing sign in..."}),f.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:"If this takes too long, you'll be redirected automatically"})]})})):a?f.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:f.jsxs("div",{className:"text-center",children:[f.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto"}),f.jsx("p",{className:"mt-4 text-muted-foreground",children:"Loading..."})]})}):f.jsxs(ZEe,{themeMode:"light",themePreset:"default",children:[f.jsxs(EAe,{defaultOpen:!0,children:[f.jsx(LAe,{onNavigate:k,activeTab:t}),f.jsxs(CAe,{className:"flex flex-col",children:[f.jsx("header",{className:"flex h-12 shrink-0 items-center gap-2 border-b transition-[width,height] ease-linear drag",children:f.jsxs("div",{className:"flex w-full items-center justify-between px-4 lg:px-6",children:[f.jsx("div",{className:"flex items-center gap-1 lg:gap-2",children:f.jsx(TAe,{className:"-ml-1"})}),f.jsx("div",{className:"flex items-center gap-2",children:f.jsx(gLe,{})})]})}),f.jsxs("div",{className:"flex-1",children:[(t==="tools"||t==="resources"||t==="prompts"||t==="auth"||t==="chat"||t==="interceptor")&&f.jsx(FAe,{connectedServerConfigs:l,selectedServer:i.selectedServer,onServerChange:b,onConnect:d,isMultiSelectEnabled:t==="chat",onMultiServerToggle:x,selectedMultipleServers:i.selectedMultipleServers}),t==="servers"&&f.jsx(Vue,{connectedServerConfigs:l,onConnect:d,onDisconnect:p,onReconnect:h,onUpdate:g,onRemove:v}),t==="tools"&&f.jsx(Khe,{serverConfig:u,serverName:i.selectedServer}),t==="evals"&&f.jsx(nTe,{}),t==="eval-results"&&f.jsx(Bke,{}),t==="resources"&&f.jsx(Xhe,{serverConfig:u,serverName:i.selectedServer}),t==="prompts"&&f.jsx(Qhe,{serverConfig:u,serverName:i.selectedServer}),t==="auth"&&f.jsx(lAe,{serverConfig:u,serverEntry:i.servers[i.selectedServer],serverName:i.selectedServer}),t==="chat"&&f.jsx(Ike,{serverConfigs:E,connectedServerConfigs:l}),t==="interceptor"&&f.jsx(rAe,{connectedServerConfigs:l,selectedServer:i.selectedServer}),t==="tracing"&&f.jsx(nAe,{}),t==="settings"&&f.jsx(QCe,{})]})]})]}),f.jsx(HAe,{})]})}function yLe({children:t,client:e,useAuth:n}){const r=bLe(n);return f.jsx(Nke,{client:e,useAuth:r,children:t})}function bLe(t){return w.useMemo(()=>function(){const{isLoading:n,user:r,getAccessToken:s}=t(),i=w.useCallback(async()=>{try{return await s()}catch{return null}},[s]);return w.useMemo(()=>({isLoading:n,isAuthenticated:!!r,fetchAccessToken:i}),[n,r,i])},[t])}const xLe={environment:"prod",sendDefaultPii:!1,tracesSampleRate:.1,tracePropagationTargets:["localhost",/^\//,/^https?:\/\/[^/]*\.convex\.(cloud|site)/]},_Le={...xLe,dsn:"https://c9df3785c734acfe9dad2d0c1e963e28@o4510109778378752.ingest.us.sentry.io/4510111435063296",replaysSessionSampleRate:.1,replaysOnErrorSampleRate:1};function wLe(){hLe({..._Le,integrations:[QDe(),cLe()]})}wLe();const SLe="https://outstanding-fennec-304.convex.cloud",ELe="client_01K4C1TVPBE7JTBFQJF9SDW9P9",kLe=(()=>{const t="mcpjam://oauth/callback";return typeof window>"u"?t:window.location.protocol==="http:"||window.location.protocol==="https:"?`${window.location.origin}/callback`:t})(),TLe=new bke(SLe),CLe=iX.createRoot(document.getElementById("root")),ALe=f.jsx(Tpe,{clientId:ELe,redirectUri:kLe,children:f.jsx(yLe,{client:TLe,useAuth:da,children:f.jsx(vLe,{})})});CLe.render(f.jsx(w.StrictMode,{children:f.jsx(Mue,{apiKey:zue(),options:Fue(),children:ALe})}));
|
|
1875
|
+
//# sourceMappingURL=index-DzmPRJya.js.map
|