@mobile-reality/mdma-cli 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,724 @@
1
+ var l1=Object.defineProperty;var s1=(i,n,a)=>n in i?l1(i,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[n]=a;var oa=(i,n,a)=>s1(i,typeof n!="symbol"?n+"":n,a);(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))s(u);new MutationObserver(u=>{for(const o of u)if(o.type==="childList")for(const f of o.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&s(f)}).observe(document,{childList:!0,subtree:!0});function a(u){const o={};return u.integrity&&(o.integrity=u.integrity),u.referrerPolicy&&(o.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?o.credentials="include":u.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(u){if(u.ep)return;u.ep=!0;const o=a(u);fetch(u.href,o)}})();function r1(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var pf={exports:{}},xs={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Ey;function u1(){if(Ey)return xs;Ey=1;var i=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function a(s,u,o){var f=null;if(o!==void 0&&(f=""+o),u.key!==void 0&&(f=""+u.key),"key"in u){o={};for(var h in u)h!=="key"&&(o[h]=u[h])}else o=u;return u=o.ref,{$$typeof:i,type:s,key:f,ref:u!==void 0?u:null,props:o}}return xs.Fragment=n,xs.jsx=a,xs.jsxs=a,xs}var Ny;function o1(){return Ny||(Ny=1,pf.exports=u1()),pf.exports}var x=o1(),yf={exports:{}},we={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Cy;function c1(){if(Cy)return we;Cy=1;var i=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),f=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),_=Symbol.iterator;function v(N){return N===null||typeof N!="object"?null:(N=_&&N[_]||N["@@iterator"],typeof N=="function"?N:null)}var O={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,j={};function E(N,U,k){this.props=N,this.context=U,this.refs=j,this.updater=k||O}E.prototype.isReactComponent={},E.prototype.setState=function(N,U){if(typeof N!="object"&&typeof N!="function"&&N!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,N,U,"setState")},E.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function H(){}H.prototype=E.prototype;function I(N,U,k){this.props=N,this.context=U,this.refs=j,this.updater=k||O}var Q=I.prototype=new H;Q.constructor=I,w(Q,E.prototype),Q.isPureReactComponent=!0;var F=Array.isArray;function L(){}var Z={H:null,A:null,T:null,S:null},J=Object.prototype.hasOwnProperty;function le(N,U,k){var W=k.ref;return{$$typeof:i,type:N,key:U,ref:W!==void 0?W:null,props:k}}function ye(N,U){return le(N.type,U,N.props)}function ie(N){return typeof N=="object"&&N!==null&&N.$$typeof===i}function P(N){var U={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(k){return U[k]})}var ke=/\/+/g;function Ce(N,U){return typeof N=="object"&&N!==null&&N.key!=null?P(""+N.key):U.toString(36)}function ve(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(L,L):(N.status="pending",N.then(function(U){N.status==="pending"&&(N.status="fulfilled",N.value=U)},function(U){N.status==="pending"&&(N.status="rejected",N.reason=U)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function B(N,U,k,W,ce){var re=typeof N;(re==="undefined"||re==="boolean")&&(N=null);var pe=!1;if(N===null)pe=!0;else switch(re){case"bigint":case"string":case"number":pe=!0;break;case"object":switch(N.$$typeof){case i:case n:pe=!0;break;case b:return pe=N._init,B(pe(N._payload),U,k,W,ce)}}if(pe)return ce=ce(N),pe=W===""?"."+Ce(N,0):W,F(ce)?(k="",pe!=null&&(k=pe.replace(ke,"$&/")+"/"),B(ce,U,k,"",function(pt){return pt})):ce!=null&&(ie(ce)&&(ce=ye(ce,k+(ce.key==null||N&&N.key===ce.key?"":(""+ce.key).replace(ke,"$&/")+"/")+pe)),U.push(ce)),1;pe=0;var Ze=W===""?".":W+":";if(F(N))for(var Be=0;Be<N.length;Be++)W=N[Be],re=Ze+Ce(W,Be),pe+=B(W,U,k,re,ce);else if(Be=v(N),typeof Be=="function")for(N=Be.call(N),Be=0;!(W=N.next()).done;)W=W.value,re=Ze+Ce(W,Be++),pe+=B(W,U,k,re,ce);else if(re==="object"){if(typeof N.then=="function")return B(ve(N),U,k,W,ce);throw U=String(N),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return pe}function $(N,U,k){if(N==null)return N;var W=[],ce=0;return B(N,W,"","",function(re){return U.call(k,re,ce++)}),W}function fe(N){if(N._status===-1){var U=N._result;U=U(),U.then(function(k){(N._status===0||N._status===-1)&&(N._status=1,N._result=k)},function(k){(N._status===0||N._status===-1)&&(N._status=2,N._result=k)}),N._status===-1&&(N._status=0,N._result=U)}if(N._status===1)return N._result.default;throw N._result}var te=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},A={map:$,forEach:function(N,U,k){$(N,function(){U.apply(this,arguments)},k)},count:function(N){var U=0;return $(N,function(){U++}),U},toArray:function(N){return $(N,function(U){return U})||[]},only:function(N){if(!ie(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return we.Activity=g,we.Children=A,we.Component=E,we.Fragment=a,we.Profiler=u,we.PureComponent=I,we.StrictMode=s,we.Suspense=p,we.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Z,we.__COMPILER_RUNTIME={__proto__:null,c:function(N){return Z.H.useMemoCache(N)}},we.cache=function(N){return function(){return N.apply(null,arguments)}},we.cacheSignal=function(){return null},we.cloneElement=function(N,U,k){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var W=w({},N.props),ce=N.key;if(U!=null)for(re in U.key!==void 0&&(ce=""+U.key),U)!J.call(U,re)||re==="key"||re==="__self"||re==="__source"||re==="ref"&&U.ref===void 0||(W[re]=U[re]);var re=arguments.length-2;if(re===1)W.children=k;else if(1<re){for(var pe=Array(re),Ze=0;Ze<re;Ze++)pe[Ze]=arguments[Ze+2];W.children=pe}return le(N.type,ce,W)},we.createContext=function(N){return N={$$typeof:f,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:o,_context:N},N},we.createElement=function(N,U,k){var W,ce={},re=null;if(U!=null)for(W in U.key!==void 0&&(re=""+U.key),U)J.call(U,W)&&W!=="key"&&W!=="__self"&&W!=="__source"&&(ce[W]=U[W]);var pe=arguments.length-2;if(pe===1)ce.children=k;else if(1<pe){for(var Ze=Array(pe),Be=0;Be<pe;Be++)Ze[Be]=arguments[Be+2];ce.children=Ze}if(N&&N.defaultProps)for(W in pe=N.defaultProps,pe)ce[W]===void 0&&(ce[W]=pe[W]);return le(N,re,ce)},we.createRef=function(){return{current:null}},we.forwardRef=function(N){return{$$typeof:h,render:N}},we.isValidElement=ie,we.lazy=function(N){return{$$typeof:b,_payload:{_status:-1,_result:N},_init:fe}},we.memo=function(N,U){return{$$typeof:m,type:N,compare:U===void 0?null:U}},we.startTransition=function(N){var U=Z.T,k={};Z.T=k;try{var W=N(),ce=Z.S;ce!==null&&ce(k,W),typeof W=="object"&&W!==null&&typeof W.then=="function"&&W.then(L,te)}catch(re){te(re)}finally{U!==null&&k.types!==null&&(U.types=k.types),Z.T=U}},we.unstable_useCacheRefresh=function(){return Z.H.useCacheRefresh()},we.use=function(N){return Z.H.use(N)},we.useActionState=function(N,U,k){return Z.H.useActionState(N,U,k)},we.useCallback=function(N,U){return Z.H.useCallback(N,U)},we.useContext=function(N){return Z.H.useContext(N)},we.useDebugValue=function(){},we.useDeferredValue=function(N,U){return Z.H.useDeferredValue(N,U)},we.useEffect=function(N,U){return Z.H.useEffect(N,U)},we.useEffectEvent=function(N){return Z.H.useEffectEvent(N)},we.useId=function(){return Z.H.useId()},we.useImperativeHandle=function(N,U,k){return Z.H.useImperativeHandle(N,U,k)},we.useInsertionEffect=function(N,U){return Z.H.useInsertionEffect(N,U)},we.useLayoutEffect=function(N,U){return Z.H.useLayoutEffect(N,U)},we.useMemo=function(N,U){return Z.H.useMemo(N,U)},we.useOptimistic=function(N,U){return Z.H.useOptimistic(N,U)},we.useReducer=function(N,U,k){return Z.H.useReducer(N,U,k)},we.useRef=function(N){return Z.H.useRef(N)},we.useState=function(N){return Z.H.useState(N)},we.useSyncExternalStore=function(N,U,k){return Z.H.useSyncExternalStore(N,U,k)},we.useTransition=function(){return Z.H.useTransition()},we.version="19.2.4",we}var Oy;function rd(){return Oy||(Oy=1,yf.exports=c1()),yf.exports}var ne=rd(),gf={exports:{}},Ss={},bf={exports:{}},vf={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var My;function f1(){return My||(My=1,(function(i){function n(B,$){var fe=B.length;B.push($);e:for(;0<fe;){var te=fe-1>>>1,A=B[te];if(0<u(A,$))B[te]=$,B[fe]=A,fe=te;else break e}}function a(B){return B.length===0?null:B[0]}function s(B){if(B.length===0)return null;var $=B[0],fe=B.pop();if(fe!==$){B[0]=fe;e:for(var te=0,A=B.length,N=A>>>1;te<N;){var U=2*(te+1)-1,k=B[U],W=U+1,ce=B[W];if(0>u(k,fe))W<A&&0>u(ce,k)?(B[te]=ce,B[W]=fe,te=W):(B[te]=k,B[U]=fe,te=U);else if(W<A&&0>u(ce,fe))B[te]=ce,B[W]=fe,te=W;else break e}}return $}function u(B,$){var fe=B.sortIndex-$.sortIndex;return fe!==0?fe:B.id-$.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;i.unstable_now=function(){return o.now()}}else{var f=Date,h=f.now();i.unstable_now=function(){return f.now()-h}}var p=[],m=[],b=1,g=null,_=3,v=!1,O=!1,w=!1,j=!1,E=typeof setTimeout=="function"?setTimeout:null,H=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;function Q(B){for(var $=a(m);$!==null;){if($.callback===null)s(m);else if($.startTime<=B)s(m),$.sortIndex=$.expirationTime,n(p,$);else break;$=a(m)}}function F(B){if(w=!1,Q(B),!O)if(a(p)!==null)O=!0,L||(L=!0,P());else{var $=a(m);$!==null&&ve(F,$.startTime-B)}}var L=!1,Z=-1,J=5,le=-1;function ye(){return j?!0:!(i.unstable_now()-le<J)}function ie(){if(j=!1,L){var B=i.unstable_now();le=B;var $=!0;try{e:{O=!1,w&&(w=!1,H(Z),Z=-1),v=!0;var fe=_;try{t:{for(Q(B),g=a(p);g!==null&&!(g.expirationTime>B&&ye());){var te=g.callback;if(typeof te=="function"){g.callback=null,_=g.priorityLevel;var A=te(g.expirationTime<=B);if(B=i.unstable_now(),typeof A=="function"){g.callback=A,Q(B),$=!0;break t}g===a(p)&&s(p),Q(B)}else s(p);g=a(p)}if(g!==null)$=!0;else{var N=a(m);N!==null&&ve(F,N.startTime-B),$=!1}}break e}finally{g=null,_=fe,v=!1}$=void 0}}finally{$?P():L=!1}}}var P;if(typeof I=="function")P=function(){I(ie)};else if(typeof MessageChannel<"u"){var ke=new MessageChannel,Ce=ke.port2;ke.port1.onmessage=ie,P=function(){Ce.postMessage(null)}}else P=function(){E(ie,0)};function ve(B,$){Z=E(function(){B(i.unstable_now())},$)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(B){B.callback=null},i.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):J=0<B?Math.floor(1e3/B):5},i.unstable_getCurrentPriorityLevel=function(){return _},i.unstable_next=function(B){switch(_){case 1:case 2:case 3:var $=3;break;default:$=_}var fe=_;_=$;try{return B()}finally{_=fe}},i.unstable_requestPaint=function(){j=!0},i.unstable_runWithPriority=function(B,$){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var fe=_;_=B;try{return $()}finally{_=fe}},i.unstable_scheduleCallback=function(B,$,fe){var te=i.unstable_now();switch(typeof fe=="object"&&fe!==null?(fe=fe.delay,fe=typeof fe=="number"&&0<fe?te+fe:te):fe=te,B){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=fe+A,B={id:b++,callback:$,priorityLevel:B,startTime:fe,expirationTime:A,sortIndex:-1},fe>te?(B.sortIndex=fe,n(m,B),a(p)===null&&B===a(m)&&(w?(H(Z),Z=-1):w=!0,ve(F,fe-te))):(B.sortIndex=A,n(p,B),O||v||(O=!0,L||(L=!0,P()))),B},i.unstable_shouldYield=ye,i.unstable_wrapCallback=function(B){var $=_;return function(){var fe=_;_=$;try{return B.apply(this,arguments)}finally{_=fe}}}})(vf)),vf}var jy;function d1(){return jy||(jy=1,bf.exports=f1()),bf.exports}var xf={exports:{}},Et={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var Dy;function h1(){if(Dy)return Et;Dy=1;var i=rd();function n(p){var m="https://react.dev/errors/"+p;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)m+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+p+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var s={d:{f:a,r:function(){throw Error(n(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},u=Symbol.for("react.portal");function o(p,m,b){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:g==null?null:""+g,children:p,containerInfo:m,implementation:b}}var f=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(p,m){if(p==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return Et.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,Et.createPortal=function(p,m){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(n(299));return o(p,m,null,b)},Et.flushSync=function(p){var m=f.T,b=s.p;try{if(f.T=null,s.p=2,p)return p()}finally{f.T=m,s.p=b,s.d.f()}},Et.preconnect=function(p,m){typeof p=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,s.d.C(p,m))},Et.prefetchDNS=function(p){typeof p=="string"&&s.d.D(p)},Et.preinit=function(p,m){if(typeof p=="string"&&m&&typeof m.as=="string"){var b=m.as,g=h(b,m.crossOrigin),_=typeof m.integrity=="string"?m.integrity:void 0,v=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;b==="style"?s.d.S(p,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:g,integrity:_,fetchPriority:v}):b==="script"&&s.d.X(p,{crossOrigin:g,integrity:_,fetchPriority:v,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},Et.preinitModule=function(p,m){if(typeof p=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var b=h(m.as,m.crossOrigin);s.d.M(p,{crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&s.d.M(p)},Et.preload=function(p,m){if(typeof p=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var b=m.as,g=h(b,m.crossOrigin);s.d.L(p,b,{crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},Et.preloadModule=function(p,m){if(typeof p=="string")if(m){var b=h(m.as,m.crossOrigin);s.d.m(p,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else s.d.m(p)},Et.requestFormReset=function(p){s.d.r(p)},Et.unstable_batchedUpdates=function(p,m){return p(m)},Et.useFormState=function(p,m,b){return f.H.useFormState(p,m,b)},Et.useFormStatus=function(){return f.H.useHostTransitionStatus()},Et.version="19.2.4",Et}var zy;function m1(){if(zy)return xf.exports;zy=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(n){console.error(n)}}return i(),xf.exports=h1(),xf.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var Ry;function p1(){if(Ry)return Ss;Ry=1;var i=d1(),n=rd(),a=m1();function s(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)t+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,l=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(l=t.return),e=t.return;while(e)}return t.tag===3?l:null}function f(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function h(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(o(e)!==e)throw Error(s(188))}function m(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(s(188));return t!==e?null:e}for(var l=e,r=t;;){var c=l.return;if(c===null)break;var d=c.alternate;if(d===null){if(r=c.return,r!==null){l=r;continue}break}if(c.child===d.child){for(d=c.child;d;){if(d===l)return p(c),e;if(d===r)return p(c),t;d=d.sibling}throw Error(s(188))}if(l.return!==r.return)l=c,r=d;else{for(var y=!1,S=c.child;S;){if(S===l){y=!0,l=c,r=d;break}if(S===r){y=!0,r=c,l=d;break}S=S.sibling}if(!y){for(S=d.child;S;){if(S===l){y=!0,l=d,r=c;break}if(S===r){y=!0,r=d,l=c;break}S=S.sibling}if(!y)throw Error(s(189))}}if(l.alternate!==r)throw Error(s(190))}if(l.tag!==3)throw Error(s(188));return l.stateNode.current===l?e:t}function b(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=b(e),t!==null)return t;e=e.sibling}return null}var g=Object.assign,_=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),O=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),H=Symbol.for("react.consumer"),I=Symbol.for("react.context"),Q=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),J=Symbol.for("react.lazy"),le=Symbol.for("react.activity"),ye=Symbol.for("react.memo_cache_sentinel"),ie=Symbol.iterator;function P(e){return e===null||typeof e!="object"?null:(e=ie&&e[ie]||e["@@iterator"],typeof e=="function"?e:null)}var ke=Symbol.for("react.client.reference");function Ce(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ke?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case w:return"Fragment";case E:return"Profiler";case j:return"StrictMode";case F:return"Suspense";case L:return"SuspenseList";case le:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case O:return"Portal";case I:return e.displayName||"Context";case H:return(e._context.displayName||"Context")+".Consumer";case Q:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Z:return t=e.displayName||null,t!==null?t:Ce(e.type)||"Memo";case J:t=e._payload,e=e._init;try{return Ce(e(t))}catch{}}return null}var ve=Array.isArray,B=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,fe={pending:!1,data:null,method:null,action:null},te=[],A=-1;function N(e){return{current:e}}function U(e){0>A||(e.current=te[A],te[A]=null,A--)}function k(e,t){A++,te[A]=e.current,e.current=t}var W=N(null),ce=N(null),re=N(null),pe=N(null);function Ze(e,t){switch(k(re,t),k(ce,e),k(W,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Jp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Jp(t),e=Fp(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}U(W),k(W,e)}function Be(){U(W),U(ce),U(re)}function pt(e){e.memoizedState!==null&&k(pe,e);var t=W.current,l=Fp(t,e.type);t!==l&&(k(ce,e),k(W,l))}function gn(e){ce.current===e&&(U(W),U(ce)),pe.current===e&&(U(pe),ys._currentValue=fe)}var qn,Zs;function Un(e){if(qn===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);qn=t&&t[1]||"",Zs=-1<l.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+qn+e+Zs}var Sa=!1;function _a(e,t){if(!e||Sa)return"";Sa=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var K=function(){throw Error()};if(Object.defineProperty(K.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(K,[])}catch(q){var R=q}Reflect.construct(e,[],K)}else{try{K.call()}catch(q){R=q}e.call(K.prototype)}}else{try{throw Error()}catch(q){R=q}(K=e())&&typeof K.catch=="function"&&K.catch(function(){})}}catch(q){if(q&&R&&typeof q.stack=="string")return[q.stack,R.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=r.DetermineComponentFrameRoot(),y=d[0],S=d[1];if(y&&S){var T=y.split(`
44
+ `),z=S.split(`
45
+ `);for(c=r=0;r<T.length&&!T[r].includes("DetermineComponentFrameRoot");)r++;for(;c<z.length&&!z[c].includes("DetermineComponentFrameRoot");)c++;if(r===T.length||c===z.length)for(r=T.length-1,c=z.length-1;1<=r&&0<=c&&T[r]!==z[c];)c--;for(;1<=r&&0<=c;r--,c--)if(T[r]!==z[c]){if(r!==1||c!==1)do if(r--,c--,0>c||T[r]!==z[c]){var Y=`
46
+ `+T[r].replace(" at new "," at ");return e.displayName&&Y.includes("<anonymous>")&&(Y=Y.replace("<anonymous>",e.displayName)),Y}while(1<=r&&0<=c);break}}}finally{Sa=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?Un(l):""}function Qs(e,t){switch(e.tag){case 26:case 27:case 5:return Un(e.type);case 16:return Un("Lazy");case 13:return e.child!==t&&t!==null?Un("Suspense Fallback"):Un("Suspense");case 19:return Un("SuspenseList");case 0:case 15:return _a(e.type,!1);case 11:return _a(e.type.render,!1);case 1:return _a(e.type,!0);case 31:return Un("Activity");default:return""}}function $s(e){try{var t="",l=null;do t+=Qs(e,l),l=e,e=e.return;while(e);return t}catch(r){return`
47
+ Error generating stack: `+r.message+`
48
+ `+r.stack}}var ka=Object.prototype.hasOwnProperty,wa=i.unstable_scheduleCallback,Nl=i.unstable_cancelCallback,Wu=i.unstable_shouldYield,Pu=i.unstable_requestPaint,Nt=i.unstable_now,eo=i.unstable_getCurrentPriorityLevel,V=i.unstable_ImmediatePriority,ee=i.unstable_UserBlockingPriority,be=i.unstable_NormalPriority,Oe=i.unstable_LowPriority,Ve=i.unstable_IdlePriority,Zt=i.log,In=i.unstable_setDisableYieldValue,Ct=null,yt=null;function Rt(e){if(typeof Zt=="function"&&In(e),yt&&typeof yt.setStrictMode=="function")try{yt.setStrictMode(Ct,e)}catch{}}var Je=Math.clz32?Math.clz32:Kb,di=Math.log,bn=Math.LN2;function Kb(e){return e>>>=0,e===0?32:31-(di(e)/bn|0)|0}var Xs=256,Js=262144,Fs=4194304;function Ki(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ws(e,t,l){var r=e.pendingLanes;if(r===0)return 0;var c=0,d=e.suspendedLanes,y=e.pingedLanes;e=e.warmLanes;var S=r&134217727;return S!==0?(r=S&~d,r!==0?c=Ki(r):(y&=S,y!==0?c=Ki(y):l||(l=S&~e,l!==0&&(c=Ki(l))))):(S=r&~d,S!==0?c=Ki(S):y!==0?c=Ki(y):l||(l=r&~e,l!==0&&(c=Ki(l)))),c===0?0:t!==0&&t!==c&&(t&d)===0&&(d=c&-c,l=t&-t,d>=l||d===32&&(l&4194048)!==0)?t:c}function Cl(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Zb(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 Md(){var e=Fs;return Fs<<=1,(Fs&62914560)===0&&(Fs=4194304),e}function to(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function Ol(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Qb(e,t,l,r,c,d){var y=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var S=e.entanglements,T=e.expirationTimes,z=e.hiddenUpdates;for(l=y&~l;0<l;){var Y=31-Je(l),K=1<<Y;S[Y]=0,T[Y]=-1;var R=z[Y];if(R!==null)for(z[Y]=null,Y=0;Y<R.length;Y++){var q=R[Y];q!==null&&(q.lane&=-536870913)}l&=~K}r!==0&&jd(e,r,0),d!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=d&~(y&~t))}function jd(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Je(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|l&261930}function Dd(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var r=31-Je(l),c=1<<r;c&t|e[r]&t&&(e[r]|=t),l&=~c}}function zd(e,t){var l=t&-t;return l=(l&42)!==0?1:no(l),(l&(e.suspendedLanes|t))!==0?0:l}function no(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function io(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Rd(){var e=$.p;return e!==0?e:(e=window.event,e===void 0?32:xy(e.type))}function Ld(e,t){var l=$.p;try{return $.p=e,t()}finally{$.p=l}}var hi=Math.random().toString(36).slice(2),_t="__reactFiber$"+hi,Lt="__reactProps$"+hi,Aa="__reactContainer$"+hi,ao="__reactEvents$"+hi,$b="__reactListeners$"+hi,Xb="__reactHandles$"+hi,Bd="__reactResources$"+hi,Ml="__reactMarker$"+hi;function lo(e){delete e[_t],delete e[Lt],delete e[ao],delete e[$b],delete e[Xb]}function Ta(e){var t=e[_t];if(t)return t;for(var l=e.parentNode;l;){if(t=l[Aa]||l[_t]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=ay(e);e!==null;){if(l=e[_t])return l;e=ay(e)}return t}e=l,l=e.parentNode}return null}function Ea(e){if(e=e[_t]||e[Aa]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function jl(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(s(33))}function Na(e){var t=e[Bd];return t||(t=e[Bd]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function vt(e){e[Ml]=!0}var qd=new Set,Ud={};function Zi(e,t){Ca(e,t),Ca(e+"Capture",t)}function Ca(e,t){for(Ud[e]=t,e=0;e<t.length;e++)qd.add(t[e])}var Jb=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]*$"),Id={},Hd={};function Fb(e){return ka.call(Hd,e)?!0:ka.call(Id,e)?!1:Jb.test(e)?Hd[e]=!0:(Id[e]=!0,!1)}function Ps(e,t,l){if(Fb(t))if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+l)}}function er(e,t,l){if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+l)}}function Hn(e,t,l,r){if(r===null)e.removeAttribute(l);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(t,l,""+r)}}function tn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Yd(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Wb(e,t,l){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var c=r.get,d=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(y){l=""+y,d.call(this,y)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return l},setValue:function(y){l=""+y},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function so(e){if(!e._valueTracker){var t=Yd(e)?"checked":"value";e._valueTracker=Wb(e,t,""+e[t])}}function Vd(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),r="";return e&&(r=Yd(e)?e.checked?"true":"false":e.value),e=r,e!==l?(t.setValue(e),!0):!1}function tr(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Pb=/[\n"\\]/g;function nn(e){return e.replace(Pb,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ro(e,t,l,r,c,d,y,S){e.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.type=y:e.removeAttribute("type"),t!=null?y==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+tn(t)):e.value!==""+tn(t)&&(e.value=""+tn(t)):y!=="submit"&&y!=="reset"||e.removeAttribute("value"),t!=null?uo(e,y,tn(t)):l!=null?uo(e,y,tn(l)):r!=null&&e.removeAttribute("value"),c==null&&d!=null&&(e.defaultChecked=!!d),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.name=""+tn(S):e.removeAttribute("name")}function Gd(e,t,l,r,c,d,y,S){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),t!=null||l!=null){if(!(d!=="submit"&&d!=="reset"||t!=null)){so(e);return}l=l!=null?""+tn(l):"",t=t!=null?""+tn(t):l,S||t===e.value||(e.value=t),e.defaultValue=t}r=r??c,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=S?e.checked:!!r,e.defaultChecked=!!r,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(e.name=y),so(e)}function uo(e,t,l){t==="number"&&tr(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function Oa(e,t,l,r){if(e=e.options,t){t={};for(var c=0;c<l.length;c++)t["$"+l[c]]=!0;for(l=0;l<e.length;l++)c=t.hasOwnProperty("$"+e[l].value),e[l].selected!==c&&(e[l].selected=c),c&&r&&(e[l].defaultSelected=!0)}else{for(l=""+tn(l),t=null,c=0;c<e.length;c++){if(e[c].value===l){e[c].selected=!0,r&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function Kd(e,t,l){if(t!=null&&(t=""+tn(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+tn(l):""}function Zd(e,t,l,r){if(t==null){if(r!=null){if(l!=null)throw Error(s(92));if(ve(r)){if(1<r.length)throw Error(s(93));r=r[0]}l=r}l==null&&(l=""),t=l}l=tn(t),e.defaultValue=l,r=e.textContent,r===l&&r!==""&&r!==null&&(e.value=r),so(e)}function Ma(e,t){if(t){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=t;return}}e.textContent=t}var ev=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 Qd(e,t,l){var r=t.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,l):typeof l!="number"||l===0||ev.has(t)?t==="float"?e.cssFloat=l:e[t]=(""+l).trim():e[t]=l+"px"}function $d(e,t,l){if(t!=null&&typeof t!="object")throw Error(s(62));if(e=e.style,l!=null){for(var r in l)!l.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var c in t)r=t[c],t.hasOwnProperty(c)&&l[c]!==r&&Qd(e,c,r)}else for(var d in t)t.hasOwnProperty(d)&&Qd(e,d,t[d])}function oo(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var tv=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"]]),nv=/^[\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 nr(e){return nv.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Yn(){}var co=null;function fo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ja=null,Da=null;function Xd(e){var t=Ea(e);if(t&&(e=t.stateNode)){var l=e[Lt]||null;e:switch(e=t.stateNode,t.type){case"input":if(ro(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),t=l.name,l.type==="radio"&&t!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+nn(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var r=l[t];if(r!==e&&r.form===e.form){var c=r[Lt]||null;if(!c)throw Error(s(90));ro(r,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<l.length;t++)r=l[t],r.form===e.form&&Vd(r)}break e;case"textarea":Kd(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&Oa(e,!!l.multiple,t,!1)}}}var ho=!1;function Jd(e,t,l){if(ho)return e(t,l);ho=!0;try{var r=e(t);return r}finally{if(ho=!1,(ja!==null||Da!==null)&&(Vr(),ja&&(t=ja,e=Da,Da=ja=null,Xd(t),e)))for(t=0;t<e.length;t++)Xd(e[t])}}function Dl(e,t){var l=e.stateNode;if(l===null)return null;var r=l[Lt]||null;if(r===null)return null;l=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(l&&typeof l!="function")throw Error(s(231,t,typeof l));return l}var Vn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),mo=!1;if(Vn)try{var zl={};Object.defineProperty(zl,"passive",{get:function(){mo=!0}}),window.addEventListener("test",zl,zl),window.removeEventListener("test",zl,zl)}catch{mo=!1}var mi=null,po=null,ir=null;function Fd(){if(ir)return ir;var e,t=po,l=t.length,r,c="value"in mi?mi.value:mi.textContent,d=c.length;for(e=0;e<l&&t[e]===c[e];e++);var y=l-e;for(r=1;r<=y&&t[l-r]===c[d-r];r++);return ir=c.slice(e,1<r?1-r:void 0)}function ar(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function lr(){return!0}function Wd(){return!1}function Bt(e){function t(l,r,c,d,y){this._reactName=l,this._targetInst=c,this.type=r,this.nativeEvent=d,this.target=y,this.currentTarget=null;for(var S in e)e.hasOwnProperty(S)&&(l=e[S],this[S]=l?l(d):d[S]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?lr:Wd,this.isPropagationStopped=Wd,this}return g(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=lr)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=lr)},persist:function(){},isPersistent:lr}),t}var Qi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},sr=Bt(Qi),Rl=g({},Qi,{view:0,detail:0}),iv=Bt(Rl),yo,go,Ll,rr=g({},Rl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:vo,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ll&&(Ll&&e.type==="mousemove"?(yo=e.screenX-Ll.screenX,go=e.screenY-Ll.screenY):go=yo=0,Ll=e),yo)},movementY:function(e){return"movementY"in e?e.movementY:go}}),Pd=Bt(rr),av=g({},rr,{dataTransfer:0}),lv=Bt(av),sv=g({},Rl,{relatedTarget:0}),bo=Bt(sv),rv=g({},Qi,{animationName:0,elapsedTime:0,pseudoElement:0}),uv=Bt(rv),ov=g({},Qi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),cv=Bt(ov),fv=g({},Qi,{data:0}),eh=Bt(fv),dv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},hv={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"},mv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function pv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=mv[e])?!!t[e]:!1}function vo(){return pv}var yv=g({},Rl,{key:function(e){if(e.key){var t=dv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ar(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?hv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:vo,charCode:function(e){return e.type==="keypress"?ar(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ar(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),gv=Bt(yv),bv=g({},rr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),th=Bt(bv),vv=g({},Rl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:vo}),xv=Bt(vv),Sv=g({},Qi,{propertyName:0,elapsedTime:0,pseudoElement:0}),_v=Bt(Sv),kv=g({},rr,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),wv=Bt(kv),Av=g({},Qi,{newState:0,oldState:0}),Tv=Bt(Av),Ev=[9,13,27,32],xo=Vn&&"CompositionEvent"in window,Bl=null;Vn&&"documentMode"in document&&(Bl=document.documentMode);var Nv=Vn&&"TextEvent"in window&&!Bl,nh=Vn&&(!xo||Bl&&8<Bl&&11>=Bl),ih=" ",ah=!1;function lh(e,t){switch(e){case"keyup":return Ev.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function sh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var za=!1;function Cv(e,t){switch(e){case"compositionend":return sh(t);case"keypress":return t.which!==32?null:(ah=!0,ih);case"textInput":return e=t.data,e===ih&&ah?null:e;default:return null}}function Ov(e,t){if(za)return e==="compositionend"||!xo&&lh(e,t)?(e=Fd(),ir=po=mi=null,za=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return nh&&t.locale!=="ko"?null:t.data;default:return null}}var Mv={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 rh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Mv[e.type]:t==="textarea"}function uh(e,t,l,r){ja?Da?Da.push(r):Da=[r]:ja=r,t=Jr(t,"onChange"),0<t.length&&(l=new sr("onChange","change",null,l,r),e.push({event:l,listeners:t}))}var ql=null,Ul=null;function jv(e){Gp(e,0)}function ur(e){var t=jl(e);if(Vd(t))return e}function oh(e,t){if(e==="change")return t}var ch=!1;if(Vn){var So;if(Vn){var _o="oninput"in document;if(!_o){var fh=document.createElement("div");fh.setAttribute("oninput","return;"),_o=typeof fh.oninput=="function"}So=_o}else So=!1;ch=So&&(!document.documentMode||9<document.documentMode)}function dh(){ql&&(ql.detachEvent("onpropertychange",hh),Ul=ql=null)}function hh(e){if(e.propertyName==="value"&&ur(Ul)){var t=[];uh(t,Ul,e,fo(e)),Jd(jv,t)}}function Dv(e,t,l){e==="focusin"?(dh(),ql=t,Ul=l,ql.attachEvent("onpropertychange",hh)):e==="focusout"&&dh()}function zv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ur(Ul)}function Rv(e,t){if(e==="click")return ur(t)}function Lv(e,t){if(e==="input"||e==="change")return ur(t)}function Bv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Qt=typeof Object.is=="function"?Object.is:Bv;function Il(e,t){if(Qt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var l=Object.keys(e),r=Object.keys(t);if(l.length!==r.length)return!1;for(r=0;r<l.length;r++){var c=l[r];if(!ka.call(t,c)||!Qt(e[c],t[c]))return!1}return!0}function mh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ph(e,t){var l=mh(e);e=0;for(var r;l;){if(l.nodeType===3){if(r=e+l.textContent.length,e<=t&&r>=t)return{node:l,offset:t-e};e=r}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=mh(l)}}function yh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?yh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function gh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=tr(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=tr(e.document)}return t}function ko(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var qv=Vn&&"documentMode"in document&&11>=document.documentMode,Ra=null,wo=null,Hl=null,Ao=!1;function bh(e,t,l){var r=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Ao||Ra==null||Ra!==tr(r)||(r=Ra,"selectionStart"in r&&ko(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Hl&&Il(Hl,r)||(Hl=r,r=Jr(wo,"onSelect"),0<r.length&&(t=new sr("onSelect","select",null,t,l),e.push({event:t,listeners:r}),t.target=Ra)))}function $i(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var La={animationend:$i("Animation","AnimationEnd"),animationiteration:$i("Animation","AnimationIteration"),animationstart:$i("Animation","AnimationStart"),transitionrun:$i("Transition","TransitionRun"),transitionstart:$i("Transition","TransitionStart"),transitioncancel:$i("Transition","TransitionCancel"),transitionend:$i("Transition","TransitionEnd")},To={},vh={};Vn&&(vh=document.createElement("div").style,"AnimationEvent"in window||(delete La.animationend.animation,delete La.animationiteration.animation,delete La.animationstart.animation),"TransitionEvent"in window||delete La.transitionend.transition);function Xi(e){if(To[e])return To[e];if(!La[e])return e;var t=La[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in vh)return To[e]=t[l];return e}var xh=Xi("animationend"),Sh=Xi("animationiteration"),_h=Xi("animationstart"),Uv=Xi("transitionrun"),Iv=Xi("transitionstart"),Hv=Xi("transitioncancel"),kh=Xi("transitionend"),wh=new Map,Eo="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(" ");Eo.push("scrollEnd");function vn(e,t){wh.set(e,t),Zi(t,[e])}var or=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},an=[],Ba=0,No=0;function cr(){for(var e=Ba,t=No=Ba=0;t<e;){var l=an[t];an[t++]=null;var r=an[t];an[t++]=null;var c=an[t];an[t++]=null;var d=an[t];if(an[t++]=null,r!==null&&c!==null){var y=r.pending;y===null?c.next=c:(c.next=y.next,y.next=c),r.pending=c}d!==0&&Ah(l,c,d)}}function fr(e,t,l,r){an[Ba++]=e,an[Ba++]=t,an[Ba++]=l,an[Ba++]=r,No|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Co(e,t,l,r){return fr(e,t,l,r),dr(e)}function Ji(e,t){return fr(e,null,null,t),dr(e)}function Ah(e,t,l){e.lanes|=l;var r=e.alternate;r!==null&&(r.lanes|=l);for(var c=!1,d=e.return;d!==null;)d.childLanes|=l,r=d.alternate,r!==null&&(r.childLanes|=l),d.tag===22&&(e=d.stateNode,e===null||e._visibility&1||(c=!0)),e=d,d=d.return;return e.tag===3?(d=e.stateNode,c&&t!==null&&(c=31-Je(l),e=d.hiddenUpdates,r=e[c],r===null?e[c]=[t]:r.push(t),t.lane=l|536870912),d):null}function dr(e){if(50<os)throw os=0,qc=null,Error(s(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var qa={};function Yv(e,t,l,r){this.tag=e,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function $t(e,t,l,r){return new Yv(e,t,l,r)}function Oo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Gn(e,t){var l=e.alternate;return l===null?(l=$t(e.tag,t,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=t,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&65011712,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,t=e.dependencies,l.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l.refCleanup=e.refCleanup,l}function Th(e,t){e.flags&=65011714;var l=e.alternate;return l===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=l.childLanes,e.lanes=l.lanes,e.child=l.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=l.memoizedProps,e.memoizedState=l.memoizedState,e.updateQueue=l.updateQueue,e.type=l.type,t=l.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function hr(e,t,l,r,c,d){var y=0;if(r=e,typeof e=="function")Oo(e)&&(y=1);else if(typeof e=="string")y=Q0(e,l,W.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case le:return e=$t(31,l,t,c),e.elementType=le,e.lanes=d,e;case w:return Fi(l.children,c,d,t);case j:y=8,c|=24;break;case E:return e=$t(12,l,t,c|2),e.elementType=E,e.lanes=d,e;case F:return e=$t(13,l,t,c),e.elementType=F,e.lanes=d,e;case L:return e=$t(19,l,t,c),e.elementType=L,e.lanes=d,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case I:y=10;break e;case H:y=9;break e;case Q:y=11;break e;case Z:y=14;break e;case J:y=16,r=null;break e}y=29,l=Error(s(130,e===null?"null":typeof e,"")),r=null}return t=$t(y,l,t,c),t.elementType=e,t.type=r,t.lanes=d,t}function Fi(e,t,l,r){return e=$t(7,e,r,t),e.lanes=l,e}function Mo(e,t,l){return e=$t(6,e,null,t),e.lanes=l,e}function Eh(e){var t=$t(18,null,null,0);return t.stateNode=e,t}function jo(e,t,l){return t=$t(4,e.children!==null?e.children:[],e.key,t),t.lanes=l,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Nh=new WeakMap;function ln(e,t){if(typeof e=="object"&&e!==null){var l=Nh.get(e);return l!==void 0?l:(t={value:e,source:t,stack:$s(t)},Nh.set(e,t),t)}return{value:e,source:t,stack:$s(t)}}var Ua=[],Ia=0,mr=null,Yl=0,sn=[],rn=0,pi=null,Tn=1,En="";function Kn(e,t){Ua[Ia++]=Yl,Ua[Ia++]=mr,mr=e,Yl=t}function Ch(e,t,l){sn[rn++]=Tn,sn[rn++]=En,sn[rn++]=pi,pi=e;var r=Tn;e=En;var c=32-Je(r)-1;r&=~(1<<c),l+=1;var d=32-Je(t)+c;if(30<d){var y=c-c%5;d=(r&(1<<y)-1).toString(32),r>>=y,c-=y,Tn=1<<32-Je(t)+c|l<<c|r,En=d+e}else Tn=1<<d|l<<c|r,En=e}function Do(e){e.return!==null&&(Kn(e,1),Ch(e,1,0))}function zo(e){for(;e===mr;)mr=Ua[--Ia],Ua[Ia]=null,Yl=Ua[--Ia],Ua[Ia]=null;for(;e===pi;)pi=sn[--rn],sn[rn]=null,En=sn[--rn],sn[rn]=null,Tn=sn[--rn],sn[rn]=null}function Oh(e,t){sn[rn++]=Tn,sn[rn++]=En,sn[rn++]=pi,Tn=t.id,En=t.overflow,pi=e}var kt=null,et=null,Le=!1,yi=null,un=!1,Ro=Error(s(519));function gi(e){var t=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Vl(ln(t,e)),Ro}function Mh(e){var t=e.stateNode,l=e.type,r=e.memoizedProps;switch(t[_t]=e,t[Lt]=r,l){case"dialog":je("cancel",t),je("close",t);break;case"iframe":case"object":case"embed":je("load",t);break;case"video":case"audio":for(l=0;l<fs.length;l++)je(fs[l],t);break;case"source":je("error",t);break;case"img":case"image":case"link":je("error",t),je("load",t);break;case"details":je("toggle",t);break;case"input":je("invalid",t),Gd(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":je("invalid",t);break;case"textarea":je("invalid",t),Zd(t,r.value,r.defaultValue,r.children)}l=r.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||t.textContent===""+l||r.suppressHydrationWarning===!0||$p(t.textContent,l)?(r.popover!=null&&(je("beforetoggle",t),je("toggle",t)),r.onScroll!=null&&je("scroll",t),r.onScrollEnd!=null&&je("scrollend",t),r.onClick!=null&&(t.onclick=Yn),t=!0):t=!1,t||gi(e,!0)}function jh(e){for(kt=e.return;kt;)switch(kt.tag){case 5:case 31:case 13:un=!1;return;case 27:case 3:un=!0;return;default:kt=kt.return}}function Ha(e){if(e!==kt)return!1;if(!Le)return jh(e),Le=!0,!1;var t=e.tag,l;if((l=t!==3&&t!==27)&&((l=t===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||Pc(e.type,e.memoizedProps)),l=!l),l&&et&&gi(e),jh(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));et=iy(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));et=iy(e)}else t===27?(t=et,Mi(e.type)?(e=lf,lf=null,et=e):et=t):et=kt?cn(e.stateNode.nextSibling):null;return!0}function Wi(){et=kt=null,Le=!1}function Lo(){var e=yi;return e!==null&&(Ht===null?Ht=e:Ht.push.apply(Ht,e),yi=null),e}function Vl(e){yi===null?yi=[e]:yi.push(e)}var Bo=N(null),Pi=null,Zn=null;function bi(e,t,l){k(Bo,t._currentValue),t._currentValue=l}function Qn(e){e._currentValue=Bo.current,U(Bo)}function qo(e,t,l){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===l)break;e=e.return}}function Uo(e,t,l,r){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var d=c.dependencies;if(d!==null){var y=c.child;d=d.firstContext;e:for(;d!==null;){var S=d;d=c;for(var T=0;T<t.length;T++)if(S.context===t[T]){d.lanes|=l,S=d.alternate,S!==null&&(S.lanes|=l),qo(d.return,l,e),r||(y=null);break e}d=S.next}}else if(c.tag===18){if(y=c.return,y===null)throw Error(s(341));y.lanes|=l,d=y.alternate,d!==null&&(d.lanes|=l),qo(y,l,e),y=null}else y=c.child;if(y!==null)y.return=c;else for(y=c;y!==null;){if(y===e){y=null;break}if(c=y.sibling,c!==null){c.return=y.return,y=c;break}y=y.return}c=y}}function Ya(e,t,l,r){e=null;for(var c=t,d=!1;c!==null;){if(!d){if((c.flags&524288)!==0)d=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var y=c.alternate;if(y===null)throw Error(s(387));if(y=y.memoizedProps,y!==null){var S=c.type;Qt(c.pendingProps.value,y.value)||(e!==null?e.push(S):e=[S])}}else if(c===pe.current){if(y=c.alternate,y===null)throw Error(s(387));y.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(ys):e=[ys])}c=c.return}e!==null&&Uo(t,e,l,r),t.flags|=262144}function pr(e){for(e=e.firstContext;e!==null;){if(!Qt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ea(e){Pi=e,Zn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function wt(e){return Dh(Pi,e)}function yr(e,t){return Pi===null&&ea(e),Dh(e,t)}function Dh(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},Zn===null){if(e===null)throw Error(s(308));Zn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Zn=Zn.next=t;return l}var Vv=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(l,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(l){return l()})}},Gv=i.unstable_scheduleCallback,Kv=i.unstable_NormalPriority,ct={$$typeof:I,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Io(){return{controller:new Vv,data:new Map,refCount:0}}function Gl(e){e.refCount--,e.refCount===0&&Gv(Kv,function(){e.controller.abort()})}var Kl=null,Ho=0,Va=0,Ga=null;function Zv(e,t){if(Kl===null){var l=Kl=[];Ho=0,Va=Gc(),Ga={status:"pending",value:void 0,then:function(r){l.push(r)}}}return Ho++,t.then(zh,zh),t}function zh(){if(--Ho===0&&Kl!==null){Ga!==null&&(Ga.status="fulfilled");var e=Kl;Kl=null,Va=0,Ga=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Qv(e,t){var l=[],r={status:"pending",value:null,reason:null,then:function(c){l.push(c)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var c=0;c<l.length;c++)(0,l[c])(t)},function(c){for(r.status="rejected",r.reason=c,c=0;c<l.length;c++)(0,l[c])(void 0)}),r}var Rh=B.S;B.S=function(e,t){bp=Nt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Zv(e,t),Rh!==null&&Rh(e,t)};var ta=N(null);function Yo(){var e=ta.current;return e!==null?e:Fe.pooledCache}function gr(e,t){t===null?k(ta,ta.current):k(ta,t.pool)}function Lh(){var e=Yo();return e===null?null:{parent:ct._currentValue,pool:e}}var Ka=Error(s(460)),Vo=Error(s(474)),br=Error(s(542)),vr={then:function(){}};function Bh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function qh(e,t,l){switch(l=e[l],l===void 0?e.push(t):l!==t&&(t.then(Yn,Yn),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ih(e),e;default:if(typeof t.status=="string")t.then(Yn,Yn);else{if(e=Fe,e!==null&&100<e.shellSuspendCounter)throw Error(s(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=r}},function(r){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ih(e),e}throw ia=t,Ka}}function na(e){try{var t=e._init;return t(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(ia=l,Ka):l}}var ia=null;function Uh(){if(ia===null)throw Error(s(459));var e=ia;return ia=null,e}function Ih(e){if(e===Ka||e===br)throw Error(s(483))}var Za=null,Zl=0;function xr(e){var t=Zl;return Zl+=1,Za===null&&(Za=[]),qh(Za,e,t)}function Ql(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Sr(e,t){throw t.$$typeof===_?Error(s(525)):(e=Object.prototype.toString.call(t),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Hh(e){function t(M,C){if(e){var D=M.deletions;D===null?(M.deletions=[C],M.flags|=16):D.push(C)}}function l(M,C){if(!e)return null;for(;C!==null;)t(M,C),C=C.sibling;return null}function r(M){for(var C=new Map;M!==null;)M.key!==null?C.set(M.key,M):C.set(M.index,M),M=M.sibling;return C}function c(M,C){return M=Gn(M,C),M.index=0,M.sibling=null,M}function d(M,C,D){return M.index=D,e?(D=M.alternate,D!==null?(D=D.index,D<C?(M.flags|=67108866,C):D):(M.flags|=67108866,C)):(M.flags|=1048576,C)}function y(M){return e&&M.alternate===null&&(M.flags|=67108866),M}function S(M,C,D,G){return C===null||C.tag!==6?(C=Mo(D,M.mode,G),C.return=M,C):(C=c(C,D),C.return=M,C)}function T(M,C,D,G){var me=D.type;return me===w?Y(M,C,D.props.children,G,D.key):C!==null&&(C.elementType===me||typeof me=="object"&&me!==null&&me.$$typeof===J&&na(me)===C.type)?(C=c(C,D.props),Ql(C,D),C.return=M,C):(C=hr(D.type,D.key,D.props,null,M.mode,G),Ql(C,D),C.return=M,C)}function z(M,C,D,G){return C===null||C.tag!==4||C.stateNode.containerInfo!==D.containerInfo||C.stateNode.implementation!==D.implementation?(C=jo(D,M.mode,G),C.return=M,C):(C=c(C,D.children||[]),C.return=M,C)}function Y(M,C,D,G,me){return C===null||C.tag!==7?(C=Fi(D,M.mode,G,me),C.return=M,C):(C=c(C,D),C.return=M,C)}function K(M,C,D){if(typeof C=="string"&&C!==""||typeof C=="number"||typeof C=="bigint")return C=Mo(""+C,M.mode,D),C.return=M,C;if(typeof C=="object"&&C!==null){switch(C.$$typeof){case v:return D=hr(C.type,C.key,C.props,null,M.mode,D),Ql(D,C),D.return=M,D;case O:return C=jo(C,M.mode,D),C.return=M,C;case J:return C=na(C),K(M,C,D)}if(ve(C)||P(C))return C=Fi(C,M.mode,D,null),C.return=M,C;if(typeof C.then=="function")return K(M,xr(C),D);if(C.$$typeof===I)return K(M,yr(M,C),D);Sr(M,C)}return null}function R(M,C,D,G){var me=C!==null?C.key:null;if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return me!==null?null:S(M,C,""+D,G);if(typeof D=="object"&&D!==null){switch(D.$$typeof){case v:return D.key===me?T(M,C,D,G):null;case O:return D.key===me?z(M,C,D,G):null;case J:return D=na(D),R(M,C,D,G)}if(ve(D)||P(D))return me!==null?null:Y(M,C,D,G,null);if(typeof D.then=="function")return R(M,C,xr(D),G);if(D.$$typeof===I)return R(M,C,yr(M,D),G);Sr(M,D)}return null}function q(M,C,D,G,me){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return M=M.get(D)||null,S(C,M,""+G,me);if(typeof G=="object"&&G!==null){switch(G.$$typeof){case v:return M=M.get(G.key===null?D:G.key)||null,T(C,M,G,me);case O:return M=M.get(G.key===null?D:G.key)||null,z(C,M,G,me);case J:return G=na(G),q(M,C,D,G,me)}if(ve(G)||P(G))return M=M.get(D)||null,Y(C,M,G,me,null);if(typeof G.then=="function")return q(M,C,D,xr(G),me);if(G.$$typeof===I)return q(M,C,D,yr(C,G),me);Sr(C,G)}return null}function oe(M,C,D,G){for(var me=null,Ue=null,de=C,Ee=C=0,ze=null;de!==null&&Ee<D.length;Ee++){de.index>Ee?(ze=de,de=null):ze=de.sibling;var Ie=R(M,de,D[Ee],G);if(Ie===null){de===null&&(de=ze);break}e&&de&&Ie.alternate===null&&t(M,de),C=d(Ie,C,Ee),Ue===null?me=Ie:Ue.sibling=Ie,Ue=Ie,de=ze}if(Ee===D.length)return l(M,de),Le&&Kn(M,Ee),me;if(de===null){for(;Ee<D.length;Ee++)de=K(M,D[Ee],G),de!==null&&(C=d(de,C,Ee),Ue===null?me=de:Ue.sibling=de,Ue=de);return Le&&Kn(M,Ee),me}for(de=r(de);Ee<D.length;Ee++)ze=q(de,M,Ee,D[Ee],G),ze!==null&&(e&&ze.alternate!==null&&de.delete(ze.key===null?Ee:ze.key),C=d(ze,C,Ee),Ue===null?me=ze:Ue.sibling=ze,Ue=ze);return e&&de.forEach(function(Li){return t(M,Li)}),Le&&Kn(M,Ee),me}function ge(M,C,D,G){if(D==null)throw Error(s(151));for(var me=null,Ue=null,de=C,Ee=C=0,ze=null,Ie=D.next();de!==null&&!Ie.done;Ee++,Ie=D.next()){de.index>Ee?(ze=de,de=null):ze=de.sibling;var Li=R(M,de,Ie.value,G);if(Li===null){de===null&&(de=ze);break}e&&de&&Li.alternate===null&&t(M,de),C=d(Li,C,Ee),Ue===null?me=Li:Ue.sibling=Li,Ue=Li,de=ze}if(Ie.done)return l(M,de),Le&&Kn(M,Ee),me;if(de===null){for(;!Ie.done;Ee++,Ie=D.next())Ie=K(M,Ie.value,G),Ie!==null&&(C=d(Ie,C,Ee),Ue===null?me=Ie:Ue.sibling=Ie,Ue=Ie);return Le&&Kn(M,Ee),me}for(de=r(de);!Ie.done;Ee++,Ie=D.next())Ie=q(de,M,Ee,Ie.value,G),Ie!==null&&(e&&Ie.alternate!==null&&de.delete(Ie.key===null?Ee:Ie.key),C=d(Ie,C,Ee),Ue===null?me=Ie:Ue.sibling=Ie,Ue=Ie);return e&&de.forEach(function(a1){return t(M,a1)}),Le&&Kn(M,Ee),me}function Xe(M,C,D,G){if(typeof D=="object"&&D!==null&&D.type===w&&D.key===null&&(D=D.props.children),typeof D=="object"&&D!==null){switch(D.$$typeof){case v:e:{for(var me=D.key;C!==null;){if(C.key===me){if(me=D.type,me===w){if(C.tag===7){l(M,C.sibling),G=c(C,D.props.children),G.return=M,M=G;break e}}else if(C.elementType===me||typeof me=="object"&&me!==null&&me.$$typeof===J&&na(me)===C.type){l(M,C.sibling),G=c(C,D.props),Ql(G,D),G.return=M,M=G;break e}l(M,C);break}else t(M,C);C=C.sibling}D.type===w?(G=Fi(D.props.children,M.mode,G,D.key),G.return=M,M=G):(G=hr(D.type,D.key,D.props,null,M.mode,G),Ql(G,D),G.return=M,M=G)}return y(M);case O:e:{for(me=D.key;C!==null;){if(C.key===me)if(C.tag===4&&C.stateNode.containerInfo===D.containerInfo&&C.stateNode.implementation===D.implementation){l(M,C.sibling),G=c(C,D.children||[]),G.return=M,M=G;break e}else{l(M,C);break}else t(M,C);C=C.sibling}G=jo(D,M.mode,G),G.return=M,M=G}return y(M);case J:return D=na(D),Xe(M,C,D,G)}if(ve(D))return oe(M,C,D,G);if(P(D)){if(me=P(D),typeof me!="function")throw Error(s(150));return D=me.call(D),ge(M,C,D,G)}if(typeof D.then=="function")return Xe(M,C,xr(D),G);if(D.$$typeof===I)return Xe(M,C,yr(M,D),G);Sr(M,D)}return typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint"?(D=""+D,C!==null&&C.tag===6?(l(M,C.sibling),G=c(C,D),G.return=M,M=G):(l(M,C),G=Mo(D,M.mode,G),G.return=M,M=G),y(M)):l(M,C)}return function(M,C,D,G){try{Zl=0;var me=Xe(M,C,D,G);return Za=null,me}catch(de){if(de===Ka||de===br)throw de;var Ue=$t(29,de,null,M.mode);return Ue.lanes=G,Ue.return=M,Ue}finally{}}}var aa=Hh(!0),Yh=Hh(!1),vi=!1;function Go(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ko(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function xi(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Si(e,t,l){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(He&2)!==0){var c=r.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),r.pending=t,t=dr(e),Ah(e,null,l),t}return fr(e,r,t,l),dr(e)}function $l(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,l|=r,t.lanes=l,Dd(e,l)}}function Zo(e,t){var l=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,l===r)){var c=null,d=null;if(l=l.firstBaseUpdate,l!==null){do{var y={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};d===null?c=d=y:d=d.next=y,l=l.next}while(l!==null);d===null?c=d=t:d=d.next=t}else c=d=t;l={baseState:r.baseState,firstBaseUpdate:c,lastBaseUpdate:d,shared:r.shared,callbacks:r.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var Qo=!1;function Xl(){if(Qo){var e=Ga;if(e!==null)throw e}}function Jl(e,t,l,r){Qo=!1;var c=e.updateQueue;vi=!1;var d=c.firstBaseUpdate,y=c.lastBaseUpdate,S=c.shared.pending;if(S!==null){c.shared.pending=null;var T=S,z=T.next;T.next=null,y===null?d=z:y.next=z,y=T;var Y=e.alternate;Y!==null&&(Y=Y.updateQueue,S=Y.lastBaseUpdate,S!==y&&(S===null?Y.firstBaseUpdate=z:S.next=z,Y.lastBaseUpdate=T))}if(d!==null){var K=c.baseState;y=0,Y=z=T=null,S=d;do{var R=S.lane&-536870913,q=R!==S.lane;if(q?(De&R)===R:(r&R)===R){R!==0&&R===Va&&(Qo=!0),Y!==null&&(Y=Y.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var oe=e,ge=S;R=t;var Xe=l;switch(ge.tag){case 1:if(oe=ge.payload,typeof oe=="function"){K=oe.call(Xe,K,R);break e}K=oe;break e;case 3:oe.flags=oe.flags&-65537|128;case 0:if(oe=ge.payload,R=typeof oe=="function"?oe.call(Xe,K,R):oe,R==null)break e;K=g({},K,R);break e;case 2:vi=!0}}R=S.callback,R!==null&&(e.flags|=64,q&&(e.flags|=8192),q=c.callbacks,q===null?c.callbacks=[R]:q.push(R))}else q={lane:R,tag:S.tag,payload:S.payload,callback:S.callback,next:null},Y===null?(z=Y=q,T=K):Y=Y.next=q,y|=R;if(S=S.next,S===null){if(S=c.shared.pending,S===null)break;q=S,S=q.next,q.next=null,c.lastBaseUpdate=q,c.shared.pending=null}}while(!0);Y===null&&(T=K),c.baseState=T,c.firstBaseUpdate=z,c.lastBaseUpdate=Y,d===null&&(c.shared.lanes=0),Ti|=y,e.lanes=y,e.memoizedState=K}}function Vh(e,t){if(typeof e!="function")throw Error(s(191,e));e.call(t)}function Gh(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)Vh(l[e],t)}var Qa=N(null),_r=N(0);function Kh(e,t){e=ni,k(_r,e),k(Qa,t),ni=e|t.baseLanes}function $o(){k(_r,ni),k(Qa,Qa.current)}function Xo(){ni=_r.current,U(Qa),U(_r)}var Xt=N(null),on=null;function _i(e){var t=e.alternate;k(lt,lt.current&1),k(Xt,e),on===null&&(t===null||Qa.current!==null||t.memoizedState!==null)&&(on=e)}function Jo(e){k(lt,lt.current),k(Xt,e),on===null&&(on=e)}function Zh(e){e.tag===22?(k(lt,lt.current),k(Xt,e),on===null&&(on=e)):ki()}function ki(){k(lt,lt.current),k(Xt,Xt.current)}function Jt(e){U(Xt),on===e&&(on=null),U(lt)}var lt=N(0);function kr(e){for(var t=e;t!==null;){if(t.tag===13){var l=t.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||nf(l)||af(l)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var $n=0,Te=null,Qe=null,ft=null,wr=!1,$a=!1,la=!1,Ar=0,Fl=0,Xa=null,$v=0;function it(){throw Error(s(321))}function Fo(e,t){if(t===null)return!1;for(var l=0;l<t.length&&l<e.length;l++)if(!Qt(e[l],t[l]))return!1;return!0}function Wo(e,t,l,r,c,d){return $n=d,Te=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,B.H=e===null||e.memoizedState===null?Cm:hc,la=!1,d=l(r,c),la=!1,$a&&(d=$h(t,l,r,c)),Qh(e),d}function Qh(e){B.H=es;var t=Qe!==null&&Qe.next!==null;if($n=0,ft=Qe=Te=null,wr=!1,Fl=0,Xa=null,t)throw Error(s(300));e===null||dt||(e=e.dependencies,e!==null&&pr(e)&&(dt=!0))}function $h(e,t,l,r){Te=e;var c=0;do{if($a&&(Xa=null),Fl=0,$a=!1,25<=c)throw Error(s(301));if(c+=1,ft=Qe=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}B.H=Om,d=t(l,r)}while($a);return d}function Xv(){var e=B.H,t=e.useState()[0];return t=typeof t.then=="function"?Wl(t):t,e=e.useState()[0],(Qe!==null?Qe.memoizedState:null)!==e&&(Te.flags|=1024),t}function Po(){var e=Ar!==0;return Ar=0,e}function ec(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function tc(e){if(wr){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}wr=!1}$n=0,ft=Qe=Te=null,$a=!1,Fl=Ar=0,Xa=null}function Ot(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ft===null?Te.memoizedState=ft=e:ft=ft.next=e,ft}function st(){if(Qe===null){var e=Te.alternate;e=e!==null?e.memoizedState:null}else e=Qe.next;var t=ft===null?Te.memoizedState:ft.next;if(t!==null)ft=t,Qe=e;else{if(e===null)throw Te.alternate===null?Error(s(467)):Error(s(310));Qe=e,e={memoizedState:Qe.memoizedState,baseState:Qe.baseState,baseQueue:Qe.baseQueue,queue:Qe.queue,next:null},ft===null?Te.memoizedState=ft=e:ft=ft.next=e}return ft}function Tr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Wl(e){var t=Fl;return Fl+=1,Xa===null&&(Xa=[]),e=qh(Xa,e,t),t=Te,(ft===null?t.memoizedState:ft.next)===null&&(t=t.alternate,B.H=t===null||t.memoizedState===null?Cm:hc),e}function Er(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Wl(e);if(e.$$typeof===I)return wt(e)}throw Error(s(438,String(e)))}function nc(e){var t=null,l=Te.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var r=Te.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),l===null&&(l=Tr(),Te.updateQueue=l),l.memoCache=t,l=t.data[t.index],l===void 0)for(l=t.data[t.index]=Array(e),r=0;r<e;r++)l[r]=ye;return t.index++,l}function Xn(e,t){return typeof t=="function"?t(e):t}function Nr(e){var t=st();return ic(t,Qe,e)}function ic(e,t,l){var r=e.queue;if(r===null)throw Error(s(311));r.lastRenderedReducer=l;var c=e.baseQueue,d=r.pending;if(d!==null){if(c!==null){var y=c.next;c.next=d.next,d.next=y}t.baseQueue=c=d,r.pending=null}if(d=e.baseState,c===null)e.memoizedState=d;else{t=c.next;var S=y=null,T=null,z=t,Y=!1;do{var K=z.lane&-536870913;if(K!==z.lane?(De&K)===K:($n&K)===K){var R=z.revertLane;if(R===0)T!==null&&(T=T.next={lane:0,revertLane:0,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null}),K===Va&&(Y=!0);else if(($n&R)===R){z=z.next,R===Va&&(Y=!0);continue}else K={lane:0,revertLane:z.revertLane,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},T===null?(S=T=K,y=d):T=T.next=K,Te.lanes|=R,Ti|=R;K=z.action,la&&l(d,K),d=z.hasEagerState?z.eagerState:l(d,K)}else R={lane:K,revertLane:z.revertLane,gesture:z.gesture,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},T===null?(S=T=R,y=d):T=T.next=R,Te.lanes|=K,Ti|=K;z=z.next}while(z!==null&&z!==t);if(T===null?y=d:T.next=S,!Qt(d,e.memoizedState)&&(dt=!0,Y&&(l=Ga,l!==null)))throw l;e.memoizedState=d,e.baseState=y,e.baseQueue=T,r.lastRenderedState=d}return c===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function ac(e){var t=st(),l=t.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=e;var r=l.dispatch,c=l.pending,d=t.memoizedState;if(c!==null){l.pending=null;var y=c=c.next;do d=e(d,y.action),y=y.next;while(y!==c);Qt(d,t.memoizedState)||(dt=!0),t.memoizedState=d,t.baseQueue===null&&(t.baseState=d),l.lastRenderedState=d}return[d,r]}function Xh(e,t,l){var r=Te,c=st(),d=Le;if(d){if(l===void 0)throw Error(s(407));l=l()}else l=t();var y=!Qt((Qe||c).memoizedState,l);if(y&&(c.memoizedState=l,dt=!0),c=c.queue,rc(Wh.bind(null,r,c,e),[e]),c.getSnapshot!==t||y||ft!==null&&ft.memoizedState.tag&1){if(r.flags|=2048,Ja(9,{destroy:void 0},Fh.bind(null,r,c,l,t),null),Fe===null)throw Error(s(349));d||($n&127)!==0||Jh(r,t,l)}return l}function Jh(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=Te.updateQueue,t===null?(t=Tr(),Te.updateQueue=t,t.stores=[e]):(l=t.stores,l===null?t.stores=[e]:l.push(e))}function Fh(e,t,l,r){t.value=l,t.getSnapshot=r,Ph(t)&&em(e)}function Wh(e,t,l){return l(function(){Ph(t)&&em(e)})}function Ph(e){var t=e.getSnapshot;e=e.value;try{var l=t();return!Qt(e,l)}catch{return!0}}function em(e){var t=Ji(e,2);t!==null&&Yt(t,e,2)}function lc(e){var t=Ot();if(typeof e=="function"){var l=e;if(e=l(),la){Rt(!0);try{l()}finally{Rt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xn,lastRenderedState:e},t}function tm(e,t,l,r){return e.baseState=l,ic(e,Qe,typeof r=="function"?r:Xn)}function Jv(e,t,l,r,c){if(Mr(e))throw Error(s(485));if(e=t.action,e!==null){var d={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(y){d.listeners.push(y)}};B.T!==null?l(!0):d.isTransition=!1,r(d),l=t.pending,l===null?(d.next=t.pending=d,nm(t,d)):(d.next=l.next,t.pending=l.next=d)}}function nm(e,t){var l=t.action,r=t.payload,c=e.state;if(t.isTransition){var d=B.T,y={};B.T=y;try{var S=l(c,r),T=B.S;T!==null&&T(y,S),im(e,t,S)}catch(z){sc(e,t,z)}finally{d!==null&&y.types!==null&&(d.types=y.types),B.T=d}}else try{d=l(c,r),im(e,t,d)}catch(z){sc(e,t,z)}}function im(e,t,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(r){am(e,t,r)},function(r){return sc(e,t,r)}):am(e,t,l)}function am(e,t,l){t.status="fulfilled",t.value=l,lm(t),e.state=l,t=e.pending,t!==null&&(l=t.next,l===t?e.pending=null:(l=l.next,t.next=l,nm(e,l)))}function sc(e,t,l){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=l,lm(t),t=t.next;while(t!==r)}e.action=null}function lm(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function sm(e,t){return t}function rm(e,t){if(Le){var l=Fe.formState;if(l!==null){e:{var r=Te;if(Le){if(et){t:{for(var c=et,d=un;c.nodeType!==8;){if(!d){c=null;break t}if(c=cn(c.nextSibling),c===null){c=null;break t}}d=c.data,c=d==="F!"||d==="F"?c:null}if(c){et=cn(c.nextSibling),r=c.data==="F!";break e}}gi(r)}r=!1}r&&(t=l[0])}}return l=Ot(),l.memoizedState=l.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:sm,lastRenderedState:t},l.queue=r,l=Tm.bind(null,Te,r),r.dispatch=l,r=lc(!1),d=dc.bind(null,Te,!1,r.queue),r=Ot(),c={state:t,dispatch:null,action:e,pending:null},r.queue=c,l=Jv.bind(null,Te,c,d,l),c.dispatch=l,r.memoizedState=e,[t,l,!1]}function um(e){var t=st();return om(t,Qe,e)}function om(e,t,l){if(t=ic(e,t,sm)[0],e=Nr(Xn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=Wl(t)}catch(y){throw y===Ka?br:y}else r=t;t=st();var c=t.queue,d=c.dispatch;return l!==t.memoizedState&&(Te.flags|=2048,Ja(9,{destroy:void 0},Fv.bind(null,c,l),null)),[r,d,e]}function Fv(e,t){e.action=t}function cm(e){var t=st(),l=Qe;if(l!==null)return om(t,l,e);st(),t=t.memoizedState,l=st();var r=l.queue.dispatch;return l.memoizedState=e,[t,r,!1]}function Ja(e,t,l,r){return e={tag:e,create:l,deps:r,inst:t,next:null},t=Te.updateQueue,t===null&&(t=Tr(),Te.updateQueue=t),l=t.lastEffect,l===null?t.lastEffect=e.next=e:(r=l.next,l.next=e,e.next=r,t.lastEffect=e),e}function fm(){return st().memoizedState}function Cr(e,t,l,r){var c=Ot();Te.flags|=e,c.memoizedState=Ja(1|t,{destroy:void 0},l,r===void 0?null:r)}function Or(e,t,l,r){var c=st();r=r===void 0?null:r;var d=c.memoizedState.inst;Qe!==null&&r!==null&&Fo(r,Qe.memoizedState.deps)?c.memoizedState=Ja(t,d,l,r):(Te.flags|=e,c.memoizedState=Ja(1|t,d,l,r))}function dm(e,t){Cr(8390656,8,e,t)}function rc(e,t){Or(2048,8,e,t)}function Wv(e){Te.flags|=4;var t=Te.updateQueue;if(t===null)t=Tr(),Te.updateQueue=t,t.events=[e];else{var l=t.events;l===null?t.events=[e]:l.push(e)}}function hm(e){var t=st().memoizedState;return Wv({ref:t,nextImpl:e}),function(){if((He&2)!==0)throw Error(s(440));return t.impl.apply(void 0,arguments)}}function mm(e,t){return Or(4,2,e,t)}function pm(e,t){return Or(4,4,e,t)}function ym(e,t){if(typeof t=="function"){e=e();var l=t(e);return function(){typeof l=="function"?l():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function gm(e,t,l){l=l!=null?l.concat([e]):null,Or(4,4,ym.bind(null,t,e),l)}function uc(){}function bm(e,t){var l=st();t=t===void 0?null:t;var r=l.memoizedState;return t!==null&&Fo(t,r[1])?r[0]:(l.memoizedState=[e,t],e)}function vm(e,t){var l=st();t=t===void 0?null:t;var r=l.memoizedState;if(t!==null&&Fo(t,r[1]))return r[0];if(r=e(),la){Rt(!0);try{e()}finally{Rt(!1)}}return l.memoizedState=[r,t],r}function oc(e,t,l){return l===void 0||($n&1073741824)!==0&&(De&261930)===0?e.memoizedState=t:(e.memoizedState=l,e=xp(),Te.lanes|=e,Ti|=e,l)}function xm(e,t,l,r){return Qt(l,t)?l:Qa.current!==null?(e=oc(e,l,r),Qt(e,t)||(dt=!0),e):($n&42)===0||($n&1073741824)!==0&&(De&261930)===0?(dt=!0,e.memoizedState=l):(e=xp(),Te.lanes|=e,Ti|=e,t)}function Sm(e,t,l,r,c){var d=$.p;$.p=d!==0&&8>d?d:8;var y=B.T,S={};B.T=S,dc(e,!1,t,l);try{var T=c(),z=B.S;if(z!==null&&z(S,T),T!==null&&typeof T=="object"&&typeof T.then=="function"){var Y=Qv(T,r);Pl(e,t,Y,Pt(e))}else Pl(e,t,r,Pt(e))}catch(K){Pl(e,t,{then:function(){},status:"rejected",reason:K},Pt())}finally{$.p=d,y!==null&&S.types!==null&&(y.types=S.types),B.T=y}}function Pv(){}function cc(e,t,l,r){if(e.tag!==5)throw Error(s(476));var c=_m(e).queue;Sm(e,c,t,fe,l===null?Pv:function(){return km(e),l(r)})}function _m(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:fe,baseState:fe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xn,lastRenderedState:fe},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xn,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function km(e){var t=_m(e);t.next===null&&(t=e.alternate.memoizedState),Pl(e,t.next.queue,{},Pt())}function fc(){return wt(ys)}function wm(){return st().memoizedState}function Am(){return st().memoizedState}function e0(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=Pt();e=xi(l);var r=Si(t,e,l);r!==null&&(Yt(r,t,l),$l(r,t,l)),t={cache:Io()},e.payload=t;return}t=t.return}}function t0(e,t,l){var r=Pt();l={lane:r,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Mr(e)?Em(t,l):(l=Co(e,t,l,r),l!==null&&(Yt(l,e,r),Nm(l,t,r)))}function Tm(e,t,l){var r=Pt();Pl(e,t,l,r)}function Pl(e,t,l,r){var c={lane:r,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Mr(e))Em(t,c);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var y=t.lastRenderedState,S=d(y,l);if(c.hasEagerState=!0,c.eagerState=S,Qt(S,y))return fr(e,t,c,0),Fe===null&&cr(),!1}catch{}finally{}if(l=Co(e,t,c,r),l!==null)return Yt(l,e,r),Nm(l,t,r),!0}return!1}function dc(e,t,l,r){if(r={lane:2,revertLane:Gc(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Mr(e)){if(t)throw Error(s(479))}else t=Co(e,l,r,2),t!==null&&Yt(t,e,2)}function Mr(e){var t=e.alternate;return e===Te||t!==null&&t===Te}function Em(e,t){$a=wr=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function Nm(e,t,l){if((l&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,l|=r,t.lanes=l,Dd(e,l)}}var es={readContext:wt,use:Er,useCallback:it,useContext:it,useEffect:it,useImperativeHandle:it,useLayoutEffect:it,useInsertionEffect:it,useMemo:it,useReducer:it,useRef:it,useState:it,useDebugValue:it,useDeferredValue:it,useTransition:it,useSyncExternalStore:it,useId:it,useHostTransitionStatus:it,useFormState:it,useActionState:it,useOptimistic:it,useMemoCache:it,useCacheRefresh:it};es.useEffectEvent=it;var Cm={readContext:wt,use:Er,useCallback:function(e,t){return Ot().memoizedState=[e,t===void 0?null:t],e},useContext:wt,useEffect:dm,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,Cr(4194308,4,ym.bind(null,t,e),l)},useLayoutEffect:function(e,t){return Cr(4194308,4,e,t)},useInsertionEffect:function(e,t){Cr(4,2,e,t)},useMemo:function(e,t){var l=Ot();t=t===void 0?null:t;var r=e();if(la){Rt(!0);try{e()}finally{Rt(!1)}}return l.memoizedState=[r,t],r},useReducer:function(e,t,l){var r=Ot();if(l!==void 0){var c=l(t);if(la){Rt(!0);try{l(t)}finally{Rt(!1)}}}else c=t;return r.memoizedState=r.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},r.queue=e,e=e.dispatch=t0.bind(null,Te,e),[r.memoizedState,e]},useRef:function(e){var t=Ot();return e={current:e},t.memoizedState=e},useState:function(e){e=lc(e);var t=e.queue,l=Tm.bind(null,Te,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:uc,useDeferredValue:function(e,t){var l=Ot();return oc(l,e,t)},useTransition:function(){var e=lc(!1);return e=Sm.bind(null,Te,e.queue,!0,!1),Ot().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var r=Te,c=Ot();if(Le){if(l===void 0)throw Error(s(407));l=l()}else{if(l=t(),Fe===null)throw Error(s(349));(De&127)!==0||Jh(r,t,l)}c.memoizedState=l;var d={value:l,getSnapshot:t};return c.queue=d,dm(Wh.bind(null,r,d,e),[e]),r.flags|=2048,Ja(9,{destroy:void 0},Fh.bind(null,r,d,l,t),null),l},useId:function(){var e=Ot(),t=Fe.identifierPrefix;if(Le){var l=En,r=Tn;l=(r&~(1<<32-Je(r)-1)).toString(32)+l,t="_"+t+"R_"+l,l=Ar++,0<l&&(t+="H"+l.toString(32)),t+="_"}else l=$v++,t="_"+t+"r_"+l.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:fc,useFormState:rm,useActionState:rm,useOptimistic:function(e){var t=Ot();t.memoizedState=t.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=l,t=dc.bind(null,Te,!0,l),l.dispatch=t,[e,t]},useMemoCache:nc,useCacheRefresh:function(){return Ot().memoizedState=e0.bind(null,Te)},useEffectEvent:function(e){var t=Ot(),l={impl:e};return t.memoizedState=l,function(){if((He&2)!==0)throw Error(s(440));return l.impl.apply(void 0,arguments)}}},hc={readContext:wt,use:Er,useCallback:bm,useContext:wt,useEffect:rc,useImperativeHandle:gm,useInsertionEffect:mm,useLayoutEffect:pm,useMemo:vm,useReducer:Nr,useRef:fm,useState:function(){return Nr(Xn)},useDebugValue:uc,useDeferredValue:function(e,t){var l=st();return xm(l,Qe.memoizedState,e,t)},useTransition:function(){var e=Nr(Xn)[0],t=st().memoizedState;return[typeof e=="boolean"?e:Wl(e),t]},useSyncExternalStore:Xh,useId:wm,useHostTransitionStatus:fc,useFormState:um,useActionState:um,useOptimistic:function(e,t){var l=st();return tm(l,Qe,e,t)},useMemoCache:nc,useCacheRefresh:Am};hc.useEffectEvent=hm;var Om={readContext:wt,use:Er,useCallback:bm,useContext:wt,useEffect:rc,useImperativeHandle:gm,useInsertionEffect:mm,useLayoutEffect:pm,useMemo:vm,useReducer:ac,useRef:fm,useState:function(){return ac(Xn)},useDebugValue:uc,useDeferredValue:function(e,t){var l=st();return Qe===null?oc(l,e,t):xm(l,Qe.memoizedState,e,t)},useTransition:function(){var e=ac(Xn)[0],t=st().memoizedState;return[typeof e=="boolean"?e:Wl(e),t]},useSyncExternalStore:Xh,useId:wm,useHostTransitionStatus:fc,useFormState:cm,useActionState:cm,useOptimistic:function(e,t){var l=st();return Qe!==null?tm(l,Qe,e,t):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:nc,useCacheRefresh:Am};Om.useEffectEvent=hm;function mc(e,t,l,r){t=e.memoizedState,l=l(r,t),l=l==null?t:g({},t,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var pc={enqueueSetState:function(e,t,l){e=e._reactInternals;var r=Pt(),c=xi(r);c.payload=t,l!=null&&(c.callback=l),t=Si(e,c,r),t!==null&&(Yt(t,e,r),$l(t,e,r))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var r=Pt(),c=xi(r);c.tag=1,c.payload=t,l!=null&&(c.callback=l),t=Si(e,c,r),t!==null&&(Yt(t,e,r),$l(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=Pt(),r=xi(l);r.tag=2,t!=null&&(r.callback=t),t=Si(e,r,l),t!==null&&(Yt(t,e,l),$l(t,e,l))}};function Mm(e,t,l,r,c,d,y){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,d,y):t.prototype&&t.prototype.isPureReactComponent?!Il(l,r)||!Il(c,d):!0}function jm(e,t,l,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(l,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(l,r),t.state!==e&&pc.enqueueReplaceState(t,t.state,null)}function sa(e,t){var l=t;if("ref"in t){l={};for(var r in t)r!=="ref"&&(l[r]=t[r])}if(e=e.defaultProps){l===t&&(l=g({},l));for(var c in e)l[c]===void 0&&(l[c]=e[c])}return l}function Dm(e){or(e)}function zm(e){console.error(e)}function Rm(e){or(e)}function jr(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function Lm(e,t,l){try{var r=e.onCaughtError;r(l.value,{componentStack:l.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function yc(e,t,l){return l=xi(l),l.tag=3,l.payload={element:null},l.callback=function(){jr(e,t)},l}function Bm(e){return e=xi(e),e.tag=3,e}function qm(e,t,l,r){var c=l.type.getDerivedStateFromError;if(typeof c=="function"){var d=r.value;e.payload=function(){return c(d)},e.callback=function(){Lm(t,l,r)}}var y=l.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(e.callback=function(){Lm(t,l,r),typeof c!="function"&&(Ei===null?Ei=new Set([this]):Ei.add(this));var S=r.stack;this.componentDidCatch(r.value,{componentStack:S!==null?S:""})})}function n0(e,t,l,r,c){if(l.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=l.alternate,t!==null&&Ya(t,l,c,!0),l=Xt.current,l!==null){switch(l.tag){case 31:case 13:return on===null?Gr():l.alternate===null&&at===0&&(at=3),l.flags&=-257,l.flags|=65536,l.lanes=c,r===vr?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([r]):t.add(r),Hc(e,r,c)),!1;case 22:return l.flags|=65536,r===vr?l.flags|=16384:(t=l.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},l.updateQueue=t):(l=t.retryQueue,l===null?t.retryQueue=new Set([r]):l.add(r)),Hc(e,r,c)),!1}throw Error(s(435,l.tag))}return Hc(e,r,c),Gr(),!1}if(Le)return t=Xt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,r!==Ro&&(e=Error(s(422),{cause:r}),Vl(ln(e,l)))):(r!==Ro&&(t=Error(s(423),{cause:r}),Vl(ln(t,l))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,r=ln(r,l),c=yc(e.stateNode,r,c),Zo(e,c),at!==4&&(at=2)),!1;var d=Error(s(520),{cause:r});if(d=ln(d,l),us===null?us=[d]:us.push(d),at!==4&&(at=2),t===null)return!0;r=ln(r,l),l=t;do{switch(l.tag){case 3:return l.flags|=65536,e=c&-c,l.lanes|=e,e=yc(l.stateNode,r,e),Zo(l,e),!1;case 1:if(t=l.type,d=l.stateNode,(l.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(Ei===null||!Ei.has(d))))return l.flags|=65536,c&=-c,l.lanes|=c,c=Bm(c),qm(c,e,l,r),Zo(l,c),!1}l=l.return}while(l!==null);return!1}var gc=Error(s(461)),dt=!1;function At(e,t,l,r){t.child=e===null?Yh(t,null,l,r):aa(t,e.child,l,r)}function Um(e,t,l,r,c){l=l.render;var d=t.ref;if("ref"in r){var y={};for(var S in r)S!=="ref"&&(y[S]=r[S])}else y=r;return ea(t),r=Wo(e,t,l,y,d,c),S=Po(),e!==null&&!dt?(ec(e,t,c),Jn(e,t,c)):(Le&&S&&Do(t),t.flags|=1,At(e,t,r,c),t.child)}function Im(e,t,l,r,c){if(e===null){var d=l.type;return typeof d=="function"&&!Oo(d)&&d.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=d,Hm(e,t,d,r,c)):(e=hr(l.type,null,r,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(d=e.child,!Ac(e,c)){var y=d.memoizedProps;if(l=l.compare,l=l!==null?l:Il,l(y,r)&&e.ref===t.ref)return Jn(e,t,c)}return t.flags|=1,e=Gn(d,r),e.ref=t.ref,e.return=t,t.child=e}function Hm(e,t,l,r,c){if(e!==null){var d=e.memoizedProps;if(Il(d,r)&&e.ref===t.ref)if(dt=!1,t.pendingProps=r=d,Ac(e,c))(e.flags&131072)!==0&&(dt=!0);else return t.lanes=e.lanes,Jn(e,t,c)}return bc(e,t,l,r,c)}function Ym(e,t,l,r){var c=r.children,d=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((t.flags&128)!==0){if(d=d!==null?d.baseLanes|l:l,e!==null){for(r=t.child=e.child,c=0;r!==null;)c=c|r.lanes|r.childLanes,r=r.sibling;r=c&~d}else r=0,t.child=null;return Vm(e,t,d,l,r)}if((l&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&gr(t,d!==null?d.cachePool:null),d!==null?Kh(t,d):$o(),Zh(t);else return r=t.lanes=536870912,Vm(e,t,d!==null?d.baseLanes|l:l,l,r)}else d!==null?(gr(t,d.cachePool),Kh(t,d),ki(),t.memoizedState=null):(e!==null&&gr(t,null),$o(),ki());return At(e,t,c,l),t.child}function ts(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Vm(e,t,l,r,c){var d=Yo();return d=d===null?null:{parent:ct._currentValue,pool:d},t.memoizedState={baseLanes:l,cachePool:d},e!==null&&gr(t,null),$o(),Zh(t),e!==null&&Ya(e,t,r,!0),t.childLanes=c,null}function Dr(e,t){return t=Rr({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Gm(e,t,l){return aa(t,e.child,null,l),e=Dr(t,t.pendingProps),e.flags|=2,Jt(t),t.memoizedState=null,e}function i0(e,t,l){var r=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Le){if(r.mode==="hidden")return e=Dr(t,r),t.lanes=536870912,ts(null,e);if(Jo(t),(e=et)?(e=ny(e,un),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:pi!==null?{id:Tn,overflow:En}:null,retryLane:536870912,hydrationErrors:null},l=Eh(e),l.return=t,t.child=l,kt=t,et=null)):e=null,e===null)throw gi(t);return t.lanes=536870912,null}return Dr(t,r)}var d=e.memoizedState;if(d!==null){var y=d.dehydrated;if(Jo(t),c)if(t.flags&256)t.flags&=-257,t=Gm(e,t,l);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(s(558));else if(dt||Ya(e,t,l,!1),c=(l&e.childLanes)!==0,dt||c){if(r=Fe,r!==null&&(y=zd(r,l),y!==0&&y!==d.retryLane))throw d.retryLane=y,Ji(e,y),Yt(r,e,y),gc;Gr(),t=Gm(e,t,l)}else e=d.treeContext,et=cn(y.nextSibling),kt=t,Le=!0,yi=null,un=!1,e!==null&&Oh(t,e),t=Dr(t,r),t.flags|=4096;return t}return e=Gn(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function zr(e,t){var l=t.ref;if(l===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(s(284));(e===null||e.ref!==l)&&(t.flags|=4194816)}}function bc(e,t,l,r,c){return ea(t),l=Wo(e,t,l,r,void 0,c),r=Po(),e!==null&&!dt?(ec(e,t,c),Jn(e,t,c)):(Le&&r&&Do(t),t.flags|=1,At(e,t,l,c),t.child)}function Km(e,t,l,r,c,d){return ea(t),t.updateQueue=null,l=$h(t,r,l,c),Qh(e),r=Po(),e!==null&&!dt?(ec(e,t,d),Jn(e,t,d)):(Le&&r&&Do(t),t.flags|=1,At(e,t,l,d),t.child)}function Zm(e,t,l,r,c){if(ea(t),t.stateNode===null){var d=qa,y=l.contextType;typeof y=="object"&&y!==null&&(d=wt(y)),d=new l(r,d),t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=pc,t.stateNode=d,d._reactInternals=t,d=t.stateNode,d.props=r,d.state=t.memoizedState,d.refs={},Go(t),y=l.contextType,d.context=typeof y=="object"&&y!==null?wt(y):qa,d.state=t.memoizedState,y=l.getDerivedStateFromProps,typeof y=="function"&&(mc(t,l,y,r),d.state=t.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(y=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),y!==d.state&&pc.enqueueReplaceState(d,d.state,null),Jl(t,r,d,c),Xl(),d.state=t.memoizedState),typeof d.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){d=t.stateNode;var S=t.memoizedProps,T=sa(l,S);d.props=T;var z=d.context,Y=l.contextType;y=qa,typeof Y=="object"&&Y!==null&&(y=wt(Y));var K=l.getDerivedStateFromProps;Y=typeof K=="function"||typeof d.getSnapshotBeforeUpdate=="function",S=t.pendingProps!==S,Y||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(S||z!==y)&&jm(t,d,r,y),vi=!1;var R=t.memoizedState;d.state=R,Jl(t,r,d,c),Xl(),z=t.memoizedState,S||R!==z||vi?(typeof K=="function"&&(mc(t,l,K,r),z=t.memoizedState),(T=vi||Mm(t,l,T,r,R,z,y))?(Y||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(t.flags|=4194308)):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=z),d.props=r,d.state=z,d.context=y,r=T):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{d=t.stateNode,Ko(e,t),y=t.memoizedProps,Y=sa(l,y),d.props=Y,K=t.pendingProps,R=d.context,z=l.contextType,T=qa,typeof z=="object"&&z!==null&&(T=wt(z)),S=l.getDerivedStateFromProps,(z=typeof S=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(y!==K||R!==T)&&jm(t,d,r,T),vi=!1,R=t.memoizedState,d.state=R,Jl(t,r,d,c),Xl();var q=t.memoizedState;y!==K||R!==q||vi||e!==null&&e.dependencies!==null&&pr(e.dependencies)?(typeof S=="function"&&(mc(t,l,S,r),q=t.memoizedState),(Y=vi||Mm(t,l,Y,r,R,q,T)||e!==null&&e.dependencies!==null&&pr(e.dependencies))?(z||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(r,q,T),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(r,q,T)),typeof d.componentDidUpdate=="function"&&(t.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof d.componentDidUpdate!="function"||y===e.memoizedProps&&R===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&R===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=q),d.props=r,d.state=q,d.context=T,r=Y):(typeof d.componentDidUpdate!="function"||y===e.memoizedProps&&R===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&R===e.memoizedState||(t.flags|=1024),r=!1)}return d=r,zr(e,t),r=(t.flags&128)!==0,d||r?(d=t.stateNode,l=r&&typeof l.getDerivedStateFromError!="function"?null:d.render(),t.flags|=1,e!==null&&r?(t.child=aa(t,e.child,null,c),t.child=aa(t,null,l,c)):At(e,t,l,c),t.memoizedState=d.state,e=t.child):e=Jn(e,t,c),e}function Qm(e,t,l,r){return Wi(),t.flags|=256,At(e,t,l,r),t.child}var vc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function xc(e){return{baseLanes:e,cachePool:Lh()}}function Sc(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=Wt),e}function $m(e,t,l){var r=t.pendingProps,c=!1,d=(t.flags&128)!==0,y;if((y=d)||(y=e!==null&&e.memoizedState===null?!1:(lt.current&2)!==0),y&&(c=!0,t.flags&=-129),y=(t.flags&32)!==0,t.flags&=-33,e===null){if(Le){if(c?_i(t):ki(),(e=et)?(e=ny(e,un),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:pi!==null?{id:Tn,overflow:En}:null,retryLane:536870912,hydrationErrors:null},l=Eh(e),l.return=t,t.child=l,kt=t,et=null)):e=null,e===null)throw gi(t);return af(e)?t.lanes=32:t.lanes=536870912,null}var S=r.children;return r=r.fallback,c?(ki(),c=t.mode,S=Rr({mode:"hidden",children:S},c),r=Fi(r,c,l,null),S.return=t,r.return=t,S.sibling=r,t.child=S,r=t.child,r.memoizedState=xc(l),r.childLanes=Sc(e,y,l),t.memoizedState=vc,ts(null,r)):(_i(t),_c(t,S))}var T=e.memoizedState;if(T!==null&&(S=T.dehydrated,S!==null)){if(d)t.flags&256?(_i(t),t.flags&=-257,t=kc(e,t,l)):t.memoizedState!==null?(ki(),t.child=e.child,t.flags|=128,t=null):(ki(),S=r.fallback,c=t.mode,r=Rr({mode:"visible",children:r.children},c),S=Fi(S,c,l,null),S.flags|=2,r.return=t,S.return=t,r.sibling=S,t.child=r,aa(t,e.child,null,l),r=t.child,r.memoizedState=xc(l),r.childLanes=Sc(e,y,l),t.memoizedState=vc,t=ts(null,r));else if(_i(t),af(S)){if(y=S.nextSibling&&S.nextSibling.dataset,y)var z=y.dgst;y=z,r=Error(s(419)),r.stack="",r.digest=y,Vl({value:r,source:null,stack:null}),t=kc(e,t,l)}else if(dt||Ya(e,t,l,!1),y=(l&e.childLanes)!==0,dt||y){if(y=Fe,y!==null&&(r=zd(y,l),r!==0&&r!==T.retryLane))throw T.retryLane=r,Ji(e,r),Yt(y,e,r),gc;nf(S)||Gr(),t=kc(e,t,l)}else nf(S)?(t.flags|=192,t.child=e.child,t=null):(e=T.treeContext,et=cn(S.nextSibling),kt=t,Le=!0,yi=null,un=!1,e!==null&&Oh(t,e),t=_c(t,r.children),t.flags|=4096);return t}return c?(ki(),S=r.fallback,c=t.mode,T=e.child,z=T.sibling,r=Gn(T,{mode:"hidden",children:r.children}),r.subtreeFlags=T.subtreeFlags&65011712,z!==null?S=Gn(z,S):(S=Fi(S,c,l,null),S.flags|=2),S.return=t,r.return=t,r.sibling=S,t.child=r,ts(null,r),r=t.child,S=e.child.memoizedState,S===null?S=xc(l):(c=S.cachePool,c!==null?(T=ct._currentValue,c=c.parent!==T?{parent:T,pool:T}:c):c=Lh(),S={baseLanes:S.baseLanes|l,cachePool:c}),r.memoizedState=S,r.childLanes=Sc(e,y,l),t.memoizedState=vc,ts(e.child,r)):(_i(t),l=e.child,e=l.sibling,l=Gn(l,{mode:"visible",children:r.children}),l.return=t,l.sibling=null,e!==null&&(y=t.deletions,y===null?(t.deletions=[e],t.flags|=16):y.push(e)),t.child=l,t.memoizedState=null,l)}function _c(e,t){return t=Rr({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Rr(e,t){return e=$t(22,e,null,t),e.lanes=0,e}function kc(e,t,l){return aa(t,e.child,null,l),e=_c(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Xm(e,t,l){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),qo(e.return,t,l)}function wc(e,t,l,r,c,d){var y=e.memoizedState;y===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:l,tailMode:c,treeForkCount:d}:(y.isBackwards=t,y.rendering=null,y.renderingStartTime=0,y.last=r,y.tail=l,y.tailMode=c,y.treeForkCount=d)}function Jm(e,t,l){var r=t.pendingProps,c=r.revealOrder,d=r.tail;r=r.children;var y=lt.current,S=(y&2)!==0;if(S?(y=y&1|2,t.flags|=128):y&=1,k(lt,y),At(e,t,r,l),r=Le?Yl:0,!S&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Xm(e,l,t);else if(e.tag===19)Xm(e,l,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(c){case"forwards":for(l=t.child,c=null;l!==null;)e=l.alternate,e!==null&&kr(e)===null&&(c=l),l=l.sibling;l=c,l===null?(c=t.child,t.child=null):(c=l.sibling,l.sibling=null),wc(t,!1,c,l,d,r);break;case"backwards":case"unstable_legacy-backwards":for(l=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&kr(e)===null){t.child=c;break}e=c.sibling,c.sibling=l,l=c,c=e}wc(t,!0,l,null,d,r);break;case"together":wc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Jn(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),Ti|=t.lanes,(l&t.childLanes)===0)if(e!==null){if(Ya(e,t,l,!1),(l&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,l=Gn(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=Gn(e,e.pendingProps),l.return=t;l.sibling=null}return t.child}function Ac(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&pr(e)))}function a0(e,t,l){switch(t.tag){case 3:Ze(t,t.stateNode.containerInfo),bi(t,ct,e.memoizedState.cache),Wi();break;case 27:case 5:pt(t);break;case 4:Ze(t,t.stateNode.containerInfo);break;case 10:bi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Jo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(_i(t),t.flags|=128,null):(l&t.child.childLanes)!==0?$m(e,t,l):(_i(t),e=Jn(e,t,l),e!==null?e.sibling:null);_i(t);break;case 19:var c=(e.flags&128)!==0;if(r=(l&t.childLanes)!==0,r||(Ya(e,t,l,!1),r=(l&t.childLanes)!==0),c){if(r)return Jm(e,t,l);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),k(lt,lt.current),r)break;return null;case 22:return t.lanes=0,Ym(e,t,l,t.pendingProps);case 24:bi(t,ct,e.memoizedState.cache)}return Jn(e,t,l)}function Fm(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)dt=!0;else{if(!Ac(e,l)&&(t.flags&128)===0)return dt=!1,a0(e,t,l);dt=(e.flags&131072)!==0}else dt=!1,Le&&(t.flags&1048576)!==0&&Ch(t,Yl,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=na(t.elementType),t.type=e,typeof e=="function")Oo(e)?(r=sa(e,r),t.tag=1,t=Zm(null,t,e,r,l)):(t.tag=0,t=bc(null,t,e,r,l));else{if(e!=null){var c=e.$$typeof;if(c===Q){t.tag=11,t=Um(null,t,e,r,l);break e}else if(c===Z){t.tag=14,t=Im(null,t,e,r,l);break e}}throw t=Ce(e)||e,Error(s(306,t,""))}}return t;case 0:return bc(e,t,t.type,t.pendingProps,l);case 1:return r=t.type,c=sa(r,t.pendingProps),Zm(e,t,r,c,l);case 3:e:{if(Ze(t,t.stateNode.containerInfo),e===null)throw Error(s(387));r=t.pendingProps;var d=t.memoizedState;c=d.element,Ko(e,t),Jl(t,r,null,l);var y=t.memoizedState;if(r=y.cache,bi(t,ct,r),r!==d.cache&&Uo(t,[ct],l,!0),Xl(),r=y.element,d.isDehydrated)if(d={element:r,isDehydrated:!1,cache:y.cache},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){t=Qm(e,t,r,l);break e}else if(r!==c){c=ln(Error(s(424)),t),Vl(c),t=Qm(e,t,r,l);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(et=cn(e.firstChild),kt=t,Le=!0,yi=null,un=!0,l=Yh(t,null,r,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(Wi(),r===c){t=Jn(e,t,l);break e}At(e,t,r,l)}t=t.child}return t;case 26:return zr(e,t),e===null?(l=uy(t.type,null,t.pendingProps,null))?t.memoizedState=l:Le||(l=t.type,e=t.pendingProps,r=Fr(re.current).createElement(l),r[_t]=t,r[Lt]=e,Tt(r,l,e),vt(r),t.stateNode=r):t.memoizedState=uy(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return pt(t),e===null&&Le&&(r=t.stateNode=ly(t.type,t.pendingProps,re.current),kt=t,un=!0,c=et,Mi(t.type)?(lf=c,et=cn(r.firstChild)):et=c),At(e,t,t.pendingProps.children,l),zr(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Le&&((c=r=et)&&(r=z0(r,t.type,t.pendingProps,un),r!==null?(t.stateNode=r,kt=t,et=cn(r.firstChild),un=!1,c=!0):c=!1),c||gi(t)),pt(t),c=t.type,d=t.pendingProps,y=e!==null?e.memoizedProps:null,r=d.children,Pc(c,d)?r=null:y!==null&&Pc(c,y)&&(t.flags|=32),t.memoizedState!==null&&(c=Wo(e,t,Xv,null,null,l),ys._currentValue=c),zr(e,t),At(e,t,r,l),t.child;case 6:return e===null&&Le&&((e=l=et)&&(l=R0(l,t.pendingProps,un),l!==null?(t.stateNode=l,kt=t,et=null,e=!0):e=!1),e||gi(t)),null;case 13:return $m(e,t,l);case 4:return Ze(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=aa(t,null,r,l):At(e,t,r,l),t.child;case 11:return Um(e,t,t.type,t.pendingProps,l);case 7:return At(e,t,t.pendingProps,l),t.child;case 8:return At(e,t,t.pendingProps.children,l),t.child;case 12:return At(e,t,t.pendingProps.children,l),t.child;case 10:return r=t.pendingProps,bi(t,t.type,r.value),At(e,t,r.children,l),t.child;case 9:return c=t.type._context,r=t.pendingProps.children,ea(t),c=wt(c),r=r(c),t.flags|=1,At(e,t,r,l),t.child;case 14:return Im(e,t,t.type,t.pendingProps,l);case 15:return Hm(e,t,t.type,t.pendingProps,l);case 19:return Jm(e,t,l);case 31:return i0(e,t,l);case 22:return Ym(e,t,l,t.pendingProps);case 24:return ea(t),r=wt(ct),e===null?(c=Yo(),c===null&&(c=Fe,d=Io(),c.pooledCache=d,d.refCount++,d!==null&&(c.pooledCacheLanes|=l),c=d),t.memoizedState={parent:r,cache:c},Go(t),bi(t,ct,c)):((e.lanes&l)!==0&&(Ko(e,t),Jl(t,null,null,l),Xl()),c=e.memoizedState,d=t.memoizedState,c.parent!==r?(c={parent:r,cache:r},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),bi(t,ct,r)):(r=d.cache,bi(t,ct,r),r!==c.cache&&Uo(t,[ct],l,!0))),At(e,t,t.pendingProps.children,l),t.child;case 29:throw t.pendingProps}throw Error(s(156,t.tag))}function Fn(e){e.flags|=4}function Tc(e,t,l,r,c){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(wp())e.flags|=8192;else throw ia=vr,Vo}else e.flags&=-16777217}function Wm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!hy(t))if(wp())e.flags|=8192;else throw ia=vr,Vo}function Lr(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Md():536870912,e.lanes|=t,el|=t)}function ns(e,t){if(!Le)switch(e.tailMode){case"hidden":t=e.tail;for(var l=null;t!==null;)t.alternate!==null&&(l=t),t=t.sibling;l===null?e.tail=null:l.sibling=null;break;case"collapsed":l=e.tail;for(var r=null;l!==null;)l.alternate!==null&&(r=l),l=l.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function tt(e){var t=e.alternate!==null&&e.alternate.child===e.child,l=0,r=0;if(t)for(var c=e.child;c!==null;)l|=c.lanes|c.childLanes,r|=c.subtreeFlags&65011712,r|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)l|=c.lanes|c.childLanes,r|=c.subtreeFlags,r|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=r,e.childLanes=l,t}function l0(e,t,l){var r=t.pendingProps;switch(zo(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tt(t),null;case 1:return tt(t),null;case 3:return l=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Qn(ct),Be(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Ha(t)?Fn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Lo())),tt(t),null;case 26:var c=t.type,d=t.memoizedState;return e===null?(Fn(t),d!==null?(tt(t),Wm(t,d)):(tt(t),Tc(t,c,null,r,l))):d?d!==e.memoizedState?(Fn(t),tt(t),Wm(t,d)):(tt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Fn(t),tt(t),Tc(t,c,e,r,l)),null;case 27:if(gn(t),l=re.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Fn(t);else{if(!r){if(t.stateNode===null)throw Error(s(166));return tt(t),null}e=W.current,Ha(t)?Mh(t):(e=ly(c,r,l),t.stateNode=e,Fn(t))}return tt(t),null;case 5:if(gn(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Fn(t);else{if(!r){if(t.stateNode===null)throw Error(s(166));return tt(t),null}if(d=W.current,Ha(t))Mh(t);else{var y=Fr(re.current);switch(d){case 1:d=y.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:d=y.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":d=y.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":d=y.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":d=y.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof r.is=="string"?y.createElement("select",{is:r.is}):y.createElement("select"),r.multiple?d.multiple=!0:r.size&&(d.size=r.size);break;default:d=typeof r.is=="string"?y.createElement(c,{is:r.is}):y.createElement(c)}}d[_t]=t,d[Lt]=r;e:for(y=t.child;y!==null;){if(y.tag===5||y.tag===6)d.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===t)break e;for(;y.sibling===null;){if(y.return===null||y.return===t)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}t.stateNode=d;e:switch(Tt(d,c,r),c){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Fn(t)}}return tt(t),Tc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Fn(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(s(166));if(e=re.current,Ha(t)){if(e=t.stateNode,l=t.memoizedProps,r=null,c=kt,c!==null)switch(c.tag){case 27:case 5:r=c.memoizedProps}e[_t]=t,e=!!(e.nodeValue===l||r!==null&&r.suppressHydrationWarning===!0||$p(e.nodeValue,l)),e||gi(t,!0)}else e=Fr(e).createTextNode(r),e[_t]=t,t.stateNode=e}return tt(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ha(t),l!==null){if(e===null){if(!r)throw Error(s(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(557));e[_t]=t}else Wi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;tt(t),e=!1}else l=Lo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(Jt(t),t):(Jt(t),null);if((t.flags&128)!==0)throw Error(s(558))}return tt(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=Ha(t),r!==null&&r.dehydrated!==null){if(e===null){if(!c)throw Error(s(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(s(317));c[_t]=t}else Wi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;tt(t),c=!1}else c=Lo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(Jt(t),t):(Jt(t),null)}return Jt(t),(t.flags&128)!==0?(t.lanes=l,t):(l=r!==null,e=e!==null&&e.memoizedState!==null,l&&(r=t.child,c=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(c=r.alternate.memoizedState.cachePool.pool),d=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(d=r.memoizedState.cachePool.pool),d!==c&&(r.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),Lr(t,t.updateQueue),tt(t),null);case 4:return Be(),e===null&&$c(t.stateNode.containerInfo),tt(t),null;case 10:return Qn(t.type),tt(t),null;case 19:if(U(lt),r=t.memoizedState,r===null)return tt(t),null;if(c=(t.flags&128)!==0,d=r.rendering,d===null)if(c)ns(r,!1);else{if(at!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(d=kr(e),d!==null){for(t.flags|=128,ns(r,!1),e=d.updateQueue,t.updateQueue=e,Lr(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)Th(l,e),l=l.sibling;return k(lt,lt.current&1|2),Le&&Kn(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Nt()>Hr&&(t.flags|=128,c=!0,ns(r,!1),t.lanes=4194304)}else{if(!c)if(e=kr(d),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,Lr(t,e),ns(r,!0),r.tail===null&&r.tailMode==="hidden"&&!d.alternate&&!Le)return tt(t),null}else 2*Nt()-r.renderingStartTime>Hr&&l!==536870912&&(t.flags|=128,c=!0,ns(r,!1),t.lanes=4194304);r.isBackwards?(d.sibling=t.child,t.child=d):(e=r.last,e!==null?e.sibling=d:t.child=d,r.last=d)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Nt(),e.sibling=null,l=lt.current,k(lt,c?l&1|2:l&1),Le&&Kn(t,r.treeForkCount),e):(tt(t),null);case 22:case 23:return Jt(t),Xo(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(l&536870912)!==0&&(t.flags&128)===0&&(tt(t),t.subtreeFlags&6&&(t.flags|=8192)):tt(t),l=t.updateQueue,l!==null&&Lr(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==l&&(t.flags|=2048),e!==null&&U(ta),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Qn(ct),tt(t),null;case 25:return null;case 30:return null}throw Error(s(156,t.tag))}function s0(e,t){switch(zo(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Qn(ct),Be(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return gn(t),null;case 31:if(t.memoizedState!==null){if(Jt(t),t.alternate===null)throw Error(s(340));Wi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Jt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));Wi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return U(lt),null;case 4:return Be(),null;case 10:return Qn(t.type),null;case 22:case 23:return Jt(t),Xo(),e!==null&&U(ta),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Qn(ct),null;case 25:return null;default:return null}}function Pm(e,t){switch(zo(t),t.tag){case 3:Qn(ct),Be();break;case 26:case 27:case 5:gn(t);break;case 4:Be();break;case 31:t.memoizedState!==null&&Jt(t);break;case 13:Jt(t);break;case 19:U(lt);break;case 10:Qn(t.type);break;case 22:case 23:Jt(t),Xo(),e!==null&&U(ta);break;case 24:Qn(ct)}}function is(e,t){try{var l=t.updateQueue,r=l!==null?l.lastEffect:null;if(r!==null){var c=r.next;l=c;do{if((l.tag&e)===e){r=void 0;var d=l.create,y=l.inst;r=d(),y.destroy=r}l=l.next}while(l!==c)}}catch(S){Ke(t,t.return,S)}}function wi(e,t,l){try{var r=t.updateQueue,c=r!==null?r.lastEffect:null;if(c!==null){var d=c.next;r=d;do{if((r.tag&e)===e){var y=r.inst,S=y.destroy;if(S!==void 0){y.destroy=void 0,c=t;var T=l,z=S;try{z()}catch(Y){Ke(c,T,Y)}}}r=r.next}while(r!==d)}}catch(Y){Ke(t,t.return,Y)}}function ep(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{Gh(t,l)}catch(r){Ke(e,e.return,r)}}}function tp(e,t,l){l.props=sa(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(r){Ke(e,t,r)}}function as(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof l=="function"?e.refCleanup=l(r):l.current=r}}catch(c){Ke(e,t,c)}}function Nn(e,t){var l=e.ref,r=e.refCleanup;if(l!==null)if(typeof r=="function")try{r()}catch(c){Ke(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(c){Ke(e,t,c)}else l.current=null}function np(e){var t=e.type,l=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&r.focus();break e;case"img":l.src?r.src=l.src:l.srcSet&&(r.srcset=l.srcSet)}}catch(c){Ke(e,e.return,c)}}function Ec(e,t,l){try{var r=e.stateNode;N0(r,e.type,l,t),r[Lt]=t}catch(c){Ke(e,e.return,c)}}function ip(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Mi(e.type)||e.tag===4}function Nc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ip(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Mi(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Cc(e,t,l){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=Yn));else if(r!==4&&(r===27&&Mi(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(Cc(e,t,l),e=e.sibling;e!==null;)Cc(e,t,l),e=e.sibling}function Br(e,t,l){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(r!==4&&(r===27&&Mi(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(Br(e,t,l),e=e.sibling;e!==null;)Br(e,t,l),e=e.sibling}function ap(e){var t=e.stateNode,l=e.memoizedProps;try{for(var r=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);Tt(t,r,l),t[_t]=e,t[Lt]=l}catch(d){Ke(e,e.return,d)}}var Wn=!1,ht=!1,Oc=!1,lp=typeof WeakSet=="function"?WeakSet:Set,xt=null;function r0(e,t){if(e=e.containerInfo,Fc=au,e=gh(e),ko(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var r=l.getSelection&&l.getSelection();if(r&&r.rangeCount!==0){l=r.anchorNode;var c=r.anchorOffset,d=r.focusNode;r=r.focusOffset;try{l.nodeType,d.nodeType}catch{l=null;break e}var y=0,S=-1,T=-1,z=0,Y=0,K=e,R=null;t:for(;;){for(var q;K!==l||c!==0&&K.nodeType!==3||(S=y+c),K!==d||r!==0&&K.nodeType!==3||(T=y+r),K.nodeType===3&&(y+=K.nodeValue.length),(q=K.firstChild)!==null;)R=K,K=q;for(;;){if(K===e)break t;if(R===l&&++z===c&&(S=y),R===d&&++Y===r&&(T=y),(q=K.nextSibling)!==null)break;K=R,R=K.parentNode}K=q}l=S===-1||T===-1?null:{start:S,end:T}}else l=null}l=l||{start:0,end:0}}else l=null;for(Wc={focusedElem:e,selectionRange:l},au=!1,xt=t;xt!==null;)if(t=xt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,xt=e;else for(;xt!==null;){switch(t=xt,d=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l<e.length;l++)c=e[l],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&d!==null){e=void 0,l=t,c=d.memoizedProps,d=d.memoizedState,r=l.stateNode;try{var oe=sa(l.type,c);e=r.getSnapshotBeforeUpdate(oe,d),r.__reactInternalSnapshotBeforeUpdate=e}catch(ge){Ke(l,l.return,ge)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,l=e.nodeType,l===9)tf(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":tf(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(s(163))}if(e=t.sibling,e!==null){e.return=t.return,xt=e;break}xt=t.return}}function sp(e,t,l){var r=l.flags;switch(l.tag){case 0:case 11:case 15:ei(e,l),r&4&&is(5,l);break;case 1:if(ei(e,l),r&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(y){Ke(l,l.return,y)}else{var c=sa(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(y){Ke(l,l.return,y)}}r&64&&ep(l),r&512&&as(l,l.return);break;case 3:if(ei(e,l),r&64&&(e=l.updateQueue,e!==null)){if(t=null,l.child!==null)switch(l.child.tag){case 27:case 5:t=l.child.stateNode;break;case 1:t=l.child.stateNode}try{Gh(e,t)}catch(y){Ke(l,l.return,y)}}break;case 27:t===null&&r&4&&ap(l);case 26:case 5:ei(e,l),t===null&&r&4&&np(l),r&512&&as(l,l.return);break;case 12:ei(e,l);break;case 31:ei(e,l),r&4&&op(e,l);break;case 13:ei(e,l),r&4&&cp(e,l),r&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=y0.bind(null,l),L0(e,l))));break;case 22:if(r=l.memoizedState!==null||Wn,!r){t=t!==null&&t.memoizedState!==null||ht,c=Wn;var d=ht;Wn=r,(ht=t)&&!d?ti(e,l,(l.subtreeFlags&8772)!==0):ei(e,l),Wn=c,ht=d}break;case 30:break;default:ei(e,l)}}function rp(e){var t=e.alternate;t!==null&&(e.alternate=null,rp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&lo(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var nt=null,qt=!1;function Pn(e,t,l){for(l=l.child;l!==null;)up(e,t,l),l=l.sibling}function up(e,t,l){if(yt&&typeof yt.onCommitFiberUnmount=="function")try{yt.onCommitFiberUnmount(Ct,l)}catch{}switch(l.tag){case 26:ht||Nn(l,t),Pn(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:ht||Nn(l,t);var r=nt,c=qt;Mi(l.type)&&(nt=l.stateNode,qt=!1),Pn(e,t,l),hs(l.stateNode),nt=r,qt=c;break;case 5:ht||Nn(l,t);case 6:if(r=nt,c=qt,nt=null,Pn(e,t,l),nt=r,qt=c,nt!==null)if(qt)try{(nt.nodeType===9?nt.body:nt.nodeName==="HTML"?nt.ownerDocument.body:nt).removeChild(l.stateNode)}catch(d){Ke(l,t,d)}else try{nt.removeChild(l.stateNode)}catch(d){Ke(l,t,d)}break;case 18:nt!==null&&(qt?(e=nt,ey(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),ul(e)):ey(nt,l.stateNode));break;case 4:r=nt,c=qt,nt=l.stateNode.containerInfo,qt=!0,Pn(e,t,l),nt=r,qt=c;break;case 0:case 11:case 14:case 15:wi(2,l,t),ht||wi(4,l,t),Pn(e,t,l);break;case 1:ht||(Nn(l,t),r=l.stateNode,typeof r.componentWillUnmount=="function"&&tp(l,t,r)),Pn(e,t,l);break;case 21:Pn(e,t,l);break;case 22:ht=(r=ht)||l.memoizedState!==null,Pn(e,t,l),ht=r;break;default:Pn(e,t,l)}}function op(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ul(e)}catch(l){Ke(t,t.return,l)}}}function cp(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ul(e)}catch(l){Ke(t,t.return,l)}}function u0(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new lp),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new lp),t;default:throw Error(s(435,e.tag))}}function qr(e,t){var l=u0(e);t.forEach(function(r){if(!l.has(r)){l.add(r);var c=g0.bind(null,e,r);r.then(c,c)}})}function Ut(e,t){var l=t.deletions;if(l!==null)for(var r=0;r<l.length;r++){var c=l[r],d=e,y=t,S=y;e:for(;S!==null;){switch(S.tag){case 27:if(Mi(S.type)){nt=S.stateNode,qt=!1;break e}break;case 5:nt=S.stateNode,qt=!1;break e;case 3:case 4:nt=S.stateNode.containerInfo,qt=!0;break e}S=S.return}if(nt===null)throw Error(s(160));up(d,y,c),nt=null,qt=!1,d=c.alternate,d!==null&&(d.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)fp(t,e),t=t.sibling}var xn=null;function fp(e,t){var l=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ut(t,e),It(e),r&4&&(wi(3,e,e.return),is(3,e),wi(5,e,e.return));break;case 1:Ut(t,e),It(e),r&512&&(ht||l===null||Nn(l,l.return)),r&64&&Wn&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?r:l.concat(r))));break;case 26:var c=xn;if(Ut(t,e),It(e),r&512&&(ht||l===null||Nn(l,l.return)),r&4){var d=l!==null?l.memoizedState:null;if(r=e.memoizedState,l===null)if(r===null)if(e.stateNode===null){e:{r=e.type,l=e.memoizedProps,c=c.ownerDocument||c;t:switch(r){case"title":d=c.getElementsByTagName("title")[0],(!d||d[Ml]||d[_t]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=c.createElement(r),c.head.insertBefore(d,c.querySelector("head > title"))),Tt(d,r,l),d[_t]=e,vt(d),r=d;break e;case"link":var y=fy("link","href",c).get(r+(l.href||""));if(y){for(var S=0;S<y.length;S++)if(d=y[S],d.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&d.getAttribute("rel")===(l.rel==null?null:l.rel)&&d.getAttribute("title")===(l.title==null?null:l.title)&&d.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){y.splice(S,1);break t}}d=c.createElement(r),Tt(d,r,l),c.head.appendChild(d);break;case"meta":if(y=fy("meta","content",c).get(r+(l.content||""))){for(S=0;S<y.length;S++)if(d=y[S],d.getAttribute("content")===(l.content==null?null:""+l.content)&&d.getAttribute("name")===(l.name==null?null:l.name)&&d.getAttribute("property")===(l.property==null?null:l.property)&&d.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&d.getAttribute("charset")===(l.charSet==null?null:l.charSet)){y.splice(S,1);break t}}d=c.createElement(r),Tt(d,r,l),c.head.appendChild(d);break;default:throw Error(s(468,r))}d[_t]=e,vt(d),r=d}e.stateNode=r}else dy(c,e.type,e.stateNode);else e.stateNode=cy(c,r,e.memoizedProps);else d!==r?(d===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):d.count--,r===null?dy(c,e.type,e.stateNode):cy(c,r,e.memoizedProps)):r===null&&e.stateNode!==null&&Ec(e,e.memoizedProps,l.memoizedProps)}break;case 27:Ut(t,e),It(e),r&512&&(ht||l===null||Nn(l,l.return)),l!==null&&r&4&&Ec(e,e.memoizedProps,l.memoizedProps);break;case 5:if(Ut(t,e),It(e),r&512&&(ht||l===null||Nn(l,l.return)),e.flags&32){c=e.stateNode;try{Ma(c,"")}catch(oe){Ke(e,e.return,oe)}}r&4&&e.stateNode!=null&&(c=e.memoizedProps,Ec(e,c,l!==null?l.memoizedProps:c)),r&1024&&(Oc=!0);break;case 6:if(Ut(t,e),It(e),r&4){if(e.stateNode===null)throw Error(s(162));r=e.memoizedProps,l=e.stateNode;try{l.nodeValue=r}catch(oe){Ke(e,e.return,oe)}}break;case 3:if(eu=null,c=xn,xn=Wr(t.containerInfo),Ut(t,e),xn=c,It(e),r&4&&l!==null&&l.memoizedState.isDehydrated)try{ul(t.containerInfo)}catch(oe){Ke(e,e.return,oe)}Oc&&(Oc=!1,dp(e));break;case 4:r=xn,xn=Wr(e.stateNode.containerInfo),Ut(t,e),It(e),xn=r;break;case 12:Ut(t,e),It(e);break;case 31:Ut(t,e),It(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,qr(e,r)));break;case 13:Ut(t,e),It(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Ir=Nt()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,qr(e,r)));break;case 22:c=e.memoizedState!==null;var T=l!==null&&l.memoizedState!==null,z=Wn,Y=ht;if(Wn=z||c,ht=Y||T,Ut(t,e),ht=Y,Wn=z,It(e),r&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(l===null||T||Wn||ht||ra(e)),l=null,t=e;;){if(t.tag===5||t.tag===26){if(l===null){T=l=t;try{if(d=T.stateNode,c)y=d.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none";else{S=T.stateNode;var K=T.memoizedProps.style,R=K!=null&&K.hasOwnProperty("display")?K.display:null;S.style.display=R==null||typeof R=="boolean"?"":(""+R).trim()}}catch(oe){Ke(T,T.return,oe)}}}else if(t.tag===6){if(l===null){T=t;try{T.stateNode.nodeValue=c?"":T.memoizedProps}catch(oe){Ke(T,T.return,oe)}}}else if(t.tag===18){if(l===null){T=t;try{var q=T.stateNode;c?ty(q,!0):ty(T.stateNode,!1)}catch(oe){Ke(T,T.return,oe)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;l===t&&(l=null),t=t.return}l===t&&(l=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(l=r.retryQueue,l!==null&&(r.retryQueue=null,qr(e,l))));break;case 19:Ut(t,e),It(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,qr(e,r)));break;case 30:break;case 21:break;default:Ut(t,e),It(e)}}function It(e){var t=e.flags;if(t&2){try{for(var l,r=e.return;r!==null;){if(ip(r)){l=r;break}r=r.return}if(l==null)throw Error(s(160));switch(l.tag){case 27:var c=l.stateNode,d=Nc(e);Br(e,d,c);break;case 5:var y=l.stateNode;l.flags&32&&(Ma(y,""),l.flags&=-33);var S=Nc(e);Br(e,S,y);break;case 3:case 4:var T=l.stateNode.containerInfo,z=Nc(e);Cc(e,z,T);break;default:throw Error(s(161))}}catch(Y){Ke(e,e.return,Y)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function dp(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;dp(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ei(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)sp(e,t.alternate,t),t=t.sibling}function ra(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:wi(4,t,t.return),ra(t);break;case 1:Nn(t,t.return);var l=t.stateNode;typeof l.componentWillUnmount=="function"&&tp(t,t.return,l),ra(t);break;case 27:hs(t.stateNode);case 26:case 5:Nn(t,t.return),ra(t);break;case 22:t.memoizedState===null&&ra(t);break;case 30:ra(t);break;default:ra(t)}e=e.sibling}}function ti(e,t,l){for(l=l&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,c=e,d=t,y=d.flags;switch(d.tag){case 0:case 11:case 15:ti(c,d,l),is(4,d);break;case 1:if(ti(c,d,l),r=d,c=r.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(z){Ke(r,r.return,z)}if(r=d,c=r.updateQueue,c!==null){var S=r.stateNode;try{var T=c.shared.hiddenCallbacks;if(T!==null)for(c.shared.hiddenCallbacks=null,c=0;c<T.length;c++)Vh(T[c],S)}catch(z){Ke(r,r.return,z)}}l&&y&64&&ep(d),as(d,d.return);break;case 27:ap(d);case 26:case 5:ti(c,d,l),l&&r===null&&y&4&&np(d),as(d,d.return);break;case 12:ti(c,d,l);break;case 31:ti(c,d,l),l&&y&4&&op(c,d);break;case 13:ti(c,d,l),l&&y&4&&cp(c,d);break;case 22:d.memoizedState===null&&ti(c,d,l),as(d,d.return);break;case 30:break;default:ti(c,d,l)}t=t.sibling}}function Mc(e,t){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&Gl(l))}function jc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Gl(e))}function Sn(e,t,l,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)hp(e,t,l,r),t=t.sibling}function hp(e,t,l,r){var c=t.flags;switch(t.tag){case 0:case 11:case 15:Sn(e,t,l,r),c&2048&&is(9,t);break;case 1:Sn(e,t,l,r);break;case 3:Sn(e,t,l,r),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Gl(e)));break;case 12:if(c&2048){Sn(e,t,l,r),e=t.stateNode;try{var d=t.memoizedProps,y=d.id,S=d.onPostCommit;typeof S=="function"&&S(y,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(T){Ke(t,t.return,T)}}else Sn(e,t,l,r);break;case 31:Sn(e,t,l,r);break;case 13:Sn(e,t,l,r);break;case 23:break;case 22:d=t.stateNode,y=t.alternate,t.memoizedState!==null?d._visibility&2?Sn(e,t,l,r):ls(e,t):d._visibility&2?Sn(e,t,l,r):(d._visibility|=2,Fa(e,t,l,r,(t.subtreeFlags&10256)!==0||!1)),c&2048&&Mc(y,t);break;case 24:Sn(e,t,l,r),c&2048&&jc(t.alternate,t);break;default:Sn(e,t,l,r)}}function Fa(e,t,l,r,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var d=e,y=t,S=l,T=r,z=y.flags;switch(y.tag){case 0:case 11:case 15:Fa(d,y,S,T,c),is(8,y);break;case 23:break;case 22:var Y=y.stateNode;y.memoizedState!==null?Y._visibility&2?Fa(d,y,S,T,c):ls(d,y):(Y._visibility|=2,Fa(d,y,S,T,c)),c&&z&2048&&Mc(y.alternate,y);break;case 24:Fa(d,y,S,T,c),c&&z&2048&&jc(y.alternate,y);break;default:Fa(d,y,S,T,c)}t=t.sibling}}function ls(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var l=e,r=t,c=r.flags;switch(r.tag){case 22:ls(l,r),c&2048&&Mc(r.alternate,r);break;case 24:ls(l,r),c&2048&&jc(r.alternate,r);break;default:ls(l,r)}t=t.sibling}}var ss=8192;function Wa(e,t,l){if(e.subtreeFlags&ss)for(e=e.child;e!==null;)mp(e,t,l),e=e.sibling}function mp(e,t,l){switch(e.tag){case 26:Wa(e,t,l),e.flags&ss&&e.memoizedState!==null&&$0(l,xn,e.memoizedState,e.memoizedProps);break;case 5:Wa(e,t,l);break;case 3:case 4:var r=xn;xn=Wr(e.stateNode.containerInfo),Wa(e,t,l),xn=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=ss,ss=16777216,Wa(e,t,l),ss=r):Wa(e,t,l));break;default:Wa(e,t,l)}}function pp(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function rs(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var r=t[l];xt=r,gp(r,e)}pp(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)yp(e),e=e.sibling}function yp(e){switch(e.tag){case 0:case 11:case 15:rs(e),e.flags&2048&&wi(9,e,e.return);break;case 3:rs(e);break;case 12:rs(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ur(e)):rs(e);break;default:rs(e)}}function Ur(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var r=t[l];xt=r,gp(r,e)}pp(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:wi(8,t,t.return),Ur(t);break;case 22:l=t.stateNode,l._visibility&2&&(l._visibility&=-3,Ur(t));break;default:Ur(t)}e=e.sibling}}function gp(e,t){for(;xt!==null;){var l=xt;switch(l.tag){case 0:case 11:case 15:wi(8,l,t);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var r=l.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Gl(l.memoizedState.cache)}if(r=l.child,r!==null)r.return=l,xt=r;else e:for(l=e;xt!==null;){r=xt;var c=r.sibling,d=r.return;if(rp(r),r===l){xt=null;break e}if(c!==null){c.return=d,xt=c;break e}xt=d}}}var o0={getCacheForType:function(e){var t=wt(ct),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l},cacheSignal:function(){return wt(ct).controller.signal}},c0=typeof WeakMap=="function"?WeakMap:Map,He=0,Fe=null,Me=null,De=0,Ge=0,Ft=null,Ai=!1,Pa=!1,Dc=!1,ni=0,at=0,Ti=0,ua=0,zc=0,Wt=0,el=0,us=null,Ht=null,Rc=!1,Ir=0,bp=0,Hr=1/0,Yr=null,Ei=null,gt=0,Ni=null,tl=null,ii=0,Lc=0,Bc=null,vp=null,os=0,qc=null;function Pt(){return(He&2)!==0&&De!==0?De&-De:B.T!==null?Gc():Rd()}function xp(){if(Wt===0)if((De&536870912)===0||Le){var e=Js;Js<<=1,(Js&3932160)===0&&(Js=262144),Wt=e}else Wt=536870912;return e=Xt.current,e!==null&&(e.flags|=32),Wt}function Yt(e,t,l){(e===Fe&&(Ge===2||Ge===9)||e.cancelPendingCommit!==null)&&(nl(e,0),Ci(e,De,Wt,!1)),Ol(e,l),((He&2)===0||e!==Fe)&&(e===Fe&&((He&2)===0&&(ua|=l),at===4&&Ci(e,De,Wt,!1)),Cn(e))}function Sp(e,t,l){if((He&6)!==0)throw Error(s(327));var r=!l&&(t&127)===0&&(t&e.expiredLanes)===0||Cl(e,t),c=r?h0(e,t):Ic(e,t,!0),d=r;do{if(c===0){Pa&&!r&&Ci(e,t,0,!1);break}else{if(l=e.current.alternate,d&&!f0(l)){c=Ic(e,t,!1),d=!1;continue}if(c===2){if(d=t,e.errorRecoveryDisabledLanes&d)var y=0;else y=e.pendingLanes&-536870913,y=y!==0?y:y&536870912?536870912:0;if(y!==0){t=y;e:{var S=e;c=us;var T=S.current.memoizedState.isDehydrated;if(T&&(nl(S,y).flags|=256),y=Ic(S,y,!1),y!==2){if(Dc&&!T){S.errorRecoveryDisabledLanes|=d,ua|=d,c=4;break e}d=Ht,Ht=c,d!==null&&(Ht===null?Ht=d:Ht.push.apply(Ht,d))}c=y}if(d=!1,c!==2)continue}}if(c===1){nl(e,0),Ci(e,t,0,!0);break}e:{switch(r=e,d=c,d){case 0:case 1:throw Error(s(345));case 4:if((t&4194048)!==t)break;case 6:Ci(r,t,Wt,!Ai);break e;case 2:Ht=null;break;case 3:case 5:break;default:throw Error(s(329))}if((t&62914560)===t&&(c=Ir+300-Nt(),10<c)){if(Ci(r,t,Wt,!Ai),Ws(r,0,!0)!==0)break e;ii=t,r.timeoutHandle=Wp(_p.bind(null,r,l,Ht,Yr,Rc,t,Wt,ua,el,Ai,d,"Throttled",-0,0),c);break e}_p(r,l,Ht,Yr,Rc,t,Wt,ua,el,Ai,d,null,-0,0)}}break}while(!0);Cn(e)}function _p(e,t,l,r,c,d,y,S,T,z,Y,K,R,q){if(e.timeoutHandle=-1,K=t.subtreeFlags,K&8192||(K&16785408)===16785408){K={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Yn},mp(t,d,K);var oe=(d&62914560)===d?Ir-Nt():(d&4194048)===d?bp-Nt():0;if(oe=X0(K,oe),oe!==null){ii=d,e.cancelPendingCommit=oe(Op.bind(null,e,t,d,l,r,c,y,S,T,Y,K,null,R,q)),Ci(e,d,y,!z);return}}Op(e,t,d,l,r,c,y,S,T)}function f0(e){for(var t=e;;){var l=t.tag;if((l===0||l===11||l===15)&&t.flags&16384&&(l=t.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var r=0;r<l.length;r++){var c=l[r],d=c.getSnapshot;c=c.value;try{if(!Qt(d(),c))return!1}catch{return!1}}if(l=t.child,t.subtreeFlags&16384&&l!==null)l.return=t,t=l;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ci(e,t,l,r){t&=~zc,t&=~ua,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var c=t;0<c;){var d=31-Je(c),y=1<<d;r[d]=-1,c&=~y}l!==0&&jd(e,l,t)}function Vr(){return(He&6)===0?(cs(0),!1):!0}function Uc(){if(Me!==null){if(Ge===0)var e=Me.return;else e=Me,Zn=Pi=null,tc(e),Za=null,Zl=0,e=Me;for(;e!==null;)Pm(e.alternate,e),e=e.return;Me=null}}function nl(e,t){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,M0(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),ii=0,Uc(),Fe=e,Me=l=Gn(e.current,null),De=t,Ge=0,Ft=null,Ai=!1,Pa=Cl(e,t),Dc=!1,el=Wt=zc=ua=Ti=at=0,Ht=us=null,Rc=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var c=31-Je(r),d=1<<c;t|=e[c],r&=~d}return ni=t,cr(),l}function kp(e,t){Te=null,B.H=es,t===Ka||t===br?(t=Uh(),Ge=3):t===Vo?(t=Uh(),Ge=4):Ge=t===gc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ft=t,Me===null&&(at=1,jr(e,ln(t,e.current)))}function wp(){var e=Xt.current;return e===null?!0:(De&4194048)===De?on===null:(De&62914560)===De||(De&536870912)!==0?e===on:!1}function Ap(){var e=B.H;return B.H=es,e===null?es:e}function Tp(){var e=B.A;return B.A=o0,e}function Gr(){at=4,Ai||(De&4194048)!==De&&Xt.current!==null||(Pa=!0),(Ti&134217727)===0&&(ua&134217727)===0||Fe===null||Ci(Fe,De,Wt,!1)}function Ic(e,t,l){var r=He;He|=2;var c=Ap(),d=Tp();(Fe!==e||De!==t)&&(Yr=null,nl(e,t)),t=!1;var y=at;e:do try{if(Ge!==0&&Me!==null){var S=Me,T=Ft;switch(Ge){case 8:Uc(),y=6;break e;case 3:case 2:case 9:case 6:Xt.current===null&&(t=!0);var z=Ge;if(Ge=0,Ft=null,il(e,S,T,z),l&&Pa){y=0;break e}break;default:z=Ge,Ge=0,Ft=null,il(e,S,T,z)}}d0(),y=at;break}catch(Y){kp(e,Y)}while(!0);return t&&e.shellSuspendCounter++,Zn=Pi=null,He=r,B.H=c,B.A=d,Me===null&&(Fe=null,De=0,cr()),y}function d0(){for(;Me!==null;)Ep(Me)}function h0(e,t){var l=He;He|=2;var r=Ap(),c=Tp();Fe!==e||De!==t?(Yr=null,Hr=Nt()+500,nl(e,t)):Pa=Cl(e,t);e:do try{if(Ge!==0&&Me!==null){t=Me;var d=Ft;t:switch(Ge){case 1:Ge=0,Ft=null,il(e,t,d,1);break;case 2:case 9:if(Bh(d)){Ge=0,Ft=null,Np(t);break}t=function(){Ge!==2&&Ge!==9||Fe!==e||(Ge=7),Cn(e)},d.then(t,t);break e;case 3:Ge=7;break e;case 4:Ge=5;break e;case 7:Bh(d)?(Ge=0,Ft=null,Np(t)):(Ge=0,Ft=null,il(e,t,d,7));break;case 5:var y=null;switch(Me.tag){case 26:y=Me.memoizedState;case 5:case 27:var S=Me;if(y?hy(y):S.stateNode.complete){Ge=0,Ft=null;var T=S.sibling;if(T!==null)Me=T;else{var z=S.return;z!==null?(Me=z,Kr(z)):Me=null}break t}}Ge=0,Ft=null,il(e,t,d,5);break;case 6:Ge=0,Ft=null,il(e,t,d,6);break;case 8:Uc(),at=6;break e;default:throw Error(s(462))}}m0();break}catch(Y){kp(e,Y)}while(!0);return Zn=Pi=null,B.H=r,B.A=c,He=l,Me!==null?0:(Fe=null,De=0,cr(),at)}function m0(){for(;Me!==null&&!Wu();)Ep(Me)}function Ep(e){var t=Fm(e.alternate,e,ni);e.memoizedProps=e.pendingProps,t===null?Kr(e):Me=t}function Np(e){var t=e,l=t.alternate;switch(t.tag){case 15:case 0:t=Km(l,t,t.pendingProps,t.type,void 0,De);break;case 11:t=Km(l,t,t.pendingProps,t.type.render,t.ref,De);break;case 5:tc(t);default:Pm(l,t),t=Me=Th(t,ni),t=Fm(l,t,ni)}e.memoizedProps=e.pendingProps,t===null?Kr(e):Me=t}function il(e,t,l,r){Zn=Pi=null,tc(t),Za=null,Zl=0;var c=t.return;try{if(n0(e,c,t,l,De)){at=1,jr(e,ln(l,e.current)),Me=null;return}}catch(d){if(c!==null)throw Me=c,d;at=1,jr(e,ln(l,e.current)),Me=null;return}t.flags&32768?(Le||r===1?e=!0:Pa||(De&536870912)!==0?e=!1:(Ai=e=!0,(r===2||r===9||r===3||r===6)&&(r=Xt.current,r!==null&&r.tag===13&&(r.flags|=16384))),Cp(t,e)):Kr(t)}function Kr(e){var t=e;do{if((t.flags&32768)!==0){Cp(t,Ai);return}e=t.return;var l=l0(t.alternate,t,ni);if(l!==null){Me=l;return}if(t=t.sibling,t!==null){Me=t;return}Me=t=e}while(t!==null);at===0&&(at=5)}function Cp(e,t){do{var l=s0(e.alternate,e);if(l!==null){l.flags&=32767,Me=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!t&&(e=e.sibling,e!==null)){Me=e;return}Me=e=l}while(e!==null);at=6,Me=null}function Op(e,t,l,r,c,d,y,S,T){e.cancelPendingCommit=null;do Zr();while(gt!==0);if((He&6)!==0)throw Error(s(327));if(t!==null){if(t===e.current)throw Error(s(177));if(d=t.lanes|t.childLanes,d|=No,Qb(e,l,d,y,S,T),e===Fe&&(Me=Fe=null,De=0),tl=t,Ni=e,ii=l,Lc=d,Bc=c,vp=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,b0(be,function(){return Rp(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=B.T,B.T=null,c=$.p,$.p=2,y=He,He|=4;try{r0(e,t,l)}finally{He=y,$.p=c,B.T=r}}gt=1,Mp(),jp(),Dp()}}function Mp(){if(gt===1){gt=0;var e=Ni,t=tl,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=B.T,B.T=null;var r=$.p;$.p=2;var c=He;He|=4;try{fp(t,e);var d=Wc,y=gh(e.containerInfo),S=d.focusedElem,T=d.selectionRange;if(y!==S&&S&&S.ownerDocument&&yh(S.ownerDocument.documentElement,S)){if(T!==null&&ko(S)){var z=T.start,Y=T.end;if(Y===void 0&&(Y=z),"selectionStart"in S)S.selectionStart=z,S.selectionEnd=Math.min(Y,S.value.length);else{var K=S.ownerDocument||document,R=K&&K.defaultView||window;if(R.getSelection){var q=R.getSelection(),oe=S.textContent.length,ge=Math.min(T.start,oe),Xe=T.end===void 0?ge:Math.min(T.end,oe);!q.extend&&ge>Xe&&(y=Xe,Xe=ge,ge=y);var M=ph(S,ge),C=ph(S,Xe);if(M&&C&&(q.rangeCount!==1||q.anchorNode!==M.node||q.anchorOffset!==M.offset||q.focusNode!==C.node||q.focusOffset!==C.offset)){var D=K.createRange();D.setStart(M.node,M.offset),q.removeAllRanges(),ge>Xe?(q.addRange(D),q.extend(C.node,C.offset)):(D.setEnd(C.node,C.offset),q.addRange(D))}}}}for(K=[],q=S;q=q.parentNode;)q.nodeType===1&&K.push({element:q,left:q.scrollLeft,top:q.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;S<K.length;S++){var G=K[S];G.element.scrollLeft=G.left,G.element.scrollTop=G.top}}au=!!Fc,Wc=Fc=null}finally{He=c,$.p=r,B.T=l}}e.current=t,gt=2}}function jp(){if(gt===2){gt=0;var e=Ni,t=tl,l=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||l){l=B.T,B.T=null;var r=$.p;$.p=2;var c=He;He|=4;try{sp(e,t.alternate,t)}finally{He=c,$.p=r,B.T=l}}gt=3}}function Dp(){if(gt===4||gt===3){gt=0,Pu();var e=Ni,t=tl,l=ii,r=vp;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?gt=5:(gt=0,tl=Ni=null,zp(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(Ei=null),io(l),t=t.stateNode,yt&&typeof yt.onCommitFiberRoot=="function")try{yt.onCommitFiberRoot(Ct,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=B.T,c=$.p,$.p=2,B.T=null;try{for(var d=e.onRecoverableError,y=0;y<r.length;y++){var S=r[y];d(S.value,{componentStack:S.stack})}}finally{B.T=t,$.p=c}}(ii&3)!==0&&Zr(),Cn(e),c=e.pendingLanes,(l&261930)!==0&&(c&42)!==0?e===qc?os++:(os=0,qc=e):os=0,cs(0)}}function zp(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Gl(t)))}function Zr(){return Mp(),jp(),Dp(),Rp()}function Rp(){if(gt!==5)return!1;var e=Ni,t=Lc;Lc=0;var l=io(ii),r=B.T,c=$.p;try{$.p=32>l?32:l,B.T=null,l=Bc,Bc=null;var d=Ni,y=ii;if(gt=0,tl=Ni=null,ii=0,(He&6)!==0)throw Error(s(331));var S=He;if(He|=4,yp(d.current),hp(d,d.current,y,l),He=S,cs(0,!1),yt&&typeof yt.onPostCommitFiberRoot=="function")try{yt.onPostCommitFiberRoot(Ct,d)}catch{}return!0}finally{$.p=c,B.T=r,zp(e,t)}}function Lp(e,t,l){t=ln(l,t),t=yc(e.stateNode,t,2),e=Si(e,t,2),e!==null&&(Ol(e,2),Cn(e))}function Ke(e,t,l){if(e.tag===3)Lp(e,e,l);else for(;t!==null;){if(t.tag===3){Lp(t,e,l);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ei===null||!Ei.has(r))){e=ln(l,e),l=Bm(2),r=Si(t,l,2),r!==null&&(qm(l,r,t,e),Ol(r,2),Cn(r));break}}t=t.return}}function Hc(e,t,l){var r=e.pingCache;if(r===null){r=e.pingCache=new c0;var c=new Set;r.set(t,c)}else c=r.get(t),c===void 0&&(c=new Set,r.set(t,c));c.has(l)||(Dc=!0,c.add(l),e=p0.bind(null,e,t,l),t.then(e,e))}function p0(e,t,l){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Fe===e&&(De&l)===l&&(at===4||at===3&&(De&62914560)===De&&300>Nt()-Ir?(He&2)===0&&nl(e,0):zc|=l,el===De&&(el=0)),Cn(e)}function Bp(e,t){t===0&&(t=Md()),e=Ji(e,t),e!==null&&(Ol(e,t),Cn(e))}function y0(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),Bp(e,l)}function g0(e,t){var l=0;switch(e.tag){case 31:case 13:var r=e.stateNode,c=e.memoizedState;c!==null&&(l=c.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(s(314))}r!==null&&r.delete(t),Bp(e,l)}function b0(e,t){return wa(e,t)}var Qr=null,al=null,Yc=!1,$r=!1,Vc=!1,Oi=0;function Cn(e){e!==al&&e.next===null&&(al===null?Qr=al=e:al=al.next=e),$r=!0,Yc||(Yc=!0,x0())}function cs(e,t){if(!Vc&&$r){Vc=!0;do for(var l=!1,r=Qr;r!==null;){if(e!==0){var c=r.pendingLanes;if(c===0)var d=0;else{var y=r.suspendedLanes,S=r.pingedLanes;d=(1<<31-Je(42|e)+1)-1,d&=c&~(y&~S),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(l=!0,Hp(r,d))}else d=De,d=Ws(r,r===Fe?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(d&3)===0||Cl(r,d)||(l=!0,Hp(r,d));r=r.next}while(l);Vc=!1}}function v0(){qp()}function qp(){$r=Yc=!1;var e=0;Oi!==0&&O0()&&(e=Oi);for(var t=Nt(),l=null,r=Qr;r!==null;){var c=r.next,d=Up(r,t);d===0?(r.next=null,l===null?Qr=c:l.next=c,c===null&&(al=l)):(l=r,(e!==0||(d&3)!==0)&&($r=!0)),r=c}gt!==0&&gt!==5||cs(e),Oi!==0&&(Oi=0)}function Up(e,t){for(var l=e.suspendedLanes,r=e.pingedLanes,c=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var y=31-Je(d),S=1<<y,T=c[y];T===-1?((S&l)===0||(S&r)!==0)&&(c[y]=Zb(S,t)):T<=t&&(e.expiredLanes|=S),d&=~S}if(t=Fe,l=De,l=Ws(e,e===t?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,l===0||e===t&&(Ge===2||Ge===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Nl(r),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||Cl(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(r!==null&&Nl(r),io(l)){case 2:case 8:l=ee;break;case 32:l=be;break;case 268435456:l=Ve;break;default:l=be}return r=Ip.bind(null,e),l=wa(l,r),e.callbackPriority=t,e.callbackNode=l,t}return r!==null&&r!==null&&Nl(r),e.callbackPriority=2,e.callbackNode=null,2}function Ip(e,t){if(gt!==0&&gt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(Zr()&&e.callbackNode!==l)return null;var r=De;return r=Ws(e,e===Fe?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Sp(e,r,t),Up(e,Nt()),e.callbackNode!=null&&e.callbackNode===l?Ip.bind(null,e):null)}function Hp(e,t){if(Zr())return null;Sp(e,t,!0)}function x0(){j0(function(){(He&6)!==0?wa(V,v0):qp()})}function Gc(){if(Oi===0){var e=Va;e===0&&(e=Xs,Xs<<=1,(Xs&261888)===0&&(Xs=256)),Oi=e}return Oi}function Yp(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:nr(""+e)}function Vp(e,t){var l=t.ownerDocument.createElement("input");return l.name=t.name,l.value=t.value,e.id&&l.setAttribute("form",e.id),t.parentNode.insertBefore(l,t),e=new FormData(e),l.parentNode.removeChild(l),e}function S0(e,t,l,r,c){if(t==="submit"&&l&&l.stateNode===c){var d=Yp((c[Lt]||null).action),y=r.submitter;y&&(t=(t=y[Lt]||null)?Yp(t.formAction):y.getAttribute("formAction"),t!==null&&(d=t,y=null));var S=new sr("action","action",null,r,c);e.push({event:S,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Oi!==0){var T=y?Vp(c,y):new FormData(c);cc(l,{pending:!0,data:T,method:c.method,action:d},null,T)}}else typeof d=="function"&&(S.preventDefault(),T=y?Vp(c,y):new FormData(c),cc(l,{pending:!0,data:T,method:c.method,action:d},d,T))},currentTarget:c}]})}}for(var Kc=0;Kc<Eo.length;Kc++){var Zc=Eo[Kc],_0=Zc.toLowerCase(),k0=Zc[0].toUpperCase()+Zc.slice(1);vn(_0,"on"+k0)}vn(xh,"onAnimationEnd"),vn(Sh,"onAnimationIteration"),vn(_h,"onAnimationStart"),vn("dblclick","onDoubleClick"),vn("focusin","onFocus"),vn("focusout","onBlur"),vn(Uv,"onTransitionRun"),vn(Iv,"onTransitionStart"),vn(Hv,"onTransitionCancel"),vn(kh,"onTransitionEnd"),Ca("onMouseEnter",["mouseout","mouseover"]),Ca("onMouseLeave",["mouseout","mouseover"]),Ca("onPointerEnter",["pointerout","pointerover"]),Ca("onPointerLeave",["pointerout","pointerover"]),Zi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Zi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Zi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Zi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Zi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Zi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var fs="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(" "),w0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(fs));function Gp(e,t){t=(t&4)!==0;for(var l=0;l<e.length;l++){var r=e[l],c=r.event;r=r.listeners;e:{var d=void 0;if(t)for(var y=r.length-1;0<=y;y--){var S=r[y],T=S.instance,z=S.currentTarget;if(S=S.listener,T!==d&&c.isPropagationStopped())break e;d=S,c.currentTarget=z;try{d(c)}catch(Y){or(Y)}c.currentTarget=null,d=T}else for(y=0;y<r.length;y++){if(S=r[y],T=S.instance,z=S.currentTarget,S=S.listener,T!==d&&c.isPropagationStopped())break e;d=S,c.currentTarget=z;try{d(c)}catch(Y){or(Y)}c.currentTarget=null,d=T}}}}function je(e,t){var l=t[ao];l===void 0&&(l=t[ao]=new Set);var r=e+"__bubble";l.has(r)||(Kp(t,e,2,!1),l.add(r))}function Qc(e,t,l){var r=0;t&&(r|=4),Kp(l,e,r,t)}var Xr="_reactListening"+Math.random().toString(36).slice(2);function $c(e){if(!e[Xr]){e[Xr]=!0,qd.forEach(function(l){l!=="selectionchange"&&(w0.has(l)||Qc(l,!1,e),Qc(l,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Xr]||(t[Xr]=!0,Qc("selectionchange",!1,t))}}function Kp(e,t,l,r){switch(xy(t)){case 2:var c=W0;break;case 8:c=P0;break;default:c=cf}l=c.bind(null,t,l,e),c=void 0,!mo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),r?c!==void 0?e.addEventListener(t,l,{capture:!0,passive:c}):e.addEventListener(t,l,!0):c!==void 0?e.addEventListener(t,l,{passive:c}):e.addEventListener(t,l,!1)}function Xc(e,t,l,r,c){var d=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var y=r.tag;if(y===3||y===4){var S=r.stateNode.containerInfo;if(S===c)break;if(y===4)for(y=r.return;y!==null;){var T=y.tag;if((T===3||T===4)&&y.stateNode.containerInfo===c)return;y=y.return}for(;S!==null;){if(y=Ta(S),y===null)return;if(T=y.tag,T===5||T===6||T===26||T===27){r=d=y;continue e}S=S.parentNode}}r=r.return}Jd(function(){var z=d,Y=fo(l),K=[];e:{var R=wh.get(e);if(R!==void 0){var q=sr,oe=e;switch(e){case"keypress":if(ar(l)===0)break e;case"keydown":case"keyup":q=gv;break;case"focusin":oe="focus",q=bo;break;case"focusout":oe="blur",q=bo;break;case"beforeblur":case"afterblur":q=bo;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":q=Pd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":q=lv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":q=xv;break;case xh:case Sh:case _h:q=uv;break;case kh:q=_v;break;case"scroll":case"scrollend":q=iv;break;case"wheel":q=wv;break;case"copy":case"cut":case"paste":q=cv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":q=th;break;case"toggle":case"beforetoggle":q=Tv}var ge=(t&4)!==0,Xe=!ge&&(e==="scroll"||e==="scrollend"),M=ge?R!==null?R+"Capture":null:R;ge=[];for(var C=z,D;C!==null;){var G=C;if(D=G.stateNode,G=G.tag,G!==5&&G!==26&&G!==27||D===null||M===null||(G=Dl(C,M),G!=null&&ge.push(ds(C,G,D))),Xe)break;C=C.return}0<ge.length&&(R=new q(R,oe,null,l,Y),K.push({event:R,listeners:ge}))}}if((t&7)===0){e:{if(R=e==="mouseover"||e==="pointerover",q=e==="mouseout"||e==="pointerout",R&&l!==co&&(oe=l.relatedTarget||l.fromElement)&&(Ta(oe)||oe[Aa]))break e;if((q||R)&&(R=Y.window===Y?Y:(R=Y.ownerDocument)?R.defaultView||R.parentWindow:window,q?(oe=l.relatedTarget||l.toElement,q=z,oe=oe?Ta(oe):null,oe!==null&&(Xe=o(oe),ge=oe.tag,oe!==Xe||ge!==5&&ge!==27&&ge!==6)&&(oe=null)):(q=null,oe=z),q!==oe)){if(ge=Pd,G="onMouseLeave",M="onMouseEnter",C="mouse",(e==="pointerout"||e==="pointerover")&&(ge=th,G="onPointerLeave",M="onPointerEnter",C="pointer"),Xe=q==null?R:jl(q),D=oe==null?R:jl(oe),R=new ge(G,C+"leave",q,l,Y),R.target=Xe,R.relatedTarget=D,G=null,Ta(Y)===z&&(ge=new ge(M,C+"enter",oe,l,Y),ge.target=D,ge.relatedTarget=Xe,G=ge),Xe=G,q&&oe)t:{for(ge=A0,M=q,C=oe,D=0,G=M;G;G=ge(G))D++;G=0;for(var me=C;me;me=ge(me))G++;for(;0<D-G;)M=ge(M),D--;for(;0<G-D;)C=ge(C),G--;for(;D--;){if(M===C||C!==null&&M===C.alternate){ge=M;break t}M=ge(M),C=ge(C)}ge=null}else ge=null;q!==null&&Zp(K,R,q,ge,!1),oe!==null&&Xe!==null&&Zp(K,Xe,oe,ge,!0)}}e:{if(R=z?jl(z):window,q=R.nodeName&&R.nodeName.toLowerCase(),q==="select"||q==="input"&&R.type==="file")var Ue=oh;else if(rh(R))if(ch)Ue=Lv;else{Ue=zv;var de=Dv}else q=R.nodeName,!q||q.toLowerCase()!=="input"||R.type!=="checkbox"&&R.type!=="radio"?z&&oo(z.elementType)&&(Ue=oh):Ue=Rv;if(Ue&&(Ue=Ue(e,z))){uh(K,Ue,l,Y);break e}de&&de(e,R,z),e==="focusout"&&z&&R.type==="number"&&z.memoizedProps.value!=null&&uo(R,"number",R.value)}switch(de=z?jl(z):window,e){case"focusin":(rh(de)||de.contentEditable==="true")&&(Ra=de,wo=z,Hl=null);break;case"focusout":Hl=wo=Ra=null;break;case"mousedown":Ao=!0;break;case"contextmenu":case"mouseup":case"dragend":Ao=!1,bh(K,l,Y);break;case"selectionchange":if(qv)break;case"keydown":case"keyup":bh(K,l,Y)}var Ee;if(xo)e:{switch(e){case"compositionstart":var ze="onCompositionStart";break e;case"compositionend":ze="onCompositionEnd";break e;case"compositionupdate":ze="onCompositionUpdate";break e}ze=void 0}else za?lh(e,l)&&(ze="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(ze="onCompositionStart");ze&&(nh&&l.locale!=="ko"&&(za||ze!=="onCompositionStart"?ze==="onCompositionEnd"&&za&&(Ee=Fd()):(mi=Y,po="value"in mi?mi.value:mi.textContent,za=!0)),de=Jr(z,ze),0<de.length&&(ze=new eh(ze,e,null,l,Y),K.push({event:ze,listeners:de}),Ee?ze.data=Ee:(Ee=sh(l),Ee!==null&&(ze.data=Ee)))),(Ee=Nv?Cv(e,l):Ov(e,l))&&(ze=Jr(z,"onBeforeInput"),0<ze.length&&(de=new eh("onBeforeInput","beforeinput",null,l,Y),K.push({event:de,listeners:ze}),de.data=Ee)),S0(K,e,z,l,Y)}Gp(K,t)})}function ds(e,t,l){return{instance:e,listener:t,currentTarget:l}}function Jr(e,t){for(var l=t+"Capture",r=[];e!==null;){var c=e,d=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||d===null||(c=Dl(e,l),c!=null&&r.unshift(ds(e,c,d)),c=Dl(e,t),c!=null&&r.push(ds(e,c,d))),e.tag===3)return r;e=e.return}return[]}function A0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Zp(e,t,l,r,c){for(var d=t._reactName,y=[];l!==null&&l!==r;){var S=l,T=S.alternate,z=S.stateNode;if(S=S.tag,T!==null&&T===r)break;S!==5&&S!==26&&S!==27||z===null||(T=z,c?(z=Dl(l,d),z!=null&&y.unshift(ds(l,z,T))):c||(z=Dl(l,d),z!=null&&y.push(ds(l,z,T)))),l=l.return}y.length!==0&&e.push({event:t,listeners:y})}var T0=/\r\n?/g,E0=/\u0000|\uFFFD/g;function Qp(e){return(typeof e=="string"?e:""+e).replace(T0,`
49
+ `).replace(E0,"")}function $p(e,t){return t=Qp(t),Qp(e)===t}function $e(e,t,l,r,c,d){switch(l){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||Ma(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&Ma(e,""+r);break;case"className":er(e,"class",r);break;case"tabIndex":er(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":er(e,l,r);break;case"style":$d(e,r,d);break;case"data":if(t!=="object"){er(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||l!=="href")){e.removeAttribute(l);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(l);break}r=nr(""+r),e.setAttribute(l,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(l,"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 d=="function"&&(l==="formAction"?(t!=="input"&&$e(e,t,"name",c.name,c,null),$e(e,t,"formEncType",c.formEncType,c,null),$e(e,t,"formMethod",c.formMethod,c,null),$e(e,t,"formTarget",c.formTarget,c,null)):($e(e,t,"encType",c.encType,c,null),$e(e,t,"method",c.method,c,null),$e(e,t,"target",c.target,c,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(l);break}r=nr(""+r),e.setAttribute(l,r);break;case"onClick":r!=null&&(e.onclick=Yn);break;case"onScroll":r!=null&&je("scroll",e);break;case"onScrollEnd":r!=null&&je("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(s(61));if(l=r.__html,l!=null){if(c.children!=null)throw Error(s(60));e.innerHTML=l}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}l=nr(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(l,""+r):e.removeAttribute(l);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":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":r===!0?e.setAttribute(l,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(l,r):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(l,r):e.removeAttribute(l);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(l):e.setAttribute(l,r);break;case"popover":je("beforetoggle",e),je("toggle",e),Ps(e,"popover",r);break;case"xlinkActuate":Hn(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Hn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Hn(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Hn(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Hn(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Hn(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Hn(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Hn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Hn(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Ps(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=tv.get(l)||l,Ps(e,l,r))}}function Jc(e,t,l,r,c,d){switch(l){case"style":$d(e,r,d);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(s(61));if(l=r.__html,l!=null){if(c.children!=null)throw Error(s(60));e.innerHTML=l}}break;case"children":typeof r=="string"?Ma(e,r):(typeof r=="number"||typeof r=="bigint")&&Ma(e,""+r);break;case"onScroll":r!=null&&je("scroll",e);break;case"onScrollEnd":r!=null&&je("scrollend",e);break;case"onClick":r!=null&&(e.onclick=Yn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ud.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(c=l.endsWith("Capture"),t=l.slice(2,c?l.length-7:void 0),d=e[Lt]||null,d=d!=null?d[l]:null,typeof d=="function"&&e.removeEventListener(t,d,c),typeof r=="function")){typeof d!="function"&&d!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(t,r,c);break e}l in e?e[l]=r:r===!0?e.setAttribute(l,""):Ps(e,l,r)}}}function Tt(e,t,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":je("error",e),je("load",e);var r=!1,c=!1,d;for(d in l)if(l.hasOwnProperty(d)){var y=l[d];if(y!=null)switch(d){case"src":r=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:$e(e,t,d,y,l,null)}}c&&$e(e,t,"srcSet",l.srcSet,l,null),r&&$e(e,t,"src",l.src,l,null);return;case"input":je("invalid",e);var S=d=y=c=null,T=null,z=null;for(r in l)if(l.hasOwnProperty(r)){var Y=l[r];if(Y!=null)switch(r){case"name":c=Y;break;case"type":y=Y;break;case"checked":T=Y;break;case"defaultChecked":z=Y;break;case"value":d=Y;break;case"defaultValue":S=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(s(137,t));break;default:$e(e,t,r,Y,l,null)}}Gd(e,d,S,T,z,y,c,!1);return;case"select":je("invalid",e),r=y=d=null;for(c in l)if(l.hasOwnProperty(c)&&(S=l[c],S!=null))switch(c){case"value":d=S;break;case"defaultValue":y=S;break;case"multiple":r=S;default:$e(e,t,c,S,l,null)}t=d,l=y,e.multiple=!!r,t!=null?Oa(e,!!r,t,!1):l!=null&&Oa(e,!!r,l,!0);return;case"textarea":je("invalid",e),d=c=r=null;for(y in l)if(l.hasOwnProperty(y)&&(S=l[y],S!=null))switch(y){case"value":r=S;break;case"defaultValue":c=S;break;case"children":d=S;break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(s(91));break;default:$e(e,t,y,S,l,null)}Zd(e,r,c,d);return;case"option":for(T in l)if(l.hasOwnProperty(T)&&(r=l[T],r!=null))switch(T){case"selected":e.selected=r&&typeof r!="function"&&typeof r!="symbol";break;default:$e(e,t,T,r,l,null)}return;case"dialog":je("beforetoggle",e),je("toggle",e),je("cancel",e),je("close",e);break;case"iframe":case"object":je("load",e);break;case"video":case"audio":for(r=0;r<fs.length;r++)je(fs[r],e);break;case"image":je("error",e),je("load",e);break;case"details":je("toggle",e);break;case"embed":case"source":case"link":je("error",e),je("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(z in l)if(l.hasOwnProperty(z)&&(r=l[z],r!=null))switch(z){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:$e(e,t,z,r,l,null)}return;default:if(oo(t)){for(Y in l)l.hasOwnProperty(Y)&&(r=l[Y],r!==void 0&&Jc(e,t,Y,r,l,void 0));return}}for(S in l)l.hasOwnProperty(S)&&(r=l[S],r!=null&&$e(e,t,S,r,l,null))}function N0(e,t,l,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,d=null,y=null,S=null,T=null,z=null,Y=null;for(q in l){var K=l[q];if(l.hasOwnProperty(q)&&K!=null)switch(q){case"checked":break;case"value":break;case"defaultValue":T=K;default:r.hasOwnProperty(q)||$e(e,t,q,null,r,K)}}for(var R in r){var q=r[R];if(K=l[R],r.hasOwnProperty(R)&&(q!=null||K!=null))switch(R){case"type":d=q;break;case"name":c=q;break;case"checked":z=q;break;case"defaultChecked":Y=q;break;case"value":y=q;break;case"defaultValue":S=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(s(137,t));break;default:q!==K&&$e(e,t,R,q,r,K)}}ro(e,y,S,T,z,Y,d,c);return;case"select":q=y=S=R=null;for(d in l)if(T=l[d],l.hasOwnProperty(d)&&T!=null)switch(d){case"value":break;case"multiple":q=T;default:r.hasOwnProperty(d)||$e(e,t,d,null,r,T)}for(c in r)if(d=r[c],T=l[c],r.hasOwnProperty(c)&&(d!=null||T!=null))switch(c){case"value":R=d;break;case"defaultValue":S=d;break;case"multiple":y=d;default:d!==T&&$e(e,t,c,d,r,T)}t=S,l=y,r=q,R!=null?Oa(e,!!l,R,!1):!!r!=!!l&&(t!=null?Oa(e,!!l,t,!0):Oa(e,!!l,l?[]:"",!1));return;case"textarea":q=R=null;for(S in l)if(c=l[S],l.hasOwnProperty(S)&&c!=null&&!r.hasOwnProperty(S))switch(S){case"value":break;case"children":break;default:$e(e,t,S,null,r,c)}for(y in r)if(c=r[y],d=l[y],r.hasOwnProperty(y)&&(c!=null||d!=null))switch(y){case"value":R=c;break;case"defaultValue":q=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(s(91));break;default:c!==d&&$e(e,t,y,c,r,d)}Kd(e,R,q);return;case"option":for(var oe in l)if(R=l[oe],l.hasOwnProperty(oe)&&R!=null&&!r.hasOwnProperty(oe))switch(oe){case"selected":e.selected=!1;break;default:$e(e,t,oe,null,r,R)}for(T in r)if(R=r[T],q=l[T],r.hasOwnProperty(T)&&R!==q&&(R!=null||q!=null))switch(T){case"selected":e.selected=R&&typeof R!="function"&&typeof R!="symbol";break;default:$e(e,t,T,R,r,q)}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 ge in l)R=l[ge],l.hasOwnProperty(ge)&&R!=null&&!r.hasOwnProperty(ge)&&$e(e,t,ge,null,r,R);for(z in r)if(R=r[z],q=l[z],r.hasOwnProperty(z)&&R!==q&&(R!=null||q!=null))switch(z){case"children":case"dangerouslySetInnerHTML":if(R!=null)throw Error(s(137,t));break;default:$e(e,t,z,R,r,q)}return;default:if(oo(t)){for(var Xe in l)R=l[Xe],l.hasOwnProperty(Xe)&&R!==void 0&&!r.hasOwnProperty(Xe)&&Jc(e,t,Xe,void 0,r,R);for(Y in r)R=r[Y],q=l[Y],!r.hasOwnProperty(Y)||R===q||R===void 0&&q===void 0||Jc(e,t,Y,R,r,q);return}}for(var M in l)R=l[M],l.hasOwnProperty(M)&&R!=null&&!r.hasOwnProperty(M)&&$e(e,t,M,null,r,R);for(K in r)R=r[K],q=l[K],!r.hasOwnProperty(K)||R===q||R==null&&q==null||$e(e,t,K,R,r,q)}function Xp(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function C0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,l=performance.getEntriesByType("resource"),r=0;r<l.length;r++){var c=l[r],d=c.transferSize,y=c.initiatorType,S=c.duration;if(d&&S&&Xp(y)){for(y=0,S=c.responseEnd,r+=1;r<l.length;r++){var T=l[r],z=T.startTime;if(z>S)break;var Y=T.transferSize,K=T.initiatorType;Y&&Xp(K)&&(T=T.responseEnd,y+=Y*(T<S?1:(S-z)/(T-z)))}if(--r,t+=8*(d+y)/(c.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Fc=null,Wc=null;function Fr(e){return e.nodeType===9?e:e.ownerDocument}function Jp(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Fp(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Pc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var ef=null;function O0(){var e=window.event;return e&&e.type==="popstate"?e===ef?!1:(ef=e,!0):(ef=null,!1)}var Wp=typeof setTimeout=="function"?setTimeout:void 0,M0=typeof clearTimeout=="function"?clearTimeout:void 0,Pp=typeof Promise=="function"?Promise:void 0,j0=typeof queueMicrotask=="function"?queueMicrotask:typeof Pp<"u"?function(e){return Pp.resolve(null).then(e).catch(D0)}:Wp;function D0(e){setTimeout(function(){throw e})}function Mi(e){return e==="head"}function ey(e,t){var l=t,r=0;do{var c=l.nextSibling;if(e.removeChild(l),c&&c.nodeType===8)if(l=c.data,l==="/$"||l==="/&"){if(r===0){e.removeChild(c),ul(t);return}r--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")r++;else if(l==="html")hs(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,hs(l);for(var d=l.firstChild;d;){var y=d.nextSibling,S=d.nodeName;d[Ml]||S==="SCRIPT"||S==="STYLE"||S==="LINK"&&d.rel.toLowerCase()==="stylesheet"||l.removeChild(d),d=y}}else l==="body"&&hs(e.ownerDocument.body);l=c}while(l);ul(t)}function ty(e,t){var l=e;e=0;do{var r=l.nextSibling;if(l.nodeType===1?t?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(t?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),r&&r.nodeType===8)if(l=r.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=r}while(l)}function tf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var l=t;switch(t=t.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":tf(l),lo(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function z0(e,t,l,r){for(;e.nodeType===1;){var c=l;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[Ml])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(d=e.getAttribute("rel"),d==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(d!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(d=e.getAttribute("src"),(d!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&d&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var d=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===d)return e}else return e;if(e=cn(e.nextSibling),e===null)break}return null}function R0(e,t,l){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=cn(e.nextSibling),e===null))return null;return e}function ny(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=cn(e.nextSibling),e===null))return null;return e}function nf(e){return e.data==="$?"||e.data==="$~"}function af(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function L0(e,t){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||l.readyState!=="loading")t();else{var r=function(){t(),l.removeEventListener("DOMContentLoaded",r)};l.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function cn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var lf=null;function iy(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(t===0)return cn(e.nextSibling);t--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||t++}e=e.nextSibling}return null}function ay(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(t===0)return e;t--}else l!=="/$"&&l!=="/&"||t++}e=e.previousSibling}return null}function ly(e,t,l){switch(t=Fr(l),e){case"html":if(e=t.documentElement,!e)throw Error(s(452));return e;case"head":if(e=t.head,!e)throw Error(s(453));return e;case"body":if(e=t.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}function hs(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);lo(e)}var fn=new Map,sy=new Set;function Wr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ai=$.d;$.d={f:B0,r:q0,D:U0,C:I0,L:H0,m:Y0,X:G0,S:V0,M:K0};function B0(){var e=ai.f(),t=Vr();return e||t}function q0(e){var t=Ea(e);t!==null&&t.tag===5&&t.type==="form"?km(t):ai.r(e)}var ll=typeof document>"u"?null:document;function ry(e,t,l){var r=ll;if(r&&typeof t=="string"&&t){var c=nn(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof l=="string"&&(c+='[crossorigin="'+l+'"]'),sy.has(c)||(sy.add(c),e={rel:e,crossOrigin:l,href:t},r.querySelector(c)===null&&(t=r.createElement("link"),Tt(t,"link",e),vt(t),r.head.appendChild(t)))}}function U0(e){ai.D(e),ry("dns-prefetch",e,null)}function I0(e,t){ai.C(e,t),ry("preconnect",e,t)}function H0(e,t,l){ai.L(e,t,l);var r=ll;if(r&&e&&t){var c='link[rel="preload"][as="'+nn(t)+'"]';t==="image"&&l&&l.imageSrcSet?(c+='[imagesrcset="'+nn(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(c+='[imagesizes="'+nn(l.imageSizes)+'"]')):c+='[href="'+nn(e)+'"]';var d=c;switch(t){case"style":d=sl(e);break;case"script":d=rl(e)}fn.has(d)||(e=g({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),fn.set(d,e),r.querySelector(c)!==null||t==="style"&&r.querySelector(ms(d))||t==="script"&&r.querySelector(ps(d))||(t=r.createElement("link"),Tt(t,"link",e),vt(t),r.head.appendChild(t)))}}function Y0(e,t){ai.m(e,t);var l=ll;if(l&&e){var r=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+nn(r)+'"][href="'+nn(e)+'"]',d=c;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=rl(e)}if(!fn.has(d)&&(e=g({rel:"modulepreload",href:e},t),fn.set(d,e),l.querySelector(c)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(ps(d)))return}r=l.createElement("link"),Tt(r,"link",e),vt(r),l.head.appendChild(r)}}}function V0(e,t,l){ai.S(e,t,l);var r=ll;if(r&&e){var c=Na(r).hoistableStyles,d=sl(e);t=t||"default";var y=c.get(d);if(!y){var S={loading:0,preload:null};if(y=r.querySelector(ms(d)))S.loading=5;else{e=g({rel:"stylesheet",href:e,"data-precedence":t},l),(l=fn.get(d))&&sf(e,l);var T=y=r.createElement("link");vt(T),Tt(T,"link",e),T._p=new Promise(function(z,Y){T.onload=z,T.onerror=Y}),T.addEventListener("load",function(){S.loading|=1}),T.addEventListener("error",function(){S.loading|=2}),S.loading|=4,Pr(y,t,r)}y={type:"stylesheet",instance:y,count:1,state:S},c.set(d,y)}}}function G0(e,t){ai.X(e,t);var l=ll;if(l&&e){var r=Na(l).hoistableScripts,c=rl(e),d=r.get(c);d||(d=l.querySelector(ps(c)),d||(e=g({src:e,async:!0},t),(t=fn.get(c))&&rf(e,t),d=l.createElement("script"),vt(d),Tt(d,"link",e),l.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},r.set(c,d))}}function K0(e,t){ai.M(e,t);var l=ll;if(l&&e){var r=Na(l).hoistableScripts,c=rl(e),d=r.get(c);d||(d=l.querySelector(ps(c)),d||(e=g({src:e,async:!0,type:"module"},t),(t=fn.get(c))&&rf(e,t),d=l.createElement("script"),vt(d),Tt(d,"link",e),l.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},r.set(c,d))}}function uy(e,t,l,r){var c=(c=re.current)?Wr(c):null;if(!c)throw Error(s(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=sl(l.href),l=Na(c).hoistableStyles,r=l.get(t),r||(r={type:"style",instance:null,count:0,state:null},l.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=sl(l.href);var d=Na(c).hoistableStyles,y=d.get(e);if(y||(c=c.ownerDocument||c,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,y),(d=c.querySelector(ms(e)))&&!d._p&&(y.instance=d,y.state.loading=5),fn.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},fn.set(e,l),d||Z0(c,e,l,y.state))),t&&r===null)throw Error(s(528,""));return y}if(t&&r!==null)throw Error(s(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=rl(l),l=Na(c).hoistableScripts,r=l.get(t),r||(r={type:"script",instance:null,count:0,state:null},l.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,e))}}function sl(e){return'href="'+nn(e)+'"'}function ms(e){return'link[rel="stylesheet"]['+e+"]"}function oy(e){return g({},e,{"data-precedence":e.precedence,precedence:null})}function Z0(e,t,l,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),Tt(t,"link",l),vt(t),e.head.appendChild(t))}function rl(e){return'[src="'+nn(e)+'"]'}function ps(e){return"script[async]"+e}function cy(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+nn(l.href)+'"]');if(r)return t.instance=r,vt(r),r;var c=g({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),vt(r),Tt(r,"style",c),Pr(r,l.precedence,e),t.instance=r;case"stylesheet":c=sl(l.href);var d=e.querySelector(ms(c));if(d)return t.state.loading|=4,t.instance=d,vt(d),d;r=oy(l),(c=fn.get(c))&&sf(r,c),d=(e.ownerDocument||e).createElement("link"),vt(d);var y=d;return y._p=new Promise(function(S,T){y.onload=S,y.onerror=T}),Tt(d,"link",r),t.state.loading|=4,Pr(d,l.precedence,e),t.instance=d;case"script":return d=rl(l.src),(c=e.querySelector(ps(d)))?(t.instance=c,vt(c),c):(r=l,(c=fn.get(d))&&(r=g({},l),rf(r,c)),e=e.ownerDocument||e,c=e.createElement("script"),vt(c),Tt(c,"link",r),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(s(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,Pr(r,l.precedence,e));return t.instance}function Pr(e,t,l){for(var r=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=r.length?r[r.length-1]:null,d=c,y=0;y<r.length;y++){var S=r[y];if(S.dataset.precedence===t)d=S;else if(d!==c)break}d?d.parentNode.insertBefore(e,d.nextSibling):(t=l.nodeType===9?l.head:l,t.insertBefore(e,t.firstChild))}function sf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function rf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var eu=null;function fy(e,t,l){if(eu===null){var r=new Map,c=eu=new Map;c.set(l,r)}else c=eu,r=c.get(l),r||(r=new Map,c.set(l,r));if(r.has(e))return r;for(r.set(e,null),l=l.getElementsByTagName(e),c=0;c<l.length;c++){var d=l[c];if(!(d[Ml]||d[_t]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var y=d.getAttribute(t)||"";y=e+y;var S=r.get(y);S?S.push(d):r.set(y,[d])}}return r}function dy(e,t,l){e=e.ownerDocument||e,e.head.insertBefore(l,t==="title"?e.querySelector("head > title"):null)}function Q0(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function hy(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function $0(e,t,l,r){if(l.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var c=sl(r.href),d=t.querySelector(ms(c));if(d){t=d._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=tu.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=d,vt(d);return}d=t.ownerDocument||t,r=oy(r),(c=fn.get(c))&&sf(r,c),d=d.createElement("link"),vt(d);var y=d;y._p=new Promise(function(S,T){y.onload=S,y.onerror=T}),Tt(d,"link",r),l.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=tu.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var uf=0;function X0(e,t){return e.stylesheets&&e.count===0&&iu(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var r=setTimeout(function(){if(e.stylesheets&&iu(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+t);0<e.imgBytes&&uf===0&&(uf=62500*C0());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&iu(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>uf?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(c)}}:null}function tu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)iu(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var nu=null;function iu(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,nu=new Map,t.forEach(J0,e),nu=null,tu.call(e))}function J0(e,t){if(!(t.state.loading&4)){var l=nu.get(e);if(l)var r=l.get(null);else{l=new Map,nu.set(e,l);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<c.length;d++){var y=c[d];(y.nodeName==="LINK"||y.getAttribute("media")!=="not all")&&(l.set(y.dataset.precedence,y),r=y)}r&&l.set(null,r)}c=t.instance,y=c.getAttribute("data-precedence"),d=l.get(y)||r,d===r&&l.set(null,c),l.set(y,c),this.count++,r=tu.bind(this),c.addEventListener("load",r),c.addEventListener("error",r),d?d.parentNode.insertBefore(c,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var ys={$$typeof:I,Provider:null,Consumer:null,_currentValue:fe,_currentValue2:fe,_threadCount:0};function F0(e,t,l,r,c,d,y,S,T){this.tag=1,this.containerInfo=e,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=to(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=to(0),this.hiddenUpdates=to(null),this.identifierPrefix=r,this.onUncaughtError=c,this.onCaughtError=d,this.onRecoverableError=y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=T,this.incompleteTransitions=new Map}function my(e,t,l,r,c,d,y,S,T,z,Y,K){return e=new F0(e,t,l,y,T,z,Y,K,S),t=1,d===!0&&(t|=24),d=$t(3,null,null,t),e.current=d,d.stateNode=e,t=Io(),t.refCount++,e.pooledCache=t,t.refCount++,d.memoizedState={element:r,isDehydrated:l,cache:t},Go(d),e}function py(e){return e?(e=qa,e):qa}function yy(e,t,l,r,c,d){c=py(c),r.context===null?r.context=c:r.pendingContext=c,r=xi(t),r.payload={element:l},d=d===void 0?null:d,d!==null&&(r.callback=d),l=Si(e,r,t),l!==null&&(Yt(l,e,t),$l(l,e,t))}function gy(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<t?l:t}}function of(e,t){gy(e,t),(e=e.alternate)&&gy(e,t)}function by(e){if(e.tag===13||e.tag===31){var t=Ji(e,67108864);t!==null&&Yt(t,e,67108864),of(e,67108864)}}function vy(e){if(e.tag===13||e.tag===31){var t=Pt();t=no(t);var l=Ji(e,t);l!==null&&Yt(l,e,t),of(e,t)}}var au=!0;function W0(e,t,l,r){var c=B.T;B.T=null;var d=$.p;try{$.p=2,cf(e,t,l,r)}finally{$.p=d,B.T=c}}function P0(e,t,l,r){var c=B.T;B.T=null;var d=$.p;try{$.p=8,cf(e,t,l,r)}finally{$.p=d,B.T=c}}function cf(e,t,l,r){if(au){var c=ff(r);if(c===null)Xc(e,t,r,lu,l),Sy(e,r);else if(t1(c,e,t,l,r))r.stopPropagation();else if(Sy(e,r),t&4&&-1<e1.indexOf(e)){for(;c!==null;){var d=Ea(c);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var y=Ki(d.pendingLanes);if(y!==0){var S=d;for(S.pendingLanes|=2,S.entangledLanes|=2;y;){var T=1<<31-Je(y);S.entanglements[1]|=T,y&=~T}Cn(d),(He&6)===0&&(Hr=Nt()+500,cs(0))}}break;case 31:case 13:S=Ji(d,2),S!==null&&Yt(S,d,2),Vr(),of(d,2)}if(d=ff(r),d===null&&Xc(e,t,r,lu,l),d===c)break;c=d}c!==null&&r.stopPropagation()}else Xc(e,t,r,null,l)}}function ff(e){return e=fo(e),df(e)}var lu=null;function df(e){if(lu=null,e=Ta(e),e!==null){var t=o(e);if(t===null)e=null;else{var l=t.tag;if(l===13){if(e=f(t),e!==null)return e;e=null}else if(l===31){if(e=h(t),e!==null)return e;e=null}else if(l===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return lu=e,null}function xy(e){switch(e){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(eo()){case V:return 2;case ee:return 8;case be:case Oe:return 32;case Ve:return 268435456;default:return 32}default:return 32}}var hf=!1,ji=null,Di=null,zi=null,gs=new Map,bs=new Map,Ri=[],e1="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 Sy(e,t){switch(e){case"focusin":case"focusout":ji=null;break;case"dragenter":case"dragleave":Di=null;break;case"mouseover":case"mouseout":zi=null;break;case"pointerover":case"pointerout":gs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":bs.delete(t.pointerId)}}function vs(e,t,l,r,c,d){return e===null||e.nativeEvent!==d?(e={blockedOn:t,domEventName:l,eventSystemFlags:r,nativeEvent:d,targetContainers:[c]},t!==null&&(t=Ea(t),t!==null&&by(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function t1(e,t,l,r,c){switch(t){case"focusin":return ji=vs(ji,e,t,l,r,c),!0;case"dragenter":return Di=vs(Di,e,t,l,r,c),!0;case"mouseover":return zi=vs(zi,e,t,l,r,c),!0;case"pointerover":var d=c.pointerId;return gs.set(d,vs(gs.get(d)||null,e,t,l,r,c)),!0;case"gotpointercapture":return d=c.pointerId,bs.set(d,vs(bs.get(d)||null,e,t,l,r,c)),!0}return!1}function _y(e){var t=Ta(e.target);if(t!==null){var l=o(t);if(l!==null){if(t=l.tag,t===13){if(t=f(l),t!==null){e.blockedOn=t,Ld(e.priority,function(){vy(l)});return}}else if(t===31){if(t=h(l),t!==null){e.blockedOn=t,Ld(e.priority,function(){vy(l)});return}}else if(t===3&&l.stateNode.current.memoizedState.isDehydrated){e.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}e.blockedOn=null}function su(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var l=ff(e.nativeEvent);if(l===null){l=e.nativeEvent;var r=new l.constructor(l.type,l);co=r,l.target.dispatchEvent(r),co=null}else return t=Ea(l),t!==null&&by(t),e.blockedOn=l,!1;t.shift()}return!0}function ky(e,t,l){su(e)&&l.delete(t)}function n1(){hf=!1,ji!==null&&su(ji)&&(ji=null),Di!==null&&su(Di)&&(Di=null),zi!==null&&su(zi)&&(zi=null),gs.forEach(ky),bs.forEach(ky)}function ru(e,t){e.blockedOn===t&&(e.blockedOn=null,hf||(hf=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,n1)))}var uu=null;function wy(e){uu!==e&&(uu=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){uu===e&&(uu=null);for(var t=0;t<e.length;t+=3){var l=e[t],r=e[t+1],c=e[t+2];if(typeof r!="function"){if(df(r||l)===null)continue;break}var d=Ea(l);d!==null&&(e.splice(t,3),t-=3,cc(d,{pending:!0,data:c,method:l.method,action:r},r,c))}}))}function ul(e){function t(T){return ru(T,e)}ji!==null&&ru(ji,e),Di!==null&&ru(Di,e),zi!==null&&ru(zi,e),gs.forEach(t),bs.forEach(t);for(var l=0;l<Ri.length;l++){var r=Ri[l];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ri.length&&(l=Ri[0],l.blockedOn===null);)_y(l),l.blockedOn===null&&Ri.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(r=0;r<l.length;r+=3){var c=l[r],d=l[r+1],y=c[Lt]||null;if(typeof d=="function")y||wy(l);else if(y){var S=null;if(d&&d.hasAttribute("formAction")){if(c=d,y=d[Lt]||null)S=y.formAction;else if(df(c)!==null)continue}else S=y.action;typeof S=="function"?l[r+1]=S:(l.splice(r,3),r-=3),wy(l)}}}function Ay(){function e(d){d.canIntercept&&d.info==="react-transition"&&d.intercept({handler:function(){return new Promise(function(y){return c=y})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),r||setTimeout(l,20)}function l(){if(!r&&!navigation.transition){var d=navigation.currentEntry;d&&d.url!=null&&navigation.navigate(d.url,{state:d.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(l,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function mf(e){this._internalRoot=e}ou.prototype.render=mf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));var l=t.current,r=Pt();yy(l,r,e,t,null,null)},ou.prototype.unmount=mf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;yy(e.current,2,null,e,null,null),Vr(),t[Aa]=null}};function ou(e){this._internalRoot=e}ou.prototype.unstable_scheduleHydration=function(e){if(e){var t=Rd();e={blockedOn:null,target:e,priority:t};for(var l=0;l<Ri.length&&t!==0&&t<Ri[l].priority;l++);Ri.splice(l,0,e),l===0&&_y(e)}};var Ty=n.version;if(Ty!=="19.2.4")throw Error(s(527,Ty,"19.2.4"));$.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=m(t),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var i1={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var cu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!cu.isDisabled&&cu.supportsFiber)try{Ct=cu.inject(i1),yt=cu}catch{}}return Ss.createRoot=function(e,t){if(!u(e))throw Error(s(299));var l=!1,r="",c=Dm,d=zm,y=Rm;return t!=null&&(t.unstable_strictMode===!0&&(l=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(d=t.onCaughtError),t.onRecoverableError!==void 0&&(y=t.onRecoverableError)),t=my(e,1,!1,null,null,l,r,null,c,d,y,Ay),e[Aa]=t.current,$c(e),new mf(t)},Ss.hydrateRoot=function(e,t,l){if(!u(e))throw Error(s(299));var r=!1,c="",d=Dm,y=zm,S=Rm,T=null;return l!=null&&(l.unstable_strictMode===!0&&(r=!0),l.identifierPrefix!==void 0&&(c=l.identifierPrefix),l.onUncaughtError!==void 0&&(d=l.onUncaughtError),l.onCaughtError!==void 0&&(y=l.onCaughtError),l.onRecoverableError!==void 0&&(S=l.onRecoverableError),l.formState!==void 0&&(T=l.formState)),t=my(e,1,!0,t,l??null,r,c,T,d,y,S,Ay),t.context=py(null),l=t.current,r=Pt(),r=no(r),c=xi(r),c.callback=null,Si(l,c,r),l=r,t.current.lanes=l,Ol(t,l),Cn(t),e[Aa]=t.current,$c(e),new ou(t)},Ss.version="19.2.4",Ss}var Ly;function y1(){if(Ly)return gf.exports;Ly=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(n){console.error(n)}}return i(),gf.exports=p1(),gf.exports}var g1=y1();function b1({domain:i,onChange:n,onSample:a}){const s=(u,o)=>{n({...i,[u]:o})};return x.jsxs("div",{className:"flex flex-col gap-3",children:[x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsx("h3",{className:"m-0 text-sm font-semibold text-text-primary",children:"Domain Context"}),x.jsx("button",{type:"button",onClick:a,className:"px-2.5 py-1 border border-border rounded bg-surface-1 text-primary text-xs font-medium cursor-pointer hover:bg-surface-2 transition-colors",title:"Fill with random sample data",children:"Sample"})]}),x.jsxs("label",{className:"flex flex-col gap-1",children:[x.jsx("span",{className:"text-xs font-medium text-text-secondary",children:"Flow Name"}),x.jsx("input",{type:"text",value:i.name,onChange:u=>s("name",u.target.value),placeholder:"e.g., kyc-verification",className:"px-2.5 py-2 border border-border rounded-md bg-surface-2 text-text-primary text-sm outline-none focus:border-primary focus:ring-1 focus:ring-primary/30 transition-colors"})]}),x.jsxs("label",{className:"flex flex-col gap-1",children:[x.jsx("span",{className:"text-xs font-medium text-text-secondary",children:"Domain"}),x.jsx("input",{type:"text",value:i.domain,onChange:u=>s("domain",u.target.value),placeholder:"e.g., finance, healthcare, engineering",className:"px-2.5 py-2 border border-border rounded-md bg-surface-2 text-text-primary text-sm outline-none focus:border-primary focus:ring-1 focus:ring-primary/30 transition-colors"})]}),x.jsxs("label",{className:"flex flex-col gap-1",children:[x.jsx("span",{className:"text-xs font-medium text-text-secondary",children:"Description"}),x.jsx("textarea",{value:i.description,onChange:u=>s("description",u.target.value),placeholder:"What should this flow accomplish?",rows:3,className:"px-2.5 py-2 border border-border rounded-md bg-surface-2 text-text-primary text-sm outline-none resize-y focus:border-primary focus:ring-1 focus:ring-primary/30 transition-colors font-[inherit]"})]}),x.jsxs("label",{className:"flex flex-col gap-1",children:[x.jsx("span",{className:"text-xs font-medium text-text-secondary",children:"Business Rules"}),x.jsx("textarea",{value:i.businessRules,onChange:u=>s("businessRules",u.target.value),placeholder:"Constraints, requirements, compliance rules...",rows:3,className:"px-2.5 py-2 border border-border rounded-md bg-surface-2 text-text-primary text-sm outline-none resize-y focus:border-primary focus:ring-1 focus:ring-primary/30 transition-colors font-[inherit]"})]})]})}function Hi({className:i="",...n}){return x.jsx("input",{...n,className:`px-2 py-1 border border-border rounded bg-surface-2 text-text-primary text-xs outline-none focus:border-primary ${i}`})}const v1={primary:"px-2.5 py-1 border border-primary rounded bg-primary-light text-primary-text text-[11px] cursor-pointer whitespace-nowrap hover:bg-primary hover:text-white transition-colors",ghost:"border-none bg-transparent text-text-muted cursor-pointer text-xs px-0.5 hover:text-error"};function wn({variant:i="primary",className:n="",...a}){return x.jsx("button",{type:"button",...a,className:`${v1[i]} ${n}`})}const x1=[{mode:"immediate",short:"Immediate",hint:"Components appear in the first response"},{mode:"keyword",short:"Keyword",hint:"When user says a keyword"},{mode:"form-submit",short:"Form Submit",hint:"After form submission from previous step"},{mode:"contextual",short:"Contextual",hint:"Based on conversation context"}],S1=[{type:"form",label:"Form"},{type:"button",label:"Button"},{type:"tasklist",label:"Tasklist"},{type:"table",label:"Table"},{type:"callout",label:"Callout"},{type:"approval-gate",label:"Approval Gate"},{type:"webhook",label:"Webhook"},{type:"chart",label:"Chart"},{type:"thinking",label:"Thinking"}];function _1(i){const n={type:i,enabled:!0};return i==="form"&&(n.form={fields:[]}),i==="tasklist"&&(n.tasklist={items:[]}),i==="table"&&(n.table={columns:[]}),i==="approval-gate"&&(n.approvalGate={roles:[],requiredApprovers:1,requireReason:!1}),n}function k1(i){return{label:`Step ${i+1}`,triggerMode:i===0?"immediate":"form-submit",trigger:"",components:[],description:""}}function w1({flowSteps:i,onChange:n}){const a=(m,b)=>{n(i.map((g,_)=>_===m?{...g,...b}:g))},s=()=>n([...i,k1(i.length)]),u=m=>{i.length<=1||n(i.filter((b,g)=>g!==m))},o=(m,b)=>{const g=m+b;if(g<0||g>=i.length)return;const _=[...i];[_[m],_[g]]=[_[g],_[m]],n(_)},f=(m,b)=>{const g=i[m];a(m,{components:[...g.components,_1(b)]})},h=(m,b)=>{const g=i[m];a(m,{components:g.components.filter((_,v)=>v!==b)})},p=(m,b,g)=>{const v=i[m].components.map((O,w)=>w===b?{...O,...g}:O);a(m,{components:v})};return x.jsxs("div",{className:"flex flex-col gap-3",children:[x.jsx("h3",{className:"m-0 text-sm font-semibold text-text-primary",children:"Conversation Flow"}),x.jsx("p",{className:"text-xs text-text-muted m-0",children:"Define each step of the conversation. Each step has its own trigger and components."}),i.map((m,b)=>x.jsx(A1,{index:b,step:m,total:i.length,onUpdate:g=>a(b,g),onMove:g=>o(b,g),onRemove:()=>u(b),onAddComponent:g=>f(b,g),onRemoveComponent:g=>h(b,g),onUpdateComponent:(g,_)=>p(b,g,_)},b)),x.jsx(wn,{onClick:s,className:"self-start",children:"+ Add Step"})]})}function A1({index:i,step:n,total:a,onUpdate:s,onMove:u,onRemove:o,onAddComponent:f,onRemoveComponent:h,onUpdateComponent:p}){const[m,b]=ne.useState(!1);return x.jsxs("div",{className:"flex flex-col gap-2 p-3 border border-border rounded-lg bg-surface-1",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("span",{className:"w-6 h-6 rounded-full bg-primary text-white text-xs font-bold flex items-center justify-center flex-shrink-0",children:i+1}),x.jsx("input",{type:"text",value:n.label,onChange:g=>s({label:g.target.value}),placeholder:"Step label...",className:"flex-1 px-2 py-1 border border-border rounded bg-surface-2 text-text-primary text-xs outline-none focus:border-primary"}),x.jsxs("div",{className:"flex gap-0.5",children:[x.jsx("button",{type:"button",onClick:()=>u(-1),disabled:i===0,className:"px-1.5 py-0.5 text-xs text-text-muted hover:text-text-primary disabled:opacity-30 bg-transparent border-none cursor-pointer",children:"↑"}),x.jsx("button",{type:"button",onClick:()=>u(1),disabled:i===a-1,className:"px-1.5 py-0.5 text-xs text-text-muted hover:text-text-primary disabled:opacity-30 bg-transparent border-none cursor-pointer",children:"↓"}),a>1&&x.jsx("button",{type:"button",onClick:o,className:"px-1.5 py-0.5 text-xs text-text-muted hover:text-error bg-transparent border-none cursor-pointer",children:"✕"})]})]}),x.jsxs("div",{className:"flex flex-col gap-1",children:[x.jsx("span",{className:"text-[11px] text-text-secondary font-medium",children:"Trigger"}),x.jsx("div",{className:"flex gap-1 flex-wrap",children:x1.map(g=>x.jsx("button",{type:"button",onClick:()=>s({triggerMode:g.mode,trigger:g.mode==="immediate"||g.mode==="form-submit"?"":n.trigger}),title:g.hint,className:`px-2 py-1 border rounded text-[10px] font-medium cursor-pointer transition-colors
50
+ ${n.triggerMode===g.mode?"border-primary text-primary-text bg-primary-light":"border-border text-text-secondary bg-surface-2 hover:bg-surface-3"}`,children:g.short},g.mode))}),n.triggerMode==="keyword"&&x.jsx(Hi,{value:n.trigger,onChange:g=>s({trigger:g.target.value}),placeholder:'e.g., "start KYC", "new incident"',className:"w-full"}),n.triggerMode==="contextual"&&x.jsx("textarea",{value:n.trigger,onChange:g=>s({trigger:g.target.value}),placeholder:'e.g., "After user provides details..."',rows:2,className:"px-2 py-1.5 border border-border rounded bg-surface-2 text-text-primary text-xs outline-none resize-y focus:border-primary font-[inherit]"}),n.triggerMode==="form-submit"&&x.jsx("span",{className:"text-[10px] text-text-muted italic",children:"Triggered after form submission from previous step."}),n.triggerMode==="immediate"&&x.jsx("span",{className:"text-[10px] text-text-muted italic",children:"Components appear in the first response."})]}),x.jsxs("div",{className:"flex flex-col gap-1.5",children:[x.jsx("span",{className:"text-[11px] text-text-secondary font-medium",children:"Components"}),n.components.map((g,_)=>x.jsx(T1,{comp:g,onUpdate:v=>p(_,v),onRemove:()=>h(_)},_)),x.jsxs("div",{className:"relative",children:[x.jsx(wn,{onClick:()=>b(g=>!g),children:"+ Add Component"}),m&&x.jsx("div",{className:"absolute z-10 mt-1 bg-surface-2 border border-border rounded-lg shadow-lg py-1 w-48",children:S1.map(g=>x.jsx("button",{type:"button",onClick:()=>{f(g.type),b(!1)},className:"w-full text-left px-3 py-1.5 text-xs text-text-primary hover:bg-surface-3 bg-transparent border-none cursor-pointer",children:g.label},g.type))})]})]}),x.jsx("textarea",{value:n.description,onChange:g=>s({description:g.target.value}),placeholder:"Optional: describe what happens at this step...",rows:2,className:"px-2 py-1.5 border border-border rounded bg-surface-2 text-text-primary text-xs outline-none resize-y focus:border-primary font-[inherit]"})]})}function T1({comp:i,onUpdate:n,onRemove:a}){const[s,u]=ne.useState(!1);return x.jsxs("div",{className:"border border-border rounded bg-surface-0 p-2",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("button",{type:"button",onClick:()=>u(o=>!o),className:"text-[10px] text-text-muted bg-transparent border-none cursor-pointer",children:s?"▼":"▶"}),x.jsx("span",{className:"text-xs font-medium text-primary-text flex-1",children:i.type}),x.jsx(wn,{variant:"ghost",onClick:a,children:"✕"})]}),s&&x.jsxs("div",{className:"mt-2",children:[i.type==="form"&&x.jsx(E1,{comp:i,onUpdate:n}),i.type==="approval-gate"&&x.jsx(N1,{comp:i,onUpdate:n}),i.type==="tasklist"&&x.jsx(C1,{comp:i,onUpdate:n}),i.type==="table"&&x.jsx(O1,{comp:i,onUpdate:n}),!["form","approval-gate","tasklist","table"].includes(i.type)&&x.jsx("span",{className:"text-[10px] text-text-muted",children:"No additional configuration needed."})]})]})}function E1({comp:i,onUpdate:n}){var f;const a=((f=i.form)==null?void 0:f.fields)??[],[s,u]=ne.useState({name:"",type:"text",label:"",required:!1,sensitive:!1}),o=()=>{!s.name||!s.label||(n({form:{fields:[...a,{...s}]}}),u({name:"",type:"text",label:"",required:!1,sensitive:!1}))};return x.jsxs("div",{className:"flex flex-col gap-1.5",children:[a.map((h,p)=>x.jsxs("div",{className:"flex items-center gap-1.5 text-[10px]",children:[x.jsx("span",{className:"font-medium text-primary-text",children:h.name}),x.jsxs("span",{className:"text-text-muted",children:["(",h.type,")"]}),x.jsxs("span",{className:"text-text-secondary",children:['"',h.label,'"']}),h.required&&x.jsx("span",{className:"text-warning",children:"req"}),h.sensitive&&x.jsx("span",{className:"text-error",children:"PII"}),x.jsx(wn,{variant:"ghost",onClick:()=>n({form:{fields:a.filter((m,b)=>b!==p)}}),children:"x"})]},p)),x.jsxs("div",{className:"flex gap-1 flex-wrap items-center",children:[x.jsx(Hi,{placeholder:"name",value:s.name,onChange:h=>u(p=>({...p,name:h.target.value})),className:"w-16"}),x.jsx(Hi,{placeholder:"label",value:s.label,onChange:h=>u(p=>({...p,label:h.target.value})),className:"w-20"}),x.jsx("select",{value:s.type,onChange:h=>u(p=>({...p,type:h.target.value})),className:"px-1 py-0.5 border border-border rounded bg-surface-2 text-text-primary text-[10px] outline-none",children:["text","number","email","date","select","checkbox","textarea"].map(h=>x.jsx("option",{value:h,children:h},h))}),x.jsxs("label",{className:"text-[10px] text-text-secondary flex items-center gap-0.5",children:[x.jsx("input",{type:"checkbox",checked:s.required,onChange:h=>u(p=>({...p,required:h.target.checked}))}),"req"]}),x.jsxs("label",{className:"text-[10px] text-text-secondary flex items-center gap-0.5",children:[x.jsx("input",{type:"checkbox",checked:s.sensitive,onChange:h=>u(p=>({...p,sensitive:h.target.checked}))}),"PII"]}),x.jsx(wn,{onClick:o,children:"+"})]})]})}function N1({comp:i,onUpdate:n}){const a=i.approvalGate??{roles:[],requiredApprovers:1,requireReason:!1},[s,u]=ne.useState("");return x.jsxs("div",{className:"flex flex-col gap-1.5",children:[x.jsx("div",{className:"flex gap-1 flex-wrap",children:a.roles.map((o,f)=>x.jsxs("span",{className:"bg-primary-light text-primary-text px-1.5 py-0.5 rounded text-[10px]",children:[o," ",x.jsx(wn,{variant:"ghost",className:"ml-0.5",onClick:()=>n({approvalGate:{...a,roles:a.roles.filter((h,p)=>p!==f)}}),children:"x"})]},f))}),x.jsxs("div",{className:"flex gap-1 items-center",children:[x.jsx(Hi,{placeholder:"role",value:s,onChange:o=>u(o.target.value),onKeyDown:o=>{o.key==="Enter"&&s&&(n({approvalGate:{...a,roles:[...a.roles,s]}}),u(""))},className:"w-24"}),x.jsx(wn,{onClick:()=>{s&&(n({approvalGate:{...a,roles:[...a.roles,s]}}),u(""))},children:"+"})]}),x.jsxs("span",{className:"text-[10px] text-text-secondary flex items-center gap-1",children:["Approvers: ",x.jsx(Hi,{type:"number",min:1,value:a.requiredApprovers,onChange:o=>n({approvalGate:{...a,requiredApprovers:Number(o.target.value)}}),className:"w-10"})]}),x.jsxs("label",{className:"text-[10px] text-text-secondary flex items-center gap-1",children:[x.jsx("input",{type:"checkbox",checked:a.requireReason,onChange:o=>n({approvalGate:{...a,requireReason:o.target.checked}})}),"Require reason on denial"]})]})}function C1({comp:i,onUpdate:n}){var o;const a=((o=i.tasklist)==null?void 0:o.items)??[],[s,u]=ne.useState("");return x.jsxs("div",{className:"flex flex-col gap-1",children:[a.map((f,h)=>x.jsxs("div",{className:"flex items-center gap-1 text-[10px]",children:[x.jsx("span",{className:"text-text-primary",children:f}),x.jsx(wn,{variant:"ghost",onClick:()=>n({tasklist:{items:a.filter((p,m)=>m!==h)}}),children:"x"})]},h)),x.jsxs("div",{className:"flex gap-1",children:[x.jsx(Hi,{placeholder:"New item",value:s,onChange:f=>u(f.target.value),onKeyDown:f=>{f.key==="Enter"&&s&&(n({tasklist:{items:[...a,s]}}),u(""))},className:"flex-1"}),x.jsx(wn,{onClick:()=>{s&&(n({tasklist:{items:[...a,s]}}),u(""))},children:"+"})]})]})}function O1({comp:i,onUpdate:n}){var o;const a=((o=i.table)==null?void 0:o.columns)??[],[s,u]=ne.useState({key:"",header:""});return x.jsxs("div",{className:"flex flex-col gap-1",children:[a.map((f,h)=>x.jsxs("div",{className:"flex items-center gap-1 text-[10px]",children:[x.jsx("span",{className:"text-primary-text",children:f.key}),x.jsxs("span",{className:"text-text-secondary",children:['"',f.header,'"']}),x.jsx(wn,{variant:"ghost",onClick:()=>n({table:{columns:a.filter((p,m)=>m!==h)}}),children:"x"})]},h)),x.jsxs("div",{className:"flex gap-1",children:[x.jsx(Hi,{placeholder:"key",value:s.key,onChange:f=>u(h=>({...h,key:f.target.value})),className:"w-16"}),x.jsx(Hi,{placeholder:"header",value:s.header,onChange:f=>u(h=>({...h,header:f.target.value})),className:"flex-1"}),x.jsx(wn,{onClick:()=>{s.key&&s.header&&(n({table:{columns:[...a,{...s}]}}),u({key:"",header:""}))},children:"+"})]})]})}const M1={baseUrl:"http://localhost:11434/v1",apiKey:"",model:"llama3"},zs={openai:{label:"OpenAI",baseUrl:"https://api.openai.com/v1",apiKey:"",model:"gpt-4o",requiresKey:!0},anthropic:{label:"Anthropic",baseUrl:"https://api.anthropic.com/v1",apiKey:"",model:"claude-sonnet-4-5-20250929",requiresKey:!0},gemini:{label:"Gemini",baseUrl:"https://generativelanguage.googleapis.com/v1beta/openai",apiKey:"",model:"gemini-2.0-flash",requiresKey:!0},openrouter:{label:"OpenRouter",baseUrl:"https://openrouter.ai/api/v1",apiKey:"",model:"anthropic/claude-sonnet-4-5-20250929",requiresKey:!0},groq:{label:"Groq",baseUrl:"https://api.groq.com/openai/v1",apiKey:"",model:"llama-3.3-70b-versatile",requiresKey:!0},ollama:{label:"Ollama",baseUrl:"http://localhost:11434/v1",apiKey:"",model:"llama3",requiresKey:!1}};async function*Cg(i,n,a){var m,b,g,_;const s=`${i.baseUrl.replace(/\/+$/,"")}/chat/completions`,u={"Content-Type":"application/json"};i.apiKey&&(u.Authorization=`Bearer ${i.apiKey}`);const o=await fetch(s,{method:"POST",headers:u,body:JSON.stringify({model:i.model,messages:n,stream:!0}),signal:a});if(!o.ok){const v=await o.text();throw new Error(`LLM API error ${o.status}: ${v}`)}const f=(m=o.body)==null?void 0:m.getReader();if(!f)throw new Error("No response body");const h=new TextDecoder;let p="";for(;;){const{done:v,value:O}=await f.read();if(v)break;p+=h.decode(O,{stream:!0});const w=p.split(`
51
+ `);p=w.pop()??"";for(const j of w){const E=j.trim();if(!E||!E.startsWith("data: "))continue;const H=E.slice(6);if(H==="[DONE]")return;try{const Q=(_=(g=(b=JSON.parse(H).choices)==null?void 0:b[0])==null?void 0:g.delta)==null?void 0:_.content;Q&&(yield Q)}catch{}}}}async function Og(i,n,a){var h,p,m;const s=`${i.baseUrl.replace(/\/+$/,"")}/chat/completions`,u={"Content-Type":"application/json"};i.apiKey&&(u.Authorization=`Bearer ${i.apiKey}`);const o=await fetch(s,{method:"POST",headers:u,body:JSON.stringify({model:i.model,messages:n,stream:!1}),signal:a});if(!o.ok){const b=await o.text();throw new Error(`LLM API error ${o.status}: ${b}`)}return((m=(p=(h=(await o.json()).choices)==null?void 0:h[0])==null?void 0:p.message)==null?void 0:m.content)??""}function j1({config:i,onConfigChange:n,activeProvider:a}){const s=a?zs[a]:null;return x.jsxs("div",{className:"p-3 border border-border rounded-lg bg-surface-1 mb-2 flex flex-col gap-2.5",children:[x.jsx("span",{className:"text-xs text-text-secondary font-medium",children:"Provider"}),x.jsx("div",{className:"flex gap-1.5 flex-wrap",children:Object.entries(zs).map(([u,o])=>x.jsx("button",{type:"button",onClick:()=>n({baseUrl:o.baseUrl,model:o.model,apiKey:i.apiKey}),className:`
52
+ px-3 py-1.5 border rounded text-xs font-medium cursor-pointer transition-colors
53
+ ${a===u?"border-primary text-primary-text bg-primary-light":"border-border text-text-secondary bg-surface-2 hover:bg-surface-3"}
54
+ `,children:o.label},u))}),(s==null?void 0:s.requiresKey)&&x.jsxs("div",{className:"flex flex-col gap-1",children:[x.jsxs("span",{className:"text-[11px] text-text-secondary",children:[s.label," API Key"]}),x.jsx("input",{placeholder:`Enter your ${s.label} API key...`,type:"password",value:i.apiKey,onChange:u=>n({...i,apiKey:u.target.value}),className:`
55
+ px-2 py-1.5 border rounded bg-surface-2 text-text-primary text-xs outline-none focus:ring-1 focus:ring-primary/30
56
+ ${i.apiKey?"border-success/30":"border-warning/30"}
57
+ `}),i.apiKey&&x.jsxs("span",{className:"text-[10px] text-success",children:["Key saved for ",s.label]})]}),x.jsxs("div",{className:"flex gap-2",children:[x.jsxs("div",{className:"flex-1 flex flex-col gap-1",children:[x.jsx("span",{className:"text-[11px] text-text-secondary",children:"Model"}),x.jsx("input",{placeholder:"Model",value:i.model,onChange:u=>n({...i,model:u.target.value}),className:"px-2 py-1.5 border border-border rounded bg-surface-2 text-text-primary text-xs outline-none focus:border-primary"})]}),x.jsxs("div",{className:"flex-[2] flex flex-col gap-1",children:[x.jsx("span",{className:"text-[11px] text-text-secondary",children:"Base URL"}),x.jsx("input",{placeholder:"Base URL",value:i.baseUrl,onChange:u=>n({...i,baseUrl:u.target.value}),className:"px-2 py-1.5 border border-border rounded bg-surface-2 text-text-primary text-xs outline-none focus:border-primary"})]})]})]})}function Mg({value:i,onChange:n,onSend:a,onStop:s,isGenerating:u,disabled:o,placeholder:f,sendLabel:h}){return x.jsxs("div",{className:"flex gap-2 pt-2 border-t border-border-light",children:[x.jsx("textarea",{value:i,onChange:p=>n(p.target.value),onKeyDown:p=>{p.key==="Enter"&&!p.shiftKey&&(p.preventDefault(),!u&&!o&&a())},placeholder:f,rows:2,disabled:o,className:`
58
+ flex-1 px-2.5 py-2 border border-border rounded-md bg-surface-2 text-text-primary text-sm
59
+ outline-none resize-none font-[inherit] focus:border-primary focus:ring-1 focus:ring-primary/30
60
+ ${o?"opacity-50":""}
61
+ `}),u?x.jsx("button",{type:"button",onClick:s,className:"px-4 py-2 border border-error rounded-md bg-error/10 text-error text-sm font-semibold cursor-pointer self-end hover:bg-error/20 transition-colors",children:"Stop"}):x.jsx("button",{type:"button",onClick:a,disabled:o,className:`
62
+ px-4 py-2 border border-primary rounded-md bg-primary-light text-primary-text text-sm font-semibold cursor-pointer self-end
63
+ hover:bg-primary hover:text-white transition-colors
64
+ ${o?"opacity-50 cursor-not-allowed":""}
65
+ `,children:h})]})}const jg="mdma-builder-api-keys";function Dg(){try{return JSON.parse(localStorage.getItem(jg)||"{}")}catch{return{}}}function D1(i,n){const a=Dg();a[i]=n,localStorage.setItem(jg,JSON.stringify(a))}function If(i){for(const[n,a]of Object.entries(zs))if(i===a.baseUrl)return n;return null}function z1({messages:i,isGenerating:n,error:a,onGenerate:s,onStop:u,onReset:o,config:f,onConfigChange:h}){const[p,m]=ne.useState(""),[b,g]=ne.useState(!1),_=ne.useMemo(()=>If(f.baseUrl),[f.baseUrl]),v=_?zs[_]:null,O=E=>{const H=If(E.baseUrl);if(H){const I=Dg(),Q=E.apiKey!==f.apiKey?E.apiKey:I[H]||E.apiKey;E.apiKey!==f.apiKey&&D1(H,E.apiKey),h({...E,apiKey:Q})}else h(E)},w=!(v!=null&&v.requiresKey)||f.apiKey.length>0,j=()=>{const E=p.trim();m(""),s(E||void 0)};return x.jsxs("div",{className:"flex flex-col h-full",children:[x.jsxs("div",{className:"flex gap-2 items-center py-2",children:[x.jsx("button",{type:"button",onClick:()=>g(E=>!E),className:"border-none bg-transparent text-primary cursor-pointer text-xs p-0 hover:text-primary-hover",children:b?"Hide Settings":"Settings"}),x.jsxs("span",{className:"text-[11px] text-text-muted",children:[(v==null?void 0:v.label)||"Custom"," / ",f.model]}),!w&&x.jsx("span",{className:"text-[11px] text-warning",children:"API key required"}),x.jsx("div",{className:"flex-1"}),x.jsx("button",{type:"button",onClick:o,className:"border-none bg-transparent text-primary cursor-pointer text-xs p-0 hover:text-primary-hover",children:"Clear"})]}),b&&x.jsx(j1,{config:f,onConfigChange:O,activeProvider:_}),x.jsxs("div",{className:"flex-1 overflow-y-auto flex flex-col gap-2 py-1",children:[i.length===0&&!n&&x.jsx("div",{className:"text-text-muted text-sm text-center py-10 px-5",children:w?x.jsxs(x.Fragment,{children:["Configure components on the left, then click ",x.jsx("strong",{children:"Generate"}),"."]}):x.jsxs(x.Fragment,{children:["Set your ",x.jsx("strong",{children:(v==null?void 0:v.label)||"LLM"})," API key in Settings above to get started."]})}),i.filter(E=>E.role!=="system").map((E,H)=>x.jsx("div",{className:`
66
+ px-3 py-2 rounded-lg text-sm leading-relaxed max-w-[90%] whitespace-pre-wrap
67
+ ${E.role==="user"?"bg-primary-light text-primary-text self-end":"bg-surface-2 text-text-primary self-start"}
68
+ `,children:E.content},H)),n&&x.jsx("div",{className:"text-xs text-primary px-1",children:"Generating..."}),a&&x.jsx("div",{className:"text-xs text-error px-1",children:a})]}),x.jsx(Mg,{value:p,onChange:m,onSend:j,onStop:u,isGenerating:n,disabled:!w,placeholder:i.length===0?"Click Generate or type to refine...":"Refine the prompt...",sendLabel:i.length===0?"Generate":"Send"})]})}function R1({prompt:i,isGenerating:n}){const[a,s]=ne.useState(!1),u=async()=>{await navigator.clipboard.writeText(i),s(!0),setTimeout(()=>s(!1),2e3)},o=()=>{const f=new Blob([i],{type:"text/plain"}),h=URL.createObjectURL(f),p=document.createElement("a");p.href=h,p.download="mdma-custom-prompt.txt",p.click(),URL.revokeObjectURL(h)};return!i&&!n?x.jsx("div",{className:"flex flex-col h-full",children:x.jsxs("div",{className:"text-text-muted text-sm text-center py-10 px-5",children:[x.jsxs("p",{className:"mb-2",children:["Configure your components and click ",x.jsx("strong",{children:"Generate"}),"."]}),x.jsxs("p",{className:"text-[11px]",children:["The generated prompt will be used with:",x.jsx("br",{}),x.jsxs("code",{className:"text-primary-text",children:["buildSystemPrompt(","{ customPrompt }",")"]})]})]})}):x.jsxs("div",{className:"flex flex-col h-full",children:[x.jsxs("div",{className:"flex justify-between items-center mb-2",children:[x.jsx("h3",{className:"m-0 text-sm font-semibold text-text-primary",children:"Generated Prompt"}),x.jsxs("div",{className:"flex gap-1.5",children:[x.jsx("button",{type:"button",onClick:u,disabled:!i,className:"px-3 py-1 border border-border rounded bg-surface-1 text-text-primary text-[11px] cursor-pointer hover:bg-surface-2 transition-colors disabled:opacity-40",children:a?"Copied!":"Copy"}),x.jsx("button",{type:"button",onClick:o,disabled:!i,className:"px-3 py-1 border border-border rounded bg-surface-1 text-text-primary text-[11px] cursor-pointer hover:bg-surface-2 transition-colors disabled:opacity-40",children:"Save"})]})]}),x.jsxs("pre",{className:"flex-1 overflow-y-auto p-3 border border-border rounded-md bg-surface-0 text-text-primary text-xs leading-relaxed whitespace-pre-wrap break-words m-0",children:[i,n&&x.jsx("span",{className:"text-primary",children:"|"})]}),i&&x.jsxs("div",{className:"mt-2.5 p-2.5 border border-primary/30 rounded-md bg-primary-light/50",children:[x.jsx("p",{className:"m-0 text-[11px] text-text-secondary",children:"Usage in your app:"}),x.jsxs("code",{className:"text-xs text-primary-text",children:["import { buildSystemPrompt } from '@mobile-reality/mdma-prompt-pack';",x.jsx("br",{}),x.jsx("br",{}),"const systemPrompt = buildSystemPrompt({",x.jsx("br",{})," customPrompt: `<paste generated prompt here>`",x.jsx("br",{}),"});"]})]})]})}const By=`You are an expert MDMA document author. MDMA (Markdown Document with Micro-Applications) extends standard Markdown with interactive components defined in fenced code blocks using the \`mdma\` language tag. Think before you generate content, and ensure it adheres to the MDMA format and authoring rules.
69
+
70
+ CRITICAL: Your output IS the Markdown document — write headings, paragraphs, and \`\`\`mdma blocks directly. NEVER wrap your response in \`\`\`markdown code fences. Your response is already rendered as Markdown.
71
+
72
+ ## Document Format
73
+
74
+ An MDMA document is a standard Markdown file that contains one or more interactive component blocks. Each component block is a YAML snippet inside a fenced code block tagged with \`mdma\`. Here is an example of what your output should look like — note there are NO outer \`\`\`markdown fences:
75
+
76
+ # My Document Title
77
+
78
+ Some regular Markdown content here.
79
+
80
+ \`\`\`mdma
81
+ type: form
82
+ id: contact-form
83
+ fields:
84
+ - name: email
85
+ type: email
86
+ label: Email Address
87
+ required: true
88
+ \`\`\`
89
+
90
+ More Markdown content can follow.
91
+
92
+ ## Component Types
93
+
94
+ MDMA supports 9 component types. Every component shares these base fields:
95
+
96
+ - **id** (string, required) — Unique identifier within the document
97
+ - **type** (string, required) — Component type name
98
+ - **label** (string, optional) — Display label
99
+ - **sensitive** (boolean, default: false) — If true, values are redacted in logs
100
+ - **disabled** (boolean | binding, default: false)
101
+ - **visible** (boolean | binding, default: true)
102
+ - **meta** (object, optional) — Arbitrary metadata
103
+
104
+ ### 1. form
105
+
106
+ Collects user input via structured fields.
107
+
108
+ \`\`\`yaml
109
+ type: form
110
+ id: <unique-id>
111
+ fields:
112
+ - name: <field-name> # required, string
113
+ type: text | number | email | date | select | checkbox | textarea
114
+ label: <display-label> # required, string
115
+ required: true | false # default: false
116
+ sensitive: true | false # default: false — set true for PII
117
+ defaultValue: <any> # optional
118
+ options: # required when type is "select"
119
+ - label: <label>
120
+ value: <value>
121
+ validation: # optional
122
+ pattern: <regex>
123
+ min: <number>
124
+ max: <number>
125
+ message: <error-message>
126
+ bind: "{{variable.path}}" # optional binding
127
+ onSubmit: <action-id> # optional — action triggered on submit
128
+ \`\`\`
129
+
130
+ ### 2. button
131
+
132
+ Triggers an action when clicked.
133
+
134
+ \`\`\`yaml
135
+ type: button
136
+ id: <unique-id>
137
+ text: <button-label> # required, string
138
+ variant: primary | secondary | danger | ghost # default: primary
139
+ onAction: <action-id> # required — action triggered on click
140
+ confirm: # optional confirmation dialog
141
+ title: <dialog-title>
142
+ message: <dialog-message>
143
+ confirmText: <confirm-label> # default: "Confirm"
144
+ cancelText: <cancel-label> # default: "Cancel"
145
+ \`\`\`
146
+
147
+ ### 3. tasklist
148
+
149
+ A checklist of items that can be individually checked off.
150
+
151
+ \`\`\`yaml
152
+ type: tasklist
153
+ id: <unique-id>
154
+ items:
155
+ - id: <item-id> # required, unique within tasklist
156
+ text: <item-description> # required, string
157
+ checked: true | false # default: false
158
+ required: true | false # default: false
159
+ bind: "{{variable.path}}" # optional binding
160
+ onComplete: <action-id> # optional — triggered when all items checked
161
+ \`\`\`
162
+
163
+ ### 4. table
164
+
165
+ Displays tabular data with optional sorting, filtering, and pagination.
166
+
167
+ \`\`\`yaml
168
+ type: table
169
+ id: <unique-id>
170
+ columns:
171
+ - key: <field-key> # required, string
172
+ header: <column-header> # required, string
173
+ sortable: true | false # default: false
174
+ sensitive: true | false # default: false
175
+ width: <css-width> # optional, e.g. "200px"
176
+ data: # array of row objects OR a binding
177
+ - { key1: value1, key2: value2 }
178
+ # OR: data: "{{variable.path}}"
179
+ sortable: true | false # default: false (table-level)
180
+ filterable: true | false # default: false
181
+ pageSize: <number> # optional, positive integer
182
+ \`\`\`
183
+
184
+ ### 5. callout
185
+
186
+ Displays a highlighted message block.
187
+
188
+ \`\`\`yaml
189
+ type: callout
190
+ id: <unique-id>
191
+ variant: info | warning | error | success # default: info
192
+ title: <optional-title>
193
+ content: <message-text> # required, string
194
+ dismissible: true | false # default: false
195
+ \`\`\`
196
+
197
+ ### 6. approval-gate
198
+
199
+ Blocks workflow progression until required approvals are received.
200
+
201
+ \`\`\`yaml
202
+ type: approval-gate
203
+ id: <unique-id>
204
+ title: <gate-title> # required, string
205
+ description: <details> # optional
206
+ requiredApprovers: <number> # default: 1, positive integer
207
+ allowedRoles: # optional — restrict who can approve
208
+ - <role-name>
209
+ onApprove: <action-id> # optional
210
+ onDeny: <action-id> # optional
211
+ requireReason: true | false # default: false — require reason on denial
212
+ \`\`\`
213
+
214
+ ### 7. webhook
215
+
216
+ Makes an HTTP request when triggered by an action.
217
+
218
+ \`\`\`yaml
219
+ type: webhook
220
+ id: <unique-id>
221
+ url: <endpoint-url> # required, valid URL or binding
222
+ method: GET | POST | PUT | PATCH | DELETE # default: POST
223
+ headers: # optional, key-value pairs
224
+ Content-Type: application/json
225
+ body: # optional, object or binding
226
+ key: value
227
+ trigger: <action-id> # required — action ID that triggers this webhook
228
+ retries: <0-5> # default: 0
229
+ timeout: <milliseconds> # default: 30000
230
+ \`\`\`
231
+
232
+ ### 8. chart
233
+
234
+ Displays data as a visual chart. Data is provided as a compact CSV-like multiline string where the first row contains column headers and subsequent rows contain comma-separated values.
235
+
236
+ \`\`\`yaml
237
+ type: chart
238
+ id: <unique-id>
239
+ variant: line | bar | area | pie # default: line
240
+ label: <chart-title> # optional
241
+ data: | # required — CSV multiline string or binding
242
+ <col1>, <col2>, <col3>
243
+ <val1>, <val2>, <val3>
244
+ <val1>, <val2>, <val3>
245
+ xAxis: <column-name> # optional — column for x-axis (default: first column)
246
+ yAxis: <column-name> | [<col1>, <col2>] # optional — column(s) for y-axis (default: all numeric non-xAxis columns)
247
+ colors: # optional — custom color palette
248
+ - "<hex-color>"
249
+ showLegend: true | false # default: true
250
+ showGrid: true | false # default: true
251
+ height: <number> # default: 300 (pixels)
252
+ stacked: true | false # default: false (for bar/area)
253
+ \`\`\`
254
+
255
+ **Data format rules:**
256
+ - First line of \`data\` = column headers (comma-separated, trimmed)
257
+ - Subsequent lines = data rows (comma-separated, trimmed)
258
+ - Numeric values are auto-detected and coerced
259
+ - Use YAML \`|\` block scalar for multi-line data
260
+
261
+ **Example — line chart:**
262
+ \`\`\`yaml
263
+ type: chart
264
+ id: revenue-chart
265
+ variant: line
266
+ label: Revenue Trend
267
+ data: |
268
+ month, revenue, costs
269
+ Jan, 45000, 32000
270
+ Feb, 52000, 35000
271
+ Mar, 48000, 31000
272
+ Apr, 61000, 38000
273
+ xAxis: month
274
+ \`\`\`
275
+
276
+ **Example — pie chart:**
277
+ \`\`\`yaml
278
+ type: chart
279
+ id: market-share
280
+ variant: pie
281
+ label: Market Share
282
+ data: |
283
+ company, share
284
+ Ours, 35
285
+ Competitor A, 25
286
+ Competitor B, 20
287
+ Others, 20
288
+ xAxis: company
289
+ \`\`\`
290
+
291
+ ### 9. thinking
292
+
293
+ Displays a collapsible block that shows AI reasoning or thinking process. Useful for transparency about how the AI arrived at conclusions or recommendations.
294
+
295
+ \`\`\`yaml
296
+ type: thinking
297
+ id: <unique-id>
298
+ label: <header-text> # optional — default: "Thinking"
299
+ content: | # required — free-form reasoning text
300
+ <reasoning text>
301
+ status: thinking | done # default: done — "thinking" shows pulsing animation
302
+ collapsed: true | false # default: true — starts collapsed
303
+ \`\`\`
304
+
305
+ - \`content\`: free-form reasoning text — use YAML \`|\` block scalar for multi-line
306
+ - \`collapsed: true\` by default — thinking is supplementary information
307
+ - \`status: thinking\` shows a pulsing animation (use during streaming), \`done\` when complete
308
+
309
+ **Example — analysis reasoning:**
310
+ \`\`\`yaml
311
+ type: thinking
312
+ id: analysis-reasoning
313
+ label: Analyzing revenue data...
314
+ status: done
315
+ collapsed: true
316
+ content: |
317
+ First, I examined the quarterly revenue trends.
318
+ Q3 shows a 15% dip which correlates with seasonal patterns.
319
+ However, year-over-year growth remains strong at 23%.
320
+ Recommendation: maintain current strategy with Q3 adjustments.
321
+ \`\`\`
322
+
323
+ ## Binding Syntax
324
+
325
+ Use \`{{variable.path}}\` to create dynamic bindings between components. Bindings must:
326
+ - Start with \`{{\` and end with \`}}\`
327
+ - Contain a valid dot-notation path starting with a letter or underscore
328
+ - Reference existing component IDs or context variables
329
+
330
+ Examples:
331
+ - \`{{contact_form.email}}\` — bind to the email field of a form
332
+ - \`{{user.name}}\` — bind to a context variable
333
+
334
+ ## Authoring Rules
335
+
336
+ 1. **Unique IDs** — Every component \`id\` must be unique within the document. Use descriptive kebab-case names (e.g., \`employee-onboarding-form\`, \`submit-btn\`).
337
+ 2. **Sensitive data** — Set \`sensitive: true\` on any field or column that contains PII (personally identifiable information) such as email addresses, phone numbers, SSNs, addresses, or financial data.
338
+ 3. **Required fields** — Mark form fields as \`required: true\` when the workflow cannot proceed without them.
339
+ 4. **Action references** — All \`onSubmit\`, \`onAction\`, \`onComplete\`, \`onApprove\`, \`onDeny\`, and \`trigger\` values should reference valid action IDs within the document.
340
+ 5. **Binding validity** — Every \`{{binding}}\` must reference a valid source. Do not leave unresolved bindings.
341
+ 6. **Minimal components** — Only include components that are necessary for the workflow. Avoid empty or placeholder components.
342
+ 7. **YAML correctness** — Ensure all YAML in mdma blocks is valid and properly indented. Always wrap string values in double quotes if they contain a colon followed by a space (\`: \`), e.g. \`label: "Step 1: Enter your info"\`.
343
+ 8. **Always include thinking** — When generating MDMA components, ALWAYS include a \`thinking\` block BEFORE the main content to show your reasoning process. Use \`status: done\` and \`collapsed: true\`.
344
+ 9. **Never expose MDMA internals to the user** — Do NOT mention thinking blocks, sensitive flags, bindings, component IDs, YAML structure, or any other MDMA implementation details in your visible Markdown text. The user should see a natural, helpful response — not commentary about how the document is built. All reasoning belongs inside the \`thinking\` block, not in the prose. Never write things like "I included a thinking block" or "the email field is marked as sensitive".
345
+
346
+ ## Self-Check Checklist
347
+
348
+ Before finalizing an MDMA document, verify:
349
+
350
+ - [ ] Every component has a unique \`id\`
351
+ - [ ] All PII fields have \`sensitive: true\`
352
+ - [ ] All \`{{bindings}}\` reference valid sources
353
+ - [ ] Required form fields are marked \`required: true\`
354
+ - [ ] Action IDs referenced in event handlers exist in the document
355
+ - [ ] Select fields include an \`options\` array
356
+ - [ ] YAML syntax is valid in all mdma blocks
357
+ - [ ] Table \`data\` matches the declared \`columns\` keys
358
+ - [ ] Approval gates have at least one approver configured
359
+ - [ ] Webhook URLs are valid or use binding syntax
360
+ `;function L1(i={}){const{customPrompt:n}=i;return n?`${By}
361
+
362
+ ---
363
+
364
+ ${n}
365
+
366
+ ---
367
+
368
+ Reminder — when generating MDMA components you MUST:
369
+ - Include a \`thinking\` block BEFORE the main content (status: done, collapsed: true).
370
+ - Use unique kebab-case IDs for every component.
371
+ - Mark PII fields with \`sensitive: true\`.
372
+ - NEVER mention thinking blocks, sensitive flags, bindings, component IDs, or any MDMA implementation details in your visible text. All reasoning goes inside the thinking block. The user should see a natural response, not meta-commentary about how the document is structured.
373
+ - Respond in plain Markdown — do NOT wrap the entire response in code fences.`:By}function qy(i){if(i)throw i}var Sf,Uy;function B1(){if(Uy)return Sf;Uy=1;var i=Object.prototype.hasOwnProperty,n=Object.prototype.toString,a=Object.defineProperty,s=Object.getOwnPropertyDescriptor,u=function(m){return typeof Array.isArray=="function"?Array.isArray(m):n.call(m)==="[object Array]"},o=function(m){if(!m||n.call(m)!=="[object Object]")return!1;var b=i.call(m,"constructor"),g=m.constructor&&m.constructor.prototype&&i.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!b&&!g)return!1;var _;for(_ in m);return typeof _>"u"||i.call(m,_)},f=function(m,b){a&&b.name==="__proto__"?a(m,b.name,{enumerable:!0,configurable:!0,value:b.newValue,writable:!0}):m[b.name]=b.newValue},h=function(m,b){if(b==="__proto__")if(i.call(m,b)){if(s)return s(m,b).value}else return;return m[b]};return Sf=function p(){var m,b,g,_,v,O,w=arguments[0],j=1,E=arguments.length,H=!1;for(typeof w=="boolean"&&(H=w,w=arguments[1]||{},j=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});j<E;++j)if(m=arguments[j],m!=null)for(b in m)g=h(w,b),_=h(m,b),w!==_&&(H&&_&&(o(_)||(v=u(_)))?(v?(v=!1,O=g&&u(g)?g:[]):O=g&&o(g)?g:{},f(w,{name:b,newValue:p(H,O,_)})):typeof _<"u"&&f(w,{name:b,newValue:_}));return w},Sf}var q1=B1();const _f=r1(q1);function Hf(i){if(typeof i!="object"||i===null)return!1;const n=Object.getPrototypeOf(i);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in i)&&!(Symbol.iterator in i)}function U1(){const i=[],n={run:a,use:s};return n;function a(...u){let o=-1;const f=u.pop();if(typeof f!="function")throw new TypeError("Expected function as last argument, not "+f);h(null,...u);function h(p,...m){const b=i[++o];let g=-1;if(p){f(p);return}for(;++g<u.length;)(m[g]===null||m[g]===void 0)&&(m[g]=u[g]);u=m,b?I1(b,h)(...m):f(null,...m)}}function s(u){if(typeof u!="function")throw new TypeError("Expected `middelware` to be a function, not "+u);return i.push(u),n}}function I1(i,n){let a;return s;function s(...f){const h=i.length>f.length;let p;h&&f.push(u);try{p=i.apply(this,f)}catch(m){const b=m;if(h&&a)throw b;return u(b)}h||(p&&p.then&&typeof p.then=="function"?p.then(o,u):p instanceof Error?u(p):o(p))}function u(f,...h){a||(a=!0,n(f,...h))}function o(f){u(null,f)}}function Os(i){return!i||typeof i!="object"?"":"position"in i||"type"in i?Iy(i.position):"start"in i||"end"in i?Iy(i):"line"in i||"column"in i?Yf(i):""}function Yf(i){return Hy(i&&i.line)+":"+Hy(i&&i.column)}function Iy(i){return Yf(i&&i.start)+"-"+Yf(i&&i.end)}function Hy(i){return i&&typeof i=="number"?i:1}class Kt extends Error{constructor(n,a,s){super(),typeof a=="string"&&(s=a,a=void 0);let u="",o={},f=!1;if(a&&("line"in a&&"column"in a?o={place:a}:"start"in a&&"end"in a?o={place:a}:"type"in a?o={ancestors:[a],place:a.position}:o={...a}),typeof n=="string"?u=n:!o.cause&&n&&(f=!0,u=n.message,o.cause=n),!o.ruleId&&!o.source&&typeof s=="string"){const p=s.indexOf(":");p===-1?o.ruleId=s:(o.source=s.slice(0,p),o.ruleId=s.slice(p+1))}if(!o.place&&o.ancestors&&o.ancestors){const p=o.ancestors[o.ancestors.length-1];p&&(o.place=p.position)}const h=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=h?h.column:void 0,this.fatal=void 0,this.file="",this.message=u,this.line=h?h.line:void 0,this.name=Os(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=f&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Kt.prototype.file="";Kt.prototype.name="";Kt.prototype.reason="";Kt.prototype.message="";Kt.prototype.stack="";Kt.prototype.column=void 0;Kt.prototype.line=void 0;Kt.prototype.ancestors=void 0;Kt.prototype.cause=void 0;Kt.prototype.fatal=void 0;Kt.prototype.place=void 0;Kt.prototype.ruleId=void 0;Kt.prototype.source=void 0;const On={basename:H1,dirname:Y1,extname:V1,join:G1,sep:"/"};function H1(i,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');Is(i);let a=0,s=-1,u=i.length,o;if(n===void 0||n.length===0||n.length>i.length){for(;u--;)if(i.codePointAt(u)===47){if(o){a=u+1;break}}else s<0&&(o=!0,s=u+1);return s<0?"":i.slice(a,s)}if(n===i)return"";let f=-1,h=n.length-1;for(;u--;)if(i.codePointAt(u)===47){if(o){a=u+1;break}}else f<0&&(o=!0,f=u+1),h>-1&&(i.codePointAt(u)===n.codePointAt(h--)?h<0&&(s=u):(h=-1,s=f));return a===s?s=f:s<0&&(s=i.length),i.slice(a,s)}function Y1(i){if(Is(i),i.length===0)return".";let n=-1,a=i.length,s;for(;--a;)if(i.codePointAt(a)===47){if(s){n=a;break}}else s||(s=!0);return n<0?i.codePointAt(0)===47?"/":".":n===1&&i.codePointAt(0)===47?"//":i.slice(0,n)}function V1(i){Is(i);let n=i.length,a=-1,s=0,u=-1,o=0,f;for(;n--;){const h=i.codePointAt(n);if(h===47){if(f){s=n+1;break}continue}a<0&&(f=!0,a=n+1),h===46?u<0?u=n:o!==1&&(o=1):u>-1&&(o=-1)}return u<0||a<0||o===0||o===1&&u===a-1&&u===s+1?"":i.slice(u,a)}function G1(...i){let n=-1,a;for(;++n<i.length;)Is(i[n]),i[n]&&(a=a===void 0?i[n]:a+"/"+i[n]);return a===void 0?".":K1(a)}function K1(i){Is(i);const n=i.codePointAt(0)===47;let a=Z1(i,!n);return a.length===0&&!n&&(a="."),a.length>0&&i.codePointAt(i.length-1)===47&&(a+="/"),n?"/"+a:a}function Z1(i,n){let a="",s=0,u=-1,o=0,f=-1,h,p;for(;++f<=i.length;){if(f<i.length)h=i.codePointAt(f);else{if(h===47)break;h=47}if(h===47){if(!(u===f-1||o===1))if(u!==f-1&&o===2){if(a.length<2||s!==2||a.codePointAt(a.length-1)!==46||a.codePointAt(a.length-2)!==46){if(a.length>2){if(p=a.lastIndexOf("/"),p!==a.length-1){p<0?(a="",s=0):(a=a.slice(0,p),s=a.length-1-a.lastIndexOf("/")),u=f,o=0;continue}}else if(a.length>0){a="",s=0,u=f,o=0;continue}}n&&(a=a.length>0?a+"/..":"..",s=2)}else a.length>0?a+="/"+i.slice(u+1,f):a=i.slice(u+1,f),s=f-u-1;u=f,o=0}else h===46&&o>-1?o++:o=-1}return a}function Is(i){if(typeof i!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(i))}const Q1={cwd:$1};function $1(){return"/"}function Vf(i){return!!(i!==null&&typeof i=="object"&&"href"in i&&i.href&&"protocol"in i&&i.protocol&&i.auth===void 0)}function X1(i){if(typeof i=="string")i=new URL(i);else if(!Vf(i)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+i+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(i.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return J1(i)}function J1(i){if(i.hostname!==""){const s=new TypeError('File URL host must be "localhost" or empty on darwin');throw s.code="ERR_INVALID_FILE_URL_HOST",s}const n=i.pathname;let a=-1;for(;++a<n.length;)if(n.codePointAt(a)===37&&n.codePointAt(a+1)===50){const s=n.codePointAt(a+2);if(s===70||s===102){const u=new TypeError("File URL path must not include encoded / characters");throw u.code="ERR_INVALID_FILE_URL_PATH",u}}return decodeURIComponent(n)}const kf=["history","path","basename","stem","extname","dirname"];class F1{constructor(n){let a;n?Vf(n)?a={path:n}:typeof n=="string"||W1(n)?a={value:n}:a=n:a={},this.cwd="cwd"in a?"":Q1.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let s=-1;for(;++s<kf.length;){const o=kf[s];o in a&&a[o]!==void 0&&a[o]!==null&&(this[o]=o==="history"?[...a[o]]:a[o])}let u;for(u in a)kf.includes(u)||(this[u]=a[u])}get basename(){return typeof this.path=="string"?On.basename(this.path):void 0}set basename(n){Af(n,"basename"),wf(n,"basename"),this.path=On.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?On.dirname(this.path):void 0}set dirname(n){Yy(this.basename,"dirname"),this.path=On.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?On.extname(this.path):void 0}set extname(n){if(wf(n,"extname"),Yy(this.dirname,"extname"),n){if(n.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(n.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=On.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){Vf(n)&&(n=X1(n)),Af(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?On.basename(this.path,this.extname):void 0}set stem(n){Af(n,"stem"),wf(n,"stem"),this.path=On.join(this.dirname||"",n+(this.extname||""))}fail(n,a,s){const u=this.message(n,a,s);throw u.fatal=!0,u}info(n,a,s){const u=this.message(n,a,s);return u.fatal=void 0,u}message(n,a,s){const u=new Kt(n,a,s);return this.path&&(u.name=this.path+":"+u.name,u.file=this.path),u.fatal=!1,this.messages.push(u),u}toString(n){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(n||void 0).decode(this.value)}}function wf(i,n){if(i&&i.includes(On.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+On.sep+"`")}function Af(i,n){if(!i)throw new Error("`"+n+"` cannot be empty")}function Yy(i,n){if(!i)throw new Error("Setting `"+n+"` requires `path` to be set too")}function W1(i){return!!(i&&typeof i=="object"&&"byteLength"in i&&"byteOffset"in i)}const P1=(function(i){const s=this.constructor.prototype,u=s[i],o=function(){return u.apply(o,arguments)};return Object.setPrototypeOf(o,s),o}),ex={}.hasOwnProperty;class ud extends P1{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=U1()}copy(){const n=new ud;let a=-1;for(;++a<this.attachers.length;){const s=this.attachers[a];n.use(...s)}return n.data(_f(!0,{},this.namespace)),n}data(n,a){return typeof n=="string"?arguments.length===2?(Nf("data",this.frozen),this.namespace[n]=a,this):ex.call(this.namespace,n)&&this.namespace[n]||void 0:n?(Nf("data",this.frozen),this.namespace=n,this):this.namespace}freeze(){if(this.frozen)return this;const n=this;for(;++this.freezeIndex<this.attachers.length;){const[a,...s]=this.attachers[this.freezeIndex];if(s[0]===!1)continue;s[0]===!0&&(s[0]=void 0);const u=a.call(n,...s);typeof u=="function"&&this.transformers.use(u)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(n){this.freeze();const a=fu(n),s=this.parser||this.Parser;return Tf("parse",s),s(String(a),a)}process(n,a){const s=this;return this.freeze(),Tf("process",this.parser||this.Parser),Ef("process",this.compiler||this.Compiler),a?u(void 0,a):new Promise(u);function u(o,f){const h=fu(n),p=s.parse(h);s.run(p,h,function(b,g,_){if(b||!g||!_)return m(b);const v=g,O=s.stringify(v,_);ix(O)?_.value=O:_.result=O,m(b,_)});function m(b,g){b||!g?f(b):o?o(g):a(void 0,g)}}}processSync(n){let a=!1,s;return this.freeze(),Tf("processSync",this.parser||this.Parser),Ef("processSync",this.compiler||this.Compiler),this.process(n,u),Gy("processSync","process",a),s;function u(o,f){a=!0,qy(o),s=f}}run(n,a,s){Vy(n),this.freeze();const u=this.transformers;return!s&&typeof a=="function"&&(s=a,a=void 0),s?o(void 0,s):new Promise(o);function o(f,h){const p=fu(a);u.run(n,p,m);function m(b,g,_){const v=g||n;b?h(b):f?f(v):s(void 0,v,_)}}}runSync(n,a){let s=!1,u;return this.run(n,a,o),Gy("runSync","run",s),u;function o(f,h){qy(f),u=h,s=!0}}stringify(n,a){this.freeze();const s=fu(a),u=this.compiler||this.Compiler;return Ef("stringify",u),Vy(n),u(n,s)}use(n,...a){const s=this.attachers,u=this.namespace;if(Nf("use",this.frozen),n!=null)if(typeof n=="function")p(n,a);else if(typeof n=="object")Array.isArray(n)?h(n):f(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function o(m){if(typeof m=="function")p(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[b,...g]=m;p(b,g)}else f(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function f(m){if(!("plugins"in m)&&!("settings"in m))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");h(m.plugins),m.settings&&(u.settings=_f(!0,u.settings,m.settings))}function h(m){let b=-1;if(m!=null)if(Array.isArray(m))for(;++b<m.length;){const g=m[b];o(g)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function p(m,b){let g=-1,_=-1;for(;++g<s.length;)if(s[g][0]===m){_=g;break}if(_===-1)s.push([m,...b]);else if(b.length>0){let[v,...O]=b;const w=s[_][1];Hf(w)&&Hf(v)&&(v=_f(!0,w,v)),s[_]=[m,v,...O]}}}}const tx=new ud().freeze();function Tf(i,n){if(typeof n!="function")throw new TypeError("Cannot `"+i+"` without `parser`")}function Ef(i,n){if(typeof n!="function")throw new TypeError("Cannot `"+i+"` without `compiler`")}function Nf(i,n){if(n)throw new Error("Cannot call `"+i+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Vy(i){if(!Hf(i)||typeof i.type!="string")throw new TypeError("Expected node, got `"+i+"`")}function Gy(i,n,a){if(!a)throw new Error("`"+i+"` finished async. Use `"+n+"` instead")}function fu(i){return nx(i)?i:new F1(i)}function nx(i){return!!(i&&typeof i=="object"&&"message"in i&&"messages"in i)}function ix(i){return typeof i=="string"||ax(i)}function ax(i){return!!(i&&typeof i=="object"&&"byteLength"in i&&"byteOffset"in i)}const lx={};function sx(i,n){const a=lx,s=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,u=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return zg(i,s,u)}function zg(i,n,a){if(rx(i)){if("value"in i)return i.type==="html"&&!a?"":i.value;if(n&&"alt"in i&&i.alt)return i.alt;if("children"in i)return Ky(i.children,n,a)}return Array.isArray(i)?Ky(i,n,a):""}function Ky(i,n,a){const s=[];let u=-1;for(;++u<i.length;)s[u]=zg(i[u],n,a);return s.join("")}function rx(i){return!!(i&&typeof i=="object")}const Zy=document.createElement("i");function od(i){const n="&"+i+";";Zy.innerHTML=n;const a=Zy.textContent;return a.charCodeAt(a.length-1)===59&&i!=="semi"||a===n?!1:a}function Dn(i,n,a,s){const u=i.length;let o=0,f;if(n<0?n=-n>u?0:u+n:n=n>u?u:n,a=a>0?a:0,s.length<1e4)f=Array.from(s),f.unshift(n,a),i.splice(...f);else for(a&&i.splice(n,a);o<s.length;)f=s.slice(o,o+1e4),f.unshift(n,0),i.splice(...f),o+=1e4,n+=1e4}function dn(i,n){return i.length>0?(Dn(i,i.length,0,n),i):n}const Qy={}.hasOwnProperty;function ux(i){const n={};let a=-1;for(;++a<i.length;)ox(n,i[a]);return n}function ox(i,n){let a;for(a in n){const u=(Qy.call(i,a)?i[a]:void 0)||(i[a]={}),o=n[a];let f;if(o)for(f in o){Qy.call(u,f)||(u[f]=[]);const h=o[f];cx(u[f],Array.isArray(h)?h:h?[h]:[])}}}function cx(i,n){let a=-1;const s=[];for(;++a<n.length;)(n[a].add==="after"?i:s).push(n[a]);Dn(i,0,0,s)}function Rg(i,n){const a=Number.parseInt(i,n);return a<9||a===11||a>13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"�":String.fromCodePoint(a)}function gl(i){return i.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Mn=Gi(/[A-Za-z]/),kn=Gi(/[\dA-Za-z]/),fx=Gi(/[#-'*+\--9=?A-Z^-~]/);function Gf(i){return i!==null&&(i<32||i===127)}const Kf=Gi(/\d/),dx=Gi(/[\dA-Fa-f]/),hx=Gi(/[!-/:-@[-`{-~]/);function xe(i){return i!==null&&i<-2}function Gt(i){return i!==null&&(i<0||i===32)}function Ye(i){return i===-2||i===-1||i===32}const mx=Gi(new RegExp("\\p{P}|\\p{S}","u")),px=Gi(/\s/);function Gi(i){return n;function n(a){return a!==null&&a>-1&&i.test(String.fromCharCode(a))}}function We(i,n,a,s){const u=s?s-1:Number.POSITIVE_INFINITY;let o=0;return f;function f(p){return Ye(p)?(i.enter(a),h(p)):n(p)}function h(p){return Ye(p)&&o++<u?(i.consume(p),h):(i.exit(a),n(p))}}const yx={tokenize:gx};function gx(i){const n=i.attempt(this.parser.constructs.contentInitial,s,u);let a;return n;function s(h){if(h===null){i.consume(h);return}return i.enter("lineEnding"),i.consume(h),i.exit("lineEnding"),We(i,n,"linePrefix")}function u(h){return i.enter("paragraph"),o(h)}function o(h){const p=i.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=p),a=p,f(h)}function f(h){if(h===null){i.exit("chunkText"),i.exit("paragraph"),i.consume(h);return}return xe(h)?(i.consume(h),i.exit("chunkText"),o):(i.consume(h),f)}}const bx={tokenize:vx},$y={tokenize:xx};function vx(i){const n=this,a=[];let s=0,u,o,f;return h;function h(I){if(s<a.length){const Q=a[s];return n.containerState=Q[1],i.attempt(Q[0].continuation,p,m)(I)}return m(I)}function p(I){if(s++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,u&&H();const Q=n.events.length;let F=Q,L;for(;F--;)if(n.events[F][0]==="exit"&&n.events[F][1].type==="chunkFlow"){L=n.events[F][1].end;break}E(s);let Z=Q;for(;Z<n.events.length;)n.events[Z][1].end={...L},Z++;return Dn(n.events,F+1,0,n.events.slice(Q)),n.events.length=Z,m(I)}return h(I)}function m(I){if(s===a.length){if(!u)return _(I);if(u.currentConstruct&&u.currentConstruct.concrete)return O(I);n.interrupt=!!(u.currentConstruct&&!u._gfmTableDynamicInterruptHack)}return n.containerState={},i.check($y,b,g)(I)}function b(I){return u&&H(),E(s),_(I)}function g(I){return n.parser.lazy[n.now().line]=s!==a.length,f=n.now().offset,O(I)}function _(I){return n.containerState={},i.attempt($y,v,O)(I)}function v(I){return s++,a.push([n.currentConstruct,n.containerState]),_(I)}function O(I){if(I===null){u&&H(),E(0),i.consume(I);return}return u=u||n.parser.flow(n.now()),i.enter("chunkFlow",{_tokenizer:u,contentType:"flow",previous:o}),w(I)}function w(I){if(I===null){j(i.exit("chunkFlow"),!0),E(0),i.consume(I);return}return xe(I)?(i.consume(I),j(i.exit("chunkFlow")),s=0,n.interrupt=void 0,h):(i.consume(I),w)}function j(I,Q){const F=n.sliceStream(I);if(Q&&F.push(null),I.previous=o,o&&(o.next=I),o=I,u.defineSkip(I.start),u.write(F),n.parser.lazy[I.start.line]){let L=u.events.length;for(;L--;)if(u.events[L][1].start.offset<f&&(!u.events[L][1].end||u.events[L][1].end.offset>f))return;const Z=n.events.length;let J=Z,le,ye;for(;J--;)if(n.events[J][0]==="exit"&&n.events[J][1].type==="chunkFlow"){if(le){ye=n.events[J][1].end;break}le=!0}for(E(s),L=Z;L<n.events.length;)n.events[L][1].end={...ye},L++;Dn(n.events,J+1,0,n.events.slice(Z)),n.events.length=L}}function E(I){let Q=a.length;for(;Q-- >I;){const F=a[Q];n.containerState=F[1],F[0].exit.call(n,i)}a.length=I}function H(){u.write([null]),o=void 0,u=void 0,n.containerState._closeFlow=void 0}}function xx(i,n,a){return We(i,i.attempt(this.parser.constructs.document,n,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Xy(i){if(i===null||Gt(i)||px(i))return 1;if(mx(i))return 2}function cd(i,n,a){const s=[];let u=-1;for(;++u<i.length;){const o=i[u].resolveAll;o&&!s.includes(o)&&(n=o(n,a),s.push(o))}return n}const Zf={name:"attention",resolveAll:Sx,tokenize:_x};function Sx(i,n){let a=-1,s,u,o,f,h,p,m,b;for(;++a<i.length;)if(i[a][0]==="enter"&&i[a][1].type==="attentionSequence"&&i[a][1]._close){for(s=a;s--;)if(i[s][0]==="exit"&&i[s][1].type==="attentionSequence"&&i[s][1]._open&&n.sliceSerialize(i[s][1]).charCodeAt(0)===n.sliceSerialize(i[a][1]).charCodeAt(0)){if((i[s][1]._close||i[a][1]._open)&&(i[a][1].end.offset-i[a][1].start.offset)%3&&!((i[s][1].end.offset-i[s][1].start.offset+i[a][1].end.offset-i[a][1].start.offset)%3))continue;p=i[s][1].end.offset-i[s][1].start.offset>1&&i[a][1].end.offset-i[a][1].start.offset>1?2:1;const g={...i[s][1].end},_={...i[a][1].start};Jy(g,-p),Jy(_,p),f={type:p>1?"strongSequence":"emphasisSequence",start:g,end:{...i[s][1].end}},h={type:p>1?"strongSequence":"emphasisSequence",start:{...i[a][1].start},end:_},o={type:p>1?"strongText":"emphasisText",start:{...i[s][1].end},end:{...i[a][1].start}},u={type:p>1?"strong":"emphasis",start:{...f.start},end:{...h.end}},i[s][1].end={...f.start},i[a][1].start={...h.end},m=[],i[s][1].end.offset-i[s][1].start.offset&&(m=dn(m,[["enter",i[s][1],n],["exit",i[s][1],n]])),m=dn(m,[["enter",u,n],["enter",f,n],["exit",f,n],["enter",o,n]]),m=dn(m,cd(n.parser.constructs.insideSpan.null,i.slice(s+1,a),n)),m=dn(m,[["exit",o,n],["enter",h,n],["exit",h,n],["exit",u,n]]),i[a][1].end.offset-i[a][1].start.offset?(b=2,m=dn(m,[["enter",i[a][1],n],["exit",i[a][1],n]])):b=0,Dn(i,s-1,a-s+3,m),a=s+m.length-b-2;break}}for(a=-1;++a<i.length;)i[a][1].type==="attentionSequence"&&(i[a][1].type="data");return i}function _x(i,n){const a=this.parser.constructs.attentionMarkers.null,s=this.previous,u=Xy(s);let o;return f;function f(p){return o=p,i.enter("attentionSequence"),h(p)}function h(p){if(p===o)return i.consume(p),h;const m=i.exit("attentionSequence"),b=Xy(p),g=!b||b===2&&u||a.includes(p),_=!u||u===2&&b||a.includes(s);return m._open=!!(o===42?g:g&&(u||!_)),m._close=!!(o===42?_:_&&(b||!g)),n(p)}}function Jy(i,n){i.column+=n,i.offset+=n,i._bufferIndex+=n}const kx={name:"autolink",tokenize:wx};function wx(i,n,a){let s=0;return u;function u(v){return i.enter("autolink"),i.enter("autolinkMarker"),i.consume(v),i.exit("autolinkMarker"),i.enter("autolinkProtocol"),o}function o(v){return Mn(v)?(i.consume(v),f):v===64?a(v):m(v)}function f(v){return v===43||v===45||v===46||kn(v)?(s=1,h(v)):m(v)}function h(v){return v===58?(i.consume(v),s=0,p):(v===43||v===45||v===46||kn(v))&&s++<32?(i.consume(v),h):(s=0,m(v))}function p(v){return v===62?(i.exit("autolinkProtocol"),i.enter("autolinkMarker"),i.consume(v),i.exit("autolinkMarker"),i.exit("autolink"),n):v===null||v===32||v===60||Gf(v)?a(v):(i.consume(v),p)}function m(v){return v===64?(i.consume(v),b):fx(v)?(i.consume(v),m):a(v)}function b(v){return kn(v)?g(v):a(v)}function g(v){return v===46?(i.consume(v),s=0,b):v===62?(i.exit("autolinkProtocol").type="autolinkEmail",i.enter("autolinkMarker"),i.consume(v),i.exit("autolinkMarker"),i.exit("autolink"),n):_(v)}function _(v){if((v===45||kn(v))&&s++<63){const O=v===45?_:g;return i.consume(v),O}return a(v)}}const Iu={partial:!0,tokenize:Ax};function Ax(i,n,a){return s;function s(o){return Ye(o)?We(i,u,"linePrefix")(o):u(o)}function u(o){return o===null||xe(o)?n(o):a(o)}}const Lg={continuation:{tokenize:Ex},exit:Nx,name:"blockQuote",tokenize:Tx};function Tx(i,n,a){const s=this;return u;function u(f){if(f===62){const h=s.containerState;return h.open||(i.enter("blockQuote",{_container:!0}),h.open=!0),i.enter("blockQuotePrefix"),i.enter("blockQuoteMarker"),i.consume(f),i.exit("blockQuoteMarker"),o}return a(f)}function o(f){return Ye(f)?(i.enter("blockQuotePrefixWhitespace"),i.consume(f),i.exit("blockQuotePrefixWhitespace"),i.exit("blockQuotePrefix"),n):(i.exit("blockQuotePrefix"),n(f))}}function Ex(i,n,a){const s=this;return u;function u(f){return Ye(f)?We(i,o,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f):o(f)}function o(f){return i.attempt(Lg,n,a)(f)}}function Nx(i){i.exit("blockQuote")}const Bg={name:"characterEscape",tokenize:Cx};function Cx(i,n,a){return s;function s(o){return i.enter("characterEscape"),i.enter("escapeMarker"),i.consume(o),i.exit("escapeMarker"),u}function u(o){return hx(o)?(i.enter("characterEscapeValue"),i.consume(o),i.exit("characterEscapeValue"),i.exit("characterEscape"),n):a(o)}}const qg={name:"characterReference",tokenize:Ox};function Ox(i,n,a){const s=this;let u=0,o,f;return h;function h(g){return i.enter("characterReference"),i.enter("characterReferenceMarker"),i.consume(g),i.exit("characterReferenceMarker"),p}function p(g){return g===35?(i.enter("characterReferenceMarkerNumeric"),i.consume(g),i.exit("characterReferenceMarkerNumeric"),m):(i.enter("characterReferenceValue"),o=31,f=kn,b(g))}function m(g){return g===88||g===120?(i.enter("characterReferenceMarkerHexadecimal"),i.consume(g),i.exit("characterReferenceMarkerHexadecimal"),i.enter("characterReferenceValue"),o=6,f=dx,b):(i.enter("characterReferenceValue"),o=7,f=Kf,b(g))}function b(g){if(g===59&&u){const _=i.exit("characterReferenceValue");return f===kn&&!od(s.sliceSerialize(_))?a(g):(i.enter("characterReferenceMarker"),i.consume(g),i.exit("characterReferenceMarker"),i.exit("characterReference"),n)}return f(g)&&u++<o?(i.consume(g),b):a(g)}}const Fy={partial:!0,tokenize:jx},Wy={concrete:!0,name:"codeFenced",tokenize:Mx};function Mx(i,n,a){const s=this,u={partial:!0,tokenize:F};let o=0,f=0,h;return p;function p(L){return m(L)}function m(L){const Z=s.events[s.events.length-1];return o=Z&&Z[1].type==="linePrefix"?Z[2].sliceSerialize(Z[1],!0).length:0,h=L,i.enter("codeFenced"),i.enter("codeFencedFence"),i.enter("codeFencedFenceSequence"),b(L)}function b(L){return L===h?(f++,i.consume(L),b):f<3?a(L):(i.exit("codeFencedFenceSequence"),Ye(L)?We(i,g,"whitespace")(L):g(L))}function g(L){return L===null||xe(L)?(i.exit("codeFencedFence"),s.interrupt?n(L):i.check(Fy,w,Q)(L)):(i.enter("codeFencedFenceInfo"),i.enter("chunkString",{contentType:"string"}),_(L))}function _(L){return L===null||xe(L)?(i.exit("chunkString"),i.exit("codeFencedFenceInfo"),g(L)):Ye(L)?(i.exit("chunkString"),i.exit("codeFencedFenceInfo"),We(i,v,"whitespace")(L)):L===96&&L===h?a(L):(i.consume(L),_)}function v(L){return L===null||xe(L)?g(L):(i.enter("codeFencedFenceMeta"),i.enter("chunkString",{contentType:"string"}),O(L))}function O(L){return L===null||xe(L)?(i.exit("chunkString"),i.exit("codeFencedFenceMeta"),g(L)):L===96&&L===h?a(L):(i.consume(L),O)}function w(L){return i.attempt(u,Q,j)(L)}function j(L){return i.enter("lineEnding"),i.consume(L),i.exit("lineEnding"),E}function E(L){return o>0&&Ye(L)?We(i,H,"linePrefix",o+1)(L):H(L)}function H(L){return L===null||xe(L)?i.check(Fy,w,Q)(L):(i.enter("codeFlowValue"),I(L))}function I(L){return L===null||xe(L)?(i.exit("codeFlowValue"),H(L)):(i.consume(L),I)}function Q(L){return i.exit("codeFenced"),n(L)}function F(L,Z,J){let le=0;return ye;function ye(ve){return L.enter("lineEnding"),L.consume(ve),L.exit("lineEnding"),ie}function ie(ve){return L.enter("codeFencedFence"),Ye(ve)?We(L,P,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ve):P(ve)}function P(ve){return ve===h?(L.enter("codeFencedFenceSequence"),ke(ve)):J(ve)}function ke(ve){return ve===h?(le++,L.consume(ve),ke):le>=f?(L.exit("codeFencedFenceSequence"),Ye(ve)?We(L,Ce,"whitespace")(ve):Ce(ve)):J(ve)}function Ce(ve){return ve===null||xe(ve)?(L.exit("codeFencedFence"),Z(ve)):J(ve)}}}function jx(i,n,a){const s=this;return u;function u(f){return f===null?a(f):(i.enter("lineEnding"),i.consume(f),i.exit("lineEnding"),o)}function o(f){return s.parser.lazy[s.now().line]?a(f):n(f)}}const Cf={name:"codeIndented",tokenize:zx},Dx={partial:!0,tokenize:Rx};function zx(i,n,a){const s=this;return u;function u(m){return i.enter("codeIndented"),We(i,o,"linePrefix",5)(m)}function o(m){const b=s.events[s.events.length-1];return b&&b[1].type==="linePrefix"&&b[2].sliceSerialize(b[1],!0).length>=4?f(m):a(m)}function f(m){return m===null?p(m):xe(m)?i.attempt(Dx,f,p)(m):(i.enter("codeFlowValue"),h(m))}function h(m){return m===null||xe(m)?(i.exit("codeFlowValue"),f(m)):(i.consume(m),h)}function p(m){return i.exit("codeIndented"),n(m)}}function Rx(i,n,a){const s=this;return u;function u(f){return s.parser.lazy[s.now().line]?a(f):xe(f)?(i.enter("lineEnding"),i.consume(f),i.exit("lineEnding"),u):We(i,o,"linePrefix",5)(f)}function o(f){const h=s.events[s.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?n(f):xe(f)?u(f):a(f)}}const Lx={name:"codeText",previous:qx,resolve:Bx,tokenize:Ux};function Bx(i){let n=i.length-4,a=3,s,u;if((i[a][1].type==="lineEnding"||i[a][1].type==="space")&&(i[n][1].type==="lineEnding"||i[n][1].type==="space")){for(s=a;++s<n;)if(i[s][1].type==="codeTextData"){i[a][1].type="codeTextPadding",i[n][1].type="codeTextPadding",a+=2,n-=2;break}}for(s=a-1,n++;++s<=n;)u===void 0?s!==n&&i[s][1].type!=="lineEnding"&&(u=s):(s===n||i[s][1].type==="lineEnding")&&(i[u][1].type="codeTextData",s!==u+2&&(i[u][1].end=i[s-1][1].end,i.splice(u+2,s-u-2),n-=s-u-2,s=u+2),u=void 0);return i}function qx(i){return i!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Ux(i,n,a){let s=0,u,o;return f;function f(g){return i.enter("codeText"),i.enter("codeTextSequence"),h(g)}function h(g){return g===96?(i.consume(g),s++,h):(i.exit("codeTextSequence"),p(g))}function p(g){return g===null?a(g):g===32?(i.enter("space"),i.consume(g),i.exit("space"),p):g===96?(o=i.enter("codeTextSequence"),u=0,b(g)):xe(g)?(i.enter("lineEnding"),i.consume(g),i.exit("lineEnding"),p):(i.enter("codeTextData"),m(g))}function m(g){return g===null||g===32||g===96||xe(g)?(i.exit("codeTextData"),p(g)):(i.consume(g),m)}function b(g){return g===96?(i.consume(g),u++,b):u===s?(i.exit("codeTextSequence"),i.exit("codeText"),n(g)):(o.type="codeTextData",m(g))}}class Ix{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,a){const s=a??Number.POSITIVE_INFINITY;return s<this.left.length?this.left.slice(n,s):n>this.left.length?this.right.slice(this.right.length-s+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-s+this.left.length).reverse())}splice(n,a,s){const u=a||0;this.setCursor(Math.trunc(n));const o=this.right.splice(this.right.length-u,Number.POSITIVE_INFINITY);return s&&_s(this.left,s),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),_s(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),_s(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const a=this.left.splice(n,Number.POSITIVE_INFINITY);_s(this.right,a.reverse())}else{const a=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);_s(this.left,a.reverse())}}}function _s(i,n){let a=0;if(n.length<1e4)i.push(...n);else for(;a<n.length;)i.push(...n.slice(a,a+1e4)),a+=1e4}function Ug(i){const n={};let a=-1,s,u,o,f,h,p,m;const b=new Ix(i);for(;++a<b.length;){for(;a in n;)a=n[a];if(s=b.get(a),a&&s[1].type==="chunkFlow"&&b.get(a-1)[1].type==="listItemPrefix"&&(p=s[1]._tokenizer.events,o=0,o<p.length&&p[o][1].type==="lineEndingBlank"&&(o+=2),o<p.length&&p[o][1].type==="content"))for(;++o<p.length&&p[o][1].type!=="content";)p[o][1].type==="chunkText"&&(p[o][1]._isInFirstContentOfListItem=!0,o++);if(s[0]==="enter")s[1].contentType&&(Object.assign(n,Hx(b,a)),a=n[a],m=!0);else if(s[1]._container){for(o=a,u=void 0;o--;)if(f=b.get(o),f[1].type==="lineEnding"||f[1].type==="lineEndingBlank")f[0]==="enter"&&(u&&(b.get(u)[1].type="lineEndingBlank"),f[1].type="lineEnding",u=o);else if(!(f[1].type==="linePrefix"||f[1].type==="listItemIndent"))break;u&&(s[1].end={...b.get(u)[1].start},h=b.slice(u,a),h.unshift(s),b.splice(u,a-u+1,h))}}return Dn(i,0,Number.POSITIVE_INFINITY,b.slice(0)),!m}function Hx(i,n){const a=i.get(n)[1],s=i.get(n)[2];let u=n-1;const o=[];let f=a._tokenizer;f||(f=s.parser[a.contentType](a.start),a._contentTypeTextTrailing&&(f._contentTypeTextTrailing=!0));const h=f.events,p=[],m={};let b,g,_=-1,v=a,O=0,w=0;const j=[w];for(;v;){for(;i.get(++u)[1]!==v;);o.push(u),v._tokenizer||(b=s.sliceStream(v),v.next||b.push(null),g&&f.defineSkip(v.start),v._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=!0),f.write(b),v._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=void 0)),g=v,v=v.next}for(v=a;++_<h.length;)h[_][0]==="exit"&&h[_-1][0]==="enter"&&h[_][1].type===h[_-1][1].type&&h[_][1].start.line!==h[_][1].end.line&&(w=_+1,j.push(w),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(f.events=[],v?(v._tokenizer=void 0,v.previous=void 0):j.pop(),_=j.length;_--;){const E=h.slice(j[_],j[_+1]),H=o.pop();p.push([H,H+E.length-1]),i.splice(H,2,E)}for(p.reverse(),_=-1;++_<p.length;)m[O+p[_][0]]=O+p[_][1],O+=p[_][1]-p[_][0]-1;return m}const Yx={resolve:Gx,tokenize:Kx},Vx={partial:!0,tokenize:Zx};function Gx(i){return Ug(i),i}function Kx(i,n){let a;return s;function s(h){return i.enter("content"),a=i.enter("chunkContent",{contentType:"content"}),u(h)}function u(h){return h===null?o(h):xe(h)?i.check(Vx,f,o)(h):(i.consume(h),u)}function o(h){return i.exit("chunkContent"),i.exit("content"),n(h)}function f(h){return i.consume(h),i.exit("chunkContent"),a.next=i.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,u}}function Zx(i,n,a){const s=this;return u;function u(f){return i.exit("chunkContent"),i.enter("lineEnding"),i.consume(f),i.exit("lineEnding"),We(i,o,"linePrefix")}function o(f){if(f===null||xe(f))return a(f);const h=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?n(f):i.interrupt(s.parser.constructs.flow,a,n)(f)}}function Ig(i,n,a,s,u,o,f,h,p){const m=p||Number.POSITIVE_INFINITY;let b=0;return g;function g(E){return E===60?(i.enter(s),i.enter(u),i.enter(o),i.consume(E),i.exit(o),_):E===null||E===32||E===41||Gf(E)?a(E):(i.enter(s),i.enter(f),i.enter(h),i.enter("chunkString",{contentType:"string"}),w(E))}function _(E){return E===62?(i.enter(o),i.consume(E),i.exit(o),i.exit(u),i.exit(s),n):(i.enter(h),i.enter("chunkString",{contentType:"string"}),v(E))}function v(E){return E===62?(i.exit("chunkString"),i.exit(h),_(E)):E===null||E===60||xe(E)?a(E):(i.consume(E),E===92?O:v)}function O(E){return E===60||E===62||E===92?(i.consume(E),v):v(E)}function w(E){return!b&&(E===null||E===41||Gt(E))?(i.exit("chunkString"),i.exit(h),i.exit(f),i.exit(s),n(E)):b<m&&E===40?(i.consume(E),b++,w):E===41?(i.consume(E),b--,w):E===null||E===32||E===40||Gf(E)?a(E):(i.consume(E),E===92?j:w)}function j(E){return E===40||E===41||E===92?(i.consume(E),w):w(E)}}function Hg(i,n,a,s,u,o){const f=this;let h=0,p;return m;function m(v){return i.enter(s),i.enter(u),i.consume(v),i.exit(u),i.enter(o),b}function b(v){return h>999||v===null||v===91||v===93&&!p||v===94&&!h&&"_hiddenFootnoteSupport"in f.parser.constructs?a(v):v===93?(i.exit(o),i.enter(u),i.consume(v),i.exit(u),i.exit(s),n):xe(v)?(i.enter("lineEnding"),i.consume(v),i.exit("lineEnding"),b):(i.enter("chunkString",{contentType:"string"}),g(v))}function g(v){return v===null||v===91||v===93||xe(v)||h++>999?(i.exit("chunkString"),b(v)):(i.consume(v),p||(p=!Ye(v)),v===92?_:g)}function _(v){return v===91||v===92||v===93?(i.consume(v),h++,g):g(v)}}function Yg(i,n,a,s,u,o){let f;return h;function h(_){return _===34||_===39||_===40?(i.enter(s),i.enter(u),i.consume(_),i.exit(u),f=_===40?41:_,p):a(_)}function p(_){return _===f?(i.enter(u),i.consume(_),i.exit(u),i.exit(s),n):(i.enter(o),m(_))}function m(_){return _===f?(i.exit(o),p(f)):_===null?a(_):xe(_)?(i.enter("lineEnding"),i.consume(_),i.exit("lineEnding"),We(i,m,"linePrefix")):(i.enter("chunkString",{contentType:"string"}),b(_))}function b(_){return _===f||_===null||xe(_)?(i.exit("chunkString"),m(_)):(i.consume(_),_===92?g:b)}function g(_){return _===f||_===92?(i.consume(_),b):b(_)}}function Ms(i,n){let a;return s;function s(u){return xe(u)?(i.enter("lineEnding"),i.consume(u),i.exit("lineEnding"),a=!0,s):Ye(u)?We(i,s,a?"linePrefix":"lineSuffix")(u):n(u)}}const Qx={name:"definition",tokenize:Xx},$x={partial:!0,tokenize:Jx};function Xx(i,n,a){const s=this;let u;return o;function o(v){return i.enter("definition"),f(v)}function f(v){return Hg.call(s,i,h,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function h(v){return u=gl(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),v===58?(i.enter("definitionMarker"),i.consume(v),i.exit("definitionMarker"),p):a(v)}function p(v){return Gt(v)?Ms(i,m)(v):m(v)}function m(v){return Ig(i,b,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function b(v){return i.attempt($x,g,g)(v)}function g(v){return Ye(v)?We(i,_,"whitespace")(v):_(v)}function _(v){return v===null||xe(v)?(i.exit("definition"),s.parser.defined.push(u),n(v)):a(v)}}function Jx(i,n,a){return s;function s(h){return Gt(h)?Ms(i,u)(h):a(h)}function u(h){return Yg(i,o,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(h)}function o(h){return Ye(h)?We(i,f,"whitespace")(h):f(h)}function f(h){return h===null||xe(h)?n(h):a(h)}}const Fx={name:"hardBreakEscape",tokenize:Wx};function Wx(i,n,a){return s;function s(o){return i.enter("hardBreakEscape"),i.consume(o),u}function u(o){return xe(o)?(i.exit("hardBreakEscape"),n(o)):a(o)}}const Px={name:"headingAtx",resolve:eS,tokenize:tS};function eS(i,n){let a=i.length-2,s=3,u,o;return i[s][1].type==="whitespace"&&(s+=2),a-2>s&&i[a][1].type==="whitespace"&&(a-=2),i[a][1].type==="atxHeadingSequence"&&(s===a-1||a-4>s&&i[a-2][1].type==="whitespace")&&(a-=s+1===a?2:4),a>s&&(u={type:"atxHeadingText",start:i[s][1].start,end:i[a][1].end},o={type:"chunkText",start:i[s][1].start,end:i[a][1].end,contentType:"text"},Dn(i,s,a-s+1,[["enter",u,n],["enter",o,n],["exit",o,n],["exit",u,n]])),i}function tS(i,n,a){let s=0;return u;function u(b){return i.enter("atxHeading"),o(b)}function o(b){return i.enter("atxHeadingSequence"),f(b)}function f(b){return b===35&&s++<6?(i.consume(b),f):b===null||Gt(b)?(i.exit("atxHeadingSequence"),h(b)):a(b)}function h(b){return b===35?(i.enter("atxHeadingSequence"),p(b)):b===null||xe(b)?(i.exit("atxHeading"),n(b)):Ye(b)?We(i,h,"whitespace")(b):(i.enter("atxHeadingText"),m(b))}function p(b){return b===35?(i.consume(b),p):(i.exit("atxHeadingSequence"),h(b))}function m(b){return b===null||b===35||Gt(b)?(i.exit("atxHeadingText"),h(b)):(i.consume(b),m)}}const nS=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Py=["pre","script","style","textarea"],iS={concrete:!0,name:"htmlFlow",resolveTo:sS,tokenize:rS},aS={partial:!0,tokenize:oS},lS={partial:!0,tokenize:uS};function sS(i){let n=i.length;for(;n--&&!(i[n][0]==="enter"&&i[n][1].type==="htmlFlow"););return n>1&&i[n-2][1].type==="linePrefix"&&(i[n][1].start=i[n-2][1].start,i[n+1][1].start=i[n-2][1].start,i.splice(n-2,2)),i}function rS(i,n,a){const s=this;let u,o,f,h,p;return m;function m(k){return b(k)}function b(k){return i.enter("htmlFlow"),i.enter("htmlFlowData"),i.consume(k),g}function g(k){return k===33?(i.consume(k),_):k===47?(i.consume(k),o=!0,w):k===63?(i.consume(k),u=3,s.interrupt?n:A):Mn(k)?(i.consume(k),f=String.fromCharCode(k),j):a(k)}function _(k){return k===45?(i.consume(k),u=2,v):k===91?(i.consume(k),u=5,h=0,O):Mn(k)?(i.consume(k),u=4,s.interrupt?n:A):a(k)}function v(k){return k===45?(i.consume(k),s.interrupt?n:A):a(k)}function O(k){const W="CDATA[";return k===W.charCodeAt(h++)?(i.consume(k),h===W.length?s.interrupt?n:P:O):a(k)}function w(k){return Mn(k)?(i.consume(k),f=String.fromCharCode(k),j):a(k)}function j(k){if(k===null||k===47||k===62||Gt(k)){const W=k===47,ce=f.toLowerCase();return!W&&!o&&Py.includes(ce)?(u=1,s.interrupt?n(k):P(k)):nS.includes(f.toLowerCase())?(u=6,W?(i.consume(k),E):s.interrupt?n(k):P(k)):(u=7,s.interrupt&&!s.parser.lazy[s.now().line]?a(k):o?H(k):I(k))}return k===45||kn(k)?(i.consume(k),f+=String.fromCharCode(k),j):a(k)}function E(k){return k===62?(i.consume(k),s.interrupt?n:P):a(k)}function H(k){return Ye(k)?(i.consume(k),H):ye(k)}function I(k){return k===47?(i.consume(k),ye):k===58||k===95||Mn(k)?(i.consume(k),Q):Ye(k)?(i.consume(k),I):ye(k)}function Q(k){return k===45||k===46||k===58||k===95||kn(k)?(i.consume(k),Q):F(k)}function F(k){return k===61?(i.consume(k),L):Ye(k)?(i.consume(k),F):I(k)}function L(k){return k===null||k===60||k===61||k===62||k===96?a(k):k===34||k===39?(i.consume(k),p=k,Z):Ye(k)?(i.consume(k),L):J(k)}function Z(k){return k===p?(i.consume(k),p=null,le):k===null||xe(k)?a(k):(i.consume(k),Z)}function J(k){return k===null||k===34||k===39||k===47||k===60||k===61||k===62||k===96||Gt(k)?F(k):(i.consume(k),J)}function le(k){return k===47||k===62||Ye(k)?I(k):a(k)}function ye(k){return k===62?(i.consume(k),ie):a(k)}function ie(k){return k===null||xe(k)?P(k):Ye(k)?(i.consume(k),ie):a(k)}function P(k){return k===45&&u===2?(i.consume(k),B):k===60&&u===1?(i.consume(k),$):k===62&&u===4?(i.consume(k),N):k===63&&u===3?(i.consume(k),A):k===93&&u===5?(i.consume(k),te):xe(k)&&(u===6||u===7)?(i.exit("htmlFlowData"),i.check(aS,U,ke)(k)):k===null||xe(k)?(i.exit("htmlFlowData"),ke(k)):(i.consume(k),P)}function ke(k){return i.check(lS,Ce,U)(k)}function Ce(k){return i.enter("lineEnding"),i.consume(k),i.exit("lineEnding"),ve}function ve(k){return k===null||xe(k)?ke(k):(i.enter("htmlFlowData"),P(k))}function B(k){return k===45?(i.consume(k),A):P(k)}function $(k){return k===47?(i.consume(k),f="",fe):P(k)}function fe(k){if(k===62){const W=f.toLowerCase();return Py.includes(W)?(i.consume(k),N):P(k)}return Mn(k)&&f.length<8?(i.consume(k),f+=String.fromCharCode(k),fe):P(k)}function te(k){return k===93?(i.consume(k),A):P(k)}function A(k){return k===62?(i.consume(k),N):k===45&&u===2?(i.consume(k),A):P(k)}function N(k){return k===null||xe(k)?(i.exit("htmlFlowData"),U(k)):(i.consume(k),N)}function U(k){return i.exit("htmlFlow"),n(k)}}function uS(i,n,a){const s=this;return u;function u(f){return xe(f)?(i.enter("lineEnding"),i.consume(f),i.exit("lineEnding"),o):a(f)}function o(f){return s.parser.lazy[s.now().line]?a(f):n(f)}}function oS(i,n,a){return s;function s(u){return i.enter("lineEnding"),i.consume(u),i.exit("lineEnding"),i.attempt(Iu,n,a)}}const cS={name:"htmlText",tokenize:fS};function fS(i,n,a){const s=this;let u,o,f;return h;function h(A){return i.enter("htmlText"),i.enter("htmlTextData"),i.consume(A),p}function p(A){return A===33?(i.consume(A),m):A===47?(i.consume(A),F):A===63?(i.consume(A),I):Mn(A)?(i.consume(A),J):a(A)}function m(A){return A===45?(i.consume(A),b):A===91?(i.consume(A),o=0,O):Mn(A)?(i.consume(A),H):a(A)}function b(A){return A===45?(i.consume(A),v):a(A)}function g(A){return A===null?a(A):A===45?(i.consume(A),_):xe(A)?(f=g,$(A)):(i.consume(A),g)}function _(A){return A===45?(i.consume(A),v):g(A)}function v(A){return A===62?B(A):A===45?_(A):g(A)}function O(A){const N="CDATA[";return A===N.charCodeAt(o++)?(i.consume(A),o===N.length?w:O):a(A)}function w(A){return A===null?a(A):A===93?(i.consume(A),j):xe(A)?(f=w,$(A)):(i.consume(A),w)}function j(A){return A===93?(i.consume(A),E):w(A)}function E(A){return A===62?B(A):A===93?(i.consume(A),E):w(A)}function H(A){return A===null||A===62?B(A):xe(A)?(f=H,$(A)):(i.consume(A),H)}function I(A){return A===null?a(A):A===63?(i.consume(A),Q):xe(A)?(f=I,$(A)):(i.consume(A),I)}function Q(A){return A===62?B(A):I(A)}function F(A){return Mn(A)?(i.consume(A),L):a(A)}function L(A){return A===45||kn(A)?(i.consume(A),L):Z(A)}function Z(A){return xe(A)?(f=Z,$(A)):Ye(A)?(i.consume(A),Z):B(A)}function J(A){return A===45||kn(A)?(i.consume(A),J):A===47||A===62||Gt(A)?le(A):a(A)}function le(A){return A===47?(i.consume(A),B):A===58||A===95||Mn(A)?(i.consume(A),ye):xe(A)?(f=le,$(A)):Ye(A)?(i.consume(A),le):B(A)}function ye(A){return A===45||A===46||A===58||A===95||kn(A)?(i.consume(A),ye):ie(A)}function ie(A){return A===61?(i.consume(A),P):xe(A)?(f=ie,$(A)):Ye(A)?(i.consume(A),ie):le(A)}function P(A){return A===null||A===60||A===61||A===62||A===96?a(A):A===34||A===39?(i.consume(A),u=A,ke):xe(A)?(f=P,$(A)):Ye(A)?(i.consume(A),P):(i.consume(A),Ce)}function ke(A){return A===u?(i.consume(A),u=void 0,ve):A===null?a(A):xe(A)?(f=ke,$(A)):(i.consume(A),ke)}function Ce(A){return A===null||A===34||A===39||A===60||A===61||A===96?a(A):A===47||A===62||Gt(A)?le(A):(i.consume(A),Ce)}function ve(A){return A===47||A===62||Gt(A)?le(A):a(A)}function B(A){return A===62?(i.consume(A),i.exit("htmlTextData"),i.exit("htmlText"),n):a(A)}function $(A){return i.exit("htmlTextData"),i.enter("lineEnding"),i.consume(A),i.exit("lineEnding"),fe}function fe(A){return Ye(A)?We(i,te,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):te(A)}function te(A){return i.enter("htmlTextData"),f(A)}}const fd={name:"labelEnd",resolveAll:pS,resolveTo:yS,tokenize:gS},dS={tokenize:bS},hS={tokenize:vS},mS={tokenize:xS};function pS(i){let n=-1;const a=[];for(;++n<i.length;){const s=i[n][1];if(a.push(i[n]),s.type==="labelImage"||s.type==="labelLink"||s.type==="labelEnd"){const u=s.type==="labelImage"?4:2;s.type="data",n+=u}}return i.length!==a.length&&Dn(i,0,i.length,a),i}function yS(i,n){let a=i.length,s=0,u,o,f,h;for(;a--;)if(u=i[a][1],o){if(u.type==="link"||u.type==="labelLink"&&u._inactive)break;i[a][0]==="enter"&&u.type==="labelLink"&&(u._inactive=!0)}else if(f){if(i[a][0]==="enter"&&(u.type==="labelImage"||u.type==="labelLink")&&!u._balanced&&(o=a,u.type!=="labelLink")){s=2;break}}else u.type==="labelEnd"&&(f=a);const p={type:i[o][1].type==="labelLink"?"link":"image",start:{...i[o][1].start},end:{...i[i.length-1][1].end}},m={type:"label",start:{...i[o][1].start},end:{...i[f][1].end}},b={type:"labelText",start:{...i[o+s+2][1].end},end:{...i[f-2][1].start}};return h=[["enter",p,n],["enter",m,n]],h=dn(h,i.slice(o+1,o+s+3)),h=dn(h,[["enter",b,n]]),h=dn(h,cd(n.parser.constructs.insideSpan.null,i.slice(o+s+4,f-3),n)),h=dn(h,[["exit",b,n],i[f-2],i[f-1],["exit",m,n]]),h=dn(h,i.slice(f+1)),h=dn(h,[["exit",p,n]]),Dn(i,o,i.length,h),i}function gS(i,n,a){const s=this;let u=s.events.length,o,f;for(;u--;)if((s.events[u][1].type==="labelImage"||s.events[u][1].type==="labelLink")&&!s.events[u][1]._balanced){o=s.events[u][1];break}return h;function h(_){return o?o._inactive?g(_):(f=s.parser.defined.includes(gl(s.sliceSerialize({start:o.end,end:s.now()}))),i.enter("labelEnd"),i.enter("labelMarker"),i.consume(_),i.exit("labelMarker"),i.exit("labelEnd"),p):a(_)}function p(_){return _===40?i.attempt(dS,b,f?b:g)(_):_===91?i.attempt(hS,b,f?m:g)(_):f?b(_):g(_)}function m(_){return i.attempt(mS,b,g)(_)}function b(_){return n(_)}function g(_){return o._balanced=!0,a(_)}}function bS(i,n,a){return s;function s(g){return i.enter("resource"),i.enter("resourceMarker"),i.consume(g),i.exit("resourceMarker"),u}function u(g){return Gt(g)?Ms(i,o)(g):o(g)}function o(g){return g===41?b(g):Ig(i,f,h,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function f(g){return Gt(g)?Ms(i,p)(g):b(g)}function h(g){return a(g)}function p(g){return g===34||g===39||g===40?Yg(i,m,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):b(g)}function m(g){return Gt(g)?Ms(i,b)(g):b(g)}function b(g){return g===41?(i.enter("resourceMarker"),i.consume(g),i.exit("resourceMarker"),i.exit("resource"),n):a(g)}}function vS(i,n,a){const s=this;return u;function u(h){return Hg.call(s,i,o,f,"reference","referenceMarker","referenceString")(h)}function o(h){return s.parser.defined.includes(gl(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?n(h):a(h)}function f(h){return a(h)}}function xS(i,n,a){return s;function s(o){return i.enter("reference"),i.enter("referenceMarker"),i.consume(o),i.exit("referenceMarker"),u}function u(o){return o===93?(i.enter("referenceMarker"),i.consume(o),i.exit("referenceMarker"),i.exit("reference"),n):a(o)}}const SS={name:"labelStartImage",resolveAll:fd.resolveAll,tokenize:_S};function _S(i,n,a){const s=this;return u;function u(h){return i.enter("labelImage"),i.enter("labelImageMarker"),i.consume(h),i.exit("labelImageMarker"),o}function o(h){return h===91?(i.enter("labelMarker"),i.consume(h),i.exit("labelMarker"),i.exit("labelImage"),f):a(h)}function f(h){return h===94&&"_hiddenFootnoteSupport"in s.parser.constructs?a(h):n(h)}}const kS={name:"labelStartLink",resolveAll:fd.resolveAll,tokenize:wS};function wS(i,n,a){const s=this;return u;function u(f){return i.enter("labelLink"),i.enter("labelMarker"),i.consume(f),i.exit("labelMarker"),i.exit("labelLink"),o}function o(f){return f===94&&"_hiddenFootnoteSupport"in s.parser.constructs?a(f):n(f)}}const Of={name:"lineEnding",tokenize:AS};function AS(i,n){return a;function a(s){return i.enter("lineEnding"),i.consume(s),i.exit("lineEnding"),We(i,n,"linePrefix")}}const gu={name:"thematicBreak",tokenize:TS};function TS(i,n,a){let s=0,u;return o;function o(m){return i.enter("thematicBreak"),f(m)}function f(m){return u=m,h(m)}function h(m){return m===u?(i.enter("thematicBreakSequence"),p(m)):s>=3&&(m===null||xe(m))?(i.exit("thematicBreak"),n(m)):a(m)}function p(m){return m===u?(i.consume(m),s++,p):(i.exit("thematicBreakSequence"),Ye(m)?We(i,h,"whitespace")(m):h(m))}}const Vt={continuation:{tokenize:OS},exit:jS,name:"list",tokenize:CS},ES={partial:!0,tokenize:DS},NS={partial:!0,tokenize:MS};function CS(i,n,a){const s=this,u=s.events[s.events.length-1];let o=u&&u[1].type==="linePrefix"?u[2].sliceSerialize(u[1],!0).length:0,f=0;return h;function h(v){const O=s.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(O==="listUnordered"?!s.containerState.marker||v===s.containerState.marker:Kf(v)){if(s.containerState.type||(s.containerState.type=O,i.enter(O,{_container:!0})),O==="listUnordered")return i.enter("listItemPrefix"),v===42||v===45?i.check(gu,a,m)(v):m(v);if(!s.interrupt||v===49)return i.enter("listItemPrefix"),i.enter("listItemValue"),p(v)}return a(v)}function p(v){return Kf(v)&&++f<10?(i.consume(v),p):(!s.interrupt||f<2)&&(s.containerState.marker?v===s.containerState.marker:v===41||v===46)?(i.exit("listItemValue"),m(v)):a(v)}function m(v){return i.enter("listItemMarker"),i.consume(v),i.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||v,i.check(Iu,s.interrupt?a:b,i.attempt(ES,_,g))}function b(v){return s.containerState.initialBlankLine=!0,o++,_(v)}function g(v){return Ye(v)?(i.enter("listItemPrefixWhitespace"),i.consume(v),i.exit("listItemPrefixWhitespace"),_):a(v)}function _(v){return s.containerState.size=o+s.sliceSerialize(i.exit("listItemPrefix"),!0).length,n(v)}}function OS(i,n,a){const s=this;return s.containerState._closeFlow=void 0,i.check(Iu,u,o);function u(h){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,We(i,n,"listItemIndent",s.containerState.size+1)(h)}function o(h){return s.containerState.furtherBlankLines||!Ye(h)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,f(h)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,i.attempt(NS,n,f)(h))}function f(h){return s.containerState._closeFlow=!0,s.interrupt=void 0,We(i,i.attempt(Vt,n,a),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(h)}}function MS(i,n,a){const s=this;return We(i,u,"listItemIndent",s.containerState.size+1);function u(o){const f=s.events[s.events.length-1];return f&&f[1].type==="listItemIndent"&&f[2].sliceSerialize(f[1],!0).length===s.containerState.size?n(o):a(o)}}function jS(i){i.exit(this.containerState.type)}function DS(i,n,a){const s=this;return We(i,u,"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function u(o){const f=s.events[s.events.length-1];return!Ye(o)&&f&&f[1].type==="listItemPrefixWhitespace"?n(o):a(o)}}const eg={name:"setextUnderline",resolveTo:zS,tokenize:RS};function zS(i,n){let a=i.length,s,u,o;for(;a--;)if(i[a][0]==="enter"){if(i[a][1].type==="content"){s=a;break}i[a][1].type==="paragraph"&&(u=a)}else i[a][1].type==="content"&&i.splice(a,1),!o&&i[a][1].type==="definition"&&(o=a);const f={type:"setextHeading",start:{...i[s][1].start},end:{...i[i.length-1][1].end}};return i[u][1].type="setextHeadingText",o?(i.splice(u,0,["enter",f,n]),i.splice(o+1,0,["exit",i[s][1],n]),i[s][1].end={...i[o][1].end}):i[s][1]=f,i.push(["exit",f,n]),i}function RS(i,n,a){const s=this;let u;return o;function o(m){let b=s.events.length,g;for(;b--;)if(s.events[b][1].type!=="lineEnding"&&s.events[b][1].type!=="linePrefix"&&s.events[b][1].type!=="content"){g=s.events[b][1].type==="paragraph";break}return!s.parser.lazy[s.now().line]&&(s.interrupt||g)?(i.enter("setextHeadingLine"),u=m,f(m)):a(m)}function f(m){return i.enter("setextHeadingLineSequence"),h(m)}function h(m){return m===u?(i.consume(m),h):(i.exit("setextHeadingLineSequence"),Ye(m)?We(i,p,"lineSuffix")(m):p(m))}function p(m){return m===null||xe(m)?(i.exit("setextHeadingLine"),n(m)):a(m)}}const LS={tokenize:BS};function BS(i){const n=this,a=i.attempt(Iu,s,i.attempt(this.parser.constructs.flowInitial,u,We(i,i.attempt(this.parser.constructs.flow,u,i.attempt(Yx,u)),"linePrefix")));return a;function s(o){if(o===null){i.consume(o);return}return i.enter("lineEndingBlank"),i.consume(o),i.exit("lineEndingBlank"),n.currentConstruct=void 0,a}function u(o){if(o===null){i.consume(o);return}return i.enter("lineEnding"),i.consume(o),i.exit("lineEnding"),n.currentConstruct=void 0,a}}const qS={resolveAll:Gg()},US=Vg("string"),IS=Vg("text");function Vg(i){return{resolveAll:Gg(i==="text"?HS:void 0),tokenize:n};function n(a){const s=this,u=this.parser.constructs[i],o=a.attempt(u,f,h);return f;function f(b){return m(b)?o(b):h(b)}function h(b){if(b===null){a.consume(b);return}return a.enter("data"),a.consume(b),p}function p(b){return m(b)?(a.exit("data"),o(b)):(a.consume(b),p)}function m(b){if(b===null)return!0;const g=u[b];let _=-1;if(g)for(;++_<g.length;){const v=g[_];if(!v.previous||v.previous.call(s,s.previous))return!0}return!1}}}function Gg(i){return n;function n(a,s){let u=-1,o;for(;++u<=a.length;)o===void 0?a[u]&&a[u][1].type==="data"&&(o=u,u++):(!a[u]||a[u][1].type!=="data")&&(u!==o+2&&(a[o][1].end=a[u-1][1].end,a.splice(o+2,u-o-2),u=o+2),o=void 0);return i?i(a,s):a}}function HS(i,n){let a=0;for(;++a<=i.length;)if((a===i.length||i[a][1].type==="lineEnding")&&i[a-1][1].type==="data"){const s=i[a-1][1],u=n.sliceStream(s);let o=u.length,f=-1,h=0,p;for(;o--;){const m=u[o];if(typeof m=="string"){for(f=m.length;m.charCodeAt(f-1)===32;)h++,f--;if(f)break;f=-1}else if(m===-2)p=!0,h++;else if(m!==-1){o++;break}}if(n._contentTypeTextTrailing&&a===i.length&&(h=0),h){const m={type:a===i.length||p||h<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?f:s.start._bufferIndex+f,_index:s.start._index+o,line:s.end.line,column:s.end.column-h,offset:s.end.offset-h},end:{...s.end}};s.end={...m.start},s.start.offset===s.end.offset?Object.assign(s,m):(i.splice(a,0,["enter",m,n],["exit",m,n]),a+=2)}a++}return i}const YS={42:Vt,43:Vt,45:Vt,48:Vt,49:Vt,50:Vt,51:Vt,52:Vt,53:Vt,54:Vt,55:Vt,56:Vt,57:Vt,62:Lg},VS={91:Qx},GS={[-2]:Cf,[-1]:Cf,32:Cf},KS={35:Px,42:gu,45:[eg,gu],60:iS,61:eg,95:gu,96:Wy,126:Wy},ZS={38:qg,92:Bg},QS={[-5]:Of,[-4]:Of,[-3]:Of,33:SS,38:qg,42:Zf,60:[kx,cS],91:kS,92:[Fx,Bg],93:fd,95:Zf,96:Lx},$S={null:[Zf,qS]},XS={null:[42,95]},JS={null:[]},FS=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:XS,contentInitial:VS,disable:JS,document:YS,flow:KS,flowInitial:GS,insideSpan:$S,string:ZS,text:QS},Symbol.toStringTag,{value:"Module"}));function WS(i,n,a){let s={_bufferIndex:-1,_index:0,line:a&&a.line||1,column:a&&a.column||1,offset:a&&a.offset||0};const u={},o=[];let f=[],h=[];const p={attempt:Z(F),check:Z(L),consume:H,enter:I,exit:Q,interrupt:Z(L,{interrupt:!0})},m={code:null,containerState:{},defineSkip:w,events:[],now:O,parser:i,previous:null,sliceSerialize:_,sliceStream:v,write:g};let b=n.tokenize.call(m,p);return n.resolveAll&&o.push(n),m;function g(ie){return f=dn(f,ie),j(),f[f.length-1]!==null?[]:(J(n,0),m.events=cd(o,m.events,m),m.events)}function _(ie,P){return e_(v(ie),P)}function v(ie){return PS(f,ie)}function O(){const{_bufferIndex:ie,_index:P,line:ke,column:Ce,offset:ve}=s;return{_bufferIndex:ie,_index:P,line:ke,column:Ce,offset:ve}}function w(ie){u[ie.line]=ie.column,ye()}function j(){let ie;for(;s._index<f.length;){const P=f[s._index];if(typeof P=="string")for(ie=s._index,s._bufferIndex<0&&(s._bufferIndex=0);s._index===ie&&s._bufferIndex<P.length;)E(P.charCodeAt(s._bufferIndex));else E(P)}}function E(ie){b=b(ie)}function H(ie){xe(ie)?(s.line++,s.column=1,s.offset+=ie===-3?2:1,ye()):ie!==-1&&(s.column++,s.offset++),s._bufferIndex<0?s._index++:(s._bufferIndex++,s._bufferIndex===f[s._index].length&&(s._bufferIndex=-1,s._index++)),m.previous=ie}function I(ie,P){const ke=P||{};return ke.type=ie,ke.start=O(),m.events.push(["enter",ke,m]),h.push(ke),ke}function Q(ie){const P=h.pop();return P.end=O(),m.events.push(["exit",P,m]),P}function F(ie,P){J(ie,P.from)}function L(ie,P){P.restore()}function Z(ie,P){return ke;function ke(Ce,ve,B){let $,fe,te,A;return Array.isArray(Ce)?U(Ce):"tokenize"in Ce?U([Ce]):N(Ce);function N(re){return pe;function pe(Ze){const Be=Ze!==null&&re[Ze],pt=Ze!==null&&re.null,gn=[...Array.isArray(Be)?Be:Be?[Be]:[],...Array.isArray(pt)?pt:pt?[pt]:[]];return U(gn)(Ze)}}function U(re){return $=re,fe=0,re.length===0?B:k(re[fe])}function k(re){return pe;function pe(Ze){return A=le(),te=re,re.partial||(m.currentConstruct=re),re.name&&m.parser.constructs.disable.null.includes(re.name)?ce():re.tokenize.call(P?Object.assign(Object.create(m),P):m,p,W,ce)(Ze)}}function W(re){return ie(te,A),ve}function ce(re){return A.restore(),++fe<$.length?k($[fe]):B}}}function J(ie,P){ie.resolveAll&&!o.includes(ie)&&o.push(ie),ie.resolve&&Dn(m.events,P,m.events.length-P,ie.resolve(m.events.slice(P),m)),ie.resolveTo&&(m.events=ie.resolveTo(m.events,m))}function le(){const ie=O(),P=m.previous,ke=m.currentConstruct,Ce=m.events.length,ve=Array.from(h);return{from:Ce,restore:B};function B(){s=ie,m.previous=P,m.currentConstruct=ke,m.events.length=Ce,h=ve,ye()}}function ye(){s.line in u&&s.column<2&&(s.column=u[s.line],s.offset+=u[s.line]-1)}}function PS(i,n){const a=n.start._index,s=n.start._bufferIndex,u=n.end._index,o=n.end._bufferIndex;let f;if(a===u)f=[i[a].slice(s,o)];else{if(f=i.slice(a,u),s>-1){const h=f[0];typeof h=="string"?f[0]=h.slice(s):f.shift()}o>0&&f.push(i[u].slice(0,o))}return f}function e_(i,n){let a=-1;const s=[];let u;for(;++a<i.length;){const o=i[a];let f;if(typeof o=="string")f=o;else switch(o){case-5:{f="\r";break}case-4:{f=`
374
+ `;break}case-3:{f=`\r
375
+ `;break}case-2:{f=n?" ":" ";break}case-1:{if(!n&&u)continue;f=" ";break}default:f=String.fromCharCode(o)}u=o===-2,s.push(f)}return s.join("")}function t_(i){const s={constructs:ux([FS,...(i||{}).extensions||[]]),content:u(yx),defined:[],document:u(bx),flow:u(LS),lazy:{},string:u(US),text:u(IS)};return s;function u(o){return f;function f(h){return WS(s,o,h)}}}function n_(i){for(;!Ug(i););return i}const tg=/[\0\t\n\r]/g;function i_(){let i=1,n="",a=!0,s;return u;function u(o,f,h){const p=[];let m,b,g,_,v;for(o=n+(typeof o=="string"?o.toString():new TextDecoder(f||void 0).decode(o)),g=0,n="",a&&(o.charCodeAt(0)===65279&&g++,a=void 0);g<o.length;){if(tg.lastIndex=g,m=tg.exec(o),_=m&&m.index!==void 0?m.index:o.length,v=o.charCodeAt(_),!m){n=o.slice(g);break}if(v===10&&g===_&&s)p.push(-3),s=void 0;else switch(s&&(p.push(-5),s=void 0),g<_&&(p.push(o.slice(g,_)),i+=_-g),v){case 0:{p.push(65533),i++;break}case 9:{for(b=Math.ceil(i/4)*4,p.push(-2);i++<b;)p.push(-1);break}case 10:{p.push(-4),i=1;break}default:s=!0,i=1}g=_+1}return h&&(s&&p.push(-5),n&&p.push(n),p.push(null)),p}}const a_=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function l_(i){return i.replace(a_,s_)}function s_(i,n,a){if(n)return n;if(a.charCodeAt(0)===35){const u=a.charCodeAt(1),o=u===120||u===88;return Rg(a.slice(o?2:1),o?16:10)}return od(a)||i}const Kg={}.hasOwnProperty;function r_(i,n,a){return typeof n!="string"&&(a=n,n=void 0),u_(a)(n_(t_(a).document().write(i_()(i,n,!0))))}function u_(i){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(ka),autolinkProtocol:le,autolinkEmail:le,atxHeading:o(Sa),blockQuote:o(pt),characterEscape:le,characterReference:le,codeFenced:o(gn),codeFencedFenceInfo:f,codeFencedFenceMeta:f,codeIndented:o(gn,f),codeText:o(qn,f),codeTextData:le,data:le,codeFlowValue:le,definition:o(Zs),definitionDestinationString:f,definitionLabelString:f,definitionTitleString:f,emphasis:o(Un),hardBreakEscape:o(_a),hardBreakTrailing:o(_a),htmlFlow:o(Qs,f),htmlFlowData:le,htmlText:o(Qs,f),htmlTextData:le,image:o($s),label:f,link:o(ka),listItem:o(Nl),listItemValue:_,listOrdered:o(wa,g),listUnordered:o(wa),paragraph:o(Wu),reference:k,referenceString:f,resourceDestinationString:f,resourceTitleString:f,setextHeading:o(Sa),strong:o(Pu),thematicBreak:o(eo)},exit:{atxHeading:p(),atxHeadingSequence:F,autolink:p(),autolinkEmail:Be,autolinkProtocol:Ze,blockQuote:p(),characterEscapeValue:ye,characterReferenceMarkerHexadecimal:ce,characterReferenceMarkerNumeric:ce,characterReferenceValue:re,characterReference:pe,codeFenced:p(j),codeFencedFence:w,codeFencedFenceInfo:v,codeFencedFenceMeta:O,codeFlowValue:ye,codeIndented:p(E),codeText:p(ve),codeTextData:ye,data:ye,definition:p(),definitionDestinationString:Q,definitionLabelString:H,definitionTitleString:I,emphasis:p(),hardBreakEscape:p(P),hardBreakTrailing:p(P),htmlFlow:p(ke),htmlFlowData:ye,htmlText:p(Ce),htmlTextData:ye,image:p($),label:te,labelText:fe,lineEnding:ie,link:p(B),listItem:p(),listOrdered:p(),listUnordered:p(),paragraph:p(),referenceString:W,resourceDestinationString:A,resourceTitleString:N,resource:U,setextHeading:p(J),setextHeadingLineSequence:Z,setextHeadingText:L,strong:p(),thematicBreak:p()}};Zg(n,(i||{}).mdastExtensions||[]);const a={};return s;function s(V){let ee={type:"root",children:[]};const be={stack:[ee],tokenStack:[],config:n,enter:h,exit:m,buffer:f,resume:b,data:a},Oe=[];let Ve=-1;for(;++Ve<V.length;)if(V[Ve][1].type==="listOrdered"||V[Ve][1].type==="listUnordered")if(V[Ve][0]==="enter")Oe.push(Ve);else{const Zt=Oe.pop();Ve=u(V,Zt,Ve)}for(Ve=-1;++Ve<V.length;){const Zt=n[V[Ve][0]];Kg.call(Zt,V[Ve][1].type)&&Zt[V[Ve][1].type].call(Object.assign({sliceSerialize:V[Ve][2].sliceSerialize},be),V[Ve][1])}if(be.tokenStack.length>0){const Zt=be.tokenStack[be.tokenStack.length-1];(Zt[1]||ng).call(be,void 0,Zt[0])}for(ee.position={start:Bi(V.length>0?V[0][1].start:{line:1,column:1,offset:0}),end:Bi(V.length>0?V[V.length-2][1].end:{line:1,column:1,offset:0})},Ve=-1;++Ve<n.transforms.length;)ee=n.transforms[Ve](ee)||ee;return ee}function u(V,ee,be){let Oe=ee-1,Ve=-1,Zt=!1,In,Ct,yt,Rt;for(;++Oe<=be;){const Je=V[Oe];switch(Je[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Je[0]==="enter"?Ve++:Ve--,Rt=void 0;break}case"lineEndingBlank":{Je[0]==="enter"&&(In&&!Rt&&!Ve&&!yt&&(yt=Oe),Rt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Rt=void 0}if(!Ve&&Je[0]==="enter"&&Je[1].type==="listItemPrefix"||Ve===-1&&Je[0]==="exit"&&(Je[1].type==="listUnordered"||Je[1].type==="listOrdered")){if(In){let di=Oe;for(Ct=void 0;di--;){const bn=V[di];if(bn[1].type==="lineEnding"||bn[1].type==="lineEndingBlank"){if(bn[0]==="exit")continue;Ct&&(V[Ct][1].type="lineEndingBlank",Zt=!0),bn[1].type="lineEnding",Ct=di}else if(!(bn[1].type==="linePrefix"||bn[1].type==="blockQuotePrefix"||bn[1].type==="blockQuotePrefixWhitespace"||bn[1].type==="blockQuoteMarker"||bn[1].type==="listItemIndent"))break}yt&&(!Ct||yt<Ct)&&(In._spread=!0),In.end=Object.assign({},Ct?V[Ct][1].start:Je[1].end),V.splice(Ct||Oe,0,["exit",In,Je[2]]),Oe++,be++}if(Je[1].type==="listItemPrefix"){const di={type:"listItem",_spread:!1,start:Object.assign({},Je[1].start),end:void 0};In=di,V.splice(Oe,0,["enter",di,Je[2]]),Oe++,be++,yt=void 0,Rt=!0}}}return V[ee][1]._spread=Zt,be}function o(V,ee){return be;function be(Oe){h.call(this,V(Oe),Oe),ee&&ee.call(this,Oe)}}function f(){this.stack.push({type:"fragment",children:[]})}function h(V,ee,be){this.stack[this.stack.length-1].children.push(V),this.stack.push(V),this.tokenStack.push([ee,be||void 0]),V.position={start:Bi(ee.start),end:void 0}}function p(V){return ee;function ee(be){V&&V.call(this,be),m.call(this,be)}}function m(V,ee){const be=this.stack.pop(),Oe=this.tokenStack.pop();if(Oe)Oe[0].type!==V.type&&(ee?ee.call(this,V,Oe[0]):(Oe[1]||ng).call(this,V,Oe[0]));else throw new Error("Cannot close `"+V.type+"` ("+Os({start:V.start,end:V.end})+"): it’s not open");be.position.end=Bi(V.end)}function b(){return sx(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function _(V){if(this.data.expectingFirstListItemValue){const ee=this.stack[this.stack.length-2];ee.start=Number.parseInt(this.sliceSerialize(V),10),this.data.expectingFirstListItemValue=void 0}}function v(){const V=this.resume(),ee=this.stack[this.stack.length-1];ee.lang=V}function O(){const V=this.resume(),ee=this.stack[this.stack.length-1];ee.meta=V}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function j(){const V=this.resume(),ee=this.stack[this.stack.length-1];ee.value=V.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const V=this.resume(),ee=this.stack[this.stack.length-1];ee.value=V.replace(/(\r?\n|\r)$/g,"")}function H(V){const ee=this.resume(),be=this.stack[this.stack.length-1];be.label=ee,be.identifier=gl(this.sliceSerialize(V)).toLowerCase()}function I(){const V=this.resume(),ee=this.stack[this.stack.length-1];ee.title=V}function Q(){const V=this.resume(),ee=this.stack[this.stack.length-1];ee.url=V}function F(V){const ee=this.stack[this.stack.length-1];if(!ee.depth){const be=this.sliceSerialize(V).length;ee.depth=be}}function L(){this.data.setextHeadingSlurpLineEnding=!0}function Z(V){const ee=this.stack[this.stack.length-1];ee.depth=this.sliceSerialize(V).codePointAt(0)===61?1:2}function J(){this.data.setextHeadingSlurpLineEnding=void 0}function le(V){const be=this.stack[this.stack.length-1].children;let Oe=be[be.length-1];(!Oe||Oe.type!=="text")&&(Oe=Nt(),Oe.position={start:Bi(V.start),end:void 0},be.push(Oe)),this.stack.push(Oe)}function ye(V){const ee=this.stack.pop();ee.value+=this.sliceSerialize(V),ee.position.end=Bi(V.end)}function ie(V){const ee=this.stack[this.stack.length-1];if(this.data.atHardBreak){const be=ee.children[ee.children.length-1];be.position.end=Bi(V.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(ee.type)&&(le.call(this,V),ye.call(this,V))}function P(){this.data.atHardBreak=!0}function ke(){const V=this.resume(),ee=this.stack[this.stack.length-1];ee.value=V}function Ce(){const V=this.resume(),ee=this.stack[this.stack.length-1];ee.value=V}function ve(){const V=this.resume(),ee=this.stack[this.stack.length-1];ee.value=V}function B(){const V=this.stack[this.stack.length-1];if(this.data.inReference){const ee=this.data.referenceType||"shortcut";V.type+="Reference",V.referenceType=ee,delete V.url,delete V.title}else delete V.identifier,delete V.label;this.data.referenceType=void 0}function $(){const V=this.stack[this.stack.length-1];if(this.data.inReference){const ee=this.data.referenceType||"shortcut";V.type+="Reference",V.referenceType=ee,delete V.url,delete V.title}else delete V.identifier,delete V.label;this.data.referenceType=void 0}function fe(V){const ee=this.sliceSerialize(V),be=this.stack[this.stack.length-2];be.label=l_(ee),be.identifier=gl(ee).toLowerCase()}function te(){const V=this.stack[this.stack.length-1],ee=this.resume(),be=this.stack[this.stack.length-1];if(this.data.inReference=!0,be.type==="link"){const Oe=V.children;be.children=Oe}else be.alt=ee}function A(){const V=this.resume(),ee=this.stack[this.stack.length-1];ee.url=V}function N(){const V=this.resume(),ee=this.stack[this.stack.length-1];ee.title=V}function U(){this.data.inReference=void 0}function k(){this.data.referenceType="collapsed"}function W(V){const ee=this.resume(),be=this.stack[this.stack.length-1];be.label=ee,be.identifier=gl(this.sliceSerialize(V)).toLowerCase(),this.data.referenceType="full"}function ce(V){this.data.characterReferenceType=V.type}function re(V){const ee=this.sliceSerialize(V),be=this.data.characterReferenceType;let Oe;be?(Oe=Rg(ee,be==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Oe=od(ee);const Ve=this.stack[this.stack.length-1];Ve.value+=Oe}function pe(V){const ee=this.stack.pop();ee.position.end=Bi(V.end)}function Ze(V){ye.call(this,V);const ee=this.stack[this.stack.length-1];ee.url=this.sliceSerialize(V)}function Be(V){ye.call(this,V);const ee=this.stack[this.stack.length-1];ee.url="mailto:"+this.sliceSerialize(V)}function pt(){return{type:"blockquote",children:[]}}function gn(){return{type:"code",lang:null,meta:null,value:""}}function qn(){return{type:"inlineCode",value:""}}function Zs(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Un(){return{type:"emphasis",children:[]}}function Sa(){return{type:"heading",depth:0,children:[]}}function _a(){return{type:"break"}}function Qs(){return{type:"html",value:""}}function $s(){return{type:"image",title:null,url:"",alt:null}}function ka(){return{type:"link",title:null,url:"",children:[]}}function wa(V){return{type:"list",ordered:V.type==="listOrdered",start:null,spread:V._spread,children:[]}}function Nl(V){return{type:"listItem",spread:V._spread,checked:null,children:[]}}function Wu(){return{type:"paragraph",children:[]}}function Pu(){return{type:"strong",children:[]}}function Nt(){return{type:"text",value:""}}function eo(){return{type:"thematicBreak"}}}function Bi(i){return{line:i.line,column:i.column,offset:i.offset}}function Zg(i,n){let a=-1;for(;++a<n.length;){const s=n[a];Array.isArray(s)?Zg(i,s):o_(i,s)}}function o_(i,n){let a;for(a in n)if(Kg.call(n,a))switch(a){case"canContainEols":{const s=n[a];s&&i[a].push(...s);break}case"transforms":{const s=n[a];s&&i[a].push(...s);break}case"enter":case"exit":{const s=n[a];s&&Object.assign(i[a],s);break}}}function ng(i,n){throw i?new Error("Cannot close `"+i.type+"` ("+Os({start:i.start,end:i.end})+"): a different token (`"+n.type+"`, "+Os({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+Os({start:n.start,end:n.end})+") is still open")}function c_(i){const n=this;n.parser=a;function a(s){return r_(s,{...n.data("settings"),...i,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}const Qg=(function(i){if(i==null)return m_;if(typeof i=="function")return Hu(i);if(typeof i=="object")return Array.isArray(i)?f_(i):d_(i);if(typeof i=="string")return h_(i);throw new Error("Expected function, string, or object as test")});function f_(i){const n=[];let a=-1;for(;++a<i.length;)n[a]=Qg(i[a]);return Hu(s);function s(...u){let o=-1;for(;++o<n.length;)if(n[o].apply(this,u))return!0;return!1}}function d_(i){const n=i;return Hu(a);function a(s){const u=s;let o;for(o in i)if(u[o]!==n[o])return!1;return!0}}function h_(i){return Hu(n);function n(a){return a&&a.type===i}}function Hu(i){return n;function n(a,s,u){return!!(p_(a)&&i.call(this,a,typeof s=="number"?s:void 0,u||void 0))}}function m_(){return!0}function p_(i){return i!==null&&typeof i=="object"&&"type"in i}const $g=[],y_=!0,ig=!1,Xg="skip";function g_(i,n,a,s){let u;typeof n=="function"&&typeof a!="function"?(s=a,a=n):u=n;const o=Qg(u),f=s?-1:1;h(i,void 0,[])();function h(p,m,b){const g=p&&typeof p=="object"?p:{};if(typeof g.type=="string"){const v=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(_,"name",{value:"node ("+(p.type+(v?"<"+v+">":""))+")"})}return _;function _(){let v=$g,O,w,j;if((!n||o(p,m,b[b.length-1]||void 0))&&(v=b_(a(p,b)),v[0]===ig))return v;if("children"in p&&p.children){const E=p;if(E.children&&v[0]!==Xg)for(w=(s?E.children.length:-1)+f,j=b.concat(E);w>-1&&w<E.children.length;){const H=E.children[w];if(O=h(H,w,j)(),O[0]===ig)return O;w=typeof O[1]=="number"?O[1]:w+f}}return v}}}function b_(i){return Array.isArray(i)?i:typeof i=="number"?[y_,i]:i==null?$g:[i]}function v_(i,n,a,s){let u,o,f;o=n,f=a,u=s,g_(i,o,h,u);function h(p,m){const b=m[m.length-1],g=b?b.children.indexOf(p):void 0;return f(p,g,b)}}const Jg="mdma";var qe;(function(i){i.assertEqual=u=>{};function n(u){}i.assertIs=n;function a(u){throw new Error}i.assertNever=a,i.arrayToEnum=u=>{const o={};for(const f of u)o[f]=f;return o},i.getValidEnumValues=u=>{const o=i.objectKeys(u).filter(h=>typeof u[u[h]]!="number"),f={};for(const h of o)f[h]=u[h];return i.objectValues(f)},i.objectValues=u=>i.objectKeys(u).map(function(o){return u[o]}),i.objectKeys=typeof Object.keys=="function"?u=>Object.keys(u):u=>{const o=[];for(const f in u)Object.prototype.hasOwnProperty.call(u,f)&&o.push(f);return o},i.find=(u,o)=>{for(const f of u)if(o(f))return f},i.isInteger=typeof Number.isInteger=="function"?u=>Number.isInteger(u):u=>typeof u=="number"&&Number.isFinite(u)&&Math.floor(u)===u;function s(u,o=" | "){return u.map(f=>typeof f=="string"?`'${f}'`:f).join(o)}i.joinValues=s,i.jsonStringifyReplacer=(u,o)=>typeof o=="bigint"?o.toString():o})(qe||(qe={}));var ag;(function(i){i.mergeShapes=(n,a)=>({...n,...a})})(ag||(ag={}));const ue=qe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),qi=i=>{switch(typeof i){case"undefined":return ue.undefined;case"string":return ue.string;case"number":return Number.isNaN(i)?ue.nan:ue.number;case"boolean":return ue.boolean;case"function":return ue.function;case"bigint":return ue.bigint;case"symbol":return ue.symbol;case"object":return Array.isArray(i)?ue.array:i===null?ue.null:i.then&&typeof i.then=="function"&&i.catch&&typeof i.catch=="function"?ue.promise:typeof Map<"u"&&i instanceof Map?ue.map:typeof Set<"u"&&i instanceof Set?ue.set:typeof Date<"u"&&i instanceof Date?ue.date:ue.object;default:return ue.unknown}},X=qe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ci extends Error{get errors(){return this.issues}constructor(n){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=n}format(n){const a=n||function(o){return o.message},s={_errors:[]},u=o=>{for(const f of o.issues)if(f.code==="invalid_union")f.unionErrors.map(u);else if(f.code==="invalid_return_type")u(f.returnTypeError);else if(f.code==="invalid_arguments")u(f.argumentsError);else if(f.path.length===0)s._errors.push(a(f));else{let h=s,p=0;for(;p<f.path.length;){const m=f.path[p];p===f.path.length-1?(h[m]=h[m]||{_errors:[]},h[m]._errors.push(a(f))):h[m]=h[m]||{_errors:[]},h=h[m],p++}}};return u(this),s}static assert(n){if(!(n instanceof ci))throw new Error(`Not a ZodError: ${n}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,qe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(n=a=>a.message){const a={},s=[];for(const u of this.issues)if(u.path.length>0){const o=u.path[0];a[o]=a[o]||[],a[o].push(n(u))}else s.push(n(u));return{formErrors:s,fieldErrors:a}}get formErrors(){return this.flatten()}}ci.create=i=>new ci(i);const Qf=(i,n)=>{let a;switch(i.code){case X.invalid_type:i.received===ue.undefined?a="Required":a=`Expected ${i.expected}, received ${i.received}`;break;case X.invalid_literal:a=`Invalid literal value, expected ${JSON.stringify(i.expected,qe.jsonStringifyReplacer)}`;break;case X.unrecognized_keys:a=`Unrecognized key(s) in object: ${qe.joinValues(i.keys,", ")}`;break;case X.invalid_union:a="Invalid input";break;case X.invalid_union_discriminator:a=`Invalid discriminator value. Expected ${qe.joinValues(i.options)}`;break;case X.invalid_enum_value:a=`Invalid enum value. Expected ${qe.joinValues(i.options)}, received '${i.received}'`;break;case X.invalid_arguments:a="Invalid function arguments";break;case X.invalid_return_type:a="Invalid function return type";break;case X.invalid_date:a="Invalid date";break;case X.invalid_string:typeof i.validation=="object"?"includes"in i.validation?(a=`Invalid input: must include "${i.validation.includes}"`,typeof i.validation.position=="number"&&(a=`${a} at one or more positions greater than or equal to ${i.validation.position}`)):"startsWith"in i.validation?a=`Invalid input: must start with "${i.validation.startsWith}"`:"endsWith"in i.validation?a=`Invalid input: must end with "${i.validation.endsWith}"`:qe.assertNever(i.validation):i.validation!=="regex"?a=`Invalid ${i.validation}`:a="Invalid";break;case X.too_small:i.type==="array"?a=`Array must contain ${i.exact?"exactly":i.inclusive?"at least":"more than"} ${i.minimum} element(s)`:i.type==="string"?a=`String must contain ${i.exact?"exactly":i.inclusive?"at least":"over"} ${i.minimum} character(s)`:i.type==="number"?a=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="bigint"?a=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="date"?a=`Date must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(i.minimum))}`:a="Invalid input";break;case X.too_big:i.type==="array"?a=`Array must contain ${i.exact?"exactly":i.inclusive?"at most":"less than"} ${i.maximum} element(s)`:i.type==="string"?a=`String must contain ${i.exact?"exactly":i.inclusive?"at most":"under"} ${i.maximum} character(s)`:i.type==="number"?a=`Number must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="bigint"?a=`BigInt must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="date"?a=`Date must be ${i.exact?"exactly":i.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(i.maximum))}`:a="Invalid input";break;case X.custom:a="Invalid input";break;case X.invalid_intersection_types:a="Intersection results could not be merged";break;case X.not_multiple_of:a=`Number must be a multiple of ${i.multipleOf}`;break;case X.not_finite:a="Number must be finite";break;default:a=n.defaultError,qe.assertNever(i)}return{message:a}};let x_=Qf;function S_(){return x_}const __=i=>{const{data:n,path:a,errorMaps:s,issueData:u}=i,o=[...a,...u.path||[]],f={...u,path:o};if(u.message!==void 0)return{...u,path:o,message:u.message};let h="";const p=s.filter(m=>!!m).slice().reverse();for(const m of p)h=m(f,{data:n,defaultError:h}).message;return{...u,path:o,message:h}};function ae(i,n){const a=S_(),s=__({issueData:n,data:i.data,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,a,a===Qf?void 0:Qf].filter(u=>!!u)});i.common.issues.push(s)}class zt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(n,a){const s=[];for(const u of a){if(u.status==="aborted")return Se;u.status==="dirty"&&n.dirty(),s.push(u.value)}return{status:n.value,value:s}}static async mergeObjectAsync(n,a){const s=[];for(const u of a){const o=await u.key,f=await u.value;s.push({key:o,value:f})}return zt.mergeObjectSync(n,s)}static mergeObjectSync(n,a){const s={};for(const u of a){const{key:o,value:f}=u;if(o.status==="aborted"||f.status==="aborted")return Se;o.status==="dirty"&&n.dirty(),f.status==="dirty"&&n.dirty(),o.value!=="__proto__"&&(typeof f.value<"u"||u.alwaysSet)&&(s[o.value]=f.value)}return{status:n.value,value:s}}}const Se=Object.freeze({status:"aborted"}),Es=i=>({status:"dirty",value:i}),yn=i=>({status:"valid",value:i}),lg=i=>i.status==="aborted",sg=i=>i.status==="dirty",xl=i=>i.status==="valid",Su=i=>typeof Promise<"u"&&i instanceof Promise;var he;(function(i){i.errToObj=n=>typeof n=="string"?{message:n}:n||{},i.toString=n=>typeof n=="string"?n:n==null?void 0:n.message})(he||(he={}));class zn{constructor(n,a,s,u){this._cachedPath=[],this.parent=n,this.data=a,this._path=s,this._key=u}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const rg=(i,n)=>{if(xl(n))return{success:!0,data:n.value};if(!i.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const a=new ci(i.common.issues);return this._error=a,this._error}}};function Ne(i){if(!i)return{};const{errorMap:n,invalid_type_error:a,required_error:s,description:u}=i;if(n&&(a||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return n?{errorMap:n,description:u}:{errorMap:(f,h)=>{const{message:p}=i;return f.code==="invalid_enum_value"?{message:p??h.defaultError}:typeof h.data>"u"?{message:p??s??h.defaultError}:f.code!=="invalid_type"?{message:h.defaultError}:{message:p??a??h.defaultError}},description:u}}class Re{get description(){return this._def.description}_getType(n){return qi(n.data)}_getOrReturnCtx(n,a){return a||{common:n.parent.common,data:n.data,parsedType:qi(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}_processInputParams(n){return{status:new zt,ctx:{common:n.parent.common,data:n.data,parsedType:qi(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}}_parseSync(n){const a=this._parse(n);if(Su(a))throw new Error("Synchronous parse encountered promise.");return a}_parseAsync(n){const a=this._parse(n);return Promise.resolve(a)}parse(n,a){const s=this.safeParse(n,a);if(s.success)return s.data;throw s.error}safeParse(n,a){const s={common:{issues:[],async:(a==null?void 0:a.async)??!1,contextualErrorMap:a==null?void 0:a.errorMap},path:(a==null?void 0:a.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:qi(n)},u=this._parseSync({data:n,path:s.path,parent:s});return rg(s,u)}"~validate"(n){var s,u;const a={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:qi(n)};if(!this["~standard"].async)try{const o=this._parseSync({data:n,path:[],parent:a});return xl(o)?{value:o.value}:{issues:a.common.issues}}catch(o){(u=(s=o==null?void 0:o.message)==null?void 0:s.toLowerCase())!=null&&u.includes("encountered")&&(this["~standard"].async=!0),a.common={issues:[],async:!0}}return this._parseAsync({data:n,path:[],parent:a}).then(o=>xl(o)?{value:o.value}:{issues:a.common.issues})}async parseAsync(n,a){const s=await this.safeParseAsync(n,a);if(s.success)return s.data;throw s.error}async safeParseAsync(n,a){const s={common:{issues:[],contextualErrorMap:a==null?void 0:a.errorMap,async:!0},path:(a==null?void 0:a.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:qi(n)},u=this._parse({data:n,path:s.path,parent:s}),o=await(Su(u)?u:Promise.resolve(u));return rg(s,o)}refine(n,a){const s=u=>typeof a=="string"||typeof a>"u"?{message:a}:typeof a=="function"?a(u):a;return this._refinement((u,o)=>{const f=n(u),h=()=>o.addIssue({code:X.custom,...s(u)});return typeof Promise<"u"&&f instanceof Promise?f.then(p=>p?!0:(h(),!1)):f?!0:(h(),!1)})}refinement(n,a){return this._refinement((s,u)=>n(s)?!0:(u.addIssue(typeof a=="function"?a(s,u):a),!1))}_refinement(n){return new Vi({schema:this,typeName:_e.ZodEffects,effect:{type:"refinement",refinement:n}})}superRefine(n){return this._refinement(n)}constructor(n){this.spa=this.safeParseAsync,this._def=n,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:a=>this["~validate"](a)}}optional(){return ui.create(this,this._def)}nullable(){return pa.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return jn.create(this)}promise(){return Eu.create(this,this._def)}or(n){return ku.create([this,n],this._def)}and(n){return wu.create(this,n,this._def)}transform(n){return new Vi({...Ne(this._def),schema:this,typeName:_e.ZodEffects,effect:{type:"transform",transform:n}})}default(n){const a=typeof n=="function"?n:()=>n;return new Nu({...Ne(this._def),innerType:this,defaultValue:a,typeName:_e.ZodDefault})}brand(){return new eb({typeName:_e.ZodBranded,type:this,...Ne(this._def)})}catch(n){const a=typeof n=="function"?n:()=>n;return new Cu({...Ne(this._def),innerType:this,catchValue:a,typeName:_e.ZodCatch})}describe(n){const a=this.constructor;return new a({...this._def,description:n})}pipe(n){return hd.create(this,n)}readonly(){return Ou.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const k_=/^c[^\s-]{8,}$/i,w_=/^[0-9a-z]+$/,A_=/^[0-9A-HJKMNP-TV-Z]{26}$/i,T_=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,E_=/^[a-z0-9_-]{21}$/i,N_=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,C_=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,O_=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,M_="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Mf;const j_=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,D_=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,z_=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,R_=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,L_=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,B_=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Fg="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",q_=new RegExp(`^${Fg}$`);function Wg(i){let n="[0-5]\\d";i.precision?n=`${n}\\.\\d{${i.precision}}`:i.precision==null&&(n=`${n}(\\.\\d+)?`);const a=i.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${n})${a}`}function U_(i){return new RegExp(`^${Wg(i)}$`)}function I_(i){let n=`${Fg}T${Wg(i)}`;const a=[];return a.push(i.local?"Z?":"Z"),i.offset&&a.push("([+-]\\d{2}:?\\d{2})"),n=`${n}(${a.join("|")})`,new RegExp(`^${n}$`)}function H_(i,n){return!!((n==="v4"||!n)&&j_.test(i)||(n==="v6"||!n)&&z_.test(i))}function Y_(i,n){if(!N_.test(i))return!1;try{const[a]=i.split(".");if(!a)return!1;const s=a.replace(/-/g,"+").replace(/_/g,"/").padEnd(a.length+(4-a.length%4)%4,"="),u=JSON.parse(atob(s));return!(typeof u!="object"||u===null||"typ"in u&&(u==null?void 0:u.typ)!=="JWT"||!u.alg||n&&u.alg!==n)}catch{return!1}}function V_(i,n){return!!((n==="v4"||!n)&&D_.test(i)||(n==="v6"||!n)&&R_.test(i))}class si extends Re{_parse(n){if(this._def.coerce&&(n.data=String(n.data)),this._getType(n)!==ue.string){const o=this._getOrReturnCtx(n);return ae(o,{code:X.invalid_type,expected:ue.string,received:o.parsedType}),Se}const s=new zt;let u;for(const o of this._def.checks)if(o.kind==="min")n.data.length<o.value&&(u=this._getOrReturnCtx(n,u),ae(u,{code:X.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),s.dirty());else if(o.kind==="max")n.data.length>o.value&&(u=this._getOrReturnCtx(n,u),ae(u,{code:X.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),s.dirty());else if(o.kind==="length"){const f=n.data.length>o.value,h=n.data.length<o.value;(f||h)&&(u=this._getOrReturnCtx(n,u),f?ae(u,{code:X.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):h&&ae(u,{code:X.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),s.dirty())}else if(o.kind==="email")O_.test(n.data)||(u=this._getOrReturnCtx(n,u),ae(u,{validation:"email",code:X.invalid_string,message:o.message}),s.dirty());else if(o.kind==="emoji")Mf||(Mf=new RegExp(M_,"u")),Mf.test(n.data)||(u=this._getOrReturnCtx(n,u),ae(u,{validation:"emoji",code:X.invalid_string,message:o.message}),s.dirty());else if(o.kind==="uuid")T_.test(n.data)||(u=this._getOrReturnCtx(n,u),ae(u,{validation:"uuid",code:X.invalid_string,message:o.message}),s.dirty());else if(o.kind==="nanoid")E_.test(n.data)||(u=this._getOrReturnCtx(n,u),ae(u,{validation:"nanoid",code:X.invalid_string,message:o.message}),s.dirty());else if(o.kind==="cuid")k_.test(n.data)||(u=this._getOrReturnCtx(n,u),ae(u,{validation:"cuid",code:X.invalid_string,message:o.message}),s.dirty());else if(o.kind==="cuid2")w_.test(n.data)||(u=this._getOrReturnCtx(n,u),ae(u,{validation:"cuid2",code:X.invalid_string,message:o.message}),s.dirty());else if(o.kind==="ulid")A_.test(n.data)||(u=this._getOrReturnCtx(n,u),ae(u,{validation:"ulid",code:X.invalid_string,message:o.message}),s.dirty());else if(o.kind==="url")try{new URL(n.data)}catch{u=this._getOrReturnCtx(n,u),ae(u,{validation:"url",code:X.invalid_string,message:o.message}),s.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(n.data)||(u=this._getOrReturnCtx(n,u),ae(u,{validation:"regex",code:X.invalid_string,message:o.message}),s.dirty())):o.kind==="trim"?n.data=n.data.trim():o.kind==="includes"?n.data.includes(o.value,o.position)||(u=this._getOrReturnCtx(n,u),ae(u,{code:X.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),s.dirty()):o.kind==="toLowerCase"?n.data=n.data.toLowerCase():o.kind==="toUpperCase"?n.data=n.data.toUpperCase():o.kind==="startsWith"?n.data.startsWith(o.value)||(u=this._getOrReturnCtx(n,u),ae(u,{code:X.invalid_string,validation:{startsWith:o.value},message:o.message}),s.dirty()):o.kind==="endsWith"?n.data.endsWith(o.value)||(u=this._getOrReturnCtx(n,u),ae(u,{code:X.invalid_string,validation:{endsWith:o.value},message:o.message}),s.dirty()):o.kind==="datetime"?I_(o).test(n.data)||(u=this._getOrReturnCtx(n,u),ae(u,{code:X.invalid_string,validation:"datetime",message:o.message}),s.dirty()):o.kind==="date"?q_.test(n.data)||(u=this._getOrReturnCtx(n,u),ae(u,{code:X.invalid_string,validation:"date",message:o.message}),s.dirty()):o.kind==="time"?U_(o).test(n.data)||(u=this._getOrReturnCtx(n,u),ae(u,{code:X.invalid_string,validation:"time",message:o.message}),s.dirty()):o.kind==="duration"?C_.test(n.data)||(u=this._getOrReturnCtx(n,u),ae(u,{validation:"duration",code:X.invalid_string,message:o.message}),s.dirty()):o.kind==="ip"?H_(n.data,o.version)||(u=this._getOrReturnCtx(n,u),ae(u,{validation:"ip",code:X.invalid_string,message:o.message}),s.dirty()):o.kind==="jwt"?Y_(n.data,o.alg)||(u=this._getOrReturnCtx(n,u),ae(u,{validation:"jwt",code:X.invalid_string,message:o.message}),s.dirty()):o.kind==="cidr"?V_(n.data,o.version)||(u=this._getOrReturnCtx(n,u),ae(u,{validation:"cidr",code:X.invalid_string,message:o.message}),s.dirty()):o.kind==="base64"?L_.test(n.data)||(u=this._getOrReturnCtx(n,u),ae(u,{validation:"base64",code:X.invalid_string,message:o.message}),s.dirty()):o.kind==="base64url"?B_.test(n.data)||(u=this._getOrReturnCtx(n,u),ae(u,{validation:"base64url",code:X.invalid_string,message:o.message}),s.dirty()):qe.assertNever(o);return{status:s.value,value:n.data}}_regex(n,a,s){return this.refinement(u=>n.test(u),{validation:a,code:X.invalid_string,...he.errToObj(s)})}_addCheck(n){return new si({...this._def,checks:[...this._def.checks,n]})}email(n){return this._addCheck({kind:"email",...he.errToObj(n)})}url(n){return this._addCheck({kind:"url",...he.errToObj(n)})}emoji(n){return this._addCheck({kind:"emoji",...he.errToObj(n)})}uuid(n){return this._addCheck({kind:"uuid",...he.errToObj(n)})}nanoid(n){return this._addCheck({kind:"nanoid",...he.errToObj(n)})}cuid(n){return this._addCheck({kind:"cuid",...he.errToObj(n)})}cuid2(n){return this._addCheck({kind:"cuid2",...he.errToObj(n)})}ulid(n){return this._addCheck({kind:"ulid",...he.errToObj(n)})}base64(n){return this._addCheck({kind:"base64",...he.errToObj(n)})}base64url(n){return this._addCheck({kind:"base64url",...he.errToObj(n)})}jwt(n){return this._addCheck({kind:"jwt",...he.errToObj(n)})}ip(n){return this._addCheck({kind:"ip",...he.errToObj(n)})}cidr(n){return this._addCheck({kind:"cidr",...he.errToObj(n)})}datetime(n){return typeof n=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:n}):this._addCheck({kind:"datetime",precision:typeof(n==null?void 0:n.precision)>"u"?null:n==null?void 0:n.precision,offset:(n==null?void 0:n.offset)??!1,local:(n==null?void 0:n.local)??!1,...he.errToObj(n==null?void 0:n.message)})}date(n){return this._addCheck({kind:"date",message:n})}time(n){return typeof n=="string"?this._addCheck({kind:"time",precision:null,message:n}):this._addCheck({kind:"time",precision:typeof(n==null?void 0:n.precision)>"u"?null:n==null?void 0:n.precision,...he.errToObj(n==null?void 0:n.message)})}duration(n){return this._addCheck({kind:"duration",...he.errToObj(n)})}regex(n,a){return this._addCheck({kind:"regex",regex:n,...he.errToObj(a)})}includes(n,a){return this._addCheck({kind:"includes",value:n,position:a==null?void 0:a.position,...he.errToObj(a==null?void 0:a.message)})}startsWith(n,a){return this._addCheck({kind:"startsWith",value:n,...he.errToObj(a)})}endsWith(n,a){return this._addCheck({kind:"endsWith",value:n,...he.errToObj(a)})}min(n,a){return this._addCheck({kind:"min",value:n,...he.errToObj(a)})}max(n,a){return this._addCheck({kind:"max",value:n,...he.errToObj(a)})}length(n,a){return this._addCheck({kind:"length",value:n,...he.errToObj(a)})}nonempty(n){return this.min(1,he.errToObj(n))}trim(){return new si({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new si({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new si({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(n=>n.kind==="datetime")}get isDate(){return!!this._def.checks.find(n=>n.kind==="date")}get isTime(){return!!this._def.checks.find(n=>n.kind==="time")}get isDuration(){return!!this._def.checks.find(n=>n.kind==="duration")}get isEmail(){return!!this._def.checks.find(n=>n.kind==="email")}get isURL(){return!!this._def.checks.find(n=>n.kind==="url")}get isEmoji(){return!!this._def.checks.find(n=>n.kind==="emoji")}get isUUID(){return!!this._def.checks.find(n=>n.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(n=>n.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(n=>n.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(n=>n.kind==="cuid2")}get isULID(){return!!this._def.checks.find(n=>n.kind==="ulid")}get isIP(){return!!this._def.checks.find(n=>n.kind==="ip")}get isCIDR(){return!!this._def.checks.find(n=>n.kind==="cidr")}get isBase64(){return!!this._def.checks.find(n=>n.kind==="base64")}get isBase64url(){return!!this._def.checks.find(n=>n.kind==="base64url")}get minLength(){let n=null;for(const a of this._def.checks)a.kind==="min"&&(n===null||a.value>n)&&(n=a.value);return n}get maxLength(){let n=null;for(const a of this._def.checks)a.kind==="max"&&(n===null||a.value<n)&&(n=a.value);return n}}si.create=i=>new si({checks:[],typeName:_e.ZodString,coerce:(i==null?void 0:i.coerce)??!1,...Ne(i)});function G_(i,n){const a=(i.toString().split(".")[1]||"").length,s=(n.toString().split(".")[1]||"").length,u=a>s?a:s,o=Number.parseInt(i.toFixed(u).replace(".","")),f=Number.parseInt(n.toFixed(u).replace(".",""));return o%f/10**u}class Sl extends Re{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(n){if(this._def.coerce&&(n.data=Number(n.data)),this._getType(n)!==ue.number){const o=this._getOrReturnCtx(n);return ae(o,{code:X.invalid_type,expected:ue.number,received:o.parsedType}),Se}let s;const u=new zt;for(const o of this._def.checks)o.kind==="int"?qe.isInteger(n.data)||(s=this._getOrReturnCtx(n,s),ae(s,{code:X.invalid_type,expected:"integer",received:"float",message:o.message}),u.dirty()):o.kind==="min"?(o.inclusive?n.data<o.value:n.data<=o.value)&&(s=this._getOrReturnCtx(n,s),ae(s,{code:X.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),u.dirty()):o.kind==="max"?(o.inclusive?n.data>o.value:n.data>=o.value)&&(s=this._getOrReturnCtx(n,s),ae(s,{code:X.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),u.dirty()):o.kind==="multipleOf"?G_(n.data,o.value)!==0&&(s=this._getOrReturnCtx(n,s),ae(s,{code:X.not_multiple_of,multipleOf:o.value,message:o.message}),u.dirty()):o.kind==="finite"?Number.isFinite(n.data)||(s=this._getOrReturnCtx(n,s),ae(s,{code:X.not_finite,message:o.message}),u.dirty()):qe.assertNever(o);return{status:u.value,value:n.data}}gte(n,a){return this.setLimit("min",n,!0,he.toString(a))}gt(n,a){return this.setLimit("min",n,!1,he.toString(a))}lte(n,a){return this.setLimit("max",n,!0,he.toString(a))}lt(n,a){return this.setLimit("max",n,!1,he.toString(a))}setLimit(n,a,s,u){return new Sl({...this._def,checks:[...this._def.checks,{kind:n,value:a,inclusive:s,message:he.toString(u)}]})}_addCheck(n){return new Sl({...this._def,checks:[...this._def.checks,n]})}int(n){return this._addCheck({kind:"int",message:he.toString(n)})}positive(n){return this._addCheck({kind:"min",value:0,inclusive:!1,message:he.toString(n)})}negative(n){return this._addCheck({kind:"max",value:0,inclusive:!1,message:he.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:0,inclusive:!0,message:he.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:0,inclusive:!0,message:he.toString(n)})}multipleOf(n,a){return this._addCheck({kind:"multipleOf",value:n,message:he.toString(a)})}finite(n){return this._addCheck({kind:"finite",message:he.toString(n)})}safe(n){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:he.toString(n)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:he.toString(n)})}get minValue(){let n=null;for(const a of this._def.checks)a.kind==="min"&&(n===null||a.value>n)&&(n=a.value);return n}get maxValue(){let n=null;for(const a of this._def.checks)a.kind==="max"&&(n===null||a.value<n)&&(n=a.value);return n}get isInt(){return!!this._def.checks.find(n=>n.kind==="int"||n.kind==="multipleOf"&&qe.isInteger(n.value))}get isFinite(){let n=null,a=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(a===null||s.value>a)&&(a=s.value):s.kind==="max"&&(n===null||s.value<n)&&(n=s.value)}return Number.isFinite(a)&&Number.isFinite(n)}}Sl.create=i=>new Sl({checks:[],typeName:_e.ZodNumber,coerce:(i==null?void 0:i.coerce)||!1,...Ne(i)});class Rs extends Re{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(n){if(this._def.coerce)try{n.data=BigInt(n.data)}catch{return this._getInvalidInput(n)}if(this._getType(n)!==ue.bigint)return this._getInvalidInput(n);let s;const u=new zt;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?n.data<o.value:n.data<=o.value)&&(s=this._getOrReturnCtx(n,s),ae(s,{code:X.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),u.dirty()):o.kind==="max"?(o.inclusive?n.data>o.value:n.data>=o.value)&&(s=this._getOrReturnCtx(n,s),ae(s,{code:X.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),u.dirty()):o.kind==="multipleOf"?n.data%o.value!==BigInt(0)&&(s=this._getOrReturnCtx(n,s),ae(s,{code:X.not_multiple_of,multipleOf:o.value,message:o.message}),u.dirty()):qe.assertNever(o);return{status:u.value,value:n.data}}_getInvalidInput(n){const a=this._getOrReturnCtx(n);return ae(a,{code:X.invalid_type,expected:ue.bigint,received:a.parsedType}),Se}gte(n,a){return this.setLimit("min",n,!0,he.toString(a))}gt(n,a){return this.setLimit("min",n,!1,he.toString(a))}lte(n,a){return this.setLimit("max",n,!0,he.toString(a))}lt(n,a){return this.setLimit("max",n,!1,he.toString(a))}setLimit(n,a,s,u){return new Rs({...this._def,checks:[...this._def.checks,{kind:n,value:a,inclusive:s,message:he.toString(u)}]})}_addCheck(n){return new Rs({...this._def,checks:[...this._def.checks,n]})}positive(n){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:he.toString(n)})}negative(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:he.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:he.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:he.toString(n)})}multipleOf(n,a){return this._addCheck({kind:"multipleOf",value:n,message:he.toString(a)})}get minValue(){let n=null;for(const a of this._def.checks)a.kind==="min"&&(n===null||a.value>n)&&(n=a.value);return n}get maxValue(){let n=null;for(const a of this._def.checks)a.kind==="max"&&(n===null||a.value<n)&&(n=a.value);return n}}Rs.create=i=>new Rs({checks:[],typeName:_e.ZodBigInt,coerce:(i==null?void 0:i.coerce)??!1,...Ne(i)});class $f extends Re{_parse(n){if(this._def.coerce&&(n.data=!!n.data),this._getType(n)!==ue.boolean){const s=this._getOrReturnCtx(n);return ae(s,{code:X.invalid_type,expected:ue.boolean,received:s.parsedType}),Se}return yn(n.data)}}$f.create=i=>new $f({typeName:_e.ZodBoolean,coerce:(i==null?void 0:i.coerce)||!1,...Ne(i)});class _u extends Re{_parse(n){if(this._def.coerce&&(n.data=new Date(n.data)),this._getType(n)!==ue.date){const o=this._getOrReturnCtx(n);return ae(o,{code:X.invalid_type,expected:ue.date,received:o.parsedType}),Se}if(Number.isNaN(n.data.getTime())){const o=this._getOrReturnCtx(n);return ae(o,{code:X.invalid_date}),Se}const s=new zt;let u;for(const o of this._def.checks)o.kind==="min"?n.data.getTime()<o.value&&(u=this._getOrReturnCtx(n,u),ae(u,{code:X.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),s.dirty()):o.kind==="max"?n.data.getTime()>o.value&&(u=this._getOrReturnCtx(n,u),ae(u,{code:X.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),s.dirty()):qe.assertNever(o);return{status:s.value,value:new Date(n.data.getTime())}}_addCheck(n){return new _u({...this._def,checks:[...this._def.checks,n]})}min(n,a){return this._addCheck({kind:"min",value:n.getTime(),message:he.toString(a)})}max(n,a){return this._addCheck({kind:"max",value:n.getTime(),message:he.toString(a)})}get minDate(){let n=null;for(const a of this._def.checks)a.kind==="min"&&(n===null||a.value>n)&&(n=a.value);return n!=null?new Date(n):null}get maxDate(){let n=null;for(const a of this._def.checks)a.kind==="max"&&(n===null||a.value<n)&&(n=a.value);return n!=null?new Date(n):null}}_u.create=i=>new _u({checks:[],coerce:(i==null?void 0:i.coerce)||!1,typeName:_e.ZodDate,...Ne(i)});class ug extends Re{_parse(n){if(this._getType(n)!==ue.symbol){const s=this._getOrReturnCtx(n);return ae(s,{code:X.invalid_type,expected:ue.symbol,received:s.parsedType}),Se}return yn(n.data)}}ug.create=i=>new ug({typeName:_e.ZodSymbol,...Ne(i)});class Xf extends Re{_parse(n){if(this._getType(n)!==ue.undefined){const s=this._getOrReturnCtx(n);return ae(s,{code:X.invalid_type,expected:ue.undefined,received:s.parsedType}),Se}return yn(n.data)}}Xf.create=i=>new Xf({typeName:_e.ZodUndefined,...Ne(i)});class Jf extends Re{_parse(n){if(this._getType(n)!==ue.null){const s=this._getOrReturnCtx(n);return ae(s,{code:X.invalid_type,expected:ue.null,received:s.parsedType}),Se}return yn(n.data)}}Jf.create=i=>new Jf({typeName:_e.ZodNull,...Ne(i)});class og extends Re{constructor(){super(...arguments),this._any=!0}_parse(n){return yn(n.data)}}og.create=i=>new og({typeName:_e.ZodAny,...Ne(i)});class Ff extends Re{constructor(){super(...arguments),this._unknown=!0}_parse(n){return yn(n.data)}}Ff.create=i=>new Ff({typeName:_e.ZodUnknown,...Ne(i)});class Yi extends Re{_parse(n){const a=this._getOrReturnCtx(n);return ae(a,{code:X.invalid_type,expected:ue.never,received:a.parsedType}),Se}}Yi.create=i=>new Yi({typeName:_e.ZodNever,...Ne(i)});class cg extends Re{_parse(n){if(this._getType(n)!==ue.undefined){const s=this._getOrReturnCtx(n);return ae(s,{code:X.invalid_type,expected:ue.void,received:s.parsedType}),Se}return yn(n.data)}}cg.create=i=>new cg({typeName:_e.ZodVoid,...Ne(i)});class jn extends Re{_parse(n){const{ctx:a,status:s}=this._processInputParams(n),u=this._def;if(a.parsedType!==ue.array)return ae(a,{code:X.invalid_type,expected:ue.array,received:a.parsedType}),Se;if(u.exactLength!==null){const f=a.data.length>u.exactLength.value,h=a.data.length<u.exactLength.value;(f||h)&&(ae(a,{code:f?X.too_big:X.too_small,minimum:h?u.exactLength.value:void 0,maximum:f?u.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:u.exactLength.message}),s.dirty())}if(u.minLength!==null&&a.data.length<u.minLength.value&&(ae(a,{code:X.too_small,minimum:u.minLength.value,type:"array",inclusive:!0,exact:!1,message:u.minLength.message}),s.dirty()),u.maxLength!==null&&a.data.length>u.maxLength.value&&(ae(a,{code:X.too_big,maximum:u.maxLength.value,type:"array",inclusive:!0,exact:!1,message:u.maxLength.message}),s.dirty()),a.common.async)return Promise.all([...a.data].map((f,h)=>u.type._parseAsync(new zn(a,f,a.path,h)))).then(f=>zt.mergeArray(s,f));const o=[...a.data].map((f,h)=>u.type._parseSync(new zn(a,f,a.path,h)));return zt.mergeArray(s,o)}get element(){return this._def.type}min(n,a){return new jn({...this._def,minLength:{value:n,message:he.toString(a)}})}max(n,a){return new jn({...this._def,maxLength:{value:n,message:he.toString(a)}})}length(n,a){return new jn({...this._def,exactLength:{value:n,message:he.toString(a)}})}nonempty(n){return this.min(1,n)}}jn.create=(i,n)=>new jn({type:i,minLength:null,maxLength:null,exactLength:null,typeName:_e.ZodArray,...Ne(n)});function fl(i){if(i instanceof mt){const n={};for(const a in i.shape){const s=i.shape[a];n[a]=ui.create(fl(s))}return new mt({...i._def,shape:()=>n})}else return i instanceof jn?new jn({...i._def,type:fl(i.element)}):i instanceof ui?ui.create(fl(i.unwrap())):i instanceof pa?pa.create(fl(i.unwrap())):i instanceof ha?ha.create(i.items.map(n=>fl(n))):i}class mt extends Re{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const n=this._def.shape(),a=qe.objectKeys(n);return this._cached={shape:n,keys:a},this._cached}_parse(n){if(this._getType(n)!==ue.object){const m=this._getOrReturnCtx(n);return ae(m,{code:X.invalid_type,expected:ue.object,received:m.parsedType}),Se}const{status:s,ctx:u}=this._processInputParams(n),{shape:o,keys:f}=this._getCached(),h=[];if(!(this._def.catchall instanceof Yi&&this._def.unknownKeys==="strip"))for(const m in u.data)f.includes(m)||h.push(m);const p=[];for(const m of f){const b=o[m],g=u.data[m];p.push({key:{status:"valid",value:m},value:b._parse(new zn(u,g,u.path,m)),alwaysSet:m in u.data})}if(this._def.catchall instanceof Yi){const m=this._def.unknownKeys;if(m==="passthrough")for(const b of h)p.push({key:{status:"valid",value:b},value:{status:"valid",value:u.data[b]}});else if(m==="strict")h.length>0&&(ae(u,{code:X.unrecognized_keys,keys:h}),s.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const m=this._def.catchall;for(const b of h){const g=u.data[b];p.push({key:{status:"valid",value:b},value:m._parse(new zn(u,g,u.path,b)),alwaysSet:b in u.data})}}return u.common.async?Promise.resolve().then(async()=>{const m=[];for(const b of p){const g=await b.key,_=await b.value;m.push({key:g,value:_,alwaysSet:b.alwaysSet})}return m}).then(m=>zt.mergeObjectSync(s,m)):zt.mergeObjectSync(s,p)}get shape(){return this._def.shape()}strict(n){return he.errToObj,new mt({...this._def,unknownKeys:"strict",...n!==void 0?{errorMap:(a,s)=>{var o,f;const u=((f=(o=this._def).errorMap)==null?void 0:f.call(o,a,s).message)??s.defaultError;return a.code==="unrecognized_keys"?{message:he.errToObj(n).message??u}:{message:u}}}:{}})}strip(){return new mt({...this._def,unknownKeys:"strip"})}passthrough(){return new mt({...this._def,unknownKeys:"passthrough"})}extend(n){return new mt({...this._def,shape:()=>({...this._def.shape(),...n})})}merge(n){return new mt({unknownKeys:n._def.unknownKeys,catchall:n._def.catchall,shape:()=>({...this._def.shape(),...n._def.shape()}),typeName:_e.ZodObject})}setKey(n,a){return this.augment({[n]:a})}catchall(n){return new mt({...this._def,catchall:n})}pick(n){const a={};for(const s of qe.objectKeys(n))n[s]&&this.shape[s]&&(a[s]=this.shape[s]);return new mt({...this._def,shape:()=>a})}omit(n){const a={};for(const s of qe.objectKeys(this.shape))n[s]||(a[s]=this.shape[s]);return new mt({...this._def,shape:()=>a})}deepPartial(){return fl(this)}partial(n){const a={};for(const s of qe.objectKeys(this.shape)){const u=this.shape[s];n&&!n[s]?a[s]=u:a[s]=u.optional()}return new mt({...this._def,shape:()=>a})}required(n){const a={};for(const s of qe.objectKeys(this.shape))if(n&&!n[s])a[s]=this.shape[s];else{let o=this.shape[s];for(;o instanceof ui;)o=o._def.innerType;a[s]=o}return new mt({...this._def,shape:()=>a})}keyof(){return Pg(qe.objectKeys(this.shape))}}mt.create=(i,n)=>new mt({shape:()=>i,unknownKeys:"strip",catchall:Yi.create(),typeName:_e.ZodObject,...Ne(n)});mt.strictCreate=(i,n)=>new mt({shape:()=>i,unknownKeys:"strict",catchall:Yi.create(),typeName:_e.ZodObject,...Ne(n)});mt.lazycreate=(i,n)=>new mt({shape:i,unknownKeys:"strip",catchall:Yi.create(),typeName:_e.ZodObject,...Ne(n)});class ku extends Re{_parse(n){const{ctx:a}=this._processInputParams(n),s=this._def.options;function u(o){for(const h of o)if(h.result.status==="valid")return h.result;for(const h of o)if(h.result.status==="dirty")return a.common.issues.push(...h.ctx.common.issues),h.result;const f=o.map(h=>new ci(h.ctx.common.issues));return ae(a,{code:X.invalid_union,unionErrors:f}),Se}if(a.common.async)return Promise.all(s.map(async o=>{const f={...a,common:{...a.common,issues:[]},parent:null};return{result:await o._parseAsync({data:a.data,path:a.path,parent:f}),ctx:f}})).then(u);{let o;const f=[];for(const p of s){const m={...a,common:{...a.common,issues:[]},parent:null},b=p._parseSync({data:a.data,path:a.path,parent:m});if(b.status==="valid")return b;b.status==="dirty"&&!o&&(o={result:b,ctx:m}),m.common.issues.length&&f.push(m.common.issues)}if(o)return a.common.issues.push(...o.ctx.common.issues),o.result;const h=f.map(p=>new ci(p));return ae(a,{code:X.invalid_union,unionErrors:h}),Se}}get options(){return this._def.options}}ku.create=(i,n)=>new ku({options:i,typeName:_e.ZodUnion,...Ne(n)});const li=i=>i instanceof Pf?li(i.schema):i instanceof Vi?li(i.innerType()):i instanceof Tu?[i.value]:i instanceof ma?i.options:i instanceof ed?qe.objectValues(i.enum):i instanceof Nu?li(i._def.innerType):i instanceof Xf?[void 0]:i instanceof Jf?[null]:i instanceof ui?[void 0,...li(i.unwrap())]:i instanceof pa?[null,...li(i.unwrap())]:i instanceof eb||i instanceof Ou?li(i.unwrap()):i instanceof Cu?li(i._def.innerType):[];class dd extends Re{_parse(n){const{ctx:a}=this._processInputParams(n);if(a.parsedType!==ue.object)return ae(a,{code:X.invalid_type,expected:ue.object,received:a.parsedType}),Se;const s=this.discriminator,u=a.data[s],o=this.optionsMap.get(u);return o?a.common.async?o._parseAsync({data:a.data,path:a.path,parent:a}):o._parseSync({data:a.data,path:a.path,parent:a}):(ae(a,{code:X.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),Se)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(n,a,s){const u=new Map;for(const o of a){const f=li(o.shape[n]);if(!f.length)throw new Error(`A discriminator value for key \`${n}\` could not be extracted from all schema options`);for(const h of f){if(u.has(h))throw new Error(`Discriminator property ${String(n)} has duplicate value ${String(h)}`);u.set(h,o)}}return new dd({typeName:_e.ZodDiscriminatedUnion,discriminator:n,options:a,optionsMap:u,...Ne(s)})}}function Wf(i,n){const a=qi(i),s=qi(n);if(i===n)return{valid:!0,data:i};if(a===ue.object&&s===ue.object){const u=qe.objectKeys(n),o=qe.objectKeys(i).filter(h=>u.indexOf(h)!==-1),f={...i,...n};for(const h of o){const p=Wf(i[h],n[h]);if(!p.valid)return{valid:!1};f[h]=p.data}return{valid:!0,data:f}}else if(a===ue.array&&s===ue.array){if(i.length!==n.length)return{valid:!1};const u=[];for(let o=0;o<i.length;o++){const f=i[o],h=n[o],p=Wf(f,h);if(!p.valid)return{valid:!1};u.push(p.data)}return{valid:!0,data:u}}else return a===ue.date&&s===ue.date&&+i==+n?{valid:!0,data:i}:{valid:!1}}class wu extends Re{_parse(n){const{status:a,ctx:s}=this._processInputParams(n),u=(o,f)=>{if(lg(o)||lg(f))return Se;const h=Wf(o.value,f.value);return h.valid?((sg(o)||sg(f))&&a.dirty(),{status:a.value,value:h.data}):(ae(s,{code:X.invalid_intersection_types}),Se)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([o,f])=>u(o,f)):u(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}wu.create=(i,n,a)=>new wu({left:i,right:n,typeName:_e.ZodIntersection,...Ne(a)});class ha extends Re{_parse(n){const{status:a,ctx:s}=this._processInputParams(n);if(s.parsedType!==ue.array)return ae(s,{code:X.invalid_type,expected:ue.array,received:s.parsedType}),Se;if(s.data.length<this._def.items.length)return ae(s,{code:X.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Se;!this._def.rest&&s.data.length>this._def.items.length&&(ae(s,{code:X.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),a.dirty());const o=[...s.data].map((f,h)=>{const p=this._def.items[h]||this._def.rest;return p?p._parse(new zn(s,f,s.path,h)):null}).filter(f=>!!f);return s.common.async?Promise.all(o).then(f=>zt.mergeArray(a,f)):zt.mergeArray(a,o)}get items(){return this._def.items}rest(n){return new ha({...this._def,rest:n})}}ha.create=(i,n)=>{if(!Array.isArray(i))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ha({items:i,typeName:_e.ZodTuple,rest:null,...Ne(n)})};class Au extends Re{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(n){const{status:a,ctx:s}=this._processInputParams(n);if(s.parsedType!==ue.object)return ae(s,{code:X.invalid_type,expected:ue.object,received:s.parsedType}),Se;const u=[],o=this._def.keyType,f=this._def.valueType;for(const h in s.data)u.push({key:o._parse(new zn(s,h,s.path,h)),value:f._parse(new zn(s,s.data[h],s.path,h)),alwaysSet:h in s.data});return s.common.async?zt.mergeObjectAsync(a,u):zt.mergeObjectSync(a,u)}get element(){return this._def.valueType}static create(n,a,s){return a instanceof Re?new Au({keyType:n,valueType:a,typeName:_e.ZodRecord,...Ne(s)}):new Au({keyType:si.create(),valueType:n,typeName:_e.ZodRecord,...Ne(a)})}}class fg extends Re{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(n){const{status:a,ctx:s}=this._processInputParams(n);if(s.parsedType!==ue.map)return ae(s,{code:X.invalid_type,expected:ue.map,received:s.parsedType}),Se;const u=this._def.keyType,o=this._def.valueType,f=[...s.data.entries()].map(([h,p],m)=>({key:u._parse(new zn(s,h,s.path,[m,"key"])),value:o._parse(new zn(s,p,s.path,[m,"value"]))}));if(s.common.async){const h=new Map;return Promise.resolve().then(async()=>{for(const p of f){const m=await p.key,b=await p.value;if(m.status==="aborted"||b.status==="aborted")return Se;(m.status==="dirty"||b.status==="dirty")&&a.dirty(),h.set(m.value,b.value)}return{status:a.value,value:h}})}else{const h=new Map;for(const p of f){const m=p.key,b=p.value;if(m.status==="aborted"||b.status==="aborted")return Se;(m.status==="dirty"||b.status==="dirty")&&a.dirty(),h.set(m.value,b.value)}return{status:a.value,value:h}}}}fg.create=(i,n,a)=>new fg({valueType:n,keyType:i,typeName:_e.ZodMap,...Ne(a)});class Ls extends Re{_parse(n){const{status:a,ctx:s}=this._processInputParams(n);if(s.parsedType!==ue.set)return ae(s,{code:X.invalid_type,expected:ue.set,received:s.parsedType}),Se;const u=this._def;u.minSize!==null&&s.data.size<u.minSize.value&&(ae(s,{code:X.too_small,minimum:u.minSize.value,type:"set",inclusive:!0,exact:!1,message:u.minSize.message}),a.dirty()),u.maxSize!==null&&s.data.size>u.maxSize.value&&(ae(s,{code:X.too_big,maximum:u.maxSize.value,type:"set",inclusive:!0,exact:!1,message:u.maxSize.message}),a.dirty());const o=this._def.valueType;function f(p){const m=new Set;for(const b of p){if(b.status==="aborted")return Se;b.status==="dirty"&&a.dirty(),m.add(b.value)}return{status:a.value,value:m}}const h=[...s.data.values()].map((p,m)=>o._parse(new zn(s,p,s.path,m)));return s.common.async?Promise.all(h).then(p=>f(p)):f(h)}min(n,a){return new Ls({...this._def,minSize:{value:n,message:he.toString(a)}})}max(n,a){return new Ls({...this._def,maxSize:{value:n,message:he.toString(a)}})}size(n,a){return this.min(n,a).max(n,a)}nonempty(n){return this.min(1,n)}}Ls.create=(i,n)=>new Ls({valueType:i,minSize:null,maxSize:null,typeName:_e.ZodSet,...Ne(n)});class Pf extends Re{get schema(){return this._def.getter()}_parse(n){const{ctx:a}=this._processInputParams(n);return this._def.getter()._parse({data:a.data,path:a.path,parent:a})}}Pf.create=(i,n)=>new Pf({getter:i,typeName:_e.ZodLazy,...Ne(n)});class Tu extends Re{_parse(n){if(n.data!==this._def.value){const a=this._getOrReturnCtx(n);return ae(a,{received:a.data,code:X.invalid_literal,expected:this._def.value}),Se}return{status:"valid",value:n.data}}get value(){return this._def.value}}Tu.create=(i,n)=>new Tu({value:i,typeName:_e.ZodLiteral,...Ne(n)});function Pg(i,n){return new ma({values:i,typeName:_e.ZodEnum,...Ne(n)})}class ma extends Re{_parse(n){if(typeof n.data!="string"){const a=this._getOrReturnCtx(n),s=this._def.values;return ae(a,{expected:qe.joinValues(s),received:a.parsedType,code:X.invalid_type}),Se}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(n.data)){const a=this._getOrReturnCtx(n),s=this._def.values;return ae(a,{received:a.data,code:X.invalid_enum_value,options:s}),Se}return yn(n.data)}get options(){return this._def.values}get enum(){const n={};for(const a of this._def.values)n[a]=a;return n}get Values(){const n={};for(const a of this._def.values)n[a]=a;return n}get Enum(){const n={};for(const a of this._def.values)n[a]=a;return n}extract(n,a=this._def){return ma.create(n,{...this._def,...a})}exclude(n,a=this._def){return ma.create(this.options.filter(s=>!n.includes(s)),{...this._def,...a})}}ma.create=Pg;class ed extends Re{_parse(n){const a=qe.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(n);if(s.parsedType!==ue.string&&s.parsedType!==ue.number){const u=qe.objectValues(a);return ae(s,{expected:qe.joinValues(u),received:s.parsedType,code:X.invalid_type}),Se}if(this._cache||(this._cache=new Set(qe.getValidEnumValues(this._def.values))),!this._cache.has(n.data)){const u=qe.objectValues(a);return ae(s,{received:s.data,code:X.invalid_enum_value,options:u}),Se}return yn(n.data)}get enum(){return this._def.values}}ed.create=(i,n)=>new ed({values:i,typeName:_e.ZodNativeEnum,...Ne(n)});class Eu extends Re{unwrap(){return this._def.type}_parse(n){const{ctx:a}=this._processInputParams(n);if(a.parsedType!==ue.promise&&a.common.async===!1)return ae(a,{code:X.invalid_type,expected:ue.promise,received:a.parsedType}),Se;const s=a.parsedType===ue.promise?a.data:Promise.resolve(a.data);return yn(s.then(u=>this._def.type.parseAsync(u,{path:a.path,errorMap:a.common.contextualErrorMap})))}}Eu.create=(i,n)=>new Eu({type:i,typeName:_e.ZodPromise,...Ne(n)});class Vi extends Re{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_e.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(n){const{status:a,ctx:s}=this._processInputParams(n),u=this._def.effect||null,o={addIssue:f=>{ae(s,f),f.fatal?a.abort():a.dirty()},get path(){return s.path}};if(o.addIssue=o.addIssue.bind(o),u.type==="preprocess"){const f=u.transform(s.data,o);if(s.common.async)return Promise.resolve(f).then(async h=>{if(a.value==="aborted")return Se;const p=await this._def.schema._parseAsync({data:h,path:s.path,parent:s});return p.status==="aborted"?Se:p.status==="dirty"||a.value==="dirty"?Es(p.value):p});{if(a.value==="aborted")return Se;const h=this._def.schema._parseSync({data:f,path:s.path,parent:s});return h.status==="aborted"?Se:h.status==="dirty"||a.value==="dirty"?Es(h.value):h}}if(u.type==="refinement"){const f=h=>{const p=u.refinement(h,o);if(s.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return h};if(s.common.async===!1){const h=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return h.status==="aborted"?Se:(h.status==="dirty"&&a.dirty(),f(h.value),{status:a.value,value:h.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(h=>h.status==="aborted"?Se:(h.status==="dirty"&&a.dirty(),f(h.value).then(()=>({status:a.value,value:h.value}))))}if(u.type==="transform")if(s.common.async===!1){const f=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!xl(f))return Se;const h=u.transform(f.value,o);if(h instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:a.value,value:h}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(f=>xl(f)?Promise.resolve(u.transform(f.value,o)).then(h=>({status:a.value,value:h})):Se);qe.assertNever(u)}}Vi.create=(i,n,a)=>new Vi({schema:i,typeName:_e.ZodEffects,effect:n,...Ne(a)});Vi.createWithPreprocess=(i,n,a)=>new Vi({schema:n,effect:{type:"preprocess",transform:i},typeName:_e.ZodEffects,...Ne(a)});class ui extends Re{_parse(n){return this._getType(n)===ue.undefined?yn(void 0):this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}ui.create=(i,n)=>new ui({innerType:i,typeName:_e.ZodOptional,...Ne(n)});class pa extends Re{_parse(n){return this._getType(n)===ue.null?yn(null):this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}pa.create=(i,n)=>new pa({innerType:i,typeName:_e.ZodNullable,...Ne(n)});class Nu extends Re{_parse(n){const{ctx:a}=this._processInputParams(n);let s=a.data;return a.parsedType===ue.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:a.path,parent:a})}removeDefault(){return this._def.innerType}}Nu.create=(i,n)=>new Nu({innerType:i,typeName:_e.ZodDefault,defaultValue:typeof n.default=="function"?n.default:()=>n.default,...Ne(n)});class Cu extends Re{_parse(n){const{ctx:a}=this._processInputParams(n),s={...a,common:{...a.common,issues:[]}},u=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return Su(u)?u.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new ci(s.common.issues)},input:s.data})})):{status:"valid",value:u.status==="valid"?u.value:this._def.catchValue({get error(){return new ci(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}Cu.create=(i,n)=>new Cu({innerType:i,typeName:_e.ZodCatch,catchValue:typeof n.catch=="function"?n.catch:()=>n.catch,...Ne(n)});class dg extends Re{_parse(n){if(this._getType(n)!==ue.nan){const s=this._getOrReturnCtx(n);return ae(s,{code:X.invalid_type,expected:ue.nan,received:s.parsedType}),Se}return{status:"valid",value:n.data}}}dg.create=i=>new dg({typeName:_e.ZodNaN,...Ne(i)});class eb extends Re{_parse(n){const{ctx:a}=this._processInputParams(n),s=a.data;return this._def.type._parse({data:s,path:a.path,parent:a})}unwrap(){return this._def.type}}class hd extends Re{_parse(n){const{status:a,ctx:s}=this._processInputParams(n);if(s.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return o.status==="aborted"?Se:o.status==="dirty"?(a.dirty(),Es(o.value)):this._def.out._parseAsync({data:o.value,path:s.path,parent:s})})();{const u=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return u.status==="aborted"?Se:u.status==="dirty"?(a.dirty(),{status:"dirty",value:u.value}):this._def.out._parseSync({data:u.value,path:s.path,parent:s})}}static create(n,a){return new hd({in:n,out:a,typeName:_e.ZodPipeline})}}class Ou extends Re{_parse(n){const a=this._def.innerType._parse(n),s=u=>(xl(u)&&(u.value=Object.freeze(u.value)),u);return Su(a)?a.then(u=>s(u)):s(a)}unwrap(){return this._def.innerType}}Ou.create=(i,n)=>new Ou({innerType:i,typeName:_e.ZodReadonly,...Ne(n)});var _e;(function(i){i.ZodString="ZodString",i.ZodNumber="ZodNumber",i.ZodNaN="ZodNaN",i.ZodBigInt="ZodBigInt",i.ZodBoolean="ZodBoolean",i.ZodDate="ZodDate",i.ZodSymbol="ZodSymbol",i.ZodUndefined="ZodUndefined",i.ZodNull="ZodNull",i.ZodAny="ZodAny",i.ZodUnknown="ZodUnknown",i.ZodNever="ZodNever",i.ZodVoid="ZodVoid",i.ZodArray="ZodArray",i.ZodObject="ZodObject",i.ZodUnion="ZodUnion",i.ZodDiscriminatedUnion="ZodDiscriminatedUnion",i.ZodIntersection="ZodIntersection",i.ZodTuple="ZodTuple",i.ZodRecord="ZodRecord",i.ZodMap="ZodMap",i.ZodSet="ZodSet",i.ZodFunction="ZodFunction",i.ZodLazy="ZodLazy",i.ZodLiteral="ZodLiteral",i.ZodEnum="ZodEnum",i.ZodEffects="ZodEffects",i.ZodNativeEnum="ZodNativeEnum",i.ZodOptional="ZodOptional",i.ZodNullable="ZodNullable",i.ZodDefault="ZodDefault",i.ZodCatch="ZodCatch",i.ZodPromise="ZodPromise",i.ZodBranded="ZodBranded",i.ZodPipeline="ZodPipeline",i.ZodReadonly="ZodReadonly"})(_e||(_e={}));const se=si.create,ya=Sl.create,bt=$f.create,Hs=Ff.create;Yi.create;const St=jn.create,jt=mt.create,ga=ku.create,K_=dd.create;wu.create;ha.create;const Bs=Au.create,Ln=Tu.create,Bn=ma.create;Eu.create;ui.create;pa.create;const tb=Vi.createWithPreprocess,ba=se().regex(/^\{\{.+\}\}$/s,"Binding must be wrapped in {{ }}");function hg(i){return ga([i,ba])}const fi=jt({id:se().min(1).describe("Unique component identifier within the document"),type:se().min(1).describe("Component type name"),label:se().optional(),sensitive:bt().default(!1).describe("If true, values are redacted in logs"),disabled:hg(bt()).default(!1),visible:hg(bt()).default(!0),meta:Bs(Hs()).optional()}),Z_=jt({name:se().min(1),type:Bn(["text","number","email","date","select","checkbox","textarea"]),label:se(),required:bt().default(!1),sensitive:bt().default(!1),defaultValue:Hs().optional(),options:tb(i=>Array.isArray(i)?i.map(n=>typeof n=="string"?{label:n,value:n}:n):i,ga([St(jt({label:se(),value:se()})),se().min(1)]).optional()),validation:jt({pattern:se().optional(),min:ya().optional(),max:ya().optional(),message:se().optional()}).optional(),bind:ba.optional()}),Mu=fi.extend({type:Ln("form"),fields:St(Z_).min(1),onSubmit:se().optional().describe("Action ID to trigger on submit")}),ju=fi.extend({type:Ln("button"),text:se().min(1),variant:Bn(["primary","secondary","danger","ghost"]).default("primary"),onAction:se().describe("Action ID to trigger on click").optional(),confirm:jt({title:se(),message:se(),confirmText:se().default("Confirm"),cancelText:se().default("Cancel")}).optional()}),Q_=jt({id:se().min(1),text:se().min(1),checked:bt().default(!1),required:bt().default(!1),bind:ba.optional()}),Du=fi.extend({type:Ln("tasklist"),items:St(Q_).min(1),onComplete:se().optional().describe("Action ID triggered when all items are checked")}),$_=tb(i=>{if(typeof i!="object"||i===null)return i;const a={...i};return"field"in a&&!("key"in a)&&(a.key=a.field,a.field=void 0),"label"in a&&!("header"in a)&&(a.header=a.label,a.label=void 0),a},jt({key:se().min(1),header:se().min(1),sortable:bt().default(!1),sensitive:bt().default(!1),width:se().optional()})),zu=fi.extend({type:Ln("table"),columns:St($_).min(1),data:ga([St(Bs(Hs())),ba]),sortable:bt().default(!1),filterable:bt().default(!1),pageSize:ya().positive().optional()}),Ru=fi.extend({type:Ln("callout"),variant:Bn(["info","warning","error","success"]).default("info"),title:se().optional(),content:se().min(1),dismissible:bt().default(!1)}),Lu=fi.extend({type:Ln("approval-gate"),title:se().min(1),description:se().optional(),requiredApprovers:ya().int().positive().default(1),allowedRoles:St(se()).optional(),onApprove:se().optional().describe("Action ID triggered on approval"),onDeny:se().optional().describe("Action ID triggered on denial"),requireReason:bt().default(!1).describe("Require reason on denial")}),Bu=fi.extend({type:Ln("webhook"),url:ga([se().url(),ba]),method:Bn(["GET","POST","PUT","PATCH","DELETE"]).default("POST"),headers:Bs(se()).optional(),body:ga([Bs(Hs()),ba]).optional(),trigger:se().describe("Action ID that triggers this webhook"),retries:ya().int().min(0).max(5).default(0),timeout:ya().int().positive().default(3e4).describe("Timeout in milliseconds")}),nb=fi.extend({type:Ln("chart"),variant:Bn(["line","bar","area","pie"]).default("line"),data:ga([se(),ba]),xAxis:se().optional(),yAxis:ga([se(),St(se())]).optional(),colors:St(se()).optional(),showLegend:bt().default(!0),showGrid:bt().default(!0),height:ya().default(300),stacked:bt().default(!1)}),ib=fi.extend({type:Ln("thinking"),content:se().min(1),status:Bn(["thinking","done"]).default("done"),collapsed:bt().default(!0)}),X_=K_("type",[Mu,ju,Du,zu,Ru,Lu,Bu,nb,ib]),J_=new Map([["form",Mu],["button",ju],["tasklist",Du],["table",zu],["callout",Ru],["approval-gate",Lu],["webhook",Bu],["chart",nb],["thinking",ib]]),F_=Bn(["component_rendered","field_changed","action_triggered","integration_called","approval_granted","approval_denied","validation_error","policy_violation"]),W_=jt({id:se(),role:se().optional()});jt({timestamp:se().datetime(),sessionId:se().uuid(),documentId:se(),eventType:F_,componentId:se(),payload:Bs(Hs()),redacted:bt().default(!1),actor:W_.optional()});const P_=jt({action:se().describe("Action type to control"),environments:St(se()).describe("Environments where this rule applies"),effect:Bn(["allow","deny"]),reason:se().optional()});jt({version:Ln(1),rules:St(P_),defaultEffect:Bn(["allow","deny"]).default("deny")});jt({title:se().optional(),version:se().optional(),author:se().optional(),description:se().optional(),tags:St(se()).optional(),domain:se().optional()});const ek=Bn(["experimental","stable","enterprise-ready"]),tk=jt({name:se(),type:se(),description:se().optional(),mock:bt().default(!0)}),nk=jt({security:St(se()).optional(),logging:St(se()).optional(),schema:St(se()).optional(),mocks:St(se()).optional(),docs:St(se()).optional()});jt({name:se().min(1),version:se(),maturity:ek,description:se(),outcome:se(),domain:se(),components_used:St(se()),integrations:St(tk).optional(),checklists:nk.optional()});const md=Symbol.for("yaml.alias"),td=Symbol.for("yaml.document"),Ii=Symbol.for("yaml.map"),ab=Symbol.for("yaml.pair"),Rn=Symbol.for("yaml.scalar"),wl=Symbol.for("yaml.seq"),pn=Symbol.for("yaml.node.type"),xa=i=>!!i&&typeof i=="object"&&i[pn]===md,Yu=i=>!!i&&typeof i=="object"&&i[pn]===td,Ys=i=>!!i&&typeof i=="object"&&i[pn]===Ii,ot=i=>!!i&&typeof i=="object"&&i[pn]===ab,Pe=i=>!!i&&typeof i=="object"&&i[pn]===Rn,Vs=i=>!!i&&typeof i=="object"&&i[pn]===wl;function rt(i){if(i&&typeof i=="object")switch(i[pn]){case Ii:case wl:return!0}return!1}function ut(i){if(i&&typeof i=="object")switch(i[pn]){case md:case Ii:case Rn:case wl:return!0}return!1}const lb=i=>(Pe(i)||rt(i))&&!!i.anchor,ca=Symbol("break visit"),ik=Symbol("skip children"),js=Symbol("remove node");function Al(i,n){const a=ak(n);Yu(i)?dl(null,i.contents,a,Object.freeze([i]))===js&&(i.contents=null):dl(null,i,a,Object.freeze([]))}Al.BREAK=ca;Al.SKIP=ik;Al.REMOVE=js;function dl(i,n,a,s){const u=lk(i,n,a,s);if(ut(u)||ot(u))return sk(i,s,u),dl(i,u,a,s);if(typeof u!="symbol"){if(rt(n)){s=Object.freeze(s.concat(n));for(let o=0;o<n.items.length;++o){const f=dl(o,n.items[o],a,s);if(typeof f=="number")o=f-1;else{if(f===ca)return ca;f===js&&(n.items.splice(o,1),o-=1)}}}else if(ot(n)){s=Object.freeze(s.concat(n));const o=dl("key",n.key,a,s);if(o===ca)return ca;o===js&&(n.key=null);const f=dl("value",n.value,a,s);if(f===ca)return ca;f===js&&(n.value=null)}}return u}function ak(i){return typeof i=="object"&&(i.Collection||i.Node||i.Value)?Object.assign({Alias:i.Node,Map:i.Node,Scalar:i.Node,Seq:i.Node},i.Value&&{Map:i.Value,Scalar:i.Value,Seq:i.Value},i.Collection&&{Map:i.Collection,Seq:i.Collection},i):i}function lk(i,n,a,s){var u,o,f,h,p;if(typeof a=="function")return a(i,n,s);if(Ys(n))return(u=a.Map)==null?void 0:u.call(a,i,n,s);if(Vs(n))return(o=a.Seq)==null?void 0:o.call(a,i,n,s);if(ot(n))return(f=a.Pair)==null?void 0:f.call(a,i,n,s);if(Pe(n))return(h=a.Scalar)==null?void 0:h.call(a,i,n,s);if(xa(n))return(p=a.Alias)==null?void 0:p.call(a,i,n,s)}function sk(i,n,a){const s=n[n.length-1];if(rt(s))s.items[i]=a;else if(ot(s))i==="key"?s.key=a:s.value=a;else if(Yu(s))s.contents=a;else{const u=xa(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${u} parent`)}}const rk={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},uk=i=>i.replace(/[!,[\]{}]/g,n=>rk[n]);class Mt{constructor(n,a){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Mt.defaultYaml,n),this.tags=Object.assign({},Mt.defaultTags,a)}clone(){const n=new Mt(this.yaml,this.tags);return n.docStart=this.docStart,n}atDocument(){const n=new Mt(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Mt.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Mt.defaultTags);break}return n}add(n,a){this.atNextDocument&&(this.yaml={explicit:Mt.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Mt.defaultTags),this.atNextDocument=!1);const s=n.trim().split(/[ \t]+/),u=s.shift();switch(u){case"%TAG":{if(s.length!==2&&(a(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;const[o,f]=s;return this.tags[o]=f,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return a(0,"%YAML directive should contain exactly one part"),!1;const[o]=s;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{const f=/^\d+\.\d+$/.test(o);return a(6,`Unsupported YAML version ${o}`,f),!1}}default:return a(0,`Unknown directive ${u}`,!0),!1}}tagName(n,a){if(n==="!")return"!";if(n[0]!=="!")return a(`Not a valid tag: ${n}`),null;if(n[1]==="<"){const f=n.slice(2,-1);return f==="!"||f==="!!"?(a(`Verbatim tags aren't resolved, so ${n} is invalid.`),null):(n[n.length-1]!==">"&&a("Verbatim tags must end with a >"),f)}const[,s,u]=n.match(/^(.*!)([^!]*)$/s);u||a(`The ${n} tag has no suffix`);const o=this.tags[s];if(o)try{return o+decodeURIComponent(u)}catch(f){return a(String(f)),null}return s==="!"?n:(a(`Could not resolve tag: ${n}`),null)}tagString(n){for(const[a,s]of Object.entries(this.tags))if(n.startsWith(s))return a+uk(n.substring(s.length));return n[0]==="!"?n:`!<${n}>`}toString(n){const a=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags);let u;if(n&&s.length>0&&ut(n.contents)){const o={};Al(n.contents,(f,h)=>{ut(h)&&h.tag&&(o[h.tag]=!0)}),u=Object.keys(o)}else u=[];for(const[o,f]of s)o==="!!"&&f==="tag:yaml.org,2002:"||(!n||u.some(h=>h.startsWith(f)))&&a.push(`%TAG ${o} ${f}`);return a.join(`
376
+ `)}}Mt.defaultYaml={explicit:!1,version:"1.2"};Mt.defaultTags={"!!":"tag:yaml.org,2002:"};function sb(i){if(/[\x00-\x19\s,[\]{}]/.test(i)){const a=`Anchor must not contain whitespace or control characters: ${JSON.stringify(i)}`;throw new Error(a)}return!0}function rb(i){const n=new Set;return Al(i,{Value(a,s){s.anchor&&n.add(s.anchor)}}),n}function ub(i,n){for(let a=1;;++a){const s=`${i}${a}`;if(!n.has(s))return s}}function ok(i,n){const a=[],s=new Map;let u=null;return{onAnchor:o=>{a.push(o),u??(u=rb(i));const f=ub(n,u);return u.add(f),f},setAnchors:()=>{for(const o of a){const f=s.get(o);if(typeof f=="object"&&f.anchor&&(Pe(f.node)||rt(f.node)))f.node.anchor=f.anchor;else{const h=new Error("Failed to resolve repeated object (this should not happen)");throw h.source=o,h}}},sourceObjects:s}}function hl(i,n,a,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let u=0,o=s.length;u<o;++u){const f=s[u],h=hl(i,s,String(u),f);h===void 0?delete s[u]:h!==f&&(s[u]=h)}else if(s instanceof Map)for(const u of Array.from(s.keys())){const o=s.get(u),f=hl(i,s,u,o);f===void 0?s.delete(u):f!==o&&s.set(u,f)}else if(s instanceof Set)for(const u of Array.from(s)){const o=hl(i,s,u,u);o===void 0?s.delete(u):o!==u&&(s.delete(u),s.add(o))}else for(const[u,o]of Object.entries(s)){const f=hl(i,s,u,o);f===void 0?delete s[u]:f!==o&&(s[u]=f)}return i.call(n,a,s)}function mn(i,n,a){if(Array.isArray(i))return i.map((s,u)=>mn(s,String(u),a));if(i&&typeof i.toJSON=="function"){if(!a||!lb(i))return i.toJSON(n,a);const s={aliasCount:0,count:1,res:void 0};a.anchors.set(i,s),a.onCreate=o=>{s.res=o,delete a.onCreate};const u=i.toJSON(n,a);return a.onCreate&&a.onCreate(u),u}return typeof i=="bigint"&&!(a!=null&&a.keep)?Number(i):i}class pd{constructor(n){Object.defineProperty(this,pn,{value:n})}clone(){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(n.range=this.range.slice()),n}toJS(n,{mapAsMap:a,maxAliasCount:s,onAnchor:u,reviver:o}={}){if(!Yu(n))throw new TypeError("A document argument is required");const f={anchors:new Map,doc:n,keep:!0,mapAsMap:a===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},h=mn(this,"",f);if(typeof u=="function")for(const{count:p,res:m}of f.anchors.values())u(m,p);return typeof o=="function"?hl(o,{"":h},"",h):h}}class yd extends pd{constructor(n){super(md),this.source=n,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(n,a){let s;a!=null&&a.aliasResolveCache?s=a.aliasResolveCache:(s=[],Al(n,{Node:(o,f)=>{(xa(f)||lb(f))&&s.push(f)}}),a&&(a.aliasResolveCache=s));let u;for(const o of s){if(o===this)break;o.anchor===this.source&&(u=o)}return u}toJSON(n,a){if(!a)return{source:this.source};const{anchors:s,doc:u,maxAliasCount:o}=a,f=this.resolve(u,a);if(!f){const p=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(p)}let h=s.get(f);if(h||(mn(f,null,a),h=s.get(f)),(h==null?void 0:h.res)===void 0){const p="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(p)}if(o>=0&&(h.count+=1,h.aliasCount===0&&(h.aliasCount=bu(u,f,s)),h.count*h.aliasCount>o)){const p="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(p)}return h.res}toString(n,a,s){const u=`*${this.source}`;if(n){if(sb(this.source),n.options.verifyAliasOrder&&!n.anchors.has(this.source)){const o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(n.implicitKey)return`${u} `}return u}}function bu(i,n,a){if(xa(n)){const s=n.resolve(i),u=a&&s&&a.get(s);return u?u.count*u.aliasCount:0}else if(rt(n)){let s=0;for(const u of n.items){const o=bu(i,u,a);o>s&&(s=o)}return s}else if(ot(n)){const s=bu(i,n.key,a),u=bu(i,n.value,a);return Math.max(s,u)}return 1}const ob=i=>!i||typeof i!="function"&&typeof i!="object";class Ae extends pd{constructor(n){super(Rn),this.value=n}toJSON(n,a){return a!=null&&a.keep?this.value:mn(this.value,n,a)}toString(){return String(this.value)}}Ae.BLOCK_FOLDED="BLOCK_FOLDED";Ae.BLOCK_LITERAL="BLOCK_LITERAL";Ae.PLAIN="PLAIN";Ae.QUOTE_DOUBLE="QUOTE_DOUBLE";Ae.QUOTE_SINGLE="QUOTE_SINGLE";const ck="tag:yaml.org,2002:";function fk(i,n,a){if(n){const s=a.filter(o=>o.tag===n),u=s.find(o=>!o.format)??s[0];if(!u)throw new Error(`Tag ${n} not found`);return u}return a.find(s=>{var u;return((u=s.identify)==null?void 0:u.call(s,i))&&!s.format})}function qs(i,n,a){var g,_,v;if(Yu(i)&&(i=i.contents),ut(i))return i;if(ot(i)){const O=(_=(g=a.schema[Ii]).createNode)==null?void 0:_.call(g,a.schema,null,a);return O.items.push(i),O}(i instanceof String||i instanceof Number||i instanceof Boolean||typeof BigInt<"u"&&i instanceof BigInt)&&(i=i.valueOf());const{aliasDuplicateObjects:s,onAnchor:u,onTagObj:o,schema:f,sourceObjects:h}=a;let p;if(s&&i&&typeof i=="object"){if(p=h.get(i),p)return p.anchor??(p.anchor=u(i)),new yd(p.anchor);p={anchor:null,node:null},h.set(i,p)}n!=null&&n.startsWith("!!")&&(n=ck+n.slice(2));let m=fk(i,n,f.tags);if(!m){if(i&&typeof i.toJSON=="function"&&(i=i.toJSON()),!i||typeof i!="object"){const O=new Ae(i);return p&&(p.node=O),O}m=i instanceof Map?f[Ii]:Symbol.iterator in Object(i)?f[wl]:f[Ii]}o&&(o(m),delete a.onTagObj);const b=m!=null&&m.createNode?m.createNode(a.schema,i,a):typeof((v=m==null?void 0:m.nodeClass)==null?void 0:v.from)=="function"?m.nodeClass.from(a.schema,i,a):new Ae(i);return n?b.tag=n:m.default||(b.tag=m.tag),p&&(p.node=b),b}function qu(i,n,a){let s=a;for(let u=n.length-1;u>=0;--u){const o=n[u];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){const f=[];f[o]=s,s=f}else s=new Map([[o,s]])}return qs(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:i,sourceObjects:new Map})}const Ns=i=>i==null||typeof i=="object"&&!!i[Symbol.iterator]().next().done;class cb extends pd{constructor(n,a){super(n),Object.defineProperty(this,"schema",{value:a,configurable:!0,enumerable:!1,writable:!0})}clone(n){const a=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return n&&(a.schema=n),a.items=a.items.map(s=>ut(s)||ot(s)?s.clone(n):s),this.range&&(a.range=this.range.slice()),a}addIn(n,a){if(Ns(n))this.add(a);else{const[s,...u]=n,o=this.get(s,!0);if(rt(o))o.addIn(u,a);else if(o===void 0&&this.schema)this.set(s,qu(this.schema,u,a));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${u}`)}}deleteIn(n){const[a,...s]=n;if(s.length===0)return this.delete(a);const u=this.get(a,!0);if(rt(u))return u.deleteIn(s);throw new Error(`Expected YAML collection at ${a}. Remaining path: ${s}`)}getIn(n,a){const[s,...u]=n,o=this.get(s,!0);return u.length===0?!a&&Pe(o)?o.value:o:rt(o)?o.getIn(u,a):void 0}hasAllNullValues(n){return this.items.every(a=>{if(!ot(a))return!1;const s=a.value;return s==null||n&&Pe(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(n){const[a,...s]=n;if(s.length===0)return this.has(a);const u=this.get(a,!0);return rt(u)?u.hasIn(s):!1}setIn(n,a){const[s,...u]=n;if(u.length===0)this.set(s,a);else{const o=this.get(s,!0);if(rt(o))o.setIn(u,a);else if(o===void 0&&this.schema)this.set(s,qu(this.schema,u,a));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${u}`)}}}const dk=i=>i.replace(/^(?!$)(?: $)?/gm,"#");function ri(i,n){return/^\n+$/.test(i)?i.substring(1):n?i.replace(/^(?! *$)/gm,n):i}const fa=(i,n,a)=>i.endsWith(`
377
+ `)?ri(a,n):a.includes(`
378
+ `)?`
379
+ `+ri(a,n):(i.endsWith(" ")?"":" ")+a,fb="flow",nd="block",vu="quoted";function Vu(i,n,a="flow",{indentAtStart:s,lineWidth:u=80,minContentWidth:o=20,onFold:f,onOverflow:h}={}){if(!u||u<0)return i;u<o&&(o=0);const p=Math.max(1+o,1+u-n.length);if(i.length<=p)return i;const m=[],b={};let g=u-n.length;typeof s=="number"&&(s>u-Math.max(2,o)?m.push(0):g=u-s);let _,v,O=!1,w=-1,j=-1,E=-1;a===nd&&(w=mg(i,w,n.length),w!==-1&&(g=w+p));for(let I;I=i[w+=1];){if(a===vu&&I==="\\"){switch(j=w,i[w+1]){case"x":w+=3;break;case"u":w+=5;break;case"U":w+=9;break;default:w+=1}E=w}if(I===`
380
+ `)a===nd&&(w=mg(i,w,n.length)),g=w+n.length+p,_=void 0;else{if(I===" "&&v&&v!==" "&&v!==`
381
+ `&&v!==" "){const Q=i[w+1];Q&&Q!==" "&&Q!==`
382
+ `&&Q!==" "&&(_=w)}if(w>=g)if(_)m.push(_),g=_+p,_=void 0;else if(a===vu){for(;v===" "||v===" ";)v=I,I=i[w+=1],O=!0;const Q=w>E+1?w-2:j-1;if(b[Q])return i;m.push(Q),b[Q]=!0,g=Q+p,_=void 0}else O=!0}v=I}if(O&&h&&h(),m.length===0)return i;f&&f();let H=i.slice(0,m[0]);for(let I=0;I<m.length;++I){const Q=m[I],F=m[I+1]||i.length;Q===0?H=`
383
+ ${n}${i.slice(0,F)}`:(a===vu&&b[Q]&&(H+=`${i[Q]}\\`),H+=`
384
+ ${n}${i.slice(Q+1,F)}`)}return H}function mg(i,n,a){let s=n,u=n+1,o=i[u];for(;o===" "||o===" ";)if(n<u+a)o=i[++n];else{do o=i[++n];while(o&&o!==`
385
+ `);s=n,u=n+1,o=i[u]}return s}const Gu=(i,n)=>({indentAtStart:n?i.indent.length:i.indentAtStart,lineWidth:i.options.lineWidth,minContentWidth:i.options.minContentWidth}),Ku=i=>/^(%|---|\.\.\.)/m.test(i);function hk(i,n,a){if(!n||n<0)return!1;const s=n-a,u=i.length;if(u<=s)return!1;for(let o=0,f=0;o<u;++o)if(i[o]===`
386
+ `){if(o-f>s)return!0;if(f=o+1,u-f<=s)return!1}return!0}function Ds(i,n){const a=JSON.stringify(i);if(n.options.doubleQuotedAsJSON)return a;const{implicitKey:s}=n,u=n.options.doubleQuotedMinMultiLineLength,o=n.indent||(Ku(i)?" ":"");let f="",h=0;for(let p=0,m=a[p];m;m=a[++p])if(m===" "&&a[p+1]==="\\"&&a[p+2]==="n"&&(f+=a.slice(h,p)+"\\ ",p+=1,h=p,m="\\"),m==="\\")switch(a[p+1]){case"u":{f+=a.slice(h,p);const b=a.substr(p+2,4);switch(b){case"0000":f+="\\0";break;case"0007":f+="\\a";break;case"000b":f+="\\v";break;case"001b":f+="\\e";break;case"0085":f+="\\N";break;case"00a0":f+="\\_";break;case"2028":f+="\\L";break;case"2029":f+="\\P";break;default:b.substr(0,2)==="00"?f+="\\x"+b.substr(2):f+=a.substr(p,6)}p+=5,h=p+1}break;case"n":if(s||a[p+2]==='"'||a.length<u)p+=1;else{for(f+=a.slice(h,p)+`
387
+
388
+ `;a[p+2]==="\\"&&a[p+3]==="n"&&a[p+4]!=='"';)f+=`
389
+ `,p+=2;f+=o,a[p+2]===" "&&(f+="\\"),p+=1,h=p+1}break;default:p+=1}return f=h?f+a.slice(h):a,s?f:Vu(f,o,vu,Gu(n,!1))}function id(i,n){if(n.options.singleQuote===!1||n.implicitKey&&i.includes(`
390
+ `)||/[ \t]\n|\n[ \t]/.test(i))return Ds(i,n);const a=n.indent||(Ku(i)?" ":""),s="'"+i.replace(/'/g,"''").replace(/\n+/g,`$&
391
+ ${a}`)+"'";return n.implicitKey?s:Vu(s,a,fb,Gu(n,!1))}function ml(i,n){const{singleQuote:a}=n.options;let s;if(a===!1)s=Ds;else{const u=i.includes('"'),o=i.includes("'");u&&!o?s=id:o&&!u?s=Ds:s=a?id:Ds}return s(i,n)}let ad;try{ad=new RegExp(`(^|(?<!
392
+ ))
393
+ +(?!
394
+ |$)`,"g")}catch{ad=/\n+(?!\n|$)/g}function xu({comment:i,type:n,value:a},s,u,o){const{blockQuote:f,commentString:h,lineWidth:p}=s.options;if(!f||/\n[\t ]+$/.test(a))return ml(a,s);const m=s.indent||(s.forceBlockIndent||Ku(a)?" ":""),b=f==="literal"?!0:f==="folded"||n===Ae.BLOCK_FOLDED?!1:n===Ae.BLOCK_LITERAL?!0:!hk(a,p,m.length);if(!a)return b?`|
395
+ `:`>
396
+ `;let g,_;for(_=a.length;_>0;--_){const F=a[_-1];if(F!==`
397
+ `&&F!==" "&&F!==" ")break}let v=a.substring(_);const O=v.indexOf(`
398
+ `);O===-1?g="-":a===v||O!==v.length-1?(g="+",o&&o()):g="",v&&(a=a.slice(0,-v.length),v[v.length-1]===`
399
+ `&&(v=v.slice(0,-1)),v=v.replace(ad,`$&${m}`));let w=!1,j,E=-1;for(j=0;j<a.length;++j){const F=a[j];if(F===" ")w=!0;else if(F===`
400
+ `)E=j;else break}let H=a.substring(0,E<j?E+1:j);H&&(a=a.substring(H.length),H=H.replace(/\n+/g,`$&${m}`));let Q=(w?m?"2":"1":"")+g;if(i&&(Q+=" "+h(i.replace(/ ?[\r\n]+/g," ")),u&&u()),!b){const F=a.replace(/\n+/g,`
401
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${m}`);let L=!1;const Z=Gu(s,!0);f!=="folded"&&n!==Ae.BLOCK_FOLDED&&(Z.onOverflow=()=>{L=!0});const J=Vu(`${H}${F}${v}`,m,nd,Z);if(!L)return`>${Q}
402
+ ${m}${J}`}return a=a.replace(/\n+/g,`$&${m}`),`|${Q}
403
+ ${m}${H}${a}${v}`}function mk(i,n,a,s){const{type:u,value:o}=i,{actualString:f,implicitKey:h,indent:p,indentStep:m,inFlow:b}=n;if(h&&o.includes(`
404
+ `)||b&&/[[\]{},]/.test(o))return ml(o,n);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return h||b||!o.includes(`
405
+ `)?ml(o,n):xu(i,n,a,s);if(!h&&!b&&u!==Ae.PLAIN&&o.includes(`
406
+ `))return xu(i,n,a,s);if(Ku(o)){if(p==="")return n.forceBlockIndent=!0,xu(i,n,a,s);if(h&&p===m)return ml(o,n)}const g=o.replace(/\n+/g,`$&
407
+ ${p}`);if(f){const _=w=>{var j;return w.default&&w.tag!=="tag:yaml.org,2002:str"&&((j=w.test)==null?void 0:j.test(g))},{compat:v,tags:O}=n.doc.schema;if(O.some(_)||v!=null&&v.some(_))return ml(o,n)}return h?g:Vu(g,p,fb,Gu(n,!1))}function gd(i,n,a,s){const{implicitKey:u,inFlow:o}=n,f=typeof i.value=="string"?i:Object.assign({},i,{value:String(i.value)});let{type:h}=i;h!==Ae.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(f.value)&&(h=Ae.QUOTE_DOUBLE);const p=b=>{switch(b){case Ae.BLOCK_FOLDED:case Ae.BLOCK_LITERAL:return u||o?ml(f.value,n):xu(f,n,a,s);case Ae.QUOTE_DOUBLE:return Ds(f.value,n);case Ae.QUOTE_SINGLE:return id(f.value,n);case Ae.PLAIN:return mk(f,n,a,s);default:return null}};let m=p(h);if(m===null){const{defaultKeyType:b,defaultStringType:g}=n.options,_=u&&b||g;if(m=p(_),m===null)throw new Error(`Unsupported default string type ${_}`)}return m}function db(i,n){const a=Object.assign({blockQuote:!0,commentString:dk,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},i.schema.toStringOptions,n);let s;switch(a.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:i,flowCollectionPadding:a.flowCollectionPadding?" ":"",indent:"",indentStep:typeof a.indent=="number"?" ".repeat(a.indent):" ",inFlow:s,options:a}}function pk(i,n){var u;if(n.tag){const o=i.filter(f=>f.tag===n.tag);if(o.length>0)return o.find(f=>f.format===n.format)??o[0]}let a,s;if(Pe(n)){s=n.value;let o=i.filter(f=>{var h;return(h=f.identify)==null?void 0:h.call(f,s)});if(o.length>1){const f=o.filter(h=>h.test);f.length>0&&(o=f)}a=o.find(f=>f.format===n.format)??o.find(f=>!f.format)}else s=n,a=i.find(o=>o.nodeClass&&s instanceof o.nodeClass);if(!a){const o=((u=s==null?void 0:s.constructor)==null?void 0:u.name)??(s===null?"null":typeof s);throw new Error(`Tag not resolved for ${o} value`)}return a}function yk(i,n,{anchors:a,doc:s}){if(!s.directives)return"";const u=[],o=(Pe(i)||rt(i))&&i.anchor;o&&sb(o)&&(a.add(o),u.push(`&${o}`));const f=i.tag??(n.default?null:n.tag);return f&&u.push(s.directives.tagString(f)),u.join(" ")}function _l(i,n,a,s){var p;if(ot(i))return i.toString(n,a,s);if(xa(i)){if(n.doc.directives)return i.toString(n);if((p=n.resolvedAliases)!=null&&p.has(i))throw new TypeError("Cannot stringify circular structure without alias nodes");n.resolvedAliases?n.resolvedAliases.add(i):n.resolvedAliases=new Set([i]),i=i.resolve(n.doc)}let u;const o=ut(i)?i:n.doc.createNode(i,{onTagObj:m=>u=m});u??(u=pk(n.doc.schema.tags,o));const f=yk(o,u,n);f.length>0&&(n.indentAtStart=(n.indentAtStart??0)+f.length+1);const h=typeof u.stringify=="function"?u.stringify(o,n,a,s):Pe(o)?gd(o,n,a,s):o.toString(n,a,s);return f?Pe(o)||h[0]==="{"||h[0]==="["?`${f} ${h}`:`${f}
408
+ ${n.indent}${h}`:h}function gk({key:i,value:n},a,s,u){const{allNullValues:o,doc:f,indent:h,indentStep:p,options:{commentString:m,indentSeq:b,simpleKeys:g}}=a;let _=ut(i)&&i.comment||null;if(g){if(_)throw new Error("With simple keys, key nodes cannot have comments");if(rt(i)||!ut(i)&&typeof i=="object"){const Z="With simple keys, collection cannot be used as a key value";throw new Error(Z)}}let v=!g&&(!i||_&&n==null&&!a.inFlow||rt(i)||(Pe(i)?i.type===Ae.BLOCK_FOLDED||i.type===Ae.BLOCK_LITERAL:typeof i=="object"));a=Object.assign({},a,{allNullValues:!1,implicitKey:!v&&(g||!o),indent:h+p});let O=!1,w=!1,j=_l(i,a,()=>O=!0,()=>w=!0);if(!v&&!a.inFlow&&j.length>1024){if(g)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");v=!0}if(a.inFlow){if(o||n==null)return O&&s&&s(),j===""?"?":v?`? ${j}`:j}else if(o&&!g||n==null&&v)return j=`? ${j}`,_&&!O?j+=fa(j,a.indent,m(_)):w&&u&&u(),j;O&&(_=null),v?(_&&(j+=fa(j,a.indent,m(_))),j=`? ${j}
409
+ ${h}:`):(j=`${j}:`,_&&(j+=fa(j,a.indent,m(_))));let E,H,I;ut(n)?(E=!!n.spaceBefore,H=n.commentBefore,I=n.comment):(E=!1,H=null,I=null,n&&typeof n=="object"&&(n=f.createNode(n))),a.implicitKey=!1,!v&&!_&&Pe(n)&&(a.indentAtStart=j.length+1),w=!1,!b&&p.length>=2&&!a.inFlow&&!v&&Vs(n)&&!n.flow&&!n.tag&&!n.anchor&&(a.indent=a.indent.substring(2));let Q=!1;const F=_l(n,a,()=>Q=!0,()=>w=!0);let L=" ";if(_||E||H){if(L=E?`
410
+ `:"",H){const Z=m(H);L+=`
411
+ ${ri(Z,a.indent)}`}F===""&&!a.inFlow?L===`
412
+ `&&I&&(L=`
413
+
414
+ `):L+=`
415
+ ${a.indent}`}else if(!v&&rt(n)){const Z=F[0],J=F.indexOf(`
416
+ `),le=J!==-1,ye=a.inFlow??n.flow??n.items.length===0;if(le||!ye){let ie=!1;if(le&&(Z==="&"||Z==="!")){let P=F.indexOf(" ");Z==="&"&&P!==-1&&P<J&&F[P+1]==="!"&&(P=F.indexOf(" ",P+1)),(P===-1||J<P)&&(ie=!0)}ie||(L=`
417
+ ${a.indent}`)}}else(F===""||F[0]===`
418
+ `)&&(L="");return j+=L+F,a.inFlow?Q&&s&&s():I&&!Q?j+=fa(j,a.indent,m(I)):w&&u&&u(),j}function hb(i,n){(i==="debug"||i==="warn")&&console.warn(n)}const du="<<",oi={identify:i=>i===du||typeof i=="symbol"&&i.description===du,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Ae(Symbol(du)),{addToJSMap:mb}),stringify:()=>du},bk=(i,n)=>(oi.identify(n)||Pe(n)&&(!n.type||n.type===Ae.PLAIN)&&oi.identify(n.value))&&(i==null?void 0:i.doc.schema.tags.some(a=>a.tag===oi.tag&&a.default));function mb(i,n,a){if(a=i&&xa(a)?a.resolve(i.doc):a,Vs(a))for(const s of a.items)jf(i,n,s);else if(Array.isArray(a))for(const s of a)jf(i,n,s);else jf(i,n,a)}function jf(i,n,a){const s=i&&xa(a)?a.resolve(i.doc):a;if(!Ys(s))throw new Error("Merge sources must be maps or map aliases");const u=s.toJSON(null,i,Map);for(const[o,f]of u)n instanceof Map?n.has(o)||n.set(o,f):n instanceof Set?n.add(o):Object.prototype.hasOwnProperty.call(n,o)||Object.defineProperty(n,o,{value:f,writable:!0,enumerable:!0,configurable:!0});return n}function pb(i,n,{key:a,value:s}){if(ut(a)&&a.addToJSMap)a.addToJSMap(i,n,s);else if(bk(i,a))mb(i,n,s);else{const u=mn(a,"",i);if(n instanceof Map)n.set(u,mn(s,u,i));else if(n instanceof Set)n.add(u);else{const o=vk(a,u,i),f=mn(s,o,i);o in n?Object.defineProperty(n,o,{value:f,writable:!0,enumerable:!0,configurable:!0}):n[o]=f}}return n}function vk(i,n,a){if(n===null)return"";if(typeof n!="object")return String(n);if(ut(i)&&(a!=null&&a.doc)){const s=db(a.doc,{});s.anchors=new Set;for(const o of a.anchors.keys())s.anchors.add(o.anchor);s.inFlow=!0,s.inStringifyKey=!0;const u=i.toString(s);if(!a.mapKeyWarned){let o=JSON.stringify(u);o.length>40&&(o=o.substring(0,36)+'..."'),hb(a.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),a.mapKeyWarned=!0}return u}return JSON.stringify(n)}function bd(i,n,a){const s=qs(i,void 0,a),u=qs(n,void 0,a);return new Dt(s,u)}class Dt{constructor(n,a=null){Object.defineProperty(this,pn,{value:ab}),this.key=n,this.value=a}clone(n){let{key:a,value:s}=this;return ut(a)&&(a=a.clone(n)),ut(s)&&(s=s.clone(n)),new Dt(a,s)}toJSON(n,a){const s=a!=null&&a.mapAsMap?new Map:{};return pb(a,s,this)}toString(n,a,s){return n!=null&&n.doc?gk(this,n,a,s):JSON.stringify(this)}}function yb(i,n,a){return(n.inFlow??i.flow?Sk:xk)(i,n,a)}function xk({comment:i,items:n},a,{blockItemPrefix:s,flowChars:u,itemIndent:o,onChompKeep:f,onComment:h}){const{indent:p,options:{commentString:m}}=a,b=Object.assign({},a,{indent:o,type:null});let g=!1;const _=[];for(let O=0;O<n.length;++O){const w=n[O];let j=null;if(ut(w))!g&&w.spaceBefore&&_.push(""),Uu(a,_,w.commentBefore,g),w.comment&&(j=w.comment);else if(ot(w)){const H=ut(w.key)?w.key:null;H&&(!g&&H.spaceBefore&&_.push(""),Uu(a,_,H.commentBefore,g))}g=!1;let E=_l(w,b,()=>j=null,()=>g=!0);j&&(E+=fa(E,o,m(j))),g&&j&&(g=!1),_.push(s+E)}let v;if(_.length===0)v=u.start+u.end;else{v=_[0];for(let O=1;O<_.length;++O){const w=_[O];v+=w?`
419
+ ${p}${w}`:`
420
+ `}}return i?(v+=`
421
+ `+ri(m(i),p),h&&h()):g&&f&&f(),v}function Sk({items:i},n,{flowChars:a,itemIndent:s}){const{indent:u,indentStep:o,flowCollectionPadding:f,options:{commentString:h}}=n;s+=o;const p=Object.assign({},n,{indent:s,inFlow:!0,type:null});let m=!1,b=0;const g=[];for(let O=0;O<i.length;++O){const w=i[O];let j=null;if(ut(w))w.spaceBefore&&g.push(""),Uu(n,g,w.commentBefore,!1),w.comment&&(j=w.comment);else if(ot(w)){const H=ut(w.key)?w.key:null;H&&(H.spaceBefore&&g.push(""),Uu(n,g,H.commentBefore,!1),H.comment&&(m=!0));const I=ut(w.value)?w.value:null;I?(I.comment&&(j=I.comment),I.commentBefore&&(m=!0)):w.value==null&&(H!=null&&H.comment)&&(j=H.comment)}j&&(m=!0);let E=_l(w,p,()=>j=null);O<i.length-1&&(E+=","),j&&(E+=fa(E,s,h(j))),!m&&(g.length>b||E.includes(`
422
+ `))&&(m=!0),g.push(E),b=g.length}const{start:_,end:v}=a;if(g.length===0)return _+v;if(!m){const O=g.reduce((w,j)=>w+j.length+2,2);m=n.options.lineWidth>0&&O>n.options.lineWidth}if(m){let O=_;for(const w of g)O+=w?`
423
+ ${o}${u}${w}`:`
424
+ `;return`${O}
425
+ ${u}${v}`}else return`${_}${f}${g.join(" ")}${f}${v}`}function Uu({indent:i,options:{commentString:n}},a,s,u){if(s&&u&&(s=s.replace(/^\n+/,"")),s){const o=ri(n(s),i);a.push(o.trimStart())}}function da(i,n){const a=Pe(n)?n.value:n;for(const s of i)if(ot(s)&&(s.key===n||s.key===a||Pe(s.key)&&s.key.value===a))return s}class hn extends cb{static get tagName(){return"tag:yaml.org,2002:map"}constructor(n){super(Ii,n),this.items=[]}static from(n,a,s){const{keepUndefined:u,replacer:o}=s,f=new this(n),h=(p,m)=>{if(typeof o=="function")m=o.call(a,p,m);else if(Array.isArray(o)&&!o.includes(p))return;(m!==void 0||u)&&f.items.push(bd(p,m,s))};if(a instanceof Map)for(const[p,m]of a)h(p,m);else if(a&&typeof a=="object")for(const p of Object.keys(a))h(p,a[p]);return typeof n.sortMapEntries=="function"&&f.items.sort(n.sortMapEntries),f}add(n,a){var f;let s;ot(n)?s=n:!n||typeof n!="object"||!("key"in n)?s=new Dt(n,n==null?void 0:n.value):s=new Dt(n.key,n.value);const u=da(this.items,s.key),o=(f=this.schema)==null?void 0:f.sortMapEntries;if(u){if(!a)throw new Error(`Key ${s.key} already set`);Pe(u.value)&&ob(s.value)?u.value.value=s.value:u.value=s.value}else if(o){const h=this.items.findIndex(p=>o(s,p)<0);h===-1?this.items.push(s):this.items.splice(h,0,s)}else this.items.push(s)}delete(n){const a=da(this.items,n);return a?this.items.splice(this.items.indexOf(a),1).length>0:!1}get(n,a){const s=da(this.items,n),u=s==null?void 0:s.value;return(!a&&Pe(u)?u.value:u)??void 0}has(n){return!!da(this.items,n)}set(n,a){this.add(new Dt(n,a),!0)}toJSON(n,a,s){const u=s?new s:a!=null&&a.mapAsMap?new Map:{};a!=null&&a.onCreate&&a.onCreate(u);for(const o of this.items)pb(a,u,o);return u}toString(n,a,s){if(!n)return JSON.stringify(this);for(const u of this.items)if(!ot(u))throw new Error(`Map items must all be pairs; found ${JSON.stringify(u)} instead`);return!n.allNullValues&&this.hasAllNullValues(!1)&&(n=Object.assign({},n,{allNullValues:!0})),yb(this,n,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:n.indent||"",onChompKeep:s,onComment:a})}}const Tl={collection:"map",default:!0,nodeClass:hn,tag:"tag:yaml.org,2002:map",resolve(i,n){return Ys(i)||n("Expected a mapping for this tag"),i},createNode:(i,n,a)=>hn.from(i,n,a)};class va extends cb{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(n){super(wl,n),this.items=[]}add(n){this.items.push(n)}delete(n){const a=hu(n);return typeof a!="number"?!1:this.items.splice(a,1).length>0}get(n,a){const s=hu(n);if(typeof s!="number")return;const u=this.items[s];return!a&&Pe(u)?u.value:u}has(n){const a=hu(n);return typeof a=="number"&&a<this.items.length}set(n,a){const s=hu(n);if(typeof s!="number")throw new Error(`Expected a valid index, not ${n}.`);const u=this.items[s];Pe(u)&&ob(a)?u.value=a:this.items[s]=a}toJSON(n,a){const s=[];a!=null&&a.onCreate&&a.onCreate(s);let u=0;for(const o of this.items)s.push(mn(o,String(u++),a));return s}toString(n,a,s){return n?yb(this,n,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(n.indent||"")+" ",onChompKeep:s,onComment:a}):JSON.stringify(this)}static from(n,a,s){const{replacer:u}=s,o=new this(n);if(a&&Symbol.iterator in Object(a)){let f=0;for(let h of a){if(typeof u=="function"){const p=a instanceof Set?h:String(f++);h=u.call(a,p,h)}o.items.push(qs(h,void 0,s))}}return o}}function hu(i){let n=Pe(i)?i.value:i;return n&&typeof n=="string"&&(n=Number(n)),typeof n=="number"&&Number.isInteger(n)&&n>=0?n:null}const El={collection:"seq",default:!0,nodeClass:va,tag:"tag:yaml.org,2002:seq",resolve(i,n){return Vs(i)||n("Expected a sequence for this tag"),i},createNode:(i,n,a)=>va.from(i,n,a)},Zu={identify:i=>typeof i=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:i=>i,stringify(i,n,a,s){return n=Object.assign({actualString:!0},n),gd(i,n,a,s)}},Qu={identify:i=>i==null,createNode:()=>new Ae(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Ae(null),stringify:({source:i},n)=>typeof i=="string"&&Qu.test.test(i)?i:n.options.nullStr},vd={identify:i=>typeof i=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:i=>new Ae(i[0]==="t"||i[0]==="T"),stringify({source:i,value:n},a){if(i&&vd.test.test(i)){const s=i[0]==="t"||i[0]==="T";if(n===s)return i}return n?a.options.trueStr:a.options.falseStr}};function An({format:i,minFractionDigits:n,tag:a,value:s}){if(typeof s=="bigint")return String(s);const u=typeof s=="number"?s:Number(s);if(!isFinite(u))return isNaN(u)?".nan":u<0?"-.inf":".inf";let o=Object.is(s,-0)?"-0":JSON.stringify(s);if(!i&&n&&(!a||a==="tag:yaml.org,2002:float")&&/^\d/.test(o)){let f=o.indexOf(".");f<0&&(f=o.length,o+=".");let h=n-(o.length-f-1);for(;h-- >0;)o+="0"}return o}const gb={identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:i=>i.slice(-3).toLowerCase()==="nan"?NaN:i[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:An},bb={identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:i=>parseFloat(i),stringify(i){const n=Number(i.value);return isFinite(n)?n.toExponential():An(i)}},vb={identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(i){const n=new Ae(parseFloat(i)),a=i.indexOf(".");return a!==-1&&i[i.length-1]==="0"&&(n.minFractionDigits=i.length-a-1),n},stringify:An},$u=i=>typeof i=="bigint"||Number.isInteger(i),xd=(i,n,a,{intAsBigInt:s})=>s?BigInt(i):parseInt(i.substring(n),a);function xb(i,n,a){const{value:s}=i;return $u(s)&&s>=0?a+s.toString(n):An(i)}const Sb={identify:i=>$u(i)&&i>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(i,n,a)=>xd(i,2,8,a),stringify:i=>xb(i,8,"0o")},_b={identify:$u,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(i,n,a)=>xd(i,0,10,a),stringify:An},kb={identify:i=>$u(i)&&i>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(i,n,a)=>xd(i,2,16,a),stringify:i=>xb(i,16,"0x")},_k=[Tl,El,Zu,Qu,vd,Sb,_b,kb,gb,bb,vb];function pg(i){return typeof i=="bigint"||Number.isInteger(i)}const mu=({value:i})=>JSON.stringify(i),kk=[{identify:i=>typeof i=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:i=>i,stringify:mu},{identify:i=>i==null,createNode:()=>new Ae(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:mu},{identify:i=>typeof i=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:i=>i==="true",stringify:mu},{identify:pg,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(i,n,{intAsBigInt:a})=>a?BigInt(i):parseInt(i,10),stringify:({value:i})=>pg(i)?i.toString():JSON.stringify(i)},{identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:i=>parseFloat(i),stringify:mu}],wk={default:!0,tag:"",test:/^/,resolve(i,n){return n(`Unresolved plain scalar ${JSON.stringify(i)}`),i}},Ak=[Tl,El].concat(kk,wk),Sd={identify:i=>i instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(i,n){if(typeof atob=="function"){const a=atob(i.replace(/[\n\r]/g,"")),s=new Uint8Array(a.length);for(let u=0;u<a.length;++u)s[u]=a.charCodeAt(u);return s}else return n("This environment does not support reading binary tags; either Buffer or atob is required"),i},stringify({comment:i,type:n,value:a},s,u,o){if(!a)return"";const f=a;let h;if(typeof btoa=="function"){let p="";for(let m=0;m<f.length;++m)p+=String.fromCharCode(f[m]);h=btoa(p)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(n??(n=Ae.BLOCK_LITERAL),n!==Ae.QUOTE_DOUBLE){const p=Math.max(s.options.lineWidth-s.indent.length,s.options.minContentWidth),m=Math.ceil(h.length/p),b=new Array(m);for(let g=0,_=0;g<m;++g,_+=p)b[g]=h.substr(_,p);h=b.join(n===Ae.BLOCK_LITERAL?`
426
+ `:" ")}return gd({comment:i,type:n,value:h},s,u,o)}};function wb(i,n){if(Vs(i))for(let a=0;a<i.items.length;++a){let s=i.items[a];if(!ot(s)){if(Ys(s)){s.items.length>1&&n("Each pair must have its own sequence indicator");const u=s.items[0]||new Dt(new Ae(null));if(s.commentBefore&&(u.key.commentBefore=u.key.commentBefore?`${s.commentBefore}
427
+ ${u.key.commentBefore}`:s.commentBefore),s.comment){const o=u.value??u.key;o.comment=o.comment?`${s.comment}
428
+ ${o.comment}`:s.comment}s=u}i.items[a]=ot(s)?s:new Dt(s)}}else n("Expected a sequence for this tag");return i}function Ab(i,n,a){const{replacer:s}=a,u=new va(i);u.tag="tag:yaml.org,2002:pairs";let o=0;if(n&&Symbol.iterator in Object(n))for(let f of n){typeof s=="function"&&(f=s.call(n,String(o++),f));let h,p;if(Array.isArray(f))if(f.length===2)h=f[0],p=f[1];else throw new TypeError(`Expected [key, value] tuple: ${f}`);else if(f&&f instanceof Object){const m=Object.keys(f);if(m.length===1)h=m[0],p=f[h];else throw new TypeError(`Expected tuple with one key, not ${m.length} keys`)}else h=f;u.items.push(bd(h,p,a))}return u}const _d={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:wb,createNode:Ab};class bl extends va{constructor(){super(),this.add=hn.prototype.add.bind(this),this.delete=hn.prototype.delete.bind(this),this.get=hn.prototype.get.bind(this),this.has=hn.prototype.has.bind(this),this.set=hn.prototype.set.bind(this),this.tag=bl.tag}toJSON(n,a){if(!a)return super.toJSON(n);const s=new Map;a!=null&&a.onCreate&&a.onCreate(s);for(const u of this.items){let o,f;if(ot(u)?(o=mn(u.key,"",a),f=mn(u.value,o,a)):o=mn(u,"",a),s.has(o))throw new Error("Ordered maps must not include duplicate keys");s.set(o,f)}return s}static from(n,a,s){const u=Ab(n,a,s),o=new this;return o.items=u.items,o}}bl.tag="tag:yaml.org,2002:omap";const kd={collection:"seq",identify:i=>i instanceof Map,nodeClass:bl,default:!1,tag:"tag:yaml.org,2002:omap",resolve(i,n){const a=wb(i,n),s=[];for(const{key:u}of a.items)Pe(u)&&(s.includes(u.value)?n(`Ordered maps must not include duplicate keys: ${u.value}`):s.push(u.value));return Object.assign(new bl,a)},createNode:(i,n,a)=>bl.from(i,n,a)};function Tb({value:i,source:n},a){return n&&(i?Eb:Nb).test.test(n)?n:i?a.options.trueStr:a.options.falseStr}const Eb={identify:i=>i===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Ae(!0),stringify:Tb},Nb={identify:i=>i===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Ae(!1),stringify:Tb},Tk={identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:i=>i.slice(-3).toLowerCase()==="nan"?NaN:i[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:An},Ek={identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:i=>parseFloat(i.replace(/_/g,"")),stringify(i){const n=Number(i.value);return isFinite(n)?n.toExponential():An(i)}},Nk={identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(i){const n=new Ae(parseFloat(i.replace(/_/g,""))),a=i.indexOf(".");if(a!==-1){const s=i.substring(a+1).replace(/_/g,"");s[s.length-1]==="0"&&(n.minFractionDigits=s.length)}return n},stringify:An},Gs=i=>typeof i=="bigint"||Number.isInteger(i);function Xu(i,n,a,{intAsBigInt:s}){const u=i[0];if((u==="-"||u==="+")&&(n+=1),i=i.substring(n).replace(/_/g,""),s){switch(a){case 2:i=`0b${i}`;break;case 8:i=`0o${i}`;break;case 16:i=`0x${i}`;break}const f=BigInt(i);return u==="-"?BigInt(-1)*f:f}const o=parseInt(i,a);return u==="-"?-1*o:o}function wd(i,n,a){const{value:s}=i;if(Gs(s)){const u=s.toString(n);return s<0?"-"+a+u.substr(1):a+u}return An(i)}const Ck={identify:Gs,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(i,n,a)=>Xu(i,2,2,a),stringify:i=>wd(i,2,"0b")},Ok={identify:Gs,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(i,n,a)=>Xu(i,1,8,a),stringify:i=>wd(i,8,"0")},Mk={identify:Gs,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(i,n,a)=>Xu(i,0,10,a),stringify:An},jk={identify:Gs,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(i,n,a)=>Xu(i,2,16,a),stringify:i=>wd(i,16,"0x")};class vl extends hn{constructor(n){super(n),this.tag=vl.tag}add(n){let a;ot(n)?a=n:n&&typeof n=="object"&&"key"in n&&"value"in n&&n.value===null?a=new Dt(n.key,null):a=new Dt(n,null),da(this.items,a.key)||this.items.push(a)}get(n,a){const s=da(this.items,n);return!a&&ot(s)?Pe(s.key)?s.key.value:s.key:s}set(n,a){if(typeof a!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof a}`);const s=da(this.items,n);s&&!a?this.items.splice(this.items.indexOf(s),1):!s&&a&&this.items.push(new Dt(n))}toJSON(n,a){return super.toJSON(n,a,Set)}toString(n,a,s){if(!n)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},n,{allNullValues:!0}),a,s);throw new Error("Set items must all have null values")}static from(n,a,s){const{replacer:u}=s,o=new this(n);if(a&&Symbol.iterator in Object(a))for(let f of a)typeof u=="function"&&(f=u.call(a,f,f)),o.items.push(bd(f,null,s));return o}}vl.tag="tag:yaml.org,2002:set";const Ad={collection:"map",identify:i=>i instanceof Set,nodeClass:vl,default:!1,tag:"tag:yaml.org,2002:set",createNode:(i,n,a)=>vl.from(i,n,a),resolve(i,n){if(Ys(i)){if(i.hasAllNullValues(!0))return Object.assign(new vl,i);n("Set items must all have null values")}else n("Expected a mapping for this tag");return i}};function Td(i,n){const a=i[0],s=a==="-"||a==="+"?i.substring(1):i,u=f=>n?BigInt(f):Number(f),o=s.replace(/_/g,"").split(":").reduce((f,h)=>f*u(60)+u(h),u(0));return a==="-"?u(-1)*o:o}function Cb(i){let{value:n}=i,a=f=>f;if(typeof n=="bigint")a=f=>BigInt(f);else if(isNaN(n)||!isFinite(n))return An(i);let s="";n<0&&(s="-",n*=a(-1));const u=a(60),o=[n%u];return n<60?o.unshift(0):(n=(n-o[0])/u,o.unshift(n%u),n>=60&&(n=(n-o[0])/u,o.unshift(n))),s+o.map(f=>String(f).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const Ob={identify:i=>typeof i=="bigint"||Number.isInteger(i),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(i,n,{intAsBigInt:a})=>Td(i,a),stringify:Cb},Mb={identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:i=>Td(i,!1),stringify:Cb},Ju={identify:i=>i instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(i){const n=i.match(Ju.test);if(!n)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,a,s,u,o,f,h]=n.map(Number),p=n[7]?Number((n[7]+"00").substr(1,3)):0;let m=Date.UTC(a,s-1,u,o||0,f||0,h||0,p);const b=n[8];if(b&&b!=="Z"){let g=Td(b,!1);Math.abs(g)<30&&(g*=60),m-=6e4*g}return new Date(m)},stringify:({value:i})=>(i==null?void 0:i.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},yg=[Tl,El,Zu,Qu,Eb,Nb,Ck,Ok,Mk,jk,Tk,Ek,Nk,Sd,oi,kd,_d,Ad,Ob,Mb,Ju],gg=new Map([["core",_k],["failsafe",[Tl,El,Zu]],["json",Ak],["yaml11",yg],["yaml-1.1",yg]]),bg={binary:Sd,bool:vd,float:vb,floatExp:bb,floatNaN:gb,floatTime:Mb,int:_b,intHex:kb,intOct:Sb,intTime:Ob,map:Tl,merge:oi,null:Qu,omap:kd,pairs:_d,seq:El,set:Ad,timestamp:Ju},Dk={"tag:yaml.org,2002:binary":Sd,"tag:yaml.org,2002:merge":oi,"tag:yaml.org,2002:omap":kd,"tag:yaml.org,2002:pairs":_d,"tag:yaml.org,2002:set":Ad,"tag:yaml.org,2002:timestamp":Ju};function Df(i,n,a){const s=gg.get(n);if(s&&!i)return a&&!s.includes(oi)?s.concat(oi):s.slice();let u=s;if(!u)if(Array.isArray(i))u=[];else{const o=Array.from(gg.keys()).filter(f=>f!=="yaml11").map(f=>JSON.stringify(f)).join(", ");throw new Error(`Unknown schema "${n}"; use one of ${o} or define customTags array`)}if(Array.isArray(i))for(const o of i)u=u.concat(o);else typeof i=="function"&&(u=i(u.slice()));return a&&(u=u.concat(oi)),u.reduce((o,f)=>{const h=typeof f=="string"?bg[f]:f;if(!h){const p=JSON.stringify(f),m=Object.keys(bg).map(b=>JSON.stringify(b)).join(", ");throw new Error(`Unknown custom tag ${p}; use one of ${m}`)}return o.includes(h)||o.push(h),o},[])}const zk=(i,n)=>i.key<n.key?-1:i.key>n.key?1:0;class Ed{constructor({compat:n,customTags:a,merge:s,resolveKnownTags:u,schema:o,sortMapEntries:f,toStringDefaults:h}){this.compat=Array.isArray(n)?Df(n,"compat"):n?Df(null,n):null,this.name=typeof o=="string"&&o||"core",this.knownTags=u?Dk:{},this.tags=Df(a,this.name,s),this.toStringOptions=h??null,Object.defineProperty(this,Ii,{value:Tl}),Object.defineProperty(this,Rn,{value:Zu}),Object.defineProperty(this,wl,{value:El}),this.sortMapEntries=typeof f=="function"?f:f===!0?zk:null}clone(){const n=Object.create(Ed.prototype,Object.getOwnPropertyDescriptors(this));return n.tags=this.tags.slice(),n}}function Rk(i,n){var p;const a=[];let s=n.directives===!0;if(n.directives!==!1&&i.directives){const m=i.directives.toString(i);m?(a.push(m),s=!0):i.directives.docStart&&(s=!0)}s&&a.push("---");const u=db(i,n),{commentString:o}=u.options;if(i.commentBefore){a.length!==1&&a.unshift("");const m=o(i.commentBefore);a.unshift(ri(m,""))}let f=!1,h=null;if(i.contents){if(ut(i.contents)){if(i.contents.spaceBefore&&s&&a.push(""),i.contents.commentBefore){const g=o(i.contents.commentBefore);a.push(ri(g,""))}u.forceBlockIndent=!!i.comment,h=i.contents.comment}const m=h?void 0:()=>f=!0;let b=_l(i.contents,u,()=>h=null,m);h&&(b+=fa(b,"",o(h))),(b[0]==="|"||b[0]===">")&&a[a.length-1]==="---"?a[a.length-1]=`--- ${b}`:a.push(b)}else a.push(_l(i.contents,u));if((p=i.directives)!=null&&p.docEnd)if(i.comment){const m=o(i.comment);m.includes(`
429
+ `)?(a.push("..."),a.push(ri(m,""))):a.push(`... ${m}`)}else a.push("...");else{let m=i.comment;m&&f&&(m=m.replace(/^\n+/,"")),m&&((!f||h)&&a[a.length-1]!==""&&a.push(""),a.push(ri(o(m),"")))}return a.join(`
430
+ `)+`
431
+ `}class Fu{constructor(n,a,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,pn,{value:td});let u=null;typeof a=="function"||Array.isArray(a)?u=a:s===void 0&&a&&(s=a,a=void 0);const o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=o;let{version:f}=o;s!=null&&s._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(f=this.directives.yaml.version)):this.directives=new Mt({version:f}),this.setSchema(f,s),this.contents=n===void 0?null:this.createNode(n,u,s)}clone(){const n=Object.create(Fu.prototype,{[pn]:{value:td}});return n.commentBefore=this.commentBefore,n.comment=this.comment,n.errors=this.errors.slice(),n.warnings=this.warnings.slice(),n.options=Object.assign({},this.options),this.directives&&(n.directives=this.directives.clone()),n.schema=this.schema.clone(),n.contents=ut(this.contents)?this.contents.clone(n.schema):this.contents,this.range&&(n.range=this.range.slice()),n}add(n){ol(this.contents)&&this.contents.add(n)}addIn(n,a){ol(this.contents)&&this.contents.addIn(n,a)}createAlias(n,a){if(!n.anchor){const s=rb(this);n.anchor=!a||s.has(a)?ub(a||"a",s):a}return new yd(n.anchor)}createNode(n,a,s){let u;if(typeof a=="function")n=a.call({"":n},"",n),u=a;else if(Array.isArray(a)){const j=H=>typeof H=="number"||H instanceof String||H instanceof Number,E=a.filter(j).map(String);E.length>0&&(a=a.concat(E)),u=a}else s===void 0&&a&&(s=a,a=void 0);const{aliasDuplicateObjects:o,anchorPrefix:f,flow:h,keepUndefined:p,onTagObj:m,tag:b}=s??{},{onAnchor:g,setAnchors:_,sourceObjects:v}=ok(this,f||"a"),O={aliasDuplicateObjects:o??!0,keepUndefined:p??!1,onAnchor:g,onTagObj:m,replacer:u,schema:this.schema,sourceObjects:v},w=qs(n,b,O);return h&&rt(w)&&(w.flow=!0),_(),w}createPair(n,a,s={}){const u=this.createNode(n,null,s),o=this.createNode(a,null,s);return new Dt(u,o)}delete(n){return ol(this.contents)?this.contents.delete(n):!1}deleteIn(n){return Ns(n)?this.contents==null?!1:(this.contents=null,!0):ol(this.contents)?this.contents.deleteIn(n):!1}get(n,a){return rt(this.contents)?this.contents.get(n,a):void 0}getIn(n,a){return Ns(n)?!a&&Pe(this.contents)?this.contents.value:this.contents:rt(this.contents)?this.contents.getIn(n,a):void 0}has(n){return rt(this.contents)?this.contents.has(n):!1}hasIn(n){return Ns(n)?this.contents!==void 0:rt(this.contents)?this.contents.hasIn(n):!1}set(n,a){this.contents==null?this.contents=qu(this.schema,[n],a):ol(this.contents)&&this.contents.set(n,a)}setIn(n,a){Ns(n)?this.contents=a:this.contents==null?this.contents=qu(this.schema,Array.from(n),a):ol(this.contents)&&this.contents.setIn(n,a)}setSchema(n,a={}){typeof n=="number"&&(n=String(n));let s;switch(n){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Mt({version:"1.1"}),s={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=n:this.directives=new Mt({version:n}),s={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=null;break;default:{const u=JSON.stringify(n);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${u}`)}}if(a.schema instanceof Object)this.schema=a.schema;else if(s)this.schema=new Ed(Object.assign(s,a));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:n,jsonArg:a,mapAsMap:s,maxAliasCount:u,onAnchor:o,reviver:f}={}){const h={anchors:new Map,doc:this,keep:!n,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof u=="number"?u:100},p=mn(this.contents,a??"",h);if(typeof o=="function")for(const{count:m,res:b}of h.anchors.values())o(b,m);return typeof f=="function"?hl(f,{"":p},"",p):p}toJSON(n,a){return this.toJS({json:!0,jsonArg:n,mapAsMap:!1,onAnchor:a})}toString(n={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in n&&(!Number.isInteger(n.indent)||Number(n.indent)<=0)){const a=JSON.stringify(n.indent);throw new Error(`"indent" option must be a positive integer, not ${a}`)}return Rk(this,n)}}function ol(i){if(rt(i))return!0;throw new Error("Expected a YAML collection as document contents")}class jb extends Error{constructor(n,a,s,u){super(),this.name=n,this.code=s,this.message=u,this.pos=a}}class Cs extends jb{constructor(n,a,s){super("YAMLParseError",n,a,s)}}class Lk extends jb{constructor(n,a,s){super("YAMLWarning",n,a,s)}}const vg=(i,n)=>a=>{if(a.pos[0]===-1)return;a.linePos=a.pos.map(h=>n.linePos(h));const{line:s,col:u}=a.linePos[0];a.message+=` at line ${s}, column ${u}`;let o=u-1,f=i.substring(n.lineStarts[s-1],n.lineStarts[s]).replace(/[\n\r]+$/,"");if(o>=60&&f.length>80){const h=Math.min(o-39,f.length-79);f="…"+f.substring(h),o-=h-1}if(f.length>80&&(f=f.substring(0,79)+"…"),s>1&&/^ *$/.test(f.substring(0,o))){let h=i.substring(n.lineStarts[s-2],n.lineStarts[s-1]);h.length>80&&(h=h.substring(0,79)+`…
432
+ `),f=h+f}if(/[^ ]/.test(f)){let h=1;const p=a.linePos[1];(p==null?void 0:p.line)===s&&p.col>u&&(h=Math.max(1,Math.min(p.col-u,80-o)));const m=" ".repeat(o)+"^".repeat(h);a.message+=`:
433
+
434
+ ${f}
435
+ ${m}
436
+ `}};function kl(i,{flow:n,indicator:a,next:s,offset:u,onError:o,parentIndent:f,startOnNewline:h}){let p=!1,m=h,b=h,g="",_="",v=!1,O=!1,w=null,j=null,E=null,H=null,I=null,Q=null,F=null;for(const J of i)switch(O&&(J.type!=="space"&&J.type!=="newline"&&J.type!=="comma"&&o(J.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),O=!1),w&&(m&&J.type!=="comment"&&J.type!=="newline"&&o(w,"TAB_AS_INDENT","Tabs are not allowed as indentation"),w=null),J.type){case"space":!n&&(a!=="doc-start"||(s==null?void 0:s.type)!=="flow-collection")&&J.source.includes(" ")&&(w=J),b=!0;break;case"comment":{b||o(J,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const le=J.source.substring(1)||" ";g?g+=_+le:g=le,_="",m=!1;break}case"newline":m?g?g+=J.source:(!Q||a!=="seq-item-ind")&&(p=!0):_+=J.source,m=!0,v=!0,(j||E)&&(H=J),b=!0;break;case"anchor":j&&o(J,"MULTIPLE_ANCHORS","A node can have at most one anchor"),J.source.endsWith(":")&&o(J.offset+J.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),j=J,F??(F=J.offset),m=!1,b=!1,O=!0;break;case"tag":{E&&o(J,"MULTIPLE_TAGS","A node can have at most one tag"),E=J,F??(F=J.offset),m=!1,b=!1,O=!0;break}case a:(j||E)&&o(J,"BAD_PROP_ORDER",`Anchors and tags must be after the ${J.source} indicator`),Q&&o(J,"UNEXPECTED_TOKEN",`Unexpected ${J.source} in ${n??"collection"}`),Q=J,m=a==="seq-item-ind"||a==="explicit-key-ind",b=!1;break;case"comma":if(n){I&&o(J,"UNEXPECTED_TOKEN",`Unexpected , in ${n}`),I=J,m=!1,b=!1;break}default:o(J,"UNEXPECTED_TOKEN",`Unexpected ${J.type} token`),m=!1,b=!1}const L=i[i.length-1],Z=L?L.offset+L.source.length:u;return O&&s&&s.type!=="space"&&s.type!=="newline"&&s.type!=="comma"&&(s.type!=="scalar"||s.source!=="")&&o(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w&&(m&&w.indent<=f||(s==null?void 0:s.type)==="block-map"||(s==null?void 0:s.type)==="block-seq")&&o(w,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:I,found:Q,spaceBefore:p,comment:g,hasNewline:v,anchor:j,tag:E,newlineAfterProp:H,end:Z,start:F??Z}}function Us(i){if(!i)return null;switch(i.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(i.source.includes(`
437
+ `))return!0;if(i.end){for(const n of i.end)if(n.type==="newline")return!0}return!1;case"flow-collection":for(const n of i.items){for(const a of n.start)if(a.type==="newline")return!0;if(n.sep){for(const a of n.sep)if(a.type==="newline")return!0}if(Us(n.key)||Us(n.value))return!0}return!1;default:return!0}}function ld(i,n,a){if((n==null?void 0:n.type)==="flow-collection"){const s=n.end[0];s.indent===i&&(s.source==="]"||s.source==="}")&&Us(n)&&a(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Db(i,n,a){const{uniqueKeys:s}=i.options;if(s===!1)return!1;const u=typeof s=="function"?s:(o,f)=>o===f||Pe(o)&&Pe(f)&&o.value===f.value;return n.some(o=>u(o.key,a))}const xg="All mapping items must start at the same column";function Bk({composeNode:i,composeEmptyNode:n},a,s,u,o){var b;const f=(o==null?void 0:o.nodeClass)??hn,h=new f(a.schema);a.atRoot&&(a.atRoot=!1);let p=s.offset,m=null;for(const g of s.items){const{start:_,key:v,sep:O,value:w}=g,j=kl(_,{indicator:"explicit-key-ind",next:v??(O==null?void 0:O[0]),offset:p,onError:u,parentIndent:s.indent,startOnNewline:!0}),E=!j.found;if(E){if(v&&(v.type==="block-seq"?u(p,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in v&&v.indent!==s.indent&&u(p,"BAD_INDENT",xg)),!j.anchor&&!j.tag&&!O){m=j.end,j.comment&&(h.comment?h.comment+=`
438
+ `+j.comment:h.comment=j.comment);continue}(j.newlineAfterProp||Us(v))&&u(v??_[_.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((b=j.found)==null?void 0:b.indent)!==s.indent&&u(p,"BAD_INDENT",xg);a.atKey=!0;const H=j.end,I=v?i(a,v,j,u):n(a,H,_,null,j,u);a.schema.compat&&ld(s.indent,v,u),a.atKey=!1,Db(a,h.items,I)&&u(H,"DUPLICATE_KEY","Map keys must be unique");const Q=kl(O??[],{indicator:"map-value-ind",next:w,offset:I.range[2],onError:u,parentIndent:s.indent,startOnNewline:!v||v.type==="block-scalar"});if(p=Q.end,Q.found){E&&((w==null?void 0:w.type)==="block-map"&&!Q.hasNewline&&u(p,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),a.options.strict&&j.start<Q.found.offset-1024&&u(I.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const F=w?i(a,w,Q,u):n(a,p,O,null,Q,u);a.schema.compat&&ld(s.indent,w,u),p=F.range[2];const L=new Dt(I,F);a.options.keepSourceTokens&&(L.srcToken=g),h.items.push(L)}else{E&&u(I.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),Q.comment&&(I.comment?I.comment+=`
439
+ `+Q.comment:I.comment=Q.comment);const F=new Dt(I);a.options.keepSourceTokens&&(F.srcToken=g),h.items.push(F)}}return m&&m<p&&u(m,"IMPOSSIBLE","Map comment with trailing content"),h.range=[s.offset,p,m??p],h}function qk({composeNode:i,composeEmptyNode:n},a,s,u,o){const f=(o==null?void 0:o.nodeClass)??va,h=new f(a.schema);a.atRoot&&(a.atRoot=!1),a.atKey&&(a.atKey=!1);let p=s.offset,m=null;for(const{start:b,value:g}of s.items){const _=kl(b,{indicator:"seq-item-ind",next:g,offset:p,onError:u,parentIndent:s.indent,startOnNewline:!0});if(!_.found)if(_.anchor||_.tag||g)(g==null?void 0:g.type)==="block-seq"?u(_.end,"BAD_INDENT","All sequence items must start at the same column"):u(p,"MISSING_CHAR","Sequence item without - indicator");else{m=_.end,_.comment&&(h.comment=_.comment);continue}const v=g?i(a,g,_,u):n(a,_.end,b,null,_,u);a.schema.compat&&ld(s.indent,g,u),p=v.range[2],h.items.push(v)}return h.range=[s.offset,p,m??p],h}function Ks(i,n,a,s){let u="";if(i){let o=!1,f="";for(const h of i){const{source:p,type:m}=h;switch(m){case"space":o=!0;break;case"comment":{a&&!o&&s(h,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const b=p.substring(1)||" ";u?u+=f+b:u=b,f="";break}case"newline":u&&(f+=p),o=!0;break;default:s(h,"UNEXPECTED_TOKEN",`Unexpected ${m} at node end`)}n+=p.length}}return{comment:u,offset:n}}const zf="Block collections are not allowed within flow collections",Rf=i=>i&&(i.type==="block-map"||i.type==="block-seq");function Uk({composeNode:i,composeEmptyNode:n},a,s,u,o){var j;const f=s.start.source==="{",h=f?"flow map":"flow sequence",p=(o==null?void 0:o.nodeClass)??(f?hn:va),m=new p(a.schema);m.flow=!0;const b=a.atRoot;b&&(a.atRoot=!1),a.atKey&&(a.atKey=!1);let g=s.offset+s.start.source.length;for(let E=0;E<s.items.length;++E){const H=s.items[E],{start:I,key:Q,sep:F,value:L}=H,Z=kl(I,{flow:h,indicator:"explicit-key-ind",next:Q??(F==null?void 0:F[0]),offset:g,onError:u,parentIndent:s.indent,startOnNewline:!1});if(!Z.found){if(!Z.anchor&&!Z.tag&&!F&&!L){E===0&&Z.comma?u(Z.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${h}`):E<s.items.length-1&&u(Z.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${h}`),Z.comment&&(m.comment?m.comment+=`
440
+ `+Z.comment:m.comment=Z.comment),g=Z.end;continue}!f&&a.options.strict&&Us(Q)&&u(Q,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(E===0)Z.comma&&u(Z.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${h}`);else if(Z.comma||u(Z.start,"MISSING_CHAR",`Missing , between ${h} items`),Z.comment){let J="";e:for(const le of I)switch(le.type){case"comma":case"space":break;case"comment":J=le.source.substring(1);break e;default:break e}if(J){let le=m.items[m.items.length-1];ot(le)&&(le=le.value??le.key),le.comment?le.comment+=`
441
+ `+J:le.comment=J,Z.comment=Z.comment.substring(J.length+1)}}if(!f&&!F&&!Z.found){const J=L?i(a,L,Z,u):n(a,Z.end,F,null,Z,u);m.items.push(J),g=J.range[2],Rf(L)&&u(J.range,"BLOCK_IN_FLOW",zf)}else{a.atKey=!0;const J=Z.end,le=Q?i(a,Q,Z,u):n(a,J,I,null,Z,u);Rf(Q)&&u(le.range,"BLOCK_IN_FLOW",zf),a.atKey=!1;const ye=kl(F??[],{flow:h,indicator:"map-value-ind",next:L,offset:le.range[2],onError:u,parentIndent:s.indent,startOnNewline:!1});if(ye.found){if(!f&&!Z.found&&a.options.strict){if(F)for(const ke of F){if(ke===ye.found)break;if(ke.type==="newline"){u(ke,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}Z.start<ye.found.offset-1024&&u(ye.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else L&&("source"in L&&((j=L.source)==null?void 0:j[0])===":"?u(L,"MISSING_CHAR",`Missing space after : in ${h}`):u(ye.start,"MISSING_CHAR",`Missing , or : between ${h} items`));const ie=L?i(a,L,ye,u):ye.found?n(a,ye.end,F,null,ye,u):null;ie?Rf(L)&&u(ie.range,"BLOCK_IN_FLOW",zf):ye.comment&&(le.comment?le.comment+=`
442
+ `+ye.comment:le.comment=ye.comment);const P=new Dt(le,ie);if(a.options.keepSourceTokens&&(P.srcToken=H),f){const ke=m;Db(a,ke.items,le)&&u(J,"DUPLICATE_KEY","Map keys must be unique"),ke.items.push(P)}else{const ke=new hn(a.schema);ke.flow=!0,ke.items.push(P);const Ce=(ie??le).range;ke.range=[le.range[0],Ce[1],Ce[2]],m.items.push(ke)}g=ie?ie.range[2]:ye.end}}const _=f?"}":"]",[v,...O]=s.end;let w=g;if((v==null?void 0:v.source)===_)w=v.offset+v.source.length;else{const E=h[0].toUpperCase()+h.substring(1),H=b?`${E} must end with a ${_}`:`${E} in block collection must be sufficiently indented and end with a ${_}`;u(g,b?"MISSING_CHAR":"BAD_INDENT",H),v&&v.source.length!==1&&O.unshift(v)}if(O.length>0){const E=Ks(O,w,a.options.strict,u);E.comment&&(m.comment?m.comment+=`
443
+ `+E.comment:m.comment=E.comment),m.range=[s.offset,w,E.offset]}else m.range=[s.offset,w,w];return m}function Lf(i,n,a,s,u,o){const f=a.type==="block-map"?Bk(i,n,a,s,o):a.type==="block-seq"?qk(i,n,a,s,o):Uk(i,n,a,s,o),h=f.constructor;return u==="!"||u===h.tagName?(f.tag=h.tagName,f):(u&&(f.tag=u),f)}function Ik(i,n,a,s,u){var _;const o=s.tag,f=o?n.directives.tagName(o.source,v=>u(o,"TAG_RESOLVE_FAILED",v)):null;if(a.type==="block-seq"){const{anchor:v,newlineAfterProp:O}=s,w=v&&o?v.offset>o.offset?v:o:v??o;w&&(!O||O.offset<w.offset)&&u(w,"MISSING_CHAR","Missing newline after block sequence props")}const h=a.type==="block-map"?"map":a.type==="block-seq"?"seq":a.start.source==="{"?"map":"seq";if(!o||!f||f==="!"||f===hn.tagName&&h==="map"||f===va.tagName&&h==="seq")return Lf(i,n,a,u,f);let p=n.schema.tags.find(v=>v.tag===f&&v.collection===h);if(!p){const v=n.schema.knownTags[f];if((v==null?void 0:v.collection)===h)n.schema.tags.push(Object.assign({},v,{default:!1})),p=v;else return v?u(o,"BAD_COLLECTION_TYPE",`${v.tag} used for ${h} collection, but expects ${v.collection??"scalar"}`,!0):u(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${f}`,!0),Lf(i,n,a,u,f)}const m=Lf(i,n,a,u,f,p),b=((_=p.resolve)==null?void 0:_.call(p,m,v=>u(o,"TAG_RESOLVE_FAILED",v),n.options))??m,g=ut(b)?b:new Ae(b);return g.range=m.range,g.tag=f,p!=null&&p.format&&(g.format=p.format),g}function Hk(i,n,a){const s=n.offset,u=Yk(n,i.options.strict,a);if(!u)return{value:"",type:null,comment:"",range:[s,s,s]};const o=u.mode===">"?Ae.BLOCK_FOLDED:Ae.BLOCK_LITERAL,f=n.source?Vk(n.source):[];let h=f.length;for(let w=f.length-1;w>=0;--w){const j=f[w][1];if(j===""||j==="\r")h=w;else break}if(h===0){const w=u.chomp==="+"&&f.length>0?`
444
+ `.repeat(Math.max(1,f.length-1)):"";let j=s+u.length;return n.source&&(j+=n.source.length),{value:w,type:o,comment:u.comment,range:[s,j,j]}}let p=n.indent+u.indent,m=n.offset+u.length,b=0;for(let w=0;w<h;++w){const[j,E]=f[w];if(E===""||E==="\r")u.indent===0&&j.length>p&&(p=j.length);else{j.length<p&&a(m+j.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),u.indent===0&&(p=j.length),b=w,p===0&&!i.atRoot&&a(m,"BAD_INDENT","Block scalar values in collections must be indented");break}m+=j.length+E.length+1}for(let w=f.length-1;w>=h;--w)f[w][0].length>p&&(h=w+1);let g="",_="",v=!1;for(let w=0;w<b;++w)g+=f[w][0].slice(p)+`
445
+ `;for(let w=b;w<h;++w){let[j,E]=f[w];m+=j.length+E.length+1;const H=E[E.length-1]==="\r";if(H&&(E=E.slice(0,-1)),E&&j.length<p){const Q=`Block scalar lines must not be less indented than their ${u.indent?"explicit indentation indicator":"first line"}`;a(m-E.length-(H?2:1),"BAD_INDENT",Q),j=""}o===Ae.BLOCK_LITERAL?(g+=_+j.slice(p)+E,_=`
446
+ `):j.length>p||E[0]===" "?(_===" "?_=`
447
+ `:!v&&_===`
448
+ `&&(_=`
449
+
450
+ `),g+=_+j.slice(p)+E,_=`
451
+ `,v=!0):E===""?_===`
452
+ `?g+=`
453
+ `:_=`
454
+ `:(g+=_+E,_=" ",v=!1)}switch(u.chomp){case"-":break;case"+":for(let w=h;w<f.length;++w)g+=`
455
+ `+f[w][0].slice(p);g[g.length-1]!==`
456
+ `&&(g+=`
457
+ `);break;default:g+=`
458
+ `}const O=s+u.length+n.source.length;return{value:g,type:o,comment:u.comment,range:[s,O,O]}}function Yk({offset:i,props:n},a,s){if(n[0].type!=="block-scalar-header")return s(n[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:u}=n[0],o=u[0];let f=0,h="",p=-1;for(let _=1;_<u.length;++_){const v=u[_];if(!h&&(v==="-"||v==="+"))h=v;else{const O=Number(v);!f&&O?f=O:p===-1&&(p=i+_)}}p!==-1&&s(p,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${u}`);let m=!1,b="",g=u.length;for(let _=1;_<n.length;++_){const v=n[_];switch(v.type){case"space":m=!0;case"newline":g+=v.source.length;break;case"comment":a&&!m&&s(v,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),g+=v.source.length,b=v.source.substring(1);break;case"error":s(v,"UNEXPECTED_TOKEN",v.message),g+=v.source.length;break;default:{const O=`Unexpected token in block scalar header: ${v.type}`;s(v,"UNEXPECTED_TOKEN",O);const w=v.source;w&&typeof w=="string"&&(g+=w.length)}}}return{mode:o,indent:f,chomp:h,comment:b,length:g}}function Vk(i){const n=i.split(/\n( *)/),a=n[0],s=a.match(/^( *)/),o=[s!=null&&s[1]?[s[1],a.slice(s[1].length)]:["",a]];for(let f=1;f<n.length;f+=2)o.push([n[f],n[f+1]]);return o}function Gk(i,n,a){const{offset:s,type:u,source:o,end:f}=i;let h,p;const m=(_,v,O)=>a(s+_,v,O);switch(u){case"scalar":h=Ae.PLAIN,p=Kk(o,m);break;case"single-quoted-scalar":h=Ae.QUOTE_SINGLE,p=Zk(o,m);break;case"double-quoted-scalar":h=Ae.QUOTE_DOUBLE,p=Qk(o,m);break;default:return a(i,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${u}`),{value:"",type:null,comment:"",range:[s,s+o.length,s+o.length]}}const b=s+o.length,g=Ks(f,b,n,a);return{value:p,type:h,comment:g.comment,range:[s,b,g.offset]}}function Kk(i,n){let a="";switch(i[0]){case" ":a="a tab character";break;case",":a="flow indicator character ,";break;case"%":a="directive indicator character %";break;case"|":case">":{a=`block scalar indicator ${i[0]}`;break}case"@":case"`":{a=`reserved character ${i[0]}`;break}}return a&&n(0,"BAD_SCALAR_START",`Plain value cannot start with ${a}`),zb(i)}function Zk(i,n){return(i[i.length-1]!=="'"||i.length===1)&&n(i.length,"MISSING_CHAR","Missing closing 'quote"),zb(i.slice(1,-1)).replace(/''/g,"'")}function zb(i){let n,a;try{n=new RegExp(`(.*?)(?<![ ])[ ]*\r?
459
+ `,"sy"),a=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
460
+ `,"sy")}catch{n=/(.*?)[ \t]*\r?\n/sy,a=/[ \t]*(.*?)[ \t]*\r?\n/sy}let s=n.exec(i);if(!s)return i;let u=s[1],o=" ",f=n.lastIndex;for(a.lastIndex=f;s=a.exec(i);)s[1]===""?o===`
461
+ `?u+=o:o=`
462
+ `:(u+=o+s[1],o=" "),f=a.lastIndex;const h=/[ \t]*(.*)/sy;return h.lastIndex=f,s=h.exec(i),u+o+((s==null?void 0:s[1])??"")}function Qk(i,n){let a="";for(let s=1;s<i.length-1;++s){const u=i[s];if(!(u==="\r"&&i[s+1]===`
463
+ `))if(u===`
464
+ `){const{fold:o,offset:f}=$k(i,s);a+=o,s=f}else if(u==="\\"){let o=i[++s];const f=Xk[o];if(f)a+=f;else if(o===`
465
+ `)for(o=i[s+1];o===" "||o===" ";)o=i[++s+1];else if(o==="\r"&&i[s+1]===`
466
+ `)for(o=i[++s+1];o===" "||o===" ";)o=i[++s+1];else if(o==="x"||o==="u"||o==="U"){const h={x:2,u:4,U:8}[o];a+=Jk(i,s+1,h,n),s+=h}else{const h=i.substr(s-1,2);n(s-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${h}`),a+=h}}else if(u===" "||u===" "){const o=s;let f=i[s+1];for(;f===" "||f===" ";)f=i[++s+1];f!==`
467
+ `&&!(f==="\r"&&i[s+2]===`
468
+ `)&&(a+=s>o?i.slice(o,s+1):u)}else a+=u}return(i[i.length-1]!=='"'||i.length===1)&&n(i.length,"MISSING_CHAR",'Missing closing "quote'),a}function $k(i,n){let a="",s=i[n+1];for(;(s===" "||s===" "||s===`
469
+ `||s==="\r")&&!(s==="\r"&&i[n+2]!==`
470
+ `);)s===`
471
+ `&&(a+=`
472
+ `),n+=1,s=i[n+1];return a||(a=" "),{fold:a,offset:n}}const Xk={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
473
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Jk(i,n,a,s){const u=i.substr(n,a),f=u.length===a&&/^[0-9a-fA-F]+$/.test(u)?parseInt(u,16):NaN;if(isNaN(f)){const h=i.substr(n-2,a+2);return s(n-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${h}`),h}return String.fromCodePoint(f)}function Rb(i,n,a,s){const{value:u,type:o,comment:f,range:h}=n.type==="block-scalar"?Hk(i,n,s):Gk(n,i.options.strict,s),p=a?i.directives.tagName(a.source,g=>s(a,"TAG_RESOLVE_FAILED",g)):null;let m;i.options.stringKeys&&i.atKey?m=i.schema[Rn]:p?m=Fk(i.schema,u,p,a,s):n.type==="scalar"?m=Wk(i,u,n,s):m=i.schema[Rn];let b;try{const g=m.resolve(u,_=>s(a??n,"TAG_RESOLVE_FAILED",_),i.options);b=Pe(g)?g:new Ae(g)}catch(g){const _=g instanceof Error?g.message:String(g);s(a??n,"TAG_RESOLVE_FAILED",_),b=new Ae(u)}return b.range=h,b.source=u,o&&(b.type=o),p&&(b.tag=p),m.format&&(b.format=m.format),f&&(b.comment=f),b}function Fk(i,n,a,s,u){var h;if(a==="!")return i[Rn];const o=[];for(const p of i.tags)if(!p.collection&&p.tag===a)if(p.default&&p.test)o.push(p);else return p;for(const p of o)if((h=p.test)!=null&&h.test(n))return p;const f=i.knownTags[a];return f&&!f.collection?(i.tags.push(Object.assign({},f,{default:!1,test:void 0})),f):(u(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,a!=="tag:yaml.org,2002:str"),i[Rn])}function Wk({atKey:i,directives:n,schema:a},s,u,o){const f=a.tags.find(h=>{var p;return(h.default===!0||i&&h.default==="key")&&((p=h.test)==null?void 0:p.test(s))})||a[Rn];if(a.compat){const h=a.compat.find(p=>{var m;return p.default&&((m=p.test)==null?void 0:m.test(s))})??a[Rn];if(f.tag!==h.tag){const p=n.tagString(f.tag),m=n.tagString(h.tag),b=`Value may be parsed as either ${p} or ${m}`;o(u,"TAG_RESOLVE_FAILED",b,!0)}}return f}function Pk(i,n,a){if(n){a??(a=n.length);for(let s=a-1;s>=0;--s){let u=n[s];switch(u.type){case"space":case"comment":case"newline":i-=u.source.length;continue}for(u=n[++s];(u==null?void 0:u.type)==="space";)i+=u.source.length,u=n[++s];break}}return i}const ew={composeNode:Lb,composeEmptyNode:Nd};function Lb(i,n,a,s){const u=i.atKey,{spaceBefore:o,comment:f,anchor:h,tag:p}=a;let m,b=!0;switch(n.type){case"alias":m=tw(i,n,s),(h||p)&&s(n,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":m=Rb(i,n,p,s),h&&(m.anchor=h.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":m=Ik(ew,i,n,a,s),h&&(m.anchor=h.source.substring(1));break;default:{const g=n.type==="error"?n.message:`Unsupported token (type: ${n.type})`;s(n,"UNEXPECTED_TOKEN",g),m=Nd(i,n.offset,void 0,null,a,s),b=!1}}return h&&m.anchor===""&&s(h,"BAD_ALIAS","Anchor cannot be an empty string"),u&&i.options.stringKeys&&(!Pe(m)||typeof m.value!="string"||m.tag&&m.tag!=="tag:yaml.org,2002:str")&&s(p??n,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(m.spaceBefore=!0),f&&(n.type==="scalar"&&n.source===""?m.comment=f:m.commentBefore=f),i.options.keepSourceTokens&&b&&(m.srcToken=n),m}function Nd(i,n,a,s,{spaceBefore:u,comment:o,anchor:f,tag:h,end:p},m){const b={type:"scalar",offset:Pk(n,a,s),indent:-1,source:""},g=Rb(i,b,h,m);return f&&(g.anchor=f.source.substring(1),g.anchor===""&&m(f,"BAD_ALIAS","Anchor cannot be an empty string")),u&&(g.spaceBefore=!0),o&&(g.comment=o,g.range[2]=p),g}function tw({options:i},{offset:n,source:a,end:s},u){const o=new yd(a.substring(1));o.source===""&&u(n,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&u(n+a.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const f=n+a.length,h=Ks(s,f,i.strict,u);return o.range=[n,f,h.offset],h.comment&&(o.comment=h.comment),o}function nw(i,n,{offset:a,start:s,value:u,end:o},f){const h=Object.assign({_directives:n},i),p=new Fu(void 0,h),m={atKey:!1,atRoot:!0,directives:p.directives,options:p.options,schema:p.schema},b=kl(s,{indicator:"doc-start",next:u??(o==null?void 0:o[0]),offset:a,onError:f,parentIndent:0,startOnNewline:!0});b.found&&(p.directives.docStart=!0,u&&(u.type==="block-map"||u.type==="block-seq")&&!b.hasNewline&&f(b.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),p.contents=u?Lb(m,u,b,f):Nd(m,b.end,s,null,b,f);const g=p.contents.range[2],_=Ks(o,g,!1,f);return _.comment&&(p.comment=_.comment),p.range=[a,g,_.offset],p}function ks(i){if(typeof i=="number")return[i,i+1];if(Array.isArray(i))return i.length===2?i:[i[0],i[1]];const{offset:n,source:a}=i;return[n,n+(typeof a=="string"?a.length:1)]}function Sg(i){var u;let n="",a=!1,s=!1;for(let o=0;o<i.length;++o){const f=i[o];switch(f[0]){case"#":n+=(n===""?"":s?`
474
+
475
+ `:`
476
+ `)+(f.substring(1)||" "),a=!0,s=!1;break;case"%":((u=i[o+1])==null?void 0:u[0])!=="#"&&(o+=1),a=!1;break;default:a||(s=!0),a=!1}}return{comment:n,afterEmptyLine:s}}class iw{constructor(n={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(a,s,u,o)=>{const f=ks(a);o?this.warnings.push(new Lk(f,s,u)):this.errors.push(new Cs(f,s,u))},this.directives=new Mt({version:n.version||"1.2"}),this.options=n}decorate(n,a){const{comment:s,afterEmptyLine:u}=Sg(this.prelude);if(s){const o=n.contents;if(a)n.comment=n.comment?`${n.comment}
477
+ ${s}`:s;else if(u||n.directives.docStart||!o)n.commentBefore=s;else if(rt(o)&&!o.flow&&o.items.length>0){let f=o.items[0];ot(f)&&(f=f.key);const h=f.commentBefore;f.commentBefore=h?`${s}
478
+ ${h}`:s}else{const f=o.commentBefore;o.commentBefore=f?`${s}
479
+ ${f}`:s}}a?(Array.prototype.push.apply(n.errors,this.errors),Array.prototype.push.apply(n.warnings,this.warnings)):(n.errors=this.errors,n.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Sg(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(n,a=!1,s=-1){for(const u of n)yield*this.next(u);yield*this.end(a,s)}*next(n){switch(n.type){case"directive":this.directives.add(n.source,(a,s,u)=>{const o=ks(n);o[0]+=a,this.onError(o,"BAD_DIRECTIVE",s,u)}),this.prelude.push(n.source),this.atDirectives=!0;break;case"document":{const a=nw(this.options,this.directives,n,this.onError);this.atDirectives&&!a.directives.docStart&&this.onError(n,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(a,!1),this.doc&&(yield this.doc),this.doc=a,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(n.source);break;case"error":{const a=n.source?`${n.message}: ${JSON.stringify(n.source)}`:n.message,s=new Cs(ks(n),"UNEXPECTED_TOKEN",a);this.atDirectives||!this.doc?this.errors.push(s):this.doc.errors.push(s);break}case"doc-end":{if(!this.doc){const s="Unexpected doc-end without preceding document";this.errors.push(new Cs(ks(n),"UNEXPECTED_TOKEN",s));break}this.doc.directives.docEnd=!0;const a=Ks(n.end,n.offset+n.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),a.comment){const s=this.doc.comment;this.doc.comment=s?`${s}
480
+ ${a.comment}`:a.comment}this.doc.range[2]=a.offset;break}default:this.errors.push(new Cs(ks(n),"UNEXPECTED_TOKEN",`Unsupported token ${n.type}`))}}*end(n=!1,a=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(n){const s=Object.assign({_directives:this.directives},this.options),u=new Fu(void 0,s);this.atDirectives&&this.onError(a,"MISSING_CHAR","Missing directives-end indicator line"),u.range=[0,a,a],this.decorate(u,!1),yield u}}}const Bb="\uFEFF",qb="",Ub="",sd="";function aw(i){switch(i){case Bb:return"byte-order-mark";case qb:return"doc-mode";case Ub:return"flow-error-end";case sd:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
481
+ `:case`\r
482
+ `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(i[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function _n(i){switch(i){case void 0:case" ":case`
483
+ `:case"\r":case" ":return!0;default:return!1}}const _g=new Set("0123456789ABCDEFabcdef"),lw=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),pu=new Set(",[]{}"),sw=new Set(` ,[]{}
484
+ \r `),Bf=i=>!i||sw.has(i);class rw{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(n,a=!1){if(n){if(typeof n!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+n:n,this.lineEndPos=null}this.atEnd=!a;let s=this.next??"stream";for(;s&&(a||this.hasChars(1));)s=yield*this.parseNext(s)}atLineEnd(){let n=this.pos,a=this.buffer[n];for(;a===" "||a===" ";)a=this.buffer[++n];return!a||a==="#"||a===`
485
+ `?!0:a==="\r"?this.buffer[n+1]===`
486
+ `:!1}charAt(n){return this.buffer[this.pos+n]}continueScalar(n){let a=this.buffer[n];if(this.indentNext>0){let s=0;for(;a===" ";)a=this.buffer[++s+n];if(a==="\r"){const u=this.buffer[s+n+1];if(u===`
487
+ `||!u&&!this.atEnd)return n+s+1}return a===`
488
+ `||s>=this.indentNext||!a&&!this.atEnd?n+s:-1}if(a==="-"||a==="."){const s=this.buffer.substr(n,3);if((s==="---"||s==="...")&&_n(this.buffer[n+3]))return-1}return n}getLine(){let n=this.lineEndPos;return(typeof n!="number"||n!==-1&&n<this.pos)&&(n=this.buffer.indexOf(`
489
+ `,this.pos),this.lineEndPos=n),n===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[n-1]==="\r"&&(n-=1),this.buffer.substring(this.pos,n))}hasChars(n){return this.pos+n<=this.buffer.length}setNext(n){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=n,null}peek(n){return this.buffer.substr(this.pos,n)}*parseNext(n){switch(n){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let n=this.getLine();if(n===null)return this.setNext("stream");if(n[0]===Bb&&(yield*this.pushCount(1),n=n.substring(1)),n[0]==="%"){let a=n.length,s=n.indexOf("#");for(;s!==-1;){const o=n[s-1];if(o===" "||o===" "){a=s-1;break}else s=n.indexOf("#",s+1)}for(;;){const o=n[a-1];if(o===" "||o===" ")a-=1;else break}const u=(yield*this.pushCount(a))+(yield*this.pushSpaces(!0));return yield*this.pushCount(n.length-u),this.pushNewline(),"stream"}if(this.atLineEnd()){const a=yield*this.pushSpaces(!0);return yield*this.pushCount(n.length-a),yield*this.pushNewline(),"stream"}return yield qb,yield*this.parseLineStart()}*parseLineStart(){const n=this.charAt(0);if(!n&&!this.atEnd)return this.setNext("line-start");if(n==="-"||n==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const a=this.peek(3);if((a==="---"||a==="...")&&_n(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,a==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!_n(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[n,a]=this.peek(2);if(!a&&!this.atEnd)return this.setNext("block-start");if((n==="-"||n==="?"||n===":")&&_n(a)){const s=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=s,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const n=this.getLine();if(n===null)return this.setNext("doc");let a=yield*this.pushIndicators();switch(n[a]){case"#":yield*this.pushCount(n.length-a);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Bf),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return a+=yield*this.parseBlockScalarHeader(),a+=yield*this.pushSpaces(!0),yield*this.pushCount(n.length-a),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let n,a,s=-1;do n=yield*this.pushNewline(),n>0?(a=yield*this.pushSpaces(!1),this.indentValue=s=a):a=0,a+=yield*this.pushSpaces(!0);while(n+a>0);const u=this.getLine();if(u===null)return this.setNext("flow");if((s!==-1&&s<this.indentNext&&u[0]!=="#"||s===0&&(u.startsWith("---")||u.startsWith("..."))&&_n(u[3]))&&!(s===this.indentNext-1&&this.flowLevel===1&&(u[0]==="]"||u[0]==="}")))return this.flowLevel=0,yield Ub,yield*this.parseLineStart();let o=0;for(;u[o]===",";)o+=yield*this.pushCount(1),o+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(o+=yield*this.pushIndicators(),u[o]){case void 0:return"flow";case"#":return yield*this.pushCount(u.length-o),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Bf),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const f=this.charAt(1);if(this.flowKey||_n(f)||f===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const n=this.charAt(0);let a=this.buffer.indexOf(n,this.pos+1);if(n==="'")for(;a!==-1&&this.buffer[a+1]==="'";)a=this.buffer.indexOf("'",a+2);else for(;a!==-1;){let o=0;for(;this.buffer[a-1-o]==="\\";)o+=1;if(o%2===0)break;a=this.buffer.indexOf('"',a+1)}const s=this.buffer.substring(0,a);let u=s.indexOf(`
490
+ `,this.pos);if(u!==-1){for(;u!==-1;){const o=this.continueScalar(u+1);if(o===-1)break;u=s.indexOf(`
491
+ `,o)}u!==-1&&(a=u-(s[u-1]==="\r"?2:1))}if(a===-1){if(!this.atEnd)return this.setNext("quoted-scalar");a=this.buffer.length}return yield*this.pushToIndex(a+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let n=this.pos;for(;;){const a=this.buffer[++n];if(a==="+")this.blockScalarKeep=!0;else if(a>"0"&&a<="9")this.blockScalarIndent=Number(a)-1;else if(a!=="-")break}return yield*this.pushUntil(a=>_n(a)||a==="#")}*parseBlockScalar(){let n=this.pos-1,a=0,s;e:for(let o=this.pos;s=this.buffer[o];++o)switch(s){case" ":a+=1;break;case`
492
+ `:n=o,a=0;break;case"\r":{const f=this.buffer[o+1];if(!f&&!this.atEnd)return this.setNext("block-scalar");if(f===`
493
+ `)break}default:break e}if(!s&&!this.atEnd)return this.setNext("block-scalar");if(a>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=a:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const o=this.continueScalar(n+1);if(o===-1)break;n=this.buffer.indexOf(`
494
+ `,o)}while(n!==-1);if(n===-1){if(!this.atEnd)return this.setNext("block-scalar");n=this.buffer.length}}let u=n+1;for(s=this.buffer[u];s===" ";)s=this.buffer[++u];if(s===" "){for(;s===" "||s===" "||s==="\r"||s===`
495
+ `;)s=this.buffer[++u];n=u-1}else if(!this.blockScalarKeep)do{let o=n-1,f=this.buffer[o];f==="\r"&&(f=this.buffer[--o]);const h=o;for(;f===" ";)f=this.buffer[--o];if(f===`
496
+ `&&o>=this.pos&&o+1+a>h)n=o;else break}while(!0);return yield sd,yield*this.pushToIndex(n+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const n=this.flowLevel>0;let a=this.pos-1,s=this.pos-1,u;for(;u=this.buffer[++s];)if(u===":"){const o=this.buffer[s+1];if(_n(o)||n&&pu.has(o))break;a=s}else if(_n(u)){let o=this.buffer[s+1];if(u==="\r"&&(o===`
497
+ `?(s+=1,u=`
498
+ `,o=this.buffer[s+1]):a=s),o==="#"||n&&pu.has(o))break;if(u===`
499
+ `){const f=this.continueScalar(s+1);if(f===-1)break;s=Math.max(s,f-2)}}else{if(n&&pu.has(u))break;a=s}return!u&&!this.atEnd?this.setNext("plain-scalar"):(yield sd,yield*this.pushToIndex(a+1,!0),n?"flow":"doc")}*pushCount(n){return n>0?(yield this.buffer.substr(this.pos,n),this.pos+=n,n):0}*pushToIndex(n,a){const s=this.buffer.slice(this.pos,n);return s?(yield s,this.pos+=s.length,s.length):(a&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Bf))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const n=this.flowLevel>0,a=this.charAt(1);if(_n(a)||n&&pu.has(a))return n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let n=this.pos+2,a=this.buffer[n];for(;!_n(a)&&a!==">";)a=this.buffer[++n];return yield*this.pushToIndex(a===">"?n+1:n,!1)}else{let n=this.pos+1,a=this.buffer[n];for(;a;)if(lw.has(a))a=this.buffer[++n];else if(a==="%"&&_g.has(this.buffer[n+1])&&_g.has(this.buffer[n+2]))a=this.buffer[n+=3];else break;return yield*this.pushToIndex(n,!1)}}*pushNewline(){const n=this.buffer[this.pos];return n===`
500
+ `?yield*this.pushCount(1):n==="\r"&&this.charAt(1)===`
501
+ `?yield*this.pushCount(2):0}*pushSpaces(n){let a=this.pos-1,s;do s=this.buffer[++a];while(s===" "||n&&s===" ");const u=a-this.pos;return u>0&&(yield this.buffer.substr(this.pos,u),this.pos=a),u}*pushUntil(n){let a=this.pos,s=this.buffer[a];for(;!n(s);)s=this.buffer[++a];return yield*this.pushToIndex(a,!1)}}class uw{constructor(){this.lineStarts=[],this.addNewLine=n=>this.lineStarts.push(n),this.linePos=n=>{let a=0,s=this.lineStarts.length;for(;a<s;){const o=a+s>>1;this.lineStarts[o]<n?a=o+1:s=o}if(this.lineStarts[a]===n)return{line:a+1,col:1};if(a===0)return{line:0,col:n};const u=this.lineStarts[a-1];return{line:a,col:n-u+1}}}}function Ui(i,n){for(let a=0;a<i.length;++a)if(i[a].type===n)return!0;return!1}function kg(i){for(let n=0;n<i.length;++n)switch(i[n].type){case"space":case"comment":case"newline":break;default:return n}return-1}function Ib(i){switch(i==null?void 0:i.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function yu(i){switch(i.type){case"document":return i.start;case"block-map":{const n=i.items[i.items.length-1];return n.sep??n.start}case"block-seq":return i.items[i.items.length-1].start;default:return[]}}function cl(i){var a;if(i.length===0)return[];let n=i.length;e:for(;--n>=0;)switch(i[n].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((a=i[++n])==null?void 0:a.type)==="space";);return i.splice(n,i.length)}function wg(i){if(i.start.type==="flow-seq-start")for(const n of i.items)n.sep&&!n.value&&!Ui(n.start,"explicit-key-ind")&&!Ui(n.sep,"map-value-ind")&&(n.key&&(n.value=n.key),delete n.key,Ib(n.value)?n.value.end?Array.prototype.push.apply(n.value.end,n.sep):n.value.end=n.sep:Array.prototype.push.apply(n.start,n.sep),delete n.sep)}class ow{constructor(n){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new rw,this.onNewLine=n}*parse(n,a=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const s of this.lexer.lex(n,a))yield*this.next(s);a||(yield*this.end())}*next(n){if(this.source=n,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=n.length;return}const a=aw(n);if(a)if(a==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=a,yield*this.step(),a){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+n.length);break;case"space":this.atNewLine&&n[0]===" "&&(this.indent+=n.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=n.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=n.length}else{const s=`Not a YAML token: ${n}`;yield*this.pop({type:"error",offset:this.offset,message:s,source:n}),this.offset+=n.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const n=this.peek(1);if(this.type==="doc-end"&&(n==null?void 0:n.type)!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!n)return yield*this.stream();switch(n.type){case"document":return yield*this.document(n);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(n);case"block-scalar":return yield*this.blockScalar(n);case"block-map":return yield*this.blockMap(n);case"block-seq":return yield*this.blockSequence(n);case"flow-collection":return yield*this.flowCollection(n);case"doc-end":return yield*this.documentEnd(n)}yield*this.pop()}peek(n){return this.stack[this.stack.length-n]}*pop(n){const a=n??this.stack.pop();if(!a)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield a;else{const s=this.peek(1);switch(a.type==="block-scalar"?a.indent="indent"in s?s.indent:0:a.type==="flow-collection"&&s.type==="document"&&(a.indent=0),a.type==="flow-collection"&&wg(a),s.type){case"document":s.value=a;break;case"block-scalar":s.props.push(a);break;case"block-map":{const u=s.items[s.items.length-1];if(u.value){s.items.push({start:[],key:a,sep:[]}),this.onKeyLine=!0;return}else if(u.sep)u.value=a;else{Object.assign(u,{key:a,sep:[]}),this.onKeyLine=!u.explicitKey;return}break}case"block-seq":{const u=s.items[s.items.length-1];u.value?s.items.push({start:[],value:a}):u.value=a;break}case"flow-collection":{const u=s.items[s.items.length-1];!u||u.value?s.items.push({start:[],key:a,sep:[]}):u.sep?u.value=a:Object.assign(u,{key:a,sep:[]});return}default:yield*this.pop(),yield*this.pop(a)}if((s.type==="document"||s.type==="block-map"||s.type==="block-seq")&&(a.type==="block-map"||a.type==="block-seq")){const u=a.items[a.items.length-1];u&&!u.sep&&!u.value&&u.start.length>0&&kg(u.start)===-1&&(a.indent===0||u.start.every(o=>o.type!=="comment"||o.indent<a.indent))&&(s.type==="document"?s.end=u.start:s.items.push({start:u.start}),a.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const n={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&n.start.push(this.sourceToken),this.stack.push(n);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(n){if(n.value)return yield*this.lineEnd(n);switch(this.type){case"doc-start":{kg(n.start)!==-1?(yield*this.pop(),yield*this.step()):n.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":n.start.push(this.sourceToken);return}const a=this.startBlockValue(n);a?this.stack.push(a):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(n){if(this.type==="map-value-ind"){const a=yu(this.peek(2)),s=cl(a);let u;n.end?(u=n.end,u.push(this.sourceToken),delete n.end):u=[this.sourceToken];const o={type:"block-map",offset:n.offset,indent:n.indent,items:[{start:s,key:n,sep:u}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(n)}*blockScalar(n){switch(this.type){case"space":case"comment":case"newline":n.props.push(this.sourceToken);return;case"scalar":if(n.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let a=this.source.indexOf(`
502
+ `)+1;for(;a!==0;)this.onNewLine(this.offset+a),a=this.source.indexOf(`
503
+ `,a)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(n){var s;const a=n.items[n.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,a.value){const u="end"in a.value?a.value.end:void 0,o=Array.isArray(u)?u[u.length-1]:void 0;(o==null?void 0:o.type)==="comment"?u==null||u.push(this.sourceToken):n.items.push({start:[this.sourceToken]})}else a.sep?a.sep.push(this.sourceToken):a.start.push(this.sourceToken);return;case"space":case"comment":if(a.value)n.items.push({start:[this.sourceToken]});else if(a.sep)a.sep.push(this.sourceToken);else{if(this.atIndentedComment(a.start,n.indent)){const u=n.items[n.items.length-2],o=(s=u==null?void 0:u.value)==null?void 0:s.end;if(Array.isArray(o)){Array.prototype.push.apply(o,a.start),o.push(this.sourceToken),n.items.pop();return}}a.start.push(this.sourceToken)}return}if(this.indent>=n.indent){const u=!this.onKeyLine&&this.indent===n.indent,o=u&&(a.sep||a.explicitKey)&&this.type!=="seq-item-ind";let f=[];if(o&&a.sep&&!a.value){const h=[];for(let p=0;p<a.sep.length;++p){const m=a.sep[p];switch(m.type){case"newline":h.push(p);break;case"space":break;case"comment":m.indent>n.indent&&(h.length=0);break;default:h.length=0}}h.length>=2&&(f=a.sep.splice(h[1]))}switch(this.type){case"anchor":case"tag":o||a.value?(f.push(this.sourceToken),n.items.push({start:f}),this.onKeyLine=!0):a.sep?a.sep.push(this.sourceToken):a.start.push(this.sourceToken);return;case"explicit-key-ind":!a.sep&&!a.explicitKey?(a.start.push(this.sourceToken),a.explicitKey=!0):o||a.value?(f.push(this.sourceToken),n.items.push({start:f,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(a.explicitKey)if(a.sep)if(a.value)n.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Ui(a.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:f,key:null,sep:[this.sourceToken]}]});else if(Ib(a.key)&&!Ui(a.sep,"newline")){const h=cl(a.start),p=a.key,m=a.sep;m.push(this.sourceToken),delete a.key,delete a.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:h,key:p,sep:m}]})}else f.length>0?a.sep=a.sep.concat(f,this.sourceToken):a.sep.push(this.sourceToken);else if(Ui(a.start,"newline"))Object.assign(a,{key:null,sep:[this.sourceToken]});else{const h=cl(a.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:h,key:null,sep:[this.sourceToken]}]})}else a.sep?a.value||o?n.items.push({start:f,key:null,sep:[this.sourceToken]}):Ui(a.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):a.sep.push(this.sourceToken):Object.assign(a,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const h=this.flowScalar(this.type);o||a.value?(n.items.push({start:f,key:h,sep:[]}),this.onKeyLine=!0):a.sep?this.stack.push(h):(Object.assign(a,{key:h,sep:[]}),this.onKeyLine=!0);return}default:{const h=this.startBlockValue(n);if(h){if(h.type==="block-seq"){if(!a.explicitKey&&a.sep&&!Ui(a.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else u&&n.items.push({start:f});this.stack.push(h);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(n){var s;const a=n.items[n.items.length-1];switch(this.type){case"newline":if(a.value){const u="end"in a.value?a.value.end:void 0,o=Array.isArray(u)?u[u.length-1]:void 0;(o==null?void 0:o.type)==="comment"?u==null||u.push(this.sourceToken):n.items.push({start:[this.sourceToken]})}else a.start.push(this.sourceToken);return;case"space":case"comment":if(a.value)n.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(a.start,n.indent)){const u=n.items[n.items.length-2],o=(s=u==null?void 0:u.value)==null?void 0:s.end;if(Array.isArray(o)){Array.prototype.push.apply(o,a.start),o.push(this.sourceToken),n.items.pop();return}}a.start.push(this.sourceToken)}return;case"anchor":case"tag":if(a.value||this.indent<=n.indent)break;a.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==n.indent)break;a.value||Ui(a.start,"seq-item-ind")?n.items.push({start:[this.sourceToken]}):a.start.push(this.sourceToken);return}if(this.indent>n.indent){const u=this.startBlockValue(n);if(u){this.stack.push(u);return}}yield*this.pop(),yield*this.step()}*flowCollection(n){const a=n.items[n.items.length-1];if(this.type==="flow-error-end"){let s;do yield*this.pop(),s=this.peek(1);while((s==null?void 0:s.type)==="flow-collection")}else if(n.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!a||a.sep?n.items.push({start:[this.sourceToken]}):a.start.push(this.sourceToken);return;case"map-value-ind":!a||a.value?n.items.push({start:[],key:null,sep:[this.sourceToken]}):a.sep?a.sep.push(this.sourceToken):Object.assign(a,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!a||a.value?n.items.push({start:[this.sourceToken]}):a.sep?a.sep.push(this.sourceToken):a.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const u=this.flowScalar(this.type);!a||a.value?n.items.push({start:[],key:u,sep:[]}):a.sep?this.stack.push(u):Object.assign(a,{key:u,sep:[]});return}case"flow-map-end":case"flow-seq-end":n.end.push(this.sourceToken);return}const s=this.startBlockValue(n);s?this.stack.push(s):(yield*this.pop(),yield*this.step())}else{const s=this.peek(2);if(s.type==="block-map"&&(this.type==="map-value-ind"&&s.indent===n.indent||this.type==="newline"&&!s.items[s.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&s.type!=="flow-collection"){const u=yu(s),o=cl(u);wg(n);const f=n.end.splice(1,n.end.length);f.push(this.sourceToken);const h={type:"block-map",offset:n.offset,indent:n.indent,items:[{start:o,key:n,sep:f}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=h}else yield*this.lineEnd(n)}}flowScalar(n){if(this.onNewLine){let a=this.source.indexOf(`
504
+ `)+1;for(;a!==0;)this.onNewLine(this.offset+a),a=this.source.indexOf(`
505
+ `,a)+1}return{type:n,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(n){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const a=yu(n),s=cl(a);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const a=yu(n),s=cl(a);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(n,a){return this.type!=="comment"||this.indent<=a?!1:n.every(s=>s.type==="newline"||s.type==="space")}*documentEnd(n){this.type!=="doc-mode"&&(n.end?n.end.push(this.sourceToken):n.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(n){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:n.end?n.end.push(this.sourceToken):n.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function cw(i){const n=i.prettyErrors!==!1;return{lineCounter:i.lineCounter||n&&new uw||null,prettyErrors:n}}function fw(i,n={}){const{lineCounter:a,prettyErrors:s}=cw(n),u=new ow(a==null?void 0:a.addNewLine),o=new iw(n);let f=null;for(const h of o.compose(u.parse(i),!0,i.length))if(!f)f=h;else if(f.options.logLevel!=="silent"){f.errors.push(new Cs(h.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&a&&(f.errors.forEach(vg(i,a)),f.warnings.forEach(vg(i,a))),f}function dw(i,n,a){let s;const u=fw(i,a);if(!u)return null;if(u.warnings.forEach(o=>hb(u.options.logLevel,o)),u.errors.length>0){if(u.options.logLevel!=="silent")throw u.errors[0];u.errors=[]}return u.toJS(Object.assign({reviver:s},a))}class pl extends Error{constructor(a,s,u){super(a);oa(this,"code");oa(this,"position");this.name="MdmaParseError",this.code=s,this.position=u}}const yl={YAML_PARSE_ERROR:"mdma/yaml-parse-error",SCHEMA_VALIDATION_ERROR:"mdma/schema-validation-error",UNKNOWN_COMPONENT_TYPE:"mdma/unknown-component-type",DUPLICATE_COMPONENT_ID:"mdma/duplicate-component-id",INVALID_BINDING:"mdma/invalid-binding",UNRESOLVED_BINDING:"mdma/unresolved-binding"};function hw(i){const n=i.split(`
506
+ `);let a=!1,s=0;for(let u=0;u<n.length;u++){const o=n[u];if(a){const m=o.search(/\S/);if(m>=0&&m<=s)a=!1;else continue}if(/^\s*[\w-]+:\s*[|>]\s*$/.test(o)){a=!0,s=o.search(/\S/);continue}const f=o.match(/^(\s*)([\w-]+):\s+(.+)$/);if(!f)continue;const[,h,,p]=f;if(!/^["']/.test(p)&&!/^[[\]{]/.test(p)&&!/^(true|false|null|~)$/i.test(p)&&!/^-?\d+(\.\d+)?$/.test(p)&&!(h&&/^\s*-/.test(o))&&p.includes(": ")){const m=p.replace(/\\/g,"\\\\").replace(/"/g,'\\"');n[u]=o.replace(/:\s+.+$/,`: "${m}"`)}}return n.join(`
507
+ `)}function mw(i,n){try{const a=dw(hw(i));return typeof a!="object"||a===null||Array.isArray(a)?{ok:!1,error:new pl("MDMA block must contain a YAML mapping (object)",yl.YAML_PARSE_ERROR,n)}:{ok:!0,data:a}}catch(a){return{ok:!1,error:new pl(`YAML parse error: ${a instanceof Error?a.message:String(a)}`,yl.YAML_PARSE_ERROR,n)}}}function pw(i,n,a){const s=i.type;if(typeof s!="string")return{ok:!1,errors:[new pl('MDMA component must have a "type" string field',yl.SCHEMA_VALIDATION_ERROR,a)]};const u=n==null?void 0:n.get(s);if(u){const f=u.safeParse(i);return f.success?{ok:!0,component:f.data}:{ok:!1,errors:f.error.issues.map(h=>new pl(`${h.path.join(".")}: ${h.message}`,yl.SCHEMA_VALIDATION_ERROR,a))}}if(!J_.has(s))return{ok:!1,errors:[new pl(`Unknown component type: "${s}"`,yl.UNKNOWN_COMPONENT_TYPE,a)]};const o=X_.safeParse(i);return o.success?{ok:!0,component:o.data}:{ok:!1,errors:o.error.issues.map(f=>new pl(`${f.path.join(".")}: ${f.message}`,yl.SCHEMA_VALIDATION_ERROR,a))}}function yw(i,n){return{type:"mdmaBlock",rawYaml:i.value,component:n,position:i.position}}function gw(i,n,a={}){const s=new Set;return v_(i,"code",(u,o,f)=>{if(u.lang!==Jg)return;const h=mw(u.value,u.position);if(!h.ok){if(console.warn("[mdma] YAML parse error:",h.error.message),n.message(h.error.message,u.position),a.failFast)throw h.error;return}const p=pw(h.data,a.customSchemas,u.position);if(!p.ok){console.warn(`[mdma] Validation failed for component type="${h.data.type}" id="${h.data.id??"?"}":`,p.errors.map(g=>g.message).join("; "));for(const g of p.errors)n.message(g.message,u.position);if(a.failFast)throw p.errors[0];return}const m=p.component.id;if(s.has(m)){const g=`Duplicate component ID: "${m}"`;if(n.message(g,u.position),a.failFast)throw new Error(g)}s.add(m);const b=yw(u,p.component);return f&&typeof o=="number"&&(f.children[o]=b),Xg}),i}const bw=(i={})=>(n,a)=>gw(n,a,{customSchemas:i.customSchemas,failFast:i.failFast});function vw(){const i=new Map,n=new Set;return{on(a,s){let u=i.get(a);return u||(u=new Set,i.set(a,u)),u.add(s),()=>{u==null||u.delete(s)}},onAny(a){return n.add(a),()=>{n.delete(a)}},emit(a){const s=i.get(a.type);if(s)for(const u of s)u(a);for(const u of n)u(a)}}}function xw(i){const n=[];return{append(a){const s={timestamp:new Date().toISOString(),sessionId:i.sessionId,documentId:i.documentId,eventType:a.eventType,componentId:a.componentId,payload:a.payload,redacted:a.redacted??!1,actor:a.actor};return n.push(s),s},entries(){return n},forComponent(a){return n.filter(s=>s.componentId===a)},size(){return n.length}}}function Sw(i,n){const a=n.split(".");let s=i;for(const u of a){if(s==null||typeof s!="object")return;s=s[u]}return s}function _w(i){const n=i.match(/^\{\{([a-zA-Z_][a-zA-Z0-9_.]*)\}\}$/);return n?n[1]:null}function ws(i,n){if(typeof i=="string"){const a=_w(i);if(a)return Sw(n,a)}return i}function kw(i){const n=typeof i=="string"?i:JSON.stringify(i);let a=0;for(let s=0;s<n.length;s++){const u=n.charCodeAt(s);a=(a<<5)-a+u|0}return`redacted:${(a>>>0).toString(16).padStart(8,"0")}`}function ww(i,n,a){const s=a.sensitiveComponents.has(n);if(!s&&!Aw(i,a.sensitiveFields))return{payload:i,redacted:!1};const u={};for(const[o,f]of Object.entries(i))s||a.sensitiveFields.has(o)?u[o]=kw(f):u[o]=f;return{payload:u,redacted:!0}}function Aw(i,n){for(const a of Object.keys(i))if(n.has(a))return!0;return!1}class Tw extends Error{constructor(a,s){super(a);oa(this,"rule");this.name="PolicyViolationError",this.rule=s}}class Ew{constructor(n,a){oa(this,"policy");oa(this,"environment");this.policy=n,this.environment=a}evaluate(n){const a=this.policy.rules.filter(s=>s.action===n&&s.environments.includes(this.environment));if(a.length>0){const s=a[0];return{allowed:s.effect==="allow",rule:s,reason:s.reason}}return{allowed:this.policy.defaultEffect==="allow",reason:`Default policy: ${this.policy.defaultEffect}`}}enforce(n){const a=this.evaluate(n);if(!a.allowed)throw new Tw(a.reason??`Action "${n}" denied by policy`,a.rule)}get currentEnvironment(){return this.environment}}function Nw(){return{version:1,rules:[{action:"send_email",environments:["preview","test"],effect:"deny",reason:"Email sending is blocked in non-production environments"},{action:"webhook_call",environments:["preview"],effect:"deny",reason:"External webhook calls are blocked in preview"}],defaultEffect:"allow"}}function Cw(i,n={}){const a=n.sessionId??crypto.randomUUID(),s=n.documentId??`doc-${Date.now()}`,u=n.environment??"preview",o=new Ew(n.policy??Nw(),u),f=vw(),h=xw({sessionId:a,documentId:s}),p={bindings:{},components:new Map},m={sensitiveComponents:new Set,sensitiveFields:new Set};for(const O of i.children)if(qf(O)){const w=O.component,j={id:w.id,type:w.type,values:{},errors:[],touched:!1,visible:ws(w.visible,p.bindings)!==!1,disabled:ws(w.disabled,p.bindings)===!0};if(w.sensitive&&m.sensitiveComponents.add(w.id),w.type==="form")for(const E of w.fields)E.sensitive&&m.sensitiveFields.add(E.name),E.defaultValue!==void 0&&(j.values[E.name]=E.defaultValue,p.bindings[E.name]=E.defaultValue);p.components.set(w.id,j)}const b=new Set;function g(){for(const O of b)O(p)}function _(O){const w={FIELD_CHANGED:"field_changed",ACTION_TRIGGERED:"action_triggered",COMPONENT_RENDERED:"component_rendered",APPROVAL_GRANTED:"approval_granted",APPROVAL_DENIED:"approval_denied",INTEGRATION_CALLED:"integration_called"},j={...O};j.type=void 0,j.componentId=void 0;let E=m;O.type==="FIELD_CHANGED"&&m.sensitiveFields.has(O.field)&&(E={...m,sensitiveFields:new Set([...m.sensitiveFields,"value"])});const{payload:H,redacted:I}=ww(j,O.componentId,E);h.append({eventType:w[O.type],componentId:O.componentId,payload:H,redacted:I,actor:"actor"in O?O.actor:void 0})}return{getState(){return p},getBindings(){return p.bindings},getComponentState(O){return p.components.get(O)},resolveBinding(O){return ws(O,p.bindings)},dispatch(O){switch(_(O),f.emit(O),O.type){case"FIELD_CHANGED":{const w=p.components.get(O.componentId);w&&(w.values={...w.values,[O.field]:O.value},w.touched=!0,p.bindings[O.field]=O.value);break}case"COMPONENT_RENDERED":break;case"APPROVAL_GRANTED":{const w=p.components.get(O.componentId);w&&(w.values={...w.values,status:"approved",approvedBy:O.actor},p.bindings[`${O.componentId}.status`]="approved");break}case"APPROVAL_DENIED":{const w=p.components.get(O.componentId);w&&(w.values={...w.values,status:"denied",deniedBy:O.actor,deniedReason:O.reason},p.bindings[`${O.componentId}.status`]="denied");break}}g()},subscribe(O){return b.add(O),()=>{b.delete(O)}},getEventLog(){return h},getEventBus(){return f},getPolicyEngine(){return o},updateAst(O){const w=new Set;for(const j of O.children)if(qf(j))w.add(j.component.id);else if(Ow(j)){const E=Mw(j.value);E&&w.add(E)}for(const j of p.components.keys())w.has(j)||(p.components.delete(j),m.sensitiveComponents.delete(j));for(const j of O.children){if(!qf(j))continue;const E=j.component;if(p.components.has(E.id))continue;const H={id:E.id,type:E.type,values:{},errors:[],touched:!1,visible:ws(E.visible,p.bindings)!==!1,disabled:ws(E.disabled,p.bindings)===!0};if(E.sensitive&&m.sensitiveComponents.add(E.id),E.type==="form")for(const I of E.fields)I.sensitive&&m.sensitiveFields.add(I.name),I.defaultValue!==void 0&&(H.values[I.name]=I.defaultValue,I.name in p.bindings||(p.bindings[I.name]=I.defaultValue));p.components.set(E.id,H)}g()}}}function qf(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="mdmaBlock"}function Ow(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="code"&&"lang"in i&&i.lang==="mdma"}function Mw(i){if(!i)return null;const n=i.match(/^\s*id:\s*(\S+)/m);return n?n[1]:null}class jw{constructor(){oa(this,"handlers",new Map)}register(n){this.handlers.set(n.definition.type,n)}get(n){return this.handlers.get(n)}has(n){return this.handlers.has(n)}list(){return Array.from(this.handlers.values()).map(n=>n.definition)}get size(){return this.handlers.size}}const Dw={definition:{type:"form",schema:Mu,description:"Interactive form with fields, validation, and submit action",version:"0.1.0"},initialize(i,n){const a=Mu.parse(n),s={};for(const u of a.fields)s[u.name]=u.defaultValue??(u.type==="checkbox"?!1:"");return{id:a.id,type:"form",values:s,errors:[],touched:!1,visible:!0,disabled:!1}},async onAction(i,n){n==="submit"&&i.dispatch({type:"ACTION_TRIGGERED",componentId:i.componentId,actionId:"submit"})}},zw={definition:{type:"button",schema:ju,description:"Clickable button that triggers an action",version:"0.1.0"},initialize(i,n){return{id:ju.parse(n).id,type:"button",values:{},errors:[],touched:!1,visible:!0,disabled:!1}},async onAction(i,n){i.dispatch({type:"ACTION_TRIGGERED",componentId:i.componentId,actionId:n})}},Rw={definition:{type:"tasklist",schema:Du,description:"Checklist of tasks with completion tracking",version:"0.1.0"},initialize(i,n){const a=Du.parse(n),s={};for(const u of a.items)s[u.id]=u.checked;return{id:a.id,type:"tasklist",values:s,errors:[],touched:!1,visible:!0,disabled:!1}},async onAction(i,n,a){if(n==="toggle"){const{itemId:s,checked:u}=a;i.dispatch({type:"FIELD_CHANGED",componentId:i.componentId,field:s,value:u})}}},Lw={definition:{type:"table",schema:zu,description:"Data table with optional sorting and filtering",version:"0.1.0"},initialize(i,n){return{id:zu.parse(n).id,type:"table",values:{sortColumn:null,sortDirection:"asc",page:0},errors:[],touched:!1,visible:!0,disabled:!1}},async onAction(i,n,a){if(n==="sort"){const{column:s,direction:u}=a;i.dispatch({type:"FIELD_CHANGED",componentId:i.componentId,field:"sortColumn",value:s}),i.dispatch({type:"FIELD_CHANGED",componentId:i.componentId,field:"sortDirection",value:u})}}},Bw={definition:{type:"callout",schema:Ru,description:"Informational callout box (info, warning, error, success)",version:"0.1.0"},initialize(i,n){return{id:Ru.parse(n).id,type:"callout",values:{dismissed:!1},errors:[],touched:!1,visible:!0,disabled:!1}},async onAction(i,n){n==="dismiss"&&i.dispatch({type:"FIELD_CHANGED",componentId:i.componentId,field:"dismissed",value:!0})}},qw={definition:{type:"approval-gate",schema:Lu,description:"Requires explicit approval before downstream components become active",version:"0.1.0"},initialize(i,n){return{id:Lu.parse(n).id,type:"approval-gate",values:{status:"pending",approvals:[]},errors:[],touched:!1,visible:!0,disabled:!1}},async onAction(i,n,a){const s=a;n==="approve"?(i.policy.enforce("approval_grant"),i.dispatch({type:"APPROVAL_GRANTED",componentId:i.componentId,actor:s.actor})):n==="deny"&&(i.policy.enforce("approval_deny"),i.dispatch({type:"APPROVAL_DENIED",componentId:i.componentId,actor:s.actor,reason:s.reason??""}))}},Uw={definition:{type:"webhook",schema:Bu,description:"HTTP webhook integration with policy enforcement",version:"0.1.0"},initialize(i,n){return{id:Bu.parse(n).id,type:"webhook",values:{status:"idle",lastResult:null},errors:[],touched:!1,visible:!0,disabled:!1}},async onAction(i,n){n==="execute"&&(i.policy.enforce("webhook_call"),i.dispatch({type:"INTEGRATION_CALLED",componentId:i.componentId,integrationId:"webhook",result:{status:"mocked",message:"Webhook execution placeholder"}}))}};function Iw(i){i.register(Dw),i.register(zw),i.register(Rw),i.register(Lw),i.register(Bw),i.register(qw),i.register(Uw)}const Ag=tx().use(c_).use(bw,{});function Hw(){const i=new jw;return Iw(i),i}async function Tg(i,n){const a=Ag.parse(i),s=await Ag.run(a);return n?(n.updateAst(s),{ast:s,store:n}):{ast:s,store:Cw(s,{registry:Hw()})}}const Hb=ne.createContext(null);function Cd(){const i=ne.useContext(Hb);if(!i)throw new Error("useMdmaContext must be used within a MdmaProvider");return i}function Yw({store:i,dataSources:n,children:a}){const s=ne.useMemo(()=>({store:i,dataSources:n}),[i,n]);return x.jsx(Hb.Provider,{value:s,children:a})}const Yb=ne.createContext(null);function Vw({value:i,children:n}){const a=ne.useMemo(()=>i??null,[i]);return x.jsx(Yb.Provider,{value:a,children:n})}function As(i,n){var s,u;const a=ne.useContext(Yb);if(a)return((s=a[i])==null?void 0:s[n])??((u=a["*"])==null?void 0:u[n])}function Gw(){const{store:i}=Cd();return i}function Kw(i){const{store:n}=Cd(),a=ne.useRef(void 0),s=ne.useCallback(o=>n.subscribe(o),[n]),u=ne.useCallback(()=>{const o=n.getComponentState(i);if(!o){a.current=void 0;return}const f=a.current;if(f&&f.id===o.id&&f.touched===o.touched&&f.visible===o.visible&&f.disabled===o.disabled&&f.values===o.values&&f.errors===o.errors)return f;const h={...o};return a.current=h,h},[n,i]);return ne.useSyncExternalStore(s,u,u)}function Zw({id:i,type:n,value:a,onChange:s,required:u}){return x.jsx("input",{id:i,type:n,value:a,required:u,onChange:o=>s(o.target.value)})}function Qw({id:i,value:n,onChange:a,required:s,options:u}){return x.jsxs("select",{id:i,value:n,required:s,onChange:o=>a(o.target.value),children:[x.jsx("option",{value:"",children:"Select..."}),u.map(o=>x.jsx("option",{value:o.value,children:o.label},o.value))]})}function $w({id:i,checked:n,onChange:a}){return x.jsx("input",{id:i,type:"checkbox",checked:n,onChange:s=>a(s.target.checked)})}function Xw({id:i,value:n,onChange:a,required:s}){return x.jsx("textarea",{id:i,value:n,required:s,onChange:u=>a(u.target.value)})}function Jw({onClick:i,label:n}){return x.jsx("button",{type:"button",className:"mdma-form-submit",onClick:i,children:n})}const Fw=ne.memo(function({component:n,componentState:a,dispatch:s}){const{dataSources:u}=Cd(),o=As("form","input")??Zw,f=As("form","select")??Qw,h=As("form","checkbox")??$w,p=As("form","textarea")??Xw,m=As("form","submitButton")??Jw;return n.type!=="form"?null:x.jsxs("div",{className:"mdma-form","data-component-id":n.id,children:[n.label&&x.jsx("h3",{className:"mdma-form-label",children:n.label}),n.fields.map(b=>{const g=`${n.id}-${b.name}`,_=String((a==null?void 0:a.values[b.name])??""),v=w=>s({type:"FIELD_CHANGED",componentId:n.id,field:b.name,value:w}),O=w=>s({type:"FIELD_CHANGED",componentId:n.id,field:b.name,value:w});return x.jsxs("div",{className:"mdma-form-field",children:[x.jsx("label",{htmlFor:g,children:b.label}),b.type==="select"?x.jsx(f,{id:g,name:b.name,label:b.label,type:"select",value:_,onChange:v,required:b.required,options:typeof b.options=="string"?(u==null?void 0:u[b.options])??[]:b.options??[]}):b.type==="checkbox"?x.jsx(h,{id:g,name:b.name,label:b.label,checked:!!(a!=null&&a.values[b.name]),onChange:O}):b.type==="textarea"?x.jsx(p,{id:g,name:b.name,label:b.label,value:_,onChange:v,required:b.required}):x.jsx(o,{id:g,name:b.name,label:b.label,type:b.type,value:_,onChange:v,required:b.required})]},b.name)}),n.onSubmit&&x.jsx(m,{onClick:()=>s({type:"ACTION_TRIGGERED",componentId:n.id,actionId:n.onSubmit}),label:"Submit"})]})}),Ww=ne.memo(function({component:n,dispatch:a}){if(n.type!=="button")return null;const s=`mdma-button--${n.variant??"primary"}`;return x.jsx("button",{type:"button",className:`mdma-button ${s}`,"data-component-id":n.id,onClick:()=>{n.onAction&&a({type:"ACTION_TRIGGERED",componentId:n.id,actionId:n.onAction})},children:n.text})}),Pw=ne.memo(function({component:n,componentState:a,dispatch:s}){return n.type!=="tasklist"?null:x.jsxs("div",{className:"mdma-tasklist","data-component-id":n.id,children:[n.label&&x.jsx("h3",{className:"mdma-tasklist-label",children:n.label}),x.jsx("ul",{className:"mdma-tasklist-items",children:n.items.map(u=>x.jsx("li",{className:"mdma-tasklist-item",children:x.jsxs("label",{children:[x.jsx("input",{type:"checkbox",checked:!!(a!=null&&a.values[u.id]),onChange:o=>s({type:"FIELD_CHANGED",componentId:n.id,field:u.id,value:o.target.checked})}),x.jsx("span",{children:u.text})]})},u.id))})]})}),e2=ne.memo(function({component:n,resolveBinding:a}){if(n.type!=="table")return null;const s=typeof n.data=="string"?a(n.data):n.data,u=Array.isArray(s)?s:[];return x.jsxs("div",{className:"mdma-table","data-component-id":n.id,children:[n.label&&x.jsx("h3",{className:"mdma-table-label",children:n.label}),x.jsxs("table",{children:[x.jsx("thead",{children:x.jsx("tr",{children:n.columns.map(o=>x.jsx("th",{style:o.width?{width:o.width}:void 0,children:o.header},o.key))})}),x.jsxs("tbody",{children:[u.map((o,f)=>x.jsx("tr",{children:n.columns.map(h=>x.jsx("td",{children:String(o[h.key]??"")},h.key))},f)),u.length===0&&x.jsx("tr",{children:x.jsx("td",{colSpan:n.columns.length,className:"mdma-table-empty",children:"No data"})})]})]})]})}),t2=ne.memo(function({component:n,componentState:a,dispatch:s}){if(n.type!=="callout"||a!=null&&a.values.dismissed)return null;const u=`mdma-callout--${n.variant??"info"}`;return x.jsxs("div",{className:`mdma-callout ${u}`,"data-component-id":n.id,role:"alert",children:[n.title&&x.jsx("strong",{className:"mdma-callout-title",children:n.title}),x.jsx("p",{className:"mdma-callout-content",children:n.content}),n.dismissible&&x.jsx("button",{type:"button",className:"mdma-callout-dismiss","aria-label":"Dismiss",onClick:()=>s({type:"FIELD_CHANGED",componentId:n.id,field:"dismissed",value:!0}),children:"×"})]})}),n2=ne.memo(function({component:n,componentState:a,dispatch:s}){if(n.type!=="approval-gate")return null;const u=(a==null?void 0:a.values.status)??"pending";return x.jsxs("div",{className:`mdma-approval-gate mdma-approval-gate--${u}`,"data-component-id":n.id,children:[x.jsx("h3",{className:"mdma-approval-gate-title",children:n.title}),n.description&&x.jsx("p",{className:"mdma-approval-gate-description",children:n.description}),x.jsxs("div",{className:"mdma-approval-gate-status",children:["Status: ",x.jsx("strong",{children:u})]}),u==="pending"&&x.jsxs("div",{className:"mdma-approval-gate-actions",children:[x.jsx("button",{type:"button",className:"mdma-button mdma-button--primary",onClick:()=>s({type:"APPROVAL_GRANTED",componentId:n.id,actor:{id:"current-user"}}),children:"Approve"}),x.jsx("button",{type:"button",className:"mdma-button mdma-button--danger",onClick:()=>s({type:"APPROVAL_DENIED",componentId:n.id,actor:{id:"current-user"},reason:""}),children:"Deny"})]})]})}),i2=ne.memo(function({component:n,componentState:a}){if(n.type!=="webhook")return null;const s=(a==null?void 0:a.values.status)??"idle";return x.jsxs("div",{className:"mdma-webhook","data-component-id":n.id,children:[n.label&&x.jsx("span",{className:"mdma-webhook-label",children:n.label}),x.jsxs("span",{className:`mdma-webhook-status mdma-webhook-status--${s}`,children:["Webhook: ",s]})]})});function Eg(i){const n=i.trim().split(`
508
+ `).filter(u=>u.trim()!=="");if(n.length===0)return{headers:[],rows:[]};const a=n[0].split(",").map(u=>u.trim()),s=n.slice(1).map(u=>{const o=u.split(",").map(h=>h.trim()),f={};return a.forEach((h,p)=>{const m=o[p]??"",b=Number(m);f[h]=m!==""&&!Number.isNaN(b)?b:m}),f});return{headers:a,rows:s}}const a2=ne.memo(function({component:n,resolveBinding:a}){if(n.type!=="chart")return null;const s=ne.useMemo(()=>{const u=n.data;if(typeof u=="string"&&u.startsWith("{{")){const o=a(u);return typeof o=="string"?Eg(o):{headers:[],rows:[]}}return Eg(u)},[n.data,a]);return s.rows.length===0?x.jsxs("div",{className:"mdma-chart mdma-chart--empty","data-component-id":n.id,children:[n.label&&x.jsx("div",{className:"mdma-chart-label",children:n.label}),x.jsx("div",{className:"mdma-chart-empty",children:"No chart data"})]}):x.jsxs("div",{className:"mdma-chart","data-component-id":n.id,children:[n.label&&x.jsx("div",{className:"mdma-chart-label",children:n.label}),x.jsxs("div",{className:"mdma-chart-variant",children:[n.variant??"line"," chart"]}),x.jsxs("table",{className:"mdma-chart-data",children:[x.jsx("thead",{children:x.jsx("tr",{children:s.headers.map(u=>x.jsx("th",{children:u},u))})}),x.jsx("tbody",{children:s.rows.map((u,o)=>x.jsx("tr",{children:s.headers.map(f=>x.jsx("td",{children:String(u[f]??"")},f))},o))})]})]})}),l2=ne.memo(function({component:n,componentState:a,dispatch:s}){if(n.type!=="thinking")return null;const u=(a==null?void 0:a.values.collapsed)??n.collapsed??!0,o=n.status??"done",f=n.label??"Thinking",h=p=>{p.preventDefault(),s({type:"FIELD_CHANGED",componentId:n.id,field:"collapsed",value:!u})};return x.jsxs("details",{className:`mdma-thinking mdma-thinking--${o}`,"data-component-id":n.id,open:!u,children:[x.jsxs("summary",{className:"mdma-thinking-summary",onClick:h,children:[o==="thinking"&&x.jsx("span",{className:"mdma-thinking-indicator"}),x.jsx("span",{className:"mdma-thinking-label",children:f})]}),x.jsx("div",{className:"mdma-thinking-content",children:n.content})]})}),s2={form:Fw,button:Ww,tasklist:Pw,table:e2,callout:t2,"approval-gate":n2,webhook:i2,chart:a2,thinking:l2},Uf=ne.memo(function({block:n,renderers:a}){const s=Gw(),u=Kw(n.component.id),o=ne.useCallback(p=>s.dispatch(p),[s]),f=ne.useCallback(p=>s.resolveBinding(p),[s]),h=(a==null?void 0:a[n.component.type])??s2[n.component.type];return h?x.jsx(h,{component:n.component,componentState:u,dispatch:o,resolveBinding:f}):x.jsxs("div",{className:"mdma-unknown-component",children:["Unknown component type: ",n.component.type]})});function r2(i){if(!i)return null;const n=i.match(/^\s*type:\s*(\S+)/m);return n?n[1]:null}const u2=ne.memo(function({node:n}){const a=r2(n.value);return x.jsxs("div",{className:"mdma-block-loading",children:[x.jsx("div",{className:"mdma-block-loading-shimmer"}),x.jsxs("div",{className:"mdma-block-loading-content",children:[x.jsx("span",{className:"mdma-block-loading-icon"}),x.jsx("span",{className:"mdma-block-loading-text",children:a?`Loading ${a} component...`:"Loading component..."})]})]})});function en(i){return!i||i.length===0?null:i.map((n,a)=>x.jsx(Vb,{node:n},a))}function Vb({node:i}){switch(i.type){case"heading":{const n=`h${i.depth??1}`;return x.jsx(n,{children:en(i.children)})}case"paragraph":return x.jsx("p",{children:en(i.children)});case"blockquote":return x.jsx("blockquote",{children:en(i.children)});case"list":{const n=i.ordered?"ol":"ul";return x.jsx(n,{start:i.ordered?i.start??1:void 0,children:en(i.children)})}case"listItem":return i.checked!=null?x.jsxs("li",{className:"mdast-task-item",children:[x.jsx("input",{type:"checkbox",checked:i.checked,readOnly:!0}),en(i.children)]}):x.jsx("li",{children:en(i.children)});case"code":return x.jsx("pre",{className:"mdast-code-block",children:x.jsx("code",{className:i.lang?`language-${i.lang}`:void 0,children:i.value})});case"thematicBreak":return x.jsx("hr",{});case"html":return x.jsx("div",{className:"mdast-raw-html",children:i.value});case"table":{const n=i.children??[],a=n[0],s=n.slice(1);return x.jsxs("table",{className:"mdast-table",children:[a&&x.jsx("thead",{children:x.jsx("tr",{children:(a.children??[]).map((u,o)=>{var f;return x.jsx("th",{style:(f=i.align)!=null&&f[o]?{textAlign:i.align[o]}:void 0,children:en(u.children)},o)})})}),s.length>0&&x.jsx("tbody",{children:s.map((u,o)=>x.jsx("tr",{children:(u.children??[]).map((f,h)=>{var p;return x.jsx("td",{style:(p=i.align)!=null&&p[h]?{textAlign:i.align[h]}:void 0,children:en(f.children)},h)})},o))})]})}case"text":return x.jsx(x.Fragment,{children:i.value});case"emphasis":return x.jsx("em",{children:en(i.children)});case"strong":return x.jsx("strong",{children:en(i.children)});case"delete":return x.jsx("del",{children:en(i.children)});case"inlineCode":return x.jsx("code",{className:"mdast-inline-code",children:i.value});case"link":return x.jsx("a",{href:i.url,title:i.title??void 0,target:"_blank",rel:"noopener noreferrer",children:en(i.children)});case"image":return x.jsx("img",{src:i.url,alt:i.alt??"",title:i.title??void 0});case"break":return x.jsx("br",{});default:return i.children?x.jsx(x.Fragment,{children:en(i.children)}):i.value?x.jsx(x.Fragment,{children:i.value}):null}}const o2=ne.memo(function({node:n}){return x.jsx("div",{className:"mdma-markdown-content",children:x.jsx(Vb,{node:n})})});function c2(i){return typeof i=="object"&&i!==null&&("renderer"in i||"elements"in i)}function f2(i){if(!i)return{renderers:void 0,elementOverrides:void 0};const n={},a={};for(const[s,u]of Object.entries(i))c2(u)?(u.renderer&&(n[s]=u.renderer),u.elements&&(a[s]=u.elements)):n[s]=u;return{renderers:Object.keys(n).length>0?n:void 0,elementOverrides:Object.keys(a).length>0?a:void 0}}function Gb(i){if(!i)return null;const n=i.match(/^\s*id:\s*(\S+)/m);return n?n[1]:null}function d2(i){if(!i)return null;const n=i.match(/^\s*type:\s*(\S+)/m);return n?n[1]:null}function h2(i){const n=Gb(i);if(!n)return null;const a=i.match(/^\s*label:\s*(.+)$/m),s=a?a[1].trim():void 0;let u="";const o=i.match(/^\s*content:\s*\|\s*\n([\s\S]*)$/m);if(o){const f=o[1],h=[];for(const p of f.split(`
509
+ `)){if(p.length>0&&!p.startsWith(" ")&&!p.startsWith(" "))break;h.push(p.replace(/^ {1,2}/,""))}u=h.join(`
510
+ `).trimEnd()}else{const f=i.match(/^\s*content:\s*(?:"([^"]*)"|'([^']*)'|(.+))$/m);f&&(u=(f[1]??f[2]??f[3]??"").trim())}return{type:"mdmaBlock",rawYaml:i,component:{type:"thinking",id:n,content:u||"...",status:"thinking",collapsed:!1,...s?{label:s}:{}}}}function m2({ast:i,store:n,customizations:a,className:s}){const{renderers:u,elementOverrides:o}=ne.useMemo(()=>f2(a==null?void 0:a.components),[a==null?void 0:a.components]),f=ne.useRef(new Map);return x.jsx(Yw,{store:n,dataSources:a==null?void 0:a.dataSources,children:x.jsx(Vw,{value:o,children:x.jsx("div",{className:`mdma-document ${s??""}`,children:i.children.map((h,p)=>{if(p2(h))return f.current.set(h.component.id,h),x.jsx(Uf,{block:h,renderers:u},h.component.id);if(y2(h)){const m=h.value,b=Gb(m),g=b?f.current.get(b):null;if(g)return x.jsx(Uf,{block:g,renderers:u},g.component.id);if(d2(m)==="thinking"&&m){const v=h2(m);if(v)return x.jsx(Uf,{block:v,renderers:u},v.component.id)}return x.jsx(u2,{node:h},p)}return x.jsx(o2,{node:h},p)})})})})}function p2(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="mdmaBlock"}function y2(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="code"&&"lang"in i&&i.lang===Jg}function g2({role:i,content:n,ast:a,store:s}){const u=i==="user";return x.jsxs("div",{className:`flex flex-col gap-1 ${u?"items-end":""}`,children:[x.jsx("span",{className:`text-[11px] font-semibold ${u?"text-primary":"text-success"}`,children:u?"You":"MDMA AI"}),u?x.jsx("div",{className:"px-3 py-2 rounded-lg bg-primary-light text-primary-text text-sm leading-relaxed max-w-[80%]",children:n}):a&&s?x.jsx("div",{className:"px-4 py-3 rounded-lg bg-surface-2 border border-border-light text-sm leading-relaxed w-full overflow-auto",children:x.jsx(m2,{ast:a,store:s})}):n?x.jsxs("div",{className:"px-4 py-3 rounded-lg bg-surface-2 border border-border-light w-full",children:[x.jsx("pre",{className:"m-0 whitespace-pre-wrap text-xs text-text-secondary",children:n}),x.jsx("span",{className:"text-[11px] text-primary",children:"Parsing..."})]}):x.jsx("div",{className:"px-4 py-3 rounded-lg bg-surface-2 border border-border-light w-full",children:x.jsx("span",{className:"text-xs text-text-muted",children:"Generating..."})})]})}const b2=200,Od="mdma-builder-preview-messages";function v2(){try{const i=localStorage.getItem(Od);return i?JSON.parse(i):[]}catch{return[]}}function x2(i){const n=i.filter(a=>a.content).map(({id:a,role:s,content:u})=>({id:a,role:s,content:u}));localStorage.setItem(Od,JSON.stringify(n))}function S2({customPrompt:i,llmConfig:n,llmOverride:a,onOverrideChange:s,chatConfig:u}){const[o,f]=ne.useState(!1),h=If(n.baseUrl),p=h?zs[h]:null,m=!!(a.model||a.baseUrl||a.apiKey),[b,g]=ne.useState([]),[_,v]=ne.useState(""),[O,w]=ne.useState(!1),[j,E]=ne.useState(null),[H,I]=ne.useState(!1),Q=ne.useRef(null),F=ne.useRef(0),L=ne.useRef(null),Z=ne.useRef(b);Z.current=b,ne.useEffect(()=>{const te=v2();if(te.length===0){I(!0);return}const A=Math.max(...te.map(U=>U.id));F.current=A;const N=te.map(U=>({...U,ast:null,store:null}));g(N),(async()=>{for(const U of te)if(U.role==="assistant"&&U.content)try{const{ast:k,store:W}=await Tg(U.content);g(ce=>ce.map(re=>re.id===U.id?{...re,ast:k,store:W}:re))}catch{}I(!0)})()},[]),ne.useEffect(()=>{H&&!O&&x2(b)},[b,H,O]);const J=ne.useCallback(()=>{var te;(te=L.current)==null||te.scrollIntoView({behavior:"smooth"})},[]),le=ne.useCallback(async(te,A)=>{var N;try{const U=((N=Z.current.find(ce=>ce.id===A))==null?void 0:N.store)??void 0,{ast:k,store:W}=await Tg(te,U);g(ce=>ce.map(re=>re.id===A?{...re,ast:k,store:W}:re))}catch{}},[]),ye=ne.useRef(!1),ie=ne.useCallback(async te=>{if(!te||ye.current)return;E(null),w(!0),ye.current=!0;const A={id:++F.current,role:"user",content:te,ast:null,store:null},N={id:++F.current,role:"assistant",content:"",ast:null,store:null},U=Z.current;g([...U,A,N]),J();const W=[{role:"system",content:L1({customPrompt:i||void 0})},...U.map(pe=>({role:pe.role,content:pe.content})),{role:"user",content:`${te}
511
+
512
+ Respond with an MDMA Markdown document. Do not wrap it in code fences.`}];Q.current=new AbortController;const ce=N.id;let re=0;try{let pe="";try{for await(const Ze of Cg(n,W,Q.current.signal)){pe+=Ze;const Be=pe;g(gn=>gn.map(qn=>qn.id===ce?{...qn,content:Be}:qn));const pt=Date.now();pt-re>=b2&&(re=pt,le(Be,ce))}}catch(Ze){if(Q.current.signal.aborted)throw Ze;pe=await Og(n,W,Q.current.signal),g(Be=>Be.map(pt=>pt.id===ce?{...pt,content:pe}:pt))}await le(pe,ce)}catch(pe){pe instanceof DOMException&&pe.name==="AbortError"||E(pe instanceof Error?pe.message:String(pe))}finally{w(!1),ye.current=!1,Q.current=null}},[i,n,le,J]),P=ne.useRef(ie);P.current=ie;const ke=ne.useCallback(()=>{const te=_.trim();te&&(v(""),P.current(te))},[_]),Ce=ne.useRef(new Set);ne.useEffect(()=>{for(const te of b)if(te.role==="assistant"&&te.store&&!Ce.current.has(te.store)){Ce.current.add(te.store);const A=te.store;A.getEventBus().on("ACTION_TRIGGERED",N=>{const U=A.getComponentState(N.componentId);if(!U)return;const k=U.values,W=Object.entries(k);if(W.length===0)return;const ce=W.map(([re,pe])=>`${re}: ${pe}`).join(`
513
+ `);P.current(`[Form submitted: ${N.componentId}]
514
+ ${ce}`)})}return()=>{}},[b]),ne.useEffect(()=>()=>{Ce.current.clear()},[]);const ve=ne.useCallback(()=>{var te;(te=Q.current)==null||te.abort()},[]),B=ne.useCallback(()=>{var te;(te=Q.current)==null||te.abort(),g([]),E(null),v(""),F.current=0,localStorage.removeItem(Od)},[]),fe=!(n.apiKey.length>0||n.baseUrl.includes("localhost"))||!i;return x.jsxs("div",{className:"flex flex-col h-full",children:[x.jsxs("div",{className:"flex gap-2 items-center pb-2 border-b border-border-light",children:[x.jsx("h3",{className:"m-0 text-sm font-semibold text-text-primary",children:"Preview Chat"}),i?x.jsx("span",{className:"text-[11px] text-success",children:"customPrompt loaded"}):x.jsx("span",{className:"text-[11px] text-warning",children:"Generate a prompt first"}),x.jsx("button",{type:"button",onClick:()=>f(te=>!te),className:"border-none bg-transparent text-primary cursor-pointer text-xs p-0 hover:text-primary-hover",children:o?"Hide Settings":"Settings"}),x.jsxs("span",{className:"text-[11px] text-text-muted",children:[(p==null?void 0:p.label)||"Custom"," / ",n.model,m&&" (override)"]}),x.jsx("div",{className:"flex-1"}),b.length>0&&x.jsx("button",{type:"button",onClick:B,className:"border-none bg-transparent text-primary cursor-pointer text-xs p-0 hover:text-primary-hover",children:"Clear"})]}),o&&x.jsxs("div",{className:"p-3 border border-border rounded-lg bg-surface-1 mb-2 flex flex-col gap-2.5",children:[x.jsxs("span",{className:"text-xs text-text-secondary font-medium",children:["Preview LLM Override",x.jsx("span",{className:"text-text-muted font-normal ml-1",children:"(leave empty to use Chat settings)"})]}),x.jsxs("div",{className:"flex gap-2",children:[x.jsxs("div",{className:"flex-1 flex flex-col gap-1",children:[x.jsx("span",{className:"text-[11px] text-text-secondary",children:"Model"}),x.jsx("input",{placeholder:u.model,value:a.model??"",onChange:te=>s({...a,model:te.target.value}),className:"px-2 py-1.5 border border-border rounded bg-surface-2 text-text-primary text-xs outline-none focus:border-primary"})]}),x.jsxs("div",{className:"flex-1 flex flex-col gap-1",children:[x.jsx("span",{className:"text-[11px] text-text-secondary",children:"API Key"}),x.jsx("input",{placeholder:u.apiKey?"••••••••":"Same as Chat",type:"password",value:a.apiKey??"",onChange:te=>s({...a,apiKey:te.target.value}),className:"px-2 py-1.5 border border-border rounded bg-surface-2 text-text-primary text-xs outline-none focus:border-primary"})]}),x.jsxs("div",{className:"flex-[2] flex flex-col gap-1",children:[x.jsx("span",{className:"text-[11px] text-text-secondary",children:"Base URL"}),x.jsx("input",{placeholder:u.baseUrl,value:a.baseUrl??"",onChange:te=>s({...a,baseUrl:te.target.value}),className:"px-2 py-1.5 border border-border rounded bg-surface-2 text-text-primary text-xs outline-none focus:border-primary"})]})]}),m&&x.jsx("button",{type:"button",onClick:()=>s({}),className:"self-start border-none bg-transparent text-primary cursor-pointer text-xs p-0 hover:text-primary-hover",children:"Reset to Chat settings"})]}),x.jsxs("div",{className:"flex-1 overflow-y-auto py-2 flex flex-col gap-3",children:[b.length===0&&x.jsx("div",{className:"text-text-muted text-sm text-center py-10 px-5",children:i?x.jsx(x.Fragment,{children:"Test your generated prompt here. Ask the LLM to create an interactive document and see MDMA components render live."}):x.jsxs(x.Fragment,{children:["Switch to the ",x.jsx("strong",{children:"Chat"})," tab and generate a prompt first, then come back here to test it."]})}),b.map(te=>x.jsx(g2,{role:te.role,content:te.content,ast:te.ast,store:te.store},te.id)),j&&x.jsx("div",{className:"text-xs text-error px-2",children:j}),x.jsx("div",{ref:L})]}),x.jsx(Mg,{value:_,onChange:v,onSend:ke,onStop:ve,isGenerating:O,disabled:fe,placeholder:"Describe the interactive document you need...",sendLabel:"Send"})]})}function _2({theme:i,onToggle:n}){return x.jsx("button",{type:"button",onClick:n,className:"p-2 rounded-lg border border-border bg-surface-1 hover:bg-surface-2 text-text-secondary hover:text-text-primary transition-colors text-sm",title:`Switch to ${i==="dark"?"light":"dark"} mode`,children:i==="dark"?"☀️":"🌙"})}function k2({steps:i,currentStep:n,onStepChange:a}){const s=i.findIndex(u=>u.id===n);return x.jsx("nav",{className:"flex lg:flex-col border-b lg:border-b-0 border-border-light",children:x.jsx("div",{className:"flex lg:flex-col w-full",children:i.map((u,o)=>x.jsxs("button",{type:"button",onClick:()=>a(u.id),className:`
515
+ flex items-center gap-2 px-4 py-3 text-sm font-medium transition-colors
516
+ border-b-2 lg:border-b-0 lg:border-l-2 flex-1 lg:flex-none
517
+ ${n===u.id?"border-primary text-primary bg-primary-light/50":"border-transparent text-text-secondary hover:text-text-primary hover:bg-surface-1"}
518
+ `,children:[x.jsx("span",{className:`
519
+ w-6 h-6 rounded-full flex items-center justify-center text-xs font-bold
520
+ ${o<s?"bg-success text-white":n===u.id?"bg-primary text-white":"bg-surface-3 text-text-secondary"}
521
+ `,children:o<s?"✓":u.icon}),x.jsx("span",{className:"hidden sm:inline",children:u.label})]},u.id))})})}function w2({domain:i}){const n=new Set;for(const a of i.flowSteps)for(const s of a.components)s.enabled&&n.add(s.type);return x.jsxs("div",{className:"flex flex-col gap-3",children:[x.jsx("h3",{className:"text-sm font-semibold text-text-primary m-0",children:"Summary"}),x.jsxs("div",{className:"text-xs text-text-secondary space-y-1",children:[x.jsxs("p",{children:[x.jsx("span",{className:"font-medium text-text-primary",children:"Flow:"})," ",i.name||"(not set)"]}),x.jsxs("p",{children:[x.jsx("span",{className:"font-medium text-text-primary",children:"Domain:"})," ",i.domain||"(not set)"]}),x.jsxs("p",{children:[x.jsx("span",{className:"font-medium text-text-primary",children:"Components:"})," ",n.size>0?[...n].join(", "):"(none)"]})]}),i.flowSteps.length>0&&x.jsxs("div",{className:"flex flex-col gap-1 mt-1",children:[x.jsxs("span",{className:"text-xs font-medium text-text-primary",children:["Conversation Flow (",i.flowSteps.length," step",i.flowSteps.length>1?"s":"",")"]}),i.flowSteps.map((a,s)=>{const u=a.components.filter(o=>o.enabled).map(o=>o.type);return x.jsxs("div",{className:"text-xs text-text-muted py-1 border-b border-border-light last:border-0",children:[x.jsxs("span",{className:"font-medium text-primary-text",children:[s+1,". ",a.label||`Step ${s+1}`]}),x.jsxs("span",{className:"ml-1 text-text-secondary",children:["(",a.triggerMode,")"]}),u.length>0&&x.jsxs("span",{className:"ml-1",children:["—"," ",u.join(", ")]})]},s)})]})]})}function A2({tabs:i,activeTab:n,onTabChange:a,indicators:s={}}){return x.jsx("div",{className:"flex border-b border-border-light px-4",children:i.map(u=>x.jsxs("button",{type:"button",onClick:()=>a(u),className:`
522
+ px-4 py-2.5 text-sm font-medium border-b-2 transition-colors capitalize
523
+ ${n===u?"border-primary text-primary":"border-transparent text-text-secondary hover:text-text-primary"}
524
+ `,children:[u,s[u]&&x.jsx("span",{className:`ml-1.5 w-1.5 h-1.5 rounded-full inline-block ${s[u]}`})]},u))})}const T2=`You are an expert MDMA prompt engineer. Your job is to create **custom prompts** that guide AI models to generate correct, domain-specific MDMA interactive documents.
525
+
526
+ ## Context
527
+
528
+ MDMA (Markdown Document with Mounted Applications) extends Markdown with interactive components defined in fenced \`mdma\` code blocks. **MDMA components use YAML syntax inside the fenced blocks — never JSON.** Users install MDMA libraries in their apps and use \`buildSystemPrompt({ customPrompt })\` to configure their AI chat. The \`buildSystemPrompt\` function automatically prepends the full MDMA specification (all component types, binding syntax, authoring rules). Your output is the \`customPrompt\` that layers on top.
529
+
530
+ **Your output will be concatenated AFTER the full MDMA spec.** Therefore you MUST NOT:
531
+ - Repeat the MDMA component schemas (they're already in the spec)
532
+ - Repeat the base authoring rules (unique IDs, sensitive flags, etc.)
533
+ - Include the self-check checklist (already provided)
534
+
535
+ **You MUST:**
536
+ - Define the domain context and purpose
537
+ - Specify which components to use and when
538
+ - Define **conversation flow** — a multi-step sequence describing when to generate MDMA components at each stage (e.g., Step 1: show form on keyword, Step 2: show approval gate after form submission)
539
+ - Provide domain-specific examples showing realistic content
540
+ - Define business rules, validation constraints, and workflow logic
541
+ - Specify which fields should be marked as sensitive
542
+ - Define the expected document structure and flow
543
+
544
+ ## What You Receive
545
+
546
+ The user will provide a configuration describing their needs:
547
+ - **Domain**: The business domain (e.g., finance, healthcare, engineering)
548
+ - **Description**: What the flow/document should accomplish
549
+ - **Selected components**: Which of the 9 MDMA types to use
550
+ - **Component configurations**: Field definitions, options, roles, etc.
551
+ - **Business rules**: Free-text constraints and requirements
552
+ - **Conversation flow**: An ordered list of steps, each with a trigger condition (immediate, keyword, form-submit, contextual) and which components to render at that point
553
+
554
+ ## Required Fields per Component
555
+
556
+ When writing domain examples with \`mdma\` blocks, every block MUST include all required fields for its type. Missing required fields cause validation errors.
557
+
558
+ | Component | Required fields (besides \`id\` and \`type\`) |
559
+ |-----------------|--------------------------------------------------------------|
560
+ | form | \`fields\` (array, each with \`name\`, \`type\`, \`label\`), \`onSubmit\` (action ID — renders submit button) |
561
+ | callout | \`content\` |
562
+ | button | \`text\` |
563
+ | approval-gate | \`title\` |
564
+ | tasklist | \`items\` (array, each with \`id\` and \`text\`) |
565
+ | table | \`columns\` (array, each with \`key\` and \`header\`), \`data\` |
566
+ | chart | \`data\` (pipe string: \`"Header1, Header2\\nVal1, Val2"\`) |
567
+ | webhook | \`url\`, \`trigger\` |
568
+ | thinking | \`content\` |
569
+
570
+ **Every form MUST include \`onSubmit\`** with a descriptive action ID (e.g., \`onSubmit: submit-kyc-form\`). Without it, the form renders without a submit button and users cannot submit their data.
571
+
572
+ Select fields use \`options\` as an array of objects: \`- label: "Display" value: key\`, NOT flat strings.
573
+ Approval gates use \`allowedRoles\` (NOT \`roles\`) for role restrictions.
574
+
575
+ ## Output Format
576
+
577
+ Generate a clean, well-structured custom prompt in plain text. Structure it as:
578
+
579
+ 1. **Role & Domain** — Set the domain context ("You are assisting with [domain] workflows...")
580
+ 2. **Conversation Flow** — Define the multi-step conversation flow. For each step, specify:
581
+ - What triggers it (user keyword, form submission, contextual condition, or immediate)
582
+ - Which components to render
583
+ - How the AI should respond at this step
584
+ The AI must follow these steps in order — after completing one step, wait for the appropriate trigger before moving to the next. Do NOT show all components at once unless the flow has a single step.
585
+ 3. **Document Purpose** — What the generated document should achieve
586
+ 4. **Component Instructions** — For each selected component, provide:
587
+ - When to include it
588
+ - What content/fields it should have
589
+ - Domain-specific field names and labels
590
+ - Which fields are sensitive (PII)
591
+ 5. **Workflow Logic** — How components relate to each other (bindings, action triggers, approval flows)
592
+ 6. **MANDATORY: Concrete MDMA Examples** — For EVERY form in the configuration, you MUST include a complete \`\`\`mdma code block example showing the exact form with all its fields. This is NOT optional. The AI that reads your prompt needs these examples to generate correct MDMA output. Examples MUST use **YAML syntax** inside fenced \`mdma\` code blocks (never JSON). Every example block MUST include all required fields for its component type — omitting required fields is a validation error. If the flow has 2 steps with 2 forms, include 2 separate form examples.
593
+ 7. **Constraints** — Things the AI must or must not do in this domain
594
+
595
+ ## Example
596
+
597
+ Given a configuration for a KYC (Know Your Customer) flow in finance with a 2-step conversation flow (Step 1: form on keyword trigger, Step 2: approval-gate + tasklist after form submission), you would generate:
598
+
599
+ ---
600
+
601
+ You are assisting with KYC (Know Your Customer) verification workflows in the financial services domain.
602
+
603
+ ### Document Purpose
604
+ Generate interactive KYC case review documents that collect applicant information, enforce compliance checks, and require dual approval before account activation.
605
+
606
+ ### Conversation Flow
607
+
608
+ **Step 1 — Collect Applicant Data**
609
+ When the user says "start KYC review", "new customer verification", or "verify identity", respond with a form to collect applicant information. Do NOT show the approval gate or tasklist yet.
610
+
611
+ Form fields: full name, date of birth, nationality, government ID number, ID type (passport/driver's license/national ID), residential address, email, phone.
612
+ - Mark as sensitive: government ID number, date of birth, residential address, email, phone
613
+ - All fields required except phone
614
+ - Use a select field for ID type with standard document options
615
+
616
+ **Step 2 — Compliance Review**
617
+ After the user submits the applicant form, show the compliance approval gate and verification checklist. Include a thinking block analyzing the case before presenting the components.
618
+
619
+ Approval Gate:
620
+ - Require 2 approvers with roles: compliance-officer, senior-analyst
621
+ - Require a reason on denial
622
+ - Title: "KYC Compliance Approval"
623
+
624
+ Tasklist:
625
+ - Items: identity document verified, address proof verified, PEP screening completed, sanctions list checked, source of funds verified
626
+ - All items required
627
+
628
+ Include a callout with variant "warning" if the case involves a PEP (Politically Exposed Person).
629
+
630
+ ### Domain Example
631
+
632
+ Here is an example of a correctly structured MDMA document section for a KYC review:
633
+
634
+ \`\`\`\`
635
+ ## KYC Case Review
636
+
637
+ Please complete the applicant information below:
638
+
639
+ \`\`\`mdma
640
+ type: form
641
+ id: kyc-applicant-form
642
+ onSubmit: submit-kyc-form
643
+ fields:
644
+ - name: full_name
645
+ type: text
646
+ label: Full Legal Name
647
+ required: true
648
+ - name: date_of_birth
649
+ type: date
650
+ label: Date of Birth
651
+ required: true
652
+ sensitive: true
653
+ - name: nationality
654
+ type: text
655
+ label: Nationality
656
+ required: true
657
+ - name: id_type
658
+ type: select
659
+ label: ID Document Type
660
+ required: true
661
+ options:
662
+ - label: Passport
663
+ value: passport
664
+ - label: "Driver's License"
665
+ value: drivers-license
666
+ - label: National ID
667
+ value: national-id
668
+ - name: id_number
669
+ type: text
670
+ label: Government ID Number
671
+ required: true
672
+ sensitive: true
673
+ \`\`\`
674
+
675
+ \`\`\`mdma
676
+ type: approval-gate
677
+ id: kyc-compliance-approval
678
+ title: KYC Compliance Approval
679
+ allowedRoles:
680
+ - compliance-officer
681
+ - senior-analyst
682
+ requiredApprovers: 2
683
+ requireReason: true
684
+ \`\`\`
685
+
686
+ \`\`\`mdma
687
+ type: callout
688
+ id: pep-warning
689
+ variant: warning
690
+ title: PEP Flag Detected
691
+ content: "This applicant has been flagged as a Politically Exposed Person (PEP). Enhanced due diligence is required before approval."
692
+ dismissible: false
693
+ \`\`\`
694
+ \`\`\`\`
695
+
696
+ ### Constraints
697
+ - Always include a thinking block analyzing the case complexity
698
+ - Never display raw ID numbers in the document text
699
+ - Use formal, compliance-appropriate language
700
+
701
+ ---
702
+
703
+ ## CRITICAL: Component Scope Rule
704
+
705
+ **ONLY include components that appear under "Selected Components" in the user's configuration.** The description and business rules may mention other component types as context — IGNORE THEM. If the user selected only "form" and "thinking", your output must ONLY contain instructions and examples for form and thinking. Do not add approval-gate, tasklist, webhook, button, table, chart, or callout unless they are explicitly listed under "Selected Components".
706
+
707
+ This is the most important rule. Violating it produces a broken prompt that generates unwanted components.
708
+
709
+ ## Important Rules
710
+
711
+ 1. **Be specific** — Use real field names, labels, and options relevant to the domain. Don't use generic placeholders.
712
+ 2. **Strict component scope** — NEVER include components not listed under "Selected Components". The description and business rules provide context, not a component wishlist. If a business rule mentions "approval required" but approval-gate is not in Selected Components, reference the rule in prose but do NOT add an approval-gate component.
713
+ 3. **Be complete** — Cover all selected components with detailed instructions.
714
+ 4. **Be concise** — The prompt should be focused and actionable, not a tutorial.
715
+ 5. **Respect the architecture** — Your output is a \`customPrompt\`, not a standalone system prompt. Never include MDMA spec details that are already in the base prompt.
716
+ 6. **Use YAML, never JSON** — All domain examples with fenced \`mdma\` code blocks MUST use YAML syntax. MDMA components are always defined in YAML. Never use JSON objects like \`{"type": "form", ...}\` in examples.
717
+ 7. **Respect flow ordering** — When the configuration defines a multi-step conversation flow, your output MUST instruct the AI to present components in the defined step order, waiting for each trigger before proceeding to the next step. Do NOT show all components at once unless the flow has a single step. Each step's trigger must be clearly communicated so the AI knows when to advance.
718
+ 8. **Always include MDMA examples** — Your output MUST contain at least one \`\`\`mdma code block for every form defined in the configuration. A prompt without concrete MDMA examples is incomplete — the AI needs them to generate correct output. If there are 2 forms across 2 steps, include 2 form code blocks.
719
+ `;function E2(i){switch(i.triggerMode){case"immediate":return"Immediately when the conversation starts";case"keyword":return i.trigger?`When the user says: ${i.trigger}`:"When the user says a specific keyword or phrase";case"form-submit":return"After the user submits the form/component from the previous step";case"contextual":return i.trigger||"Based on conversation context"}}function N2(i){var a,s,u;const n=[];if(n.push(` - **${i.type}**`),i.type==="form"&&((a=i.form)!=null&&a.fields.length)){n.push(" Fields:");for(const o of i.form.fields)n.push(` - ${o.name} (${o.type}, label: "${o.label}", required: ${o.required}, sensitive: ${o.sensitive})`)}if(i.type==="approval-gate"&&i.approvalGate){const o=i.approvalGate;n.push(` Roles: ${o.roles.join(", ")||"(none)"}`),n.push(` Required approvers: ${o.requiredApprovers}`),n.push(` Require reason on denial: ${o.requireReason}`)}if(i.type==="tasklist"&&((s=i.tasklist)!=null&&s.items.length)){n.push(" Items:");for(const o of i.tasklist.items)n.push(` - ${o}`)}if(i.type==="table"&&((u=i.table)!=null&&u.columns.length)){n.push(" Columns:");for(const o of i.table.columns)n.push(` - ${o.key}: "${o.header}"`)}return n}function C2(i){const n=["## User Configuration","",`**Flow Name:** ${i.name||"(not set)"}`,`**Domain:** ${i.domain||"(not set)"}`,`**Description:** ${i.description||"(not set)"}`];if(i.businessRules&&n.push(`**Business Rules:** ${i.businessRules}`),i.flowSteps.length>0){n.push("","**Conversation Flow:**","");for(let u=0;u<i.flowSteps.length;u++){const o=i.flowSteps[u];n.push(`Step ${u+1} — ${o.label||`Step ${u+1}`}`),n.push(` Trigger: ${E2(o)}`);const f=o.components.filter(h=>h.enabled);if(f.length>0){n.push(" Components:");for(const h of f)n.push(...N2(h))}o.description&&n.push(` ${o.description}`),n.push("")}const a=new Set;for(const u of i.flowSteps)for(const o of u.components)o.enabled&&a.add(o.type);a.size>0&&n.push(`**All Component Types Used:** ${[...a].join(", ")}`,"");let s=0;for(const u of i.flowSteps)s+=u.components.filter(o=>o.enabled&&o.type==="form").length;s>0&&n.push(`**IMPORTANT:** Your output MUST include concrete \`\`\`mdma code block examples for all ${s} form(s) defined above. Each form must include onSubmit and all specified fields.`,"")}return n.join(`
720
+ `)}function O2(i){const[n,a]=ne.useState({name:"",domain:"",description:"",businessRules:"",flowSteps:[{label:"Step 1",triggerMode:"immediate",trigger:"",components:[],description:""}]}),[s,u]=ne.useState([]),[o,f]=ne.useState(""),[h,p]=ne.useState(!1),[m,b]=ne.useState(null),g=ne.useRef(null),_=ne.useCallback(async j=>{b(null),p(!0),g.current=new AbortController;const E=C2(n),H=[...s,{role:"user",content:j?`${j}
721
+
722
+ ${E}`:`Generate a custom prompt based on this configuration:
723
+
724
+ ${E}`}];u(H);const I=[{role:"system",content:T2},...H];try{let Q="";try{for await(const F of Cg(i,I,g.current.signal))Q+=F,f(Q)}catch{Q=await Og(i,I,g.current.signal),f(Q)}u(F=>[...F,{role:"assistant",content:Q}])}catch(Q){Q instanceof Error&&Q.name!=="AbortError"&&b(Q.message)}finally{p(!1)}},[n,s,i]),v=ne.useCallback(()=>{var j;(j=g.current)==null||j.abort()},[]),O=ne.useCallback(()=>{u([]),f(""),b(null)},[]),w=ne.useCallback(j=>{a(E=>({...E,flowSteps:j}))},[]);return{domain:n,setDomain:a,updateFlowSteps:w,messages:s,generatedPrompt:o,isGenerating:h,error:m,generate:_,stop:v,reset:O}}function M2(){const i=localStorage.getItem("mdma-builder-theme");return i==="light"||i==="dark"?i:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function j2(){const[i,n]=ne.useState(M2);ne.useEffect(()=>{document.documentElement.classList.toggle("dark",i==="dark")},[i]);const a=ne.useCallback(u=>{n(u),localStorage.setItem("mdma-builder-theme",u)},[]),s=ne.useCallback(()=>{a(i==="dark"?"light":"dark")},[i,a]);return{theme:i,setTheme:a,toggle:s}}const Ng=[{domain:{name:"contact-form",domain:"support",description:"Collect contact info, then gather feedback after the issue is resolved.",businessRules:"Email is sensitive.",flowSteps:[{label:"Contact info",triggerMode:"immediate",trigger:"",description:"",components:[{type:"form",enabled:!0,form:{fields:[{name:"name",type:"text",label:"Name",required:!0,sensitive:!1},{name:"email",type:"email",label:"Email",required:!0,sensitive:!0},{name:"message",type:"textarea",label:"Message",required:!0,sensitive:!1}]}}]},{label:"Feedback",triggerMode:"form-submit",trigger:"",description:"",components:[{type:"form",enabled:!0,form:{fields:[{name:"rating",type:"select",label:"Rating",required:!0,sensitive:!1},{name:"comments",type:"textarea",label:"Comments",required:!1,sensitive:!1}]}}]}]}},{domain:{name:"bug-report",domain:"engineering",description:"Report a bug, then collect repro steps after initial triage.",businessRules:"Reporter email is sensitive.",flowSteps:[{label:"Bug details",triggerMode:"keyword",trigger:"bug, report bug, found a bug",description:"",components:[{type:"form",enabled:!0,form:{fields:[{name:"title",type:"text",label:"Bug Title",required:!0,sensitive:!1},{name:"severity",type:"select",label:"Severity",required:!0,sensitive:!1},{name:"reporter_email",type:"email",label:"Reporter Email",required:!0,sensitive:!0}]}}]},{label:"Repro steps",triggerMode:"form-submit",trigger:"",description:"",components:[{type:"form",enabled:!0,form:{fields:[{name:"steps",type:"textarea",label:"Steps to Reproduce",required:!0,sensitive:!1},{name:"expected",type:"textarea",label:"Expected Behavior",required:!0,sensitive:!1},{name:"actual",type:"textarea",label:"Actual Behavior",required:!0,sensitive:!1}]}}]}]}},{domain:{name:"event-rsvp",domain:"events",description:"RSVP for an event, then collect dietary preferences.",businessRules:"Phone number is sensitive.",flowSteps:[{label:"RSVP",triggerMode:"keyword",trigger:"rsvp, register, sign up",description:"",components:[{type:"form",enabled:!0,form:{fields:[{name:"attendee_name",type:"text",label:"Name",required:!0,sensitive:!1},{name:"phone",type:"text",label:"Phone",required:!1,sensitive:!0},{name:"guests",type:"number",label:"Number of Guests",required:!0,sensitive:!1}]}}]},{label:"Preferences",triggerMode:"form-submit",trigger:"",description:"",components:[{type:"form",enabled:!0,form:{fields:[{name:"dietary",type:"select",label:"Dietary Preference",required:!1,sensitive:!1},{name:"allergies",type:"text",label:"Allergies",required:!1,sensitive:!1}]}}]}]}},{domain:{name:"leave-request",domain:"hr",description:"Submit a leave request, then manager adds review notes.",businessRules:"No sensitive fields.",flowSteps:[{label:"Request",triggerMode:"immediate",trigger:"",description:"",components:[{type:"form",enabled:!0,form:{fields:[{name:"employee_name",type:"text",label:"Employee Name",required:!0,sensitive:!1},{name:"leave_type",type:"select",label:"Leave Type",required:!0,sensitive:!1},{name:"start_date",type:"date",label:"Start Date",required:!0,sensitive:!1},{name:"end_date",type:"date",label:"End Date",required:!0,sensitive:!1}]}}]},{label:"Manager review",triggerMode:"form-submit",trigger:"",description:"",components:[{type:"form",enabled:!0,form:{fields:[{name:"reviewer",type:"text",label:"Reviewer Name",required:!0,sensitive:!1},{name:"decision",type:"select",label:"Decision",required:!0,sensitive:!1},{name:"notes",type:"textarea",label:"Notes",required:!1,sensitive:!1}]}}]}]}},{domain:{name:"order-return",domain:"e-commerce",description:"Request a product return, then provide shipping details.",businessRules:"Address is sensitive.",flowSteps:[{label:"Return request",triggerMode:"keyword",trigger:"return, refund, send back",description:"",components:[{type:"form",enabled:!0,form:{fields:[{name:"order_id",type:"text",label:"Order ID",required:!0,sensitive:!1},{name:"reason",type:"select",label:"Return Reason",required:!0,sensitive:!1},{name:"item_condition",type:"select",label:"Item Condition",required:!0,sensitive:!1}]}}]},{label:"Shipping details",triggerMode:"form-submit",trigger:"",description:"",components:[{type:"form",enabled:!0,form:{fields:[{name:"return_address",type:"textarea",label:"Return Address",required:!0,sensitive:!0},{name:"pickup_date",type:"date",label:"Preferred Pickup Date",required:!1,sensitive:!1}]}}]}]}}];function D2(){const i=Math.floor(Math.random()*Ng.length);return Ng[i]}const Ts=[{id:"domain",label:"Domain",icon:"1"},{id:"flow",label:"Flow",icon:"2"},{id:"generate",label:"Generate",icon:"3"}],z2=["chat","output","preview"];function R2(){const{theme:i,toggle:n}=j2(),[a,s]=ne.useState(()=>{const H=localStorage.getItem("mdma-builder-llm-config");return H?JSON.parse(H):M1}),[u,o]=ne.useState(()=>{const H=localStorage.getItem("mdma-builder-preview-llm-override");return H?JSON.parse(H):{}}),f=H=>{s(H),localStorage.setItem("mdma-builder-llm-config",JSON.stringify(H))},h=H=>{o(H),localStorage.setItem("mdma-builder-preview-llm-override",JSON.stringify(H))},p={...a,...Object.fromEntries(Object.entries(u).filter(([,H])=>H))},m=O2(a),[b,g]=ne.useState("domain"),[_,v]=ne.useState("chat"),O=()=>{const H=D2();m.setDomain(H.domain)},w=Ts.findIndex(H=>H.id===b),j=ne.useMemo(()=>m.generatedPrompt?{output:"bg-success",preview:"bg-primary"}:{},[m.generatedPrompt]),E={domain:x.jsx(b1,{domain:m.domain,onChange:m.setDomain,onSample:O}),flow:x.jsx(w1,{flowSteps:m.domain.flowSteps,onChange:m.updateFlowSteps}),generate:x.jsx(w2,{domain:m.domain})};return x.jsxs("div",{className:"flex flex-col h-screen bg-surface-0 text-text-primary",children:[x.jsxs("header",{className:"flex items-center justify-between px-5 py-3 border-b border-border-light",children:[x.jsxs("div",{className:"flex items-center gap-3",children:[x.jsxs("h1",{className:"text-lg font-bold m-0",children:[x.jsx("span",{className:"text-primary",children:"MDMA"})," Prompt Builder"]}),x.jsx("span",{className:"text-xs text-text-muted hidden sm:inline",children:"Generate custom prompts for your MDMA-powered chat"})]}),x.jsx(_2,{theme:i,onToggle:n})]}),x.jsxs("div",{className:"flex flex-1 overflow-hidden flex-col lg:flex-row",children:[x.jsxs("aside",{className:"w-full lg:w-[400px] border-b lg:border-b-0 lg:border-r border-border-light overflow-y-auto flex-shrink-0 flex flex-col",children:[x.jsx(k2,{steps:Ts,currentStep:b,onStepChange:g}),x.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:E[b]}),x.jsxs("div",{className:"flex gap-2 p-4 border-t border-border-light",children:[x.jsx("button",{type:"button",onClick:()=>{const H=Ts[w-1];H&&g(H.id)},disabled:w===0,className:"px-4 py-2 text-sm rounded-lg border border-border bg-surface-1 text-text-secondary hover:bg-surface-2 disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:"Back"}),x.jsx("button",{type:"button",onClick:()=>{const H=Ts[w+1];H&&g(H.id)},disabled:w===Ts.length-1,className:"px-4 py-2 text-sm rounded-lg border border-primary bg-primary-light text-primary-text font-medium hover:bg-primary hover:text-white disabled:opacity-40 disabled:cursor-not-allowed transition-colors flex-1",children:"Next"})]})]}),x.jsxs("main",{className:"flex-1 flex flex-col overflow-hidden",children:[x.jsx(A2,{tabs:z2,activeTab:_,onTabChange:v,indicators:j}),x.jsx("div",{className:"flex-1 p-4 overflow-hidden flex flex-col",children:_==="chat"?x.jsx(z1,{messages:m.messages,isGenerating:m.isGenerating,error:m.error,onGenerate:m.generate,onStop:m.stop,onReset:m.reset,config:a,onConfigChange:f}):_==="output"?x.jsx(R1,{prompt:m.generatedPrompt,isGenerating:m.isGenerating}):x.jsx(S2,{customPrompt:m.generatedPrompt,llmConfig:p,llmOverride:u,onOverrideChange:h,chatConfig:a})})]})]})]})}g1.createRoot(document.getElementById("root")).render(x.jsx(ne.StrictMode,{children:x.jsx(R2,{})}));